diff --git a/public/cdn/avue-form-design/index.umd.min.js b/public/cdn/avue-form-design/index.umd.min.js index d8d8e94..e59e319 100644 --- a/public/cdn/avue-form-design/index.umd.min.js +++ b/public/cdn/avue-form-design/index.umd.min.js @@ -5,7 +5,7 @@ * @author owenm * @license MIT */ -function n(e){return n="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},n(e)}function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(){return s=Object.assign||function(e){for(var t=1;t=0||(o[i]=e[i]);return o}function l(e,t){if(null==e)return{};var i,n,o=a(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i])}return o}function c(e){return d(e)||h(e)||u()}function d(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(i){return!1}return!1}}function L(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function k(e,t,i,n){if(e){i=i||document;do{if(null!=t&&(">"===t[0]?e.parentNode===i&&x(e,t):x(e,t))||n&&e===i)return e;if(e===i)break}while(e=L(e))}return null}var E,D=/\s+/g;function N(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(D," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(D," ")}}function I(e,t,i){var n=e&&e.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),void 0===t?i:i[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=i+("string"===typeof i?"":"px")}}function T(e,t){var i="";if("string"===typeof e)i=e;else do{var n=I(e,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(i)}function M(e,t,i){if(e){var n=e.getElementsByTagName(t),o=0,s=n.length;if(i)for(;o=s:o<=s,!r)return n;if(n===O())break;n=H(n,!1)}return!1}function P(e,t,i){var n=0,o=0,s=e.children;while(o2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,o=l(i,["evt"]);ie.pluginEvent.bind(Qe)(e,t,r({dragEl:re,parentEl:ae,ghostEl:le,rootEl:ce,nextEl:de,lastDownEl:he,cloneEl:ue,cloneHidden:ge,dragStarted:ke,putSortable:ve,activeSortable:Qe.active,originalEvent:n,oldIndex:fe,oldDraggableIndex:pe,newIndex:me,newDraggableIndex:_e,hideGhostForTarget:Ge,unhideGhostForTarget:Ye,cloneNowHidden:function(){ge=!0},cloneNowShown:function(){ge=!1},dispatchSortableEvent:function(e){se({sortable:t,name:e,originalEvent:n})}},o))};function se(e){ne(r({putSortable:ve,cloneEl:ue,targetEl:re,rootEl:ce,oldIndex:fe,oldDraggableIndex:pe,newIndex:me,newDraggableIndex:_e},e))}var re,ae,le,ce,de,he,ue,ge,fe,me,pe,_e,be,ve,we,Ce,ye,Se,xe,Le,ke,Ee,De,Ne,Ie,Te=!1,Me=!1,Oe=[],Ae=!1,Re=!1,Pe=[],Fe=!1,We=[],Be="undefined"!==typeof document,Ve=v,He=p||m?"cssFloat":"float",ze=Be&&!w&&!v&&"draggable"in document.createElement("div"),Ue=function(){if(Be){if(m)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Ke=function(e,t){var i=I(e),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=P(e,0,t),s=P(e,1,t),r=o&&I(o),a=s&&I(s),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+A(o).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+A(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&r["float"]&&"none"!==r["float"]){var d="left"===r["float"]?"left":"right";return!s||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return o&&("block"===r.display||"flex"===r.display||"table"===r.display||"grid"===r.display||l>=n&&"none"===i[He]||s&&"none"===i[He]&&l+c>n)?"vertical":"horizontal"},je=function(e,t,i){var n=i?e.left:e.top,o=i?e.right:e.bottom,s=i?e.width:e.height,r=i?t.left:t.top,a=i?t.right:t.bottom,l=i?t.width:t.height;return n===r||o===a||n+s/2===r+l/2},qe=function(e,t){var i;return Oe.some((function(n){if(!F(n)){var o=A(n),s=n[X].options.emptyInsertThreshold,r=e>=o.left-s&&e<=o.right+s,a=t>=o.top-s&&t<=o.bottom+s;return s&&r&&a?i=n:void 0}})),i},$e=function(e){function t(e,i){return function(n,o,s,r){var a=n.options.group.name&&o.options.group.name&&n.options.group.name===o.options.group.name;if(null==e&&(i||a))return!0;if(null==e||!1===e)return!1;if(i&&"clone"===e)return e;if("function"===typeof e)return t(e(n,o,s,r),i)(n,o,s,r);var l=(i?n:o).options.group.name;return!0===e||"string"===typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var i={},o=e.group;o&&"object"==n(o)||(o={name:o}),i.name=o.name,i.checkPull=t(o.pull,!0),i.checkPut=t(o.put),i.revertClone=o.revertClone,e.group=i},Ge=function(){!Ue&&le&&I(le,"display","none")},Ye=function(){!Ue&&le&&I(le,"display","")};Be&&document.addEventListener("click",(function(e){if(Me)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Me=!1,!1}),!0);var Xe=function(e){if(re){e=e.touches?e.touches[0]:e;var t=qe(e.clientX,e.clientY);if(t){var i={};for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);i.target=i.rootEl=t,i.preventDefault=void 0,i.stopPropagation=void 0,t[X]._onDragOver(i)}}},Ze=function(e){re&&re.parentNode[X]._isOutsideThisEl(e.target)};function Qe(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=s({},t),e[X]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ke(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Qe.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var n in ie.initializePlugins(this,e,i),i)!(n in t)&&(t[n]=i[n]);for(var o in $e(t),this)"_"===o.charAt(0)&&"function"===typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!t.forceFallback&&ze,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?y(e,"pointerdown",this._onTapStart):(y(e,"mousedown",this._onTapStart),y(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(y(e,"dragover",this),y(e,"dragenter",this)),Oe.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,Z())}function Je(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function et(e,t,i,n,o,s,r,a){var l,c,d=e[X],h=d.options.onMove;return!window.CustomEvent||m||p?(l=document.createEvent("Event"),l.initEvent("move",!0,!0)):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=i,l.draggedRect=n,l.related=o||t,l.relatedRect=s||A(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),h&&(c=h.call(d,l,r)),c}function tt(e){e.draggable=!1}function it(){Fe=!1}function nt(e,t,i){var n=A(F(i.el,i.options.draggable)),o=10;return t?e.clientX>n.right+o||e.clientX<=n.right&&e.clientY>n.bottom&&e.clientX>=n.left:e.clientX>n.right&&e.clientY>n.top||e.clientX<=n.right&&e.clientY>n.bottom+o}function ot(e,t,i,n,o,s,r,a){var l=n?e.clientY:e.clientX,c=n?i.height:i.width,d=n?i.top:i.left,h=n?i.bottom:i.right,u=!1;if(!r)if(a&&Ned+c*s/2:lh-Ne)return-De}else if(l>d+c*(1-o)/2&&lh-c*s/2)?l>d+c/2?1:-1:0}function st(e){return W(re)=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){re&&tt(re),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;S(e,"mouseup",this._disableDelayedDrag),S(e,"touchend",this._disableDelayedDrag),S(e,"touchcancel",this._disableDelayedDrag),S(e,"mousemove",this._delayedDragTouchMoveHandler),S(e,"touchmove",this._delayedDragTouchMoveHandler),S(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?y(document,"pointermove",this._onTouchMove):y(document,t?"touchmove":"mousemove",this._onTouchMove):(y(re,"dragend",this),y(ce,"dragstart",this._onDragStart));try{document.selection?lt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(i){}},_dragStarted:function(e,t){if(Te=!1,ce&&re){oe("dragStarted",this,{evt:t}),this.nativeDraggable&&y(document,"dragover",Ze);var i=this.options;!e&&N(re,i.dragClass,!1),N(re,i.ghostClass,!0),Qe.active=this,e&&this._appendGhost(),se({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Ce){this._lastX=Ce.clientX,this._lastY=Ce.clientY,Ge();var e=document.elementFromPoint(Ce.clientX,Ce.clientY),t=e;while(e&&e.shadowRoot){if(e=e.shadowRoot.elementFromPoint(Ce.clientX,Ce.clientY),e===t)break;t=e}if(re.parentNode[X]._isOutsideThisEl(e),t)do{if(t[X]){var i=void 0;if(i=t[X]._onDragOver({clientX:Ce.clientX,clientY:Ce.clientY,target:e,rootEl:t}),i&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Ye()}},_onTouchMove:function(e){if(we){var t=this.options,i=t.fallbackTolerance,n=t.fallbackOffset,o=e.touches?e.touches[0]:e,s=le&&T(le,!0),r=le&&s&&s.a,a=le&&s&&s.d,l=Ve&&Ie&&B(Ie),c=(o.clientX-we.clientX+n.x)/(r||1)+(l?l[0]-Pe[0]:0)/(r||1),d=(o.clientY-we.clientY+n.y)/(a||1)+(l?l[1]-Pe[1]:0)/(a||1);if(!Qe.active&&!Te){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(se({rootEl:ae,name:"add",toEl:ae,fromEl:ce,originalEvent:e}),se({sortable:this,name:"remove",toEl:ae,originalEvent:e}),se({rootEl:ae,name:"sort",toEl:ae,fromEl:ce,originalEvent:e}),se({sortable:this,name:"sort",toEl:ae,originalEvent:e})),ve&&ve.save()):me!==fe&&me>=0&&(se({sortable:this,name:"update",toEl:ae,originalEvent:e}),se({sortable:this,name:"sort",toEl:ae,originalEvent:e})),Qe.active&&(null!=me&&-1!==me||(me=fe,_e=pe),se({sortable:this,name:"end",toEl:ae,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){oe("nulling",this),ce=re=ae=le=de=ue=he=ge=we=Ce=ke=me=_e=fe=pe=Ee=De=ve=be=Qe.dragged=Qe.ghost=Qe.clone=Qe.active=null,We.forEach((function(e){e.checked=!0})),We.length=ye=Se=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":re&&(this._onDragOver(e),Je(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e,t=[],i=this.el.children,n=0,o=i.length,s=this.options;n1&&(Ot.forEach((function(e){n.addAnimationState({target:e,rect:Pt?A(e):o}),Y(e),e.fromRect=o,t.removeAnimationState(e)})),Pt=!1,Bt(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(e){var t=e.sortable,i=e.isOwner,n=e.insertion,o=e.activeSortable,s=e.parentEl,r=e.putSortable,a=this.options;if(n){if(i&&o._hideClone(),Rt=!1,a.animation&&Ot.length>1&&(Pt||!i&&!o.options.sort&&!r)){var l=A(It,!1,!0,!0);Ot.forEach((function(e){e!==It&&(G(e,l),s.appendChild(e))})),Pt=!0}if(!i)if(Pt||Ht(),Ot.length>1){var c=Mt;o._showClone(t),o.options.animation&&!Mt&&c&&At.forEach((function(e){o.addAnimationState({target:e,rect:Tt}),e.fromRect=Tt,e.thisAnimationDuration=null}))}else o._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,i=e.isOwner,n=e.activeSortable;if(Ot.forEach((function(e){e.thisAnimationDuration=null})),n.options.animation&&!i&&n.multiDrag.isMultiDrag){Tt=s({},t);var o=T(It,!0);Tt.top-=o.f,Tt.left-=o.e}},dragOverAnimationComplete:function(){Pt&&(Pt=!1,Ht())},drop:function(e){var t=e.originalEvent,i=e.rootEl,n=e.parentEl,o=e.sortable,s=e.dispatchSortableEvent,r=e.oldIndex,a=e.putSortable,l=a||this.sortable;if(t){var c=this.options,d=n.children;if(!Ft)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),N(It,c.selectedClass,!~Ot.indexOf(It)),~Ot.indexOf(It))Ot.splice(Ot.indexOf(It),1),Dt=null,ne({sortable:o,rootEl:i,name:"deselect",targetEl:It,originalEvt:t});else{if(Ot.push(It),ne({sortable:o,rootEl:i,name:"select",targetEl:It,originalEvt:t}),t.shiftKey&&Dt&&o.el.contains(Dt)){var h,u,g=W(Dt),f=W(It);if(~g&&~f&&g!==f)for(f>g?(u=g,h=f):(u=f,h=g+1);u1){var m=A(It),p=W(It,":not(."+this.options.selectedClass+")");if(!Rt&&c.animation&&(It.thisAnimationDuration=null),l.captureAnimationState(),!Rt&&(c.animation&&(It.fromRect=m,Ot.forEach((function(e){if(e.thisAnimationDuration=null,e!==It){var t=Pt?A(e):m;e.fromRect=t,l.addAnimationState({target:e,rect:t})}}))),Ht(),Ot.forEach((function(e){d[p]?n.insertBefore(e,d[p]):n.appendChild(e),p++})),r===W(It))){var _=!1;Ot.forEach((function(e){e.sortableIndex===W(e)||(_=!0)})),_&&s("update")}Ot.forEach((function(e){Y(e)})),l.animateAll()}Nt=l}(i===n||a&&"clone"!==a.lastPutMode)&&At.forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))}},nullingGlobal:function(){this.isMultiDrag=Ft=!1,At.length=0},destroyGlobal:function(){this._deselectMultiDrag(),S(document,"pointerup",this._deselectMultiDrag),S(document,"mouseup",this._deselectMultiDrag),S(document,"touchend",this._deselectMultiDrag),S(document,"keydown",this._checkKeyDown),S(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(("undefined"===typeof Ft||!Ft)&&Nt===this.sortable&&(!e||!k(e.target,this.options.draggable,this.sortable.el,!1))&&(!e||0===e.button))while(Ot.length){var t=Ot[0];N(t,this.options.selectedClass,!1),Ot.shift(),ne({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},s(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[X];t&&t.options.multiDrag&&!~Ot.indexOf(e)&&(Nt&&Nt!==t&&(Nt.multiDrag._deselectMultiDrag(),Nt=t),N(e,t.options.selectedClass,!0),Ot.push(e))},deselect:function(e){var t=e.parentNode[X],i=Ot.indexOf(e);t&&t.options.multiDrag&&~i&&(N(e,t.options.selectedClass,!1),Ot.splice(i,1))}},eventProperties:function(){var e=this,t=[],i=[];return Ot.forEach((function(n){var o;t.push({multiDragElement:n,index:n.sortableIndex}),o=Pt&&n!==It?-1:Pt?W(n,":not(."+e.options.selectedClass+")"):W(n),i.push({multiDragElement:n,index:o})})),{items:c(Ot),clones:[].concat(At),oldIndicies:t,newIndicies:i}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),"ctrl"===e?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function Bt(e,t){Ot.forEach((function(i,n){var o=t.children[i.sortableIndex+(e?Number(n):0)];o?t.insertBefore(i,o):t.appendChild(i)}))}function Vt(e,t){At.forEach((function(i,n){var o=t.children[i.sortableIndex+(e?Number(n):0)];o?t.insertBefore(i,o):t.appendChild(i)}))}function Ht(){Ot.forEach((function(e){e!==It&&e.parentNode&&e.parentNode.removeChild(e)}))}Qe.mount(new bt),Qe.mount(Lt,xt),t["default"]=Qe},7979:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".codicon-wrench-subaction{opacity:.5}@-webkit-keyframes codicon-spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes codicon-spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.codicon-loading.codicon-modifier-spin,.codicon-sync.codicon-modifier-spin{-webkit-animation:codicon-spin 1.5s steps(30) infinite;animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{-webkit-animation-duration:1s!important;animation-duration:1s!important;-webkit-animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}",""]),e.exports=t},"7d86":function(e,t,i){var n=i("e244"),o=i("69f1"),s=i("fe32"),r=i("72c7"),a=i("9550"),l=i("35d6"),c=l.get,d=l.enforce,h=String(String).split("String");(e.exports=function(e,t,i,a){var l,c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,g=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof t||s(i,"name")||o(i,"name",t),l=d(i),l.source||(l.source=h.join("string"==typeof t?t:""))),e!==n?(c?!g&&e[t]&&(u=!0):delete e[t],u?e[t]=i:o(e,t,i)):u?e[t]=i:r(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||a(this)}))},"7e50":function(e,t,i){var n=i("83ec"),o=i("ac97"),s=i("45ad"),r=i("42b1").f,a=i("55ab"),l=o((function(){r(1)})),c=!a||l;n({target:"Object",stat:!0,forced:c,sham:!a},{getOwnPropertyDescriptor:function(e,t){return r(s(e),t)}})},"7eca":function(e,t,i){"use strict";function n(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,i){const n=i[0];return"undefined"!==typeof t[n]?t[n]:e})),i}function o(e,t,...i){return n(t,i)}i.r(t),i.d(t,"CancellationTokenSource",(function(){return BF})),i.d(t,"Emitter",(function(){return VF})),i.d(t,"KeyCode",(function(){return HF})),i.d(t,"KeyMod",(function(){return zF})),i.d(t,"Position",(function(){return UF})),i.d(t,"Range",(function(){return KF})),i.d(t,"Selection",(function(){return jF})),i.d(t,"SelectionDirection",(function(){return qF})),i.d(t,"MarkerSeverity",(function(){return $F})),i.d(t,"MarkerTag",(function(){return GF})),i.d(t,"Uri",(function(){return YF})),i.d(t,"Token",(function(){return XF})),i.d(t,"editor",(function(){return ZF})),i.d(t,"languages",(function(){return QF}));var s=i("1cb4");const r="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function a(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of r)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}const l=a();function c(e){let t=l;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 d={maxLen:1e3,windowSize:15,timeBudget:150};function h(e,t,i,n,o=d){if(i.length>o.maxLen){let s=e-o.maxLen/2;return s<0?s=0:n+=s,i=i.substring(s,e+o.maxLen/2),h(e,t,i,n,o)}const s=Date.now(),r=e-1-n;let a=-1,l=null;for(let c=1;;c++){if(Date.now()-s>=o.timeBudget)break;const e=r-o.windowSize*c;t.lastIndex=Math.max(0,e);const n=u(t,i,r,a);if(!n&&l)break;if(l=n,e<=0)break;a=e}if(l){let e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function u(e,t,i,n){let o;while(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}const g=8;class f{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class m{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class p{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class _{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}compute(e,t,i){return i}}class b{constructor(e,t=null){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0,this.deps=t}validate(e){return this.defaultValue}}class v{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}validate(e){return"undefined"===typeof e?this.defaultValue:e}compute(e,t,i){return i}}function w(e,t){return"undefined"===typeof e?t:"false"!==e&&Boolean(e)}class C extends v{constructor(e,t,i,n){"undefined"!==typeof n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return w(e,this.defaultValue)}}class y extends v{constructor(e,t,i,n,o,s){"undefined"!==typeof s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}static clampedInt(e,t,i,n){if("undefined"===typeof e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),o=Math.min(n,o),0|o)}validate(e){return y.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class S extends v{constructor(e,t,i,n,o){"undefined"!==typeof o&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}static clamp(e,t,i){return ei?i:e}static float(e,t){if("number"===typeof e)return e;if("undefined"===typeof e)return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){return this.validationFn(S.float(e,this.defaultValue))}}class x extends v{static string(e,t){return"string"!==typeof e?t:e}constructor(e,t,i,n){"undefined"!==typeof n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return x.string(e,this.defaultValue)}}function L(e,t,i){return"string"!==typeof e||-1===i.indexOf(e)?t:e}class k extends v{constructor(e,t,i,n,o){"undefined"!==typeof o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return L(e,this.defaultValue,this._allowedValues)}}class E extends _{constructor(e,t,i,n,o,s,r){"undefined"!==typeof 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)}}function D(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class N extends _{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[o("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),o("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."),o("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:"auto",description:o("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}}class I extends _{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(16,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:o("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:o("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:w(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:w(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function T(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var M;function O(e){switch(e){case"line":return M.Line;case"block":return M.Block;case"underline":return M.Underline;case"line-thin":return M.LineThin;case"block-outline":return M.BlockOutline;case"underline-thin":return M.UnderlineThin}}(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"})(M||(M={}));class A extends b{constructor(){super(121,[60,29])}compute(e,t,i){const n=["monaco-editor"];return t.get(29)&&n.push(t.get(29)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(60)?n.push("mouse-default"):"copy"===t.get(60)&&n.push("mouse-copy"),t.get(95)&&n.push("showUnused"),t.get(119)&&n.push("showDeprecated"),n.join(" ")}}class R extends C{constructor(){super(28,"emptySelectionClipboard",!0,{description:o("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class P extends _{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:!0,autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(31,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:o("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"boolean",default:e.seedSearchStringFromSelection,description:o("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:[o("editor.find.autoFindInSelection.never","Never turn on Find in selection automatically (default)"),o("editor.find.autoFindInSelection.always","Always turn on Find in selection automatically"),o("editor.find.autoFindInSelection.multiline","Turn on Find in selection automatically when multiple lines of content are selected.")],description:o("find.autoFindInSelection","Controls the condition for turning on find in selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:o("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:s["f"]},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:o("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:o("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:w(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:w(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection),autoFindInSelection:"boolean"===typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":L(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:w(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:w(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:w(t.loop,this.defaultValue.loop)}}}class F extends _{constructor(){super(39,"fontLigatures",F.OFF,{anyOf:[{type:"boolean",description:o("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:o("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:o("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"undefined"===typeof e?this.defaultValue:"string"===typeof e?"false"===e?F.OFF:"true"===e?F.ON:e:Boolean(e)?F.ON:F.OFF}}F.OFF='"liga" off, "calt" off',F.ON='"liga" on, "calt" on';class W extends b{constructor(){super(38)}compute(e,t,i){return e.fontInfo}}class B extends v{constructor(){super(40,"fontSize",ue.fontSize,{type:"number",minimum:6,maximum:100,default:ue.fontSize,description:o("fontSize","Controls the font size in pixels.")})}validate(e){let t=S.float(e,this.defaultValue);return 0===t?ue.fontSize:S.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class V extends _{constructor(){super(41,"fontWeight",ue.fontWeight,{anyOf:[{type:"number",minimum:V.MINIMUM_VALUE,maximum:V.MAXIMUM_VALUE,errorMessage:o("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:V.SUGGESTION_VALUES}],default:ue.fontWeight,description:o("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(y.clampedInt(e,ue.fontWeight,V.MINIMUM_VALUE,V.MAXIMUM_VALUE))}}V.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],V.MINIMUM_VALUE=1,V.MAXIMUM_VALUE=1e3;class H extends _{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:[o("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),o("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),o("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]};super(45,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:o("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:o("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:o("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:o("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:o("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:o("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,description:o("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,description:o("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,description:o("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,description:o("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,description:o("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:L(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:L(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:L(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:L(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:L(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:L(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:x.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:x.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:x.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:x.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:x.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class z extends _{constructor(){const e={enabled:!0,delay:300,sticky:!0};super(48,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:o("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,description:o("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:o("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:w(t.enabled,this.defaultValue.enabled),delay:y.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:w(t.sticky,this.defaultValue.sticky)}}}class U extends b{constructor(){super(124,[44,52,33,59,87,54,55,89,111,114,115,116,2])}compute(e,t,i){return U.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),o=Math.floor(e.viewLineCount/n);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:n,minimapLineCount:o}}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,r=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,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,f=e.minimap.size,m=e.minimap.side,p=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,v=e.isViewportWrapping,w=d?2:3;let C=Math.floor(o*n);const y=C/o;let S=!1,x=!1,L=w*h,k=h/o,E=1;if("fill"===f||"fit"===f){const{typicalViewportLineCount:i,extraLinesBeyondLastLine:s,desiredRatio:l,minimapLineCount:d}=U.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,height:n,lineHeight:a,pixelRatio:o}),u=_/d;if(u>1)S=!0,x=!0,h=1,L=1,k=h/o;else{let n=!1,c=h+1;if("fit"===f){const i=Math.ceil((_+s)*L);v&&r&&b<=t.stableFitRemainingWidth?(n=!0,c=t.stableFitMaxMinimapScale):(n=i>C,v&&n?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0))}if("fill"===f||n){S=!0;const e=h;L=Math.min(a*o,Math.max(1,Math.floor(1/l))),h=Math.min(c,Math.max(1,Math.floor(L/w))),h>e&&(E=Math.min(2,h/e)),k=h/o/E,C=Math.ceil(Math.max(i,_+s)*L),v&&n&&(t.stableFitMaxMinimapScale=h)}}}const D=Math.floor(u*k),N=Math.min(D,Math.max(0,Math.floor((b-p-2)*k/(l+k)))+g);let I=Math.floor(o*N);const T=I/o;I=Math.floor(I*E);const M=d?1:2,O="left"===m?0:i-N-p;return{renderMinimap:M,minimapLeft:O,minimapWidth:N,minimapHeightIsEditorHeight:S,minimapIsSampling:x,minimapScale:h,minimapLineHeight:L,minimapCanvasInnerWidth:I,minimapCanvasInnerHeight:C,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(116),h="inherit"===d?e.get(115):d,u="inherit"===h?e.get(111):h,g=e.get(114),f=e.get(2),m=t.isDominatedByLongLines,_=e.get(44),b=0!==e.get(54).renderType,v=e.get(55),w=e.get(89),C=e.get(59),S=e.get(87),x=S.verticalScrollbarSize,L=S.verticalHasArrows,k=S.arrowSize,E=S.horizontalScrollbarSize,D=e.get(52),N=e.get(33);let I;if("string"===typeof D&&/^\d+(\.\d+)?ch$/.test(D)){const e=parseFloat(D.substr(0,D.length-2));I=y.clampedInt(e*r,0,0,1e3)}else I=y.clampedInt(D,0,0,1e3);N&&(I+=16);let T=0;if(b){const e=Math.max(s,v);T=Math.round(e*a)}let M=0;_&&(M=o);let O=0,A=O+M,R=A+T,P=R+I;const F=i-M-T-I;let W=!1,B=!1,V=-1;2!==f&&("inherit"===h&&m?(W=!0,B=!0):"on"===u||"bounded"===u?B=!0:"wordWrapColumn"===u&&(V=g));const H=U._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:w,minimap:C,verticalScrollbarWidth:x,viewLineCount:c,remainingWidth:F,isViewportWrapping:B},t.memory||new p);0!==H.renderMinimap&&0===H.minimapLeft&&(O+=H.minimapWidth,A+=H.minimapWidth,R+=H.minimapWidth,P+=H.minimapWidth);const z=F-H.minimapWidth,K=Math.max(1,Math.floor((z-x-2)/r)),j=L?k:0;return B&&(V=Math.max(1,K),"bounded"===u&&(V=Math.min(V,g))),{width:i,height:n,glyphMarginLeft:O,glyphMarginWidth:M,lineNumbersLeft:A,lineNumbersWidth:T,decorationsLeft:R,decorationsWidth:I,contentLeft:P,contentWidth:z,minimap:H,viewportColumn:K,isWordWrapMinified:W,isViewportWrapping:B,wrappingColumn:V,verticalScrollbarWidth:x,horizontalScrollbarHeight:E,overviewRuler:{top:j,width:x,height:n-2*j,right:0}}}}class K extends _{constructor(){const e={enabled:!0};super(51,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:o("codeActions","Enables the code action lightbulb in the editor.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e;return{enabled:w(t.enabled,this.defaultValue.enabled)}}}class j extends _{constructor(){const e={enabled:!0,fontSize:0,fontFamily:ue.fontFamily};super(120,"inlineHints",e,{"editor.inlineHints.enabled":{type:"boolean",default:e.enabled,description:o("inlineHints.enable","Enables the inline hints in the editor.")},"editor.inlineHints.fontSize":{type:"number",default:e.fontSize,description:o("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:o("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:w(t.enabled,this.defaultValue.enabled),fontSize:y.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:x.string(t.fontFamily,this.defaultValue.fontFamily)}}}class q extends y{constructor(){super(53,"lineHeight",ue.lineHeight,0,150,{description:o("lineHeight","Controls the line height. Use 0 to compute the line height from the font size.")})}compute(e,t,i){return e.fontInfo.lineHeight}}class $ extends _{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(59,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:o("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[o("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),o("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),o("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:o("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:o("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:o("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:o("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:o("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:o("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:w(t.enabled,this.defaultValue.enabled),size:L(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:L(t.side,this.defaultValue.side,["right","left"]),showSlider:L(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:w(t.renderCharacters,this.defaultValue.renderCharacters),scale:y.clampedInt(t.scale,1,1,3),maxColumn:y.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function G(e){return"ctrlCmd"===e?s["f"]?"metaKey":"ctrlKey":"altKey"}class Y extends _{constructor(){super(69,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:o("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:o("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:y.clampedInt(t.top,0,0,1e3),bottom:y.clampedInt(t.bottom,0,0,1e3)}}}class X extends _{constructor(){const e={enabled:!0,cycle:!1};super(70,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:o("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:o("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:w(t.enabled,this.defaultValue.enabled),cycle:w(t.cycle,this.defaultValue.cycle)}}}class Z extends b{constructor(){super(122)}compute(e,t,i){return e.pixelRatio}}class Q extends _{constructor(){const e={other:!0,comments:!1,strings:!1};super(73,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:o("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:o("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:e.other,description:o("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}}}],default:e,description:o("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:w(t.other,this.defaultValue.other),comments:w(t.comments,this.defaultValue.comments),strings:w(t.strings,this.defaultValue.strings)};return!!(i.other&&i.comments&&i.strings)||!!(i.other||i.comments||i.strings)&&i}return this.defaultValue}}class J extends _{constructor(){super(54,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[o("lineNumbers.off","Line numbers are not rendered."),o("lineNumbers.on","Line numbers are rendered as absolute number."),o("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),o("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:o("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return"undefined"!==typeof e&&("function"===typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}function ee(e){const t=e.get(82);return"editable"===t?e.get(75):"on"!==t}class te extends _{constructor(){const e=[],t={type:"number",description:o("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(86,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:o("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:o("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:y.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"===typeof i){const e=i;t.push({column:y.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}}function ie(e,t){if("string"!==typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}class ne extends _{constructor(){super(87,"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=y.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=y.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:y.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:ie(t.vertical,this.defaultValue.vertical),horizontal:ie(t.horizontal,this.defaultValue.horizontal),useShadows:w(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:w(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:w(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:w(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:w(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:y.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:y.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:w(t.scrollByPage,this.defaultValue.scrollByPage)}}}class oe extends _{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(101,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[o("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),o("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:o("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:o("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:o("suggest.localityBonus","Controls whether sorting favours words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:o("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:o("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:o("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:o("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:o("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:o("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:o("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:o("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e;return{insertMode:L(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:w(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:w(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:w(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:w(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:w(t.showIcons,this.defaultValue.showIcons),showStatusBar:w(t.showStatusBar,this.defaultValue.showStatusBar),showInlineDetails:w(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:w(t.showMethods,this.defaultValue.showMethods),showFunctions:w(t.showFunctions,this.defaultValue.showFunctions),showConstructors:w(t.showConstructors,this.defaultValue.showConstructors),showFields:w(t.showFields,this.defaultValue.showFields),showVariables:w(t.showVariables,this.defaultValue.showVariables),showClasses:w(t.showClasses,this.defaultValue.showClasses),showStructs:w(t.showStructs,this.defaultValue.showStructs),showInterfaces:w(t.showInterfaces,this.defaultValue.showInterfaces),showModules:w(t.showModules,this.defaultValue.showModules),showProperties:w(t.showProperties,this.defaultValue.showProperties),showEvents:w(t.showEvents,this.defaultValue.showEvents),showOperators:w(t.showOperators,this.defaultValue.showOperators),showUnits:w(t.showUnits,this.defaultValue.showUnits),showValues:w(t.showValues,this.defaultValue.showValues),showConstants:w(t.showConstants,this.defaultValue.showConstants),showEnums:w(t.showEnums,this.defaultValue.showEnums),showEnumMembers:w(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:w(t.showKeywords,this.defaultValue.showKeywords),showWords:w(t.showWords,this.defaultValue.showWords),showColors:w(t.showColors,this.defaultValue.showColors),showFiles:w(t.showFiles,this.defaultValue.showFiles),showReferences:w(t.showReferences,this.defaultValue.showReferences),showFolders:w(t.showFolders,this.defaultValue.showFolders),showTypeParameters:w(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:w(t.showSnippets,this.defaultValue.showSnippets),showUsers:w(t.showUsers,this.defaultValue.showUsers),showIssues:w(t.showIssues,this.defaultValue.showIssues)}}}class se extends _{constructor(){super(97,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:o("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"===typeof e?{selectLeadingAndTrailingWhitespace:w(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}:this.defaultValue}}class re extends b{constructor(){super(123,[75])}compute(e,t,i){const n=t.get(75);return!!n||e.tabFocusMode}}function ae(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}class le extends b{constructor(){super(125,[124])}compute(e,t,i){const n=t.get(124);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}const ce="Consolas, 'Courier New', monospace",de="Menlo, Monaco, 'Courier New', monospace",he="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",ue={fontFamily:s["f"]?de:s["d"]?he:ce,fontWeight:"normal",fontSize:s["f"]?12:14,lineHeight:0,letterSpacing:0},ge={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},fe=[];function me(e){return fe[e.id]=e,e}const pe={acceptSuggestionOnCommitCharacter:me(new C(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:o("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:me(new k(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",o("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:o("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:me(new N),accessibilityPageSize:me(new y(3,"accessibilityPageSize",10,1,1073741824,{description:o("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader. Warning: this has a performance implication for numbers larger than the default.")})),ariaLabel:me(new x(4,"ariaLabel",o("editorViewAccessibleLabel","Editor content"))),autoClosingBrackets:me(new k(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",o("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),o("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:o("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingOvertype:me(new k(6,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",o("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:o("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:me(new k(7,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",o("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),o("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:o("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:me(new E(8,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],D,{enumDescriptions:[o("editor.autoIndent.none","The editor will not insert indentation automatically."),o("editor.autoIndent.keep","The editor will keep the current line's indentation."),o("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),o("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),o("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:o("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:me(new C(9,"automaticLayout",!1)),autoSurround:me(new k(10,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[o("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),o("editor.autoSurround.quotes","Surround with quotes but not brackets."),o("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:o("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),stickyTabStops:me(new C(99,"stickyTabStops",!1,{description:o("stickyTabStops","Emulate selection behaviour of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:me(new C(11,"codeLens",!0,{description:o("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:me(new x(12,"codeLensFontFamily","",{description:o("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:me(new y(13,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,description:o("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.")})),colorDecorators:me(new C(14,"colorDecorators",!0,{description:o("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:me(new C(15,"columnSelection",!1,{description:o("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:me(new I),contextmenu:me(new C(17,"contextmenu",!0)),copyWithSyntaxHighlighting:me(new C(18,"copyWithSyntaxHighlighting",!0,{description:o("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:me(new E(19,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],T,{description:o("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:me(new C(20,"cursorSmoothCaretAnimation",!1,{description:o("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:me(new E(21,"cursorStyle",M.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],O,{description:o("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:me(new y(22,"cursorSurroundingLines",0,0,1073741824,{description:o("cursorSurroundingLines","Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:me(new k(23,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[o("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),o("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],description:o("cursorSurroundingLinesStyle","Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:me(new y(24,"cursorWidth",0,0,1073741824,{markdownDescription:o("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:me(new C(25,"disableLayerHinting",!1)),disableMonospaceOptimizations:me(new C(26,"disableMonospaceOptimizations",!1)),dragAndDrop:me(new C(27,"dragAndDrop",!0,{description:o("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:me(new R),extraEditorClassName:me(new x(29,"extraEditorClassName","")),fastScrollSensitivity:me(new S(30,"fastScrollSensitivity",5,e=>e<=0?5:e,{markdownDescription:o("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:me(new P),fixedOverflowWidgets:me(new C(32,"fixedOverflowWidgets",!1)),folding:me(new C(33,"folding",!0,{description:o("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:me(new k(34,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[o("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),o("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:o("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:me(new C(35,"foldingHighlight",!0,{description:o("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),unfoldOnClickAfterEndOfLine:me(new C(36,"unfoldOnClickAfterEndOfLine",!1,{description:o("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:me(new x(37,"fontFamily",ue.fontFamily,{description:o("fontFamily","Controls the font family.")})),fontInfo:me(new W),fontLigatures2:me(new F),fontSize:me(new B),fontWeight:me(new V),formatOnPaste:me(new C(42,"formatOnPaste",!1,{description:o("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:me(new C(43,"formatOnType",!1,{description:o("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:me(new C(44,"glyphMargin",!0,{description:o("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:me(new H),hideCursorInOverviewRuler:me(new C(46,"hideCursorInOverviewRuler",!1,{description:o("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),highlightActiveIndentGuide:me(new C(47,"highlightActiveIndentGuide",!0,{description:o("highlightActiveIndentGuide","Controls whether the editor should highlight the active indent guide.")})),hover:me(new z),inDiffEditor:me(new C(49,"inDiffEditor",!1)),letterSpacing:me(new S(50,"letterSpacing",ue.letterSpacing,e=>S.clamp(e,-5,20),{description:o("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:me(new K),lineDecorationsWidth:me(new v(52,"lineDecorationsWidth",10)),lineHeight:me(new q),lineNumbers:me(new J),lineNumbersMinChars:me(new y(55,"lineNumbersMinChars",5,1,300)),linkedEditing:me(new C(56,"linkedEditing",!1,{description:o("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.")})),links:me(new C(57,"links",!0,{description:o("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:me(new k(58,"matchBrackets","always",["always","near","never"],{description:o("matchBrackets","Highlight matching brackets.")})),minimap:me(new $),mouseStyle:me(new k(60,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:me(new S(61,"mouseWheelScrollSensitivity",1,e=>0===e?1:e,{markdownDescription:o("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:me(new C(62,"mouseWheelZoom",!1,{markdownDescription:o("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:me(new C(63,"multiCursorMergeOverlapping",!0,{description:o("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:me(new E(64,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],G,{markdownEnumDescriptions:[o("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),o("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:o({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:me(new k(65,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[o("multiCursorPaste.spread","Each cursor pastes a single line of the text."),o("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:o("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),occurrencesHighlight:me(new C(66,"occurrencesHighlight",!0,{description:o("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:me(new C(67,"overviewRulerBorder",!0,{description:o("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:me(new y(68,"overviewRulerLanes",3,0,3)),padding:me(new Y),parameterHints:me(new X),peekWidgetDefaultFocus:me(new k(71,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[o("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),o("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:o("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:me(new C(72,"definitionLinkOpensInPeek",!1,{description:o("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:me(new Q),quickSuggestionsDelay:me(new y(74,"quickSuggestionsDelay",10,0,1073741824,{description:o("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:me(new C(75,"readOnly",!1)),renameOnType:me(new C(76,"renameOnType",!1,{description:o("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:o("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:me(new C(77,"renderControlCharacters",!1,{description:o("renderControlCharacters","Controls whether the editor should render control characters.")})),renderIndentGuides:me(new C(78,"renderIndentGuides",!0,{description:o("renderIndentGuides","Controls whether the editor should render indent guides.")})),renderFinalNewline:me(new C(79,"renderFinalNewline",!0,{description:o("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:me(new k(80,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",o("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:o("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:me(new C(81,"renderLineHighlightOnlyWhenFocus",!1,{description:o("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused")})),renderValidationDecorations:me(new k(82,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:me(new k(83,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",o("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),o("renderWhitespace.selection","Render whitespace characters only on selected text."),o("renderWhitespace.trailing","Render only trailing whitespace characters"),""],description:o("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:me(new y(84,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:me(new C(85,"roundedSelection",!0,{description:o("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:me(new te),scrollbar:me(new ne),scrollBeyondLastColumn:me(new y(88,"scrollBeyondLastColumn",5,0,1073741824,{description:o("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:me(new C(89,"scrollBeyondLastLine",!0,{description:o("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:me(new C(90,"scrollPredominantAxis",!0,{description:o("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:me(new C(91,"selectionClipboard",!0,{description:o("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:s["d"]})),selectionHighlight:me(new C(92,"selectionHighlight",!0,{description:o("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:me(new C(93,"selectOnLineNumbers",!0)),showFoldingControls:me(new k(94,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[o("showFoldingControls.always","Always show the folding controls."),o("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:o("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:me(new C(95,"showUnused",!0,{description:o("showUnused","Controls fading out of unused code.")})),showDeprecated:me(new C(119,"showDeprecated",!0,{description:o("showDeprecated","Controls strikethrough deprecated variables.")})),inlineHints:me(new j),snippetSuggestions:me(new k(96,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[o("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),o("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),o("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),o("snippetSuggestions.none","Do not show snippet suggestions.")],description:o("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:me(new se),smoothScrolling:me(new C(98,"smoothScrolling",!1,{description:o("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:me(new y(100,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:me(new oe),suggestFontSize:me(new y(102,"suggestFontSize",0,0,1e3,{markdownDescription:o("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")})),suggestLineHeight:me(new y(103,"suggestLineHeight",0,0,1e3,{markdownDescription:o("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.")})),suggestOnTriggerCharacters:me(new C(104,"suggestOnTriggerCharacters",!0,{description:o("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:me(new k(105,"suggestSelection","recentlyUsed",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[o("suggestSelection.first","Always select the first suggestion."),o("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),o("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:o("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:me(new k(106,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[o("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),o("tabCompletion.off","Disable tab completions."),o("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:o("tabCompletion","Enables tab completions.")})),tabIndex:me(new y(107,"tabIndex",0,-1,1073741824)),unusualLineTerminators:me(new k(108,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[o("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),o("unusualLineTerminators.off","Unusual line terminators are ignored."),o("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:o("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useTabStops:me(new C(109,"useTabStops",!0,{description:o("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordSeparators:me(new x(110,"wordSeparators",r,{description:o("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:me(new k(111,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[o("wordWrap.off","Lines will never wrap."),o("wordWrap.on","Lines will wrap at the viewport width."),o({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),o({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:o({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:me(new x(112,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:me(new x(113,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:me(new y(114,"wordWrapColumn",80,1,1073741824,{markdownDescription:o({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:me(new k(115,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:me(new k(116,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:me(new E(117,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],ae,{enumDescriptions:[o("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),o("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),o("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),o("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:o("wrappingIndent","Controls the indentation of wrapped lines.")})),wrappingStrategy:me(new k(118,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[o("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."),o("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:o("wrappingStrategy","Controls the algorithm that computes wrapping points.")})),editorClassName:me(new A),pixelRatio:me(new Z),tabFocusMode:me(new re),layoutInfo:me(new U),wrappingInfo:me(new le)};class _e{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)}}const be=new _e;function ve(e){Se(e)||be.onUnexpectedError(e)}function we(e){Se(e)||be.onUnexpectedExternalError(e)}function Ce(e){if(e instanceof Error){let{name:t,message:i}=e;const n=e.stacktrace||e.stack;return{$isError:!0,name:t,message:i,stack:n}}return e}const ye="Canceled";function Se(e){return e instanceof Error&&e.name===ye&&e.message===ye}function xe(){const e=new Error(ye);return e.name=e.message,e}function Le(e){return e?new Error("Illegal argument: "+e):new Error("Illegal argument")}function ke(e){return e?new Error("Illegal state: "+e):new Error("Illegal state")}var Ee;(function(e){function t(e){return e&&"object"===typeof e&&"function"===typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function n(){return i}function*o(e){yield e}function s(e){return e||i}function r(e){return!e||!0===e[Symbol.iterator]().next().done}function a(e){return e[Symbol.iterator]().next().value}function l(e,t){for(const i of e)if(t(i))return!0;return!1}function*c(e,t){for(const i of e)t(i)&&(yield i)}function*d(e,t){for(const i of e)yield t(i)}function*h(...e){for(const t of e)for(const e of t)yield e}function*u(e){for(const t of e)for(const e of t)yield e}function*g(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t{t[e]||console.log(i)},3e3)}markTracked(t){if(t&&t!==We.None)try{t[e]=!0}catch(i){}}}}function Ie(e){Ne&&Ne.markTracked(e)}function Te(e){return Ne?(Ne.trackDisposable(e),e):e}class Me extends Error{constructor(e){super(`Encounter errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function Oe(e){return"function"===typeof e.dispose&&0===e.dispose.length}function Ae(e){if(Ee.is(e)){let i=[];for(const n of e)if(n){Ie(n);try{n.dispose()}catch(t){i.push(t)}}if(1===i.length)throw i[0];if(i.length>1)throw new Me(i);return Array.isArray(e)?[]:e}if(e)return Ie(e),e.dispose(),e}function Re(...e){return e.forEach(Ie),Pe(()=>Ae(e))}function Pe(e){const t=Te({dispose:()=>{Ie(t),e()}});return t}class Fe{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(Ie(this),this._isDisposed=!0,this.clear())}clear(){try{Ae(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 Ie(e),this._isDisposed?Fe.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}}Fe.DISABLE_DISPOSED_WARNING=!1;class We{constructor(){this._store=new Fe,Te(this)}dispose(){Ie(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}We.None=Object.freeze({dispose(){}});class Be{constructor(){this._isDisposed=!1,Te(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value&&this._value.dispose(),e&&Ie(e),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Ie(this),this._value&&this._value.dispose(),this._value=void 0}}class Ve{constructor(e){this.object=e}dispose(){}}class He{constructor(e){this.element=e,this.next=He.Undefined,this.prev=He.Undefined}}He.Undefined=new He(void 0);class ze{constructor(){this._first=He.Undefined,this._last=He.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===He.Undefined}clear(){this._first=He.Undefined,this._last=He.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new He(e);if(this._first===He.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==He.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==He.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==He.Undefined&&e.next!==He.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===He.Undefined&&e.next===He.Undefined?(this._first=He.Undefined,this._last=He.Undefined):e.next===He.Undefined?(this._last=this._last.prev,this._last.next=He.Undefined):e.prev===He.Undefined&&(this._first=this._first.next,this._first.prev=He.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;while(e!==He.Undefined)yield e.element,e=e.next}}const Ue=s["b"].performance&&"function"===typeof s["b"].performance.now;class Ke{constructor(e){this._highResolution=Ue&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new Ke(e)}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?s["b"].performance.now():Date.now()}}var je;(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 l((i,n=null,o)=>e(e=>i.call(n,t(e)),null,o))}function n(e,t){return l((i,n=null,o)=>e(e=>{t(e),i.call(n,e)},null,o))}function o(e,t){return l((i,n=null,o)=>e(e=>t(e)&&i.call(n,e),null,o))}function s(e){return e}function r(...e){return(t,i=null,n)=>Re(...e.map(e=>e(e=>t.call(i,e),null,n)))}function a(e,t,n){let o=n;return i(e,e=>(o=t(o,e),o))}function l(e){let t;const i=new Ye({onFirstListenerAdd(){t=e(i.fire,i)},onLastListenerRemove(){t.dispose()}});return i.event}function c(e,t,i=100,n=!1,o){let s,r=void 0,a=void 0,l=0;const c=new Ye({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 d(e){const n=(new Date).getTime();return i(t(e),e=>(new Date).getTime()-n)}function h(e){let t,i=!0;return o(e,e=>{const n=i||e!==t;return i=!1,t=e,n})}function u(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 Ye({onFirstListenerAdd(){o||(o=e(e=>r.fire(e)))},onFirstListenerDidAdd(){n&&(t?setTimeout(s):s())},onLastListenerRemove(){o&&o.dispose(),o=null}});return r.event}e.None=()=>We.None,e.once=t,e.map=i,e.forEach=n,e.filter=o,e.signal=s,e.any=r,e.reduce=a,e.snapshot=l,e.debounce=c,e.stopwatch=d,e.latch=h,e.buffer=u;class g{constructor(e){this.event=e}map(e){return new g(i(this.event,e))}forEach(e){return new g(n(this.event,e))}filter(e){return new g(o(this.event,e))}reduce(e,t){return new g(a(this.event,e,t))}latch(){return new g(h(this.event))}debounce(e,t=100,i=!1,n){return new g(c(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)}}function f(e){return new g(e)}function m(e,t,i=(e=>e)){const n=(...e)=>r.fire(i(...e)),o=()=>e.on(t,n),s=()=>e.removeListener(t,n),r=new Ye({onFirstListenerAdd:o,onLastListenerRemove:s});return r.event}function p(e,t,i=(e=>e)){const n=(...e)=>r.fire(i(...e)),o=()=>e.addEventListener(t,n),s=()=>e.removeEventListener(t,n),r=new Ye({onFirstListenerAdd:o,onLastListenerRemove:s});return r.event}function _(e){const t=new Ye;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}function b(e){return new Promise(i=>t(e)(i))}e.chain=f,e.fromNodeEventEmitter=m,e.fromDOMEventEmitter=p,e.fromPromise=_,e.toPromise=b})(je||(je={}));class qe{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${qe._idPool++}`}start(e){this._stopWatch=new Ke(!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}}}qe._idPool=0;let $e=-1;class Ge{constructor(e,t=Math.random().toString(18).slice(2,5)){this.customThreshold=e,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(e){let t=$e;if("number"===typeof this.customThreshold&&(t=this.customThreshold),t<=0||e{const e=this._stacks.get(i)||0;this._stacks.set(i,e-1)}}}class Ye{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=$e>0?new Ge(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=(null===(t=this._options)||void 0===t?void 0:t._profName)?new qe(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,i)=>{var n;this._listeners||(this._listeners=new ze);const o=this._listeners.isEmpty();o&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=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 r=null===(n=this._leakageMon)||void 0===n?void 0:n.check(this._listeners.size);let a;return a={dispose:()=>{if(r&&r(),a.dispose=Ye._noop,!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const e=this._listeners&&!this._listeners.isEmpty();e||this._options.onLastListenerRemove(this)}}},i instanceof Fe?i.add(a):Array.isArray(i)&&i.push(a),a}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ze);for(let t of this._listeners)this._deliveryQueue.push([t,e]);null===(t=this._perfMon)||void 0===t||t.start(this._deliveryQueue.size);while(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(n){ve(n)}}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}}Ye._noop=function(){};class Xe extends Ye{constructor(e){super(e),this._isPaused=0,this._eventQueue=new ze,this._mergeFn=null===e||void 0===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 while(!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 Ze{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 Qe{constructor(){this.listening=!1,this.inputEvent=je.None,this.inputEventListener=We.None,this.emitter=new Ye({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()}}const Je=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var et;(function(e){function t(t){return t===e.None||t===e.Cancelled||(t instanceof tt||!(!t||"object"!==typeof t)&&("boolean"===typeof t.isCancellationRequested&&"function"===typeof t.onCancellationRequested))}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:je.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Je})})(et||(et={}));class tt{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?Je:(this._emitter||(this._emitter=new Ye),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class it{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 tt),this._token}cancel(){this._token?this._token instanceof tt&&this._token.cancel():this._token=et.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof tt&&this._token.dispose():this._token=et.None}}class nt{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 ot=new nt,st=new nt,rt=new nt;var at;function lt(e,t){const i=(65535&t)<<16>>>0;return(e|i)>>>0}function ct(e,t){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new ut(0!==n?[dt(i,t),dt(n,t)]:[dt(i,t)])}function dt(e,t){const i=!!(2048&e),n=!!(256&e),o=2===t?n:i,s=!!(1024&e),r=!!(512&e),a=2===t?i:n,l=255&e;return new ht(o,s,r,a,l)}(function(){function e(e,t,i=t,n=i){ot.define(e,t),st.define(e,i),rt.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){function t(e){return ot.keyCodeToStr(e)}function i(e){return ot.strToKeyCode(e)}function n(e){return st.keyCodeToStr(e)}function o(e){return rt.keyCodeToStr(e)}function s(e){return st.strToKeyCode(e)||rt.strToKeyCode(e)}e.toString=t,e.fromString=i,e.toUserSettingsUS=n,e.toUserSettingsGeneral=o,e.fromUserSettings=s}(at||(at={}));class ht{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 ut([this])}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class ut{constructor(e){if(0===e.length)throw Le("parts");this.parts=e}}class gt{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 ft{}var mt=i("f940");const pt=65,_t=97,bt=90,vt=122,wt=46,Ct=47,yt=92,St=58,xt=63;class Lt 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 kt(e,t){if("string"!==typeof e)throw new Lt(t,"string",e)}function Et(e){return e===Ct||e===yt}function Dt(e){return e===Ct}function Nt(e){return e>=pt&&e<=bt||e>=_t&&e<=vt}function It(e,t,i,n){let o="",s=0,r=-1,a=0,l=0;for(let c=0;c<=e.length;++c){if(c2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(i)),r=c,a=0;continue}if(0!==o.length){o="",s=0,r=c,a=0;continue}}t&&(o+=o.length>0?i+"..":"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,c)}`:o=e.slice(r+1,c),s=c-r-1;r=c,a=0}else l===wt&&-1!==a?++a:a=-1}return o}function Tt(e,t){if(null===t||"object"!==typeof t)throw new Lt("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 Mt={resolve(...e){let t="",i="",n=!1;for(let o=e.length-1;o>=-1;o--){let s;if(o>=0){if(s=e[o],kt(s,"path"),0===s.length)continue}else 0===t.length?s=mt["a"]():(s=mt["b"]["="+t]||mt["a"](),(void 0===s||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===yt)&&(s=t+"\\"));const r=s.length;let a=0,l="",c=!1;const d=s.charCodeAt(0);if(1===r)Et(d)&&(a=1,c=!0);else if(Et(d))if(c=!0,Et(s.charCodeAt(1))){let e=2,t=e;while(e2&&Et(s.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${s.slice(a)}\\${i}`,n=c,c&&t.length>0)break}return i=It(i,!n,"\\",Et),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){kt(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 Dt(s)?"\\":e;if(Et(s))if(o=!0,Et(e.charCodeAt(1))){let o=2,s=o;while(o2&&Et(e.charCodeAt(2))&&(o=!0,n=3));let r=n0&&Et(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?o?"\\"+r:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){kt(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return Et(i)||t>2&&Nt(i)&&e.charCodeAt(1)===St&&Et(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let s=0;s0&&(void 0===t?t=i=n:t+="\\"+n)}if(void 0===t)return".";let n=!0,o=0;if("string"===typeof i&&Et(i.charCodeAt(0))){++o;const e=i.length;e>1&&Et(i.charCodeAt(1))&&(++o,e>2&&(Et(i.charCodeAt(2))?++o:n=!1))}if(n){while(o=2&&(t="\\"+t.slice(o))}return Mt.normalize(t)},relative(e,t){if(kt(e,"from"),kt(t,"to"),e===t)return"";const i=Mt.resolve(e),n=Mt.resolve(t);if(i===n)return"";if(e=i.toLowerCase(),t=n.toLowerCase(),e===t)return"";let o=0;while(oo&&e.charCodeAt(s-1)===yt)s--;const r=s-o;let a=0;while(aa&&t.charCodeAt(l-1)===yt)l--;const c=l-a,d=rd){if(t.charCodeAt(a+u)===yt)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>d&&(e.charCodeAt(o+u)===yt?h=u:2===u&&(h=3)),-1===h&&(h=0)}let g="";for(u=o+h+1;u<=s;++u)u!==s&&e.charCodeAt(u)!==yt||(g+=0===g.length?"..":"\\..");return a+=h,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===yt&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!==typeof e)return e;if(0===e.length)return"";const t=Mt.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===yt){if(t.charCodeAt(1)===yt){const e=t.charCodeAt(2);if(e!==xt&&e!==wt)return"\\\\?\\UNC\\"+t.slice(2)}}else if(Nt(t.charCodeAt(0))&&t.charCodeAt(1)===St&&t.charCodeAt(2)===yt)return"\\\\?\\"+t;return e},dirname(e){kt(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return Et(o)?e:".";if(Et(o)){if(i=n=1,Et(e.charCodeAt(1))){let o=2,s=o;while(o2&&Et(e.charCodeAt(2))?3:2,n=i);let s=-1,r=!0;for(let a=t-1;a>=n;--a)if(Et(e.charCodeAt(a))){if(!r){s=a;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&kt(t,"ext"),kt(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&Nt(e.charCodeAt(0))&&e.charCodeAt(1)===St&&(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(Et(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(Et(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){kt(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&e.charCodeAt(1)===St&&Nt(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(Et(t)){if(!s){n=a+1;break}}else-1===o&&(s=!1,o=a+1),t===wt?-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:Tt.bind(null,"\\"),parse(e){kt(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 Et(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Et(o)){if(n=1,Et(e.charCodeAt(1))){let t=2,o=t;while(t0&&(t.root=e.slice(0,n));let s=-1,r=n,a=-1,l=!0,c=e.length-1,d=0;for(;c>=n;--c)if(o=e.charCodeAt(c),Et(o)){if(!l){r=c+1;break}}else-1===a&&(l=!1,a=c+1),o===wt?-1===s?s=c:1!==d&&(d=1):-1!==s&&(d=-1);return-1!==a&&(-1===s||0===d||1===d&&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},Ot={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=-1&&!i;n--){const o=n>=0?e[n]:mt["a"]();kt(o,"path"),0!==o.length&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Ct)}return t=It(t,!i,"/",Dt),i?"/"+t:t.length>0?t:"."},normalize(e){if(kt(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Ct,i=e.charCodeAt(e.length-1)===Ct;return e=It(e,!t,"/",Dt),0===e.length?t?"/":i?"./":".":(i&&(e+="/"),t?"/"+e:e)},isAbsolute(e){return kt(e,"path"),e.length>0&&e.charCodeAt(0)===Ct},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?".":Ot.normalize(t)},relative(e,t){if(kt(e,"from"),kt(t,"to"),e===t)return"";if(e=Ot.resolve(e),t=Ot.resolve(t),e===t)return"";const i=1,n=e.length,o=n-i,s=1,r=t.length-s,a=oa){if(t.charCodeAt(s+c)===Ct)return t.slice(s+c+1);if(0===c)return t.slice(s+c)}else o>a&&(e.charCodeAt(i+c)===Ct?l=c:0===c&&(l=0));let d="";for(c=i+l+1;c<=n;++c)c!==n&&e.charCodeAt(c)!==Ct||(d+=0===d.length?"..":"/..");return`${d}${t.slice(s+l)}`},toNamespacedPath(e){return e},dirname(e){if(kt(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Ct;let i=-1,n=!0;for(let o=e.length-1;o>=1;--o)if(e.charCodeAt(o)===Ct){if(!n){i=o;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&kt(t,"ext"),kt(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===Ct){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)===Ct){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){kt(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!==Ct)-1===n&&(o=!1,n=r+1),a===wt?-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:Tt.bind(null,"/"),parse(e){kt(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===Ct;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,a=!0,l=e.length-1,c=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==Ct)-1===r&&(a=!1,r=l+1),t===wt?-1===o?o=l:1!==c&&(c=1):-1!==o&&(c=-1);else if(!a){s=l+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===c||1===c&&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};Ot.win32=Mt.win32=Mt,Ot.posix=Mt.posix=Ot;const At="win32"===mt["c"]?Mt.normalize:Ot.normalize,Rt="win32"===mt["c"]?Mt.resolve:Ot.resolve,Pt="win32"===mt["c"]?Mt.relative:Ot.relative,Ft="win32"===mt["c"]?Mt.dirname:Ot.dirname,Wt="win32"===mt["c"]?Mt.basename:Ot.basename,Bt="win32"===mt["c"]?Mt.extname:Ot.extname,Vt="win32"===mt["c"]?Mt.sep:Ot.sep,Ht=/^\w[\w\d+.-]*$/,zt=/^\//,Ut=/^\/\//;function Kt(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&&!Ht.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!zt.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(Ut.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 ("//")')}function jt(e,t){return e||t?e:"file"}function qt(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==Gt&&(t=Gt+t):t=Gt;break}return t}const $t="",Gt="/",Yt=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Xt{constructor(e,t,i,n,o,s=!1){"object"===typeof e?(this.scheme=e.scheme||$t,this.authority=e.authority||$t,this.path=e.path||$t,this.query=e.query||$t,this.fragment=e.fragment||$t):(this.scheme=jt(e,s),this.authority=t||$t,this.path=qt(this.scheme,i||$t),this.query=n||$t,this.fragment=o||$t,Kt(this,s))}static isUri(e){return e instanceof Xt||!!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 ii(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=$t),void 0===i?i=this.authority:null===i&&(i=$t),void 0===n?n=this.path:null===n&&(n=$t),void 0===o?o=this.query:null===o&&(o=$t),void 0===s?s=this.fragment:null===s&&(s=$t),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new Qt(t,i,n,o,s)}static parse(e,t=!1){const i=Yt.exec(e);return i?new Qt(i[2]||$t,ri(i[4]||$t),ri(i[5]||$t),ri(i[7]||$t),ri(i[9]||$t),t):new Qt($t,$t,$t,$t,$t)}static file(e){let t=$t;if(s["j"]&&(e=e.replace(/\\/g,Gt)),e[0]===Gt&&e[1]===Gt){const i=e.indexOf(Gt,2);-1===i?(t=e.substring(2),e=Gt):(t=e.substring(2,i),e=e.substring(i)||Gt)}return new Qt("file",t,e,$t,$t)}static from(e){return new Qt(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=s["j"]&&"file"===e.scheme?Xt.file(Mt.join(ii(e,!0),...t)).path:Ot.join(e.path,...t),e.with({path:i})}toString(e=!1){return ni(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof Xt)return e;{const t=new Qt(e);return t._formatted=e.external,t._fsPath=e._sep===Zt?e.fsPath:null,t}}return e}}const Zt=s["j"]?1:void 0;class Qt extends Xt{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=ii(this,!1)),this._fsPath}toString(e=!1){return e?ni(this,!0):(this._formatted||(this._formatted=ni(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=Zt),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 Jt={[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 ei(e,t){let i=void 0,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=Jt[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 ti(e){let t=void 0;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,s["j"]&&(i=i.replace(/\//g,"\\")),i}function ni(e,t){const i=t?ti:ei;let n="",{scheme:o,authority:s,path:r,query:a,fragment:l}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=Gt,n+=Gt),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:ei(l,!1)),n}function oi(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+oi(e.substr(3)):e}}const si=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ri(e){return e.match(si)?e.replace(si,e=>oi(e)):e}class ai{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 ai(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return ai.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return ai.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||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 li.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return li.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))}containsRange(e){return li.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 li.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 li.plusRange(this,e)}static plusRange(e,t){let i,n,o,s;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new li(i,n,o,s)}intersectRanges(e){return li.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,c=t.endColumn;return il?(o=l,s=c):o===l&&(s=Math.min(s,c)),i>o||i===o&&n>s?null:new li(i,n,o,s)}equalsRange(e){return li.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 li.getEndPosition(this)}static getEndPosition(e){return new ai(e.endLineNumber,e.endColumn)}getStartPosition(){return li.getStartPosition(this)}static getStartPosition(e){return new ai(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new li(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new li(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return li.collapseToStart(this)}static collapseToStart(e){return new li(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new li(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new li(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}}class ci extends li{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 ci.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 ci(this.startLineNumber,this.startColumn,e,t):new ci(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ai(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return 0===this.getDirection()?new ci(e,t,this.endLineNumber,this.endColumn):new ci(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new ci(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new ci(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;ie,Gi.serviceIds.set(e,t),t}function Qi(e){return function(t,i,n){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");Xi(e,t,n,!0)}}const Ji=Zi("codeEditorService");class en{constructor(){this._zoomLevel=0,this._lastZoomLevelChangeTime=0,this._onDidChangeZoomLevel=new Ye,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"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}function tn(){return en.INSTANCE.getZoomLevel()}function nn(){return en.INSTANCE.getTimeSinceLastZoomLevelChanged()}function on(e){return en.INSTANCE.onDidChangeZoomLevel(e)}function sn(){return en.INSTANCE.getZoomFactor()}function rn(){return en.INSTANCE.getPixelRatio()}en.INSTANCE=new en;const an=navigator.userAgent,ln=an.indexOf("Edge/")>=0,cn=an.indexOf("Firefox")>=0,dn=an.indexOf("AppleWebKit")>=0,hn=an.indexOf("Chrome")>=0,un=!hn&&an.indexOf("Safari")>=0,gn=!hn&&!un&&dn,fn=(an.indexOf("iPad")>=0||un&&navigator.maxTouchPoints,ln&&an.indexOf("WebView/")>=0),mn=an.indexOf("Electron/")>=0,pn=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches,_n=(e,t,i)=>{const n=e=>o.fire(e),o=new Ye({onFirstListenerAdd:()=>{e.addEventListener(t,n,i)},onLastListenerRemove:()=>{e.removeEventListener(t,n,i)}});return o.event};let bn=new Array(230),vn=new Array(112);function wn(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return at.fromString(t)}return bn[e.keyCode]||0}(function(){for(let t=0;t{t.token.onCancellationRequested(()=>{n(xe())}),Promise.resolve(i).then(i=>{t.dispose(),e(i)},e=>{t.dispose(),n(e)})});return new class{cancel(){t.cancel()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}class Rn{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(xe()),this.completionPromise=null)}cancelTimeout(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancelTimeout()}}function Pn(e,t){return t?new Promise((i,n)=>{const o=setTimeout(i,e);t.onCancellationRequested(()=>{clearTimeout(o),n(xe())})}):An(t=>Pn(e,t))}function Fn(e,t=0){const i=setTimeout(e,t);return Pe(()=>clearTimeout(i))}class Wn{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 Bn{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 Vn{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()}}(function(){if("function"!==typeof requestIdleCallback||"function"!==typeof cancelIdleCallback){const e=Object.freeze({didTimeout:!0,timeRemaining(){return 15}});kn=t=>{const i=setTimeout(()=>t(e));let n=!1;return{dispose(){n||(n=!0,clearTimeout(i))}}}}else kn=(e,t)=>{const i=requestIdleCallback(e,"number"===typeof t?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(i))}}}})();class Hn{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=kn(()=>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 zn;(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.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.vscodeWebviewResource="vscode-webview-resource",e.extension="extension",e.vscodeFileResource="vscode-file"})(zn||(zn={}));class Un{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 n=this._ports[t],o=this._connectionTokens[t];let r="path="+encodeURIComponent(e.path);return"string"===typeof o&&(r+="&tkn="+encodeURIComponent(o)),Xt.from({scheme:s["i"]?this._preferredWebSchema:zn.vscodeRemoteResource,authority:`${i}:${n}`,path:"/vscode-remote-resource",query:r})}}const Kn=new Un;class jn{constructor(){this.FALLBACK_AUTHORITY="vscode-app"}asBrowserUri(e,t,i){const n=this.toUri(e,t);return n.scheme===zn.vscodeRemote?Kn.rewrite(n):s["g"]&&(i||s["h"])&&n.scheme===zn.file?n.with({scheme:zn.vscodeFileResource,authority:n.authority||this.FALLBACK_AUTHORITY,query:null,fragment:null}):n}toUri(e,t){return Xt.isUri(e)?e:Xt.parse(t.toUrl(e))}}const qn=new jn,$n={clipboard:{writeText:s["g"]||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:s["g"]||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText),richText:(()=>{if(ln){let e=navigator.userAgent.indexOf("Edge/"),t=parseInt(navigator.userAgent.substring(e+5,navigator.userAgent.indexOf(".",e)),10);if(!t||t>=12&&t<=16)return!1}return!0})()},keyboard:(()=>s["g"]||pn?0:navigator.keyboard||un?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 Gn(e){while(e.firstChild)e.firstChild.remove()}function Yn(e){var t;return null!==(t=null===e||void 0===e?void 0:e.isConnected)&&void 0!==t&&t}class Xn{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function Zn(e,t,i,n){return new Xn(e,t,i,n)}function Qn(e){return function(t){return e(new Tn(t))}}function Jn(e){return function(t){return e(new Ln(t))}}let eo=function(e,t,i,n){let o=i;return"click"===t||"mousedown"===t?o=Qn(i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=Jn(i)),Zn(e,t,o,n)};function to(e,t){return Zn(e,"mouseout",i=>{let n=i.relatedTarget;while(n&&n!==e)n=n.parentNode;n!==e&&t(i)})}function io(e,t){return Zn(e,"pointerout",i=>{let n=i.relatedTarget;while(n&&n!==e)n=n.parentNode;n!==e&&t(i)})}let no,oo,so=null;function ro(e){if(!so){const e=e=>setTimeout(()=>e((new Date).getTime()),0);so=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}return so.call(self,e)}class ao{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){ve(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let e=[],t=null,i=!1,n=!1,o=()=>{i=!1,t=e,e=[],n=!0;while(t.length>0){t.sort(ao.sort);let e=t.shift();e.execute()}n=!1};oo=(t,n=0)=>{let s=new ao(t,n);return e.push(s),i||(i=!0,ro(o)),s},no=(e,i)=>{if(n){let n=new ao(e,i);return t.push(n),n}return oo(e,i)}})();const lo=16,co=function(e,t){return t};class ho extends We{constructor(e,t,i,n=co,o=lo){super();let s=null,r=0,a=this._register(new Wn),l=()=>{r=(new Date).getTime(),i(s),s=null};this._register(Zn(e,t,e=>{s=n(s,e);let t=(new Date).getTime()-r;t>=o?(a.cancel(),l()):a.setIfNotSet(l,o-t)}))}}function uo(e,t,i,n,o){return new ho(e,t,i,n,o)}function go(e){return document.defaultView.getComputedStyle(e,null)}function fo(e){if(e!==document.body)return new po(e.clientWidth,e.clientHeight);if(s["c"]&&window.visualViewport){const e=window.visualViewport.width,t=window.visualViewport.height-(pn?24:0);return new po(e,t)}if(window.innerWidth&&window.innerHeight)return new po(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new po(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new po(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class mo{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let n=go(e),o="0";return n&&(o=n.getPropertyValue?n.getPropertyValue(t):n.getAttribute(i)),mo.convertToPixels(e,o)}static getBorderLeftWidth(e){return mo.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return mo.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return mo.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return mo.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return mo.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return mo.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return mo.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return mo.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return mo.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return mo.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return mo.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return mo.getDimension(e,"margin-bottom","marginBottom")}}class po{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new po(e,t):this}static is(e){return"object"===typeof e&&"number"===typeof e.height&&"number"===typeof e.width}static lift(e){return e instanceof po?e:new po(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&(e.width===t.width&&e.height===t.height)}}function _o(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;while(null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement){i-=e.scrollTop;const o=Eo(e)?null:go(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=mo.getBorderLeftWidth(e),i+=mo.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function bo(e){let t=e.getBoundingClientRect();return{left:t.left+vo.scrollX,top:t.top+vo.scrollY,width:t.width,height:t.height}}const vo=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 wo(e){let t=mo.getMarginLeft(e)+mo.getMarginRight(e);return e.offsetWidth+t}function Co(e){let t=mo.getBorderLeftWidth(e)+mo.getBorderRightWidth(e),i=mo.getPaddingLeft(e)+mo.getPaddingRight(e);return e.offsetWidth-t-i}function yo(e){let t=mo.getBorderTopWidth(e)+mo.getBorderBottomWidth(e),i=mo.getPaddingTop(e)+mo.getPaddingBottom(e);return e.offsetHeight-t-i}function So(e){let t=mo.getMarginTop(e)+mo.getMarginBottom(e);return e.offsetHeight+t}function xo(e,t){while(e){if(e===t)return!0;e=e.parentNode}return!1}function Lo(e,t,i){while(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 ko(e,t,i){return!!Lo(e,t,i)}function Eo(e){return e&&!!e.host&&!!e.mode}function Do(e){return!!No(e)}function No(e){while(e.parentNode){if(e===document.body)return null;e=e.parentNode}return Eo(e)?e:null}function Io(){let e=document.activeElement;while(null===e||void 0===e?void 0:e.shadowRoot)e=e.shadowRoot.activeElement;return e}function To(e=document.getElementsByTagName("head")[0]){let t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}let Mo=null;function Oo(){return Mo||(Mo=To()),Mo}function Ao(e){var t,i;return(null===(t=null===e||void 0===e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(i=null===e||void 0===e?void 0:e.sheet)||void 0===i?void 0:i.cssRules)?e.sheet.cssRules:[]}function Ro(e,t,i=Oo()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)}function Po(e,t=Oo()){if(!t)return;let i=Ao(t),n=[];for(let o=0;o=0;o--)t.sheet.deleteRule(n[o])}function Fo(e){return"object"===typeof HTMLElement?e instanceof HTMLElement:e&&"object"===typeof e&&1===e.nodeType&&"string"===typeof e.nodeName}const Wo={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:ln?"mousewheel":"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:dn?"webkitAnimationStart":"animationstart",ANIMATION_END:dn?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:dn?"webkitAnimationIteration":"animationiteration"},Bo={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}};function Vo(e){let t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}function Ho(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 zo extends We{constructor(e){super(),this._onDidFocus=this._register(new Ye),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Ye),this.onDidBlur=this._onDidBlur.event;let t=xo(document.activeElement,e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{let i=xo(document.activeElement,e);i!==t&&(t?o():n())},this._register(_n(e,Wo.FOCUS,!0)(n)),this._register(_n(e,Wo.BLUR,!0)(o))}}function Uo(e){return new zo(e)}function Ko(e,...t){if(e.append(...t),1===t.length&&"string"!==typeof t[0])return t[0]}function jo(e,...t){e.innerText="",Ko(e,...t)}const qo=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var $o;function Go(e,t,i,...n){let o=qo.exec(t);if(!o)throw new Error("Bad use of emmet");i=Object.assign({},i||{});let s,r=o[1]||"div";return s=e!==$o.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];"undefined"!==typeof t&&(/^on\w+$/.test(e)?s[e]=t:"selected"===e?t&&s.setAttribute(e,"true"):s.setAttribute(e,t))}),s.append(...n),s}function Yo(e,t,...i){return Go($o.HTML,e,t,...i)}function Xo(...e){for(let t of e)t.style.display="",t.removeAttribute("aria-hidden")}function Zo(...e){for(let t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function Qo(e,t){while(e&&e.nodeType===e.ELEMENT_NODE){if(e instanceof HTMLElement&&e.hasAttribute(t))return e;e=e.parentNode}return null}function Jo(e){if(e&&e.hasAttribute("tabIndex")){if(document.activeElement===e){let t=Qo(e.parentElement,"tabIndex");t&&t.focus()}e.removeAttribute("tabindex")}}function es(e){return Array.prototype.slice.call(document.getElementsByTagName(e),0)}function ts(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function is(e){if(mn||fn)window.open(e);else{let t=window.open();t&&(t.opener=null,t.location.href=e)}}function ns(e){const t=()=>{e(),i=oo(t)};let i=oo(t);return Pe(()=>i.dispose())}function os(e){return e?`url('${qn.asBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}(function(e){e["HTML"]="http://www.w3.org/1999/xhtml",e["SVG"]="http://www.w3.org/2000/svg"})($o||($o={})),Yo.SVG=function(e,t,...i){return Go($o.SVG,e,t,...i)},Kn.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");class ss extends Ye{constructor(){super(),this._subscriptions=new Fe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(_n(document.body,"keydown",!0)(e=>{if(e.repeat)return;const t=new Ln(e);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(_n(document.body,"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(_n(document.body,"mousedown",!0)(e=>{this._keyStatus.lastKeyPressed=void 0})),this._subscriptions.add(_n(document.body,"mouseup",!0)(e=>{this._keyStatus.lastKeyPressed=void 0})),this._subscriptions.add(_n(document.body,"mousemove",!0)(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)})),this._subscriptions.add(_n(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 ss.instance||(ss.instance=new ss),ss.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}var rs=i("3fa4");class as{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos!1)){return new us(new ds(e))}static forStrings(){return new us(new as)}static forConfigKeys(){return new us(new ls)}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new hs,this._root.segment=i.value()),n=this._root;while(1){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new hs,n.left.segment=i.value()),n=n.left;else if(e<0)n.right||(n.right=new hs,n.right.segment=i.value()),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new hs,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;while(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?void 0:t.value)&&void 0===(null===t||void 0===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;while(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()){t?(o.left=void 0,o.mid=void 0,o.right=void 0):o.value=void 0;while(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;break}o=t}break}i.next(),n.push([0,o]),o=o.mid}}}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n=void 0;while(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(),n=i.value||n,i=i.mid}}return i&&i.value||n}findSuperstr(e){const t=this._iter.reset(e);let i=this._root;while(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 gs{constructor(e,t){this[Symbol.toStringTag]="ResourceMap",e instanceof gs?(this.map=new Map(e.map),this.toKey=null!==t&&void 0!==t?t:gs.defaultToKey):(this.map=new Map,this.toKey=null!==e&&void 0!==e?e:gs.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){"undefined"!==typeof t&&(e=e.bind(t));for(let[i,n]of this.map)e(n,Xt.parse(i),this)}values(){return this.map.values()}*keys(){for(let e of this.map.keys())yield Xt.parse(e)}*entries(){for(let e of this.map.entries())yield[Xt.parse(e[0]),e[1]]}*[Symbol.iterator](){for(let e of this.map)yield[Xt.parse(e[0]),e[1]]}}gs.defaultToKey=e=>e.toString();class fs{constructor(){this[Symbol.toStringTag]="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:this.addItemLast(n);break;case 1:this.addItemFirst(n);break;case 2:this.addItemLast(n);break;default:this.addItemLast(n);break}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;while(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](){return 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](){return 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](){return 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}[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;while(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 ms extends fs{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))}}var ps=i("c223");function _s(e){let t=JSON.parse(e);return t=bs(t),t}function bs(e,t=0){if(!e||t>200)return e;if("object"===typeof e){switch(e.$mid){case 1:return Xt.revive(e);case 2:return new RegExp(e.source,e.flags)}if(e instanceof ps["a"]||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;ie.length)return!1;if(i){const i=Object(rs["Q"])(e,t);if(!i)return!1;if(t.length===e.length)return!0;let o=t.length;return t.charAt(t.length-1)===n&&o--,e.charAt(o)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function Cs(e){return ii(e,!0)}class ys{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Object(rs["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 Xt.joinPath(e,...t)}basenameOrAuthority(e){return xs(e)||e.authority}basename(e){return Ot.basename(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===zn.file?t=Xt.file(Ft(Cs(e))).path:(t=Ot.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===zn.file?Xt.file(At(Cs(e))).path:Ot.normalize(e.path),e.with({path:t})}resolvePath(e,t){if(e.scheme===zn.file){const i=Xt.file(Rt(Cs(e),t));return e.with({authority:i.authority,path:i.path})}return-1===t.indexOf("/")&&(t=vs(t),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t)),e.with({path:Ot.resolve(e.path,t)})}}const Ss=new ys(()=>!1),xs=(Ss.isEqual.bind(Ss),Ss.basenameOrAuthority.bind(Ss),Ss.basename.bind(Ss)),Ls=(Ss.dirname.bind(Ss),Ss.joinPath.bind(Ss),Ss.normalizePath.bind(Ss));Ss.resolvePath.bind(Ss);var ks;function Es(e){return"string"===typeof e}function Ds(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ns(e){return"number"===typeof e&&!isNaN(e)}function Is(e){return!0===e||!1===e}function Ts(e){return"undefined"===typeof e}function Ms(e){return Ts(e)||null===e}function Os(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function As(e){return"function"===typeof e}function Rs(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 o of e)n[o]=i(o);return n}function Vs(e){return null===e?void 0:e}(function(e){function t(t){const i=new Map,n=t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";"));n.split(";").forEach(e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(e.META_DATA_MIME,o),i}e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=t})(ks||(ks={}));const Hs=Zi("commandService"),zs=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Ye,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 n of e.description.args)t.push(n.constraint);const i=e.handler;e.handler=function(e,...n){return Rs(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new ze,this._commands.set(i,n));let o=n.unshift(e),s=Pe(()=>{o();const e=this._commands.get(i);(null===e||void 0===e?void 0:e.isEmpty())&&this._commands.delete(i)});return this._onDidRegisterCommand.fire(i),s}registerCommandAlias(e,t){return zs.registerCommand(e,(e,...i)=>e.get(Hs).executeCommand(t,...i))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return Ee.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}};var Us;(function(e){e[e["API"]=0]="API",e[e["USER"]=1]="USER"})(Us||(Us={}));var Ks=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const js=Zi("openerService");Object.freeze({_serviceBrand:void 0,registerOpener(){return We.None},registerValidator(){return We.None},registerExternalUriResolver(){return We.None},setDefaultExternalOpener(){},registerExternalOpener(){return We.None},open(){return Ks(this,void 0,void 0,(function*(){return!1}))},resolveExternalUri(e){return Ks(this,void 0,void 0,(function*(){return{resolved:e,dispose(){}}}))}});function qs(e,t){return Xt.isUri(e)?Object(rs["r"])(e.scheme,t):Object(rs["Q"])(e,t+":")}var $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},Gs=function(e,t){return function(i,n){t(i,n,e)}},Ys=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Xs=class{constructor(e){this._commandService=e}open(e){return Ys(this,void 0,void 0,(function*(){if(!qs(e,zn.command))return!1;"string"===typeof e&&(e=Xt.parse(e));let t=[];try{t=_s(decodeURIComponent(e.query))}catch(i){try{t=_s(e.query)}catch(n){}}return Array.isArray(t)||(t=[t]),yield this._commandService.executeCommand(e.path,...t),!0}))}};Xs=$s([Gs(0,Hs)],Xs);let Zs=class{constructor(e){this._editorService=e}open(e,t){return Ys(this,void 0,void 0,(function*(){"string"===typeof e&&(e=Xt.parse(e));let i=void 0;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===zn.file&&(e=Ls(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,context:(null===t||void 0===t?void 0:t.fromUserGesture)?Us.USER:Us.API},null===t||void 0===t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null===t||void 0===t?void 0:t.openToSide),!0}))}};Zs=$s([Gs(0,Ji)],Zs);let Qs=class{constructor(e,t){this._openers=new ze,this._validators=new ze,this._resolvers=new ze,this._resolvedUriTargets=new gs(e=>e.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new ze,this._defaultExternalOpener={openExternal:e=>Ys(this,void 0,void 0,(function*(){return qs(e,zn.http)||qs(e,zn.https)?is(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>Ys(this,void 0,void 0,(function*(){return!!((null===t||void 0===t?void 0:t.openExternal)||qs(e,zn.mailto)||qs(e,zn.http)||qs(e,zn.https))&&(yield this._doOpenExternal(e,t),!0)}))}),this._openers.push(new Xs(t)),this._openers.push(new Zs(e))}registerOpener(e){const t=this._openers.unshift(e);return{dispose:t}}registerValidator(e){const t=this._validators.push(e);return{dispose:t}}registerExternalUriResolver(e){const t=this._resolvers.push(e);return{dispose:t}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){const t=this._externalOpeners.push(e);return{dispose:t}}open(e,t){var i;return Ys(this,void 0,void 0,(function*(){const n="string"===typeof e?Xt.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){const n=yield i.open(e,t);if(n)return!0}return!1}))}resolveExternalUri(e,t){return Ys(this,void 0,void 0,(function*(){for(const i of this._resolvers){const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.set(n.resolved,e),n}return{resolved:e,dispose:()=>{}}}))}_doOpenExternal(e,t){return Ys(this,void 0,void 0,(function*(){const i="string"===typeof e?Xt.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?void 0:t.allowContributedOpeners){const e="string"===typeof(null===t||void 0===t?void 0:t.allowContributedOpeners)?null===t||void 0===t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners){const n=yield t.openExternal(o,{sourceUri:i,preferredOpenerId:e},et.None);if(n)return!0}}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},et.None)}))}dispose(){this._validators.clear()}};function Js(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function er(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]=er(e[i]):t[i]=e[i]}),t}function tr(e){if(!e||"object"!==typeof e)return e;const t=[e];while(t.length>0){const e=t.shift();Object.freeze(e);for(const i in e)if(ir.call(e,i)){const n=e[i];"object"!==typeof n||Object.isFrozen(n)||t.push(n)}}return e}Qs=$s([Gs(0,Ji),Gs(1,Hs)],Qs);const ir=Object.prototype.hasOwnProperty;function nr(e,t,i=!0){return Ds(e)?(Ds(t)&&Object.keys(t).forEach(n=>{n in e?i&&(Ds(e[n])&&Ds(t[n])?nr(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]}),e):t}function or(e,t){if(e===t)return!0;if(null===e||void 0===e||null===t||void 0===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;ithis.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 li(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})}):this.ranges.push({rhs:!0,range:new li(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}}const lr=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new Ye,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))}},cr=s["f"]?1.5:1.35,dr=8;class hr{constructor(e){this.zoomLevel=e.zoomLevel,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}static createFromValidatedSettings(e,t,i,n){const o=e.get(37),s=e.get(41),r=e.get(40),a=e.get(39),l=e.get(53),c=e.get(50);return hr._create(o,s,r,a,l,c,t,i,n)}static _create(e,t,i,n,o,s,r,a,l){0===o?o=Math.round(cr*i):o>>n)>>>0}function Lr(e,t=0,i=e.byteLength,n=0){for(let o=0;oe.toString(16).padStart(2,"0")).join(""):kr((e>>>0).toString(16),t/4)}class Dr{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 n,o,s=this._buffLen,r=this._leftoverHighSurrogate;0!==r?(n=r,o=-1,r=0):(n=e.charCodeAt(0),o=0);while(1){let a=n;if(rs["D"](n)){if(!(o+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()),Er(this._h0)+Er(this._h1)+Er(this._h2)+Er(this._h3)+Er(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Lr(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Lr(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=Dr._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,xr(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let i,n,o,s=this._h0,r=this._h1,a=this._h2,l=this._h3,c=this._h4;for(let d=0;d<80;d++)d<20?(i=r&a|~r&l,n=1518500249):d<40?(i=r^a^l,n=1859775393):d<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),o=xr(s,5)+i+c+n+e.getUint32(4*d,!1)&4294967295,c=l,l=a,a=xr(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+l&4294967295,this._h4=this._h4+c&4294967295}}function Nr(e,t,i){return Math.min(Math.max(e,t),i)}Dr._bigBlock32=new DataView(new ArrayBuffer(320));const Ir="**",Tr="/",Mr="[/\\\\]",Or="[^/\\\\]",Ar=/\//g;function Rr(e){switch(e){case 0:return"";case 1:return Or+"*?";default:return`(?:${Mr}|${Or}+${Mr}|${Mr}${Or}+)*?`}}function Pr(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;break}s+=r}return s&&i.push(s),i}function Fr(e){if(!e)return"";let t="";const i=Pr(e,Tr);if(i.every(e=>e===Ir))t=".*";else{let e=!1;i.forEach((n,o)=>{if(n===Ir)return void(e||(t+=Rr(2),e=!0));let s=!1,r="",a=!1,l="";for(const e of n)if("}"!==e&&s)r+=e;else if(!a||"]"===e&&l)switch(e){case"{":s=!0;continue;case"[":a=!0;continue;case"}":const i=Pr(r,","),n=`(?:${i.map(e=>Fr(e)).join("|")})`;t+=n,s=!1,r="";break;case"]":t+="["+l+"]",a=!1,l="";break;case"?":t+=Or;continue;case"*":t+=Rr(1);continue;default:t+=rs["t"](e)}else{let t;t="-"===e?e:"^"!==e&&"!"!==e||l?e===Tr?"":rs["t"](e):"^",l+=t}o$r(e,t)).filter(e=>e!==qr),e),n=i.length;if(!n)return qr;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}function Qr(e,t,i){const n=Vt===Ot.sep,o=n?e:e.replace(Ar,Vt),s=Vt+o,r=Ot.sep+e,a=i?function(i,a){return"string"!==typeof i||i!==o&&!i.endsWith(s)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,s){return"string"!==typeof i||i!==o&&(n||i!==e)?null:t};return a.allPaths=[(i?"*/":"./")+e],a}function Jr(e){try{const t=new RegExp(`^${Fr(e)}$`);return function(i){return t.lastIndex=0,"string"===typeof i&&t.test(i)?e:null}}catch(t){return qr}}function ea(e,t,i){return!(!e||"string"!==typeof t)&&ta(e)(t,void 0,i)}function ta(e,t={}){if(!e)return jr;if("string"===typeof e||ia(e)){const i=$r(e,t);if(i===qr)return jr;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return na(e,t)}function ia(e){const t=e;return t&&"string"===typeof t.base&&"string"===typeof t.pattern}function na(e,t){const i=sa(Object.getOwnPropertyNames(e).map(i=>oa(i,e[i],t)).filter(e=>e!==qr)),n=i.length;if(!n)return qr;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=void 0;for(let s=0,r=i.length;s!!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}function oa(e,t,i){if(!1===t)return qr;const n=$r(e,i);if(n===qr)return qr;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 a=i.replace("$(basename)",s),l=r(a);return On(l)?l.then(t=>t?e:null):l?e:null};return t.requiresSiblings=!0,t}}return n}function sa(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 ra(e,t,i,n){if(Array.isArray(e)){let o=0;for(const s of e){const e=ra(s,t,i,n);if(10===e)return e;e>o&&(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:a}=e;if(!n&&!a)return 0;let l=0;if(r)if(r===t.scheme)l=10;else{if("*"!==r)return 0;l=5}if(o)if(o===i)l=10;else{if("*"!==o)return 0;l=Math.max(l,5)}if(s){let e;if(e="string"===typeof s?s:Object.assign(Object.assign({},s),{base:At(s.base)}),e!==t.fsPath&&!ea(e,t.fsPath))return 0;l=10}return l}return 0}const aa=Zi("modelService");function la(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}function ca(e){return"string"!==typeof e&&(Array.isArray(e)?e.every(ca):!!e.exclusive)}class da{constructor(){this._clock=0,this._entries=[],this._onDidChange=new Ye}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),Pe(()=>{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 i of this._entries)i._score>0&&t.push(i.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=ra(t.selector,e.uri,e.getLanguageIdentifier().language,la(e)),ca(t.selector)&&t._score>0){for(let e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(da._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:e._timet._time?-1:0}}class ha{constructor(){this._map=new Map,this._promises=new Map,this._onDidChange=new Ye,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]),Pe(()=>{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))})),Pe(()=>{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}}class ua{constructor(){this._icons=new Map,this._onDidRegister=new Ye}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}}const ga=new ua,fa=ga;function ma(e,t){return new pa(e,t)}class pa{constructor(e,t,i){this.id=e,this.definition=t,this.description=i,ga.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var _a;(function(e){function t(i){if(i instanceof pa)return["codicon","codicon-"+i.id];const n=e.iconIdRegex.exec(i.id);if(!n)return t(pa.error);let[,,o,s]=n;const r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s),r}function i(e){return t(e).join(" ")}function n(e){return"."+t(e).join(".")}e.iconIdRegex=/^(codicon\/)?([a-z\-]+)(?:~([a-z\-]+))?$/i,e.asClassNameArray=t,e.asClassName=i,e.asCSSSelector=n})(_a||(_a={})),function(e){e.add=new e("add",{character:"\\ea60"}),e.plus=new e("plus",{character:"\\ea60"}),e.gistNew=new e("gist-new",{character:"\\ea60"}),e.repoCreate=new e("repo-create",{character:"\\ea60"}),e.lightbulb=new e("lightbulb",{character:"\\ea61"}),e.lightBulb=new e("light-bulb",{character:"\\ea61"}),e.repo=new e("repo",{character:"\\ea62"}),e.repoDelete=new e("repo-delete",{character:"\\ea62"}),e.gistFork=new e("gist-fork",{character:"\\ea63"}),e.repoForked=new e("repo-forked",{character:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{character:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{character:"\\ea64"}),e.recordKeys=new e("record-keys",{character:"\\ea65"}),e.keyboard=new e("keyboard",{character:"\\ea65"}),e.tag=new e("tag",{character:"\\ea66"}),e.tagAdd=new e("tag-add",{character:"\\ea66"}),e.tagRemove=new e("tag-remove",{character:"\\ea66"}),e.person=new e("person",{character:"\\ea67"}),e.personAdd=new e("person-add",{character:"\\ea67"}),e.personFollow=new e("person-follow",{character:"\\ea67"}),e.personOutline=new e("person-outline",{character:"\\ea67"}),e.personFilled=new e("person-filled",{character:"\\ea67"}),e.gitBranch=new e("git-branch",{character:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{character:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{character:"\\ea68"}),e.sourceControl=new e("source-control",{character:"\\ea68"}),e.mirror=new e("mirror",{character:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{character:"\\ea69"}),e.star=new e("star",{character:"\\ea6a"}),e.starAdd=new e("star-add",{character:"\\ea6a"}),e.starDelete=new e("star-delete",{character:"\\ea6a"}),e.starEmpty=new e("star-empty",{character:"\\ea6a"}),e.comment=new e("comment",{character:"\\ea6b"}),e.commentAdd=new e("comment-add",{character:"\\ea6b"}),e.alert=new e("alert",{character:"\\ea6c"}),e.warning=new e("warning",{character:"\\ea6c"}),e.search=new e("search",{character:"\\ea6d"}),e.searchSave=new e("search-save",{character:"\\ea6d"}),e.logOut=new e("log-out",{character:"\\ea6e"}),e.signOut=new e("sign-out",{character:"\\ea6e"}),e.logIn=new e("log-in",{character:"\\ea6f"}),e.signIn=new e("sign-in",{character:"\\ea6f"}),e.eye=new e("eye",{character:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{character:"\\ea70"}),e.eyeWatch=new e("eye-watch",{character:"\\ea70"}),e.circleFilled=new e("circle-filled",{character:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{character:"\\ea71"}),e.closeDirty=new e("close-dirty",{character:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{character:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{character:"\\ea71"}),e.debugHint=new e("debug-hint",{character:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{character:"\\ea72"}),e.edit=new e("edit",{character:"\\ea73"}),e.pencil=new e("pencil",{character:"\\ea73"}),e.info=new e("info",{character:"\\ea74"}),e.issueOpened=new e("issue-opened",{character:"\\ea74"}),e.gistPrivate=new e("gist-private",{character:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{character:"\\ea75"}),e.lock=new e("lock",{character:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{character:"\\ea75"}),e.close=new e("close",{character:"\\ea76"}),e.removeClose=new e("remove-close",{character:"\\ea76"}),e.x=new e("x",{character:"\\ea76"}),e.repoSync=new e("repo-sync",{character:"\\ea77"}),e.sync=new e("sync",{character:"\\ea77"}),e.clone=new e("clone",{character:"\\ea78"}),e.desktopDownload=new e("desktop-download",{character:"\\ea78"}),e.beaker=new e("beaker",{character:"\\ea79"}),e.microscope=new e("microscope",{character:"\\ea79"}),e.vm=new e("vm",{character:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{character:"\\ea7a"}),e.file=new e("file",{character:"\\ea7b"}),e.fileText=new e("file-text",{character:"\\ea7b"}),e.more=new e("more",{character:"\\ea7c"}),e.ellipsis=new e("ellipsis",{character:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{character:"\\ea7c"}),e.mailReply=new e("mail-reply",{character:"\\ea7d"}),e.reply=new e("reply",{character:"\\ea7d"}),e.organization=new e("organization",{character:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{character:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{character:"\\ea7e"}),e.newFile=new e("new-file",{character:"\\ea7f"}),e.fileAdd=new e("file-add",{character:"\\ea7f"}),e.newFolder=new e("new-folder",{character:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{character:"\\ea80"}),e.trash=new e("trash",{character:"\\ea81"}),e.trashcan=new e("trashcan",{character:"\\ea81"}),e.history=new e("history",{character:"\\ea82"}),e.clock=new e("clock",{character:"\\ea82"}),e.folder=new e("folder",{character:"\\ea83"}),e.fileDirectory=new e("file-directory",{character:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{character:"\\ea83"}),e.logoGithub=new e("logo-github",{character:"\\ea84"}),e.markGithub=new e("mark-github",{character:"\\ea84"}),e.github=new e("github",{character:"\\ea84"}),e.terminal=new e("terminal",{character:"\\ea85"}),e.console=new e("console",{character:"\\ea85"}),e.repl=new e("repl",{character:"\\ea85"}),e.zap=new e("zap",{character:"\\ea86"}),e.symbolEvent=new e("symbol-event",{character:"\\ea86"}),e.error=new e("error",{character:"\\ea87"}),e.stop=new e("stop",{character:"\\ea87"}),e.variable=new e("variable",{character:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{character:"\\ea88"}),e.array=new e("array",{character:"\\ea8a"}),e.symbolArray=new e("symbol-array",{character:"\\ea8a"}),e.symbolModule=new e("symbol-module",{character:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{character:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{character:"\\ea8b"}),e.symbolObject=new e("symbol-object",{character:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{character:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{character:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{character:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{character:"\\ea8f"}),e.symbolNull=new e("symbol-null",{character:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{character:"\\ea90"}),e.symbolNumber=new e("symbol-number",{character:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{character:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{character:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{character:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{character:"\\ea92"}),e.symbolKey=new e("symbol-key",{character:"\\ea93"}),e.symbolText=new e("symbol-text",{character:"\\ea93"}),e.symbolReference=new e("symbol-reference",{character:"\\ea94"}),e.goToFile=new e("go-to-file",{character:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{character:"\\ea95"}),e.symbolValue=new e("symbol-value",{character:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{character:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{character:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{character:"\\ea97"}),e.archive=new e("archive",{character:"\\ea98"}),e.arrowBoth=new e("arrow-both",{character:"\\ea99"}),e.arrowDown=new e("arrow-down",{character:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{character:"\\ea9b"}),e.arrowRight=new e("arrow-right",{character:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{character:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{character:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{character:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{character:"\\eaa0"}),e.arrowUp=new e("arrow-up",{character:"\\eaa1"}),e.bell=new e("bell",{character:"\\eaa2"}),e.bold=new e("bold",{character:"\\eaa3"}),e.book=new e("book",{character:"\\eaa4"}),e.bookmark=new e("bookmark",{character:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{character:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{character:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{character:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{character:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{character:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{character:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{character:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{character:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{character:"\\eaab"}),e.briefcase=new e("briefcase",{character:"\\eaac"}),e.broadcast=new e("broadcast",{character:"\\eaad"}),e.browser=new e("browser",{character:"\\eaae"}),e.bug=new e("bug",{character:"\\eaaf"}),e.calendar=new e("calendar",{character:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{character:"\\eab1"}),e.check=new e("check",{character:"\\eab2"}),e.checklist=new e("checklist",{character:"\\eab3"}),e.chevronDown=new e("chevron-down",{character:"\\eab4"}),e.chevronLeft=new e("chevron-left",{character:"\\eab5"}),e.chevronRight=new e("chevron-right",{character:"\\eab6"}),e.chevronUp=new e("chevron-up",{character:"\\eab7"}),e.chromeClose=new e("chrome-close",{character:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{character:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{character:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{character:"\\eabb"}),e.circleOutline=new e("circle-outline",{character:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{character:"\\eabc"}),e.circleSlash=new e("circle-slash",{character:"\\eabd"}),e.circuitBoard=new e("circuit-board",{character:"\\eabe"}),e.clearAll=new e("clear-all",{character:"\\eabf"}),e.clippy=new e("clippy",{character:"\\eac0"}),e.closeAll=new e("close-all",{character:"\\eac1"}),e.cloudDownload=new e("cloud-download",{character:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{character:"\\eac3"}),e.code=new e("code",{character:"\\eac4"}),e.collapseAll=new e("collapse-all",{character:"\\eac5"}),e.colorMode=new e("color-mode",{character:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{character:"\\eac7"}),e.compareChanges=new e("compare-changes",{character:"\\eafd"}),e.creditCard=new e("credit-card",{character:"\\eac9"}),e.dash=new e("dash",{character:"\\eacc"}),e.dashboard=new e("dashboard",{character:"\\eacd"}),e.database=new e("database",{character:"\\eace"}),e.debugContinue=new e("debug-continue",{character:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{character:"\\ead0"}),e.debugPause=new e("debug-pause",{character:"\\ead1"}),e.debugRestart=new e("debug-restart",{character:"\\ead2"}),e.debugStart=new e("debug-start",{character:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{character:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{character:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{character:"\\ead6"}),e.debugStop=new e("debug-stop",{character:"\\ead7"}),e.debug=new e("debug",{character:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{character:"\\ead9"}),e.deviceCamera=new e("device-camera",{character:"\\eada"}),e.deviceMobile=new e("device-mobile",{character:"\\eadb"}),e.diffAdded=new e("diff-added",{character:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{character:"\\eadd"}),e.diffModified=new e("diff-modified",{character:"\\eade"}),e.diffRemoved=new e("diff-removed",{character:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{character:"\\eae0"}),e.diff=new e("diff",{character:"\\eae1"}),e.discard=new e("discard",{character:"\\eae2"}),e.editorLayout=new e("editor-layout",{character:"\\eae3"}),e.emptyWindow=new e("empty-window",{character:"\\eae4"}),e.exclude=new e("exclude",{character:"\\eae5"}),e.extensions=new e("extensions",{character:"\\eae6"}),e.eyeClosed=new e("eye-closed",{character:"\\eae7"}),e.fileBinary=new e("file-binary",{character:"\\eae8"}),e.fileCode=new e("file-code",{character:"\\eae9"}),e.fileMedia=new e("file-media",{character:"\\eaea"}),e.filePdf=new e("file-pdf",{character:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{character:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{character:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{character:"\\eaee"}),e.fileZip=new e("file-zip",{character:"\\eaef"}),e.files=new e("files",{character:"\\eaf0"}),e.filter=new e("filter",{character:"\\eaf1"}),e.flame=new e("flame",{character:"\\eaf2"}),e.foldDown=new e("fold-down",{character:"\\eaf3"}),e.foldUp=new e("fold-up",{character:"\\eaf4"}),e.fold=new e("fold",{character:"\\eaf5"}),e.folderActive=new e("folder-active",{character:"\\eaf6"}),e.folderOpened=new e("folder-opened",{character:"\\eaf7"}),e.gear=new e("gear",{character:"\\eaf8"}),e.gift=new e("gift",{character:"\\eaf9"}),e.gistSecret=new e("gist-secret",{character:"\\eafa"}),e.gist=new e("gist",{character:"\\eafb"}),e.gitCommit=new e("git-commit",{character:"\\eafc"}),e.gitCompare=new e("git-compare",{character:"\\eafd"}),e.gitMerge=new e("git-merge",{character:"\\eafe"}),e.githubAction=new e("github-action",{character:"\\eaff"}),e.githubAlt=new e("github-alt",{character:"\\eb00"}),e.globe=new e("globe",{character:"\\eb01"}),e.grabber=new e("grabber",{character:"\\eb02"}),e.graph=new e("graph",{character:"\\eb03"}),e.gripper=new e("gripper",{character:"\\eb04"}),e.heart=new e("heart",{character:"\\eb05"}),e.home=new e("home",{character:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{character:"\\eb07"}),e.hubot=new e("hubot",{character:"\\eb08"}),e.inbox=new e("inbox",{character:"\\eb09"}),e.issueClosed=new e("issue-closed",{character:"\\eb0a"}),e.issueReopened=new e("issue-reopened",{character:"\\eb0b"}),e.issues=new e("issues",{character:"\\eb0c"}),e.italic=new e("italic",{character:"\\eb0d"}),e.jersey=new e("jersey",{character:"\\eb0e"}),e.json=new e("json",{character:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{character:"\\eb10"}),e.key=new e("key",{character:"\\eb11"}),e.law=new e("law",{character:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{character:"\\eb13"}),e.linkExternal=new e("link-external",{character:"\\eb14"}),e.link=new e("link",{character:"\\eb15"}),e.listOrdered=new e("list-ordered",{character:"\\eb16"}),e.listUnordered=new e("list-unordered",{character:"\\eb17"}),e.liveShare=new e("live-share",{character:"\\eb18"}),e.loading=new e("loading",{character:"\\eb19"}),e.location=new e("location",{character:"\\eb1a"}),e.mailRead=new e("mail-read",{character:"\\eb1b"}),e.mail=new e("mail",{character:"\\eb1c"}),e.markdown=new e("markdown",{character:"\\eb1d"}),e.megaphone=new e("megaphone",{character:"\\eb1e"}),e.mention=new e("mention",{character:"\\eb1f"}),e.milestone=new e("milestone",{character:"\\eb20"}),e.mortarBoard=new e("mortar-board",{character:"\\eb21"}),e.move=new e("move",{character:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{character:"\\eb23"}),e.mute=new e("mute",{character:"\\eb24"}),e.noNewline=new e("no-newline",{character:"\\eb25"}),e.note=new e("note",{character:"\\eb26"}),e.octoface=new e("octoface",{character:"\\eb27"}),e.openPreview=new e("open-preview",{character:"\\eb28"}),e.package_=new e("package",{character:"\\eb29"}),e.paintcan=new e("paintcan",{character:"\\eb2a"}),e.pin=new e("pin",{character:"\\eb2b"}),e.play=new e("play",{character:"\\eb2c"}),e.run=new e("run",{character:"\\eb2c"}),e.plug=new e("plug",{character:"\\eb2d"}),e.preserveCase=new e("preserve-case",{character:"\\eb2e"}),e.preview=new e("preview",{character:"\\eb2f"}),e.project=new e("project",{character:"\\eb30"}),e.pulse=new e("pulse",{character:"\\eb31"}),e.question=new e("question",{character:"\\eb32"}),e.quote=new e("quote",{character:"\\eb33"}),e.radioTower=new e("radio-tower",{character:"\\eb34"}),e.reactions=new e("reactions",{character:"\\eb35"}),e.references=new e("references",{character:"\\eb36"}),e.refresh=new e("refresh",{character:"\\eb37"}),e.regex=new e("regex",{character:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{character:"\\eb39"}),e.remote=new e("remote",{character:"\\eb3a"}),e.remove=new e("remove",{character:"\\eb3b"}),e.replaceAll=new e("replace-all",{character:"\\eb3c"}),e.replace=new e("replace",{character:"\\eb3d"}),e.repoClone=new e("repo-clone",{character:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{character:"\\eb3f"}),e.repoPull=new e("repo-pull",{character:"\\eb40"}),e.repoPush=new e("repo-push",{character:"\\eb41"}),e.report=new e("report",{character:"\\eb42"}),e.requestChanges=new e("request-changes",{character:"\\eb43"}),e.rocket=new e("rocket",{character:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{character:"\\eb45"}),e.rootFolder=new e("root-folder",{character:"\\eb46"}),e.rss=new e("rss",{character:"\\eb47"}),e.ruby=new e("ruby",{character:"\\eb48"}),e.saveAll=new e("save-all",{character:"\\eb49"}),e.saveAs=new e("save-as",{character:"\\eb4a"}),e.save=new e("save",{character:"\\eb4b"}),e.screenFull=new e("screen-full",{character:"\\eb4c"}),e.screenNormal=new e("screen-normal",{character:"\\eb4d"}),e.searchStop=new e("search-stop",{character:"\\eb4e"}),e.server=new e("server",{character:"\\eb50"}),e.settingsGear=new e("settings-gear",{character:"\\eb51"}),e.settings=new e("settings",{character:"\\eb52"}),e.shield=new e("shield",{character:"\\eb53"}),e.smiley=new e("smiley",{character:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{character:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{character:"\\eb56"}),e.splitVertical=new e("split-vertical",{character:"\\eb57"}),e.squirrel=new e("squirrel",{character:"\\eb58"}),e.starFull=new e("star-full",{character:"\\eb59"}),e.starHalf=new e("star-half",{character:"\\eb5a"}),e.symbolClass=new e("symbol-class",{character:"\\eb5b"}),e.symbolColor=new e("symbol-color",{character:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{character:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{character:"\\eb5e"}),e.symbolField=new e("symbol-field",{character:"\\eb5f"}),e.symbolFile=new e("symbol-file",{character:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{character:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{character:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{character:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{character:"\\eb64"}),e.symbolProperty=new e("symbol-property",{character:"\\eb65"}),e.wrench=new e("wrench",{character:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{character:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{character:"\\eb66"}),e.tasklist=new e("tasklist",{character:"\\eb67"}),e.telescope=new e("telescope",{character:"\\eb68"}),e.textSize=new e("text-size",{character:"\\eb69"}),e.threeBars=new e("three-bars",{character:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{character:"\\eb6b"}),e.thumbsup=new e("thumbsup",{character:"\\eb6c"}),e.tools=new e("tools",{character:"\\eb6d"}),e.triangleDown=new e("triangle-down",{character:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{character:"\\eb6f"}),e.triangleRight=new e("triangle-right",{character:"\\eb70"}),e.triangleUp=new e("triangle-up",{character:"\\eb71"}),e.twitter=new e("twitter",{character:"\\eb72"}),e.unfold=new e("unfold",{character:"\\eb73"}),e.unlock=new e("unlock",{character:"\\eb74"}),e.unmute=new e("unmute",{character:"\\eb75"}),e.unverified=new e("unverified",{character:"\\eb76"}),e.verified=new e("verified",{character:"\\eb77"}),e.versions=new e("versions",{character:"\\eb78"}),e.vmActive=new e("vm-active",{character:"\\eb79"}),e.vmOutline=new e("vm-outline",{character:"\\eb7a"}),e.vmRunning=new e("vm-running",{character:"\\eb7b"}),e.watch=new e("watch",{character:"\\eb7c"}),e.whitespace=new e("whitespace",{character:"\\eb7d"}),e.wholeWord=new e("whole-word",{character:"\\eb7e"}),e.window=new e("window",{character:"\\eb7f"}),e.wordWrap=new e("word-wrap",{character:"\\eb80"}),e.zoomIn=new e("zoom-in",{character:"\\eb81"}),e.zoomOut=new e("zoom-out",{character:"\\eb82"}),e.listFilter=new e("list-filter",{character:"\\eb83"}),e.listFlat=new e("list-flat",{character:"\\eb84"}),e.listSelection=new e("list-selection",{character:"\\eb85"}),e.selection=new e("selection",{character:"\\eb85"}),e.listTree=new e("list-tree",{character:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{character:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{character:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{character:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{character:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{character:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{character:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{character:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{character:"\\eb8c"}),e.symbolString=new e("symbol-string",{character:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{character:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{character:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{character:"\\eb90"}),e.callIncoming=new e("call-incoming",{character:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{character:"\\eb93"}),e.menu=new e("menu",{character:"\\eb94"}),e.expandAll=new e("expand-all",{character:"\\eb95"}),e.feedback=new e("feedback",{character:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{character:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{character:"\\eb98"}),e.account=new e("account",{character:"\\eb99"}),e.bellDot=new e("bell-dot",{character:"\\eb9a"}),e.debugConsole=new e("debug-console",{character:"\\eb9b"}),e.library=new e("library",{character:"\\eb9c"}),e.output=new e("output",{character:"\\eb9d"}),e.runAll=new e("run-all",{character:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{character:"\\eb9f"}),e.pinned=new e("pinned",{character:"\\eba0"}),e.githubInverted=new e("github-inverted",{character:"\\eba1"}),e.debugAlt=new e("debug-alt",{character:"\\eb91"}),e.serverProcess=new e("server-process",{character:"\\eba2"}),e.serverEnvironment=new e("server-environment",{character:"\\eba3"}),e.pass=new e("pass",{character:"\\eba4"}),e.stopCircle=new e("stop-circle",{character:"\\eba5"}),e.playCircle=new e("play-circle",{character:"\\eba6"}),e.record=new e("record",{character:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{character:"\\eba8"}),e.vmConnect=new e("vm-connect",{character:"\\eba9"}),e.cloud=new e("cloud",{character:"\\ebaa"}),e.merge=new e("merge",{character:"\\ebab"}),e.exportIcon=new e("export",{character:"\\ebac"}),e.graphLeft=new e("graph-left",{character:"\\ebad"}),e.magnet=new e("magnet",{character:"\\ebae"}),e.notebook=new e("notebook",{character:"\\ebaf"}),e.redo=new e("redo",{character:"\\ebb0"}),e.checkAll=new e("check-all",{character:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{character:"\\ebb2"}),e.passFilled=new e("pass-filled",{character:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{character:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{character:"\\ebb5"}),e.combine=new e("combine",{character:"\\ebb6"}),e.gather=new e("gather",{character:"\\ebb6"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition)}(pa||(pa={}));class ba{constructor(e,t){this.language=e,this.id=t}}class va{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=this.getForeground(e),i="mtk"+t,n=this.getFontStyle(e);return 1&n&&(i+=" mtki"),2&n&&(i+=" mtkb"),4&n&&(i+=" mtku"),i}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}}(function(){let e=Object.create(null);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(){let e=Object.create(null);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})();var wa,Ca,ya;(function(e){e[e["Invoke"]=1]="Invoke",e[e["TriggerCharacter"]=2]="TriggerCharacter",e[e["ContentChange"]=3]="ContentChange"})(wa||(wa={})),function(e){e[e["Text"]=0]="Text",e[e["Read"]=1]="Read",e[e["Write"]=2]="Write"}(Ca||(Ca={})),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;function n(e){return t.get(e)}function o(e){return i.get(e)}function s(e,t){const n=i.get(e);let o=n&&fa.get("symbol-"+n);return o||(console.info("No codicon found for SymbolKind "+e),o=pa.symbolProperty),`${t?"inline":"block"} ${o.classNames}`}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=n,e.toString=o,e.toCssClassName=s}(ya||(ya={}));class Sa{constructor(e){this.value=e}}Sa.Comment=new Sa("comment"),Sa.Imports=new Sa("imports"),Sa.Region=new Sa("region");const xa=new da,La=new da,ka=new da,Ea=new da,Da=new da,Na=new da,Ia=new da,Ta=new da,Ma=new da,Oa=new da,Aa=new da,Ra=new da,Pa=new da,Fa=new da,Wa=new da,Ba=new da,Va=new da,Ha=new da,za=new da,Ua=new da,Ka=new da,ja=new da,qa=new da,$a=new da,Ga=new ha;class Ya{clone(){return this}equals(e){return this===e}}const Xa=new Ya,Za="vs.editor.nullMode",Qa=new ba(Za,0);function Ja(e,t,i,n){return new hi([new di(n,"",e)],i)}function el(e,t,i,n){let o=new Uint32Array(2);return o[0]=n,o[1]=(16384|e<<0|2<<23)>>>0,new ui(o,null===i?Xa:i)}const tl="editorWorkerService",il=Zi(tl),nl=Zi("modeService"),ol=Zi("textModelService"),sl="$initialize";let rl=!1;function al(e){s["i"]&&(rl||(rl=!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 ll{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,n=this._handler.handleMessage(t.method,t.args);n.then(e=>{this._send({vsWorker:this._workerId,seq:i,res:e,err:void 0})},e=>{e.detail instanceof Error&&(e.detail=Ce(e.detail)),this._send({vsWorker:this._workerId,seq:i,res:void 0,err:Ce(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 ll({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(n){return Promise.reject(n)}}}),this._protocol.setWorkerId(this._worker.getId());let o=null;"undefined"!==typeof self.require&&"function"===typeof self.require.getConfig?o=self.require.getConfig():"undefined"!==typeof self.requirejs&&(o=self.requirejs.s.contexts._.config);const s=Ws(i);this._onModuleLoaded=this._protocol.sendMessage(sl,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,s]);const r=(e,t)=>this._request(e,t);this._lazyProxy=new Promise((e,i)=>{n=i,this._onModuleLoaded.then(t=>{e(Bs(t,r))},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)}}var dl;const hl=null===(dl=window.trustedTypes)||void 0===dl?void 0:dl.createPolicy("defaultWorkerFactory",{createScriptURL:e=>e});function ul(e,t){if(s["b"].MonacoEnvironment){if("function"===typeof s["b"].MonacoEnvironment.getWorker)return s["b"].MonacoEnvironment.getWorker(e,t);if("function"===typeof s["b"].MonacoEnvironment.getWorkerUrl){const i=s["b"].MonacoEnvironment.getWorkerUrl(e,t);return new Worker(hl?hl.createScriptURL(i):i,{name:t})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function gl(e){return"function"===typeof e.then}class fl{constructor(e,t,i,n,o){this.id=t;const s=ul("workerMain.js",i);gl(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=o,"function"===typeof e.addEventListener&&e.addEventListener("error",o)})}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 ml{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let n=++ml.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new fl(e,n,this._label||"anonymous"+n,t,e=>{al(e),this._webWorkerFailedBeforeError=e,i(e)})}}var pl;ml.LAST_WORKER_ID=0,function(e){e[e["None"]=0]="None",e[e["Indent"]=1]="Indent",e[e["IndentOutdent"]=2]="IndentOutdent",e[e["Outdent"]=3]="Outdent"}(pl||(pl={}));class _l{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;t0&&e.getLanguageId(r-1)===o)r--;return new Cl(e,o,r,s+1,e.getStartOffset(r),e.getEndOffset(s))}class Cl{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(){const e=this._actual.getLineContent();return e.substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){const t=this._actual.getLineContent();return t.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 yl(e){return 0!==(7&e)}class Sl{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(e=>new _l(e)):e.brackets?this._autoClosingPairs=e.brackets.map(e=>new _l({open:e[0],close:e[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new _l({open:t.open,close:t.close||""}))}this._autoCloseBefore="string"===typeof e.autoCloseBefore?e.autoCloseBefore:Sl.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}}let xl;function Ll(){return xl||(xl=new TextDecoder(s["e"]()?"UTF-16LE":"UTF-16BE")),xl}Sl.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t";const kl="undefined"!==typeof TextDecoder;let El,Dl;function Nl(e,t,i){const n=new Uint16Array(e.buffer,t,i);return Ll().decode(n)}function Il(e,t,i){let n=[],o=0;for(let s=0;snew Tl(e),Dl=Nl):(El=e=>new Ml,Dl=Il);class Tl{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 Ll().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||rs["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[e[0].toLowerCase(),e[1].toLowerCase()]);const i=[];for(let r=0;r{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 r=0;r0&&s.push({open:n,close:o})}return s}class Rl{constructor(e,t){const i=Al(t);this.brackets=i.map((t,n)=>new Ol(e,n,t.open,t.close,Bl(t.open,t.close,i,n),Vl(t.open,t.close,i,n))),this.forwardRegex=Hl(this.brackets),this.reversedRegex=zl(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const e of n.open)this.textIsBracket[e]=n,this.textIsOpenBracket[e]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,e.length);for(const e of n.close)this.textIsBracket[e]=n,this.textIsOpenBracket[e]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,e.length)}}}function Pl(e,t,i,n){for(let o=0,s=t.length;o=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function Fl(e,t){return e.length-t.length}function Wl(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 Bl(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let s=0,r=o.length;s=0;n--)t[i++]=e.charCodeAt(n);return Ll().decode(t)}{let t=[],i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charAt(n);return t.join("")}}let t=null,i=null;return function(n){return t!==n&&(t=n,i=e(t)),i}}();class ql{static _findPrevBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let s=i.length-(o.index||0),r=o[0].length,a=n+s;return new li(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,o){const s=jl(i),r=s.substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,r,n)}static findNextBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let s=o.index||0,r=o[0].length;if(0===r)return null;let a=n+s;return new li(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}class $l{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(yl(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=ql.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase(),l=this._richEditBrackets.textIsOpenBracket[a];if(l)return null;const c=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(c)?{matchOpenBracket:a}:null}}function Gl(e){return e.global&&(e.lastIndex=0),!0}class Yl{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&Gl(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&Gl(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&Gl(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&Gl(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}}class Xl{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(e=>{const t=Xl._createOpenBracketRegExp(e[0]),i=Xl._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 o=0,s=this._regExpRules.length;o!e.reg||e.reg.test(e.text));if(s)return e.action}if(e>=2&&i.length>0&&n.length>0)for(let o=0,s=this._brackets.length;o=2&&i.length>0)for(let o=0,s=this._brackets.length;o{this._entries.get(e.id)===n&&(this._entries.set(e.id,i),this._onDidChange.fire(new Ql(e)))})}_getRichEditSupport(e){return this._entries.get(e)}getIndentationRules(e){const t=this._entries.get(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=wl(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 bl(t?t.getAutoClosingPairs():[])}getAutoCloseBeforeSet(e){let t=this._getCharacterPairSupport(e);return t?t.getAutoCloseBeforeSet():Sl.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED}getSurroundingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getSurroundingPairs():[]}shouldAutoClosePair(e,t,i){const n=wl(t,i-1);return Sl.shouldAutoClosePair(e,n,i-n.firstCharOffset)}getWordDefinition(e){let t=this._getRichEditSupport(e);return c(t&&t.wordDefinition||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 s=this.getPrecedingValidLine(t,i,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const r=t.getLineContent(s);if(o.shouldIncrease(r)||o.shouldIndentNextLine(r))return{indentation:rs["x"](r),action:pl.Indent,line:s};if(o.shouldDecrease(r))return{indentation:rs["x"](r),action:null,line:s};{if(1===s)return{indentation:rs["x"](t.getLineContent(s)),action:null,line:s};const e=s-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:rs["x"](t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:rs["x"](t.getLineContent(s)),action:null,line:s};for(let n=s;n>0;n--){const e=t.getLineContent(n);if(o.shouldIncrease(e))return{indentation:rs["x"](e),action:pl.Indent,line:n};if(o.shouldIndentNextLine(e)){let e=0;for(let i=n-1;i>0;i--)if(!o.shouldIndentNextLine(t.getLineContent(n))){e=i;break}return{indentation:rs["x"](t.getLineContent(e+1)),action:null,line:e+1}}if(o.shouldDecrease(e))return{indentation:rs["x"](e),action:null,line:n}}return{indentation:rs["x"](t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,n,o){if(e<4)return null;const s=this._getRichEditSupport(i);if(!s)return null;const r=this.getIndentRulesSupport(i);if(!r)return null;const a=this.getInheritIndentForLine(e,t,n),l=t.getLineContent(n);if(a){const i=a.line;if(void 0!==i){const n=s.onEnter(e,"",t.getLineContent(i),"");if(n){let e=rs["x"](t.getLineContent(i));return n.removeText&&(e=e.substring(0,e.length-n.removeText)),n.indentAction===pl.Indent||n.indentAction===pl.IndentOutdent?e=o.shiftIndent(e):n.indentAction===pl.Outdent&&(e=o.unshiftIndent(e)),r.shouldDecrease(l)&&(e=o.unshiftIndent(e)),n.appendText&&(e+=n.appendText),rs["x"](e)}}return r.shouldDecrease(l)?a.action===pl.Indent?a.indentation:o.unshiftIndent(a.indentation):a.action===pl.Indent?o.shiftIndent(a.indentation):a.indentation}return null}getIndentForEnter(e,t,i,n){if(e<4)return null;t.forceTokenization(i.startLineNumber);const o=t.getLineTokens(i.startLineNumber),s=wl(o,i.startColumn-1),r=s.getLineContent();let a,l,c=!1;if(s.firstCharOffset>0&&o.getLanguageId(0)!==s.languageId?(c=!0,a=r.substr(0,i.startColumn-1-s.firstCharOffset)):a=o.getLineContent().substring(0,i.startColumn-1),i.isEmpty())l=r.substr(i.startColumn-1-s.firstCharOffset);else{const e=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn);l=e.getLineContent().substr(i.endColumn-1-s.firstCharOffset)}const d=this.getIndentRulesSupport(s.languageId);if(!d)return null;const h=a,u=rs["x"](a),g={getLineTokens:e=>t.getLineTokens(e),getLanguageIdentifier:()=>t.getLanguageIdentifier(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i),getLineContent:e=>e===i.startLineNumber?h:t.getLineContent(e)},f=rs["x"](o.getLineContent()),m=this.getInheritIndentForLine(e,g,i.startLineNumber+1);if(!m){const e=c?f:u;return{beforeEnter:e,afterEnter:e}}let p=c?f:m.indentation;return m.action===pl.Indent&&(p=n.shiftIndent(p)),d.shouldDecrease(l)&&(p=n.unshiftIndent(p)),{beforeEnter:c?f:u,afterEnter:p}}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 a=s.getLineContent(),l=a.substr(0,i.startColumn-1-s.firstCharOffset);let c;if(i.isEmpty())c=a.substr(i.startColumn-1-s.firstCharOffset);else{const e=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn);c=e.getLineContent().substr(i.endColumn-1-s.firstCharOffset)}if(!r.shouldDecrease(l+c)&&r.shouldDecrease(l+n+c)){const n=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!n)return null;let s=n.indentation;return n.action!==pl.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 a;if(i.isEmpty())a=s.substr(i.startColumn-1-n.firstCharOffset);else{const e=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn);a=e.getLineContent().substr(i.endColumn-1-n.firstCharOffset)}let l="";if(i.startLineNumber>1&&0===n.firstCharOffset){const e=this.getScopedLineTokens(t,i.startLineNumber-1);e.languageId===n.languageId&&(l=e.getLineContent())}const c=o.onEnter(e,l,r,a);if(!c)return null;const d=c.indentAction;let h=c.appendText;const u=c.removeText||0;h?d===pl.Indent&&(h="\t"+h):h=d===pl.Indent||d===pl.IndentOutdent?"\t":"";let g=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return u&&(g=g.substring(0,g.length-u)),{indentAction:d,appendText:h,removeText:u,indentation:g}}getIndentationAtPosition(e,t,i){const n=e.getLineContent(t);let o=rs["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="undefined"===typeof i?e.getLineMaxColumn(t)-1:i-1;return wl(n,o)}getBracketsSupport(e){const t=this._getRichEditSupport(e);return t&&t.brackets||null}}const ec=new Jl;function tc(e,t=0){return e[e.length-(1+t)]}function ic(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function nc(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 sc(e,t){return ac(e,t,0,e.length-1,[]),e}function rc(e,t,i,n,o,s){let r=i,a=n+1;for(let l=i;l<=o;l++)s[l]=e[l];for(let l=i;l<=o;l++)r>n?e[l]=s[a++]:a>o?e[l]=s[r++]:t(s[a],s[r])<0?e[l]=s[a++]:e[l]=s[r++]}function ac(e,t,i,n,o){if(n<=i)return;const s=i+(n-i)/2|0;ac(e,t,i,s,o),ac(e,t,s+1,n,o),t(e[s],e[s+1])<=0||rc(e,t,i,s,n,o)}function lc(e){return e.filter(e=>!!e)}function cc(e){return!Array.isArray(e)||0===e.length}function dc(e){return Array.isArray(e)&&e.length>0}function hc(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 uc(e){const t=new Set;return e.filter(e=>!t.has(e)&&(t.add(e),!0))}function gc(e,t){return e.length>0?e[0]:t}function fc(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 o=i;ot;o--)n.push(o);return n}function mc(e,t,i){const n=e.slice(0,t),o=e.slice(t);return n.concat(i,o)}class pc{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class _c{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new pc(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 yc{constructor(e,t,i=null){this.ContinueProcessingPredicate=i;const[n,o,s]=yc._getElements(e),[r,a,l]=yc._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(yc._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i=e&&n>=i&&this.ElementsAreEqual(t,n))t--,n--;if(e>t||i>n){let o;return i<=n?(vc.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new pc(e,0,i,n-i+1)]):e<=t?(vc.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[new pc(e,t-e+1,i,0)]):(vc.Assert(e===t+1,"originalStart should only be one more than originalEnd"),vc.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}const s=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,s,r,o),l=s[0],c=r[0];if(null!==a)return a;if(!o[0]){const s=this.ComputeDiffRecursive(e,l,i,c,o);let r=[];return r=o[0]?[new pc(l+1,t-(l+1)+1,c+1,n-(c+1)+1)]:this.ComputeDiffRecursive(l+1,t,c+1,n,o),this.ConcatenateChanges(s,r)}return[new pc(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,m,p,_){let b=null,v=null,w=new Cc,C=t,y=i,S=u[0]-m[0]-n,x=-1073741824,L=this.m_forwardHistory.length-1;do{const t=S+e;t===C||t=0&&(l=this.m_forwardHistory[L],e=l[0],C=1,y=l.length-1)}while(--L>=-1);if(b=w.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==b&&b.length>0){const i=b[b.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}v=[new pc(e,h-e+1,t,f-t+1)]}else{w=new Cc,C=s,y=r,S=u[0]-m[0]-a,x=1073741824,L=p?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+o;e===C||e=c[e+1]?(d=c[e+1]-1,g=d-S-a,d>x&&w.MarkNextChange(),x=d+1,w.AddOriginalElement(d+1,g+1),S=e+1-o):(d=c[e-1],g=d-S-a,d>x&&w.MarkNextChange(),x=d,w.AddModifiedElement(d+1,g+1),S=e-1-o),L>=0&&(c=this.m_reverseHistory[L],o=c[0],C=1,y=c.length-1)}while(--L>=-1);v=w.getChanges()}return this.ConcatenateChanges(b,v)}ComputeRecursionPoint(e,t,i,n,o,s,r){let a=0,l=0,c=0,d=0,h=0,u=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),f=g+1,m=new Int32Array(f),p=new Int32Array(f),_=n-i,b=t-e,v=e-i,w=t-n,C=b-_,y=C%2===0;m[_]=e,p[b]=t,r[0]=!1;for(let S=1;S<=g/2+1;S++){let g=0,C=0;c=this.ClipDiagonalBound(_-S,S,_,f),d=this.ClipDiagonalBound(_+S,S,_,f);for(let e=c;e<=d;e+=2){a=e===c||eg+C&&(g=a,C=l),!y&&Math.abs(e-b)<=S-1&&a>=p[e])return o[0]=a,s[0]=l,i<=p[e]&&S<=1448?this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r):null}const x=(g-e+(C-i)-S)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,x))return r[0]=!0,o[0]=g,s[0]=C,x>0&&S<=1448?this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r):(e++,i++,[new pc(e,t-e+1,i,n-i+1)]);h=this.ClipDiagonalBound(b-S,S,b,f),u=this.ClipDiagonalBound(b+S,S,b,f);for(let f=h;f<=u;f+=2){a=f===h||f=p[f+1]?p[f+1]-1:p[f-1],l=a-(f-b)-w;const g=a;while(a>e&&l>i&&this.ElementsAreEqual(a,l))a--,l--;if(p[f]=a,y&&Math.abs(f-_)<=S&&a<=m[f])return o[0]=a,s[0]=l,g>=m[f]&&S<=1448?this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r):null}if(S<=1447){let e=new Int32Array(d-c+2);e[0]=_-c+1,wc.Copy2(m,c,e,1,d-c+1),this.m_forwardHistory.push(e),e=new Int32Array(u-h+2),e[0]=b-h+1,wc.Copy2(p,h,e,1,u-h+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r)}PrettifyChanges(e){for(let t=0;t0,r=i.modifiedLength>0;while(i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,o=0;if(t>0){const i=e[t-1];i.originalLength>0&&(n=i.originalStart+i.originalLength),i.modifiedLength>0&&(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,c=i.modifiedStart-e;if(tl&&(l=d,a=e)}i.originalStart-=a,i.modifiedStart-=a}if(this._hasStrings)for(let t=1,i=e.length;t0&&t>a&&(a=t,l=d,c=e)}return a>0?[l,c]: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){const o=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(i,n)?1:0;return o+s}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 wc.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],wc.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return wc.Copy(e,0,i,0,e.length),wc.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(vc.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),vc.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 n=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new pc(n,o,s,r),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e0&&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=xc(s,a,o,!0).changes;r&&(l=Dc(l)),h=[];for(let e=0,t=l.length;e1&&r>1){const n=e.charCodeAt(i-2),o=t.charCodeAt(r-2);if(n!==o)break;i--,r--}(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,s+1,1,r)}{let i=Mc(e,1),r=Mc(t,1);const a=e.length+1,l=t.length+1;while(i!0;const t=Date.now();return()=>Date.now()-t255?255:0|e}function Rc(e){return e<0?0:e>4294967295?4294967295:0|e}class Pc{constructor(e,t){this.index=e,this.remainder=t}}class Fc{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Rc(e);const i=this.values,n=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}changeValue(e,t){return e=Rc(e),t=Rc(t),this.values[e]!==t&&(this.values[e]=t,e-1=i.length)return!1;let o=i.length-e;return t>=o&&(t=o),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(n.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=Rc(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,o=0,s=0;while(t<=i)if(n=t+(i-t)/2|0,o=this.prefixSum[n],s=o-this.values[n],e=o))break;t=n+1}return new Pc(n,e-s)}}class Wc{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const i of t)this._acceptDeleteRange(i.range),this._acceptInsertText(new ai(i.range.startLineNumber,i.range.startColumn),i.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n=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 Vc{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,s=e*t;ot&&(t=s),n>i&&(i=n),r>i&&(i=r)}t++,i++;let n=new Vc(i,t,0);for(let o=0,s=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let zc=null;function Uc(){return null===zc&&(zc=new Hc([[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]])),zc}let Kc=null;function jc(){if(null===Kc){Kc=new Bc(0);const e=" \t<>'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…";for(let i=0;in);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=Uc()){const i=jc();let n=[];for(let o=1,s=e.getLineCount();o<=s;o++){const s=e.getLineContent(o),r=s.length;let a=0,l=0,c=0,d=1,h=!1,u=!1,g=!1,f=!1;while(a=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}Gc.INSTANCE=new Gc;var Yc=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Xc extends Wc{get uri(){return this._uri}get version(){return this._versionId}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=h(e.column,c(t),this._lines[e.lineNumber-1],0);return i?new li(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](){while(1)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 Zc{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 Xc(Xt.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;let i=this._models[e];i.onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,i,n){return Yc(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 Ic(r,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:n}),c=l.computeDiff(),d=!(c.changes.length>0)&&this._modelsAreIdentical(o,s);return{quitEarly:c.quitEarly,identical:d,changes:c.changes}}))}_modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLineCount();if(i!==n)return!1;for(let o=1;o<=i;o++){const i=e.getLineContent(o),n=t.getLineContent(o);if(i!==n)return!1}return!0}computeMoreMinimalEdits(e,t){return Yc(this,void 0,void 0,(function*(){const i=this._getModel(e);if(!i)return t;const n=[];let o=void 0;t=sc(t,(e,t)=>{if(e.range&&t.range)return li.compareRangesUsingStarts(e.range,t.range);let i=e.range?0:1,n=t.range?0:1;return i-n});for(let{range:e,text:s,eol:r}of t){if("number"===typeof r&&(o=r),li.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)>Zc._diffLimit){n.push({range:e,text:s});continue}const a=bc(t,s,!1),l=i.offsetAt(li.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 Yc(this,void 0,void 0,(function*(){let t=this._getModel(e);return t?$c(t):null}))}textualSuggest(e,t,i,n){return Yc(this,void 0,void 0,(function*(){const o=new Ke(!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>Zc._suggestionsLimit))break e}return{words:Array.from(r),duration:o.elapsed()}}))}computeWordRanges(e,t,i,n){return Yc(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),o=Bs(i,n);let s={host:o,getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(Ws(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(i){return Promise.reject(i)}}}Zc._diffLimit=1e5,Zc._suggestionsLimit=1e4,"function"===typeof importScripts&&(s["b"].monaco=$i());const Qc=Zi("textResourceConfigurationService"),Jc=Zi("textResourcePropertiesService"),ed=Zi("logService");var td;(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"})(td||(td={}));const id=td.Info;class nd extends We{constructor(){super(...arguments),this.level=id,this._onDidChangeLogLevel=this._register(new Ye)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class od extends nd{constructor(e=id){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=td.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=td.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=td.Info&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.getLevel()<=td.Error&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}var sd=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},rd=function(e,t){return function(i,n){t(i,n,e)}},ad=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ld=6e4,cd=3e5;function dd(e,t){let i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let hd=class extends We{constructor(e,t,i){super(),this._modelService=e,this._workerManager=this._register(new gd(this._modelService)),this._logService=i,this._register(za.register("*",{provideLinks:(e,t)=>dd(this._modelService,e.uri)?this._workerManager.withWorker().then(t=>t.computeLinks(e.uri)).then(e=>e&&{links:e}):Promise.resolve({links:[]})})),this._register(ka.register("*",new ud(this._workerManager,t,this._modelService)))}dispose(){super.dispose()}canComputeDiff(e,t){return dd(this._modelService,e)&&dd(this._modelService,t)}computeDiff(e,t,i,n){return this._workerManager.withWorker().then(o=>o.computeDiff(e,t,i,n))}computeMoreMinimalEdits(e,t){if(dc(t)){if(!dd(this._modelService,e))return Promise.resolve(t);const i=Ke.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,Pn(1e3).then(()=>t)])}return Promise.resolve(void 0)}canNavigateValueSet(e){return dd(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return dd(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};hd=sd([rd(0,aa),rd(1,Qc),rd(2,ed)],hd);class ud{constructor(e,t,i){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return ad(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)dd(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())dd(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=ec.getWordDefinition(e.getLanguageIdentifier().id),s=e.getWordAtPosition(t),r=s?new li(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):li.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),c=yield l.textualSuggest(n,null===s||void 0===s?void 0:s.word,o);return c?{duration:c.duration,suggestions:c.words.map(e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}}))}:void 0}))}}class gd extends We{constructor(e){super(),this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime();let t=this._register(new Bn);t.cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(cd/2)),this._register(this._modelService.onModelRemoved(e=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;let e=this._modelService.getModels();0===e.length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;let e=(new Date).getTime()-this._lastWorkerUsedTime;e>cd&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new _d(this._modelService,!1,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)}}class fd extends We{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 Bn;e.cancelAndSet(()=>this._checkStopModelSync(),Math.round(ld/2)),this._register(e)}}dispose(){for(let e in this._syncedModels)Ae(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){let n=e-this._syncedModelsLastUsedTime[i];n>ld&&t.push(i)}for(const i of t)this._stopModelSync(i)}_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 Fe;n.add(t.onDidChangeContent(e=>{this._proxy.acceptModelChanged(i.toString(),e)})),n.add(t.onWillDispose(()=>{this._stopModelSync(i)})),n.add(Pe(()=>{this._proxy.acceptRemovedModel(i)})),this._syncedModels[i]=n}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Ae(t)}}class md{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class pd{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class _d extends We{constructor(e,t,i){super(),this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new ml(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 cl(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new pd(this)))}catch(e){al(e),this._worker=new md(new Zc(new pd(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(al(e),this._worker=new md(new Zc(new pd(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new fd(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e){return this._disposed?Promise.reject(xe()):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 ad(this,void 0,void 0,(function*(){const n=yield this._withSyncedResources(e),o=i.source,s=Object(rs["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=ec.getWordDefinition(n.getLanguageIdentifier().id),s=o.source,r=Object(rs["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=ec.getWordDefinition(o.getLanguageIdentifier().id),r=s.source,a=Object(rs["L"])(s);return n.navigateValueSet(e.toString(),t,i,r,a)})}dispose(){super.dispose(),this._disposed=!0}}function bd(e,t){return new vd(e,t)}class vd extends _d{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(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?Ws(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())}}class wd{constructor(e,t){this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t}equals(e){return e instanceof wd&&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 s=n;s0?this._tokens[e-1<<1]:0}getMetadata(e){const t=this._tokens[1+(e<<1)];return t}getLanguageId(e){const t=this._tokens[1+(e<<1)];return va.getLanguageId(t)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return va.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return va.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return va.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return va.getInlineStyleFromMetadata(i,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return wd.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new Cd(this,e,t,i)}static convertToEndOffset(e,t){const i=e.length>>>1,n=i-1;for(let o=0;o>>1)-1;while(it&&(n=o)}return i}}class Cd{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 o=this._firstTokenIndex,s=e.getCount();o=i)break;this._tokensCount++}}equals(e){return e instanceof Cd&&(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}}class yd{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,n=t.length;if(i!==n)return!1;for(let o=0;o=o||(r[a++]=new yd(Math.max(1,l.startColumn-n+1),Math.min(s+1,l.endColumn-n+1),l.className,l.type));return r}static filter(e,t,i,n){if(0===e.length)return[];let o=[],s=0;for(let r=0,a=e.length;rt)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const c=l.startLineNumber===t?l.startColumn:i,d=l.endLineNumber===t?l.endColumn:n;o[s++]=new yd(c,d,a.inlineClassName,a.type)}return o}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=yd._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 Sd{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class xd{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 Ld{static normalize(e,t){if(0===t.length)return[];let i=[];const n=new xd;let o=0;for(let s=0,r=t.length;s1){const t=e.charCodeAt(a-2);rs["D"](t)&&a--}if(l>1){const t=e.charCodeAt(l-2);rs["D"](t)&&l--}const h=a-1,u=l-2;o=n.consumeLowerThan(h,o,i),0===n.count&&(o=h),n.insert(u,c,d)}return n.consumeLowerThan(1073741824,o,i),i}}class kd{constructor(e,t,i){this.endIndex=e,this.type=t,this.metadata=i}isWhitespace(){return!!(1&this.metadata)}}class Ed{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Dd{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,m,p,_,b){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(yd.compare),this.tabSize=c,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=f,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=p,this.fontLigatures=_,this.selectionsOnLine=b&&b.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;while(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=Nd.getPartIndex(r),d=Nd.getCharIndex(r),h=Nd.getPartIndex(a);l=c!==h?t:Nd.getCharIndex(a);let u=i-d,g=l-i;return u<=g?o:s}}class Id{constructor(e,t,i){this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function Td(e,t){if(0===e.lineContent.length){let i=0,n="";if(e.lineDecorations.length>0){const t=[],o=[];for(let n=0,s=e.lineDecorations.length;n0?``:"",i=o.length>0?``:"";n=`${e}${i}`}}return t.appendASCIIString(n),new Id(new Nd(0,0),!1,i)}return Vd(Rd(e),t)}class Md{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function Od(e){let t=El(1e4),i=Td(e,t);return new Md(i.characterMapping,t.build(),i.containsRTL,i.containsForeignElements)}class Ad{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.parts=s,this.containsForeignElements=r,this.fauxIndentLength=a,this.tabSize=l,this.startVisibleColumn=c,this.containsRTL=d,this.spaceWidth=h,this.renderSpaceCharCode=u,this.renderWhitespace=g,this.renderControlCharacters=f}}function Rd(e){const t=e.lineContent;let i,n;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0){for(let t=0,i=e.lineDecorations.length;t0&&(n[o++]=new kd(t,"",0));for(let s=0,r=e.getCount();s=i){n[o++]=new kd(i,a,0);break}n[o++]=new kd(r,a,0)}return n}function Fd(e,t,i){let n=0,o=[],s=0;if(i)for(let r=0,a=t.length;r=50&&(o[s++]=new kd(l+1,t,r),c=l+1,l=-1);c!==a&&(o[s++]=new kd(a,t,r))}else o[s++]=i;n=a}else for(let r=0,a=t.length;r50){const t=e.type,r=e.metadata,l=Math.ceil(a/50);for(let e=1;e=x.endOffset&&(S++,x=c&&c[S]),Ev)o=!0;else if(9===e)o=!0;else if(32===e)if(d)if(y)o=!0;else{const e=E+1E),o&&h&&(o=w||E>v),y){if(!o||!l&&L>=r){if(u){const e=f>0?g[f-1].endIndex:s;for(let t=e+1;t<=E;t++)g[f++]=new kd(t,"mtkw",1)}else g[f++]=new kd(E,"mtkw",1);L%=r}}else(E===_||o&&E>s)&&(g[f++]=new kd(E,p,0),L%=r);9===e?L=r:rs["C"](e)?L+=2:L++,y=o;while(E===_)m++,m0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0,o=32===e&&32!==n&&9!==n;o||(k=!0)}else k=!0;if(k)if(u){const e=f>0?g[f-1].endIndex:s;for(let t=e+1;t<=i;t++)g[f++]=new kd(t,"mtkw",1)}else g[f++]=new kd(i,"mtkw",1);else g[f++]=new kd(i,p,0);return g}function Bd(e,t,i,n){n.sort(yd.compare);const o=Ld.normalize(e,n),s=o.length;let r=0,a=[],l=0,c=0;for(let h=0,u=i.length;hc&&(c=e.startOffset,a[l++]=new kd(c,n,d)),!(e.endOffset+1<=t)){c=t,a[l++]=new kd(c,n+" "+e.className,d|e.metadata);break}c=e.endOffset+1,a[l++]=new kd(c,n+" "+e.className,d|e.metadata),r++}t>c&&(c=t,a[l++]=new kd(c,n,d))}const d=i[i.length-1].endIndex;if(r'):t.appendASCIIString("");for(let x=0,L=l.length;x=c&&(i+=o)}}for(u&&(t.appendASCIIString(' style="width:'),t.appendASCIIString(String(g*e)),t.appendASCIIString('px"')),t.appendASCII(62);b1?t.write1(8594):t.write1(65515);for(let e=2;e<=i;e++)t.write1(160)}else i=1,t.write1(f);w+=i,b>=c&&(v+=i)}y=e}else{let e=0;for(t.appendASCII(62);b=c&&(v+=o)}y=e}L?C++:C=0,t.appendASCIIString("")}return _.setPartData(r,l.length-1,w,S),a&&t.appendASCIIString(""),t.appendASCIIString(""),new Id(_,u,o)}class Hd{constructor(e,t,i,n){this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class zd{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}}class Ud{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,s=0;while(i<=n){o=i+(n-i)/2|0;const r=e[o];if(s=o>0?e[o-1]:0,t=r))break;i=o+1}}return new zd(o,t-s)}}class Kd{constructor(e,t){this.tabSize=e,this.data=t}}class jd{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 qd{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=qd.isBasicASCII(i,s),this.containsRTL=qd.containsRTL(i,this.isBasicASCII,o),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=c}static isBasicASCII(e,t){return!t||rs["z"](e)}static containsRTL(e,t,i){return!(t||!i)&&rs["m"](e)}}class $d{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class Gd{constructor(e,t){this.range=e,this.options=t}}function Yd(e){return Array.isArray(e)}function Xd(e){return!Yd(e)}function Zd(e){return"string"===typeof e}function Qd(e){return!Zd(e)}function Jd(e){return!e}function eh(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function th(e){return e.replace(/[&<>'"_]/g,"-")}function ih(e,t){console.log(`${e.languageId}: ${t}`)}function nh(e,t){return new Error(`${e.languageId}: ${t}`)}function oh(e,t,i,n,o){const s=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return t.replace(s,(function(t,s,a,l,c,d,h,u,g){return Jd(a)?Jd(l)?!Jd(c)&&c0){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}function rh(e,t){let i=t;while(i&&i.length>0){const t=e.stateNames[i];if(t)return!0;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return!1}const ah=5;class lh{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 ch(e,t);let i=ch.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new ch(e,t),this._entries[i]=n,n)}}lh._INSTANCE=new lh(ah);class ch{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";while(null!==e)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){while(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 ch._equals(this,e)}push(e){return lh.create(this,e)}pop(){return this.parent}popall(){let e=this;while(e.parent)e=e.parent;return e}switchTo(e){return lh.create(this.parent,e)}}class dh{constructor(e,t){this.modeId=e,this.state=t}equals(e){return this.modeId===e.modeId&&this.state.equals(e.state)}clone(){let e=this.state.clone();return e===this.state?this:new dh(this.modeId,this.state)}}class hh{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 uh(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new uh(e,t);let i=ch.getStackElementId(e),n=this._entries[i];return n||(n=new uh(e,null),this._entries[i]=n,n)}}hh._INSTANCE=new hh(ah);class uh{constructor(e,t){this.stack=e,this.embeddedModeData=t}clone(){let e=this.embeddedModeData?this.embeddedModeData.clone():null;return e===this.embeddedModeData?this:hh.create(this.stack,this.embeddedModeData)}equals(e){return e instanceof uh&&(!!this.stack.equals(e.stack)&&(null===this.embeddedModeData&&null===e.embeddedModeData||null!==this.embeddedModeData&&null!==e.embeddedModeData&&this.embeddedModeData.equals(e.embeddedModeData)))}}class gh{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 di(e,t,this._language)))}nestedModeTokenize(e,t,i,n){const o=i.modeId,s=i.state,r=Ga.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 hi(this._tokens,e)}}class fh{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 a=0;a{if(o)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i{})}}getInitialState(){let e=lh.create(null,this._lexer.start);return hh.create(e,null)}tokenize(e,t,i,n){let o=new gh,s=this._tokenize(e,t,i,n,o);return o.finalize(s)}tokenize2(e,t,i,n){let o=new fh(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=sh(this._lexer,t.stack.state),!i))throw nh(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const s of i){if(!Qd(s.action)||"@pop"!==s.action.nextEmbedded)continue;o=!0;let t=s.regex,i=s.regex.source;if("^(?:"===i.substr(0,4)&&")"===i.substr(i.length-1,1)){let e=(t.ignoreCase?"i":"")+(t.unicode?"u":"");t=new RegExp(i.substr(4,i.length-5),e)}let r=e.search(t);-1===r||0!==r&&s.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,c=i.stack,d=0,h=null,u=!0;while(u||d=a)break;u=!1;let e=this._lexer.tokenizer[m];if(!e&&(e=sh(this._lexer,m),!e))throw nh(this._lexer,"tokenizer state is not defined: "+m);let t=r.substr(d);for(const i of e)if((0===d||!i.matchOnlyAtLineStart)&&(p=t.match(i.regex),p)){_=p[0],b=i.action;break}}if(p||(p=[""],_=""),b||(d=this._lexer.maxStack)throw nh(this._lexer,"maximum tokenizer stack size reached: ["+c.state+","+c.parent.state+",...]");c=c.push(m)}else if("@pop"===b.next){if(c.depth<=1)throw nh(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(v));c=c.pop()}else if("@popall"===b.next)c=c.popall();else{let e=oh(this._lexer,b.next,_,p,m);if("@"===e[0]&&(e=e.substr(1)),!sh(this._lexer,e))throw nh(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(v));c=c.push(e)}}b.log&&"string"===typeof b.log&&ih(this._lexer,this._lexer.languageId+": "+oh(this._lexer,b.log,_,p,m))}if(null===C)throw nh(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(v));const y=i=>{let s=this._modeService.getModeIdForLanguageName(i);s&&(i=s);const r=this._getNestedEmbeddedModeData(i);if(d0)throw nh(this._lexer,"groups cannot be nested: "+this._safeRuleName(v));if(p.length!==C.length+1)throw nh(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(v));let e=0;for(let t=1;te});class wh{static colorizeElement(e,t,i,n){n=n||{};let o=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:"";i.className+=" "+o;let a=e=>{var t;const n=null!==(t=null===vh||void 0===vh?void 0:vh.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n};return this.colorize(t,r||"",s,n).then(a,e=>console.error(e))}static colorize(e,t,i,n){let o=4;n&&"number"===typeof n.tabSize&&(o=n.tabSize),rs["R"](t)&&(t=t.substr(1));let s=rs["P"](t),r=e.getModeId(i);if(!r)return Promise.resolve(yh(s,o));e.triggerMode(r);const a=Ga.get(r);if(a)return Ch(s,o,a);const l=Ga.getPromise(r);return new Promise(l?(e,t)=>{l.then(i=>{Ch(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=Ga.get(r);a?Ch(s,o,a).then(e,t):e(yh(s,o))};n=new Wn,n.cancelAndSet(a,500),i=Ga.onDidChange(e=>{e.changedLanguages.indexOf(r)>=0&&a()})})}static colorizeLine(e,t,i,n,o=4){const s=qd.isBasicASCII(e,t),r=qd.containsRTL(e,s,i);let a=Od(new Dd(!1,!0,e,!1,s,r,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null));return a.html}static colorizeModelLine(e,t,i=4){let n=e.getLineContent(t);e.forceTokenization(t);let o=e.getLineTokens(t),s=o.inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,i)}}function Ch(e,t,i){return new Promise((n,o)=>{const s=()=>{const r=Sh(e,t,i);if(i instanceof mh){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(s,o)}n(r)};s()})}function yh(e,t){let i=[];const n=16793600,o=new Uint32Array(2);o[0]=0,o[1]=n;for(let s=0,r=e.length;s")}return i.join("")}function Sh(e,t,i){let n=[],o=i.getInitialState();for(let s=0,r=e.length;s"),o=a.endState}return n.join("")}var xh;(function(e){e[e["Ignore"]=0]="Ignore",e[e["Info"]=1]="Info",e[e["Warning"]=2]="Warning",e[e["Error"]=3]="Error"})(xh||(xh={})),function(e){const t="error",i="warning",n="warn",o="info";function s(s){return s?rs["r"](t,s)?e.Error:rs["r"](i,s)||rs["r"](n,s)?e.Warning:rs["r"](o,s)?e.Info:e.Ignore:e.Ignore}e.fromValue=s}(xh||(xh={}));var Lh=xh;function kh(e){return!(!e||"function"!==typeof e.getEditorType)&&e.getEditorType()===mr.ICodeEditor}const Eh=Zi("IWorkspaceEditService");function Dh(e){return Ds(e)&&(Boolean(e.newUri)||Boolean(e.oldUri))}function Nh(e){return Ds(e)&&Xt.isUri(e.resource)&&Ds(e.edit)}class Ih{constructor(e){this.metadata=e}static convert(e){return e.edits.map(e=>{if(Nh(e))return new Th(e.resource,e.edit,e.modelVersionId,e.metadata);if(Dh(e))return new Mh(e.oldUri,e.newUri,e.options,e.metadata);throw new Error("Unsupported edit")})}}class Th extends Ih{constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i,this.metadata=n}}class Mh extends Ih{constructor(e,t,i,n){super(n),this.oldResource=e,this.newResource=t,this.options=i,this.metadata=n}}class Oh{constructor(){this.data=new Map}add(e,t){Js(Es(e)),Js(Ds(t)),Js(!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}}const Ah=new Oh,Rh={JSONContribution:"base.contributions.json"};function Ph(e){return e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}class Fh{constructor(){this._onDidChangeSchema=new Ye,this.schemasById={}}registerSchema(e,t){this.schemasById[Ph(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Wh=new Fh;Ah.add(Rh.JSONContribution,Wh);const Bh={Configuration:"base.contributions.configuration"},Vh={properties:{},patternProperties:{}},Hh={properties:{},patternProperties:{}},zh={properties:{},patternProperties:{}},Uh={properties:{},patternProperties:{}},Kh={properties:{},patternProperties:{}},jh={properties:{},patternProperties:{}},qh="vscode://schemas/settings/resourceLanguage",$h=Ah.as(Rh.JSONContribution);class Gh{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new Ye,this._onDidUpdateConfiguration=new Ye,this.defaultValues={},this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:o("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={},$h.registerSchema(qh,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)),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}),$h.registerSchema(qh,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=3){i=Ms(e.scope)?i:e.scope;let n=[],o=e.properties;if(o)for(let r in o){if(t&&eu(r)){delete o[r];continue}const e=o[r];this.updatePropertyDefaultValue(r,e),Xh.test(r)?e.scope=void 0:e.scope=Ms(e.scope)?i:e.scope,!o[r].hasOwnProperty("included")||o[r].included?(this.configurationProperties[r]=o[r],!o[r].deprecationMessage&&o[r].markdownDeprecationMessage&&(o[r].deprecationMessage=o[r].markdownDeprecationMessage),n.push(r)):(this.excludedConfigurationProperties[r]=o[r],delete o[r])}let s=e.allOf;if(s)for(let r of s)n.push(...this.validateAndRegisterProperties(r,t,i));return n}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=e=>{let i=e.properties;if(i)for(const t in i)this.updateSchema(t,i[t]);let n=e.allOf;n&&n.forEach(t)};t(e)}updateSchema(e,t){switch(Vh.properties[e]=t,t.scope){case 1:Hh.properties[e]=t;break;case 2:zh.properties[e]=t;break;case 6:Uh.properties[e]=t;break;case 3:Kh.properties[e]=t;break;case 4:jh.properties[e]=t;break;case 5:jh.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:o("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:o("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:qh};this.updatePropertyDefaultValue(t,i),Vh.properties[t]=i,Hh.properties[t]=i,zh.properties[t]=i,Uh.properties[t]=i,Kh.properties[t]=i,jh.properties[t]=i}this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.defaultValues[e];Ts(i)&&(i=t.default),Ts(i)&&(i=Qh(t.type)),t.default=i}}const Yh="\\[.*\\]$",Xh=new RegExp(Yh);function Zh(e){return e.substring(1,e.length-1)}function Qh(e){const t=Array.isArray(e)?e[0]:e;switch(t){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const Jh=new Gh;function eu(e){return e.trim()?Xh.test(e)?o("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==Jh.getConfigurationProperties()[e]?o("config.property.duplicate","Cannot register '{0}'. This property is already registered.",e):null:o("config.property.empty","Cannot register an empty property")}Ah.add(Bh.Configuration,Jh);const tu=Object.prototype.hasOwnProperty;function iu(e,t){for(let i in e)if(tu.call(e,i)){const n=t({key:i,value:e[i]},(function(){delete e[i]}));if(!1===n)return}}class nu{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)}}const ou=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new Ye,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus!==e&&(this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus))}},su=Object.hasOwnProperty;class ru{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class au{constructor(){this._values=[]}_read(e){return this._values[e]}_write(e,t){this._values[e]=t}}class lu{static readOptions(e){const t=e,i=new au;for(const n of fe){const e="_never_"===n.name?void 0:t[n.name];i._write(n.id,e)}return i}static validateOptions(e){const t=new m;for(const i of fe)t._write(i.id,i.validate(e._read(i.id)));return t}static computeOptions(e,t){const i=new ru;for(const n of fe)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!==typeof e||"object"!==typeof t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&nc(e,t);for(let i in e)if(!lu._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of fe){const s=!lu._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new f(i):null}}function cu(e){const t=e.wordWrap;!0===t?e.wordWrap="on":!1===t&&(e.wordWrap="off");const i=e.lineNumbers;!0===i?e.lineNumbers="on":!1===i&&(e.lineNumbers="off");const n=e.autoClosingBrackets;!1===n&&(e.autoClosingBrackets="never",e.autoClosingQuotes="never",e.autoSurround="never");const o=e.cursorBlinking;"visible"===o&&(e.cursorBlinking="solid");const s=e.renderWhitespace;!0===s?e.renderWhitespace="boundary":!1===s&&(e.renderWhitespace="none");const r=e.renderLineHighlight;!0===r?e.renderLineHighlight="line":!1===r&&(e.renderLineHighlight="none");const a=e.acceptSuggestionOnEnter;!0===a?e.acceptSuggestionOnEnter="on":!1===a&&(e.acceptSuggestionOnEnter="off");const l=e.tabCompletion;!1===l?e.tabCompletion="off":!0===l&&(e.tabCompletion="onlySnippets");const c=e.suggest;if(c&&"object"===typeof c.filteredTypes&&c.filteredTypes){const e={method:"showMethods",function:"showFunctions",constructor:"showConstructors",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};iu(e,e=>{const t=c.filteredTypes[e.key];!1===t&&(c[e.value]=t)})}const d=e.hover;!0===d?e.hover={enabled:!0}:!1===d&&(e.hover={enabled:!1});const h=e.parameterHints;!0===h?e.parameterHints={enabled:!0}:!1===h&&(e.parameterHints={enabled:!1});const u=e.autoIndent;!0===u?e.autoIndent="full":!1===u&&(e.autoIndent="advanced");const g=e.matchBrackets;!0===g?e.matchBrackets="always":!1===g&&(e.matchBrackets="never")}function du(e){const t=er(e);return cu(t),t}class hu extends We{constructor(e,t){super(),this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new Ye),this.onDidChangeFast=this._onDidChangeFast.event,this.isSimpleWidget=e,this._isDominatedByLongLines=!1,this._computeOptionsMemory=new p,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._rawOptions=du(t),this._readOptions=lu.readOptions(this._rawOptions),this._validatedOptions=lu.validateOptions(this._readOptions),this._register(lr.onDidChangeZoomLevel(e=>this._recomputeOptions())),this._register(ou.onDidChangeTabFocus(e=>this._recomputeOptions()))}observeReferenceElement(e){}updatePixelRatio(){}_recomputeOptions(){const e=this.options,t=this._computeInternalOptions();if(e){const i=lu.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=hr.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:ou.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return lu.computeOptions(this._validatedOptions,i)}static _subsetEquals(e,t){for(const i in t)if(su.call(t,i)){const n=t[i],o=e[i];if(o===n)continue;if(Array.isArray(o)&&Array.isArray(n)){if(!nc(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("undefined"===typeof e)return;const t=du(e);hu._subsetEquals(this._rawOptions,t)||(this._rawOptions=nr(this._rawOptions,t||{}),this._readOptions=lu.readOptions(this._rawOptions),this._validatedOptions=lu.validateOptions(this._readOptions),this._recomputeOptions())}setIsDominatedByLongLines(e){this._isDominatedByLongLines=e,this._recomputeOptions()}setMaxLineNumber(e){const t=hu._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;while(e)e=Math.floor(e/10),t++;return t||1}}const uu=Object.freeze({id:"editor",order:5,type:"object",title:o("editorConfigurationTitle","Editor"),scope:5}),gu=Ah.as(Bh.Configuration),fu=Object.assign(Object.assign({},uu),{properties:{"editor.tabSize":{type:"number",default:ge.tabSize,minimum:1,markdownDescription:o("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:ge.insertSpaces,markdownDescription:o("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:ge.detectIndentation,markdownDescription:o("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:ge.trimAutoWhitespace,description:o("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:ge.largeFileOptimizations,description:o("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:o("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[o("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),o("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),o("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:o("wordBasedSuggestionsMode","Controls form what documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[o("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),o("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),o("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:o("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:o("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:o("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:o("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:o("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:o("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:o("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:o("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[o("wordWrap.off","Lines will never wrap."),o("wordWrap.on","Lines will wrap at the viewport width."),o("wordWrap.inherit","Lines will wrap according to the `#editor.wordWrap#` setting.")]}}});function mu(e){return"undefined"!==typeof e.type||"undefined"!==typeof e.anyOf}for(const JF of fe){const e=JF.schema;if("undefined"!==typeof e)if(mu(e))fu.properties["editor."+JF.name]=e;else for(let t in e)su.call(e,t)&&(fu.properties[t]=e[t])}let pu=null;function _u(){return null===pu&&(pu=Object.create(null),Object.keys(fu.properties).forEach(e=>{pu[e]=!0})),pu}function bu(e){const t=_u();return t["editor."+e]||!1}function vu(e){const t=_u();return t["diffEditor."+e]||!1}gu.registerConfiguration(fu);class wu{static insert(e,t){return{range:new li(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}}}const Cu=Zi("configurationService");function yu(e,t){const i=Object.create(null);for(let n in e)Su(i,n,e[n],t);return i}function Su(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let l=0;lconsole.error("Conflict in default settings: "+e))}return e}class Nu{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?ku(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 n of hc([...Object.keys(this.contents),...Object.keys(t)])){let e=this.contents[n],o=t[n];o&&("object"===typeof e&&"object"===typeof o?(e=er(e),this.mergeContents(e,o)):e=o),i[n]=e}return new Nu(i,this.keys,this.overrides)}merge(...e){const t=er(this.contents),i=er(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=>nc(t.identifiers,e.identifiers));t?this.mergeContents(t.contents,e.contents):i.push(er(e))}for(const e of o.keys)-1===n.indexOf(e)&&n.push(e)}return new Nu(t,n,i)}freeze(){return this.isFrozen=!0,this}mergeContents(e,t){for(const i of Object.keys(t))i in e&&Ds(e[i])&&Ds(t[i])?this.mergeContents(e[i],t[i]):e[i]=er(t[i])}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?tr(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),Su(this.contents,e,t,e=>{throw new Error(e)})}removeValue(e){this.removeKey(e)&&xu(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 Tu{constructor(e,t,i=new Nu,n=new Nu,o=new gs,s=new Nu,r=new gs,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 gs,this._userConfiguration=null}getValue(e,t,i){const n=this.getConsolidateConfigurationModel(t,i);return n.getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new Nu,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(Xt.revive(t[0]),this.parseConfigurationModel(t[1])),e),new gs);return new Tu(t,i,new Nu,n,o,new Nu,new gs,!1)}static parseConfigurationModel(e){return new Nu(e.contents,e.keys,e.overrides).freeze()}}class Mu{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 Nu;this.affectedKeys.forEach(e=>s.setValue(e,{})),this.affectedKeysTree=s.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Tu.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!or(n,o)}return!0}return!1}doesAffectedKeysTreeContains(e,t){let i,n=yu({[t]:!0},()=>{});while("object"===typeof n&&(i=Object.keys(n)[0])){if(e=e[i],!e)return!1;n=n[i]}return!0}}class Ou extends We{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 Ye),this._currentChord=null,this._currentChordChecker=new Bn,this._currentChordStatusMessage=null,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:je.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(o("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)}_doDispatch(e,t){let i=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;const[n]=e.getDispatchParts();if(null===n)return this._log("\\ Keyboard event cannot be dispatched."),i;const s=this._contextKeyService.getContext(t),r=this._currentChord?this._currentChord.keypress:null,a=e.getLabel(),l=this._getResolver().resolve(s,r,n);return this._logService.trace("KeybindingService#dispatch",a,null===l||void 0===l?void 0:l.commandId),l&&l.enterChord?(i=!0,this._enterChordMode(n,a),i):(this._currentChord&&(l&&l.commandId||(this._notificationService.status(o("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),i=!0)),this._leaveChordMode(),l&&l.commandId&&(l.bubble||(i=!0),"undefined"===typeof 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"})),i)}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class Au{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(let n=0,o=e.length;n=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("undefined"===typeof i)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let n=i.length-1;n>=0;n--){let e=i[n];if(e.command===t.command)continue;const o=e.keypressParts.length>1,s=t.keypressParts.length>1;o&&s&&e.keypressParts[1]!==t.keypressParts[1]||Au.whenIsEntirelyIncluded(e.when,t.when)&&this._removeFromLookupMap(e)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);"undefined"===typeof 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("undefined"!==typeof t)for(let i=0,n=t.length;i9===e.type?e.expr:[e];let o=n(i).concat(n(t));for(let s=0;s1&&null!==o.keypressParts[1]?(this._log(`\\ From ${n.length} keybinding entries, matched chord, when: ${Ru(o.when)}, source: ${Pu(o)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${n.length} keybinding entries, matched ${o.command}, when: ${Ru(o.when)}, source: ${Pu(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(Au.contextMatchesRules(e,n.when))return n}return null}static contextMatchesRules(e,t){return!t||t.evaluate(e)}}function Ru(e){return e?""+e.serialize():"no when condition"}function Pu(e){return e.extensionId?e.isBuiltinExtension?"built-in extension "+e.extensionId:"user extension "+e.extensionId:e.isDefault?"built-in":"user"}class Fu{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===s["a"]){if(e&&e.win)return e.win}else if(2===s["a"]){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=Fu.bindToCurrentPlatform(e);if(t&&t.primary){const i=ct(t.primary,s["a"]);i&&this._registerDefaultKeybinding(i,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let i=0,n=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&&Fu._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,o,r){1===s["a"]&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:r,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Vu)),this._cachedMergedKeybindings.slice(0)}}const Wu=new Fu,Bu={EditorModes:"platform.keybindingsRegistry"};function Vu(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.commandt.command?1:e.weight2-t.weight2}Ah.add(Bu.EditorModes,Wu);class Hu{constructor(e,t,i,n,o,s,r){this.resolvedKeybinding=e,this.keypressParts=e?zu(e.getDispatchParts()):[],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 zu(e){let t=[];for(let i=0,n=e.length;ithis._getLabel(e))}getAriaLabel(){return ju.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 gt(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchParts(){return this._parts.map(e=>this._getDispatchPart(e))}}class Gu extends $u{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 at.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":at.toString(e.keyCode)}_getDispatchPart(e){return Gu.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+=at.toString(e.keyCode),t}}const Yu=Zi("notificationService");class Xu{}const Zu=Zi("contextService");class Qu{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}}}var Ju,eg,tg,ig,ng,og,sg,rg,ag;(function(e){e.noSelection=o("noSelection","No selection"),e.singleSelectionRange=o("singleSelectionRange","Line {0}, Column {1} ({2} selected)"),e.singleSelection=o("singleSelection","Line {0}, Column {1}"),e.multiSelectionRange=o("multiSelectionRange","{0} selections ({1} characters selected)"),e.multiSelection=o("multiSelection","{0} selections"),e.emergencyConfOn=o("emergencyConfOn","Now changing the setting `accessibilitySupport` to 'on'."),e.openingDocs=o("openingDocs","Now opening the Editor Accessibility documentation page."),e.readonlyDiffEditor=o("readonlyDiffEditor"," in a read-only pane of a diff editor."),e.editableDiffEditor=o("editableDiffEditor"," in a pane of a diff editor."),e.readonlyEditor=o("readonlyEditor"," in a read-only code editor"),e.editableEditor=o("editableEditor"," in a code editor"),e.changeConfigToOnMac=o("changeConfigToOnMac","To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),e.changeConfigToOnWinLinux=o("changeConfigToOnWinLinux","To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),e.auto_on=o("auto_on","The editor is configured to be optimized for usage with a Screen Reader."),e.auto_off=o("auto_off","The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),e.tabFocusModeOnMsg=o("tabFocusModeOnMsg","Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),e.tabFocusModeOnMsgNoKb=o("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."),e.tabFocusModeOffMsg=o("tabFocusModeOffMsg","Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),e.tabFocusModeOffMsgNoKb=o("tabFocusModeOffMsgNoKb","Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),e.openDocMac=o("openDocMac","Press Command+H now to open a browser window with more information related to editor accessibility."),e.openDocWinLinux=o("openDocWinLinux","Press Control+H now to open a browser window with more information related to editor accessibility."),e.outroMsg=o("outroMsg","You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),e.showAccessibilityHelpAction=o("showAccessibilityHelpAction","Show Accessibility Help")})(Ju||(Ju={})),function(e){e.inspectTokensAction=o("inspectTokens","Developer: Inspect Tokens")}(eg||(eg={})),function(e){e.gotoLineActionLabel=o("gotoLineActionLabel","Go to Line/Column...")}(tg||(tg={})),function(e){e.helpQuickAccessActionLabel=o("helpQuickAccess","Show all Quick Access Providers")}(ig||(ig={})),function(e){e.quickCommandActionLabel=o("quickCommandActionLabel","Command Palette"),e.quickCommandHelp=o("quickCommandActionHelp","Show And Run Commands")}(ng||(ng={})),function(e){e.quickOutlineActionLabel=o("quickOutlineActionLabel","Go to Symbol..."),e.quickOutlineByCategoryActionLabel=o("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")}(og||(og={})),function(e){e.editorViewAccessibleLabel=o("editorViewAccessibleLabel","Editor content"),e.accessibilityHelpMessage=o("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")}(sg||(sg={})),function(e){e.toggleHighContrast=o("toggleHighContrast","Toggle High Contrast Theme")}(rg||(rg={})),function(e){e.bulkEditServiceSummary=o("bulkEditServiceSummary","Made {0} edits in {1} files")}(ag||(ag={}));var lg=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},cg=function(e,t){return function(i,n){t(i,n,e)}},dg=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class hg{constructor(e){this.disposed=!1,this.model=e,this._onDispose=new Ye}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onDispose.fire()}}function ug(e,t,i){return kh(e)?t(e):i(e)}let gg=class{constructor(e){this.modelService=e}setEditor(e){this.editor=e}createModelReference(e){let t=null;return this.editor&&(t=ug(this.editor,t=>this.findModel(t,e),t=>this.findModel(t.getOriginalEditor(),e)||this.findModel(t.getModifiedEditor(),e))),t?Promise.resolve(new Ve(new hg(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}};gg=lg([cg(0,aa)],gg);class fg{show(){return fg.NULL_PROGRESS_RUNNER}showWhile(e,t){return dg(this,void 0,void 0,(function*(){yield e}))}}fg.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class mg{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 pg{info(e){return this.notify({severity:Lh.Info,message:e})}warn(e){return this.notify({severity:Lh.Warning,message:e})}error(e){return this.notify({severity:Lh.Error,message:e})}notify(e){switch(e.severity){case Lh.Error:console.error(e.message);break;case Lh.Warning:console.warn(e.message);break;default:console.log(e.message);break}return pg.NO_OP}status(e,t){return We.None}}pg.NO_OP=new Xu;class _g{constructor(e){this._onWillExecuteCommand=new Ye,this._onDidExecuteCommand=new Ye,this._instantiationService=e}executeCommand(e,...t){const i=zs.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(n){return Promise.reject(n)}}}class bg extends Ou{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._register(Zn(s,Wo.KEY_DOWN,e=>{let t=new Ln(e),i=this._dispatch(t,t.target);i&&(t.preventDefault(),t.stopPropagation())}))}addDynamicKeybinding(e,t,i,n){const o=ct(t,s["a"]),r=new Fe;return o&&(this._dynamicKeybindings.push({keybinding:o,command:e,when:n,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),r.add(Pe(()=>{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 Hu(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new Hu(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeybinding(e){return[new Gu(e,s["a"])]}resolveKeyboardEvent(e){let t=new ht(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new Gu(t,s["a"])}}function vg(e){return e&&"object"===typeof e&&(!e.overrideIdentifier||"string"===typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof Xt)}class wg{constructor(){this._onDidChangeConfiguration=new Ye,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new Tu(new Iu,new Nu)}getValue(e,t){const i="string"===typeof e?e:void 0,n=vg(e)?e:vg(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()};let i=[];for(const n of e){const[e,t]=n;this.getValue(e)!==t&&(this._configuration.updateValue(e,t),i.push(e))}if(i.length>0){const e=new Mu({keys:i,overrides:[]},t,this._configuration);e.source=7,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}}class Cg{constructor(e){this.configurationService=e,this._onDidChangeConfiguration=new Ye,this.configurationService.onDidChangeConfiguration(e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})})}getValue(e,t,i){const n=ai.isIPosition(t)?t:null,o=n?"string"===typeof i?i:void 0:"string"===typeof t?t:void 0;return"undefined"===typeof o?this.configurationService.getValue():this.configurationService.getValue(o)}}let yg=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:s["d"]||s["f"]?"\n":"\r\n"}};yg=lg([cg(0,Cu)],yg);class Sg{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class xg{constructor(){const e=Xt.from({scheme:xg.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new Qu({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}function Lg(e,t,i){if(!t)return;if(!(e instanceof wg))return;let n=[];Object.keys(t).forEach(e=>{bu(e)&&n.push(["editor."+e,t[e]]),i&&vu(e)&&n.push(["diffEditor."+e,t[e]])}),n.length>0&&e.updateValues(n)}xg.SCHEME="inmemory";class kg{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return dg(this,void 0,void 0,(function*(){const t=new Map;for(let o of e){if(!(o instanceof Th))throw new Error("bad edit - only text edits are supported");const e=this._modelService.getModel(o.resource);if(!e)throw new Error("bad edit - model not found");if("number"===typeof o.versionId&&e.getVersionId()!==o.versionId)throw new Error("bad state - model changed in the meantime");let i=t.get(e);i||(i=[],t.set(e,i)),i.push(wu.replaceMove(li.lift(o.textEdit.range),o.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:rs["v"](ag.bulkEditServiceSummary,i,n)}}))}}class Eg{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}}class Dg{constructor(e,t){this._codeEditorService=e,this._container=t,this.onLayout=je.None}get dimension(){return this._dimension||(this._dimension=fo(window.document.body)),this._dimension}get container(){return this._container}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}}i("0678");const Ng=2e4;let Ig,Tg,Mg,Og,Ag;function Rg(e){Ig=document.createElement("div"),Ig.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"),Ig.appendChild(e),e};Tg=t(),Mg=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"),Ig.appendChild(e),e};Og=i(),Ag=i(),e.appendChild(Ig)}function Pg(e){Ig&&(Tg.textContent!==e?(Gn(Mg),Fg(Tg,e)):(Gn(Tg),Fg(Mg,e)))}function Fg(e,t){Gn(e),t.length>Ng&&(t=t.substr(0,Ng)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}i("0556");class Wg{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class Bg{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 s of this._requests){let e;0===s.type&&(e=t),2===s.type&&(e=i),1===s.type&&(e=n),e.appendChild(document.createElement("br"));const r=document.createElement("span");Bg._render(r,s),e.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;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())}}class zg{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}function Ug(){Kg.INSTANCE.clearCache()}class Kg extends We{constructor(){super(),this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._cache=new zg,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearCache(){this._cache=new zg,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=Kg._actualReadConfiguration(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new gr({zoomLevel:tn(),pixelRatio:rn(),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 Wg(e,t);return i.push(o),n&&n.push(o),o}static _actualReadConfiguration(e){const t=[],i=[],n=this.createRequest("n",0,t,i),o=this.createRequest("m",0,t,null),s=this.createRequest(" ",0,t,i),r=this.createRequest("0",0,t,i),a=this.createRequest("1",0,t,i),l=this.createRequest("2",0,t,i),c=this.createRequest("3",0,t,i),d=this.createRequest("4",0,t,i),h=this.createRequest("5",0,t,i),u=this.createRequest("6",0,t,i),g=this.createRequest("7",0,t,i),f=this.createRequest("8",0,t,i),m=this.createRequest("9",0,t,i),p=this.createRequest("→",0,t,i),_=this.createRequest("→",0,t,null),b=this.createRequest("·",0,t,i),v=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),Vg(e,t);const w=Math.max(r.width,a.width,l.width,c.width,d.width,h.width,u.width,g.width,f.width,m.width);let C=e.fontFeatureSettings===F.OFF;const y=i[0].width;for(let L=1,k=i.length;C&&L.001){C=!1;break}}let S=!0;C&&_.width!==y&&(S=!1),_.width>p.width&&(S=!1);const x=nn()>2e3;return new gr({zoomLevel:tn(),pixelRatio:rn(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:C,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:S,spaceWidth:s.width,middotWidth:b.width,wsmiddotWidth:v.width,maxDigitWidth:w},x)}}Kg.INSTANCE=new Kg;class jg extends hu{constructor(e,t,i=null,n){super(e,t),this.accessibilityService=n,this._elementSizeObserver=this._register(new Hg(i,t.dimension,()=>this._recomputeOptions())),this._register(Kg.INSTANCE.onDidChange(()=>this._recomputeOptions())),this._validatedOptions.get(9)&&this._elementSizeObserver.startObserving(),this._register(on(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 un||gn||(e+="no-user-select "),un&&(e+="no-minimap-shadow "),s["f"]&&(e+="mac "),e}_getEnvConfiguration(){return{extraEditorClassName:jg._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:dn||cn,pixelRatio:rn(),zoomLevel:tn(),accessibilitySupport:this.accessibilityService.isScreenReaderOptimized()?2:this.accessibilityService.getAccessibilitySupport()}}readConfiguration(e){return Kg.INSTANCE.readConfiguration(e)}}var qg=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class $g extends We{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new Ye),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 this._actionCallback?this._actionCallback(e):Promise.resolve(!0)}}class Gg extends We{constructor(){super(...arguments),this._onBeforeRun=this._register(new Ye),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Ye),this.onDidRun=this._onDidRun.event}run(e,t){return qg(this,void 0,void 0,(function*(){if(!e.enabled)return Promise.resolve(null);this._onBeforeRun.fire({action:e});try{const i=yield this.runAction(e,t);this._onDidRun.fire({action:e,result:i})}catch(i){this._onDidRun.fire({action:e,error:i})}}))}runAction(e,t){const i=t?e.run(t):e.run();return Promise.resolve(i)}}class Yg extends $g{constructor(e){super(Yg.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Yg.ID="vs.actions.separator";class Xg{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}dispose(){}get actions(){return this._actions}run(){return qg(this,void 0,void 0,(function*(){}))}}class Zg extends $g{constructor(){super(Zg.ID,o("submenu.empty","(empty)"),void 0,!1)}}Zg.ID="vs.actions.empty";let Qg=s["l"]||"";const Jg=new Map;Jg.set("false",!1),Jg.set("true",!0),Jg.set("isMac",s["f"]),Jg.set("isLinux",s["d"]),Jg.set("isWindows",s["j"]),Jg.set("isWeb",s["i"]),Jg.set("isMacNative",s["f"]&&!s["i"]),Jg.set("isEdge",Qg.indexOf("Edg/")>=0),Jg.set("isFirefox",Qg.indexOf("Firefox")>=0),Jg.set("isChrome",Qg.indexOf("Chrome")>=0),Jg.set("isSafari",Qg.indexOf("Safari")>=0),Jg.set("isIPad",Qg.indexOf("iPad")>=0);const ef=Object.prototype.hasOwnProperty;class tf{static has(e){return rf.create(e)}static equals(e,t){return af.create(e,t)}static regex(e,t){return pf.create(e,t)}static not(e){return hf.create(e)}static and(...e){return bf.create(e)}static or(...e){return vf.create(e)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return vf.create(i.map(e=>this._deserializeAndExpression(e,t)))}static _deserializeAndExpression(e,t){let i=e.split("&&");return bf.create(i.map(e=>this._deserializeOne(e,t)))}static _deserializeOne(e,t){if(e=e.trim(),e.indexOf("!=")>=0){let i=e.split("!=");return df.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return af.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return pf.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let t=e.split(" in ");return lf.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return gf.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return uf.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return mf.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return ff.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?hf.create(e.substr(1).trim()):rf.create(e)}static _deserializeValue(e,t){if(e=e.trim(),"true"===e)return!0;if("false"===e)return!1;let i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if(Object(rs["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("/"),n=e.lastIndexOf("/");if(i===n||i<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let o=e.slice(i+1,n),s="i"===e[n+1]?"i":"";try{return new RegExp(o,s)}catch(r){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${r}`);return console.warn(`bad regexp-value '${e}', parse error: ${r}`),null}}}function nf(e,t){return e.cmp(t)}class of{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 sf.INSTANCE}}of.INSTANCE=new of;class sf{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 of.INSTANCE}}sf.INSTANCE=new sf;class rf{constructor(e){this.key=e,this.type=2}static create(e){const t=Jg.get(e);return"boolean"===typeof t?t?sf.INSTANCE:of.INSTANCE:new rf(e)}cmp(e){return e.type!==this.type?this.type-e.type:Sf(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 hf.create(this.key)}}class af{constructor(e,t){this.key=e,this.value=t,this.type=4}static create(e,t){if("boolean"===typeof t)return t?rf.create(e):hf.create(e);const i=Jg.get(e);if("boolean"===typeof i){const e=i?"true":"false";return t===e?sf.INSTANCE:of.INSTANCE}return new af(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 df.create(this.key,this.value)}}class lf{constructor(e,t){this.key=e,this.valueKey=t,this.type=10}static create(e,t){return new lf(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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&&ef.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return cf.create(this)}}class cf{constructor(e){this._actual=e,this.type=11}static create(e){return new cf(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 df{constructor(e,t){this.key=e,this.value=t,this.type=5}static create(e,t){if("boolean"===typeof t)return t?hf.create(e):rf.create(e);const i=Jg.get(e);if("boolean"===typeof i){const e=i?"true":"false";return t===e?of.INSTANCE:sf.INSTANCE}return new df(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 af.create(this.key,this.value)}}class hf{constructor(e){this.key=e,this.type=3}static create(e){const t=Jg.get(e);return"boolean"===typeof t?t?of.INSTANCE:sf.INSTANCE:new hf(e)}cmp(e){return e.type!==this.type?this.type-e.type:Sf(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 rf.create(this.key)}}class uf{constructor(e,t){this.key=e,this.value=t,this.type=12}static create(e,t){return new uf(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 mf.create(this.key,this.value)}}class gf{constructor(e,t){this.key=e,this.value=t,this.type=13}static create(e,t){return new gf(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 ff.create(this.key,this.value)}}class ff{constructor(e,t){this.key=e,this.value=t,this.type=14}static create(e,t){return new ff(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 _f.create(this)}}class _f{constructor(e){this._actual=e,this.type=8}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 bf{constructor(e){this.expr=e,this.type=6}static create(e){return bf._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=vf.create(e.expr.map(e=>bf.create([e,i])));n&&(t.push(n),t.sort(nf))}return 1===t.length?t[0]:new bf(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 vf.create(e)}}class vf{constructor(e){this.expr=e,this.type=9}static create(e){const t=vf._normalizeArr(e);if(0!==t.length)return 1===t.length?t[0]:new vf(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 i of this.expr)e.push(i.negate());const t=e=>9===e.type?e.expr:[e];while(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(tf.and(e,i));e.unshift(tf.or(...o))}return e[0]}}class wf extends rf{constructor(e,t){super(e),this._defaultValue=t}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return tf.not(this.key)}isEqualTo(e){return tf.equals(this.key,e)}}const Cf=Zi("contextKeyService"),yf="setContext";function Sf(e,t){return et?1:0}function xf(e,t,i,n){return ei?1:tn?1:0}var Lf;(function(e){e["DARK"]="dark",e["LIGHT"]="light",e["HIGH_CONTRAST"]="hc"})(Lf||(Lf={}));const kf=Zi("themeService");var Ef,Df;function Nf(e){return{id:e}}function If(e){switch(e){case Lf.DARK:return"vs-dark";case Lf.HIGH_CONTRAST:return"hc-black";default:return"vs"}}(function(e){function t(e){return e&&"object"===typeof e&&"string"===typeof e.id}e.isThemeColor=t})(Ef||(Ef={})),function(e){function t(e){return e&&"object"===typeof e&&"string"===typeof e.id&&("undefined"===typeof e.color||Ef.isThemeColor(e.color))}e.isThemeIcon=t;const i=/^\$\(([a-z.]+\/)?([a-z-~]+)\)$/i;function n(e){const t=i.exec(e);if(!t)return;let[,n,o]=t;return n&&"codicon/"!==n?{id:n+o}:{id:o}}function o(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}}function s(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.fromString=n,e.modify=o,e.isEqual=s,e.asClassNameArray=_a.asClassNameArray,e.asClassName=_a.asClassName,e.asCSSSelector=_a.asCSSSelector}(Df||(Df={}));const Tf={ThemingContribution:"base.contributions.theming"};class Mf{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Ye}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Pe(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let Of=new Mf;function Af(e){return Of.onColorThemeChange(e)}Ah.add(Tf.ThemingContribution,Of);class Rf extends We{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(){}}var Pf=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},Ff=function(e,t){return function(i,n){t(i,n,e)}};function Wf(e){return void 0!==e.command}class Bf{constructor(e){this.id=Bf._idPool++,this._debugName=e}}Bf._idPool=0,Bf.CommandPalette=new Bf("CommandPalette"),Bf.EditorContext=new Bf("EditorContext"),Bf.EditorContextPeek=new Bf("EditorContextPeek"),Bf.MenubarEditMenu=new Bf("MenubarEditMenu"),Bf.MenubarGoMenu=new Bf("MenubarGoMenu"),Bf.MenubarSelectionMenu=new Bf("MenubarSelectionMenu");const Vf=Zi("menuService"),Hf=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ye,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:e=>e===Bf.CommandPalette}}addCommand(e){return this.addCommands(Ee.single(e))}addCommands(e){for(const t of e)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Pe(()=>{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(Ee.single({id:e,item:t}))}appendMenuItems(e){const t=new Set,i=new ze;for(const{id:n,item:o}of e){let e=this._menuItems.get(n);e||(e=new ze,this._menuItems.set(n,e)),i.push(e.push(o)),t.add(n)}return this._onDidChangeMenu.fire(t),Pe(()=>{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===Bf.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)Wf(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 zf extends Xg{constructor(e,t,i,n){const o=[],s=t.createMenu(e.submenu,i),r=s.getActions(n);s.dispose();for(let a of r){const[,e]=a;e.length>0&&(o.push(...e),o.push(new Yg))}o.length&&o.pop(),super("submenuitem."+e.submenu.id,"string"===typeof e.title?e.title:e.title.value,o,"submenu"),this.item=e}}let Uf=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)}this.item=t,this.alt=i?new e(i,void 0,n,o,s):void 0,this._options=n,Df.isThemeIcon(t.icon)&&(this.class=_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)}};Uf=Pf([Ff(3,Cf),Ff(4,Hs)],Uf);const Kf=Zi("telemetryService");class jf{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?tf.and(e,this.precondition):this.precondition),Wu.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 zs.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Hf.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 qf extends jf{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((e,t)=>t[0]-e[0]),{dispose:()=>{for(let e=0;e{const i=e.get(Cf);if(i.contextMatchesRules(Vs(this.precondition)))return this.runEditorCommand(e,n,t)})}}class Yf extends Gf{constructor(e){super(Yf.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=Bf.EditorContext),t.title||(t.title=e.label),t.when=tf.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(Kf).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}function Xf(e){return tm.INSTANCE.registerEditorCommand(e),e}function Zf(e){const t=new e;return tm.INSTANCE.registerEditorAction(t),t}function Qf(e,t){tm.INSTANCE.registerEditorContribution(e,t)}var Jf;(function(e){function t(e){return tm.INSTANCE.getEditorCommand(e)}function i(){return tm.INSTANCE.getEditorActions()}function n(){return tm.INSTANCE.getEditorContributions()}function o(e){return tm.INSTANCE.getEditorContributions().filter(t=>e.indexOf(t.id)>=0)}function s(){return tm.INSTANCE.getDiffEditorContributions()}e.getEditorCommand=t,e.getEditorActions=i,e.getEditorContributions=n,e.getSomeEditorContributions=o,e.getDiffEditorContributions=s})(Jf||(Jf={}));const em={EditorCommonContributions:"editor.contributions"};class tm{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 im(e){return e.register(),e}tm.INSTANCE=new tm,Ah.add(em.EditorCommonContributions,tm.INSTANCE);const nm=im(new qf({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:Bf.MenubarEditMenu,group:"1_do",title:o({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:Bf.CommandPalette,group:"",title:o("undo","Undo"),order:1}]}));im(new $f(nm,{id:"default:undo",precondition:void 0}));const om=im(new qf({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:Bf.MenubarEditMenu,group:"1_do",title:o({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:Bf.CommandPalette,group:"",title:o("redo","Redo"),order:1}]}));im(new $f(om,{id:"default:redo",precondition:void 0}));const sm=im(new qf({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:Bf.MenubarSelectionMenu,group:"1_basic",title:o({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:Bf.CommandPalette,group:"",title:o("selectAll","Select All"),order:1}]}));class rm{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 am(e){return new rm(e)}let lm=0;function cm(){const e="$memoize"+lm++;let t=void 0;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=()=>{"undefined"!==typeof t&&Object.getOwnPropertyNames(t).forEach(i=>{0===i.indexOf(e)&&delete t[i]})},i}function dm(e,t,i){return cm()(e,t,i)}var hm,um=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){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"})(hm||(hm={}));class gm extends We{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(Zn(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(Zn(document,"touchend",e=>this.onTouchEnd(e))),this._register(Zn(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){return gm.isTouchDevice()?(gm.INSTANCE||(gm.INSTANCE=new gm),gm.INSTANCE.targets.push(e),{dispose:()=>{gm.INSTANCE.targets=gm.INSTANCE.targets.filter(t=>t!==e)}}):We.None}static ignoreTarget(e){return gm.isTouchDevice()?(gm.INSTANCE||(gm.INSTANCE=new gm),gm.INSTANCE.ignoreTargets.push(e),{dispose:()=>{gm.INSTANCE.ignoreTargets=gm.INSTANCE.ignoreTargets.filter(t=>t!==e)}}):We.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,n=e.targetTouches.length;i=gm.HOLD_DELAY&&Math.abs(s.initialPageX-tc(s.rollingPageX))<30&&Math.abs(s.initialPageY-tc(s.rollingPageY))<30){let e=this.newGestureEvent(hm.Contextmenu,s.initialTarget);e.pageX=tc(s.rollingPageX),e.pageY=tc(s.rollingPageY),this.dispatchEvent(e)}else if(1===i){let e=tc(s.rollingPageX),i=tc(s.rollingPageY),n=tc(s.rollingTimestamps)-s.rollingTimestamps[0],o=e-s.rollingPageX[0],r=i-s.rollingPageY[0];const a=this.targets.filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(a,t,Math.abs(o)/n,o>0?1:-1,e,Math.abs(r)/n,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent(hm.End,s.initialTarget)),delete this.activeTouches[o.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===hm.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>gm.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==hm.Change&&e.type!==hm.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,n,o,s,r,a){this.handle=oo(()=>{let l=Date.now(),c=l-t,d=0,h=0,u=!0;i+=gm.SCROLL_FRICTION*c,s+=gm.SCROLL_FRICTION*c,i>0&&(u=!1,d=n*i*c),s>0&&(u=!1,h=r*s*c);let g=this.newGestureEvent(hm.Change);g.translationX=d,g.translationY=h,e.forEach(e=>e.dispatchEvent(g)),u||this.inertia(e,l,i,n,o+d,s,r,a+h)})}onTouchMove(e){let t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}function fm(e,t){let i=new Tn(t);return i.preventDefault(),{leftButton:i.leftButton,buttons:i.buttons,posx:i.posx,posy:i.posy}}gm.SCROLL_FRICTION=-.005,gm.HOLD_DELAY=700,gm.CLEAR_TAP_COUNT_TIME=400,um([dm],gm,"isTouchDevice",null);class mm{constructor(){this._hooks=new Fe,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,n,o){if(this.isMonitoring())return;this._mouseMoveEventMerger=i,this._mouseMoveCallback=n,this._onStopCallback=o;const s=In.getSameOriginWindowChain(),r="mousemove",a="mouseup",l=s.map(e=>e.window.document),c=No(e);c&&l.unshift(c);for(const d of l)this._hooks.add(uo(d,r,e=>{e.buttons===t?this._mouseMoveCallback(e):this.stopMonitoring(!0)},(e,t)=>this._mouseMoveEventMerger(e,t))),this._hooks.add(Zn(d,a,e=>this.stopMonitoring(!0)));if(In.hasDifferentOriginAncestor()){let e=s[s.length-1];this._hooks.add(Zn(e.window.document,"mouseout",e=>{let t=new Tn(e);"html"===t.target.tagName.toLowerCase()&&this.stopMonitoring(!0)})),this._hooks.add(Zn(e.window.document,"mouseover",e=>{let t=new Tn(e);"html"===t.target.tagName.toLowerCase()&&this.stopMonitoring(!0)})),this._hooks.add(Zn(e.window.document.body,"mouseleave",e=>{this.stopMonitoring(!0)}))}}}class pm{constructor(e,t){this.x=e,this.y=t}toClientCoordinates(){return new _m(this.x-vo.scrollX,this.y-vo.scrollY)}}class _m{constructor(e,t){this.clientX=e,this.clientY=t}toPageCoordinates(){return new pm(this.clientX+vo.scrollX,this.clientY+vo.scrollY)}}class bm{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}}function vm(e){const t=bo(e);return new bm(t.left,t.top,t.width,t.height)}class wm extends Tn{constructor(e,t){super(e),this.pos=new pm(this.posx,this.posy),this.editorPos=vm(t)}}class Cm{constructor(e){this._editorViewDomNode=e}_create(e){return new wm(e,this._editorViewDomNode)}onContextMenu(e,t){return Zn(e,"contextmenu",e=>{t(this._create(e))})}onMouseUp(e,t){return Zn(e,"mouseup",e=>{t(this._create(e))})}onMouseDown(e,t){return Zn(e,"mousedown",e=>{t(this._create(e))})}onMouseLeave(e,t){return to(e,e=>{t(this._create(e))})}onMouseMoveThrottled(e,t,i,n){const o=(e,t)=>i(e,this._create(t));return uo(e,"mousemove",t,o,n)}}class ym{constructor(e){this._editorViewDomNode=e}_create(e){return new wm(e,this._editorViewDomNode)}onPointerUp(e,t){return Zn(e,"pointerup",e=>{t(this._create(e))})}onPointerDown(e,t){return Zn(e,"pointerdown",e=>{t(this._create(e))})}onPointerLeave(e,t){return io(e,e=>{t(this._create(e))})}onPointerMoveThrottled(e,t,i,n){const o=(e,t)=>i(e,this._create(t));return uo(e,"pointermove",t,o,n)}}class Sm extends We{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new mm),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=eo(document,"keydown",e=>{const t=e.toKeybinding();t.isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,e.browserEvent)},!0);const s=(e,t)=>i(e,new wm(t,this._editorViewDomNode));this._globalMouseMoveMonitor.startMonitoring(e,t,s,n,e=>{this._keydownListener.dispose(),o(e)})}}class xm extends We{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 Im(n,o),n=a,o=l)}return t[i++]=new Im(n,o),t}static _createHorizontalRangesFromClientRects(e,t){if(!e||0===e.length)return null;const i=[];for(let n=0,o=e.length;nl)return null;if(t=Math.min(l,Math.max(a,t)),n=Math.min(l,Math.max(a,n)),t===n&&i===o&&0===i){const i=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(i,s)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let c=e.children[t].firstChild,d=e.children[n].firstChild;if(c&&d||(!c&&0===i&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&0===o&&n>0&&(d=e.children[n-1].firstChild,o=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const h=this._readClientRects(c,i,d,o,r);return this._createHorizontalRangesFromClientRects(h,s)}}const Rm=function(){return!!s["g"]||!(s["d"]||cn||un)}();let Pm=!0;const Fm=ln;class Wm{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 Bm{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(38);this.renderWhitespace=i.get(83),this.renderControlCharacters=i.get(77),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(26),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(53),this.stopRenderingLineAfter=i.get(100),this.fontLigatures=i.get(39)}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 Vm{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=am(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!Fm&&this._options.themeType!==Lf.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=yd.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if(Fm||s.themeType===Lf.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 c=Td(l,n);n.appendASCIIString("");let d=null;return Pm&&Rm&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===c.containsForeignElements&&o.content.length<300&&l.lineTokens.getCount()<100&&(d=new Hm(this._renderedViewLine?this._renderedViewLine.domNode:null,l,c.characterMapping)),d||(d=Km(this._renderedViewLine?this._renderedViewLine.domNode:null,l,c.characterMapping,c.containsRTL,c.containsForeignElements)),this._renderedViewLine=d,!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 Hm}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Hm?this._renderedViewLine.monospaceAssumptionsAreValid():Pm}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Hm&&(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 Mm(o,s):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}Vm.CLASS_NAME="view-line";class Hm{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 Pm;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!"),Pm=!1),Pm}toSlowRenderedLine(){return Km(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i){const n=this._getCharPosition(e),o=this._getCharPosition(t);return[new Im(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;while(t)t=t.previousSibling,o++;const s=this._characterMapping.partDataToCharOffset(o,n,i);return s+1}}class zm{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 Im(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 Im(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=Am.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=Nd.getPartIndex(n),s=Nd.getCharIndex(n),r=Am.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 Im(0,this.getWidth())];const o=this._characterMapping.charOffsetToPartData(t-1),s=Nd.getPartIndex(o),r=Nd.getCharIndex(o),a=this._characterMapping.charOffsetToPartData(i-1),l=Nd.getPartIndex(a),c=Nd.getCharIndex(a);return Am.readHorizontalRanges(this._getReadingTarget(e),s,r,l,c,n.clientRectDeltaLeft,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;while(t)t=t.previousSibling,o++;const s=this._characterMapping.partDataToCharOffset(o,n,i);return s+1}}class Um extends zm{_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.left0&&(this.changes=Ym(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(ps["f"](e,t?t.length:0,i),i+=4,t)for(const n of t)ps["f"](e,n.selectionStartLineNumber,i),i+=4,ps["f"](e,n.selectionStartColumn,i),i+=4,ps["f"](e,n.positionLineNumber,i),i+=4,ps["f"](e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=ps["c"](e,t);t+=4;for(let o=0;oe.toString()).join(", ")}matchesResource(e){const t=Xt.isUri(this.model)?this.model:this.model.uri;return t.toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Qm}append(e,t,i,n,o){this._data instanceof Qm&&this._data.append(e,t,i,n,o)}close(){this._data instanceof Qm&&(this._data=this._data.serialize())}open(){this._data instanceof Qm||(this._data=Qm.deserialize(this._data))}undo(){if(Xt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Qm&&(this._data=this._data.serialize());const e=Qm.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Xt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Qm&&(this._data=this._data.serialize());const e=Qm.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Qm&&(this._data=this._data.serialize()),this._data.byteLength+168}}class ep{constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const i of this._editStackElementsArr){const e=Zm(i.resource);this._editStackElementsMap.set(e,i)}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=Zm(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Zm(Xt.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Zm(e.uri);if(this._editStackElementsMap.has(t)){const i=this._editStackElementsMap.get(t);return i.canAppend(e)}return!1}append(e,t,i,n,o){const s=Zm(e.uri),r=this._editStackElementsMap.get(s);r.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=Zm(e);if(this._editStackElementsMap.has(t)){const e=this._editStackElementsMap.get(t);return e.heapSize()}return 0}split(){return this._editStackElementsArr}toString(){let e=[];for(const t of this._editStackElementsArr)e.push(`${xs(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function tp(e){const t=e.getEOL();return"\n"===t?0:1}function ip(e){return!!e&&(e instanceof Jm||e instanceof ep)}class np{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);ip(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);ip(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(ip(t)&&t.canAppend(this._model))return t;const i=new Jm(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],tp(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),s=np._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),tp(this._model),this._model.getAlternativeVersionId(),s),s}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return ve(i),null}}}class op{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function sp(e,t,i,n,o){let s;for(o.spacesDiff=0,o.looksLikeAlignment=!1,s=0;s0&&a>0)return;if(l>0&&c>0)return;let d=Math.abs(a-c),h=Math.abs(r-l);if(0===d)return o.spacesDiff=h,void(h>0&&0<=l-1&&l-10?o++:p>1&&s++,sp(r,a,l,m,h),h.looksLikeAlignment&&(!i||t!==h.spacesDiff))continue;let b=h.spacesDiff;b<=c&&d[b]++,r=l,a=m}let u=i;o!==s&&(u=o{let i=d[t];i>e&&(e=i,g=t)}),4===g&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function ap(e){return(1&e.metadata)>>>0}function lp(e,t){e.metadata=254&e.metadata|t<<0}function cp(e){return(2&e.metadata)>>>1===1}function dp(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function hp(e){return(4&e.metadata)>>>2===1}function up(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function gp(e){return(8&e.metadata)>>>3===1}function fp(e,t){e.metadata=247&e.metadata|(t?1:0)<<3}function mp(e){return(48&e.metadata)>>>4}function pp(e,t){e.metadata=207&e.metadata|t<<4}function _p(e){return(64&e.metadata)>>>6===1}function bp(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}class vp{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,lp(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,up(this,!1),pp(this,1),fp(this,!1),bp(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,dp(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;up(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),pp(this,this.options.stickiness),fp(this,!(!this.options.overviewRuler||!this.options.overviewRuler.color)),bp(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 wp=new vp(null,0,0);wp.parent=wp,wp.left=wp,wp.right=wp,lp(wp,0);class Cp{constructor(){this.root=wp,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o){return this.root===wp?[]:Ip(this,e,t,i,n,o)}search(e,t,i){return this.root===wp?[]:Np(this,e,t,i)}collectNodesFromOwner(e){return Ep(this,e)}collectNodesPostOrder(){return Dp(this)}insert(e){Tp(this,e),this._normalizeDeltaIfNecessary()}delete(e){Op(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;while(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=Lp(this,e,e+t);for(let s=0,r=o.length;si)&&(1!==n&&(2===n||t))}function xp(e,t,i,n,o){const s=mp(e),r=0===s||2===s,a=1===s||2===s,l=i-t,c=n,d=Math.min(l,c),h=e.start;let u=!1;const g=e.end;let f=!1;t<=h&&g<=i&&_p(e)&&(e.start=t,u=!0,e.end=t,f=!0);{const e=o?1:l>0?2:0;!u&&Sp(h,r,t,e)&&(u=!0),!f&&Sp(g,a,t,e)&&(f=!0)}if(d>0&&!o){const e=l>c?2:0;!u&&Sp(h,r,t+d,e)&&(u=!0),!f&&Sp(g,a,t+d,e)&&(f=!0)}{const n=o?1:0;!u&&Sp(h,r,i,n)&&(e.start=t+c,u=!0),!f&&Sp(g,a,i,n)&&(e.end=t+c,f=!0)}const m=c-l;u||(e.start=Math.max(0,h+m)),f||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function Lp(e,t,i){let n=e.root,o=0,s=0,r=0,a=0,l=[],c=0;while(n!==wp)if(cp(n))dp(n.left,!1),dp(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!cp(n.left)){if(s=o+n.maxEnd,si?dp(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[c++]=n),dp(n,!0),n.right===wp||cp(n.right)||(o+=n.delta,n=n.right))}return dp(e.root,!1),l}function kp(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=n-(i-t);while(o!==wp)if(cp(o))dp(o.left,!1),dp(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),Bp(o),o=o.parent;else{if(!cp(o.left)){if(r=s+o.maxEnd,ri?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),dp(o,!0)):(dp(o,!0),o.right===wp||cp(o.right)||(s+=o.delta,o=o.right))}dp(e.root,!1)}function Ep(e,t){let i=e.root,n=[],o=0;while(i!==wp)cp(i)?(dp(i.left,!1),dp(i.right,!1),i=i.parent):i.left===wp||cp(i.left)?(i.ownerId===t&&(n[o++]=i),dp(i,!0),i.right===wp||cp(i.right)||(i=i.right)):i=i.left;return dp(e.root,!1),n}function Dp(e){let t=e.root,i=[],n=0;while(t!==wp)cp(t)?(dp(t.left,!1),dp(t.right,!1),t=t.parent):t.left===wp||cp(t.left)?t.right===wp||cp(t.right)?(i[n++]=t,dp(t,!0)):t=t.right:t=t.left;return dp(e.root,!1),i}function Np(e,t,i,n){let o=e.root,s=0,r=0,a=0,l=[],c=0;while(o!==wp){if(cp(o)){dp(o.left,!1),dp(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==wp&&!cp(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&&hp(o)&&(e=!1),e&&(l[c++]=o),dp(o,!0),o.right===wp||cp(o.right)||(s+=o.delta,o=o.right)}return dp(e.root,!1),l}function Ip(e,t,i,n,o,s){let r=e.root,a=0,l=0,c=0,d=0,h=[],u=0;while(r!==wp)if(cp(r))dp(r.left,!1),dp(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;else{if(!cp(r.left)){if(l=a+r.maxEnd,li)dp(r,!0);else{if(d=a+r.end,d>=t){r.setCachedOffsets(c,d,s);let e=!0;n&&r.ownerId&&r.ownerId!==n&&(e=!1),o&&hp(r)&&(e=!1),e&&(h[u++]=r)}dp(r,!0),r.right===wp||cp(r.right)||(a+=r.delta,r=r.right)}}return dp(e.root,!1),h}function Tp(e,t){if(e.root===wp)return t.parent=wp,t.left=wp,t.right=wp,lp(t,0),e.root=t,e.root;Mp(e,t),Vp(t.parent);let i=t;while(i!==e.root&&1===ap(i.parent))if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===ap(t)?(lp(i.parent,0),lp(t,0),lp(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,Pp(e,i)),lp(i.parent,0),lp(i.parent.parent,1),Fp(e,i.parent.parent))}else{const t=i.parent.parent.left;1===ap(t)?(lp(i.parent,0),lp(t,0),lp(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,Fp(e,i)),lp(i.parent,0),lp(i.parent.parent,1),Pp(e,i.parent.parent))}return lp(e.root,0),t}function Mp(e,t){let i=0,n=e.root;const o=t.start,s=t.end;while(1){const e=Hp(o,s,n.start+i,n.end+i);if(e<0){if(n.left===wp){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===wp){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}}t.parent=n,t.left=wp,t.right=wp,lp(t,1)}function Op(e,t){let i,n;if(t.left===wp?(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===wp?(i=t.left,n=t):(n=Ap(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,lp(i,0),t.detach(),Rp(),Bp(i),void(e.root.parent=wp);let o,s=1===ap(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,lp(n,ap(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==wp&&(n.left.parent=n),n.right!==wp&&(n.right.parent=n)),t.detach(),s)return Vp(i.parent),n!==t&&(Vp(n),Vp(n.parent)),void Rp();Vp(i),Vp(i.parent),n!==t&&(Vp(n),Vp(n.parent));while(i!==e.root&&0===ap(i))i===i.parent.left?(o=i.parent.right,1===ap(o)&&(lp(o,0),lp(i.parent,1),Pp(e,i.parent),o=i.parent.right),0===ap(o.left)&&0===ap(o.right)?(lp(o,1),i=i.parent):(0===ap(o.right)&&(lp(o.left,0),lp(o,1),Fp(e,o),o=i.parent.right),lp(o,ap(i.parent)),lp(i.parent,0),lp(o.right,0),Pp(e,i.parent),i=e.root)):(o=i.parent.left,1===ap(o)&&(lp(o,0),lp(i.parent,1),Fp(e,i.parent),o=i.parent.left),0===ap(o.left)&&0===ap(o.right)?(lp(o,1),i=i.parent):(0===ap(o.left)&&(lp(o.right,0),lp(o,1),Pp(e,o),o=i.parent.left),lp(o,ap(i.parent)),lp(i.parent,0),lp(o.left,0),Fp(e,i.parent),i=e.root));lp(i,0),Rp()}function Ap(e){while(e.left!==wp)e=e.left;return e}function Rp(){wp.parent=wp,wp.delta=0,wp.start=0,wp.end=0}function Pp(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!==wp&&(i.left.parent=t),i.parent=t.parent,t.parent===wp?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,Bp(t),Bp(i)}function Fp(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!==wp&&(i.right.parent=t),i.parent=t.parent,t.parent===wp?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,Bp(t),Bp(i)}function Wp(e){let t=e.end;if(e.left!==wp){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==wp){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function Bp(e){e.maxEnd=Wp(e)}function Vp(e){while(e!==wp){const t=Wp(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function Hp(e,t,i,n){return e===i?t-n:e-i}class zp{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!==Up)return Kp(this.right);let e=this;while(e.parent!==Up){if(e.parent.left===e)break;e=e.parent}return e.parent===Up?Up:e.parent}prev(){if(this.left!==Up)return jp(this.left);let e=this;while(e.parent!==Up){if(e.parent.right===e)break;e=e.parent}return e.parent===Up?Up:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Up=new zp(null,0);function Kp(e){while(e.left!==Up)e=e.left;return e}function jp(e){while(e.right!==Up)e=e.right;return e}function qp(e){return e===Up?0:e.size_left+e.piece.length+qp(e.right)}function $p(e){return e===Up?0:e.lf_left+e.piece.lineFeedCnt+$p(e.right)}function Gp(){Up.parent=Up}function Yp(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!==Up&&(i.left.parent=t),i.parent=t.parent,t.parent===Up?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function Xp(e,t){let i=t.left;t.left=i.right,i.right!==Up&&(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===Up?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function Zp(e,t){let i,n;if(t.left===Up?(n=t,i=n.right):t.right===Up?(n=t,i=n.left):(n=Kp(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),Gp(),void(e.root.parent=Up);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,e_(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,e_(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!==Up&&(n.left.parent=n),n.right!==Up&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,e_(e,n)),t.detach(),i.parent.left===i){let t=qp(i),n=$p(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,Jp(e,i.parent,o,s)}}if(e_(e,i.parent),s)Gp();else{while(i!==e.root&&0===i.color)i===i.parent.left?(o=i.parent.right,1===o.color&&(o.color=0,i.parent.color=1,Yp(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,Xp(e,o),o=i.parent.right),o.color=i.parent.color,i.parent.color=0,o.right.color=0,Yp(e,i.parent),i=e.root)):(o=i.parent.left,1===o.color&&(o.color=0,i.parent.color=1,Xp(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,Yp(e,o),o=i.parent.left),o.color=i.parent.color,i.parent.color=0,o.left.color=0,Xp(e,i.parent),i=e.root));i.color=0,Gp()}}function Qp(e,t){e_(e,t);while(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&&(t=t.parent,Yp(e,t)),t.parent.color=0,t.parent.parent.color=1,Xp(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&&(t=t.parent,Xp(e,t)),t.parent.color=0,t.parent.parent.color=1,Yp(e,t.parent.parent))}e.root.color=0}function Jp(e,t,i,n){while(t!==e.root&&t!==Up)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function e_(e,t){let i=0,n=0;if(t!==e.root){if(0===i){while(t!==e.root&&t===t.parent.right)t=t.parent;if(t===e.root)return;t=t.parent,i=qp(t.left)-t.size_left,n=$p(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n}while(t!==e.root&&(0!==i||0!==n))t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}Up.parent=Up,Up.left=Up,Up.right=Up,Up.color=0;class t_ extends Bc{constructor(e){super(0);for(let t=0,i=e.length;t(t.hasOwnProperty(i)||(t[i]=e(i)),t[i])}const n_=i_(e=>new t_(e)),o_=999;class s_{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?r_(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=rs["p"](this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(n){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new a_(t,this.wordSeparators?n_(this.wordSeparators):null,i?this.searchString:null)}}function r_(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}class a_{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}function l_(e,t,i){if(!i)return new vr(e,null);let n=[];for(let o=0,s=t.length;o>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class d_{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new f_(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),t=e-l;a=r+s.length+t}else a=r+s.length;const c=e.getPositionAt(r),d=e.getPositionAt(a);return new li(c.lineNumber,c.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 c_(r):null,l=[];let c,d=0;i.reset(0);while(c=i.next(r))if(l[d++]=l_(this._getMultilineMatchRange(e,s,r,a,c.index,c[0]),c,n),d>=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 l=t.startLineNumber+1;l=a))return o;return o}const c=new f_(e.wordSeparators,e.regex);let d;c.reset(0);do{if(d=c.next(t),d&&(s[o++]=l_(new li(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 f_(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 ai(t.lineNumber,1),s=e.getOffsetAt(o),r=e.getLineCount(),a=e.getValueInRange(new li(o.lineNumber,o.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new c_(a):null;i.reset(t.column-1);let c=i.next(a);return c?l_(this._getMultilineMatchRange(e,s,a,l,c.index,c[0]),c,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new ai(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 l=1;l<=o;l++){const t=(s+l-1)%o,r=e.getLineContent(t+1),a=this._findFirstMatchInLine(i,r,t+1,1,n);if(a)return a}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const s=e.next(t);return s?l_(new li(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 f_(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 li(1,1,t.lineNumber,t.column),i,n,10*o_);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 ai(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 l=1;l<=o;l++){const t=(o+s-l-1)%o,r=e.getLineContent(t+1),a=this._findLastMatchInLine(i,r,t+1,n);if(a)return a}return null}static _findLastMatchInLine(e,t,i,n){let o,s=null;e.reset(0);while(o=e.next(t))s=l_(new li(i,o.index+1,i,o.index+1+o[0].length),o,n);return s}}function h_(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}function u_(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}function g_(e,t,i,n,o){return h_(e,t,i,n,o)&&u_(e,t,i,n,o)}class f_{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){rs["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||g_(this._wordSeparators,e,t,n,o))return i}while(i);return null}}const m_=65535;function p_(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class __{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function b_(e,t=!0){let i=[0],n=1;for(let o=0,s=e.length;o126)&&(r=!1)}const a=new __(p_(e),n,o,s,r);return e.length=0,a}class w_{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class C_{constructor(e,t){this.buffer=e,this.lineStarts=t}}class y_{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Up&&e.iterate(e.root,e=>(e!==Up&&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 S_{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 x_{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new C_("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Up,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,s=e.length;o0){e[o].lineStarts||(e[o].lineStarts=b_(e[o].buffer));let t=new w_(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),n=this.rbInsertRight(n,t)}this._searchCache=new S_(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=m_,i=t-Math.floor(t/3),n=2*i,o="",s=0,r=[];if(this.iterate(this.root,t=>{let a=this.getNodeContent(t),l=a.length;if(s<=i||s+l0){let t=o.replace(/\r\n|\r|\n/g,e);r.push(new C_(t,b_(t)))}this.create(r,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new y_(this,e)}getOffsetAt(e,t){let i=0,n=this.root;while(n!==Up)if(n.left!==Up&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;let o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+(o+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;while(t!==Up)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=this.getOffsetAt(i+1,1),t=n-e;return new ai(i+1,t+1)}return new ai(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Up){let t=this.getOffsetAt(i+1,1),o=n-e-t;return new ai(i+1,o+1)}t=t.right}return new ai(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);i=i.next();while(i!==Up){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===Up)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,c=s.start.line,d=s.end.line;let h=l[c]+s.start.column;if(n&&(10===a.charCodeAt(h)&&(h++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(c===d)return this._EOLNormalized||13!==a.charCodeAt(h+r-1)?i+=a.substr(h,r):(n=!0,i+=a.substr(h,r-1)),!0;i+=this._EOLNormalized?a.substring(h,Math.max(h,l[c+1]-this._EOLLength)):a.substring(h,l[c+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=c+1;ne+p,t.reset(0)):(u=f.buffer,g=e=>e,t.reset(p));do{if(h=t.next(u),h){if(g(h.index)>=_)return c;this.positionInBuffer(e,g(h.index)-m,b);let t=this.getLineFeedCnt(e.piece.bufferIndex,o,b),s=b.line===o.line?b.column-o.column+n:b.column+1,r=s+h[0].length;if(d[c++]=l_(new li(i+t,s,i+t,r),h,a),g(h.index)+h[0].length>=_)return c;if(c>=l)return c}}while(h);return c}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new f_(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 c=this.positionInBuffer(a.node,a.remainder),d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,c,d,t,i,n,s,o),o;let h=e.startLineNumber,u=a.node;while(u!==l.node){let l=this.getLineFeedCnt(u.piece.bufferIndex,c,u.piece.end);if(l>=1){let a=this._buffers[u.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[c.line+l],f=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,h,f,c,this.positionInBuffer(u,g-d),t,i,n,s,o),s>=n)return o;h+=l}let d=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const a=this.getLineContent(h).substring(d,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,d,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(h).substr(d),h,d,s,o,i,n),s>=n)return o;h++,a=this.nodeAt2(h,1),u=a.node,c=this.positionInBuffer(a.node,a.remainder)}if(h===e.endLineNumber){let a=h===e.startLineNumber?e.startColumn-1:0;const l=this.getLineContent(h).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}let g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,h,g,c,d,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=i.length;let h=-a;while(-1!==(h=i.indexOf(t,h+a)))if((!c||g_(c,i,d,h,a))&&(r[s++]=new vr(new li(n,h+1+o,n,h+1+a+o),null),s>=l))return s;return s}let d;t.reset(0);do{if(d=t.next(i),d&&(r[s++]=l_(new li(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!==Up){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 w_(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)){let e=this.nodeCharCodeAt(i,n);if(10===e){let e={line:o.start.line+1,column:0};o=new w_(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){let o=this.nodeCharCodeAt(i,n-1);if(13===o){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 c=i;for(let t=0;t=0;s--)o=this.rbInsertLeft(o,n[s]);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 s=1;s=h))break;l=d+1}}return i?(i.line=d,i.column=a-u,null):{line:d,column:a-u}}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,a=this._buffers[e].buffer;return 13===a.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){let i=this._buffers[e].lineStarts;return i[t.line]+t.column}deleteNodes(e){for(let t=0;tm_){let t=[];while(e.length>m_){const i=e.charCodeAt(m_-1);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,m_-1),e=e.substring(m_-1)):(n=e.substring(0,m_),e=e.substring(m_));let o=b_(n);t.push(new w_(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 C_(n,o))}let i=b_(e);return t.push(new w_(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 C_(e,i)),t}let t=this._buffers[0].buffer.length;const i=b_(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}}i=i.next();while(i!==Up){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;while(e!==Up)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,c=r-o,d=i.length+c;e.piece=new w_(i.bufferIndex,i.start,s,a,d),Jp(this,e,c,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=this.offsetInBuffer(i.bufferIndex,s),l=r-n,c=o-a,d=i.length+c;e.piece=new w_(i.bufferIndex,s,i.end,r,d),Jp(this,e,c,l)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,c=this.getLineFeedCnt(n.bufferIndex,n.start,l),d=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new w_(n.bufferIndex,n.start,l,c,d),Jp(this,e,d-r,c-a);let h=new w_(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,h);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=b_(t,!1);for(let u=0;ue)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;while(i!==Up)if(i.left!==Up&&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}i=i.next();while(i!==Up){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){let e=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:e}}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;while(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===Up||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;if(n===i.length-1)return!1;let s=i[n+1];return!(s>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o)}endWithCR(e){return"string"===typeof e?13===e.charCodeAt(e.length-1):e!==Up&&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 w_(e.piece.bufferIndex,e.piece.start,i,r,s),Jp(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,c=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new w_(t.piece.bufferIndex,a,t.piece.end,c,l),Jp(this,t,-1,-1),0===t.piece.length&&n.push(t);let d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let h=0;h>>0}const E_=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],n=i.startLineNumber+i.tokens.length-1;if(n+1===e)return void i.tokens.push(t)}this.tokens.push(new M_(e,[t]))}}class N_{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;ie)){let o=n;while(o>t&&this._getDeltaLine(o-1)===e)o--;let s=n;while(se||d===e&&u>=t)&&(de||r===e&&g>=t){if(ro?f-=o-i:f=i;else if(u===t&&g===i){if(!(u===n&&f>o)){c=!0;continue}f-=o-i}else if(uo)){c=!0;continue}u===t?(g=i,f=g+(f-o)):(g=0,f=g+(f-o))}else if(u>n){if(0===a&&!c){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,f+=e),u-=a,g-=o-i,f-=o-i}const p=4*l;s[p]=u,s[p+1]=g,s[p+2]=f,s[p+3]=m,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 c=0;c0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new ai(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;if(s<0)return void(this.startLineNumber+=t);const r=this.tokens.getMaxDeltaLine();s>=r+1||this.tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}class M_{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function O_(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class A_{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 n=null;for(let o=0,s=this._pieces.length;oi.endLineNumber){n=n||{index:o};break}if(e.removeTokens(i),e.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(e.endLineNumberi.endLineNumber){n=n||{index:o};continue}const[t,r]=e.split(i);t.isEmpty()?n=n||{index:o}:r.isEmpty()||(this._pieces.splice(o,1,t,r),o++,s++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=mc(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSemanticTokens(e,t){const i=this._pieces;if(0===i.length)return t;const n=A_._findFirstPieceWithLine(i,e),o=i[n].getLineTokens(e);if(!o)return t;const s=t.getCount(),r=o.getCount();let a=0,l=[],c=0,d=0;const h=(e,t)=>{e!==d&&(d=e,l[c++]=e,l[c++]=t)};for(let u=0;u>>0,l=~r>>>0;while(at)){while(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 R_{constructor(){this._lineTokens=[],this._len=0}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let n=null;if(t1&&(t=va.getLanguageId(n[1])!==e),!t)return E_}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=k_(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){while(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 n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=R_._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=R_._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len||(0!==t?(this._lineTokens[n]=R_._deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=R_._insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=R_._insert(this._lineTokens[n],e.column-1,i))}static _deleteBeginning(e,t){return null===e||e===E_?e:R_._delete(e,0,t)}static _deleteEnding(e,t){if(null===e||e===E_)return e;const i=O_(e),n=i[i.length-2];return R_._delete(e,t,n)}static _delete(e,t,i){if(null===e||e===E_||t===i)return e;const n=O_(e),o=n.length>>>1;if(0===t&&n[n.length-2]===i)return E_;const s=wd.findIndexInTokensArray(n,t),r=s>0?n[s-1<<1]:0,a=n[s<<1];if(ic&&(n[l++]=e,n[l++]=n[1+(u<<1)],c=e)}if(l===n.length)return e;let h=new Uint32Array(l);return h.set(n.subarray(0,l),0),h.buffer}static _append(e,t){if(t===E_)return e;if(e===E_)return t;if(null===e)return e;if(null===t)return null;const i=O_(e),n=O_(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 l=0;l>>1;let s=wd.findIndexInTokensArray(n,t);if(s>0){const e=n[s-1<<1];e===t&&s--}for(let r=s;re.sortIndex-t.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const u=this._doApplyEdits(a);let g=null;if(t&&d.length>0){d.sort((e,t)=>t.lineNumber-e.lineNumber),g=[];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===rs["u"](n)&&g.push(t)}}return this._onDidChangeContent.fire(),new Cr(h,u,g)}_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 li(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let u=0,g=e.length;u0&&a.push(i.text),s=n.endLineNumber,r=n.endColumn}const l=a.join(""),[c,d,h]=L_(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:c,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(P_._sortOpsDescending);let t=[];for(let i=0;i0){const e=c.eolCount+1;l=1===e?new li(r,a,r,a+c.firstLineLength):new li(r,a,r+e-1,c.lastLineLength+1)}else l=new li(r,a,r,a);i=l.endLineNumber,n=l.endColumn,t.push(l),o=c}return t}static _sortOpsAscending(e,t){let i=li.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=li.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class F_{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 o=0,s=i.length;o=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=v_(this._tmpLineStarts,e);this.chunks.push(new C_(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=rs["m"](e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=rs["n"](e))}finish(e=!0){return this._finish(),new F_(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=b_(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class B_{constructor(){this.changeType=1}}class V_{constructor(e,t){this.changeType=2,this.lineNumber=e,this.detail=t}}class H_{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class z_{constructor(e,t,i){this.changeType=4,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class U_{constructor(){this.changeType=5}}class K_{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 o=0;o=0;s--)this._invalidateLine(e.startLineNumber+s-1);this._acceptDeleteRange(e),this._acceptInsertText(new ai(e.startLineNumber,e.startColumn),t)}_acceptDeleteRange(e){const t=e.startLineNumber-1;t>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){const i=e.lineNumber-1;i>=this._len||this._insertLines(e.lineNumber,t)}}class $_ extends We{constructor(e){super(),this._isDisposed=!1,this._textModel=e,this._tokenizationStateStore=new q_,this._tokenizationSupport=null,this._register(Ga.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]=G_(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&s["k"](()=>{this._isDisposed||this._revalidateTokensNow()})}_revalidateTokensNow(e=this._textModel.getLineCount()){const t=1,i=new D_,n=Ke.create(!1);while(this._hasLinesToTokenize()){if(n.elapsed()>t)break;const o=this._tokenizeOneInvalidLine(i);if(o>=e)break}this._beginBackgroundTokenization(),this._textModel.setTokens(i.tokens)}tokenizeViewport(e,t){const i=new D_;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens)}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new D_;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&&l>=1;l--){let e=this._textModel.getLineFirstNonWhitespaceColumn(l);if(0!==e&&e=0;l--){let e=Y_(r,this._tokenizationSupport,o[l],!1,a);a=e.endState}for(let l=t;l<=i;l++){let t=this._textModel.getLineContent(l),i=Y_(r,this._tokenizationSupport,t,!0,a);e.add(l,i.tokens),this._tokenizationStateStore.setFakeTokens(l-1),a=i.endState}}}function G_(e){const t=e.getLanguageIdentifier();let i=e.isTooLargeForTokenization()?null:Ga.get(t.language),n=null;if(i)try{n=i.getInitialState()}catch(o){ve(o),i=null}return[i,n]}function Y_(e,t,i,n,o){let s=null;if(t)try{s=t.tokenize2(i,n,o.clone(),0)}catch(r){ve(r)}return s||(s=el(e.id,i,o,0)),wd.convertToEndOffset(s.tokens,i.length),s}function X_(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}class Z_{constructor(e,t,i,n=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=X_(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class Q_{constructor(e,t,i,n){this.h=0|Math.max(Math.min(360,e),0),this.s=X_(Math.max(Math.min(1,t),0),3),this.l=X_(Math.max(Math.min(1,i),0),3),this.a=X_(Math.max(Math.min(1,n),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,s=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const c=(r+s)/2,d=s-r;if(d>0){switch(l=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),s){case t:a=(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:o}=e;let s,r,a;if(0===i)s=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,o=2*n-e;s=Q_._hue2rgb(o,e,t+1/3),r=Q_._hue2rgb(o,e,t),a=Q_._hue2rgb(o,e,t-1/3)}return new Z_(Math.round(255*s),Math.round(255*r),Math.round(255*a),o)}}class J_{constructor(e,t,i,n){this.h=0|Math.max(Math.min(360,e),0),this.s=X_(Math.max(Math.min(1,t),0),3),this.v=X_(Math.max(Math.min(1,i),0),3),this.a=X_(Math.max(Math.min(1,n),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=Math.min(t,i,n),r=o-s,a=0===o?0:r/o;let l;return l=0===r?0:o===t?((i-n)/r%6+6)%6:o===i?(n-t)/r+2:(t-i)/r+4,new J_(Math.round(60*l),a,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,s=n*i,r=s*(1-Math.abs(t/60%2-1)),a=n-s;let[l,c,d]=[0,0,0];return t<60?(l=s,c=r):t<120?(l=r,c=s):t<180?(c=s,d=r):t<240?(c=r,d=s):t<300?(l=r,d=s):t<=360&&(l=s,d=r),l=Math.round(255*(l+a)),c=Math.round(255*(c+a)),d=Math.round(255*(d+a)),new Z_(l,c,d,o)}}class eb{constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof Z_)this.rgba=e;else if(e instanceof Q_)this._hsla=e,this.rgba=Q_.toRGBA(e);else{if(!(e instanceof J_))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=J_.toRGBA(e)}}static fromHex(e){return eb.Format.CSS.parseHex(e)||eb.red}get hsla(){return this._hsla?this._hsla:Q_.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:J_.fromRGBA(this.rgba)}equals(e){return!!e&&Z_.equals(this.rgba,e.rgba)&&Q_.equals(this.hsla,e.hsla)&&J_.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=eb._relativeLuminanceForComponent(this.rgba.r),t=eb._relativeLuminanceForComponent(this.rgba.g),i=eb._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return X_(n,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){const e=(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3;return e>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}while(1)}}const lb=()=>{throw new Error("Invalid change accessor")};class cb{constructor(){this._searchCanceledBrand=void 0}}function db(e){return e instanceof cb?null:e}cb.INSTANCE=new cb;class hb extends We{constructor(e,t,i,n=null,o){super(),this._onWillDispose=this._register(new Ye),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new wb),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new Ye),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new Ye),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new Ye),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new Ye),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new Ye),this.onDidChangeAttached=this._onDidChangeAttached.event,this._eventEmitter=this._register(new Cb),ob++,this.id="$model"+ob,this.isForSimpleWidget=t.isForSimpleWidget,this._associatedResource="undefined"===typeof n||null===n?Xt.parse("inmemory://model/"+ob):n,this._undoRedoService=o,this._attachedEditorCount=0;const{textBuffer:s,disposable:r}=nb(e,t.defaultEOL);this._buffer=s,this._bufferDisposable=r,this._options=hb.resolveOptions(this._buffer,t);const a=this._buffer.getLineCount(),l=this._buffer.getValueLengthInRange(new li(1,1,a,this._buffer.getLineLength(a)+1),0);t.largeFileOptimizations?this._isTooLargeForTokenization=l>hb.LARGE_FILE_SIZE_THRESHOLD||a>hb.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=l>hb.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageIdentifier=i||Qa,this._languageRegistryListener=ec.onDidChange(e=>{e.languageIdentifier.id===this._languageIdentifier.id&&this._onDidChangeLanguageConfiguration.fire({})}),this._instanceId=rs["O"](ob),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new ub,this._commandManager=new np(this,o),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new R_,this._tokens2=new A_,this._tokenization=new $_(this)}static resolveOptions(e,t){if(t.detectIndentation){const i=rp(e,t.tabSize,t.insertSpaces);return new br({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new br({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 P_([],"","\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 j_(e,t))}setValue(e){if(this._assertNotDisposed(),null===e)return;const{textBuffer:t,disposable:i}=nb(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 ub,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new K_([new B_],this._versionId,!1,!1),this._createContentChanged2(new li(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 K_([new U_],this._versionId,!1,!1),this._createContentChanged2(new li(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>=rb?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="undefined"!==typeof e.tabSize?e.tabSize:this._options.tabSize,i="undefined"!==typeof e.indentSize?e.indentSize:this._options.indentSize,n="undefined"!==typeof e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o="undefined"!==typeof e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=new br({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=rp(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 s=0;s({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 ab(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,s;if(i<1)o=1,s=1;else if(i>t)o=t,s=this.getLineMaxColumn(o);else if(o=0|i,n<=1)s=1;else{const e=this.getLineMaxColumn(o);s=n>=e?e:0|n}const r=e.endLineNumber,a=e.endColumn;let l,c;if(r<1)l=1,c=1;else if(r>t)l=t,c=this.getLineMaxColumn(l);else if(l=0|r,a<=1)c=1;else{const e=this.getLineMaxColumn(l);c=a>=e?e:0|a}return i===o&&n===s&&r===l&&a===c&&e instanceof li&&!(e instanceof ci)?e:new li(o,s,l,c)}_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;const n=this._buffer.getLineCount();if(e>n)return!1;if(1===t)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(1===i){const i=this._buffer.getLineCharCode(e,t-2);if(rs["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 ai(1,1);if(n>s)return new ai(s,this.getLineMaxColumn(s));if(o<=1)return new ai(n,1);const r=this.getLineMaxColumn(n);if(o>=r)return new ai(n,r);if(1===i){const e=this._buffer.getLineCharCode(n,o-2);if(rs["D"](e))return new ai(n,o-1)}return new ai(n,o)}validatePosition(e){const t=1;return this._assertNotDisposed(),e instanceof ai&&this._isValidPosition(e.lineNumber,e.column,t)?e:this._validatePosition(e.lineNumber,e.column,t)}_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,r=rs["D"](e),a=rs["D"](t);return!r&&!a}return!0}validateRange(e){const t=1;if(this._assertNotDisposed(),e instanceof li&&!(e instanceof ci)&&this._isValidRange(e,t))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,s=i.column,r=n.lineNumber,a=n.column;if(1===t){const e=s>1?this._buffer.getLineCharCode(o,s-2):0,t=a>1&&a<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,a-2):0,i=rs["D"](e),n=rs["D"](t);return i||n?o===r&&s===a?new li(o,s-1,r,a-1):i&&n?new li(o,s-1,r,a+1):i?new li(o,s-1,r,a):new li(o,s,r,a+1):new li(o,s,r,a)}return new li(o,s,r,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 li(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=sb){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every(e=>li.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 c;if(l.push(a.reduce((e,t)=>li.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t))),!i&&e.indexOf("\n")<0){const t=new s_(e,i,n,o),a=t.parseSearchRequest();if(!a)return[];c=e=>this.findMatchesLineByLine(e,a,s,r)}else c=t=>d_.findMatches(this,new s_(e,i,n,o),t,s,r);return l.map(c).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 s_(e,i,n,o),a=t.parseSearchRequest();if(!a)return null;const l=this.getLineCount();let c=new li(r.lineNumber,r.column,l,this.getLineMaxColumn(l)),d=this.findMatchesLineByLine(c,a,s,1);return d_.findNextMatch(this,new s_(e,i,n,o),r,s),d.length>0?d[0]:(c=new li(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),d=this.findMatchesLineByLine(c,a,s,1),d.length>0?d[0]:null)}return d_.findNextMatch(this,new s_(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return d_.findPreviousMatch(this,new s_(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){const t="\n"===this.getEOL()?0:1;if(t!==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 wr?e:new wr(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,o=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 li(n,1,n,o);t.push(new wr(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 li(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 li(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 c=n.range.startLineNumber,d=n.range.endLineNumber,h=d-c,u=r,g=Math.min(h,u),f=u-h;for(let i=g;i>=0;i--){const n=c+i,s=o-t-f+n;e.push(new V_(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,vb(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)},n=null;try{n=t(i)}catch(o){ve(o)}return i.addDecoration=lb,i.changeDecoration=lb,i.changeDecorationOptions=lb,i.removeDecoration=lb,i.deltaDecorations=lb,n}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:bb[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(bb[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;ithis.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 li(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 ai(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]=hb._findLanguageBoundaries(n,o),a=h(t.column,ec.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]=hb._findLanguageBoundaries(n,o-1),a=h(t.column,ec.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 s=t;s>=0&&e.getLanguageId(s)===i;s--)n=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,r=e.getCount();s=0;e--){const t=i.getEndOffset(e);if(t<=n)break;yl(i.getStandardTokenType(e))&&(n=t)}const a=Math.min(o.length,e.column-1+r.maxBracketLength);let l=null;while(1){const i=ql.findNextBracketInRange(r.forwardRegex,t,o,n,a);if(!i)break;if(i.startColumn<=e.column&&e.column<=i.endColumn){const e=o.substring(i.startColumn-1,i.endColumn-1).toLowerCase(),t=this._matchFoundBracket(i,r.textIsBracket[e],r.textIsOpenBracket[e],null);if(t){if(t instanceof cb)return null;l=t}}n=i.endColumn-1}if(l)return l}if(s>0&&i.getStartOffset(s)===e.column-1){const r=s-1,a=ec.getBracketsSupport(i.getLanguageId(r));if(a&&!yl(i.getStandardTokenType(r))){const s=Math.max(0,e.column-1-a.maxBracketLength);let l=Math.min(o.length,e.column-1+a.maxBracketLength);for(let e=r+1;e=l)break;yl(i.getStandardTokenType(e))&&(l=t)}const c=ql.findPrevBracketInRange(a.reversedRegex,t,o,s,l);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn){const e=o.substring(c.startColumn-1,c.endColumn-1).toLowerCase(),t=this._matchFoundBracket(c,a.textIsBracket[e],a.textIsOpenBracket[e],null);if(t)return t instanceof cb?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 cb?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)=>{while(1){if(i&&++r%100===0&&!i())return cb.INSTANCE;const c=ql.findPrevBracketInRange(o,t,n,a,l);if(!c)break;const d=n.substring(c.startColumn-1,c.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return c;l=c.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const e=this._getLineTokens(l),i=e.getCount(),o=this._buffer.getLineContent(l);let s=i-1,r=o.length,c=o.length;l===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,c=t.column-1);let d=!0;for(;s>=0;s--){const t=e.getLanguageId(s)===n&&!yl(e.getStandardTokenType(s));if(t)d?r=e.getStartOffset(s):(r=e.getStartOffset(s),c=e.getEndOffset(s));else if(d&&r!==c){const e=a(l,o,r,c);if(e)return e}d=t}if(d&&r!==c){const e=a(l,o,r,c);if(e)return e}}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)=>{while(1){if(i&&++r%100===0&&!i())return cb.INSTANCE;const c=ql.findNextBracketInRange(o,t,n,a,l);if(!c)break;const d=n.substring(c.startColumn-1,c.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return c;a=c.endColumn-1}return null},l=this.getLineCount();for(let c=t.lineNumber;c<=l;c++){const e=this._getLineTokens(c),i=e.getCount(),o=this._buffer.getLineContent(c);let s=0,r=0,l=0;c===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,l=t.column-1);let d=!0;for(;s=1;o--){const e=this._getLineTokens(o),s=e.getCount(),r=this._buffer.getLineContent(o);let a=s-1,l=r.length,c=r.length;if(o===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,c=t.column-1;const o=e.getLanguageId(a);i!==o&&(i=o,n=ec.getBracketsSupport(i))}let d=!0;for(;a>=0;a--){const t=e.getLanguageId(a);if(i!==t){if(n&&d&&l!==c){const e=ql.findPrevBracketInRange(n.reversedRegex,o,r,l,c);if(e)return this._toFoundBracket(n,e);d=!1}i=t,n=ec.getBracketsSupport(i)}const s=!!n&&!yl(e.getStandardTokenType(a));if(s)d?l=e.getStartOffset(a):(l=e.getStartOffset(a),c=e.getEndOffset(a));else if(n&&d&&l!==c){const e=ql.findPrevBracketInRange(n.reversedRegex,o,r,l,c);if(e)return this._toFoundBracket(n,e)}d=s}if(n&&d&&l!==c){const e=ql.findPrevBracketInRange(n.reversedRegex,o,r,l,c);if(e)return this._toFoundBracket(n,e)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let n=-1,o=null;for(let s=t.lineNumber;s<=i;s++){const e=this._getLineTokens(s),i=e.getCount(),r=this._buffer.getLineContent(s);let a=0,l=0,c=0;if(s===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,c=t.column-1;const i=e.getLanguageId(a);n!==i&&(n=i,o=ec.getBracketsSupport(n))}let d=!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{while(1){if(i&&++l%100===0&&!i())return cb.INSTANCE;const a=ql.findNextBracketInRange(e.forwardRegex,t,n,o,s);if(!a)break;const c=n.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[c];if(d&&(d.isOpen(c)?r[d.index]++:d.isClose(c)&&r[d.index]--,-1===r[d.index]))return this._matchFoundBracket(a,d,!1,i);o=a.endColumn-1}return null};let d=-1,h=null;for(let u=n.lineNumber;u<=o;u++){const e=this._getLineTokens(u),t=e.getCount(),i=this._buffer.getLineContent(u);let o=0,s=0,r=0;if(u===n.lineNumber){o=e.findTokenIndexAtOffset(n.column-1),s=n.column-1,r=n.column-1;const t=e.getLanguageId(o);d!==t&&(d=t,h=ec.getBracketsSupport(d),a(d,h))}let l=!0;for(;on)throw new Error("Illegal value for lineNumber");const o=ec.getFoldingRules(this._languageIdentifier.id),s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,c=-1;const d=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,c=-1;for(let t=e;t=0){l=t,c=e;break}}}};let h=-2,u=-1,g=-2,f=-1;const m=e=>{if(-2===h){h=-1,u=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){h=t,u=e;break}}}if(-1!==g&&(-2===g||g=0){g=t,f=e;break}}}};let p=0,_=!0,b=0,v=!0,w=0,C=0;for(let y=0;_||v;y++){const o=e-y,r=e+y;y>1&&(o<1||o1&&(r>n||r>i)&&(v=!1),y>5e4&&(_=!1,v=!1);let g=-1;if(_){const e=this._computeIndentLevel(o-1);e>=0?(l=o-1,c=e,g=Math.ceil(e/this._options.indentSize)):(d(o),g=this._getIndentLevelForWhitespaceLine(s,a,c))}let S=-1;if(v){const e=this._computeIndentLevel(r-1);e>=0?(h=r-1,u=e,S=Math.ceil(e/this._options.indentSize)):(m(r),S=this._getIndentLevelForWhitespaceLine(s,u,f))}if(0!==y){if(1===y){if(r<=n&&S>=0&&C+1===S){_=!1,p=r,b=r,w=S;continue}if(o>=1&&g>=0&&g-1===C){v=!1,p=o,b=o,w=g;continue}if(p=e,b=e,w=C,0===w)return{startLineNumber:p,endLineNumber:b,indent:w}}_&&(g>=w?p=o:_=!1),v&&(S>=w?b=r:v=!1)}else C=g}return{startLineNumber:p,endLineNumber:b,indent:w}}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=ec.getFoldingRules(this._languageIdentifier.id),o=Boolean(n&&n.offSide);let s=new Array(t-e+1),r=-2,a=-1,l=-2,c=-1;for(let d=e;d<=t;d++){let t=d-e;const n=this._computeIndentLevel(d-1);if(n>=0)r=d-1,a=n,s[t]=Math.ceil(n/this._options.indentSize);else{if(-2===r){r=-1,a=-1;for(let e=d-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,c=t;break}}}s[t]=this._getIndentLevelForWhitespaceLine(o,a,c)}}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))}}const yb=()=>!0,Sb=()=>!1,xb=e=>" "===e||"\t"===e;class Lb{constructor(e,t,i){this._languageIdentifier=e;const n=i.options,o=n.get(124);this.readOnly=n.get(75),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=n.get(99),this.lineHeight=n.get(53),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=n.get(109),this.wordSeparators=n.get(110),this.emptySelectionClipboard=n.get(28),this.copyWithSyntaxHighlighting=n.get(18),this.multiCursorMergeOverlapping=n.get(63),this.multiCursorPaste=n.get(65),this.autoClosingBrackets=n.get(5),this.autoClosingQuotes=n.get(7),this.autoClosingOvertype=n.get(6),this.autoSurround=n.get(10),this.autoIndent=n.get(8),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:Lb._getShouldAutoClose(e,this.autoClosingQuotes),bracket:Lb._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=ec.getAutoClosingPairs(e.id);let s=Lb._getSurroundingPairs(e);if(s)for(const r of s)this.surroundingPairs[r.open]=r.close}static shouldRecreate(e){return e.hasChanged(124)||e.hasChanged(110)||e.hasChanged(28)||e.hasChanged(63)||e.hasChanged(65)||e.hasChanged(5)||e.hasChanged(7)||e.hasChanged(6)||e.hasChanged(10)||e.hasChanged(109)||e.hasChanged(53)||e.hasChanged(75)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=Lb._getElectricCharacters(this._languageIdentifier);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return hb.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return ec.getElectricCharacters(e.id)}catch(t){return ve(t),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return xb;case"languageDefined":return Lb._getLanguageDefinedShouldAutoClose(e);case"always":return yb;case"never":return Sb}}static _getLanguageDefinedShouldAutoClose(e){try{const t=ec.getAutoCloseBeforeSet(e.id);return e=>-1!==t.indexOf(e)}catch(t){return ve(t),Sb}}static _getSurroundingPairs(e){try{return ec.getSurroundingPairs(e.id)}catch(t){return ve(t),null}}}class kb{constructor(e,t,i,n){this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=n,this.selection=kb._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 kb(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new ai(t,i),n):new kb(new li(t,i,t,i),n,new ai(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 ci(i,n,o,s)}}class Eb{constructor(e,t,i){this.model=e,this.coordinatesConverter=t,this.cursorConfig=i}}class Db{constructor(e){this.modelState=e,this.viewState=null}}class Nb{constructor(e){this.modelState=null,this.viewState=e}}class Ib{constructor(e,t){this.modelState=e,this.viewState=t}static fromModelState(e){return new Db(e)}static fromViewState(e){return new Nb(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,n=e.positionLineNumber,o=e.positionColumn,s=new kb(new li(t,i,t,i),0,new ai(n,o),0);return Ib.fromModelState(s)}static fromModelSelections(e){let t=[];for(let i=0,n=e.length;i=65536?2:1,9===t)s=Mb.nextRenderTabStop(s,i);else{let i=rs["w"](t);while(r=65536?2:1,i=n}rs["C"](t)||rs["A"](t)?s+=2:s+=1}}return s}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 o=0,s=1,r=0;while(r=65536?2:1,9===a)l=Mb.nextRenderTabStop(o,i);else{let t=rs["w"](a);while(r=65536?2:1,t=o}l=rs["C"](a)||rs["A"](a)?o+2:o+1}const c=r+1;if(l>=t){const e=t-o,i=l-t;return ir?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 e-1-(e-1)%t}static prevIndentTabStop(e,t){return e-1-(e-1)%t}}function Ob(e){return"'"===e||'"'===e||"`"===e}class Ab{static whitespaceVisibleColumn(e,t,i){const n=e.length;let o=0,s=-1,r=-1;for(let a=0;a=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 Wb{constructor(e,t,i){this.model=e.model;const n=e.configuration.options;this.layoutInfo=n.get(124),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(53),this.stickyTabStops=n.get(99),this.typicalHalfwidthCharacterWidth=n.get(38).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Wb.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 ai(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new ai(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,Ub._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class Vb extends Bb{constructor(e,t,i,n){super(e,t,i),this._ctx=e,n?(this.target=n,this.targetPath=km.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 Fb.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(!Fb.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfill(7,new ai(1,1),void 0,Hb);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return t.fulfill(7,new ai(i,n),void 0,Hb)}if(i){if(Fb.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.model.getLineLength(i)){const n=e.getLineWidth(i),o=zb(t.mouseContentHorizontalOffset-n);return t.fulfill(7,new ai(i,1),void 0,o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=zb(t.mouseContentHorizontalOffset-n),s=new ai(i,e.model.getLineMaxColumn(i));return t.fulfill(7,s,void 0,o)}}return t.fulfill(0)}const n=Ub._doHitTest(e,t);return n.position?Ub.createMouseTargetFromHitTestPosition(e,t,n.position.lineNumber,n.position.column):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(Fb.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new ai(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Fb.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 ai(i,n))}}return null}static _hitTestScrollbar(e,t){if(Fb.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new ai(i,n))}return null}getMouseColumn(e,t){const i=this._context.configuration.options,n=i.get(124),o=this._context.viewLayout.getCurrentScrollLeft()+t.x-e.x-n.contentLeft;return Ub._getMouseColumn(o,i.get(38).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;const i=Math.round(e/t);return i+1}static createMouseTargetFromHitTestPosition(e,t,i,n){const o=new ai(i,n),s=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>s){if(ln&&1===o.column){const n=zb(t.mouseContentHorizontalOffset-s);return t.fulfill(7,new ai(i,e.model.getLineMaxColumn(i)),void 0,n)}const n=zb(t.mouseContentHorizontalOffset-s);return t.fulfill(7,o,void 0,n)}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})}const c=e.model.getLineMaxColumn(i);if(ne.offset-t.offset);for(let d=1;d=t.editorPos.y+e.layoutInfo.height&&(s=t.editorPos.y+e.layoutInfo.height-1);const r=new pm(t.pos.x,s),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates());return a.position?a:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=No(e.viewDomNode);let n;if(n=i?"undefined"===typeof i.caretRangeFromPoint?Kb(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):document.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return{position:null,hitTarget:null};const o=n.startContainer;let s=null;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,r=i?i.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(a===Vm.CLASS_NAME){const i=e.getPositionFromDOMInfo(t,n.startOffset);return{position:i,hitTarget:null}}s=o.parentNode}else if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null,n=i&&i.nodeType===i.ELEMENT_NODE?i.className:null;if(n===Vm.CLASS_NAME){const t=e.getPositionFromDOMInfo(o,o.textContent.length);return{position:t,hitTarget:null}}s=o}return{position:null,hitTarget:s}}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(s===Vm.CLASS_NAME){const t=e.getPositionFromDOMInfo(i.offsetNode.parentNode,i.offset);return{position:t,hitTarget:null}}return{position:null,hitTarget:i.offsetNode.parentNode}}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===Vm.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t){const i=e.getPositionFromDOMInfo(t,0);return{position:i,hitTarget:null}}}else if(s===Vm.CLASS_NAME){const t=e.getPositionFromDOMInfo(i.offsetNode,0);return{position:t,hitTarget:null}}}return{position:null,hitTarget:i.offsetNode}}static _doHitTestWithMoveToPoint(e,t){let i=null,n=null;const o=document.body.createTextRange();try{o.moveToPoint(t.clientX,t.clientY)}catch(c){return{position:null,hitTarget:null}}o.collapse(!0);const s=o?o.parentElement():null,r=s?s.parentNode:null,a=r?r.parentNode:null,l=a&&a.nodeType===a.ELEMENT_NODE?a.className:"";if(l===Vm.CLASS_NAME){const t=o.duplicate();t.moveToElementText(s),t.setEndPoint("EndToStart",o),i=e.getPositionFromDOMInfo(s,t.text.length),t.moveToElementText(e.viewDomNode)}else n=s;return o.moveToElementText(e.viewDomNode),{position:i,hitTarget:n}}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.getTextModelOptions(),o=Ab.atomicPosition(i,e.column-1,n,2);return-1!==o?new ai(e.lineNumber,o+1):e}static _doHitTest(e,t){let i;return i="function"===typeof document.caretRangeFromPoint?this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint?this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates()):document.body.createTextRange?this._doHitTestWithMoveToPoint(e,t.pos.toClientCoordinates()):{position:null,hitTarget:null},i.position&&e.stickyTabStops&&(i.position=this._snapToSoftTabBoundary(i.position,e.model)),i}}function Kb(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){while(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=jb.getInstance();for(let n=0;nthis._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1;const n=new Cm(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),qb(this.mouseTargetFactory),$b.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)));const o=e=>{if(this.viewController.emitMouseWheel(e),!this._context.configuration.options.get(62))return;const t=new Mn(e),i=s["f"]?e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;if(i){const e=lr.getZoomLevel(),i=t.deltaY>0?1:-1;lr.setZoomLevel(e+i),t.preventDefault(),t.stopPropagation()}};this._register(Zn(this.viewHelper.viewDomNode,Wo.MOUSE_WHEEL,o,{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}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 _m(e,t),n=i.toPageCoordinates(),o=vm(this.viewHelper.viewDomNode);return n.yo.y+o.height||n.xo.x+o.width?null:this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,n,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){if(this._mouseDownOperation.isActive())return;const t=e.timestamp;t{e.preventDefault(),this.viewHelper.focusTextArea()};if(c&&(i||o&&r))d(),this._mouseDownOperation.start(t.type,e);else if(n)e.preventDefault();else if(a){const i=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(i.viewZoneId)&&(d(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}$b.MOUSE_MOVE_MINIMUM_TIME=100;class Gb extends We{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 Sm(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new Wn),this._mouseState=new Yb,this._currentSelection=new ci(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(75)&&n.get(27)&&!n.get(15)&&!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,qb(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,qb(null),e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}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=Wb.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return new Pb(null,13,o,e)}const a=n.getLineNumberAtVerticalOffset(s);return new Pb(null,13,o,new ai(a,i.getLineMaxColumn(a)))}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+(e.posy-t.y));return e.posxt.x+t.width?new Pb(null,13,o,new ai(s,i.getLineMaxColumn(s))):null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t),o=n.position;if(!o)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return new Pb(n.element,n.type,n.mouseColumn,e,null,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new ai(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 Yb{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>Yb.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)}}function Xb(e,t){const i={translationY:t.translationY,translationX:t.translationX};return e&&(i.translationY+=e.translationY,i.translationX+=e.translationX),i}Yb.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class Zb extends $b{constructor(e,t,i){super(e,t,i),this.viewHelper.linesContentDomNode.style.touchAction="none",this._installGestureHandlerTimeout=window.setTimeout(()=>{if(this._installGestureHandlerTimeout=-1,window.MSGesture){const e=new MSGesture,t=new MSGesture;e.target=this.viewHelper.linesContentDomNode,t.target=this.viewHelper.linesContentDomNode,this.viewHelper.linesContentDomNode.addEventListener("pointerdown",i=>{const n=i.pointerType;"mouse"!==n?"touch"===n?(this._lastPointerType="touch",e.addPointer(i.pointerId)):(this._lastPointerType="pen",t.addPointer(i.pointerId)):this._lastPointerType="mouse"}),this._register(uo(this.viewHelper.linesContentDomNode,"MSGestureChange",e=>this._onGestureChange(e),Xb)),this._register(Zn(this.viewHelper.linesContentDomNode,"MSGestureTap",e=>this._onCaptureGestureTap(e),!0))}},100),this._lastPointerType="mouse"}_onMouseDown(e){"mouse"===this._lastPointerType&&super._onMouseDown(e)}_onCaptureGestureTap(e){const t=new wm(e,this.viewHelper.viewDomNode),i=this._createMouseTarget(t,!1);i.position&&this.viewController.moveTo(i.position),t.browserEvent.fromElement?(t.preventDefault(),this.viewHelper.focusTextArea()):setTimeout(()=>{this.viewHelper.focusTextArea()})}_onGestureChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}dispose(){window.clearTimeout(this._installGestureHandlerTimeout),super.dispose()}}class Qb extends $b{constructor(e,t,i){super(e,t,i),this._register(gm.addTarget(this.viewHelper.linesContentDomNode)),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Tap,e=>this.onTap(e))),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Change,e=>this.onChange(e))),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Contextmenu,e=>this._onContextMenu(new wm(e,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(Zn(this.viewHelper.linesContentDomNode,"pointerdown",e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"}));const n=new ym(this.viewHelper.viewDomNode);this._register(n.onPointerMoveThrottled(this.viewHelper.viewDomNode,e=>this._onMouseMove(e),qb(this.mouseTargetFactory),$b.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 wm(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 Jb extends $b{constructor(e,t,i){super(e,t,i),this._register(gm.addTarget(this.viewHelper.linesContentDomNode)),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Tap,e=>this.onTap(e))),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Change,e=>this.onChange(e))),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Contextmenu,e=>this._onContextMenu(new wm(e,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new wm(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.moveTo(t.position)}onChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}}class ev extends We{constructor(e,t,i){super(),s["c"]&&$n.pointerEvents?this.handler=this._register(new Qb(e,t,i)):window.TouchEvent?this.handler=this._register(new Jb(e,t,i)):window.navigator.pointerEnabled||window.PointerEvent?this.handler=this._register(new Zb(e,t,i)):this.handler=this._register(new $b(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}i("1a37");const tv=!1;class iv{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 iv(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new iv(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,i){tv&&console.log("writeToTextArea "+e+": "+this.toString()),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;while(-1!==(o=t.indexOf("\n",o+1)))n++;return[e,i*t.length,n]}static selectedText(e){return new iv(e,0,e.length,null,null)}static deduceInput(e,t,i){if(!e)return{text:"",replaceCharCnt:0};tv&&(console.log("------------------------deduceInput"),console.log("PREVIOUS STATE: "+e.toString()),console.log("CURRENT STATE: "+t.toString()));let n=e.value,o=e.selectionStart,s=e.selectionEnd,r=t.value,a=t.selectionStart,l=t.selectionEnd;const c=n.substring(s),d=r.substring(l),h=rs["e"](c,d);r=r.substring(0,r.length-h),n=n.substring(0,n.length-h);const u=n.substring(0,o),g=r.substring(0,a),f=rs["d"](u,g);if(r=r.substring(f),n=n.substring(f),a-=f,o-=f,l-=f,s-=f,tv&&(console.log("AFTER DIFFING PREVIOUS STATE: <"+n+">, selectionStart: "+o+", selectionEnd: "+s),console.log("AFTER DIFFING CURRENT STATE: <"+r+">, selectionStart: "+a+", selectionEnd: "+l)),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)||rs["k"](e)))return{text:e,replaceCharCnt:0}}if(a===l){if(n===r&&0===o&&s===n.length&&a===r.length&&-1===r.indexOf("\n")&&rs["l"](r))return{text:"",replaceCharCnt:0};const e=u.length-f;return tv&&console.log("REMOVE PREVIOUS: "+(u.length-f)+" chars"),{text:r,replaceCharCnt:e}}const m=s-o;return{text:r,replaceCharCnt:m}}}iv.EMPTY=new iv("",0,0,null,null);class nv{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 li(n,1,o+1,1)}static fromEditorSelection(e,t,i,n,o){const s=nv._getPageOfLine(i.startLineNumber,n),r=nv._getRangeForPage(s,n),a=nv._getPageOfLine(i.endLineNumber,n),l=nv._getRangeForPage(a,n),c=r.intersectRanges(new li(1,1,i.startLineNumber,i.startColumn));let d=t.getValueInRange(c,1);const h=t.getLineCount(),u=t.getLineMaxColumn(h),g=l.intersectRanges(new li(i.endLineNumber,i.endColumn,h,u));let f,m=t.getValueInRange(g,1);if(s===a||s+1===a)f=t.getValueInRange(i,1);else{const e=r.intersectRanges(i),n=l.intersectRanges(i);f=t.getValueInRange(e,1)+String.fromCharCode(8230)+t.getValueInRange(n,1)}if(o){const e=500;d.length>e&&(d=d.substring(d.length-e,d.length)),m.length>e&&(m=m.substring(0,e)),f.length>2*e&&(f=f.substring(0,e)+String.fromCharCode(8230)+f.substring(f.length-e,f.length))}return new iv(d+f+m,d.length,d.length+f.length,new ai(i.startLineNumber,i.startColumn),new ai(i.endLineNumber,i.endColumn))}}const ov={forceCopyWithSyntaxHighlighting:!1};class sv{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)}}sv.INSTANCE=new sv;class rv extends We{constructor(e,t){super(),this.textArea=t,this._onFocus=this._register(new Ye),this.onFocus=this._onFocus.event,this._onBlur=this._register(new Ye),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new Ye),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new Ye),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new Ye),this.onCut=this._onCut.event,this._onPaste=this._register(new Ye),this.onPaste=this._onPaste.event,this._onType=this._register(new Ye),this.onType=this._onType.event,this._onCompositionStart=this._register(new Ye),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new Ye),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new Ye),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new Ye),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._host=e,this._textArea=this._register(new lv(t)),this._asyncTriggerCut=this._register(new Vn(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Vn(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=iv.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._isDoingComposition=!1,this._nextCommand=0;let i=null;this._register(eo(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(eo(t.domNode,"keyup",e=>{this._onKeyUp.fire(e)})),this._register(Zn(t.domNode,"compositionstart",e=>{if(tv&&console.log("[compositionstart]",e),this._isDoingComposition)return;this._isDoingComposition=!0;let t=!1;s["f"]&&i&&i.equals(109)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"!==i.code&&"ArrowLeft"!==i.code||(tv&&console.log("[compositionstart] Handling long press case on macOS + arrow key",e),t=!0)),t?this._textAreaState=new iv(this._textAreaState.value,this._textAreaState.selectionStart-1,this._textAreaState.selectionEnd,this._textAreaState.selectionStartPosition?new ai(this._textAreaState.selectionStartPosition.lineNumber,this._textAreaState.selectionStartPosition.column-1):null,this._textAreaState.selectionEndPosition):this._setAndWriteTextAreaState("compositionstart",iv.EMPTY),this._onCompositionStart.fire({moveOneCharacterLeft:t})}));const n=e=>{const t=this._textAreaState,i=iv.readFromTextArea(this._textArea);return[i,iv.deduceInput(t,i,e)]},o=e=>{const t=this._textAreaState,i=iv.selectedText(e),n={text:i.value,replaceCharCnt:t.selectionEnd-t.selectionStart};return[i,n]};this._register(Zn(t.domNode,"compositionupdate",e=>{tv&&console.log("[compositionupdate]",e);const[t,i]=o(e.data||"");this._textAreaState=t,this._onType.fire(i),this._onCompositionUpdate.fire(e)})),this._register(Zn(t.domNode,"compositionend",e=>{if(tv&&console.log("[compositionend]",e),!this._isDoingComposition)return;const[t,i]=o(e.data||"");this._textAreaState=t,this._onType.fire(i),(hn||cn)&&(this._textAreaState=iv.readFromTextArea(this._textArea)),this._isDoingComposition&&(this._isDoingComposition=!1,this._onCompositionEnd.fire())})),this._register(Zn(t.domNode,"input",()=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._isDoingComposition)return;const[e,t]=n(s["f"]);0===t.replaceCharCnt&&1===t.text.length&&rs["D"](t.text.charCodeAt(0))||(this._textAreaState=e,0===this._nextCommand?""!==t.text&&this._onType.fire(t):(""===t.text&&0===t.replaceCharCnt||this._firePaste(t.text,null),this._nextCommand=0))})),this._register(Zn(t.domNode,"cut",e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()})),this._register(Zn(t.domNode,"copy",e=>{this._ensureClipboardGetsEditorSelection(e)})),this._register(Zn(t.domNode,"paste",e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),av.canUseTextData(e)){const[t,i]=av.getTextData(e);""!==t&&this._firePaste(t,i)}else this._textArea.getSelectionStart()!==this._textArea.getSelectionEnd()&&this._setAndWriteTextAreaState("paste",iv.EMPTY),this._nextCommand=1})),this._register(Zn(t.domNode,"focus",()=>{const e=this._hasFocus;this._setHasFocus(!0),un&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(Zn(t.domNode,"blur",()=>{this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))}_installSelectionChangeListener(){let e=0;return Zn(document,"selectionchange",t=>{if(!this._hasFocus)return;if(this._isDoingComposition)return;if(!hn)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),c=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),h=this._host.deduceModelPosition(d[0],d[1],d[2]),u=new ci(c.lineNumber,c.column,h.lineNumber,h.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=No(this.textArea.domNode);e?this._setHasFocus(e.activeElement===this.textArea.domNode):Yn(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(av.canUseTextData(e)&&$n.clipboard.richText),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};sv.INSTANCE.set(cn?t.text.replace(/\r\n/g,"\n"):t.text,i),av.canUseTextData(e)?av.setTextData(e,t.text,t.html,i):this._setAndWriteTextAreaState("copy or cut",iv.selectedText(t.text))}_firePaste(e,t){t||(t=sv.INSTANCE.get(e)),this._onPaste.fire({text:e,metadata:t})}}class av{static canUseTextData(e){return!!e.clipboardData||!!window.clipboardData}static getTextData(e){if(e.clipboardData){e.preventDefault();const i=e.clipboardData.getData("text/plain");let n=null;const o=e.clipboardData.getData("vscode-editor-data");if("string"===typeof o)try{n=JSON.parse(o),1!==n.version&&(n=null)}catch(t){}return[i,n]}if(window.clipboardData){e.preventDefault();const t=window.clipboardData.getData("Text");return[t,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 lv extends We{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 this._actual.domNode.selectionStart}getSelectionEnd(){return this._actual.domNode.selectionEnd}setSelectionRange(e,t,i){const n=this._actual.domNode;let o=null;const s=No(n);o=s?s.activeElement:document.activeElement;const r=o===n,a=n.selectionStart,l=n.selectionEnd;if(r&&a===t&&l===i)cn&&window.parent!==window&&n.focus();else{if(r)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(cn&&window.parent!==window&&n.focus());try{const e=Vo(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),Ho(n,e)}catch(c){}}}}i("1f2d");class cv extends xm{}const dv={ColorContribution:"base.contributions.colors"};class hv{constructor(){this._onDidChangeSchema=new Ye,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){const e=i.defaults[t.type];return iC(e,t)}}getColorSchema(){return this.colorSchema}toString(){let e=(e,t)=>{let i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)};return Object.keys(this.colorsById).sort(e).map(e=>`- \`${e}\`: ${this.colorsById[e].description}`).join("\n")}}const uv=new hv;function gv(e,t,i,n,o){return uv.registerColor(e,t,i,n,o)}Ah.add(dv.ColorContribution,uv);const fv=gv("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},o("foreground","Overall foreground color. This color is only used if not overridden by a component.")),mv=(gv("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},o("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),gv("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},o("iconForeground","The default color for icons in the workbench.")),gv("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},o("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component."))),pv=gv("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},o("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),_v=gv("contrastActiveBorder",{light:null,dark:null,hc:mv},o("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),bv=(gv("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},o("textLinkForeground","Foreground color for links in text.")),gv("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:eb.black},o("textCodeBlockBackground","Background color for code blocks in text.")),gv("widget.shadow",{dark:eC(eb.black,.36),light:eC(eb.black,.16),hc:null},o("widgetShadow","Shadow color of widgets such as find/replace inside the editor."))),vv=gv("input.background",{dark:"#3C3C3C",light:eb.white,hc:eb.black},o("inputBoxBackground","Input box background.")),wv=gv("input.foreground",{dark:fv,light:fv,hc:fv},o("inputBoxForeground","Input box foreground.")),Cv=gv("input.border",{dark:null,light:null,hc:pv},o("inputBoxBorder","Input box border.")),yv=(gv("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:pv},o("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),gv("inputOption.activeBackground",{dark:eC(mv,.4),light:eC(mv,.2),hc:eb.transparent},o("inputOption.activeBackground","Background color of activated options in input fields.")),gv("inputOption.activeForeground",{dark:eb.white,light:eb.black,hc:null},o("inputOption.activeForeground","Foreground color of activated options in input fields.")),gv("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:eb.black},o("inputValidationInfoBackground","Input validation background color for information severity."))),Sv=gv("inputValidation.infoForeground",{dark:null,light:null,hc:null},o("inputValidationInfoForeground","Input validation foreground color for information severity.")),xv=gv("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:pv},o("inputValidationInfoBorder","Input validation border color for information severity.")),Lv=gv("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:eb.black},o("inputValidationWarningBackground","Input validation background color for warning severity.")),kv=gv("inputValidation.warningForeground",{dark:null,light:null,hc:null},o("inputValidationWarningForeground","Input validation foreground color for warning severity.")),Ev=gv("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:pv},o("inputValidationWarningBorder","Input validation border color for warning severity.")),Dv=gv("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:eb.black},o("inputValidationErrorBackground","Input validation background color for error severity.")),Nv=gv("inputValidation.errorForeground",{dark:null,light:null,hc:null},o("inputValidationErrorForeground","Input validation foreground color for error severity.")),Iv=gv("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:pv},o("inputValidationErrorBorder","Input validation border color for error severity.")),Tv=gv("dropdown.background",{dark:"#3C3C3C",light:eb.white,hc:eb.black},o("dropdownBackground","Dropdown background.")),Mv=gv("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:eb.white},o("dropdownForeground","Dropdown foreground.")),Ov=gv("button.foreground",{dark:eb.white,light:eb.white,hc:eb.white},o("buttonForeground","Button foreground color.")),Av=gv("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},o("buttonBackground","Button background color.")),Rv=gv("button.hoverBackground",{dark:Jw(Av,.2),light:Qw(Av,.2),hc:null},o("buttonHoverBackground","Button background color when hovering.")),Pv=gv("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:eb.black},o("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Fv=gv("badge.foreground",{dark:eb.white,light:"#333",hc:eb.white},o("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Wv=gv("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},o("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),Bv=gv("scrollbarSlider.background",{dark:eb.fromHex("#797979").transparent(.4),light:eb.fromHex("#646464").transparent(.4),hc:eC(pv,.6)},o("scrollbarSliderBackground","Scrollbar slider background color.")),Vv=gv("scrollbarSlider.hoverBackground",{dark:eb.fromHex("#646464").transparent(.7),light:eb.fromHex("#646464").transparent(.7),hc:eC(pv,.8)},o("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),Hv=gv("scrollbarSlider.activeBackground",{dark:eb.fromHex("#BFBFBF").transparent(.4),light:eb.fromHex("#000000").transparent(.6),hc:pv},o("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),zv=gv("progressBar.background",{dark:eb.fromHex("#0E70C0"),light:eb.fromHex("#0E70C0"),hc:pv},o("progressBarBackground","Background color of the progress bar that can show for long running operations.")),Uv=gv("editorError.background",{dark:null,light:null,hc:null},o("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Kv=gv("editorError.foreground",{dark:"#F48771",light:"#E51400",hc:null},o("editorError.foreground","Foreground color of error squigglies in the editor.")),jv=gv("editorError.border",{dark:null,light:null,hc:eb.fromHex("#E47777").transparent(.8)},o("errorBorder","Border color of error boxes in the editor.")),qv=gv("editorWarning.background",{dark:null,light:null,hc:null},o("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),$v=gv("editorWarning.foreground",{dark:"#CCA700",light:"#E9A700",hc:null},o("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Gv=gv("editorWarning.border",{dark:null,light:null,hc:eb.fromHex("#FFCC00").transparent(.8)},o("warningBorder","Border color of warning boxes in the editor.")),Yv=gv("editorInfo.background",{dark:null,light:null,hc:null},o("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Xv=gv("editorInfo.foreground",{dark:"#75BEFF",light:"#75BEFF",hc:null},o("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Zv=gv("editorInfo.border",{dark:null,light:null,hc:eb.fromHex("#75BEFF").transparent(.8)},o("infoBorder","Border color of info boxes in the editor.")),Qv=gv("editorHint.foreground",{dark:eb.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},o("editorHint.foreground","Foreground color of hint squigglies in the editor.")),Jv=gv("editorHint.border",{dark:null,light:null,hc:eb.fromHex("#eeeeee").transparent(.8)},o("hintBorder","Border color of hint boxes in the editor.")),ew=gv("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:eb.black},o("editorBackground","Editor background color.")),tw=gv("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:eb.white},o("editorForeground","Editor default foreground color.")),iw=gv("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},o("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),nw=gv("editorWidget.foreground",{dark:fv,light:fv,hc:fv},o("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),ow=gv("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:pv},o("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.")),sw=(gv("editorWidget.resizeBorder",{light:null,dark:null,hc:null},o("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.")),gv("quickInput.background",{dark:iw,light:iw,hc:iw},o("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette."))),rw=gv("quickInput.foreground",{dark:nw,light:nw,hc:nw},o("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),aw=gv("quickInputTitle.background",{dark:new eb(new Z_(255,255,255,.105)),light:new eb(new Z_(0,0,0,.06)),hc:"#000000"},o("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),lw=gv("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:eb.white},o("pickerGroupForeground","Quick picker color for grouping labels.")),cw=gv("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:eb.white},o("pickerGroupBorder","Quick picker color for grouping borders.")),dw=gv("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},o("editorSelectionBackground","Color of the editor selection.")),hw=gv("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},o("editorSelectionForeground","Color of the selected text for high contrast.")),uw=gv("editor.inactiveSelectionBackground",{light:eC(dw,.5),dark:eC(dw,.5),hc:eC(dw,.5)},o("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),gw=gv("editor.selectionHighlightBackground",{light:tC(dw,ew,.3,.6),dark:tC(dw,ew,.3,.6),hc:null},o("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),fw=(gv("editor.selectionHighlightBorder",{light:null,dark:null,hc:_v},o("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),gv("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},o("editorFindMatch","Color of the current search match.")),gv("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},o("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0)),mw=(gv("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},o("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),gv("editor.findMatchBorder",{light:null,dark:null,hc:_v},o("editorFindMatchBorder","Border color of the current search match.")),gv("editor.findMatchHighlightBorder",{light:null,dark:null,hc:_v},o("findMatchHighlightBorder","Border color of the other search matches.")),gv("editor.findRangeHighlightBorder",{dark:null,light:null,hc:eC(_v,.4)},o("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),gv("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},o("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),gv("editorHoverWidget.background",{light:iw,dark:iw,hc:iw},o("hoverBackground","Background color of the editor hover."))),pw=(gv("editorHoverWidget.foreground",{light:nw,dark:nw,hc:nw},o("hoverForeground","Foreground color of the editor hover.")),gv("editorHoverWidget.border",{light:ow,dark:ow,hc:ow},o("hoverBorder","Border color of the editor hover.")),gv("editorHoverWidget.statusBarBackground",{dark:Jw(mw,.2),light:Qw(mw,.05),hc:iw},o("statusBarBackground","Background color of the editor hover status bar.")),gv("editorLink.activeForeground",{dark:"#4E94CE",light:eb.blue,hc:eb.cyan},o("activeLinkForeground","Color of active links.")),gv("editorInlineHint.foreground",{dark:iw,light:nw,hc:iw},o("editorInlineHintForeground","Foreground color of inline hints")),gv("editorInlineHint.background",{dark:nw,light:iw,hc:nw},o("editorInlineHintBackground","Background color of inline hints")),gv("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},o("editorLightBulbForeground","The color used for the lightbulb actions icon.")),gv("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},o("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),new eb(new Z_(155,185,85,.2))),_w=new eb(new Z_(255,0,0,.2)),bw=gv("diffEditor.insertedTextBackground",{dark:pw,light:pw,hc:null},o("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),vw=gv("diffEditor.removedTextBackground",{dark:_w,light:_w,hc:null},o("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),ww=gv("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},o("diffEditorInsertedOutline","Outline color for the text that got inserted.")),Cw=gv("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},o("diffEditorRemovedOutline","Outline color for text that got removed.")),yw=gv("diffEditor.border",{dark:null,light:null,hc:pv},o("diffEditorBorder","Border color between the two text editors.")),Sw=gv("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},o("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),xw=gv("list.focusBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},o("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.")),Lw=gv("list.focusForeground",{dark:null,light:null,hc:null},o("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.")),kw=gv("list.activeSelectionBackground",{dark:"#094771",light:"#0060C0",hc:null},o("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.")),Ew=gv("list.activeSelectionForeground",{dark:eb.white,light:eb.white,hc:null},o("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.")),Dw=gv("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},o("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.")),Nw=gv("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},o("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.")),Iw=gv("list.inactiveFocusBackground",{dark:null,light:null,hc:null},o("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.")),Tw=gv("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},o("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Mw=gv("list.hoverForeground",{dark:null,light:null,hc:null},o("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Ow=gv("list.dropBackground",{dark:xw,light:xw,hc:null},o("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),Aw=(gv("list.highlightForeground",{dark:"#0097fb",light:"#0066BF",hc:mv},o("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),gv("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:eb.black},o("listFilterWidgetBackground","Background color of the type filter widget in lists and trees."))),Rw=gv("listFilterWidget.outline",{dark:eb.transparent,light:eb.transparent,hc:"#f38518"},o("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Pw=gv("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:pv},o("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Fw=gv("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},o("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Ww=gv("menu.border",{dark:null,light:null,hc:pv},o("menuBorder","Border color of menus.")),Bw=gv("menu.foreground",{dark:Mv,light:fv,hc:Mv},o("menuForeground","Foreground color of menu items.")),Vw=gv("menu.background",{dark:Tv,light:Tv,hc:Tv},o("menuBackground","Background color of menu items.")),Hw=gv("menu.selectionForeground",{dark:Ew,light:Ew,hc:Ew},o("menuSelectionForeground","Foreground color of the selected menu item in menus.")),zw=gv("menu.selectionBackground",{dark:kw,light:kw,hc:kw},o("menuSelectionBackground","Background color of the selected menu item in menus.")),Uw=gv("menu.selectionBorder",{dark:null,light:null,hc:_v},o("menuSelectionBorder","Border color of the selected menu item in menus.")),Kw=gv("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:pv},o("menuSeparatorBackground","Color of a separator menu item in menus.")),jw=(gv("editor.snippetTabstopHighlightBackground",{dark:new eb(new Z_(124,124,124,.3)),light:new eb(new Z_(10,50,100,.2)),hc:new eb(new Z_(124,124,124,.3))},o("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),gv("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},o("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),gv("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},o("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),gv("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new eb(new Z_(10,50,100,.5)),hc:"#525252"},o("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),gv("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},o("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),gv("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},o("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),gv("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},o("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),gv("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},o("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0)),qw=gv("minimap.errorHighlight",{dark:new eb(new Z_(255,18,18,.7)),light:new eb(new Z_(255,18,18,.7)),hc:new eb(new Z_(255,50,50,1))},o("minimapError","Minimap marker color for errors.")),$w=gv("minimap.warningHighlight",{dark:$v,light:$v,hc:Gv},o("overviewRuleWarning","Minimap marker color for warnings.")),Gw=gv("minimap.background",{dark:null,light:null,hc:null},o("minimapBackground","Minimap background color.")),Yw=gv("minimapSlider.background",{light:eC(Bv,.5),dark:eC(Bv,.5),hc:eC(Bv,.5)},o("minimapSliderBackground","Minimap slider background color.")),Xw=gv("minimapSlider.hoverBackground",{light:eC(Vv,.5),dark:eC(Vv,.5),hc:eC(Vv,.5)},o("minimapSliderHoverBackground","Minimap slider background color when hovering.")),Zw=gv("minimapSlider.activeBackground",{light:eC(Hv,.5),dark:eC(Hv,.5),hc:eC(Hv,.5)},o("minimapSliderActiveBackground","Minimap slider background color when clicked on."));gv("problemsErrorIcon.foreground",{dark:Kv,light:Kv,hc:Kv},o("problemsErrorIconForeground","The color used for the problems error icon.")),gv("problemsWarningIcon.foreground",{dark:$v,light:$v,hc:$v},o("problemsWarningIconForeground","The color used for the problems warning icon.")),gv("problemsInfoIcon.foreground",{dark:Xv,light:Xv,hc:Xv},o("problemsInfoIconForeground","The color used for the problems info icon."));function Qw(e,t){return i=>{let n=iC(e,i);if(n)return n.darken(t)}}function Jw(e,t){return i=>{let n=iC(e,i);if(n)return n.lighten(t)}}function eC(e,t){return i=>{let n=iC(e,i);if(n)return n.transparent(t)}}function tC(e,t,i,n){return o=>{let s=iC(e,o);if(s){let e=iC(t,o);return e?s.isDarkerThan(e)?eb.getLighterColor(s,e,i).transparent(n):eb.getDarkerColor(s,e,i).transparent(n):s.transparent(i*n)}}}function iC(e,t){if(null!==e)return"string"===typeof e?"#"===e[0]?eb.fromHex(e):t.getColor(e):e instanceof eb?e:"function"===typeof e?e(t):void 0}const nC="vscode://schemas/workbench-colors";let oC=Ah.as(Rh.JSONContribution);oC.registerSchema(nC,uv.getColorSchema());const sC=new Vn(()=>oC.notifySchemaChanged(nC),200);uv.onDidChangeSchema(()=>{sC.isScheduled()||sC.schedule()});const rC=gv("editor.lineHighlightBackground",{dark:null,light:null,hc:null},o("lineHighlight","Background color for the highlight of line at the cursor position.")),aC=gv("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},o("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),lC=gv("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},o("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),cC=gv("editor.rangeHighlightBorder",{dark:null,light:null,hc:_v},o("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),dC=gv("editor.symbolHighlightBackground",{dark:fw,light:fw,hc:null},o("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),hC=gv("editor.symbolHighlightBorder",{dark:null,light:null,hc:_v},o("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),uC=gv("editorCursor.foreground",{dark:"#AEAFAD",light:eb.black,hc:eb.white},o("caret","Color of the editor cursor.")),gC=gv("editorCursor.background",null,o("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),fC=gv("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},o("editorWhitespaces","Color of whitespace characters in the editor.")),mC=gv("editorIndentGuide.background",{dark:fC,light:fC,hc:fC},o("editorIndentGuides","Color of the editor indentation guides.")),pC=gv("editorIndentGuide.activeBackground",{dark:fC,light:fC,hc:fC},o("editorActiveIndentGuide","Color of the active editor indentation guides.")),_C=gv("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:eb.white},o("editorLineNumbers","Color of editor line numbers.")),bC=gv("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:_v},o("editorActiveLineNumber","Color of editor active line number"),!1,o("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),vC=gv("editorLineNumber.activeForeground",{dark:bC,light:bC,hc:bC},o("editorActiveLineNumber","Color of editor active line number")),wC=gv("editorRuler.foreground",{dark:"#5A5A5A",light:eb.lightgrey,hc:eb.white},o("editorRuler","Color of the editor rulers.")),CC=(gv("editorCodeLens.foreground",{dark:"#999999",light:"#999999",hc:"#999999"},o("editorCodeLensForeground","Foreground color of editor CodeLens")),gv("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},o("editorBracketMatchBackground","Background color behind matching brackets")),gv("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:pv},o("editorBracketMatchBorder","Color for matching brackets boxes")),gv("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},o("editorOverviewRulerBorder","Color of the overview ruler border."))),yC=gv("editorOverviewRuler.background",null,o("editorOverviewRulerBackground","Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.")),SC=gv("editorGutter.background",{dark:ew,light:ew,hc:ew},o("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),xC=gv("editorUnnecessaryCode.border",{dark:null,light:null,hc:eb.fromHex("#fff").transparent(.8)},o("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),LC=gv("editorUnnecessaryCode.opacity",{dark:eb.fromHex("#000a"),light:eb.fromHex("#0007"),hc:null},o("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.")),kC=new eb(new Z_(0,122,204,.6)),EC=(gv("editorOverviewRuler.rangeHighlightForeground",{dark:kC,light:kC,hc:kC},o("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),gv("editorOverviewRuler.errorForeground",{dark:new eb(new Z_(255,18,18,.7)),light:new eb(new Z_(255,18,18,.7)),hc:new eb(new Z_(255,50,50,1))},o("overviewRuleError","Overview ruler marker color for errors."))),DC=gv("editorOverviewRuler.warningForeground",{dark:$v,light:$v,hc:Gv},o("overviewRuleWarning","Overview ruler marker color for warnings.")),NC=gv("editorOverviewRuler.infoForeground",{dark:Xv,light:Xv,hc:Zv},o("overviewRuleInfo","Overview ruler marker color for infos."));Af((e,t)=>{const i=e.getColor(ew);i&&t.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${i}; }`);const n=e.getColor(tw);n&&t.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${n}; }`);const o=e.getColor(SC);o&&t.addRule(`.monaco-editor .margin { background-color: ${o}; }`);const s=e.getColor(lC);s&&t.addRule(`.monaco-editor .rangeHighlight { background-color: ${s}; }`);const r=e.getColor(cC);r&&t.addRule(`.monaco-editor .rangeHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${r}; }`);const a=e.getColor(dC);a&&t.addRule(`.monaco-editor .symbolHighlight { background-color: ${a}; }`);const l=e.getColor(hC);l&&t.addRule(`.monaco-editor .symbolHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${l}; }`);const c=e.getColor(fC);c&&(t.addRule(`.monaco-editor .mtkw { color: ${c} !important; }`),t.addRule(`.monaco-editor .mtkz { color: ${c} !important; }`))});class IC extends cv{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ai(1,1),this._renderResult=null,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(53);const t=e.get(54);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(79);const i=e.get(124);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();return this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t),2===this._renderLineNumbers||3===this._renderLineNumbers}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 ai(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=s["d"]?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o='
',r=this._context.model.getLineCount(),a=[];for(let s=i;s<=n;s++){const e=s-i;if(!this._renderFinalNewline&&s===r&&0===this._context.model.getLineLength(s)){a[e]="";continue}const t=this._getLineRenderLineNumber(s);a[e]=t?o+t+"
":""}this._renderResult=a}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}IC.CLASS_NAME="line-numbers",Af((e,t)=>{const i=e.getColor(_C);i&&t.addRule(`.monaco-editor .line-numbers { color: ${i}; }`);const n=e.getColor(vC);n&&t.addRule(`.monaco-editor .current-line ~ .line-numbers { color: ${n}; }`)});class TC extends Lm{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._canUseLayerHinting=!t.get(25),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=am(document.createElement("div")),this._domNode.setClassName(TC.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=am(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(TC.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(124);return this._canUseLayerHinting=!t.get(25),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)}}TC.CLASS_NAME="glyph-margin",TC.OUTER_CLASS_NAME="margin";i("53d7");const MC="monaco-mouse-cursor-text";class OC{constructor(e,t,i){this.top=e,this.left=t,this.width=i}setWidth(e){return new OC(this.top,this.left,e)}}const AC=cn;class RC extends Lm{constructor(e,t,i){super(e),this._primaryCursorPosition=new ai(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._viewHelper=i,this._scrollLeft=0,this._scrollTop=0;const n=this._context.configuration.options,r=n.get(124);this._setAccessibilityOptions(n),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=n.get(38),this._lineHeight=n.get(53),this._emptySelectionClipboard=n.get(28),this._copyWithSyntaxHighlighting=n.get(18),this._visibleTextArea=null,this._selections=[new ci(1,1,1,1)],this._modelSelections=[new ci(1,1,1,1)],this._lastRenderPosition=null,this.textArea=am(document.createElement("textarea")),km.write(this.textArea,6),this.textArea.setClassName("inputarea "+MC),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(107))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",o("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),s["i"]&&n.get(75)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=am(document.createElement("div")),this.textAreaCover.setPosition("absolute");const a={getLineCount:()=>this._context.model.getLineCount(),getLineMaxColumn:e=>this._context.model.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.model.getValueInRange(e,t)},l={getDataToCopy:e=>{const t=this._context.model.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,s["j"]),i=this._context.model.getEOL(),n=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),o=Array.isArray(t)?t:null,r=Array.isArray(t)?t.join(i):t;let a=void 0,l=null;if(e&&(ov.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&r.length<65536)){const e=this._context.model.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(a=e.html,l=e.mode)}return{isFromEmptySelection:n,multicursorText:o,text:r,html:a,mode:l}},getScreenReaderContent:e=>{if(1===this._accessibilitySupport){if(s["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 iv(i,i.length,i.length,t,t)}}return iv.EMPTY}return nv.fromEditorSelection(e,a,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.model.deduceModelPositionRelativeToViewPosition(e,t,i)};this._textAreaInput=this._register(new rv(l,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="undefined"!==typeof 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.replaceCharCnt?this._viewController.replacePreviousChar(e.text,e.replaceCharCnt):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.moveOneCharacterLeft?1:0);this._context.model.revealRange("keyboard",!0,new li(t,i,t,i),0,1);const n=this._viewHelper.visibleRangeForPositionRelativeToEditor(t,i);n&&(this._visibleTextArea=new OC(this._context.viewLayout.getVerticalOffsetForLineNumber(t),n.left,AC?0:1),this._render()),this.textArea.setClassName(`inputarea ${MC} ime-input`),this._viewController.compositionStart(),this._context.model.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(e=>{this._visibleTextArea=this._visibleTextArea.setWidth(PC(e.data,this._fontInfo)),this._render()})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName("inputarea "+MC),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()}_getWordBeforePosition(e){const t=this._context.model.getLineContent(e.lineNumber),i=n_(this._context.configuration.options.get(110));let n=e.column,o=0;while(n>1){const s=t.charCodeAt(n-2),r=i.get(s);if(0!==r||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),i=t.charAt(e.column-2);if(!rs["D"](i.charCodeAt(0)))return i}return""}_getAriaLabel(e){const t=e.get(2);return 1===t?o("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",s["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===pe.accessibilityPageSize.defaultValue?this._accessibilityPageSize=100:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(124);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(38),this._lineHeight=t.get(53),this._emptySelectionClipboard=t.get(28),this._copyWithSyntaxHighlighting=t.get(18),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(107))),s["i"]&&e.hasChanged(75)&&(t.get(75)?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 ai(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():s["f"]?this._renderInsideEditor(this._primaryCursorPosition,t,e,AC?0:1,this._lineHeight):this._renderInsideEditor(this._primaryCursorPosition,t,e,AC?0:1,AC?0:1)}_renderInsideEditor(e,t,i,n,o){this._lastRenderPosition=e;const s=this.textArea,r=this.textAreaCover;jg.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(jg.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),AC)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(44)?t.setClassName("monaco-editor-background textAreaCover "+TC.OUTER_CLASS_NAME):0!==i.get(54).renderType?t.setClassName("monaco-editor-background textAreaCover "+IC.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")}}function PC(e,t){const i=document.createElement("canvas"),n=i.getContext("2d");n.font=FC(t);const o=n.measureText(e);return cn?o.width+2:o.width}function FC(e){return WC("normal",e.fontWeight,e.fontSize,e.lineHeight,e.fontFamily)}function WC(e,t,i,n,o){return`${e} normal ${t} ${i}px / ${n}px ${o}`}class BC{static columnSelect(e,t,i,n,o,s){let r=Math.abs(o-i)+1,a=i>o,l=n>s,c=ns)continue;if(fn)continue;if(g1&&n--,BC.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 a=o;a<=s;a++){const i=t.getLineMaxColumn(a),o=Mb.visibleColumnFromColumn2(e,t,new ai(a,i));n=Math.max(n,o)}let r=i.toViewVisualColumn;return re.getLineMinColumn(t)?i-=rs["K"](e.getLineContent(t),i-1):t>1&&(t-=1,i=e.getLineMaxColumn(t)),new ai(t,i)}static leftPositionAtomicSoftTabs(e,t,i,n){const o=e.getLineMinColumn(t),s=e.getLineContent(t),r=Ab.atomicPosition(s,i-1,n,0);return-1===r||r+1l?(i=l,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=Mb.columnFromVisibleColumn2(e,t,i,a),o=c?0:a-Mb.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),new KC(i,n,o)}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=jC.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 n=i.selection,o=jC.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=jC.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new kb(new li(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new ai(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){const a=Mb.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,l=1===i&&1===n;return i-=s,i<1?(i=1,n=r?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=Mb.columnFromVisibleColumn2(e,t,i,a),o=l?0:a-Mb.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),new KC(i,n,o)}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=jC.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 n=i.selection,o=jC.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=jC.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new kb(new li(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new ai(s.lineNumber,s.column),s.leftoverVisibleColumns)}static moveToBeginningOfLine(e,t,i,n){let o,s=i.position.lineNumber,r=t.getLineMinColumn(s),a=t.getLineFirstNonWhitespaceColumn(s)||r,l=i.position.column;return o=l===a?r:a,i.move(n,s,o,0)}static moveToEndOfLine(e,t,i,n,o){let s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){let o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}class qC{static deleteRight(e,t,i,n){let o=[],s=3!==e;for(let r=0,a=n.length;r=l.length+1)return!1;const c=l.charAt(a.column-2),d=i.get(c);if(!d)return!1;if(Ob(c)){if("never"===t)return!1}else if("never"===e)return!1;const h=l.charAt(a.column-1);let u=!1;for(const e of d)e.open===c&&e.close===h&&(u=!0);if(!u)return!1}return!0}static _runAutoClosingPairDelete(e,t,i){let n=[];for(let o=0,s=i.length;o1){let e=i.getLineContent(n.lineNumber),o=rs["u"](e),s=-1===o?e.length+1:o+1;if(n.column<=s){let e=Mb.visibleColumnFromColumn2(t,i,n),o=Mb.prevIndentTabStop(e,t.indentSize),s=Mb.columnFromVisibleColumn2(t,i,n.lineNumber,o);a=new li(n.lineNumber,s,n.lineNumber,n.column)}else a=new li(n.lineNumber,n.column-1,n.lineNumber,n.column)}else{let e=jC.left(t,i,n.lineNumber,n.column);a=new li(e.lineNumber,e.column,n.lineNumber,n.column)}}a.isEmpty()?o[r]=null:(a.startLineNumber!==a.endLineNumber&&(s=!0),o[r]=new VC(a,""))}return[s,o]}static cut(e,t,i){let n=[];for(let o=0,s=i.length;o1?(e=l.lineNumber-1,i=t.getLineMaxColumn(l.lineNumber-1),r=l.lineNumber,a=t.getLineMaxColumn(l.lineNumber)):(e=l.lineNumber,i=1,r=l.lineNumber,a=t.getLineMaxColumn(l.lineNumber));let c=new li(e,i,r,a);c.isEmpty()?n[o]=null:n[o]=new VC(c,"")}else n[o]=null;else n[o]=new VC(s,"")}return new Tb(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class $C{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=$C._findPreviousWordOnLine(e,t,new ai(o,s));if(0===n)return new ai(o,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start===1&&0===r.nextCharClass&&(r=$C._findPreviousWordOnLine(e,t,new ai(o,r.start+1))),new ai(o,r?r.start+1:1);if(3===n){while(r&&2===r.wordType)r=$C._findPreviousWordOnLine(e,t,new ai(o,r.start+1));return new ai(o,r?r.start+1:1)}return r&&s<=r.end+1&&(r=$C._findPreviousWordOnLine(e,t,new ai(o,r.start+1))),new ai(o,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new ai(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let s=t.column-1;s>1;s--){const e=o.charCodeAt(s-2),t=o.charCodeAt(s-1);if(95===e&&95!==t)return new ai(i,s);if(rs["F"](e)&&rs["G"](t))return new ai(i,s);if(rs["G"](e)&&rs["G"](t)&&s+1=a.start+1&&(a=$C._findNextWordOnLine(e,t,new ai(o,a.end+1))),s=a?a.start+1:t.getLineMaxColumn(o);return new ai(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?l=1:(a--,l=n.getLineMaxColumn(a)):(c&&l<=c.end+1&&(c=$C._findPreviousWordOnLine(i,n,new ai(a,c.start+1))),c?l=c.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new li(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new ai(i.positionLineNumber,i.positionColumn);let o=this._deleteInsideWordWhitespace(t,n);return o||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;while(o>0&&this._charAtIsWhitespace(i,o-1))o--;while(s+11?new li(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 li(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;while(i-11&&this._charAtIsWhitespace(n,t-2))t--;return r(t,i)},l=$C._findPreviousWordOnLine(e,t,i);if(l&&s(l))return a(l);const c=$C._findNextWordOnLine(e,t,i);return c&&s(c)?a(c):l&&c?r(l.end+1,c.start+1):l?r(l.start+1,l.end+1):c?r(c.start+1,c.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=$C._moveWordPartLeft(e,i);return new li(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let n=t;n=h.start+1&&(h=$C._findNextWordOnLine(i,n,new ai(a,h.end+1))),h?l=h.start+1:lt&&(i=t,n=e.model.getLineMaxColumn(i)),Ib.fromModelState(new kb(new li(s.lineNumber,1,i,n),0,new ai(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)),Ib.fromViewState(t.viewState.move(t.modelState.hasSelection(),n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return Ib.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 Ib.fromModelState($C.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Ib(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Ib.fromViewState(new kb(new li(i,n,i,n),0,new ai(i,n),0))}static moveTo(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new ai(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return Ib.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 this._moveToViewMinColumn(e,t,n);case 5:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 6:return this._moveToViewCenterColumn(e,t,n);case 7:return this._moveToViewMaxColumn(e,t,n);case 8: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 9:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 11:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 10:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 12:{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;r1){let t=Mb.visibleColumnFromColumn(h,u+1,o);if(t%s!==0&&e.isCheapToTokenize(d-1)){let t=ec.getEnterAction(this._opts.autoIndent,e,new li(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)));if(t){if(c=l,t.appendText)for(let e=0,i=t.appendText.length;e1){let n;for(n=i-1;n>=1;n--){const e=t.getLineContent(n),i=rs["H"](e);if(i>=0)break}if(n<1)return null;const s=t.getLineMaxColumn(n),r=ec.getEnterAction(e.autoIndent,t,new li(n,s,n,s));r&&(o=r.indentation+r.appendText)}return n&&(n===pl.Indent&&(o=ey.shiftIndent(e,o)),n===pl.Outdent&&(o=ey.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="",s=i.getStartPosition();if(e.insertSpaces){let i=Mb.visibleColumnFromColumn2(e,t,s),n=e.indentSize,r=n-i%n;for(let e=0;e=4){const o=ec.getIndentForEnter(e.autoIndent,t,n,{unshiftIndent:t=>ey.unshiftIndent(e,t),shiftIndent:t=>ey.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)});if(o){let s=Mb.visibleColumnFromColumn2(e,t,n.getEndPosition());const r=n.endColumn,a=t.getLineContent(n.endLineNumber),l=rs["u"](a);if(n=l>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,l+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new HC(n,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return r<=l+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new zC(n,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return ey._typeCommand(n,"\n"+e.normalizeIndentation(r),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;ney.shiftIndent(e,t),unshiftIndent:t=>ey.unshiftIndent(e,t)});if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===o?ey._typeCommand(new li(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):ey._typeCommand(new li(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;if(92===h&&d)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 r of o)if(null===s||r.open.length>s.open.length){let e=!0;for(const o of i){const i=t.getValueInRange(new li(o.lineNumber,o.column-r.open.length+1,o.lineNumber,o.column));if(i+n!==r.open){e=!1;break}}e&&(s=r)}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 s of n)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o?o.close:""}static _getAutoClosingPairClose(e,t,i,n,o){const s=Ob(n),r=s?e.autoClosingQuotes:e.autoClosingBrackets;if("never"===r)return null;const a=this._findAutoClosingPairOpen(e,t,i.map(e=>e.getPosition()),n);if(!a)return null;const l=this._findSubAutoClosingPairClose(e,a);let c=!0;const d=s?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;for(let u=0,g=i.length;ug.column-1){const t=f.charAt(g.column-1),i=ey._isBeforeClosingBrace(e,m);if(!i&&!d(t))return null}if(!t.isCheapToTokenize(g.lineNumber))return null;if(1===a.open.length&&s&&"always"!==r){const t=n_(e.wordSeparators);if(o&&g.column>1&&0===t.get(f.charCodeAt(g.column-2)))return null;if(!o&&g.column>2&&0===t.get(f.charCodeAt(g.column-3)))return null}t.forceTokenization(g.lineNumber);const p=t.getLineTokens(g.lineNumber);let _=!1;try{_=ec.shouldAutoClosePair(a,p,o?g.column:g.column-1)}catch(h){ve(h)}if(!_)return null}return c?a.close.substring(0,a.close.length-l.length):a.close}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){let a=[];for(let l=0,c=n.length;lnew VC(new li(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1));return new Tb(1,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const a=this._getAutoClosingPairClose(t,i,o,r,!1);return null!==a?this._runAutoClosingOpenCharType(e,t,i,o,r,!1,a):null}static typeWithInterceptors(e,t,i,n,o,s,r){if(!e&&"\n"===r){let e=[];for(let t=0,s=o.length;t{const i=e.get(Ji).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)}),e.addImplementation(1e3,(e,t)=>{const i=document.activeElement;return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)}),e.addImplementation(0,(e,t)=>{const i=e.get(Ji).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}(function(e){class t extends oy{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[GC.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),e.revealPrimaryCursor(t.source,!0)}}e.MoveTo=Xf(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=Xf(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends oy{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=>Ib.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=Xf(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 ai(n.viewPosition.lineNumber,n.viewPosition.column),o);let r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return BC.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=Xf(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return BC.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=Xf(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return BC.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return BC.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=Xf(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=Xf(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return BC.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=Xf(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=Xf(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends oy{constructor(){super({id:"cursorMove",precondition:void 0,description:YC.description})}runCoreEditorCommand(e,t){const i=YC.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,r._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:return GC.simpleMove(e,t,i.direction,n,o,i.unit);case 9:case 11:case 10:case 12:return GC.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=r,e.CursorMove=Xf(new r);class a extends oy{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,GC.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=Xf(new a({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=Xf(new a({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1039}})),e.CursorRight=Xf(new a({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=Xf(new a({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1041}})),e.CursorUp=Xf(new a({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=Xf(new a({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=Xf(new a({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:11}})),e.CursorPageUpSelect=Xf(new a({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1035}})),e.CursorDown=Xf(new a({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=Xf(new a({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=Xf(new a({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:12}})),e.CursorPageDownSelect=Xf(new a({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1036}})),e.CreateCursor=Xf(new class extends oy{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let i;i=t.wholeLine?GC.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):GC.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 li(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case ry.RawAtArgument.Top:a=3;break;case ry.RawAtArgument.Center:a=1;break;case ry.RawAtArgument.Bottom:a=4;break;default:break}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends ly{constructor(){super(sm)}runDOMCommand(){cn&&(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,[GC.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=Xf(new class extends oy{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[Ib.fromModelSelection(t.selection)])}})})(ay||(ay={}));const cy=tf.and(iy.textInputFocus,iy.columnSelection);function dy(e,t){Wu.registerKeybindingRule({id:e,primary:t,when:cy,weight:ny+1})}function hy(e){return e.register(),e}var uy,gy;dy(ay.CursorColumnSelectLeft.id,1039),dy(ay.CursorColumnSelectRight.id,1041),dy(ay.CursorColumnSelectUp.id,1040),dy(ay.CursorColumnSelectPageUp.id,1035),dy(ay.CursorColumnSelectDown.id,1042),dy(ay.CursorColumnSelectPageDown.id,1036),function(e){class t extends Gf{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=Xf(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:iy.writable,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,ey.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=Xf(new class extends t{constructor(){super({id:"outdent",precondition:iy.writable,kbOpts:{weight:ny,kbExpr:tf.and(iy.editorTextFocus,iy.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,ey.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=Xf(new class extends t{constructor(){super({id:"tab",precondition:iy.writable,kbOpts:{weight:ny,kbExpr:tf.and(iy.editorTextFocus,iy.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,ey.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=Xf(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=qC.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=Xf(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=qC.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 ly{constructor(){super(nm)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(75))return t.getModel().undo()}},e.Redo=new class extends ly{constructor(){super(om)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(75))return t.getModel().redo()}}}(uy||(uy={}));class fy extends jf{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Ji).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function my(e,t){hy(new fy("default:"+e,e)),hy(new fy(e,e,t))}my("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),my("replacePreviousChar"),my("compositionStart"),my("compositionEnd"),my("paste"),my("cut");class py{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)}replacePreviousChar(e,t){this.commandDelegate.replacePreviousChar(e,t)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){ay.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){ay.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){ay.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),ay.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),ay.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){ay.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){ay.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){ay.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){ay.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){ay.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){ay.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){ay.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){ay.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){ay.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 _y{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 _y.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){return new by(e.element,e.type,e.mouseColumn,e.position?t.convertViewPositionToModelPosition(e.position):null,e.range?t.convertViewRangeToModelRange(e.range):null,e.detail)}}class by{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 Pb.toString(this)}}class vy{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 a=i;a<=n;a++){const i=a-this._rendLineNumberStart;e<=a&&a<=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){const t=this._lines.splice(e-this._rendLineNumberStart,o-e+1);return t}const s=[];for(let d=0;di)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 wy{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new vy(()=>this._host.createVisibleLine())}_createDomNode(){const e=am(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(124)}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 i=0,n=t.length;it){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,n=t-e+1;n>0&&(this._removeLinesAfter(o,n),o.linesLength-=n)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let a=t;a<=i;a++){const e=s+a;r[a].layoutLine(e,n[e-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let a=t;a<=i;a++)s[r++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;r--){const t=e.lines[r];n[r]&&(t.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");Cy._ttPolicy&&(t=Cy._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;oe}),Cy._sb=El(1e5);class yy extends Lm{constructor(e){super(e),this._visibleLines=new wy(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 xy extends yy{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(124);return this._contentWidth=i.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 Ly extends yy{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),jg.applyFontInfo(this.domNode,t.get(38))}onConfigurationChanged(e){const t=this._context.configuration.options;jg.applyFontInfo(this.domNode,t.get(38));const i=t.get(124);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 ky{constructor(e,t){this.top=e,this.left=t}}class Ey extends Lm{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=am(document.createElement("div")),km.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=am(document.createElement("div")),km.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 Dy(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){const n=this._widgets[e.getId()];n.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 Dy{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=am(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(124);this._fixedOverflowWidgets=n.get(32),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(53),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(53),e.hasChanged(124)){const e=t.get(124);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=o.viewportHeight-a,c=s-n,d=r>=n,h=a,u=l>=n;let g=e.left,f=t.left;return g+i>o.scrollLeft+o.viewportWidth&&(g=o.scrollLeft+o.viewportWidth-i),f+i>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-i),gs){const e=r-(s-n);r-=e,i-=e}if(r=m,b=c+n<=d.height-p;return this._fixedOverflowWidgets?{fitsAbove:_,aboveTop:Math.max(l,m),aboveLeft:u,fitsBelow:b,belowTop:c,belowLeft:f}:{fitsAbove:_,aboveTop:s,aboveLeft:h,fitsBelow:b,belowTop:r,belowLeft:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new ky(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 d of t)d.lineNumbern.lineNumber&&(n=d);let o=1073741824;for(const d of i.ranges)d.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&&Ny(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&&Ny(this._actual.afterRender,this._actual,this._renderData.position)}}function Ny(e,t,...i){try{return e.call(t,...i)}catch(n){return null}}i("a2e5");let Iy=!0;class Ty extends cv{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(124);this._lineHeight=t.get(53),this._renderLineHighlight=t.get(80),this._renderLineHighlightOnlyWhenFocus=t.get(81),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ci(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=Iy?this._selections.slice(0,1):this._selections,i=t.map(e=>e.positionLineNumber);i.sort((e,t)=>e-t),nc(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(124);return this._lineHeight=t.get(53),this._renderLineHighlight=t.get(80),this._renderLineHighlightOnlyWhenFocus=t.get(81),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 a=i;a<=n;a++){const e=a-i;while(s=this._renderData.length?"":this._renderData[i]}}class My extends Ty{_renderOne(e){const t="current-line"+(this._shouldRenderOther()?" current-line-both":"");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 Oy extends Ty{_renderOne(e){const t="current-line"+(this._shouldRenderMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"");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)}}Af((e,t)=>{Iy=!1;const i=e.getColor(rC);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(aC)){const i=e.getColor(aC);i&&(Iy=!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; }")))}});i("cc1a");class Ay extends cv{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(53),this._typicalHalfwidthCharacterWidth=t.get(38).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(53),this._typicalHalfwidthCharacterWidth=t.get(38).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 a=0,l=t.length;a{if(e.options.zIndext.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return in?1:li.compareRangesUsingStarts(e.range,t.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let a=o;a<=s;a++){const e=a-o;r[e]=""}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 r=0,a=t.length;r',l=Math.max(e.range.startLineNumber,o),c=Math.min(e.range.endLineNumber,s);for(let t=l;t<=c;t++){const e=t-o;i[e]+=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,c=t.length;l';r[t]+=a}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}i("7043");class Ry extends We{onclick(e,t){this._register(Zn(e,Wo.CLICK,e=>t(new Tn(e))))}onmousedown(e,t){this._register(Zn(e,Wo.MOUSE_DOWN,e=>t(new Tn(e))))}onmouseover(e,t){this._register(Zn(e,Wo.MOUSE_OVER,e=>t(new Tn(e))))}onnonbubblingmouseout(e,t){this._register(to(e,e=>t(new Tn(e))))}onkeydown(e,t){this._register(Zn(e,Wo.KEY_DOWN,e=>t(new Ln(e))))}onkeyup(e,t){this._register(Zn(e,Wo.KEY_UP,e=>t(new Ln(e))))}oninput(e,t){this._register(Zn(e,Wo.INPUT,t))}onblur(e,t){this._register(Zn(e,Wo.BLUR,t))}onfocus(e,t){this._register(Zn(e,Wo.FOCUS,t))}ignoreGesture(e){gm.ignoreTarget(e)}}const Py=11;class Fy extends Ry{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","undefined"!==typeof e.top&&(this.bgDomNode.style.top="0px"),"undefined"!==typeof e.left&&(this.bgDomNode.style.left="0px"),"undefined"!==typeof e.bottom&&(this.bgDomNode.style.bottom="0px"),"undefined"!==typeof 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=Py+"px",this.domNode.style.height=Py+"px","undefined"!==typeof e.top&&(this.domNode.style.top=e.top+"px"),"undefined"!==typeof e.left&&(this.domNode.style.left=e.left+"px"),"undefined"!==typeof e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),"undefined"!==typeof e.right&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new mm),this.onmousedown(this.bgDomNode,e=>this._arrowMouseDown(e)),this.onmousedown(this.domNode,e=>this._arrowMouseDown(e)),this._mousedownRepeatTimer=this._register(new Bn),this._mousedownScheduleRepeatTimer=this._register(new Wn)}_arrowMouseDown(e){const t=()=>{this._mousedownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet(t,200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,fm,e=>{},()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Wy extends We{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 Wn)}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":"")))}}const By=140;class Vy extends Ry{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 Wy(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new mm),this._shouldRender=!0,this.domNode=am(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 Fy(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=am(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 n=bo(this.domNode.domNode);t=e.posx-n.left,i=e.posy-n.top}const n=this._mouseDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),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,fm,e=>{const t=this._sliderOrthogonalMousePosition(e),r=Math.abs(t-n);if(s["j"]&&r>By)return void this._setDesiredScrollPositionNow(o.getScrollPosition());const a=this._sliderMousePosition(e),l=a-i;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(l))},()=>{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()}}const Hy=20;class zy{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 zy(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(Hy,Math.floor(i*r/n))),c=(r-l)/(n-i),d=o*c;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:c,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=zy._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 Mn(null,1,0))}),this._createArrow({className:"scra",icon:Ky,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Mn(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 qy=ma("scrollbar-button-up",pa.triangleUp),$y=ma("scrollbar-button-down",pa.triangleDown);class Gy extends Vy{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new zy(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-Py)/2,i=(t.verticalScrollbarSize-Py)/2;this._createArrow({className:"scra",icon:qy,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Mn(null,0,1))}),this._createArrow({className:"scra",icon:$y,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Mn(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}}class Yy{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 Yy("undefined"!==typeof e.width?e.width:this.width,"undefined"!==typeof e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,"undefined"!==typeof e.height?e.height:this.height,"undefined"!==typeof e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new Yy(this.width,this.scrollWidth,"undefined"!==typeof e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,"undefined"!==typeof 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 Xy extends We{constructor(e,t){super(),this._onScroll=this._register(new Ye),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e,this._scheduleAtNextAnimationFrame=t,this._state=new Yy(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:"undefined"===typeof e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:"undefined"===typeof 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 eS(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=eS.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 Zy{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function Qy(e,t){const i=t-e;return function(t){return e+i*iS(t)}}function Jy(e,t,i){return function(n){return n2.5*i){let n,o;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){const t=Math.abs(Math.round(e)-e);return t<.01}}aS.INSTANCE=new aS;class lS extends Ry{constructor(e,t,i){super(),this._onScroll=this._register(new Ye),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Ye),e.style.overflow="hidden",this._options=uS(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 Gy(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new jy(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=am(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=am(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=am(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"),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 Wn),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Ae(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,s["f"]&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){"undefined"!==typeof e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),"undefined"!==typeof e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),"undefined"!==typeof e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),"undefined"!==typeof e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),"undefined"!==typeof e.horizontalScrollbarSize&&this._horizontalScrollbar.updateScrollbarSize(e.horizontalScrollbarSize),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){const t=this._mouseWheelToDispose.length>0;if(t!==e&&(this._mouseWheelToDispose=Ae(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new Mn(e))};this._mouseWheelToDispose.push(Zn(this._listenOnDomNode,Wo.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){const t=aS.INSTANCE;if(sS){const i=window.devicePixelRatio/sn();s["j"]||s["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 r=!s["f"]&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!r||o||(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);const a=this._scrollable.getFutureScrollPosition();let l={};if(n){const e=a.scrollTop-oS*n;this._verticalScrollbar.writeScrollPosition(l,e)}if(o){const e=a.scrollLeft-oS*o;this._horizontalScrollbar.writeScrollPosition(l,e)}if(l=this._scrollable.validateScrollPosition(l),a.scrollLeft!==l.scrollLeft||a.scrollTop!==l.scrollTop){const e=sS&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel();e?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),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;this._leftShadowDomNode.setClassName("shadow"+(i?" left":"")),this._topShadowDomNode.setClassName("shadow"+(t?" top":"")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"+(t?" top":"")+(i?" left":""))}}_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(),nS)}}class cS extends lS{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Xy(0,e=>oo(e));super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class dS extends lS{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 hS extends cS{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 uS(e){const t={lazyRender:"undefined"!==typeof e.lazyRender&&e.lazyRender,className:"undefined"!==typeof e.className?e.className:"",useShadows:"undefined"===typeof e.useShadows||e.useShadows,handleMouseWheel:"undefined"===typeof e.handleMouseWheel||e.handleMouseWheel,flipAxes:"undefined"!==typeof e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:"undefined"!==typeof e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:"undefined"!==typeof e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:"undefined"!==typeof e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:"undefined"!==typeof e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:"undefined"!==typeof e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:"undefined"===typeof e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:"undefined"===typeof e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:"undefined"!==typeof e.arrowSize?e.arrowSize:11,listenOnDomNode:"undefined"!==typeof e.listenOnDomNode?e.listenOnDomNode:null,horizontal:"undefined"!==typeof e.horizontal?e.horizontal:1,horizontalScrollbarSize:"undefined"!==typeof e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:"undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:"undefined"!==typeof e.horizontalHasArrows&&e.horizontalHasArrows,vertical:"undefined"!==typeof e.vertical?e.vertical:1,verticalScrollbarSize:"undefined"!==typeof e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:"undefined"!==typeof e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:"undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:"undefined"!==typeof e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize="undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize="undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,s["f"]&&(t.className+=" mac"),t}class gS extends Lm{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(87),r=o.get(61),a=o.get(30),l=o.get(90),c={listenOnDomNode:i.domNode,className:"editor-scrollable "+If(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 dS(t.domNode,c,this._context.viewLayout.getScrollable())),km.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=am(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(Zn(i.domNode,"scroll",e=>d(i.domNode,!0,!0))),this._register(Zn(t.domNode,"scroll",e=>d(t.domNode,!0,!1))),this._register(Zn(n.domNode,"scroll",e=>d(n.domNode,!0,!1))),this._register(Zn(this.scrollbarDomNode.domNode,"scroll",e=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(124);this.scrollbarDomNode.setLeft(t.contentLeft);const i=e.get(59),n=i.side;"right"===n?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(87)||e.hasChanged(61)||e.hasChanged(30)){const e=this._context.configuration.options,t=e.get(87),i=e.get(61),n=e.get(30),o=e.get(90),s={handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(124)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+If(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}i("df70");class fS{constructor(e,t,i){this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class mS extends cv{_render(e,t,i){const n=[];for(let r=e;r<=t;r++){const t=r-e;n[t]=[]}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',l=[];for(let c=t;c<=i;c++){const e=c-t,i=n[e];0===i.length?l[e]="":l[e]='
=this._renderResult.length?"":this._renderResult[i]}}i("9c85");class _S extends cv{constructor(e){super(),this._context=e,this._primaryLineNumber=0;const t=this._context.configuration.options,i=t.get(125),n=t.get(38);this._lineHeight=t.get(53),this._spaceWidth=n.spaceWidth,this._enabled=t.get(78),this._activeIndentEnabled=t.get(47),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(125),n=t.get(38);return this._lineHeight=t.get(53),this._spaceWidth=n.spaceWidth,this._enabled=t.get(78),this._activeIndentEnabled=t.get(47),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,c=0,d=0;if(this._activeIndentEnabled&&this._primaryLineNumber){const e=this._context.model.getActiveIndentGuide(this._primaryLineNumber,t,i);l=e.startLineNumber,c=e.endLineNumber,d=e.indent}const h=[];for(let u=t;u<=i;u++){const i=l<=u&&u<=c,n=u-t,g=a[n];let f="";if(g>=1){const t=e.visibleRangeForPosition(new ai(u,1));let n=t?t.left:0;for(let e=1;e<=g;e++){const t=i&&e===d?"cigra":"cigr";if(f+=`
`,n+=o,n>s||this._maxIndentLeft>0&&n>this._maxIndentLeft)break}}h[n]=f}this._renderResult=h}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Af((e,t)=>{const i=e.getColor(mC);i&&t.addRule(`.monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 ${i} inset; }`);const n=e.getColor(pC)||i;n&&t.addRule(`.monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 ${n} inset; }`)});i("11cb");class bS{constructor(){this._currentVisibleRange=new li(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class vS{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 wS{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 r=1,a=e.length;r{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new Vn(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new bS,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Vm(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(125)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(38),n=t.get(125);return this._lineHeight=t.get(53),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(84),this._cursorSurroundingLines=t.get(22),this._cursorSurroundingLinesStyle=t.get(23),this._canUseLayerHinting=!t.get(25),jg.applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(124)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Bm(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++){const e=this._visibleLines.getVisibleLine(t);e.onOptionsChanged(this._viewLineOptions)}return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).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 vS(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 wS(e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop),o=n<=this._lineHeight?1:e.scrollType;return this._context.model.setScrollPosition(i,o),!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 ai(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=li.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let o=[],s=0;const r=new Wm(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new ai(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),c=this._visibleLines.getEndLineNumber();for(let d=n.startLineNumber;d<=n.endLineNumber;d++){if(dc)continue;const e=d===n.startLineNumber?n.startColumn:1,h=d===n.endLineNumber?n.endColumn:this._context.model.getLineMaxColumn(d),u=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(e,h,r);if(u){if(t&&dthis._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(t,i,new Wm(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Tm(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 o=i;o<=n;o++){const e=this._visibleLines.getVisibleLine(o);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(),s["d"]&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++){const e=this._visibleLines.getVisibleLine(i);if(e.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;u=c}else if(5===o||6===o)if(6===o&&s<=c&&d<=a)u=s;else{const e=Math.max(5*this._lineHeight,.2*r),t=c-e,i=d-r;u=Math.max(i,t)}else if(1===o||2===o)if(2===o&&s<=c&&d<=a)u=s;else{const e=(c+d)/2;u=Math.max(0,e-r/2)}else u=this._computeMinimumScrolling(s,a,c,d,3===o,4===o);return u}_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 a of e.selections){if(a.startLineNumber!==a.endLineNumber)return null;const e=this._visibleRangesForLineRange(a.startLineNumber,a.startColumn,a.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)}if(o=Math.max(0,o-CS.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding,"selections"===e.type&&s-o>t.width)return null;const r=this._computeMinimumScrolling(i,n,o,s);return{scrollLeft:r,maxHorizontalOffset:s}}_computeMinimumScrolling(e,t,i,n,o,s){e|=0,t|=0,i|=0,n|=0,o=!!o,s=!!s;const r=t-e,a=n-i;return at?Math.max(0,n-r):e:i}}CS.HORIZONTAL_EXTRA_PX=30;i("b042");class yS extends mS{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(124);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.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,i=t.get(124);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.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 o=0,s=t.length;o
',a=[];for(let l=t;l<=i;l++){const e=l-t,i=n[e];let o="";for(let t=0,n=i.length;t';o[e]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}i("36df");class xS{constructor(e,t,i,n){this.r=xS._clamp(e),this.g=xS._clamp(t),this.b=xS._clamp(i),this.a=xS._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}}xS.Empty=new xS(0,0,0,0);class LS{constructor(){this._onDidChange=new Ye,this.onDidChange=this._onDidChange.event,this._updateColorMap(),Ga.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()})}static getInstance(){return this._INSTANCE||(this._INSTANCE=new LS),this._INSTANCE}_updateColorMap(){const e=Ga.getColorMap();if(!e)return this._colors=[xS.Empty],void(this._backgroundIsLight=!0);this._colors=[xS.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}LS._INSTANCE=null;const kS=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})(),ES=(e,t)=>(e-=32,e<0||e>96?t<=2?(e+96)%96:95:e);class DS{constructor(e,t){this.scale=t,this.charDataNormal=DS.soften(e,.8),this.charDataLight=DS.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;ne.width||i+h>e.height)return void console.warn("bad render request outside image data");const u=a?this.charDataLight:this.charDataNormal,g=ES(n,r),f=4*e.width,m=s.r,p=s.g,_=s.b,b=o.r-m,v=o.g-p,w=o.b-_,C=e.data;let y=g*c*d,S=i*f+4*t;for(let x=0;xe.width||i+c>e.height)return void console.warn("bad render request outside image data");const d=4*e.width,h=.5,u=o.r,g=o.g,f=o.b,m=n.r-u,p=n.g-g,_=n.b-f,b=u+m*h,v=g+p*h,w=f+_*h,C=e.data;let y=i*d+4*t;for(let S=0;S{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i>1]=IS[e[i]]<<4|15&IS[e[i+1]];return t},MS={1:NS(()=>TS("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:NS(()=>TS("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class OS{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=MS[e]?new DS(MS[e](),e):OS.createFromSampleData(OS.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 o of kS)i.fillText(String.fromCharCode(o),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){const i=61440;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");let n=OS._downsample(e,t);return new DS(n,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let c=0;c0){const e=255/a;for(let t=0;tOS.create(this.fontScale,a.fontFamily)),this.backgroundColor=PS._getMinimapBackground(t,i)}static _getMinimapBackground(e,t){const i=e.getColor(Gw);return i?new xS(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 FS{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,c,d){const h=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),f=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/(c-o),d=l*s,h=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new FS(l,c,h,s,d,i,1,Math.min(r,u))}let m,p;if(s&&i!==r){const e=i-t+1;m=Math.floor(e*u/h)}else{const e=o/f;m=Math.floor(e*u/h)}p=e.scrollBeyondLastLine?(r-1)*u/h:Math.max(0,r*u/h-m),p=Math.min(e.minimapHeight-m,p);const _=p/(c-o),b=l*_;let v=0;if(e.scrollBeyondLastLine){const e=o/f;v=e-1}if(g>=r+v){const e=1,t=r,i=p>0;return new FS(l,c,i,_,b,m,e,t)}{let e=Math.max(1,Math.floor(t-b*h/u));d&&d.scrollHeight===c&&(d.scrollTop>l&&(e=Math.min(e,d.startLineNumber)),d.scrollTopWS.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get(),i=t.lines;for(let n=0,o=i.length;n1){for(let t=0,i=r-1;t0&&this.minimapLines[i-1]>=e)i--;let n=this.modelLineToMinimapLine(t)-1;while(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;o--){if(this.minimapLines[o]=0;i--){if(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]=HS.compute(this.options,this._context.model.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}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{e.preventDefault();const t=this._model.options.renderMinimap;if(0===t)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(e.leftButton&&this._lastRenderData){const t=bo(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e.buttons,e.posx,i,e.posy,this._lastRenderData.renderedLayout)}return}const i=this._model.options.minimapLineHeight,n=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.browserEvent.offsetY,o=Math.floor(n/i);let s=o+this._lastRenderData.renderedLayout.startLineNumber;s=Math.min(s,this._model.getLineCount()),this._model.revealLineNumber(s)}),this._sliderMouseMoveMonitor=new mm,this._sliderMouseDownListener=eo(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=gm.addTarget(this._domNode.domNode),this._sliderTouchStartListener=Zn(this._domNode.domNode,hm.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=Zn(this._domNode.domNode,hm.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=eo(this._domNode.domNode,hm.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 r=(e,n)=>{const r=Math.abs(n-t);if(s["j"]&&r>AS)return void this._model.setScrollTop(o.scrollTop);const a=e-i;this._model.setScrollTop(o.getDesiredScrollTopFromDelta(a))};n!==i&&r(n,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,fm,e=>r(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 VS(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(jw),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){const t=this._model.options.renderMinimap;if(0===t)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 i=FS.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(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight);const n=e.scrollLeft/this._model.options.typicalHalfwidthCharacterWidth,o=Math.min(this._model.options.minimapWidth,Math.round(n*this._model.options.minimapCharWidth/this._model.options.pixelRatio));this._sliderHorizontal.setLeft(o),this._sliderHorizontal.setWidth(this._model.options.minimapWidth-o),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}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 c=new Map;for(let d=0;dthis._model.options.canvasInnerHeight)return;let h=t.get(s);const u=!h;if(!h){const e=this._model.getLineContent(s);h=[g];for(let t=1;ts?h.length-1:m-1;if(v>0){const t=h[v]-b||2;this.renderDecoration(e,n,b,d,t,r)}u&&this.renderLineHighlight(e,n,d,r)}renderLineHighlight(e,t,i,n){e.fillStyle=t&&t.transparent(.5).toString()||"",e.fillRect(g,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 BS(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;let[s,r,a]=US._renderUntouchedLines(o,t,i,n,this._lastRenderData);const l=this._model.getMinimapLinesRenderingData(t,i,a),c=this._model.getOptions().tabSize,d=this._model.options.backgroundColor,h=this._model.tokensColorTracker,u=h.backgroundIsLight(),g=this._model.options.renderMinimap,f=this._model.options.charRenderer(),m=this._model.options.fontScale,p=this._model.options.minimapCharWidth,_=1===g?2:3,b=_*m,v=n>b?Math.floor((n-b)/2):0;let w=0;const C=[];for(let k=0,E=i-t+1;k=0&&ip)return;const s=f.charCodeAt(v);if(9===s){const e=c-(v+w)%c;w+=e-1,b+=e*o}else if(32===s)b+=o;else{const c=rs["C"](s)?2:1;for(let d=0;dp)return}}}}}Af((e,t)=>{const i=e.getColor(Gw);i&&t.addRule(`.monaco-editor .minimap > canvas { opacity: ${i.rgba.a}; will-change: opacity; }`);const n=e.getColor(Yw);n&&t.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${n}; }`);const o=e.getColor(Xw);o&&t.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${o}; }`);const s=e.getColor(Zw);s&&t.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${s}; }`);const r=e.getColor(Wv);r&&t.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${r} -6px 0 6px -6px inset; }`)});i("70a8");class KS extends Lm{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=am(document.createElement("div")),km.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,i=t.get(124);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=am(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],i=e.domNode.domNode;delete this._widgets[t],i.parentNode.removeChild(i),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 i=0,n=t.length;i=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e,r=s+t,a=s+t+o;return[[0,s,r,s,a,s,r,s],[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,o=e,s=o+t;return[[0,o,o,o,s,o,o,o],[0,t,t,t,i,t+i,t+i,t+i]]}{const t=e,i=n;return[[0,t,t,t,t,t,t,t],[0,i,i,i,i,i,i,i]]}}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 qS extends Lm{constructor(e){super(e),this._domNode=am(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=Ga.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new jS(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-l),_=e-l,b=e+l}_>p+1||e!==f?(0!==r&&c.fillRect(d[f],m,h[f],p-m),f=e,m=_,p=b):b>p&&(p=b)}c.fillRect(d[f],m,h[f],p-m)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,i=e/2|0,o=this._settings.x[7],r=this._settings.w[7];c.fillStyle=this._settings.cursorColor;let a=-100,l=-100;for(let d=0,h=this._cursorPositions.length;dt&&(u=t-i);const g=u-i,f=g+e;g>l+1?(0!==d&&c.fillRect(o,a,r,l-a),a=g,l=f):f>l&&(l=f)}c.fillRect(o,a,r,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(c.beginPath(),c.lineWidth=1,c.strokeStyle=this._settings.borderColor,c.moveTo(0,0),c.lineTo(0,t),c.stroke(),c.moveTo(0,0),c.lineTo(e,0),c.stroke())}}class $S{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 GS{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-h);const u=n.color;let g=this._color2Id[u];g||(g=++this._lastAssignedId,this._color2Id[u]=g,this._id2Color[g]=u);const f=new $S(d-h,d+h,g);n.setColorZone(f),r.push(f)}return this._colorZonesInvalid=!1,r.sort($S.compare),r}}class XS extends xm{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=am(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new YS(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(53)),this._zoneManager.setPixelRatio(i.get(122)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(53)&&(this._zoneManager.setLineHeight(t.get(53)),this._render()),e.hasChanged(122)&&(this._zoneManager.setPixelRatio(t.get(122)),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,c=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=c):r>=l?r=Math.max(r,c):(e.fillRect(0,s,n,r-s),s=l,r=c)}e.fillRect(0,s,n,r-s)}}i("df93");class ZS extends Lm{constructor(e){super(e),this.domNode=am(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(86),this._typicalHalfwidthCharacterWidth=t.get(38).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(86),this._typicalHalfwidthCharacterWidth=t.get(38).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=am(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;while(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(wC);i&&t.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${i} inset; }`)});i("9368");class QS extends Lm{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options,i=t.get(87);this._useShadows=i.useShadows,this._domNode=am(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,t=e.get(124);0===t.minimap.renderMinimap||t.minimap.minimapWidth>0&&0===t.minimap.minimapLeft?this._width=t.width:this._width=t.width-t.minimap.minimapWidth-t.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(87);return this._useShadows=i.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":"")}}Af((e,t)=>{const i=e.getColor(Wv);i&&t.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${i} 0 6px 6px -6px inset; }`)});i("adf0");class JS{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class ex{constructor(e,t){this.lineNumber=e,this.ranges=t}}function tx(e){return new JS(e)}function ix(e){return new ex(e.lineNumber,e.ranges.map(tx))}const nx=ln;class ox extends cv{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(53),this._roundedSelection=t.get(85),this._typicalHalfwidthCharacterWidth=t.get(38).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(53),this._roundedSelection=t.get(85),this._typicalHalfwidthCharacterWidth=t.get(38).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 r=0,a=t.length;r0){const e=t[r-1].ranges[0].left,o=t[r-1].ranges[0].left+t[r-1].ranges[0].width;sx(i-e)e&&(c.top=1),sx(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 c=0,d=n.length;c1,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 sx(e){return e<0?-e:e}ox.SELECTION_CLASS_NAME="selected-text",ox.SELECTION_TOP_LEFT="top-left-radius",ox.SELECTION_BOTTOM_LEFT="bottom-left-radius",ox.SELECTION_TOP_RIGHT="top-right-radius",ox.SELECTION_BOTTOM_RIGHT="bottom-right-radius",ox.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",ox.ROUNDED_PIECE_WIDTH=10,Af((e,t)=>{const i=e.getColor(dw);i&&t.addRule(`.monaco-editor .focused .selected-text { background-color: ${i}; }`);const n=e.getColor(uw);n&&t.addRule(`.monaco-editor .selected-text { background-color: ${n}; }`);const o=e.getColor(hw);o&&!o.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${o}; }`)});i("b856");class rx{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 ax{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(38);this._cursorStyle=t.get(21),this._lineHeight=t.get(53),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(24),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=am(document.createElement("div")),this._domNode.setClassName("cursor "+MC),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),jg.applyFontInfo(this._domNode,i),this._domNode.setDisplay("none"),this._position=new ai(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(38);return this._cursorStyle=t.get(21),this._lineHeight=t.get(53),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(24),this._typicalHalfwidthCharacterWidth),jg.applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_prepareRender(e){let t="";if(this._cursorStyle===M.Line||this._cursorStyle===M.LineThin){const i=e.visibleRangeForPosition(this._position);if(!i||i.outsideRenderedLine)return null;let n;if(this._cursorStyle===M.Line){if(n=ts(this._lineCursorWidth>0?this._lineCursorWidth:2),n>2){const e=this._context.model.getLineContent(this._position.lineNumber),i=rs["J"](e,this._position.column-1);t=e.substr(this._position.column-1,i)}}else n=ts(1);let o=i.left;n>=2&&o>=1&&(o-=1);const s=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new rx(s,o,n,this._lineHeight,t,"")}const i=this._context.model.getLineContent(this._position.lineNumber),n=rs["J"](i,this._position.column-1),o=e.linesVisibleRangesForRange(new li(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===M.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!==M.Underline&&this._cursorStyle!==M.UnderlineThin||(c+=this._lineHeight-2,d=2),new rx(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 ${MC} ${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 lx extends Lm{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(75),this._cursorBlinking=t.get(19),this._cursorStyle=t.get(21),this._cursorSmoothCaretAnimation=t.get(20),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new ax(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=am(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 Wn,this._cursorFlatBlinkInterval=new Bn,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(75),this._cursorBlinking=t.get(19),this._cursorStyle=t.get(21),this._cursorSmoothCaretAnimation=t.get(20),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.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()},lx.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},lx.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case M.Line:e+=" cursor-line-style";break;case M.Block:e+=" cursor-block-style";break;case M.Underline:e+=" cursor-underline-style";break;case M.LineThin:e+=" cursor-line-thin-style";break;case M.BlockOutline:e+=" cursor-block-outline-style";break;case M.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;case 5:e+=" cursor-solid";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(uC);if(i){let n=e.getColor(gC);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 cx=()=>{throw new Error("Invalid change accessor")};class dx extends Lm{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._lineHeight=t.get(53),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=am(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=am(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 n of e)t.set(n.id,n);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)}};hx(e,n),n.addZone=cx,n.removeZone=cx,n.layoutZone=cx}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n=e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),o={whitespaceId:n,delegate:t,isVisible:!1,domNode:am(t.domNode),marginDomNode:t.marginDomNode?am(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.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(i){ve(i)}}_safeCallOnDomNodeTop(e,t){if("function"===typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(i){ve(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(let s=0,r=t.length;s{this._context.theme.update(e),this._context.model.onDidColorThemeChange(),this.render(!0,!1)})),this._viewParts=[],this._textAreaHandler=new RC(this._context,r,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=am(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=am(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=am(document.createElement("div")),km.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new gS(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new CS(this._context,this._linesContent),this._viewZones=new dx(this._context),this._viewParts.push(this._viewZones);const a=new qS(this._context);this._viewParts.push(a);const l=new QS(this._context);this._viewParts.push(l);const c=new xy(this._context);this._viewParts.push(c),c.addDynamicOverlay(new My(this._context)),c.addDynamicOverlay(new ox(this._context)),c.addDynamicOverlay(new _S(this._context)),c.addDynamicOverlay(new Ay(this._context));const d=new Ly(this._context);this._viewParts.push(d),d.addDynamicOverlay(new Oy(this._context)),d.addDynamicOverlay(new pS(this._context)),d.addDynamicOverlay(new SS(this._context)),d.addDynamicOverlay(new yS(this._context)),d.addDynamicOverlay(new IC(this._context));const h=new TC(this._context);h.getDomNode().appendChild(this._viewZones.marginDomNode),h.getDomNode().appendChild(d.getDomNode()),this._viewParts.push(h),this._contentWidgets=new Ey(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new lx(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new KS(this._context),this._viewParts.push(this._overlayWidgets);const u=new ZS(this._context);this._viewParts.push(u);const g=new zS(this._context);if(this._viewParts.push(g),a){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(a.getDomNode(),e.insertBefore)}this._linesContent.appendChild(c.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(h.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 ev(this._context,r,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,focusTextArea:()=>{this.focus()},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Rb(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 ai(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPositionRelativeToEditor:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ai(e,t)))}}_applyLayout(){const e=this._context.configuration.options,t=e.get(124);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(121)+" "+If(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this._configPixelRatio=this._context.configuration.options.get(122),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=no(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){px(()=>this._actualRender())}_getViewPartsToRender(){let e=[],t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!Yn(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 fx(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 Dm(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(n);for(const o of e)o.render(n),o.onDidRender();Math.abs(rn()-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 ai(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?_y.convertViewToModelMouseTarget(i,this._context.model.coordinatesConverter):null}createOverviewRuler(e){return new XS(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 li(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,i=this._overlayWidgets.setWidgetPosition(e.widget,t);i&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}function px(e){try{return e()}catch(t){ve(t)}}class _x{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new kb(new li(1,1,1,1),0,new ai(1,1),0),new kb(new li(1,1,1,1),0,new ai(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 Ib(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return 0===this.modelState.selection.getDirection()?new ci(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new ci(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 kb(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 kb(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 kb(n,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new ai(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new ai(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new li(n.lineNumber,n.column,o.lineNumber,o.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new kb(s,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class bx{constructor(e){this.context=e,this.primaryCursor=new _x(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--}}}}class vx{constructor(){this.type=0}}class wx{constructor(){this.type=1}}class Cx{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class yx{constructor(e,t){this.type=3,this.selections=e,this.modelSelections=t}}class Sx{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class xx{constructor(){this.type=5}}class Lx{constructor(e){this.type=6,this.isFocused=e}}class kx{constructor(){this.type=7}}class Ex{constructor(){this.type=8}}class Dx{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}}class Nx{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Ix{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class Tx{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 Mx{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 Ox{constructor(){this.type=14}}class Ax{constructor(e){this.type=15,this.ranges=e}}class Rx{constructor(){this.type=16}}class Px{constructor(){this.type=17}}class Fx extends We{constructor(){super(),this._onEvent=this._register(new Ye),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{const t=this.beginEmitViewEvents();t.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(){while(this._viewEventQueue){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class Wx{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class Bx{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 Bx(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class Vx{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 Vx(this.oldHasFocus,e.hasFocus)}}class Hx{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 Hx(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class zx{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class Ux{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,n=t.length;if(i!==n)return!1;for(let o=0;o=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class $x extends We{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new Eb(this._model,this._coordinatesConverter,n),this._cursors=new bx(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=Ae(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new Eb(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;t$x.MAX_CURSOR_COUNT&&(n=n.slice(0,$x.MAX_CURSOR_COUNT),o=!0);const s=new jx(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 li(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 li(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 Tx(t,i,n,o,s,r))}saveState(){let e=[];const t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const i=Ib.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,Ib.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:Mb.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:Mb.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,Ib.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],n=[];for(let r=0,a=e.length;r0&&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 jx(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new yx(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 Ux(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,c=n.text.lastIndexOf(a,l-1);if(-1===c)return null;t.push([c,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 i=0,n=o.length;i0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=new jx(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){ve(s)}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}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{if("keyboard"===t){const e=qx.getAllAutoClosedCharacters(this._autoClosedActions);this._executeEditOperation(ey.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),e)),this._selectionsWhenCompositionStarted=null}},e,t)}type(e,t,i){this._executeEdit(()=>{if("keyboard"===i){const e=t.length;let i=0;while(i{this._executeEditOperation(ey.replacePreviousChar(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i))},e,n)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(ey.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(qC.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Tb(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Tb(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}$x.MAX_CURSOR_COUNT=1e4;class Gx{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let s=0,r=n.trackedRanges.length;s0&&(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 r=0;r0?(n[r].sort(o),s[r]=t[r].computeCursorState(e.model,{getInverseEditOperations:()=>n[r],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new ci(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new ci(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[r]=e.selectionsBefore[r];return s});r||(r=e.selectionsBefore);let a=[];for(let l in o)o.hasOwnProperty(l)&&a.push(parseInt(l,10));a.sort((e,t)=>t-e);for(const l of a)r.splice(l,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{li.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a=(e,t,i)=>{r=!0,s(e,t,i)},l=(t,i)=>{const n=ci.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()},c={addEditOperation:s,addTrackedEditOperation:a,trackSelection:l};try{i.getEditOperations(e.model,c)}catch(d){return ve(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((e,t)=>-li.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}}class Yx{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 Xx(e,t,i,n,o,s,r){let a="
",l=n,c=0;for(let d=0,h=t.getCount();d0)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}`,h>o||l>=o)break}return a+="
",a}class Zx{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 Qx{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 Jx{constructor(e,t,i,n){this._instanceId=rs["O"](++Jx.INSTANCE_COUNT),this._pendingChanges=new Zx,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;while(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 Qx(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})}};e(i)}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 a of i)n.add(a.id);const o=new Map;for(const a of t)o.set(a.id,a);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=Jx.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[r+1].afterLineNumber>=e)return r;i=r+1|0}else n=r-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e),i=t+1;return i1?this._lineHeight*(e-1):0;const i=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e);return t+i+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e|=0,e<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,o=t;while(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,c;-1===r?(r=a,c=s+1,l=0):(c=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let d=o,h=d;const u=5e5;let g=0;o>=u&&(g=Math.floor(o/u)*u,g=Math.floor(g/i)*i,h-=g);const f=[],m=e+(t-e)/2;let p=-1;for(let w=n;w<=s;w++){if(-1===p){const e=d,t=d+i;(e<=m&&mm)&&(p=w)}d+=i,f[w-n]=h,h+=i;while(c===w)h+=l,d+=l,r++,r>=a?c=s+1:(c=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(d>=t){s=w;break}}-1===p&&(p=s);const _=0|this.getVerticalOffsetForLineNumber(s);let b=n,v=s;return bt&&v--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:s,relativeVerticalOffset:f,centeredLineNumber:p,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;const n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+o)return-1;while(t=o+s)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),o=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:s,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 s=i;s<=n;s++){const e=this.getVerticalOffsetForWhitespaceIndex(s),i=this.getHeightForWhitespaceIndex(s);if(e>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:e,height:i})}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}}Jx.INSTANCE_COUNT=0;const eL=125;class tL{constructor(e,t,i,n){e|=0,t|=0,i|=0,n|=0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<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 iL extends We{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new Ye),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new tL(0,0,0,0),this._scrollable=this._register(new Xy(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 Bx(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 nL extends We{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(124),s=n.get(69);this._linesLayout=new Jx(t,n.get(53),s.top,s.bottom),this._scrollable=this._register(new iL(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new tL(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(98)?eL:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(53)&&this._linesLayout.setLineHeight(t.get(53)),e.hasChanged(69)){const e=t.get(69);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(124)){const e=t.get(124),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new tL(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(98)&&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,n=i.get(87);return 2===n.horizontal||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(89)?o+=Math.max(0,t-n.get(53)-n.get(69).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 tL(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Hd(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Hd(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(125),n=t.get(38);if(i.isViewportWrapping){const i=t.get(124),o=t.get(59);return e>i.contentWidth+n.typicalHalfwidthCharacterWidth&&o.enabled&&"right"===o.side?e+i.verticalScrollbarWidth:e}{const i=t.get(88)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i,o)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new tL(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),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,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(){const e=this._scrollable.getScrollDimensions();return e.contentWidth}getScrollWidth(){const e=this._scrollable.getScrollDimensions();return e.scrollWidth}getContentHeight(){const e=this._scrollable.getScrollDimensions();return e.contentHeight}getScrollHeight(){const e=this._scrollable.getScrollDimensions();return e.scrollHeight}getCurrentScrollLeft(){const e=this._scrollable.getCurrentScrollPosition();return e.scrollLeft}getCurrentScrollTop(){const e=this._scrollable.getCurrentScrollPosition();return e.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})}}class oL{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 sL{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 Pc(t,e-i)}}class rL{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 oL(this)}_constructLines(e,t){this.lines=[],e&&(this.hiddenAreasIds=[]);let i=this.model.getLinesContent();const n=i.length,o=this.createLineBreaksComputer();for(let u=0;uthis.model.getDecorationRange(e)).sort(li.compareRangesUsingStarts),l=1,c=0,d=-1,h=d+1=l&&e<=c,i=gL(s[u],!t);r[u]=i.getViewLineCount(),this.lines[u]=i}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new sL(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(li.compareRangesUsingStarts),i=[],n=t[0].startLineNumber,o=t[0].endLineNumber;for(let s=1,r=t.length;so+1?(i.push(new li(n,1,o,1)),n=e.startLineNumber,o=e.endLineNumber):e.endLineNumber>o&&(o=e.endLineNumber)}return i.push(new li(n,1,o,1)),i}setHiddenAreas(e){let t=this._reduceRanges(e),i=this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e)).sort(li.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n=s&&e<=r?this.lines[d].isVisible()&&(this.lines[d]=this.lines[d].setVisible(!1),t=!0):(c=!0,this.lines[d].isVisible()||(this.lines[d]=this.lines[d].setVisible(!0),t=!0)),t){let e=this.lines[d].getViewLineCount();this.prefixSumComputer.changeValue(d,e)}}return c||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 c=null;if(l){c=[];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 c=0,d=n.length;ca?(c=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,d=c+a-1,g=d+1,f=g+(o-a)-1,l=!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 c=null;for(let g=a;g<=l;g++){const e=this.lines[g];if(e.isVisible()){let t=e.getViewLineNumberOfModelPosition(0,g===a?i.column:1),n=e.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),o=n-t+1,l=0;o>1&&1===e.getViewLineMinColumn(this.model,g+1,n)&&(l=0===t?1:2),s.push(o),r.push(l),null===c&&(c=new ai(g+1,0))}else null!==c&&(o=o.concat(this.model.getLinesIndentGuides(c.lineNumber,g)),c=null)}null!==c&&(o=o.concat(this.model.getLinesIndentGuides(c.lineNumber,n.lineNumber)),c=null);const d=t-e+1;let h=new Array(d),u=0;for(let g=0,f=o.length;gt&&(h=!0,d=t-o+1);let u=c+d;if(n.getViewLinesData(this.model,l+1,c,u,o-e,i,a),o+=d,h)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 c=r.getModelColumnOfViewPosition(s,t),d=this.model.validatePosition(new ai(o+1,c));return d.equals(i)?new ai(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 li(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 ai(n+1,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new li(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t){const i=this.model.validatePosition(new ai(e,t)),n=i.lineNumber,o=i.column;let s=n-1,r=!1;while(s>0&&!this.lines[s].isVisible())s--,r=!0;if(0===s&&!this.lines[s].isVisible())return new ai(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 li(t.lineNumber,t.column,i.lineNumber-1,this.getViewLineMaxColumn(i.lineNumber-1)):new li(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)}while(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 pL;for(const s of n){const e=s.options.overviewRuler,t=e?e.position:0;if(0===t)continue;const n=e.getColor(i),r=this._getViewLineNumberForModelPosition(s.range.startLineNumber,s.range.startColumn),a=this._getViewLineNumberForModelPosition(s.range.endLineNumber,s.range.endColumn);o.accept(n,r,a,t)}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 li(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 u=r;u<=a;u++){const e=this.lines[u];if(e.isVisible())null===l&&(l=new ai(u+1,u===r?n.column:1));else if(null!==l){const e=this.model.getLineMaxColumn(u);s=s.concat(this.model.getDecorationsInRange(new li(l.lineNumber,l.column,u,e),t,i)),l=null}}null!==l&&(s=s.concat(this.model.getDecorationsInRange(new li(l.lineNumber,l.column,o.lineNumber,o.column),t,i)),l=null),s.sort((e,t)=>{const i=li.compareRangesUsingStarts(e.range,t.range);return 0===i?e.idt.id?1:0:i});let c=[],d=0,h=null;for(const u of s){const e=u.id;h!==e&&(h=e,c[d++]=u)}return c}}class aL{constructor(){}isVisible(){return!0}setVisible(e){return e?this:lL.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 jd(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 ai(e,t)}getViewLineNumberOfModelPosition(e,t){return e}}aL.INSTANCE=new aL;class lL{constructor(){}isVisible(){return!1}setVisible(e){return e?aL.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")}}lL.INSTANCE=new lL;class cL{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 Ud.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets,e,0)}getInputEndOffsetOfOutputLineIndex(e,t,i){return i+1===this._lineBreakData.breakOffsets.length?e.getLineMaxColumn(t)-1:Ud.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=hL(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),s=o-n;return i>0&&(s=this._lineBreakData.wrappedTextIndentLength+s),s}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=hL(this._lineBreakData.wrappedTextIndentLength)+s);let r=i>0?this._lineBreakData.wrappedTextIndentLength+1:1,a=s.length+1,l=i+10&&(c=this._lineBreakData.wrappedTextIndentLength);let d=e.getLineTokens(t);const h=0===i?0:this._lineBreakData.breakOffsetsVisibleColumn[i-1];return new jd(s,l,r,a,h,d.sliceAndInflate(n,o,c))}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 ai(e+n,o)}getViewLineNumberOfModelPosition(e,t){if(!this._isVisible)throw new Error("Not supported");const i=Ud.getOutputPositionOfInputOffset(this._lineBreakData.breakOffsets,t-1);return e+i.outputLineIndex}}let dL=[""];function hL(e){if(e>=dL.length)for(let t=1;t<=e;t++)dL[t]=uL(t);return dL[e]}function uL(e){return new Array(e+1).join(" ")}function gL(e,t){return null===e?t?aL.INSTANCE:lL.INSTANCE:new cL(e,t)}class fL{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 mL{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new fL(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 Nx(t,i)}onModelLinesInserted(e,t,i,n){return new Ix(t,i)}onModelLineChanged(e,t,i){return[!1,new Dx(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 o=0;o=t)return void(i>s&&(o[o.length-1]=i));o.push(n,t,i)}else this.result[e]=[n,t,i]}}class _L{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 ai(n.startLineNumber,1)),t=this._coordinatesConverter.convertModelPositionToViewPosition(new ai(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)));s=new li(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n);i=new Gd(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,ee(this.configuration.options)),i=e.startLineNumber,n=e.endLineNumber;let o=[],s=0,r=[];for(let a=i;a<=n;a++)r[a-i]=[];for(let a=0,l=t.length;athis.tokenizeViewport(),50)),this._updateConfigurationViewLineCount=this._register(new Vn(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,bL&&this.model.isTooLargeForTokenization())this._lines=new mL(this.model);else{const e=this._configuration.options,t=e.get(38),i=e.get(118),s=e.get(125),r=e.get(117);this._lines=new rL(this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new $x(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new nL(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(e=>{e.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new Mx(e)),this._eventDispatcher.emitOutgoingEvent(new Hx(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 _L(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(LS.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Rx)})),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 ai(e.startLineNumber,1)),i=this.coordinatesConverter.convertViewPositionToModelPosition(new ai(e.endLineNumber,1));this.model.tokenizeViewport(t.lineNumber,i.lineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Lx(e)),this._eventDispatcher.emitOutgoingEvent(new Vx(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new vx)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new wx)}onDidColorThemeChange(){this._eventDispatcher.emitSingleViewEvent(new Ox)}_onConfigurationChanged(e,t){let i=null;if(-1!==this._viewportStartLine){let e=new ai(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(e)}let n=!1;const o=this._configuration.options,s=o.get(38),r=o.get(118),a=o.get(125),l=o.get(117);if(this._lines.setWrappingSettings(s,r,a.wrappingColumn,l)&&(e.emitViewEvent(new xx),e.emitViewEvent(new Ex),e.emitViewEvent(new Sx(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),0!==this.viewLayout.getCurrentScrollTop()&&(n=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(75)&&(this._decorations.reset(),e.emitViewEvent(new Sx(null))),e.emitViewEvent(new Cx(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)}Lb.shouldRecreate(t)&&(this.cursorConfig=new Lb(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);break}const a=r.finalize();let l=0;for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new xx),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,c,d]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),c&&(t.emitViewEvent(c),this.viewLayout.onLinesInserted(c.fromLineNumber,c.toLineNumber)),d&&(t.emitViewEvent(d),this.viewLayout.onLinesDeleted(d.fromLineNumber,d.toLineNumber));break}case 5:break}this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new Ex),t.emitViewEvent(new Sx(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 kx),this.cursorConfig=new Lb(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Lb(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 xx),e.emitViewEvent(new Ex),e.emitViewEvent(new Sx(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Lb(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 Sx(e))}))}setHiddenAreas(e){try{const t=this._eventDispatcher.beginEmitViewEvents();let i=this._lines.setHiddenAreas(e);i&&(t.emitViewEvent(new xx),t.emitViewEvent(new Ex),t.emitViewEvent(new Sx(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(124),t=this._configuration.options.get(53),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 li(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 c=0,d=i.length;ca||(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 a of e)a.isEmpty()||r.push(this.model.getValueInRange(a,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 li(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(38),s=this._getColorMap(),r=o.fontFamily===ue.fontFamily?o.fontFamily:`'${o.fontFamily}', ${ue.fontFamily}`;return{mode:i.language,html:`
`+this._getHTMLToCopy(n,s)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const e=this.model.getLineTokens(c),d=e.getLineContent(),h=c===i?n-1:0,u=c===o?r-1:d.length;l+=""===d?"
":Xx(d,e.inflate(),t,h,u,a,s["j"])}return l}_getColorMap(){let e=Ga.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;ithis._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}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 Kx):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))}replacePreviousChar(e,t,i){this._executeCursorEdit(n=>this._cursor.replacePreviousChar(n,e,t,i))}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 li(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new Tx(e,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new li(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new Tx(e,i,null,0,!0,0)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(s=>s.emitViewEvent(new Tx(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){const t=this.viewLayout.changeWhitespace(e);t&&(this._eventDispatcher.emitSingleViewEvent(new Px),this._eventDispatcher.emitOutgoingEvent(new zx))}setMaxLineWidth(e){this.viewLayout.setMaxLineWidth(e)}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}}class wL{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)}}const CL=Zi("accessibilityService"),yL=new wf("accessibilityModeEnabled",!1);class SL extends Bc{constructor(e,t){super(0);for(let i=0;i=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 xL=[],LL=[];class kL{constructor(e,t){this.classifier=new SL(e,t)}static create(e){return new kL(e.get(113),e.get(112))}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(c[v]-_);while(v+1=e)break;e=t,v++}}while(vt&&(t=m,o=p);let r=0,d=0,w=0,C=0;if(o<=_){let p=o,b=0===t?0:i.charCodeAt(t-1),v=0===t?0:e.get(b),y=!0;for(let o=t;om&&TL(b,v,a,l)&&(r=t,d=p),p+=c,p>_){t>m?(w=t,C=p-c):(w=o+1,C=p),p-d>h&&(r=0),y=!1;break}b=a,v=l}if(y){f>0&&(u[f]=l[l.length-1],g[f]=c[l.length-1],f++);break}}if(0===r){let a=o,l=i.charCodeAt(t),c=e.get(l),u=!1;for(let n=t-1;n>=m;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){u=!0;break}let g,f;if(rs["E"](o)?(n--,g=0,f=2):(g=e.get(o),f=rs["C"](o)?s:1),a<=_){if(0===w&&(w=t,C=a),a<=_-h)break;if(TL(o,g,l,c)){r=t,d=a;break}}a-=f,l=o,c=g}if(0!==r){const e=h-(C-d);if(e<=n){const t=i.charCodeAt(w);let o;o=rs["D"](t)?2:NL(t,C,n,s),e-o<0&&(r=0)}}if(u){v--;continue}}if(0===r&&(r=w,d=C),r<=m){const e=i.charCodeAt(m);rs["D"](e)?(r=m+2,d=p+2):(r=m+1,d=p+NL(e,p,n,s))}m=r,u[f]=r,p=d,g[f]=d,f++,_=d+h;while(v<0||v=y)break;y=e,v++}}return 0===f?null:(u.length=f,g.length=f,xL=t.breakOffsets,LL=t.breakOffsetsVisibleColumn,t.breakOffsets=u,t.breakOffsetsVisibleColumn=g,t.wrappedTextIndentLength=d,t)}function DL(e,t,i,n,o,s){if(-1===n)return null;const r=t.length;if(r<=1)return null;const a=ML(t,i,n,o,s),l=n-a;let c=[],d=[],h=0,u=0,g=0,f=n,m=t.charCodeAt(0),p=e.get(m),_=NL(m,0,i,o),b=1;rs["D"](m)&&(_+=1,m=t.charCodeAt(1),p=e.get(m),b++);for(let v=b;vf&&((0===u||_-g>l)&&(u=n,g=_-a),c[h]=u,d[h]=g,h++,f=g+l,u=0),m=s,p=r}return 0===h?null:(c[h]=r,d[h]=_,new Ud(c,d,a))}function NL(e,t,i,n){return 9===e?i-t%i:rs["C"](e)||e<32?n:1}function IL(e,t){return t-e%t}function TL(e,t,i,n){return 32!==i&&(2===t||3===t&&2!==n||1===n||3===n&&1!==t)}function ML(e,t,i,n,o){let s=0;if(0!==o){const r=rs["u"](e);if(-1!==r){for(let i=0;ii&&(s=0)}}return s}var OL;const AL=null===(OL=window.trustedTypes)||void 0===OL?void 0:OL.createPolicy("domLineBreaksComputer",{createHTML:e=>e});class RL{static create(){return new RL}constructor(){}createLineBreaksComputer(e,t,i,n){t|=0,i=+i;let o=[];return{addRequest:(e,t)=>{o.push(e)},finalize:()=>PL(o,e,t,i,n)}}}function PL(e,t,i,n,o){var s;if(-1===n){const t=[];for(let i=0,n=e.length;ir?(s=0,a=0):f=r-e}const m=n.substr(s),p=FL(m,a,i,f,l);c[v]=s,d[v]=a,h[v]=m,u[v]=p[0],g[v]=p[1]}const f=l.build(),m=null!==(s=null===AL||void 0===AL?void 0:AL.createHTML(f))&&void 0!==s?s:f;a.innerHTML=m,a.style.position="absolute",a.style.top="10000",a.style.wordWrap="break-word",document.body.appendChild(a);let p=document.createRange();const _=Array.prototype.slice.call(a.children,0);let b=[];for(let v=0;v');const s=e.length;let r=t,a=0,l=[],c=[],d=0");for(let h=0;h"),l[h]=a,c[h]=r;const t=d;d=h+1"),l[e.length]=a,c[e.length]=r,o.appendASCIIString(""),[l,c]}function WL(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{BL(e,o,n,0,null,i.length-1,null,s)}catch(r){return console.log(r),null}return 0===s.length?null:(s.push(i.length),s)}function BL(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||VL(e,t,i[n],i[n+1]),r=r||VL(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,c=VL(e,t,i[l],i[l+1]);BL(e,t,i,n,o,l,c,a),BL(e,t,i,l,c,s,r,a)}function VL(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 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},zL=function(e,t){return function(i,n){t(i,n,e)}};let UL=0;class KL{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){Ae(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let jL=class e extends We{constructor(e,t,i,n,o,s,r,a,l,c){super(),this._onDidDispose=this._register(new Ye),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new Ye),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new Ye),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new Ye),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new Ye),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new Ye),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeConfiguration=this._register(new Ye),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new Ye),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new Ye),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new Ye),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Ye),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new Ye),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new qL),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new qL),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Ye),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Ye),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Ye),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Ye),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Ye),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Ye),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Ye),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Ye),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Ye),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Ye),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onContextMenu=this._register(new Ye),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Ye),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Ye),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Ye),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Ye),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Ye),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new Ye),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new Ye),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new Ye),this.onDidChangeViewZones=this._onDidChangeViewZones.event;const d=Object.assign({},t);let h;this._domElement=e,this._overflowWidgetsDomNode=d.overflowWidgetsDomNode,delete d.overflowWidgetsDomNode,this._id=++UL,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this.isSimpleWidget=i.isSimpleWidget||!1,this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(d,c)),this._register(this._configuration.onDidChange(e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(124)){const e=t.get(124);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(r.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=s,this._themeService=a,this._register(new $L(this,this._contextKeyService)),this._register(new GL(this,this._contextKeyService)),this._instantiationService=n.createChild(new wL([Cf,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new YL(e),this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}),this._contentWidgets={},this._overlayWidgets={},h=Array.isArray(i.contributions)?i.contributions:Jf.getEditorContributions();for(const g of h)try{const e=this._instantiationService.createInstance(g.ctor,this);this._contributions[g.id]=e}catch(u){ve(u)}Jf.getEditorActions().forEach(e=>{const t=new Yx(e.id,e.label,e.alias,Vs(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 jg(this.isSimpleWidget,e,this._domElement,t)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return mr.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;tli.lift(e)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Mb.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(!ai.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(!li.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 li(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(!ai.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new li(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=ci.isISelection(e),i=li.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 ci(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 li(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(!li.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(li.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._replacePreviousChar(e,t.text||"",t.replaceCharCnt||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,ve):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._commandService.executeCommand(t,i))}_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))}_replacePreviousChar(e,t,i){this._modelData&&this._modelData.viewModel.replacePreviousChar(t,i,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 li(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=Jf.getEditorCommand(t);return!!n&&(i=i||{},i.source=e,this._instantiationService.invokeFunction(e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,ve)}),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(75)&&(this._modelData.model.pushStackElement(),!0))}popUndoStop(){return!!this._modelData&&(!this._configuration.options.get(75)&&(this._modelData.model.popStackElement(),!0))}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(75))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,ee(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(){const e=this._configuration.options,t=e.get(124);return t}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(124),s=e._getVerticalOffsetForPosition(this._modelData,i.lineNumber,i.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(i.lineNumber,i.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft();return{top:s,left:r,height:n.get(53)}}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){jg.applyFontInfoSlow(e,this._configuration.options.get(38))}_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 vL(this._id,this._configuration,e,RL.create(),kL.create(this._configuration.options),e=>oo(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(o("cursors.maximum","The number of cursors has been limited to {0}.",$x.MAX_CURSOR_COUNT));const t=[];for(let o=0,s=e.selections.length;o{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},replacePreviousChar:(e,t)=>{this._replacePreviousChar("keyboard",e,t)},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)},replacePreviousChar:(e,t)=>{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 _y(e.coordinatesConverter);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);const n=new mx(t,this._configuration,this._themeService,e,i,this._overflowWidgetsDomNode);return[n,!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}};jL=HL([zL(3,Yi),zL(4,Ji),zL(5,Hs),zL(6,Cf),zL(7,kf),zL(8,Yu),zL(9,CL)],jL);class qL extends We{constructor(){super(),this._onDidChangeToTrue=this._register(new Ye),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new Ye),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 $L extends We{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=iy.editorSimpleInput.bindTo(t),this._editorFocus=iy.focus.bindTo(t),this._textInputFocus=iy.textInputFocus.bindTo(t),this._editorTextFocus=iy.editorTextFocus.bindTo(t),this._editorTabMovesFocus=iy.tabMovesFocus.bindTo(t),this._editorReadonly=iy.readOnly.bindTo(t),this._inDiffEditor=iy.inDiffEditor.bindTo(t),this._editorColumnSelection=iy.columnSelection.bindTo(t),this._hasMultipleSelections=iy.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=iy.hasNonEmptySelection.bindTo(t),this._canUndo=iy.canUndo.bindTo(t),this._canRedo=iy.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(123)),this._editorReadonly.set(e.get(75)),this._inDiffEditor.set(e.get(49)),this._editorColumnSelection.set(e.get(15))}_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 GL extends We{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this._langId=iy.languageId.bindTo(t),this._hasCompletionItemProvider=iy.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=iy.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=iy.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=iy.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=iy.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=iy.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=iy.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=iy.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=iy.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=iy.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=iy.hasReferenceProvider.bindTo(t),this._hasRenameProvider=iy.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=iy.hasSignatureHelpProvider.bindTo(t),this._hasInlineHintsProvider=iy.hasInlineHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=iy.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=iy.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=iy.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=iy.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=iy.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(ka.onDidChange(i)),this._register(Wa.onDidChange(i)),this._register(Pa.onDidChange(i)),this._register(Ma.onDidChange(i)),this._register(Oa.onDidChange(i)),this._register(Aa.onDidChange(i)),this._register(Ra.onDidChange(i)),this._register(Da.onDidChange(i)),this._register(Ia.onDidChange(i)),this._register(Na.onDidChange(i)),this._register(xa.onDidChange(i)),this._register(La.onDidChange(i)),this._register(Ba.onDidChange(i)),this._register(Va.onDidChange(i)),this._register(Ea.onDidChange(i)),this._register(Fa.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(ka.has(e)),this._hasCodeActionsProvider.set(Wa.has(e)),this._hasCodeLensProvider.set(Pa.has(e)),this._hasDefinitionProvider.set(Ma.has(e)),this._hasDeclarationProvider.set(Oa.has(e)),this._hasImplementationProvider.set(Aa.has(e)),this._hasTypeDefinitionProvider.set(Ra.has(e)),this._hasHoverProvider.set(Da.has(e)),this._hasDocumentHighlightProvider.set(Ia.has(e)),this._hasDocumentSymbolProvider.set(Na.has(e)),this._hasReferenceProvider.set(xa.has(e)),this._hasRenameProvider.set(La.has(e)),this._hasSignatureHelpProvider.set(Ea.has(e)),this._hasInlineHintsProvider.set(Fa.has(e)),this._hasDocumentFormattingProvider.set(Ba.has(e)||Va.has(e)),this._hasDocumentSelectionFormattingProvider.set(Va.has(e)),this._hasMultipleDocumentFormattingProvider.set(Ba.all(e).length+Va.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(Va.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===zn.walkThroughSnippet)}):this.reset()}}class YL extends We{constructor(e){super(),this._onChange=this._register(new Ye),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Uo(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 XL=encodeURIComponent("");function QL(e){return XL+encodeURIComponent(e.toString())+ZL}const JL=encodeURIComponent('');function tk(e){return JL+encodeURIComponent(e.toString())+ek}Af((e,t)=>{const i=e.getColor(jv);i&&t.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${i}; }`);const n=e.getColor(Kv);n&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${QL(n)}") repeat-x bottom left; }`);const o=e.getColor(Uv);o&&t.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${o}; }`);const s=e.getColor(Gv);s&&t.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${s}; }`);const r=e.getColor($v);r&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${QL(r)}") repeat-x bottom left; }`);const a=e.getColor(qv);a&&t.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=e.getColor(Zv);l&&t.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const c=e.getColor(Xv);c&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${QL(c)}") repeat-x bottom left; }`);const d=e.getColor(Yv);d&&t.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${d}; }`);const h=e.getColor(Jv);h&&t.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${h}; }`);const u=e.getColor(Qv);u&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${tk(u)}") no-repeat bottom left; }`);const g=e.getColor(LC);g&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${g.rgba.a}; }`);const f=e.getColor(xC);f&&t.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${f}; }`);const m=e.getColor(tw)||"inherit";t.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${m}}`)});i("7115"),i("c901");const ik=!1;var nk;(function(e){e["North"]="north",e["South"]="south",e["East"]="east",e["West"]="west"})(nk||(nk={}));let ok=4;const sk=new Ye;class rk extends We{constructor(e,t,i){super(),this._state=3,this._onDidEnablementChange=this._register(new Ye),this.onDidEnablementChange=this._onDidEnablementChange.event,this._onDidStart=this._register(new Ye),this.onDidStart=this._onDidStart.event,this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._onDidReset=this._register(new Ye),this.onDidReset=this._onDidReset.event,this._onDidEnd=this._register(new Ye),this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.orthogonalStartSashDisposables=this._register(new Fe),this.orthogonalEndSashDisposables=this._register(new Fe),this.el=Ko(e,Yo(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add("orthogonal-edge-"+i.orthogonalEdge),s["f"]&&this.el.classList.add("mac"),this._register(_n(this.el,"mousedown")(this.onMouseDown,this)),this._register(_n(this.el,"dblclick")(this.onMouseDoubleClick,this)),this._register(gm.addTarget(this.el)),this._register(_n(this.el,hm.Start)(this.onTouchStart,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=ok,this._register(sk.event(e=>{this.size=e,this.layout()}))),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",ik),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){this.orthogonalStartSashDisposables.clear(),e?(this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange,this)),this.onOrthogonalStartSashEnablementChange(e.state)):this.onOrthogonalStartSashEnablementChange(0),this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){this.orthogonalEndSashDisposables.clear(),e?(this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange,this)),this.onOrthogonalEndSashEnablementChange(e.state)):this.onOrthogonalEndSashEnablementChange(0),this._orthogonalEndSash=e}onMouseDown(e){Bo.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=[...es("iframe"),...es("webview")];for(const s of i)s.style.pointerEvents="none";const n=new Tn(e),o=n.posx,r=n.posy,a=n.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=To(this.el),d=()=>{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",c.textContent=`* { cursor: ${e} !important; }`},h=new Fe;d(),t||this.onDidEnablementChange(d,null,h);const u=e=>{Bo.stop(e,!1);const t=new Tn(e),i={startX:o,currentX:t.posx,startY:r,currentY:t.posy,altKey:a};this._onDidChange.fire(i)},g=e=>{Bo.stop(e,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const t of i)t.style.pointerEvents="auto"};_n(window,"mousemove")(u,null,h),_n(window,"mouseup")(g,null,h)}onMouseDoubleClick(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}onTouchStart(e){Bo.stop(e);const t=[],i=e.pageX,n=e.pageY,o=e.altKey;this._onDidStart.fire({startX:i,currentX:i,startY:n,currentY:n,altKey:o}),t.push(Zn(this.el,hm.Change,e=>{Ns(e.pageX)&&Ns(e.pageY)&&this._onDidChange.fire({startX:i,currentX:e.pageX,startY:n,currentY:e.pageY,altKey:o})})),t.push(Zn(this.el,hm.End,e=>{this._onDidEnd.fire(),Ae(t)}))}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")}onOrthogonalStartSashEnablementChange(e){this.el.classList.toggle("orthogonal-start",0!==e)}onOrthogonalEndSashEnablementChange(e){this.el.classList.toggle("orthogonal-end",0!==e)}getOrthogonalSash(e){if(0===this.orientation){if(e.offsetY<=this.size)return this.orthogonalStartSash;if(e.offsetY>=this.el.clientHeight-this.size)return this.orthogonalEndSash}else{if(e.offsetX<=this.size)return this.orthogonalStartSash;if(e.offsetX>=this.el.clientWidth-this.size)return this.orthogonalEndSash}}dispose(){super.dispose(),this.el.remove()}}class ak{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const lk=[];function ck(e,t,i){lk.push([e,new ak(t,[],i)])}function dk(){return lk}const hk=Zi("IEditorCancelService"),uk=new wf("cancellableOperation",!1);ck(hk,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext(e=>{const t=uk.bindTo(e.get(Cf)),i=new ze;return{key:t,tokens:i}}),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);Xf(new class extends Gf{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:uk})}runEditorCommand(e,t){e.get(hk).cancel(t)}});class gk{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 gk(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)}}i("c6b4"),i("154c");const fk={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:"text/plain"};class mk{constructor(e){this.data=e}update(){}getData(){return this.data}}const pk={CurrentDragAndDropData:void 0};class _k extends We{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof $g&&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 Gg)),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(gm.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,cn&&this._register(Zn(e,Wo.DRAG_START,e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(fk.TEXT,this._action.label)}))),this._register(Zn(t,hm.Tap,e=>this.onClick(e))),this._register(Zn(t,Wo.MOUSE_DOWN,e=>{i||Bo.stop(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")})),s["f"]&&this._register(Zn(t,Wo.CONTEXT_MENU,e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)})),this._register(Zn(t,Wo.CLICK,e=>{Bo.stop(e,!0),this.options&&this.options.isMenu||s["k"](()=>this.onClick(e))})),this._register(Zn(t,Wo.DBLCLICK,e=>{Bo.stop(e,!0)})),[Wo.MOUSE_UP,Wo.MOUSE_OUT].forEach(e=>{this._register(Zn(t,e,e=>{Bo.stop(e),t.classList.remove("active")}))})}onClick(e){var t;Bo.stop(e,!0);const i=Ms(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.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.classList.remove("focused"))}updateEnabled(){}updateLabel(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),super.dispose()}}class bk extends _k{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=Ko(this.element,Yo("a.action-label"))),this.label&&(this._action.id===Yg.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&&(Ko(this.element,Yo("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){super.focus(),this.label&&this.label.focus()}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({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.label.tabIndex=0),this.element&&this.element.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled"),Jo(this.label)),this.element&&this.element.classList.add("disabled"))}updateChecked(){this.label&&(this.getAction().checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}class vk extends We{constructor(e,t={}){var i,n,o,s,r,a;let l,c;switch(super(),this.triggerKeyDown=!1,this._onDidBlur=this._register(new Ye),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new Ye({onFirstListenerAdd:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new Ye),this.onDidRun=this._onDidRun.event,this._onBeforeRun=this._register(new Ye),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!==(s=null===(o=this.options.triggerKeys)||void 0===o?void 0:o.keyDown)&&void 0!==s&&s,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Gg,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:l=this.options.ignoreOrientationForPreviousAndNextKey?[15,16]:[15],c=this.options.ignoreOrientationForPreviousAndNextKey?[17,18]:[17];break;case 1:l=this.options.ignoreOrientationForPreviousAndNextKey?[17,18]:[17],c=this.options.ignoreOrientationForPreviousAndNextKey?[15,16]:[15],this.domNode.className+=" reverse";break;case 2:l=this.options.ignoreOrientationForPreviousAndNextKey?[15,16]:[16],c=this.options.ignoreOrientationForPreviousAndNextKey?[17,18]:[18],this.domNode.className+=" vertical";break;case 3:l=this.options.ignoreOrientationForPreviousAndNextKey?[17,18]:[18],c=this.options.ignoreOrientationForPreviousAndNextKey?[15,16]:[16],this.domNode.className+=" vertical reverse";break}this._register(Zn(this.domNode,Wo.KEY_DOWN,e=>{const t=new Ln(e);let i=!0;l&&(t.equals(l[0])||t.equals(l[1]))?i=this.focusPrevious():c&&(t.equals(c[0])||t.equals(c[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())})),this._register(Zn(this.domNode,Wo.KEY_UP,e=>{const t=new Ln(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(Uo(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{Io()!==this.domNode&&xo(Io(),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=Ns(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(Zn(i,Wo.CONTEXT_MENU,e=>{Bo.stop(e,!0)})),this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e)),o||(o=new bk(this.context,e,t)),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),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++)}),this.focusedItem&&this.focus(this.focusedItem)}clear(){Ae(this.viewItems),this.viewItems=[],this._actionIds=[],Gn(this.actionsList)}focus(e){let t=!1,i=void 0;if(void 0===e?t=!0:"number"===typeof e?i=e:"boolean"===typeof e&&(t=e),t&&"undefined"===typeof this.focusedItem){const e=this.viewItems.findIndex(e=>e.isEnabled());this.focusedItem=-1===e?void 0:e,this.updateFocus()}else void 0!==i&&(this.focusedItem=i),this.updateFocus()}focusNext(){"undefined"===typeof this.focusedItem&&(this.focusedItem=this.viewItems.length-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&&!t.isEnabled());return this.focusedItem!==e||t.isEnabled()||(this.focusedItem=void 0),this.updateFocus(),!0}focusPrevious(){"undefined"===typeof this.focusedItem&&(this.focusedItem=0);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&&!t.isEnabled());return this.focusedItem!==e||t.isEnabled()||(this.focusedItem=void 0),this.updateFocus(!0),!0}updateFocus(e,t){"undefined"===typeof this.focusedItem&&this.actionsList.focus({preventScroll:t});for(let i=0;ie.id.localeCompare(t.id),t=e=>{while(Df.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 o of n.filter(e=>!!e.description).sort(e))i.push(`||${o.id}|${Df.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(e=>!Df.isThemeIcon(e.defaults)).sort(e))i.push(`||${o.id}|`);return i.join("\n")}}const yk=new Ck;function Sk(e,t,i,n){return yk.registerIcon(e,t,i,n)}function xk(){return yk}function Lk(){for(const e of fa.all)yk.registerIcon(e.id,e.definition,e.description);fa.onDidRegister(e=>yk.registerIcon(e.id,e.definition,e.description))}Ah.add(wk.IconContribution,yk),Lk();const kk="vscode://schemas/icons";let Ek=Ah.as(Rh.JSONContribution);Ek.registerSchema(kk,yk.getIconSchema());const Dk=new Vn(()=>Ek.notifySchemaChanged(kk),200);yk.onDidChange(()=>{Dk.isScheduled()||Dk.schedule()});Sk("widget-close",pa.close,o("widgetClose","Icon for the close action in widgets."));var Nk;const Ik=3;class Tk{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 Mk{constructor(e){this.entries=e}}const Ok=Sk("diff-review-insert",pa.add,o("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),Ak=Sk("diff-review-remove",pa.remove,o("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),Rk=Sk("diff-review-close",pa.close,o("diffReviewCloseIcon","Icon for 'Close' in diff review."));class Pk extends We{constructor(e){super(),this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=am(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=am(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new vk(this.actionBarContainer.domNode)),this._actionBar.push(new $g("diffreview.close",o("label.close","Close"),"close-diff-review "+Df.asClassName(Rk),!0,()=>(this.hide(),Promise.resolve(null))),{label:!1,icon:!0}),this.domNode=am(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=am(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new hS(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(eo(this.domNode.domNode,"click",e=>{e.preventDefault();let t=Lo(e.target,"diff-review-row");t&&this._goToRow(t)})),this._register(eo(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[l-1];n=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let s=t-Ik+1,c=i-Ik+1;if(ss){const e=s-m;m+=e,p+=e}if(p>f){const e=f-p;m+=e,p+=e}u[g++]=new Tk(n,m,o,p)}n[o++]=new Mk(u)}let s=n[0].entries,r=[],a=0;for(let l=1,c=n.length;lh)&&(h=i),0!==n&&(0===u||ng)&&(g=s)}let f=document.createElement("div");f.className="diff-review-row";let m=document.createElement("div");m.className="diff-review-cell diff-review-summary";const p=h-d+1,_=g-u+1;m.appendChild(document.createTextNode(`${a+1}/${this._diffs.length}: @@ -${d},${p} +${u},${_} @@`)),f.setAttribute("data-line",String(u));const b=e=>0===e?o("no_lines_changed","no lines changed"):1===e?o("one_line_changed","1 line changed"):o("more_lines_changed","{0} lines changed",e),v=b(p),w=b(_);f.setAttribute("aria-label",o({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}",a+1,this._diffs.length,d,v,u,w)),f.appendChild(m),f.setAttribute("role","listitem"),c.appendChild(f);const C=t.get(53);let y=u;for(let o=0,S=l.length;oe}),Af((e,t)=>{const i=e.getColor(_C);i&&t.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${i}; }`);const n=e.getColor(Wv);n&&t.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${n} 0 -6px 6px -6px inset; }`)});class Fk extends Yf{constructor(){super({id:"editor.action.diffReview.next",label:o("editor.action.diffReview.next","Go to Next Difference"),alias:"Go to Next Difference",precondition:tf.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=Bk(e);i&&i.diffReviewNext()}}class Wk extends Yf{constructor(){super({id:"editor.action.diffReview.prev",label:o("editor.action.diffReview.prev","Go to Previous Difference"),alias:"Go to Previous Difference",precondition:tf.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=Bk(e);i&&i.diffReviewPrev()}}function Bk(e){const t=e.get(Ji),i=t.listDiffEditors(),n=t.getActiveCodeEditor();if(!n)return null;for(let o=0,s=i.length;on.modifiedStartLineNumber?o("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):o("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"),void 0,!0,()=>zk(this,void 0,void 0,(function*(){const e=new li(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),t=n.originalModel.getValueInRange(e);yield this._clipboardService.writeText(t)}))));let d=0,h=void 0;n.originalEndLineNumber>n.modifiedStartLineNumber&&(h=new $g("diff.clipboard.copyDeletedLineContent",o("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber),void 0,!0,()=>zk(this,void 0,void 0,(function*(){const e=n.originalModel.getLineContent(n.originalStartLineNumber+d);yield this._clipboardService.writeText(e)}))),c.push(h));const u=i.getOption(75);u||c.push(new $g("diff.inline.revertChange",o("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>zk(this,void 0,void 0,(function*(){const e=new li(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 li(n.modifiedStartLineNumber,e,n.modifiedStartLineNumber,e),text:l+t}])}else{const e=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new li(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,e),text:t}])}}))));const g=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(h&&(h.label=o("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+d)),c),autoSelectFirstItem:!0})};this._register(eo(this._diffActions,"mousedown",e=>{const{top:t,height:i}=bo(this._diffActions);let n=Math.floor(a/3);e.preventDefault(),g(e.posx,t+i+n)})),this._register(i.onMouseMove(e=>{if(8===e.target.type||5===e.target.type){const t=e.target.detail.viewZoneId;t===this._viewZoneId?(this.visibility=!0,d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,a)):this.visibility=!1}else this.visibility=!1})),this._register(i.onMouseDown(e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){const t=e.target.detail.viewZoneId;t===this._viewZoneId&&(e.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,a),g(e.event.posx,e.event.posy+a))}}))}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}=bo(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=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},Yk=function(e,t){return function(i,n){t(i,n,e)}};class Xk{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter(e=>!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?gk.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 tE=class e extends We{constructor(t,i,n,o,s,r,a,l,c,d,h,u){super(),this._editorProgressService=u,this._onDidDispose=this._register(new Ye),this.onDidDispose=this._onDidDispose.event,this._onDidUpdateDiff=this._register(new Ye),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new Ye),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._editorWorkerService=s,this._codeEditorService=l,this._contextKeyService=this._register(r.createScoped(t)),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=c,this._notificationService=d,this._id=++Zk,this._state=0,this._updatingDiffProgress=null,this._domElement=t,i=i||{},this._renderSideBySide=!0,"undefined"!==typeof i.renderSideBySide&&(this._renderSideBySide=i.renderSideBySide),this._maxComputationTime=5e3,"undefined"!==typeof i.maxComputationTime&&(this._maxComputationTime=i.maxComputationTime),this._ignoreTrimWhitespace=!0,"undefined"!==typeof i.ignoreTrimWhitespace&&(this._ignoreTrimWhitespace=i.ignoreTrimWhitespace),this._renderIndicators=!0,"undefined"!==typeof i.renderIndicators&&(this._renderIndicators=i.renderIndicators),this._originalIsEditable=w(i.originalEditable,!1),this._diffCodeLens=w(i.diffCodeLens,!1),this._diffWordWrap=hE(i.diffWordWrap,"inherit"),"undefined"!==typeof i.isInEmbeddedEditor?this._contextKeyService.createKey("isInEmbeddedDiffEditor",i.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._renderOverviewRuler=!0,"undefined"!==typeof i.renderOverviewRuler&&(this._renderOverviewRuler=Boolean(i.renderOverviewRuler)),this._updateDecorationsRunner=this._register(new Vn(()=>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=am(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(eo(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 Xk(h,o),this._modifiedEditorState=new Xk(h,o),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new Hg(this._containerDomElement,i.dimension,()=>this._onDidContainerSizeChanged())),i.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null;const g=this._contextKeyService.createScoped(),f=new wL;f.set(Cf,g);const m=a.createChild(f),p=this._contextKeyService.createScoped(),_=new wL;_.set(Cf,p);const b=a.createChild(_);this._originalEditor=this._createLeftHandSideEditor(i,n.originalEditor||{},m,g),this._modifiedEditor=this._createRightHandSideEditor(i,n.modifiedEditor||{},b,p),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=new Pk(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,"undefined"!==typeof i.enableSplitViewResizing&&(this._enableSplitViewResizing=i.enableSplitViewResizing),this._renderSideBySide?this._setStrategy(new aE(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new cE(this._createDataSource(),this._enableSplitViewResizing)),this._register(c.onDidColorThemeChange(t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide)}));const v=Jf.getDiffEditorContributions();for(const e of v)try{this._register(a.createInstance(e.ctor,this))}catch(C){ve(C)}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+=If(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,n,o){const s=this._createInnerEditor(n,this._originalDomNode,this._adjustOptionsForLeftHandSide(t),i);this._register(s.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(s.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(s.onDidChangeConfiguration(e=>{s.getModel()&&(e.hasChanged(38)&&this._updateDecorationsRunner.schedule(),e.hasChanged(125)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(s.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}));const r=o.createKey("isInDiffLeftEditor",void 0);return this._register(s.onDidFocusEditorWidget(()=>r.set(!0))),this._register(s.onDidBlurEditorWidget(()=>r.set(!1))),this._register(s.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})})),s}_createRightHandSideEditor(t,i,n,o){const s=this._createInnerEditor(n,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t),i);this._register(s.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(s.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(s.onDidChangeConfiguration(e=>{s.getModel()&&(e.hasChanged(38)&&this._updateDecorationsRunner.schedule(),e.hasChanged(125)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(s.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})),this._register(s.onDidChangeModelOptions(e=>{e.tabSize&&this._updateDecorationsRunner.schedule()}));const r=o.createKey("isInDiffRightEditor",void 0);return this._register(s.onDidFocusEditorWidget(()=>r.set(!0))),this._register(s.onDidBlurEditorWidget(()=>r.set(!1))),this._register(s.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})})),s}_createInnerEditor(e,t,i,n){return e.createInstance(jL,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 mr.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(t){let i=!1;"undefined"!==typeof t.renderSideBySide&&this._renderSideBySide!==t.renderSideBySide&&(this._renderSideBySide=t.renderSideBySide,i=!0),"undefined"!==typeof t.maxComputationTime&&(this._maxComputationTime=t.maxComputationTime,this._isVisible&&this._beginUpdateDecorationsSoon());let n=!1;"undefined"!==typeof t.ignoreTrimWhitespace&&this._ignoreTrimWhitespace!==t.ignoreTrimWhitespace&&(this._ignoreTrimWhitespace=t.ignoreTrimWhitespace,n=!0),"undefined"!==typeof t.renderIndicators&&this._renderIndicators!==t.renderIndicators&&(this._renderIndicators=t.renderIndicators,n=!0),n&&this._beginUpdateDecorations(),this._originalIsEditable=w(t.originalEditable,this._originalIsEditable),this._diffCodeLens=w(t.diffCodeLens,this._diffCodeLens),this._diffWordWrap=hE(t.diffWordWrap,this._diffWordWrap),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t)),"undefined"!==typeof t.enableSplitViewResizing&&(this._enableSplitViewResizing=t.enableSplitViewResizing),this._strategy.setEnableSplitViewResizing(this._enableSplitViewResizing),i&&(this._renderSideBySide?this._setStrategy(new aE(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new cE(this._createDataSource(),this._enableSplitViewResizing)),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide)),"undefined"!==typeof 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(){const e=this._originalEditor.saveViewState(),t=this._modifiedEditor.saveViewState();return{original:e,modified:t}}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,o=this._modifiedEditor.getLayoutInfo();o&&(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(o("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=t.scrollbar||{},t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap||(t.minimap={}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._renderSideBySide?t.wordWrapOverride1=this._diffWordWrap:t.wordWrapOverride1="off",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 i.wordWrapOverride1=this._diffWordWrap,i.revealHorizontalRightPadding=pe.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,r=Math.max(0,Math.floor(e.height*s)),a=Math.floor(t*s);return{height:r,top:a}}_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}};tE.ONE_OVERVIEW_WIDTH=15,tE.ENTIRE_DIFF_OVERVIEW_WIDTH=30,tE.UPDATE_DIFF_DECORATIONS_DELAY=200,tE=Gk([Yk(3,Kk),Yk(4,il),Yk(5,Cf),Yk(6,Yi),Yk(7,Ji),Yk(8,kf),Yk(9,Yu),Yk(10,Hk),Yk(11,qk)],tE);class iE extends We{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=(e.getColor(bw)||pw).transparent(2),i=(e.getColor(vw)||_w).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 nE{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._indexe.afterLineNumber-t.afterLineNumber,p=(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)},_=new nE(this._modifiedForeignVZ),b=new nE(this._originalForeignVZ);let v=1,w=1;for(let C=0,y=this._lineChanges.length;C<=y;C++){const i=C0?-1:0),u=i.modifiedStartLineNumber+(i.modifiedEndLineNumber>0?-1:0),d=i.originalEndLineNumber>0?oE._getViewLineCount(this._originalEditor,i.originalStartLineNumber,i.originalEndLineNumber):0,c=i.modifiedEndLineNumber>0?oE._getViewLineCount(this._modifiedEditor,i.modifiedStartLineNumber,i.modifiedEndLineNumber):0,g=Math.max(i.originalStartLineNumber,i.originalEndLineNumber),f=Math.max(i.modifiedStartLineNumber,i.modifiedEndLineNumber)):(h+=1e7+d,u+=1e7+c,g=h,f=u);let n=[],S=[];if(o){let e;e=i?i.originalEndLineNumber>0?i.originalStartLineNumber-v:i.modifiedStartLineNumber-w:s.getLineCount()-v;for(let t=0;ts&&S.push({afterLineNumber:i,heightInLines:o-s,domNode:null,marginDomNode:null})}i&&(v=(i.originalEndLineNumber>0?i.originalEndLineNumber:i.originalStartLineNumber)+1,w=(i.modifiedEndLineNumber>0?i.modifiedEndLineNumber:i.modifiedStartLineNumber)+1)}while(_.current&&_.current.afterLineNumber<=f){let e;e=_.current.afterLineNumber<=u?h-u+_.current.afterLineNumber:g;let o=null;i&&i.modifiedStartLineNumber<=_.current.afterLineNumber&&_.current.afterLineNumber<=i.modifiedEndLineNumber&&(o=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),n.push({afterLineNumber:e,heightInLines:_.current.height/t,domNode:null,marginDomNode:o}),_.advance()}while(b.current&&b.current.afterLineNumber<=g){let t;t=b.current.afterLineNumber<=h?u-h+b.current.afterLineNumber:f,S.push({afterLineNumber:t,heightInLines:b.current.height/e,domNode:null}),b.advance()}if(null!==i&&uE(i)){const e=this._produceOriginalFromDiff(i,d,c);e&&n.push(e)}if(null!==i&&gE(i)){const e=this._produceModifiedFromDiff(i,d,c);e&&S.push(e)}let x=0,L=0;n=n.sort(m),S=S.sort(m);while(x=t.heightInLines?(e.heightInLines-=t.heightInLines,L++):(t.heightInLines-=e.heightInLines,x++)}while(x(e.domNode||(e.domNode=fE()),e))}}function sE(e,t,i,n,o){return{range:new li(e,t,i,n),options:o}}const rE={charDelete:_b.register({className:"char-delete"}),charDeleteWholeLine:_b.register({className:"char-delete",isWholeLine:!0}),charInsert:_b.register({className:"char-insert"}),charInsertWholeLine:_b.register({className:"char-insert",isWholeLine:!0}),lineInsert:_b.register({className:"line-insert",marginClassName:"line-insert",isWholeLine:!0}),lineInsertWithSign:_b.register({className:"line-insert",linesDecorationsClassName:"insert-sign "+Df.asClassName(Qk),marginClassName:"line-insert",isWholeLine:!0}),lineDelete:_b.register({className:"line-delete",marginClassName:"line-delete",isWholeLine:!0}),lineDeleteWithSign:_b.register({className:"line-delete",linesDecorationsClassName:"delete-sign "+Df.asClassName(Jk),marginClassName:"line-delete",isWholeLine:!0}),lineDeleteMargin:_b.register({marginClassName:"line-delete"})};class aE extends iE{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new rk(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(),i=t-(this._dataSource.getOptions().renderOverviewRuler?tE.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let n=Math.floor((e||.5)*i);const o=Math.floor(.5*i);return n=this._disableSash?o:n||o,i>2*aE.MINIMUM_EDITOR_WIDTH?(ni-aE.MINIMUM_EDITOR_WIDTH&&(n=i-aE.MINIMUM_EDITOR_WIDTH)):n=o,this._sashPosition!==n&&(this._sashPosition=n,this._sash.layout()),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const t=this._dataSource.getWidth(),i=t-(this._dataSource.getOptions().renderOverviewRuler?tE.ENTIRE_DIFF_OVERVIEW_WIDTH:0),n=this.layout((this._startSashPosition+(e.currentX-e.startX))/i);this._sashRatio=n/i,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(),s=new lE(e,t,i,n,o);return s.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 l of e)if(gE(l)){s.decorations.push({range:new li(l.originalStartLineNumber,1,l.originalEndLineNumber,1073741824),options:i?rE.lineDeleteWithSign:rE.lineDelete}),uE(l)&&l.charChanges||s.decorations.push(sE(l.originalStartLineNumber,1,l.originalEndLineNumber,1073741824,rE.charDeleteWholeLine));const e=mE(r,a,l.originalStartLineNumber,l.originalEndLineNumber);if(s.overviewZones.push(new GS(e.startLineNumber,e.endLineNumber,o)),l.charChanges)for(const i of l.charChanges)if(gE(i))if(t)for(let e=i.originalStartLineNumber;e<=i.originalEndLineNumber;e++){let t,n;t=e===i.originalStartLineNumber?i.originalStartColumn:r.getLineFirstNonWhitespaceColumn(e),n=e===i.originalEndLineNumber?i.originalEndColumn:r.getLineLastNonWhitespaceColumn(e),s.decorations.push(sE(e,t,e,n,rE.charDelete))}else s.decorations.push(sE(i.originalStartLineNumber,i.originalStartColumn,i.originalEndLineNumber,i.originalEndColumn,rE.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 l of e)if(uE(l)){s.decorations.push({range:new li(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824),options:i?rE.lineInsertWithSign:rE.lineInsert}),gE(l)&&l.charChanges||s.decorations.push(sE(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824,rE.charInsertWholeLine));const e=mE(r,a,l.modifiedStartLineNumber,l.modifiedEndLineNumber);if(s.overviewZones.push(new GS(e.startLineNumber,e.endLineNumber,o)),l.charChanges)for(const i of l.charChanges)if(uE(i))if(t)for(let e=i.modifiedStartLineNumber;e<=i.modifiedEndLineNumber;e++){let t,n;t=e===i.modifiedStartLineNumber?i.modifiedStartColumn:r.getLineFirstNonWhitespaceColumn(e),n=e===i.modifiedEndLineNumber?i.modifiedEndColumn:r.getLineLastNonWhitespaceColumn(e),s.decorations.push(sE(e,t,e,n,rE.charInsert))}else s.decorations.push(sE(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn,rE.charInsert))}return s}}aE.MINIMUM_EDITOR_WIDTH=100;class lE extends oE{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 cE extends iE{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(),r=new dE(e,t,i,o,s,n);return r.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 l of e)if(gE(l)){o.decorations.push({range:new li(l.originalStartLineNumber,1,l.originalEndLineNumber,1073741824),options:rE.lineDeleteMargin});const e=mE(r,a,l.originalStartLineNumber,l.originalEndLineNumber);o.overviewZones.push(new GS(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 l of e)if(uE(l)){s.decorations.push({range:new li(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824),options:i?rE.lineInsertWithSign:rE.lineInsert});const e=mE(r,a,l.modifiedStartLineNumber,l.modifiedEndLineNumber);if(s.overviewZones.push(new GS(e.startLineNumber,e.endLineNumber,o)),l.charChanges){for(const i of l.charChanges)if(uE(i))if(t)for(let e=i.modifiedStartLineNumber;e<=i.modifiedEndLineNumber;e++){let t,n;t=e===i.modifiedStartLineNumber?i.modifiedStartColumn:r.getLineFirstNonWhitespaceColumn(e),n=e===i.modifiedEndLineNumber?i.modifiedEndColumn:r.getLineLastNonWhitespaceColumn(e),s.decorations.push(sE(e,t,e,n,rE.charInsert))}else s.decorations.push(sE(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn,rE.charInsert))}else s.decorations.push(sE(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824,rE.charInsertWholeLine))}return s}layout(){return Math.max(5,this._decorationsLeft)}}class dE extends oE{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 "+MC;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 r=e.originalStartLineNumber;r<=e.originalEndLineNumber;r++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(r),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(38),o=t.get(26),s=n.typicalHalfwidthCharacterWidth,r=t.get(88),a=this._originalModel.mightContainNonBasicASCII(),l=this._originalModel.mightContainRTL(),c=t.get(53),d=t.get(124),h=d.decorationsWidth,u=t.get(100),g=t.get(83),f=t.get(77),m=t.get(39),p=this._lineBreaksComputer.finalize();let _=0;for(let b=0;b0,S=El(1e4);let x=0,L=0,k=null;for(let s=t.originalStartLineNumber;s<=t.originalEndLineNumber;s++){const r=s-t.originalStartLineNumber,b=this._originalModel.getLineTokens(s),v=b.getLineContent(),E=p[_++],D=yd.filter(C,s,1,v.length+1);if(E){let t=0;for(const e of E.breakOffsets){const s=b.sliceAndInflate(t,e,0),r=v.substring(t,e);x=Math.max(x,this._renderOriginalLine(L++,r,s,yd.extractWrapped(D,t,e),y,a,l,n,o,c,h,u,g,f,m,i,S,w)),t=e}k||(k=[]);while(k.lengthe.afterLineNumber-t.afterLineNumber)}_renderOriginalLine(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,m,p,_){p.appendASCIIString('
');const b=qd.isBasicASCII(t,s),v=qd.containsRTL(t,b,r),w=Td(new Dd(a.isMonospace&&!l,a.canUseHalfwidthRightwardsArrow,t,!1,b,v,0,i,n,m,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,h,u,g,f!==F.OFF,null),p);if(p.appendASCIIString("
"),this._renderIndicators){const t=document.createElement("div");t.className="delete-sign "+Df.asClassName(Jk),t.setAttribute("style",`position:absolute;top:${e*c}px;width:${d}px;height:${c}px;right:0;`),_.appendChild(t)}const C=w.characterMapping.getAbsoluteOffsets();return C.length>0?C[C.length-1]:0}}function hE(e,t){return L(e,t,["off","on","inherit"])}function uE(e){return e.modifiedEndLineNumber>0}function gE(e){return e.originalEndLineNumber>0}function fE(){const e=document.createElement("div");return e.className="diagonal-fill",e}function mE(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 li(i,e.getLineMinColumn(i),n,e.getLineMaxColumn(n)))}Af((e,t)=>{const i=e.getColor(bw);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(vw);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(ww);o&&t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${"hc"===e.type?"dashed":"solid"} ${o}; }`);const s=e.getColor(Cw);s&&t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${"hc"===e.type?"dashed":"solid"} ${s}; }`);const r=e.getColor(Wv);r&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${r}; }`);const a=e.getColor(yw);a&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${a}; }`);const l=e.getColor(Bv);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 c=e.getColor(Vv);c&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:hover {\n\t\t\t\tbackground: ${c};\n\t\t\t}\n\t\t`);const d=e.getColor(Hv);d&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:active {\n\t\t\t\tbackground: ${d};\n\t\t\t}\n\t\t`);const h=e.getColor(Sw);t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${h} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${h} 50%, ${h} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)});const pE=Zi("themeService"),_E=Zi("keybindingService");var bE=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},vE=function(e,t){return function(i,n){t(i,n,e)}};let wE=0,CE=!1;function yE(){CE||(CE=!0,Rg(document.body))}let SE=class extends jL{constructor(e,t,i,n,o,s,r,a,l,c){const d=Object.assign({},t);d.ariaLabel=d.ariaLabel||sg.editorViewAccessibleLabel,d.ariaLabel=d.ariaLabel+";"+sg.accessibilityHelpMessage,super(e,d,{},i,n,o,s,a,l,c),this._standaloneKeybindingService=r instanceof bg?r:null,yE()}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_"+ ++wE,o=tf.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"),We.None;const t=e.id,i=e.label,n=tf.and(tf.equals("editorId",this.getId()),tf.deserialize(e.precondition)),o=e.keybindings,s=tf.and(n,tf.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),c=new Fe,d=this.getId()+":"+t;if(c.add(zs.registerCommand(d,l)),r){let e={command:{id:d,title:i},when:n,group:r,order:a};c.add(Hf.appendMenuItem(Bf.EditorContext,e))}if(Array.isArray(o))for(const u of o)c.add(this._standaloneKeybindingService.addDynamicKeybinding(d,u,l,s));let h=new Yx(d,i,i,n,l,this._contextKeyService);return this._actions[t]=h,c.add(Pe(()=>{delete this._actions[t]})),c}};SE=bE([vE(2,Yi),vE(3,Ji),vE(4,Hs),vE(5,Cf),vE(6,_E),vE(7,kf),vE(8,Yu),vE(9,CL)],SE);let xE=class extends SE{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f){const m=Object.assign({},t);Lg(h,m,!1);const p=c.registerEditorContainer(e);"string"===typeof m.theme&&c.setTheme(m.theme);let _,b=m.model;if(delete m.model,super(e,m,n,o,s,r,a,c,d,u),this._contextViewService=l,this._configurationService=h,this._standaloneThemeService=c,this._register(i),this._register(p),"undefined"===typeof b?(_=kE(g,f,m.value||"",m.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){Lg(this._configurationService,e,!1),"string"===typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),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)}};xE=bE([vE(3,Yi),vE(4,Ji),vE(5,Hs),vE(6,Cf),vE(7,_E),vE(8,Vk),vE(9,pE),vE(10,Yu),vE(11,Cu),vE(12,CL),vE(13,aa),vE(14,nl)],xE);let LE=class extends tE{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f){const m=Object.assign({},t);Lg(h,m,!0);const p=c.registerEditorContainer(e);"string"===typeof m.theme&&(m.theme=c.setTheme(m.theme)),super(e,m,{},f,a,o,n,l,c,d,u,g),this._contextViewService=r,this._configurationService=h,this._standaloneThemeService=c,this._register(i),this._register(p),this._contextViewService.setContainer(this._containerDomElement)}dispose(){super.dispose()}updateOptions(e){Lg(this._configurationService,e,!0),"string"===typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(SE,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 kE(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)),EE(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return EE(e,i,t.create(n),o)}function EE(e,t,i,n){return e.createModel(t,i,n)}LE=bE([vE(3,Yi),vE(4,Cf),vE(5,_E),vE(6,Vk),vE(7,il),vE(8,Ji),vE(9,pE),vE(10,Yu),vE(11,Cu),vE(12,Hk),vE(13,qk),vE(14,Kk)],LE);class DE{constructor(e){this._languageIdentifier=e}getId(){return this._languageIdentifier.language}}const NE="text/plain",IE="application/unknown";let TE=[],ME=[],OE=[];function AE(e,t=!1){const i=RE(e);TE.push(i),i.userConfigured?OE.push(i):ME.push(i),t&&!i.userConfigured&&TE.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 RE(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(Ot.sep)>=0}}function PE(e,t){let i;if(e)switch(e.scheme){case zn.file:i=e.fsPath;break;case zn.data:const t=ks.parseMetaData(e);i=t.get(ks.META_DATA_LABEL);break;default:i=e.path}if(!i)return[IE];i=i.toLowerCase();const n=Wt(i),o=FE(i,n,OE);if(o)return[o,NE];const s=FE(i,n,ME);if(s)return[s,NE];if(t){const e=WE(t);if(e)return[e,NE]}return[IE]}function FE(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;ea(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}function WE(e){if(Object(rs["R"])(e)&&(e=e.substr(1)),e.length>0)for(let t=TE.length-1;t>=0;t--){const i=TE[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i.mime}return null}const BE={ModesRegistry:"editor.modesRegistry"};class VE{constructor(){this._onDidChangeLanguages=new Ye,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}});const KE=Object.prototype.hasOwnProperty;class jE extends We{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new Ye),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(HE.onDidChangeLanguages(e=>this._initializeFromRegistry())))}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={};const e=HE.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})}),Ah.as(Bh.Configuration).registerOverrideIdentifiers(HE.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(KE.call(this._languages,t))i=this._languages[t];else{const e=this._getLanguageId(t);i={identifier:new ba(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)AE({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let a of t.filenames)AE({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(let a of t.filenamePatterns)AE({id:i,mime:n,filepattern:a},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);rs["M"](t)||AE({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(r){ve(r)}}e.aliases.push(i);let o=null;if("undefined"!==typeof t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const a of o)a&&0!==a.length&&e.aliases.push(a);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!!KE.call(this._mimeTypesMap,e)||KE.call(this._languages,e)}getModeIdForLanguageNameLowercase(e){return KE.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null}extractModeIds(e){return e?e.split(",").map(e=>e.trim()).map(e=>KE.call(this._mimeTypesMap,e)?this._mimeTypesMap[e].language:e).filter(e=>KE.call(this._languages,e)):[]}getLanguageIdentifier(e){if(e===Za||0===e)return Qa;let t;if("string"===typeof e)t=e;else if(t=this._languageIdToLanguage[e],!t)return null;return KE.call(this._languages,t)?this._languages[t].identifier:null}getModeIdsFromFilepathOrFirstLine(e,t){if(!e&&!t)return[];let i=PE(e,t);return this.extractModeIds(i.join(","))}}class qE extends We{constructor(e,t){super(),this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._selector=t,this.languageIdentifier=this._selector(),this._register(e(()=>this._evaluate()))}_evaluate(){let e=this._selector();e.id!==this.languageIdentifier.id&&(this.languageIdentifier=e,this._onDidChange.fire(this.languageIdentifier))}}class $E extends We{constructor(e=!1){super(),this._onDidCreateMode=this._register(new Ye),this.onDidCreateMode=this._onDidCreateMode.event,this._onLanguagesMaybeChanged=this._register(new Ye),this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,this._instantiatedModes={},this._registry=this._register(new jE(!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 gc(i,null)}getModeId(e){const t=this._registry.extractModeIds(e);return gc(t,null)}getLanguageIdentifier(e){return this._registry.getLanguageIdentifier(e)}create(e){return new qE(this.onLanguagesMaybeChanged,()=>{const t=this.getModeId(e);return this._createModeAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new qE(this.onLanguagesMaybeChanged,()=>{const i=this.getModeIdByFilepathOrFirstLine(e,t);return this._createModeAndGetLanguageIdentifier(i)})}_createModeAndGetLanguageIdentifier(e){const t=this.getLanguageIdentifier(e||"plaintext")||Qa;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)||Qa;this._instantiatedModes[e]=new DE(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]}}const GE=Zi("undoRedoService");class YE{constructor(e,t){this.resource=e,this.elements=t}}class XE{constructor(){this.id=XE._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}XE._ID=0,XE.None=new XE;class ZE{constructor(){this.id=ZE._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}ZE._ID=0,ZE.None=new ZE;class QE{constructor(e,t,i){this._legend=e,this._themeService=t,this._logService=i,this._hashTable=new tD}getMetadata(e,t,i){const n=this._hashTable.get(e,t,i.id);let o;if(n)o=n.metadata,this._logService.getLevel()===td.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${va.getForeground(o)}, fontStyle ${va.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()===td.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);if("undefined"===typeof r)o=2147483647;else{if(o=0,"undefined"!==typeof r.italic){const e=(r.italic?1:0)<<11;o|=1|e}if("undefined"!==typeof r.bold){const e=(r.bold?2:0)<<11;o|=2|e}if("undefined"!==typeof r.underline){const e=(r.underline?4:0)<<11;o|=4|e}if(r.foreground){const e=r.foreground<<14;o|=8|e}0===o&&(o=2147483647)}}else this._logService.getLevel()===td.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()===td.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${n}) / ${t} (${s.join(" ")}): foreground ${va.getForeground(o)}, fontStyle ${va.getFontStyle(o).toString(2)}`)}return o}}function JE(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,c=0;while(ae&&0===n[5*t])t--;if(t-1===e){let e=d;while(e+1=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=tD._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+10?t[0]:null}function hD(e){const t=$a.ordered(e);return t.length>0?t[0]:null}zs.registerCommand("_provideDocumentSemanticTokensLegend",(e,...t)=>rD(void 0,void 0,void 0,(function*(){const[i]=t;Os(i instanceof Xt);const n=e.get(aa).getModel(i);if(!n)return;const o=dD(n);return o?o.getLegend():e.get(Hs).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)}))),zs.registerCommand("_provideDocumentSemanticTokens",(e,...t)=>rD(void 0,void 0,void 0,(function*(){const[i]=t;Os(i instanceof Xt);const n=e.get(aa).getModel(i);if(!n)return;const o=cD(n,null,et.None);if(!o)return e.get(Hs).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const{provider:s,request:r}=o;let a;try{a=yield r}catch(c){return void we(c)}if(!a||!aD(a))return;const l=oD({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l}))),zs.registerCommand("_provideDocumentRangeSemanticTokensLegend",(e,...t)=>rD(void 0,void 0,void 0,(function*(){const[i]=t;Os(i instanceof Xt);const n=e.get(aa).getModel(i);if(!n)return;const o=hD(n);return o?o.getLegend():void 0}))),zs.registerCommand("_provideDocumentRangeSemanticTokens",(e,...t)=>rD(void 0,void 0,void 0,(function*(){const[i,n]=t;Os(i instanceof Xt),Os(li.isIRange(n));const o=e.get(aa).getModel(i);if(!o)return;const s=hD(o);if(!s)return;let r;try{r=yield s.provideDocumentRangeSemanticTokens(o,li.lift(n),et.None)}catch(a){return void we(a)}return r&&aD(r)?oD({id:0,type:"full",data:r.data}):void 0})));var uD=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},gD=function(e,t){return function(i,n){t(i,n,e)}};function fD(e){return e.toString()}function mD(e){const t=new Dr,i=e.createSnapshot();let n;while(n=i.read())t.update(n);return t.digest()}class pD{constructor(e,t,i){this._modelEventListeners=new Fe,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),this._languageSelection&&(this._languageSelection.dispose(),this._languageSelection=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 _D=s["d"]||s["f"]?1:2;class bD{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}}function vD(e){return e.scheme===zn.file||e.scheme===zn.vscodeRemote||e.scheme===zn.userData||"fake-fs"===e.scheme}let wD=class e extends We{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 Ye),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new Ye),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new Ye),this.onModelModeChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new xD(this._themeService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration(()=>this._updateModelOptions())),this._updateModelOptions(),this._register(new SD(this,this._themeService,this._configurationService,this._semanticStyling))}static _readModelOptions(e,t){let i=ge.tabSize;if(e.editor&&"undefined"!==typeof e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(i=t),i<1&&(i=1)}let n=i;if(e.editor&&"undefined"!==typeof e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let o=ge.insertSpaces;e.editor&&"undefined"!==typeof e.editor.insertSpaces&&(o="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let s=_D;const r=e.eol;"\r\n"===r?s=2:"\n"===r&&(s=1);let a=ge.trimAutoWhitespace;e.editor&&"undefined"!==typeof e.editor.trimAutoWhitespace&&(a="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let l=ge.detectIndentation;e.editor&&"undefined"!==typeof e.editor.detectIndentation&&(l="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let c=ge.largeFileOptimizations;return e.editor&&"undefined"!==typeof e.editor.largeFileOptimizations&&(c="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations)),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:o,detectIndentation:l,defaultEOL:s,trimAutoWhitespace:a,largeFileOptimizations:c}}_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===s["a"]||2===s["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=[];this._disposedModels.forEach(e=>{e.sharesUndoRedoStack||t.push(e)}),t.sort((e,t)=>e.time-t.time);while(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 hb(e,o,t,i,this._undoRedoService);if(i&&this._disposedModels.has(fD(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=mD(s)===e.sha1;if(n||e.sharesUndoRedoStack){for(const e of t.past)ip(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)ip(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,e=>ip(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=fD(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new pD(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,UE,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[fD(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)ip(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri));for(const i of e.future)ip(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri))}}const a=e.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(s)if(!o&&r>a){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(t.uri,!1,e=>ip(e)&&e.matchesResource(t.uri)),this._insertDisposedModel(new bD(t.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,r,mD(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})}};wD.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,wD=uD([gD(0,Cu),gD(1,Jc),gD(2,kf),gD(3,ed),gD(4,GE)],wD);const CD="editor.semanticHighlighting";function yD(e,t,i){var n;const o=null===(n=i.getValue(CD,{overrideIdentifier:e.getLanguageIdentifier().language,resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"===typeof o?o:t.getColorTheme().semanticHighlighting}class SD extends We{constructor(e,t,i,n){super(),this._watchers=Object.create(null),this._semanticStyling=n;const o=e=>{this._watchers[e.uri.toString()]=new kD(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()];yD(n,t,i)?e||o(n):e&&s(n,e)}};this._register(e.onModelAdded(e=>{yD(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(CD)&&r()})),this._register(t.onDidColorThemeChange(r))}}class xD extends We{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 QE(e.getLegend(),this._themeService,this._logService)),this._caches.get(e)}}class LD{constructor(e,t,i){this._provider=e,this.resultId=t,this.data=i}dispose(){this._provider.releaseDocumentSemanticTokens(this.resultId)}}class kD extends We{constructor(e,t,i){super(),this._isDisposed=!1,this._model=e,this._semanticStyling=i,this._fetchDocumentSemanticTokens=this._register(new Vn(()=>this._fetchDocumentSemanticTokensNow(),kD.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule()}));const n=()=>{Ae(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of qa.all(e))"function"===typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange(()=>this._fetchDocumentSemanticTokens.schedule(0)))};n(),this._register(qa.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 it,t=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,i=cD(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=>{const t=e&&(Se(e)||"string"===typeof e.message&&-1!==e.message.indexOf("busy"));t||ve(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(lD(t)){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 o of t.edits)e+=(o.data?o.data.length:0)-o.deleteCount;const i=o.data,n=new Uint32Array(i.length+e);let s=i.length,r=n.length;for(let o=t.edits.length-1;o>=0;o--){const e=t.edits[o],a=s-(e.start+e.deleteCount);a>0&&(kD._copy(i,s-a,n,r-a,a),r-=a),e.data&&(kD._copy(e.data,0,n,r-e.data.length,e.data.length),r-=e.data.length),s=e.start}s>0&&kD._copy(i,0,n,0,s),t={resultId:t.resultId,data:n}}}if(aD(t)){this._currentDocumentResponse=new LD(e,t.resultId,t.data);const o=JE(t,i,this._model.getLanguageIdentifier());if(n.length>0)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)}}kD.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY=300;class ED extends We{constructor(){super(),this._onCodeEditorAdd=this._register(new Ye),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new Ye),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new Ye),this._onDiffEditorRemove=this._register(new Ye),this._onDecorationTypeRegistered=this._register(new Ye),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)){const e=this._modelProperties.get(i);return e.get(t)}}}var DD=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},ND=function(e,t){return function(i,n){t(i,n,e)}};class ID{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){const i=this._styleSheet.sheet;i.insertRule(e,t)}removeRulesContainingSelector(e){Po(e,this._styleSheet)}}class TD{constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){const i=this._styleSheet.sheet;i.insertRule(e,t)}removeRulesContainingSelector(e){Po(e,this._styleSheet)}}let MD=class extends ED{constructor(e,t=null){super(),this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._globalStyleSheet=t||null,this._themeService=e}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=new TD(To())),this._globalStyleSheet}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!Do(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const e=new ID(this,i,To(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 OD(this._themeService,s,r):new AD(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)}};MD=DD([ND(0,kf)],MD);class OD{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new PD(3,i,e),this._afterContentRules=new PD(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 AD{constructor(e,t,i){this._disposables=new Fe,this._styleSheet=t,this._styleSheet.ref(),this.refCount=0;const n=t=>{const n=new PD(t,i,e);if(this._disposables.add(n),n.hasContent)return n.className},o=t=>{const n=new PD(t,i,e);return this._disposables.add(n),n.hasContent?{className:n.className,hasLetterSpacing:n.hasLetterSpacing}:null};this.className=n(0);const s=o(1);s&&(this.inlineClassName=s.className,this.inlineClassNameAffectsLetterSpacing=s.hasLetterSpacing),this.beforeContentClassName=n(3),this.afterContentClassName=n(4),this.glyphMarginClassName=n(2);const r=i.options;this.isWholeLine=Boolean(r.isWholeLine),this.stickiness=r.rangeBehavior;const a=r.light&&r.light.overviewRulerColor||r.overviewRulerColor,l=r.dark&&r.dark.overviewRulerColor||r.overviewRulerColor;"undefined"===typeof a&&"undefined"===typeof l||(this.overviewRuler={color:a||l,darkColor:l||a,position:r.overviewRulerLane||pr.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 RD={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 PD{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=FD.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+FD.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=FD.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("undefined"!==typeof e){if(this.collectBorderSettingsCSSText(e,t),"undefined"!==typeof e.contentIconPath&&t.push(rs["v"](RD.contentIconPath,os(Xt.revive(e.contentIconPath)))),"string"===typeof e.contentText){const i=e.contentText.match(/^.*$/m)[0],n=i.replace(/['\\]/g,"\\$&");t.push(rs["v"](RD.contentText,n))}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"undefined"!==typeof e.gutterIconPath&&(t.push(rs["v"](RD.gutterIconPath,os(Xt.revive(e.gutterIconPath)))),"undefined"!==typeof e.gutterIconSize&&t.push(rs["v"](RD.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push(rs["v"]("box-sizing: border-box;")),!0)}collectCSSText(e,t,i){const n=i.length;for(let o of t){const t=this.resolveValue(e[o]);"string"===typeof t&&i.push(rs["v"](RD[o],t))}return i.length!==n}resolveValue(e){if(fr(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}class FD{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}}class WD extends MD{getActiveCodeEditor(){return null}openCodeEditor(e,t,i){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){const i=this.findModel(e,t.resource);if(!i){if(t.resource){const i=t.resource.scheme;if(i===zn.http||i===zn.https)return is(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if("number"===typeof n.endLineNumber&&"number"===typeof n.endColumn)e.setSelection(n),e.revealRangeInCenter(n,1);else{const t={lineNumber:n.startLineNumber,column:n.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}}class BD{constructor(e,t,i,n,o){this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function VD(e){if(!e||!Array.isArray(e))return[];let t=[],i=0;for(let n=0,o=e.length;n{let i=$D(e.token,t.token);return 0!==i?i:e.index-t.index});let i=0,n="000000",o="ffffff";while(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 UD;for(let d of t)s.getId(d);let r=s.getId(n),a=s.getId(o),l=new GD(i,r,a),c=new YD(l);for(let d=0,h=e.length;d>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const jD=/\b(comment|string|regex|regexp)\b/;function qD(e){let t=e.match(jD);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 4;case"regexp":return 4}throw new Error("Unexpected match for standard token type!")}function $D(e,t){return et?1:0}class GD{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 GD(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 YD{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"undefined"!==typeof 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);"undefined"===typeof a&&(a=new YD(this._mainRule.clone()),this._children.set(o,a)),a.insert(s,t,i,n)}}function XD(e){let t=[];for(let i=1,n=e.length;i0?(rN(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,eb.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=aN(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,eb.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);return i||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=nN.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case eN:return Lf.LIGHT;case iN:return Lf.HIGH_CONTRAST;default:return Lf.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let i=aN(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=KD.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")),o=n.metadata,s=va.getForeground(o),r=va.getFontStyle(o);return{foreground:s,italic:Boolean(1&r),bold:Boolean(2&r),underline:Boolean(4&r)}}}function rN(e){return e===eN||e===tN||e===iN}function aN(e){switch(e){case eN:return ZD;case tN:return QD;case iN:return JD}}function lN(e){let t=aN(e);return new sN(e,t)}class cN extends We{constructor(){super(),this._onColorThemeChange=this._register(new Ye),this.onDidColorThemeChange=this._onColorThemeChange.event,this._environment=Object.create(null),this._knownThemes=new Map,this._knownThemes.set(eN,lN(eN)),this._knownThemes.set(tN,lN(tN)),this._knownThemes.set(iN,lN(iN));const e=xk();this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(eN),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})}registerEditorContainer(e){return Do(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=To(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),We.None}_registerShadowDomContainer(e){const t=To(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&&this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;return t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(eN),this._theme===t||(this._theme=t,this._updateThemeOrColorMap()),t.id}_updateThemeOrColorMap(){let e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};oN.getThemingParticipants().forEach(e=>e(this._theme,i,this._environment));const n=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(XD(n)),this._themeCSS=e.join("\n"),this._updateCSS(),Ga.setColorMap(n),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}}var dN=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},hN=function(e,t){return function(i,n){t(i,n,e)}};const uN="data-keybinding-context";class gN{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"undefined"===typeof t&&this._parent?this._parent.getValue(e):t}}class fN extends gN{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}fN.INSTANCE=new fN;class mN extends gN{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=us.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(e=>{if(6===e.source){const e=Array.from(Ee.map(this._values,([e])=>e));this._values.clear(),i.fire(new bN(e))}else{const t=[];for(const i of e.affectedKeys){const e="config."+i,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...Ee.map(n,([e])=>e)),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new bN(t))}})}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(mN._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(mN._keyPrefix.length),i=this._configurationService.getValue(t);let n=void 0;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)}}mN._keyPrefix="config.";class pN{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){"undefined"===typeof this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class _N{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class bN{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class vN{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class wN{constructor(e){this._onDidChangeContext=new Xe({merge:e=>new vN(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 pN(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 yN(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId),i=Au.contextMatchesRules(t,e);return i}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 _N(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new _N(e))}getContext(e){return this._isDisposed?fN.INSTANCE:this.getContextValuesContainer(SN(e))}}let CN=class extends wN{constructor(e){super(0),this._contexts=new Map,this._toDispose=new Fe,this._lastContextId=0;const t=new mN(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?fN.INSTANCE:this._contexts.get(e)||fN.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 gN(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};CN=dN([hN(0,Cu)],CN);class yN extends wN{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new Be,this._parent=e,this._updateParentChangeListener(),t){if(this._domNode=t,this._domNode.hasAttribute(uN)){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(uN,String(this._myContextId))}}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(this._onDidChangeContext.fire,this._onDidChangeContext)}dispose(){var e;this._onDidChangeContext.dispose(),this._isDisposed=!0,this._parent.disposeContext(this._myContextId),null===(e=this._parentChangeListener)||void 0===e||e.dispose(),this._domNode&&(this._domNode.removeAttribute(uN),this._domNode=void 0)}getContextValuesContainer(e){return this._isDisposed?fN.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)}}function SN(e){while(e){if(e.hasAttribute(uN)){const t=e.getAttribute(uN);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}zs.registerCommand(yf,(function(e,t,i){e.get(Cf).createKey(String(t),i)}));var xN,LN;i("1a7b"),i("f743");function kN(e,t,i){const n=i.mode===LN.ALIGN?i.offset:i.offset+i.size,o=i.mode===LN.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){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}function n(e,n){return!i(t(e,n))}function o(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}e.intersect=t,e.isEmpty=i,e.intersects=n,e.relativeComplement=o})(xN||(xN={})),function(e){e[e["AVOID"]=0]="AVOID",e[e["ALIGN"]=1]="ALIGN"}(LN||(LN={}));class EN extends We{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=We.None,this.toDisposeOnSetContainer=We.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Yo(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Zo(this.view),this.setContainer(e,t),this._register(Pe(()=>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=Yo(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=DN,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Yo("slot"))}else this.container.appendChild(this.view);const i=new Fe;EN.BUBBLE_UP_EVENTS.forEach(e=>{i.add(eo(this.container,e,e=>{this.onDOMEvent(e,!1)}))}),EN.BUBBLE_DOWN_EVENTS.forEach(e=>{i.add(eo(this.container,e,e=>{this.onDOMEvent(e,!0)},!0))}),this.toDisposeOnSetContainer=i}}show(e){this.isVisible()&&this.hide(),Gn(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",Xo(this.view),this.toDisposeOnClean=e.render(this.view)||We.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||s["c"]&&$n.pointerEvents?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;let e,t=this.delegate.getAnchor();if(Fo(t)){let i=bo(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=wo(this.view),n=So(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,r=this.delegate.anchorAxisAlignment||0;let a,l;if(0===r){const t={offset:e.top-window.pageYOffset,size:e.height,position:0===o?0:1},r={offset:e.left,size:e.width,position:0===s?0:1,mode:LN.ALIGN};a=kN(window.innerHeight,n,t)+window.pageYOffset,xN.intersects({start:a,end:a+n},{start:t.offset,end:t.offset+t.size})&&(r.mode=LN.AVOID),l=kN(window.innerWidth,i,r)}else{const t={offset:e.left,size:e.width,position:0===s?0:1},r={offset:e.top,size:e.height,position:0===o?0:1,mode:LN.ALIGN};l=kN(window.innerWidth,i,t),xN.intersects({start:l,end:l+i},{start:t.offset,end:t.offset+t.size})&&(r.mode=LN.AVOID),a=kN(window.innerHeight,n,r)+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 c=bo(this.container);this.view.style.top=a-(this.useFixedPosition?bo(this.view).top:c.top)+"px",this.view.style.left=l-(this.useFixedPosition?bo(this.view).left:c.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null===t||void 0===t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),Zo(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!xo(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}EN.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],EN.BUBBLE_DOWN_EVENTS=["click"];let DN='\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';i("c3b4"),i("6d8f");function NN(e){let t=e.definition;while(t instanceof pa)t=t.definition;return`.codicon-${e.id}:before { content: '${t.character}'; }`}function IN(...e){return function(t,i){for(let n=0,o=e.length;n0?[{start:0,end:t.length}]:[]:null}function ON(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function AN(e,t){return RN(e.toLowerCase(),t.toLowerCase(),0,0)}function RN(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=RN(e,t,i+1,n+1))?zN({start:n,end:n+1},o):null}return RN(e,t,i,n+1)}function PN(e){return 97<=e&&e<=122}function FN(e){return 65<=e&&e<=90}function WN(e){return 48<=e&&e<=57}function BN(e){return 32===e||9===e||10===e||13===e}const VN=new Set;function HN(e){return PN(e)||FN(e)||WN(e)}function zN(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function UN(e,t){for(let i=t;i0&&!HN(e.charCodeAt(i-1)))return i}return e.length}function KN(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;o=KN(e,t,i+1,n+1);while(!o&&(s=UN(t,s)).6}function $N(e){const{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:o}=e;return i>.2&&t<.8&&n>.6&&o<.2}function GN(e){let t=0,i=0,n=0,o=0;for(let s=0;s60)return null;const i=jN(t);if(!$N(i)){if(!qN(i))return null;t=t.toLowerCase()}let n=null,o=0;e=e.toLowerCase();while(o/?".split("").forEach(e=>VN.add(e.charCodeAt(0)));const XN=IN(TN,YN,ON),ZN=IN(TN,YN,AN),QN=new ms(1e4);function JN(e,t,i=!1){if("string"!==typeof e||"string"!==typeof t)return null;let n=QN.get(e);n||(n=new RegExp(rs["o"](e),"i"),QN.set(e,n));const o=n.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:i?ZN(e,t):XN(e,t)}const eI=128;function tI(){const e=[],t=[];for(let i=0;i<=eI;i++)t[i]=0;for(let i=0;i<=eI;i++)e.push(t.slice(0));return e}function iI(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const nI=iI(2*eI),oI=iI(2*eI),sI=tI(),rI=tI(),aI=tI(),lI=!1;function cI(e,t,i,n,o){function s(e,t,i=" "){while(e.lengths(e,3)).join("|")}\n`;for(let a=0;a<=i;a++)r+=0===a?" |":t[a-1]+"|",r+=e[a].slice(0,o+1).map(e=>s(e.toString(),3)).join("|")+"\n";return r}function dI(e,t,i,n){e=e.substr(t),i=i.substr(n),console.log(cI(rI,e,e.length,i,i.length)),console.log(cI(aI,e,e.length,i,i.length)),console.log(cI(sI,e,e.length,i,i.length))}function hI(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!!rs["A"](i)}}function uI(e,t){if(t<0||t>=e.length)return!1;const i=e.charCodeAt(t);switch(i){case 32:case 9:return!0;default:return!1}}function gI(e,t,i){return t[e]!==i[e]}function fI(e,t,i,n,o,s,r=!1){while(teI?eI:e.length,l=n.length>eI?eI:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!fI(t,i,a,o,s,l,!0))return;_I(a,l,i,s,t,o);let c=1,d=1,h=i,u=s;const g=[!1];for(c=1,h=i;hr,b=_?rI[c][d-1]+(sI[c][d-1]>0?-5:0):0,v=u>r+1&&sI[c][d-1]>0,w=v?rI[c][d-2]+(sI[c][d-2]>0?-5:0):0;if(v&&(!_||w>=b)&&(!m||w>=p))rI[c][d]=w,aI[c][d]=3,sI[c][d]=0;else if(_&&(!m||b>=p))rI[c][d]=b,aI[c][d]=2,sI[c][d]=0;else{if(!m)throw new Error("not possible");rI[c][d]=p,aI[c][d]=1,sI[c][d]=sI[c-1][d-1]+1}}}if(lI&&dI(e,i,n,s),!g[0]&&!r)return;c--,d--;const f=[rI[c][d],s];let m=0,p=0;while(c>=1){let e=d;do{const t=aI[c][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+c-1]===o[s+d-1]&&!gI(e+s-1,n,o)&&m+1>sI[c][e]&&(e=d),e===d?m++:m=1,p||(p=e),c--,d=e-1,f.push(d)}l===a&&(f[0]+=2);const _=p-a;return f[0]-=_,f}function _I(e,t,i,n,o,s){let r=e-1,a=t-1;while(r>=i&&a>=n)o[r]===s[a]&&(oI[r]=a,r--),a--}function bI(e,t,i,n,o,s,r,a,l,c,d){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===i-n?h=e[i]===o[r]?7:5:!gI(r,o,s)||0!==r&&gI(r-1,o,s)?!hI(s,r)||0!==r&&hI(s,r-1)?(hI(s,r-1)||uI(s,r-1))&&(h=5,u=!0):h=5:(h=e[i]===o[r]?7:5,u=!0),h>1&&i===n&&(d[0]=!0),u||(u=gI(r,o,s)||hI(s,r-1)||uI(s,r-1)),i===n?r>l&&(h-=u?3:5):h+=c?u?2:0:u?0:1,r+1===a&&(h-=u?3:5),h}(function(e){function t(e){return!e||-100===e[0]&&0===e[1]&&0===e[2]}e.Default=[-100,0],e.isDefault=t})(mI||(mI={}));const vI="$(";const wI=/(\s)?(\\)?\$\([a-z0-9\-]+?(?:~[a-z0-9\-]*?)?\)(\s)?/gi;function CI(e){return-1===e.indexOf(vI)?e:e.replace(wI,(e,t,i,n)=>i?e:t||n||"")}function yI(e){const t=e.indexOf(vI);return-1===t?{text:e}:SI(e,t)}function SI(e,t){const i=[];let n="";function o(e){if(e){n+=e;for(const t of e)i.push(c)}}let s,r,a=-1,l="",c=0,d=t;const h=e.length;o(e.substr(0,t));while(dthis.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,triggerKeys:{keys:[3,...s["f"]||s["d"]?[10]:[]],keyDown:!0}}),this.menuElement=n,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Fe),this.initializeStyleSheet(e),Zn(n,Wo.KEY_DOWN,e=>{const t=new Ln(e);t.equals(2)&&e.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(Zn(n,Wo.KEY_DOWN,e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){Bo.stop(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof MI&&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)}}})),s["d"]&&this._register(Zn(n,Wo.KEY_DOWN,e=>{const t=new Ln(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Bo.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Bo.stop(e,!0))})),this._register(Zn(this.domNode,Wo.MOUSE_OUT,e=>{let t=e.relatedTarget;xo(t,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())})),this._register(Zn(this.actionsList,Wo.MOUSE_OVER,e=>{let t=e.target;if(t&&xo(t,this.actionsList)&&t!==this.actionsList){while(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 hS(n,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this._register(Zn(r,Wo.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 OI)).forEach((e,t,i)=>{e.updatePositionInSet(t+1,i.length)})}initializeStyleSheet(e){Do(e)?(this.styleSheet=To(e),this.styleSheet.textContent=RI):(II.globalStyleSheet||(II.globalStyleSheet=To(),II.globalStyleSheet.textContent=RI),this.styleSheet=II.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 TI||t instanceof OI)&&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(Zn(this.element,Wo.MOUSE_UP,e=>{if(Bo.stop(e,!0),cn){const t=new Tn(e);if(t.rightButton)return;this.onClick(e)}else setTimeout(()=>{this.onClick(e)},0)})),this._register(Zn(this.element,Wo.CONTEXT_MENU,e=>{Bo.stop(e,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Ko(this.element,Yo("a.action-menu-item")),this._action.id===Yg.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",""+this.mnemonic)),this.check=Ko(this.item,Yo("span.menu-item-check"+EI.cssSelector)),this.check.setAttribute("role","none"),this.label=Ko(this.item,Yo("span.action-label")),this.options.label&&this.options.keybinding&&(Ko(this.item,Yo("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){Gn(this.label);let e=CI(this.getAction().label);if(e){const t=AI(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=LI.exec(e);if(i){e=rs["s"](e),kI.lastIndex=0;let t=kI.exec(e);while(t&&t[1])t=kI.exec(e);const n=e=>e.replace(/&&/g,"&");t?this.label.append(rs["I"](n(e.substr(0,t.index))," "),Yo("u",{"aria-hidden":"true"},t[3]),rs["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=o({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.item&&(this.item.classList.remove("disabled"),this.item.tabIndex=0)):(this.element&&this.element.classList.add("disabled"),this.item&&(this.item.classList.add("disabled"),Jo(this.item)))}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 MI extends TI{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 Fe),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:NI.Right,this.showScheduler=new Vn(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Vn(()=>{this.element&&!xo(Io(),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=Ko(this.item,Yo("span.submenu-indicator"+DI.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(Zn(this.element,Wo.KEY_UP,e=>{let t=new Ln(e);(t.equals(17)||t.equals(3))&&(Bo.stop(e,!0),this.createSubmenu(!0))})),this._register(Zn(this.element,Wo.KEY_DOWN,e=>{let t=new Ln(e);Io()===this.item&&(t.equals(17)||t.equals(3))&&Bo.stop(e,!0)})),this._register(Zn(this.element,Wo.MOUSE_OVER,e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(Zn(this.element,Wo.MOUSE_LEAVE,e=>{this.mouseOver=!1})),this._register(Zn(this.element,Wo.FOCUS_OUT,e=>{this.element&&!xo(Io(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)})))}updateEnabled(){}onClick(e){Bo.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(t){}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=kN(e.width,t.width,{position:n===NI.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{let t=new Ln(e);t.equals(15)&&(Bo.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(Zn(this.submenuContainer,Wo.KEY_DOWN,e=>{let t=new Ln(e);t.equals(15)&&Bo.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"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t?""+t:""),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 OI extends bk{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?""+e.separatorColor:"")}}function AI(e){const t=LI,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}let RI=`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${NN(EI)}\n${NN(DI)}\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`;function PI(e,t){const i=Object.create(null);for(let n in t){const o=t[n];o&&(i[n]=iC(o,e))}return i}function FI(e,t,i){function n(n){const o=PI(e.getColorTheme(),t);"function"===typeof i?i(o):i.style(o)}return n(e.getColorTheme()),e.onDidColorThemeChange(n)}function WI(e,t,i){return FI(t,Object.assign(Object.assign({},BI),i||{}),e)}const BI={listFocusBackground:xw,listFocusForeground:Lw,listActiveSelectionBackground:Qw(kw,.1),listActiveSelectionForeground:Ew,listFocusAndSelectionBackground:kw,listFocusAndSelectionForeground:Ew,listInactiveSelectionBackground:Dw,listInactiveSelectionForeground:Nw,listInactiveFocusBackground:Iw,listHoverBackground:Tw,listHoverForeground:Mw,listDropBackground:Ow,listFocusOutline:_v,listSelectionOutline:_v,listHoverOutline:_v,listFilterWidgetBackground:Aw,listFilterWidgetOutline:Rw,listFilterWidgetNoMatchesOutline:Pw,listMatchesShadow:bv,treeIndentGuidesStroke:Fw},VI={shadowColor:bv,borderColor:Ww,foregroundColor:Bw,backgroundColor:Vw,selectionForegroundColor:Hw,selectionBackgroundColor:zw,selectionBorderColor:Uw,separatorColor:Kw};function HI(e,t,i){return FI(t,Object.assign(Object.assign({},VI),i),e)}class zI{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=Fo(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(Yo(".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",_n(this.block,Wo.MOUSE_DOWN)(e=>e.stopPropagation()));const s=new Fe,r=e.actionRunner||new Gg;return r.onBeforeRun(this.onActionRun,this,s),r.onDidRun(this.onDidActionRun,this,s),i=new II(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(HI(i,this.themeService)),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,s),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,s),_n(window,Wo.BLUR)(()=>{this.contextViewService.hideContextView(!0)},null,s),_n(window,Wo.MOUSE_DOWN)(e=>{if(e.defaultPrevented)return;let t=new Tn(e),i=t.target;if(!t.rightButton){while(i){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}},null,s),Re(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&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&this.notificationService.error(e.error)}}var 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},KI=function(e,t){return function(i,n){t(i,n,e)}};let jI=class extends We{constructor(e,t,i,n,o){super(),this.contextMenuHandler=new zI(i,e,t,n,o)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(e),ss.getInstance().resetKeyStatus()}};jI=UI([KI(0,Kf),KI(1,Yu),KI(2,Vk),KI(3,_E),KI(4,kf)],jI);const qI=Zi("layoutService");var $I=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},GI=function(e,t){return function(i,n){t(i,n,e)}};let YI=class extends We{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=We.None,this.container=e.container,this.contextView=this._register(new EN(this.container,1)),this.layout(),this._register(e.onLayout(()=>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=Pe(()=>{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)}};YI=$I([GI(0,qI)],YI);const XI=Zi("dialogService");class ZI{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}}class QI{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 i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new ZI(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")}}const JI=!1;class eT extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.toString()}}class tT{constructor(e=new wL,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(Yi,this)}createChild(e){return new tT(e,this._strict,this)}invokeFunction(e,...t){let i=iT.traceInvocation(e),n=!1;try{const o={get:(e,t)=>{if(n)throw ke("service accessor is only valid during the invocation of its target method");const o=this._getOrCreateServiceInstance(e,i);if(!o&&t!==Qi)throw new Error(`[invokeFunction] unknown service '${e}'`);return o}};return e(o,...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof ak?(i=iT.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=iT.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=Gi.getServiceDependencies(e).sort((e,t)=>e.index-t.index),o=[];for(const r of n){let t=this._getOrCreateServiceInstance(r.id,i);if(!t&&this._strict&&!r.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${r.id}.`);o.push(t)}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 ak)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 ak?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 QI(e=>e.id.toString());let o=0;const s=[{id:e,desc:t,_trace:i}];while(s.length){const t=s.pop();if(n.lookupOrInsertNode(t),o++>1e3)throw new eT(n);for(let i of Gi.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 ak){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};n.insertEdge(t,e),s.push(e)}}}while(1){const e=n.roots();if(0===e.length){if(!n.isEmpty())throw new eT(n);break}for(const{data:t}of e){const e=this._getServiceInstanceOrDescriptor(t.id);if(e instanceof ak){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 ak)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 Hn(()=>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){return i.value[t]=n,!0}})}return this._createInstance(e,t,n)}}class iT{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return JI?new iT(1,e.name||e.toString().substring(0,42).replace(/\n/g,"")):iT._None}static traceCreation(e){return JI?new iT(0,e.name):iT._None}branch(e,t){let i=new iT(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;iT._totals+=e;let t=!1;function i(e,n){let o=[],s=new Array(e+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,o.push(`${s}CREATES -> ${r}`);let n=i(e+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}let n=[`${0===this.type?"CREATE":"CALL"} ${this.name}`,""+i(1,this),`DONE, took ${e.toFixed(2)}ms (grand total ${iT._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(n.join("\n"))}}iT._None=new class extends iT{constructor(){super(-1,null)}stop(){}branch(){return this}},iT._totals=0;const nT=Zi("labelService");i("dff0");class oT extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function sT(e,t){const i=[];for(let n of t){if(e.start>=n.range.end)continue;if(e.ende.concat(t),[]))}class cT{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const n=i.length-t,o=sT({start:0,end:e},this.groups),s=sT({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(e=>({range:rT(e.range,n),size:e.size})),r=i.map((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size}));this.groups=lT(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){const e=this.getRenderer(t);e.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 uT=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 gT={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(e){return[e]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}},horizontalScrolling:!1,transformOptimization:!0};class fT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class mT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class pT{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?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null===e||void 0===e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null===e||void 0===e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class vT{constructor(e,t,i,n=gT){if(this.virtualDelegate=t,this.domId="list_id_"+ ++vT.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Rn(50),this.splicing=!1,this.dragOverAnimationStopDisposable=We.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=We.None,this.onDragLeaveTimeout=We.None,this.disposables=new Fe,this._onDidChangeContentHeight=new Ye,this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new cT;for(const s of i)this.renderers.set(s.templateId,s);this.cache=this.disposables.add(new hT(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 n.mouseSupport||n.mouseSupport),this._horizontalScrolling=sr(n,e=>e.horizontalScrolling,gT.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight="undefined"===typeof n.additionalScrollHeight?0:n.additionalScrollHeight,this.accessibilityProvider=new bT(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows";const o=sr(n,e=>e.transformOptimization,gT.transformOptimization);o&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(gm.addTarget(this.rowsContainer)),this.scrollable=new Xy(sr(n,e=>e.smoothScrolling,!1)?125:0,e=>oo(e)),this.scrollableElement=this.disposables.add(new dS(this.rowsContainer,{horizontal:1,vertical:sr(n,e=>e.verticalScrollMode,gT.verticalScrollMode),useShadows:sr(n,e=>e.useShadows,gT.useShadows)},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),_n(this.rowsContainer,hm.Change)(this.onTouchChange,this,this.disposables),_n(this.scrollableElement.getDomNode(),"scroll")(e=>e.target.scrollTop=0,null,this.disposables),je.map(_n(this.domNode,"dragover"),e=>this.toDragEvent(e))(this.onDragOver,this,this.disposables),je.map(_n(this.domNode,"drop"),e=>this.toDragEvent(e))(this.onDrop,this,this.disposables),_n(this.domNode,"dragleave")(this.onDragLeave,this,this.disposables),_n(window,"dragend")(this.onDragEnd,this,this.disposables),this.setRowLineHeight=sr(n,e=>e.setRowLineHeight,gT.setRowLineHeight),this.setRowHeight=sr(n,e=>e.setRowHeight,gT.setRowHeight),this.supportDynamicHeights=sr(n,e=>e.supportDynamicHeights,gT.supportDynamicHeights),this.dnd=sr(n,e=>e.dnd,gT.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:Co(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),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),o={start:e,end:e+t},s=xN.intersect(n,o),r=new Map;for(let C=s.start;C({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:We.None}));let h;0===e&&t>=this.items.length?(this.rangeMap=new cT,this.rangeMap.splice(0,0,d),this.items=d,h=[]):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),f=rT(l,u),m=xN.intersect(g,f);for(let C=m.start;CrT(e,u)),b={start:e,end:e+i.length},v=[b,..._].map(e=>xN.intersect(g,e)),w=this.getNextToLastElement(v);for(const C of v)for(let e=C.start;ee.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=this._scrollHeight+"px",this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=oo(()=>{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)"undefined"!==typeof 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(){const e=this.scrollableElement.getScrollDimensions();return e.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:yo(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),"undefined"!==typeof t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"===typeof t?t:Co(this.domNode)}))}render(e,t,i,n,o,s=!1){const r=this.getRenderRange(t,i),a=xN.relativeComplement(r,e),l=xN.relativeComplement(e,r),c=this.getNextToLastElement(a);if(s){const t=xN.intersect(e,r);for(let e=t.start;ethis.onDragStart(n.element,a,e))}this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=cn?"-moz-fit-content":"fit-content",e.width=Co(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(){const e=this.scrollableElement.getScrollPosition();return e.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 je.map(_n(this.domNode,"click"),e=>this.toMouseEvent(e))}get onMouseDblClick(){return je.map(_n(this.domNode,"dblclick"),e=>this.toMouseEvent(e))}get onMouseMiddleClick(){return je.filter(je.map(_n(this.domNode,"auxclick"),e=>this.toMouseEvent(e)),e=>1===e.browserEvent.button)}get onMouseDown(){return je.map(_n(this.domNode,"mousedown"),e=>this.toMouseEvent(e))}get onContextMenu(){return je.map(_n(this.domNode,"contextmenu"),e=>this.toMouseEvent(e))}get onTouchStart(){return je.map(_n(this.domNode,"touchstart"),e=>this.toTouchEvent(e))}get onTap(){return je.map(_n(this.rowsContainer,hm.Tap),e=>this.toGestureEvent(e))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}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(fk.RESOURCES,JSON.stringify([t])),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(n,i)),"undefined"===typeof e&&(e=String(n.length));const t=Yo(".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 fT(n),pk.CurrentDragAndDropData=new mT(n),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),pk.CurrentDragAndDropData&&"vscode-ui"===pk.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(pk.CurrentDragAndDropData)this.currentDragData=pk.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new pT}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:"undefined"===typeof e.index?[-1]:[e.index],i=hc(i).filter(e=>e>=-1&&ee-t),i=-1===i[0]?[-1]:i,_T(this.currentDragFeedback,i))return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackDisposable.dispose(),-1===i[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Pe(()=>{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=Pe(()=>{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=Fn(()=>this.clearDragOverFeedback(),100)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,pk.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,pk.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=We.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=_o(this.domNode).top;this.dragOverAnimationDisposable=ns(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Fn(()=>{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;while(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;while(1){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;en.splice(e,t,i))}}var CT,yT=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};class ST{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 xT{constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new Ye,this.onChange=this._onChange.event}get trait(){return this._trait}get renderer(){return new ST(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(KT),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=zT(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return oc(this.sortedIndexes,e,KT)>=0}dispose(){Ae(this._onChange)}}yT([dm],xT.prototype,"renderer",null);class LT extends xT{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 kT{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 ET(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function DT(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&(!!e.parentElement&&DT(e.parentElement))}class NT{constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Fe;const n=!1!==i.multipleSelectionSupport,o=je.chain(_n(t.domNode,"keydown")).filter(e=>!ET(e.target)).map(e=>new Ln(e));o.filter(e=>3===e.keyCode).on(this.onEnter,this,this.disposables),o.filter(e=>16===e.keyCode).on(this.onUpArrow,this,this.disposables),o.filter(e=>18===e.keyCode).on(this.onDownArrow,this,this.disposables),o.filter(e=>11===e.keyCode).on(this.onPageUpArrow,this,this.disposables),o.filter(e=>12===e.keyCode).on(this.onPageDownArrow,this,this.disposables),o.filter(e=>9===e.keyCode).on(this.onEscape,this,this.disposables),n&&o.filter(e=>(s["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(fc(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"})(CT||(CT={}));const IT=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 TT{constructor(e,t,i,n){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.delegate=n,this.enabled=!1,this.state=CT.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Fe,this.disposables=new Fe,this.updateOptions(e.options)}updateOptions(e){const t="undefined"===typeof e.enableKeyboardNavigation||!!e.enableKeyboardNavigation;t?this.enable():this.disable(),"undefined"!==typeof e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=je.chain(_n(this.view.domNode,"keydown")).filter(e=>!ET(e.target)).filter(()=>this.automaticKeyboardNavigation||this.triggered).map(e=>new Ln(e)).filter(e=>this.delegate.mightProducePrintableCharacter(e)).forEach(e=>{e.stopPropagation(),e.preventDefault()}).map(e=>e.browserEvent.key).event,t=je.debounce(e,()=>null,800),i=je.reduce(je.any(e,t),(e,t)=>null===t?null:(e||"")+t);i(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&&Pg(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=CT.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===CT.Idle?1:0;this.state=CT.Typing;for(let o=0;o!ET(e.target)).map(e=>new Ln(e));i.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 OT(e){return s["f"]?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function AT(e){return e.browserEvent.shiftKey}function RT(e){return e instanceof MouseEvent&&2===e.button}const PT={isSelectionSingleChangeEvent:OT,isSelectionRangeChangeEvent:AT};class FT{constructor(e){this.list=e,this.disposables=new Fe,this._onPointer=new Ye,this.onPointer=this._onPointer.event,this.multipleSelectionSupport=!(!1===e.options.multipleSelectionSupport),this.multipleSelectionSupport&&(this.multipleSelectionController=e.options.multipleSelectionController||PT),this.mouseSupport="undefined"===typeof 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(gm.addTarget(e.getHTMLElement()))),je.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):s["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){DT(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(DT(e.browserEvent.target))return;const t="undefined"===typeof e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(ET(e.browserEvent.target)||DT(e.browserEvent.target))return;let t=this.list.getFocus()[0];const i=this.list.getSelection();t=void 0===t?i[0]:t;const n=e.index;return"undefined"===typeof n?(this.list.setFocus([],e.browserEvent),void this.list.setSelection([],e.browserEvent)):this.multipleSelectionSupport&&this.isSelectionRangeChangeEvent(e)||this.multipleSelectionSupport&&this.isSelectionChangeEvent(e)?this.changeSelection(e,t):(this.list.setFocus([n],e.browserEvent),RT(e.browserEvent)||this.list.setSelection([n],e.browserEvent),void this._onPointer.fire(e))}onDoubleClick(e){if(ET(e.browserEvent.target)||DT(e.browserEvent.target))return;if(this.multipleSelectionSupport&&this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e,t){const i=e.index;if(this.isSelectionRangeChangeEvent(e)&&void 0!==t){const n=Math.min(t,i),o=Math.max(t,i),s=fc(n,o+1),r=this.list.getSelection(),a=HT(zT(r,[t]),t);if(0===a.length)return;const l=zT(s,UT(r,a));this.list.setSelection(l,e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const t=this.list.getSelection(),n=t.filter(e=>e!==i);this.list.setFocus([i]),t.length===n.length?this.list.setSelection([...n,i],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class WT{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}; }`):s["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.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}; }`),this.styleElement.textContent=i.join("\n")}}const BT={listFocusBackground:eb.fromHex("#7FB0D0"),listActiveSelectionBackground:eb.fromHex("#0E639C"),listActiveSelectionForeground:eb.fromHex("#FFFFFF"),listFocusAndSelectionBackground:eb.fromHex("#094771"),listFocusAndSelectionForeground:eb.fromHex("#FFFFFF"),listInactiveSelectionBackground:eb.fromHex("#3F3F46"),listHoverBackground:eb.fromHex("#2A2D2E"),listDropBackground:eb.fromHex("#383B3D"),treeIndentGuidesStroke:eb.fromHex("#a9a9a9")},VT={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function HT(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;while(o>=0&&e[o]===t-(i-o))n.push(e[o--]);n.reverse(),o=i;while(o=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.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;class jT{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 qT{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 $T{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements(),i=t.indexOf(e)>-1?t:[e];return i}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 GT{constructor(e,t,i,n,o=VT){var s;this.user=e,this._options=o,this.eventBufferer=new Ze,this._ariaLabel="",this.disposables=new Fe,this.didJustPressContextMenuKey=!1,this._onDidDispose=new Ye,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(s=this._options.accessibilityProvider)||void 0===s?void 0:s.getWidgetRole():"list";this.selection=new LT("listbox"!==r),this.focus=new xT("focused"),nr(o,BT,!1);const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new qT(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(e=>new jT(e.templateId,[...a,e]));const l=Object.assign(Object.assign({},o),{dnd:o.dnd&&new $T(this,o.dnd)});if(this.view=new vT(t,i,n,l),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const e=To(this.view.domNode);this.styleController=new WT(e,this.view.domId)}if(this.spliceable=new wT([new kT(this.focus,this.view,o.identityProvider),new kT(this.selection,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.onDidFocus=je.map(_n(this.view.domNode,"focus",!0),()=>null),this.onDidBlur=je.map(_n(this.view.domNode,"blur",!0),()=>null),this.disposables.add(new MT(this,this.view)),"boolean"!==typeof o.keyboardSupport||o.keyboardSupport){const e=new NT(this,this.view,o);this.disposables.add(e)}if(o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||IT;this.typeLabelController=new TT(this,this.view,o.keyboardNavigationLabelProvider,e),this.disposables.add(this.typeLabelController)}this.mouseController=this.createMouseController(o),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()),o.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return je.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e))}get onDidChangeSelection(){return je.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(){const e=je.chain(_n(this.view.domNode,"keydown")).map(e=>new Ln(e)).filter(e=>this.didJustPressContextMenuKey=58===e.keyCode||e.shiftKey&&68===e.keyCode).filter(e=>(e.preventDefault(),e.stopPropagation(),!1)).event,t=je.chain(_n(this.view.domNode,"keyup")).filter(()=>{const e=this.didJustPressContextMenuKey;return this.didJustPressContextMenuKey=!1,e}).filter(()=>this.getFocus().length>0&&!!this.view.domElement(this.getFocus()[0])).map(e=>{const t=this.getFocus()[0],i=this.view.element(t),n=this.view.domElement(t);return{index:t,element:i,anchor:n,browserEvent:e}}).event,i=je.chain(this.view.onContextMenu).filter(()=>!this.didJustPressContextMenuKey).map(({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:{x:i.clientX+1,y:i.clientY},browserEvent:i})).event;return je.any(e,t,i)}get onKeyDown(){return _n(this.view.domNode,"keydown")}createMouseController(e){return new FT(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 oT(this.user,"Invalid start index: "+e);if(t<0)throw new oT(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()}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new oT(this.user,"Invalid index "+i);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new oT(this.user,"Invalid index "+i);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){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([]),setTimeout(()=>this.focusNextPage(e,t),0))}}focusPreviousPage(e,t){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([]),setTimeout(()=>this.focusPreviousPage(e,t),0))}}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 oT(this.user,"Invalid index "+e);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(Ns(t)){const e=o-this.view.renderHeight;this.view.setScrollTop(e*Nr(t,0,1)+n)}else{const e=n+o,t=i+this.view.renderHeight;n=t||(n=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new oT(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()}}yT([dm],GT.prototype,"onDidChangeFocus",null),yT([dm],GT.prototype,"onDidChangeSelection",null),yT([dm],GT.prototype,"onContextMenu",null);class YT{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){const t=this.renderer.renderTemplate(e);return{data:t,disposable:We.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 it,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 XT{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}}function ZT(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new XT(e,t.accessibilityProvider)})}class QT{constructor(e,t,i,n,o={}){const s=()=>this.model,r=n.map(e=>new YT(e,s));this.list=new GT(e,t,i,r,ZT(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 je.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 je.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 onDidChangeFocus(){return je.map(this.list.onDidChangeFocus,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(e=>this._model.get(e)),indexes:t,browserEvent:i}))}get onDidChangeSelection(){return je.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,fc(e.length))}getFocus(){return this.list.getFocus()}setSelection(e,t){this.list.setSelection(e,t)}style(e){this.list.style(e)}dispose(){this.list.dispose()}}const JT="inputFocus";var eM;i("72b1");(function(e){e[e["Unknown"]=0]="Unknown",e[e["Twistie"]=1]="Twistie",e[e["Element"]=2]="Element"})(eM||(eM={}));class tM extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class iM{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}}function nM(e){return"object"===typeof e&&"visibility"in e&&"data"in e}function oM(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function sM(e){return"boolean"===typeof e.collapsible}class rM{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Ze,this._onDidChangeCollapseState=new Ye,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new Ye,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new Ye,this.onDidSplice=this._onDidSplice.event,this.collapseByDefault="undefined"!==typeof n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren="undefined"!==typeof 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=Ee.empty(),n={}){if(0===e.length)throw new tM(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=Ee.empty()),void 0===s&&(s=null!==(r=o.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t),l=[...n],c=t[t.length-1],d=new yc({getElements:()=>a.children.map(t=>e.getId(t.element).toString())},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(t=>e.getId(t.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return this.spliceSimple(t,i,l,o);const h=t.slice(0,-1),u=(t,i,n)=>{if(s>0)for(let r=0;rt.originalStart-e.originalStart))u(g,f,g-(m.originalStart+m.originalLength)),g=m.originalStart,f=m.modifiedStart-c,this.spliceSimple([...h,g],m.originalLength,Ee.slice(l,f,f+m.modifiedLength),o);u(g,f,g)}spliceSimple(e,t,i=Ee.empty(),{onDidCreateNode:n,onDidDeleteNode:o}){const{parentNode:s,listIndex:r,revealed:a,visible:l}=this.getParentNodeWithListIndex(e),c=[],d=Ee.map(i,e=>this.createTreeNode(e,s,s.visible?1:0,a,c,n)),h=e[e.length-1],u=s.children.length>0;let g=0;for(let C=h;C>=0&&Ce+(t.visible?t.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(s,p-e),this.list.splice(r,e,c)}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:f,deletedNodes:_});let w=s;while(w){if(2===w.visibility){this.refilter();break}w=w.parent}}rerender(e){if(0===e.length)throw new tM(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);"undefined"===typeof 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);"undefined"===typeof 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&&!sM(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:(sM(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})),!sM(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);while(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:"undefined"!==typeof e.collapsed,collapsed:"undefined"===typeof 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||Ee.empty(),c=n&&0!==a&&!r.collapsed,d=Ee.map(l,e=>this.createTreeNode(e,r,a,c,o,s));let h=0,u=1;for(const g of d)r.children.push(g),u+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=h++);return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=h,r.visible=2===a?h>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)while(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):nM(i)?(e.filterData=i.data,oM(i.visibility)):(e.filterData=void 0,oM(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 tM(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 tM(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 tM(this.user,"Invalid tree location");for(let a=0;ae.element)),this.data=e}}function gM(e){return e instanceof fT?new uM(e):e}class fM{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=We.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(gM(e),t)}onDragOver(e,t,i,n,o=!0){const s=this.dnd.onDragOver(gM(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),"undefined"===typeof t)return s;if(r&&"boolean"!==typeof s&&s.autoExpand&&(this.autoExpandDisposable=Fn(()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0},500)),"boolean"===typeof s||!s.accept||"undefined"===typeof s.bubble||s.feedback){if(!o){const e="boolean"===typeof s?s:s.accept,t="boolean"===typeof s?void 0:s.effect;return{accept:e,effect:t,feedback:[i]}}return s}if(1===s.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 a=this.modelProvider(),l=a.getNodeLocation(t),c=a.getListIndex(l),d=a.getListRenderCount(l);return Object.assign(Object.assign({},s),{feedback:fc(c,c+d)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(gM(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function mM(e,t){return t&&Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId(e){return t.identityProvider.getId(e.element)}},dnd:t.dnd&&new fM(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return t.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return t.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:t.accessibilityProvider&&Object.assign(Object.assign({},t.accessibilityProvider),{getSetSize(t){const i=e(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n),s=i.getNode(o);return s.visibleChildrenCount},getPosInSet(e){return e.visibleChildIndex+1},isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel(e){return t.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return t.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),enableKeyboardNavigation:t.simpleKeyboardNavigation})}class pM{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 _M;(function(e){e["None"]="none",e["OnHover"]="onHover",e["Always"]="always"})(_M||(_M={}));class bM{constructor(e,t=[]){this._elements=t,this.onDidChange=je.forEach(e,e=>this._elements=e)}get elements(){return this._elements}}class vM{constructor(e,t,i,n,o={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=vM.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new nu,this.activeIndentNodes=new Set,this.indentGuidesDisposable=We.None,this.disposables=new Fe,this.templateId=e.templateId,this.updateOptions(o),je.map(i,e=>e.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if("undefined"!==typeof e.indent&&(this.indent=Nr(e.indent,0,40)),"undefined"!==typeof e.renderIndentGuides){const t=e.renderIndentGuides!==_M.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const e=new Fe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}"undefined"!==typeof e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Ko(e,Yo(".monaco-tl-row")),i=Ko(t,Yo(".monaco-tl-indent")),n=Ko(t,Yo(".monaco-tl-twistie")),o=Ko(t,Yo(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:We.None,templateData:s}}renderElement(e,t,i,n){"number"===typeof n&&(this.renderedNodes.set(e,{templateData:i,height:n}),this.renderedElements.set(e.element,e));const o=vM.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(...aM.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(...aM.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(Gn(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Fe,n=this.modelProvider();let o=e;while(1){const e=n.getNodeLocation(o),s=n.getParentNodeLocation(e);if(!s)break;const r=n.getNode(s),a=Yo(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(Pe(()=>this.renderedIndentGuides.delete(r,a))),o=r}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(o){}}),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(),Ae(this.disposables)}}vM.DefaultIndent=8;class wM{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 Fe,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:nM(i)?oM(i.visibility):i,0===n)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:mI.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),n=Array.isArray(i)?i:[i];for(const o of n){const e=o&&o.toString();if("undefined"===typeof e)return{data:mI.Default,visibility:!0};const t=pI(this._pattern,this._lowercasePattern,0,e,e.toLowerCase(),0,!0);if(t)return this._matchCount++,1===n.length?{data:t,visibility:!0}:{data:{label:e,score:t},visibility:!0}}return this.tree.options.filterOnType?2:{data:mI.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Ae(this.disposables)}}class CM{constructor(e,t,i,n,s){this.tree=e,this.view=i,this.filter=n,this.keyboardNavigationDelegate=s,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new Ye,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new Ye,this.enabledDisposables=new Fe,this.disposables=new Fe,this.domNode=Yo(".monaco-list-type-filter."+this.positionClassName),this.domNode.draggable=!0,_n(this.domNode,"dragstart")(this.onDragStart,this,this.disposables),this.messageDomNode=Ko(i.getHTMLElement(),Yo(".monaco-list-type-filter-message")),this.labelDomNode=Ko(this.domNode,Yo("span.label"));const r=Ko(this.domNode,Yo(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=Ko(r,Yo("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),_n(this.filterOnTypeDomNode,"input")(this.onDidChangeFilterOnType,this,this.disposables),this.clearDomNode=Ko(r,Yo("button.clear"+dM.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=o("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(),"undefined"!==typeof e.filterOnType&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType),"undefined"!==typeof e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=je.chain(_n(this.view.getHTMLElement(),"keydown")).filter(e=>!ET(e.target)||e.target===this.filterOnTypeDomNode).filter(e=>"Dead"!==e.key&&!/^Media/.test(e.key)).map(e=>new Ln(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&&(s["f"]?e.altKey&&!e.metaKey:e.ctrlKey)&&!e.shiftKey).forEach(e=>{e.stopPropagation(),e.preventDefault()}).event,t=_n(this.clearDomNode,"click");je.chain(je.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&&(s["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=>!mI.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}=bo(e),i=e.clientWidth,n=i/2,o=this.domNode.clientWidth,s=new Fe;let r=this.positionClassName;const a=()=>{switch(r){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-o-6+"px";break}},l=e=>{e.preventDefault();const i=e.clientX-t;e.dataTransfer&&(e.dataTransfer.dropEffect="none"),r=i{this.positionClassName=r,this.domNode.className="monaco-list-type-filter "+this.positionClassName,this.domNode.style.top="",this.domNode.style.left="",Ae(s)};a(),this.domNode.classList.remove(r),this.domNode.classList.add("dragging"),s.add(Pe(()=>this.domNode.classList.remove("dragging"))),_n(document,"dragover")(l,null,s),_n(this.domNode,"dragend")(c,null,s),pk.CurrentDragAndDropData=new mk("vscode-ui"),s.add(Pe(()=>pk.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(...cM.classNamesArray),this.filterOnTypeDomNode.classList.add(...lM.classNamesArray),this.filterOnTypeDomNode.title=o("disable filter on type","Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...lM.classNamesArray),this.filterOnTypeDomNode.classList.add(...cM.classNamesArray),this.filterOnTypeDomNode.title=o("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=o("empty","No elements found"),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),this.domNode.classList.toggle("no-matches",e),this.domNode.title=o("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||!mI.isDefault(e.filterData))}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),Ae(this.disposables)}}function yM(e){let t=eM.Unknown;return ko(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=eM.Twistie:ko(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(t=eM.Element),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function SM(e,t){t(e),e.children.forEach(e=>SM(e,t))}class xM{constructor(e){this.identityProvider=e,this.nodes=[],this._onDidChange=new Ye,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)&&nc(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=>SM(e,i)),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach(e=>SM(e,n));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach(e=>SM(e,s));const r=[];for(const a of this.nodes){const e=this.identityProvider.getId(a.element).toString(),t=i.has(e);if(t){const t=o.get(e);t&&r.push(t)}else r.push(a)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class LM extends FT{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(ET(e.browserEvent.target)||DT(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.expandOnlyOnDoubleClick&&2!==e.browserEvent.detail&&!n)return super.onViewPointer(e);if(t.collapsible){const i=this.tree.model,s=i.getNodeLocation(t),r=e.browserEvent.altKey;if(i.setCollapsed(s,void 0,r),o&&n)return}super.onViewPointer(e)}onDoubleClick(e){const t=e.browserEvent.target.classList.contains("monaco-tl-twistie");t||super.onDoubleClick(e)}}class kM extends GT{constructor(e,t,i,n,o,s,r){super(e,t,i,n,r),this.focusTrait=o,this.selectionTrait=s}createMouseController(e){return new LM(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];i.forEach((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i)}),n.length>0&&super.setFocus(uc([...super.getFocus(),...n])),o.length>0&&super.setSelection(uc([...super.getSelection(),...o]))}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)}}class EM{constructor(e,t,i,n,o={}){this._options=o,this.eventBufferer=new Ze,this.disposables=new Fe,this._onWillRefilter=new Ye,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new Ye;const s=new pM(i),r=new Qe,a=new Qe,l=new bM(a.event);this.renderers=n.map(e=>new vM(e,()=>this.model,r.event,l,o));for(let h of this.renderers)this.disposables.add(h);let c;o.keyboardNavigationLabelProvider&&(c=new wM(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:c}),this.disposables.add(c)),this.focus=new xM(o.identityProvider),this.selection=new xM(o.identityProvider),this.view=new kM(e,t,s,this.renderers,this.focus,this.selection,Object.assign(Object.assign({},mM(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const d=je.forEach(this.model.onDidSplice,e=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)})});if(d(()=>null,null,this.disposables),a.input=je.chain(je.any(d,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!==o.keyboardSupport){const e=je.chain(this.view.onKeyDown).filter(e=>!ET(e.target)).map(e=>new Ln(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(o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||IT;this.typeFilterController=new CM(this,this.model,this.view,c,e),this.focusNavigationFilter=e=>this.typeFilterController.shouldAllowFocus(e),this.disposables.add(this.typeFilterController)}this.styleElement=To(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===_M.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return je.map(this.view.onMouseDblClick,yM)}get onPointer(){return je.map(this.view.onPointer,yM)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnlyOnDoubleClick(){var e;return null!==(e=this._options.expandOnlyOnDoubleClick)&&void 0!==e&&e}get expandOnlyOnTwistieClick(){return"undefined"!==typeof 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===_M.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),o=this.model.setCollapsed(n,!0);if(!o){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),o=this.model.setCollapsed(n,!1);if(!o){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(){Ae(this.disposables),this.view.dispose()}}class DM{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new rM(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){return i.sorter.compare(e.element,t.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=Ee.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Ee.empty(),i){const n=new Set,o=new Set,s=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)},r=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)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:s,onDidDeleteNode:r}))}preserveCollapseState(e=Ee.empty()){return this.sorter&&(e=sc([...e],this.sorter.compare.bind(this.sorter))),Ee.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="undefined"!==typeof 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 tM(this.user,"Tree element not found: "+e);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new tM(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new tM(this.user,"Tree element not found: "+e);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i),o=this.model.getNode(n);return o.element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new tM(this.user,"Tree element not found: "+e);return this.model.getNodeLocation(t)}}function NM(e){const t=[e.element],i=e.incompressible||!1;return{element:{elements:t,incompressible:i},children:Ee.map(Ee.from(e.children),NM),collapsible:e.collapsible,collapsed:e.collapsed}}function IM(e){const t=[e.element],i=e.incompressible||!1;let n,o;while(1){if([o,n]=Ee.consume(Ee.from(e.children),2),1!==o.length)break;if(o[0].incompressible)break;e=o[0],t.push(e.element)}return{element:{elements:t,incompressible:i},children:Ee.map(Ee.concat(o,n),IM),collapsible:e.collapsible,collapsed:e.collapsed}}function TM(e,t=0){let i;return i=tTM(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 MM(e){return TM(e,0)}function OM(e,t,i){return e.element===t?Object.assign(Object.assign({},e),{children:i}):Object.assign(Object.assign({},e),{children:Ee.map(Ee.from(e.children),e=>OM(e,t,i))})}const AM=e=>({getId(t){return t.elements.map(t=>e.getId(t).toString()).join("\0")}});class RM{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new DM(e,t,i),this.enabled="undefined"===typeof 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=Ee.empty(),i){const n=i.diffIdentityProvider&&AM(i.diffIdentityProvider);if(null===e){const e=Ee.map(t,this.enabled?IM:NM);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const o=this.nodes.get(e);if(!o)throw new Error("Unknown compressed tree node");const s=this.model.getNode(o),r=this.model.getParentNodeLocation(o),a=this.model.getNode(r),l=MM(s),c=OM(l,e,t),d=(this.enabled?IM:NM)(c),h=a.children.map(e=>e===s?d:e);this._setChildren(a.element,h,{diffIdentityProvider:n,diffDepth:s.depth-a.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode(),i=t.children,n=Ee.map(i,MM),o=Ee.map(n,e?IM:NM);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,o=e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},s=e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:s}))}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("undefined"===typeof 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 tM(this.user,"Tree element not found: "+e);return t}}const PM=e=>e[e.length-1];class FM{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 FM(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}}function WM(e,t){return{splice(i,n,o){t.splice(i,n,o.map(t=>e.map(t)))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}function BM(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId(i){return t.identityProvider.getId(e(i))}},sorter:t.sorter&&{compare(e,i){return t.sorter.compare(e.elements[0],i.elements[0])}},filter:t.filter&&{filter(i,n){return t.filter.filter(e(i),n)}}})}class VM{constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||PM;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new iM(e=>new FM(n,e)),this.model=new RM(e,WM(this.nodeMapper,t),BM(n,i))}get onDidSplice(){return je.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 je.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return je.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}setChildren(e,t=Ee.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 HM=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};class zM extends EM{constructor(e,t,i,n,o={}){super(e,t,i,n,o)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=Ee.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 DM(e,t,i)}}class UM{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){const t=this.renderer.renderTemplate(e);return{compressedTreeNode:void 0,data:t}}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 KM(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(o){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}HM([dm],UM.prototype,"compressedTreeNodeProvider",null);class jM extends zM{constructor(e,t,i,n,o={}){const s=()=>this,r=n.map(e=>new UM(s,e));super(e,t,i,r,KM(s,o))}setChildren(e,t=Ee.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new VM(e,t,i)}updateOptions(e={}){super.updateOptions(e),"undefined"!==typeof e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var qM=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function $M(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function GM(e,t){return!!t.parent&&(t.parent===e||GM(e,t.parent))}function YM(e,t){return e===t||GM(e,t)||GM(t,e)}class XM{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new XM(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 ZM{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){const t=this.renderer.renderTemplate(e);return{templateData:t}}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(...hM.classNamesArray),!0):(t.classList.remove(...hM.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 QM(e){return{browserEvent:e.browserEvent,elements:e.elements.map(e=>e.element)}}function JM(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class eO extends fT{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function tO(e){return e instanceof fT?new eO(e):e}class iO{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(tO(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(tO(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(tO(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function nO(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new iO(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return 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){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return 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){return e.filter.filter(t.element,i)}},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}),sorter:void 0,expandOnlyOnTwistieClick:"undefined"===typeof e.expandOnlyOnTwistieClick?void 0:"function"!==typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),additionalScrollHeight:e.additionalScrollHeight})}function oO(e,t){t(e),e.children.forEach(e=>oO(e,t))}class sO{constructor(e,t,i,n,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new Ye,this._onDidChangeNodeSlowState=new Ye,this.nodeMapper=new iM(e=>new XM(e)),this.disposables=new Fe,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren="undefined"!==typeof s.autoExpandSingleChildren&&s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,i,n,s),this.root=$M({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 je.map(this.tree.onDidChangeFocus,QM)}get onDidChangeSelection(){return je.map(this.tree.onDidChangeSelection,QM)}get onMouseDblClick(){return je.map(this.tree.onMouseDblClick,JM)}get onPointer(){return je.map(this.tree.onPointer,JM)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,i,n,o){const s=new pM(i),r=n.map(e=>new ZM(e,this.nodeMapper,this._onDidChangeNodeSlowState.event)),a=nO(o)||{};return new zM(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 qM(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 qM(this,void 0,void 0,(function*(){if("undefined"===typeof this.root.element)throw new tM(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield je.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch(r){}}))}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 qM(this,void 0,void 0,(function*(){if("undefined"===typeof this.root.element)throw new tM(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield je.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 je.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 je.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setSelection(i,t)}getSelection(){const e=this.tree.getSelection();return e.map(e=>e.element)}setFocus(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setFocus(i,t)}getFocus(){const e=this.tree.getFocus();return e.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 tM(this.user,"Data tree node not found: "+e);return t}refreshAndRenderNode(e,t,i,n){return qM(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)}))}refreshNode(e,t,i){return qM(this,void 0,void 0,(function*(){let n;return this.subTreeRefreshPromises.forEach((o,s)=>{!n&&YM(s,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n||this.doRefreshSubTree(e,t,i)}))}doRefreshSubTree(e,t,i){return qM(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 o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield Promise.all(o.map(e=>this.doRefreshSubTree(e,t,i)))}finally{n()}}))}doRefreshNode(e,t,i){return qM(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=Pn(800);t.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},e=>null),n=this.doGetChildren(e).finally(()=>t.cancel())}else n=Promise.resolve(Ee.empty());try{const o=yield n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Se(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}))}doGetChildren(e){let t=this.refreshPromises.get(e);return t||(t=An(()=>qM(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(ve))}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 c of e.children)if(s.set(c.element,c),this.identityProvider){const e=this.tree.isCollapsed(c);r.set(c.id,{node:c,collapsed:e})}const a=[],l=o.map(t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=$M({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(),c=r.get(l);if(c){const e=c.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?c.collapsed?(e.children.forEach(e=>oO(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 d=$M({element:t,parent:e,id:l,hasChildren:o});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(d),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(d),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(d):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(d.collapsedByDefault=!1,a.push(d)),d});for(const c of s.values())oO(c,e=>this.nodes.delete(e.element));for(const c of l)this.nodes.set(c.element,c);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){return 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?Ee.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 rO{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 rO(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 aO{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){const t=this.renderer.renderTemplate(e);return{templateData:t}}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(...hM.classNamesArray),!0):(t.classList.remove(...hM.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=Ae(this.disposables)}}function lO(e){const t=e&&nO(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(e=>e.element))}})})}class cO extends sO{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new iM(e=>new rO(e)),this.filter=r.filter}createTree(e,t,i,n,o){const s=new pM(i),r=n.map(e=>new aO(e,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),a=lO(o)||{};return new jM(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 c=!1;const d=e=>{const t=e.element;if(t)for(let n=0;n{const t=this.filter.filter(e,1),i=dO(t);if(2===i)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===i})),super.processChildren(e)}}function dO(e){return"boolean"===typeof e?e?1:0:nM(e)?oM(e.visibility):oM(e)}class hO extends EM{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 DM(e,t,i)}}var uO=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=function(e,t){return function(i,n){t(i,n,e)}};const fO=Zi("listService");let mO=class{constructor(e){this._themeService=e,this.disposables=new Fe,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 WT(To(),"");this.disposables.add(WI(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),Re(e.onDidFocus(()=>this._lastFocusedWidget=e),Pe(()=>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()}};mO=uO([gO(0,kf)],mO);const pO=new wf("listFocus",!0),_O=new wf("listSupportsMultiselect",!0),bO=(tf.and(pO,tf.not(JT)),new wf("listHasSelectionOrFocus",!1)),vO=new wf("listDoubleSelection",!1),wO=new wf("listMultiSelection",!1),CO=new wf("listSupportsKeyboardNavigation",!0),yO="listAutomaticKeyboardNavigation",SO=new wf(yO,!0);let xO=!1;function LO(e,t){const i=e.createScoped(t.getHTMLElement());return pO.bindTo(i),i}const kO="workbench.list.multiSelectModifier",EO="workbench.list.openMode",DO="workbench.list.horizontalScrolling",NO="workbench.list.keyboardNavigation",IO="workbench.list.automaticKeyboardNavigation",TO="workbench.tree.indent",MO="workbench.tree.renderIndentGuides",OO="workbench.list.smoothScrolling",AO="workbench.tree.expandMode";function RO(e){return"alt"===e.getValue(kO)}class PO extends We{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=RO(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(kO)&&(this.useAltAsMultipleSelectionModifier=RO(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:OT(e)}isSelectionRangeChangeEvent(e){return AT(e)}}function FO(e,t,i){const n=new Fe,o=Object.assign({},e);if(!1!==e.multipleSelectionSupport&&!e.multipleSelectionController){const e=new PO(t);o.multipleSelectionController=e,n.add(e)}return o.keyboardNavigationDelegate={mightProducePrintableCharacter(e){return i.mightProducePrintableCharacter(e)}},o.smoothScrolling=t.getValue(OO),[o,n]}let WO=class extends GT{constructor(e,t,i,n,o,s,r,a,l,c){const d="undefined"!==typeof o.horizontalScrolling?o.horizontalScrolling:l.getValue(DO),[h,u]=FO(o,l,c);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},PI(a.getColorTheme(),BI)),h),{horizontalScrolling:d})),this.disposables.add(u),this.contextKeyService=LO(s,this),this.themeService=a;const g=_O.bindTo(this.contextKeyService);g.set(!(!1===o.multipleSelectionSupport)),this.listHasSelectionOrFocus=bO.bindTo(this.contextKeyService),this.listDoubleSelection=vO.bindTo(this.contextKeyService),this.listMultiSelection=wO.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=RO(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(kO)&&(this._useAltAsMultipleSelectionModifier=RO(l));let t={};if(e.affectsConfiguration(DO)&&void 0===this.horizontalScrolling){const e=l.getValue(DO);t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(OO)){const e=l.getValue(OO);t=Object.assign(Object.assign({},t),{smoothScrolling:e})}Object.keys(t).length>0&&this.updateOptions(t)}))}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles)}dispose(){super.dispose(),this._styler&&this._styler.dispose()}updateStyles(e){this._styler&&this._styler.dispose(),this._styler=WI(this,this.themeService,e)}};WO=uO([gO(5,Cf),gO(6,fO),gO(7,kf),gO(8,Cu),gO(9,_E)],WO);let BO=class extends QT{constructor(e,t,i,n,o,s,r,a,l,c){const d="undefined"!==typeof o.horizontalScrolling?o.horizontalScrolling:l.getValue(DO),[h,u]=FO(o,l,c);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},PI(a.getColorTheme(),BI)),h),{horizontalScrolling:d})),this.disposables=new Fe,this.disposables.add(u),this.contextKeyService=LO(s,this),this.horizontalScrolling=o.horizontalScrolling;const g=_O.bindTo(this.contextKeyService);g.set(!(!1===o.multipleSelectionSupport)),this._useAltAsMultipleSelectionModifier=RO(l),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),o.overrideStyles&&this.disposables.add(WI(this,a,o.overrideStyles)),this.disposables.add(l.onDidChangeConfiguration(e=>{e.affectsConfiguration(kO)&&(this._useAltAsMultipleSelectionModifier=RO(l));let t={};if(e.affectsConfiguration(DO)&&void 0===this.horizontalScrolling){const e=l.getValue(DO);t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(OO)){const e=l.getValue(OO);t=Object.assign(Object.assign({},t),{smoothScrolling:e})}Object.keys(t).length>0&&this.updateOptions(t)}))}dispose(){super.dispose(),this.disposables.dispose()}};BO=uO([gO(5,Cf),gO(6,fO),gO(7,kf),gO(8,Cu),gO(9,_E)],BO);class VO extends We{constructor(e,t){var i,n;super(),this.widget=e,this._onDidOpen=this._register(new Ye),this.onDidOpen=this._onDidOpen.event,this.openOnFocus=null!==(i=null===t||void 0===t?void 0:t.openOnFocus)&&void 0!==i&&i,this._register(je.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))),this.openOnFocus&&this._register(je.filter(this.widget.onDidChangeFocus,e=>e.browserEvent instanceof KeyboardEvent)(e=>this.onFocusFromKeyboard(e))),"boolean"!==typeof(null===t||void 0===t?void 0:t.openOnSingleClick)&&(null===t||void 0===t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null===t||void 0===t?void 0:t.configurationService.getValue(EO)),this._register(null===t||void 0===t?void 0:t.configurationService.onDidChangeConfiguration(()=>{this.openOnSingleClick="doubleClick"!==(null===t||void 0===t?void 0:t.configurationService.getValue(EO))}))):this.openOnSingleClick=null===(n=null===t||void 0===t?void 0:t.openOnSingleClick)||void 0===n||n}onFocusFromKeyboard(e){const t=this.widget.getFocus();this.widget.setSelection(t,e.browserEvent);const i=e.browserEvent,n="boolean"!==typeof i.preserveFocus||i.preserveFocus,o="boolean"===typeof i.pinned?i.pinned:!n,s=!1;this._open(this.getSelectedElement(),n,o,s,e.browserEvent)}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,o=!1;this._open(this.getSelectedElement(),i,n,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;const i=2===t.detail;if(i)return;const n=1===t.button,o=!0,s=n,r=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,r,t)}onMouseDblClick(e,t){if(!t)return;const i=!1,n=!0,o=t.ctrlKey||t.metaKey||t.altKey;this._open(e,i,n,o,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 HO extends VO{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function zO(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 UO=class extends zM{constructor(e,t,i,n,o,s,r,a,l,c,d){const{options:h,getAutomaticKeyboardNavigation:u,disposable:g}=GO(t,o,s,l,c,d);super(e,t,i,n,h),this.disposables.add(g),this.internals=new YO(this,o,u,o.overrideStyles,s,r,a,l,d),this.disposables.add(this.internals)}};UO=uO([gO(5,Cf),gO(6,fO),gO(7,kf),gO(8,Cu),gO(9,_E),gO(10,CL)],UO);let KO=class extends jM{constructor(e,t,i,n,o,s,r,a,l,c,d){const{options:h,getAutomaticKeyboardNavigation:u,disposable:g}=GO(t,o,s,l,c,d);super(e,t,i,n,h),this.disposables.add(g),this.internals=new YO(this,o,u,o.overrideStyles,s,r,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};KO=uO([gO(5,Cf),gO(6,fO),gO(7,kf),gO(8,Cu),gO(9,_E),gO(10,CL)],KO);let jO=class extends hO{constructor(e,t,i,n,o,s,r,a,l,c,d,h){const{options:u,getAutomaticKeyboardNavigation:g,disposable:f}=GO(t,s,r,c,d,h);super(e,t,i,n,o,u),this.disposables.add(f),this.internals=new YO(this,s,g,s.overrideStyles,r,a,l,c,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};jO=uO([gO(6,Cf),gO(7,fO),gO(8,kf),gO(9,Cu),gO(10,_E),gO(11,CL)],jO);let qO=class extends sO{constructor(e,t,i,n,o,s,r,a,l,c,d,h){const{options:u,getAutomaticKeyboardNavigation:g,disposable:f}=GO(t,s,r,c,d,h);super(e,t,i,n,o,u),this.disposables.add(f),this.internals=new YO(this,s,g,s.overrideStyles,r,a,l,c,h),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};qO=uO([gO(6,Cf),gO(7,fO),gO(8,kf),gO(9,Cu),gO(10,_E),gO(11,CL)],qO);let $O=class extends cO{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u){const{options:g,getAutomaticKeyboardNavigation:f,disposable:m}=GO(t,r,a,d,h,u);super(e,t,i,n,o,s,g),this.disposables.add(m),this.internals=new YO(this,r,f,r.overrideStyles,a,l,c,d,u),this.disposables.add(this.internals)}};function GO(e,t,i,n,o,s){var r;CO.bindTo(i),xO||(SO.bindTo(i),xO=!0);const a=()=>{let e=i.getContextKeyValue(yO);return e&&(e=n.getValue(IO)),e},l=s.isScreenReaderOptimized(),c=t.simpleKeyboardNavigation||l?"simple":n.getValue(NO),d=void 0!==t.horizontalScrolling?t.horizontalScrolling:n.getValue(DO),[h,u]=FO(t,n,o),g=t.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},h),{indent:n.getValue(TO),renderIndentGuides:n.getValue(MO),smoothScrolling:n.getValue(OO),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:"simple"===c,filterOnType:"filter"===c,horizontalScrolling:d,keyboardNavigationEventFilter:zO(e,o),additionalScrollHeight:g,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnDoubleClick:"doubleClick"===n.getValue(EO),expandOnlyOnTwistieClick:null!==(r=t.expandOnlyOnTwistieClick)&&void 0!==r?r:"doubleClick"===n.getValue(AO)})}}$O=uO([gO(7,Cf),gO(8,fO),gO(9,kf),gO(10,Cu),gO(11,_E),gO(12,CL)],$O);let YO=class{constructor(e,t,i,n,o,s,r,a,l){this.tree=e,this.themeService=r,this.disposables=[],this.contextKeyService=LO(o,e);const c=_O.bindTo(this.contextKeyService);c.set(!(!1===t.multipleSelectionSupport)),this.hasSelectionOrFocus=bO.bindTo(this.contextKeyService),this.hasDoubleSelection=vO.bindTo(this.contextKeyService),this.hasMultiSelection=wO.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=RO(a);const d=new Set;d.add(yO);const h=()=>{const t=l.isScreenReaderOptimized(),i=t?"simple":a.getValue(NO);e.updateOptions({simpleKeyboardNavigation:"simple"===i,filterOnType:"filter"===i})};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(kO)&&(this._useAltAsMultipleSelectionModifier=RO(a)),n.affectsConfiguration(TO)){const e=a.getValue(TO);o=Object.assign(Object.assign({},o),{indent:e})}if(n.affectsConfiguration(MO)){const e=a.getValue(MO);o=Object.assign(Object.assign({},o),{renderIndentGuides:e})}if(n.affectsConfiguration(OO)){const e=a.getValue(OO);o=Object.assign(Object.assign({},o),{smoothScrolling:e})}if(n.affectsConfiguration(NO)&&h(),n.affectsConfiguration(IO)&&(o=Object.assign(Object.assign({},o),{automaticKeyboardNavigation:i()})),n.affectsConfiguration(DO)&&void 0===t.horizontalScrolling){const e=a.getValue(DO);o=Object.assign(Object.assign({},o),{horizontalScrolling:e})}n.affectsConfiguration(EO)&&(o=Object.assign(Object.assign({},o),{expandOnlyOnDoubleClick:"doubleClick"===a.getValue(EO)})),n.affectsConfiguration(AO)&&void 0===t.expandOnlyOnTwistieClick&&(o=Object.assign(Object.assign({},o),{expandOnlyOnTwistieClick:"doubleClick"===a.getValue(AO)})),Object.keys(o).length>0&&e.updateOptions(o)}),this.contextKeyService.onDidChangeContext(t=>{t.affectsSome(d)&&e.updateOptions({automaticKeyboardNavigation:i()})}),l.onDidChangeScreenReaderOptimized(()=>h())),this.navigator=new HO(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateStyleOverrides(e){Ae(this.styler),this.styler=e?WI(this.tree,this.themeService,e):We.None}dispose(){this.disposables=Ae(this.disposables),Ae(this.styler),this.styler=void 0}};YO=uO([gO(4,Cf),gO(5,fO),gO(6,kf),gO(7,Cu),gO(8,CL)],YO);const XO=Ah.as(Bh.Configuration);var ZO,QO;XO.registerConfiguration({id:"workbench",order:7,title:o("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[kO]:{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[o("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),o("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:o({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.")},[EO]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:o({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). For parents with children in trees, this setting will control if a single click expands the parent or a double click. Note that some trees and lists might choose to ignore this setting if it is not applicable. ")},[DO]:{type:"boolean",default:!1,description:o("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[TO]:{type:"number",default:8,minimum:0,maximum:40,description:o("tree indent setting","Controls tree indentation in pixels.")},[MO]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:o("render tree indent guides","Controls whether the tree should render indent guides.")},[OO]:{type:"boolean",default:!1,description:o("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[NO]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[o("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),o("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),o("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:o("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},[IO]:{type:"boolean",default:!0,markdownDescription:o("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.")},[AO]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:o("expand mode","Controls how tree folders are expanded when clicking the folder names.")}}}),function(e){e[e["Hint"]=1]="Hint",e[e["Info"]=2]="Info",e[e["Warning"]=4]="Warning",e[e["Error"]=8]="Error"}(ZO||(ZO={})),function(e){function t(e,t){return t-e}e.compare=t;const i=Object.create(null);function n(e){return i[e]||""}function s(t){switch(t){case Lh.Error:return e.Error;case Lh.Warning:return e.Warning;case Lh.Info:return e.Info;case Lh.Ignore:return e.Hint}}function r(t){switch(t){case e.Error:return Lh.Error;case e.Warning:return Lh.Warning;case e.Info:return Lh.Info;case e.Hint:return Lh.Ignore}}i[e.Error]=o("sev.error","Error"),i[e.Warning]=o("sev.warning","Warning"),i[e.Info]=o("sev.info","Info"),e.toString=n,e.fromSeverity=s,e.toSeverity=r}(ZO||(ZO={})),function(e){const t="";function i(e){return n(e,!0)}function n(e,i){let n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"===typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(ZO.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=i,e.makeKeyOptionalMessage=n}(QO||(QO={}));const JO=Zi("markerService");class eA{constructor(){this._byResource=new gs,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 gs,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){let i=this._byResource.get(e);return null===i||void 0===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:Ee.empty():Xt.isUri(e)?null!==(o=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==o?o:Ee.empty():Ee.map(Ee.concat(...this._byOwner.values()),e=>e[1])}}class tA{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new gs,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===zn.inMemory||e.scheme===zn.walkThrough||e.scheme===zn.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e}))i===ZO.Error?t.errors+=1:i===ZO.Warning?t.warnings+=1:i===ZO.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 iA{constructor(){this._onMarkerChanged=new Ye,this.onMarkerChanged=je.debounce(this._onMarkerChanged.event,iA._debouncer,0),this._data=new eA,this._stats=new tA(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(cc(i)){const i=this._data.delete(t,e);i&&this._onMarkerChanged.fire([t])}else{const n=[];for(const o of i){const i=iA._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:c,endColumn:d,relatedInformation:h,tags:u}=i;if(s)return a=a>0?a:1,l=l>0?l:1,c=c>=a?c:a,d=d>0?d:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:c,endColumn:d,relatedInformation:h,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(iA._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&&void 0!==i?i:t),s=[];for(const t of e)for(const e of t)if(iA._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(iA._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||(iA._dedupeMap=new gs,e=[]);for(const i of t)iA._dedupeMap.has(i)||(iA._dedupeMap.set(i,!0),e.push(i));return e}}const nA="__$__targetStorageMarker",oA=Zi("storageService");var sA;(function(e){e[e["NONE"]=0]="NONE",e[e["SHUTDOWN"]=1]="SHUTDOWN"})(sA||(sA={}));class rA extends We{constructor(){super(...arguments),this._onDidChangeValue=this._register(new Xe),this._onDidChangeTarget=this._register(new Xe),this._onWillSaveState=this._register(new Ye),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===nA?(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]})}store(e,t,i,n){Ms(t)?this.remove(e,i):this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),this.doStore(e,t,i)})}remove(e,t){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.doRemove(e,t)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){const n=this.getKeyTargets(t);"number"===typeof i?n[e]!==i&&(n[e]=i,this.doStore(nA,JSON.stringify(n),t)):"number"===typeof n[e]&&(delete n[e],this.doStore(nA,JSON.stringify(n),t))}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(nA,e);if(t)try{return JSON.parse(t)}catch(i){}return Object.create(null)}}class aA extends rA{constructor(){super(...arguments),this.globalCache=new Map,this.workspaceCache=new Map}getCache(e){return 0===e?this.globalCache:this.workspaceCache}get(e,t,i){const n=this.getCache(t).get(e);return Ms(n)?i:n}getBoolean(e,t,i){const n=this.getCache(t).get(e);return Ms(n)?i:"true"===n}getNumber(e,t,i){const n=this.getCache(t).get(e);return Ms(n)?i:parseInt(n,10)}doStore(e,t,i){const n=String(t),o=this.getCache(i).get(e);o!==n&&(this.getCache(i).set(e,n),this.emitDidChangeValue(i,e))}doRemove(e,t){const i=this.getCache(t).delete(e);i&&this.emitDidChangeValue(t,e)}}var lA=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},cA=function(e,t){return function(i,n){t(i,n,e)}};let dA=class{constructor(e){this._commandService=e}createMenu(e,t){return new hA(e,this._commandService,t,this)}};dA=lA([cA(0,Hs)],dA);let hA=class e{constructor(e,t,i,n){this._id=e,this._commandService=t,this._contextKeyService=i,this._menuService=n,this._dispoables=new Fe,this._onDidChange=new Ye,this.onDidChange=this._onDidChange.event,this._menuGroups=[],this._contextKeys=new Set,this._build();const o=new Vn(()=>this._build(),50);this._dispoables.add(o),this._dispoables.add(Hf.onDidChangeMenu(t=>{t.has(e)&&o.schedule()}));const s=new Vn(()=>this._onDidChange.fire(this),50);this._dispoables.add(s),this._dispoables.add(i.onDidChangeContext(e=>{e.affectsSome(this._contextKeys)&&s.schedule()}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const t=Hf.getMenuItems(this._id);let i;t.sort(e._compareMenuItems);for(let n of t){const t=n.group||"";if(i&&i[0]===t||(i=[t,[]],this._menuGroups.push(i)),i[1].push(n),e._fillInKbExprKeys(n.when,this._contextKeys),Wf(n)&&(n.command.precondition&&e._fillInKbExprKeys(n.command.precondition,this._contextKeys),n.command.toggled)){const t=n.command.toggled.condition||n.command.toggled;e._fillInKbExprKeys(t,this._contextKeys)}}this._onDidChange.fire(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=Wf(t)?new Uf(t.command,t.alt,e,this._contextKeyService,this._commandService):new zf(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(Wf(t)?t.command.title:t.title,Wf(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)}};hA=lA([cA(1,Hs),cA(2,Cf),cA(3,Vf)],hA);const uA=Zi("markerDecorationsService");var gA=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},fA=function(e,t){return function(i,n){t(i,n,e)}};function mA(e){return e.toString()}class pA extends We{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(Pe(()=>{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 o=0;othis._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(mA(e));return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(e=>{const t=this._markerDecorations.get(mA(e));t&&this._updateDecorations(t)})}_onModelAdded(e){const t=new pA(e);this._markerDecorations.set(mA(e.uri),t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(mA(e.uri));t&&(t.dispose(),this._markerDecorations.delete(mA(e.uri))),e.uri.scheme!==zn.inMemory&&e.uri.scheme!==zn.internal&&e.uri.scheme!==zn.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=li.lift(t);if(t.severity!==ZO.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 li(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 li(i.startLineNumber,t-1,i.endLineNumber,t):new li(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}};_A=gA([fA(0,aa),fA(1,JO)],_A);var bA=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},vA=function(e,t){return function(i,n){t(i,n,e)}};let wA=class extends We{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new Ye,this._accessibilityModeEnabledContext=yL.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}};wA=bA([vA(0,Cf),vA(1,Cu)],wA);var CA=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class yA{constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return CA(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,n=document.body.appendChild(Yo("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 CA(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}}))}readFindText(){return CA(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return CA(this,void 0,void 0,(function*(){this.findText=e}))}}var SA=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},xA=function(e,t){return function(i,n){t(i,n,e)}},LA=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const kA=!1;function EA(e){return e.scheme===zn.file?e.fsPath:e.path}let DA=0;class NA{constructor(e,t,i,n,o,s,r){this.id=++DA,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 IA{constructor(e,t){this.resourceLabel=e,this.reason=t}}class TA{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements){const i=0===n.reason?e:t;i.push(n.resourceLabel)}let i=[];return e.length>0&&i.push(o({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(o({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 MA{constructor(e,t,i,n,o,s,r){this.id=++DA,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 TA),this.removedResources.has(t)||this.removedResources.set(t,new IA(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 TA),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new IA(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class OA{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 t of this._future)1===t.type&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i=0;i--)t.push(this._future[i].id);return new YE(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let r=0,a=this._past.length;r=t||s.id!==e.elements[n])&&(i=!1,o=0),i||1!==s.type||s.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let r=this._future.length-1;r>=0;r--,n++){const o=this._future[r];i&&(n>=t||o.id!==e.elements[n])&&(i=!1,s=r),i||1!==o.type||o.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 i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.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 AA{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=s,i=n))}return[t,i]}canUndo(e){if(e instanceof ZE){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);return e.hasPastElements()}return!1}_onError(e,t){ve(e);for(const i of t.strResources)this.removeElements(i);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(a){return s(),n.dispose(),this._onError(a,e)}return r?r.then(()=>(s(),n.dispose(),o()),t=>(s(),n.dispose(),this._onError(t,e))):(s(),n.dispose(),o())}_invokeWorkspacePrepare(e){return LA(this,void 0,void 0,(function*(){if("undefined"===typeof e.actual.prepareUndoRedo)return We.None;const t=e.actual.prepareUndoRedo();return"undefined"===typeof t?We.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||"undefined"===typeof e.actual.prepareUndoRedo)return t(We.None);const i=e.actual.prepareUndoRedo();return i?Oe(i)?t(i):i.then(e=>t(e)):t(We.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||RA);return new AA(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.info(n),new FA(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.info(n),new FA}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,o({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,o({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 s=[];for(const o of i.editStacks)o.getClosestPastElement()!==t&&s.push(o.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,o({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,s.join(", ")));const r=[];for(const o of i.editStacks)o.locked&&r.push(o.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,o({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,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,o({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 LA(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const s=yield this._dialogService.show(Lh.Info,o("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),[o({key:"ok",comment:["{0} denotes a number that is > 1"]},"Undo in {0} Files",i.editStacks.length),o("nok","Undo this File"),o("cancel","Cancel")],{cancelId:2});if(2===s.choice)return;if(1===s.choice)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const r=this._checkWorkspaceUndo(e,t,i,!1);if(r)return r.returnValue;n=!0}let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return s.dispose(),r.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,s,()=>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 AA([e]),n,()=>this._continueUndoInGroup(t.groupId,i))));{const e=o({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.info(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 ZE){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)return;if(o.groupId){const[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}const s=o.sourceId!==t||o.confirmBeforeUndo;if(s&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{kA&&this._print("undo")}}_confirmAndContinueUndo(e,t,i){return LA(this,void 0,void 0,(function*(){const n=yield this._dialogService.show(Lh.Info,o("confirmDifferentSource","Would you like to undo '{0}'?",i.label),[o("confirmDifferentSource.ok","Undo"),o("cancel","Cancel")],{cancelId:1});if(1!==n.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,o({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,s.join(", ")));const r=[];for(const o of i.editStacks)o.locked&&r.push(o.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,o({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,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,o({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 LA(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,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 AA([e]),i,()=>this._continueRedoInGroup(t.groupId))));{const e=o({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.info(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{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});function HA(e,t,i=!1){const n=e||"",o=t||"",s=VA.value.collator.compare(n,o);return VA.value.collatorIsNumeric&&0===s&&n!==o?no.length)return 1}return 0}i("8c32");const KA=/(\\)?\$\(([a-z\-]+(?:~[a-z\-]+)?)\)/gi;function jA(e){const t=new Array;let i,n=0,o=0;while(null!==(i=KA.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})`:qA({id:r}))}return n{n="\r\n"===e?-1:0,o+=i;for(const i of t)i.end<=o||(i.start>=o&&(i.start+=n),i.end>=o&&(i.end+=n));return i+=n,"⏎"})}}var GA=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class YA{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 XA extends We{constructor(e,t){super(),this.hoverDelegate=void 0,this.customHovers=new Map,this.domNode=this._register(new YA(Ko(e,Yo(".monaco-icon-label")))),this.labelContainer=Ko(this.domNode.element,Yo(".monaco-icon-label-container"));const i=Ko(this.labelContainer,Yo("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new YA(Ko(this.labelContainer,Yo("span.monaco-icon-description-container")))),(null===t||void 0===t?void 0:t.supportHighlights)?this.nameNode=new JA(i,!!t.supportIcons):this.nameNode=new ZA(i),(null===t||void 0===t?void 0:t.supportDescriptionHighlights)?this.descriptionNodeFactory=()=>new $A(Ko(this.descriptionContainer.element,Yo("span.label-description")),!!t.supportIcons):this.descriptionNodeFactory=()=>this._register(new YA(Ko(this.descriptionContainer.element,Yo("span.label-description")))),(null===t||void 0===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?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof $A?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,null===i||void 0===i?void 0:i.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(null===i||void 0===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){e&&n&&(void 0!==t&&(e.target.x=t+10),i.showHover(e))}getTooltipForCustom(e){if(Es(e))return()=>GA(this,void 0,void 0,(function*(){return e}));if(As(e.markdown))return e.markdown;{const t=e.markdown;return()=>GA(this,void 0,void 0,(function*(){return t}))}}setupCustomHover(e,t,i){t.setAttribute("title",""),t.removeAttribute("title");let n=this.getTooltipForCustom(i);const r=s["f"]?1500:500;let a,l,c,d=!1;function h(i){if(d)return;function s(e){d=!1,a=void 0,c.dispose(!0),h.dispose(),u.dispose()}c=new it;const h=_n(t,Wo.MOUSE_LEAVE,!0)(s.bind(t)),u=_n(t,Wo.MOUSE_DOWN,!0)(s.bind(t));function g(e){l=e.x}d=!0;const f=_n(t,Wo.MOUSE_MOVE,!0)(g.bind(t));setTimeout(()=>GA(this,void 0,void 0,(function*(){if(d&&n){if(!a){const t={targetElements:[this],dispose:()=>{}};a={text:o("iconLabel.loading","Loading..."),target:t,anchorPosition:0},XA.adjustXAndShowCustomHover(a,l,e,d);const i=yield n(c.token);i&&(a={text:i,target:t,anchorPosition:0})}XA.adjustXAndShowCustomHover(a,l,e,d)}f.dispose()})),r)}const u=this._register(_n(t,Wo.MOUSE_OVER,!0)(h.bind(t)));this.customHovers.set(t,u)}setupNativeHover(e,t){let i="";Es(t)?i=t:(null===t||void 0===t?void 0:t.markdownNotSupportedFallback)&&(i=t.markdownNotSupportedFallback),e.title=i}}class ZA{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!or(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=Ko(this.container,Yo("a.label-name",{id:null===t||void 0===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=>xN.intersect(o,e)).filter(e=>!xN.isEmpty(e)).map(({start:e,end:t})=>({start:e-n,end:t-n}));return n=o.end+t.length,s})}class JA{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!or(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=new $A(Ko(this.container,Yo("a.label-name",{id:null===t||void 0===t?void 0:t.domId})),this.supportIcons)),this.singleLabel.set(e,null===t||void 0===t?void 0:t.matches,void 0,null===t||void 0===t?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(null===t||void 0===t?void 0:t.separator)||"/",n=QA(e,i,null===t||void 0===t?void 0:t.matches);for(let o=0;o=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},aR=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const lR=Yo;class cR{constructor(e){this.hidden=!1,this._onChecked=new Ye,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 dR{get templateId(){return dR.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Ko(e,lR(".quick-input-list-entry"));const i=Ko(t.entry,lR("label.quick-input-list-label"));t.toDisposeTemplate.push(eo(i,Wo.CLICK,e=>{t.checkbox.offsetParent||e.preventDefault()})),t.checkbox=Ko(i,lR("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(eo(t.checkbox,Wo.CHANGE,e=>{t.element.checked=t.checkbox.checked}));const n=Ko(i,lR(".quick-input-list-rows")),o=Ko(n,lR(".quick-input-list-row")),r=Ko(n,lR(".quick-input-list-row"));t.label=new XA(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const a=Ko(o,lR(".quick-input-list-entry-keybinding"));t.keybinding=new sR(a,s["a"]);const l=Ko(r,lR(".quick-input-list-label-meta"));return t.detail=new $A(l,!0),t.separator=Ko(t.entry,lR(".quick-input-list-separator")),t.actionBar=new vk(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=Ae(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?nR(t.iconPath):void 0);t.alwaysVisible&&(n=n?n+" always-visible":"always-visible");const o=new $g("id-"+i,"",n,!0,()=>aR(this,void 0,void 0,(function*(){e.fireButtonTriggered({button:t,item:e.item})})));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=Ae(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=Ae(e.toDisposeElement),e.toDisposeTemplate=Ae(e.toDisposeTemplate)}}dR.ID="listelement";class hR{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return dR.ID}}var uR;(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"})(uR||(uR={}));class gR{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 Ye,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new Ye,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new Ye,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new Ye,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new Ye,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new Ye,this.onKeyDown=this._onKeyDown.event,this._onLeave=new Ye,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Ko(this.parent,lR(".quick-input-list"));const n=new hR,o=new mR;this.list=i.createList("QuickInput",this.container,n,[new dR],{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 Ln(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(s["f"]?e.metaKey:e.ctrlKey)&&this.list.setFocus(fc(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();break}this._onKeyDown.fire(t)})),this.disposables.push(this.list.onMouseDown(e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()})),this.disposables.push(Zn(this.container,Wo.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 je.map(this.list.onDidChangeFocus,e=>e.elements.map(e=>e.item))}get onDidChangeSelection(){return je.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=Ae(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],c=n.label&&n.label.replace(/\r?\n/g," "),d=n.meta&&n.meta.replace(/\r?\n/g," "),h=n.description&&n.description.replace(/\r?\n/g," "),u=n.detail&&n.detail.replace(/\r?\n/g," "),g=n.ariaLabel||[c,h,u].map(e=>e&&yI(e).text).filter(e=>!!e).join(", ");i.push(new cR({index:o,item:n,saneLabel:c,saneMeta:d,saneAriaLabel:g,saneDescription:h,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===uR.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=uR.First),e===uR.Previous&&0===this.list.getFocus()[0]&&(e=uR.Last),e===uR.Second&&this.list.length<2&&(e=uR.First),e){case uR.First:this.list.focusFirst();break;case uR.Second:this.list.focusNth(1);break;case uR.Last:this.list.focusLast();break;case uR.Next:this.list.focusNext();break;case uR.Previous:this.list.focusPrevious();break;case uR.NextPage:this.list.focusNextPage();break;case uR.PreviousPage:this.list.focusPreviousPage();break}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;e=e.trim(),e&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)?this.elements.forEach(t=>{const i=this.matchOnLabel?Vs(xI(e,yI(t.saneLabel))):void 0,n=this.matchOnDescription?Vs(xI(e,yI(t.saneDescription||""))):void 0,o=this.matchOnDetail?Vs(xI(e,yI(t.saneDetail||""))):void 0,s=this.matchOnMeta?Vs(xI(e,yI(t.saneMeta||""))):void 0;i||n||o||s?(t.labelHighlights=i,t.descriptionHighlights=n,t.detailHighlights=o,t.hidden=!1):(t.labelHighlights=void 0,t.descriptionHighlights=void 0,t.detailHighlights=void 0,t.hidden=!t.item.alwaysShow),t.separator=void 0}):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)=>fR(e,t,i))}return this.elementsToIndexes=t.reduce((e,t,i)=>(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=Ae(this.elementDisposables),this.disposables=Ae(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)}}function fR(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:zA(e.saneLabel,t.saneLabel,i)}rR([dm],gR.prototype,"onDidChangeFocus",null),rR([dm],gR.prototype,"onDidChangeSelection",null);class mR{getWidgetAriaLabel(){return o("quickInput","Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}i("eba9");function pR(e,t={}){const i=bR(t);return i.textContent=e,i}function _R(e,t={}){const i=bR(t);return wR(i,CR(e),t.actionHandler),i}function bR(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}class vR{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 wR(e,t,i){let n;if(2===t.type)n=document.createTextNode(t.content||"");else if(3===t.type)n=document.createElement("b");else if(4===t.type)n=document.createElement("i");else if(5===t.type&&i){const e=document.createElement("a");e.href="#",i.disposeables.add(eo(e,"click",e=>{i.callback(String(t.index),e)})),n=e}else 7===t.type?n=document.createElement("br"):1===t.type&&(n=e);n&&e!==n&&e.appendChild(n),n&&Array.isArray(t.children)&&t.children.forEach(e=>{wR(n,e,i)})}function CR(e){const t={type:1,children:[]};let i=0,n=t;const o=[],s=new vR(e);while(!s.eos()){let e=s.next();const t="\\"===e&&0!==SR(s.peek());if(t&&(e=s.next()),!t&&yR(e)&&e===s.peek()){s.advance(),2===n.type&&(n=o.pop());const t=SR(e);if(n.type===t||5===n.type&&6===t)n=o.pop();else{const e={type:t,children:[]};5===t&&(e.index=i,i++),n.children.push(e),o.push(n),n=e}}else if("\n"===e)2===n.type&&(n=o.pop()),n.children.push({type:7});else if(2!==n.type){const t={type:2,content:e};n.children.push(t),o.push(n),n=t}else n.content+=e}return 2===n.type&&(n=o.pop()),o.length,t}function yR(e){return 0!==SR(e)}function SR(e){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;default:return 0}}const xR=Yo,LR={inputBackground:eb.fromHex("#3C3C3C"),inputForeground:eb.fromHex("#CCCCCC"),inputValidationInfoBorder:eb.fromHex("#55AAFF"),inputValidationInfoBackground:eb.fromHex("#063B49"),inputValidationWarningBorder:eb.fromHex("#B89500"),inputValidationWarningBackground:eb.fromHex("#352A05"),inputValidationErrorBorder:eb.fromHex("#BE1100"),inputValidationErrorBackground:eb.fromHex("#5A1D1D")};class kR extends Ry{constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new Ye),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),nr(this.options,LR,!1),this.message=null,this.placeholder=this.options.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=Ko(e,xR(".monaco-inputbox.idle"));let n=this.options.flexibleHeight?"textarea":"input",o=Ko(this.element,xR(".ibwrapper"));if(this.input=Ko(o,xR(n+".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=Ko(o,xR("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new cS(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Ko(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(e=>this.input.scrollTop=e.scrollTop));const t=je.filter(_n(document,"selectionchange"),()=>{const e=document.getSelection();return(null===e||void 0===e?void 0:e.anchorNode)===o});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.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 vk(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),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:So(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)}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 wo(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const e=parseFloat(this.mirror.style.paddingLeft||"")||0,i=parseFloat(this.mirror.style.paddingRight||"")||0;t=e+i}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?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=wo(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:t=>{if(!this.message)return null;e=Ko(t,xR(".monaco-inputbox-container")),i();const n={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?_R(this.message.content,n):pR(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:"",Ko(e,o),null},onHide:()=>{this.state="closed"},layout:i}),t=3===this.message.type?o("alertErrorMessage","Error: {0}",this.message.content):2===this.message.type?o("alertWarningMessage","Warning: {0}",this.message.content):o("alertInfoMessage","Info: {0}",this.message.content),Pg(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=e.charCodeAt(e.length-1),i=10===t?" ":"",n=e+i;n?this.mirror.textContent=e+i: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=So(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 ER=Yo;class DR extends We{constructor(e){super(),this.parent=e,this.onKeyDown=e=>Zn(this.inputBox.inputElement,Wo.KEY_DOWN,t=>{e(new Ln(t))}),this.onMouseDown=e=>Zn(this.inputBox.inputElement,Wo.MOUSE_DOWN,t=>{e(new Tn(t))}),this.onDidChange=e=>this.inputBox.onDidChange(e),this.container=Ko(this.parent,ER(".quick-input-box")),this.inputBox=this._register(new kR(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===Lh.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===Lh.Info?1:e===Lh.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===Lh.Info?1:e===Lh.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}i("f5ab");const NR={badgeBackground:eb.fromHex("#4D4D4D"),badgeForeground:eb.fromHex("#FFFFFF")};class IR{constructor(e,t){this.count=0,this.options=t||Object.create(null),nr(this.options,NR,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=Ko(e,Yo(".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(rs["v"])(this.countFormat,this.count),this.element.title=Object(rs["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}}}i("2adc");const TR="done",MR="active",OR="infinite",AR="discrete",RR={progressBarBackground:eb.fromHex("#0E70C0")};class PR extends We{constructor(e,t){super(),this.options=t||Object.create(null),nr(this.options,RR,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this._register(this.showDelayedScheduler=new Vn(()=>Xo(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(MR,OR,AR),this.workedVal=0,this.totalWork=void 0}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(TR),this.element.classList.contains(OR)?(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(AR,TR),this.element.classList.add(MR,OR),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}}}i("e635");const FR={buttonBackground:eb.fromHex("#0E639C"),buttonHoverBackground:eb.fromHex("#006BB3"),buttonForeground:eb.white};class WR extends We{constructor(e,t){super(),this._onDidClick=this._register(new Ye),this.options=t||Object.create(null),nr(this.options,FR,!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(gm.addTarget(this._element)),[Wo.CLICK,hm.Tap].forEach(e=>{this._register(Zn(this._element,e,e=>{this.enabled?this._onDidClick.fire(e):Bo.stop(e)}))}),this._register(Zn(this._element,Wo.KEY_DOWN,e=>{const t=new Ln(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&&Bo.stop(t,!0)})),this._register(Zn(this._element,Wo.MOUSE_OVER,e=>{this._element.classList.contains("disabled")||this.setHoverBackground()})),this._register(Zn(this._element,Wo.MOUSE_OUT,e=>{this.applyStyles()})),this.focusTracker=this._register(Uo(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?jo(this._element,...jA(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)),Jo(this._element))}get enabled(){return!this._element.classList.contains("disabled")}}var BR=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const VR=Yo,HR=ma("quick-input-back",pa.arrowLeft),zR={iconClass:HR.classNames,tooltip:o("quickInput.back","Back"),handle:-1};class UR extends We{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new Ye),this.onDidHideEmitter=this._register(new Ye),this.onDisposeEmitter=this._register(new Ye),this.visibleDisposables=this._register(new Fe),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()}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(){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire()}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 Wn,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===zR);this.ui.leftActionBar.push(e.map((e,t)=>{const i=new $g("id-"+t,"",e.iconClass||nR(e.iconPath),!0,()=>BR(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!==zR);this.ui.rightActionBar.push(t.map((e,t)=>{const i=new $g("id-"+t,"",e.iconClass||nR(e.iconPath),!0,()=>BR(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)}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?o("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e===Lh.Error){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()}}class KR extends UR{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new Ye),this.onDidAcceptEmitter=this._register(new Ye),this.onDidCustomEmitter=this._register(new Ye),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()?BA.NONE:BA.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new Ye),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new Ye),this.onDidTriggerItemButtonEmitter=this._register(new Ye),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?WA:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,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(uR.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{if(e===this.value)return;this._value=e;const t=this.ui.list.filter(this.filterValue(this.ui.inputBox.value));t&&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(uR.Next),this.canSelectMany&&this.ui.list.domFocus(),Bo.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(uR.Previous):this.ui.list.focus(uR.Last),this.canSelectMany&&this.ui.list.domFocus(),Bo.stop(e,!0);break;case 12:this.ui.list.focus(uR.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Bo.stop(e,!0);break;case 11:this.ui.list.focus(uR.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Bo.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(uR.First),Bo.stop(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(uR.Last),Bo.stop(e,!0));break}})),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&&nc(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&&nc(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&&nc(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 Zn(this.ui.container,Wo.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Ln(e),i=t.keyCode,n=this._quickNavigate.keybindings,o=n.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)))});o&&(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;let e=!1,t=!1;this._hideInput&&this._items.length>0&&(this.ui.isScreenReaderOptimized()?t=!0:e=!0),this.ui.container.classList.toggle("hidden-input",e&&!this.description);const i={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};if(this.ui.setVisibilities(i),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||""),t)this.ui.inputBox.ariaLabel="";else{const e=this.ariaLabel||this.placeholder||KR.DEFAULT_ARIA_LABEL;this.ui.inputBox.ariaLabel!==e&&(this.ui.inputBox.ariaLabel=e)}if(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 BA.NONE:this._itemActivation=BA.FIRST;break;case BA.SECOND:this.ui.list.focus(uR.Second),this._itemActivation=BA.FIRST;break;case BA.LAST:this.ui.list.focus(uR.Last),this._itemActivation=BA.FIRST;break;default:this.trySelectFirst();break}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));const n=this.validationMessage||"";this._lastValidationMessage!==n&&(this._lastValidationMessage=n,jo(this.ui.message,...jA(Object(rs["s"])(n))),this.showMessageDecoration(this.validationMessage?Lh.Error:Lh.Ignore)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(uR.First))}}KR.DEFAULT_ARIA_LABEL=o("quickInputBox.ariaLabel","Type to narrow down results.");class jR extends We{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new Ye),this.onDidCustomEmitter=this._register(new Ye),this.onDidTriggerButtonEmitter=this._register(new Ye),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new Ye),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new Ye),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(Zn(window,Wo.KEY_DOWN,e,!0)),this._register(Zn(window,Wo.KEY_UP,e,!0)),this._register(Zn(window,Wo.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Ko(this.parentElement,VR(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=To(e),i=Ko(e,VR(".quick-input-titlebar")),n=this._register(new vk(i));n.domNode.classList.add("quick-input-left-action-bar");const s=Ko(i,VR(".quick-input-title")),r=this._register(new vk(i));r.domNode.classList.add("quick-input-right-action-bar");const a=Ko(e,VR(".quick-input-description")),l=Ko(e,VR(".quick-input-header")),c=Ko(l,VR("input.quick-input-check-all"));c.type="checkbox",this._register(eo(c,Wo.CHANGE,e=>{const t=c.checked;x.setAllVisibleChecked(t)})),this._register(Zn(c,Wo.CLICK,e=>{(e.x||e.y)&&g.setFocus()}));const d=Ko(l,VR(".quick-input-description")),h=Ko(l,VR(".quick-input-and-message")),u=Ko(h,VR(".quick-input-filter")),g=this._register(new DR(u));g.setAttribute("aria-describedby",this.idPrefix+"message");const f=Ko(u,VR(".quick-input-visible-count"));f.setAttribute("aria-live","polite"),f.setAttribute("aria-atomic","true");const m=new IR(f,{countFormat:o({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=Ko(u,VR(".quick-input-count"));p.setAttribute("aria-live","polite");const _=new IR(p,{countFormat:o({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")}),b=Ko(l,VR(".quick-input-action")),v=new WR(b);v.label=o("ok","OK"),this._register(v.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));const w=Ko(l,VR(".quick-input-action")),C=new WR(w);C.label=o("custom","Custom"),this._register(C.onDidClick(e=>{this.onDidCustomEmitter.fire()}));const y=Ko(h,VR(`#${this.idPrefix}message.quick-input-message`)),S=new PR(e);S.getContainer().classList.add("quick-input-progress");const x=this._register(new gR(e,this.idPrefix+"list",this.options));this._register(x.onChangedAllVisibleChecked(e=>{c.checked=e})),this._register(x.onChangedVisibleCount(e=>{m.setCount(e)})),this._register(x.onChangedCheckedCount(e=>{_.setCount(e)})),this._register(x.onLeave(()=>{setTimeout(()=>{g.setFocus(),this.controller instanceof KR&&this.controller.canSelectMany&&x.clearFocus()},0)})),this._register(x.onDidChangeFocus(()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")}));const L=Uo(e);return this._register(L),this._register(Zn(e,Wo.FOCUS,e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0},!0)),this._register(L.onDidBlur(()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(),this.previousFocusElement=void 0})),this._register(Zn(e,Wo.FOCUS,e=>{g.setFocus()})),this._register(Zn(e,Wo.KEY_DOWN,t=>{const i=new Ln(t);switch(i.keyCode){case 3:Bo.stop(t,!0),this.onDidAcceptEmitter.fire();break;case 9:Bo.stop(t,!0),this.hide();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]?(Bo.stop(t,!0),o[o.length-1].focus()):i.shiftKey||i.target!==o[o.length-1]||(Bo.stop(t,!0),o[0].focus())}break}})),this.ui={container:e,styleSheet:t,leftActionBar:n,titleBar:i,title:s,description1:a,description2:d,rightActionBar:r,checkAll:c,filterContainer:u,inputBox:g,visibleCountContainer:f,visibleCount:m,countContainer:p,count:_,okContainer:b,ok:v,message:y,customButtonContainer:w,customButton:C,progressBar:S,list:x,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=et.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();e.splice(t,1),r.items=e}}}))),r.onDidChangeValue(e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])}),i.onCancellationRequested(()=>{r.hide()}),r.onDidHide(()=>{Ae(l),s(void 0)})];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 KR(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(Lh.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),jo(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();zR.tooltip=n?o("quickInput.backWithKeybinding","Back ({0})",n):o("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(){var e;const t=this.controller;if(t){const i=!(null===(e=this.ui)||void 0===e?void 0:e.container.contains(document.activeElement));this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",i||(this.previousFocusElement&&this.previousFocusElement.offsetParent?(this.previousFocusElement.focus(),this.previousFocusElement=void 0):this.options.returnFocus()),t.didHide()}}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,jR.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.listInactiveFocusForeground&&(s.push(`.monaco-list .monaco-list-row.focused { color: ${this.styles.list.listInactiveFocusForeground}; }`),s.push(`.monaco-list .monaco-list-row.focused:hover { color: ${this.styles.list.listInactiveFocusForeground}; }`)),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}; }`);const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}}jR.MAX_WIDTH=600;const qR=Zi("quickInputService");var $R;(function(e){e[e["PRESERVE"]=0]="PRESERVE",e[e["LAST"]=1]="LAST"})($R||($R={}));const GR={Quickaccess:"workbench.contributions.quickaccess"};class YR{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),Pe(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return lc([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){const t=e&&this.providers.find(t=>e.startsWith(t.prefix))||void 0;return t||this.defaultProvider}}Ah.add(GR.Quickaccess,new YR);var XR=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=function(e,t){return function(i,n){t(i,n,e)}};let QR=class extends We{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Ah.as(GR.Quickaccess),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?void 0:s.descriptor;if(s&&o&&r===o)return e===o.prefix||(null===t||void 0===t?void 0:t.preserveValue)||(s.picker.value=e),void this.adjustValueSelection(s.picker,o,t);if(o&&!(null===t||void 0===t?void 0:t.preserveValue)){let t=void 0;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?void 0:n.defaultFilterValue;e===$R.LAST?t=this.lastAcceptedPickerValues.get(o):"string"===typeof e&&(t=`${o.prefix}${e}`)}"string"===typeof t&&(e=t)}const a=new Fe,l=a.add(this.quickInputService.createQuickPick());l.value=e,this.adjustValueSelection(l,o,t),l.placeholder=null===o||void 0===o?void 0:o.placeholder,l.quickNavigate=null===t||void 0===t?void 0:t.quickNavigateConfiguration,l.hideInput=!!l.quickNavigate&&!s,("number"===typeof(null===t||void 0===t?void 0:t.itemActivation)||(null===t||void 0===t?void 0:t.quickNavigateConfiguration))&&(l.itemActivation=null!==(i=null===t||void 0===t?void 0:t.itemActivation)&&void 0!==i?i:BA.SECOND),l.contextKey=null===o||void 0===o?void 0:o.contextKey,l.filterValue=e=>e.substring(o?o.prefix.length:0),(null===o||void 0===o?void 0:o.placeholder)&&(l.ariaLabel=null===o||void 0===o?void 0:o.placeholder);const c=this.registerPickerListeners(l,n,o,e,a);n&&a.add(n.provide(l,c)),l.show()}adjustValueSelection(e,t,i){var n;let o;o=(null===i||void 0===i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null===t||void 0===t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n,o){const s=this.visibleQuickAccess={picker:e,descriptor:i,value:n};o.add(Pe(()=>{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)}));const r=o.add(new it);return NS(e.onDidHide)(()=>{0===e.selectedItems.length&&r.cancel(),o.dispose()}),r.token}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]}};QR=XR([ZR(0,qR),ZR(1,Yi)],QR);var 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},eP=function(e,t){return function(i,n){t(i,n,e)}};let tP=class extends Rf{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(QR))),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(WO,e,t,i,n,o),styles:this.computeStyles()},s=this._register(new jR(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.onLayout(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 wf(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=et.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},PI(this.theme,{quickInputBackground:sw,quickInputForeground:rw,quickInputTitleBackground:aw,contrastBorder:pv,widgetShadow:bv})),inputBox:PI(this.theme,{inputForeground:wv,inputBackground:vv,inputBorder:Cv,inputValidationInfoBackground:yv,inputValidationInfoForeground:Sv,inputValidationInfoBorder:xv,inputValidationWarningBackground:Lv,inputValidationWarningForeground:kv,inputValidationWarningBorder:Ev,inputValidationErrorBackground:Dv,inputValidationErrorForeground:Nv,inputValidationErrorBorder:Iv}),countBadge:PI(this.theme,{badgeBackground:Pv,badgeForeground:Fv,badgeBorder:pv}),button:PI(this.theme,{buttonForeground:Ov,buttonBackground:Av,buttonHoverBackground:Rv,buttonBorder:pv}),progressBar:PI(this.theme,{progressBarBackground:zv}),list:PI(this.theme,{listBackground:sw,listInactiveFocusForeground:Lw,listInactiveFocusBackground:xw,listFocusOutline:_v,listInactiveFocusOutline:_v,pickerGroupBorder:cw,pickerGroupForeground:lw})}}};tP=JR([eP(0,Yi),eP(1,Cf),eP(2,kf),eP(3,CL),eP(4,qI)],tP);var iP=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},nP=function(e,t){return function(i,n){t(i,n,e)}};let oP=class extends tP{constructor(e,t,i,n,o,s){super(t,i,n,o,s),this.host=void 0;const r=rP.get(e);this.host={_serviceBrand:void 0,get container(){return r.widget.getDomNode()},get dimension(){return e.getLayoutInfo()},get onLayout(){return e.onDidLayoutChange},focus:()=>e.focus()}}createController(){return super.createController(this.host)}};oP=iP([nP(1,Yi),nP(2,Cf),nP(3,kf),nP(4,CL),nP(5,qI)],oP);let sP=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(oP,e);this.mapEditorToService.set(e,t),NS(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},i=et.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}};sP=iP([nP(0,Yi),nP(1,Ji)],sP);class rP{constructor(e){this.editor=e,this.widget=new aP(this.editor)}static get(e){return e.getContribution(rP.ID)}dispose(){this.widget.dispose()}}rP.ID="editor.controller.quickInput";class aP{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return aP.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}var lP;aP.ID="editor.contrib.quickInputWidget",Qf(rP.ID,rP),function(e){const t=new wL;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}function s(e){let t=new wL;for(const[n,o]of dk())t.set(n,o);for(let n in e)e.hasOwnProperty(n)&&t.set(Zi(n),e[n]);n.forEach(i=>t.set(i.id,i.get(e)));let i=new tT(t,!0);return t.set(Yi,i),[t,i]}e.init=s,e.instantiationService=o(Yi,()=>new tT(t,!0));const r=new wg;e.configurationService=o(Cu,()=>r),e.resourceConfigurationService=o(Qc,()=>new Cg(r)),e.resourcePropertiesService=o(Jc,()=>new yg(r)),e.contextService=o(Zu,()=>new xg),e.labelService=o(nT,()=>new Eg),e.telemetryService=o(Kf,()=>new Sg),e.dialogService=o(XI,()=>new mg),e.notificationService=o(Yu,()=>new pg),e.markerService=o(JO,()=>new iA),e.modeService=o(nl,e=>new $E),e.standaloneThemeService=o(pE,()=>new cN),e.logService=o(ed,()=>new od),e.undoRedoService=o(GE,t=>new PA(e.dialogService.get(t),e.notificationService.get(t))),e.modelService=o(aa,t=>new wD(e.configurationService.get(t),e.resourcePropertiesService.get(t),e.standaloneThemeService.get(t),e.logService.get(t),e.undoRedoService.get(t))),e.markerDecorationsService=o(uA,t=>new _A(e.modelService.get(t),e.markerService.get(t))),e.codeEditorService=o(Ji,t=>new WD(e.standaloneThemeService.get(t))),e.editorProgressService=o(qk,()=>new fg),e.storageService=o(oA,()=>new aA),e.editorWorkerService=o(il,t=>new hd(e.modelService.get(t),e.resourceConfigurationService.get(t),e.logService.get(t)))}(lP||(lP={}));class cP extends We{constructor(e,t){super();const[i,n]=lP.init(t);this._serviceCollection=i,this._instantiationService=n;const o=this.get(Cu),s=this.get(Yu),r=this.get(Kf),a=this.get(kf),l=this.get(ed);let c=(e,i)=>{let n=null;return t&&(n=t[e.toString()]),n||(n=i()),this._serviceCollection.set(e,n),n},d=c(Cf,()=>this._register(new CN(o)));c(CL,()=>new wA(d,o)),c(fO,()=>new mO(a));let h=c(Hs,()=>new _g(this._instantiationService)),u=c(_E,()=>this._register(new bg(d,h,r,s,l,e))),g=c(qI,()=>new Dg(lP.codeEditorService.get(Ji),e));c(qR,()=>new sP(n,lP.codeEditorService.get(Ji)));let f=c(Vk,()=>this._register(new YI(g)));c(Kk,()=>new yA),c(Hk,()=>{const e=new jI(r,s,f,u,a);return e.configure({blockMouse:!1}),this._register(e)}),c(Vf,()=>new dA(h)),c(Eh,()=>new kg(lP.modelService.get(aa)))}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 dP(e,t,i){let n=new cP(e,t),o=null;n.has(ol)||(o=new gg(lP.modelService.get()),n.set(ol,o)),n.has(js)||n.set(js,new Qs(n.get(Ji),n.get(Hs)));let s=i(n);return o&&o.setEditor(s),s}function hP(e,t,i){return dP(e,i||{},i=>new xE(e,t,i,i.get(Yi),i.get(Ji),i.get(Hs),i.get(Cf),i.get(_E),i.get(Vk),i.get(pE),i.get(Yu),i.get(Cu),i.get(CL),i.get(aa),i.get(nl)))}function uP(e){return lP.codeEditorService.get().onCodeEditorAdd(t=>{e(t)})}function gP(e,t,i){return dP(e,i||{},i=>new LE(e,t,i,i.get(Yi),i.get(Cf),i.get(_E),i.get(Vk),i.get(il),i.get(Ji),i.get(pE),i.get(Yu),i.get(Cu),i.get(Hk),i.get(qk),i.get(Kk)))}function fP(e,t){return new ar(e,t)}function mP(e,t,i){return kE(lP.modelService.get(),lP.modeService.get(),e,t,i)}function pP(e,t){lP.modelService.get().setMode(e,lP.modeService.get().create(t))}function _P(e,t,i){e&&lP.markerService.get().changeOne(t,e.uri,i)}function bP(e){return lP.markerService.get().read(e)}function vP(e){return lP.markerService.get().onMarkerChanged(e)}function wP(e){return lP.modelService.get().getModel(e)}function CP(){return lP.modelService.get().getModels()}function yP(e){return lP.modelService.get().onModelAdded(e)}function SP(e){return lP.modelService.get().onModelRemoved(e)}function xP(e){return lP.modelService.get().onModelModeChanged(t=>{e({model:t.model,oldLanguage:t.oldModeId})})}function LP(e){return bd(lP.modelService.get(),e)}function kP(e,t){const i=lP.standaloneThemeService.get();return i.registerEditorContainer(e),wh.colorizeElement(i,lP.modeService.get(),e,t)}function EP(e,t,i){const n=lP.standaloneThemeService.get();return n.registerEditorContainer(document.body),wh.colorize(lP.modeService.get(),e,t,i)}function DP(e,t,i=4){const n=lP.standaloneThemeService.get();return n.registerEditorContainer(document.body),wh.colorizeModelLine(e,t,i)}function NP(e){let t=Ga.get(e);return t||{getInitialState:()=>Xa,tokenize:(t,i,n,o)=>Ja(e,t,n,o)}}function IP(e,t){let i=lP.modeService.get();i.triggerMode(t);let n=NP(t),o=Object(rs["P"])(e),s=[],r=n.getInitialState();for(let a=0,l=o.length;a=0&&i<5)i++,t=t.replace(/@(\w+)/g,(function(i,n){let o="";if("string"===typeof e[n])o=e[n];else{if(!(e[n]&&e[n]instanceof RegExp))throw void 0===e[n]?nh(e,"language definition does not contain attribute '"+n+"', used at: "+t):nh(e,"attribute reference '"+n+"' must be a string, used at: "+t);o=e[n].source}return Jd(o)?"":"(?:"+o+")"}));let n=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,n)}function zP(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 nh(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 nh(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&&!rh(e,oh(e,o,"",[],""))))throw nh(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=HP(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=KP(e,this.name,t)}}function qP(e,t){if(!t||"object"!==typeof t)throw new Error("Monarch: expecting a language definition object");let i={};i.languageId=e,i.includeLF=FP(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"===typeof t.start?t.start:null,i.ignoreCase=FP(t.ignoreCase,!1),i.unicode=FP(t.unicode,!1),i.tokenPostfix=WP(t.tokenPostfix,"."+i.languageId),i.defaultToken=WP(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 nh(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw nh(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new jP(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 nh(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 nh(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=FP(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 nh(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(let r in t.tokenizer)if(t.tokenizer.hasOwnProperty(r)){i.start||(i.start=r);const e=t.tokenizer[r];i.tokenizer[r]=new Array,o("tokenizer."+r,i.tokenizer[r],e)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw nh(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 r of t.brackets){let e=r;if(e&&Array.isArray(e)&&3===e.length&&(e={token:e[2],open:e[0],close:e[1]}),e.open===e.close)throw nh(i,"open and close brackets in a 'brackets' attribute must be different: "+e.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!==typeof e.open||"string"!==typeof e.token||"string"!==typeof e.close)throw nh(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:e.token+i.tokenPostfix,open:eh(i,e.open),close:eh(i,e.close)})}return i.brackets=s,i.noThrow=!0,i}function $P(e){HE.registerLanguage(e)}function GP(){let e=[];return e=e.concat(HE.getLanguages()),e}function YP(e){let t=lP.modeService.get().getLanguageIdentifier(e);return t?t.id:0}function XP(e,t){let i=lP.modeService.get().onDidCreateMode(n=>{n.getId()===e&&(i.dispose(),t())});return i}function ZP(e,t){let i=lP.modeService.get().getLanguageIdentifier(e);if(!i)throw new Error("Cannot set configuration for unknown language "+e);return ec.register(i,t)}class QP{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 JP.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 ui(n.tokens,n.endState)}}class JP{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]===c)continue;let d=a.startIndex;0===l?d=0:deF(e)?new QP(i,e):new JP(lP.standaloneThemeService.get(),i,e);return tF(t)?Ga.registerPromise(e,t.then(e=>n(e))):Ga.register(e,n(t))}function oF(e,t){const i=t=>_h(lP.modeService.get(),lP.standaloneThemeService.get(),e,qP(e,t));return tF(t)?Ga.registerPromise(e,t.then(e=>i(e))):Ga.register(e,i(t))}function sF(e,t){return xa.register(e,t)}function rF(e,t){return La.register(e,t)}function aF(e,t){return Ea.register(e,t)}function lF(e,t){return Da.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 li(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),e.range||(e.range=new li(i.lineNumber,i.column,i.lineNumber,i.column)),e})}})}function cF(e,t){return Na.register(e,t)}function dF(e,t){return Ia.register(e,t)}function hF(e,t){return Ta.register(e,t)}function uF(e,t){return Ma.register(e,t)}function gF(e,t){return Aa.register(e,t)}function fF(e,t){return Ra.register(e,t)}function mF(e,t){return Pa.register(e,t)}function pF(e,t){return Wa.register(e,{provideCodeActions:(e,i,n,o)=>{let s=lP.markerService.get().read({resource:e.uri}).filter(e=>li.areIntersectingOrTouching(e,i));return t.provideCodeActions(e,i,{markers:s,only:n.only},o)}})}function _F(e,t){return Ba.register(e,t)}function bF(e,t){return Va.register(e,t)}function vF(e,t){return Ha.register(e,t)}function wF(e,t){return za.register(e,t)}function CF(e,t){return ka.register(e,t)}function yF(e,t){return Ua.register(e,t)}function SF(e,t){return ja.register(e,t)}function xF(e,t){return Oa.register(e,t)}function LF(e,t){return Ka.register(e,t)}function kF(e,t){return qa.register(e,t)}function EF(e,t){return $a.register(e,t)}function DF(){return{register:$P,getLanguages:GP,onLanguage:XP,getEncodedLanguageId:YP,setLanguageConfiguration:ZP,setColorMap:iF,setTokensProvider:nF,setMonarchTokensProvider:oF,registerReferenceProvider:sF,registerRenameProvider:rF,registerCompletionItemProvider:CF,registerSignatureHelpProvider:aF,registerHoverProvider:lF,registerDocumentSymbolProvider:cF,registerDocumentHighlightProvider:dF,registerLinkedEditingRangeProvider:hF,registerDefinitionProvider:uF,registerImplementationProvider:gF,registerTypeDefinitionProvider:fF,registerCodeLensProvider:mF,registerCodeActionProvider:pF,registerDocumentFormattingEditProvider:_F,registerDocumentRangeFormattingEditProvider:bF,registerOnTypeFormattingEditProvider:vF,registerLinkProvider:wF,registerColorProvider:yF,registerFoldingRangeProvider:SF,registerDeclarationProvider:xF,registerSelectionRangeProvider:LF,registerDocumentSemanticTokensProvider:kF,registerDocumentRangeSemanticTokensProvider:EF,DocumentHighlightKind:Ci,CompletionItemKind:mi,CompletionItemTag:pi,CompletionItemInsertTextRule:fi,SymbolKind:Vi,SymbolTag:Hi,IndentAction:ki,CompletionTriggerKind:_i,SignatureHelpTriggerKind:Bi,FoldingRangeKind:Sa}}class NF{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"===typeof e?e.toLowerCase():e._lower}}var IF,TF,MF=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function OF(e){const t=[],i=new Set,n=Ba.ordered(e);for(const s of n)t.push(s),s.extensionId&&i.add(NF.toKey(s.extensionId));const o=Va.ordered(e);for(const s of o){if(s.extensionId){if(i.has(NF.toKey(s.extensionId)))continue;i.add(NF.toKey(s.extensionId))}t.push({displayName:s.displayName,extensionId:s.extensionId,provideDocumentFormattingEdits(e,t,i){return s.provideDocumentRangeFormattingEdits(e,e.getFullModelRange(),t,i)}})}return t}class AF{static setFormatterSelector(e){const t=AF._selectors.unshift(e);return{dispose:t}}static select(e,t,i){return MF(this,void 0,void 0,(function*(){if(0===e.length)return;const n=Ee.first(AF._selectors);return n?yield n(e,t,i):void 0}))}}function RF(e,t,i,n,o){return MF(this,void 0,void 0,(function*(){const s=Va.ordered(t);for(const r of s){let s=yield Promise.resolve(r.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(we);if(dc(s))return yield e.computeMoreMinimalEdits(t.uri,s)}}))}function PF(e,t,i,n){return MF(this,void 0,void 0,(function*(){const o=OF(t);for(const s of o){let o=yield Promise.resolve(s.provideDocumentFormattingEdits(t,i,n)).catch(we);if(dc(o))return yield e.computeMoreMinimalEdits(t.uri,o)}}))}function FF(e,t,i,n,o){const s=Ha.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,et.None)).catch(we).then(i=>e.computeMoreMinimalEdits(t.uri,i))}AF._selectors=new ze,zs.registerCommand("_executeFormatRangeProvider",(function(e,...t){const[i,n,o]=t;Os(Xt.isUri(i)),Os(li.isIRange(n));const s=e.get(aa).getModel(i);if(!s)throw Le("resource");return RF(e.get(il),s,li.lift(n),o,et.None)})),zs.registerCommand("_executeFormatDocumentProvider",(function(e,...t){const[i,n]=t;Os(Xt.isUri(i));const o=e.get(aa).getModel(i);if(!o)throw Le("resource");return PF(e.get(il),o,n,et.None)})),zs.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){const[i,n,o,s]=t;Os(Xt.isUri(i)),Os(ai.isIPosition(n)),Os("string"===typeof o);const r=e.get(aa).getModel(i);if(!r)throw Le("resource");return FF(e.get(il),r,ai.lift(n),o,s)})),pe.wrappingIndent.defaultValue=0,pe.glyphMargin.defaultValue=!1,pe.autoIndent.defaultValue=3,pe.overviewRulerLanes.defaultValue=2,AF.setFormatterSelector((e,t,i)=>Promise.resolve(e[0]));const WF=$i();WF.editor=RP(),WF.languages=DF();const BF=WF.CancellationTokenSource,VF=WF.Emitter,HF=WF.KeyCode,zF=WF.KeyMod,UF=WF.Position,KF=WF.Range,jF=WF.Selection,qF=WF.SelectionDirection,$F=WF.MarkerSeverity,GF=WF.MarkerTag,YF=WF.Uri,XF=WF.Token,ZF=WF.editor,QF=WF.languages;((null===(IF=s["b"].MonacoEnvironment)||void 0===IF?void 0:IF.globalAPI)||(null===(TF=s["b"].define)||void 0===TF?void 0:TF.amd))&&(self.monaco=WF),"undefined"!==typeof 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"]})},"7f17":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},"7f36":function(e,t,i){"use strict";var n=i("7eca");i.d(t,"a",(function(){return n["languages"]}))},"7f82":function(e,t,i){var n=i("eee7");e.exports=function(e,t){if(!n(e))return e;var i,o;if(t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;if("function"==typeof(i=e.valueOf)&&!n(o=i.call(e)))return o;if(!t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},"80db":function(e,t){var i=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:i)(e)}},8120:function(e,t,i){"use strict";var n=i("83ec"),o=i("3395").trim,s=i("c55c");n({target:"String",proto:!0,forced:s("trim")},{trim:function(){return o(this)}})},"826e":function(e,t,i){"use strict";i.d(t,"a",(function(){return d}));i("eb46"),i("2c50"),i("9bf1"),i("d927"),i("ef61"),i("fa89"),i("2eb0"),i("f05e"),i("b485"),i("a8de"),i("7352"),i("8120"),i("f96e"),i("b13d");var n,o,s,r=i("5491"),a=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/,c={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"'":"\\'","\\":"\\\\"};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.space||2,n=0!=t.dropQuotesOnKeys,o=t.dropQuotesOnNumbers||!1,s=t.inlineShortArrays||!1,r=t.inlineShortArraysDepth||1,a=t.quoteType||"single",l=t.minify||!1;o&&h(e);var c=f(e,null,l?void 0:i,n,a);if(s&&!l){var d=g(c);if(r>1)for(var u=1;ux;x++)if((g||x in C)&&(b=C[x],v=y(b,x,w),e))if(t)k[x]=v;else if(v)switch(e){case 3:return!0;case 5:return b;case 6:return x;case 2:l.call(k,b)}else switch(e){case 4:return!1;case 7:l.call(k,b)}return h?-1:c||d?d:k}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},"8c32":function(e,t,i){var n=i("e09a");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("bbcfab50",n,!0,{sourceMap:!1,shadowMode:!1})},"8c42":function(e,t,i){var n=i("fe32"),o=i("c1ca"),s=i("42b1"),r=i("b896");e.exports=function(e,t){for(var i=o(t),a=r.f,l=s.f,c=0;c1?arguments[1]:void 0)}})},"8dab":function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{-moz-user-select:none;user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;-ms-touch-action:none;touch-action:none}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-list:focus .monaco-list-row.selected .codicon{color:inherit}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000}.monaco-list-type-filter{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;border-radius:2px;padding:0 3px;max-width:calc(100% - 10px);text-overflow:ellipsis;overflow:hidden;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:all-scroll;font-size:13px;line-height:18px;height:20px;z-index:1;top:4px}.monaco-list-type-filter.dragging{-webkit-transition:top .2s,left .2s;transition:top .2s,left .2s}.monaco-list-type-filter.ne{right:4px}.monaco-list-type-filter.nw{left:4px}.monaco-list-type-filter>.controls{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .2s;transition:width .2s;width:0}.monaco-list-type-filter.dragging>.controls,.monaco-list-type-filter:hover>.controls{width:36px}.monaco-list-type-filter>.controls>*{border:none;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;background:none;width:16px;height:16px;-ms-flex-negative:0;flex-shrink:0;margin:0;padding:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;cursor:pointer}.monaco-list-type-filter>.controls>.filter{margin-left:4px}.monaco-list-type-filter-message{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-list-type-filter{cursor:-webkit-grab;cursor:grab}.monaco-list-type-filter.dragging{cursor:-webkit-grabbing;cursor:grabbing}",""]),e.exports=t},"8fed":function(e,t,i){var n=i("f79e"),o=i("2c21"),s=i("ac97");e.exports=!!Object.getOwnPropertySymbols&&!s((function(){return!Symbol.sham&&(n?38===o:o>37&&o<41)}))},9368:function(e,t,i){var n=i("3c82");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("3e21d075",n,!0,{sourceMap:!1,shadowMode:!1})},9532:function(e,t,i){var n=i("8a16");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("3f644738",n,!0,{sourceMap:!1,shadowMode:!1})},9550:function(e,t,i){var n=i("2f6c"),o=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(e){return o.call(e)}),e.exports=n.inspectSource},"95d1":function(e,t,i){var n=i("e244"),o=i("a909"),s=i("e2da"),r=i("69f1"),a=i("1810"),l=a("iterator"),c=a("toStringTag"),d=s.values;for(var h in o){var u=n[h],g=u&&u.prototype;if(g){if(g[l]!==d)try{r(g,l,d)}catch(m){g[l]=d}if(g[c]||r(g,c,h),o[h])for(var f in s)if(g[f]!==s[f])try{r(g,f,s[f])}catch(m){g[f]=s[f]}}}},"986e":function(e,t,i){var n=i("f0db"),o=i("2f6c");(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.11.0",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"99ab":function(e,t,i){var n=i("83ec"),o=i("d362");n({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},"9b3a":function(e,t,i){"use strict";var n=i("88d2"),o=i.n(n);o.a},"9bf1":function(e,t,i){"use strict";var n=i("83ec"),o=i("eee7"),s=i("5a43"),r=i("3352"),a=i("ce47"),l=i("45ad"),c=i("acd4"),d=i("1810"),h=i("72d4"),u=h("slice"),g=d("species"),f=[].slice,m=Math.max;n({target:"Array",proto:!0,forced:!u},{slice:function(e,t){var i,n,d,h=l(this),u=a(h.length),p=r(e,u),_=r(void 0===t?u:t,u);if(s(h)&&(i=h.constructor,"function"!=typeof i||i!==Array&&!s(i.prototype)?o(i)&&(i=i[g],null===i&&(i=void 0)):i=void 0,i===Array||void 0===i))return f.call(h,p,_);for(n=new(void 0===i?Array:i)(m(_-p,0)),d=0;p<_;p++,d++)p in h&&c(n,d,h[p]);return n.length=d,n}})},"9c85":function(e,t,i){var n=i("eca0");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("46bf518f",n,!0,{sourceMap:!1,shadowMode:!1})},"9d6f":function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{-moz-user-select:none;user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .mtkz{display:inline-block}",""]),e.exports=t},a056:function(e,t,i){var n=i("ac97"),o=/#|\.prototype\./,s=function(e,t){var i=a[r(e)];return i==c||i!=l&&("function"==typeof t?n(t):!!t)},r=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},a=s.data={},l=s.NATIVE="N",c=s.POLYFILL="P";e.exports=s},a078:function(e,t,i){"use strict";var n=i("4eaf").charAt,o=i("35d6"),s=i("325d"),r="String Iterator",a=o.set,l=o.getterFor(r);s(String,"String",(function(e){a(this,{type:r,string:String(e),index:0})}),(function(){var e,t=l(this),i=t.string,o=t.index;return o>=i.length?{value:void 0,done:!0}:(e=n(i,o),t.index+=e.length,{value:e,done:!1})}))},a0c9:function(e,t,i){"use strict";e.exports=function(e,t){return t||(t={}),e=e&&e.__esModule?e.default:e,"string"!==typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},a23c:function(e,t,i){var n=i("e263");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("f22d8072",n,!0,{sourceMap:!1,shadowMode:!1})},a2e5:function(e,t,i){var n=i("3f13");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("b6bc25aa",n,!0,{sourceMap:!1,shadowMode:!1})},a52d:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}",""]),e.exports=t},a53d:function(e,t,i){var n=i("1810"),o=i("d85b"),s=n("iterator"),r=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||r[s]===e)}},a55b:function(e,t,i){var n=i("fbcf"),o=i("7f17"),s=i("1810"),r=s("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||void 0==(i=n(s)[r])?t:o(i)}},a5f6:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"form-config-container"},[i("el-form",{attrs:{"label-position":"left","label-suffix":":","label-width":"130px",size:"small"}},[i("el-form-item",{attrs:{label:"标签对齐方式"}},[i("el-select",{attrs:{placeholder:"标签对齐方式"},model:{value:e.data.labelPosition,callback:function(t){e.$set(e.data,"labelPosition",t)},expression:"data.labelPosition"}},[i("el-option",{attrs:{label:"左对齐",value:"left"}}),i("el-option",{attrs:{label:"右对齐",value:"right"}}),i("el-option",{attrs:{label:"顶部对齐",value:"top"}})],1)],1),i("el-form-item",{attrs:{label:"标签宽度"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{min:80,max:200,step:10,"controls-position":"right",placeholder:"标签宽度"},model:{value:e.data.labelWidth,callback:function(t){e.$set(e.data,"labelWidth",t)},expression:"data.labelWidth"}})],1),i("el-form-item",{attrs:{label:"标签后缀"}},[i("el-input",{attrs:{placeholder:"标签后缀"},model:{value:e.data.labelSuffix,callback:function(t){e.$set(e.data,"labelSuffix",t)},expression:"data.labelSuffix"}})],1),i("el-form-item",{attrs:{label:"项之间的间隔"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{min:0,max:60,step:5,"controls-position":"right",placeholder:"项之间的间隔"},model:{value:e.data.gutter,callback:function(t){e.$set(e.data,"gutter",t)},expression:"data.gutter"}})],1),i("el-form-item",{attrs:{label:"多分组转标签"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.tabs,callback:function(t){e.$set(e.data,"tabs",t)},expression:"data.tabs"}})],1),i("el-form-item",{attrs:{label:"详情模式"}},[i("el-switch",{model:{value:e.data.detail,callback:function(t){e.$set(e.data,"detail",t)},expression:"data.detail"}})],1),i("el-form-item",{attrs:{label:"显示按钮"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.menuBtn,callback:function(t){e.$set(e.data,"menuBtn",t)},expression:"data.menuBtn"}})],1),e.data.menuBtn?i("el-form-item",{attrs:{label:"显示提交按钮"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.submitBtn,callback:function(t){e.$set(e.data,"submitBtn",t)},expression:"data.submitBtn"}})],1):e._e(),e.data.menuBtn&&e.data.submitBtn?i("el-form-item",{attrs:{label:"提交按钮的文字"}},[i("el-input",{attrs:{placeholder:"提交按钮的文字"},model:{value:e.data.submitText,callback:function(t){e.$set(e.data,"submitText",t)},expression:"data.submitText"}})],1):e._e(),e.data.menuBtn?i("el-form-item",{attrs:{label:"显示清空按钮"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.emptyBtn,callback:function(t){e.$set(e.data,"emptyBtn",t)},expression:"data.emptyBtn"}})],1):e._e(),e.data.menuBtn&&e.data.emptyBtn?i("el-form-item",{attrs:{label:"清空按钮的文字"}},[i("el-input",{attrs:{placeholder:"提交按钮的文字"},model:{value:e.data.emptyText,callback:function(t){e.$set(e.data,"emptyText",t)},expression:"data.emptyText"}})],1):e._e(),i("el-form-item",{attrs:{label:"全局只读"}},[i("el-switch",{model:{value:e.data.readonly,callback:function(t){e.$set(e.data,"readonly",t)},expression:"data.readonly"}})],1),i("el-form-item",{attrs:{label:"全局禁用"}},[i("el-switch",{model:{value:e.data.disabled,callback:function(t){e.$set(e.data,"disabled",t)},expression:"data.disabled"}})],1)],1)],1)},o=[],s={name:"form-config",props:["data"]},r=s,a=i("e3d4"),l=Object(a["a"])(r,n,o,!1,null,null,null);t["a"]=l.exports},a780:function(e,t,i){var n=i("6043");e.exports=n("document","documentElement")},a7f7:function(e,t,i){var n=i("fe32"),o=i("c673"),s=i("5350"),r=i("4467"),a=s("IE_PROTO"),l=Object.prototype;e.exports=r?Object.getPrototypeOf:function(e){return e=o(e),n(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},a8de:function(e,t,i){"use strict";var n=i("e820"),o=i("fbcf"),s=i("ce47"),r=i("80db"),a=i("0874"),l=i("61c0"),c=i("c243"),d=i("ec23"),h=Math.max,u=Math.min,g=function(e){return void 0===e?e:String(e)};n("replace",2,(function(e,t,i,n){var f=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,m=n.REPLACE_KEEPS_$0,p=f?"$":"$0";return[function(i,n){var o=a(this),s=void 0==i?void 0:i[e];return void 0!==s?s.call(i,o,n):t.call(String(o),i,n)},function(e,n){if(!f&&m||"string"===typeof n&&-1===n.indexOf(p)){var a=i(t,e,this,n);if(a.done)return a.value}var _=o(e),b=String(this),v="function"===typeof n;v||(n=String(n));var w=_.global;if(w){var C=_.unicode;_.lastIndex=0}var y=[];while(1){var S=d(_,b);if(null===S)break;if(y.push(S),!w)break;var x=String(S[0]);""===x&&(_.lastIndex=l(b,s(_.lastIndex),C))}for(var L="",k=0,E=0;E=k&&(L+=b.slice(k,N)+A,k=N+D.length)}return L+b.slice(k)}]}))},a909:function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},ac97:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},aca4:function(e,t,i){var n=i("1810");t.f=n},acd4:function(e,t,i){"use strict";var n=i("7f82"),o=i("b896"),s=i("4d82");e.exports=function(e,t,i){var r=n(t);r in e?o.f(e,r,s(0,i)):e[r]=i}},ad2f:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-count-badge{padding:3px 6px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}",""]),e.exports=t},adf0:function(e,t,i){var n=i("a52d");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("44843bab",n,!0,{sourceMap:!1,shadowMode:!1})},b012:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{-webkit-transition:all 80ms;transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{-webkit-box-sizing:border-box;box-sizing:border-box;background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}@-webkit-keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@-webkit-keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@-webkit-keyframes monaco-cursor-expand{0%,20%{-webkit-transform:scaleY(1);transform:scaleY(1)}80%,to{-webkit-transform:scaleY(0);transform:scaleY(0)}}@keyframes monaco-cursor-expand{0%,20%{-webkit-transform:scaleY(1);transform:scaleY(1)}80%,to{-webkit-transform:scaleY(0);transform:scaleY(0)}}.cursor-smooth{-webkit-animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{-webkit-animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{-webkit-animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}",""]),e.exports=t},b042:function(e,t,i){var n=i("e4f5");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("7223b90e",n,!0,{sourceMap:!1,shadowMode:!1})},b105:function(e,t,i){"use strict";var n=i("83ec"),o=i("8aa3").findIndex,s=i("6e10"),r="findIndex",a=!0;r in[]&&Array(1)[r]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),s(r)},b13d:function(e,t,i){"use strict";var n=i("83ec");n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},b485:function(e,t,i){"use strict";var n=i("e820"),o=i("fbcf"),s=i("ce47"),r=i("0874"),a=i("61c0"),l=i("ec23");n("match",1,(function(e,t,i){return[function(t){var i=r(this),n=void 0==t?void 0:t[e];return void 0!==n?n.call(t,i):new RegExp(t)[e](String(i))},function(e){var n=i(t,e,this);if(n.done)return n.value;var r=o(e),c=String(this);if(!r.global)return l(r,c);var d=r.unicode;r.lastIndex=0;var h,u=[],g=0;while(null!==(h=l(r,c))){var f=String(h[0]);u[g]=f,""===f&&(r.lastIndex=a(c,s(r.lastIndex),d)),g++}return 0===g?null:u}]}))},b4fd:function(e,t,i){var n=i("ac97"),o=i("c401"),s="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?s.call(e,""):Object(e)}:Object},b856:function(e,t,i){var n=i("b012");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("6a89fb2a",n,!0,{sourceMap:!1,shadowMode:!1})},b896:function(e,t,i){var n=i("55ab"),o=i("bf6f"),s=i("fbcf"),r=i("7f82"),a=Object.defineProperty;t.f=n?a:function(e,t,i){if(s(e),t=r(t,!0),s(i),o)try{return a(e,t,i)}catch(n){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},bd77:function(e,t,i){var n=i("8fed");e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},bf1d:function(e,t,i){var n=i("45ad"),o=i("f0f1").f,s={}.toString,r="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return o(e)}catch(t){return r.slice()}};e.exports.f=function(e){return r&&"[object Window]"==s.call(e)?a(e):o(n(e))}},bf6f:function(e,t,i){var n=i("55ab"),o=i("ac97"),s=i("f146");e.exports=!n&&!o((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},c09a:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:hsla(0,0%,100%,.01)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:hsla(0,0%,67.1%,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{font-size:11px!important;opacity:.7!important;display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign{opacity:1}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}",""]),e.exports=t},c1ca:function(e,t,i){var n=i("6043"),o=i("f0f1"),s=i("0ef1"),r=i("fbcf");e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(r(e)),i=s.f;return i?t.concat(i(e)):t}},c223: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 c})),i.d(t,"c",(function(){return d})),i.d(t,"f",(function(){return h})),i.d(t,"d",(function(){return u})),i.d(t,"g",(function(){return g}));var n=i("3fa4");const o="undefined"!==typeof 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 c(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function d(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 h(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("f20c").Buffer)},c225:function(e,t,i){"use strict";var n=i("83ec"),o=i("e244"),s=i("6043"),r=i("f0db"),a=i("55ab"),l=i("8fed"),c=i("bd77"),d=i("ac97"),h=i("fe32"),u=i("5a43"),g=i("eee7"),f=i("fbcf"),m=i("c673"),p=i("45ad"),_=i("7f82"),b=i("4d82"),v=i("ca2b"),w=i("3e1a"),C=i("f0f1"),y=i("bf1d"),S=i("0ef1"),x=i("42b1"),L=i("b896"),k=i("11b0"),E=i("69f1"),D=i("7d86"),N=i("986e"),I=i("5350"),T=i("fd3f"),M=i("76b2"),O=i("1810"),A=i("aca4"),R=i("6baf"),P=i("63ef"),F=i("35d6"),W=i("8aa3").forEach,B=I("hidden"),V="Symbol",H="prototype",z=O("toPrimitive"),U=F.set,K=F.getterFor(V),j=Object[H],q=o.Symbol,$=s("JSON","stringify"),G=x.f,Y=L.f,X=y.f,Z=k.f,Q=N("symbols"),J=N("op-symbols"),ee=N("string-to-symbol-registry"),te=N("symbol-to-string-registry"),ie=N("wks"),ne=o.QObject,oe=!ne||!ne[H]||!ne[H].findChild,se=a&&d((function(){return 7!=v(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=G(j,t);n&&delete j[t],Y(e,t,i),n&&e!==j&&Y(j,t,n)}:Y,re=function(e,t){var i=Q[e]=v(q[H]);return U(i,{type:V,tag:e,description:t}),a||(i.description=t),i},ae=c?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof q},le=function(e,t,i){e===j&&le(J,t,i),f(e);var n=_(t,!0);return f(i),h(Q,n)?(i.enumerable?(h(e,B)&&e[B][n]&&(e[B][n]=!1),i=v(i,{enumerable:b(0,!1)})):(h(e,B)||Y(e,B,b(1,{})),e[B][n]=!0),se(e,n,i)):Y(e,n,i)},ce=function(e,t){f(e);var i=p(t),n=w(i).concat(fe(i));return W(n,(function(t){a&&!he.call(i,t)||le(e,t,i[t])})),e},de=function(e,t){return void 0===t?v(e):ce(v(e),t)},he=function(e){var t=_(e,!0),i=Z.call(this,t);return!(this===j&&h(Q,t)&&!h(J,t))&&(!(i||!h(this,t)||!h(Q,t)||h(this,B)&&this[B][t])||i)},ue=function(e,t){var i=p(e),n=_(t,!0);if(i!==j||!h(Q,n)||h(J,n)){var o=G(i,n);return!o||!h(Q,n)||h(i,B)&&i[B][n]||(o.enumerable=!0),o}},ge=function(e){var t=X(p(e)),i=[];return W(t,(function(e){h(Q,e)||h(T,e)||i.push(e)})),i},fe=function(e){var t=e===j,i=X(t?J:p(e)),n=[];return W(i,(function(e){!h(Q,e)||t&&!h(j,e)||n.push(Q[e])})),n};if(l||(q=function(){if(this instanceof q)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=M(e),i=function(e){this===j&&i.call(J,e),h(this,B)&&h(this[B],t)&&(this[B][t]=!1),se(this,t,b(1,e))};return a&&oe&&se(j,t,{configurable:!0,set:i}),re(t,e)},D(q[H],"toString",(function(){return K(this).tag})),D(q,"withoutSetter",(function(e){return re(M(e),e)})),k.f=he,L.f=le,x.f=ue,C.f=y.f=ge,S.f=fe,A.f=function(e){return re(O(e),e)},a&&(Y(q[H],"description",{configurable:!0,get:function(){return K(this).description}}),r||D(j,"propertyIsEnumerable",he,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:q}),W(w(ie),(function(e){R(e)})),n({target:V,stat:!0,forced:!l},{for:function(e){var t=String(e);if(h(ee,t))return ee[t];var i=q(t);return ee[t]=i,te[i]=t,i},keyFor:function(e){if(!ae(e))throw TypeError(e+" is not a symbol");if(h(te,e))return te[e]},useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),n({target:"Object",stat:!0,forced:!l,sham:!a},{create:de,defineProperty:le,defineProperties:ce,getOwnPropertyDescriptor:ue}),n({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:ge,getOwnPropertySymbols:fe}),n({target:"Object",stat:!0,forced:d((function(){S.f(1)}))},{getOwnPropertySymbols:function(e){return S.f(m(e))}}),$){var me=!l||d((function(){var e=q();return"[null]"!=$([e])||"{}"!=$({a:e})||"{}"!=$(Object(e))}));n({target:"JSON",stat:!0,forced:me},{stringify:function(e,t,i){var n,o=[e],s=1;while(arguments.length>s)o.push(arguments[s++]);if(n=t,(g(t)||void 0!==e)&&!ae(e))return u(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!ae(t))return t}),o[1]=t,$.apply(null,o)}})}q[H][z]||E(q[H],z,q[H].valueOf),P(q,V),T[B]=!0},c243:function(e,t,i){var n=i("c673"),o=Math.floor,s="".replace,r=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,i,l,c,d){var h=i+e.length,u=l.length,g=a;return void 0!==c&&(c=n(c),g=r),s.call(d,g,(function(n,s){var r;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,i);case"'":return t.slice(h);case"<":r=c[s.slice(1,-1)];break;default:var a=+s;if(0===a)return n;if(a>u){var d=o(a/10);return 0===d?n:d<=u?void 0===l[d-1]?s.charAt(1):l[d-1]+s.charAt(1):n}r=l[a-1]}return void 0===r?"":r}))}},c293:function(module,__webpack_exports__,__webpack_require__){"use strict";var _utils_monaco_editor__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("d895");__webpack_exports__["a"]={name:"config-custom",components:{MonacoEditor:_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_0__["a"]},props:["data"],data:function(){return{params:this.data.params||{},event:this.data.event||{},options:{minimap:{enabled:!1}}}},methods:{},watch:{"data.params":function(e){this.params=e||{}},"data.event":function(e){this.event=e||{}},params:function params(val){try{this.data.params=eval("("+val+")")}catch(e){}},event:function event(val){try{this.data.event=eval("("+val+")")}catch(e){}}}}},c3b4:function(e,t,i){var n=i("10b1");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("77038fc2",n,!0,{sourceMap:!1,shadowMode:!1})},c401:function(e,t){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},c55c:function(e,t,i){var n=i("ac97"),o=i("d554"),s="​…᠎";e.exports=function(e){return n((function(){return!!o[e]()||s[e]()!=s||o[e].name!==e}))}},c673:function(e,t,i){var n=i("0874");e.exports=function(e){return Object(n(e))}},c6b4:function(e,t,i){var n=i("6aad");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("1a9cb28d",n,!0,{sourceMap:!1,shadowMode:!1})},c732:function(e,t,i){var n=i("55ab"),o=i("b896"),s=i("fbcf"),r=i("3e1a");e.exports=n?Object.defineProperties:function(e,t){s(e);var i,n=r(t),a=n.length,l=0;while(a>l)o.f(e,i=n[l++],t[i]);return e}},c8ed:function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(n){"object"===typeof window&&(i=window)}e.exports=i},c901:function(e,t,i){var n=i("f39a");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("635cd606",n,!0,{sourceMap:!1,shadowMode:!1})},c91b:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-text-button{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;padding:4px;text-align:center;cursor:pointer;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled{opacity:.4;cursor:default}.monaco-text-button>.codicon{margin:0 .2em;color:inherit!important}.monaco-button-dropdown{display:-webkit-box;display:-ms-flexbox;display:flex}.monaco-button-dropdown>.monaco-dropdown-button{margin-left:1px}",""]),e.exports=t},ca23:function(e,t,i){var n=i("eee7"),o=i("13a8");e.exports=function(e,t,i){var s,r;return o&&"function"==typeof(s=t.constructor)&&s!==i&&n(r=s.prototype)&&r!==i.prototype&&o(e,r),e}},ca2b:function(e,t,i){var n,o=i("fbcf"),s=i("c732"),r=i("e629"),a=i("fd3f"),l=i("a780"),c=i("f146"),d=i("5350"),h=">",u="<",g="prototype",f="script",m=d("IE_PROTO"),p=function(){},_=function(e){return u+f+h+e+u+"/"+f+h},b=function(e){e.write(_("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){var e,t=c("iframe"),i="java"+f+":";return t.style.display="none",l.appendChild(t),t.src=String(i),e=t.contentWindow.document,e.open(),e.write(_("document.F=Object")),e.close(),e.F},w=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(t){}w=n?b(n):v();var e=r.length;while(e--)delete w[g][r[e]];return w()};a[m]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(p[g]=o(e),i=new p,p[g]=null,i[m]=e):i=w(),void 0===t?i:s(i,t)}},ca84:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".el-tag[data-v-1938f570]{vertical-align:top}.el-tag+.el-tag[data-v-1938f570],.input-new-tag[data-v-1938f570]{margin-left:5px}.input-new-tag[data-v-1938f570]{width:90px;vertical-align:bottom}.color-picker[data-v-1938f570]{left:10px;vertical-align:top}",""]),e.exports=t},cc1a:function(e,t,i){var n=i("11e2");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("52b97b55",n,!0,{sourceMap:!1,shadowMode:!1})},ce47:function(e,t,i){var n=i("80db"),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},d30c:function(e,t,i){"use strict";var n=i("6043"),o=i("b896"),s=i("1810"),r=i("55ab"),a=s("species");e.exports=function(e){var t=n(e),i=o.f;r&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},d31d:function(e,t,i){"use strict";var n,o,s,r,a=i("83ec"),l=i("f0db"),c=i("e244"),d=i("6043"),h=i("fc9a"),u=i("7d86"),g=i("6161"),f=i("63ef"),m=i("d30c"),p=i("eee7"),_=i("7f17"),b=i("d6e4"),v=i("9550"),w=i("d75f"),C=i("59cf"),y=i("a55b"),S=i("59e5").set,x=i("f652"),L=i("3073"),k=i("4fe1"),E=i("fc01"),D=i("53ff"),N=i("35d6"),I=i("a056"),T=i("1810"),M=i("f79e"),O=i("2c21"),A=T("species"),R="Promise",P=N.get,F=N.set,W=N.getterFor(R),B=h,V=c.TypeError,H=c.document,z=c.process,U=d("fetch"),K=E.f,j=K,q=!!(H&&H.createEvent&&c.dispatchEvent),$="function"==typeof PromiseRejectionEvent,G="unhandledrejection",Y="rejectionhandled",X=0,Z=1,Q=2,J=1,ee=2,te=I(R,(function(){var e=v(B)!==String(B);if(!e){if(66===O)return!0;if(!M&&!$)return!0}if(l&&!B.prototype["finally"])return!0;if(O>=51&&/native code/.test(B))return!1;var t=B.resolve(1),i=function(e){e((function(){}),(function(){}))},n=t.constructor={};return n[A]=i,!(t.then((function(){}))instanceof i)})),ie=te||!C((function(e){B.all(e)["catch"]((function(){}))})),ne=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},oe=function(e,t){if(!e.notified){e.notified=!0;var i=e.reactions;x((function(){var n=e.value,o=e.state==Z,s=0;while(i.length>s){var r,a,l,c=i[s++],d=o?c.ok:c.fail,h=c.resolve,u=c.reject,g=c.domain;try{d?(o||(e.rejection===ee&&le(e),e.rejection=J),!0===d?r=n:(g&&g.enter(),r=d(n),g&&(g.exit(),l=!0)),r===c.promise?u(V("Promise-chain cycle")):(a=ne(r))?a.call(r,h,u):h(r)):u(n)}catch(f){g&&!l&&g.exit(),u(f)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&re(e)}))}},se=function(e,t,i){var n,o;q?(n=H.createEvent("Event"),n.promise=t,n.reason=i,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:i},!$&&(o=c["on"+e])?o(n):e===G&&k("Unhandled promise rejection",i)},re=function(e){S.call(c,(function(){var t,i=e.facade,n=e.value,o=ae(e);if(o&&(t=D((function(){M?z.emit("unhandledRejection",n,i):se(G,i,n)})),e.rejection=M||ae(e)?ee:J,t.error))throw t.value}))},ae=function(e){return e.rejection!==J&&!e.parent},le=function(e){S.call(c,(function(){var t=e.facade;M?z.emit("rejectionHandled",t):se(Y,t,e.value)}))},ce=function(e,t,i){return function(n){e(t,n,i)}},de=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=Q,oe(e,!0))},he=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw V("Promise can't be resolved itself");var n=ne(t);n?x((function(){var i={done:!1};try{n.call(t,ce(he,i,e),ce(de,i,e))}catch(o){de(i,o,e)}})):(e.value=t,e.state=Z,oe(e,!1))}catch(o){de({done:!1},o,e)}}};te&&(B=function(e){b(this,B,R),_(e),n.call(this);var t=P(this);try{e(ce(he,t),ce(de,t))}catch(i){de(t,i)}},n=function(e){F(this,{type:R,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:X,value:void 0})},n.prototype=g(B.prototype,{then:function(e,t){var i=W(this),n=K(y(this,B));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=M?z.domain:void 0,i.parent=!0,i.reactions.push(n),i.state!=X&&oe(i,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n,t=P(e);this.promise=e,this.resolve=ce(he,t),this.reject=ce(de,t)},E.f=K=function(e){return e===B||e===s?new o(e):j(e)},l||"function"!=typeof h||(r=h.prototype.then,u(h.prototype,"then",(function(e,t){var i=this;return new B((function(e,t){r.call(i,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof U&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return L(B,U.apply(c,arguments))}}))),a({global:!0,wrap:!0,forced:te},{Promise:B}),f(B,R,!1,!0),m(R),s=d(R),a({target:R,stat:!0,forced:te},{reject:function(e){var t=K(this);return t.reject.call(void 0,e),t.promise}}),a({target:R,stat:!0,forced:l||te},{resolve:function(e){return L(l&&this===s?B:this,e)}}),a({target:R,stat:!0,forced:ie},{all:function(e){var t=this,i=K(t),n=i.resolve,o=i.reject,s=D((function(){var i=_(t.resolve),s=[],r=0,a=1;w(e,(function(e){var l=r++,c=!1;s.push(void 0),a++,i.call(t,e).then((function(e){c||(c=!0,s[l]=e,--a||n(s))}),o)})),--a||n(s)}));return s.error&&o(s.value),i.promise},race:function(e){var t=this,i=K(t),n=i.reject,o=D((function(){var o=_(t.resolve);w(e,(function(e){o.call(t,e).then(i.resolve,n)}))}));return o.error&&n(o.value),i.promise}})},d362:function(e,t,i){"use strict";var n=i("55ab"),o=i("ac97"),s=i("3e1a"),r=i("0ef1"),a=i("11b0"),l=i("c673"),c=i("b4fd"),d=Object.assign,h=Object.defineProperty;e.exports=!d||o((function(){if(n&&1!==d({b:1},d(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),o="abcdefghijklmnopqrst";return e[i]=7,o.split("").forEach((function(e){t[e]=e})),7!=d({},e)[i]||s(d({},t)).join("")!=o}))?function(e,t){var i=l(e),o=arguments.length,d=1,h=r.f,u=a.f;while(o>d){var g,f=c(arguments[d++]),m=h?s(f).concat(h(f)):s(f),p=m.length,_=0;while(p>_)g=m[_++],n&&!u.call(f,g)||(i[g]=f[g])}return i}:d},d53b:function(e,t,i){var n=i("6965"),o=i("c401"),s=i("1810"),r=s("toStringTag"),a="Arguments"==o(function(){return arguments}()),l=function(e,t){try{return e[t]}catch(i){}};e.exports=n?o:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=l(t=Object(e),r))?i:a?o(t):"Object"==(n=o(t))&&"function"==typeof t.callee?"Arguments":n}},d543:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));i("fa89");function n(e,t,i,n,o,s,r){try{var a=e[s](r),l=a.value}catch(c){return void i(c)}a.done?t(l):Promise.resolve(l).then(n,o)}function o(e){return function(){var t=this,i=arguments;return new Promise((function(o,s){var r=e.apply(t,i);function a(e){n(r,o,s,a,l,"next",e)}function l(e){n(r,o,s,a,l,"throw",e)}a(void 0)}))}}},d554:function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},d557:function(e,t,i){var n=i("312a");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("7bb72351",n,!0,{sourceMap:!1,shadowMode:!1})},d6e4:function(e,t){e.exports=function(e,t,i){if(!(e instanceof t))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return e}},d6ed:function(e,t,i){var n=i("7f17");e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 0:return function(){return e.call(t)};case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,o){return e.call(t,i,n,o)}}return function(){return e.apply(t,arguments)}}},d75f:function(e,t,i){var n=i("fbcf"),o=i("a53d"),s=i("ce47"),r=i("d6ed"),a=i("6023"),l=i("dc8c"),c=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,i){var d,h,u,g,f,m,p,_=i&&i.that,b=!(!i||!i.AS_ENTRIES),v=!(!i||!i.IS_ITERATOR),w=!(!i||!i.INTERRUPTED),C=r(t,_,1+b+w),y=function(e){return d&&l(d),new c(!0,e)},S=function(e){return b?(n(e),w?C(e[0],e[1],y):C(e[0],e[1])):w?C(e,y):C(e)};if(v)d=e;else{if(h=a(e),"function"!=typeof h)throw TypeError("Target is not iterable");if(o(h)){for(u=0,g=s(e.length);g>u;u++)if(f=S(e[u]),f&&f instanceof c)return f;return new c(!1)}d=h.call(e)}m=d.next;while(!(p=m.call(d)).done){try{f=S(p.value)}catch(x){throw l(d),x}if("object"==typeof f&&f&&f instanceof c)return f}return new c(!1)}},d80d:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"widget-config"},[this.data&&Object.keys(this.data).length>0?i("el-form",{attrs:{"label-suffix":":",labelPosition:"left",labelWidth:"90px",size:"small"}},[i("el-collapse",{model:{value:e.collapse,callback:function(t){e.collapse=t},expression:"collapse"}},[i("el-collapse-item",{attrs:{name:"1",title:"基本属性"}},[e.data.type&&!e.data.component?i("el-form-item",{attrs:{label:"类型"}},[i("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型"},on:{change:e.handleChangeType},model:{value:e.data.type,callback:function(t){e.$set(e.data,"type",t)},expression:"data.type"}},e._l(e.fields,(function(t){return i("el-option-group",{key:t.title,attrs:{label:t.title}},e._l(t.list,(function(e){return i("el-option",{key:e.type,attrs:{label:e.label,value:e.type}})})),1)})),1)],1):e._e(),i("el-form-item",{attrs:{label:"属性值"}},[i("el-input",{attrs:{clearable:"",placeholder:"属性值"},model:{value:e.data.prop,callback:function(t){e.$set(e.data,"prop",t)},expression:"data.prop"}})],1),i("el-form-item",{attrs:{label:"标题"}},[i("el-input",{attrs:{clearable:"",placeholder:"标题"},model:{value:e.data.label,callback:function(t){e.$set(e.data,"label",t)},expression:"data.label"}})],1),e.data.subfield?i("el-form-item",{attrs:{label:"宽度"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{"controls-position":"right",placeholder:"宽度",min:100},model:{value:e.data.width,callback:function(t){e.$set(e.data,"width",t)},expression:"data.width"}})],1):e._e(),e.data.subfield||["group"].includes(e.data.type)?e._e():i("el-form-item",{attrs:{label:"表单栅格"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{"controls-position":"right",placeholder:"表单栅格",min:8,max:24},model:{value:e.data.span,callback:function(t){e.$set(e.data,"span",t)},expression:"data.span"}})],1),["cascader","checkbox","radio","select","tree","upload","img","array","slider","timerange","daterange","datetimerange"].includes(e.data.type)?i("el-form-item",{attrs:{label:"数据类型"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/doc/dataType",target:"_blank"}},[e._v("数据类型 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-select",{attrs:{placeholder:"数据类型",clearable:""},model:{value:e.data.dataType,callback:function(t){e.$set(e.data,"dataType",t)},expression:"data.dataType"}},[i("el-option",{attrs:{label:"String",value:"string"}}),i("el-option",{attrs:{label:"Number",value:"number"}}),i("el-option",{attrs:{label:"Array",value:"array"}})],1)],2):e._e(),e.data.type&&!e.data.component?i("el-form-item",{attrs:{label:"深结构"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/doc/form/form-bind",target:"_blank"}},[e._v("深结构 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-input",{attrs:{clearable:"",placeholder:"深结构"},model:{value:e.data.bind,callback:function(t){e.$set(e.data,"bind",t)},expression:"data.bind"}})],2):e._e(),i("el-form-item",{attrs:{label:"字段提示"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/doc/form/form-tip",target:"_blank"}},[e._v("字段提示 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-input",{attrs:{clearable:"",placeholder:"字段提示"},model:{value:e.data.tip,callback:function(t){e.$set(e.data,"tip",t)},expression:"data.tip"}})],2),e.data.tip&&!["upload"].includes(e.data.type)?i("el-form-item",{attrs:{label:"字段提示位置","label-width":"110px"}},[i("el-select",{attrs:{placeholder:"字段提示位置",clearable:""},model:{value:e.data.tipPlacement,callback:function(t){e.$set(e.data,"tipPlacement",t)},expression:"data.tipPlacement"}},[i("el-option",{attrs:{label:"上",value:"top"}}),i("el-option",{attrs:{label:"下",value:"bottom"}}),i("el-option",{attrs:{label:"左",value:"left"}}),i("el-option",{attrs:{label:"右",value:"right"}})],1)],1):e._e(),i("el-form-item",{attrs:{label:"标题提示"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/doc/form/form-tip",target:"_blank"}},[e._v("标题提示 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-input",{attrs:{clearable:"",placeholder:"标题提示"},model:{value:e.data.labelTip,callback:function(t){e.$set(e.data,"labelTip",t)},expression:"data.labelTip"}})],2),e.data.labelTip&&!["upload"].includes(e.data.type)?i("el-form-item",{attrs:{label:"标题提示位置","label-width":"110px"}},[i("el-select",{attrs:{placeholder:"标题提示位置",clearable:""},model:{value:e.data.labelTipPlacement,callback:function(t){e.$set(e.data,"labelTipPlacement",t)},expression:"data.labelTipPlacement"}},[i("el-option",{attrs:{label:"上",value:"top"}}),i("el-option",{attrs:{label:"下",value:"bottom"}}),i("el-option",{attrs:{label:"左",value:"left"}}),i("el-option",{attrs:{label:"右",value:"right"}})],1)],1):e._e(),["color","dynamic","group","ueditor","upload","map"].includes(e.data.type)?e._e():i("el-form-item",{attrs:{label:"默认值"}},[e.defaultValues&&e.defaultValues[e.data.type]?[i("el-select",{attrs:{"allow-create":"",clearable:"",filterable:"",placeholder:"默认值"},model:{value:e.data.value,callback:function(t){e.$set(e.data,"value",t)},expression:"data.value"}},e._l(e.defaultValues[e.data.type],(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)]:[i("el-input",{attrs:{clearable:"",placeholder:"默认值"},model:{value:e.data.value,callback:function(t){e.$set(e.data,"value",t)},expression:"data.value"}})]],2),i(e.getComponent,{tag:"component",attrs:{data:e.data,"default-values":e.defaultValues}})],1),["group","dynamic"].includes(e.data.type)?e._e():i("el-collapse-item",{attrs:{name:"2",title:"事件属性"}},[i("config-event",{attrs:{data:e.data}})],1)],1)],1):i("avue-empty",{staticStyle:{"margin-top":"100%"},attrs:{desc:"拖拽字段进行配置"}})],1)},o=[],s=(i("eb46"),i("2f62"),i("fa89"),i("d31d"),i("f96e"),i("fc08"),i("d543")),r=i("1e33"),a=["year","month","week","date","datetime","time","daterange","timerange","datetimerange","dates"],l={name:"widget-config",props:["data","defaultValues"],computed:{getComponent:function(){var e="config-",t=this.data,i=t.type,n=t.component;if((!i||n)&&"ueditor"!=i)return e+"custom";var o="input";return o=[void 0,"input","password","url"].includes(i)?"input":a.includes(i)?"date":["array","img"].includes(i)?"array":["tree","cascader"].includes(i)?"tree":["radio","checkbox","select"].includes(i)?"select":i,e+o}},data:function(){return{fields:r["a"],collapse:["1","2"]}},methods:{handleChangeType:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function i(){var n,o,s;return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!e){i.next=6;break}return i.next=3,t.getConfigByType(e);case 3:for(o in n=i.sent,n.prop=t.data.prop,n)n&&Object.prototype.hasOwnProperty.call(n,o)&&!["icon","label","span"].includes(o)&&(s=n[o],t.$set(t.data,o,s));case 6:case"end":return i.stop()}}),i)})))()},getConfigByType:function(e){return new Promise((function(t,i){r["a"].forEach((function(i){i.list.forEach((function(i){i.type==e&&t(i)}))})),i()}))}}},c=l,d=i("e3d4"),h=Object(d["a"])(c,n,o,!1,null,null,null);t["a"]=h.exports},d85b:function(e,t){e.exports={}},d895:function(e,t,i){"use strict";i("085b"),i("99ab");var n=i("863c"),o=i("5491"),s=i("7eca"),r=i("7f36"),a={},l={},c=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 l[t]||(l[t]=new e(t)),l[t]},e.prototype.whenLoaded=function(){return this._lazyLoadPromise},e.prototype.load=function(){var e=this;return this._loadingTriggered||(this._loadingTriggered=!0,a[this._languageId].loader().then((function(t){return e._lazyLoadPromiseResolve(t)}),(function(t){return e._lazyLoadPromiseReject(t)}))),this._lazyLoadPromise},e}();function d(e){var t=e.id;a[t]=e,r["a"].register(e);var i=c.getOrCreate(t);r["a"].setMonarchTokensProvider(t,i.whenLoaded().then((function(e){return e.language}))),r["a"].onLanguage(t,(function(){i.load().then((function(e){r["a"].setLanguageConfiguration(t,e.conf)}))}))}d({id:"javascript",extensions:[".js",".es6",".jsx",".mjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:function(){return i.e(1).then(i.bind(null,"f8f9"))}});var h=i("826e");function u(){}t["a"]={name:"MonacoEditor",props:{diffEditor:{type:Boolean,default:!1},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},original:String,value:[String,Object],language:{type:String,default:"javascript"},theme:{type:String,default:"vs"},readOnly:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},editorMounted:{type:Function,default:u},editorBeforeMount:{type:Function,default:u},keyIndex:{type:String}},watch:{options:{deep:!0,handler:function(e){this.editor&&this.editor.updateOptions(e)}},keyIndex:function(){var e=this.value;"object"==Object(o["a"])(e)&&(e=Object(h["a"])(e)),this.editor&&e!==this._getValue()&&this._setValue(e)},language:function(){if(this.editor)if(this.diffEditor){var e=this.editor.getModel(),t=e.original,i=e.modified;s["editor"].setModelLanguage(t,this.language),s["editor"].setModelLanguage(i,this.language)}else s["editor"].setModelLanguage(this.editor.getModel(),this.language)},theme:function(){this.editor&&s["editor"].setTheme(this.theme)},style:function(){var e=this;this.editor&&this.$nextTick((function(){e.editor.layout()}))}},computed:{style:function(){return{width:/^\d+$/.test(this.width)?"".concat(this.width,"px"):this.width,height:/^\d+$/.test(this.height)?"".concat(this.height,"px"):this.height}}},mounted:function(){this.initMonaco()},beforeDestroy:function(){this.editor&&this.editor.dispose()},render:function(){var e=arguments[0];return e("div",{class:"monaco_editor_container",style:this.style})},methods:{initMonaco:function(){var e=this.value,t=this.language,i=this.theme,o=this.readOnly,r=this.options;Object.assign(r,this._editorBeforeMount()),this.editor=s["editor"][this.diffEditor?"createDiffEditor":"create"](this.$el,Object(n["a"])({value:"string"==typeof e?e:Object(h["a"])(e),language:t,theme:i,readOnly:o},r)),this.diffEditor&&this._setModel(this.value,this.original),this._editorMounted(this.editor)},_getEditor:function(){return this.editor?this.diffEditor?this.editor.modifiedEditor:this.editor:null},_setModel:function(e,t){var i=this.language,n=s["editor"].createModel(t,i),o=s["editor"].createModel(e,i);this.editor.setModel({original:n,modified:o})},_setValue:function(e){var t=this._getEditor();if(t)return t.setValue(e)},_getValue:function(){var e=this._getEditor();return e?e.getValue():""},_editorBeforeMount:function(){var e=this.editorBeforeMount(s);return e||{}},_editorMounted:function(e){var t=this;this.editorMounted(e,s),this.diffEditor?e.onDidUpdateDiff((function(e){var i=t._getValue();t._emitChange(i,e)})):e.onDidChangeModelContent((function(e){var i=t._getValue();t._emitChange(i,e)}))},_emitChange:function(e,t){this.$emit("change",e,t),this.$emit("input",e)}}}},d927:function(e,t,i){"use strict";var n=i("83ec"),o=i("3352"),s=i("80db"),r=i("ce47"),a=i("c673"),l=i("f152"),c=i("acd4"),d=i("72d4"),h=d("splice"),u=Math.max,g=Math.min,f=9007199254740991,m="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!h},{splice:function(e,t){var i,n,d,h,p,_,b=a(this),v=r(b.length),w=o(e,v),C=arguments.length;if(0===C?i=n=0:1===C?(i=0,n=v-w):(i=C-2,n=g(u(s(t),0),v-w)),v+i-n>f)throw TypeError(m);for(d=l(b,n),h=0;hv-n+i;h--)delete b[h-1]}else if(i>n)for(h=v-n;h>w;h--)p=h+n-1,_=h+i-1,p in b?b[_]=b[p]:delete b[_];for(h=0;h=c?e?"":void 0:(s=a.charCodeAt(l),s<55296||s>56319||l+1===c||(r=a.charCodeAt(l+1))<56320||r>57343?e?a.charAt(l):s:e?a.slice(l,l+2):r-56320+(s-55296<<10)+65536)}}},"0390":function(e,t,i){"use strict";var n=i("02f4")(!0);e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}},"0bfb":function(e,t,i){"use strict";var n=i("cb7c");e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"0d58":function(e,t,i){var n=i("ce10"),o=i("e11e");e.exports=Object.keys||function(e){return n(e,o)}},1495:function(e,t,i){var n=i("86cc"),o=i("cb7c"),s=i("0d58");e.exports=i("9e1e")?Object.defineProperties:function(e,t){o(e);var i,r=s(t),a=r.length,l=0;while(a>l)n.f(e,i=r[l++],t[i]);return e}},"214f":function(e,t,i){"use strict";i("b0c5");var n=i("2aba"),o=i("32e9"),s=i("79e5"),r=i("be13"),a=i("2b4c"),l=i("520a"),c=a("species"),d=!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),h=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2===i.length&&"a"===i[0]&&"b"===i[1]}();e.exports=function(e,t,i){var u=a(e),g=!s((function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})),f=g?!s((function(){var t=!1,i=/a/;return i.exec=function(){return t=!0,null},"split"===e&&(i.constructor={},i.constructor[c]=function(){return i}),i[u](""),!t})):void 0;if(!g||!f||"replace"===e&&!d||"split"===e&&!h){var m=/./[u],p=i(r,u,""[e],(function(e,t,i,n,o){return t.exec===l?g&&!o?{done:!0,value:m.call(t,i,n)}:{done:!0,value:e.call(i,t,n)}:{done:!1}})),_=p[0],b=p[1];n(String.prototype,e,_),o(RegExp.prototype,u,2==t?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}}},"230e":function(e,t,i){var n=i("d3f4"),o=i("7726").document,s=n(o)&&n(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},"23c6":function(e,t,i){var n=i("2d95"),o=i("2b4c")("toStringTag"),s="Arguments"==n(function(){return arguments}()),r=function(e,t){try{return e[t]}catch(i){}};e.exports=function(e){var t,i,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=r(t=Object(e),o))?i:s?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},2621:function(e,t){t.f=Object.getOwnPropertySymbols},"2aba":function(e,t,i){var n=i("7726"),o=i("32e9"),s=i("69a8"),r=i("ca5a")("src"),a=i("fa5b"),l="toString",c=(""+a).split(l);i("8378").inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,i,a){var l="function"==typeof i;l&&(s(i,"name")||o(i,"name",t)),e[t]!==i&&(l&&(s(i,r)||o(i,r,e[t]?""+e[t]:c.join(String(t)))),e===n?e[t]=i:a?e[t]?e[t]=i:o(e,t,i):(delete e[t],o(e,t,i)))})(Function.prototype,l,(function(){return"function"==typeof this&&this[r]||a.call(this)}))},"2aeb":function(e,t,i){var n=i("cb7c"),o=i("1495"),s=i("e11e"),r=i("613b")("IE_PROTO"),a=function(){},l="prototype",c=function(){var e,t=i("230e")("iframe"),n=s.length,o="<",r=">";t.style.display="none",i("fab2").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+r+"document.F=Object"+o+"/script"+r),e.close(),c=e.F;while(n--)delete c[l][s[n]];return c()};e.exports=Object.create||function(e,t){var i;return null!==e?(a[l]=n(e),i=new a,a[l]=null,i[r]=e):i=c(),void 0===t?i:o(i,t)}},"2b4c":function(e,t,i){var n=i("5537")("wks"),o=i("ca5a"),s=i("7726").Symbol,r="function"==typeof s,a=e.exports=function(e){return n[e]||(n[e]=r&&s[e]||(r?s:o)("Symbol."+e))};a.store=n},"2d00":function(e,t){e.exports=!1},"2d95":function(e,t){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},"2fdb":function(e,t,i){"use strict";var n=i("5ca1"),o=i("d2c8"),s="includes";n(n.P+n.F*i("5147")(s),"String",{includes:function(e){return!!~o(this,e,s).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},"32e9":function(e,t,i){var n=i("86cc"),o=i("4630");e.exports=i("9e1e")?function(e,t,i){return n.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},"38fd":function(e,t,i){var n=i("69a8"),o=i("4bf8"),s=i("613b")("IE_PROTO"),r=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?r:null}},"41a0":function(e,t,i){"use strict";var n=i("2aeb"),o=i("4630"),s=i("7f20"),r={};i("32e9")(r,i("2b4c")("iterator"),(function(){return this})),e.exports=function(e,t,i){e.prototype=n(r,{next:o(1,i)}),s(e,t+" Iterator")}},"456d":function(e,t,i){var n=i("4bf8"),o=i("0d58");i("5eda")("keys",(function(){return function(e){return o(n(e))}}))},4588:function(e,t){var i=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:i)(e)}},4630:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"4bf8":function(e,t,i){var n=i("be13");e.exports=function(e){return Object(n(e))}},5147:function(e,t,i){var n=i("2b4c")("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(i){try{return t[n]=!1,!"/./"[e](t)}catch(o){}}return!0}},"520a":function(e,t,i){"use strict";var n=i("0bfb"),o=RegExp.prototype.exec,s=String.prototype.replace,r=o,a="lastIndex",l=function(){var e=/a/,t=/b*/g;return o.call(e,"a"),o.call(t,"a"),0!==e[a]||0!==t[a]}(),c=void 0!==/()??/.exec("")[1],d=l||c;d&&(r=function(e){var t,i,r,d,h=this;return c&&(i=new RegExp("^"+h.source+"$(?!\\s)",n.call(h))),l&&(t=h[a]),r=o.call(h,e),l&&r&&(h[a]=h.global?r.index+r[0].length:t),c&&r&&r.length>1&&s.call(r[0],i,(function(){for(d=1;d1?arguments[1]:void 0)}}),i("9c6c")("includes")},6821:function(e,t,i){var n=i("626a"),o=i("be13");e.exports=function(e){return n(o(e))}},"69a8":function(e,t){var i={}.hasOwnProperty;e.exports=function(e,t){return i.call(e,t)}},"6a99":function(e,t,i){var n=i("d3f4");e.exports=function(e,t){if(!n(e))return e;var i,o;if(t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;if("function"==typeof(i=e.valueOf)&&!n(o=i.call(e)))return o;if(!t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},7333:function(e,t,i){"use strict";var n=i("0d58"),o=i("2621"),s=i("52a7"),r=i("4bf8"),a=i("626a"),l=Object.assign;e.exports=!l||i("79e5")((function(){var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!=l({},e)[i]||Object.keys(l({},t)).join("")!=n}))?function(e,t){var i=r(e),l=arguments.length,c=1,d=o.f,h=s.f;while(l>c){var u,g=a(arguments[c++]),f=d?n(g).concat(d(g)):n(g),m=f.length,p=0;while(m>p)h.call(g,u=f[p++])&&(i[u]=g[u])}return i}:l},7726:function(e,t){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},"77f1":function(e,t,i){var n=i("4588"),o=Math.max,s=Math.min;e.exports=function(e,t){return e=n(e),e<0?o(e+t,0):s(e,t)}},"79e5":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"7f20":function(e,t,i){var n=i("86cc").f,o=i("69a8"),s=i("2b4c")("toStringTag");e.exports=function(e,t,i){e&&!o(e=i?e:e.prototype,s)&&n(e,s,{configurable:!0,value:t})}},8378:function(e,t){var i=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=i)},"84f2":function(e,t){e.exports={}},"86cc":function(e,t,i){var n=i("cb7c"),o=i("c69a"),s=i("6a99"),r=Object.defineProperty;t.f=i("9e1e")?Object.defineProperty:function(e,t,i){if(n(e),t=s(t,!0),n(i),o)try{return r(e,t,i)}catch(a){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},"9b43":function(e,t,i){var n=i("d8e8");e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,o){return e.call(t,i,n,o)}}return function(){return e.apply(t,arguments)}}},"9c6c":function(e,t,i){var n=i("2b4c")("unscopables"),o=Array.prototype;void 0==o[n]&&i("32e9")(o,n,{}),e.exports=function(e){o[n][e]=!0}},"9def":function(e,t,i){var n=i("4588"),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},"9e1e":function(e,t,i){e.exports=!i("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},a352:function(t,i){t.exports=e},a481:function(e,t,i){"use strict";var n=i("cb7c"),o=i("4bf8"),s=i("9def"),r=i("4588"),a=i("0390"),l=i("5f1b"),c=Math.max,d=Math.min,h=Math.floor,u=/\$([$&`']|\d\d?|<[^>]*>)/g,g=/\$([$&`']|\d\d?)/g,f=function(e){return void 0===e?e:String(e)};i("214f")("replace",2,(function(e,t,i,m){return[function(n,o){var s=e(this),r=void 0==n?void 0:n[t];return void 0!==r?r.call(n,s,o):i.call(String(s),n,o)},function(e,t){var o=m(i,e,this,t);if(o.done)return o.value;var h=n(e),u=String(this),g="function"===typeof t;g||(t=String(t));var _=h.global;if(_){var b=h.unicode;h.lastIndex=0}var v=[];while(1){var w=l(h,u);if(null===w)break;if(v.push(w),!_)break;var C=String(w[0]);""===C&&(h.lastIndex=a(u,s(h.lastIndex),b))}for(var y="",S=0,x=0;x=S&&(y+=u.slice(S,k)+T,S=k+L.length)}return y+u.slice(S)}];function p(e,t,n,s,r,a){var l=n+e.length,c=s.length,d=g;return void 0!==r&&(r=o(r),d=u),i.call(a,d,(function(i,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(l);case"<":a=r[o.slice(1,-1)];break;default:var d=+o;if(0===d)return i;if(d>c){var u=h(d/10);return 0===u?i:u<=c?void 0===s[u-1]?o.charAt(1):s[u-1]+o.charAt(1):i}a=s[d-1]}return void 0===a?"":a}))}}))},aae3:function(e,t,i){var n=i("d3f4"),o=i("2d95"),s=i("2b4c")("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==o(e))}},ac6a:function(e,t,i){for(var n=i("cadf"),o=i("0d58"),s=i("2aba"),r=i("7726"),a=i("32e9"),l=i("84f2"),c=i("2b4c"),d=c("iterator"),h=c("toStringTag"),u=l.Array,g={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},f=o(g),m=0;md)if(a=l[d++],a!=a)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===i)return e||d||0;return!e&&-1}}},c649:function(e,t,i){"use strict";(function(e){i.d(t,"c",(function(){return c})),i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return o})),i.d(t,"d",(function(){return l}));i("a481");function n(){return"undefined"!==typeof window?window.console:e.console}var o=n();function s(e){var t=Object.create(null);return function(i){var n=t[i];return n||(t[i]=e(i))}}var r=/-(\w)/g,a=s((function(e){return e.replace(r,(function(e,t){return t?t.toUpperCase():""}))}));function l(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function c(e,t,i){var n=0===i?e.children[0]:e.children[i-1].nextSibling;e.insertBefore(t,n)}}).call(this,i("c8ba"))},c69a:function(e,t,i){e.exports=!i("9e1e")&&!i("79e5")((function(){return 7!=Object.defineProperty(i("230e")("div"),"a",{get:function(){return 7}}).a}))},c8ba:function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(n){"object"===typeof window&&(i=window)}e.exports=i},ca5a:function(e,t){var i=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++i+n).toString(36))}},cadf:function(e,t,i){"use strict";var n=i("9c6c"),o=i("d53b"),s=i("84f2"),r=i("6821");e.exports=i("01f9")(Array,"Array",(function(e,t){this._t=r(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,i=this._i++;return!e||i>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?i:"values"==t?e[i]:[i,e[i]])}),"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},cb7c:function(e,t,i){var n=i("d3f4");e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},ce10:function(e,t,i){var n=i("69a8"),o=i("6821"),s=i("c366")(!1),r=i("613b")("IE_PROTO");e.exports=function(e,t){var i,a=o(e),l=0,c=[];for(i in a)i!=r&&n(a,i)&&c.push(i);while(t.length>l)n(a,i=t[l++])&&(~s(c,i)||c.push(i));return c}},d2c8:function(e,t,i){var n=i("aae3"),o=i("be13");e.exports=function(e,t,i){if(n(t))throw TypeError("String#"+i+" doesn't accept regex!");return String(o(e))}},d3f4:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},d53b:function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},d8e8:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},e11e:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},f559:function(e,t,i){"use strict";var n=i("5ca1"),o=i("9def"),s=i("d2c8"),r="startsWith",a=""[r];n(n.P+n.F*i("5147")(r),"String",{startsWith:function(e){var t=s(this,e,r),i=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return a?a.call(t,n,i):t.slice(i,i+n.length)===n}})},f6fd:function(e,t){(function(e){var t="currentScript",i=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(n){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(n.stack)||[!1])[1];for(e in i)if(i[e].src==t||"interactive"==i[e].readyState)return i[e];return null}}})})(document)},f751:function(e,t,i){var n=i("5ca1");n(n.S+n.F,"Object",{assign:i("7333")})},fa5b:function(e,t,i){e.exports=i("5537")("native-function-to-string",Function.toString)},fab2:function(e,t,i){var n=i("7726").document;e.exports=n&&n.documentElement},fb15:function(e,t,i){"use strict";var n;(i.r(t),"undefined"!==typeof window)&&(i("f6fd"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(i.p=n[1]));i("f751"),i("f559"),i("ac6a"),i("cadf"),i("456d");function o(e){if(Array.isArray(e))return e}function s(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var i=[],n=!0,o=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done);n=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){o=!0,s=l}finally{try{n||null==a["return"]||a["return"]()}finally{if(o)throw s}}return i}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i=s?o.length:o.indexOf(e)}));return i?r.filter((function(e){return-1!==e})):r}function w(e,t){var i=this;this.$nextTick((function(){return i.$emit(e.toLowerCase(),t)}))}function C(e){var t=this;return function(i){null!==t.realList&&t["onDrag"+e](i),w.call(t,e,i)}}function y(e){return["transition-group","TransitionGroup"].includes(e)}function S(e){if(!e||1!==e.length)return!1;var t=c(e,1),i=t[0].componentOptions;return!!i&&y(i.tag)}function x(e,t,i){return e[i]||(t[i]?t[i]():void 0)}function L(e,t,i){var n=0,o=0,s=x(t,i,"header");s&&(n=s.length,e=e?[].concat(g(s),g(e)):g(s));var r=x(t,i,"footer");return r&&(o=r.length,e=e?[].concat(g(e),g(r)):g(r)),{children:e,headerOffset:n,footerOffset:o}}function k(e,t){var i=null,n=function(e,t){i=_(i,e,t)},o=Object.keys(e).filter((function(e){return"id"===e||e.startsWith("data-")})).reduce((function(t,i){return t[i]=e[i],t}),{});if(n("attrs",o),!t)return i;var s=t.on,r=t.props,a=t.attrs;return n("on",s),n("props",r),Object.assign(i.attrs,a),i}var E=["Start","Add","Remove","Update","End"],D=["Choose","Unchoose","Sort","Filter","Clone"],N=["Move"].concat(E,D).map((function(e){return"on"+e})),I=null,T={options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:function(e){return e}},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},M={name:"draggable",inheritAttrs:!1,props:T,data:function(){return{transitionMode:!1,noneFunctionalComponentMode:!1}},render:function(e){var t=this.$slots.default;this.transitionMode=S(t);var i=L(t,this.$slots,this.$scopedSlots),n=i.children,o=i.headerOffset,s=i.footerOffset;this.headerOffset=o,this.footerOffset=s;var r=k(this.$attrs,this.componentData);return e(this.getTag(),r,n)},created:function(){null!==this.list&&null!==this.value&&p["b"].error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&p["b"].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&p["b"].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted:function(){var e=this;if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));var t={};E.forEach((function(i){t["on"+i]=C.call(e,i)})),D.forEach((function(i){t["on"+i]=w.bind(e,i)}));var i=Object.keys(this.$attrs).reduce((function(t,i){return t[Object(p["a"])(i)]=e.$attrs[i],t}),{}),n=Object.assign({},this.options,i,t,{onMove:function(t,i){return e.onDragMove(t,i)}});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new m.a(this.rootContainer,n),this.computeIndexes()},beforeDestroy:function(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer:function(){return this.transitionMode?this.$el.children[0]:this.$el},realList:function(){return this.list?this.list:this.value}},watch:{options:{handler:function(e){this.updateOptions(e)},deep:!0},$attrs:{handler:function(e){this.updateOptions(e)},deep:!0},realList:function(){this.computeIndexes()}},methods:{getIsFunctional:function(){var e=this._vnode.fnOptions;return e&&e.functional},getTag:function(){return this.tag||this.element},updateOptions:function(e){for(var t in e){var i=Object(p["a"])(t);-1===N.indexOf(i)&&this._sortable.option(i,e[t])}},getChildrenNodes:function(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;var e=this.$slots.default;return this.transitionMode?e[0].child.$slots.default:e},computeIndexes:function(){var e=this;this.$nextTick((function(){e.visibleIndexes=v(e.getChildrenNodes(),e.rootContainer.children,e.transitionMode,e.footerOffset)}))},getUnderlyingVm:function(e){var t=b(this.getChildrenNodes()||[],e);if(-1===t)return null;var i=this.realList[t];return{index:t,element:i}},getUnderlyingPotencialDraggableComponent:function(e){var t=e.__vue__;return t&&t.$options&&y(t.$options._componentTag)?t.$parent:!("realList"in t)&&1===t.$children.length&&"realList"in t.$children[0]?t.$children[0]:t},emitChanges:function(e){var t=this;this.$nextTick((function(){t.$emit("change",e)}))},alterList:function(e){if(this.list)e(this.list);else{var t=g(this.value);e(t),this.$emit("input",t)}},spliceList:function(){var e=arguments,t=function(t){return t.splice.apply(t,g(e))};this.alterList(t)},updatePosition:function(e,t){var i=function(i){return i.splice(t,0,i.splice(e,1)[0])};this.alterList(i)},getRelatedContextFromMoveEvent:function(e){var t=e.to,i=e.related,n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};var o=n.realList,s={list:o,component:n};if(t!==i&&o&&n.getUnderlyingVm){var r=n.getUnderlyingVm(i);if(r)return Object.assign(r,s)}return s},getVmIndex:function(e){var t=this.visibleIndexes,i=t.length;return e>i-1?i:t[e]},getComponent:function(){return this.$slots.default[0].componentInstance},resetTransitionData:function(e){if(this.noTransitionOnDrag&&this.transitionMode){var t=this.getChildrenNodes();t[e].data=null;var i=this.getComponent();i.children=[],i.kept=void 0}},onDragStart:function(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),I=e.item},onDragAdd:function(e){var t=e.item._underlying_vm_;if(void 0!==t){Object(p["d"])(e.item);var i=this.getVmIndex(e.newIndex);this.spliceList(i,0,t),this.computeIndexes();var n={element:t,newIndex:i};this.emitChanges({added:n})}},onDragRemove:function(e){if(Object(p["c"])(this.rootContainer,e.item,e.oldIndex),"clone"!==e.pullMode){var t=this.context.index;this.spliceList(t,1);var i={element:this.context.element,oldIndex:t};this.resetTransitionData(t),this.emitChanges({removed:i})}else Object(p["d"])(e.clone)},onDragUpdate:function(e){Object(p["d"])(e.item),Object(p["c"])(e.from,e.item,e.oldIndex);var t=this.context.index,i=this.getVmIndex(e.newIndex);this.updatePosition(t,i);var n={element:this.context.element,oldIndex:t,newIndex:i};this.emitChanges({moved:n})},updateProperty:function(e,t){e.hasOwnProperty(t)&&(e[t]+=this.headerOffset)},computeFutureIndex:function(e,t){if(!e.element)return 0;var i=g(t.to.children).filter((function(e){return"none"!==e.style["display"]})),n=i.indexOf(t.related),o=e.component.getVmIndex(n),s=-1!==i.indexOf(I);return s||!t.willInsertAfter?o:o+1},onDragMove:function(e,t){var i=this.move;if(!i||!this.realList)return!0;var n=this.getRelatedContextFromMoveEvent(e),o=this.context,s=this.computeFutureIndex(n,e);Object.assign(o,{futureIndex:s});var r=Object.assign({},e,{relatedContext:n,draggedContext:o});return i(r,t)},onDragEnd:function(){this.computeIndexes(),I=null}}};"undefined"!==typeof window&&"Vue"in window&&window.Vue.component("draggable",M);var O=M;t["default"]=O}})["default"]}))},dbc3:function(e,t,i){var n=i("eb42");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("21a18477",n,!0,{sourceMap:!1,shadowMode:!1})},dc8c:function(e,t,i){var n=i("fbcf");e.exports=function(e){var t=e["return"];if(void 0!==t)return n(t.call(e)).value}},df3c:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".context-view{position:absolute;z-index:2500}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;z-index:2500;color:inherit}",""]),e.exports=t},df70:function(e,t,i){var n=i("139d");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("a4992a28",n,!0,{sourceMap:!1,shadowMode:!1})},df93:function(e,t,i){var n=i("e577");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("0e249fd5",n,!0,{sourceMap:!1,shadowMode:!1})},dff0:function(e,t,i){var n=i("8dab");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("24132abe",n,!0,{sourceMap:!1,shadowMode:!1})},e09a:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-icon-label{display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:0;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;-ms-flex-negative:0;flex-shrink:0}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;-webkit-box-flex:1;-ms-flex:1;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;padding:0 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}",""]),e.exports=t},e0e0:function(e,t,i){"use strict";var n=i("15b2").IteratorPrototype,o=i("ca2b"),s=i("4d82"),r=i("63ef"),a=i("d85b"),l=function(){return this};e.exports=function(e,t,i){var c=t+" Iterator";return e.prototype=o(n,{next:s(1,i)}),r(e,c,!1,!0),a[c]=l,e}},e244:function(e,t,i){(function(t){var i=function(e){return e&&e.Math==Math&&e};e.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,i("c8ed"))},e248:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".context-view .monaco-menu{min-width:130px}",""]),e.exports=t},e263:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}",""]),e.exports=t},e2da:function(e,t,i){"use strict";var n=i("45ad"),o=i("6e10"),s=i("d85b"),r=i("35d6"),a=i("325d"),l="Array Iterator",c=r.set,d=r.getterFor(l);e.exports=a(Array,"Array",(function(e,t){c(this,{type:l,target:n(e),index:0,kind:t})}),(function(){var e=d(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},e3d4:function(e,t,i){"use strict";function n(e,t,i,n,o,s,r,a){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),r?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",(function(){return n}))},e3f4:function(e,t,i){(function(e){function i(e,t){for(var i=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),i++):i&&(e.splice(n,1),i--)}if(t)for(;i--;i)e.unshift("..");return e}function n(e){"string"!==typeof e&&(e+="");var t,i=0,n=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){i=t+1;break}}else-1===n&&(o=!1,n=t+1);return-1===n?"":e.slice(i,n)}function o(e,t){if(e.filter)return e.filter(t);for(var i=[],n=0;n=-1&&!n;s--){var r=s>=0?arguments[s]:e.cwd();if("string"!==typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,n="/"===r.charAt(0))}return t=i(o(t.split("/"),(function(e){return!!e})),!n).join("/"),(n?"/":"")+t||"."},t.normalize=function(e){var n=t.isAbsolute(e),r="/"===s(e,-1);return e=i(o(e.split("/"),(function(e){return!!e})),!n).join("/"),e||n||(e="."),e&&r&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,i){function n(e){for(var t=0;t=0;i--)if(""!==e[i])break;return t>i?[]:e.slice(t,i-t+1)}e=t.resolve(e).substr(1),i=t.resolve(i).substr(1);for(var o=n(e.split("/")),s=n(i.split("/")),r=Math.min(o.length,s.length),a=r,l=0;l=1;--s)if(t=e.charCodeAt(s),47===t){if(!o){n=s;break}}else o=!1;return-1===n?i?"/":".":i&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var i=n(e);return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,i=0,n=-1,o=!0,s=0,r=e.length-1;r>=0;--r){var a=e.charCodeAt(r);if(47!==a)-1===n&&(o=!1,n=r+1),46===a?-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)};var s="b"==="ab".substr(-1)?function(e,t,i){return e.substr(t,i)}:function(e,t,i){return t<0&&(t=e.length+t),e.substr(t,i)}}).call(this,i("2552"))},e4f5:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}",""]),e.exports=t},e577:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .view-ruler{position:absolute;top:0}",""]),e.exports=t},e5d9:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:transparent;-webkit-transition:opacity .1s linear;transition:opacity .1s linear}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{-webkit-transition:opacity .8s linear;transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;-webkit-box-shadow:#ddd 0 6px 6px -6px inset;box-shadow:inset 0 6px 6px -6px #ddd}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;-webkit-box-shadow:#ddd 6px 0 6px -6px inset;box-shadow:inset 6px 0 6px -6px #ddd}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{-webkit-box-shadow:#ddd 6px 6px 6px -6px inset;box-shadow:inset 6px 6px 6px -6px #ddd}.vs .monaco-scrollable-element>.scrollbar>.slider{background:hsla(0,0%,39.2%,.4)}.vs-dark .monaco-scrollable-element>.scrollbar>.slider{background:hsla(0,0%,47.5%,.4)}.hc-black .monaco-scrollable-element>.scrollbar>.slider{background:rgba(111,195,223,.6)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:hsla(0,0%,39.2%,.7)}.hc-black .monaco-scrollable-element>.scrollbar>.slider:hover{background:rgba(111,195,223,.8)}.monaco-scrollable-element>.scrollbar>.slider.active{background:rgba(0,0,0,.6)}.vs-dark .monaco-scrollable-element>.scrollbar>.slider.active{background:hsla(0,0%,74.9%,.4)}.hc-black .monaco-scrollable-element>.scrollbar>.slider.active{background:#6fc3df}.vs-dark .monaco-scrollable-element .shadow.top{-webkit-box-shadow:none;box-shadow:none}.vs-dark .monaco-scrollable-element .shadow.left{-webkit-box-shadow:#000 6px 0 6px -6px inset;box-shadow:inset 6px 0 6px -6px #000}.vs-dark .monaco-scrollable-element .shadow.top.left{-webkit-box-shadow:#000 6px 6px 6px -6px inset;box-shadow:inset 6px 6px 6px -6px #000}.hc-black .monaco-scrollable-element .shadow.left,.hc-black .monaco-scrollable-element .shadow.top,.hc-black .monaco-scrollable-element .shadow.top.left{-webkit-box-shadow:none;box-shadow:none}",""]),e.exports=t},e629:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},e635:function(e,t,i){var n=i("c91b");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("0091cd35",n,!0,{sourceMap:!1,shadowMode:!1})},e669:function(module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es_array_find_index__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("b105"),core_js_modules_es_array_find_index__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_find_index__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("eb46"),core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("2f62"),core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("d927"),core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("085b"),core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("fa89"),core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("d31d"),core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("f96e"),core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_7__),_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("5491"),regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("fc08"),regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_9__),_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("d543"),_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("863c"),_fieldsConfig_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("1e33"),_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("826e"),_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("d895"),_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("3a5d"),_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_15__),_mixins_history__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("2790"),vuedraggable__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("d958"),vuedraggable__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(vuedraggable__WEBPACK_IMPORTED_MODULE_17__),_WidgetForm__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("17b9"),_FormConfig__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("a5f6"),_WidgetConfig__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("d80d");__webpack_exports__["a"]={name:"FormDesign",components:{Draggable:vuedraggable__WEBPACK_IMPORTED_MODULE_17___default.a,MonacoEditor:_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_14__["a"],WidgetForm:_WidgetForm__WEBPACK_IMPORTED_MODULE_18__["a"],FormConfig:_FormConfig__WEBPACK_IMPORTED_MODULE_19__["a"],WidgetConfig:_WidgetConfig__WEBPACK_IMPORTED_MODULE_20__["a"]},mixins:[_mixins_history__WEBPACK_IMPORTED_MODULE_16__["a"]],props:{options:{type:[Object,String],default:function(){return{column:[]}}},storage:{type:Boolean,default:!1},asideLeftWidth:{type:[String,Number],default:"270px"},asideRightWidth:{type:[String,Number],default:"380px"},showGithubStar:{type:Boolean,default:!0},toolbar:{type:Array,default:function(){return["import","generate","preview","clear"]}},undoRedo:{type:Boolean,default:!0},includeFields:{type:Array,default:function(){var e=[];return _fieldsConfig_js__WEBPACK_IMPORTED_MODULE_12__["a"].forEach((function(t){t.list.forEach((function(t){e.push(t.type)}))})),e}},customFields:{type:Array},defaultValues:{type:Object}},watch:{options:{handler:function handler(val){var _this=this,options=val;if("string"==typeof options)try{options=eval("("+options+")")}catch(e){console.error("非法配置"),options={column:[]}}this.transAvueOptionsToFormDesigner(options).then((function(e){_this.widgetForm=Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])(Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])({},_this.widgetForm),e)}))},deep:!0}},computed:{leftWidth:function(){return"string"==typeof this.asideLeftWidth?this.asideLeftWidth:"".concat(this.asideLeftWidth,"px")},rightWidth:function(){return"string"==typeof this.asideRightWidth?this.asideRightWidth:"".concat(this.asideRightWidth,"px")}},data:function(){return{widgetEmpty:_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_15___default.a,fields:_fieldsConfig_js__WEBPACK_IMPORTED_MODULE_12__["a"],widgetForm:{column:[],labelPosition:"left",labelSuffix:":",labelWidth:120,gutter:0,menuBtn:!0,submitBtn:!0,submitText:"提交",emptyBtn:!0,emptyText:"清空",menuPosition:"center"},widgetFormPreview:{},configTab:"widget",widgetFormSelect:{},previewVisible:!1,generateJsonVisible:!1,importJsonVisible:!1,importJson:{},widgetModels:{},configOption:{generateType:"json",space:2,quoteType:"single",dropQuotesOnKeys:!0},history:{index:0,maxStep:20,steps:[]}}},mounted:function(){this.handleLoadStorage(),this.handleLoadCss()},methods:{handleLoadStorage:function handleLoadStorage(){var _this2=this;return Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_10__["a"])(regeneratorRuntime.mark((function _callee(){var options;return regeneratorRuntime.wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(options=_this2.options,"string"==typeof options)try{options=eval("("+options+")")}catch(e){console.error("非法配置"),options={column:[]}}return options.column||(options.column=[]),_context.t0=_this2,_context.next=6,_this2.transAvueOptionsToFormDesigner(Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])(Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])({},_this2.widgetForm),options));case 6:_context.t1=_context.sent,_context.t2=[_context.t1],_context.t3=_this2.storage,_context.t4={index:0,maxStep:20,steps:_context.t2,storage:_context.t3},_this2.widgetForm=_context.t0.initHistory.call(_context.t0,_context.t4),_this2.undoRedo&&window.addEventListener("keydown",(function(e){(e.metaKey&&!e.shiftKey&&90==e.keyCode||e.ctrlKey&&!e.shiftKey&&90==e.keyCode)&&(_this2.widgetForm=_this2.handleUndo()),(e.metaKey&&e.shiftKey&&90==e.keyCode||e.ctrlKey&&e.shiftKey&&90==e.keyCode||e.ctrlKey&&89==e.keyCode)&&(_this2.widgetForm=_this2.handleRedo())}),!1);case 12:case"end":return _context.stop()}}),_callee)})))()},handleLoadCss:function(){var e=document.getElementsByTagName("head")[0],t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href="https://at.alicdn.com/t/font_1254447_zc9iezc230c.css",e.appendChild(t)},handleAvueDoc:function(){window.open("https://avuejs.com/doc/form/form-doc","_blank")},handleFieldClick:function(e){var t=this,i=this.widgetForm.column.findIndex((function(e){return e.prop==t.widgetFormSelect.prop}))+1,n=0;-1==i?(this.widgetForm.column.push(e),n=this.widgetForm.column.length-1):(this.widgetForm.column.splice(i,0,e),n=i),this.$refs.widgetForm.handleWidgetAdd({newIndex:n})},handlePreview:function(){var e=this;this.widgetForm.column&&0!=this.widgetForm.column.length?this.transformToAvueOptions(this.widgetForm).then((function(t){e.widgetFormPreview=t,e.previewVisible=!0})):this.$message.error("没有需要展示的内容")},handleImportJsonSubmit:function(){var e=this;try{this.transAvueOptionsToFormDesigner(this.importJson).then((function(t){e.widgetForm=t,e.importJsonVisible=!1,e.handleHistoryChange(e.widgetForm)}))}catch(t){this.$message.error(t.message)}},handleGenerateJson:function(){var e=this;this.transformToAvueOptions(this.widgetForm).then((function(t){e.widgetFormPreview=t,e.generateJsonVisible=!0}))},handleGenerate:function(){var e=this;this.transformToAvueOptions(this.widgetForm).then((function(t){e.configOption.generateType&&"string"==e.configOption.generateType?e.$emit("submit",Object(_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_13__["a"])(t,Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])({minify:!0},e.configOption))):e.$emit("submit",t)}))},handleCopy:function(){var e=this;this.transformToAvueOptions(this.widgetForm).then((function(t){e.$Clipboard({text:Object(_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_13__["a"])(t,Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])({minify:!0},e.configOption))}).then((function(){e.$message.success("复制成功")})).catch((function(){e.$message.error("复制失败")}))}))},handlePreviewSubmit:function(e,t){var i=this;t?this.$alert(this.widgetModels).then((function(){t()})).catch((function(){t()})):this.$refs.form.validate((function(e,t){e&&i.$alert(i.widgetModels).then((function(){t()})).catch((function(){t()}))}))},handleBeforeClose:function(){this.$refs.form.resetForm(),this.widgetModels={},this.previewVisible=!1},handleClear:function(){var e=this;this.widgetForm&&this.widgetForm.column&&this.widgetForm.column.length>0?this.$confirm("确定要清空吗?","警告",{type:"warning"}).then((function(){e.$set(e.widgetForm,"column",[]),e.$set(e,"widgetModels",{}),e.$set(e,"widgetFormSelect",{}),e.handleHistoryChange(e.widgetForm)})).catch((function(){})):this.$message.error("没有需要清空的内容")},transformToAvueOptions:function(e){var t=this;return new Promise((function(i,n){try{(function(){for(var n=t.deepClone(e),o=function(e){var i=n.column[e];if("dynamic"==i.type&&i.children&&i.children.column&&i.children.column.length>0){var o=i.children.column;o.forEach((function(e){delete e.subfield})),t.transformToAvueOptions(i.children).then((function(e){i.children=e}))}else if("group"==i.type){n.group||(n.group=[]);var r={label:i.label,icon:i.icon,prop:i.prop,arrow:i.arrow,collapse:i.collapse,display:i.display};t.transformToAvueOptions(i.children).then((function(e){r.column=e.column,n.group.push(r)})),n.column.splice(e,1),e--}else if(["checkbox","radio","tree","cascader","select"].includes(i.type)){if("static"==i.dicOption)delete i.dicUrl,delete i.dicMethod,delete i.dicQuery,delete i.dicQueryConfig;else if("remote"==i.dicOption)if(delete i.dicData,i.dicQueryConfig&&i.dicQueryConfig.length>0){var a={};i.dicQueryConfig.forEach((function(e){e.key&&e.value&&(a[e.key]=e.value)})),i.dicQuery=a,delete i.dicQueryConfig}else delete i.dicQueryConfig;delete i.dicOption}else if(["upload"].includes(i.type)){if(i.headersConfig&&i.headersConfig.length>0){var l={};i.headersConfig.forEach((function(e){e.key&&e.value&&(l[e.key]=e.value)})),i.headers=l}else delete i.headers;if(delete i.headersConfig,i.dataConfig&&i.dataConfig.length>0){var c={};i.dataConfig.forEach((function(e){e.key&&e.value&&(c[e.key]=e.value)})),i.data=c}else delete i.data;delete i.dataConfig}s=e},s=0;s0&&data.column.forEach((function(e){if("dynamic"==e.type&&e.children&&e.children.column&&e.children.column.length>0){var t=e.children.column;t.forEach((function(e){e.subfield=!0})),_this12.transAvueOptionsToFormDesigner(e.children).then((function(t){e.children=t}))}else if(["checkbox","radio","tree","cascader","select"].includes(e.type)){if(!e.dicData&&e.dicQuery&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_8__["a"])(e.dicQuery)){var i=[];for(var n in e.dicQuery)i.push({key:n,value:e.dicQuery[n],$cellEdit:!0});e.dicQueryConfig=i}e.dicUrl?e.dicOption="remote":e.dicOption="static",e.dicData||(e.dicData=[])}else if(["upload"].includes(e.type)){if(e.headers&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_8__["a"])(e.headers)){var o=[];for(var s in e.headers)o.push({key:s,value:e.headers[s],$cellEdit:!0});e.headersConfig=o}else e.headersConfig=[];if(e.data&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_8__["a"])(e.data)){var r=[];for(var a in e.data)r.push({key:a,value:e.data[a],$cellEdit:!0});e.dataConfig=r}else e.dataConfig=[]}})),data.group&&data.group.length>0){for(var i=function(e){data.column||(data.column=[]);var t=data.group[e],i={type:"group",label:t.label,icon:t.icon,prop:t.prop,arrow:t.arrow,collapse:t.collapse,display:t.display};_this12.transAvueOptionsToFormDesigner(t).then((function(e){i.children=e,data.column.push(i)}))},n=0;n0&&void 0!==e[0]?e[0]:"json","string"!=n){i.next=10;break}return i.t0=_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_13__["a"],i.next=5,t.transformToAvueOptions(t.widgetForm);case 5:return i.t1=i.sent,i.t2={minify:!0},i.abrupt("return",(0,i.t0)(i.t1,i.t2));case 10:return i.next=12,t.transformToAvueOptions(t.widgetForm);case 12:return i.abrupt("return",i.sent);case 13:case"end":return i.stop()}}),i)})))()}}}},e743:function(e,t,i){var n=i("2273");e.exports=/web0s(?!.*chrome)/i.test(n)},e820:function(e,t,i){"use strict";i("2eb0");var n=i("7d86"),o=i("ac97"),s=i("1810"),r=i("69f1"),a=s("species"),l=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),c=function(){return"$0"==="a".replace(/./,"$0")}(),d=s("replace"),h=function(){return!!/./[d]&&""===/./[d]("a","$0")}(),u=!o((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2!==i.length||"a"!==i[0]||"b"!==i[1]}));e.exports=function(e,t,i,d){var g=s(e),f=!o((function(){var t={};return t[g]=function(){return 7},7!=""[e](t)})),m=f&&!o((function(){var t=!1,i=/a/;return"split"===e&&(i={},i.constructor={},i.constructor[a]=function(){return i},i.flags="",i[g]=/./[g]),i.exec=function(){return t=!0,null},i[g](""),!t}));if(!f||!m||"replace"===e&&(!l||!c||h)||"split"===e&&!u){var p=/./[g],_=i(g,""[e],(function(e,t,i,n,o){return t.exec===RegExp.prototype.exec?f&&!o?{done:!0,value:p.call(t,i,n)}:{done:!0,value:e.call(i,t,n)}:{done:!1}}),{REPLACE_KEEPS_$0:c,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:h}),b=_[0],v=_[1];n(String.prototype,e,b),n(RegExp.prototype,g,2==t?function(e,t){return v.call(e,this,t)}:function(e){return v.call(e,this)})}d&&r(RegExp.prototype[g],"sham",!0)}},eb42:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".dic[data-v-332ffb4a]{display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:5px}",""]),e.exports=t},eb46:function(e,t,i){"use strict";var n=i("83ec"),o=i("370b");n({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},eba9:function(e,t,i){var n=i("58a5");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("fb80cdb8",n,!0,{sourceMap:!1,shadowMode:!1})},ec23:function(e,t,i){var n=i("c401"),o=i("6e1d");e.exports=function(e,t){var i=e.exec;if("function"===typeof i){var s=i.call(e,t);if("object"!==typeof s)throw TypeError("RegExp exec method returned something other than an Object or null");return s}if("RegExp"!==n(e))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},eca0:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .lines-content .cigr,.monaco-editor .lines-content .cigra{position:absolute}",""]),e.exports=t},eee7:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},ef61:function(e,t,i){var n=i("83ec"),o=i("c673"),s=i("3e1a"),r=i("ac97"),a=r((function(){s(1)}));n({target:"Object",stat:!0,forced:a},{keys:function(e){return s(o(e))}})},f05e:function(e,t,i){"use strict";var n=i("7d86"),o=i("fbcf"),s=i("ac97"),r=i("ff5c"),a="toString",l=RegExp.prototype,c=l[a],d=s((function(){return"/a/b"!=c.call({source:"a",flags:"b"})})),h=c.name!=a;(d||h)&&n(RegExp.prototype,a,(function(){var e=o(this),t=String(e.source),i=e.flags,n=String(void 0===i&&e instanceof RegExp&&!("flags"in l)?r.call(e):i);return"/"+t+"/"+n}),{unsafe:!0})},f0db:function(e,t){e.exports=!1},f0f1:function(e,t,i){var n=i("396d"),o=i("e629"),s=o.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},f146:function(e,t,i){var n=i("e244"),o=i("eee7"),s=n.document,r=o(s)&&o(s.createElement);e.exports=function(e){return r?s.createElement(e):{}}},f152:function(e,t,i){var n=i("eee7"),o=i("5a43"),s=i("1810"),r=s("species");e.exports=function(e,t){var i;return o(e)&&(i=e.constructor,"function"!=typeof i||i!==Array&&!o(i.prototype)?n(i)&&(i=i[r],null===i&&(i=void 0)):i=void 0),new(void 0===i?Array:i)(0===t?0:t)}},f20c:function(e,t,i){"use strict";(function(e){ +function n(e){return n="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},n(e)}function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(){return s=Object.assign||function(e){for(var t=1;t=0||(o[i]=e[i]);return o}function l(e,t){if(null==e)return{};var i,n,o=a(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i])}return o}function c(e){return d(e)||h(e)||u()}function d(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(i){return!1}return!1}}function L(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function k(e,t,i,n){if(e){i=i||document;do{if(null!=t&&(">"===t[0]?e.parentNode===i&&x(e,t):x(e,t))||n&&e===i)return e;if(e===i)break}while(e=L(e))}return null}var E,D=/\s+/g;function N(e,t,i){if(e&&t)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(D," ").replace(" "+t+" "," ");e.className=(n+(i?" "+t:"")).replace(D," ")}}function I(e,t,i){var n=e&&e.style;if(n){if(void 0===i)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(i=e.currentStyle),void 0===t?i:i[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=i+("string"===typeof i?"":"px")}}function T(e,t){var i="";if("string"===typeof e)i=e;else do{var n=I(e,"transform");n&&"none"!==n&&(i=n+" "+i)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(i)}function M(e,t,i){if(e){var n=e.getElementsByTagName(t),o=0,s=n.length;if(i)for(;o=s:o<=s,!r)return n;if(n===O())break;n=H(n,!1)}return!1}function P(e,t,i){var n=0,o=0,s=e.children;while(o2&&void 0!==arguments[2]?arguments[2]:{},n=i.evt,o=l(i,["evt"]);ie.pluginEvent.bind(Qe)(e,t,r({dragEl:re,parentEl:ae,ghostEl:le,rootEl:ce,nextEl:de,lastDownEl:he,cloneEl:ue,cloneHidden:ge,dragStarted:ke,putSortable:ve,activeSortable:Qe.active,originalEvent:n,oldIndex:fe,oldDraggableIndex:pe,newIndex:me,newDraggableIndex:_e,hideGhostForTarget:Ge,unhideGhostForTarget:Ye,cloneNowHidden:function(){ge=!0},cloneNowShown:function(){ge=!1},dispatchSortableEvent:function(e){se({sortable:t,name:e,originalEvent:n})}},o))};function se(e){ne(r({putSortable:ve,cloneEl:ue,targetEl:re,rootEl:ce,oldIndex:fe,oldDraggableIndex:pe,newIndex:me,newDraggableIndex:_e},e))}var re,ae,le,ce,de,he,ue,ge,fe,me,pe,_e,be,ve,we,Ce,ye,Se,xe,Le,ke,Ee,De,Ne,Ie,Te=!1,Me=!1,Oe=[],Ae=!1,Re=!1,Pe=[],Fe=!1,We=[],Be="undefined"!==typeof document,Ve=v,He=p||m?"cssFloat":"float",ze=Be&&!w&&!v&&"draggable"in document.createElement("div"),Ue=function(){if(Be){if(m)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Ke=function(e,t){var i=I(e),n=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),o=P(e,0,t),s=P(e,1,t),r=o&&I(o),a=s&&I(s),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+A(o).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+A(s).width;if("flex"===i.display)return"column"===i.flexDirection||"column-reverse"===i.flexDirection?"vertical":"horizontal";if("grid"===i.display)return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&r["float"]&&"none"!==r["float"]){var d="left"===r["float"]?"left":"right";return!s||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return o&&("block"===r.display||"flex"===r.display||"table"===r.display||"grid"===r.display||l>=n&&"none"===i[He]||s&&"none"===i[He]&&l+c>n)?"vertical":"horizontal"},je=function(e,t,i){var n=i?e.left:e.top,o=i?e.right:e.bottom,s=i?e.width:e.height,r=i?t.left:t.top,a=i?t.right:t.bottom,l=i?t.width:t.height;return n===r||o===a||n+s/2===r+l/2},qe=function(e,t){var i;return Oe.some((function(n){if(!F(n)){var o=A(n),s=n[X].options.emptyInsertThreshold,r=e>=o.left-s&&e<=o.right+s,a=t>=o.top-s&&t<=o.bottom+s;return s&&r&&a?i=n:void 0}})),i},$e=function(e){function t(e,i){return function(n,o,s,r){var a=n.options.group.name&&o.options.group.name&&n.options.group.name===o.options.group.name;if(null==e&&(i||a))return!0;if(null==e||!1===e)return!1;if(i&&"clone"===e)return e;if("function"===typeof e)return t(e(n,o,s,r),i)(n,o,s,r);var l=(i?n:o).options.group.name;return!0===e||"string"===typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var i={},o=e.group;o&&"object"==n(o)||(o={name:o}),i.name=o.name,i.checkPull=t(o.pull,!0),i.checkPut=t(o.put),i.revertClone=o.revertClone,e.group=i},Ge=function(){!Ue&&le&&I(le,"display","none")},Ye=function(){!Ue&&le&&I(le,"display","")};Be&&document.addEventListener("click",(function(e){if(Me)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Me=!1,!1}),!0);var Xe=function(e){if(re){e=e.touches?e.touches[0]:e;var t=qe(e.clientX,e.clientY);if(t){var i={};for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);i.target=i.rootEl=t,i.preventDefault=void 0,i.stopPropagation=void 0,t[X]._onDragOver(i)}}},Ze=function(e){re&&re.parentNode[X]._isOutsideThisEl(e.target)};function Qe(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=s({},t),e[X]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ke(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Qe.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var n in ie.initializePlugins(this,e,i),i)!(n in t)&&(t[n]=i[n]);for(var o in $e(t),this)"_"===o.charAt(0)&&"function"===typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!t.forceFallback&&ze,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?y(e,"pointerdown",this._onTapStart):(y(e,"mousedown",this._onTapStart),y(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(y(e,"dragover",this),y(e,"dragenter",this)),Oe.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,Z())}function Je(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function et(e,t,i,n,o,s,r,a){var l,c,d=e[X],h=d.options.onMove;return!window.CustomEvent||m||p?(l=document.createEvent("Event"),l.initEvent("move",!0,!0)):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=i,l.draggedRect=n,l.related=o||t,l.relatedRect=s||A(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),h&&(c=h.call(d,l,r)),c}function tt(e){e.draggable=!1}function it(){Fe=!1}function nt(e,t,i){var n=A(F(i.el,i.options.draggable)),o=10;return t?e.clientX>n.right+o||e.clientX<=n.right&&e.clientY>n.bottom&&e.clientX>=n.left:e.clientX>n.right&&e.clientY>n.top||e.clientX<=n.right&&e.clientY>n.bottom+o}function ot(e,t,i,n,o,s,r,a){var l=n?e.clientY:e.clientX,c=n?i.height:i.width,d=n?i.top:i.left,h=n?i.bottom:i.right,u=!1;if(!r)if(a&&Ned+c*s/2:lh-Ne)return-De}else if(l>d+c*(1-o)/2&&lh-c*s/2)?l>d+c/2?1:-1:0}function st(e){return W(re)=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){re&&tt(re),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;S(e,"mouseup",this._disableDelayedDrag),S(e,"touchend",this._disableDelayedDrag),S(e,"touchcancel",this._disableDelayedDrag),S(e,"mousemove",this._delayedDragTouchMoveHandler),S(e,"touchmove",this._delayedDragTouchMoveHandler),S(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?y(document,"pointermove",this._onTouchMove):y(document,t?"touchmove":"mousemove",this._onTouchMove):(y(re,"dragend",this),y(ce,"dragstart",this._onDragStart));try{document.selection?lt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(i){}},_dragStarted:function(e,t){if(Te=!1,ce&&re){oe("dragStarted",this,{evt:t}),this.nativeDraggable&&y(document,"dragover",Ze);var i=this.options;!e&&N(re,i.dragClass,!1),N(re,i.ghostClass,!0),Qe.active=this,e&&this._appendGhost(),se({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Ce){this._lastX=Ce.clientX,this._lastY=Ce.clientY,Ge();var e=document.elementFromPoint(Ce.clientX,Ce.clientY),t=e;while(e&&e.shadowRoot){if(e=e.shadowRoot.elementFromPoint(Ce.clientX,Ce.clientY),e===t)break;t=e}if(re.parentNode[X]._isOutsideThisEl(e),t)do{if(t[X]){var i=void 0;if(i=t[X]._onDragOver({clientX:Ce.clientX,clientY:Ce.clientY,target:e,rootEl:t}),i&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Ye()}},_onTouchMove:function(e){if(we){var t=this.options,i=t.fallbackTolerance,n=t.fallbackOffset,o=e.touches?e.touches[0]:e,s=le&&T(le,!0),r=le&&s&&s.a,a=le&&s&&s.d,l=Ve&&Ie&&B(Ie),c=(o.clientX-we.clientX+n.x)/(r||1)+(l?l[0]-Pe[0]:0)/(r||1),d=(o.clientY-we.clientY+n.y)/(a||1)+(l?l[1]-Pe[1]:0)/(a||1);if(!Qe.active&&!Te){if(i&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(se({rootEl:ae,name:"add",toEl:ae,fromEl:ce,originalEvent:e}),se({sortable:this,name:"remove",toEl:ae,originalEvent:e}),se({rootEl:ae,name:"sort",toEl:ae,fromEl:ce,originalEvent:e}),se({sortable:this,name:"sort",toEl:ae,originalEvent:e})),ve&&ve.save()):me!==fe&&me>=0&&(se({sortable:this,name:"update",toEl:ae,originalEvent:e}),se({sortable:this,name:"sort",toEl:ae,originalEvent:e})),Qe.active&&(null!=me&&-1!==me||(me=fe,_e=pe),se({sortable:this,name:"end",toEl:ae,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){oe("nulling",this),ce=re=ae=le=de=ue=he=ge=we=Ce=ke=me=_e=fe=pe=Ee=De=ve=be=Qe.dragged=Qe.ghost=Qe.clone=Qe.active=null,We.forEach((function(e){e.checked=!0})),We.length=ye=Se=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":re&&(this._onDragOver(e),Je(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e,t=[],i=this.el.children,n=0,o=i.length,s=this.options;n1&&(Ot.forEach((function(e){n.addAnimationState({target:e,rect:Pt?A(e):o}),Y(e),e.fromRect=o,t.removeAnimationState(e)})),Pt=!1,Bt(!this.options.removeCloneOnHide,i))},dragOverCompleted:function(e){var t=e.sortable,i=e.isOwner,n=e.insertion,o=e.activeSortable,s=e.parentEl,r=e.putSortable,a=this.options;if(n){if(i&&o._hideClone(),Rt=!1,a.animation&&Ot.length>1&&(Pt||!i&&!o.options.sort&&!r)){var l=A(It,!1,!0,!0);Ot.forEach((function(e){e!==It&&(G(e,l),s.appendChild(e))})),Pt=!0}if(!i)if(Pt||Ht(),Ot.length>1){var c=Mt;o._showClone(t),o.options.animation&&!Mt&&c&&At.forEach((function(e){o.addAnimationState({target:e,rect:Tt}),e.fromRect=Tt,e.thisAnimationDuration=null}))}else o._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,i=e.isOwner,n=e.activeSortable;if(Ot.forEach((function(e){e.thisAnimationDuration=null})),n.options.animation&&!i&&n.multiDrag.isMultiDrag){Tt=s({},t);var o=T(It,!0);Tt.top-=o.f,Tt.left-=o.e}},dragOverAnimationComplete:function(){Pt&&(Pt=!1,Ht())},drop:function(e){var t=e.originalEvent,i=e.rootEl,n=e.parentEl,o=e.sortable,s=e.dispatchSortableEvent,r=e.oldIndex,a=e.putSortable,l=a||this.sortable;if(t){var c=this.options,d=n.children;if(!Ft)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),N(It,c.selectedClass,!~Ot.indexOf(It)),~Ot.indexOf(It))Ot.splice(Ot.indexOf(It),1),Dt=null,ne({sortable:o,rootEl:i,name:"deselect",targetEl:It,originalEvt:t});else{if(Ot.push(It),ne({sortable:o,rootEl:i,name:"select",targetEl:It,originalEvt:t}),t.shiftKey&&Dt&&o.el.contains(Dt)){var h,u,g=W(Dt),f=W(It);if(~g&&~f&&g!==f)for(f>g?(u=g,h=f):(u=f,h=g+1);u1){var m=A(It),p=W(It,":not(."+this.options.selectedClass+")");if(!Rt&&c.animation&&(It.thisAnimationDuration=null),l.captureAnimationState(),!Rt&&(c.animation&&(It.fromRect=m,Ot.forEach((function(e){if(e.thisAnimationDuration=null,e!==It){var t=Pt?A(e):m;e.fromRect=t,l.addAnimationState({target:e,rect:t})}}))),Ht(),Ot.forEach((function(e){d[p]?n.insertBefore(e,d[p]):n.appendChild(e),p++})),r===W(It))){var _=!1;Ot.forEach((function(e){e.sortableIndex===W(e)||(_=!0)})),_&&s("update")}Ot.forEach((function(e){Y(e)})),l.animateAll()}Nt=l}(i===n||a&&"clone"!==a.lastPutMode)&&At.forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))}},nullingGlobal:function(){this.isMultiDrag=Ft=!1,At.length=0},destroyGlobal:function(){this._deselectMultiDrag(),S(document,"pointerup",this._deselectMultiDrag),S(document,"mouseup",this._deselectMultiDrag),S(document,"touchend",this._deselectMultiDrag),S(document,"keydown",this._checkKeyDown),S(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(("undefined"===typeof Ft||!Ft)&&Nt===this.sortable&&(!e||!k(e.target,this.options.draggable,this.sortable.el,!1))&&(!e||0===e.button))while(Ot.length){var t=Ot[0];N(t,this.options.selectedClass,!1),Ot.shift(),ne({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},s(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[X];t&&t.options.multiDrag&&!~Ot.indexOf(e)&&(Nt&&Nt!==t&&(Nt.multiDrag._deselectMultiDrag(),Nt=t),N(e,t.options.selectedClass,!0),Ot.push(e))},deselect:function(e){var t=e.parentNode[X],i=Ot.indexOf(e);t&&t.options.multiDrag&&~i&&(N(e,t.options.selectedClass,!1),Ot.splice(i,1))}},eventProperties:function(){var e=this,t=[],i=[];return Ot.forEach((function(n){var o;t.push({multiDragElement:n,index:n.sortableIndex}),o=Pt&&n!==It?-1:Pt?W(n,":not(."+e.options.selectedClass+")"):W(n),i.push({multiDragElement:n,index:o})})),{items:c(Ot),clones:[].concat(At),oldIndicies:t,newIndicies:i}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),"ctrl"===e?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function Bt(e,t){Ot.forEach((function(i,n){var o=t.children[i.sortableIndex+(e?Number(n):0)];o?t.insertBefore(i,o):t.appendChild(i)}))}function Vt(e,t){At.forEach((function(i,n){var o=t.children[i.sortableIndex+(e?Number(n):0)];o?t.insertBefore(i,o):t.appendChild(i)}))}function Ht(){Ot.forEach((function(e){e!==It&&e.parentNode&&e.parentNode.removeChild(e)}))}Qe.mount(new bt),Qe.mount(Lt,xt),t["default"]=Qe},7979:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".codicon-wrench-subaction{opacity:.5}@-webkit-keyframes codicon-spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes codicon-spin{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.codicon-loading.codicon-modifier-spin,.codicon-sync.codicon-modifier-spin{-webkit-animation:codicon-spin 1.5s steps(30) infinite;animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{-webkit-animation-duration:1s!important;animation-duration:1s!important;-webkit-animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}",""]),e.exports=t},"7d86":function(e,t,i){var n=i("e244"),o=i("69f1"),s=i("fe32"),r=i("72c7"),a=i("9550"),l=i("35d6"),c=l.get,d=l.enforce,h=String(String).split("String");(e.exports=function(e,t,i,a){var l,c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,g=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof t||s(i,"name")||o(i,"name",t),l=d(i),l.source||(l.source=h.join("string"==typeof t?t:""))),e!==n?(c?!g&&e[t]&&(u=!0):delete e[t],u?e[t]=i:o(e,t,i)):u?e[t]=i:r(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||a(this)}))},"7e50":function(e,t,i){var n=i("83ec"),o=i("ac97"),s=i("45ad"),r=i("42b1").f,a=i("55ab"),l=o((function(){r(1)})),c=!a||l;n({target:"Object",stat:!0,forced:c,sham:!a},{getOwnPropertyDescriptor:function(e,t){return r(s(e),t)}})},"7eca":function(e,t,i){"use strict";function n(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,i){const n=i[0];return"undefined"!==typeof t[n]?t[n]:e})),i}function o(e,t,...i){return n(t,i)}i.r(t),i.d(t,"CancellationTokenSource",(function(){return BF})),i.d(t,"Emitter",(function(){return VF})),i.d(t,"KeyCode",(function(){return HF})),i.d(t,"KeyMod",(function(){return zF})),i.d(t,"Position",(function(){return UF})),i.d(t,"Range",(function(){return KF})),i.d(t,"Selection",(function(){return jF})),i.d(t,"SelectionDirection",(function(){return qF})),i.d(t,"MarkerSeverity",(function(){return $F})),i.d(t,"MarkerTag",(function(){return GF})),i.d(t,"Uri",(function(){return YF})),i.d(t,"Token",(function(){return XF})),i.d(t,"editor",(function(){return ZF})),i.d(t,"languages",(function(){return QF}));var s=i("1cb4");const r="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function a(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of r)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}const l=a();function c(e){let t=l;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 d={maxLen:1e3,windowSize:15,timeBudget:150};function h(e,t,i,n,o=d){if(i.length>o.maxLen){let s=e-o.maxLen/2;return s<0?s=0:n+=s,i=i.substring(s,e+o.maxLen/2),h(e,t,i,n,o)}const s=Date.now(),r=e-1-n;let a=-1,l=null;for(let c=1;;c++){if(Date.now()-s>=o.timeBudget)break;const e=r-o.windowSize*c;t.lastIndex=Math.max(0,e);const n=u(t,i,r,a);if(!n&&l)break;if(l=n,e<=0)break;a=e}if(l){let e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function u(e,t,i,n){let o;while(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}const g=8;class f{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class m{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class p{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class _{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}compute(e,t,i){return i}}class b{constructor(e,t=null){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0,this.deps=t}validate(e){return this.defaultValue}}class v{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}validate(e){return"undefined"===typeof e?this.defaultValue:e}compute(e,t,i){return i}}function w(e,t){return"undefined"===typeof e?t:"false"!==e&&Boolean(e)}class C extends v{constructor(e,t,i,n){"undefined"!==typeof n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return w(e,this.defaultValue)}}class y extends v{constructor(e,t,i,n,o,s){"undefined"!==typeof s&&(s.type="integer",s.default=i,s.minimum=n,s.maximum=o),super(e,t,i,s),this.minimum=n,this.maximum=o}static clampedInt(e,t,i,n){if("undefined"===typeof e)return t;let o=parseInt(e,10);return isNaN(o)?t:(o=Math.max(i,o),o=Math.min(n,o),0|o)}validate(e){return y.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}class S extends v{constructor(e,t,i,n,o){"undefined"!==typeof o&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=n}static clamp(e,t,i){return ei?i:e}static float(e,t){if("number"===typeof e)return e;if("undefined"===typeof e)return t;const i=parseFloat(e);return isNaN(i)?t:i}validate(e){return this.validationFn(S.float(e,this.defaultValue))}}class x extends v{static string(e,t){return"string"!==typeof e?t:e}constructor(e,t,i,n){"undefined"!==typeof n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return x.string(e,this.defaultValue)}}function L(e,t,i){return"string"!==typeof e||-1===i.indexOf(e)?t:e}class k extends v{constructor(e,t,i,n,o){"undefined"!==typeof o&&(o.type="string",o.enum=n,o.default=i),super(e,t,i,o),this._allowedValues=n}validate(e){return L(e,this.defaultValue,this._allowedValues)}}class E extends _{constructor(e,t,i,n,o,s,r){"undefined"!==typeof 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)}}function D(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class N extends _{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[o("accessibilitySupport.auto","The editor will use platform APIs to detect when a Screen Reader is attached."),o("accessibilitySupport.on","The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."),o("accessibilitySupport.off","The editor will never be optimized for usage with a Screen Reader.")],default:"auto",description:o("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}}class I extends _{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(16,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:o("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:o("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:w(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:w(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function T(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var M;function O(e){switch(e){case"line":return M.Line;case"block":return M.Block;case"underline":return M.Underline;case"line-thin":return M.LineThin;case"block-outline":return M.BlockOutline;case"underline-thin":return M.UnderlineThin}}(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"})(M||(M={}));class A extends b{constructor(){super(121,[60,29])}compute(e,t,i){const n=["monaco-editor"];return t.get(29)&&n.push(t.get(29)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(60)?n.push("mouse-default"):"copy"===t.get(60)&&n.push("mouse-copy"),t.get(95)&&n.push("showUnused"),t.get(119)&&n.push("showDeprecated"),n.join(" ")}}class R extends C{constructor(){super(28,"emptySelectionClipboard",!0,{description:o("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class P extends _{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:!0,autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(31,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:o("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"boolean",default:e.seedSearchStringFromSelection,description:o("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:[o("editor.find.autoFindInSelection.never","Never turn on Find in selection automatically (default)"),o("editor.find.autoFindInSelection.always","Always turn on Find in selection automatically"),o("editor.find.autoFindInSelection.multiline","Turn on Find in selection automatically when multiple lines of content are selected.")],description:o("find.autoFindInSelection","Controls the condition for turning on find in selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:o("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:s["f"]},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:o("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:o("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:w(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:w(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection),autoFindInSelection:"boolean"===typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":L(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:w(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:w(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:w(t.loop,this.defaultValue.loop)}}}class F extends _{constructor(){super(39,"fontLigatures",F.OFF,{anyOf:[{type:"boolean",description:o("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:o("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:o("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"undefined"===typeof e?this.defaultValue:"string"===typeof e?"false"===e?F.OFF:"true"===e?F.ON:e:Boolean(e)?F.ON:F.OFF}}F.OFF='"liga" off, "calt" off',F.ON='"liga" on, "calt" on';class W extends b{constructor(){super(38)}compute(e,t,i){return e.fontInfo}}class B extends v{constructor(){super(40,"fontSize",ue.fontSize,{type:"number",minimum:6,maximum:100,default:ue.fontSize,description:o("fontSize","Controls the font size in pixels.")})}validate(e){let t=S.float(e,this.defaultValue);return 0===t?ue.fontSize:S.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class V extends _{constructor(){super(41,"fontWeight",ue.fontWeight,{anyOf:[{type:"number",minimum:V.MINIMUM_VALUE,maximum:V.MAXIMUM_VALUE,errorMessage:o("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:V.SUGGESTION_VALUES}],default:ue.fontWeight,description:o("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(y.clampedInt(e,ue.fontWeight,V.MINIMUM_VALUE,V.MAXIMUM_VALUE))}}V.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],V.MINIMUM_VALUE=1,V.MAXIMUM_VALUE=1e3;class H extends _{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:[o("editor.gotoLocation.multiple.peek","Show peek view of the results (default)"),o("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a peek view"),o("editor.gotoLocation.multiple.goto","Go to the primary result and enable peek-less navigation to others")]};super(45,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:o("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:o("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:o("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:o("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:o("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:o("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,description:o("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,description:o("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,description:o("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,description:o("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,description:o("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:L(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:L(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:L(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:L(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(o=r.multipleImplementations)&&void 0!==o?o:L(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(s=r.multipleReferences)&&void 0!==s?s:L(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:x.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:x.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:x.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:x.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:x.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class z extends _{constructor(){const e={enabled:!0,delay:300,sticky:!0};super(48,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:o("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,description:o("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:o("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:w(t.enabled,this.defaultValue.enabled),delay:y.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:w(t.sticky,this.defaultValue.sticky)}}}class U extends b{constructor(){super(124,[44,52,33,59,87,54,55,89,111,114,115,116,2])}compute(e,t,i){return U.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),o=Math.floor(e.viewLineCount/n);return{typicalViewportLineCount:t,extraLinesBeyondLastLine:i,desiredRatio:n,minimapLineCount:o}}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,r=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,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,c=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=o>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,f=e.minimap.size,m=e.minimap.side,p=e.verticalScrollbarWidth,_=e.viewLineCount,b=e.remainingWidth,v=e.isViewportWrapping,w=d?2:3;let C=Math.floor(o*n);const y=C/o;let S=!1,x=!1,L=w*h,k=h/o,E=1;if("fill"===f||"fit"===f){const{typicalViewportLineCount:i,extraLinesBeyondLastLine:s,desiredRatio:l,minimapLineCount:d}=U.computeContainedMinimapLineCount({viewLineCount:_,scrollBeyondLastLine:c,height:n,lineHeight:a,pixelRatio:o}),u=_/d;if(u>1)S=!0,x=!0,h=1,L=1,k=h/o;else{let n=!1,c=h+1;if("fit"===f){const i=Math.ceil((_+s)*L);v&&r&&b<=t.stableFitRemainingWidth?(n=!0,c=t.stableFitMaxMinimapScale):(n=i>C,v&&n?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0))}if("fill"===f||n){S=!0;const e=h;L=Math.min(a*o,Math.max(1,Math.floor(1/l))),h=Math.min(c,Math.max(1,Math.floor(L/w))),h>e&&(E=Math.min(2,h/e)),k=h/o/E,C=Math.ceil(Math.max(i,_+s)*L),v&&n&&(t.stableFitMaxMinimapScale=h)}}}const D=Math.floor(u*k),N=Math.min(D,Math.max(0,Math.floor((b-p-2)*k/(l+k)))+g);let I=Math.floor(o*N);const T=I/o;I=Math.floor(I*E);const M=d?1:2,O="left"===m?0:i-N-p;return{renderMinimap:M,minimapLeft:O,minimapWidth:N,minimapHeightIsEditorHeight:S,minimapIsSampling:x,minimapScale:h,minimapLineHeight:L,minimapCanvasInnerWidth:I,minimapCanvasInnerHeight:C,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(116),h="inherit"===d?e.get(115):d,u="inherit"===h?e.get(111):h,g=e.get(114),f=e.get(2),m=t.isDominatedByLongLines,_=e.get(44),b=0!==e.get(54).renderType,v=e.get(55),w=e.get(89),C=e.get(59),S=e.get(87),x=S.verticalScrollbarSize,L=S.verticalHasArrows,k=S.arrowSize,E=S.horizontalScrollbarSize,D=e.get(52),N=e.get(33);let I;if("string"===typeof D&&/^\d+(\.\d+)?ch$/.test(D)){const e=parseFloat(D.substr(0,D.length-2));I=y.clampedInt(e*r,0,0,1e3)}else I=y.clampedInt(D,0,0,1e3);N&&(I+=16);let T=0;if(b){const e=Math.max(s,v);T=Math.round(e*a)}let M=0;_&&(M=o);let O=0,A=O+M,R=A+T,P=R+I;const F=i-M-T-I;let W=!1,B=!1,V=-1;2!==f&&("inherit"===h&&m?(W=!0,B=!0):"on"===u||"bounded"===u?B=!0:"wordWrapColumn"===u&&(V=g));const H=U._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:o,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:w,minimap:C,verticalScrollbarWidth:x,viewLineCount:c,remainingWidth:F,isViewportWrapping:B},t.memory||new p);0!==H.renderMinimap&&0===H.minimapLeft&&(O+=H.minimapWidth,A+=H.minimapWidth,R+=H.minimapWidth,P+=H.minimapWidth);const z=F-H.minimapWidth,K=Math.max(1,Math.floor((z-x-2)/r)),j=L?k:0;return B&&(V=Math.max(1,K),"bounded"===u&&(V=Math.min(V,g))),{width:i,height:n,glyphMarginLeft:O,glyphMarginWidth:M,lineNumbersLeft:A,lineNumbersWidth:T,decorationsLeft:R,decorationsWidth:I,contentLeft:P,contentWidth:z,minimap:H,viewportColumn:K,isWordWrapMinified:W,isViewportWrapping:B,wrappingColumn:V,verticalScrollbarWidth:x,horizontalScrollbarHeight:E,overviewRuler:{top:j,width:x,height:n-2*j,right:0}}}}class K extends _{constructor(){const e={enabled:!0};super(51,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:o("codeActions","Enables the code action lightbulb in the editor.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e;return{enabled:w(t.enabled,this.defaultValue.enabled)}}}class j extends _{constructor(){const e={enabled:!0,fontSize:0,fontFamily:ue.fontFamily};super(120,"inlineHints",e,{"editor.inlineHints.enabled":{type:"boolean",default:e.enabled,description:o("inlineHints.enable","Enables the inline hints in the editor.")},"editor.inlineHints.fontSize":{type:"number",default:e.fontSize,description:o("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:o("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:w(t.enabled,this.defaultValue.enabled),fontSize:y.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:x.string(t.fontFamily,this.defaultValue.fontFamily)}}}class q extends y{constructor(){super(53,"lineHeight",ue.lineHeight,0,150,{description:o("lineHeight","Controls the line height. Use 0 to compute the line height from the font size.")})}compute(e,t,i){return e.fontInfo.lineHeight}}class $ extends _{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(59,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:o("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[o("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),o("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),o("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:o("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:o("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:o("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:o("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:o("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:o("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:w(t.enabled,this.defaultValue.enabled),size:L(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:L(t.side,this.defaultValue.side,["right","left"]),showSlider:L(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:w(t.renderCharacters,this.defaultValue.renderCharacters),scale:y.clampedInt(t.scale,1,1,3),maxColumn:y.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function G(e){return"ctrlCmd"===e?s["f"]?"metaKey":"ctrlKey":"altKey"}class Y extends _{constructor(){super(69,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:o("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:o("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:y.clampedInt(t.top,0,0,1e3),bottom:y.clampedInt(t.bottom,0,0,1e3)}}}class X extends _{constructor(){const e={enabled:!0,cycle:!1};super(70,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:o("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:o("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:w(t.enabled,this.defaultValue.enabled),cycle:w(t.cycle,this.defaultValue.cycle)}}}class Z extends b{constructor(){super(122)}compute(e,t,i){return e.pixelRatio}}class Q extends _{constructor(){const e={other:!0,comments:!1,strings:!1};super(73,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:o("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:o("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{type:"boolean",default:e.other,description:o("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}}}],default:e,description:o("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:w(t.other,this.defaultValue.other),comments:w(t.comments,this.defaultValue.comments),strings:w(t.strings,this.defaultValue.strings)};return!!(i.other&&i.comments&&i.strings)||!!(i.other||i.comments||i.strings)&&i}return this.defaultValue}}class J extends _{constructor(){super(54,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[o("lineNumbers.off","Line numbers are not rendered."),o("lineNumbers.on","Line numbers are rendered as absolute number."),o("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),o("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:o("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return"undefined"!==typeof e&&("function"===typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}function ee(e){const t=e.get(82);return"editable"===t?e.get(75):"on"!==t}class te extends _{constructor(){const e=[],t={type:"number",description:o("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(86,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:o("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:o("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:y.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"===typeof i){const e=i;t.push({column:y.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}}function ie(e,t){if("string"!==typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}class ne extends _{constructor(){super(87,"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=y.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=y.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:y.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:ie(t.vertical,this.defaultValue.vertical),horizontal:ie(t.horizontal,this.defaultValue.horizontal),useShadows:w(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:w(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:w(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:w(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:w(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:y.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:y.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:w(t.scrollByPage,this.defaultValue.scrollByPage)}}}class oe extends _{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(101,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[o("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),o("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:o("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:o("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:o("suggest.localityBonus","Controls whether sorting favours words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:o("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:o("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:o("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:o("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:o("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:o("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:o("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:o("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:o("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!==typeof e)return this.defaultValue;const t=e;return{insertMode:L(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:w(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:w(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:w(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:w(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),showIcons:w(t.showIcons,this.defaultValue.showIcons),showStatusBar:w(t.showStatusBar,this.defaultValue.showStatusBar),showInlineDetails:w(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:w(t.showMethods,this.defaultValue.showMethods),showFunctions:w(t.showFunctions,this.defaultValue.showFunctions),showConstructors:w(t.showConstructors,this.defaultValue.showConstructors),showFields:w(t.showFields,this.defaultValue.showFields),showVariables:w(t.showVariables,this.defaultValue.showVariables),showClasses:w(t.showClasses,this.defaultValue.showClasses),showStructs:w(t.showStructs,this.defaultValue.showStructs),showInterfaces:w(t.showInterfaces,this.defaultValue.showInterfaces),showModules:w(t.showModules,this.defaultValue.showModules),showProperties:w(t.showProperties,this.defaultValue.showProperties),showEvents:w(t.showEvents,this.defaultValue.showEvents),showOperators:w(t.showOperators,this.defaultValue.showOperators),showUnits:w(t.showUnits,this.defaultValue.showUnits),showValues:w(t.showValues,this.defaultValue.showValues),showConstants:w(t.showConstants,this.defaultValue.showConstants),showEnums:w(t.showEnums,this.defaultValue.showEnums),showEnumMembers:w(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:w(t.showKeywords,this.defaultValue.showKeywords),showWords:w(t.showWords,this.defaultValue.showWords),showColors:w(t.showColors,this.defaultValue.showColors),showFiles:w(t.showFiles,this.defaultValue.showFiles),showReferences:w(t.showReferences,this.defaultValue.showReferences),showFolders:w(t.showFolders,this.defaultValue.showFolders),showTypeParameters:w(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:w(t.showSnippets,this.defaultValue.showSnippets),showUsers:w(t.showUsers,this.defaultValue.showUsers),showIssues:w(t.showIssues,this.defaultValue.showIssues)}}}class se extends _{constructor(){super(97,"smartSelect",{selectLeadingAndTrailingWhitespace:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:o("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"===typeof e?{selectLeadingAndTrailingWhitespace:w(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace)}:this.defaultValue}}class re extends b{constructor(){super(123,[75])}compute(e,t,i){const n=t.get(75);return!!n||e.tabFocusMode}}function ae(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}}class le extends b{constructor(){super(125,[124])}compute(e,t,i){const n=t.get(124);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}const ce="Consolas, 'Courier New', monospace",de="Menlo, Monaco, 'Courier New', monospace",he="'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",ue={fontFamily:s["f"]?de:s["d"]?he:ce,fontWeight:"normal",fontSize:s["f"]?12:14,lineHeight:0,letterSpacing:0},ge={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0},fe=[];function me(e){return fe[e.id]=e,e}const pe={acceptSuggestionOnCommitCharacter:me(new C(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:o("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:me(new k(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",o("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:o("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:me(new N),accessibilityPageSize:me(new y(3,"accessibilityPageSize",10,1,1073741824,{description:o("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader. Warning: this has a performance implication for numbers larger than the default.")})),ariaLabel:me(new x(4,"ariaLabel",o("editorViewAccessibleLabel","Editor content"))),autoClosingBrackets:me(new k(5,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",o("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),o("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:o("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingOvertype:me(new k(6,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",o("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:o("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:me(new k(7,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",o("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),o("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:o("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:me(new E(8,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],D,{enumDescriptions:[o("editor.autoIndent.none","The editor will not insert indentation automatically."),o("editor.autoIndent.keep","The editor will keep the current line's indentation."),o("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),o("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),o("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:o("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:me(new C(9,"automaticLayout",!1)),autoSurround:me(new k(10,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[o("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),o("editor.autoSurround.quotes","Surround with quotes but not brackets."),o("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:o("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),stickyTabStops:me(new C(99,"stickyTabStops",!1,{description:o("stickyTabStops","Emulate selection behaviour of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:me(new C(11,"codeLens",!0,{description:o("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:me(new x(12,"codeLensFontFamily","",{description:o("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:me(new y(13,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,description:o("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to `0`, the 90% of `#editor.fontSize#` is used.")})),colorDecorators:me(new C(14,"colorDecorators",!0,{description:o("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),columnSelection:me(new C(15,"columnSelection",!1,{description:o("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:me(new I),contextmenu:me(new C(17,"contextmenu",!0)),copyWithSyntaxHighlighting:me(new C(18,"copyWithSyntaxHighlighting",!0,{description:o("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:me(new E(19,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],T,{description:o("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:me(new C(20,"cursorSmoothCaretAnimation",!1,{description:o("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:me(new E(21,"cursorStyle",M.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],O,{description:o("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:me(new y(22,"cursorSurroundingLines",0,0,1073741824,{description:o("cursorSurroundingLines","Controls the minimal number of visible leading and trailing lines surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:me(new k(23,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[o("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),o("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],description:o("cursorSurroundingLinesStyle","Controls when `cursorSurroundingLines` should be enforced.")})),cursorWidth:me(new y(24,"cursorWidth",0,0,1073741824,{markdownDescription:o("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:me(new C(25,"disableLayerHinting",!1)),disableMonospaceOptimizations:me(new C(26,"disableMonospaceOptimizations",!1)),dragAndDrop:me(new C(27,"dragAndDrop",!0,{description:o("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:me(new R),extraEditorClassName:me(new x(29,"extraEditorClassName","")),fastScrollSensitivity:me(new S(30,"fastScrollSensitivity",5,e=>e<=0?5:e,{markdownDescription:o("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:me(new P),fixedOverflowWidgets:me(new C(32,"fixedOverflowWidgets",!1)),folding:me(new C(33,"folding",!0,{description:o("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:me(new k(34,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[o("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),o("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:o("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:me(new C(35,"foldingHighlight",!0,{description:o("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),unfoldOnClickAfterEndOfLine:me(new C(36,"unfoldOnClickAfterEndOfLine",!1,{description:o("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:me(new x(37,"fontFamily",ue.fontFamily,{description:o("fontFamily","Controls the font family.")})),fontInfo:me(new W),fontLigatures2:me(new F),fontSize:me(new B),fontWeight:me(new V),formatOnPaste:me(new C(42,"formatOnPaste",!1,{description:o("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:me(new C(43,"formatOnType",!1,{description:o("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:me(new C(44,"glyphMargin",!0,{description:o("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:me(new H),hideCursorInOverviewRuler:me(new C(46,"hideCursorInOverviewRuler",!1,{description:o("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),highlightActiveIndentGuide:me(new C(47,"highlightActiveIndentGuide",!0,{description:o("highlightActiveIndentGuide","Controls whether the editor should highlight the active indent guide.")})),hover:me(new z),inDiffEditor:me(new C(49,"inDiffEditor",!1)),letterSpacing:me(new S(50,"letterSpacing",ue.letterSpacing,e=>S.clamp(e,-5,20),{description:o("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:me(new K),lineDecorationsWidth:me(new v(52,"lineDecorationsWidth",10)),lineHeight:me(new q),lineNumbers:me(new J),lineNumbersMinChars:me(new y(55,"lineNumbersMinChars",5,1,300)),linkedEditing:me(new C(56,"linkedEditing",!1,{description:o("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols, e.g. HTML tags, are updated while editing.")})),links:me(new C(57,"links",!0,{description:o("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:me(new k(58,"matchBrackets","always",["always","near","never"],{description:o("matchBrackets","Highlight matching brackets.")})),minimap:me(new $),mouseStyle:me(new k(60,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:me(new S(61,"mouseWheelScrollSensitivity",1,e=>0===e?1:e,{markdownDescription:o("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:me(new C(62,"mouseWheelZoom",!1,{markdownDescription:o("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:me(new C(63,"multiCursorMergeOverlapping",!0,{description:o("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:me(new E(64,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],G,{markdownEnumDescriptions:[o("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),o("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:o({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:me(new k(65,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[o("multiCursorPaste.spread","Each cursor pastes a single line of the text."),o("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:o("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),occurrencesHighlight:me(new C(66,"occurrencesHighlight",!0,{description:o("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:me(new C(67,"overviewRulerBorder",!0,{description:o("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:me(new y(68,"overviewRulerLanes",3,0,3)),padding:me(new Y),parameterHints:me(new X),peekWidgetDefaultFocus:me(new k(71,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[o("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),o("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:o("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:me(new C(72,"definitionLinkOpensInPeek",!1,{description:o("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:me(new Q),quickSuggestionsDelay:me(new y(74,"quickSuggestionsDelay",10,0,1073741824,{description:o("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:me(new C(75,"readOnly",!1)),renameOnType:me(new C(76,"renameOnType",!1,{description:o("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:o("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:me(new C(77,"renderControlCharacters",!1,{description:o("renderControlCharacters","Controls whether the editor should render control characters.")})),renderIndentGuides:me(new C(78,"renderIndentGuides",!0,{description:o("renderIndentGuides","Controls whether the editor should render indent guides.")})),renderFinalNewline:me(new C(79,"renderFinalNewline",!0,{description:o("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:me(new k(80,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",o("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:o("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:me(new C(81,"renderLineHighlightOnlyWhenFocus",!1,{description:o("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused")})),renderValidationDecorations:me(new k(82,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:me(new k(83,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",o("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),o("renderWhitespace.selection","Render whitespace characters only on selected text."),o("renderWhitespace.trailing","Render only trailing whitespace characters"),""],description:o("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:me(new y(84,"revealHorizontalRightPadding",30,0,1e3)),roundedSelection:me(new C(85,"roundedSelection",!0,{description:o("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:me(new te),scrollbar:me(new ne),scrollBeyondLastColumn:me(new y(88,"scrollBeyondLastColumn",5,0,1073741824,{description:o("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:me(new C(89,"scrollBeyondLastLine",!0,{description:o("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:me(new C(90,"scrollPredominantAxis",!0,{description:o("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:me(new C(91,"selectionClipboard",!0,{description:o("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:s["d"]})),selectionHighlight:me(new C(92,"selectionHighlight",!0,{description:o("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:me(new C(93,"selectOnLineNumbers",!0)),showFoldingControls:me(new k(94,"showFoldingControls","mouseover",["always","mouseover"],{enumDescriptions:[o("showFoldingControls.always","Always show the folding controls."),o("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:o("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:me(new C(95,"showUnused",!0,{description:o("showUnused","Controls fading out of unused code.")})),showDeprecated:me(new C(119,"showDeprecated",!0,{description:o("showDeprecated","Controls strikethrough deprecated variables.")})),inlineHints:me(new j),snippetSuggestions:me(new k(96,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[o("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),o("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),o("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),o("snippetSuggestions.none","Do not show snippet suggestions.")],description:o("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:me(new se),smoothScrolling:me(new C(98,"smoothScrolling",!1,{description:o("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:me(new y(100,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:me(new oe),suggestFontSize:me(new y(102,"suggestFontSize",0,0,1e3,{markdownDescription:o("suggestFontSize","Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.")})),suggestLineHeight:me(new y(103,"suggestLineHeight",0,0,1e3,{markdownDescription:o("suggestLineHeight","Line height for the suggest widget. When set to `0`, the value of `#editor.lineHeight#` is used. The minimum value is 8.")})),suggestOnTriggerCharacters:me(new C(104,"suggestOnTriggerCharacters",!0,{description:o("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:me(new k(105,"suggestSelection","recentlyUsed",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[o("suggestSelection.first","Always select the first suggestion."),o("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),o("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:o("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:me(new k(106,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[o("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),o("tabCompletion.off","Disable tab completions."),o("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:o("tabCompletion","Enables tab completions.")})),tabIndex:me(new y(107,"tabIndex",0,-1,1073741824)),unusualLineTerminators:me(new k(108,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[o("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),o("unusualLineTerminators.off","Unusual line terminators are ignored."),o("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:o("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useTabStops:me(new C(109,"useTabStops",!0,{description:o("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordSeparators:me(new x(110,"wordSeparators",r,{description:o("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:me(new k(111,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[o("wordWrap.off","Lines will never wrap."),o("wordWrap.on","Lines will wrap at the viewport width."),o({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),o({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:o({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:me(new x(112,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:me(new x(113,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:me(new y(114,"wordWrapColumn",80,1,1073741824,{markdownDescription:o({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:me(new k(115,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:me(new k(116,"wordWrapOverride2","inherit",["off","on","inherit"])),wrappingIndent:me(new E(117,"wrappingIndent",1,"same",["none","same","indent","deepIndent"],ae,{enumDescriptions:[o("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),o("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),o("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),o("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:o("wrappingIndent","Controls the indentation of wrapped lines.")})),wrappingStrategy:me(new k(118,"wrappingStrategy","simple",["simple","advanced"],{enumDescriptions:[o("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."),o("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:o("wrappingStrategy","Controls the algorithm that computes wrapping points.")})),editorClassName:me(new A),pixelRatio:me(new Z),tabFocusMode:me(new re),layoutInfo:me(new U),wrappingInfo:me(new le)};class _e{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)}}const be=new _e;function ve(e){Se(e)||be.onUnexpectedError(e)}function we(e){Se(e)||be.onUnexpectedExternalError(e)}function Ce(e){if(e instanceof Error){let{name:t,message:i}=e;const n=e.stacktrace||e.stack;return{$isError:!0,name:t,message:i,stack:n}}return e}const ye="Canceled";function Se(e){return e instanceof Error&&e.name===ye&&e.message===ye}function xe(){const e=new Error(ye);return e.name=e.message,e}function Le(e){return e?new Error("Illegal argument: "+e):new Error("Illegal argument")}function ke(e){return e?new Error("Illegal state: "+e):new Error("Illegal state")}var Ee;(function(e){function t(e){return e&&"object"===typeof e&&"function"===typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function n(){return i}function*o(e){yield e}function s(e){return e||i}function r(e){return!e||!0===e[Symbol.iterator]().next().done}function a(e){return e[Symbol.iterator]().next().value}function l(e,t){for(const i of e)if(t(i))return!0;return!1}function*c(e,t){for(const i of e)t(i)&&(yield i)}function*d(e,t){for(const i of e)yield t(i)}function*h(...e){for(const t of e)for(const e of t)yield e}function*u(e){for(const t of e)for(const e of t)yield e}function*g(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t{t[e]||console.log(i)},3e3)}markTracked(t){if(t&&t!==We.None)try{t[e]=!0}catch(i){}}}}function Ie(e){Ne&&Ne.markTracked(e)}function Te(e){return Ne?(Ne.trackDisposable(e),e):e}class Me extends Error{constructor(e){super(`Encounter errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function Oe(e){return"function"===typeof e.dispose&&0===e.dispose.length}function Ae(e){if(Ee.is(e)){let i=[];for(const n of e)if(n){Ie(n);try{n.dispose()}catch(t){i.push(t)}}if(1===i.length)throw i[0];if(i.length>1)throw new Me(i);return Array.isArray(e)?[]:e}if(e)return Ie(e),e.dispose(),e}function Re(...e){return e.forEach(Ie),Pe(()=>Ae(e))}function Pe(e){const t=Te({dispose:()=>{Ie(t),e()}});return t}class Fe{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(Ie(this),this._isDisposed=!0,this.clear())}clear(){try{Ae(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 Ie(e),this._isDisposed?Fe.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}}Fe.DISABLE_DISPOSED_WARNING=!1;class We{constructor(){this._store=new Fe,Te(this)}dispose(){Ie(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}We.None=Object.freeze({dispose(){}});class Be{constructor(){this._isDisposed=!1,Te(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value&&this._value.dispose(),e&&Ie(e),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Ie(this),this._value&&this._value.dispose(),this._value=void 0}}class Ve{constructor(e){this.object=e}dispose(){}}class He{constructor(e){this.element=e,this.next=He.Undefined,this.prev=He.Undefined}}He.Undefined=new He(void 0);class ze{constructor(){this._first=He.Undefined,this._last=He.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===He.Undefined}clear(){this._first=He.Undefined,this._last=He.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new He(e);if(this._first===He.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==He.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==He.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==He.Undefined&&e.next!==He.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===He.Undefined&&e.next===He.Undefined?(this._first=He.Undefined,this._last=He.Undefined):e.next===He.Undefined?(this._last=this._last.prev,this._last.next=He.Undefined):e.prev===He.Undefined&&(this._first=this._first.next,this._first.prev=He.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;while(e!==He.Undefined)yield e.element,e=e.next}}const Ue=s["b"].performance&&"function"===typeof s["b"].performance.now;class Ke{constructor(e){this._highResolution=Ue&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new Ke(e)}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?s["b"].performance.now():Date.now()}}var je;(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 l((i,n=null,o)=>e(e=>i.call(n,t(e)),null,o))}function n(e,t){return l((i,n=null,o)=>e(e=>{t(e),i.call(n,e)},null,o))}function o(e,t){return l((i,n=null,o)=>e(e=>t(e)&&i.call(n,e),null,o))}function s(e){return e}function r(...e){return(t,i=null,n)=>Re(...e.map(e=>e(e=>t.call(i,e),null,n)))}function a(e,t,n){let o=n;return i(e,e=>(o=t(o,e),o))}function l(e){let t;const i=new Ye({onFirstListenerAdd(){t=e(i.fire,i)},onLastListenerRemove(){t.dispose()}});return i.event}function c(e,t,i=100,n=!1,o){let s,r=void 0,a=void 0,l=0;const c=new Ye({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 d(e){const n=(new Date).getTime();return i(t(e),e=>(new Date).getTime()-n)}function h(e){let t,i=!0;return o(e,e=>{const n=i||e!==t;return i=!1,t=e,n})}function u(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 Ye({onFirstListenerAdd(){o||(o=e(e=>r.fire(e)))},onFirstListenerDidAdd(){n&&(t?setTimeout(s):s())},onLastListenerRemove(){o&&o.dispose(),o=null}});return r.event}e.None=()=>We.None,e.once=t,e.map=i,e.forEach=n,e.filter=o,e.signal=s,e.any=r,e.reduce=a,e.snapshot=l,e.debounce=c,e.stopwatch=d,e.latch=h,e.buffer=u;class g{constructor(e){this.event=e}map(e){return new g(i(this.event,e))}forEach(e){return new g(n(this.event,e))}filter(e){return new g(o(this.event,e))}reduce(e,t){return new g(a(this.event,e,t))}latch(){return new g(h(this.event))}debounce(e,t=100,i=!1,n){return new g(c(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)}}function f(e){return new g(e)}function m(e,t,i=(e=>e)){const n=(...e)=>r.fire(i(...e)),o=()=>e.on(t,n),s=()=>e.removeListener(t,n),r=new Ye({onFirstListenerAdd:o,onLastListenerRemove:s});return r.event}function p(e,t,i=(e=>e)){const n=(...e)=>r.fire(i(...e)),o=()=>e.addEventListener(t,n),s=()=>e.removeEventListener(t,n),r=new Ye({onFirstListenerAdd:o,onLastListenerRemove:s});return r.event}function _(e){const t=new Ye;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}function b(e){return new Promise(i=>t(e)(i))}e.chain=f,e.fromNodeEventEmitter=m,e.fromDOMEventEmitter=p,e.fromPromise=_,e.toPromise=b})(je||(je={}));class qe{constructor(e){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${e}_${qe._idPool++}`}start(e){this._stopWatch=new Ke(!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}}}qe._idPool=0;let $e=-1;class Ge{constructor(e,t=Math.random().toString(18).slice(2,5)){this.customThreshold=e,this.name=t,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(e){let t=$e;if("number"===typeof this.customThreshold&&(t=this.customThreshold),t<=0||e{const e=this._stacks.get(i)||0;this._stacks.set(i,e-1)}}}class Ye{constructor(e){var t;this._disposed=!1,this._options=e,this._leakageMon=$e>0?new Ge(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=(null===(t=this._options)||void 0===t?void 0:t._profName)?new qe(this._options._profName):void 0}get event(){return this._event||(this._event=(e,t,i)=>{var n;this._listeners||(this._listeners=new ze);const o=this._listeners.isEmpty();o&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=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 r=null===(n=this._leakageMon)||void 0===n?void 0:n.check(this._listeners.size);let a;return a={dispose:()=>{if(r&&r(),a.dispose=Ye._noop,!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const e=this._listeners&&!this._listeners.isEmpty();e||this._options.onLastListenerRemove(this)}}},i instanceof Fe?i.add(a):Array.isArray(i)&&i.push(a),a}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ze);for(let t of this._listeners)this._deliveryQueue.push([t,e]);null===(t=this._perfMon)||void 0===t||t.start(this._deliveryQueue.size);while(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(n){ve(n)}}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}}Ye._noop=function(){};class Xe extends Ye{constructor(e){super(e),this._isPaused=0,this._eventQueue=new ze,this._mergeFn=null===e||void 0===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 while(!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 Ze{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 Qe{constructor(){this.listening=!1,this.inputEvent=je.None,this.inputEventListener=We.None,this.emitter=new Ye({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()}}const Je=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var et;(function(e){function t(t){return t===e.None||t===e.Cancelled||(t instanceof tt||!(!t||"object"!==typeof t)&&("boolean"===typeof t.isCancellationRequested&&"function"===typeof t.onCancellationRequested))}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:je.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Je})})(et||(et={}));class tt{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?Je:(this._emitter||(this._emitter=new Ye),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class it{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 tt),this._token}cancel(){this._token?this._token instanceof tt&&this._token.cancel():this._token=et.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener&&this._parentListener.dispose(),this._token?this._token instanceof tt&&this._token.dispose():this._token=et.None}}class nt{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 ot=new nt,st=new nt,rt=new nt;var at;function lt(e,t){const i=(65535&t)<<16>>>0;return(e|i)>>>0}function ct(e,t){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new ut(0!==n?[dt(i,t),dt(n,t)]:[dt(i,t)])}function dt(e,t){const i=!!(2048&e),n=!!(256&e),o=2===t?n:i,s=!!(1024&e),r=!!(512&e),a=2===t?i:n,l=255&e;return new ht(o,s,r,a,l)}(function(){function e(e,t,i=t,n=i){ot.define(e,t),st.define(e,i),rt.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){function t(e){return ot.keyCodeToStr(e)}function i(e){return ot.strToKeyCode(e)}function n(e){return st.keyCodeToStr(e)}function o(e){return rt.keyCodeToStr(e)}function s(e){return st.strToKeyCode(e)||rt.strToKeyCode(e)}e.toString=t,e.fromString=i,e.toUserSettingsUS=n,e.toUserSettingsGeneral=o,e.fromUserSettings=s}(at||(at={}));class ht{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 ut([this])}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class ut{constructor(e){if(0===e.length)throw Le("parts");this.parts=e}}class gt{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 ft{}var mt=i("f940");const pt=65,_t=97,bt=90,vt=122,wt=46,Ct=47,yt=92,St=58,xt=63;class Lt 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 kt(e,t){if("string"!==typeof e)throw new Lt(t,"string",e)}function Et(e){return e===Ct||e===yt}function Dt(e){return e===Ct}function Nt(e){return e>=pt&&e<=bt||e>=_t&&e<=vt}function It(e,t,i,n){let o="",s=0,r=-1,a=0,l=0;for(let c=0;c<=e.length;++c){if(c2){const e=o.lastIndexOf(i);-1===e?(o="",s=0):(o=o.slice(0,e),s=o.length-1-o.lastIndexOf(i)),r=c,a=0;continue}if(0!==o.length){o="",s=0,r=c,a=0;continue}}t&&(o+=o.length>0?i+"..":"..",s=2)}else o.length>0?o+=`${i}${e.slice(r+1,c)}`:o=e.slice(r+1,c),s=c-r-1;r=c,a=0}else l===wt&&-1!==a?++a:a=-1}return o}function Tt(e,t){if(null===t||"object"!==typeof t)throw new Lt("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 Mt={resolve(...e){let t="",i="",n=!1;for(let o=e.length-1;o>=-1;o--){let s;if(o>=0){if(s=e[o],kt(s,"path"),0===s.length)continue}else 0===t.length?s=mt["a"]():(s=mt["b"]["="+t]||mt["a"](),(void 0===s||s.slice(0,2).toLowerCase()!==t.toLowerCase()&&s.charCodeAt(2)===yt)&&(s=t+"\\"));const r=s.length;let a=0,l="",c=!1;const d=s.charCodeAt(0);if(1===r)Et(d)&&(a=1,c=!0);else if(Et(d))if(c=!0,Et(s.charCodeAt(1))){let e=2,t=e;while(e2&&Et(s.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${s.slice(a)}\\${i}`,n=c,c&&t.length>0)break}return i=It(i,!n,"\\",Et),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){kt(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 Dt(s)?"\\":e;if(Et(s))if(o=!0,Et(e.charCodeAt(1))){let o=2,s=o;while(o2&&Et(e.charCodeAt(2))&&(o=!0,n=3));let r=n0&&Et(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?o?"\\"+r:r:o?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){kt(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return Et(i)||t>2&&Nt(i)&&e.charCodeAt(1)===St&&Et(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let s=0;s0&&(void 0===t?t=i=n:t+="\\"+n)}if(void 0===t)return".";let n=!0,o=0;if("string"===typeof i&&Et(i.charCodeAt(0))){++o;const e=i.length;e>1&&Et(i.charCodeAt(1))&&(++o,e>2&&(Et(i.charCodeAt(2))?++o:n=!1))}if(n){while(o=2&&(t="\\"+t.slice(o))}return Mt.normalize(t)},relative(e,t){if(kt(e,"from"),kt(t,"to"),e===t)return"";const i=Mt.resolve(e),n=Mt.resolve(t);if(i===n)return"";if(e=i.toLowerCase(),t=n.toLowerCase(),e===t)return"";let o=0;while(oo&&e.charCodeAt(s-1)===yt)s--;const r=s-o;let a=0;while(aa&&t.charCodeAt(l-1)===yt)l--;const c=l-a,d=rd){if(t.charCodeAt(a+u)===yt)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>d&&(e.charCodeAt(o+u)===yt?h=u:2===u&&(h=3)),-1===h&&(h=0)}let g="";for(u=o+h+1;u<=s;++u)u!==s&&e.charCodeAt(u)!==yt||(g+=0===g.length?"..":"\\..");return a+=h,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===yt&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!==typeof e)return e;if(0===e.length)return"";const t=Mt.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===yt){if(t.charCodeAt(1)===yt){const e=t.charCodeAt(2);if(e!==xt&&e!==wt)return"\\\\?\\UNC\\"+t.slice(2)}}else if(Nt(t.charCodeAt(0))&&t.charCodeAt(1)===St&&t.charCodeAt(2)===yt)return"\\\\?\\"+t;return e},dirname(e){kt(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const o=e.charCodeAt(0);if(1===t)return Et(o)?e:".";if(Et(o)){if(i=n=1,Et(e.charCodeAt(1))){let o=2,s=o;while(o2&&Et(e.charCodeAt(2))?3:2,n=i);let s=-1,r=!0;for(let a=t-1;a>=n;--a)if(Et(e.charCodeAt(a))){if(!r){s=a;break}}else r=!1;if(-1===s){if(-1===i)return".";s=i}return e.slice(0,s)},basename(e,t){void 0!==t&&kt(t,"ext"),kt(e,"path");let i,n=0,o=-1,s=!0;if(e.length>=2&&Nt(e.charCodeAt(0))&&e.charCodeAt(1)===St&&(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(Et(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(Et(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){kt(e,"path");let t=0,i=-1,n=0,o=-1,s=!0,r=0;e.length>=2&&e.charCodeAt(1)===St&&Nt(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(Et(t)){if(!s){n=a+1;break}}else-1===o&&(s=!1,o=a+1),t===wt?-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:Tt.bind(null,"\\"),parse(e){kt(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 Et(o)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Et(o)){if(n=1,Et(e.charCodeAt(1))){let t=2,o=t;while(t0&&(t.root=e.slice(0,n));let s=-1,r=n,a=-1,l=!0,c=e.length-1,d=0;for(;c>=n;--c)if(o=e.charCodeAt(c),Et(o)){if(!l){r=c+1;break}}else-1===a&&(l=!1,a=c+1),o===wt?-1===s?s=c:1!==d&&(d=1):-1!==s&&(d=-1);return-1!==a&&(-1===s||0===d||1===d&&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},Ot={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=-1&&!i;n--){const o=n>=0?e[n]:mt["a"]();kt(o,"path"),0!==o.length&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Ct)}return t=It(t,!i,"/",Dt),i?"/"+t:t.length>0?t:"."},normalize(e){if(kt(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Ct,i=e.charCodeAt(e.length-1)===Ct;return e=It(e,!t,"/",Dt),0===e.length?t?"/":i?"./":".":(i&&(e+="/"),t?"/"+e:e)},isAbsolute(e){return kt(e,"path"),e.length>0&&e.charCodeAt(0)===Ct},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?".":Ot.normalize(t)},relative(e,t){if(kt(e,"from"),kt(t,"to"),e===t)return"";if(e=Ot.resolve(e),t=Ot.resolve(t),e===t)return"";const i=1,n=e.length,o=n-i,s=1,r=t.length-s,a=oa){if(t.charCodeAt(s+c)===Ct)return t.slice(s+c+1);if(0===c)return t.slice(s+c)}else o>a&&(e.charCodeAt(i+c)===Ct?l=c:0===c&&(l=0));let d="";for(c=i+l+1;c<=n;++c)c!==n&&e.charCodeAt(c)!==Ct||(d+=0===d.length?"..":"/..");return`${d}${t.slice(s+l)}`},toNamespacedPath(e){return e},dirname(e){if(kt(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Ct;let i=-1,n=!0;for(let o=e.length-1;o>=1;--o)if(e.charCodeAt(o)===Ct){if(!n){i=o;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&kt(t,"ext"),kt(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===Ct){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)===Ct){if(!s){n=i+1;break}}else-1===o&&(s=!1,o=i+1);return-1===o?"":e.slice(n,o)},extname(e){kt(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!==Ct)-1===n&&(o=!1,n=r+1),a===wt?-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:Tt.bind(null,"/"),parse(e){kt(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===Ct;let n;i?(t.root="/",n=1):n=0;let o=-1,s=0,r=-1,a=!0,l=e.length-1,c=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==Ct)-1===r&&(a=!1,r=l+1),t===wt?-1===o?o=l:1!==c&&(c=1):-1!==o&&(c=-1);else if(!a){s=l+1;break}}if(-1!==r){const n=0===s&&i?1:s;-1===o||0===c||1===c&&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};Ot.win32=Mt.win32=Mt,Ot.posix=Mt.posix=Ot;const At="win32"===mt["c"]?Mt.normalize:Ot.normalize,Rt="win32"===mt["c"]?Mt.resolve:Ot.resolve,Pt="win32"===mt["c"]?Mt.relative:Ot.relative,Ft="win32"===mt["c"]?Mt.dirname:Ot.dirname,Wt="win32"===mt["c"]?Mt.basename:Ot.basename,Bt="win32"===mt["c"]?Mt.extname:Ot.extname,Vt="win32"===mt["c"]?Mt.sep:Ot.sep,Ht=/^\w[\w\d+.-]*$/,zt=/^\//,Ut=/^\/\//;function Kt(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&&!Ht.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!zt.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(Ut.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 ("//")')}function jt(e,t){return e||t?e:"file"}function qt(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==Gt&&(t=Gt+t):t=Gt;break}return t}const $t="",Gt="/",Yt=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Xt{constructor(e,t,i,n,o,s=!1){"object"===typeof e?(this.scheme=e.scheme||$t,this.authority=e.authority||$t,this.path=e.path||$t,this.query=e.query||$t,this.fragment=e.fragment||$t):(this.scheme=jt(e,s),this.authority=t||$t,this.path=qt(this.scheme,i||$t),this.query=n||$t,this.fragment=o||$t,Kt(this,s))}static isUri(e){return e instanceof Xt||!!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 ii(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=$t),void 0===i?i=this.authority:null===i&&(i=$t),void 0===n?n=this.path:null===n&&(n=$t),void 0===o?o=this.query:null===o&&(o=$t),void 0===s?s=this.fragment:null===s&&(s=$t),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new Qt(t,i,n,o,s)}static parse(e,t=!1){const i=Yt.exec(e);return i?new Qt(i[2]||$t,ri(i[4]||$t),ri(i[5]||$t),ri(i[7]||$t),ri(i[9]||$t),t):new Qt($t,$t,$t,$t,$t)}static file(e){let t=$t;if(s["j"]&&(e=e.replace(/\\/g,Gt)),e[0]===Gt&&e[1]===Gt){const i=e.indexOf(Gt,2);-1===i?(t=e.substring(2),e=Gt):(t=e.substring(2,i),e=e.substring(i)||Gt)}return new Qt("file",t,e,$t,$t)}static from(e){return new Qt(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=s["j"]&&"file"===e.scheme?Xt.file(Mt.join(ii(e,!0),...t)).path:Ot.join(e.path,...t),e.with({path:i})}toString(e=!1){return ni(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof Xt)return e;{const t=new Qt(e);return t._formatted=e.external,t._fsPath=e._sep===Zt?e.fsPath:null,t}}return e}}const Zt=s["j"]?1:void 0;class Qt extends Xt{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=ii(this,!1)),this._fsPath}toString(e=!1){return e?ni(this,!0):(this._formatted||(this._formatted=ni(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=Zt),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 Jt={[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 ei(e,t){let i=void 0,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=Jt[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 ti(e){let t=void 0;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,s["j"]&&(i=i.replace(/\//g,"\\")),i}function ni(e,t){const i=t?ti:ei;let n="",{scheme:o,authority:s,path:r,query:a,fragment:l}=e;if(o&&(n+=o,n+=":"),(s||"file"===o)&&(n+=Gt,n+=Gt),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:ei(l,!1)),n}function oi(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+oi(e.substr(3)):e}}const si=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ri(e){return e.match(si)?e.replace(si,e=>oi(e)):e}class ai{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 ai(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return ai.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return ai.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||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 li.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return li.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.columne.endColumn))}containsRange(e){return li.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 li.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 li.plusRange(this,e)}static plusRange(e,t){let i,n,o,s;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new li(i,n,o,s)}intersectRanges(e){return li.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,s=e.endColumn,r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,c=t.endColumn;return il?(o=l,s=c):o===l&&(s=Math.min(s,c)),i>o||i===o&&n>s?null:new li(i,n,o,s)}equalsRange(e){return li.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 li.getEndPosition(this)}static getEndPosition(e){return new ai(e.endLineNumber,e.endColumn)}getStartPosition(){return li.getStartPosition(this)}static getStartPosition(e){return new ai(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new li(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new li(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return li.collapseToStart(this)}static collapseToStart(e){return new li(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}static fromPositions(e,t=e){return new li(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new li(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}}class ci extends li{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 ci.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 ci(this.startLineNumber,this.startColumn,e,t):new ci(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new ai(this.positionLineNumber,this.positionColumn)}setStartPosition(e,t){return 0===this.getDirection()?new ci(e,t,this.endLineNumber,this.endColumn):new ci(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new ci(e.lineNumber,e.column,t.lineNumber,t.column)}static liftSelection(e){return new ci(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;ie,Gi.serviceIds.set(e,t),t}function Qi(e){return function(t,i,n){if(3!==arguments.length)throw new Error("@optional-decorator can only be used to decorate a parameter");Xi(e,t,n,!0)}}const Ji=Zi("codeEditorService");class en{constructor(){this._zoomLevel=0,this._lastZoomLevelChangeTime=0,this._onDidChangeZoomLevel=new Ye,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"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}function tn(){return en.INSTANCE.getZoomLevel()}function nn(){return en.INSTANCE.getTimeSinceLastZoomLevelChanged()}function on(e){return en.INSTANCE.onDidChangeZoomLevel(e)}function sn(){return en.INSTANCE.getZoomFactor()}function rn(){return en.INSTANCE.getPixelRatio()}en.INSTANCE=new en;const an=navigator.userAgent,ln=an.indexOf("Edge/")>=0,cn=an.indexOf("Firefox")>=0,dn=an.indexOf("AppleWebKit")>=0,hn=an.indexOf("Chrome")>=0,un=!hn&&an.indexOf("Safari")>=0,gn=!hn&&!un&&dn,fn=(an.indexOf("iPad")>=0||un&&navigator.maxTouchPoints,ln&&an.indexOf("WebView/")>=0),mn=an.indexOf("Electron/")>=0,pn=window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches,_n=(e,t,i)=>{const n=e=>o.fire(e),o=new Ye({onFirstListenerAdd:()=>{e.addEventListener(t,n,i)},onLastListenerRemove:()=>{e.removeEventListener(t,n,i)}});return o.event};let bn=new Array(230),vn=new Array(112);function wn(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return at.fromString(t)}return bn[e.keyCode]||0}(function(){for(let t=0;t{t.token.onCancellationRequested(()=>{n(xe())}),Promise.resolve(i).then(i=>{t.dispose(),e(i)},e=>{t.dispose(),n(e)})});return new class{cancel(){t.cancel()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}class Rn{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(xe()),this.completionPromise=null)}cancelTimeout(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancelTimeout()}}function Pn(e,t){return t?new Promise((i,n)=>{const o=setTimeout(i,e);t.onCancellationRequested(()=>{clearTimeout(o),n(xe())})}):An(t=>Pn(e,t))}function Fn(e,t=0){const i=setTimeout(e,t);return Pe(()=>clearTimeout(i))}class Wn{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 Bn{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 Vn{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()}}(function(){if("function"!==typeof requestIdleCallback||"function"!==typeof cancelIdleCallback){const e=Object.freeze({didTimeout:!0,timeRemaining(){return 15}});kn=t=>{const i=setTimeout(()=>t(e));let n=!1;return{dispose(){n||(n=!0,clearTimeout(i))}}}}else kn=(e,t)=>{const i=requestIdleCallback(e,"number"===typeof t?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(i))}}}})();class Hn{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=kn(()=>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 zn;(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.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.vscodeWebviewResource="vscode-webview-resource",e.extension="extension",e.vscodeFileResource="vscode-file"})(zn||(zn={}));class Un{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 n=this._ports[t],o=this._connectionTokens[t];let r="path="+encodeURIComponent(e.path);return"string"===typeof o&&(r+="&tkn="+encodeURIComponent(o)),Xt.from({scheme:s["i"]?this._preferredWebSchema:zn.vscodeRemoteResource,authority:`${i}:${n}`,path:"/vscode-remote-resource",query:r})}}const Kn=new Un;class jn{constructor(){this.FALLBACK_AUTHORITY="vscode-app"}asBrowserUri(e,t,i){const n=this.toUri(e,t);return n.scheme===zn.vscodeRemote?Kn.rewrite(n):s["g"]&&(i||s["h"])&&n.scheme===zn.file?n.with({scheme:zn.vscodeFileResource,authority:n.authority||this.FALLBACK_AUTHORITY,query:null,fragment:null}):n}toUri(e,t){return Xt.isUri(e)?e:Xt.parse(t.toUrl(e))}}const qn=new jn,$n={clipboard:{writeText:s["g"]||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:s["g"]||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText),richText:(()=>{if(ln){let e=navigator.userAgent.indexOf("Edge/"),t=parseInt(navigator.userAgent.substring(e+5,navigator.userAgent.indexOf(".",e)),10);if(!t||t>=12&&t<=16)return!1}return!0})()},keyboard:(()=>s["g"]||pn?0:navigator.keyboard||un?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 Gn(e){while(e.firstChild)e.firstChild.remove()}function Yn(e){var t;return null!==(t=null===e||void 0===e?void 0:e.isConnected)&&void 0!==t&&t}class Xn{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function Zn(e,t,i,n){return new Xn(e,t,i,n)}function Qn(e){return function(t){return e(new Tn(t))}}function Jn(e){return function(t){return e(new Ln(t))}}let eo=function(e,t,i,n){let o=i;return"click"===t||"mousedown"===t?o=Qn(i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(o=Jn(i)),Zn(e,t,o,n)};function to(e,t){return Zn(e,"mouseout",i=>{let n=i.relatedTarget;while(n&&n!==e)n=n.parentNode;n!==e&&t(i)})}function io(e,t){return Zn(e,"pointerout",i=>{let n=i.relatedTarget;while(n&&n!==e)n=n.parentNode;n!==e&&t(i)})}let no,oo,so=null;function ro(e){if(!so){const e=e=>setTimeout(()=>e((new Date).getTime()),0);so=self.requestAnimationFrame||self.msRequestAnimationFrame||self.webkitRequestAnimationFrame||self.mozRequestAnimationFrame||self.oRequestAnimationFrame||e}return so.call(self,e)}class ao{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){ve(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let e=[],t=null,i=!1,n=!1,o=()=>{i=!1,t=e,e=[],n=!0;while(t.length>0){t.sort(ao.sort);let e=t.shift();e.execute()}n=!1};oo=(t,n=0)=>{let s=new ao(t,n);return e.push(s),i||(i=!0,ro(o)),s},no=(e,i)=>{if(n){let n=new ao(e,i);return t.push(n),n}return oo(e,i)}})();const lo=16,co=function(e,t){return t};class ho extends We{constructor(e,t,i,n=co,o=lo){super();let s=null,r=0,a=this._register(new Wn),l=()=>{r=(new Date).getTime(),i(s),s=null};this._register(Zn(e,t,e=>{s=n(s,e);let t=(new Date).getTime()-r;t>=o?(a.cancel(),l()):a.setIfNotSet(l,o-t)}))}}function uo(e,t,i,n,o){return new ho(e,t,i,n,o)}function go(e){return document.defaultView.getComputedStyle(e,null)}function fo(e){if(e!==document.body)return new po(e.clientWidth,e.clientHeight);if(s["c"]&&window.visualViewport){const e=window.visualViewport.width,t=window.visualViewport.height-(pn?24:0);return new po(e,t)}if(window.innerWidth&&window.innerHeight)return new po(window.innerWidth,window.innerHeight);if(document.body&&document.body.clientWidth&&document.body.clientHeight)return new po(document.body.clientWidth,document.body.clientHeight);if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientHeight)return new po(document.documentElement.clientWidth,document.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class mo{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){let n=go(e),o="0";return n&&(o=n.getPropertyValue?n.getPropertyValue(t):n.getAttribute(i)),mo.convertToPixels(e,o)}static getBorderLeftWidth(e){return mo.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return mo.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return mo.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return mo.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return mo.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return mo.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return mo.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return mo.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return mo.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return mo.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return mo.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return mo.getDimension(e,"margin-bottom","marginBottom")}}class po{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new po(e,t):this}static is(e){return"object"===typeof e&&"number"===typeof e.height&&"number"===typeof e.width}static lift(e){return e instanceof po?e:new po(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&(e.width===t.width&&e.height===t.height)}}function _o(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;while(null!==(e=e.parentNode)&&e!==document.body&&e!==document.documentElement){i-=e.scrollTop;const o=Eo(e)?null:go(e);o&&(n-="rtl"!==o.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=mo.getBorderLeftWidth(e),i+=mo.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function bo(e){let t=e.getBoundingClientRect();return{left:t.left+vo.scrollX,top:t.top+vo.scrollY,width:t.width,height:t.height}}const vo=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 wo(e){let t=mo.getMarginLeft(e)+mo.getMarginRight(e);return e.offsetWidth+t}function Co(e){let t=mo.getBorderLeftWidth(e)+mo.getBorderRightWidth(e),i=mo.getPaddingLeft(e)+mo.getPaddingRight(e);return e.offsetWidth-t-i}function yo(e){let t=mo.getBorderTopWidth(e)+mo.getBorderBottomWidth(e),i=mo.getPaddingTop(e)+mo.getPaddingBottom(e);return e.offsetHeight-t-i}function So(e){let t=mo.getMarginTop(e)+mo.getMarginBottom(e);return e.offsetHeight+t}function xo(e,t){while(e){if(e===t)return!0;e=e.parentNode}return!1}function Lo(e,t,i){while(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 ko(e,t,i){return!!Lo(e,t,i)}function Eo(e){return e&&!!e.host&&!!e.mode}function Do(e){return!!No(e)}function No(e){while(e.parentNode){if(e===document.body)return null;e=e.parentNode}return Eo(e)?e:null}function Io(){let e=document.activeElement;while(null===e||void 0===e?void 0:e.shadowRoot)e=e.shadowRoot.activeElement;return e}function To(e=document.getElementsByTagName("head")[0]){let t=document.createElement("style");return t.type="text/css",t.media="screen",e.appendChild(t),t}let Mo=null;function Oo(){return Mo||(Mo=To()),Mo}function Ao(e){var t,i;return(null===(t=null===e||void 0===e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(i=null===e||void 0===e?void 0:e.sheet)||void 0===i?void 0:i.cssRules)?e.sheet.cssRules:[]}function Ro(e,t,i=Oo()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)}function Po(e,t=Oo()){if(!t)return;let i=Ao(t),n=[];for(let o=0;o=0;o--)t.sheet.deleteRule(n[o])}function Fo(e){return"object"===typeof HTMLElement?e instanceof HTMLElement:e&&"object"===typeof e&&1===e.nodeType&&"string"===typeof e.nodeName}const Wo={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:ln?"mousewheel":"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:dn?"webkitAnimationStart":"animationstart",ANIMATION_END:dn?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:dn?"webkitAnimationIteration":"animationiteration"},Bo={stop:function(e,t){e.preventDefault?e.preventDefault():e.returnValue=!1,t&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)}};function Vo(e){let t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}function Ho(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 zo extends We{constructor(e){super(),this._onDidFocus=this._register(new Ye),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new Ye),this.onDidBlur=this._onDidBlur.event;let t=xo(document.activeElement,e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{let i=xo(document.activeElement,e);i!==t&&(t?o():n())},this._register(_n(e,Wo.FOCUS,!0)(n)),this._register(_n(e,Wo.BLUR,!0)(o))}}function Uo(e){return new zo(e)}function Ko(e,...t){if(e.append(...t),1===t.length&&"string"!==typeof t[0])return t[0]}function jo(e,...t){e.innerText="",Ko(e,...t)}const qo=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var $o;function Go(e,t,i,...n){let o=qo.exec(t);if(!o)throw new Error("Bad use of emmet");i=Object.assign({},i||{});let s,r=o[1]||"div";return s=e!==$o.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];"undefined"!==typeof t&&(/^on\w+$/.test(e)?s[e]=t:"selected"===e?t&&s.setAttribute(e,"true"):s.setAttribute(e,t))}),s.append(...n),s}function Yo(e,t,...i){return Go($o.HTML,e,t,...i)}function Xo(...e){for(let t of e)t.style.display="",t.removeAttribute("aria-hidden")}function Zo(...e){for(let t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function Qo(e,t){while(e&&e.nodeType===e.ELEMENT_NODE){if(e instanceof HTMLElement&&e.hasAttribute(t))return e;e=e.parentNode}return null}function Jo(e){if(e&&e.hasAttribute("tabIndex")){if(document.activeElement===e){let t=Qo(e.parentElement,"tabIndex");t&&t.focus()}e.removeAttribute("tabindex")}}function es(e){return Array.prototype.slice.call(document.getElementsByTagName(e),0)}function ts(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function is(e){if(mn||fn)window.open(e);else{let t=window.open();t&&(t.opener=null,t.location.href=e)}}function ns(e){const t=()=>{e(),i=oo(t)};let i=oo(t);return Pe(()=>i.dispose())}function os(e){return e?`url('${qn.asBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}(function(e){e["HTML"]="http://www.w3.org/1999/xhtml",e["SVG"]="http://www.w3.org/2000/svg"})($o||($o={})),Yo.SVG=function(e,t,...i){return Go($o.SVG,e,t,...i)},Kn.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");class ss extends Ye{constructor(){super(),this._subscriptions=new Fe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(_n(document.body,"keydown",!0)(e=>{if(e.repeat)return;const t=new Ln(e);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(_n(document.body,"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(_n(document.body,"mousedown",!0)(e=>{this._keyStatus.lastKeyPressed=void 0})),this._subscriptions.add(_n(document.body,"mouseup",!0)(e=>{this._keyStatus.lastKeyPressed=void 0})),this._subscriptions.add(_n(document.body,"mousemove",!0)(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)})),this._subscriptions.add(_n(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 ss.instance||(ss.instance=new ss),ss.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}var rs=i("3fa4");class as{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos!1)){return new us(new ds(e))}static forStrings(){return new us(new as)}static forConfigKeys(){return new us(new ls)}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new hs,this._root.segment=i.value()),n=this._root;while(1){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new hs,n.left.segment=i.value()),n=n.left;else if(e<0)n.right||(n.right=new hs,n.right.segment=i.value()),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new hs,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;while(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?void 0:t.value)&&void 0===(null===t||void 0===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;while(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()){t?(o.left=void 0,o.mid=void 0,o.right=void 0):o.value=void 0;while(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;break}o=t}break}i.next(),n.push([0,o]),o=o.mid}}}findSubstr(e){const t=this._iter.reset(e);let i=this._root,n=void 0;while(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(),n=i.value||n,i=i.mid}}return i&&i.value||n}findSuperstr(e){const t=this._iter.reset(e);let i=this._root;while(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 gs{constructor(e,t){this[Symbol.toStringTag]="ResourceMap",e instanceof gs?(this.map=new Map(e.map),this.toKey=null!==t&&void 0!==t?t:gs.defaultToKey):(this.map=new Map,this.toKey=null!==e&&void 0!==e?e:gs.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){"undefined"!==typeof t&&(e=e.bind(t));for(let[i,n]of this.map)e(n,Xt.parse(i),this)}values(){return this.map.values()}*keys(){for(let e of this.map.keys())yield Xt.parse(e)}*entries(){for(let e of this.map.entries())yield[Xt.parse(e[0]),e[1]]}*[Symbol.iterator](){for(let e of this.map)yield[Xt.parse(e[0]),e[1]]}}gs.defaultToKey=e=>e.toString();class fs{constructor(){this[Symbol.toStringTag]="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:this.addItemLast(n);break;case 1:this.addItemFirst(n);break;case 2:this.addItemLast(n);break;default:this.addItemLast(n);break}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;while(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](){return 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](){return 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](){return 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}[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;while(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 ms extends fs{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))}}var ps=i("c223");function _s(e){let t=JSON.parse(e);return t=bs(t),t}function bs(e,t=0){if(!e||t>200)return e;if("object"===typeof e){switch(e.$mid){case 1:return Xt.revive(e);case 2:return new RegExp(e.source,e.flags)}if(e instanceof ps["a"]||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;ie.length)return!1;if(i){const i=Object(rs["Q"])(e,t);if(!i)return!1;if(t.length===e.length)return!0;let o=t.length;return t.charAt(t.length-1)===n&&o--,e.charAt(o)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function Cs(e){return ii(e,!0)}class ys{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Object(rs["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 Xt.joinPath(e,...t)}basenameOrAuthority(e){return xs(e)||e.authority}basename(e){return Ot.basename(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===zn.file?t=Xt.file(Ft(Cs(e))).path:(t=Ot.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===zn.file?Xt.file(At(Cs(e))).path:Ot.normalize(e.path),e.with({path:t})}resolvePath(e,t){if(e.scheme===zn.file){const i=Xt.file(Rt(Cs(e),t));return e.with({authority:i.authority,path:i.path})}return-1===t.indexOf("/")&&(t=vs(t),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t)),e.with({path:Ot.resolve(e.path,t)})}}const Ss=new ys(()=>!1),xs=(Ss.isEqual.bind(Ss),Ss.basenameOrAuthority.bind(Ss),Ss.basename.bind(Ss)),Ls=(Ss.dirname.bind(Ss),Ss.joinPath.bind(Ss),Ss.normalizePath.bind(Ss));Ss.resolvePath.bind(Ss);var ks;function Es(e){return"string"===typeof e}function Ds(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ns(e){return"number"===typeof e&&!isNaN(e)}function Is(e){return!0===e||!1===e}function Ts(e){return"undefined"===typeof e}function Ms(e){return Ts(e)||null===e}function Os(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function As(e){return"function"===typeof e}function Rs(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 o of e)n[o]=i(o);return n}function Vs(e){return null===e?void 0:e}(function(e){function t(t){const i=new Map,n=t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";"));n.split(";").forEach(e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(e.META_DATA_MIME,o),i}e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=t})(ks||(ks={}));const Hs=Zi("commandService"),zs=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Ye,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 n of e.description.args)t.push(n.constraint);const i=e.handler;e.handler=function(e,...n){return Rs(n,t),i(e,...n)}}const{id:i}=e;let n=this._commands.get(i);n||(n=new ze,this._commands.set(i,n));let o=n.unshift(e),s=Pe(()=>{o();const e=this._commands.get(i);(null===e||void 0===e?void 0:e.isEmpty())&&this._commands.delete(i)});return this._onDidRegisterCommand.fire(i),s}registerCommandAlias(e,t){return zs.registerCommand(e,(e,...i)=>e.get(Hs).executeCommand(t,...i))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return Ee.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}};var Us;(function(e){e[e["API"]=0]="API",e[e["USER"]=1]="USER"})(Us||(Us={}));var Ks=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const js=Zi("openerService");Object.freeze({_serviceBrand:void 0,registerOpener(){return We.None},registerValidator(){return We.None},registerExternalUriResolver(){return We.None},setDefaultExternalOpener(){},registerExternalOpener(){return We.None},open(){return Ks(this,void 0,void 0,(function*(){return!1}))},resolveExternalUri(e){return Ks(this,void 0,void 0,(function*(){return{resolved:e,dispose(){}}}))}});function qs(e,t){return Xt.isUri(e)?Object(rs["r"])(e.scheme,t):Object(rs["Q"])(e,t+":")}var $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},Gs=function(e,t){return function(i,n){t(i,n,e)}},Ys=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Xs=class{constructor(e){this._commandService=e}open(e){return Ys(this,void 0,void 0,(function*(){if(!qs(e,zn.command))return!1;"string"===typeof e&&(e=Xt.parse(e));let t=[];try{t=_s(decodeURIComponent(e.query))}catch(i){try{t=_s(e.query)}catch(n){}}return Array.isArray(t)||(t=[t]),yield this._commandService.executeCommand(e.path,...t),!0}))}};Xs=$s([Gs(0,Hs)],Xs);let Zs=class{constructor(e){this._editorService=e}open(e,t){return Ys(this,void 0,void 0,(function*(){"string"===typeof e&&(e=Xt.parse(e));let i=void 0;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===zn.file&&(e=Ls(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,context:(null===t||void 0===t?void 0:t.fromUserGesture)?Us.USER:Us.API},null===t||void 0===t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null===t||void 0===t?void 0:t.openToSide),!0}))}};Zs=$s([Gs(0,Ji)],Zs);let Qs=class{constructor(e,t){this._openers=new ze,this._validators=new ze,this._resolvers=new ze,this._resolvedUriTargets=new gs(e=>e.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new ze,this._defaultExternalOpener={openExternal:e=>Ys(this,void 0,void 0,(function*(){return qs(e,zn.http)||qs(e,zn.https)?is(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>Ys(this,void 0,void 0,(function*(){return!!((null===t||void 0===t?void 0:t.openExternal)||qs(e,zn.mailto)||qs(e,zn.http)||qs(e,zn.https))&&(yield this._doOpenExternal(e,t),!0)}))}),this._openers.push(new Xs(t)),this._openers.push(new Zs(e))}registerOpener(e){const t=this._openers.unshift(e);return{dispose:t}}registerValidator(e){const t=this._validators.push(e);return{dispose:t}}registerExternalUriResolver(e){const t=this._resolvers.push(e);return{dispose:t}}setDefaultExternalOpener(e){this._defaultExternalOpener=e}registerExternalOpener(e){const t=this._externalOpeners.push(e);return{dispose:t}}open(e,t){var i;return Ys(this,void 0,void 0,(function*(){const n="string"===typeof e?Xt.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){const n=yield i.open(e,t);if(n)return!0}return!1}))}resolveExternalUri(e,t){return Ys(this,void 0,void 0,(function*(){for(const i of this._resolvers){const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.set(n.resolved,e),n}return{resolved:e,dispose:()=>{}}}))}_doOpenExternal(e,t){return Ys(this,void 0,void 0,(function*(){const i="string"===typeof e?Xt.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?void 0:t.allowContributedOpeners){const e="string"===typeof(null===t||void 0===t?void 0:t.allowContributedOpeners)?null===t||void 0===t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners){const n=yield t.openExternal(o,{sourceUri:i,preferredOpenerId:e},et.None);if(n)return!0}}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},et.None)}))}dispose(){this._validators.clear()}};function Js(e,t){if(!e)throw new Error(t?`Assertion failed (${t})`:"Assertion Failed")}function er(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]=er(e[i]):t[i]=e[i]}),t}function tr(e){if(!e||"object"!==typeof e)return e;const t=[e];while(t.length>0){const e=t.shift();Object.freeze(e);for(const i in e)if(ir.call(e,i)){const n=e[i];"object"!==typeof n||Object.isFrozen(n)||t.push(n)}}return e}Qs=$s([Gs(0,Ji),Gs(1,Hs)],Qs);const ir=Object.prototype.hasOwnProperty;function nr(e,t,i=!0){return Ds(e)?(Ds(t)&&Object.keys(t).forEach(n=>{n in e?i&&(Ds(e[n])&&Ds(t[n])?nr(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]}),e):t}function or(e,t){if(e===t)return!0;if(null===e||void 0===e||null===t||void 0===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;ithis.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 li(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)})}):this.ranges.push({rhs:!0,range:new li(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}}const lr=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new Ye,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))}},cr=s["f"]?1.5:1.35,dr=8;class hr{constructor(e){this.zoomLevel=e.zoomLevel,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}static createFromValidatedSettings(e,t,i,n){const o=e.get(37),s=e.get(41),r=e.get(40),a=e.get(39),l=e.get(53),c=e.get(50);return hr._create(o,s,r,a,l,c,t,i,n)}static _create(e,t,i,n,o,s,r,a,l){0===o?o=Math.round(cr*i):o>>n)>>>0}function Lr(e,t=0,i=e.byteLength,n=0){for(let o=0;oe.toString(16).padStart(2,"0")).join(""):kr((e>>>0).toString(16),t/4)}class Dr{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 n,o,s=this._buffLen,r=this._leftoverHighSurrogate;0!==r?(n=r,o=-1,r=0):(n=e.charCodeAt(0),o=0);while(1){let a=n;if(rs["D"](n)){if(!(o+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()),Er(this._h0)+Er(this._h1)+Er(this._h2)+Er(this._h3)+Er(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Lr(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Lr(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=Dr._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,xr(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let i,n,o,s=this._h0,r=this._h1,a=this._h2,l=this._h3,c=this._h4;for(let d=0;d<80;d++)d<20?(i=r&a|~r&l,n=1518500249):d<40?(i=r^a^l,n=1859775393):d<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),o=xr(s,5)+i+c+n+e.getUint32(4*d,!1)&4294967295,c=l,l=a,a=xr(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+l&4294967295,this._h4=this._h4+c&4294967295}}function Nr(e,t,i){return Math.min(Math.max(e,t),i)}Dr._bigBlock32=new DataView(new ArrayBuffer(320));const Ir="**",Tr="/",Mr="[/\\\\]",Or="[^/\\\\]",Ar=/\//g;function Rr(e){switch(e){case 0:return"";case 1:return Or+"*?";default:return`(?:${Mr}|${Or}+${Mr}|${Mr}${Or}+)*?`}}function Pr(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;break}s+=r}return s&&i.push(s),i}function Fr(e){if(!e)return"";let t="";const i=Pr(e,Tr);if(i.every(e=>e===Ir))t=".*";else{let e=!1;i.forEach((n,o)=>{if(n===Ir)return void(e||(t+=Rr(2),e=!0));let s=!1,r="",a=!1,l="";for(const e of n)if("}"!==e&&s)r+=e;else if(!a||"]"===e&&l)switch(e){case"{":s=!0;continue;case"[":a=!0;continue;case"}":const i=Pr(r,","),n=`(?:${i.map(e=>Fr(e)).join("|")})`;t+=n,s=!1,r="";break;case"]":t+="["+l+"]",a=!1,l="";break;case"?":t+=Or;continue;case"*":t+=Rr(1);continue;default:t+=rs["t"](e)}else{let t;t="-"===e?e:"^"!==e&&"!"!==e||l?e===Tr?"":rs["t"](e):"^",l+=t}o$r(e,t)).filter(e=>e!==qr),e),n=i.length;if(!n)return qr;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}function Qr(e,t,i){const n=Vt===Ot.sep,o=n?e:e.replace(Ar,Vt),s=Vt+o,r=Ot.sep+e,a=i?function(i,a){return"string"!==typeof i||i!==o&&!i.endsWith(s)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,s){return"string"!==typeof i||i!==o&&(n||i!==e)?null:t};return a.allPaths=[(i?"*/":"./")+e],a}function Jr(e){try{const t=new RegExp(`^${Fr(e)}$`);return function(i){return t.lastIndex=0,"string"===typeof i&&t.test(i)?e:null}}catch(t){return qr}}function ea(e,t,i){return!(!e||"string"!==typeof t)&&ta(e)(t,void 0,i)}function ta(e,t={}){if(!e)return jr;if("string"===typeof e||ia(e)){const i=$r(e,t);if(i===qr)return jr;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return na(e,t)}function ia(e){const t=e;return t&&"string"===typeof t.base&&"string"===typeof t.pattern}function na(e,t){const i=sa(Object.getOwnPropertyNames(e).map(i=>oa(i,e[i],t)).filter(e=>e!==qr)),n=i.length;if(!n)return qr;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=void 0;for(let s=0,r=i.length;s!!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}function oa(e,t,i){if(!1===t)return qr;const n=$r(e,i);if(n===qr)return qr;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 a=i.replace("$(basename)",s),l=r(a);return On(l)?l.then(t=>t?e:null):l?e:null};return t.requiresSiblings=!0,t}}return n}function sa(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 ra(e,t,i,n){if(Array.isArray(e)){let o=0;for(const s of e){const e=ra(s,t,i,n);if(10===e)return e;e>o&&(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:a}=e;if(!n&&!a)return 0;let l=0;if(r)if(r===t.scheme)l=10;else{if("*"!==r)return 0;l=5}if(o)if(o===i)l=10;else{if("*"!==o)return 0;l=Math.max(l,5)}if(s){let e;if(e="string"===typeof s?s:Object.assign(Object.assign({},s),{base:At(s.base)}),e!==t.fsPath&&!ea(e,t.fsPath))return 0;l=10}return l}return 0}const aa=Zi("modelService");function la(e){return!e.isTooLargeForSyncing()&&!e.isForSimpleWidget}function ca(e){return"string"!==typeof e&&(Array.isArray(e)?e.every(ca):!!e.exclusive)}class da{constructor(){this._clock=0,this._entries=[],this._onDidChange=new Ye}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),Pe(()=>{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 i of this._entries)i._score>0&&t.push(i.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=ra(t.selector,e.uri,e.getLanguageIdentifier().language,la(e)),ca(t.selector)&&t._score>0){for(let e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(da._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:e._timet._time?-1:0}}class ha{constructor(){this._map=new Map,this._promises=new Map,this._onDidChange=new Ye,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]),Pe(()=>{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))})),Pe(()=>{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}}class ua{constructor(){this._icons=new Map,this._onDidRegister=new Ye}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}}const ga=new ua,fa=ga;function ma(e,t){return new pa(e,t)}class pa{constructor(e,t,i){this.id=e,this.definition=t,this.description=i,ga.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var _a;(function(e){function t(i){if(i instanceof pa)return["codicon","codicon-"+i.id];const n=e.iconIdRegex.exec(i.id);if(!n)return t(pa.error);let[,,o,s]=n;const r=["codicon","codicon-"+o];return s&&r.push("codicon-modifier-"+s),r}function i(e){return t(e).join(" ")}function n(e){return"."+t(e).join(".")}e.iconIdRegex=/^(codicon\/)?([a-z\-]+)(?:~([a-z\-]+))?$/i,e.asClassNameArray=t,e.asClassName=i,e.asCSSSelector=n})(_a||(_a={})),function(e){e.add=new e("add",{character:"\\ea60"}),e.plus=new e("plus",{character:"\\ea60"}),e.gistNew=new e("gist-new",{character:"\\ea60"}),e.repoCreate=new e("repo-create",{character:"\\ea60"}),e.lightbulb=new e("lightbulb",{character:"\\ea61"}),e.lightBulb=new e("light-bulb",{character:"\\ea61"}),e.repo=new e("repo",{character:"\\ea62"}),e.repoDelete=new e("repo-delete",{character:"\\ea62"}),e.gistFork=new e("gist-fork",{character:"\\ea63"}),e.repoForked=new e("repo-forked",{character:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{character:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{character:"\\ea64"}),e.recordKeys=new e("record-keys",{character:"\\ea65"}),e.keyboard=new e("keyboard",{character:"\\ea65"}),e.tag=new e("tag",{character:"\\ea66"}),e.tagAdd=new e("tag-add",{character:"\\ea66"}),e.tagRemove=new e("tag-remove",{character:"\\ea66"}),e.person=new e("person",{character:"\\ea67"}),e.personAdd=new e("person-add",{character:"\\ea67"}),e.personFollow=new e("person-follow",{character:"\\ea67"}),e.personOutline=new e("person-outline",{character:"\\ea67"}),e.personFilled=new e("person-filled",{character:"\\ea67"}),e.gitBranch=new e("git-branch",{character:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{character:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{character:"\\ea68"}),e.sourceControl=new e("source-control",{character:"\\ea68"}),e.mirror=new e("mirror",{character:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{character:"\\ea69"}),e.star=new e("star",{character:"\\ea6a"}),e.starAdd=new e("star-add",{character:"\\ea6a"}),e.starDelete=new e("star-delete",{character:"\\ea6a"}),e.starEmpty=new e("star-empty",{character:"\\ea6a"}),e.comment=new e("comment",{character:"\\ea6b"}),e.commentAdd=new e("comment-add",{character:"\\ea6b"}),e.alert=new e("alert",{character:"\\ea6c"}),e.warning=new e("warning",{character:"\\ea6c"}),e.search=new e("search",{character:"\\ea6d"}),e.searchSave=new e("search-save",{character:"\\ea6d"}),e.logOut=new e("log-out",{character:"\\ea6e"}),e.signOut=new e("sign-out",{character:"\\ea6e"}),e.logIn=new e("log-in",{character:"\\ea6f"}),e.signIn=new e("sign-in",{character:"\\ea6f"}),e.eye=new e("eye",{character:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{character:"\\ea70"}),e.eyeWatch=new e("eye-watch",{character:"\\ea70"}),e.circleFilled=new e("circle-filled",{character:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{character:"\\ea71"}),e.closeDirty=new e("close-dirty",{character:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{character:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{character:"\\ea71"}),e.debugHint=new e("debug-hint",{character:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{character:"\\ea72"}),e.edit=new e("edit",{character:"\\ea73"}),e.pencil=new e("pencil",{character:"\\ea73"}),e.info=new e("info",{character:"\\ea74"}),e.issueOpened=new e("issue-opened",{character:"\\ea74"}),e.gistPrivate=new e("gist-private",{character:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{character:"\\ea75"}),e.lock=new e("lock",{character:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{character:"\\ea75"}),e.close=new e("close",{character:"\\ea76"}),e.removeClose=new e("remove-close",{character:"\\ea76"}),e.x=new e("x",{character:"\\ea76"}),e.repoSync=new e("repo-sync",{character:"\\ea77"}),e.sync=new e("sync",{character:"\\ea77"}),e.clone=new e("clone",{character:"\\ea78"}),e.desktopDownload=new e("desktop-download",{character:"\\ea78"}),e.beaker=new e("beaker",{character:"\\ea79"}),e.microscope=new e("microscope",{character:"\\ea79"}),e.vm=new e("vm",{character:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{character:"\\ea7a"}),e.file=new e("file",{character:"\\ea7b"}),e.fileText=new e("file-text",{character:"\\ea7b"}),e.more=new e("more",{character:"\\ea7c"}),e.ellipsis=new e("ellipsis",{character:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{character:"\\ea7c"}),e.mailReply=new e("mail-reply",{character:"\\ea7d"}),e.reply=new e("reply",{character:"\\ea7d"}),e.organization=new e("organization",{character:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{character:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{character:"\\ea7e"}),e.newFile=new e("new-file",{character:"\\ea7f"}),e.fileAdd=new e("file-add",{character:"\\ea7f"}),e.newFolder=new e("new-folder",{character:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{character:"\\ea80"}),e.trash=new e("trash",{character:"\\ea81"}),e.trashcan=new e("trashcan",{character:"\\ea81"}),e.history=new e("history",{character:"\\ea82"}),e.clock=new e("clock",{character:"\\ea82"}),e.folder=new e("folder",{character:"\\ea83"}),e.fileDirectory=new e("file-directory",{character:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{character:"\\ea83"}),e.logoGithub=new e("logo-github",{character:"\\ea84"}),e.markGithub=new e("mark-github",{character:"\\ea84"}),e.github=new e("github",{character:"\\ea84"}),e.terminal=new e("terminal",{character:"\\ea85"}),e.console=new e("console",{character:"\\ea85"}),e.repl=new e("repl",{character:"\\ea85"}),e.zap=new e("zap",{character:"\\ea86"}),e.symbolEvent=new e("symbol-event",{character:"\\ea86"}),e.error=new e("error",{character:"\\ea87"}),e.stop=new e("stop",{character:"\\ea87"}),e.variable=new e("variable",{character:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{character:"\\ea88"}),e.array=new e("array",{character:"\\ea8a"}),e.symbolArray=new e("symbol-array",{character:"\\ea8a"}),e.symbolModule=new e("symbol-module",{character:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{character:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{character:"\\ea8b"}),e.symbolObject=new e("symbol-object",{character:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{character:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{character:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{character:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{character:"\\ea8f"}),e.symbolNull=new e("symbol-null",{character:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{character:"\\ea90"}),e.symbolNumber=new e("symbol-number",{character:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{character:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{character:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{character:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{character:"\\ea92"}),e.symbolKey=new e("symbol-key",{character:"\\ea93"}),e.symbolText=new e("symbol-text",{character:"\\ea93"}),e.symbolReference=new e("symbol-reference",{character:"\\ea94"}),e.goToFile=new e("go-to-file",{character:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{character:"\\ea95"}),e.symbolValue=new e("symbol-value",{character:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{character:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{character:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{character:"\\ea97"}),e.archive=new e("archive",{character:"\\ea98"}),e.arrowBoth=new e("arrow-both",{character:"\\ea99"}),e.arrowDown=new e("arrow-down",{character:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{character:"\\ea9b"}),e.arrowRight=new e("arrow-right",{character:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{character:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{character:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{character:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{character:"\\eaa0"}),e.arrowUp=new e("arrow-up",{character:"\\eaa1"}),e.bell=new e("bell",{character:"\\eaa2"}),e.bold=new e("bold",{character:"\\eaa3"}),e.book=new e("book",{character:"\\eaa4"}),e.bookmark=new e("bookmark",{character:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{character:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{character:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{character:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{character:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{character:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{character:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{character:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{character:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{character:"\\eaab"}),e.briefcase=new e("briefcase",{character:"\\eaac"}),e.broadcast=new e("broadcast",{character:"\\eaad"}),e.browser=new e("browser",{character:"\\eaae"}),e.bug=new e("bug",{character:"\\eaaf"}),e.calendar=new e("calendar",{character:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{character:"\\eab1"}),e.check=new e("check",{character:"\\eab2"}),e.checklist=new e("checklist",{character:"\\eab3"}),e.chevronDown=new e("chevron-down",{character:"\\eab4"}),e.chevronLeft=new e("chevron-left",{character:"\\eab5"}),e.chevronRight=new e("chevron-right",{character:"\\eab6"}),e.chevronUp=new e("chevron-up",{character:"\\eab7"}),e.chromeClose=new e("chrome-close",{character:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{character:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{character:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{character:"\\eabb"}),e.circleOutline=new e("circle-outline",{character:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{character:"\\eabc"}),e.circleSlash=new e("circle-slash",{character:"\\eabd"}),e.circuitBoard=new e("circuit-board",{character:"\\eabe"}),e.clearAll=new e("clear-all",{character:"\\eabf"}),e.clippy=new e("clippy",{character:"\\eac0"}),e.closeAll=new e("close-all",{character:"\\eac1"}),e.cloudDownload=new e("cloud-download",{character:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{character:"\\eac3"}),e.code=new e("code",{character:"\\eac4"}),e.collapseAll=new e("collapse-all",{character:"\\eac5"}),e.colorMode=new e("color-mode",{character:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{character:"\\eac7"}),e.compareChanges=new e("compare-changes",{character:"\\eafd"}),e.creditCard=new e("credit-card",{character:"\\eac9"}),e.dash=new e("dash",{character:"\\eacc"}),e.dashboard=new e("dashboard",{character:"\\eacd"}),e.database=new e("database",{character:"\\eace"}),e.debugContinue=new e("debug-continue",{character:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{character:"\\ead0"}),e.debugPause=new e("debug-pause",{character:"\\ead1"}),e.debugRestart=new e("debug-restart",{character:"\\ead2"}),e.debugStart=new e("debug-start",{character:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{character:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{character:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{character:"\\ead6"}),e.debugStop=new e("debug-stop",{character:"\\ead7"}),e.debug=new e("debug",{character:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{character:"\\ead9"}),e.deviceCamera=new e("device-camera",{character:"\\eada"}),e.deviceMobile=new e("device-mobile",{character:"\\eadb"}),e.diffAdded=new e("diff-added",{character:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{character:"\\eadd"}),e.diffModified=new e("diff-modified",{character:"\\eade"}),e.diffRemoved=new e("diff-removed",{character:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{character:"\\eae0"}),e.diff=new e("diff",{character:"\\eae1"}),e.discard=new e("discard",{character:"\\eae2"}),e.editorLayout=new e("editor-layout",{character:"\\eae3"}),e.emptyWindow=new e("empty-window",{character:"\\eae4"}),e.exclude=new e("exclude",{character:"\\eae5"}),e.extensions=new e("extensions",{character:"\\eae6"}),e.eyeClosed=new e("eye-closed",{character:"\\eae7"}),e.fileBinary=new e("file-binary",{character:"\\eae8"}),e.fileCode=new e("file-code",{character:"\\eae9"}),e.fileMedia=new e("file-media",{character:"\\eaea"}),e.filePdf=new e("file-pdf",{character:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{character:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{character:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{character:"\\eaee"}),e.fileZip=new e("file-zip",{character:"\\eaef"}),e.files=new e("files",{character:"\\eaf0"}),e.filter=new e("filter",{character:"\\eaf1"}),e.flame=new e("flame",{character:"\\eaf2"}),e.foldDown=new e("fold-down",{character:"\\eaf3"}),e.foldUp=new e("fold-up",{character:"\\eaf4"}),e.fold=new e("fold",{character:"\\eaf5"}),e.folderActive=new e("folder-active",{character:"\\eaf6"}),e.folderOpened=new e("folder-opened",{character:"\\eaf7"}),e.gear=new e("gear",{character:"\\eaf8"}),e.gift=new e("gift",{character:"\\eaf9"}),e.gistSecret=new e("gist-secret",{character:"\\eafa"}),e.gist=new e("gist",{character:"\\eafb"}),e.gitCommit=new e("git-commit",{character:"\\eafc"}),e.gitCompare=new e("git-compare",{character:"\\eafd"}),e.gitMerge=new e("git-merge",{character:"\\eafe"}),e.githubAction=new e("github-action",{character:"\\eaff"}),e.githubAlt=new e("github-alt",{character:"\\eb00"}),e.globe=new e("globe",{character:"\\eb01"}),e.grabber=new e("grabber",{character:"\\eb02"}),e.graph=new e("graph",{character:"\\eb03"}),e.gripper=new e("gripper",{character:"\\eb04"}),e.heart=new e("heart",{character:"\\eb05"}),e.home=new e("home",{character:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{character:"\\eb07"}),e.hubot=new e("hubot",{character:"\\eb08"}),e.inbox=new e("inbox",{character:"\\eb09"}),e.issueClosed=new e("issue-closed",{character:"\\eb0a"}),e.issueReopened=new e("issue-reopened",{character:"\\eb0b"}),e.issues=new e("issues",{character:"\\eb0c"}),e.italic=new e("italic",{character:"\\eb0d"}),e.jersey=new e("jersey",{character:"\\eb0e"}),e.json=new e("json",{character:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{character:"\\eb10"}),e.key=new e("key",{character:"\\eb11"}),e.law=new e("law",{character:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{character:"\\eb13"}),e.linkExternal=new e("link-external",{character:"\\eb14"}),e.link=new e("link",{character:"\\eb15"}),e.listOrdered=new e("list-ordered",{character:"\\eb16"}),e.listUnordered=new e("list-unordered",{character:"\\eb17"}),e.liveShare=new e("live-share",{character:"\\eb18"}),e.loading=new e("loading",{character:"\\eb19"}),e.location=new e("location",{character:"\\eb1a"}),e.mailRead=new e("mail-read",{character:"\\eb1b"}),e.mail=new e("mail",{character:"\\eb1c"}),e.markdown=new e("markdown",{character:"\\eb1d"}),e.megaphone=new e("megaphone",{character:"\\eb1e"}),e.mention=new e("mention",{character:"\\eb1f"}),e.milestone=new e("milestone",{character:"\\eb20"}),e.mortarBoard=new e("mortar-board",{character:"\\eb21"}),e.move=new e("move",{character:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{character:"\\eb23"}),e.mute=new e("mute",{character:"\\eb24"}),e.noNewline=new e("no-newline",{character:"\\eb25"}),e.note=new e("note",{character:"\\eb26"}),e.octoface=new e("octoface",{character:"\\eb27"}),e.openPreview=new e("open-preview",{character:"\\eb28"}),e.package_=new e("package",{character:"\\eb29"}),e.paintcan=new e("paintcan",{character:"\\eb2a"}),e.pin=new e("pin",{character:"\\eb2b"}),e.play=new e("play",{character:"\\eb2c"}),e.run=new e("run",{character:"\\eb2c"}),e.plug=new e("plug",{character:"\\eb2d"}),e.preserveCase=new e("preserve-case",{character:"\\eb2e"}),e.preview=new e("preview",{character:"\\eb2f"}),e.project=new e("project",{character:"\\eb30"}),e.pulse=new e("pulse",{character:"\\eb31"}),e.question=new e("question",{character:"\\eb32"}),e.quote=new e("quote",{character:"\\eb33"}),e.radioTower=new e("radio-tower",{character:"\\eb34"}),e.reactions=new e("reactions",{character:"\\eb35"}),e.references=new e("references",{character:"\\eb36"}),e.refresh=new e("refresh",{character:"\\eb37"}),e.regex=new e("regex",{character:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{character:"\\eb39"}),e.remote=new e("remote",{character:"\\eb3a"}),e.remove=new e("remove",{character:"\\eb3b"}),e.replaceAll=new e("replace-all",{character:"\\eb3c"}),e.replace=new e("replace",{character:"\\eb3d"}),e.repoClone=new e("repo-clone",{character:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{character:"\\eb3f"}),e.repoPull=new e("repo-pull",{character:"\\eb40"}),e.repoPush=new e("repo-push",{character:"\\eb41"}),e.report=new e("report",{character:"\\eb42"}),e.requestChanges=new e("request-changes",{character:"\\eb43"}),e.rocket=new e("rocket",{character:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{character:"\\eb45"}),e.rootFolder=new e("root-folder",{character:"\\eb46"}),e.rss=new e("rss",{character:"\\eb47"}),e.ruby=new e("ruby",{character:"\\eb48"}),e.saveAll=new e("save-all",{character:"\\eb49"}),e.saveAs=new e("save-as",{character:"\\eb4a"}),e.save=new e("save",{character:"\\eb4b"}),e.screenFull=new e("screen-full",{character:"\\eb4c"}),e.screenNormal=new e("screen-normal",{character:"\\eb4d"}),e.searchStop=new e("search-stop",{character:"\\eb4e"}),e.server=new e("server",{character:"\\eb50"}),e.settingsGear=new e("settings-gear",{character:"\\eb51"}),e.settings=new e("settings",{character:"\\eb52"}),e.shield=new e("shield",{character:"\\eb53"}),e.smiley=new e("smiley",{character:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{character:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{character:"\\eb56"}),e.splitVertical=new e("split-vertical",{character:"\\eb57"}),e.squirrel=new e("squirrel",{character:"\\eb58"}),e.starFull=new e("star-full",{character:"\\eb59"}),e.starHalf=new e("star-half",{character:"\\eb5a"}),e.symbolClass=new e("symbol-class",{character:"\\eb5b"}),e.symbolColor=new e("symbol-color",{character:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{character:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{character:"\\eb5e"}),e.symbolField=new e("symbol-field",{character:"\\eb5f"}),e.symbolFile=new e("symbol-file",{character:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{character:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{character:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{character:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{character:"\\eb64"}),e.symbolProperty=new e("symbol-property",{character:"\\eb65"}),e.wrench=new e("wrench",{character:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{character:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{character:"\\eb66"}),e.tasklist=new e("tasklist",{character:"\\eb67"}),e.telescope=new e("telescope",{character:"\\eb68"}),e.textSize=new e("text-size",{character:"\\eb69"}),e.threeBars=new e("three-bars",{character:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{character:"\\eb6b"}),e.thumbsup=new e("thumbsup",{character:"\\eb6c"}),e.tools=new e("tools",{character:"\\eb6d"}),e.triangleDown=new e("triangle-down",{character:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{character:"\\eb6f"}),e.triangleRight=new e("triangle-right",{character:"\\eb70"}),e.triangleUp=new e("triangle-up",{character:"\\eb71"}),e.twitter=new e("twitter",{character:"\\eb72"}),e.unfold=new e("unfold",{character:"\\eb73"}),e.unlock=new e("unlock",{character:"\\eb74"}),e.unmute=new e("unmute",{character:"\\eb75"}),e.unverified=new e("unverified",{character:"\\eb76"}),e.verified=new e("verified",{character:"\\eb77"}),e.versions=new e("versions",{character:"\\eb78"}),e.vmActive=new e("vm-active",{character:"\\eb79"}),e.vmOutline=new e("vm-outline",{character:"\\eb7a"}),e.vmRunning=new e("vm-running",{character:"\\eb7b"}),e.watch=new e("watch",{character:"\\eb7c"}),e.whitespace=new e("whitespace",{character:"\\eb7d"}),e.wholeWord=new e("whole-word",{character:"\\eb7e"}),e.window=new e("window",{character:"\\eb7f"}),e.wordWrap=new e("word-wrap",{character:"\\eb80"}),e.zoomIn=new e("zoom-in",{character:"\\eb81"}),e.zoomOut=new e("zoom-out",{character:"\\eb82"}),e.listFilter=new e("list-filter",{character:"\\eb83"}),e.listFlat=new e("list-flat",{character:"\\eb84"}),e.listSelection=new e("list-selection",{character:"\\eb85"}),e.selection=new e("selection",{character:"\\eb85"}),e.listTree=new e("list-tree",{character:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{character:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{character:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{character:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{character:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{character:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{character:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{character:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{character:"\\eb8c"}),e.symbolString=new e("symbol-string",{character:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{character:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{character:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{character:"\\eb90"}),e.callIncoming=new e("call-incoming",{character:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{character:"\\eb93"}),e.menu=new e("menu",{character:"\\eb94"}),e.expandAll=new e("expand-all",{character:"\\eb95"}),e.feedback=new e("feedback",{character:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{character:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{character:"\\eb98"}),e.account=new e("account",{character:"\\eb99"}),e.bellDot=new e("bell-dot",{character:"\\eb9a"}),e.debugConsole=new e("debug-console",{character:"\\eb9b"}),e.library=new e("library",{character:"\\eb9c"}),e.output=new e("output",{character:"\\eb9d"}),e.runAll=new e("run-all",{character:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{character:"\\eb9f"}),e.pinned=new e("pinned",{character:"\\eba0"}),e.githubInverted=new e("github-inverted",{character:"\\eba1"}),e.debugAlt=new e("debug-alt",{character:"\\eb91"}),e.serverProcess=new e("server-process",{character:"\\eba2"}),e.serverEnvironment=new e("server-environment",{character:"\\eba3"}),e.pass=new e("pass",{character:"\\eba4"}),e.stopCircle=new e("stop-circle",{character:"\\eba5"}),e.playCircle=new e("play-circle",{character:"\\eba6"}),e.record=new e("record",{character:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{character:"\\eba8"}),e.vmConnect=new e("vm-connect",{character:"\\eba9"}),e.cloud=new e("cloud",{character:"\\ebaa"}),e.merge=new e("merge",{character:"\\ebab"}),e.exportIcon=new e("export",{character:"\\ebac"}),e.graphLeft=new e("graph-left",{character:"\\ebad"}),e.magnet=new e("magnet",{character:"\\ebae"}),e.notebook=new e("notebook",{character:"\\ebaf"}),e.redo=new e("redo",{character:"\\ebb0"}),e.checkAll=new e("check-all",{character:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{character:"\\ebb2"}),e.passFilled=new e("pass-filled",{character:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{character:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{character:"\\ebb5"}),e.combine=new e("combine",{character:"\\ebb6"}),e.gather=new e("gather",{character:"\\ebb6"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition)}(pa||(pa={}));class ba{constructor(e,t){this.language=e,this.id=t}}class va{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=this.getForeground(e),i="mtk"+t,n=this.getFontStyle(e);return 1&n&&(i+=" mtki"),2&n&&(i+=" mtkb"),4&n&&(i+=" mtku"),i}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}}(function(){let e=Object.create(null);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(){let e=Object.create(null);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})();var wa,Ca,ya;(function(e){e[e["Invoke"]=1]="Invoke",e[e["TriggerCharacter"]=2]="TriggerCharacter",e[e["ContentChange"]=3]="ContentChange"})(wa||(wa={})),function(e){e[e["Text"]=0]="Text",e[e["Read"]=1]="Read",e[e["Write"]=2]="Write"}(Ca||(Ca={})),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;function n(e){return t.get(e)}function o(e){return i.get(e)}function s(e,t){const n=i.get(e);let o=n&&fa.get("symbol-"+n);return o||(console.info("No codicon found for SymbolKind "+e),o=pa.symbolProperty),`${t?"inline":"block"} ${o.classNames}`}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=n,e.toString=o,e.toCssClassName=s}(ya||(ya={}));class Sa{constructor(e){this.value=e}}Sa.Comment=new Sa("comment"),Sa.Imports=new Sa("imports"),Sa.Region=new Sa("region");const xa=new da,La=new da,ka=new da,Ea=new da,Da=new da,Na=new da,Ia=new da,Ta=new da,Ma=new da,Oa=new da,Aa=new da,Ra=new da,Pa=new da,Fa=new da,Wa=new da,Ba=new da,Va=new da,Ha=new da,za=new da,Ua=new da,Ka=new da,ja=new da,qa=new da,$a=new da,Ga=new ha;class Ya{clone(){return this}equals(e){return this===e}}const Xa=new Ya,Za="vs.editor.nullMode",Qa=new ba(Za,0);function Ja(e,t,i,n){return new hi([new di(n,"",e)],i)}function el(e,t,i,n){let o=new Uint32Array(2);return o[0]=n,o[1]=(16384|e<<0|2<<23)>>>0,new ui(o,null===i?Xa:i)}const tl="editorWorkerService",il=Zi(tl),nl=Zi("modeService"),ol=Zi("textModelService"),sl="$initialize";let rl=!1;function al(e){s["i"]&&(rl||(rl=!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 ll{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,n=this._handler.handleMessage(t.method,t.args);n.then(e=>{this._send({vsWorker:this._workerId,seq:i,res:e,err:void 0})},e=>{e.detail instanceof Error&&(e.detail=Ce(e.detail)),this._send({vsWorker:this._workerId,seq:i,res:void 0,err:Ce(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 ll({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(n){return Promise.reject(n)}}}),this._protocol.setWorkerId(this._worker.getId());let o=null;"undefined"!==typeof self.require&&"function"===typeof self.require.getConfig?o=self.require.getConfig():"undefined"!==typeof self.requirejs&&(o=self.requirejs.s.contexts._.config);const s=Ws(i);this._onModuleLoaded=this._protocol.sendMessage(sl,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,s]);const r=(e,t)=>this._request(e,t);this._lazyProxy=new Promise((e,i)=>{n=i,this._onModuleLoaded.then(t=>{e(Bs(t,r))},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)}}var dl;const hl=null===(dl=window.trustedTypes)||void 0===dl?void 0:dl.createPolicy("defaultWorkerFactory",{createScriptURL:e=>e});function ul(e,t){if(s["b"].MonacoEnvironment){if("function"===typeof s["b"].MonacoEnvironment.getWorker)return s["b"].MonacoEnvironment.getWorker(e,t);if("function"===typeof s["b"].MonacoEnvironment.getWorkerUrl){const i=s["b"].MonacoEnvironment.getWorkerUrl(e,t);return new Worker(hl?hl.createScriptURL(i):i,{name:t})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function gl(e){return"function"===typeof e.then}class fl{constructor(e,t,i,n,o){this.id=t;const s=ul("workerMain.js",i);gl(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=o,"function"===typeof e.addEventListener&&e.addEventListener("error",o)})}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 ml{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){let n=++ml.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new fl(e,n,this._label||"anonymous"+n,t,e=>{al(e),this._webWorkerFailedBeforeError=e,i(e)})}}var pl;ml.LAST_WORKER_ID=0,function(e){e[e["None"]=0]="None",e[e["Indent"]=1]="Indent",e[e["IndentOutdent"]=2]="IndentOutdent",e[e["Outdent"]=3]="Outdent"}(pl||(pl={}));class _l{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;t0&&e.getLanguageId(r-1)===o)r--;return new Cl(e,o,r,s+1,e.getStartOffset(r),e.getEndOffset(s))}class Cl{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(){const e=this._actual.getLineContent();return e.substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){const t=this._actual.getLineContent();return t.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 yl(e){return 0!==(7&e)}class Sl{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(e=>new _l(e)):e.brackets?this._autoClosingPairs=e.brackets.map(e=>new _l({open:e[0],close:e[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new _l({open:t.open,close:t.close||""}))}this._autoCloseBefore="string"===typeof e.autoCloseBefore?e.autoCloseBefore:Sl.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}}let xl;function Ll(){return xl||(xl=new TextDecoder(s["e"]()?"UTF-16LE":"UTF-16BE")),xl}Sl.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED=";:.,=}])> \n\t";const kl="undefined"!==typeof TextDecoder;let El,Dl;function Nl(e,t,i){const n=new Uint16Array(e.buffer,t,i);return Ll().decode(n)}function Il(e,t,i){let n=[],o=0;for(let s=0;snew Tl(e),Dl=Nl):(El=e=>new Ml,Dl=Il);class Tl{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 Ll().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||rs["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[e[0].toLowerCase(),e[1].toLowerCase()]);const i=[];for(let r=0;r{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 r=0;r0&&s.push({open:n,close:o})}return s}class Rl{constructor(e,t){const i=Al(t);this.brackets=i.map((t,n)=>new Ol(e,n,t.open,t.close,Bl(t.open,t.close,i,n),Vl(t.open,t.close,i,n))),this.forwardRegex=Hl(this.brackets),this.reversedRegex=zl(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const e of n.open)this.textIsBracket[e]=n,this.textIsOpenBracket[e]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,e.length);for(const e of n.close)this.textIsBracket[e]=n,this.textIsOpenBracket[e]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,e.length)}}}function Pl(e,t,i,n){for(let o=0,s=t.length;o=0&&n.push(t);for(const t of s.close)t.indexOf(e)>=0&&n.push(t)}}function Fl(e,t){return e.length-t.length}function Wl(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 Bl(e,t,i,n){let o=[];o=o.concat(e),o=o.concat(t);for(let s=0,r=o.length;s=0;n--)t[i++]=e.charCodeAt(n);return Ll().decode(t)}{let t=[],i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charAt(n);return t.join("")}}let t=null,i=null;return function(n){return t!==n&&(t=n,i=e(t)),i}}();class ql{static _findPrevBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let s=i.length-(o.index||0),r=o[0].length,a=n+s;return new li(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,o){const s=jl(i),r=s.substring(i.length-o,i.length-n);return this._findPrevBracketInText(e,t,r,n)}static findNextBracketInText(e,t,i,n){let o=i.match(e);if(!o)return null;let s=o.index||0,r=o[0].length;if(0===r)return null;let a=n+s;return new li(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,o){const s=i.substring(n,o);return this.findNextBracketInText(e,t,s,n)}}class $l{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(yl(t.getStandardTokenType(n)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,r=ql.findPrevBracketInRange(o,1,s,0,s.length);if(!r)return null;const a=s.substring(r.startColumn-1,r.endColumn-1).toLowerCase(),l=this._richEditBrackets.textIsOpenBracket[a];if(l)return null;const c=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(c)?{matchOpenBracket:a}:null}}function Gl(e){return e.global&&(e.lastIndex=0),!0}class Yl{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&Gl(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&Gl(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&Gl(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&Gl(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}}class Xl{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(e=>{const t=Xl._createOpenBracketRegExp(e[0]),i=Xl._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 o=0,s=this._regExpRules.length;o!e.reg||e.reg.test(e.text));if(s)return e.action}if(e>=2&&i.length>0&&n.length>0)for(let o=0,s=this._brackets.length;o=2&&i.length>0)for(let o=0,s=this._brackets.length;o{this._entries.get(e.id)===n&&(this._entries.set(e.id,i),this._onDidChange.fire(new Ql(e)))})}_getRichEditSupport(e){return this._entries.get(e)}getIndentationRules(e){const t=this._entries.get(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=wl(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 bl(t?t.getAutoClosingPairs():[])}getAutoCloseBeforeSet(e){let t=this._getCharacterPairSupport(e);return t?t.getAutoCloseBeforeSet():Sl.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED}getSurroundingPairs(e){let t=this._getCharacterPairSupport(e);return t?t.getSurroundingPairs():[]}shouldAutoClosePair(e,t,i){const n=wl(t,i-1);return Sl.shouldAutoClosePair(e,n,i-n.firstCharOffset)}getWordDefinition(e){let t=this._getRichEditSupport(e);return c(t&&t.wordDefinition||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 s=this.getPrecedingValidLine(t,i,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const r=t.getLineContent(s);if(o.shouldIncrease(r)||o.shouldIndentNextLine(r))return{indentation:rs["x"](r),action:pl.Indent,line:s};if(o.shouldDecrease(r))return{indentation:rs["x"](r),action:null,line:s};{if(1===s)return{indentation:rs["x"](t.getLineContent(s)),action:null,line:s};const e=s-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:rs["x"](t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:rs["x"](t.getLineContent(s)),action:null,line:s};for(let n=s;n>0;n--){const e=t.getLineContent(n);if(o.shouldIncrease(e))return{indentation:rs["x"](e),action:pl.Indent,line:n};if(o.shouldIndentNextLine(e)){let e=0;for(let i=n-1;i>0;i--)if(!o.shouldIndentNextLine(t.getLineContent(n))){e=i;break}return{indentation:rs["x"](t.getLineContent(e+1)),action:null,line:e+1}}if(o.shouldDecrease(e))return{indentation:rs["x"](e),action:null,line:n}}return{indentation:rs["x"](t.getLineContent(1)),action:null,line:1}}}getGoodIndentForLine(e,t,i,n,o){if(e<4)return null;const s=this._getRichEditSupport(i);if(!s)return null;const r=this.getIndentRulesSupport(i);if(!r)return null;const a=this.getInheritIndentForLine(e,t,n),l=t.getLineContent(n);if(a){const i=a.line;if(void 0!==i){const n=s.onEnter(e,"",t.getLineContent(i),"");if(n){let e=rs["x"](t.getLineContent(i));return n.removeText&&(e=e.substring(0,e.length-n.removeText)),n.indentAction===pl.Indent||n.indentAction===pl.IndentOutdent?e=o.shiftIndent(e):n.indentAction===pl.Outdent&&(e=o.unshiftIndent(e)),r.shouldDecrease(l)&&(e=o.unshiftIndent(e)),n.appendText&&(e+=n.appendText),rs["x"](e)}}return r.shouldDecrease(l)?a.action===pl.Indent?a.indentation:o.unshiftIndent(a.indentation):a.action===pl.Indent?o.shiftIndent(a.indentation):a.indentation}return null}getIndentForEnter(e,t,i,n){if(e<4)return null;t.forceTokenization(i.startLineNumber);const o=t.getLineTokens(i.startLineNumber),s=wl(o,i.startColumn-1),r=s.getLineContent();let a,l,c=!1;if(s.firstCharOffset>0&&o.getLanguageId(0)!==s.languageId?(c=!0,a=r.substr(0,i.startColumn-1-s.firstCharOffset)):a=o.getLineContent().substring(0,i.startColumn-1),i.isEmpty())l=r.substr(i.startColumn-1-s.firstCharOffset);else{const e=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn);l=e.getLineContent().substr(i.endColumn-1-s.firstCharOffset)}const d=this.getIndentRulesSupport(s.languageId);if(!d)return null;const h=a,u=rs["x"](a),g={getLineTokens:e=>t.getLineTokens(e),getLanguageIdentifier:()=>t.getLanguageIdentifier(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i),getLineContent:e=>e===i.startLineNumber?h:t.getLineContent(e)},f=rs["x"](o.getLineContent()),m=this.getInheritIndentForLine(e,g,i.startLineNumber+1);if(!m){const e=c?f:u;return{beforeEnter:e,afterEnter:e}}let p=c?f:m.indentation;return m.action===pl.Indent&&(p=n.shiftIndent(p)),d.shouldDecrease(l)&&(p=n.unshiftIndent(p)),{beforeEnter:c?f:u,afterEnter:p}}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 a=s.getLineContent(),l=a.substr(0,i.startColumn-1-s.firstCharOffset);let c;if(i.isEmpty())c=a.substr(i.startColumn-1-s.firstCharOffset);else{const e=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn);c=e.getLineContent().substr(i.endColumn-1-s.firstCharOffset)}if(!r.shouldDecrease(l+c)&&r.shouldDecrease(l+n+c)){const n=this.getInheritIndentForLine(e,t,i.startLineNumber,!1);if(!n)return null;let s=n.indentation;return n.action!==pl.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 a;if(i.isEmpty())a=s.substr(i.startColumn-1-n.firstCharOffset);else{const e=this.getScopedLineTokens(t,i.endLineNumber,i.endColumn);a=e.getLineContent().substr(i.endColumn-1-n.firstCharOffset)}let l="";if(i.startLineNumber>1&&0===n.firstCharOffset){const e=this.getScopedLineTokens(t,i.startLineNumber-1);e.languageId===n.languageId&&(l=e.getLineContent())}const c=o.onEnter(e,l,r,a);if(!c)return null;const d=c.indentAction;let h=c.appendText;const u=c.removeText||0;h?d===pl.Indent&&(h="\t"+h):h=d===pl.Indent||d===pl.IndentOutdent?"\t":"";let g=this.getIndentationAtPosition(t,i.startLineNumber,i.startColumn);return u&&(g=g.substring(0,g.length-u)),{indentAction:d,appendText:h,removeText:u,indentation:g}}getIndentationAtPosition(e,t,i){const n=e.getLineContent(t);let o=rs["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="undefined"===typeof i?e.getLineMaxColumn(t)-1:i-1;return wl(n,o)}getBracketsSupport(e){const t=this._getRichEditSupport(e);return t&&t.brackets||null}}const ec=new Jl;function tc(e,t=0){return e[e.length-(1+t)]}function ic(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function nc(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 sc(e,t){return ac(e,t,0,e.length-1,[]),e}function rc(e,t,i,n,o,s){let r=i,a=n+1;for(let l=i;l<=o;l++)s[l]=e[l];for(let l=i;l<=o;l++)r>n?e[l]=s[a++]:a>o?e[l]=s[r++]:t(s[a],s[r])<0?e[l]=s[a++]:e[l]=s[r++]}function ac(e,t,i,n,o){if(n<=i)return;const s=i+(n-i)/2|0;ac(e,t,i,s,o),ac(e,t,s+1,n,o),t(e[s],e[s+1])<=0||rc(e,t,i,s,n,o)}function lc(e){return e.filter(e=>!!e)}function cc(e){return!Array.isArray(e)||0===e.length}function dc(e){return Array.isArray(e)&&e.length>0}function hc(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 uc(e){const t=new Set;return e.filter(e=>!t.has(e)&&(t.add(e),!0))}function gc(e,t){return e.length>0?e[0]:t}function fc(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 o=i;ot;o--)n.push(o);return n}function mc(e,t,i){const n=e.slice(0,t),o=e.slice(t);return n.concat(i,o)}class pc{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class _c{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new pc(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 yc{constructor(e,t,i=null){this.ContinueProcessingPredicate=i;const[n,o,s]=yc._getElements(e),[r,a,l]=yc._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(yc._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i=e&&n>=i&&this.ElementsAreEqual(t,n))t--,n--;if(e>t||i>n){let o;return i<=n?(vc.Assert(e===t+1,"originalStart should only be one more than originalEnd"),o=[new pc(e,0,i,n-i+1)]):e<=t?(vc.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[new pc(e,t-e+1,i,0)]):(vc.Assert(e===t+1,"originalStart should only be one more than originalEnd"),vc.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),o=[]),o}const s=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,s,r,o),l=s[0],c=r[0];if(null!==a)return a;if(!o[0]){const s=this.ComputeDiffRecursive(e,l,i,c,o);let r=[];return r=o[0]?[new pc(l+1,t-(l+1)+1,c+1,n-(c+1)+1)]:this.ComputeDiffRecursive(l+1,t,c+1,n,o),this.ConcatenateChanges(s,r)}return[new pc(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,m,p,_){let b=null,v=null,w=new Cc,C=t,y=i,S=u[0]-m[0]-n,x=-1073741824,L=this.m_forwardHistory.length-1;do{const t=S+e;t===C||t=0&&(l=this.m_forwardHistory[L],e=l[0],C=1,y=l.length-1)}while(--L>=-1);if(b=w.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==b&&b.length>0){const i=b[b.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}v=[new pc(e,h-e+1,t,f-t+1)]}else{w=new Cc,C=s,y=r,S=u[0]-m[0]-a,x=1073741824,L=p?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+o;e===C||e=c[e+1]?(d=c[e+1]-1,g=d-S-a,d>x&&w.MarkNextChange(),x=d+1,w.AddOriginalElement(d+1,g+1),S=e+1-o):(d=c[e-1],g=d-S-a,d>x&&w.MarkNextChange(),x=d,w.AddModifiedElement(d+1,g+1),S=e-1-o),L>=0&&(c=this.m_reverseHistory[L],o=c[0],C=1,y=c.length-1)}while(--L>=-1);v=w.getChanges()}return this.ConcatenateChanges(b,v)}ComputeRecursionPoint(e,t,i,n,o,s,r){let a=0,l=0,c=0,d=0,h=0,u=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),f=g+1,m=new Int32Array(f),p=new Int32Array(f),_=n-i,b=t-e,v=e-i,w=t-n,C=b-_,y=C%2===0;m[_]=e,p[b]=t,r[0]=!1;for(let S=1;S<=g/2+1;S++){let g=0,C=0;c=this.ClipDiagonalBound(_-S,S,_,f),d=this.ClipDiagonalBound(_+S,S,_,f);for(let e=c;e<=d;e+=2){a=e===c||eg+C&&(g=a,C=l),!y&&Math.abs(e-b)<=S-1&&a>=p[e])return o[0]=a,s[0]=l,i<=p[e]&&S<=1448?this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r):null}const x=(g-e+(C-i)-S)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,x))return r[0]=!0,o[0]=g,s[0]=C,x>0&&S<=1448?this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r):(e++,i++,[new pc(e,t-e+1,i,n-i+1)]);h=this.ClipDiagonalBound(b-S,S,b,f),u=this.ClipDiagonalBound(b+S,S,b,f);for(let f=h;f<=u;f+=2){a=f===h||f=p[f+1]?p[f+1]-1:p[f-1],l=a-(f-b)-w;const g=a;while(a>e&&l>i&&this.ElementsAreEqual(a,l))a--,l--;if(p[f]=a,y&&Math.abs(f-_)<=S&&a<=m[f])return o[0]=a,s[0]=l,g>=m[f]&&S<=1448?this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r):null}if(S<=1447){let e=new Int32Array(d-c+2);e[0]=_-c+1,wc.Copy2(m,c,e,1,d-c+1),this.m_forwardHistory.push(e),e=new Int32Array(u-h+2),e[0]=b-h+1,wc.Copy2(p,h,e,1,u-h+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,c,d,v,b,h,u,w,m,p,a,t,o,l,n,s,y,r)}PrettifyChanges(e){for(let t=0;t0,r=i.modifiedLength>0;while(i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,o=0;if(t>0){const i=e[t-1];i.originalLength>0&&(n=i.originalStart+i.originalLength),i.modifiedLength>0&&(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,c=i.modifiedStart-e;if(tl&&(l=d,a=e)}i.originalStart-=a,i.modifiedStart-=a}if(this._hasStrings)for(let t=1,i=e.length;t0&&t>a&&(a=t,l=d,c=e)}return a>0?[l,c]: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){const o=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(i,n)?1:0;return o+s}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 wc.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],wc.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return wc.Copy(e,0,i,0,e.length),wc.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(vc.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),vc.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 n=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new pc(n,o,s,r),!0}return i[0]=null,!1}ClipDiagonalBound(e,t,i,n){if(e>=0&&e0&&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=xc(s,a,o,!0).changes;r&&(l=Dc(l)),h=[];for(let e=0,t=l.length;e1&&r>1){const n=e.charCodeAt(i-2),o=t.charCodeAt(r-2);if(n!==o)break;i--,r--}(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,o+1,1,i,s+1,1,r)}{let i=Mc(e,1),r=Mc(t,1);const a=e.length+1,l=t.length+1;while(i!0;const t=Date.now();return()=>Date.now()-t255?255:0|e}function Rc(e){return e<0?0:e>4294967295?4294967295:0|e}class Pc{constructor(e,t){this.index=e,this.remainder=t}}class Fc{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=Rc(e);const i=this.values,n=this.prefixSum,o=t.length;return 0!==o&&(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}changeValue(e,t){return e=Rc(e),t=Rc(t),this.values[e]!==t&&(this.values[e]=t,e-1=i.length)return!1;let o=i.length-e;return t>=o&&(t=o),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(n.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=Rc(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,o=0,s=0;while(t<=i)if(n=t+(i-t)/2|0,o=this.prefixSum[n],s=o-this.values[n],e=o))break;t=n+1}return new Pc(n,e-s)}}class Wc{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);const t=e.changes;for(const i of t)this._acceptDeleteRange(i.range),this._acceptInsertText(new ai(i.range.startLineNumber,i.range.startColumn),i.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n=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 Vc{constructor(e,t,i){const n=new Uint8Array(e*t);for(let o=0,s=e*t;ot&&(t=s),n>i&&(i=n),r>i&&(i=r)}t++,i++;let n=new Vc(i,t,0);for(let o=0,s=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let zc=null;function Uc(){return null===zc&&(zc=new Hc([[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]])),zc}let Kc=null;function jc(){if(null===Kc){Kc=new Bc(0);const e=" \t<>'\"、。。、,.:;‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…";for(let i=0;in);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=Uc()){const i=jc();let n=[];for(let o=1,s=e.getLineCount();o<=s;o++){const s=e.getLineContent(o),r=s.length;let a=0,l=0,c=0,d=1,h=!1,u=!1,g=!1,f=!1;while(a=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}Gc.INSTANCE=new Gc;var Yc=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Xc extends Wc{get uri(){return this._uri}get version(){return this._versionId}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=h(e.column,c(t),this._lines[e.lineNumber-1],0);return i?new li(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](){while(1)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 Zc{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 Xc(Xt.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;let i=this._models[e];i.onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeDiff(e,t,i,n){return Yc(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 Ic(r,a,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:n}),c=l.computeDiff(),d=!(c.changes.length>0)&&this._modelsAreIdentical(o,s);return{quitEarly:c.quitEarly,identical:d,changes:c.changes}}))}_modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLineCount();if(i!==n)return!1;for(let o=1;o<=i;o++){const i=e.getLineContent(o),n=t.getLineContent(o);if(i!==n)return!1}return!0}computeMoreMinimalEdits(e,t){return Yc(this,void 0,void 0,(function*(){const i=this._getModel(e);if(!i)return t;const n=[];let o=void 0;t=sc(t,(e,t)=>{if(e.range&&t.range)return li.compareRangesUsingStarts(e.range,t.range);let i=e.range?0:1,n=t.range?0:1;return i-n});for(let{range:e,text:s,eol:r}of t){if("number"===typeof r&&(o=r),li.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)>Zc._diffLimit){n.push({range:e,text:s});continue}const a=bc(t,s,!1),l=i.offsetAt(li.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 Yc(this,void 0,void 0,(function*(){let t=this._getModel(e);return t?$c(t):null}))}textualSuggest(e,t,i,n){return Yc(this,void 0,void 0,(function*(){const o=new Ke(!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>Zc._suggestionsLimit))break e}return{words:Array.from(r),duration:o.elapsed()}}))}computeWordRanges(e,t,i,n){return Yc(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),o=Bs(i,n);let s={host:o,getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(Ws(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(i){return Promise.reject(i)}}}Zc._diffLimit=1e5,Zc._suggestionsLimit=1e4,"function"===typeof importScripts&&(s["b"].monaco=$i());const Qc=Zi("textResourceConfigurationService"),Jc=Zi("textResourcePropertiesService"),ed=Zi("logService");var td;(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"})(td||(td={}));const id=td.Info;class nd extends We{constructor(){super(...arguments),this.level=id,this._onDidChangeLogLevel=this._register(new Ye)}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}}class od extends nd{constructor(e=id){super(),this.setLevel(e)}trace(e,...t){this.getLevel()<=td.Trace&&console.log("%cTRACE","color: #888",e,...t)}debug(e,...t){this.getLevel()<=td.Debug&&console.log("%cDEBUG","background: #eee; color: #888",e,...t)}info(e,...t){this.getLevel()<=td.Info&&console.log("%c INFO","color: #33f",e,...t)}error(e,...t){this.getLevel()<=td.Error&&console.log("%c ERR","color: #f33",e,...t)}dispose(){}}var sd=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},rd=function(e,t){return function(i,n){t(i,n,e)}},ad=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ld=6e4,cd=3e5;function dd(e,t){let i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let hd=class extends We{constructor(e,t,i){super(),this._modelService=e,this._workerManager=this._register(new gd(this._modelService)),this._logService=i,this._register(za.register("*",{provideLinks:(e,t)=>dd(this._modelService,e.uri)?this._workerManager.withWorker().then(t=>t.computeLinks(e.uri)).then(e=>e&&{links:e}):Promise.resolve({links:[]})})),this._register(ka.register("*",new ud(this._workerManager,t,this._modelService)))}dispose(){super.dispose()}canComputeDiff(e,t){return dd(this._modelService,e)&&dd(this._modelService,t)}computeDiff(e,t,i,n){return this._workerManager.withWorker().then(o=>o.computeDiff(e,t,i,n))}computeMoreMinimalEdits(e,t){if(dc(t)){if(!dd(this._modelService,e))return Promise.resolve(t);const i=Ke.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,Pn(1e3).then(()=>t)])}return Promise.resolve(void 0)}canNavigateValueSet(e){return dd(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(n=>n.navigateValueSet(e,t,i))}canComputeWordRanges(e){return dd(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};hd=sd([rd(0,aa),rd(1,Qc),rd(2,ed)],hd);class ud{constructor(e,t,i){this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return ad(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)dd(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())dd(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=ec.getWordDefinition(e.getLanguageIdentifier().id),s=e.getWordAtPosition(t),r=s?new li(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):li.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),c=yield l.textualSuggest(n,null===s||void 0===s?void 0:s.word,o);return c?{duration:c.duration,suggestions:c.words.map(e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}}))}:void 0}))}}class gd extends We{constructor(e){super(),this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime();let t=this._register(new Bn);t.cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(cd/2)),this._register(this._modelService.onModelRemoved(e=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;let e=this._modelService.getModels();0===e.length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;let e=(new Date).getTime()-this._lastWorkerUsedTime;e>cd&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new _d(this._modelService,!1,"editorWorkerService")),Promise.resolve(this._editorWorkerClient)}}class fd extends We{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 Bn;e.cancelAndSet(()=>this._checkStopModelSync(),Math.round(ld/2)),this._register(e)}}dispose(){for(let e in this._syncedModels)Ae(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){let n=e-this._syncedModelsLastUsedTime[i];n>ld&&t.push(i)}for(const i of t)this._stopModelSync(i)}_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 Fe;n.add(t.onDidChangeContent(e=>{this._proxy.acceptModelChanged(i.toString(),e)})),n.add(t.onWillDispose(()=>{this._stopModelSync(i)})),n.add(Pe(()=>{this._proxy.acceptRemovedModel(i)})),this._syncedModels[i]=n}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Ae(t)}}class md{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class pd{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class _d extends We{constructor(e,t,i){super(),this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new ml(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 cl(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new pd(this)))}catch(e){al(e),this._worker=new md(new Zc(new pd(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(al(e),this._worker=new md(new Zc(new pd(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new fd(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e){return this._disposed?Promise.reject(xe()):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 ad(this,void 0,void 0,(function*(){const n=yield this._withSyncedResources(e),o=i.source,s=Object(rs["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=ec.getWordDefinition(n.getLanguageIdentifier().id),s=o.source,r=Object(rs["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=ec.getWordDefinition(o.getLanguageIdentifier().id),r=s.source,a=Object(rs["L"])(s);return n.navigateValueSet(e.toString(),t,i,r,a)})}dispose(){super.dispose(),this._disposed=!0}}function bd(e,t){return new vd(e,t)}class vd extends _d{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(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?Ws(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())}}class wd{constructor(e,t){this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t}equals(e){return e instanceof wd&&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 s=n;s0?this._tokens[e-1<<1]:0}getMetadata(e){const t=this._tokens[1+(e<<1)];return t}getLanguageId(e){const t=this._tokens[1+(e<<1)];return va.getLanguageId(t)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return va.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return va.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return va.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return va.getInlineStyleFromMetadata(i,t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return wd.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new Cd(this,e,t,i)}static convertToEndOffset(e,t){const i=e.length>>>1,n=i-1;for(let o=0;o>>1)-1;while(it&&(n=o)}return i}}class Cd{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 o=this._firstTokenIndex,s=e.getCount();o=i)break;this._tokensCount++}}equals(e){return e instanceof Cd&&(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}}class yd{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,n=t.length;if(i!==n)return!1;for(let o=0;o=o||(r[a++]=new yd(Math.max(1,l.startColumn-n+1),Math.min(s+1,l.endColumn-n+1),l.className,l.type));return r}static filter(e,t,i,n){if(0===e.length)return[];let o=[],s=0;for(let r=0,a=e.length;rt)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const c=l.startLineNumber===t?l.startColumn:i,d=l.endLineNumber===t?l.endColumn:n;o[s++]=new yd(c,d,a.inlineClassName,a.type)}return o}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=yd._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 Sd{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class xd{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 Ld{static normalize(e,t){if(0===t.length)return[];let i=[];const n=new xd;let o=0;for(let s=0,r=t.length;s1){const t=e.charCodeAt(a-2);rs["D"](t)&&a--}if(l>1){const t=e.charCodeAt(l-2);rs["D"](t)&&l--}const h=a-1,u=l-2;o=n.consumeLowerThan(h,o,i),0===n.count&&(o=h),n.insert(u,c,d)}return n.consumeLowerThan(1073741824,o,i),i}}class kd{constructor(e,t,i){this.endIndex=e,this.type=t,this.metadata=i}isWhitespace(){return!!(1&this.metadata)}}class Ed{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class Dd{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,m,p,_,b){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(yd.compare),this.tabSize=c,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=f,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=p,this.fontLigatures=_,this.selectionsOnLine=b&&b.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;while(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=Nd.getPartIndex(r),d=Nd.getCharIndex(r),h=Nd.getPartIndex(a);l=c!==h?t:Nd.getCharIndex(a);let u=i-d,g=l-i;return u<=g?o:s}}class Id{constructor(e,t,i){this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function Td(e,t){if(0===e.lineContent.length){let i=0,n="";if(e.lineDecorations.length>0){const t=[],o=[];for(let n=0,s=e.lineDecorations.length;n0?``:"",i=o.length>0?``:"";n=`${e}${i}`}}return t.appendASCIIString(n),new Id(new Nd(0,0),!1,i)}return Vd(Rd(e),t)}class Md{constructor(e,t,i,n){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=n}}function Od(e){let t=El(1e4),i=Td(e,t);return new Md(i.characterMapping,t.build(),i.containsRTL,i.containsForeignElements)}class Ad{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=o,this.parts=s,this.containsForeignElements=r,this.fauxIndentLength=a,this.tabSize=l,this.startVisibleColumn=c,this.containsRTL=d,this.spaceWidth=h,this.renderSpaceCharCode=u,this.renderWhitespace=g,this.renderControlCharacters=f}}function Rd(e){const t=e.lineContent;let i,n;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0){for(let t=0,i=e.lineDecorations.length;t0&&(n[o++]=new kd(t,"",0));for(let s=0,r=e.getCount();s=i){n[o++]=new kd(i,a,0);break}n[o++]=new kd(r,a,0)}return n}function Fd(e,t,i){let n=0,o=[],s=0;if(i)for(let r=0,a=t.length;r=50&&(o[s++]=new kd(l+1,t,r),c=l+1,l=-1);c!==a&&(o[s++]=new kd(a,t,r))}else o[s++]=i;n=a}else for(let r=0,a=t.length;r50){const t=e.type,r=e.metadata,l=Math.ceil(a/50);for(let e=1;e=x.endOffset&&(S++,x=c&&c[S]),Ev)o=!0;else if(9===e)o=!0;else if(32===e)if(d)if(y)o=!0;else{const e=E+1E),o&&h&&(o=w||E>v),y){if(!o||!l&&L>=r){if(u){const e=f>0?g[f-1].endIndex:s;for(let t=e+1;t<=E;t++)g[f++]=new kd(t,"mtkw",1)}else g[f++]=new kd(E,"mtkw",1);L%=r}}else(E===_||o&&E>s)&&(g[f++]=new kd(E,p,0),L%=r);9===e?L=r:rs["C"](e)?L+=2:L++,y=o;while(E===_)m++,m0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0,o=32===e&&32!==n&&9!==n;o||(k=!0)}else k=!0;if(k)if(u){const e=f>0?g[f-1].endIndex:s;for(let t=e+1;t<=i;t++)g[f++]=new kd(t,"mtkw",1)}else g[f++]=new kd(i,"mtkw",1);else g[f++]=new kd(i,p,0);return g}function Bd(e,t,i,n){n.sort(yd.compare);const o=Ld.normalize(e,n),s=o.length;let r=0,a=[],l=0,c=0;for(let h=0,u=i.length;hc&&(c=e.startOffset,a[l++]=new kd(c,n,d)),!(e.endOffset+1<=t)){c=t,a[l++]=new kd(c,n+" "+e.className,d|e.metadata);break}c=e.endOffset+1,a[l++]=new kd(c,n+" "+e.className,d|e.metadata),r++}t>c&&(c=t,a[l++]=new kd(c,n,d))}const d=i[i.length-1].endIndex;if(r'):t.appendASCIIString("");for(let x=0,L=l.length;x=c&&(i+=o)}}for(u&&(t.appendASCIIString(' style="width:'),t.appendASCIIString(String(g*e)),t.appendASCIIString('px"')),t.appendASCII(62);b1?t.write1(8594):t.write1(65515);for(let e=2;e<=i;e++)t.write1(160)}else i=1,t.write1(f);w+=i,b>=c&&(v+=i)}y=e}else{let e=0;for(t.appendASCII(62);b=c&&(v+=o)}y=e}L?C++:C=0,t.appendASCIIString("")}return _.setPartData(r,l.length-1,w,S),a&&t.appendASCIIString(""),t.appendASCIIString("
"),new Id(_,u,o)}class Hd{constructor(e,t,i,n){this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class zd{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}}class Ud{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,s=0;while(i<=n){o=i+(n-i)/2|0;const r=e[o];if(s=o>0?e[o-1]:0,t=r))break;i=o+1}}return new zd(o,t-s)}}class Kd{constructor(e,t){this.tabSize=e,this.data=t}}class jd{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 qd{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=qd.isBasicASCII(i,s),this.containsRTL=qd.containsRTL(i,this.isBasicASCII,o),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=c}static isBasicASCII(e,t){return!t||rs["z"](e)}static containsRTL(e,t,i){return!(t||!i)&&rs["m"](e)}}class $d{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class Gd{constructor(e,t){this.range=e,this.options=t}}function Yd(e){return Array.isArray(e)}function Xd(e){return!Yd(e)}function Zd(e){return"string"===typeof e}function Qd(e){return!Zd(e)}function Jd(e){return!e}function eh(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function th(e){return e.replace(/[&<>'"_]/g,"-")}function ih(e,t){console.log(`${e.languageId}: ${t}`)}function nh(e,t){return new Error(`${e.languageId}: ${t}`)}function oh(e,t,i,n,o){const s=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return t.replace(s,(function(t,s,a,l,c,d,h,u,g){return Jd(a)?Jd(l)?!Jd(c)&&c0){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}function rh(e,t){let i=t;while(i&&i.length>0){const t=e.stateNames[i];if(t)return!0;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return!1}const ah=5;class lh{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 ch(e,t);let i=ch.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new ch(e,t),this._entries[i]=n,n)}}lh._INSTANCE=new lh(ah);class ch{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";while(null!==e)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){while(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 ch._equals(this,e)}push(e){return lh.create(this,e)}pop(){return this.parent}popall(){let e=this;while(e.parent)e=e.parent;return e}switchTo(e){return lh.create(this.parent,e)}}class dh{constructor(e,t){this.modeId=e,this.state=t}equals(e){return this.modeId===e.modeId&&this.state.equals(e.state)}clone(){let e=this.state.clone();return e===this.state?this:new dh(this.modeId,this.state)}}class hh{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 uh(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new uh(e,t);let i=ch.getStackElementId(e),n=this._entries[i];return n||(n=new uh(e,null),this._entries[i]=n,n)}}hh._INSTANCE=new hh(ah);class uh{constructor(e,t){this.stack=e,this.embeddedModeData=t}clone(){let e=this.embeddedModeData?this.embeddedModeData.clone():null;return e===this.embeddedModeData?this:hh.create(this.stack,this.embeddedModeData)}equals(e){return e instanceof uh&&(!!this.stack.equals(e.stack)&&(null===this.embeddedModeData&&null===e.embeddedModeData||null!==this.embeddedModeData&&null!==e.embeddedModeData&&this.embeddedModeData.equals(e.embeddedModeData)))}}class gh{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 di(e,t,this._language)))}nestedModeTokenize(e,t,i,n){const o=i.modeId,s=i.state,r=Ga.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 hi(this._tokens,e)}}class fh{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 a=0;a{if(o)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i{})}}getInitialState(){let e=lh.create(null,this._lexer.start);return hh.create(e,null)}tokenize(e,t,i,n){let o=new gh,s=this._tokenize(e,t,i,n,o);return o.finalize(s)}tokenize2(e,t,i,n){let o=new fh(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=sh(this._lexer,t.stack.state),!i))throw nh(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,o=!1;for(const s of i){if(!Qd(s.action)||"@pop"!==s.action.nextEmbedded)continue;o=!0;let t=s.regex,i=s.regex.source;if("^(?:"===i.substr(0,4)&&")"===i.substr(i.length-1,1)){let e=(t.ignoreCase?"i":"")+(t.unicode?"u":"");t=new RegExp(i.substr(4,i.length-5),e)}let r=e.search(t);-1===r||0!==r&&s.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,c=i.stack,d=0,h=null,u=!0;while(u||d=a)break;u=!1;let e=this._lexer.tokenizer[m];if(!e&&(e=sh(this._lexer,m),!e))throw nh(this._lexer,"tokenizer state is not defined: "+m);let t=r.substr(d);for(const i of e)if((0===d||!i.matchOnlyAtLineStart)&&(p=t.match(i.regex),p)){_=p[0],b=i.action;break}}if(p||(p=[""],_=""),b||(d=this._lexer.maxStack)throw nh(this._lexer,"maximum tokenizer stack size reached: ["+c.state+","+c.parent.state+",...]");c=c.push(m)}else if("@pop"===b.next){if(c.depth<=1)throw nh(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(v));c=c.pop()}else if("@popall"===b.next)c=c.popall();else{let e=oh(this._lexer,b.next,_,p,m);if("@"===e[0]&&(e=e.substr(1)),!sh(this._lexer,e))throw nh(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(v));c=c.push(e)}}b.log&&"string"===typeof b.log&&ih(this._lexer,this._lexer.languageId+": "+oh(this._lexer,b.log,_,p,m))}if(null===C)throw nh(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(v));const y=i=>{let s=this._modeService.getModeIdForLanguageName(i);s&&(i=s);const r=this._getNestedEmbeddedModeData(i);if(d0)throw nh(this._lexer,"groups cannot be nested: "+this._safeRuleName(v));if(p.length!==C.length+1)throw nh(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(v));let e=0;for(let t=1;te});class wh{static colorizeElement(e,t,i,n){n=n||{};let o=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:"";i.className+=" "+o;let a=e=>{var t;const n=null!==(t=null===vh||void 0===vh?void 0:vh.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n};return this.colorize(t,r||"",s,n).then(a,e=>console.error(e))}static colorize(e,t,i,n){let o=4;n&&"number"===typeof n.tabSize&&(o=n.tabSize),rs["R"](t)&&(t=t.substr(1));let s=rs["P"](t),r=e.getModeId(i);if(!r)return Promise.resolve(yh(s,o));e.triggerMode(r);const a=Ga.get(r);if(a)return Ch(s,o,a);const l=Ga.getPromise(r);return new Promise(l?(e,t)=>{l.then(i=>{Ch(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=Ga.get(r);a?Ch(s,o,a).then(e,t):e(yh(s,o))};n=new Wn,n.cancelAndSet(a,500),i=Ga.onDidChange(e=>{e.changedLanguages.indexOf(r)>=0&&a()})})}static colorizeLine(e,t,i,n,o=4){const s=qd.isBasicASCII(e,t),r=qd.containsRTL(e,s,i);let a=Od(new Dd(!1,!0,e,!1,s,r,0,n,[],o,0,0,0,0,-1,"none",!1,!1,null));return a.html}static colorizeModelLine(e,t,i=4){let n=e.getLineContent(t);e.forceTokenization(t);let o=e.getLineTokens(t),s=o.inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,i)}}function Ch(e,t,i){return new Promise((n,o)=>{const s=()=>{const r=Sh(e,t,i);if(i instanceof mh){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(s,o)}n(r)};s()})}function yh(e,t){let i=[];const n=16793600,o=new Uint32Array(2);o[0]=0,o[1]=n;for(let s=0,r=e.length;s")}return i.join("")}function Sh(e,t,i){let n=[],o=i.getInitialState();for(let s=0,r=e.length;s"),o=a.endState}return n.join("")}var xh;(function(e){e[e["Ignore"]=0]="Ignore",e[e["Info"]=1]="Info",e[e["Warning"]=2]="Warning",e[e["Error"]=3]="Error"})(xh||(xh={})),function(e){const t="error",i="warning",n="warn",o="info";function s(s){return s?rs["r"](t,s)?e.Error:rs["r"](i,s)||rs["r"](n,s)?e.Warning:rs["r"](o,s)?e.Info:e.Ignore:e.Ignore}e.fromValue=s}(xh||(xh={}));var Lh=xh;function kh(e){return!(!e||"function"!==typeof e.getEditorType)&&e.getEditorType()===mr.ICodeEditor}const Eh=Zi("IWorkspaceEditService");function Dh(e){return Ds(e)&&(Boolean(e.newUri)||Boolean(e.oldUri))}function Nh(e){return Ds(e)&&Xt.isUri(e.resource)&&Ds(e.edit)}class Ih{constructor(e){this.metadata=e}static convert(e){return e.edits.map(e=>{if(Nh(e))return new Th(e.resource,e.edit,e.modelVersionId,e.metadata);if(Dh(e))return new Mh(e.oldUri,e.newUri,e.options,e.metadata);throw new Error("Unsupported edit")})}}class Th extends Ih{constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i,this.metadata=n}}class Mh extends Ih{constructor(e,t,i,n){super(n),this.oldResource=e,this.newResource=t,this.options=i,this.metadata=n}}class Oh{constructor(){this.data=new Map}add(e,t){Js(Es(e)),Js(Ds(t)),Js(!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}}const Ah=new Oh,Rh={JSONContribution:"base.contributions.json"};function Ph(e){return e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e}class Fh{constructor(){this._onDidChangeSchema=new Ye,this.schemasById={}}registerSchema(e,t){this.schemasById[Ph(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const Wh=new Fh;Ah.add(Rh.JSONContribution,Wh);const Bh={Configuration:"base.contributions.configuration"},Vh={properties:{},patternProperties:{}},Hh={properties:{},patternProperties:{}},zh={properties:{},patternProperties:{}},Uh={properties:{},patternProperties:{}},Kh={properties:{},patternProperties:{}},jh={properties:{},patternProperties:{}},qh="vscode://schemas/settings/resourceLanguage",$h=Ah.as(Rh.JSONContribution);class Gh{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new Ye,this._onDidUpdateConfiguration=new Ye,this.defaultValues={},this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:o("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={},$h.registerSchema(qh,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)),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}),$h.registerSchema(qh,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=3){i=Ms(e.scope)?i:e.scope;let n=[],o=e.properties;if(o)for(let r in o){if(t&&eu(r)){delete o[r];continue}const e=o[r];this.updatePropertyDefaultValue(r,e),Xh.test(r)?e.scope=void 0:e.scope=Ms(e.scope)?i:e.scope,!o[r].hasOwnProperty("included")||o[r].included?(this.configurationProperties[r]=o[r],!o[r].deprecationMessage&&o[r].markdownDeprecationMessage&&(o[r].deprecationMessage=o[r].markdownDeprecationMessage),n.push(r)):(this.excludedConfigurationProperties[r]=o[r],delete o[r])}let s=e.allOf;if(s)for(let r of s)n.push(...this.validateAndRegisterProperties(r,t,i));return n}getConfigurationProperties(){return this.configurationProperties}registerJSONConfiguration(e){const t=e=>{let i=e.properties;if(i)for(const t in i)this.updateSchema(t,i[t]);let n=e.allOf;n&&n.forEach(t)};t(e)}updateSchema(e,t){switch(Vh.properties[e]=t,t.scope){case 1:Hh.properties[e]=t;break;case 2:zh.properties[e]=t;break;case 6:Uh.properties[e]=t;break;case 3:Kh.properties[e]=t;break;case 4:jh.properties[e]=t;break;case 5:jh.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:o("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:o("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:qh};this.updatePropertyDefaultValue(t,i),Vh.properties[t]=i,Hh.properties[t]=i,zh.properties[t]=i,Uh.properties[t]=i,Kh.properties[t]=i,jh.properties[t]=i}this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i=this.defaultValues[e];Ts(i)&&(i=t.default),Ts(i)&&(i=Qh(t.type)),t.default=i}}const Yh="\\[.*\\]$",Xh=new RegExp(Yh);function Zh(e){return e.substring(1,e.length-1)}function Qh(e){const t=Array.isArray(e)?e[0]:e;switch(t){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const Jh=new Gh;function eu(e){return e.trim()?Xh.test(e)?o("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==Jh.getConfigurationProperties()[e]?o("config.property.duplicate","Cannot register '{0}'. This property is already registered.",e):null:o("config.property.empty","Cannot register an empty property")}Ah.add(Bh.Configuration,Jh);const tu=Object.prototype.hasOwnProperty;function iu(e,t){for(let i in e)if(tu.call(e,i)){const n=t({key:i,value:e[i]},(function(){delete e[i]}));if(!1===n)return}}class nu{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)}}const ou=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new Ye,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus!==e&&(this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus))}},su=Object.hasOwnProperty;class ru{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class au{constructor(){this._values=[]}_read(e){return this._values[e]}_write(e,t){this._values[e]=t}}class lu{static readOptions(e){const t=e,i=new au;for(const n of fe){const e="_never_"===n.name?void 0:t[n.name];i._write(n.id,e)}return i}static validateOptions(e){const t=new m;for(const i of fe)t._write(i.id,i.validate(e._read(i.id)));return t}static computeOptions(e,t){const i=new ru;for(const n of fe)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!==typeof e||"object"!==typeof t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&nc(e,t);for(let i in e)if(!lu._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const o of fe){const s=!lu._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(n=!0)}return n?new f(i):null}}function cu(e){const t=e.wordWrap;!0===t?e.wordWrap="on":!1===t&&(e.wordWrap="off");const i=e.lineNumbers;!0===i?e.lineNumbers="on":!1===i&&(e.lineNumbers="off");const n=e.autoClosingBrackets;!1===n&&(e.autoClosingBrackets="never",e.autoClosingQuotes="never",e.autoSurround="never");const o=e.cursorBlinking;"visible"===o&&(e.cursorBlinking="solid");const s=e.renderWhitespace;!0===s?e.renderWhitespace="boundary":!1===s&&(e.renderWhitespace="none");const r=e.renderLineHighlight;!0===r?e.renderLineHighlight="line":!1===r&&(e.renderLineHighlight="none");const a=e.acceptSuggestionOnEnter;!0===a?e.acceptSuggestionOnEnter="on":!1===a&&(e.acceptSuggestionOnEnter="off");const l=e.tabCompletion;!1===l?e.tabCompletion="off":!0===l&&(e.tabCompletion="onlySnippets");const c=e.suggest;if(c&&"object"===typeof c.filteredTypes&&c.filteredTypes){const e={method:"showMethods",function:"showFunctions",constructor:"showConstructors",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};iu(e,e=>{const t=c.filteredTypes[e.key];!1===t&&(c[e.value]=t)})}const d=e.hover;!0===d?e.hover={enabled:!0}:!1===d&&(e.hover={enabled:!1});const h=e.parameterHints;!0===h?e.parameterHints={enabled:!0}:!1===h&&(e.parameterHints={enabled:!1});const u=e.autoIndent;!0===u?e.autoIndent="full":!1===u&&(e.autoIndent="advanced");const g=e.matchBrackets;!0===g?e.matchBrackets="always":!1===g&&(e.matchBrackets="never")}function du(e){const t=er(e);return cu(t),t}class hu extends We{constructor(e,t){super(),this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new Ye),this.onDidChangeFast=this._onDidChangeFast.event,this.isSimpleWidget=e,this._isDominatedByLongLines=!1,this._computeOptionsMemory=new p,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._rawOptions=du(t),this._readOptions=lu.readOptions(this._rawOptions),this._validatedOptions=lu.validateOptions(this._readOptions),this._register(lr.onDidChangeZoomLevel(e=>this._recomputeOptions())),this._register(ou.onDidChangeTabFocus(e=>this._recomputeOptions()))}observeReferenceElement(e){}updatePixelRatio(){}_recomputeOptions(){const e=this.options,t=this._computeInternalOptions();if(e){const i=lu.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=hr.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:ou.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport};return lu.computeOptions(this._validatedOptions,i)}static _subsetEquals(e,t){for(const i in t)if(su.call(t,i)){const n=t[i],o=e[i];if(o===n)continue;if(Array.isArray(o)&&Array.isArray(n)){if(!nc(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("undefined"===typeof e)return;const t=du(e);hu._subsetEquals(this._rawOptions,t)||(this._rawOptions=nr(this._rawOptions,t||{}),this._readOptions=lu.readOptions(this._rawOptions),this._validatedOptions=lu.validateOptions(this._readOptions),this._recomputeOptions())}setIsDominatedByLongLines(e){this._isDominatedByLongLines=e,this._recomputeOptions()}setMaxLineNumber(e){const t=hu._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;while(e)e=Math.floor(e/10),t++;return t||1}}const uu=Object.freeze({id:"editor",order:5,type:"object",title:o("editorConfigurationTitle","Editor"),scope:5}),gu=Ah.as(Bh.Configuration),fu=Object.assign(Object.assign({},uu),{properties:{"editor.tabSize":{type:"number",default:ge.tabSize,minimum:1,markdownDescription:o("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:ge.insertSpaces,markdownDescription:o("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:ge.detectIndentation,markdownDescription:o("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:ge.trimAutoWhitespace,description:o("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:ge.largeFileOptimizations,description:o("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:o("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[o("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),o("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),o("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:o("wordBasedSuggestionsMode","Controls form what documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[o("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),o("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),o("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:o("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:o("stablePeek","Keep peek editors open even when double clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:o("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"diffEditor.maxComputationTime":{type:"number",default:5e3,description:o("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.renderSideBySide":{type:"boolean",default:!0,description:o("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:!0,description:o("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:!0,description:o("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:!1,description:o("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:"inherit",markdownEnumDescriptions:[o("wordWrap.off","Lines will never wrap."),o("wordWrap.on","Lines will wrap at the viewport width."),o("wordWrap.inherit","Lines will wrap according to the `#editor.wordWrap#` setting.")]}}});function mu(e){return"undefined"!==typeof e.type||"undefined"!==typeof e.anyOf}for(const JF of fe){const e=JF.schema;if("undefined"!==typeof e)if(mu(e))fu.properties["editor."+JF.name]=e;else for(let t in e)su.call(e,t)&&(fu.properties[t]=e[t])}let pu=null;function _u(){return null===pu&&(pu=Object.create(null),Object.keys(fu.properties).forEach(e=>{pu[e]=!0})),pu}function bu(e){const t=_u();return t["editor."+e]||!1}function vu(e){const t=_u();return t["diffEditor."+e]||!1}gu.registerConfiguration(fu);class wu{static insert(e,t){return{range:new li(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}}}const Cu=Zi("configurationService");function yu(e,t){const i=Object.create(null);for(let n in e)Su(i,n,e[n],t);return i}function Su(e,t,i,n){const o=t.split("."),s=o.pop();let r=e;for(let l=0;lconsole.error("Conflict in default settings: "+e))}return e}class Nu{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?ku(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 n of hc([...Object.keys(this.contents),...Object.keys(t)])){let e=this.contents[n],o=t[n];o&&("object"===typeof e&&"object"===typeof o?(e=er(e),this.mergeContents(e,o)):e=o),i[n]=e}return new Nu(i,this.keys,this.overrides)}merge(...e){const t=er(this.contents),i=er(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=>nc(t.identifiers,e.identifiers));t?this.mergeContents(t.contents,e.contents):i.push(er(e))}for(const e of o.keys)-1===n.indexOf(e)&&n.push(e)}return new Nu(t,n,i)}freeze(){return this.isFrozen=!0,this}mergeContents(e,t){for(const i of Object.keys(t))i in e&&Ds(e[i])&&Ds(t[i])?this.mergeContents(e[i],t[i]):e[i]=er(t[i])}checkAndFreeze(e){return this.isFrozen&&!Object.isFrozen(e)?tr(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),Su(this.contents,e,t,e=>{throw new Error(e)})}removeValue(e){this.removeKey(e)&&xu(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 Tu{constructor(e,t,i=new Nu,n=new Nu,o=new gs,s=new Nu,r=new gs,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 gs,this._userConfiguration=null}getValue(e,t,i){const n=this.getConsolidateConfigurationModel(t,i);return n.getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource),n||(n=new Nu,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(Xt.revive(t[0]),this.parseConfigurationModel(t[1])),e),new gs);return new Tu(t,i,new Nu,n,o,new Nu,new gs,!1)}static parseConfigurationModel(e){return new Nu(e.contents,e.keys,e.overrides).freeze()}}class Mu{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 Nu;this.affectedKeys.forEach(e=>s.setValue(e,{})),this.affectedKeysTree=s.contents}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Tu.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!or(n,o)}return!0}return!1}doesAffectedKeysTreeContains(e,t){let i,n=yu({[t]:!0},()=>{});while("object"===typeof n&&(i=Object.keys(n)[0])){if(e=e[i],!e)return!1;n=n[i]}return!0}}class Ou extends We{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 Ye),this._currentChord=null,this._currentChordChecker=new Bn,this._currentChordStatusMessage=null,this._logging=!1}get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:je.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(o("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)}_doDispatch(e,t){let i=!1;if(e.isChord())return console.warn("Unexpected keyboard event mapped to a chord"),!1;const[n]=e.getDispatchParts();if(null===n)return this._log("\\ Keyboard event cannot be dispatched."),i;const s=this._contextKeyService.getContext(t),r=this._currentChord?this._currentChord.keypress:null,a=e.getLabel(),l=this._getResolver().resolve(s,r,n);return this._logService.trace("KeybindingService#dispatch",a,null===l||void 0===l?void 0:l.commandId),l&&l.enterChord?(i=!0,this._enterChordMode(n,a),i):(this._currentChord&&(l&&l.commandId||(this._notificationService.status(o("missing.chord","The key combination ({0}, {1}) is not a command.",this._currentChord.label,a),{hideAfter:1e4}),i=!0)),this._leaveChordMode(),l&&l.commandId&&(l.bubble||(i=!0),"undefined"===typeof 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"})),i)}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class Au{constructor(e,t,i){this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(let n=0,o=e.length;n=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("undefined"===typeof i)return this._map.set(e,[t]),void this._addToLookupMap(t);for(let n=i.length-1;n>=0;n--){let e=i[n];if(e.command===t.command)continue;const o=e.keypressParts.length>1,s=t.keypressParts.length>1;o&&s&&e.keypressParts[1]!==t.keypressParts[1]||Au.whenIsEntirelyIncluded(e.when,t.when)&&this._removeFromLookupMap(e)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);"undefined"===typeof 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("undefined"!==typeof t)for(let i=0,n=t.length;i9===e.type?e.expr:[e];let o=n(i).concat(n(t));for(let s=0;s1&&null!==o.keypressParts[1]?(this._log(`\\ From ${n.length} keybinding entries, matched chord, when: ${Ru(o.when)}, source: ${Pu(o)}.`),{enterChord:!0,leaveChord:!1,commandId:null,commandArgs:null,bubble:!1}):(this._log(`\\ From ${n.length} keybinding entries, matched ${o.command}, when: ${Ru(o.when)}, source: ${Pu(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(Au.contextMatchesRules(e,n.when))return n}return null}static contextMatchesRules(e,t){return!t||t.evaluate(e)}}function Ru(e){return e?""+e.serialize():"no when condition"}function Pu(e){return e.extensionId?e.isBuiltinExtension?"built-in extension "+e.extensionId:"user extension "+e.extensionId:e.isDefault?"built-in":"user"}class Fu{constructor(){this._coreKeybindings=[],this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===s["a"]){if(e&&e.win)return e.win}else if(2===s["a"]){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=Fu.bindToCurrentPlatform(e);if(t&&t.primary){const i=ct(t.primary,s["a"]);i&&this._registerDefaultKeybinding(i,e.id,e.args,e.weight,0,e.when)}if(t&&Array.isArray(t.secondary))for(let i=0,n=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&&Fu._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,o,r){1===s["a"]&&this._assertNoCtrlAlt(e.parts[0],t),this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:r,weight1:n,weight2:o,extensionId:null,isBuiltinExtension:!1}),this._cachedMergedKeybindings=null}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=[].concat(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Vu)),this._cachedMergedKeybindings.slice(0)}}const Wu=new Fu,Bu={EditorModes:"platform.keybindingsRegistry"};function Vu(e,t){return e.weight1!==t.weight1?e.weight1-t.weight1:e.commandt.command?1:e.weight2-t.weight2}Ah.add(Bu.EditorModes,Wu);class Hu{constructor(e,t,i,n,o,s,r){this.resolvedKeybinding=e,this.keypressParts=e?zu(e.getDispatchParts()):[],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 zu(e){let t=[];for(let i=0,n=e.length;ithis._getLabel(e))}getAriaLabel(){return ju.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 gt(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchParts(){return this._parts.map(e=>this._getDispatchPart(e))}}class Gu extends $u{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 at.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":at.toString(e.keyCode)}_getDispatchPart(e){return Gu.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+=at.toString(e.keyCode),t}}const Yu=Zi("notificationService");class Xu{}const Zu=Zi("contextService");class Qu{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}}}var Ju,eg,tg,ig,ng,og,sg,rg,ag;(function(e){e.noSelection=o("noSelection","No selection"),e.singleSelectionRange=o("singleSelectionRange","Line {0}, Column {1} ({2} selected)"),e.singleSelection=o("singleSelection","Line {0}, Column {1}"),e.multiSelectionRange=o("multiSelectionRange","{0} selections ({1} characters selected)"),e.multiSelection=o("multiSelection","{0} selections"),e.emergencyConfOn=o("emergencyConfOn","Now changing the setting `accessibilitySupport` to 'on'."),e.openingDocs=o("openingDocs","Now opening the Editor Accessibility documentation page."),e.readonlyDiffEditor=o("readonlyDiffEditor"," in a read-only pane of a diff editor."),e.editableDiffEditor=o("editableDiffEditor"," in a pane of a diff editor."),e.readonlyEditor=o("readonlyEditor"," in a read-only code editor"),e.editableEditor=o("editableEditor"," in a code editor"),e.changeConfigToOnMac=o("changeConfigToOnMac","To configure the editor to be optimized for usage with a Screen Reader press Command+E now."),e.changeConfigToOnWinLinux=o("changeConfigToOnWinLinux","To configure the editor to be optimized for usage with a Screen Reader press Control+E now."),e.auto_on=o("auto_on","The editor is configured to be optimized for usage with a Screen Reader."),e.auto_off=o("auto_off","The editor is configured to never be optimized for usage with a Screen Reader, which is not the case at this time."),e.tabFocusModeOnMsg=o("tabFocusModeOnMsg","Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."),e.tabFocusModeOnMsgNoKb=o("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."),e.tabFocusModeOffMsg=o("tabFocusModeOffMsg","Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."),e.tabFocusModeOffMsgNoKb=o("tabFocusModeOffMsgNoKb","Pressing Tab in the current editor will insert the tab character. The command {0} is currently not triggerable by a keybinding."),e.openDocMac=o("openDocMac","Press Command+H now to open a browser window with more information related to editor accessibility."),e.openDocWinLinux=o("openDocWinLinux","Press Control+H now to open a browser window with more information related to editor accessibility."),e.outroMsg=o("outroMsg","You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."),e.showAccessibilityHelpAction=o("showAccessibilityHelpAction","Show Accessibility Help")})(Ju||(Ju={})),function(e){e.inspectTokensAction=o("inspectTokens","Developer: Inspect Tokens")}(eg||(eg={})),function(e){e.gotoLineActionLabel=o("gotoLineActionLabel","Go to Line/Column...")}(tg||(tg={})),function(e){e.helpQuickAccessActionLabel=o("helpQuickAccess","Show all Quick Access Providers")}(ig||(ig={})),function(e){e.quickCommandActionLabel=o("quickCommandActionLabel","Command Palette"),e.quickCommandHelp=o("quickCommandActionHelp","Show And Run Commands")}(ng||(ng={})),function(e){e.quickOutlineActionLabel=o("quickOutlineActionLabel","Go to Symbol..."),e.quickOutlineByCategoryActionLabel=o("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")}(og||(og={})),function(e){e.editorViewAccessibleLabel=o("editorViewAccessibleLabel","Editor content"),e.accessibilityHelpMessage=o("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")}(sg||(sg={})),function(e){e.toggleHighContrast=o("toggleHighContrast","Toggle High Contrast Theme")}(rg||(rg={})),function(e){e.bulkEditServiceSummary=o("bulkEditServiceSummary","Made {0} edits in {1} files")}(ag||(ag={}));var lg=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},cg=function(e,t){return function(i,n){t(i,n,e)}},dg=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class hg{constructor(e){this.disposed=!1,this.model=e,this._onDispose=new Ye}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onDispose.fire()}}function ug(e,t,i){return kh(e)?t(e):i(e)}let gg=class{constructor(e){this.modelService=e}setEditor(e){this.editor=e}createModelReference(e){let t=null;return this.editor&&(t=ug(this.editor,t=>this.findModel(t,e),t=>this.findModel(t.getOriginalEditor(),e)||this.findModel(t.getModifiedEditor(),e))),t?Promise.resolve(new Ve(new hg(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}};gg=lg([cg(0,aa)],gg);class fg{show(){return fg.NULL_PROGRESS_RUNNER}showWhile(e,t){return dg(this,void 0,void 0,(function*(){yield e}))}}fg.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class mg{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 pg{info(e){return this.notify({severity:Lh.Info,message:e})}warn(e){return this.notify({severity:Lh.Warning,message:e})}error(e){return this.notify({severity:Lh.Error,message:e})}notify(e){switch(e.severity){case Lh.Error:console.error(e.message);break;case Lh.Warning:console.warn(e.message);break;default:console.log(e.message);break}return pg.NO_OP}status(e,t){return We.None}}pg.NO_OP=new Xu;class _g{constructor(e){this._onWillExecuteCommand=new Ye,this._onDidExecuteCommand=new Ye,this._instantiationService=e}executeCommand(e,...t){const i=zs.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(n){return Promise.reject(n)}}}class bg extends Ou{constructor(e,t,i,n,o,s){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._register(Zn(s,Wo.KEY_DOWN,e=>{let t=new Ln(e),i=this._dispatch(t,t.target);i&&(t.preventDefault(),t.stopPropagation())}))}addDynamicKeybinding(e,t,i,n){const o=ct(t,s["a"]),r=new Fe;return o&&(this._dynamicKeybindings.push({keybinding:o,command:e,when:n,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),r.add(Pe(()=>{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 Hu(s,o.command,o.commandArgs,e,t,null,!1)}else i[n++]=new Hu(void 0,o.command,o.commandArgs,e,t,null,!1)}return i}resolveKeybinding(e){return[new Gu(e,s["a"])]}resolveKeyboardEvent(e){let t=new ht(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new Gu(t,s["a"])}}function vg(e){return e&&"object"===typeof e&&(!e.overrideIdentifier||"string"===typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof Xt)}class wg{constructor(){this._onDidChangeConfiguration=new Ye,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new Tu(new Iu,new Nu)}getValue(e,t){const i="string"===typeof e?e:void 0,n=vg(e)?e:vg(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()};let i=[];for(const n of e){const[e,t]=n;this.getValue(e)!==t&&(this._configuration.updateValue(e,t),i.push(e))}if(i.length>0){const e=new Mu({keys:i,overrides:[]},t,this._configuration);e.source=7,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}}class Cg{constructor(e){this.configurationService=e,this._onDidChangeConfiguration=new Ye,this.configurationService.onDidChangeConfiguration(e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})})}getValue(e,t,i){const n=ai.isIPosition(t)?t:null,o=n?"string"===typeof i?i:void 0:"string"===typeof t?t:void 0;return"undefined"===typeof o?this.configurationService.getValue():this.configurationService.getValue(o)}}let yg=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:s["d"]||s["f"]?"\n":"\r\n"}};yg=lg([cg(0,Cu)],yg);class Sg{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class xg{constructor(){const e=Xt.from({scheme:xg.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new Qu({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}function Lg(e,t,i){if(!t)return;if(!(e instanceof wg))return;let n=[];Object.keys(t).forEach(e=>{bu(e)&&n.push(["editor."+e,t[e]]),i&&vu(e)&&n.push(["diffEditor."+e,t[e]])}),n.length>0&&e.updateValues(n)}xg.SCHEME="inmemory";class kg{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return dg(this,void 0,void 0,(function*(){const t=new Map;for(let o of e){if(!(o instanceof Th))throw new Error("bad edit - only text edits are supported");const e=this._modelService.getModel(o.resource);if(!e)throw new Error("bad edit - model not found");if("number"===typeof o.versionId&&e.getVersionId()!==o.versionId)throw new Error("bad state - model changed in the meantime");let i=t.get(e);i||(i=[],t.set(e,i)),i.push(wu.replaceMove(li.lift(o.textEdit.range),o.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:rs["v"](ag.bulkEditServiceSummary,i,n)}}))}}class Eg{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}}class Dg{constructor(e,t){this._codeEditorService=e,this._container=t,this.onLayout=je.None}get dimension(){return this._dimension||(this._dimension=fo(window.document.body)),this._dimension}get container(){return this._container}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}}i("0678");const Ng=2e4;let Ig,Tg,Mg,Og,Ag;function Rg(e){Ig=document.createElement("div"),Ig.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"),Ig.appendChild(e),e};Tg=t(),Mg=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"),Ig.appendChild(e),e};Og=i(),Ag=i(),e.appendChild(Ig)}function Pg(e){Ig&&(Tg.textContent!==e?(Gn(Mg),Fg(Tg,e)):(Gn(Tg),Fg(Mg,e)))}function Fg(e,t){Gn(e),t.length>Ng&&(t=t.substr(0,Ng)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}i("0556");class Wg{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class Bg{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 s of this._requests){let e;0===s.type&&(e=t),2===s.type&&(e=i),1===s.type&&(e=n),e.appendChild(document.createElement("br"));const r=document.createElement("span");Bg._render(r,s),e.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;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())}}class zg{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}function Ug(){Kg.INSTANCE.clearCache()}class Kg extends We{constructor(){super(),this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._cache=new zg,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearCache(){this._cache=new zg,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=Kg._actualReadConfiguration(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new gr({zoomLevel:tn(),pixelRatio:rn(),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 Wg(e,t);return i.push(o),n&&n.push(o),o}static _actualReadConfiguration(e){const t=[],i=[],n=this.createRequest("n",0,t,i),o=this.createRequest("m",0,t,null),s=this.createRequest(" ",0,t,i),r=this.createRequest("0",0,t,i),a=this.createRequest("1",0,t,i),l=this.createRequest("2",0,t,i),c=this.createRequest("3",0,t,i),d=this.createRequest("4",0,t,i),h=this.createRequest("5",0,t,i),u=this.createRequest("6",0,t,i),g=this.createRequest("7",0,t,i),f=this.createRequest("8",0,t,i),m=this.createRequest("9",0,t,i),p=this.createRequest("→",0,t,i),_=this.createRequest("→",0,t,null),b=this.createRequest("·",0,t,i),v=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),Vg(e,t);const w=Math.max(r.width,a.width,l.width,c.width,d.width,h.width,u.width,g.width,f.width,m.width);let C=e.fontFeatureSettings===F.OFF;const y=i[0].width;for(let L=1,k=i.length;C&&L.001){C=!1;break}}let S=!0;C&&_.width!==y&&(S=!1),_.width>p.width&&(S=!1);const x=nn()>2e3;return new gr({zoomLevel:tn(),pixelRatio:rn(),fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:C,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:S,spaceWidth:s.width,middotWidth:b.width,wsmiddotWidth:v.width,maxDigitWidth:w},x)}}Kg.INSTANCE=new Kg;class jg extends hu{constructor(e,t,i=null,n){super(e,t),this.accessibilityService=n,this._elementSizeObserver=this._register(new Hg(i,t.dimension,()=>this._recomputeOptions())),this._register(Kg.INSTANCE.onDidChange(()=>this._recomputeOptions())),this._validatedOptions.get(9)&&this._elementSizeObserver.startObserving(),this._register(on(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 un||gn||(e+="no-user-select "),un&&(e+="no-minimap-shadow "),s["f"]&&(e+="mac "),e}_getEnvConfiguration(){return{extraEditorClassName:jg._getExtraEditorClassName(),outerWidth:this._elementSizeObserver.getWidth(),outerHeight:this._elementSizeObserver.getHeight(),emptySelectionClipboard:dn||cn,pixelRatio:rn(),zoomLevel:tn(),accessibilitySupport:this.accessibilityService.isScreenReaderOptimized()?2:this.accessibilityService.getAccessibilitySupport()}}readConfiguration(e){return Kg.INSTANCE.readConfiguration(e)}}var qg=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class $g extends We{constructor(e,t="",i="",n=!0,o){super(),this._onDidChange=this._register(new Ye),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 this._actionCallback?this._actionCallback(e):Promise.resolve(!0)}}class Gg extends We{constructor(){super(...arguments),this._onBeforeRun=this._register(new Ye),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Ye),this.onDidRun=this._onDidRun.event}run(e,t){return qg(this,void 0,void 0,(function*(){if(!e.enabled)return Promise.resolve(null);this._onBeforeRun.fire({action:e});try{const i=yield this.runAction(e,t);this._onDidRun.fire({action:e,result:i})}catch(i){this._onDidRun.fire({action:e,error:i})}}))}runAction(e,t){const i=t?e.run(t):e.run();return Promise.resolve(i)}}class Yg extends $g{constructor(e){super(Yg.ID,e,e?"separator text":"separator"),this.checked=!1,this.enabled=!1}}Yg.ID="vs.actions.separator";class Xg{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}dispose(){}get actions(){return this._actions}run(){return qg(this,void 0,void 0,(function*(){}))}}class Zg extends $g{constructor(){super(Zg.ID,o("submenu.empty","(empty)"),void 0,!1)}}Zg.ID="vs.actions.empty";let Qg=s["l"]||"";const Jg=new Map;Jg.set("false",!1),Jg.set("true",!0),Jg.set("isMac",s["f"]),Jg.set("isLinux",s["d"]),Jg.set("isWindows",s["j"]),Jg.set("isWeb",s["i"]),Jg.set("isMacNative",s["f"]&&!s["i"]),Jg.set("isEdge",Qg.indexOf("Edg/")>=0),Jg.set("isFirefox",Qg.indexOf("Firefox")>=0),Jg.set("isChrome",Qg.indexOf("Chrome")>=0),Jg.set("isSafari",Qg.indexOf("Safari")>=0),Jg.set("isIPad",Qg.indexOf("iPad")>=0);const ef=Object.prototype.hasOwnProperty;class tf{static has(e){return rf.create(e)}static equals(e,t){return af.create(e,t)}static regex(e,t){return pf.create(e,t)}static not(e){return hf.create(e)}static and(...e){return bf.create(e)}static or(...e){return vf.create(e)}static deserialize(e,t=!1){if(e)return this._deserializeOrExpression(e,t)}static _deserializeOrExpression(e,t){let i=e.split("||");return vf.create(i.map(e=>this._deserializeAndExpression(e,t)))}static _deserializeAndExpression(e,t){let i=e.split("&&");return bf.create(i.map(e=>this._deserializeOne(e,t)))}static _deserializeOne(e,t){if(e=e.trim(),e.indexOf("!=")>=0){let i=e.split("!=");return df.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("==")>=0){let i=e.split("==");return af.create(i[0].trim(),this._deserializeValue(i[1],t))}if(e.indexOf("=~")>=0){let i=e.split("=~");return pf.create(i[0].trim(),this._deserializeRegexValue(i[1],t))}if(e.indexOf(" in ")>=0){let t=e.split(" in ");return lf.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(e)){const t=e.split(">=");return gf.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(e)){const t=e.split(">");return uf.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(e)){const t=e.split("<=");return mf.create(t[0].trim(),t[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(e)){const t=e.split("<");return ff.create(t[0].trim(),t[1].trim())}return/^\!\s*/.test(e)?hf.create(e.substr(1).trim()):rf.create(e)}static _deserializeValue(e,t){if(e=e.trim(),"true"===e)return!0;if("false"===e)return!1;let i=/^'([^']*)'$/.exec(e);return i?i[1].trim():e}static _deserializeRegexValue(e,t){if(Object(rs["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("/"),n=e.lastIndexOf("/");if(i===n||i<0){if(t)throw new Error(`bad regexp-value '${e}', missing /-enclosure`);return console.warn(`bad regexp-value '${e}', missing /-enclosure`),null}let o=e.slice(i+1,n),s="i"===e[n+1]?"i":"";try{return new RegExp(o,s)}catch(r){if(t)throw new Error(`bad regexp-value '${e}', parse error: ${r}`);return console.warn(`bad regexp-value '${e}', parse error: ${r}`),null}}}function nf(e,t){return e.cmp(t)}class of{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 sf.INSTANCE}}of.INSTANCE=new of;class sf{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 of.INSTANCE}}sf.INSTANCE=new sf;class rf{constructor(e){this.key=e,this.type=2}static create(e){const t=Jg.get(e);return"boolean"===typeof t?t?sf.INSTANCE:of.INSTANCE:new rf(e)}cmp(e){return e.type!==this.type?this.type-e.type:Sf(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 hf.create(this.key)}}class af{constructor(e,t){this.key=e,this.value=t,this.type=4}static create(e,t){if("boolean"===typeof t)return t?rf.create(e):hf.create(e);const i=Jg.get(e);if("boolean"===typeof i){const e=i?"true":"false";return t===e?sf.INSTANCE:of.INSTANCE}return new af(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 df.create(this.key,this.value)}}class lf{constructor(e,t){this.key=e,this.valueKey=t,this.type=10}static create(e,t){return new lf(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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&&ef.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return cf.create(this)}}class cf{constructor(e){this._actual=e,this.type=11}static create(e){return new cf(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 df{constructor(e,t){this.key=e,this.value=t,this.type=5}static create(e,t){if("boolean"===typeof t)return t?hf.create(e):rf.create(e);const i=Jg.get(e);if("boolean"===typeof i){const e=i?"true":"false";return t===e?of.INSTANCE:sf.INSTANCE}return new df(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 af.create(this.key,this.value)}}class hf{constructor(e){this.key=e,this.type=3}static create(e){const t=Jg.get(e);return"boolean"===typeof t?t?of.INSTANCE:sf.INSTANCE:new hf(e)}cmp(e){return e.type!==this.type?this.type-e.type:Sf(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 rf.create(this.key)}}class uf{constructor(e,t){this.key=e,this.value=t,this.type=12}static create(e,t){return new uf(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 mf.create(this.key,this.value)}}class gf{constructor(e,t){this.key=e,this.value=t,this.type=13}static create(e,t){return new gf(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 ff.create(this.key,this.value)}}class ff{constructor(e,t){this.key=e,this.value=t,this.type=14}static create(e,t){return new ff(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:xf(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 _f.create(this)}}class _f{constructor(e){this._actual=e,this.type=8}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 bf{constructor(e){this.expr=e,this.type=6}static create(e){return bf._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=vf.create(e.expr.map(e=>bf.create([e,i])));n&&(t.push(n),t.sort(nf))}return 1===t.length?t[0]:new bf(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 vf.create(e)}}class vf{constructor(e){this.expr=e,this.type=9}static create(e){const t=vf._normalizeArr(e);if(0!==t.length)return 1===t.length?t[0]:new vf(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 i of this.expr)e.push(i.negate());const t=e=>9===e.type?e.expr:[e];while(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(tf.and(e,i));e.unshift(tf.or(...o))}return e[0]}}class wf extends rf{constructor(e,t){super(e),this._defaultValue=t}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return tf.not(this.key)}isEqualTo(e){return tf.equals(this.key,e)}}const Cf=Zi("contextKeyService"),yf="setContext";function Sf(e,t){return et?1:0}function xf(e,t,i,n){return ei?1:tn?1:0}var Lf;(function(e){e["DARK"]="dark",e["LIGHT"]="light",e["HIGH_CONTRAST"]="hc"})(Lf||(Lf={}));const kf=Zi("themeService");var Ef,Df;function Nf(e){return{id:e}}function If(e){switch(e){case Lf.DARK:return"vs-dark";case Lf.HIGH_CONTRAST:return"hc-black";default:return"vs"}}(function(e){function t(e){return e&&"object"===typeof e&&"string"===typeof e.id}e.isThemeColor=t})(Ef||(Ef={})),function(e){function t(e){return e&&"object"===typeof e&&"string"===typeof e.id&&("undefined"===typeof e.color||Ef.isThemeColor(e.color))}e.isThemeIcon=t;const i=/^\$\(([a-z.]+\/)?([a-z-~]+)\)$/i;function n(e){const t=i.exec(e);if(!t)return;let[,n,o]=t;return n&&"codicon/"!==n?{id:n+o}:{id:o}}function o(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}}function s(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.fromString=n,e.modify=o,e.isEqual=s,e.asClassNameArray=_a.asClassNameArray,e.asClassName=_a.asClassName,e.asCSSSelector=_a.asCSSSelector}(Df||(Df={}));const Tf={ThemingContribution:"base.contributions.theming"};class Mf{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Ye}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Pe(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let Of=new Mf;function Af(e){return Of.onColorThemeChange(e)}Ah.add(Tf.ThemingContribution,Of);class Rf extends We{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(){}}var Pf=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},Ff=function(e,t){return function(i,n){t(i,n,e)}};function Wf(e){return void 0!==e.command}class Bf{constructor(e){this.id=Bf._idPool++,this._debugName=e}}Bf._idPool=0,Bf.CommandPalette=new Bf("CommandPalette"),Bf.EditorContext=new Bf("EditorContext"),Bf.EditorContextPeek=new Bf("EditorContextPeek"),Bf.MenubarEditMenu=new Bf("MenubarEditMenu"),Bf.MenubarGoMenu=new Bf("MenubarGoMenu"),Bf.MenubarSelectionMenu=new Bf("MenubarSelectionMenu");const Vf=Zi("menuService"),Hf=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ye,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:e=>e===Bf.CommandPalette}}addCommand(e){return this.addCommands(Ee.single(e))}addCommands(e){for(const t of e)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Pe(()=>{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(Ee.single({id:e,item:t}))}appendMenuItems(e){const t=new Set,i=new ze;for(const{id:n,item:o}of e){let e=this._menuItems.get(n);e||(e=new ze,this._menuItems.set(n,e)),i.push(e.push(o)),t.add(n)}return this._onDidChangeMenu.fire(t),Pe(()=>{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===Bf.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)Wf(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 zf extends Xg{constructor(e,t,i,n){const o=[],s=t.createMenu(e.submenu,i),r=s.getActions(n);s.dispose();for(let a of r){const[,e]=a;e.length>0&&(o.push(...e),o.push(new Yg))}o.length&&o.pop(),super("submenuitem."+e.submenu.id,"string"===typeof e.title?e.title:e.title.value,o,"submenu"),this.item=e}}let Uf=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)}this.item=t,this.alt=i?new e(i,void 0,n,o,s):void 0,this._options=n,Df.isThemeIcon(t.icon)&&(this.class=_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)}};Uf=Pf([Ff(3,Cf),Ff(4,Hs)],Uf);const Kf=Zi("telemetryService");class jf{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?tf.and(e,this.precondition):this.precondition),Wu.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 zs.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){Hf.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 qf extends jf{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((e,t)=>t[0]-e[0]),{dispose:()=>{for(let e=0;e{const i=e.get(Cf);if(i.contextMatchesRules(Vs(this.precondition)))return this.runEditorCommand(e,n,t)})}}class Yf extends Gf{constructor(e){super(Yf.convertOptions(e)),this.label=e.label,this.alias=e.alias}static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=Bf.EditorContext),t.title||(t.title=e.label),t.when=tf.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(Kf).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}function Xf(e){return tm.INSTANCE.registerEditorCommand(e),e}function Zf(e){const t=new e;return tm.INSTANCE.registerEditorAction(t),t}function Qf(e,t){tm.INSTANCE.registerEditorContribution(e,t)}var Jf;(function(e){function t(e){return tm.INSTANCE.getEditorCommand(e)}function i(){return tm.INSTANCE.getEditorActions()}function n(){return tm.INSTANCE.getEditorContributions()}function o(e){return tm.INSTANCE.getEditorContributions().filter(t=>e.indexOf(t.id)>=0)}function s(){return tm.INSTANCE.getDiffEditorContributions()}e.getEditorCommand=t,e.getEditorActions=i,e.getEditorContributions=n,e.getSomeEditorContributions=o,e.getDiffEditorContributions=s})(Jf||(Jf={}));const em={EditorCommonContributions:"editor.contributions"};class tm{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 im(e){return e.register(),e}tm.INSTANCE=new tm,Ah.add(em.EditorCommonContributions,tm.INSTANCE);const nm=im(new qf({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:Bf.MenubarEditMenu,group:"1_do",title:o({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:Bf.CommandPalette,group:"",title:o("undo","Undo"),order:1}]}));im(new $f(nm,{id:"default:undo",precondition:void 0}));const om=im(new qf({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:Bf.MenubarEditMenu,group:"1_do",title:o({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:Bf.CommandPalette,group:"",title:o("redo","Redo"),order:1}]}));im(new $f(om,{id:"default:redo",precondition:void 0}));const sm=im(new qf({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:Bf.MenubarSelectionMenu,group:"1_basic",title:o({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:Bf.CommandPalette,group:"",title:o("selectAll","Select All"),order:1}]}));class rm{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 am(e){return new rm(e)}let lm=0;function cm(){const e="$memoize"+lm++;let t=void 0;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=()=>{"undefined"!==typeof t&&Object.getOwnPropertyNames(t).forEach(i=>{0===i.indexOf(e)&&delete t[i]})},i}function dm(e,t,i){return cm()(e,t,i)}var hm,um=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){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"})(hm||(hm={}));class gm extends We{constructor(){super(),this.dispatched=!1,this.activeTouches={},this.handle=null,this.targets=[],this.ignoreTargets=[],this._lastSetTapCountTime=0,this._register(Zn(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(Zn(document,"touchend",e=>this.onTouchEnd(e))),this._register(Zn(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){return gm.isTouchDevice()?(gm.INSTANCE||(gm.INSTANCE=new gm),gm.INSTANCE.targets.push(e),{dispose:()=>{gm.INSTANCE.targets=gm.INSTANCE.targets.filter(t=>t!==e)}}):We.None}static ignoreTarget(e){return gm.isTouchDevice()?(gm.INSTANCE||(gm.INSTANCE=new gm),gm.INSTANCE.ignoreTargets.push(e),{dispose:()=>{gm.INSTANCE.ignoreTargets=gm.INSTANCE.ignoreTargets.filter(t=>t!==e)}}):We.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,n=e.targetTouches.length;i=gm.HOLD_DELAY&&Math.abs(s.initialPageX-tc(s.rollingPageX))<30&&Math.abs(s.initialPageY-tc(s.rollingPageY))<30){let e=this.newGestureEvent(hm.Contextmenu,s.initialTarget);e.pageX=tc(s.rollingPageX),e.pageY=tc(s.rollingPageY),this.dispatchEvent(e)}else if(1===i){let e=tc(s.rollingPageX),i=tc(s.rollingPageY),n=tc(s.rollingTimestamps)-s.rollingTimestamps[0],o=e-s.rollingPageX[0],r=i-s.rollingPageY[0];const a=this.targets.filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(a,t,Math.abs(o)/n,o>0?1:-1,e,Math.abs(r)/n,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent(hm.End,s.initialTarget)),delete this.activeTouches[o.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===hm.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>gm.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==hm.Change&&e.type!==hm.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,n,o,s,r,a){this.handle=oo(()=>{let l=Date.now(),c=l-t,d=0,h=0,u=!0;i+=gm.SCROLL_FRICTION*c,s+=gm.SCROLL_FRICTION*c,i>0&&(u=!1,d=n*i*c),s>0&&(u=!1,h=r*s*c);let g=this.newGestureEvent(hm.Change);g.translationX=d,g.translationY=h,e.forEach(e=>e.dispatchEvent(g)),u||this.inertia(e,l,i,n,o+d,s,r,a+h)})}onTouchMove(e){let t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}function fm(e,t){let i=new Tn(t);return i.preventDefault(),{leftButton:i.leftButton,buttons:i.buttons,posx:i.posx,posy:i.posy}}gm.SCROLL_FRICTION=-.005,gm.HOLD_DELAY=700,gm.CLEAR_TAP_COUNT_TIME=400,um([dm],gm,"isTouchDevice",null);class mm{constructor(){this._hooks=new Fe,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,n,o){if(this.isMonitoring())return;this._mouseMoveEventMerger=i,this._mouseMoveCallback=n,this._onStopCallback=o;const s=In.getSameOriginWindowChain(),r="mousemove",a="mouseup",l=s.map(e=>e.window.document),c=No(e);c&&l.unshift(c);for(const d of l)this._hooks.add(uo(d,r,e=>{e.buttons===t?this._mouseMoveCallback(e):this.stopMonitoring(!0)},(e,t)=>this._mouseMoveEventMerger(e,t))),this._hooks.add(Zn(d,a,e=>this.stopMonitoring(!0)));if(In.hasDifferentOriginAncestor()){let e=s[s.length-1];this._hooks.add(Zn(e.window.document,"mouseout",e=>{let t=new Tn(e);"html"===t.target.tagName.toLowerCase()&&this.stopMonitoring(!0)})),this._hooks.add(Zn(e.window.document,"mouseover",e=>{let t=new Tn(e);"html"===t.target.tagName.toLowerCase()&&this.stopMonitoring(!0)})),this._hooks.add(Zn(e.window.document.body,"mouseleave",e=>{this.stopMonitoring(!0)}))}}}class pm{constructor(e,t){this.x=e,this.y=t}toClientCoordinates(){return new _m(this.x-vo.scrollX,this.y-vo.scrollY)}}class _m{constructor(e,t){this.clientX=e,this.clientY=t}toPageCoordinates(){return new pm(this.clientX+vo.scrollX,this.clientY+vo.scrollY)}}class bm{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n}}function vm(e){const t=bo(e);return new bm(t.left,t.top,t.width,t.height)}class wm extends Tn{constructor(e,t){super(e),this.pos=new pm(this.posx,this.posy),this.editorPos=vm(t)}}class Cm{constructor(e){this._editorViewDomNode=e}_create(e){return new wm(e,this._editorViewDomNode)}onContextMenu(e,t){return Zn(e,"contextmenu",e=>{t(this._create(e))})}onMouseUp(e,t){return Zn(e,"mouseup",e=>{t(this._create(e))})}onMouseDown(e,t){return Zn(e,"mousedown",e=>{t(this._create(e))})}onMouseLeave(e,t){return to(e,e=>{t(this._create(e))})}onMouseMoveThrottled(e,t,i,n){const o=(e,t)=>i(e,this._create(t));return uo(e,"mousemove",t,o,n)}}class ym{constructor(e){this._editorViewDomNode=e}_create(e){return new wm(e,this._editorViewDomNode)}onPointerUp(e,t){return Zn(e,"pointerup",e=>{t(this._create(e))})}onPointerDown(e,t){return Zn(e,"pointerdown",e=>{t(this._create(e))})}onPointerLeave(e,t){return io(e,e=>{t(this._create(e))})}onPointerMoveThrottled(e,t,i,n){const o=(e,t)=>i(e,this._create(t));return uo(e,"pointermove",t,o,n)}}class Sm extends We{constructor(e){super(),this._editorViewDomNode=e,this._globalMouseMoveMonitor=this._register(new mm),this._keydownListener=null}startMonitoring(e,t,i,n,o){this._keydownListener=eo(document,"keydown",e=>{const t=e.toKeybinding();t.isModifierKey()||this._globalMouseMoveMonitor.stopMonitoring(!0,e.browserEvent)},!0);const s=(e,t)=>i(e,new wm(t,this._editorViewDomNode));this._globalMouseMoveMonitor.startMonitoring(e,t,s,n,e=>{this._keydownListener.dispose(),o(e)})}}class xm extends We{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 Im(n,o),n=a,o=l)}return t[i++]=new Im(n,o),t}static _createHorizontalRangesFromClientRects(e,t){if(!e||0===e.length)return null;const i=[];for(let n=0,o=e.length;nl)return null;if(t=Math.min(l,Math.max(a,t)),n=Math.min(l,Math.max(a,n)),t===n&&i===o&&0===i){const i=e.children[t].getClientRects();return this._createHorizontalRangesFromClientRects(i,s)}t!==n&&n>0&&0===o&&(n--,o=1073741824);let c=e.children[t].firstChild,d=e.children[n].firstChild;if(c&&d||(!c&&0===i&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&0===o&&n>0&&(d=e.children[n-1].firstChild,o=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const h=this._readClientRects(c,i,d,o,r);return this._createHorizontalRangesFromClientRects(h,s)}}const Rm=function(){return!!s["g"]||!(s["d"]||cn||un)}();let Pm=!0;const Fm=ln;class Wm{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 Bm{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(38);this.renderWhitespace=i.get(83),this.renderControlCharacters=i.get(77),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(26),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(53),this.stopRenderingLineAfter=i.get(100),this.fontLigatures=i.get(39)}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 Vm{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=am(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!Fm&&this._options.themeType!==Lf.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=yd.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let a=null;if(Fm||s.themeType===Lf.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 c=Td(l,n);n.appendASCIIString("");let d=null;return Pm&&Rm&&o.isBasicASCII&&s.useMonospaceOptimizations&&0===c.containsForeignElements&&o.content.length<300&&l.lineTokens.getCount()<100&&(d=new Hm(this._renderedViewLine?this._renderedViewLine.domNode:null,l,c.characterMapping)),d||(d=Km(this._renderedViewLine?this._renderedViewLine.domNode:null,l,c.characterMapping,c.containsRTL,c.containsForeignElements)),this._renderedViewLine=d,!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 Hm}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Hm?this._renderedViewLine.monospaceAssumptionsAreValid():Pm}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Hm&&(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 Mm(o,s):null}getColumnOfNodeOffset(e,t,i){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t,i):1}}Vm.CLASS_NAME="view-line";class Hm{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 Pm;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!"),Pm=!1),Pm}toSlowRenderedLine(){return Km(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i){const n=this._getCharPosition(e),o=this._getCharPosition(t);return[new Im(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;while(t)t=t.previousSibling,o++;const s=this._characterMapping.partDataToCharOffset(o,n,i);return s+1}}class zm{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 Im(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 Im(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=Am.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=Nd.getPartIndex(n),s=Nd.getCharIndex(n),r=Am.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 Im(0,this.getWidth())];const o=this._characterMapping.charOffsetToPartData(t-1),s=Nd.getPartIndex(o),r=Nd.getCharIndex(o),a=this._characterMapping.charOffsetToPartData(i-1),l=Nd.getPartIndex(a),c=Nd.getCharIndex(a);return Am.readHorizontalRanges(this._getReadingTarget(e),s,r,l,c,n.clientRectDeltaLeft,n.endNode)}getColumnOfNodeOffset(e,t,i){const n=t.textContent.length;let o=-1;while(t)t=t.previousSibling,o++;const s=this._characterMapping.partDataToCharOffset(o,n,i);return s+1}}class Um extends zm{_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.left0&&(this.changes=Ym(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(ps["f"](e,t?t.length:0,i),i+=4,t)for(const n of t)ps["f"](e,n.selectionStartLineNumber,i),i+=4,ps["f"](e,n.selectionStartColumn,i),i+=4,ps["f"](e,n.positionLineNumber,i),i+=4,ps["f"](e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=ps["c"](e,t);t+=4;for(let o=0;oe.toString()).join(", ")}matchesResource(e){const t=Xt.isUri(this.model)?this.model:this.model.uri;return t.toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Qm}append(e,t,i,n,o){this._data instanceof Qm&&this._data.append(e,t,i,n,o)}close(){this._data instanceof Qm&&(this._data=this._data.serialize())}open(){this._data instanceof Qm||(this._data=Qm.deserialize(this._data))}undo(){if(Xt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Qm&&(this._data=this._data.serialize());const e=Qm.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Xt.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Qm&&(this._data=this._data.serialize());const e=Qm.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Qm&&(this._data=this._data.serialize()),this._data.byteLength+168}}class ep{constructor(e,t){this.type=1,this.label=e,this._isOpen=!0,this._editStackElementsArr=t.slice(0),this._editStackElementsMap=new Map;for(const i of this._editStackElementsArr){const e=Zm(i.resource);this._editStackElementsMap.set(e,i)}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=Zm(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Zm(Xt.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Zm(e.uri);if(this._editStackElementsMap.has(t)){const i=this._editStackElementsMap.get(t);return i.canAppend(e)}return!1}append(e,t,i,n,o){const s=Zm(e.uri),r=this._editStackElementsMap.get(s);r.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=Zm(e);if(this._editStackElementsMap.has(t)){const e=this._editStackElementsMap.get(t);return e.heapSize()}return 0}split(){return this._editStackElementsArr}toString(){let e=[];for(const t of this._editStackElementsArr)e.push(`${xs(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function tp(e){const t=e.getEOL();return"\n"===t?0:1}function ip(e){return!!e&&(e instanceof Jm||e instanceof ep)}class np{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);ip(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);ip(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(ip(t)&&t.canAppend(this._model))return t;const i=new Jm(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],tp(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),s=np._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),tp(this._model),this._model.getAlternativeVersionId(),s),s}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return ve(i),null}}}class op{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function sp(e,t,i,n,o){let s;for(o.spacesDiff=0,o.looksLikeAlignment=!1,s=0;s0&&a>0)return;if(l>0&&c>0)return;let d=Math.abs(a-c),h=Math.abs(r-l);if(0===d)return o.spacesDiff=h,void(h>0&&0<=l-1&&l-10?o++:p>1&&s++,sp(r,a,l,m,h),h.looksLikeAlignment&&(!i||t!==h.spacesDiff))continue;let b=h.spacesDiff;b<=c&&d[b]++,r=l,a=m}let u=i;o!==s&&(u=o{let i=d[t];i>e&&(e=i,g=t)}),4===g&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function ap(e){return(1&e.metadata)>>>0}function lp(e,t){e.metadata=254&e.metadata|t<<0}function cp(e){return(2&e.metadata)>>>1===1}function dp(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function hp(e){return(4&e.metadata)>>>2===1}function up(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function gp(e){return(8&e.metadata)>>>3===1}function fp(e,t){e.metadata=247&e.metadata|(t?1:0)<<3}function mp(e){return(48&e.metadata)>>>4}function pp(e,t){e.metadata=207&e.metadata|t<<4}function _p(e){return(64&e.metadata)>>>6===1}function bp(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}class vp{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,lp(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,up(this,!1),pp(this,1),fp(this,!1),bp(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,dp(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;up(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),pp(this,this.options.stickiness),fp(this,!(!this.options.overviewRuler||!this.options.overviewRuler.color)),bp(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 wp=new vp(null,0,0);wp.parent=wp,wp.left=wp,wp.right=wp,lp(wp,0);class Cp{constructor(){this.root=wp,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,o){return this.root===wp?[]:Ip(this,e,t,i,n,o)}search(e,t,i){return this.root===wp?[]:Np(this,e,t,i)}collectNodesFromOwner(e){return Ep(this,e)}collectNodesPostOrder(){return Dp(this)}insert(e){Tp(this,e),this._normalizeDeltaIfNecessary()}delete(e){Op(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;while(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=Lp(this,e,e+t);for(let s=0,r=o.length;si)&&(1!==n&&(2===n||t))}function xp(e,t,i,n,o){const s=mp(e),r=0===s||2===s,a=1===s||2===s,l=i-t,c=n,d=Math.min(l,c),h=e.start;let u=!1;const g=e.end;let f=!1;t<=h&&g<=i&&_p(e)&&(e.start=t,u=!0,e.end=t,f=!0);{const e=o?1:l>0?2:0;!u&&Sp(h,r,t,e)&&(u=!0),!f&&Sp(g,a,t,e)&&(f=!0)}if(d>0&&!o){const e=l>c?2:0;!u&&Sp(h,r,t+d,e)&&(u=!0),!f&&Sp(g,a,t+d,e)&&(f=!0)}{const n=o?1:0;!u&&Sp(h,r,i,n)&&(e.start=t+c,u=!0),!f&&Sp(g,a,i,n)&&(e.end=t+c,f=!0)}const m=c-l;u||(e.start=Math.max(0,h+m)),f||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function Lp(e,t,i){let n=e.root,o=0,s=0,r=0,a=0,l=[],c=0;while(n!==wp)if(cp(n))dp(n.left,!1),dp(n.right,!1),n===n.parent.right&&(o-=n.parent.delta),n=n.parent;else{if(!cp(n.left)){if(s=o+n.maxEnd,si?dp(n,!0):(a=o+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[c++]=n),dp(n,!0),n.right===wp||cp(n.right)||(o+=n.delta,n=n.right))}return dp(e.root,!1),l}function kp(e,t,i,n){let o=e.root,s=0,r=0,a=0;const l=n-(i-t);while(o!==wp)if(cp(o))dp(o.left,!1),dp(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),Bp(o),o=o.parent;else{if(!cp(o.left)){if(r=s+o.maxEnd,ri?(o.start+=l,o.end+=l,o.delta+=l,(o.delta<-1073741824||o.delta>1073741824)&&(e.requestNormalizeDelta=!0),dp(o,!0)):(dp(o,!0),o.right===wp||cp(o.right)||(s+=o.delta,o=o.right))}dp(e.root,!1)}function Ep(e,t){let i=e.root,n=[],o=0;while(i!==wp)cp(i)?(dp(i.left,!1),dp(i.right,!1),i=i.parent):i.left===wp||cp(i.left)?(i.ownerId===t&&(n[o++]=i),dp(i,!0),i.right===wp||cp(i.right)||(i=i.right)):i=i.left;return dp(e.root,!1),n}function Dp(e){let t=e.root,i=[],n=0;while(t!==wp)cp(t)?(dp(t.left,!1),dp(t.right,!1),t=t.parent):t.left===wp||cp(t.left)?t.right===wp||cp(t.right)?(i[n++]=t,dp(t,!0)):t=t.right:t=t.left;return dp(e.root,!1),i}function Np(e,t,i,n){let o=e.root,s=0,r=0,a=0,l=[],c=0;while(o!==wp){if(cp(o)){dp(o.left,!1),dp(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==wp&&!cp(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&&hp(o)&&(e=!1),e&&(l[c++]=o),dp(o,!0),o.right===wp||cp(o.right)||(s+=o.delta,o=o.right)}return dp(e.root,!1),l}function Ip(e,t,i,n,o,s){let r=e.root,a=0,l=0,c=0,d=0,h=[],u=0;while(r!==wp)if(cp(r))dp(r.left,!1),dp(r.right,!1),r===r.parent.right&&(a-=r.parent.delta),r=r.parent;else{if(!cp(r.left)){if(l=a+r.maxEnd,li)dp(r,!0);else{if(d=a+r.end,d>=t){r.setCachedOffsets(c,d,s);let e=!0;n&&r.ownerId&&r.ownerId!==n&&(e=!1),o&&hp(r)&&(e=!1),e&&(h[u++]=r)}dp(r,!0),r.right===wp||cp(r.right)||(a+=r.delta,r=r.right)}}return dp(e.root,!1),h}function Tp(e,t){if(e.root===wp)return t.parent=wp,t.left=wp,t.right=wp,lp(t,0),e.root=t,e.root;Mp(e,t),Vp(t.parent);let i=t;while(i!==e.root&&1===ap(i.parent))if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===ap(t)?(lp(i.parent,0),lp(t,0),lp(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,Pp(e,i)),lp(i.parent,0),lp(i.parent.parent,1),Fp(e,i.parent.parent))}else{const t=i.parent.parent.left;1===ap(t)?(lp(i.parent,0),lp(t,0),lp(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,Fp(e,i)),lp(i.parent,0),lp(i.parent.parent,1),Pp(e,i.parent.parent))}return lp(e.root,0),t}function Mp(e,t){let i=0,n=e.root;const o=t.start,s=t.end;while(1){const e=Hp(o,s,n.start+i,n.end+i);if(e<0){if(n.left===wp){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===wp){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}}t.parent=n,t.left=wp,t.right=wp,lp(t,1)}function Op(e,t){let i,n;if(t.left===wp?(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===wp?(i=t.left,n=t):(n=Ap(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,lp(i,0),t.detach(),Rp(),Bp(i),void(e.root.parent=wp);let o,s=1===ap(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,lp(n,ap(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==wp&&(n.left.parent=n),n.right!==wp&&(n.right.parent=n)),t.detach(),s)return Vp(i.parent),n!==t&&(Vp(n),Vp(n.parent)),void Rp();Vp(i),Vp(i.parent),n!==t&&(Vp(n),Vp(n.parent));while(i!==e.root&&0===ap(i))i===i.parent.left?(o=i.parent.right,1===ap(o)&&(lp(o,0),lp(i.parent,1),Pp(e,i.parent),o=i.parent.right),0===ap(o.left)&&0===ap(o.right)?(lp(o,1),i=i.parent):(0===ap(o.right)&&(lp(o.left,0),lp(o,1),Fp(e,o),o=i.parent.right),lp(o,ap(i.parent)),lp(i.parent,0),lp(o.right,0),Pp(e,i.parent),i=e.root)):(o=i.parent.left,1===ap(o)&&(lp(o,0),lp(i.parent,1),Fp(e,i.parent),o=i.parent.left),0===ap(o.left)&&0===ap(o.right)?(lp(o,1),i=i.parent):(0===ap(o.left)&&(lp(o.right,0),lp(o,1),Pp(e,o),o=i.parent.left),lp(o,ap(i.parent)),lp(i.parent,0),lp(o.left,0),Fp(e,i.parent),i=e.root));lp(i,0),Rp()}function Ap(e){while(e.left!==wp)e=e.left;return e}function Rp(){wp.parent=wp,wp.delta=0,wp.start=0,wp.end=0}function Pp(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!==wp&&(i.left.parent=t),i.parent=t.parent,t.parent===wp?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,Bp(t),Bp(i)}function Fp(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!==wp&&(i.right.parent=t),i.parent=t.parent,t.parent===wp?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,Bp(t),Bp(i)}function Wp(e){let t=e.end;if(e.left!==wp){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==wp){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function Bp(e){e.maxEnd=Wp(e)}function Vp(e){while(e!==wp){const t=Wp(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function Hp(e,t,i,n){return e===i?t-n:e-i}class zp{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!==Up)return Kp(this.right);let e=this;while(e.parent!==Up){if(e.parent.left===e)break;e=e.parent}return e.parent===Up?Up:e.parent}prev(){if(this.left!==Up)return jp(this.left);let e=this;while(e.parent!==Up){if(e.parent.right===e)break;e=e.parent}return e.parent===Up?Up:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Up=new zp(null,0);function Kp(e){while(e.left!==Up)e=e.left;return e}function jp(e){while(e.right!==Up)e=e.right;return e}function qp(e){return e===Up?0:e.size_left+e.piece.length+qp(e.right)}function $p(e){return e===Up?0:e.lf_left+e.piece.lineFeedCnt+$p(e.right)}function Gp(){Up.parent=Up}function Yp(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!==Up&&(i.left.parent=t),i.parent=t.parent,t.parent===Up?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function Xp(e,t){let i=t.left;t.left=i.right,i.right!==Up&&(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===Up?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function Zp(e,t){let i,n;if(t.left===Up?(n=t,i=n.right):t.right===Up?(n=t,i=n.left):(n=Kp(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),Gp(),void(e.root.parent=Up);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,e_(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,e_(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!==Up&&(n.left.parent=n),n.right!==Up&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,e_(e,n)),t.detach(),i.parent.left===i){let t=qp(i),n=$p(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,Jp(e,i.parent,o,s)}}if(e_(e,i.parent),s)Gp();else{while(i!==e.root&&0===i.color)i===i.parent.left?(o=i.parent.right,1===o.color&&(o.color=0,i.parent.color=1,Yp(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,Xp(e,o),o=i.parent.right),o.color=i.parent.color,i.parent.color=0,o.right.color=0,Yp(e,i.parent),i=e.root)):(o=i.parent.left,1===o.color&&(o.color=0,i.parent.color=1,Xp(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,Yp(e,o),o=i.parent.left),o.color=i.parent.color,i.parent.color=0,o.left.color=0,Xp(e,i.parent),i=e.root));i.color=0,Gp()}}function Qp(e,t){e_(e,t);while(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&&(t=t.parent,Yp(e,t)),t.parent.color=0,t.parent.parent.color=1,Xp(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&&(t=t.parent,Xp(e,t)),t.parent.color=0,t.parent.parent.color=1,Yp(e,t.parent.parent))}e.root.color=0}function Jp(e,t,i,n){while(t!==e.root&&t!==Up)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function e_(e,t){let i=0,n=0;if(t!==e.root){if(0===i){while(t!==e.root&&t===t.parent.right)t=t.parent;if(t===e.root)return;t=t.parent,i=qp(t.left)-t.size_left,n=$p(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n}while(t!==e.root&&(0!==i||0!==n))t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}Up.parent=Up,Up.left=Up,Up.right=Up,Up.color=0;class t_ extends Bc{constructor(e){super(0);for(let t=0,i=e.length;t(t.hasOwnProperty(i)||(t[i]=e(i)),t[i])}const n_=i_(e=>new t_(e)),o_=999;class s_{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?r_(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=rs["p"](this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(n){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new a_(t,this.wordSeparators?n_(this.wordSeparators):null,i?this.searchString:null)}}function r_(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}class a_{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}function l_(e,t,i){if(!i)return new vr(e,null);let n=[];for(let o=0,s=t.length;o>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class d_{static findMatches(e,t,i,n,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new f_(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),t=e-l;a=r+s.length+t}else a=r+s.length;const c=e.getPositionAt(r),d=e.getPositionAt(a);return new li(c.lineNumber,c.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 c_(r):null,l=[];let c,d=0;i.reset(0);while(c=i.next(r))if(l[d++]=l_(this._getMultilineMatchRange(e,s,r,a,c.index,c[0]),c,n),d>=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 l=t.startLineNumber+1;l=a))return o;return o}const c=new f_(e.wordSeparators,e.regex);let d;c.reset(0);do{if(d=c.next(t),d&&(s[o++]=l_(new li(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 f_(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 ai(t.lineNumber,1),s=e.getOffsetAt(o),r=e.getLineCount(),a=e.getValueInRange(new li(o.lineNumber,o.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new c_(a):null;i.reset(t.column-1);let c=i.next(a);return c?l_(this._getMultilineMatchRange(e,s,a,l,c.index,c[0]),c,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new ai(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 l=1;l<=o;l++){const t=(s+l-1)%o,r=e.getLineContent(t+1),a=this._findFirstMatchInLine(i,r,t+1,1,n);if(a)return a}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const s=e.next(t);return s?l_(new li(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 f_(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 li(1,1,t.lineNumber,t.column),i,n,10*o_);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 ai(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 l=1;l<=o;l++){const t=(o+s-l-1)%o,r=e.getLineContent(t+1),a=this._findLastMatchInLine(i,r,t+1,n);if(a)return a}return null}static _findLastMatchInLine(e,t,i,n){let o,s=null;e.reset(0);while(o=e.next(t))s=l_(new li(i,o.index+1,i,o.index+1+o[0].length),o,n);return s}}function h_(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}function u_(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}function g_(e,t,i,n,o){return h_(e,t,i,n,o)&&u_(e,t,i,n,o)}class f_{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){rs["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||g_(this._wordSeparators,e,t,n,o))return i}while(i);return null}}const m_=65535;function p_(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class __{constructor(e,t,i,n,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=o}}function b_(e,t=!0){let i=[0],n=1;for(let o=0,s=e.length;o126)&&(r=!1)}const a=new __(p_(e),n,o,s,r);return e.length=0,a}class w_{constructor(e,t,i,n,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=o}}class C_{constructor(e,t){this.buffer=e,this.lineStarts=t}}class y_{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Up&&e.iterate(e.root,e=>(e!==Up&&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 S_{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 x_{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new C_("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Up,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let o=0,s=e.length;o0){e[o].lineStarts||(e[o].lineStarts=b_(e[o].buffer));let t=new w_(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),n=this.rbInsertRight(n,t)}this._searchCache=new S_(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=m_,i=t-Math.floor(t/3),n=2*i,o="",s=0,r=[];if(this.iterate(this.root,t=>{let a=this.getNodeContent(t),l=a.length;if(s<=i||s+l0){let t=o.replace(/\r\n|\r|\n/g,e);r.push(new C_(t,b_(t)))}this.create(r,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new y_(this,e)}getOffsetAt(e,t){let i=0,n=this.root;while(n!==Up)if(n.left!==Up&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;let o=this.getAccumulatedValue(n,e-n.lf_left-2);return i+(o+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;while(t!==Up)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=this.getOffsetAt(i+1,1),t=n-e;return new ai(i+1,t+1)}return new ai(i+1,o.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Up){let t=this.getOffsetAt(i+1,1),o=n-e-t;return new ai(i+1,o+1)}t=t.right}return new ai(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);i=i.next();while(i!==Up){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===Up)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,c=s.start.line,d=s.end.line;let h=l[c]+s.start.column;if(n&&(10===a.charCodeAt(h)&&(h++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(c===d)return this._EOLNormalized||13!==a.charCodeAt(h+r-1)?i+=a.substr(h,r):(n=!0,i+=a.substr(h,r-1)),!0;i+=this._EOLNormalized?a.substring(h,Math.max(h,l[c+1]-this._EOLLength)):a.substring(h,l[c+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=c+1;ne+p,t.reset(0)):(u=f.buffer,g=e=>e,t.reset(p));do{if(h=t.next(u),h){if(g(h.index)>=_)return c;this.positionInBuffer(e,g(h.index)-m,b);let t=this.getLineFeedCnt(e.piece.bufferIndex,o,b),s=b.line===o.line?b.column-o.column+n:b.column+1,r=s+h[0].length;if(d[c++]=l_(new li(i+t,s,i+t,r),h,a),g(h.index)+h[0].length>=_)return c;if(c>=l)return c}}while(h);return c}findMatchesLineByLine(e,t,i,n){const o=[];let s=0;const r=new f_(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 c=this.positionInBuffer(a.node,a.remainder),d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,c,d,t,i,n,s,o),o;let h=e.startLineNumber,u=a.node;while(u!==l.node){let l=this.getLineFeedCnt(u.piece.bufferIndex,c,u.piece.end);if(l>=1){let a=this._buffers[u.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[c.line+l],f=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(u,r,h,f,c,this.positionInBuffer(u,g-d),t,i,n,s,o),s>=n)return o;h+=l}let d=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const a=this.getLineContent(h).substring(d,e.endColumn-1);return s=this._findMatchesInLine(t,r,a,e.endLineNumber,d,s,o,i,n),o}if(s=this._findMatchesInLine(t,r,this.getLineContent(h).substr(d),h,d,s,o,i,n),s>=n)return o;h++,a=this.nodeAt2(h,1),u=a.node,c=this.positionInBuffer(a.node,a.remainder)}if(h===e.endLineNumber){let a=h===e.startLineNumber?e.startColumn-1:0;const l=this.getLineContent(h).substring(a,e.endColumn-1);return s=this._findMatchesInLine(t,r,l,e.endLineNumber,a,s,o,i,n),o}let g=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(l.node,r,h,g,c,d,t,i,n,s,o),o}_findMatchesInLine(e,t,i,n,o,s,r,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=i.length;let h=-a;while(-1!==(h=i.indexOf(t,h+a)))if((!c||g_(c,i,d,h,a))&&(r[s++]=new vr(new li(n,h+1+o,n,h+1+a+o),null),s>=l))return s;return s}let d;t.reset(0);do{if(d=t.next(i),d&&(r[s++]=l_(new li(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!==Up){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 w_(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)){let e=this.nodeCharCodeAt(i,n);if(10===e){let e={line:o.start.line+1,column:0};o=new w_(o.bufferIndex,e,o.end,this.getLineFeedCnt(o.bufferIndex,e,o.end),o.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){let o=this.nodeCharCodeAt(i,n-1);if(13===o){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 c=i;for(let t=0;t=0;s--)o=this.rbInsertLeft(o,n[s]);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 s=1;s=h))break;l=d+1}}return i?(i.line=d,i.column=a-u,null):{line:d,column:a-u}}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,a=this._buffers[e].buffer;return 13===a.charCodeAt(r)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){let i=this._buffers[e].lineStarts;return i[t.line]+t.column}deleteNodes(e){for(let t=0;tm_){let t=[];while(e.length>m_){const i=e.charCodeAt(m_-1);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,m_-1),e=e.substring(m_-1)):(n=e.substring(0,m_),e=e.substring(m_));let o=b_(n);t.push(new w_(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 C_(n,o))}let i=b_(e);return t.push(new w_(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 C_(e,i)),t}let t=this._buffers[0].buffer.length;const i=b_(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}}i=i.next();while(i!==Up){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;while(e!==Up)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,c=r-o,d=i.length+c;e.piece=new w_(i.bufferIndex,i.start,s,a,d),Jp(this,e,c,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=this.offsetInBuffer(i.bufferIndex,s),l=r-n,c=o-a,d=i.length+c;e.piece=new w_(i.bufferIndex,s,i.end,r,d),Jp(this,e,c,l)}shrinkNode(e,t,i){const n=e.piece,o=n.start,s=n.end,r=n.length,a=n.lineFeedCnt,l=t,c=this.getLineFeedCnt(n.bufferIndex,n.start,l),d=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,o);e.piece=new w_(n.bufferIndex,n.start,l,c,d),Jp(this,e,d-r,c-a);let h=new w_(n.bufferIndex,i,s,this.getLineFeedCnt(n.bufferIndex,i,s),this.offsetInBuffer(n.bufferIndex,s)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,h);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=b_(t,!1);for(let u=0;ue)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;while(i!==Up)if(i.left!==Up&&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}i=i.next();while(i!==Up){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){let e=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:e}}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;while(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===Up||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;if(n===i.length-1)return!1;let s=i[n+1];return!(s>o+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(o)}endWithCR(e){return"string"===typeof e?13===e.charCodeAt(e.length-1):e!==Up&&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 w_(e.piece.bufferIndex,e.piece.start,i,r,s),Jp(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,c=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new w_(t.piece.bufferIndex,a,t.piece.end,c,l),Jp(this,t,-1,-1),0===t.piece.length&&n.push(t);let d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let h=0;h>>0}const E_=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],n=i.startLineNumber+i.tokens.length-1;if(n+1===e)return void i.tokens.push(t)}this.tokens.push(new M_(e,[t]))}}class N_{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;ie)){let o=n;while(o>t&&this._getDeltaLine(o-1)===e)o--;let s=n;while(se||d===e&&u>=t)&&(de||r===e&&g>=t){if(ro?f-=o-i:f=i;else if(u===t&&g===i){if(!(u===n&&f>o)){c=!0;continue}f-=o-i}else if(uo)){c=!0;continue}u===t?(g=i,f=g+(f-o)):(g=0,f=g+(f-o))}else if(u>n){if(0===a&&!c){l=r;break}u-=a}else{if(!(u===n&&g>=o))throw new Error("Not possible!");e&&0===u&&(g+=e,f+=e),u-=a,g-=o-i,f-=o-i}const p=4*l;s[p]=u,s[p+1]=g,s[p+2]=f,s[p+3]=m,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 c=0;c0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,o){this._acceptDeleteRange(e),this._acceptInsertText(new ai(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;if(s<0)return void(this.startLineNumber+=t);const r=this.tokens.getMaxDeltaLine();s>=r+1||this.tokens.acceptInsertText(s,e.column-1,t,i,n,o)}}class M_{constructor(e,t){this.startLineNumber=e,this.tokens=t}}function O_(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class A_{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 n=null;for(let o=0,s=this._pieces.length;oi.endLineNumber){n=n||{index:o};break}if(e.removeTokens(i),e.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(e.endLineNumberi.endLineNumber){n=n||{index:o};continue}const[t,r]=e.split(i);t.isEmpty()?n=n||{index:o}:r.isEmpty()||(this._pieces.splice(o,1,t,r),o++,s++,n=n||{index:o})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=mc(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSemanticTokens(e,t){const i=this._pieces;if(0===i.length)return t;const n=A_._findFirstPieceWithLine(i,e),o=i[n].getLineTokens(e);if(!o)return t;const s=t.getCount(),r=o.getCount();let a=0,l=[],c=0,d=0;const h=(e,t)=>{e!==d&&(d=e,l[c++]=e,l[c++]=t)};for(let u=0;u>>0,l=~r>>>0;while(at)){while(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 R_{constructor(){this._lineTokens=[],this._len=0}flush(){this._lineTokens=[],this._len=0}getTokens(e,t,i){let n=null;if(t1&&(t=va.getLanguageId(n[1])!==e),!t)return E_}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=k_(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){while(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 n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=R_._delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=R_._deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len||(0!==t?(this._lineTokens[n]=R_._deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=R_._insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=R_._insert(this._lineTokens[n],e.column-1,i))}static _deleteBeginning(e,t){return null===e||e===E_?e:R_._delete(e,0,t)}static _deleteEnding(e,t){if(null===e||e===E_)return e;const i=O_(e),n=i[i.length-2];return R_._delete(e,t,n)}static _delete(e,t,i){if(null===e||e===E_||t===i)return e;const n=O_(e),o=n.length>>>1;if(0===t&&n[n.length-2]===i)return E_;const s=wd.findIndexInTokensArray(n,t),r=s>0?n[s-1<<1]:0,a=n[s<<1];if(ic&&(n[l++]=e,n[l++]=n[1+(u<<1)],c=e)}if(l===n.length)return e;let h=new Uint32Array(l);return h.set(n.subarray(0,l),0),h.buffer}static _append(e,t){if(t===E_)return e;if(e===E_)return t;if(null===e)return e;if(null===t)return null;const i=O_(e),n=O_(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 l=0;l>>1;let s=wd.findIndexInTokensArray(n,t);if(s>0){const e=n[s-1<<1];e===t&&s--}for(let r=s;re.sortIndex-t.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const u=this._doApplyEdits(a);let g=null;if(t&&d.length>0){d.sort((e,t)=>t.lineNumber-e.lineNumber),g=[];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===rs["u"](n)&&g.push(t)}}return this._onDidChangeContent.fire(),new Cr(h,u,g)}_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 li(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let s=i.startLineNumber,r=i.startColumn;const a=[];for(let u=0,g=e.length;u0&&a.push(i.text),s=n.endLineNumber,r=n.endColumn}const l=a.join(""),[c,d,h]=L_(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:c,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(P_._sortOpsDescending);let t=[];for(let i=0;i0){const e=c.eolCount+1;l=1===e?new li(r,a,r,a+c.firstLineLength):new li(r,a,r+e-1,c.lastLineLength+1)}else l=new li(r,a,r,a);i=l.endLineNumber,n=l.endColumn,t.push(l),o=c}return t}static _sortOpsAscending(e,t){let i=li.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=li.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class F_{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 o=0,s=i.length;o=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=v_(this._tmpLineStarts,e);this.chunks.push(new C_(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=rs["m"](e)),this.isBasicASCII||this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=rs["n"](e))}finish(e=!0){return this._finish(),new F_(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=b_(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}class B_{constructor(){this.changeType=1}}class V_{constructor(e,t){this.changeType=2,this.lineNumber=e,this.detail=t}}class H_{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class z_{constructor(e,t,i){this.changeType=4,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class U_{constructor(){this.changeType=5}}class K_{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 o=0;o=0;s--)this._invalidateLine(e.startLineNumber+s-1);this._acceptDeleteRange(e),this._acceptInsertText(new ai(e.startLineNumber,e.startColumn),t)}_acceptDeleteRange(e){const t=e.startLineNumber-1;t>=this._len||this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){const i=e.lineNumber-1;i>=this._len||this._insertLines(e.lineNumber,t)}}class $_ extends We{constructor(e){super(),this._isDisposed=!1,this._textModel=e,this._tokenizationStateStore=new q_,this._tokenizationSupport=null,this._register(Ga.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]=G_(this._textModel);this._tokenizationSupport=e,this._tokenizationStateStore.flush(t),this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&s["k"](()=>{this._isDisposed||this._revalidateTokensNow()})}_revalidateTokensNow(e=this._textModel.getLineCount()){const t=1,i=new D_,n=Ke.create(!1);while(this._hasLinesToTokenize()){if(n.elapsed()>t)break;const o=this._tokenizeOneInvalidLine(i);if(o>=e)break}this._beginBackgroundTokenization(),this._textModel.setTokens(i.tokens)}tokenizeViewport(e,t){const i=new D_;this._tokenizeViewport(i,e,t),this._textModel.setTokens(i.tokens)}reset(){this._resetTokenizationState(),this._textModel.clearTokens()}forceTokenization(e){const t=new D_;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&&l>=1;l--){let e=this._textModel.getLineFirstNonWhitespaceColumn(l);if(0!==e&&e=0;l--){let e=Y_(r,this._tokenizationSupport,o[l],!1,a);a=e.endState}for(let l=t;l<=i;l++){let t=this._textModel.getLineContent(l),i=Y_(r,this._tokenizationSupport,t,!0,a);e.add(l,i.tokens),this._tokenizationStateStore.setFakeTokens(l-1),a=i.endState}}}function G_(e){const t=e.getLanguageIdentifier();let i=e.isTooLargeForTokenization()?null:Ga.get(t.language),n=null;if(i)try{n=i.getInitialState()}catch(o){ve(o),i=null}return[i,n]}function Y_(e,t,i,n,o){let s=null;if(t)try{s=t.tokenize2(i,n,o.clone(),0)}catch(r){ve(r)}return s||(s=el(e.id,i,o,0)),wd.convertToEndOffset(s.tokens,i.length),s}function X_(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}class Z_{constructor(e,t,i,n=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=X_(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class Q_{constructor(e,t,i,n){this.h=0|Math.max(Math.min(360,e),0),this.s=X_(Math.max(Math.min(1,t),0),3),this.l=X_(Math.max(Math.min(1,i),0),3),this.a=X_(Math.max(Math.min(1,n),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,s=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const c=(r+s)/2,d=s-r;if(d>0){switch(l=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),s){case t:a=(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:o}=e;let s,r,a;if(0===i)s=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,o=2*n-e;s=Q_._hue2rgb(o,e,t+1/3),r=Q_._hue2rgb(o,e,t),a=Q_._hue2rgb(o,e,t-1/3)}return new Z_(Math.round(255*s),Math.round(255*r),Math.round(255*a),o)}}class J_{constructor(e,t,i,n){this.h=0|Math.max(Math.min(360,e),0),this.s=X_(Math.max(Math.min(1,t),0),3),this.v=X_(Math.max(Math.min(1,i),0),3),this.a=X_(Math.max(Math.min(1,n),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=Math.min(t,i,n),r=o-s,a=0===o?0:r/o;let l;return l=0===r?0:o===t?((i-n)/r%6+6)%6:o===i?(n-t)/r+2:(t-i)/r+4,new J_(Math.round(60*l),a,o,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:o}=e,s=n*i,r=s*(1-Math.abs(t/60%2-1)),a=n-s;let[l,c,d]=[0,0,0];return t<60?(l=s,c=r):t<120?(l=r,c=s):t<180?(c=s,d=r):t<240?(c=r,d=s):t<300?(l=r,d=s):t<=360&&(l=s,d=r),l=Math.round(255*(l+a)),c=Math.round(255*(c+a)),d=Math.round(255*(d+a)),new Z_(l,c,d,o)}}class eb{constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof Z_)this.rgba=e;else if(e instanceof Q_)this._hsla=e,this.rgba=Q_.toRGBA(e);else{if(!(e instanceof J_))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=J_.toRGBA(e)}}static fromHex(e){return eb.Format.CSS.parseHex(e)||eb.red}get hsla(){return this._hsla?this._hsla:Q_.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:J_.fromRGBA(this.rgba)}equals(e){return!!e&&Z_.equals(this.rgba,e.rgba)&&Q_.equals(this.hsla,e.hsla)&&J_.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=eb._relativeLuminanceForComponent(this.rgba.r),t=eb._relativeLuminanceForComponent(this.rgba.g),i=eb._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return X_(n,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){const e=(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3;return e>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}while(1)}}const lb=()=>{throw new Error("Invalid change accessor")};class cb{constructor(){this._searchCanceledBrand=void 0}}function db(e){return e instanceof cb?null:e}cb.INSTANCE=new cb;class hb extends We{constructor(e,t,i,n=null,o){super(),this._onWillDispose=this._register(new Ye),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new wb),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeLanguage=this._register(new Ye),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new Ye),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new Ye),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidChangeOptions=this._register(new Ye),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new Ye),this.onDidChangeAttached=this._onDidChangeAttached.event,this._eventEmitter=this._register(new Cb),ob++,this.id="$model"+ob,this.isForSimpleWidget=t.isForSimpleWidget,this._associatedResource="undefined"===typeof n||null===n?Xt.parse("inmemory://model/"+ob):n,this._undoRedoService=o,this._attachedEditorCount=0;const{textBuffer:s,disposable:r}=nb(e,t.defaultEOL);this._buffer=s,this._bufferDisposable=r,this._options=hb.resolveOptions(this._buffer,t);const a=this._buffer.getLineCount(),l=this._buffer.getValueLengthInRange(new li(1,1,a,this._buffer.getLineLength(a)+1),0);t.largeFileOptimizations?this._isTooLargeForTokenization=l>hb.LARGE_FILE_SIZE_THRESHOLD||a>hb.LARGE_FILE_LINE_COUNT_THRESHOLD:this._isTooLargeForTokenization=!1,this._isTooLargeForSyncing=l>hb.MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this._isDisposing=!1,this._languageIdentifier=i||Qa,this._languageRegistryListener=ec.onDidChange(e=>{e.languageIdentifier.id===this._languageIdentifier.id&&this._onDidChangeLanguageConfiguration.fire({})}),this._instanceId=rs["O"](ob),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new ub,this._commandManager=new np(this,o),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._tokens=new R_,this._tokens2=new A_,this._tokenization=new $_(this)}static resolveOptions(e,t){if(t.detectIndentation){const i=rp(e,t.tabSize,t.insertSpaces);return new br({tabSize:i.tabSize,indentSize:i.tabSize,insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL})}return new br({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 P_([],"","\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 j_(e,t))}setValue(e){if(this._assertNotDisposed(),null===e)return;const{textBuffer:t,disposable:i}=nb(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 ub,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new K_([new B_],this._versionId,!1,!1),this._createContentChanged2(new li(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 K_([new U_],this._versionId,!1,!1),this._createContentChanged2(new li(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>=rb?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="undefined"!==typeof e.tabSize?e.tabSize:this._options.tabSize,i="undefined"!==typeof e.indentSize?e.indentSize:this._options.indentSize,n="undefined"!==typeof e.insertSpaces?e.insertSpaces:this._options.insertSpaces,o="undefined"!==typeof e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=new br({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=rp(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 s=0;s({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 ab(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,s;if(i<1)o=1,s=1;else if(i>t)o=t,s=this.getLineMaxColumn(o);else if(o=0|i,n<=1)s=1;else{const e=this.getLineMaxColumn(o);s=n>=e?e:0|n}const r=e.endLineNumber,a=e.endColumn;let l,c;if(r<1)l=1,c=1;else if(r>t)l=t,c=this.getLineMaxColumn(l);else if(l=0|r,a<=1)c=1;else{const e=this.getLineMaxColumn(l);c=a>=e?e:0|a}return i===o&&n===s&&r===l&&a===c&&e instanceof li&&!(e instanceof ci)?e:new li(o,s,l,c)}_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;const n=this._buffer.getLineCount();if(e>n)return!1;if(1===t)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(1===i){const i=this._buffer.getLineCharCode(e,t-2);if(rs["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 ai(1,1);if(n>s)return new ai(s,this.getLineMaxColumn(s));if(o<=1)return new ai(n,1);const r=this.getLineMaxColumn(n);if(o>=r)return new ai(n,r);if(1===i){const e=this._buffer.getLineCharCode(n,o-2);if(rs["D"](e))return new ai(n,o-1)}return new ai(n,o)}validatePosition(e){const t=1;return this._assertNotDisposed(),e instanceof ai&&this._isValidPosition(e.lineNumber,e.column,t)?e:this._validatePosition(e.lineNumber,e.column,t)}_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,r=rs["D"](e),a=rs["D"](t);return!r&&!a}return!0}validateRange(e){const t=1;if(this._assertNotDisposed(),e instanceof li&&!(e instanceof ci)&&this._isValidRange(e,t))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,s=i.column,r=n.lineNumber,a=n.column;if(1===t){const e=s>1?this._buffer.getLineCharCode(o,s-2):0,t=a>1&&a<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,a-2):0,i=rs["D"](e),n=rs["D"](t);return i||n?o===r&&s===a?new li(o,s-1,r,a-1):i&&n?new li(o,s-1,r,a+1):i?new li(o,s-1,r,a):new li(o,s,r,a+1):new li(o,s,r,a)}return new li(o,s,r,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 li(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=sb){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every(e=>li.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 c;if(l.push(a.reduce((e,t)=>li.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t))),!i&&e.indexOf("\n")<0){const t=new s_(e,i,n,o),a=t.parseSearchRequest();if(!a)return[];c=e=>this.findMatchesLineByLine(e,a,s,r)}else c=t=>d_.findMatches(this,new s_(e,i,n,o),t,s,r);return l.map(c).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 s_(e,i,n,o),a=t.parseSearchRequest();if(!a)return null;const l=this.getLineCount();let c=new li(r.lineNumber,r.column,l,this.getLineMaxColumn(l)),d=this.findMatchesLineByLine(c,a,s,1);return d_.findNextMatch(this,new s_(e,i,n,o),r,s),d.length>0?d[0]:(c=new li(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),d=this.findMatchesLineByLine(c,a,s,1),d.length>0?d[0]:null)}return d_.findNextMatch(this,new s_(e,i,n,o),r,s)}findPreviousMatch(e,t,i,n,o,s){this._assertNotDisposed();const r=this.validatePosition(t);return d_.findPreviousMatch(this,new s_(e,i,n,o),r,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){const t="\n"===this.getEOL()?0:1;if(t!==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 wr?e:new wr(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,o=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 li(n,1,n,o);t.push(new wr(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 li(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 li(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 c=n.range.startLineNumber,d=n.range.endLineNumber,h=d-c,u=r,g=Math.min(h,u),f=u-h;for(let i=g;i>=0;i--){const n=c+i,s=o-t-f+n;e.push(new V_(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,vb(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)},n=null;try{n=t(i)}catch(o){ve(o)}return i.addDecoration=lb,i.changeDecoration=lb,i.changeDecorationOptions=lb,i.removeDecoration=lb,i.deltaDecorations=lb,n}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:bb[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(bb[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,n=t.length;ithis.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 li(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 ai(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]=hb._findLanguageBoundaries(n,o),a=h(t.column,ec.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]=hb._findLanguageBoundaries(n,o-1),a=h(t.column,ec.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 s=t;s>=0&&e.getLanguageId(s)===i;s--)n=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,r=e.getCount();s=0;e--){const t=i.getEndOffset(e);if(t<=n)break;yl(i.getStandardTokenType(e))&&(n=t)}const a=Math.min(o.length,e.column-1+r.maxBracketLength);let l=null;while(1){const i=ql.findNextBracketInRange(r.forwardRegex,t,o,n,a);if(!i)break;if(i.startColumn<=e.column&&e.column<=i.endColumn){const e=o.substring(i.startColumn-1,i.endColumn-1).toLowerCase(),t=this._matchFoundBracket(i,r.textIsBracket[e],r.textIsOpenBracket[e],null);if(t){if(t instanceof cb)return null;l=t}}n=i.endColumn-1}if(l)return l}if(s>0&&i.getStartOffset(s)===e.column-1){const r=s-1,a=ec.getBracketsSupport(i.getLanguageId(r));if(a&&!yl(i.getStandardTokenType(r))){const s=Math.max(0,e.column-1-a.maxBracketLength);let l=Math.min(o.length,e.column-1+a.maxBracketLength);for(let e=r+1;e=l)break;yl(i.getStandardTokenType(e))&&(l=t)}const c=ql.findPrevBracketInRange(a.reversedRegex,t,o,s,l);if(c&&c.startColumn<=e.column&&e.column<=c.endColumn){const e=o.substring(c.startColumn-1,c.endColumn-1).toLowerCase(),t=this._matchFoundBracket(c,a.textIsBracket[e],a.textIsOpenBracket[e],null);if(t)return t instanceof cb?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 cb?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)=>{while(1){if(i&&++r%100===0&&!i())return cb.INSTANCE;const c=ql.findPrevBracketInRange(o,t,n,a,l);if(!c)break;const d=n.substring(c.startColumn-1,c.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return c;l=c.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const e=this._getLineTokens(l),i=e.getCount(),o=this._buffer.getLineContent(l);let s=i-1,r=o.length,c=o.length;l===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,c=t.column-1);let d=!0;for(;s>=0;s--){const t=e.getLanguageId(s)===n&&!yl(e.getStandardTokenType(s));if(t)d?r=e.getStartOffset(s):(r=e.getStartOffset(s),c=e.getEndOffset(s));else if(d&&r!==c){const e=a(l,o,r,c);if(e)return e}d=t}if(d&&r!==c){const e=a(l,o,r,c);if(e)return e}}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)=>{while(1){if(i&&++r%100===0&&!i())return cb.INSTANCE;const c=ql.findNextBracketInRange(o,t,n,a,l);if(!c)break;const d=n.substring(c.startColumn-1,c.endColumn-1).toLowerCase();if(e.isOpen(d)?s++:e.isClose(d)&&s--,0===s)return c;a=c.endColumn-1}return null},l=this.getLineCount();for(let c=t.lineNumber;c<=l;c++){const e=this._getLineTokens(c),i=e.getCount(),o=this._buffer.getLineContent(c);let s=0,r=0,l=0;c===t.lineNumber&&(s=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,l=t.column-1);let d=!0;for(;s=1;o--){const e=this._getLineTokens(o),s=e.getCount(),r=this._buffer.getLineContent(o);let a=s-1,l=r.length,c=r.length;if(o===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,c=t.column-1;const o=e.getLanguageId(a);i!==o&&(i=o,n=ec.getBracketsSupport(i))}let d=!0;for(;a>=0;a--){const t=e.getLanguageId(a);if(i!==t){if(n&&d&&l!==c){const e=ql.findPrevBracketInRange(n.reversedRegex,o,r,l,c);if(e)return this._toFoundBracket(n,e);d=!1}i=t,n=ec.getBracketsSupport(i)}const s=!!n&&!yl(e.getStandardTokenType(a));if(s)d?l=e.getStartOffset(a):(l=e.getStartOffset(a),c=e.getEndOffset(a));else if(n&&d&&l!==c){const e=ql.findPrevBracketInRange(n.reversedRegex,o,r,l,c);if(e)return this._toFoundBracket(n,e)}d=s}if(n&&d&&l!==c){const e=ql.findPrevBracketInRange(n.reversedRegex,o,r,l,c);if(e)return this._toFoundBracket(n,e)}}return null}findNextBracket(e){const t=this.validatePosition(e),i=this.getLineCount();let n=-1,o=null;for(let s=t.lineNumber;s<=i;s++){const e=this._getLineTokens(s),i=e.getCount(),r=this._buffer.getLineContent(s);let a=0,l=0,c=0;if(s===t.lineNumber){a=e.findTokenIndexAtOffset(t.column-1),l=t.column-1,c=t.column-1;const i=e.getLanguageId(a);n!==i&&(n=i,o=ec.getBracketsSupport(n))}let d=!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{while(1){if(i&&++l%100===0&&!i())return cb.INSTANCE;const a=ql.findNextBracketInRange(e.forwardRegex,t,n,o,s);if(!a)break;const c=n.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[c];if(d&&(d.isOpen(c)?r[d.index]++:d.isClose(c)&&r[d.index]--,-1===r[d.index]))return this._matchFoundBracket(a,d,!1,i);o=a.endColumn-1}return null};let d=-1,h=null;for(let u=n.lineNumber;u<=o;u++){const e=this._getLineTokens(u),t=e.getCount(),i=this._buffer.getLineContent(u);let o=0,s=0,r=0;if(u===n.lineNumber){o=e.findTokenIndexAtOffset(n.column-1),s=n.column-1,r=n.column-1;const t=e.getLanguageId(o);d!==t&&(d=t,h=ec.getBracketsSupport(d),a(d,h))}let l=!0;for(;on)throw new Error("Illegal value for lineNumber");const o=ec.getFoldingRules(this._languageIdentifier.id),s=Boolean(o&&o.offSide);let r=-2,a=-1,l=-2,c=-1;const d=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,c=-1;for(let t=e;t=0){l=t,c=e;break}}}};let h=-2,u=-1,g=-2,f=-1;const m=e=>{if(-2===h){h=-1,u=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){h=t,u=e;break}}}if(-1!==g&&(-2===g||g=0){g=t,f=e;break}}}};let p=0,_=!0,b=0,v=!0,w=0,C=0;for(let y=0;_||v;y++){const o=e-y,r=e+y;y>1&&(o<1||o1&&(r>n||r>i)&&(v=!1),y>5e4&&(_=!1,v=!1);let g=-1;if(_){const e=this._computeIndentLevel(o-1);e>=0?(l=o-1,c=e,g=Math.ceil(e/this._options.indentSize)):(d(o),g=this._getIndentLevelForWhitespaceLine(s,a,c))}let S=-1;if(v){const e=this._computeIndentLevel(r-1);e>=0?(h=r-1,u=e,S=Math.ceil(e/this._options.indentSize)):(m(r),S=this._getIndentLevelForWhitespaceLine(s,u,f))}if(0!==y){if(1===y){if(r<=n&&S>=0&&C+1===S){_=!1,p=r,b=r,w=S;continue}if(o>=1&&g>=0&&g-1===C){v=!1,p=o,b=o,w=g;continue}if(p=e,b=e,w=C,0===w)return{startLineNumber:p,endLineNumber:b,indent:w}}_&&(g>=w?p=o:_=!1),v&&(S>=w?b=r:v=!1)}else C=g}return{startLineNumber:p,endLineNumber:b,indent:w}}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=ec.getFoldingRules(this._languageIdentifier.id),o=Boolean(n&&n.offSide);let s=new Array(t-e+1),r=-2,a=-1,l=-2,c=-1;for(let d=e;d<=t;d++){let t=d-e;const n=this._computeIndentLevel(d-1);if(n>=0)r=d-1,a=n,s[t]=Math.ceil(n/this._options.indentSize);else{if(-2===r){r=-1,a=-1;for(let e=d-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,c=t;break}}}s[t]=this._getIndentLevelForWhitespaceLine(o,a,c)}}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))}}const yb=()=>!0,Sb=()=>!1,xb=e=>" "===e||"\t"===e;class Lb{constructor(e,t,i){this._languageIdentifier=e;const n=i.options,o=n.get(124);this.readOnly=n.get(75),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=n.get(99),this.lineHeight=n.get(53),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=n.get(109),this.wordSeparators=n.get(110),this.emptySelectionClipboard=n.get(28),this.copyWithSyntaxHighlighting=n.get(18),this.multiCursorMergeOverlapping=n.get(63),this.multiCursorPaste=n.get(65),this.autoClosingBrackets=n.get(5),this.autoClosingQuotes=n.get(7),this.autoClosingOvertype=n.get(6),this.autoSurround=n.get(10),this.autoIndent=n.get(8),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:Lb._getShouldAutoClose(e,this.autoClosingQuotes),bracket:Lb._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=ec.getAutoClosingPairs(e.id);let s=Lb._getSurroundingPairs(e);if(s)for(const r of s)this.surroundingPairs[r.open]=r.close}static shouldRecreate(e){return e.hasChanged(124)||e.hasChanged(110)||e.hasChanged(28)||e.hasChanged(63)||e.hasChanged(65)||e.hasChanged(5)||e.hasChanged(7)||e.hasChanged(6)||e.hasChanged(10)||e.hasChanged(109)||e.hasChanged(53)||e.hasChanged(75)}get electricChars(){if(!this._electricChars){this._electricChars={};let e=Lb._getElectricCharacters(this._languageIdentifier);if(e)for(const t of e)this._electricChars[t]=!0}return this._electricChars}normalizeIndentation(e){return hb.normalizeIndentation(e,this.indentSize,this.insertSpaces)}static _getElectricCharacters(e){try{return ec.getElectricCharacters(e.id)}catch(t){return ve(t),null}}static _getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return xb;case"languageDefined":return Lb._getLanguageDefinedShouldAutoClose(e);case"always":return yb;case"never":return Sb}}static _getLanguageDefinedShouldAutoClose(e){try{const t=ec.getAutoCloseBeforeSet(e.id);return e=>-1!==t.indexOf(e)}catch(t){return ve(t),Sb}}static _getSurroundingPairs(e){try{return ec.getSurroundingPairs(e.id)}catch(t){return ve(t),null}}}class kb{constructor(e,t,i,n){this.selectionStart=e,this.selectionStartLeftoverVisibleColumns=t,this.position=i,this.leftoverVisibleColumns=n,this.selection=kb._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 kb(this.selectionStart,this.selectionStartLeftoverVisibleColumns,new ai(t,i),n):new kb(new li(t,i,t,i),n,new ai(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 ci(i,n,o,s)}}class Eb{constructor(e,t,i){this.model=e,this.coordinatesConverter=t,this.cursorConfig=i}}class Db{constructor(e){this.modelState=e,this.viewState=null}}class Nb{constructor(e){this.modelState=null,this.viewState=e}}class Ib{constructor(e,t){this.modelState=e,this.viewState=t}static fromModelState(e){return new Db(e)}static fromViewState(e){return new Nb(e)}static fromModelSelection(e){const t=e.selectionStartLineNumber,i=e.selectionStartColumn,n=e.positionLineNumber,o=e.positionColumn,s=new kb(new li(t,i,t,i),0,new ai(n,o),0);return Ib.fromModelState(s)}static fromModelSelections(e){let t=[];for(let i=0,n=e.length;i=65536?2:1,9===t)s=Mb.nextRenderTabStop(s,i);else{let i=rs["w"](t);while(r=65536?2:1,i=n}rs["C"](t)||rs["A"](t)?s+=2:s+=1}}return s}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 o=0,s=1,r=0;while(r=65536?2:1,9===a)l=Mb.nextRenderTabStop(o,i);else{let t=rs["w"](a);while(r=65536?2:1,t=o}l=rs["C"](a)||rs["A"](a)?o+2:o+1}const c=r+1;if(l>=t){const e=t-o,i=l-t;return ir?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 e-1-(e-1)%t}static prevIndentTabStop(e,t){return e-1-(e-1)%t}}function Ob(e){return"'"===e||'"'===e||"`"===e}class Ab{static whitespaceVisibleColumn(e,t,i){const n=e.length;let o=0,s=-1,r=-1;for(let a=0;a=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 Wb{constructor(e,t,i){this.model=e.model;const n=e.configuration.options;this.layoutInfo=n.get(124),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(53),this.stickyTabStops=n.get(99),this.typicalHalfwidthCharacterWidth=n.get(38).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Wb.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 ai(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new ai(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,Ub._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class Vb extends Bb{constructor(e,t,i,n){super(e,t,i),this._ctx=e,n?(this.target=n,this.targetPath=km.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 Fb.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(!Fb.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfill(7,new ai(1,1),void 0,Hb);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return t.fulfill(7,new ai(i,n),void 0,Hb)}if(i){if(Fb.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.model.getLineLength(i)){const n=e.getLineWidth(i),o=zb(t.mouseContentHorizontalOffset-n);return t.fulfill(7,new ai(i,1),void 0,o)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const o=zb(t.mouseContentHorizontalOffset-n),s=new ai(i,e.model.getLineMaxColumn(i));return t.fulfill(7,s,void 0,o)}}return t.fulfill(0)}const n=Ub._doHitTest(e,t);return n.position?Ub.createMouseTargetFromHitTestPosition(e,t,n.position.lineNumber,n.position.column):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(Fb.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new ai(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(Fb.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 ai(i,n))}}return null}static _hitTestScrollbar(e,t){if(Fb.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.model.getLineMaxColumn(i);return t.fulfill(11,new ai(i,n))}return null}getMouseColumn(e,t){const i=this._context.configuration.options,n=i.get(124),o=this._context.viewLayout.getCurrentScrollLeft()+t.x-e.x-n.contentLeft;return Ub._getMouseColumn(o,i.get(38).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;const i=Math.round(e/t);return i+1}static createMouseTargetFromHitTestPosition(e,t,i,n){const o=new ai(i,n),s=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>s){if(ln&&1===o.column){const n=zb(t.mouseContentHorizontalOffset-s);return t.fulfill(7,new ai(i,e.model.getLineMaxColumn(i)),void 0,n)}const n=zb(t.mouseContentHorizontalOffset-s);return t.fulfill(7,o,void 0,n)}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})}const c=e.model.getLineMaxColumn(i);if(ne.offset-t.offset);for(let d=1;d=t.editorPos.y+e.layoutInfo.height&&(s=t.editorPos.y+e.layoutInfo.height-1);const r=new pm(t.pos.x,s),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates());return a.position?a:this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=No(e.viewDomNode);let n;if(n=i?"undefined"===typeof i.caretRangeFromPoint?Kb(i,t.clientX,t.clientY):i.caretRangeFromPoint(t.clientX,t.clientY):document.caretRangeFromPoint(t.clientX,t.clientY),!n||!n.startContainer)return{position:null,hitTarget:null};const o=n.startContainer;let s=null;if(o.nodeType===o.TEXT_NODE){const t=o.parentNode,i=t?t.parentNode:null,r=i?i.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(a===Vm.CLASS_NAME){const i=e.getPositionFromDOMInfo(t,n.startOffset);return{position:i,hitTarget:null}}s=o.parentNode}else if(o.nodeType===o.ELEMENT_NODE){const t=o.parentNode,i=t?t.parentNode:null,n=i&&i.nodeType===i.ELEMENT_NODE?i.className:null;if(n===Vm.CLASS_NAME){const t=e.getPositionFromDOMInfo(o,o.textContent.length);return{position:t,hitTarget:null}}s=o}return{position:null,hitTarget:s}}static _doHitTestWithCaretPositionFromPoint(e,t){const i=document.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const t=i.offsetNode.parentNode,n=t?t.parentNode:null,o=n?n.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(s===Vm.CLASS_NAME){const t=e.getPositionFromDOMInfo(i.offsetNode.parentNode,i.offset);return{position:t,hitTarget:null}}return{position:null,hitTarget:i.offsetNode.parentNode}}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,o=t?t.parentNode:null,s=o&&o.nodeType===o.ELEMENT_NODE?o.className:null;if(n===Vm.CLASS_NAME){const t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t){const i=e.getPositionFromDOMInfo(t,0);return{position:i,hitTarget:null}}}else if(s===Vm.CLASS_NAME){const t=e.getPositionFromDOMInfo(i.offsetNode,0);return{position:t,hitTarget:null}}}return{position:null,hitTarget:i.offsetNode}}static _doHitTestWithMoveToPoint(e,t){let i=null,n=null;const o=document.body.createTextRange();try{o.moveToPoint(t.clientX,t.clientY)}catch(c){return{position:null,hitTarget:null}}o.collapse(!0);const s=o?o.parentElement():null,r=s?s.parentNode:null,a=r?r.parentNode:null,l=a&&a.nodeType===a.ELEMENT_NODE?a.className:"";if(l===Vm.CLASS_NAME){const t=o.duplicate();t.moveToElementText(s),t.setEndPoint("EndToStart",o),i=e.getPositionFromDOMInfo(s,t.text.length),t.moveToElementText(e.viewDomNode)}else n=s;return o.moveToElementText(e.viewDomNode),{position:i,hitTarget:n}}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:n}=t.getTextModelOptions(),o=Ab.atomicPosition(i,e.column-1,n,2);return-1!==o?new ai(e.lineNumber,o+1):e}static _doHitTest(e,t){let i;return i="function"===typeof document.caretRangeFromPoint?this._doHitTestWithCaretRangeFromPoint(e,t):document.caretPositionFromPoint?this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates()):document.body.createTextRange?this._doHitTestWithMoveToPoint(e,t.pos.toClientCoordinates()):{position:null,hitTarget:null},i.position&&e.stickyTabStops&&(i.position=this._snapToSoftTabBoundary(i.position,e.model)),i}}function Kb(e,t,i){const n=document.createRange();let o=e.elementFromPoint(t,i);if(null!==o){while(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=jb.getInstance();for(let n=0;nthis._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1;const n=new Cm(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),qb(this.mouseTargetFactory),$b.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)));const o=e=>{if(this.viewController.emitMouseWheel(e),!this._context.configuration.options.get(62))return;const t=new Mn(e),i=s["f"]?e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey;if(i){const e=lr.getZoomLevel(),i=t.deltaY>0?1:-1;lr.setZoomLevel(e+i),t.preventDefault(),t.stopPropagation()}};this._register(Zn(this.viewHelper.viewDomNode,Wo.MOUSE_WHEEL,o,{capture:!0,passive:!1})),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}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 _m(e,t),n=i.toPageCoordinates(),o=vm(this.viewHelper.viewDomNode);return n.yo.y+o.height||n.xo.x+o.width?null:this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,n,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){if(this._mouseDownOperation.isActive())return;const t=e.timestamp;t{e.preventDefault(),this.viewHelper.focusTextArea()};if(c&&(i||o&&r))d(),this._mouseDownOperation.start(t.type,e);else if(n)e.preventDefault();else if(a){const i=t.detail;this.viewHelper.shouldSuppressMouseDownOnViewZone(i.viewZoneId)&&(d(),this._mouseDownOperation.start(t.type,e),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(t.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:t})}}$b.MOUSE_MOVE_MINIMUM_TIME=100;class Gb extends We{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 Sm(this._viewHelper.viewDomNode)),this._onScrollTimeout=this._register(new Wn),this._mouseState=new Yb,this._currentSelection=new ci(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(75)&&n.get(27)&&!n.get(15)&&!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,qb(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,qb(null),e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._onScrollTimeout.cancel()}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=Wb.getZoneAtCoord(this._context,s);if(r){const e=this._helpPositionJumpOverViewZone(r);if(e)return new Pb(null,13,o,e)}const a=n.getLineNumberAtVerticalOffset(s);return new Pb(null,13,o,new ai(a,i.getLineMaxColumn(a)))}const s=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+(e.posy-t.y));return e.posxt.x+t.width?new Pb(null,13,o,new ai(s,i.getLineMaxColumn(s))):null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const n=this._createMouseTarget(e,t),o=n.position;if(!o)return null;if(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return new Pb(n.element,n.type,n.mouseColumn,e,null,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new ai(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 Yb{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>Yb.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)}}function Xb(e,t){const i={translationY:t.translationY,translationX:t.translationX};return e&&(i.translationY+=e.translationY,i.translationX+=e.translationX),i}Yb.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class Zb extends $b{constructor(e,t,i){super(e,t,i),this.viewHelper.linesContentDomNode.style.touchAction="none",this._installGestureHandlerTimeout=window.setTimeout(()=>{if(this._installGestureHandlerTimeout=-1,window.MSGesture){const e=new MSGesture,t=new MSGesture;e.target=this.viewHelper.linesContentDomNode,t.target=this.viewHelper.linesContentDomNode,this.viewHelper.linesContentDomNode.addEventListener("pointerdown",i=>{const n=i.pointerType;"mouse"!==n?"touch"===n?(this._lastPointerType="touch",e.addPointer(i.pointerId)):(this._lastPointerType="pen",t.addPointer(i.pointerId)):this._lastPointerType="mouse"}),this._register(uo(this.viewHelper.linesContentDomNode,"MSGestureChange",e=>this._onGestureChange(e),Xb)),this._register(Zn(this.viewHelper.linesContentDomNode,"MSGestureTap",e=>this._onCaptureGestureTap(e),!0))}},100),this._lastPointerType="mouse"}_onMouseDown(e){"mouse"===this._lastPointerType&&super._onMouseDown(e)}_onCaptureGestureTap(e){const t=new wm(e,this.viewHelper.viewDomNode),i=this._createMouseTarget(t,!1);i.position&&this.viewController.moveTo(i.position),t.browserEvent.fromElement?(t.preventDefault(),this.viewHelper.focusTextArea()):setTimeout(()=>{this.viewHelper.focusTextArea()})}_onGestureChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}dispose(){window.clearTimeout(this._installGestureHandlerTimeout),super.dispose()}}class Qb extends $b{constructor(e,t,i){super(e,t,i),this._register(gm.addTarget(this.viewHelper.linesContentDomNode)),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Tap,e=>this.onTap(e))),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Change,e=>this.onChange(e))),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Contextmenu,e=>this._onContextMenu(new wm(e,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(Zn(this.viewHelper.linesContentDomNode,"pointerdown",e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"}));const n=new ym(this.viewHelper.viewDomNode);this._register(n.onPointerMoveThrottled(this.viewHelper.viewDomNode,e=>this._onMouseMove(e),qb(this.mouseTargetFactory),$b.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 wm(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 Jb extends $b{constructor(e,t,i){super(e,t,i),this._register(gm.addTarget(this.viewHelper.linesContentDomNode)),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Tap,e=>this.onTap(e))),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Change,e=>this.onChange(e))),this._register(Zn(this.viewHelper.linesContentDomNode,hm.Contextmenu,e=>this._onContextMenu(new wm(e,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new wm(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.moveTo(t.position)}onChange(e){this._context.model.deltaScrollNow(-e.translationX,-e.translationY)}}class ev extends We{constructor(e,t,i){super(),s["c"]&&$n.pointerEvents?this.handler=this._register(new Qb(e,t,i)):window.TouchEvent?this.handler=this._register(new Jb(e,t,i)):window.navigator.pointerEnabled||window.PointerEvent?this.handler=this._register(new Zb(e,t,i)):this.handler=this._register(new $b(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}i("1a37");const tv=!1;class iv{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 iv(e.getValue(),e.getSelectionStart(),e.getSelectionEnd(),null,null)}collapseSelection(){return new iv(this.value,this.value.length,this.value.length,null,null)}writeToTextArea(e,t,i){tv&&console.log("writeToTextArea "+e+": "+this.toString()),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;while(-1!==(o=t.indexOf("\n",o+1)))n++;return[e,i*t.length,n]}static selectedText(e){return new iv(e,0,e.length,null,null)}static deduceInput(e,t,i){if(!e)return{text:"",replaceCharCnt:0};tv&&(console.log("------------------------deduceInput"),console.log("PREVIOUS STATE: "+e.toString()),console.log("CURRENT STATE: "+t.toString()));let n=e.value,o=e.selectionStart,s=e.selectionEnd,r=t.value,a=t.selectionStart,l=t.selectionEnd;const c=n.substring(s),d=r.substring(l),h=rs["e"](c,d);r=r.substring(0,r.length-h),n=n.substring(0,n.length-h);const u=n.substring(0,o),g=r.substring(0,a),f=rs["d"](u,g);if(r=r.substring(f),n=n.substring(f),a-=f,o-=f,l-=f,s-=f,tv&&(console.log("AFTER DIFFING PREVIOUS STATE: <"+n+">, selectionStart: "+o+", selectionEnd: "+s),console.log("AFTER DIFFING CURRENT STATE: <"+r+">, selectionStart: "+a+", selectionEnd: "+l)),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)||rs["k"](e)))return{text:e,replaceCharCnt:0}}if(a===l){if(n===r&&0===o&&s===n.length&&a===r.length&&-1===r.indexOf("\n")&&rs["l"](r))return{text:"",replaceCharCnt:0};const e=u.length-f;return tv&&console.log("REMOVE PREVIOUS: "+(u.length-f)+" chars"),{text:r,replaceCharCnt:e}}const m=s-o;return{text:r,replaceCharCnt:m}}}iv.EMPTY=new iv("",0,0,null,null);class nv{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 li(n,1,o+1,1)}static fromEditorSelection(e,t,i,n,o){const s=nv._getPageOfLine(i.startLineNumber,n),r=nv._getRangeForPage(s,n),a=nv._getPageOfLine(i.endLineNumber,n),l=nv._getRangeForPage(a,n),c=r.intersectRanges(new li(1,1,i.startLineNumber,i.startColumn));let d=t.getValueInRange(c,1);const h=t.getLineCount(),u=t.getLineMaxColumn(h),g=l.intersectRanges(new li(i.endLineNumber,i.endColumn,h,u));let f,m=t.getValueInRange(g,1);if(s===a||s+1===a)f=t.getValueInRange(i,1);else{const e=r.intersectRanges(i),n=l.intersectRanges(i);f=t.getValueInRange(e,1)+String.fromCharCode(8230)+t.getValueInRange(n,1)}if(o){const e=500;d.length>e&&(d=d.substring(d.length-e,d.length)),m.length>e&&(m=m.substring(0,e)),f.length>2*e&&(f=f.substring(0,e)+String.fromCharCode(8230)+f.substring(f.length-e,f.length))}return new iv(d+f+m,d.length,d.length+f.length,new ai(i.startLineNumber,i.startColumn),new ai(i.endLineNumber,i.endColumn))}}const ov={forceCopyWithSyntaxHighlighting:!1};class sv{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)}}sv.INSTANCE=new sv;class rv extends We{constructor(e,t){super(),this.textArea=t,this._onFocus=this._register(new Ye),this.onFocus=this._onFocus.event,this._onBlur=this._register(new Ye),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new Ye),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new Ye),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new Ye),this.onCut=this._onCut.event,this._onPaste=this._register(new Ye),this.onPaste=this._onPaste.event,this._onType=this._register(new Ye),this.onType=this._onType.event,this._onCompositionStart=this._register(new Ye),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new Ye),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new Ye),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new Ye),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._host=e,this._textArea=this._register(new lv(t)),this._asyncTriggerCut=this._register(new Vn(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Vn(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=iv.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._isDoingComposition=!1,this._nextCommand=0;let i=null;this._register(eo(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(eo(t.domNode,"keyup",e=>{this._onKeyUp.fire(e)})),this._register(Zn(t.domNode,"compositionstart",e=>{if(tv&&console.log("[compositionstart]",e),this._isDoingComposition)return;this._isDoingComposition=!0;let t=!1;s["f"]&&i&&i.equals(109)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"!==i.code&&"ArrowLeft"!==i.code||(tv&&console.log("[compositionstart] Handling long press case on macOS + arrow key",e),t=!0)),t?this._textAreaState=new iv(this._textAreaState.value,this._textAreaState.selectionStart-1,this._textAreaState.selectionEnd,this._textAreaState.selectionStartPosition?new ai(this._textAreaState.selectionStartPosition.lineNumber,this._textAreaState.selectionStartPosition.column-1):null,this._textAreaState.selectionEndPosition):this._setAndWriteTextAreaState("compositionstart",iv.EMPTY),this._onCompositionStart.fire({moveOneCharacterLeft:t})}));const n=e=>{const t=this._textAreaState,i=iv.readFromTextArea(this._textArea);return[i,iv.deduceInput(t,i,e)]},o=e=>{const t=this._textAreaState,i=iv.selectedText(e),n={text:i.value,replaceCharCnt:t.selectionEnd-t.selectionStart};return[i,n]};this._register(Zn(t.domNode,"compositionupdate",e=>{tv&&console.log("[compositionupdate]",e);const[t,i]=o(e.data||"");this._textAreaState=t,this._onType.fire(i),this._onCompositionUpdate.fire(e)})),this._register(Zn(t.domNode,"compositionend",e=>{if(tv&&console.log("[compositionend]",e),!this._isDoingComposition)return;const[t,i]=o(e.data||"");this._textAreaState=t,this._onType.fire(i),(hn||cn)&&(this._textAreaState=iv.readFromTextArea(this._textArea)),this._isDoingComposition&&(this._isDoingComposition=!1,this._onCompositionEnd.fire())})),this._register(Zn(t.domNode,"input",()=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._isDoingComposition)return;const[e,t]=n(s["f"]);0===t.replaceCharCnt&&1===t.text.length&&rs["D"](t.text.charCodeAt(0))||(this._textAreaState=e,0===this._nextCommand?""!==t.text&&this._onType.fire(t):(""===t.text&&0===t.replaceCharCnt||this._firePaste(t.text,null),this._nextCommand=0))})),this._register(Zn(t.domNode,"cut",e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()})),this._register(Zn(t.domNode,"copy",e=>{this._ensureClipboardGetsEditorSelection(e)})),this._register(Zn(t.domNode,"paste",e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),av.canUseTextData(e)){const[t,i]=av.getTextData(e);""!==t&&this._firePaste(t,i)}else this._textArea.getSelectionStart()!==this._textArea.getSelectionEnd()&&this._setAndWriteTextAreaState("paste",iv.EMPTY),this._nextCommand=1})),this._register(Zn(t.domNode,"focus",()=>{const e=this._hasFocus;this._setHasFocus(!0),un&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(Zn(t.domNode,"blur",()=>{this._isDoingComposition&&(this._isDoingComposition=!1,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))}_installSelectionChangeListener(){let e=0;return Zn(document,"selectionchange",t=>{if(!this._hasFocus)return;if(this._isDoingComposition)return;if(!hn)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),c=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),h=this._host.deduceModelPosition(d[0],d[1],d[2]),u=new ci(c.lineNumber,c.column,h.lineNumber,h.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=No(this.textArea.domNode);e?this._setHasFocus(e.activeElement===this.textArea.domNode):Yn(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(av.canUseTextData(e)&&$n.clipboard.richText),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};sv.INSTANCE.set(cn?t.text.replace(/\r\n/g,"\n"):t.text,i),av.canUseTextData(e)?av.setTextData(e,t.text,t.html,i):this._setAndWriteTextAreaState("copy or cut",iv.selectedText(t.text))}_firePaste(e,t){t||(t=sv.INSTANCE.get(e)),this._onPaste.fire({text:e,metadata:t})}}class av{static canUseTextData(e){return!!e.clipboardData||!!window.clipboardData}static getTextData(e){if(e.clipboardData){e.preventDefault();const i=e.clipboardData.getData("text/plain");let n=null;const o=e.clipboardData.getData("vscode-editor-data");if("string"===typeof o)try{n=JSON.parse(o),1!==n.version&&(n=null)}catch(t){}return[i,n]}if(window.clipboardData){e.preventDefault();const t=window.clipboardData.getData("Text");return[t,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 lv extends We{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 this._actual.domNode.selectionStart}getSelectionEnd(){return this._actual.domNode.selectionEnd}setSelectionRange(e,t,i){const n=this._actual.domNode;let o=null;const s=No(n);o=s?s.activeElement:document.activeElement;const r=o===n,a=n.selectionStart,l=n.selectionEnd;if(r&&a===t&&l===i)cn&&window.parent!==window&&n.focus();else{if(r)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(cn&&window.parent!==window&&n.focus());try{const e=Vo(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),Ho(n,e)}catch(c){}}}}i("1f2d");class cv extends xm{}const dv={ColorContribution:"base.contributions.colors"};class hv{constructor(){this._onDidChangeSchema=new Ye,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){const e=i.defaults[t.type];return iC(e,t)}}getColorSchema(){return this.colorSchema}toString(){let e=(e,t)=>{let i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)};return Object.keys(this.colorsById).sort(e).map(e=>`- \`${e}\`: ${this.colorsById[e].description}`).join("\n")}}const uv=new hv;function gv(e,t,i,n,o){return uv.registerColor(e,t,i,n,o)}Ah.add(dv.ColorContribution,uv);const fv=gv("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},o("foreground","Overall foreground color. This color is only used if not overridden by a component.")),mv=(gv("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},o("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component.")),gv("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},o("iconForeground","The default color for icons in the workbench.")),gv("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},o("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component."))),pv=gv("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},o("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),_v=gv("contrastActiveBorder",{light:null,dark:null,hc:mv},o("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast.")),bv=(gv("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},o("textLinkForeground","Foreground color for links in text.")),gv("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:eb.black},o("textCodeBlockBackground","Background color for code blocks in text.")),gv("widget.shadow",{dark:eC(eb.black,.36),light:eC(eb.black,.16),hc:null},o("widgetShadow","Shadow color of widgets such as find/replace inside the editor."))),vv=gv("input.background",{dark:"#3C3C3C",light:eb.white,hc:eb.black},o("inputBoxBackground","Input box background.")),wv=gv("input.foreground",{dark:fv,light:fv,hc:fv},o("inputBoxForeground","Input box foreground.")),Cv=gv("input.border",{dark:null,light:null,hc:pv},o("inputBoxBorder","Input box border.")),yv=(gv("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:pv},o("inputBoxActiveOptionBorder","Border color of activated options in input fields.")),gv("inputOption.activeBackground",{dark:eC(mv,.4),light:eC(mv,.2),hc:eb.transparent},o("inputOption.activeBackground","Background color of activated options in input fields.")),gv("inputOption.activeForeground",{dark:eb.white,light:eb.black,hc:null},o("inputOption.activeForeground","Foreground color of activated options in input fields.")),gv("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:eb.black},o("inputValidationInfoBackground","Input validation background color for information severity."))),Sv=gv("inputValidation.infoForeground",{dark:null,light:null,hc:null},o("inputValidationInfoForeground","Input validation foreground color for information severity.")),xv=gv("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hc:pv},o("inputValidationInfoBorder","Input validation border color for information severity.")),Lv=gv("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hc:eb.black},o("inputValidationWarningBackground","Input validation background color for warning severity.")),kv=gv("inputValidation.warningForeground",{dark:null,light:null,hc:null},o("inputValidationWarningForeground","Input validation foreground color for warning severity.")),Ev=gv("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hc:pv},o("inputValidationWarningBorder","Input validation border color for warning severity.")),Dv=gv("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hc:eb.black},o("inputValidationErrorBackground","Input validation background color for error severity.")),Nv=gv("inputValidation.errorForeground",{dark:null,light:null,hc:null},o("inputValidationErrorForeground","Input validation foreground color for error severity.")),Iv=gv("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hc:pv},o("inputValidationErrorBorder","Input validation border color for error severity.")),Tv=gv("dropdown.background",{dark:"#3C3C3C",light:eb.white,hc:eb.black},o("dropdownBackground","Dropdown background.")),Mv=gv("dropdown.foreground",{dark:"#F0F0F0",light:null,hc:eb.white},o("dropdownForeground","Dropdown foreground.")),Ov=gv("button.foreground",{dark:eb.white,light:eb.white,hc:eb.white},o("buttonForeground","Button foreground color.")),Av=gv("button.background",{dark:"#0E639C",light:"#007ACC",hc:null},o("buttonBackground","Button background color.")),Rv=gv("button.hoverBackground",{dark:Jw(Av,.2),light:Qw(Av,.2),hc:null},o("buttonHoverBackground","Button background color when hovering.")),Pv=gv("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hc:eb.black},o("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Fv=gv("badge.foreground",{dark:eb.white,light:"#333",hc:eb.white},o("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Wv=gv("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hc:null},o("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),Bv=gv("scrollbarSlider.background",{dark:eb.fromHex("#797979").transparent(.4),light:eb.fromHex("#646464").transparent(.4),hc:eC(pv,.6)},o("scrollbarSliderBackground","Scrollbar slider background color.")),Vv=gv("scrollbarSlider.hoverBackground",{dark:eb.fromHex("#646464").transparent(.7),light:eb.fromHex("#646464").transparent(.7),hc:eC(pv,.8)},o("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),Hv=gv("scrollbarSlider.activeBackground",{dark:eb.fromHex("#BFBFBF").transparent(.4),light:eb.fromHex("#000000").transparent(.6),hc:pv},o("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),zv=gv("progressBar.background",{dark:eb.fromHex("#0E70C0"),light:eb.fromHex("#0E70C0"),hc:pv},o("progressBarBackground","Background color of the progress bar that can show for long running operations.")),Uv=gv("editorError.background",{dark:null,light:null,hc:null},o("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Kv=gv("editorError.foreground",{dark:"#F48771",light:"#E51400",hc:null},o("editorError.foreground","Foreground color of error squigglies in the editor.")),jv=gv("editorError.border",{dark:null,light:null,hc:eb.fromHex("#E47777").transparent(.8)},o("errorBorder","Border color of error boxes in the editor.")),qv=gv("editorWarning.background",{dark:null,light:null,hc:null},o("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),$v=gv("editorWarning.foreground",{dark:"#CCA700",light:"#E9A700",hc:null},o("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),Gv=gv("editorWarning.border",{dark:null,light:null,hc:eb.fromHex("#FFCC00").transparent(.8)},o("warningBorder","Border color of warning boxes in the editor.")),Yv=gv("editorInfo.background",{dark:null,light:null,hc:null},o("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Xv=gv("editorInfo.foreground",{dark:"#75BEFF",light:"#75BEFF",hc:null},o("editorInfo.foreground","Foreground color of info squigglies in the editor.")),Zv=gv("editorInfo.border",{dark:null,light:null,hc:eb.fromHex("#75BEFF").transparent(.8)},o("infoBorder","Border color of info boxes in the editor.")),Qv=gv("editorHint.foreground",{dark:eb.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hc:null},o("editorHint.foreground","Foreground color of hint squigglies in the editor.")),Jv=gv("editorHint.border",{dark:null,light:null,hc:eb.fromHex("#eeeeee").transparent(.8)},o("hintBorder","Border color of hint boxes in the editor.")),ew=gv("editor.background",{light:"#fffffe",dark:"#1E1E1E",hc:eb.black},o("editorBackground","Editor background color.")),tw=gv("editor.foreground",{light:"#333333",dark:"#BBBBBB",hc:eb.white},o("editorForeground","Editor default foreground color.")),iw=gv("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hc:"#0C141F"},o("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),nw=gv("editorWidget.foreground",{dark:fv,light:fv,hc:fv},o("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),ow=gv("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hc:pv},o("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.")),sw=(gv("editorWidget.resizeBorder",{light:null,dark:null,hc:null},o("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.")),gv("quickInput.background",{dark:iw,light:iw,hc:iw},o("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette."))),rw=gv("quickInput.foreground",{dark:nw,light:nw,hc:nw},o("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),aw=gv("quickInputTitle.background",{dark:new eb(new Z_(255,255,255,.105)),light:new eb(new Z_(0,0,0,.06)),hc:"#000000"},o("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),lw=gv("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hc:eb.white},o("pickerGroupForeground","Quick picker color for grouping labels.")),cw=gv("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hc:eb.white},o("pickerGroupBorder","Quick picker color for grouping borders.")),dw=gv("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},o("editorSelectionBackground","Color of the editor selection.")),hw=gv("editor.selectionForeground",{light:null,dark:null,hc:"#000000"},o("editorSelectionForeground","Color of the selected text for high contrast.")),uw=gv("editor.inactiveSelectionBackground",{light:eC(dw,.5),dark:eC(dw,.5),hc:eC(dw,.5)},o("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),gw=gv("editor.selectionHighlightBackground",{light:tC(dw,ew,.3,.6),dark:tC(dw,ew,.3,.6),hc:null},o("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),fw=(gv("editor.selectionHighlightBorder",{light:null,dark:null,hc:_v},o("editorSelectionHighlightBorder","Border color for regions with the same content as the selection.")),gv("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hc:null},o("editorFindMatch","Color of the current search match.")),gv("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hc:null},o("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0)),mw=(gv("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hc:null},o("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),gv("editor.findMatchBorder",{light:null,dark:null,hc:_v},o("editorFindMatchBorder","Border color of the current search match.")),gv("editor.findMatchHighlightBorder",{light:null,dark:null,hc:_v},o("findMatchHighlightBorder","Border color of the other search matches.")),gv("editor.findRangeHighlightBorder",{dark:null,light:null,hc:eC(_v,.4)},o("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),gv("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hc:"#ADD6FF26"},o("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),gv("editorHoverWidget.background",{light:iw,dark:iw,hc:iw},o("hoverBackground","Background color of the editor hover."))),pw=(gv("editorHoverWidget.foreground",{light:nw,dark:nw,hc:nw},o("hoverForeground","Foreground color of the editor hover.")),gv("editorHoverWidget.border",{light:ow,dark:ow,hc:ow},o("hoverBorder","Border color of the editor hover.")),gv("editorHoverWidget.statusBarBackground",{dark:Jw(mw,.2),light:Qw(mw,.05),hc:iw},o("statusBarBackground","Background color of the editor hover status bar.")),gv("editorLink.activeForeground",{dark:"#4E94CE",light:eb.blue,hc:eb.cyan},o("activeLinkForeground","Color of active links.")),gv("editorInlineHint.foreground",{dark:iw,light:nw,hc:iw},o("editorInlineHintForeground","Foreground color of inline hints")),gv("editorInlineHint.background",{dark:nw,light:iw,hc:nw},o("editorInlineHintBackground","Background color of inline hints")),gv("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hc:"#FFCC00"},o("editorLightBulbForeground","The color used for the lightbulb actions icon.")),gv("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hc:"#75BEFF"},o("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon.")),new eb(new Z_(155,185,85,.2))),_w=new eb(new Z_(255,0,0,.2)),bw=gv("diffEditor.insertedTextBackground",{dark:pw,light:pw,hc:null},o("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),vw=gv("diffEditor.removedTextBackground",{dark:_w,light:_w,hc:null},o("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),ww=gv("diffEditor.insertedTextBorder",{dark:null,light:null,hc:"#33ff2eff"},o("diffEditorInsertedOutline","Outline color for the text that got inserted.")),Cw=gv("diffEditor.removedTextBorder",{dark:null,light:null,hc:"#FF008F"},o("diffEditorRemovedOutline","Outline color for text that got removed.")),yw=gv("diffEditor.border",{dark:null,light:null,hc:pv},o("diffEditorBorder","Border color between the two text editors.")),Sw=gv("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hc:null},o("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),xw=gv("list.focusBackground",{dark:"#062F4A",light:"#D6EBFF",hc:null},o("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.")),Lw=gv("list.focusForeground",{dark:null,light:null,hc:null},o("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.")),kw=gv("list.activeSelectionBackground",{dark:"#094771",light:"#0060C0",hc:null},o("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.")),Ew=gv("list.activeSelectionForeground",{dark:eb.white,light:eb.white,hc:null},o("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.")),Dw=gv("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hc:null},o("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.")),Nw=gv("list.inactiveSelectionForeground",{dark:null,light:null,hc:null},o("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.")),Iw=gv("list.inactiveFocusBackground",{dark:null,light:null,hc:null},o("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.")),Tw=gv("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hc:null},o("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Mw=gv("list.hoverForeground",{dark:null,light:null,hc:null},o("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Ow=gv("list.dropBackground",{dark:xw,light:xw,hc:null},o("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),Aw=(gv("list.highlightForeground",{dark:"#0097fb",light:"#0066BF",hc:mv},o("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),gv("listFilterWidget.background",{light:"#efc1ad",dark:"#653723",hc:eb.black},o("listFilterWidgetBackground","Background color of the type filter widget in lists and trees."))),Rw=gv("listFilterWidget.outline",{dark:eb.transparent,light:eb.transparent,hc:"#f38518"},o("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Pw=gv("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hc:pv},o("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Fw=gv("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hc:"#a9a9a9"},o("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Ww=gv("menu.border",{dark:null,light:null,hc:pv},o("menuBorder","Border color of menus.")),Bw=gv("menu.foreground",{dark:Mv,light:fv,hc:Mv},o("menuForeground","Foreground color of menu items.")),Vw=gv("menu.background",{dark:Tv,light:Tv,hc:Tv},o("menuBackground","Background color of menu items.")),Hw=gv("menu.selectionForeground",{dark:Ew,light:Ew,hc:Ew},o("menuSelectionForeground","Foreground color of the selected menu item in menus.")),zw=gv("menu.selectionBackground",{dark:kw,light:kw,hc:kw},o("menuSelectionBackground","Background color of the selected menu item in menus.")),Uw=gv("menu.selectionBorder",{dark:null,light:null,hc:_v},o("menuSelectionBorder","Border color of the selected menu item in menus.")),Kw=gv("menu.separatorBackground",{dark:"#BBBBBB",light:"#888888",hc:pv},o("menuSeparatorBackground","Color of a separator menu item in menus.")),jw=(gv("editor.snippetTabstopHighlightBackground",{dark:new eb(new Z_(124,124,124,.3)),light:new eb(new Z_(10,50,100,.2)),hc:new eb(new Z_(124,124,124,.3))},o("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop.")),gv("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hc:null},o("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop.")),gv("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hc:null},o("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet.")),gv("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new eb(new Z_(10,50,100,.5)),hc:"#525252"},o("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet.")),gv("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hc:"#AB5A00"},o("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),gv("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hc:"#A0A0A0CC"},o("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),gv("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hc:"#AB5A00"},o("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),gv("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hc:"#ffffff"},o("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0)),qw=gv("minimap.errorHighlight",{dark:new eb(new Z_(255,18,18,.7)),light:new eb(new Z_(255,18,18,.7)),hc:new eb(new Z_(255,50,50,1))},o("minimapError","Minimap marker color for errors.")),$w=gv("minimap.warningHighlight",{dark:$v,light:$v,hc:Gv},o("overviewRuleWarning","Minimap marker color for warnings.")),Gw=gv("minimap.background",{dark:null,light:null,hc:null},o("minimapBackground","Minimap background color.")),Yw=gv("minimapSlider.background",{light:eC(Bv,.5),dark:eC(Bv,.5),hc:eC(Bv,.5)},o("minimapSliderBackground","Minimap slider background color.")),Xw=gv("minimapSlider.hoverBackground",{light:eC(Vv,.5),dark:eC(Vv,.5),hc:eC(Vv,.5)},o("minimapSliderHoverBackground","Minimap slider background color when hovering.")),Zw=gv("minimapSlider.activeBackground",{light:eC(Hv,.5),dark:eC(Hv,.5),hc:eC(Hv,.5)},o("minimapSliderActiveBackground","Minimap slider background color when clicked on."));gv("problemsErrorIcon.foreground",{dark:Kv,light:Kv,hc:Kv},o("problemsErrorIconForeground","The color used for the problems error icon.")),gv("problemsWarningIcon.foreground",{dark:$v,light:$v,hc:$v},o("problemsWarningIconForeground","The color used for the problems warning icon.")),gv("problemsInfoIcon.foreground",{dark:Xv,light:Xv,hc:Xv},o("problemsInfoIconForeground","The color used for the problems info icon."));function Qw(e,t){return i=>{let n=iC(e,i);if(n)return n.darken(t)}}function Jw(e,t){return i=>{let n=iC(e,i);if(n)return n.lighten(t)}}function eC(e,t){return i=>{let n=iC(e,i);if(n)return n.transparent(t)}}function tC(e,t,i,n){return o=>{let s=iC(e,o);if(s){let e=iC(t,o);return e?s.isDarkerThan(e)?eb.getLighterColor(s,e,i).transparent(n):eb.getDarkerColor(s,e,i).transparent(n):s.transparent(i*n)}}}function iC(e,t){if(null!==e)return"string"===typeof e?"#"===e[0]?eb.fromHex(e):t.getColor(e):e instanceof eb?e:"function"===typeof e?e(t):void 0}const nC="vscode://schemas/workbench-colors";let oC=Ah.as(Rh.JSONContribution);oC.registerSchema(nC,uv.getColorSchema());const sC=new Vn(()=>oC.notifySchemaChanged(nC),200);uv.onDidChangeSchema(()=>{sC.isScheduled()||sC.schedule()});const rC=gv("editor.lineHighlightBackground",{dark:null,light:null,hc:null},o("lineHighlight","Background color for the highlight of line at the cursor position.")),aC=gv("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hc:"#f38518"},o("lineHighlightBorderBox","Background color for the border around the line at the cursor position.")),lC=gv("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hc:null},o("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),cC=gv("editor.rangeHighlightBorder",{dark:null,light:null,hc:_v},o("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0),dC=gv("editor.symbolHighlightBackground",{dark:fw,light:fw,hc:null},o("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),hC=gv("editor.symbolHighlightBorder",{dark:null,light:null,hc:_v},o("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0),uC=gv("editorCursor.foreground",{dark:"#AEAFAD",light:eb.black,hc:eb.white},o("caret","Color of the editor cursor.")),gC=gv("editorCursor.background",null,o("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),fC=gv("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hc:"#e3e4e229"},o("editorWhitespaces","Color of whitespace characters in the editor.")),mC=gv("editorIndentGuide.background",{dark:fC,light:fC,hc:fC},o("editorIndentGuides","Color of the editor indentation guides.")),pC=gv("editorIndentGuide.activeBackground",{dark:fC,light:fC,hc:fC},o("editorActiveIndentGuide","Color of the active editor indentation guides.")),_C=gv("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hc:eb.white},o("editorLineNumbers","Color of editor line numbers.")),bC=gv("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hc:_v},o("editorActiveLineNumber","Color of editor active line number"),!1,o("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),vC=gv("editorLineNumber.activeForeground",{dark:bC,light:bC,hc:bC},o("editorActiveLineNumber","Color of editor active line number")),wC=gv("editorRuler.foreground",{dark:"#5A5A5A",light:eb.lightgrey,hc:eb.white},o("editorRuler","Color of the editor rulers.")),CC=(gv("editorCodeLens.foreground",{dark:"#999999",light:"#999999",hc:"#999999"},o("editorCodeLensForeground","Foreground color of editor CodeLens")),gv("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hc:"#0064001a"},o("editorBracketMatchBackground","Background color behind matching brackets")),gv("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hc:pv},o("editorBracketMatchBorder","Color for matching brackets boxes")),gv("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hc:"#7f7f7f4d"},o("editorOverviewRulerBorder","Color of the overview ruler border."))),yC=gv("editorOverviewRuler.background",null,o("editorOverviewRulerBackground","Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.")),SC=gv("editorGutter.background",{dark:ew,light:ew,hc:ew},o("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),xC=gv("editorUnnecessaryCode.border",{dark:null,light:null,hc:eb.fromHex("#fff").transparent(.8)},o("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor.")),LC=gv("editorUnnecessaryCode.opacity",{dark:eb.fromHex("#000a"),light:eb.fromHex("#0007"),hc:null},o("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.")),kC=new eb(new Z_(0,122,204,.6)),EC=(gv("editorOverviewRuler.rangeHighlightForeground",{dark:kC,light:kC,hc:kC},o("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),gv("editorOverviewRuler.errorForeground",{dark:new eb(new Z_(255,18,18,.7)),light:new eb(new Z_(255,18,18,.7)),hc:new eb(new Z_(255,50,50,1))},o("overviewRuleError","Overview ruler marker color for errors."))),DC=gv("editorOverviewRuler.warningForeground",{dark:$v,light:$v,hc:Gv},o("overviewRuleWarning","Overview ruler marker color for warnings.")),NC=gv("editorOverviewRuler.infoForeground",{dark:Xv,light:Xv,hc:Zv},o("overviewRuleInfo","Overview ruler marker color for infos."));Af((e,t)=>{const i=e.getColor(ew);i&&t.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${i}; }`);const n=e.getColor(tw);n&&t.addRule(`.monaco-editor, .monaco-editor .inputarea.ime-input { color: ${n}; }`);const o=e.getColor(SC);o&&t.addRule(`.monaco-editor .margin { background-color: ${o}; }`);const s=e.getColor(lC);s&&t.addRule(`.monaco-editor .rangeHighlight { background-color: ${s}; }`);const r=e.getColor(cC);r&&t.addRule(`.monaco-editor .rangeHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${r}; }`);const a=e.getColor(dC);a&&t.addRule(`.monaco-editor .symbolHighlight { background-color: ${a}; }`);const l=e.getColor(hC);l&&t.addRule(`.monaco-editor .symbolHighlight { border: 1px ${"hc"===e.type?"dotted":"solid"} ${l}; }`);const c=e.getColor(fC);c&&(t.addRule(`.monaco-editor .mtkw { color: ${c} !important; }`),t.addRule(`.monaco-editor .mtkz { color: ${c} !important; }`))});class IC extends cv{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new ai(1,1),this._renderResult=null,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(53);const t=e.get(54);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(79);const i=e.get(124);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();return this._lastCursorModelPosition=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(t),2===this._renderLineNumbers||3===this._renderLineNumbers}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 ai(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=s["d"]?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,o='
',r=this._context.model.getLineCount(),a=[];for(let s=i;s<=n;s++){const e=s-i;if(!this._renderFinalNewline&&s===r&&0===this._context.model.getLineLength(s)){a[e]="";continue}const t=this._getLineRenderLineNumber(s);a[e]=t?o+t+"
":""}this._renderResult=a}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}IC.CLASS_NAME="line-numbers",Af((e,t)=>{const i=e.getColor(_C);i&&t.addRule(`.monaco-editor .line-numbers { color: ${i}; }`);const n=e.getColor(vC);n&&t.addRule(`.monaco-editor .current-line ~ .line-numbers { color: ${n}; }`)});class TC extends Lm{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._canUseLayerHinting=!t.get(25),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=am(document.createElement("div")),this._domNode.setClassName(TC.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=am(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(TC.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(124);return this._canUseLayerHinting=!t.get(25),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)}}TC.CLASS_NAME="glyph-margin",TC.OUTER_CLASS_NAME="margin";i("53d7");const MC="monaco-mouse-cursor-text";class OC{constructor(e,t,i){this.top=e,this.left=t,this.width=i}setWidth(e){return new OC(this.top,this.left,e)}}const AC=cn;class RC extends Lm{constructor(e,t,i){super(e),this._primaryCursorPosition=new ai(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._viewHelper=i,this._scrollLeft=0,this._scrollTop=0;const n=this._context.configuration.options,r=n.get(124);this._setAccessibilityOptions(n),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=n.get(38),this._lineHeight=n.get(53),this._emptySelectionClipboard=n.get(28),this._copyWithSyntaxHighlighting=n.get(18),this._visibleTextArea=null,this._selections=[new ci(1,1,1,1)],this._modelSelections=[new ci(1,1,1,1)],this._lastRenderPosition=null,this.textArea=am(document.createElement("textarea")),km.write(this.textArea,6),this.textArea.setClassName("inputarea "+MC),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(107))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",o("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),s["i"]&&n.get(75)&&this.textArea.setAttribute("readonly","true"),this.textAreaCover=am(document.createElement("div")),this.textAreaCover.setPosition("absolute");const a={getLineCount:()=>this._context.model.getLineCount(),getLineMaxColumn:e=>this._context.model.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.model.getValueInRange(e,t)},l={getDataToCopy:e=>{const t=this._context.model.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,s["j"]),i=this._context.model.getEOL(),n=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),o=Array.isArray(t)?t:null,r=Array.isArray(t)?t.join(i):t;let a=void 0,l=null;if(e&&(ov.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&r.length<65536)){const e=this._context.model.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(a=e.html,l=e.mode)}return{isFromEmptySelection:n,multicursorText:o,text:r,html:a,mode:l}},getScreenReaderContent:e=>{if(1===this._accessibilitySupport){if(s["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 iv(i,i.length,i.length,t,t)}}return iv.EMPTY}return nv.fromEditorSelection(e,a,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.model.deduceModelPositionRelativeToViewPosition(e,t,i)};this._textAreaInput=this._register(new rv(l,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="undefined"!==typeof 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.replaceCharCnt?this._viewController.replacePreviousChar(e.text,e.replaceCharCnt):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.moveOneCharacterLeft?1:0);this._context.model.revealRange("keyboard",!0,new li(t,i,t,i),0,1);const n=this._viewHelper.visibleRangeForPositionRelativeToEditor(t,i);n&&(this._visibleTextArea=new OC(this._context.viewLayout.getVerticalOffsetForLineNumber(t),n.left,AC?0:1),this._render()),this.textArea.setClassName(`inputarea ${MC} ime-input`),this._viewController.compositionStart(),this._context.model.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(e=>{this._visibleTextArea=this._visibleTextArea.setWidth(PC(e.data,this._fontInfo)),this._render()})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName("inputarea "+MC),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()}_getWordBeforePosition(e){const t=this._context.model.getLineContent(e.lineNumber),i=n_(this._context.configuration.options.get(110));let n=e.column,o=0;while(n>1){const s=t.charCodeAt(n-2),r=i.get(s);if(0!==r||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),i=t.charAt(e.column-2);if(!rs["D"](i.charCodeAt(0)))return i}return""}_getAriaLabel(e){const t=e.get(2);return 1===t?o("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",s["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===pe.accessibilityPageSize.defaultValue?this._accessibilityPageSize=100:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(124);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(38),this._lineHeight=t.get(53),this._emptySelectionClipboard=t.get(28),this._copyWithSyntaxHighlighting=t.get(18),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(107))),s["i"]&&e.hasChanged(75)&&(t.get(75)?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 ai(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():s["f"]?this._renderInsideEditor(this._primaryCursorPosition,t,e,AC?0:1,this._lineHeight):this._renderInsideEditor(this._primaryCursorPosition,t,e,AC?0:1,AC?0:1)}_renderInsideEditor(e,t,i,n,o){this._lastRenderPosition=e;const s=this.textArea,r=this.textAreaCover;jg.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(jg.applyFontInfo(e,this._fontInfo),e.setTop(0),e.setLeft(0),t.setTop(0),t.setLeft(0),AC)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(44)?t.setClassName("monaco-editor-background textAreaCover "+TC.OUTER_CLASS_NAME):0!==i.get(54).renderType?t.setClassName("monaco-editor-background textAreaCover "+IC.CLASS_NAME):t.setClassName("monaco-editor-background textAreaCover")}}function PC(e,t){const i=document.createElement("canvas"),n=i.getContext("2d");n.font=FC(t);const o=n.measureText(e);return cn?o.width+2:o.width}function FC(e){return WC("normal",e.fontWeight,e.fontSize,e.lineHeight,e.fontFamily)}function WC(e,t,i,n,o){return`${e} normal ${t} ${i}px / ${n}px ${o}`}class BC{static columnSelect(e,t,i,n,o,s){let r=Math.abs(o-i)+1,a=i>o,l=n>s,c=ns)continue;if(fn)continue;if(g1&&n--,BC.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 a=o;a<=s;a++){const i=t.getLineMaxColumn(a),o=Mb.visibleColumnFromColumn2(e,t,new ai(a,i));n=Math.max(n,o)}let r=i.toViewVisualColumn;return re.getLineMinColumn(t)?i-=rs["K"](e.getLineContent(t),i-1):t>1&&(t-=1,i=e.getLineMaxColumn(t)),new ai(t,i)}static leftPositionAtomicSoftTabs(e,t,i,n){const o=e.getLineMinColumn(t),s=e.getLineContent(t),r=Ab.atomicPosition(s,i-1,n,0);return-1===r||r+1l?(i=l,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=Mb.columnFromVisibleColumn2(e,t,i,a),o=c?0:a-Mb.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),new KC(i,n,o)}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=jC.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 n=i.selection,o=jC.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=jC.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new kb(new li(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new ai(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,n,o,s,r){const a=Mb.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+o,l=1===i&&1===n;return i-=s,i<1?(i=1,n=r?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=Mb.columnFromVisibleColumn2(e,t,i,a),o=l?0:a-Mb.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),new KC(i,n,o)}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=jC.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 n=i.selection,o=jC.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=jC.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new kb(new li(o.lineNumber,o.column,o.lineNumber,o.column),o.leftoverVisibleColumns,new ai(s.lineNumber,s.column),s.leftoverVisibleColumns)}static moveToBeginningOfLine(e,t,i,n){let o,s=i.position.lineNumber,r=t.getLineMinColumn(s),a=t.getLineFirstNonWhitespaceColumn(s)||r,l=i.position.column;return o=l===a?r:a,i.move(n,s,o,0)}static moveToEndOfLine(e,t,i,n,o){let s=i.position.lineNumber,r=t.getLineMaxColumn(s);return i.move(n,s,r,o?1073741824-r:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){let o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(n,o,s,0)}}class qC{static deleteRight(e,t,i,n){let o=[],s=3!==e;for(let r=0,a=n.length;r=l.length+1)return!1;const c=l.charAt(a.column-2),d=i.get(c);if(!d)return!1;if(Ob(c)){if("never"===t)return!1}else if("never"===e)return!1;const h=l.charAt(a.column-1);let u=!1;for(const e of d)e.open===c&&e.close===h&&(u=!0);if(!u)return!1}return!0}static _runAutoClosingPairDelete(e,t,i){let n=[];for(let o=0,s=i.length;o1){let e=i.getLineContent(n.lineNumber),o=rs["u"](e),s=-1===o?e.length+1:o+1;if(n.column<=s){let e=Mb.visibleColumnFromColumn2(t,i,n),o=Mb.prevIndentTabStop(e,t.indentSize),s=Mb.columnFromVisibleColumn2(t,i,n.lineNumber,o);a=new li(n.lineNumber,s,n.lineNumber,n.column)}else a=new li(n.lineNumber,n.column-1,n.lineNumber,n.column)}else{let e=jC.left(t,i,n.lineNumber,n.column);a=new li(e.lineNumber,e.column,n.lineNumber,n.column)}}a.isEmpty()?o[r]=null:(a.startLineNumber!==a.endLineNumber&&(s=!0),o[r]=new VC(a,""))}return[s,o]}static cut(e,t,i){let n=[];for(let o=0,s=i.length;o1?(e=l.lineNumber-1,i=t.getLineMaxColumn(l.lineNumber-1),r=l.lineNumber,a=t.getLineMaxColumn(l.lineNumber)):(e=l.lineNumber,i=1,r=l.lineNumber,a=t.getLineMaxColumn(l.lineNumber));let c=new li(e,i,r,a);c.isEmpty()?n[o]=null:n[o]=new VC(c,"")}else n[o]=null;else n[o]=new VC(s,"")}return new Tb(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class $C{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=$C._findPreviousWordOnLine(e,t,new ai(o,s));if(0===n)return new ai(o,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start===1&&0===r.nextCharClass&&(r=$C._findPreviousWordOnLine(e,t,new ai(o,r.start+1))),new ai(o,r?r.start+1:1);if(3===n){while(r&&2===r.wordType)r=$C._findPreviousWordOnLine(e,t,new ai(o,r.start+1));return new ai(o,r?r.start+1:1)}return r&&s<=r.end+1&&(r=$C._findPreviousWordOnLine(e,t,new ai(o,r.start+1))),new ai(o,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new ai(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let s=t.column-1;s>1;s--){const e=o.charCodeAt(s-2),t=o.charCodeAt(s-1);if(95===e&&95!==t)return new ai(i,s);if(rs["F"](e)&&rs["G"](t))return new ai(i,s);if(rs["G"](e)&&rs["G"](t)&&s+1=a.start+1&&(a=$C._findNextWordOnLine(e,t,new ai(o,a.end+1))),s=a?a.start+1:t.getLineMaxColumn(o);return new ai(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?l=1:(a--,l=n.getLineMaxColumn(a)):(c&&l<=c.end+1&&(c=$C._findPreviousWordOnLine(i,n,new ai(a,c.start+1))),c?l=c.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new li(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new ai(i.positionLineNumber,i.positionColumn);let o=this._deleteInsideWordWhitespace(t,n);return o||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;while(o>0&&this._charAtIsWhitespace(i,o-1))o--;while(s+11?new li(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 li(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,s=!1;while(i-11&&this._charAtIsWhitespace(n,t-2))t--;return r(t,i)},l=$C._findPreviousWordOnLine(e,t,i);if(l&&s(l))return a(l);const c=$C._findNextWordOnLine(e,t,i);return c&&s(c)?a(c):l&&c?r(l.end+1,c.start+1):l?r(l.start+1,l.end+1):c?r(c.start+1,c.end+1):r(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=$C._moveWordPartLeft(e,i);return new li(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let n=t;n=h.start+1&&(h=$C._findNextWordOnLine(i,n,new ai(a,h.end+1))),h?l=h.start+1:lt&&(i=t,n=e.model.getLineMaxColumn(i)),Ib.fromModelState(new kb(new li(s.lineNumber,1,i,n),0,new ai(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)),Ib.fromViewState(t.viewState.move(t.modelState.hasSelection(),n,o,0))}{const e=t.modelState.selectionStart.getEndPosition();return Ib.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 Ib.fromModelState($C.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Ib(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Ib.fromViewState(new kb(new li(i,n,i,n),0,new ai(i,n),0))}static moveTo(e,t,i,n,o){const s=e.model.validatePosition(n),r=o?e.coordinatesConverter.validateViewPosition(new ai(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return Ib.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 this._moveToViewMinColumn(e,t,n);case 5:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 6:return this._moveToViewCenterColumn(e,t,n);case 7:return this._moveToViewMaxColumn(e,t,n);case 8: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 9:{const i=this._firstLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 11:{const i=this._lastLineNumberInRange(e.model,r,o),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 10:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 12:{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;r1){let t=Mb.visibleColumnFromColumn(h,u+1,o);if(t%s!==0&&e.isCheapToTokenize(d-1)){let t=ec.getEnterAction(this._opts.autoIndent,e,new li(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)));if(t){if(c=l,t.appendText)for(let e=0,i=t.appendText.length;e1){let n;for(n=i-1;n>=1;n--){const e=t.getLineContent(n),i=rs["H"](e);if(i>=0)break}if(n<1)return null;const s=t.getLineMaxColumn(n),r=ec.getEnterAction(e.autoIndent,t,new li(n,s,n,s));r&&(o=r.indentation+r.appendText)}return n&&(n===pl.Indent&&(o=ey.shiftIndent(e,o)),n===pl.Outdent&&(o=ey.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="",s=i.getStartPosition();if(e.insertSpaces){let i=Mb.visibleColumnFromColumn2(e,t,s),n=e.indentSize,r=n-i%n;for(let e=0;e=4){const o=ec.getIndentForEnter(e.autoIndent,t,n,{unshiftIndent:t=>ey.unshiftIndent(e,t),shiftIndent:t=>ey.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)});if(o){let s=Mb.visibleColumnFromColumn2(e,t,n.getEndPosition());const r=n.endColumn,a=t.getLineContent(n.endLineNumber),l=rs["u"](a);if(n=l>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,l+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new HC(n,"\n"+e.normalizeIndentation(o.afterEnter),!0);{let t=0;return r<=l+1&&(e.insertSpaces||(s=Math.ceil(s/e.indentSize)),t=Math.min(s+1-e.normalizeIndentation(o.afterEnter).length-1,0)),new zC(n,"\n"+e.normalizeIndentation(o.afterEnter),0,t,!0)}}}return ey._typeCommand(n,"\n"+e.normalizeIndentation(r),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;ney.shiftIndent(e,t),unshiftIndent:t=>ey.unshiftIndent(e,t)});if(null===s)return null;if(s!==e.normalizeIndentation(o)){const o=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===o?ey._typeCommand(new li(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+n,!1):ey._typeCommand(new li(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;if(92===h&&d)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 r of o)if(null===s||r.open.length>s.open.length){let e=!0;for(const o of i){const i=t.getValueInRange(new li(o.lineNumber,o.column-r.open.length+1,o.lineNumber,o.column));if(i+n!==r.open){e=!1;break}}e&&(s=r)}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 s of n)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o?o.close:""}static _getAutoClosingPairClose(e,t,i,n,o){const s=Ob(n),r=s?e.autoClosingQuotes:e.autoClosingBrackets;if("never"===r)return null;const a=this._findAutoClosingPairOpen(e,t,i.map(e=>e.getPosition()),n);if(!a)return null;const l=this._findSubAutoClosingPairClose(e,a);let c=!0;const d=s?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;for(let u=0,g=i.length;ug.column-1){const t=f.charAt(g.column-1),i=ey._isBeforeClosingBrace(e,m);if(!i&&!d(t))return null}if(!t.isCheapToTokenize(g.lineNumber))return null;if(1===a.open.length&&s&&"always"!==r){const t=n_(e.wordSeparators);if(o&&g.column>1&&0===t.get(f.charCodeAt(g.column-2)))return null;if(!o&&g.column>2&&0===t.get(f.charCodeAt(g.column-3)))return null}t.forceTokenization(g.lineNumber);const p=t.getLineTokens(g.lineNumber);let _=!1;try{_=ec.shouldAutoClosePair(a,p,o?g.column:g.column-1)}catch(h){ve(h)}if(!_)return null}return c?a.close.substring(0,a.close.length-l.length):a.close}static _runAutoClosingOpenCharType(e,t,i,n,o,s,r){let a=[];for(let l=0,c=n.length;lnew VC(new li(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1));return new Tb(1,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const a=this._getAutoClosingPairClose(t,i,o,r,!1);return null!==a?this._runAutoClosingOpenCharType(e,t,i,o,r,!1,a):null}static typeWithInterceptors(e,t,i,n,o,s,r){if(!e&&"\n"===r){let e=[];for(let t=0,s=o.length;t{const i=e.get(Ji).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)}),e.addImplementation(1e3,(e,t)=>{const i=document.activeElement;return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(),!0)}),e.addImplementation(0,(e,t)=>{const i=e.get(Ji).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))})}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}(function(e){class t extends oy{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[GC.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),e.revealPrimaryCursor(t.source,!0)}}e.MoveTo=Xf(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=Xf(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends oy{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=>Ib.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=Xf(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 ai(n.viewPosition.lineNumber,n.viewPosition.column),o);let r=n.doColumnSelect?i.fromViewLineNumber:s.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return BC.columnSelect(e.cursorConfig,e,r,a,s.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=Xf(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return BC.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=Xf(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return BC.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return BC.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=Xf(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=Xf(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return BC.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=Xf(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=Xf(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends oy{constructor(){super({id:"cursorMove",precondition:void 0,description:YC.description})}runCoreEditorCommand(e,t){const i=YC.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,r._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:return GC.simpleMove(e,t,i.direction,n,o,i.unit);case 9:case 11:case 10:case 12:return GC.viewportMove(e,t,i.direction,n,o);default:return null}}}e.CursorMoveImpl=r,e.CursorMove=Xf(new r);class a extends oy{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,GC.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=Xf(new a({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=Xf(new a({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1039}})),e.CursorRight=Xf(new a({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=Xf(new a({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1041}})),e.CursorUp=Xf(new a({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=Xf(new a({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=Xf(new a({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:11}})),e.CursorPageUpSelect=Xf(new a({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1035}})),e.CursorDown=Xf(new a({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=Xf(new a({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=Xf(new a({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:12}})),e.CursorPageDownSelect=Xf(new a({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1036}})),e.CreateCursor=Xf(new class extends oy{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let i;i=t.wholeLine?GC.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):GC.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 li(o,1,o,e.model.getLineMaxColumn(o));let a=0;if(i.at)switch(i.at){case ry.RawAtArgument.Top:a=3;break;case ry.RawAtArgument.Center:a=1;break;case ry.RawAtArgument.Bottom:a=4;break;default:break}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends ly{constructor(){super(sm)}runDOMCommand(){cn&&(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,[GC.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=Xf(new class extends oy{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[Ib.fromModelSelection(t.selection)])}})})(ay||(ay={}));const cy=tf.and(iy.textInputFocus,iy.columnSelection);function dy(e,t){Wu.registerKeybindingRule({id:e,primary:t,when:cy,weight:ny+1})}function hy(e){return e.register(),e}var uy,gy;dy(ay.CursorColumnSelectLeft.id,1039),dy(ay.CursorColumnSelectRight.id,1041),dy(ay.CursorColumnSelectUp.id,1040),dy(ay.CursorColumnSelectPageUp.id,1035),dy(ay.CursorColumnSelectDown.id,1042),dy(ay.CursorColumnSelectPageDown.id,1036),function(e){class t extends Gf{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=Xf(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:iy.writable,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,ey.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=Xf(new class extends t{constructor(){super({id:"outdent",precondition:iy.writable,kbOpts:{weight:ny,kbExpr:tf.and(iy.editorTextFocus,iy.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,ey.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=Xf(new class extends t{constructor(){super({id:"tab",precondition:iy.writable,kbOpts:{weight:ny,kbExpr:tf.and(iy.editorTextFocus,iy.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,ey.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=Xf(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,o]=qC.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,o),t.setPrevEditOperationType(2)}}),e.DeleteRight=Xf(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:ny,kbExpr:iy.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,o]=qC.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 ly{constructor(){super(nm)}runDOMCommand(){document.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(75))return t.getModel().undo()}},e.Redo=new class extends ly{constructor(){super(om)}runDOMCommand(){document.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(75))return t.getModel().redo()}}}(uy||(uy={}));class fy extends jf{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Ji).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function my(e,t){hy(new fy("default:"+e,e)),hy(new fy(e,e,t))}my("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),my("replacePreviousChar"),my("compositionStart"),my("compositionEnd"),my("paste"),my("cut");class py{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)}replacePreviousChar(e,t){this.commandDelegate.replacePreviousChar(e,t)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){ay.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){ay.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_moveToSelect(e){ay.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_columnSelect(e,t,i){e=this._validateViewColumn(e),ay.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),ay.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e){ay.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelect(e){ay.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_wordSelectDrag(e){ay.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorWordSelect(e){ay.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelect(e){ay.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lineSelectDrag(e){ay.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelect(e){ay.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_lastCursorLineSelectDrag(e){ay.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e))}_selectAll(){ay.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 _y{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 _y.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){return new by(e.element,e.type,e.mouseColumn,e.position?t.convertViewPositionToModelPosition(e.position):null,e.range?t.convertViewRangeToModelRange(e.range):null,e.detail)}}class by{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 Pb.toString(this)}}class vy{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 a=i;a<=n;a++){const i=a-this._rendLineNumberStart;e<=a&&a<=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){const t=this._lines.splice(e-this._rendLineNumberStart,o-e+1);return t}const s=[];for(let d=0;di)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 wy{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new vy(()=>this._host.createVisibleLine())}_createDomNode(){const e=am(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(124)}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 i=0,n=t.length;it){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,n=t-e+1;n>0&&(this._removeLinesAfter(o,n),o.linesLength-=n)}return this._finishRendering(o,!1,n),o}_renderUntouchedLines(e,t,i,n,o){const s=e.rendLineNumberStart,r=e.lines;for(let a=t;a<=i;a++){const e=s+a;r[a].layoutLine(e,n[e-o])}}_insertLinesBefore(e,t,i,n,o){const s=[];let r=0;for(let a=t;a<=i;a++)s[r++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;r--){const t=e.lines[r];n[r]&&(t.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");Cy._ttPolicy&&(t=Cy._ttPolicy.createHTML(t)),n.innerHTML=t;for(let o=0;oe}),Cy._sb=El(1e5);class yy extends Lm{constructor(e){super(e),this._visibleLines=new wy(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 xy extends yy{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(124);return this._contentWidth=i.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 Ly extends yy{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),jg.applyFontInfo(this.domNode,t.get(38))}onConfigurationChanged(e){const t=this._context.configuration.options;jg.applyFontInfo(this.domNode,t.get(38));const i=t.get(124);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 ky{constructor(e,t){this.top=e,this.left=t}}class Ey extends Lm{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=am(document.createElement("div")),km.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=am(document.createElement("div")),km.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 Dy(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){const n=this._widgets[e.getId()];n.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 Dy{constructor(e,t,i){this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=am(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(124);this._fixedOverflowWidgets=n.get(32),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=n.get(53),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(53),e.hasChanged(124)){const e=t.get(124);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=o.viewportHeight-a,c=s-n,d=r>=n,h=a,u=l>=n;let g=e.left,f=t.left;return g+i>o.scrollLeft+o.viewportWidth&&(g=o.scrollLeft+o.viewportWidth-i),f+i>o.scrollLeft+o.viewportWidth&&(f=o.scrollLeft+o.viewportWidth-i),gs){const e=r-(s-n);r-=e,i-=e}if(r=m,b=c+n<=d.height-p;return this._fixedOverflowWidgets?{fitsAbove:_,aboveTop:Math.max(l,m),aboveLeft:u,fitsBelow:b,belowTop:c,belowLeft:f}:{fitsAbove:_,aboveTop:s,aboveLeft:h,fitsBelow:b,belowTop:r,belowLeft:g}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new ky(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 d of t)d.lineNumbern.lineNumber&&(n=d);let o=1073741824;for(const d of i.ranges)d.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&&Ny(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&&Ny(this._actual.afterRender,this._actual,this._renderData.position)}}function Ny(e,t,...i){try{return e.call(t,...i)}catch(n){return null}}i("a2e5");let Iy=!0;class Ty extends cv{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(124);this._lineHeight=t.get(53),this._renderLineHighlight=t.get(80),this._renderLineHighlightOnlyWhenFocus=t.get(81),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ci(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=Iy?this._selections.slice(0,1):this._selections,i=t.map(e=>e.positionLineNumber);i.sort((e,t)=>e-t),nc(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(124);return this._lineHeight=t.get(53),this._renderLineHighlight=t.get(80),this._renderLineHighlightOnlyWhenFocus=t.get(81),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 a=i;a<=n;a++){const e=a-i;while(s=this._renderData.length?"":this._renderData[i]}}class My extends Ty{_renderOne(e){const t="current-line"+(this._shouldRenderOther()?" current-line-both":"");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 Oy extends Ty{_renderOne(e){const t="current-line"+(this._shouldRenderMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"");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)}}Af((e,t)=>{Iy=!1;const i=e.getColor(rC);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(aC)){const i=e.getColor(aC);i&&(Iy=!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; }")))}});i("cc1a");class Ay extends cv{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(53),this._typicalHalfwidthCharacterWidth=t.get(38).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(53),this._typicalHalfwidthCharacterWidth=t.get(38).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 a=0,l=t.length;a{if(e.options.zIndext.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return in?1:li.compareRangesUsingStarts(e.range,t.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,r=[];for(let a=o;a<=s;a++){const e=a-o;r[e]=""}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 r=0,a=t.length;r',l=Math.max(e.range.startLineNumber,o),c=Math.min(e.range.endLineNumber,s);for(let t=l;t<=c;t++){const e=t-o;i[e]+=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,c=t.length;l';r[t]+=a}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}i("7043");class Ry extends We{onclick(e,t){this._register(Zn(e,Wo.CLICK,e=>t(new Tn(e))))}onmousedown(e,t){this._register(Zn(e,Wo.MOUSE_DOWN,e=>t(new Tn(e))))}onmouseover(e,t){this._register(Zn(e,Wo.MOUSE_OVER,e=>t(new Tn(e))))}onnonbubblingmouseout(e,t){this._register(to(e,e=>t(new Tn(e))))}onkeydown(e,t){this._register(Zn(e,Wo.KEY_DOWN,e=>t(new Ln(e))))}onkeyup(e,t){this._register(Zn(e,Wo.KEY_UP,e=>t(new Ln(e))))}oninput(e,t){this._register(Zn(e,Wo.INPUT,t))}onblur(e,t){this._register(Zn(e,Wo.BLUR,t))}onfocus(e,t){this._register(Zn(e,Wo.FOCUS,t))}ignoreGesture(e){gm.ignoreTarget(e)}}const Py=11;class Fy extends Ry{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","undefined"!==typeof e.top&&(this.bgDomNode.style.top="0px"),"undefined"!==typeof e.left&&(this.bgDomNode.style.left="0px"),"undefined"!==typeof e.bottom&&(this.bgDomNode.style.bottom="0px"),"undefined"!==typeof 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=Py+"px",this.domNode.style.height=Py+"px","undefined"!==typeof e.top&&(this.domNode.style.top=e.top+"px"),"undefined"!==typeof e.left&&(this.domNode.style.left=e.left+"px"),"undefined"!==typeof e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),"undefined"!==typeof e.right&&(this.domNode.style.right=e.right+"px"),this._mouseMoveMonitor=this._register(new mm),this.onmousedown(this.bgDomNode,e=>this._arrowMouseDown(e)),this.onmousedown(this.domNode,e=>this._arrowMouseDown(e)),this._mousedownRepeatTimer=this._register(new Bn),this._mousedownScheduleRepeatTimer=this._register(new Wn)}_arrowMouseDown(e){const t=()=>{this._mousedownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancelAndSet(t,200),this._mouseMoveMonitor.startMonitoring(e.target,e.buttons,fm,e=>{},()=>{this._mousedownRepeatTimer.cancel(),this._mousedownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class Wy extends We{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 Wn)}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":"")))}}const By=140;class Vy extends Ry{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 Wy(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._mouseMoveMonitor=this._register(new mm),this._shouldRender=!0,this.domNode=am(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 Fy(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=am(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 n=bo(this.domNode.domNode);t=e.posx-n.left,i=e.posy-n.top}const n=this._mouseDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),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,fm,e=>{const t=this._sliderOrthogonalMousePosition(e),r=Math.abs(t-n);if(s["j"]&&r>By)return void this._setDesiredScrollPositionNow(o.getScrollPosition());const a=this._sliderMousePosition(e),l=a-i;this._setDesiredScrollPositionNow(o.getDesiredScrollPositionFromDelta(l))},()=>{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()}}const Hy=20;class zy{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 zy(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(Hy,Math.floor(i*r/n))),c=(r-l)/(n-i),d=o*c;return{computedAvailableSize:Math.round(s),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:c,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=zy._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 Mn(null,1,0))}),this._createArrow({className:"scra",icon:Ky,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Mn(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 qy=ma("scrollbar-button-up",pa.triangleUp),$y=ma("scrollbar-button-down",pa.triangleDown);class Gy extends Vy{constructor(e,t,i){const n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new zy(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-Py)/2,i=(t.verticalScrollbarSize-Py)/2;this._createArrow({className:"scra",icon:qy,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Mn(null,0,1))}),this._createArrow({className:"scra",icon:$y,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Mn(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}}class Yy{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 Yy("undefined"!==typeof e.width?e.width:this.width,"undefined"!==typeof e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,"undefined"!==typeof e.height?e.height:this.height,"undefined"!==typeof e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new Yy(this.width,this.scrollWidth,"undefined"!==typeof e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,"undefined"!==typeof 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 Xy extends We{constructor(e,t){super(),this._onScroll=this._register(new Ye),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e,this._scheduleAtNextAnimationFrame=t,this._state=new Yy(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:"undefined"===typeof e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:"undefined"===typeof 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 eS(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=eS.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 Zy{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function Qy(e,t){const i=t-e;return function(t){return e+i*iS(t)}}function Jy(e,t,i){return function(n){return n2.5*i){let n,o;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){const t=Math.abs(Math.round(e)-e);return t<.01}}aS.INSTANCE=new aS;class lS extends Ry{constructor(e,t,i){super(),this._onScroll=this._register(new Ye),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Ye),e.style.overflow="hidden",this._options=uS(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 Gy(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new jy(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=am(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=am(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=am(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"),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 Wn),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Ae(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,s["f"]&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){"undefined"!==typeof e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),"undefined"!==typeof e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),"undefined"!==typeof e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),"undefined"!==typeof e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),"undefined"!==typeof e.horizontalScrollbarSize&&this._horizontalScrollbar.updateScrollbarSize(e.horizontalScrollbarSize),this._options.lazyRender||this._render()}_setListeningToMouseWheel(e){const t=this._mouseWheelToDispose.length>0;if(t!==e&&(this._mouseWheelToDispose=Ae(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new Mn(e))};this._mouseWheelToDispose.push(Zn(this._listenOnDomNode,Wo.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){const t=aS.INSTANCE;if(sS){const i=window.devicePixelRatio/sn();s["j"]||s["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 r=!s["f"]&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!r||o||(o=n,n=0),e.browserEvent&&e.browserEvent.altKey&&(o*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);const a=this._scrollable.getFutureScrollPosition();let l={};if(n){const e=a.scrollTop-oS*n;this._verticalScrollbar.writeScrollPosition(l,e)}if(o){const e=a.scrollLeft-oS*o;this._horizontalScrollbar.writeScrollPosition(l,e)}if(l=this._scrollable.validateScrollPosition(l),a.scrollLeft!==l.scrollLeft||a.scrollTop!==l.scrollTop){const e=sS&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel();e?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),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;this._leftShadowDomNode.setClassName("shadow"+(i?" left":"")),this._topShadowDomNode.setClassName("shadow"+(t?" top":"")),this._topLeftShadowDomNode.setClassName("shadow top-left-corner"+(t?" top":"")+(i?" left":""))}}_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(),nS)}}class cS extends lS{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Xy(0,e=>oo(e));super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class dS extends lS{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 hS extends cS{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 uS(e){const t={lazyRender:"undefined"!==typeof e.lazyRender&&e.lazyRender,className:"undefined"!==typeof e.className?e.className:"",useShadows:"undefined"===typeof e.useShadows||e.useShadows,handleMouseWheel:"undefined"===typeof e.handleMouseWheel||e.handleMouseWheel,flipAxes:"undefined"!==typeof e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:"undefined"!==typeof e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:"undefined"!==typeof e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:"undefined"!==typeof e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:"undefined"!==typeof e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:"undefined"!==typeof e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:"undefined"===typeof e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:"undefined"===typeof e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:"undefined"!==typeof e.arrowSize?e.arrowSize:11,listenOnDomNode:"undefined"!==typeof e.listenOnDomNode?e.listenOnDomNode:null,horizontal:"undefined"!==typeof e.horizontal?e.horizontal:1,horizontalScrollbarSize:"undefined"!==typeof e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:"undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:"undefined"!==typeof e.horizontalHasArrows&&e.horizontalHasArrows,vertical:"undefined"!==typeof e.vertical?e.vertical:1,verticalScrollbarSize:"undefined"!==typeof e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:"undefined"!==typeof e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:"undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:"undefined"!==typeof e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize="undefined"!==typeof e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize="undefined"!==typeof e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,s["f"]&&(t.className+=" mac"),t}class gS extends Lm{constructor(e,t,i,n){super(e);const o=this._context.configuration.options,s=o.get(87),r=o.get(61),a=o.get(30),l=o.get(90),c={listenOnDomNode:i.domNode,className:"editor-scrollable "+If(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 dS(t.domNode,c,this._context.viewLayout.getScrollable())),km.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=am(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(Zn(i.domNode,"scroll",e=>d(i.domNode,!0,!0))),this._register(Zn(t.domNode,"scroll",e=>d(t.domNode,!0,!1))),this._register(Zn(n.domNode,"scroll",e=>d(n.domNode,!0,!1))),this._register(Zn(this.scrollbarDomNode.domNode,"scroll",e=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(124);this.scrollbarDomNode.setLeft(t.contentLeft);const i=e.get(59),n=i.side;"right"===n?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(87)||e.hasChanged(61)||e.hasChanged(30)){const e=this._context.configuration.options,t=e.get(87),i=e.get(61),n=e.get(30),o=e.get(90),s={handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:o};this.scrollbar.updateOptions(s)}return e.hasChanged(124)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+If(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}i("df70");class fS{constructor(e,t,i){this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class mS extends cv{_render(e,t,i){const n=[];for(let r=e;r<=t;r++){const t=r-e;n[t]=[]}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',l=[];for(let c=t;c<=i;c++){const e=c-t,i=n[e];0===i.length?l[e]="":l[e]='
=this._renderResult.length?"":this._renderResult[i]}}i("9c85");class _S extends cv{constructor(e){super(),this._context=e,this._primaryLineNumber=0;const t=this._context.configuration.options,i=t.get(125),n=t.get(38);this._lineHeight=t.get(53),this._spaceWidth=n.spaceWidth,this._enabled=t.get(78),this._activeIndentEnabled=t.get(47),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(125),n=t.get(38);return this._lineHeight=t.get(53),this._spaceWidth=n.spaceWidth,this._enabled=t.get(78),this._activeIndentEnabled=t.get(47),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,c=0,d=0;if(this._activeIndentEnabled&&this._primaryLineNumber){const e=this._context.model.getActiveIndentGuide(this._primaryLineNumber,t,i);l=e.startLineNumber,c=e.endLineNumber,d=e.indent}const h=[];for(let u=t;u<=i;u++){const i=l<=u&&u<=c,n=u-t,g=a[n];let f="";if(g>=1){const t=e.visibleRangeForPosition(new ai(u,1));let n=t?t.left:0;for(let e=1;e<=g;e++){const t=i&&e===d?"cigra":"cigr";if(f+=`
`,n+=o,n>s||this._maxIndentLeft>0&&n>this._maxIndentLeft)break}}h[n]=f}this._renderResult=h}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Af((e,t)=>{const i=e.getColor(mC);i&&t.addRule(`.monaco-editor .lines-content .cigr { box-shadow: 1px 0 0 0 ${i} inset; }`);const n=e.getColor(pC)||i;n&&t.addRule(`.monaco-editor .lines-content .cigra { box-shadow: 1px 0 0 0 ${n} inset; }`)});i("11cb");class bS{constructor(){this._currentVisibleRange=new li(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class vS{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 wS{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 r=1,a=e.length;r{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new Vn(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new bS,this._horizontalRevealRequest=null}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Vm(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(125)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(38),n=t.get(125);return this._lineHeight=t.get(53),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(84),this._cursorSurroundingLines=t.get(22),this._cursorSurroundingLinesStyle=t.get(23),this._canUseLayerHinting=!t.get(25),jg.applyFontInfo(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(124)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new Bm(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++){const e=this._visibleLines.getVisibleLine(t);e.onOptionsChanged(this._viewLineOptions)}return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let o=t;o<=i;o++)n=this._visibleLines.getVisibleLine(o).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 vS(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 wS(e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop),o=n<=this._lineHeight?1:e.scrollType;return this._context.model.setScrollPosition(i,o),!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 ai(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=li.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let o=[],s=0;const r=new Wm(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new ai(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),c=this._visibleLines.getEndLineNumber();for(let d=n.startLineNumber;d<=n.endLineNumber;d++){if(dc)continue;const e=d===n.startLineNumber?n.startColumn:1,h=d===n.endLineNumber?n.endColumn:this._context.model.getLineMaxColumn(d),u=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(e,h,r);if(u){if(t&&dthis._visibleLines.getEndLineNumber()?null:this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(t,i,new Wm(this.domNode.domNode,this._textRangeRestingSpot))}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new Tm(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 o=i;o<=n;o++){const e=this._visibleLines.getVisibleLine(o);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(),s["d"]&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++){const e=this._visibleLines.getVisibleLine(i);if(e.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;u=c}else if(5===o||6===o)if(6===o&&s<=c&&d<=a)u=s;else{const e=Math.max(5*this._lineHeight,.2*r),t=c-e,i=d-r;u=Math.max(i,t)}else if(1===o||2===o)if(2===o&&s<=c&&d<=a)u=s;else{const e=(c+d)/2;u=Math.max(0,e-r/2)}else u=this._computeMinimumScrolling(s,a,c,d,3===o,4===o);return u}_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 a of e.selections){if(a.startLineNumber!==a.endLineNumber)return null;const e=this._visibleRangesForLineRange(a.startLineNumber,a.startColumn,a.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)}if(o=Math.max(0,o-CS.HORIZONTAL_EXTRA_PX),s+=this._revealHorizontalRightPadding,"selections"===e.type&&s-o>t.width)return null;const r=this._computeMinimumScrolling(i,n,o,s);return{scrollLeft:r,maxHorizontalOffset:s}}_computeMinimumScrolling(e,t,i,n,o,s){e|=0,t|=0,i|=0,n|=0,o=!!o,s=!!s;const r=t-e,a=n-i;return at?Math.max(0,n-r):e:i}}CS.HORIZONTAL_EXTRA_PX=30;i("b042");class yS extends mS{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(124);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.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,i=t.get(124);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.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 o=0,s=t.length;o
',a=[];for(let l=t;l<=i;l++){const e=l-t,i=n[e];let o="";for(let t=0,n=i.length;t';o[e]=r}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}i("36df");class xS{constructor(e,t,i,n){this.r=xS._clamp(e),this.g=xS._clamp(t),this.b=xS._clamp(i),this.a=xS._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}}xS.Empty=new xS(0,0,0,0);class LS{constructor(){this._onDidChange=new Ye,this.onDidChange=this._onDidChange.event,this._updateColorMap(),Ga.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()})}static getInstance(){return this._INSTANCE||(this._INSTANCE=new LS),this._INSTANCE}_updateColorMap(){const e=Ga.getColorMap();if(!e)return this._colors=[xS.Empty],void(this._backgroundIsLight=!0);this._colors=[xS.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}LS._INSTANCE=null;const kS=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})(),ES=(e,t)=>(e-=32,e<0||e>96?t<=2?(e+96)%96:95:e);class DS{constructor(e,t){this.scale=t,this.charDataNormal=DS.soften(e,.8),this.charDataLight=DS.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let n=0,o=e.length;ne.width||i+h>e.height)return void console.warn("bad render request outside image data");const u=a?this.charDataLight:this.charDataNormal,g=ES(n,r),f=4*e.width,m=s.r,p=s.g,_=s.b,b=o.r-m,v=o.g-p,w=o.b-_,C=e.data;let y=g*c*d,S=i*f+4*t;for(let x=0;xe.width||i+c>e.height)return void console.warn("bad render request outside image data");const d=4*e.width,h=.5,u=o.r,g=o.g,f=o.b,m=n.r-u,p=n.g-g,_=n.b-f,b=u+m*h,v=g+p*h,w=f+_*h,C=e.data;let y=i*d+4*t;for(let S=0;S{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i>1]=IS[e[i]]<<4|15&IS[e[i+1]];return t},MS={1:NS(()=>TS("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:NS(()=>TS("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class OS{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=MS[e]?new DS(MS[e](),e):OS.createFromSampleData(OS.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 o of kS)i.fillText(String.fromCharCode(o),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){const i=61440;if(e.length!==i)throw new Error("Unexpected source in MinimapCharRenderer");let n=OS._downsample(e,t);return new DS(n,t)}static _downsampleChar(e,t,i,n,o){const s=1*o,r=2*o;let a=n,l=0;for(let c=0;c0){const e=255/a;for(let t=0;tOS.create(this.fontScale,a.fontFamily)),this.backgroundColor=PS._getMinimapBackground(t,i)}static _getMinimapBackground(e,t){const i=e.getColor(Gw);return i?new xS(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 FS{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,c,d){const h=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),f=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/(c-o),d=l*s,h=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new FS(l,c,h,s,d,i,1,Math.min(r,u))}let m,p;if(s&&i!==r){const e=i-t+1;m=Math.floor(e*u/h)}else{const e=o/f;m=Math.floor(e*u/h)}p=e.scrollBeyondLastLine?(r-1)*u/h:Math.max(0,r*u/h-m),p=Math.min(e.minimapHeight-m,p);const _=p/(c-o),b=l*_;let v=0;if(e.scrollBeyondLastLine){const e=o/f;v=e-1}if(g>=r+v){const e=1,t=r,i=p>0;return new FS(l,c,i,_,b,m,e,t)}{let e=Math.max(1,Math.floor(t-b*h/u));d&&d.scrollHeight===c&&(d.scrollTop>l&&(e=Math.min(e,d.startLineNumber)),d.scrollTopWS.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get(),i=t.lines;for(let n=0,o=i.length;n1){for(let t=0,i=r-1;t0&&this.minimapLines[i-1]>=e)i--;let n=this.modelLineToMinimapLine(t)-1;while(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;o--){if(this.minimapLines[o]=0;i--){if(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]=HS.compute(this.options,this._context.model.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const n of i)switch(n.type){case"deleted":this._actual.onLinesDeleted(n.deleteFromLineNumber,n.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(n.insertFromLineNumber,n.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}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{e.preventDefault();const t=this._model.options.renderMinimap;if(0===t)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(e.leftButton&&this._lastRenderData){const t=bo(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e.buttons,e.posx,i,e.posy,this._lastRenderData.renderedLayout)}return}const i=this._model.options.minimapLineHeight,n=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.browserEvent.offsetY,o=Math.floor(n/i);let s=o+this._lastRenderData.renderedLayout.startLineNumber;s=Math.min(s,this._model.getLineCount()),this._model.revealLineNumber(s)}),this._sliderMouseMoveMonitor=new mm,this._sliderMouseDownListener=eo(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=gm.addTarget(this._domNode.domNode),this._sliderTouchStartListener=Zn(this._domNode.domNode,hm.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=Zn(this._domNode.domNode,hm.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=eo(this._domNode.domNode,hm.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 r=(e,n)=>{const r=Math.abs(n-t);if(s["j"]&&r>AS)return void this._model.setScrollTop(o.scrollTop);const a=e-i;this._model.setScrollTop(o.getDesiredScrollTopFromDelta(a))};n!==i&&r(n,t),this._sliderMouseMoveMonitor.startMonitoring(this._slider.domNode,e,fm,e=>r(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 VS(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(jw),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){const t=this._model.options.renderMinimap;if(0===t)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 i=FS.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(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight);const n=e.scrollLeft/this._model.options.typicalHalfwidthCharacterWidth,o=Math.min(this._model.options.minimapWidth,Math.round(n*this._model.options.minimapCharWidth/this._model.options.pixelRatio));this._sliderHorizontal.setLeft(o),this._sliderHorizontal.setWidth(this._model.options.minimapWidth-o),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}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 c=new Map;for(let d=0;dthis._model.options.canvasInnerHeight)return;let h=t.get(s);const u=!h;if(!h){const e=this._model.getLineContent(s);h=[g];for(let t=1;ts?h.length-1:m-1;if(v>0){const t=h[v]-b||2;this.renderDecoration(e,n,b,d,t,r)}u&&this.renderLineHighlight(e,n,d,r)}renderLineHighlight(e,t,i,n){e.fillStyle=t&&t.transparent(.5).toString()||"",e.fillRect(g,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 BS(e,t.imageData,t.lines)}const o=this._getBuffer();if(!o)return null;let[s,r,a]=US._renderUntouchedLines(o,t,i,n,this._lastRenderData);const l=this._model.getMinimapLinesRenderingData(t,i,a),c=this._model.getOptions().tabSize,d=this._model.options.backgroundColor,h=this._model.tokensColorTracker,u=h.backgroundIsLight(),g=this._model.options.renderMinimap,f=this._model.options.charRenderer(),m=this._model.options.fontScale,p=this._model.options.minimapCharWidth,_=1===g?2:3,b=_*m,v=n>b?Math.floor((n-b)/2):0;let w=0;const C=[];for(let k=0,E=i-t+1;k=0&&ip)return;const s=f.charCodeAt(v);if(9===s){const e=c-(v+w)%c;w+=e-1,b+=e*o}else if(32===s)b+=o;else{const c=rs["C"](s)?2:1;for(let d=0;dp)return}}}}}Af((e,t)=>{const i=e.getColor(Gw);i&&t.addRule(`.monaco-editor .minimap > canvas { opacity: ${i.rgba.a}; will-change: opacity; }`);const n=e.getColor(Yw);n&&t.addRule(`.monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${n}; }`);const o=e.getColor(Xw);o&&t.addRule(`.monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${o}; }`);const s=e.getColor(Zw);s&&t.addRule(`.monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${s}; }`);const r=e.getColor(Wv);r&&t.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${r} -6px 0 6px -6px inset; }`)});i("70a8");class KS extends Lm{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=am(document.createElement("div")),km.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,i=t.get(124);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=am(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],i=e.domNode.domNode;delete this._widgets[t],i.parentNode.removeChild(i),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 i=0,n=t.length;i=3){const t=Math.floor(n/3),i=Math.floor(n/3),o=n-t-i,s=e,r=s+t,a=s+t+o;return[[0,s,r,s,a,s,r,s],[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,o=e,s=o+t;return[[0,o,o,o,s,o,o,o],[0,t,t,t,i,t+i,t+i,t+i]]}{const t=e,i=n;return[[0,t,t,t,t,t,t,t],[0,i,i,i,i,i,i,i]]}}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 qS extends Lm{constructor(e){super(e),this._domNode=am(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=Ga.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new jS(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-l),_=e-l,b=e+l}_>p+1||e!==f?(0!==r&&c.fillRect(d[f],m,h[f],p-m),f=e,m=_,p=b):b>p&&(p=b)}c.fillRect(d[f],m,h[f],p-m)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,i=e/2|0,o=this._settings.x[7],r=this._settings.w[7];c.fillStyle=this._settings.cursorColor;let a=-100,l=-100;for(let d=0,h=this._cursorPositions.length;dt&&(u=t-i);const g=u-i,f=g+e;g>l+1?(0!==d&&c.fillRect(o,a,r,l-a),a=g,l=f):f>l&&(l=f)}c.fillRect(o,a,r,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(c.beginPath(),c.lineWidth=1,c.strokeStyle=this._settings.borderColor,c.moveTo(0,0),c.lineTo(0,t),c.stroke(),c.moveTo(0,0),c.lineTo(e,0),c.stroke())}}class $S{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 GS{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-h);const u=n.color;let g=this._color2Id[u];g||(g=++this._lastAssignedId,this._color2Id[u]=g,this._id2Color[g]=u);const f=new $S(d-h,d+h,g);n.setColorZone(f),r.push(f)}return this._colorZonesInvalid=!1,r.sort($S.compare),r}}class XS extends xm{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=am(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new YS(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(53)),this._zoneManager.setPixelRatio(i.get(122)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(53)&&(this._zoneManager.setLineHeight(t.get(53)),this._render()),e.hasChanged(122)&&(this._zoneManager.setPixelRatio(t.get(122)),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,c=a.to;t!==o?(e.fillRect(0,s,n,r-s),o=t,e.fillStyle=i[o],s=l,r=c):r>=l?r=Math.max(r,c):(e.fillRect(0,s,n,r-s),s=l,r=c)}e.fillRect(0,s,n,r-s)}}i("df93");class ZS extends Lm{constructor(e){super(e),this.domNode=am(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(86),this._typicalHalfwidthCharacterWidth=t.get(38).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(86),this._typicalHalfwidthCharacterWidth=t.get(38).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=am(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),o--}return}let i=e-t;while(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(wC);i&&t.addRule(`.monaco-editor .view-ruler { box-shadow: 1px 0 0 0 ${i} inset; }`)});i("9368");class QS extends Lm{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const t=this._context.configuration.options,i=t.get(87);this._useShadows=i.useShadows,this._domNode=am(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,t=e.get(124);0===t.minimap.renderMinimap||t.minimap.minimapWidth>0&&0===t.minimap.minimapLeft?this._width=t.width:this._width=t.width-t.minimap.minimapWidth-t.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(87);return this._useShadows=i.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":"")}}Af((e,t)=>{const i=e.getColor(Wv);i&&t.addRule(`.monaco-editor .scroll-decoration { box-shadow: ${i} 0 6px 6px -6px inset; }`)});i("adf0");class JS{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class ex{constructor(e,t){this.lineNumber=e,this.ranges=t}}function tx(e){return new JS(e)}function ix(e){return new ex(e.lineNumber,e.ranges.map(tx))}const nx=ln;class ox extends cv{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(53),this._roundedSelection=t.get(85),this._typicalHalfwidthCharacterWidth=t.get(38).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(53),this._roundedSelection=t.get(85),this._typicalHalfwidthCharacterWidth=t.get(38).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 r=0,a=t.length;r0){const e=t[r-1].ranges[0].left,o=t[r-1].ranges[0].left+t[r-1].ranges[0].width;sx(i-e)e&&(c.top=1),sx(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 c=0,d=n.length;c1,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 sx(e){return e<0?-e:e}ox.SELECTION_CLASS_NAME="selected-text",ox.SELECTION_TOP_LEFT="top-left-radius",ox.SELECTION_BOTTOM_LEFT="bottom-left-radius",ox.SELECTION_TOP_RIGHT="top-right-radius",ox.SELECTION_BOTTOM_RIGHT="bottom-right-radius",ox.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",ox.ROUNDED_PIECE_WIDTH=10,Af((e,t)=>{const i=e.getColor(dw);i&&t.addRule(`.monaco-editor .focused .selected-text { background-color: ${i}; }`);const n=e.getColor(uw);n&&t.addRule(`.monaco-editor .selected-text { background-color: ${n}; }`);const o=e.getColor(hw);o&&!o.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${o}; }`)});i("b856");class rx{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 ax{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(38);this._cursorStyle=t.get(21),this._lineHeight=t.get(53),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(24),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=am(document.createElement("div")),this._domNode.setClassName("cursor "+MC),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),jg.applyFontInfo(this._domNode,i),this._domNode.setDisplay("none"),this._position=new ai(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(38);return this._cursorStyle=t.get(21),this._lineHeight=t.get(53),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(24),this._typicalHalfwidthCharacterWidth),jg.applyFontInfo(this._domNode,i),!0}onCursorPositionChanged(e){return this._position=e,!0}_prepareRender(e){let t="";if(this._cursorStyle===M.Line||this._cursorStyle===M.LineThin){const i=e.visibleRangeForPosition(this._position);if(!i||i.outsideRenderedLine)return null;let n;if(this._cursorStyle===M.Line){if(n=ts(this._lineCursorWidth>0?this._lineCursorWidth:2),n>2){const e=this._context.model.getLineContent(this._position.lineNumber),i=rs["J"](e,this._position.column-1);t=e.substr(this._position.column-1,i)}}else n=ts(1);let o=i.left;n>=2&&o>=1&&(o-=1);const s=e.getVerticalOffsetForLineNumber(this._position.lineNumber)-e.bigNumbersDelta;return new rx(s,o,n,this._lineHeight,t,"")}const i=this._context.model.getLineContent(this._position.lineNumber),n=rs["J"](i,this._position.column-1),o=e.linesVisibleRangesForRange(new li(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===M.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!==M.Underline&&this._cursorStyle!==M.UnderlineThin||(c+=this._lineHeight-2,d=2),new rx(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 ${MC} ${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 lx extends Lm{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(75),this._cursorBlinking=t.get(19),this._cursorStyle=t.get(21),this._cursorSmoothCaretAnimation=t.get(20),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new ax(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=am(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 Wn,this._cursorFlatBlinkInterval=new Bn,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(75),this._cursorBlinking=t.get(19),this._cursorStyle=t.get(21),this._cursorSmoothCaretAnimation=t.get(20),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.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()},lx.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},lx.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case M.Line:e+=" cursor-line-style";break;case M.Block:e+=" cursor-block-style";break;case M.Underline:e+=" cursor-underline-style";break;case M.LineThin:e+=" cursor-line-thin-style";break;case M.BlockOutline:e+=" cursor-block-outline-style";break;case M.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;case 5:e+=" cursor-solid";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(uC);if(i){let n=e.getColor(gC);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 cx=()=>{throw new Error("Invalid change accessor")};class dx extends Lm{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(124);this._lineHeight=t.get(53),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=am(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=am(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 n of e)t.set(n.id,n);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)}};hx(e,n),n.addZone=cx,n.removeZone=cx,n.layoutZone=cx}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n=e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),o={whitespaceId:n,delegate:t,isVisible:!1,domNode:am(t.domNode),marginDomNode:t.marginDomNode?am(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.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(i){ve(i)}}_safeCallOnDomNodeTop(e,t){if("function"===typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(i){ve(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(let s=0,r=t.length;s{this._context.theme.update(e),this._context.model.onDidColorThemeChange(),this.render(!0,!1)})),this._viewParts=[],this._textAreaHandler=new RC(this._context,r,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=am(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=am(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=am(document.createElement("div")),km.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new gS(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new CS(this._context,this._linesContent),this._viewZones=new dx(this._context),this._viewParts.push(this._viewZones);const a=new qS(this._context);this._viewParts.push(a);const l=new QS(this._context);this._viewParts.push(l);const c=new xy(this._context);this._viewParts.push(c),c.addDynamicOverlay(new My(this._context)),c.addDynamicOverlay(new ox(this._context)),c.addDynamicOverlay(new _S(this._context)),c.addDynamicOverlay(new Ay(this._context));const d=new Ly(this._context);this._viewParts.push(d),d.addDynamicOverlay(new Oy(this._context)),d.addDynamicOverlay(new pS(this._context)),d.addDynamicOverlay(new SS(this._context)),d.addDynamicOverlay(new yS(this._context)),d.addDynamicOverlay(new IC(this._context));const h=new TC(this._context);h.getDomNode().appendChild(this._viewZones.marginDomNode),h.getDomNode().appendChild(d.getDomNode()),this._viewParts.push(h),this._contentWidgets=new Ey(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new lx(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new KS(this._context),this._viewParts.push(this._overlayWidgets);const u=new ZS(this._context);this._viewParts.push(u);const g=new zS(this._context);if(this._viewParts.push(g),a){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(a.getDomNode(),e.insertBefore)}this._linesContent.appendChild(c.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(h.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 ev(this._context,r,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._renderNow()}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,focusTextArea:()=>{this.focus()},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new Rb(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 ai(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPositionRelativeToEditor:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new ai(e,t)))}}_applyLayout(){const e=this._context.configuration.options,t=e.get(124);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(121)+" "+If(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this._configPixelRatio=this._context.configuration.options.get(122),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=no(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){px(()=>this._actualRender())}_getViewPartsToRender(){let e=[],t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!Yn(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 fx(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 Dm(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(n);for(const o of e)o.render(n),o.onDidRender();Math.abs(rn()-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 ai(n.lineNumber,n.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?_y.convertViewToModelMouseTarget(i,this._context.model.coordinatesConverter):null}createOverviewRuler(e){return new XS(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 li(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,i=this._overlayWidgets.setWidgetPosition(e.widget,t);i&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}}function px(e){try{return e()}catch(t){ve(t)}}class _x{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new kb(new li(1,1,1,1),0,new ai(1,1),0),new kb(new li(1,1,1,1),0,new ai(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 Ib(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return 0===this.modelState.selection.getDirection()?new ci(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new ci(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 kb(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 kb(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 kb(n,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new ai(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new ai(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new li(n.lineNumber,n.column,o.lineNumber,o.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new kb(s,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class bx{constructor(e){this.context=e,this.primaryCursor=new _x(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--}}}}class vx{constructor(){this.type=0}}class wx{constructor(){this.type=1}}class Cx{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class yx{constructor(e,t){this.type=3,this.selections=e,this.modelSelections=t}}class Sx{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0)}}class xx{constructor(){this.type=5}}class Lx{constructor(e){this.type=6,this.isFocused=e}}class kx{constructor(){this.type=7}}class Ex{constructor(){this.type=8}}class Dx{constructor(e,t){this.type=9,this.fromLineNumber=e,this.toLineNumber=t}}class Nx{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Ix{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class Tx{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 Mx{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 Ox{constructor(){this.type=14}}class Ax{constructor(e){this.type=15,this.ranges=e}}class Rx{constructor(){this.type=16}}class Px{constructor(){this.type=17}}class Fx extends We{constructor(){super(),this._onEvent=this._register(new Ye),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{const t=this.beginEmitViewEvents();t.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(){while(this._viewEventQueue){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class Wx{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class Bx{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 Bx(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class Vx{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 Vx(this.oldHasFocus,e.hasFocus)}}class Hx{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 Hx(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class zx{constructor(){this.kind=3}isNoOp(){return!1}merge(e){return this}}class Ux{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,n=t.length;if(i!==n)return!1;for(let o=0;o=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class $x extends We{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new Eb(this._model,this._coordinatesConverter,n),this._cursors=new bx(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=Ae(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new Eb(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;t$x.MAX_CURSOR_COUNT&&(n=n.slice(0,$x.MAX_CURSOR_COUNT),o=!0);const s=new jx(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 li(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 li(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 Tx(t,i,n,o,s,r))}saveState(){let e=[];const t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const i=Ib.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,Ib.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:Mb.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:Mb.visibleColumnFromColumn2(this.context.cursorConfig,this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,Ib.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],n=[];for(let r=0,a=e.length;r0&&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 jx(this._model,this);if(s.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new yx(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 Ux(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,c=n.text.lastIndexOf(a,l-1);if(-1===c)return null;t.push([c,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 i=0,n=o.length;i0&&this._pushAutoClosedAction(s,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=new jx(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){ve(s)}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}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{if("keyboard"===t){const e=qx.getAllAutoClosedCharacters(this._autoClosedActions);this._executeEditOperation(ey.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),e)),this._selectionsWhenCompositionStarted=null}},e,t)}type(e,t,i){this._executeEdit(()=>{if("keyboard"===i){const e=t.length;let i=0;while(i{this._executeEditOperation(ey.replacePreviousChar(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i))},e,n)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(ey.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(qC.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Tb(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new Tb(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}$x.MAX_CURSOR_COUNT=1e4;class Gx{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(n,i);for(let s=0,r=n.trackedRanges.length;s0&&(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 r=0;r0?(n[r].sort(o),s[r]=t[r].computeCursorState(e.model,{getInverseEditOperations:()=>n[r],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new ci(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new ci(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):s[r]=e.selectionsBefore[r];return s});r||(r=e.selectionsBefore);let a=[];for(let l in o)o.hasOwnProperty(l)&&a.push(parseInt(l,10));a.sort((e,t)=>t-e);for(const l of a)r.splice(l,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{li.isEmpty(e)&&""===s||n.push({identifier:{major:t,minor:o++},range:e,text:s,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let r=!1;const a=(e,t,i)=>{r=!0,s(e,t,i)},l=(t,i)=>{const n=ci.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()},c={addEditOperation:s,addTrackedEditOperation:a,trackSelection:l};try{i.getEditOperations(e.model,c)}catch(d){return ve(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:r}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((e,t)=>-li.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}}class Yx{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 Xx(e,t,i,n,o,s,r){let a="
",l=n,c=0;for(let d=0,h=t.getCount();d0)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}`,h>o||l>=o)break}return a+="
",a}class Zx{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 Qx{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 Jx{constructor(e,t,i,n){this._instanceId=rs["O"](++Jx.INSTANCE_COUNT),this._pendingChanges=new Zx,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;while(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 Qx(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})}};e(i)}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 a of i)n.add(a.id);const o=new Map;for(const a of t)o.set(a.id,a);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=Jx.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[r+1].afterLineNumber>=e)return r;i=r+1|0}else n=r-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e),i=t+1;return i1?this._lineHeight*(e-1):0;const i=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e);return t+i+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e|=0,e<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,o=t;while(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,c;-1===r?(r=a,c=s+1,l=0):(c=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let d=o,h=d;const u=5e5;let g=0;o>=u&&(g=Math.floor(o/u)*u,g=Math.floor(g/i)*i,h-=g);const f=[],m=e+(t-e)/2;let p=-1;for(let w=n;w<=s;w++){if(-1===p){const e=d,t=d+i;(e<=m&&mm)&&(p=w)}d+=i,f[w-n]=h,h+=i;while(c===w)h+=l,d+=l,r++,r>=a?c=s+1:(c=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(d>=t){s=w;break}}-1===p&&(p=s);const _=0|this.getVerticalOffsetForLineNumber(s);let b=n,v=s;return bt&&v--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:s,relativeVerticalOffset:f,centeredLineNumber:p,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;const n=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=n+o)return-1;while(t=o+s)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),o=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:s,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 s=i;s<=n;s++){const e=this.getVerticalOffsetForWhitespaceIndex(s),i=this.getHeightForWhitespaceIndex(s);if(e>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:e,height:i})}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}}Jx.INSTANCE_COUNT=0;const eL=125;class tL{constructor(e,t,i,n){e|=0,t|=0,i|=0,n|=0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),n<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 iL extends We{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new Ye),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new tL(0,0,0,0),this._scrollable=this._register(new Xy(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 Bx(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 nL extends We{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,o=n.get(124),s=n.get(69);this._linesLayout=new Jx(t,n.get(53),s.top,s.bottom),this._scrollable=this._register(new iL(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new tL(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(98)?eL:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(53)&&this._linesLayout.setLineHeight(t.get(53)),e.hasChanged(69)){const e=t.get(69);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(124)){const e=t.get(124),i=e.contentWidth,n=e.height,o=this._scrollable.getScrollDimensions(),s=o.contentWidth;this._scrollable.setScrollDimensions(new tL(i,o.contentWidth,n,this._getContentHeight(i,n,s)))}else this._updateHeight();e.hasChanged(98)&&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,n=i.get(87);return 2===n.horizontal||e>=t?0:n.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return n.get(89)?o+=Math.max(0,t-n.get(53)-n.get(69).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 tL(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Hd(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Hd(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(e){const t=this._configuration.options,i=t.get(125),n=t.get(38);if(i.isViewportWrapping){const i=t.get(124),o=t.get(59);return e>i.contentWidth+n.typicalHalfwidthCharacterWidth&&o.enabled&&"right"===o.side?e+i.verticalScrollbarWidth:e}{const i=t.get(88)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(e+i,o)}}setMaxLineWidth(e){const t=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new tL(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),n=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-n,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(){const e=this._scrollable.getScrollDimensions();return e.contentWidth}getScrollWidth(){const e=this._scrollable.getScrollDimensions();return e.scrollWidth}getContentHeight(){const e=this._scrollable.getScrollDimensions();return e.contentHeight}getScrollHeight(){const e=this._scrollable.getScrollDimensions();return e.scrollHeight}getCurrentScrollLeft(){const e=this._scrollable.getCurrentScrollPosition();return e.scrollLeft}getCurrentScrollTop(){const e=this._scrollable.getCurrentScrollPosition();return e.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})}}class oL{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 sL{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 Pc(t,e-i)}}class rL{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 oL(this)}_constructLines(e,t){this.lines=[],e&&(this.hiddenAreasIds=[]);let i=this.model.getLinesContent();const n=i.length,o=this.createLineBreaksComputer();for(let u=0;uthis.model.getDecorationRange(e)).sort(li.compareRangesUsingStarts),l=1,c=0,d=-1,h=d+1=l&&e<=c,i=gL(s[u],!t);r[u]=i.getViewLineCount(),this.lines[u]=i}this._validModelVersionId=this.model.getVersionId(),this.prefixSumComputer=new sL(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(li.compareRangesUsingStarts),i=[],n=t[0].startLineNumber,o=t[0].endLineNumber;for(let s=1,r=t.length;so+1?(i.push(new li(n,1,o,1)),n=e.startLineNumber,o=e.endLineNumber):e.endLineNumber>o&&(o=e.endLineNumber)}return i.push(new li(n,1,o,1)),i}setHiddenAreas(e){let t=this._reduceRanges(e),i=this.hiddenAreasIds.map(e=>this.model.getDecorationRange(e)).sort(li.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n=s&&e<=r?this.lines[d].isVisible()&&(this.lines[d]=this.lines[d].setVisible(!1),t=!0):(c=!0,this.lines[d].isVisible()||(this.lines[d]=this.lines[d].setVisible(!0),t=!0)),t){let e=this.lines[d].getViewLineCount();this.prefixSumComputer.changeValue(d,e)}}return c||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 c=null;if(l){c=[];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 c=0,d=n.length;ca?(c=1===t?1:this.prefixSumComputer.getAccumulatedValue(t-2)+1,d=c+a-1,g=d+1,f=g+(o-a)-1,l=!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 c=null;for(let g=a;g<=l;g++){const e=this.lines[g];if(e.isVisible()){let t=e.getViewLineNumberOfModelPosition(0,g===a?i.column:1),n=e.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),o=n-t+1,l=0;o>1&&1===e.getViewLineMinColumn(this.model,g+1,n)&&(l=0===t?1:2),s.push(o),r.push(l),null===c&&(c=new ai(g+1,0))}else null!==c&&(o=o.concat(this.model.getLinesIndentGuides(c.lineNumber,g)),c=null)}null!==c&&(o=o.concat(this.model.getLinesIndentGuides(c.lineNumber,n.lineNumber)),c=null);const d=t-e+1;let h=new Array(d),u=0;for(let g=0,f=o.length;gt&&(h=!0,d=t-o+1);let u=c+d;if(n.getViewLinesData(this.model,l+1,c,u,o-e,i,a),o+=d,h)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 c=r.getModelColumnOfViewPosition(s,t),d=this.model.validatePosition(new ai(o+1,c));return d.equals(i)?new ai(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 li(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 ai(n+1,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new li(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t){const i=this.model.validatePosition(new ai(e,t)),n=i.lineNumber,o=i.column;let s=n-1,r=!1;while(s>0&&!this.lines[s].isVisible())s--,r=!0;if(0===s&&!this.lines[s].isVisible())return new ai(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 li(t.lineNumber,t.column,i.lineNumber-1,this.getViewLineMaxColumn(i.lineNumber-1)):new li(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)}while(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 pL;for(const s of n){const e=s.options.overviewRuler,t=e?e.position:0;if(0===t)continue;const n=e.getColor(i),r=this._getViewLineNumberForModelPosition(s.range.startLineNumber,s.range.startColumn),a=this._getViewLineNumberForModelPosition(s.range.endLineNumber,s.range.endColumn);o.accept(n,r,a,t)}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 li(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 u=r;u<=a;u++){const e=this.lines[u];if(e.isVisible())null===l&&(l=new ai(u+1,u===r?n.column:1));else if(null!==l){const e=this.model.getLineMaxColumn(u);s=s.concat(this.model.getDecorationsInRange(new li(l.lineNumber,l.column,u,e),t,i)),l=null}}null!==l&&(s=s.concat(this.model.getDecorationsInRange(new li(l.lineNumber,l.column,o.lineNumber,o.column),t,i)),l=null),s.sort((e,t)=>{const i=li.compareRangesUsingStarts(e.range,t.range);return 0===i?e.idt.id?1:0:i});let c=[],d=0,h=null;for(const u of s){const e=u.id;h!==e&&(h=e,c[d++]=u)}return c}}class aL{constructor(){}isVisible(){return!0}setVisible(e){return e?this:lL.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 jd(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 ai(e,t)}getViewLineNumberOfModelPosition(e,t){return e}}aL.INSTANCE=new aL;class lL{constructor(){}isVisible(){return!1}setVisible(e){return e?aL.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")}}lL.INSTANCE=new lL;class cL{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 Ud.getInputOffsetOfOutputPosition(this._lineBreakData.breakOffsets,e,0)}getInputEndOffsetOfOutputLineIndex(e,t,i){return i+1===this._lineBreakData.breakOffsets.length?e.getLineMaxColumn(t)-1:Ud.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=hL(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),s=o-n;return i>0&&(s=this._lineBreakData.wrappedTextIndentLength+s),s}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=hL(this._lineBreakData.wrappedTextIndentLength)+s);let r=i>0?this._lineBreakData.wrappedTextIndentLength+1:1,a=s.length+1,l=i+10&&(c=this._lineBreakData.wrappedTextIndentLength);let d=e.getLineTokens(t);const h=0===i?0:this._lineBreakData.breakOffsetsVisibleColumn[i-1];return new jd(s,l,r,a,h,d.sliceAndInflate(n,o,c))}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 ai(e+n,o)}getViewLineNumberOfModelPosition(e,t){if(!this._isVisible)throw new Error("Not supported");const i=Ud.getOutputPositionOfInputOffset(this._lineBreakData.breakOffsets,t-1);return e+i.outputLineIndex}}let dL=[""];function hL(e){if(e>=dL.length)for(let t=1;t<=e;t++)dL[t]=uL(t);return dL[e]}function uL(e){return new Array(e+1).join(" ")}function gL(e,t){return null===e?t?aL.INSTANCE:lL.INSTANCE:new cL(e,t)}class fL{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 mL{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new fL(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 Nx(t,i)}onModelLinesInserted(e,t,i,n){return new Ix(t,i)}onModelLineChanged(e,t,i){return[!1,new Dx(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 o=0;o=t)return void(i>s&&(o[o.length-1]=i));o.push(n,t,i)}else this.result[e]=[n,t,i]}}class _L{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 ai(n.startLineNumber,1)),t=this._coordinatesConverter.convertModelPositionToViewPosition(new ai(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)));s=new li(e.lineNumber,e.column,t.lineNumber,t.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(n);i=new Gd(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,ee(this.configuration.options)),i=e.startLineNumber,n=e.endLineNumber;let o=[],s=0,r=[];for(let a=i;a<=n;a++)r[a-i]=[];for(let a=0,l=t.length;athis.tokenizeViewport(),50)),this._updateConfigurationViewLineCount=this._register(new Vn(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStartLine=-1,this._viewportStartLineTrackedRange=null,this._viewportStartLineDelta=0,bL&&this.model.isTooLargeForTokenization())this._lines=new mL(this.model);else{const e=this._configuration.options,t=e.get(38),i=e.get(118),s=e.get(125),r=e.get(117);this._lines=new rL(this.model,n,o,t,this.model.getOptions().tabSize,i,s.wrappingColumn,r)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new $x(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new nL(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(e=>{e.scrollTopChanged&&this._tokenizeViewportSoon.schedule(),this._eventDispatcher.emitSingleViewEvent(new Mx(e)),this._eventDispatcher.emitOutgoingEvent(new Hx(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 _L(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(LS.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new Rx)})),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 ai(e.startLineNumber,1)),i=this.coordinatesConverter.convertViewPositionToModelPosition(new ai(e.endLineNumber,1));this.model.tokenizeViewport(t.lineNumber,i.lineNumber)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new Lx(e)),this._eventDispatcher.emitOutgoingEvent(new Vx(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new vx)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new wx)}onDidColorThemeChange(){this._eventDispatcher.emitSingleViewEvent(new Ox)}_onConfigurationChanged(e,t){let i=null;if(-1!==this._viewportStartLine){let e=new ai(this._viewportStartLine,this.getLineMinColumn(this._viewportStartLine));i=this.coordinatesConverter.convertViewPositionToModelPosition(e)}let n=!1;const o=this._configuration.options,s=o.get(38),r=o.get(118),a=o.get(125),l=o.get(117);if(this._lines.setWrappingSettings(s,r,a.wrappingColumn,l)&&(e.emitViewEvent(new xx),e.emitViewEvent(new Ex),e.emitViewEvent(new Sx(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),0!==this.viewLayout.getCurrentScrollTop()&&(n=!0),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(75)&&(this._decorations.reset(),e.emitViewEvent(new Sx(null))),e.emitViewEvent(new Cx(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)}Lb.shouldRecreate(t)&&(this.cursorConfig=new Lb(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);break}const a=r.finalize();let l=0;for(const e of o)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new xx),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,c,d]=this._lines.onModelLineChanged(s,e.lineNumber,i);n=o,r&&t.emitViewEvent(r),c&&(t.emitViewEvent(c),this.viewLayout.onLinesInserted(c.fromLineNumber,c.toLineNumber)),d&&(t.emitViewEvent(d),this.viewLayout.onLinesDeleted(d.fromLineNumber,d.toLineNumber));break}case 5:break}this._lines.acceptVersionId(s),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new Ex),t.emitViewEvent(new Sx(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 kx),this.cursorConfig=new Lb(this.model.getLanguageIdentifier(),this.model.getOptions(),this._configuration),this._cursor.updateConfiguration(this.cursorConfig)})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new Lb(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 xx),e.emitViewEvent(new Ex),e.emitViewEvent(new Sx(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Lb(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 Sx(e))}))}setHiddenAreas(e){try{const t=this._eventDispatcher.beginEmitViewEvents();let i=this._lines.setHiddenAreas(e);i&&(t.emitViewEvent(new xx),t.emitViewEvent(new Ex),t.emitViewEvent(new Sx(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(124),t=this._configuration.options.get(53),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 li(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 c=0,d=i.length;ca||(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 a of e)a.isEmpty()||r.push(this.model.getValueInRange(a,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 li(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const o=this._configuration.options.get(38),s=this._getColorMap(),r=o.fontFamily===ue.fontFamily?o.fontFamily:`'${o.fontFamily}', ${ue.fontFamily}`;return{mode:i.language,html:`
`+this._getHTMLToCopy(n,s)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const e=this.model.getLineTokens(c),d=e.getLineContent(),h=c===i?n-1:0,u=c===o?r-1:d.length;l+=""===d?"
":Xx(d,e.inflate(),t,h,u,a,s["j"])}return l}_getColorMap(){let e=Ga.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;ithis._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}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 Kx):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))}replacePreviousChar(e,t,i){this._executeCursorEdit(n=>this._cursor.replacePreviousChar(n,e,t,i))}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 li(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new Tx(e,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new li(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new Tx(e,i,null,0,!0,0)))}revealRange(e,t,i,n,o){this._withViewEventsCollector(s=>s.emitViewEvent(new Tx(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){const t=this.viewLayout.changeWhitespace(e);t&&(this._eventDispatcher.emitSingleViewEvent(new Px),this._eventDispatcher.emitOutgoingEvent(new zx))}setMaxLineWidth(e){this.viewLayout.setMaxLineWidth(e)}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}}class wL{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)}}const CL=Zi("accessibilityService"),yL=new wf("accessibilityModeEnabled",!1);class SL extends Bc{constructor(e,t){super(0);for(let i=0;i=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 xL=[],LL=[];class kL{constructor(e,t){this.classifier=new SL(e,t)}static create(e){return new kL(e.get(113),e.get(112))}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(c[v]-_);while(v+1=e)break;e=t,v++}}while(vt&&(t=m,o=p);let r=0,d=0,w=0,C=0;if(o<=_){let p=o,b=0===t?0:i.charCodeAt(t-1),v=0===t?0:e.get(b),y=!0;for(let o=t;om&&TL(b,v,a,l)&&(r=t,d=p),p+=c,p>_){t>m?(w=t,C=p-c):(w=o+1,C=p),p-d>h&&(r=0),y=!1;break}b=a,v=l}if(y){f>0&&(u[f]=l[l.length-1],g[f]=c[l.length-1],f++);break}}if(0===r){let a=o,l=i.charCodeAt(t),c=e.get(l),u=!1;for(let n=t-1;n>=m;n--){const t=n+1,o=i.charCodeAt(n);if(9===o){u=!0;break}let g,f;if(rs["E"](o)?(n--,g=0,f=2):(g=e.get(o),f=rs["C"](o)?s:1),a<=_){if(0===w&&(w=t,C=a),a<=_-h)break;if(TL(o,g,l,c)){r=t,d=a;break}}a-=f,l=o,c=g}if(0!==r){const e=h-(C-d);if(e<=n){const t=i.charCodeAt(w);let o;o=rs["D"](t)?2:NL(t,C,n,s),e-o<0&&(r=0)}}if(u){v--;continue}}if(0===r&&(r=w,d=C),r<=m){const e=i.charCodeAt(m);rs["D"](e)?(r=m+2,d=p+2):(r=m+1,d=p+NL(e,p,n,s))}m=r,u[f]=r,p=d,g[f]=d,f++,_=d+h;while(v<0||v=y)break;y=e,v++}}return 0===f?null:(u.length=f,g.length=f,xL=t.breakOffsets,LL=t.breakOffsetsVisibleColumn,t.breakOffsets=u,t.breakOffsetsVisibleColumn=g,t.wrappedTextIndentLength=d,t)}function DL(e,t,i,n,o,s){if(-1===n)return null;const r=t.length;if(r<=1)return null;const a=ML(t,i,n,o,s),l=n-a;let c=[],d=[],h=0,u=0,g=0,f=n,m=t.charCodeAt(0),p=e.get(m),_=NL(m,0,i,o),b=1;rs["D"](m)&&(_+=1,m=t.charCodeAt(1),p=e.get(m),b++);for(let v=b;vf&&((0===u||_-g>l)&&(u=n,g=_-a),c[h]=u,d[h]=g,h++,f=g+l,u=0),m=s,p=r}return 0===h?null:(c[h]=r,d[h]=_,new Ud(c,d,a))}function NL(e,t,i,n){return 9===e?i-t%i:rs["C"](e)||e<32?n:1}function IL(e,t){return t-e%t}function TL(e,t,i,n){return 32!==i&&(2===t||3===t&&2!==n||1===n||3===n&&1!==t)}function ML(e,t,i,n,o){let s=0;if(0!==o){const r=rs["u"](e);if(-1!==r){for(let i=0;ii&&(s=0)}}return s}var OL;const AL=null===(OL=window.trustedTypes)||void 0===OL?void 0:OL.createPolicy("domLineBreaksComputer",{createHTML:e=>e});class RL{static create(){return new RL}constructor(){}createLineBreaksComputer(e,t,i,n){t|=0,i=+i;let o=[];return{addRequest:(e,t)=>{o.push(e)},finalize:()=>PL(o,e,t,i,n)}}}function PL(e,t,i,n,o){var s;if(-1===n){const t=[];for(let i=0,n=e.length;ir?(s=0,a=0):f=r-e}const m=n.substr(s),p=FL(m,a,i,f,l);c[v]=s,d[v]=a,h[v]=m,u[v]=p[0],g[v]=p[1]}const f=l.build(),m=null!==(s=null===AL||void 0===AL?void 0:AL.createHTML(f))&&void 0!==s?s:f;a.innerHTML=m,a.style.position="absolute",a.style.top="10000",a.style.wordWrap="break-word",document.body.appendChild(a);let p=document.createRange();const _=Array.prototype.slice.call(a.children,0);let b=[];for(let v=0;v');const s=e.length;let r=t,a=0,l=[],c=[],d=0");for(let h=0;h"),l[h]=a,c[h]=r;const t=d;d=h+1"),l[e.length]=a,c[e.length]=r,o.appendASCIIString(""),[l,c]}function WL(e,t,i,n){if(i.length<=1)return null;const o=Array.prototype.slice.call(t.children,0),s=[];try{BL(e,o,n,0,null,i.length-1,null,s)}catch(r){return console.log(r),null}return 0===s.length?null:(s.push(i.length),s)}function BL(e,t,i,n,o,s,r,a){if(n===s)return;if(o=o||VL(e,t,i[n],i[n+1]),r=r||VL(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,c=VL(e,t,i[l],i[l+1]);BL(e,t,i,n,o,l,c,a),BL(e,t,i,l,c,s,r,a)}function VL(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 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},zL=function(e,t){return function(i,n){t(i,n,e)}};let UL=0;class KL{constructor(e,t,i,n,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=o}dispose(){Ae(this.listenersToRemove),this.model.onBeforeDetached(),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let jL=class e extends We{constructor(e,t,i,n,o,s,r,a,l,c){super(),this._onDidDispose=this._register(new Ye),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new Ye),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new Ye),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new Ye),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new Ye),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new Ye),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeConfiguration=this._register(new Ye),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new Ye),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new Ye),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new Ye),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Ye),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new Ye),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new qL),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new qL),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Ye),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Ye),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Ye),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Ye),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Ye),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Ye),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Ye),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Ye),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Ye),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Ye),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onContextMenu=this._register(new Ye),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Ye),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Ye),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Ye),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Ye),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Ye),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new Ye),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new Ye),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new Ye),this.onDidChangeViewZones=this._onDidChangeViewZones.event;const d=Object.assign({},t);let h;this._domElement=e,this._overflowWidgetsDomNode=d.overflowWidgetsDomNode,delete d.overflowWidgetsDomNode,this._id=++UL,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this.isSimpleWidget=i.isSimpleWidget||!1,this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(d,c)),this._register(this._configuration.onDidChange(e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(124)){const e=t.get(124);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(r.createScoped(this._domElement)),this._notificationService=l,this._codeEditorService=o,this._commandService=s,this._themeService=a,this._register(new $L(this,this._contextKeyService)),this._register(new GL(this,this._contextKeyService)),this._instantiationService=n.createChild(new wL([Cf,this._contextKeyService])),this._modelData=null,this._contributions={},this._actions={},this._focusTracker=new YL(e),this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}),this._contentWidgets={},this._overlayWidgets={},h=Array.isArray(i.contributions)?i.contributions:Jf.getEditorContributions();for(const g of h)try{const e=this._instantiationService.createInstance(g.ctor,this);this._contributions[g.id]=e}catch(u){ve(u)}Jf.getEditorActions().forEach(e=>{const t=new Yx(e.id,e.label,e.alias,Vs(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 jg(this.isSimpleWidget,e,this._domElement,t)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return mr.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose();const e=Object.keys(this._contributions);for(let t=0,i=e.length;tli.lift(e)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Mb.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(!ai.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(!li.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 li(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(!ai.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new li(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=ci.isISelection(e),i=li.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 ci(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 li(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(!li.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(li.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._replacePreviousChar(e,t.text||"",t.replaceCharCnt||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,ve):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._commandService.executeCommand(t,i))}_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))}_replacePreviousChar(e,t,i){this._modelData&&this._modelData.viewModel.replacePreviousChar(t,i,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 li(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=Jf.getEditorCommand(t);return!!n&&(i=i||{},i.source=e,this._instantiationService.invokeFunction(e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,ve)}),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(75)&&(this._modelData.model.pushStackElement(),!0))}popUndoStop(){return!!this._modelData&&(!this._configuration.options.get(75)&&(this._modelData.model.popStackElement(),!0))}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(75))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,ee(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(){const e=this._configuration.options,t=e.get(124);return t}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(124),s=e._getVerticalOffsetForPosition(this._modelData,i.lineNumber,i.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(i.lineNumber,i.column)+o.glyphMarginWidth+o.lineNumbersWidth+o.decorationsWidth-this.getScrollLeft();return{top:s,left:r,height:n.get(53)}}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){jg.applyFontInfoSlow(e,this._configuration.options.get(38))}_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 vL(this._id,this._configuration,e,RL.create(),kL.create(this._configuration.options),e=>oo(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(o("cursors.maximum","The number of cursors has been limited to {0}.",$x.MAX_CURSOR_COUNT));const t=[];for(let o=0,s=e.selections.length;o{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},replacePreviousChar:(e,t)=>{this._replacePreviousChar("keyboard",e,t)},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)},replacePreviousChar:(e,t)=>{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 _y(e.coordinatesConverter);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);const n=new mx(t,this._configuration,this._themeService,e,i,this._overflowWidgetsDomNode);return[n,!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}};jL=HL([zL(3,Yi),zL(4,Ji),zL(5,Hs),zL(6,Cf),zL(7,kf),zL(8,Yu),zL(9,CL)],jL);class qL extends We{constructor(){super(),this._onDidChangeToTrue=this._register(new Ye),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new Ye),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 $L extends We{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=iy.editorSimpleInput.bindTo(t),this._editorFocus=iy.focus.bindTo(t),this._textInputFocus=iy.textInputFocus.bindTo(t),this._editorTextFocus=iy.editorTextFocus.bindTo(t),this._editorTabMovesFocus=iy.tabMovesFocus.bindTo(t),this._editorReadonly=iy.readOnly.bindTo(t),this._inDiffEditor=iy.inDiffEditor.bindTo(t),this._editorColumnSelection=iy.columnSelection.bindTo(t),this._hasMultipleSelections=iy.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=iy.hasNonEmptySelection.bindTo(t),this._canUndo=iy.canUndo.bindTo(t),this._canRedo=iy.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(123)),this._editorReadonly.set(e.get(75)),this._inDiffEditor.set(e.get(49)),this._editorColumnSelection.set(e.get(15))}_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 GL extends We{constructor(e,t){super(),this._editor=e,this._contextKeyService=t,this._langId=iy.languageId.bindTo(t),this._hasCompletionItemProvider=iy.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=iy.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=iy.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=iy.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=iy.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=iy.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=iy.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=iy.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=iy.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=iy.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=iy.hasReferenceProvider.bindTo(t),this._hasRenameProvider=iy.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=iy.hasSignatureHelpProvider.bindTo(t),this._hasInlineHintsProvider=iy.hasInlineHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=iy.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=iy.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=iy.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=iy.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=iy.isInWalkThroughSnippet.bindTo(t);const i=()=>this._update();this._register(e.onDidChangeModel(i)),this._register(e.onDidChangeModelLanguage(i)),this._register(ka.onDidChange(i)),this._register(Wa.onDidChange(i)),this._register(Pa.onDidChange(i)),this._register(Ma.onDidChange(i)),this._register(Oa.onDidChange(i)),this._register(Aa.onDidChange(i)),this._register(Ra.onDidChange(i)),this._register(Da.onDidChange(i)),this._register(Ia.onDidChange(i)),this._register(Na.onDidChange(i)),this._register(xa.onDidChange(i)),this._register(La.onDidChange(i)),this._register(Ba.onDidChange(i)),this._register(Va.onDidChange(i)),this._register(Ea.onDidChange(i)),this._register(Fa.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(ka.has(e)),this._hasCodeActionsProvider.set(Wa.has(e)),this._hasCodeLensProvider.set(Pa.has(e)),this._hasDefinitionProvider.set(Ma.has(e)),this._hasDeclarationProvider.set(Oa.has(e)),this._hasImplementationProvider.set(Aa.has(e)),this._hasTypeDefinitionProvider.set(Ra.has(e)),this._hasHoverProvider.set(Da.has(e)),this._hasDocumentHighlightProvider.set(Ia.has(e)),this._hasDocumentSymbolProvider.set(Na.has(e)),this._hasReferenceProvider.set(xa.has(e)),this._hasRenameProvider.set(La.has(e)),this._hasSignatureHelpProvider.set(Ea.has(e)),this._hasInlineHintsProvider.set(Fa.has(e)),this._hasDocumentFormattingProvider.set(Ba.has(e)||Va.has(e)),this._hasDocumentSelectionFormattingProvider.set(Va.has(e)),this._hasMultipleDocumentFormattingProvider.set(Ba.all(e).length+Va.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(Va.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===zn.walkThroughSnippet)}):this.reset()}}class YL extends We{constructor(e){super(),this._onChange=this._register(new Ye),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(Uo(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 XL=encodeURIComponent("");function QL(e){return XL+encodeURIComponent(e.toString())+ZL}const JL=encodeURIComponent('');function tk(e){return JL+encodeURIComponent(e.toString())+ek}Af((e,t)=>{const i=e.getColor(jv);i&&t.addRule(`.monaco-editor .squiggly-error { border-bottom: 4px double ${i}; }`);const n=e.getColor(Kv);n&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${QL(n)}") repeat-x bottom left; }`);const o=e.getColor(Uv);o&&t.addRule(`.monaco-editor .squiggly-error::before { display: block; content: ''; width: 100%; height: 100%; background: ${o}; }`);const s=e.getColor(Gv);s&&t.addRule(`.monaco-editor .squiggly-warning { border-bottom: 4px double ${s}; }`);const r=e.getColor($v);r&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${QL(r)}") repeat-x bottom left; }`);const a=e.getColor(qv);a&&t.addRule(`.monaco-editor .squiggly-warning::before { display: block; content: ''; width: 100%; height: 100%; background: ${a}; }`);const l=e.getColor(Zv);l&&t.addRule(`.monaco-editor .squiggly-info { border-bottom: 4px double ${l}; }`);const c=e.getColor(Xv);c&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${QL(c)}") repeat-x bottom left; }`);const d=e.getColor(Yv);d&&t.addRule(`.monaco-editor .squiggly-info::before { display: block; content: ''; width: 100%; height: 100%; background: ${d}; }`);const h=e.getColor(Jv);h&&t.addRule(`.monaco-editor .squiggly-hint { border-bottom: 2px dotted ${h}; }`);const u=e.getColor(Qv);u&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${tk(u)}") no-repeat bottom left; }`);const g=e.getColor(LC);g&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${g.rgba.a}; }`);const f=e.getColor(xC);f&&t.addRule(`.monaco-editor.showUnused .squiggly-unnecessary { border-bottom: 2px dashed ${f}; }`);const m=e.getColor(tw)||"inherit";t.addRule(`.monaco-editor.showDeprecated .squiggly-inline-deprecated { text-decoration: line-through; text-decoration-color: ${m}}`)});i("7115"),i("c901");const ik=!1;var nk;(function(e){e["North"]="north",e["South"]="south",e["East"]="east",e["West"]="west"})(nk||(nk={}));let ok=4;const sk=new Ye;class rk extends We{constructor(e,t,i){super(),this._state=3,this._onDidEnablementChange=this._register(new Ye),this.onDidEnablementChange=this._onDidEnablementChange.event,this._onDidStart=this._register(new Ye),this.onDidStart=this._onDidStart.event,this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._onDidReset=this._register(new Ye),this.onDidReset=this._onDidReset.event,this._onDidEnd=this._register(new Ye),this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.orthogonalStartSashDisposables=this._register(new Fe),this.orthogonalEndSashDisposables=this._register(new Fe),this.el=Ko(e,Yo(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add("orthogonal-edge-"+i.orthogonalEdge),s["f"]&&this.el.classList.add("mac"),this._register(_n(this.el,"mousedown")(this.onMouseDown,this)),this._register(_n(this.el,"dblclick")(this.onMouseDoubleClick,this)),this._register(gm.addTarget(this.el)),this._register(_n(this.el,hm.Start)(this.onTouchStart,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=ok,this._register(sk.event(e=>{this.size=e,this.layout()}))),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",ik),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){this.orthogonalStartSashDisposables.clear(),e?(this.orthogonalStartSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalStartSashEnablementChange,this)),this.onOrthogonalStartSashEnablementChange(e.state)):this.onOrthogonalStartSashEnablementChange(0),this._orthogonalStartSash=e}get orthogonalEndSash(){return this._orthogonalEndSash}set orthogonalEndSash(e){this.orthogonalEndSashDisposables.clear(),e?(this.orthogonalEndSashDisposables.add(e.onDidEnablementChange(this.onOrthogonalEndSashEnablementChange,this)),this.onOrthogonalEndSashEnablementChange(e.state)):this.onOrthogonalEndSashEnablementChange(0),this._orthogonalEndSash=e}onMouseDown(e){Bo.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=[...es("iframe"),...es("webview")];for(const s of i)s.style.pointerEvents="none";const n=new Tn(e),o=n.posx,r=n.posy,a=n.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=To(this.el),d=()=>{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",c.textContent=`* { cursor: ${e} !important; }`},h=new Fe;d(),t||this.onDidEnablementChange(d,null,h);const u=e=>{Bo.stop(e,!1);const t=new Tn(e),i={startX:o,currentX:t.posx,startY:r,currentY:t.posy,altKey:a};this._onDidChange.fire(i)},g=e=>{Bo.stop(e,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const t of i)t.style.pointerEvents="auto"};_n(window,"mousemove")(u,null,h),_n(window,"mouseup")(g,null,h)}onMouseDoubleClick(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}onTouchStart(e){Bo.stop(e);const t=[],i=e.pageX,n=e.pageY,o=e.altKey;this._onDidStart.fire({startX:i,currentX:i,startY:n,currentY:n,altKey:o}),t.push(Zn(this.el,hm.Change,e=>{Ns(e.pageX)&&Ns(e.pageY)&&this._onDidChange.fire({startX:i,currentX:e.pageX,startY:n,currentY:e.pageY,altKey:o})})),t.push(Zn(this.el,hm.End,e=>{this._onDidEnd.fire(),Ae(t)}))}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")}onOrthogonalStartSashEnablementChange(e){this.el.classList.toggle("orthogonal-start",0!==e)}onOrthogonalEndSashEnablementChange(e){this.el.classList.toggle("orthogonal-end",0!==e)}getOrthogonalSash(e){if(0===this.orientation){if(e.offsetY<=this.size)return this.orthogonalStartSash;if(e.offsetY>=this.el.clientHeight-this.size)return this.orthogonalEndSash}else{if(e.offsetX<=this.size)return this.orthogonalStartSash;if(e.offsetX>=this.el.clientWidth-this.size)return this.orthogonalEndSash}}dispose(){super.dispose(),this.el.remove()}}class ak{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const lk=[];function ck(e,t,i){lk.push([e,new ak(t,[],i)])}function dk(){return lk}const hk=Zi("IEditorCancelService"),uk=new wf("cancellableOperation",!1);ck(hk,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext(e=>{const t=uk.bindTo(e.get(Cf)),i=new ze;return{key:t,tokens:i}}),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);Xf(new class extends Gf{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:uk})}runEditorCommand(e,t){e.get(hk).cancel(t)}});class gk{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 gk(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)}}i("c6b4"),i("154c");const fk={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:"text/plain"};class mk{constructor(e){this.data=e}update(){}getData(){return this.data}}const pk={CurrentDragAndDropData:void 0};class _k extends We{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof $g&&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 Gg)),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(gm.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,cn&&this._register(Zn(e,Wo.DRAG_START,e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(fk.TEXT,this._action.label)}))),this._register(Zn(t,hm.Tap,e=>this.onClick(e))),this._register(Zn(t,Wo.MOUSE_DOWN,e=>{i||Bo.stop(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")})),s["f"]&&this._register(Zn(t,Wo.CONTEXT_MENU,e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)})),this._register(Zn(t,Wo.CLICK,e=>{Bo.stop(e,!0),this.options&&this.options.isMenu||s["k"](()=>this.onClick(e))})),this._register(Zn(t,Wo.DBLCLICK,e=>{Bo.stop(e,!0)})),[Wo.MOUSE_UP,Wo.MOUSE_OUT].forEach(e=>{this._register(Zn(t,e,e=>{Bo.stop(e),t.classList.remove("active")}))})}onClick(e){var t;Bo.stop(e,!0);const i=Ms(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.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.classList.remove("focused"))}updateEnabled(){}updateLabel(){}updateTooltip(){}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),super.dispose()}}class bk extends _k{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=Ko(this.element,Yo("a.action-label"))),this.label&&(this._action.id===Yg.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&&(Ko(this.element,Yo("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}focus(){super.focus(),this.label&&this.label.focus()}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({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.label.tabIndex=0),this.element&&this.element.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled"),Jo(this.label)),this.element&&this.element.classList.add("disabled"))}updateChecked(){this.label&&(this.getAction().checked?this.label.classList.add("checked"):this.label.classList.remove("checked"))}}class vk extends We{constructor(e,t={}){var i,n,o,s,r,a;let l,c;switch(super(),this.triggerKeyDown=!1,this._onDidBlur=this._register(new Ye),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new Ye({onFirstListenerAdd:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new Ye),this.onDidRun=this._onDidRun.event,this._onBeforeRun=this._register(new Ye),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!==(s=null===(o=this.options.triggerKeys)||void 0===o?void 0:o.keyDown)&&void 0!==s&&s,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new Gg,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:l=this.options.ignoreOrientationForPreviousAndNextKey?[15,16]:[15],c=this.options.ignoreOrientationForPreviousAndNextKey?[17,18]:[17];break;case 1:l=this.options.ignoreOrientationForPreviousAndNextKey?[17,18]:[17],c=this.options.ignoreOrientationForPreviousAndNextKey?[15,16]:[15],this.domNode.className+=" reverse";break;case 2:l=this.options.ignoreOrientationForPreviousAndNextKey?[15,16]:[16],c=this.options.ignoreOrientationForPreviousAndNextKey?[17,18]:[18],this.domNode.className+=" vertical";break;case 3:l=this.options.ignoreOrientationForPreviousAndNextKey?[17,18]:[18],c=this.options.ignoreOrientationForPreviousAndNextKey?[15,16]:[16],this.domNode.className+=" vertical reverse";break}this._register(Zn(this.domNode,Wo.KEY_DOWN,e=>{const t=new Ln(e);let i=!0;l&&(t.equals(l[0])||t.equals(l[1]))?i=this.focusPrevious():c&&(t.equals(c[0])||t.equals(c[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())})),this._register(Zn(this.domNode,Wo.KEY_UP,e=>{const t=new Ln(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(Uo(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{Io()!==this.domNode&&xo(Io(),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=Ns(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(Zn(i,Wo.CONTEXT_MENU,e=>{Bo.stop(e,!0)})),this.options.actionViewItemProvider&&(o=this.options.actionViewItemProvider(e)),o||(o=new bk(this.context,e,t)),o.actionRunner=this._actionRunner,o.setActionContext(this.context),o.render(i),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++)}),this.focusedItem&&this.focus(this.focusedItem)}clear(){Ae(this.viewItems),this.viewItems=[],this._actionIds=[],Gn(this.actionsList)}focus(e){let t=!1,i=void 0;if(void 0===e?t=!0:"number"===typeof e?i=e:"boolean"===typeof e&&(t=e),t&&"undefined"===typeof this.focusedItem){const e=this.viewItems.findIndex(e=>e.isEnabled());this.focusedItem=-1===e?void 0:e,this.updateFocus()}else void 0!==i&&(this.focusedItem=i),this.updateFocus()}focusNext(){"undefined"===typeof this.focusedItem&&(this.focusedItem=this.viewItems.length-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&&!t.isEnabled());return this.focusedItem!==e||t.isEnabled()||(this.focusedItem=void 0),this.updateFocus(),!0}focusPrevious(){"undefined"===typeof this.focusedItem&&(this.focusedItem=0);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&&!t.isEnabled());return this.focusedItem!==e||t.isEnabled()||(this.focusedItem=void 0),this.updateFocus(!0),!0}updateFocus(e,t){"undefined"===typeof this.focusedItem&&this.actionsList.focus({preventScroll:t});for(let i=0;ie.id.localeCompare(t.id),t=e=>{while(Df.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 o of n.filter(e=>!!e.description).sort(e))i.push(`||${o.id}|${Df.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of n.filter(e=>!Df.isThemeIcon(e.defaults)).sort(e))i.push(`||${o.id}|`);return i.join("\n")}}const yk=new Ck;function Sk(e,t,i,n){return yk.registerIcon(e,t,i,n)}function xk(){return yk}function Lk(){for(const e of fa.all)yk.registerIcon(e.id,e.definition,e.description);fa.onDidRegister(e=>yk.registerIcon(e.id,e.definition,e.description))}Ah.add(wk.IconContribution,yk),Lk();const kk="vscode://schemas/icons";let Ek=Ah.as(Rh.JSONContribution);Ek.registerSchema(kk,yk.getIconSchema());const Dk=new Vn(()=>Ek.notifySchemaChanged(kk),200);yk.onDidChange(()=>{Dk.isScheduled()||Dk.schedule()});Sk("widget-close",pa.close,o("widgetClose","Icon for the close action in widgets."));var Nk;const Ik=3;class Tk{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 Mk{constructor(e){this.entries=e}}const Ok=Sk("diff-review-insert",pa.add,o("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),Ak=Sk("diff-review-remove",pa.remove,o("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),Rk=Sk("diff-review-close",pa.close,o("diffReviewCloseIcon","Icon for 'Close' in diff review."));class Pk extends We{constructor(e){super(),this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=am(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=am(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new vk(this.actionBarContainer.domNode)),this._actionBar.push(new $g("diffreview.close",o("label.close","Close"),"close-diff-review "+Df.asClassName(Rk),!0,()=>(this.hide(),Promise.resolve(null))),{label:!1,icon:!0}),this.domNode=am(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=am(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new hS(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(eo(this.domNode.domNode,"click",e=>{e.preventDefault();let t=Lo(e.target,"diff-review-row");t&&this._goToRow(t)})),this._register(eo(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[l-1];n=0===t.originalEndLineNumber?t.originalStartLineNumber+1:t.originalEndLineNumber+1,o=0===t.modifiedEndLineNumber?t.modifiedStartLineNumber+1:t.modifiedEndLineNumber+1}let s=t-Ik+1,c=i-Ik+1;if(ss){const e=s-m;m+=e,p+=e}if(p>f){const e=f-p;m+=e,p+=e}u[g++]=new Tk(n,m,o,p)}n[o++]=new Mk(u)}let s=n[0].entries,r=[],a=0;for(let l=1,c=n.length;lh)&&(h=i),0!==n&&(0===u||ng)&&(g=s)}let f=document.createElement("div");f.className="diff-review-row";let m=document.createElement("div");m.className="diff-review-cell diff-review-summary";const p=h-d+1,_=g-u+1;m.appendChild(document.createTextNode(`${a+1}/${this._diffs.length}: @@ -${d},${p} +${u},${_} @@`)),f.setAttribute("data-line",String(u));const b=e=>0===e?o("no_lines_changed","no lines changed"):1===e?o("one_line_changed","1 line changed"):o("more_lines_changed","{0} lines changed",e),v=b(p),w=b(_);f.setAttribute("aria-label",o({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}",a+1,this._diffs.length,d,v,u,w)),f.appendChild(m),f.setAttribute("role","listitem"),c.appendChild(f);const C=t.get(53);let y=u;for(let o=0,S=l.length;oe}),Af((e,t)=>{const i=e.getColor(_C);i&&t.addRule(`.monaco-diff-editor .diff-review-line-number { color: ${i}; }`);const n=e.getColor(Wv);n&&t.addRule(`.monaco-diff-editor .diff-review-shadow { box-shadow: ${n} 0 -6px 6px -6px inset; }`)});class Fk extends Yf{constructor(){super({id:"editor.action.diffReview.next",label:o("editor.action.diffReview.next","Go to Next Difference"),alias:"Go to Next Difference",precondition:tf.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:65,weight:100}})}run(e,t){const i=Bk(e);i&&i.diffReviewNext()}}class Wk extends Yf{constructor(){super({id:"editor.action.diffReview.prev",label:o("editor.action.diffReview.prev","Go to Previous Difference"),alias:"Go to Previous Difference",precondition:tf.has("isInDiffEditor"),kbOpts:{kbExpr:null,primary:1089,weight:100}})}run(e,t){const i=Bk(e);i&&i.diffReviewPrev()}}function Bk(e){const t=e.get(Ji),i=t.listDiffEditors(),n=t.getActiveCodeEditor();if(!n)return null;for(let o=0,s=i.length;on.modifiedStartLineNumber?o("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):o("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"),void 0,!0,()=>zk(this,void 0,void 0,(function*(){const e=new li(n.originalStartLineNumber,1,n.originalEndLineNumber+1,1),t=n.originalModel.getValueInRange(e);yield this._clipboardService.writeText(t)}))));let d=0,h=void 0;n.originalEndLineNumber>n.modifiedStartLineNumber&&(h=new $g("diff.clipboard.copyDeletedLineContent",o("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber),void 0,!0,()=>zk(this,void 0,void 0,(function*(){const e=n.originalModel.getLineContent(n.originalStartLineNumber+d);yield this._clipboardService.writeText(e)}))),c.push(h));const u=i.getOption(75);u||c.push(new $g("diff.inline.revertChange",o("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>zk(this,void 0,void 0,(function*(){const e=new li(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 li(n.modifiedStartLineNumber,e,n.modifiedStartLineNumber,e),text:l+t}])}else{const e=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new li(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,e),text:t}])}}))));const g=(e,t)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:e,y:t}),getActions:()=>(h&&(h.label=o("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+d)),c),autoSelectFirstItem:!0})};this._register(eo(this._diffActions,"mousedown",e=>{const{top:t,height:i}=bo(this._diffActions);let n=Math.floor(a/3);e.preventDefault(),g(e.posx,t+i+n)})),this._register(i.onMouseMove(e=>{if(8===e.target.type||5===e.target.type){const t=e.target.detail.viewZoneId;t===this._viewZoneId?(this.visibility=!0,d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,a)):this.visibility=!1}else this.visibility=!1})),this._register(i.onMouseDown(e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){const t=e.target.detail.viewZoneId;t===this._viewZoneId&&(e.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,a),g(e.event.posx,e.event.posy+a))}}))}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}=bo(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=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},Yk=function(e,t){return function(i,n){t(i,n,e)}};class Xk{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter(e=>!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?gk.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 tE=class e extends We{constructor(t,i,n,o,s,r,a,l,c,d,h,u){super(),this._editorProgressService=u,this._onDidDispose=this._register(new Ye),this.onDidDispose=this._onDidDispose.event,this._onDidUpdateDiff=this._register(new Ye),this.onDidUpdateDiff=this._onDidUpdateDiff.event,this._onDidContentSizeChange=this._register(new Ye),this._lastOriginalWarning=null,this._lastModifiedWarning=null,this._editorWorkerService=s,this._codeEditorService=l,this._contextKeyService=this._register(r.createScoped(t)),this._contextKeyService.createKey("isInDiffEditor",!0),this._themeService=c,this._notificationService=d,this._id=++Zk,this._state=0,this._updatingDiffProgress=null,this._domElement=t,i=i||{},this._renderSideBySide=!0,"undefined"!==typeof i.renderSideBySide&&(this._renderSideBySide=i.renderSideBySide),this._maxComputationTime=5e3,"undefined"!==typeof i.maxComputationTime&&(this._maxComputationTime=i.maxComputationTime),this._ignoreTrimWhitespace=!0,"undefined"!==typeof i.ignoreTrimWhitespace&&(this._ignoreTrimWhitespace=i.ignoreTrimWhitespace),this._renderIndicators=!0,"undefined"!==typeof i.renderIndicators&&(this._renderIndicators=i.renderIndicators),this._originalIsEditable=w(i.originalEditable,!1),this._diffCodeLens=w(i.diffCodeLens,!1),this._diffWordWrap=hE(i.diffWordWrap,"inherit"),"undefined"!==typeof i.isInEmbeddedEditor?this._contextKeyService.createKey("isInEmbeddedDiffEditor",i.isInEmbeddedEditor):this._contextKeyService.createKey("isInEmbeddedDiffEditor",!1),this._renderOverviewRuler=!0,"undefined"!==typeof i.renderOverviewRuler&&(this._renderOverviewRuler=Boolean(i.renderOverviewRuler)),this._updateDecorationsRunner=this._register(new Vn(()=>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=am(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(eo(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 Xk(h,o),this._modifiedEditorState=new Xk(h,o),this._isVisible=!0,this._isHandlingScrollEvent=!1,this._elementSizeObserver=this._register(new Hg(this._containerDomElement,i.dimension,()=>this._onDidContainerSizeChanged())),i.automaticLayout&&this._elementSizeObserver.startObserving(),this._diffComputationResult=null;const g=this._contextKeyService.createScoped(),f=new wL;f.set(Cf,g);const m=a.createChild(f),p=this._contextKeyService.createScoped(),_=new wL;_.set(Cf,p);const b=a.createChild(_);this._originalEditor=this._createLeftHandSideEditor(i,n.originalEditor||{},m,g),this._modifiedEditor=this._createRightHandSideEditor(i,n.modifiedEditor||{},b,p),this._originalOverviewRuler=null,this._modifiedOverviewRuler=null,this._reviewPane=new Pk(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,"undefined"!==typeof i.enableSplitViewResizing&&(this._enableSplitViewResizing=i.enableSplitViewResizing),this._renderSideBySide?this._setStrategy(new aE(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new cE(this._createDataSource(),this._enableSplitViewResizing)),this._register(c.onDidColorThemeChange(t=>{this._strategy&&this._strategy.applyColors(t)&&this._updateDecorationsRunner.schedule(),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide)}));const v=Jf.getDiffEditorContributions();for(const e of v)try{this._register(a.createInstance(e.ctor,this))}catch(C){ve(C)}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+=If(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,n,o){const s=this._createInnerEditor(n,this._originalDomNode,this._adjustOptionsForLeftHandSide(t),i);this._register(s.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(s.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(s.onDidChangeConfiguration(e=>{s.getModel()&&(e.hasChanged(38)&&this._updateDecorationsRunner.schedule(),e.hasChanged(125)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(s.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()}));const r=o.createKey("isInDiffLeftEditor",void 0);return this._register(s.onDidFocusEditorWidget(()=>r.set(!0))),this._register(s.onDidBlurEditorWidget(()=>r.set(!1))),this._register(s.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})})),s}_createRightHandSideEditor(t,i,n,o){const s=this._createInnerEditor(n,this._modifiedDomNode,this._adjustOptionsForRightHandSide(t),i);this._register(s.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(s.onDidChangeViewZones(()=>{this._onViewZonesChanged()})),this._register(s.onDidChangeConfiguration(e=>{s.getModel()&&(e.hasChanged(38)&&this._updateDecorationsRunner.schedule(),e.hasChanged(125)&&(this._updateDecorationsRunner.cancel(),this._updateDecorations()))})),this._register(s.onDidChangeModelContent(()=>{this._isVisible&&this._beginUpdateDecorationsSoon()})),this._register(s.onDidChangeModelOptions(e=>{e.tabSize&&this._updateDecorationsRunner.schedule()}));const r=o.createKey("isInDiffRightEditor",void 0);return this._register(s.onDidFocusEditorWidget(()=>r.set(!0))),this._register(s.onDidBlurEditorWidget(()=>r.set(!1))),this._register(s.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})})),s}_createInnerEditor(e,t,i,n){return e.createInstance(jL,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 mr.IDiffEditor}getLineChanges(){return this._diffComputationResult?this._diffComputationResult.changes:null}getOriginalEditor(){return this._originalEditor}getModifiedEditor(){return this._modifiedEditor}updateOptions(t){let i=!1;"undefined"!==typeof t.renderSideBySide&&this._renderSideBySide!==t.renderSideBySide&&(this._renderSideBySide=t.renderSideBySide,i=!0),"undefined"!==typeof t.maxComputationTime&&(this._maxComputationTime=t.maxComputationTime,this._isVisible&&this._beginUpdateDecorationsSoon());let n=!1;"undefined"!==typeof t.ignoreTrimWhitespace&&this._ignoreTrimWhitespace!==t.ignoreTrimWhitespace&&(this._ignoreTrimWhitespace=t.ignoreTrimWhitespace,n=!0),"undefined"!==typeof t.renderIndicators&&this._renderIndicators!==t.renderIndicators&&(this._renderIndicators=t.renderIndicators,n=!0),n&&this._beginUpdateDecorations(),this._originalIsEditable=w(t.originalEditable,this._originalIsEditable),this._diffCodeLens=w(t.diffCodeLens,this._diffCodeLens),this._diffWordWrap=hE(t.diffWordWrap,this._diffWordWrap),this._modifiedEditor.updateOptions(this._adjustOptionsForRightHandSide(t)),this._originalEditor.updateOptions(this._adjustOptionsForLeftHandSide(t)),"undefined"!==typeof t.enableSplitViewResizing&&(this._enableSplitViewResizing=t.enableSplitViewResizing),this._strategy.setEnableSplitViewResizing(this._enableSplitViewResizing),i&&(this._renderSideBySide?this._setStrategy(new aE(this._createDataSource(),this._enableSplitViewResizing)):this._setStrategy(new cE(this._createDataSource(),this._enableSplitViewResizing)),this._containerDomElement.className=e._getClassName(this._themeService.getColorTheme(),this._renderSideBySide)),"undefined"!==typeof 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(){const e=this._originalEditor.saveViewState(),t=this._modifiedEditor.saveViewState();return{original:e,modified:t}}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,o=this._modifiedEditor.getLayoutInfo();o&&(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(o("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=t.scrollbar||{},t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._diffCodeLens,t.fixedOverflowWidgets=!0,t.minimap||(t.minimap={}),t.minimap.enabled=!1,t}_adjustOptionsForLeftHandSide(e){const t=this._adjustOptionsForSubEditor(e);return this._renderSideBySide?t.wordWrapOverride1=this._diffWordWrap:t.wordWrapOverride1="off",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 i.wordWrapOverride1=this._diffWordWrap,i.revealHorizontalRightPadding=pe.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,r=Math.max(0,Math.floor(e.height*s)),a=Math.floor(t*s);return{height:r,top:a}}_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}};tE.ONE_OVERVIEW_WIDTH=15,tE.ENTIRE_DIFF_OVERVIEW_WIDTH=30,tE.UPDATE_DIFF_DECORATIONS_DELAY=200,tE=Gk([Yk(3,Kk),Yk(4,il),Yk(5,Cf),Yk(6,Yi),Yk(7,Ji),Yk(8,kf),Yk(9,Yu),Yk(10,Hk),Yk(11,qk)],tE);class iE extends We{constructor(e){super(),this._dataSource=e,this._insertColor=null,this._removeColor=null}applyColors(e){const t=(e.getColor(bw)||pw).transparent(2),i=(e.getColor(vw)||_w).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 nE{constructor(e){this._source=e,this._index=-1,this.current=null,this.advance()}advance(){this._index++,this._indexe.afterLineNumber-t.afterLineNumber,p=(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)},_=new nE(this._modifiedForeignVZ),b=new nE(this._originalForeignVZ);let v=1,w=1;for(let C=0,y=this._lineChanges.length;C<=y;C++){const i=C0?-1:0),u=i.modifiedStartLineNumber+(i.modifiedEndLineNumber>0?-1:0),d=i.originalEndLineNumber>0?oE._getViewLineCount(this._originalEditor,i.originalStartLineNumber,i.originalEndLineNumber):0,c=i.modifiedEndLineNumber>0?oE._getViewLineCount(this._modifiedEditor,i.modifiedStartLineNumber,i.modifiedEndLineNumber):0,g=Math.max(i.originalStartLineNumber,i.originalEndLineNumber),f=Math.max(i.modifiedStartLineNumber,i.modifiedEndLineNumber)):(h+=1e7+d,u+=1e7+c,g=h,f=u);let n=[],S=[];if(o){let e;e=i?i.originalEndLineNumber>0?i.originalStartLineNumber-v:i.modifiedStartLineNumber-w:s.getLineCount()-v;for(let t=0;ts&&S.push({afterLineNumber:i,heightInLines:o-s,domNode:null,marginDomNode:null})}i&&(v=(i.originalEndLineNumber>0?i.originalEndLineNumber:i.originalStartLineNumber)+1,w=(i.modifiedEndLineNumber>0?i.modifiedEndLineNumber:i.modifiedStartLineNumber)+1)}while(_.current&&_.current.afterLineNumber<=f){let e;e=_.current.afterLineNumber<=u?h-u+_.current.afterLineNumber:g;let o=null;i&&i.modifiedStartLineNumber<=_.current.afterLineNumber&&_.current.afterLineNumber<=i.modifiedEndLineNumber&&(o=this._createOriginalMarginDomNodeForModifiedForeignViewZoneInAddedRegion()),n.push({afterLineNumber:e,heightInLines:_.current.height/t,domNode:null,marginDomNode:o}),_.advance()}while(b.current&&b.current.afterLineNumber<=g){let t;t=b.current.afterLineNumber<=h?u-h+b.current.afterLineNumber:f,S.push({afterLineNumber:t,heightInLines:b.current.height/e,domNode:null}),b.advance()}if(null!==i&&uE(i)){const e=this._produceOriginalFromDiff(i,d,c);e&&n.push(e)}if(null!==i&&gE(i)){const e=this._produceModifiedFromDiff(i,d,c);e&&S.push(e)}let x=0,L=0;n=n.sort(m),S=S.sort(m);while(x=t.heightInLines?(e.heightInLines-=t.heightInLines,L++):(t.heightInLines-=e.heightInLines,x++)}while(x(e.domNode||(e.domNode=fE()),e))}}function sE(e,t,i,n,o){return{range:new li(e,t,i,n),options:o}}const rE={charDelete:_b.register({className:"char-delete"}),charDeleteWholeLine:_b.register({className:"char-delete",isWholeLine:!0}),charInsert:_b.register({className:"char-insert"}),charInsertWholeLine:_b.register({className:"char-insert",isWholeLine:!0}),lineInsert:_b.register({className:"line-insert",marginClassName:"line-insert",isWholeLine:!0}),lineInsertWithSign:_b.register({className:"line-insert",linesDecorationsClassName:"insert-sign "+Df.asClassName(Qk),marginClassName:"line-insert",isWholeLine:!0}),lineDelete:_b.register({className:"line-delete",marginClassName:"line-delete",isWholeLine:!0}),lineDeleteWithSign:_b.register({className:"line-delete",linesDecorationsClassName:"delete-sign "+Df.asClassName(Jk),marginClassName:"line-delete",isWholeLine:!0}),lineDeleteMargin:_b.register({marginClassName:"line-delete"})};class aE extends iE{constructor(e,t){super(e),this._disableSash=!1===t,this._sashRatio=null,this._sashPosition=null,this._startSashPosition=null,this._sash=this._register(new rk(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(),i=t-(this._dataSource.getOptions().renderOverviewRuler?tE.ENTIRE_DIFF_OVERVIEW_WIDTH:0);let n=Math.floor((e||.5)*i);const o=Math.floor(.5*i);return n=this._disableSash?o:n||o,i>2*aE.MINIMUM_EDITOR_WIDTH?(ni-aE.MINIMUM_EDITOR_WIDTH&&(n=i-aE.MINIMUM_EDITOR_WIDTH)):n=o,this._sashPosition!==n&&(this._sashPosition=n,this._sash.layout()),this._sashPosition}_onSashDragStart(){this._startSashPosition=this._sashPosition}_onSashDrag(e){const t=this._dataSource.getWidth(),i=t-(this._dataSource.getOptions().renderOverviewRuler?tE.ENTIRE_DIFF_OVERVIEW_WIDTH:0),n=this.layout((this._startSashPosition+(e.currentX-e.startX))/i);this._sashRatio=n/i,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(),s=new lE(e,t,i,n,o);return s.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 l of e)if(gE(l)){s.decorations.push({range:new li(l.originalStartLineNumber,1,l.originalEndLineNumber,1073741824),options:i?rE.lineDeleteWithSign:rE.lineDelete}),uE(l)&&l.charChanges||s.decorations.push(sE(l.originalStartLineNumber,1,l.originalEndLineNumber,1073741824,rE.charDeleteWholeLine));const e=mE(r,a,l.originalStartLineNumber,l.originalEndLineNumber);if(s.overviewZones.push(new GS(e.startLineNumber,e.endLineNumber,o)),l.charChanges)for(const i of l.charChanges)if(gE(i))if(t)for(let e=i.originalStartLineNumber;e<=i.originalEndLineNumber;e++){let t,n;t=e===i.originalStartLineNumber?i.originalStartColumn:r.getLineFirstNonWhitespaceColumn(e),n=e===i.originalEndLineNumber?i.originalEndColumn:r.getLineLastNonWhitespaceColumn(e),s.decorations.push(sE(e,t,e,n,rE.charDelete))}else s.decorations.push(sE(i.originalStartLineNumber,i.originalStartColumn,i.originalEndLineNumber,i.originalEndColumn,rE.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 l of e)if(uE(l)){s.decorations.push({range:new li(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824),options:i?rE.lineInsertWithSign:rE.lineInsert}),gE(l)&&l.charChanges||s.decorations.push(sE(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824,rE.charInsertWholeLine));const e=mE(r,a,l.modifiedStartLineNumber,l.modifiedEndLineNumber);if(s.overviewZones.push(new GS(e.startLineNumber,e.endLineNumber,o)),l.charChanges)for(const i of l.charChanges)if(uE(i))if(t)for(let e=i.modifiedStartLineNumber;e<=i.modifiedEndLineNumber;e++){let t,n;t=e===i.modifiedStartLineNumber?i.modifiedStartColumn:r.getLineFirstNonWhitespaceColumn(e),n=e===i.modifiedEndLineNumber?i.modifiedEndColumn:r.getLineLastNonWhitespaceColumn(e),s.decorations.push(sE(e,t,e,n,rE.charInsert))}else s.decorations.push(sE(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn,rE.charInsert))}return s}}aE.MINIMUM_EDITOR_WIDTH=100;class lE extends oE{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 cE extends iE{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(),r=new dE(e,t,i,o,s,n);return r.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 l of e)if(gE(l)){o.decorations.push({range:new li(l.originalStartLineNumber,1,l.originalEndLineNumber,1073741824),options:rE.lineDeleteMargin});const e=mE(r,a,l.originalStartLineNumber,l.originalEndLineNumber);o.overviewZones.push(new GS(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 l of e)if(uE(l)){s.decorations.push({range:new li(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824),options:i?rE.lineInsertWithSign:rE.lineInsert});const e=mE(r,a,l.modifiedStartLineNumber,l.modifiedEndLineNumber);if(s.overviewZones.push(new GS(e.startLineNumber,e.endLineNumber,o)),l.charChanges){for(const i of l.charChanges)if(uE(i))if(t)for(let e=i.modifiedStartLineNumber;e<=i.modifiedEndLineNumber;e++){let t,n;t=e===i.modifiedStartLineNumber?i.modifiedStartColumn:r.getLineFirstNonWhitespaceColumn(e),n=e===i.modifiedEndLineNumber?i.modifiedEndColumn:r.getLineLastNonWhitespaceColumn(e),s.decorations.push(sE(e,t,e,n,rE.charInsert))}else s.decorations.push(sE(i.modifiedStartLineNumber,i.modifiedStartColumn,i.modifiedEndLineNumber,i.modifiedEndColumn,rE.charInsert))}else s.decorations.push(sE(l.modifiedStartLineNumber,1,l.modifiedEndLineNumber,1073741824,rE.charInsertWholeLine))}return s}layout(){return Math.max(5,this._decorationsLeft)}}class dE extends oE{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 "+MC;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 r=e.originalStartLineNumber;r<=e.originalEndLineNumber;r++)this._lineBreaksComputer.addRequest(this._originalModel.getLineContent(r),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(38),o=t.get(26),s=n.typicalHalfwidthCharacterWidth,r=t.get(88),a=this._originalModel.mightContainNonBasicASCII(),l=this._originalModel.mightContainRTL(),c=t.get(53),d=t.get(124),h=d.decorationsWidth,u=t.get(100),g=t.get(83),f=t.get(77),m=t.get(39),p=this._lineBreaksComputer.finalize();let _=0;for(let b=0;b0,S=El(1e4);let x=0,L=0,k=null;for(let s=t.originalStartLineNumber;s<=t.originalEndLineNumber;s++){const r=s-t.originalStartLineNumber,b=this._originalModel.getLineTokens(s),v=b.getLineContent(),E=p[_++],D=yd.filter(C,s,1,v.length+1);if(E){let t=0;for(const e of E.breakOffsets){const s=b.sliceAndInflate(t,e,0),r=v.substring(t,e);x=Math.max(x,this._renderOriginalLine(L++,r,s,yd.extractWrapped(D,t,e),y,a,l,n,o,c,h,u,g,f,m,i,S,w)),t=e}k||(k=[]);while(k.lengthe.afterLineNumber-t.afterLineNumber)}_renderOriginalLine(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f,m,p,_){p.appendASCIIString('
');const b=qd.isBasicASCII(t,s),v=qd.containsRTL(t,b,r),w=Td(new Dd(a.isMonospace&&!l,a.canUseHalfwidthRightwardsArrow,t,!1,b,v,0,i,n,m,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,h,u,g,f!==F.OFF,null),p);if(p.appendASCIIString("
"),this._renderIndicators){const t=document.createElement("div");t.className="delete-sign "+Df.asClassName(Jk),t.setAttribute("style",`position:absolute;top:${e*c}px;width:${d}px;height:${c}px;right:0;`),_.appendChild(t)}const C=w.characterMapping.getAbsoluteOffsets();return C.length>0?C[C.length-1]:0}}function hE(e,t){return L(e,t,["off","on","inherit"])}function uE(e){return e.modifiedEndLineNumber>0}function gE(e){return e.originalEndLineNumber>0}function fE(){const e=document.createElement("div");return e.className="diagonal-fill",e}function mE(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 li(i,e.getLineMinColumn(i),n,e.getLineMaxColumn(n)))}Af((e,t)=>{const i=e.getColor(bw);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(vw);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(ww);o&&t.addRule(`.monaco-editor .line-insert, .monaco-editor .char-insert { border: 1px ${"hc"===e.type?"dashed":"solid"} ${o}; }`);const s=e.getColor(Cw);s&&t.addRule(`.monaco-editor .line-delete, .monaco-editor .char-delete { border: 1px ${"hc"===e.type?"dashed":"solid"} ${s}; }`);const r=e.getColor(Wv);r&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { box-shadow: -6px 0 5px -5px ${r}; }`);const a=e.getColor(yw);a&&t.addRule(`.monaco-diff-editor.side-by-side .editor.modified { border-left: 1px solid ${a}; }`);const l=e.getColor(Bv);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 c=e.getColor(Vv);c&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:hover {\n\t\t\t\tbackground: ${c};\n\t\t\t}\n\t\t`);const d=e.getColor(Hv);d&&t.addRule(`\n\t\t\t.monaco-diff-editor .diffViewport:active {\n\t\t\t\tbackground: ${d};\n\t\t\t}\n\t\t`);const h=e.getColor(Sw);t.addRule(`\n\t.monaco-editor .diagonal-fill {\n\t\tbackground-image: linear-gradient(\n\t\t\t-45deg,\n\t\t\t${h} 12.5%,\n\t\t\t#0000 12.5%, #0000 50%,\n\t\t\t${h} 50%, ${h} 62.5%,\n\t\t\t#0000 62.5%, #0000 100%\n\t\t);\n\t\tbackground-size: 8px 8px;\n\t}\n\t`)});const pE=Zi("themeService"),_E=Zi("keybindingService");var bE=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},vE=function(e,t){return function(i,n){t(i,n,e)}};let wE=0,CE=!1;function yE(){CE||(CE=!0,Rg(document.body))}let SE=class extends jL{constructor(e,t,i,n,o,s,r,a,l,c){const d=Object.assign({},t);d.ariaLabel=d.ariaLabel||sg.editorViewAccessibleLabel,d.ariaLabel=d.ariaLabel+";"+sg.accessibilityHelpMessage,super(e,d,{},i,n,o,s,a,l,c),this._standaloneKeybindingService=r instanceof bg?r:null,yE()}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_"+ ++wE,o=tf.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"),We.None;const t=e.id,i=e.label,n=tf.and(tf.equals("editorId",this.getId()),tf.deserialize(e.precondition)),o=e.keybindings,s=tf.and(n,tf.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),c=new Fe,d=this.getId()+":"+t;if(c.add(zs.registerCommand(d,l)),r){let e={command:{id:d,title:i},when:n,group:r,order:a};c.add(Hf.appendMenuItem(Bf.EditorContext,e))}if(Array.isArray(o))for(const u of o)c.add(this._standaloneKeybindingService.addDynamicKeybinding(d,u,l,s));let h=new Yx(d,i,i,n,l,this._contextKeyService);return this._actions[t]=h,c.add(Pe(()=>{delete this._actions[t]})),c}};SE=bE([vE(2,Yi),vE(3,Ji),vE(4,Hs),vE(5,Cf),vE(6,_E),vE(7,kf),vE(8,Yu),vE(9,CL)],SE);let xE=class extends SE{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f){const m=Object.assign({},t);Lg(h,m,!1);const p=c.registerEditorContainer(e);"string"===typeof m.theme&&c.setTheme(m.theme);let _,b=m.model;if(delete m.model,super(e,m,n,o,s,r,a,c,d,u),this._contextViewService=l,this._configurationService=h,this._standaloneThemeService=c,this._register(i),this._register(p),"undefined"===typeof b?(_=kE(g,f,m.value||"",m.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){Lg(this._configurationService,e,!1),"string"===typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),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)}};xE=bE([vE(3,Yi),vE(4,Ji),vE(5,Hs),vE(6,Cf),vE(7,_E),vE(8,Vk),vE(9,pE),vE(10,Yu),vE(11,Cu),vE(12,CL),vE(13,aa),vE(14,nl)],xE);let LE=class extends tE{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u,g,f){const m=Object.assign({},t);Lg(h,m,!0);const p=c.registerEditorContainer(e);"string"===typeof m.theme&&(m.theme=c.setTheme(m.theme)),super(e,m,{},f,a,o,n,l,c,d,u,g),this._contextViewService=r,this._configurationService=h,this._standaloneThemeService=c,this._register(i),this._register(p),this._contextViewService.setContainer(this._containerDomElement)}dispose(){super.dispose()}updateOptions(e){Lg(this._configurationService,e,!0),"string"===typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(SE,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 kE(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)),EE(e,i,t.createByFilepathOrFirstLine(o||null,s),o)}return EE(e,i,t.create(n),o)}function EE(e,t,i,n){return e.createModel(t,i,n)}LE=bE([vE(3,Yi),vE(4,Cf),vE(5,_E),vE(6,Vk),vE(7,il),vE(8,Ji),vE(9,pE),vE(10,Yu),vE(11,Cu),vE(12,Hk),vE(13,qk),vE(14,Kk)],LE);class DE{constructor(e){this._languageIdentifier=e}getId(){return this._languageIdentifier.language}}const NE="text/plain",IE="application/unknown";let TE=[],ME=[],OE=[];function AE(e,t=!1){const i=RE(e);TE.push(i),i.userConfigured?OE.push(i):ME.push(i),t&&!i.userConfigured&&TE.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 RE(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(Ot.sep)>=0}}function PE(e,t){let i;if(e)switch(e.scheme){case zn.file:i=e.fsPath;break;case zn.data:const t=ks.parseMetaData(e);i=t.get(ks.META_DATA_LABEL);break;default:i=e.path}if(!i)return[IE];i=i.toLowerCase();const n=Wt(i),o=FE(i,n,OE);if(o)return[o,NE];const s=FE(i,n,ME);if(s)return[s,NE];if(t){const e=WE(t);if(e)return[e,NE]}return[IE]}function FE(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;ea(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}function WE(e){if(Object(rs["R"])(e)&&(e=e.substr(1)),e.length>0)for(let t=TE.length-1;t>=0;t--){const i=TE[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i.mime}return null}const BE={ModesRegistry:"editor.modesRegistry"};class VE{constructor(){this._onDidChangeLanguages=new Ye,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}});const KE=Object.prototype.hasOwnProperty;class jE extends We{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new Ye),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(HE.onDidChangeLanguages(e=>this._initializeFromRegistry())))}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={};const e=HE.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})}),Ah.as(Bh.Configuration).registerOverrideIdentifiers(HE.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(KE.call(this._languages,t))i=this._languages[t];else{const e=this._getLanguageId(t);i={identifier:new ba(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)AE({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(let a of t.filenames)AE({id:i,mime:n,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(let a of t.filenamePatterns)AE({id:i,mime:n,filepattern:a},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);rs["M"](t)||AE({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(r){ve(r)}}e.aliases.push(i);let o=null;if("undefined"!==typeof t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const a of o)a&&0!==a.length&&e.aliases.push(a);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!!KE.call(this._mimeTypesMap,e)||KE.call(this._languages,e)}getModeIdForLanguageNameLowercase(e){return KE.call(this._lowercaseNameMap,e)?this._lowercaseNameMap[e].language:null}extractModeIds(e){return e?e.split(",").map(e=>e.trim()).map(e=>KE.call(this._mimeTypesMap,e)?this._mimeTypesMap[e].language:e).filter(e=>KE.call(this._languages,e)):[]}getLanguageIdentifier(e){if(e===Za||0===e)return Qa;let t;if("string"===typeof e)t=e;else if(t=this._languageIdToLanguage[e],!t)return null;return KE.call(this._languages,t)?this._languages[t].identifier:null}getModeIdsFromFilepathOrFirstLine(e,t){if(!e&&!t)return[];let i=PE(e,t);return this.extractModeIds(i.join(","))}}class qE extends We{constructor(e,t){super(),this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._selector=t,this.languageIdentifier=this._selector(),this._register(e(()=>this._evaluate()))}_evaluate(){let e=this._selector();e.id!==this.languageIdentifier.id&&(this.languageIdentifier=e,this._onDidChange.fire(this.languageIdentifier))}}class $E extends We{constructor(e=!1){super(),this._onDidCreateMode=this._register(new Ye),this.onDidCreateMode=this._onDidCreateMode.event,this._onLanguagesMaybeChanged=this._register(new Ye),this.onLanguagesMaybeChanged=this._onLanguagesMaybeChanged.event,this._instantiatedModes={},this._registry=this._register(new jE(!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 gc(i,null)}getModeId(e){const t=this._registry.extractModeIds(e);return gc(t,null)}getLanguageIdentifier(e){return this._registry.getLanguageIdentifier(e)}create(e){return new qE(this.onLanguagesMaybeChanged,()=>{const t=this.getModeId(e);return this._createModeAndGetLanguageIdentifier(t)})}createByFilepathOrFirstLine(e,t){return new qE(this.onLanguagesMaybeChanged,()=>{const i=this.getModeIdByFilepathOrFirstLine(e,t);return this._createModeAndGetLanguageIdentifier(i)})}_createModeAndGetLanguageIdentifier(e){const t=this.getLanguageIdentifier(e||"plaintext")||Qa;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)||Qa;this._instantiatedModes[e]=new DE(t),this._onDidCreateMode.fire(this._instantiatedModes[e])}return this._instantiatedModes[e]}}const GE=Zi("undoRedoService");class YE{constructor(e,t){this.resource=e,this.elements=t}}class XE{constructor(){this.id=XE._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}XE._ID=0,XE.None=new XE;class ZE{constructor(){this.id=ZE._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}}ZE._ID=0,ZE.None=new ZE;class QE{constructor(e,t,i){this._legend=e,this._themeService=t,this._logService=i,this._hashTable=new tD}getMetadata(e,t,i){const n=this._hashTable.get(e,t,i.id);let o;if(n)o=n.metadata,this._logService.getLevel()===td.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${va.getForeground(o)}, fontStyle ${va.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()===td.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);if("undefined"===typeof r)o=2147483647;else{if(o=0,"undefined"!==typeof r.italic){const e=(r.italic?1:0)<<11;o|=1|e}if("undefined"!==typeof r.bold){const e=(r.bold?2:0)<<11;o|=2|e}if("undefined"!==typeof r.underline){const e=(r.underline?4:0)<<11;o|=4|e}if(r.foreground){const e=r.foreground<<14;o|=8|e}0===o&&(o=2147483647)}}else this._logService.getLevel()===td.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()===td.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${n}) / ${t} (${s.join(" ")}): foreground ${va.getForeground(o)}, fontStyle ${va.getFontStyle(o).toString(2)}`)}return o}}function JE(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,c=0;while(ae&&0===n[5*t])t--;if(t-1===e){let e=d;while(e+1=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=tD._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+10?t[0]:null}function hD(e){const t=$a.ordered(e);return t.length>0?t[0]:null}zs.registerCommand("_provideDocumentSemanticTokensLegend",(e,...t)=>rD(void 0,void 0,void 0,(function*(){const[i]=t;Os(i instanceof Xt);const n=e.get(aa).getModel(i);if(!n)return;const o=dD(n);return o?o.getLegend():e.get(Hs).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)}))),zs.registerCommand("_provideDocumentSemanticTokens",(e,...t)=>rD(void 0,void 0,void 0,(function*(){const[i]=t;Os(i instanceof Xt);const n=e.get(aa).getModel(i);if(!n)return;const o=cD(n,null,et.None);if(!o)return e.get(Hs).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const{provider:s,request:r}=o;let a;try{a=yield r}catch(c){return void we(c)}if(!a||!aD(a))return;const l=oD({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l}))),zs.registerCommand("_provideDocumentRangeSemanticTokensLegend",(e,...t)=>rD(void 0,void 0,void 0,(function*(){const[i]=t;Os(i instanceof Xt);const n=e.get(aa).getModel(i);if(!n)return;const o=hD(n);return o?o.getLegend():void 0}))),zs.registerCommand("_provideDocumentRangeSemanticTokens",(e,...t)=>rD(void 0,void 0,void 0,(function*(){const[i,n]=t;Os(i instanceof Xt),Os(li.isIRange(n));const o=e.get(aa).getModel(i);if(!o)return;const s=hD(o);if(!s)return;let r;try{r=yield s.provideDocumentRangeSemanticTokens(o,li.lift(n),et.None)}catch(a){return void we(a)}return r&&aD(r)?oD({id:0,type:"full",data:r.data}):void 0})));var uD=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},gD=function(e,t){return function(i,n){t(i,n,e)}};function fD(e){return e.toString()}function mD(e){const t=new Dr,i=e.createSnapshot();let n;while(n=i.read())t.update(n);return t.digest()}class pD{constructor(e,t,i){this._modelEventListeners=new Fe,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),this._languageSelection&&(this._languageSelection.dispose(),this._languageSelection=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 _D=s["d"]||s["f"]?1:2;class bD{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}}function vD(e){return e.scheme===zn.file||e.scheme===zn.vscodeRemote||e.scheme===zn.userData||"fake-fs"===e.scheme}let wD=class e extends We{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 Ye),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new Ye),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new Ye),this.onModelModeChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._semanticStyling=this._register(new xD(this._themeService,this._logService)),this._register(this._configurationService.onDidChangeConfiguration(()=>this._updateModelOptions())),this._updateModelOptions(),this._register(new SD(this,this._themeService,this._configurationService,this._semanticStyling))}static _readModelOptions(e,t){let i=ge.tabSize;if(e.editor&&"undefined"!==typeof e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(i=t),i<1&&(i=1)}let n=i;if(e.editor&&"undefined"!==typeof e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let o=ge.insertSpaces;e.editor&&"undefined"!==typeof e.editor.insertSpaces&&(o="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let s=_D;const r=e.eol;"\r\n"===r?s=2:"\n"===r&&(s=1);let a=ge.trimAutoWhitespace;e.editor&&"undefined"!==typeof e.editor.trimAutoWhitespace&&(a="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let l=ge.detectIndentation;e.editor&&"undefined"!==typeof e.editor.detectIndentation&&(l="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let c=ge.largeFileOptimizations;return e.editor&&"undefined"!==typeof e.editor.largeFileOptimizations&&(c="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations)),{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:o,detectIndentation:l,defaultEOL:s,trimAutoWhitespace:a,largeFileOptimizations:c}}_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===s["a"]||2===s["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=[];this._disposedModels.forEach(e=>{e.sharesUndoRedoStack||t.push(e)}),t.sort((e,t)=>e.time-t.time);while(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 hb(e,o,t,i,this._undoRedoService);if(i&&this._disposedModels.has(fD(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=mD(s)===e.sha1;if(n||e.sharesUndoRedoStack){for(const e of t.past)ip(e)&&e.matchesResource(i)&&e.setModel(s);for(const e of t.future)ip(e)&&e.matchesResource(i)&&e.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,e=>ip(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=fD(s.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new pD(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,UE,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[fD(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)ip(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri));for(const i of e.future)ip(i)&&i.matchesResource(t.uri)&&(s=!0,r+=i.heapSize(t.uri),i.setModel(t.uri))}}const a=e.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK;if(s)if(!o&&r>a){const e=n.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(t.uri,!1,e=>ip(e)&&e.matchesResource(t.uri)),this._insertDisposedModel(new bD(t.uri,n.model.getInitialUndoRedoSnapshot(),Date.now(),o,r,mD(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})}};wD.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,wD=uD([gD(0,Cu),gD(1,Jc),gD(2,kf),gD(3,ed),gD(4,GE)],wD);const CD="editor.semanticHighlighting";function yD(e,t,i){var n;const o=null===(n=i.getValue(CD,{overrideIdentifier:e.getLanguageIdentifier().language,resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"===typeof o?o:t.getColorTheme().semanticHighlighting}class SD extends We{constructor(e,t,i,n){super(),this._watchers=Object.create(null),this._semanticStyling=n;const o=e=>{this._watchers[e.uri.toString()]=new kD(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()];yD(n,t,i)?e||o(n):e&&s(n,e)}};this._register(e.onModelAdded(e=>{yD(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(CD)&&r()})),this._register(t.onDidColorThemeChange(r))}}class xD extends We{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 QE(e.getLegend(),this._themeService,this._logService)),this._caches.get(e)}}class LD{constructor(e,t,i){this._provider=e,this.resultId=t,this.data=i}dispose(){this._provider.releaseDocumentSemanticTokens(this.resultId)}}class kD extends We{constructor(e,t,i){super(),this._isDisposed=!1,this._model=e,this._semanticStyling=i,this._fetchDocumentSemanticTokens=this._register(new Vn(()=>this._fetchDocumentSemanticTokensNow(),kD.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule()}));const n=()=>{Ae(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of qa.all(e))"function"===typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange(()=>this._fetchDocumentSemanticTokens.schedule(0)))};n(),this._register(qa.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 it,t=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,i=cD(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=>{const t=e&&(Se(e)||"string"===typeof e.message&&-1!==e.message.indexOf("busy"));t||ve(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(lD(t)){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 o of t.edits)e+=(o.data?o.data.length:0)-o.deleteCount;const i=o.data,n=new Uint32Array(i.length+e);let s=i.length,r=n.length;for(let o=t.edits.length-1;o>=0;o--){const e=t.edits[o],a=s-(e.start+e.deleteCount);a>0&&(kD._copy(i,s-a,n,r-a,a),r-=a),e.data&&(kD._copy(e.data,0,n,r-e.data.length,e.data.length),r-=e.data.length),s=e.start}s>0&&kD._copy(i,0,n,0,s),t={resultId:t.resultId,data:n}}}if(aD(t)){this._currentDocumentResponse=new LD(e,t.resultId,t.data);const o=JE(t,i,this._model.getLanguageIdentifier());if(n.length>0)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)}}kD.FETCH_DOCUMENT_SEMANTIC_TOKENS_DELAY=300;class ED extends We{constructor(){super(),this._onCodeEditorAdd=this._register(new Ye),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new Ye),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new Ye),this._onDiffEditorRemove=this._register(new Ye),this._onDecorationTypeRegistered=this._register(new Ye),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)){const e=this._modelProperties.get(i);return e.get(t)}}}var DD=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},ND=function(e,t){return function(i,n){t(i,n,e)}};class ID{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){const i=this._styleSheet.sheet;i.insertRule(e,t)}removeRulesContainingSelector(e){Po(e,this._styleSheet)}}class TD{constructor(e){this._styleSheet=e}ref(){}unref(){}insertRule(e,t){const i=this._styleSheet.sheet;i.insertRule(e,t)}removeRulesContainingSelector(e){Po(e,this._styleSheet)}}let MD=class extends ED{constructor(e,t=null){super(),this._decorationOptionProviders=new Map,this._editorStyleSheets=new Map,this._globalStyleSheet=t||null,this._themeService=e}_getOrCreateGlobalStyleSheet(){return this._globalStyleSheet||(this._globalStyleSheet=new TD(To())),this._globalStyleSheet}_getOrCreateStyleSheet(e){if(!e)return this._getOrCreateGlobalStyleSheet();const t=e.getContainerDomNode();if(!Do(t))return this._getOrCreateGlobalStyleSheet();const i=e.getId();if(!this._editorStyleSheets.has(i)){const e=new ID(this,i,To(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 OD(this._themeService,s,r):new AD(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)}};MD=DD([ND(0,kf)],MD);class OD{constructor(e,t,i){this._styleSheet=t,this._styleSheet.ref(),this._parentTypeKey=i.parentTypeKey,this.refCount=0,this._beforeContentRules=new PD(3,i,e),this._afterContentRules=new PD(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 AD{constructor(e,t,i){this._disposables=new Fe,this._styleSheet=t,this._styleSheet.ref(),this.refCount=0;const n=t=>{const n=new PD(t,i,e);if(this._disposables.add(n),n.hasContent)return n.className},o=t=>{const n=new PD(t,i,e);return this._disposables.add(n),n.hasContent?{className:n.className,hasLetterSpacing:n.hasLetterSpacing}:null};this.className=n(0);const s=o(1);s&&(this.inlineClassName=s.className,this.inlineClassNameAffectsLetterSpacing=s.hasLetterSpacing),this.beforeContentClassName=n(3),this.afterContentClassName=n(4),this.glyphMarginClassName=n(2);const r=i.options;this.isWholeLine=Boolean(r.isWholeLine),this.stickiness=r.rangeBehavior;const a=r.light&&r.light.overviewRulerColor||r.overviewRulerColor,l=r.dark&&r.dark.overviewRulerColor||r.overviewRulerColor;"undefined"===typeof a&&"undefined"===typeof l||(this.overviewRuler={color:a||l,darkColor:l||a,position:r.overviewRulerLane||pr.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 RD={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 PD{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=FD.getClassName(this._providerArgs.key,e);this._providerArgs.parentTypeKey&&(n=n+" "+FD.getClassName(this._providerArgs.parentTypeKey,e)),this._className=n,this._unThemedSelector=FD.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("undefined"!==typeof e){if(this.collectBorderSettingsCSSText(e,t),"undefined"!==typeof e.contentIconPath&&t.push(rs["v"](RD.contentIconPath,os(Xt.revive(e.contentIconPath)))),"string"===typeof e.contentText){const i=e.contentText.match(/^.*$/m)[0],n=i.replace(/['\\]/g,"\\$&");t.push(rs["v"](RD.contentText,n))}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"undefined"!==typeof e.gutterIconPath&&(t.push(rs["v"](RD.gutterIconPath,os(Xt.revive(e.gutterIconPath)))),"undefined"!==typeof e.gutterIconSize&&t.push(rs["v"](RD.gutterIconSize,e.gutterIconSize))),t.join("")}collectBorderSettingsCSSText(e,t){return!!this.collectCSSText(e,["border","borderColor","borderRadius","borderSpacing","borderStyle","borderWidth"],t)&&(t.push(rs["v"]("box-sizing: border-box;")),!0)}collectCSSText(e,t,i){const n=i.length;for(let o of t){const t=this.resolveValue(e[o]);"string"===typeof t&&i.push(rs["v"](RD[o],t))}return i.length!==n}resolveValue(e){if(fr(e)){this._usesThemeColors=!0;const t=this._theme.getColor(e.id);return t?t.toString():"transparent"}return e}}class FD{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}}class WD extends MD{getActiveCodeEditor(){return null}openCodeEditor(e,t,i){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){const i=this.findModel(e,t.resource);if(!i){if(t.resource){const i=t.resource.scheme;if(i===zn.http||i===zn.https)return is(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if("number"===typeof n.endLineNumber&&"number"===typeof n.endColumn)e.setSelection(n),e.revealRangeInCenter(n,1);else{const t={lineNumber:n.startLineNumber,column:n.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}}class BD{constructor(e,t,i,n,o){this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=o}}function VD(e){if(!e||!Array.isArray(e))return[];let t=[],i=0;for(let n=0,o=e.length;n{let i=$D(e.token,t.token);return 0!==i?i:e.index-t.index});let i=0,n="000000",o="ffffff";while(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 UD;for(let d of t)s.getId(d);let r=s.getId(n),a=s.getId(o),l=new GD(i,r,a),c=new YD(l);for(let d=0,h=e.length;d>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const jD=/\b(comment|string|regex|regexp)\b/;function qD(e){let t=e.match(jD);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 4;case"regexp":return 4}throw new Error("Unexpected match for standard token type!")}function $D(e,t){return et?1:0}class GD{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 GD(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 YD{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"undefined"!==typeof 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);"undefined"===typeof a&&(a=new YD(this._mainRule.clone()),this._children.set(o,a)),a.insert(s,t,i,n)}}function XD(e){let t=[];for(let i=1,n=e.length;i0?(rN(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,eb.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=aN(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,eb.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);return i||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=nN.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case eN:return Lf.LIGHT;case iN:return Lf.HIGH_CONTRAST;default:return Lf.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let i=aN(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=KD.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")),o=n.metadata,s=va.getForeground(o),r=va.getFontStyle(o);return{foreground:s,italic:Boolean(1&r),bold:Boolean(2&r),underline:Boolean(4&r)}}}function rN(e){return e===eN||e===tN||e===iN}function aN(e){switch(e){case eN:return ZD;case tN:return QD;case iN:return JD}}function lN(e){let t=aN(e);return new sN(e,t)}class cN extends We{constructor(){super(),this._onColorThemeChange=this._register(new Ye),this.onDidColorThemeChange=this._onColorThemeChange.event,this._environment=Object.create(null),this._knownThemes=new Map,this._knownThemes.set(eN,lN(eN)),this._knownThemes.set(tN,lN(tN)),this._knownThemes.set(iN,lN(iN));const e=xk();this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(eN),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})}registerEditorContainer(e){return Do(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=To(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),We.None}_registerShadowDomContainer(e){const t=To(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&&this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;return t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(eN),this._theme===t||(this._theme=t,this._updateThemeOrColorMap()),t.id}_updateThemeOrColorMap(){let e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};oN.getThemingParticipants().forEach(e=>e(this._theme,i,this._environment));const n=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(XD(n)),this._themeCSS=e.join("\n"),this._updateCSS(),Ga.setColorMap(n),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}}var dN=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},hN=function(e,t){return function(i,n){t(i,n,e)}};const uN="data-keybinding-context";class gN{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"undefined"===typeof t&&this._parent?this._parent.getValue(e):t}}class fN extends gN{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}fN.INSTANCE=new fN;class mN extends gN{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=us.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(e=>{if(6===e.source){const e=Array.from(Ee.map(this._values,([e])=>e));this._values.clear(),i.fire(new bN(e))}else{const t=[];for(const i of e.affectedKeys){const e="config."+i,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...Ee.map(n,([e])=>e)),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new bN(t))}})}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(mN._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(mN._keyPrefix.length),i=this._configurationService.getValue(t);let n=void 0;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)}}mN._keyPrefix="config.";class pN{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){"undefined"===typeof this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class _N{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}}class bN{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}}class vN{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}}class wN{constructor(e){this._onDidChangeContext=new Xe({merge:e=>new vN(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 pN(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 yN(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId),i=Au.contextMatchesRules(t,e);return i}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 _N(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new _N(e))}getContext(e){return this._isDisposed?fN.INSTANCE:this.getContextValuesContainer(SN(e))}}let CN=class extends wN{constructor(e){super(0),this._contexts=new Map,this._toDispose=new Fe,this._lastContextId=0;const t=new mN(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?fN.INSTANCE:this._contexts.get(e)||fN.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 gN(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};CN=dN([hN(0,Cu)],CN);class yN extends wN{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=new Be,this._parent=e,this._updateParentChangeListener(),t){if(this._domNode=t,this._domNode.hasAttribute(uN)){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(uN,String(this._myContextId))}}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(this._onDidChangeContext.fire,this._onDidChangeContext)}dispose(){var e;this._onDidChangeContext.dispose(),this._isDisposed=!0,this._parent.disposeContext(this._myContextId),null===(e=this._parentChangeListener)||void 0===e||e.dispose(),this._domNode&&(this._domNode.removeAttribute(uN),this._domNode=void 0)}getContextValuesContainer(e){return this._isDisposed?fN.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)}}function SN(e){while(e){if(e.hasAttribute(uN)){const t=e.getAttribute(uN);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}zs.registerCommand(yf,(function(e,t,i){e.get(Cf).createKey(String(t),i)}));var xN,LN;i("1a7b"),i("f743");function kN(e,t,i){const n=i.mode===LN.ALIGN?i.offset:i.offset+i.size,o=i.mode===LN.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){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}function n(e,n){return!i(t(e,n))}function o(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}e.intersect=t,e.isEmpty=i,e.intersects=n,e.relativeComplement=o})(xN||(xN={})),function(e){e[e["AVOID"]=0]="AVOID",e[e["ALIGN"]=1]="ALIGN"}(LN||(LN={}));class EN extends We{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=We.None,this.toDisposeOnSetContainer=We.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=Yo(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Zo(this.view),this.setContainer(e,t),this._register(Pe(()=>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=Yo(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=DN,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(Yo("slot"))}else this.container.appendChild(this.view);const i=new Fe;EN.BUBBLE_UP_EVENTS.forEach(e=>{i.add(eo(this.container,e,e=>{this.onDOMEvent(e,!1)}))}),EN.BUBBLE_DOWN_EVENTS.forEach(e=>{i.add(eo(this.container,e,e=>{this.onDOMEvent(e,!0)},!0))}),this.toDisposeOnSetContainer=i}}show(e){this.isVisible()&&this.hide(),Gn(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",Xo(this.view),this.toDisposeOnClean=e.render(this.view)||We.None,this.delegate=e,this.doLayout(),this.delegate.focus&&this.delegate.focus()}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||s["c"]&&$n.pointerEvents?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;let e,t=this.delegate.getAnchor();if(Fo(t)){let i=bo(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=wo(this.view),n=So(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,r=this.delegate.anchorAxisAlignment||0;let a,l;if(0===r){const t={offset:e.top-window.pageYOffset,size:e.height,position:0===o?0:1},r={offset:e.left,size:e.width,position:0===s?0:1,mode:LN.ALIGN};a=kN(window.innerHeight,n,t)+window.pageYOffset,xN.intersects({start:a,end:a+n},{start:t.offset,end:t.offset+t.size})&&(r.mode=LN.AVOID),l=kN(window.innerWidth,i,r)}else{const t={offset:e.left,size:e.width,position:0===s?0:1},r={offset:e.top,size:e.height,position:0===o?0:1,mode:LN.ALIGN};l=kN(window.innerWidth,i,t),xN.intersects({start:l,end:l+i},{start:t.offset,end:t.offset+t.size})&&(r.mode=LN.AVOID),a=kN(window.innerHeight,n,r)+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 c=bo(this.container);this.view.style.top=a-(this.useFixedPosition?bo(this.view).top:c.top)+"px",this.view.style.left=l-(this.useFixedPosition?bo(this.view).left:c.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null===t||void 0===t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),Zo(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!xo(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}EN.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],EN.BUBBLE_DOWN_EVENTS=["click"];let DN='\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';i("c3b4"),i("6d8f");function NN(e){let t=e.definition;while(t instanceof pa)t=t.definition;return`.codicon-${e.id}:before { content: '${t.character}'; }`}function IN(...e){return function(t,i){for(let n=0,o=e.length;n0?[{start:0,end:t.length}]:[]:null}function ON(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function AN(e,t){return RN(e.toLowerCase(),t.toLowerCase(),0,0)}function RN(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=RN(e,t,i+1,n+1))?zN({start:n,end:n+1},o):null}return RN(e,t,i,n+1)}function PN(e){return 97<=e&&e<=122}function FN(e){return 65<=e&&e<=90}function WN(e){return 48<=e&&e<=57}function BN(e){return 32===e||9===e||10===e||13===e}const VN=new Set;function HN(e){return PN(e)||FN(e)||WN(e)}function zN(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function UN(e,t){for(let i=t;i0&&!HN(e.charCodeAt(i-1)))return i}return e.length}function KN(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;o=KN(e,t,i+1,n+1);while(!o&&(s=UN(t,s)).6}function $N(e){const{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:o}=e;return i>.2&&t<.8&&n>.6&&o<.2}function GN(e){let t=0,i=0,n=0,o=0;for(let s=0;s60)return null;const i=jN(t);if(!$N(i)){if(!qN(i))return null;t=t.toLowerCase()}let n=null,o=0;e=e.toLowerCase();while(o/?".split("").forEach(e=>VN.add(e.charCodeAt(0)));const XN=IN(TN,YN,ON),ZN=IN(TN,YN,AN),QN=new ms(1e4);function JN(e,t,i=!1){if("string"!==typeof e||"string"!==typeof t)return null;let n=QN.get(e);n||(n=new RegExp(rs["o"](e),"i"),QN.set(e,n));const o=n.exec(t);return o?[{start:o.index,end:o.index+o[0].length}]:i?ZN(e,t):XN(e,t)}const eI=128;function tI(){const e=[],t=[];for(let i=0;i<=eI;i++)t[i]=0;for(let i=0;i<=eI;i++)e.push(t.slice(0));return e}function iI(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const nI=iI(2*eI),oI=iI(2*eI),sI=tI(),rI=tI(),aI=tI(),lI=!1;function cI(e,t,i,n,o){function s(e,t,i=" "){while(e.lengths(e,3)).join("|")}\n`;for(let a=0;a<=i;a++)r+=0===a?" |":t[a-1]+"|",r+=e[a].slice(0,o+1).map(e=>s(e.toString(),3)).join("|")+"\n";return r}function dI(e,t,i,n){e=e.substr(t),i=i.substr(n),console.log(cI(rI,e,e.length,i,i.length)),console.log(cI(aI,e,e.length,i,i.length)),console.log(cI(sI,e,e.length,i,i.length))}function hI(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!!rs["A"](i)}}function uI(e,t){if(t<0||t>=e.length)return!1;const i=e.charCodeAt(t);switch(i){case 32:case 9:return!0;default:return!1}}function gI(e,t,i){return t[e]!==i[e]}function fI(e,t,i,n,o,s,r=!1){while(teI?eI:e.length,l=n.length>eI?eI:n.length;if(i>=a||s>=l||a-i>l-s)return;if(!fI(t,i,a,o,s,l,!0))return;_I(a,l,i,s,t,o);let c=1,d=1,h=i,u=s;const g=[!1];for(c=1,h=i;hr,b=_?rI[c][d-1]+(sI[c][d-1]>0?-5:0):0,v=u>r+1&&sI[c][d-1]>0,w=v?rI[c][d-2]+(sI[c][d-2]>0?-5:0):0;if(v&&(!_||w>=b)&&(!m||w>=p))rI[c][d]=w,aI[c][d]=3,sI[c][d]=0;else if(_&&(!m||b>=p))rI[c][d]=b,aI[c][d]=2,sI[c][d]=0;else{if(!m)throw new Error("not possible");rI[c][d]=p,aI[c][d]=1,sI[c][d]=sI[c-1][d-1]+1}}}if(lI&&dI(e,i,n,s),!g[0]&&!r)return;c--,d--;const f=[rI[c][d],s];let m=0,p=0;while(c>=1){let e=d;do{const t=aI[c][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+c-1]===o[s+d-1]&&!gI(e+s-1,n,o)&&m+1>sI[c][e]&&(e=d),e===d?m++:m=1,p||(p=e),c--,d=e-1,f.push(d)}l===a&&(f[0]+=2);const _=p-a;return f[0]-=_,f}function _I(e,t,i,n,o,s){let r=e-1,a=t-1;while(r>=i&&a>=n)o[r]===s[a]&&(oI[r]=a,r--),a--}function bI(e,t,i,n,o,s,r,a,l,c,d){if(t[i]!==s[r])return Number.MIN_SAFE_INTEGER;let h=1,u=!1;return r===i-n?h=e[i]===o[r]?7:5:!gI(r,o,s)||0!==r&&gI(r-1,o,s)?!hI(s,r)||0!==r&&hI(s,r-1)?(hI(s,r-1)||uI(s,r-1))&&(h=5,u=!0):h=5:(h=e[i]===o[r]?7:5,u=!0),h>1&&i===n&&(d[0]=!0),u||(u=gI(r,o,s)||hI(s,r-1)||uI(s,r-1)),i===n?r>l&&(h-=u?3:5):h+=c?u?2:0:u?0:1,r+1===a&&(h-=u?3:5),h}(function(e){function t(e){return!e||-100===e[0]&&0===e[1]&&0===e[2]}e.Default=[-100,0],e.isDefault=t})(mI||(mI={}));const vI="$(";const wI=/(\s)?(\\)?\$\([a-z0-9\-]+?(?:~[a-z0-9\-]*?)?\)(\s)?/gi;function CI(e){return-1===e.indexOf(vI)?e:e.replace(wI,(e,t,i,n)=>i?e:t||n||"")}function yI(e){const t=e.indexOf(vI);return-1===t?{text:e}:SI(e,t)}function SI(e,t){const i=[];let n="";function o(e){if(e){n+=e;for(const t of e)i.push(c)}}let s,r,a=-1,l="",c=0,d=t;const h=e.length;o(e.substr(0,t));while(dthis.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,triggerKeys:{keys:[3,...s["f"]||s["d"]?[10]:[]],keyDown:!0}}),this.menuElement=n,this.actionsList.setAttribute("role","menu"),this.actionsList.tabIndex=0,this.menuDisposables=this._register(new Fe),this.initializeStyleSheet(e),Zn(n,Wo.KEY_DOWN,e=>{const t=new Ln(e);t.equals(2)&&e.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(Zn(n,Wo.KEY_DOWN,e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){Bo.stop(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof MI&&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)}}})),s["d"]&&this._register(Zn(n,Wo.KEY_DOWN,e=>{const t=new Ln(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Bo.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Bo.stop(e,!0))})),this._register(Zn(this.domNode,Wo.MOUSE_OUT,e=>{let t=e.relatedTarget;xo(t,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())})),this._register(Zn(this.actionsList,Wo.MOUSE_OVER,e=>{let t=e.target;if(t&&xo(t,this.actionsList)&&t!==this.actionsList){while(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 hS(n,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this._register(Zn(r,Wo.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 OI)).forEach((e,t,i)=>{e.updatePositionInSet(t+1,i.length)})}initializeStyleSheet(e){Do(e)?(this.styleSheet=To(e),this.styleSheet.textContent=RI):(II.globalStyleSheet||(II.globalStyleSheet=To(),II.globalStyleSheet.textContent=RI),this.styleSheet=II.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 TI||t instanceof OI)&&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(Zn(this.element,Wo.MOUSE_UP,e=>{if(Bo.stop(e,!0),cn){const t=new Tn(e);if(t.rightButton)return;this.onClick(e)}else setTimeout(()=>{this.onClick(e)},0)})),this._register(Zn(this.element,Wo.CONTEXT_MENU,e=>{Bo.stop(e,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Ko(this.element,Yo("a.action-menu-item")),this._action.id===Yg.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",""+this.mnemonic)),this.check=Ko(this.item,Yo("span.menu-item-check"+EI.cssSelector)),this.check.setAttribute("role","none"),this.label=Ko(this.item,Yo("span.action-label")),this.options.label&&this.options.keybinding&&(Ko(this.item,Yo("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){Gn(this.label);let e=CI(this.getAction().label);if(e){const t=AI(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));const i=LI.exec(e);if(i){e=rs["s"](e),kI.lastIndex=0;let t=kI.exec(e);while(t&&t[1])t=kI.exec(e);const n=e=>e.replace(/&&/g,"&");t?this.label.append(rs["I"](n(e.substr(0,t.index))," "),Yo("u",{"aria-hidden":"true"},t[3]),rs["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=o({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.item&&(this.item.classList.remove("disabled"),this.item.tabIndex=0)):(this.element&&this.element.classList.add("disabled"),this.item&&(this.item.classList.add("disabled"),Jo(this.item)))}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 MI extends TI{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 Fe),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:NI.Right,this.showScheduler=new Vn(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Vn(()=>{this.element&&!xo(Io(),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=Ko(this.item,Yo("span.submenu-indicator"+DI.cssSelector)),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(Zn(this.element,Wo.KEY_UP,e=>{let t=new Ln(e);(t.equals(17)||t.equals(3))&&(Bo.stop(e,!0),this.createSubmenu(!0))})),this._register(Zn(this.element,Wo.KEY_DOWN,e=>{let t=new Ln(e);Io()===this.item&&(t.equals(17)||t.equals(3))&&Bo.stop(e,!0)})),this._register(Zn(this.element,Wo.MOUSE_OVER,e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(Zn(this.element,Wo.MOUSE_LEAVE,e=>{this.mouseOver=!1})),this._register(Zn(this.element,Wo.FOCUS_OUT,e=>{this.element&&!xo(Io(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!1)})))}updateEnabled(){}onClick(e){Bo.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(t){}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=kN(e.width,t.width,{position:n===NI.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{let t=new Ln(e);t.equals(15)&&(Bo.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(Zn(this.submenuContainer,Wo.KEY_DOWN,e=>{let t=new Ln(e);t.equals(15)&&Bo.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"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t?""+t:""),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 OI extends bk{style(e){this.label&&(this.label.style.borderBottomColor=e.separatorColor?""+e.separatorColor:"")}}function AI(e){const t=LI,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}let RI=`\n.monaco-menu {\n\tfont-size: 13px;\n\n}\n\n${NN(EI)}\n${NN(DI)}\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`;function PI(e,t){const i=Object.create(null);for(let n in t){const o=t[n];o&&(i[n]=iC(o,e))}return i}function FI(e,t,i){function n(n){const o=PI(e.getColorTheme(),t);"function"===typeof i?i(o):i.style(o)}return n(e.getColorTheme()),e.onDidColorThemeChange(n)}function WI(e,t,i){return FI(t,Object.assign(Object.assign({},BI),i||{}),e)}const BI={listFocusBackground:xw,listFocusForeground:Lw,listActiveSelectionBackground:Qw(kw,.1),listActiveSelectionForeground:Ew,listFocusAndSelectionBackground:kw,listFocusAndSelectionForeground:Ew,listInactiveSelectionBackground:Dw,listInactiveSelectionForeground:Nw,listInactiveFocusBackground:Iw,listHoverBackground:Tw,listHoverForeground:Mw,listDropBackground:Ow,listFocusOutline:_v,listSelectionOutline:_v,listHoverOutline:_v,listFilterWidgetBackground:Aw,listFilterWidgetOutline:Rw,listFilterWidgetNoMatchesOutline:Pw,listMatchesShadow:bv,treeIndentGuidesStroke:Fw},VI={shadowColor:bv,borderColor:Ww,foregroundColor:Bw,backgroundColor:Vw,selectionForegroundColor:Hw,selectionBackgroundColor:zw,selectionBorderColor:Uw,separatorColor:Kw};function HI(e,t,i){return FI(t,Object.assign(Object.assign({},VI),i),e)}class zI{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=Fo(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(Yo(".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",_n(this.block,Wo.MOUSE_DOWN)(e=>e.stopPropagation()));const s=new Fe,r=e.actionRunner||new Gg;return r.onBeforeRun(this.onActionRun,this,s),r.onDidRun(this.onDidActionRun,this,s),i=new II(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(HI(i,this.themeService)),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,s),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,s),_n(window,Wo.BLUR)(()=>{this.contextViewService.hideContextView(!0)},null,s),_n(window,Wo.MOUSE_DOWN)(e=>{if(e.defaultPrevented)return;let t=new Tn(e),i=t.target;if(!t.rightButton){while(i){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}},null,s),Re(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&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&this.notificationService.error(e.error)}}var 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},KI=function(e,t){return function(i,n){t(i,n,e)}};let jI=class extends We{constructor(e,t,i,n,o){super(),this.contextMenuHandler=new zI(i,e,t,n,o)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){this.contextMenuHandler.showContextMenu(e),ss.getInstance().resetKeyStatus()}};jI=UI([KI(0,Kf),KI(1,Yu),KI(2,Vk),KI(3,_E),KI(4,kf)],jI);const qI=Zi("layoutService");var $I=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},GI=function(e,t){return function(i,n){t(i,n,e)}};let YI=class extends We{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=We.None,this.container=e.container,this.contextView=this._register(new EN(this.container,1)),this.layout(),this._register(e.onLayout(()=>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=Pe(()=>{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)}};YI=$I([GI(0,qI)],YI);const XI=Zi("dialogService");class ZI{constructor(e){this.incoming=new Map,this.outgoing=new Map,this.data=e}}class QI{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 i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new ZI(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")}}const JI=!1;class eT extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.toString()}}class tT{constructor(e=new wL,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(Yi,this)}createChild(e){return new tT(e,this._strict,this)}invokeFunction(e,...t){let i=iT.traceInvocation(e),n=!1;try{const o={get:(e,t)=>{if(n)throw ke("service accessor is only valid during the invocation of its target method");const o=this._getOrCreateServiceInstance(e,i);if(!o&&t!==Qi)throw new Error(`[invokeFunction] unknown service '${e}'`);return o}};return e(o,...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof ak?(i=iT.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=iT.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=Gi.getServiceDependencies(e).sort((e,t)=>e.index-t.index),o=[];for(const r of n){let t=this._getOrCreateServiceInstance(r.id,i);if(!t&&this._strict&&!r.optional)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${r.id}.`);o.push(t)}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 ak)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 ak?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 QI(e=>e.id.toString());let o=0;const s=[{id:e,desc:t,_trace:i}];while(s.length){const t=s.pop();if(n.lookupOrInsertNode(t),o++>1e3)throw new eT(n);for(let i of Gi.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 ak){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};n.insertEdge(t,e),s.push(e)}}}while(1){const e=n.roots();if(0===e.length){if(!n.isEmpty())throw new eT(n);break}for(const{data:t}of e){const e=this._getServiceInstanceOrDescriptor(t.id);if(e instanceof ak){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 ak)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 Hn(()=>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){return i.value[t]=n,!0}})}return this._createInstance(e,t,n)}}class iT{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return JI?new iT(1,e.name||e.toString().substring(0,42).replace(/\n/g,"")):iT._None}static traceCreation(e){return JI?new iT(0,e.name):iT._None}branch(e,t){let i=new iT(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;iT._totals+=e;let t=!1;function i(e,n){let o=[],s=new Array(e+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,o.push(`${s}CREATES -> ${r}`);let n=i(e+1,l);n&&o.push(n)}else o.push(`${s}uses -> ${r}`);return o.join("\n")}let n=[`${0===this.type?"CREATE":"CALL"} ${this.name}`,""+i(1,this),`DONE, took ${e.toFixed(2)}ms (grand total ${iT._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(n.join("\n"))}}iT._None=new class extends iT{constructor(){super(-1,null)}stop(){}branch(){return this}},iT._totals=0;const nT=Zi("labelService");i("dff0");class oT extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function sT(e,t){const i=[];for(let n of t){if(e.start>=n.range.end)continue;if(e.ende.concat(t),[]))}class cT{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const n=i.length-t,o=sT({start:0,end:e},this.groups),s=sT({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(e=>({range:rT(e.range,n),size:e.size})),r=i.map((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size}));this.groups=lT(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){const e=this.getRenderer(t);e.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 uT=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 gT={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(e){return[e]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}},horizontalScrolling:!1,transformOptimization:!0};class fT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class mT{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class pT{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?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null===e||void 0===e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null===e||void 0===e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class vT{constructor(e,t,i,n=gT){if(this.virtualDelegate=t,this.domId="list_id_"+ ++vT.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Rn(50),this.splicing=!1,this.dragOverAnimationStopDisposable=We.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=We.None,this.onDragLeaveTimeout=We.None,this.disposables=new Fe,this._onDidChangeContentHeight=new Ye,this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new cT;for(const s of i)this.renderers.set(s.templateId,s);this.cache=this.disposables.add(new hT(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 n.mouseSupport||n.mouseSupport),this._horizontalScrolling=sr(n,e=>e.horizontalScrolling,gT.horizontalScrolling),this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.additionalScrollHeight="undefined"===typeof n.additionalScrollHeight?0:n.additionalScrollHeight,this.accessibilityProvider=new bT(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows";const o=sr(n,e=>e.transformOptimization,gT.transformOptimization);o&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)"),this.disposables.add(gm.addTarget(this.rowsContainer)),this.scrollable=new Xy(sr(n,e=>e.smoothScrolling,!1)?125:0,e=>oo(e)),this.scrollableElement=this.disposables.add(new dS(this.rowsContainer,{horizontal:1,vertical:sr(n,e=>e.verticalScrollMode,gT.verticalScrollMode),useShadows:sr(n,e=>e.useShadows,gT.useShadows)},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),_n(this.rowsContainer,hm.Change)(this.onTouchChange,this,this.disposables),_n(this.scrollableElement.getDomNode(),"scroll")(e=>e.target.scrollTop=0,null,this.disposables),je.map(_n(this.domNode,"dragover"),e=>this.toDragEvent(e))(this.onDragOver,this,this.disposables),je.map(_n(this.domNode,"drop"),e=>this.toDragEvent(e))(this.onDrop,this,this.disposables),_n(this.domNode,"dragleave")(this.onDragLeave,this,this.disposables),_n(window,"dragend")(this.onDragEnd,this,this.disposables),this.setRowLineHeight=sr(n,e=>e.setRowLineHeight,gT.setRowLineHeight),this.setRowHeight=sr(n,e=>e.setRowHeight,gT.setRowHeight),this.supportDynamicHeights=sr(n,e=>e.supportDynamicHeights,gT.supportDynamicHeights),this.dnd=sr(n,e=>e.dnd,gT.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:Co(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),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),o={start:e,end:e+t},s=xN.intersect(n,o),r=new Map;for(let C=s.start;C({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:We.None}));let h;0===e&&t>=this.items.length?(this.rangeMap=new cT,this.rangeMap.splice(0,0,d),this.items=d,h=[]):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),f=rT(l,u),m=xN.intersect(g,f);for(let C=m.start;CrT(e,u)),b={start:e,end:e+i.length},v=[b,..._].map(e=>xN.intersect(g,e)),w=this.getNextToLastElement(v);for(const C of v)for(let e=C.start;ee.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=this._scrollHeight+"px",this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=oo(()=>{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)"undefined"!==typeof 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(){const e=this.scrollableElement.getScrollDimensions();return e.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:yo(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),"undefined"!==typeof t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"===typeof t?t:Co(this.domNode)}))}render(e,t,i,n,o,s=!1){const r=this.getRenderRange(t,i),a=xN.relativeComplement(r,e),l=xN.relativeComplement(e,r),c=this.getNextToLastElement(a);if(s){const t=xN.intersect(e,r);for(let e=t.start;ethis.onDragStart(n.element,a,e))}this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width=cn?"-moz-fit-content":"fit-content",e.width=Co(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(){const e=this.scrollableElement.getScrollPosition();return e.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 je.map(_n(this.domNode,"click"),e=>this.toMouseEvent(e))}get onMouseDblClick(){return je.map(_n(this.domNode,"dblclick"),e=>this.toMouseEvent(e))}get onMouseMiddleClick(){return je.filter(je.map(_n(this.domNode,"auxclick"),e=>this.toMouseEvent(e)),e=>1===e.browserEvent.button)}get onMouseDown(){return je.map(_n(this.domNode,"mousedown"),e=>this.toMouseEvent(e))}get onContextMenu(){return je.map(_n(this.domNode,"contextmenu"),e=>this.toMouseEvent(e))}get onTouchStart(){return je.map(_n(this.domNode,"touchstart"),e=>this.toTouchEvent(e))}get onTap(){return je.map(_n(this.rowsContainer,hm.Tap),e=>this.toGestureEvent(e))}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i="undefined"===typeof t?void 0:this.items[t],n=i&&i.element;return{browserEvent:e,index:t,element:n}}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(fk.RESOURCES,JSON.stringify([t])),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(n,i)),"undefined"===typeof e&&(e=String(n.length));const t=Yo(".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 fT(n),pk.CurrentDragAndDropData=new mT(n),this.dnd.onDragStart&&this.dnd.onDragStart(this.currentDragData,i)}onDragOver(e){if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),pk.CurrentDragAndDropData&&"vscode-ui"===pk.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(pk.CurrentDragAndDropData)this.currentDragData=pk.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new pT}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:"undefined"===typeof e.index?[-1]:[e.index],i=hc(i).filter(e=>e>=-1&&ee-t),i=-1===i[0]?[-1]:i,_T(this.currentDragFeedback,i))return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackDisposable.dispose(),-1===i[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Pe(()=>{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=Pe(()=>{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=Fn(()=>this.clearDragOverFeedback(),100)}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.currentDragData=void 0,pk.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,pk.CurrentDragAndDropData=void 0,this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=We.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=_o(this.domNode).top;this.dragOverAnimationDisposable=ns(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=Fn(()=>{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;while(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;while(1){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;en.splice(e,t,i))}}var CT,yT=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};class ST{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 xT{constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new Ye,this.onChange=this._onChange.event}get trait(){return this._trait}get renderer(){return new ST(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(KT),t)}_set(e,t,i){const n=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=zT(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return oc(this.sortedIndexes,e,KT)>=0}dispose(){Ae(this._onChange)}}yT([dm],xT.prototype,"renderer",null);class LT extends xT{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 kT{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 ET(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function DT(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&(!!e.parentElement&&DT(e.parentElement))}class NT{constructor(e,t,i){this.list=e,this.view=t,this.disposables=new Fe;const n=!1!==i.multipleSelectionSupport,o=je.chain(_n(t.domNode,"keydown")).filter(e=>!ET(e.target)).map(e=>new Ln(e));o.filter(e=>3===e.keyCode).on(this.onEnter,this,this.disposables),o.filter(e=>16===e.keyCode).on(this.onUpArrow,this,this.disposables),o.filter(e=>18===e.keyCode).on(this.onDownArrow,this,this.disposables),o.filter(e=>11===e.keyCode).on(this.onPageUpArrow,this,this.disposables),o.filter(e=>12===e.keyCode).on(this.onPageDownArrow,this,this.disposables),o.filter(e=>9===e.keyCode).on(this.onEscape,this,this.disposables),n&&o.filter(e=>(s["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(fc(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"})(CT||(CT={}));const IT=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 TT{constructor(e,t,i,n){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.delegate=n,this.enabled=!1,this.state=CT.Idle,this.automaticKeyboardNavigation=!0,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new Fe,this.disposables=new Fe,this.updateOptions(e.options)}updateOptions(e){const t="undefined"===typeof e.enableKeyboardNavigation||!!e.enableKeyboardNavigation;t?this.enable():this.disable(),"undefined"!==typeof e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation)}enable(){if(this.enabled)return;const e=je.chain(_n(this.view.domNode,"keydown")).filter(e=>!ET(e.target)).filter(()=>this.automaticKeyboardNavigation||this.triggered).map(e=>new Ln(e)).filter(e=>this.delegate.mightProducePrintableCharacter(e)).forEach(e=>{e.stopPropagation(),e.preventDefault()}).map(e=>e.browserEvent.key).event,t=je.debounce(e,()=>null,800),i=je.reduce(je.any(e,t),(e,t)=>null===t?null:(e||"")+t);i(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&&Pg(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=CT.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===CT.Idle?1:0;this.state=CT.Typing;for(let o=0;o!ET(e.target)).map(e=>new Ln(e));i.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 OT(e){return s["f"]?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function AT(e){return e.browserEvent.shiftKey}function RT(e){return e instanceof MouseEvent&&2===e.button}const PT={isSelectionSingleChangeEvent:OT,isSelectionRangeChangeEvent:AT};class FT{constructor(e){this.list=e,this.disposables=new Fe,this._onPointer=new Ye,this.onPointer=this._onPointer.event,this.multipleSelectionSupport=!(!1===e.options.multipleSelectionSupport),this.multipleSelectionSupport&&(this.multipleSelectionController=e.options.multipleSelectionController||PT),this.mouseSupport="undefined"===typeof 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(gm.addTarget(e.getHTMLElement()))),je.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):s["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){DT(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(DT(e.browserEvent.target))return;const t="undefined"===typeof e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(ET(e.browserEvent.target)||DT(e.browserEvent.target))return;let t=this.list.getFocus()[0];const i=this.list.getSelection();t=void 0===t?i[0]:t;const n=e.index;return"undefined"===typeof n?(this.list.setFocus([],e.browserEvent),void this.list.setSelection([],e.browserEvent)):this.multipleSelectionSupport&&this.isSelectionRangeChangeEvent(e)||this.multipleSelectionSupport&&this.isSelectionChangeEvent(e)?this.changeSelection(e,t):(this.list.setFocus([n],e.browserEvent),RT(e.browserEvent)||this.list.setSelection([n],e.browserEvent),void this._onPointer.fire(e))}onDoubleClick(e){if(ET(e.browserEvent.target)||DT(e.browserEvent.target))return;if(this.multipleSelectionSupport&&this.isSelectionChangeEvent(e))return;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e,t){const i=e.index;if(this.isSelectionRangeChangeEvent(e)&&void 0!==t){const n=Math.min(t,i),o=Math.max(t,i),s=fc(n,o+1),r=this.list.getSelection(),a=HT(zT(r,[t]),t);if(0===a.length)return;const l=zT(s,UT(r,a));this.list.setSelection(l,e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const t=this.list.getSelection(),n=t.filter(e=>e!==i);this.list.setFocus([i]),t.length===n.length?this.list.setSelection([...n,i],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class WT{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}; }`):s["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.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}; }`),this.styleElement.textContent=i.join("\n")}}const BT={listFocusBackground:eb.fromHex("#7FB0D0"),listActiveSelectionBackground:eb.fromHex("#0E639C"),listActiveSelectionForeground:eb.fromHex("#FFFFFF"),listFocusAndSelectionBackground:eb.fromHex("#094771"),listFocusAndSelectionForeground:eb.fromHex("#FFFFFF"),listInactiveSelectionBackground:eb.fromHex("#3F3F46"),listHoverBackground:eb.fromHex("#2A2D2E"),listDropBackground:eb.fromHex("#383B3D"),treeIndentGuidesStroke:eb.fromHex("#a9a9a9")},VT={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function HT(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let o=i-1;while(o>=0&&e[o]===t-(i-o))n.push(e[o--]);n.reverse(),o=i;while(o=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.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;class jT{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 qT{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 $T{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements(),i=t.indexOf(e)>-1?t:[e];return i}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 GT{constructor(e,t,i,n,o=VT){var s;this.user=e,this._options=o,this.eventBufferer=new Ze,this._ariaLabel="",this.disposables=new Fe,this.didJustPressContextMenuKey=!1,this._onDidDispose=new Ye,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(s=this._options.accessibilityProvider)||void 0===s?void 0:s.getWidgetRole():"list";this.selection=new LT("listbox"!==r),this.focus=new xT("focused"),nr(o,BT,!1);const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new qT(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(e=>new jT(e.templateId,[...a,e]));const l=Object.assign(Object.assign({},o),{dnd:o.dnd&&new $T(this,o.dnd)});if(this.view=new vT(t,i,n,l),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const e=To(this.view.domNode);this.styleController=new WT(e,this.view.domId)}if(this.spliceable=new wT([new kT(this.focus,this.view,o.identityProvider),new kT(this.selection,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.onDidFocus=je.map(_n(this.view.domNode,"focus",!0),()=>null),this.onDidBlur=je.map(_n(this.view.domNode,"blur",!0),()=>null),this.disposables.add(new MT(this,this.view)),"boolean"!==typeof o.keyboardSupport||o.keyboardSupport){const e=new NT(this,this.view,o);this.disposables.add(e)}if(o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||IT;this.typeLabelController=new TT(this,this.view,o.keyboardNavigationLabelProvider,e),this.disposables.add(this.typeLabelController)}this.mouseController=this.createMouseController(o),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()),o.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}get onDidChangeFocus(){return je.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e))}get onDidChangeSelection(){return je.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(){const e=je.chain(_n(this.view.domNode,"keydown")).map(e=>new Ln(e)).filter(e=>this.didJustPressContextMenuKey=58===e.keyCode||e.shiftKey&&68===e.keyCode).filter(e=>(e.preventDefault(),e.stopPropagation(),!1)).event,t=je.chain(_n(this.view.domNode,"keyup")).filter(()=>{const e=this.didJustPressContextMenuKey;return this.didJustPressContextMenuKey=!1,e}).filter(()=>this.getFocus().length>0&&!!this.view.domElement(this.getFocus()[0])).map(e=>{const t=this.getFocus()[0],i=this.view.element(t),n=this.view.domElement(t);return{index:t,element:i,anchor:n,browserEvent:e}}).event,i=je.chain(this.view.onContextMenu).filter(()=>!this.didJustPressContextMenuKey).map(({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:{x:i.clientX+1,y:i.clientY},browserEvent:i})).event;return je.any(e,t,i)}get onKeyDown(){return _n(this.view.domNode,"keydown")}createMouseController(e){return new FT(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 oT(this.user,"Invalid start index: "+e);if(t<0)throw new oT(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()}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new oT(this.user,"Invalid index "+i);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new oT(this.user,"Invalid index "+i);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){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([]),setTimeout(()=>this.focusNextPage(e,t),0))}}focusPreviousPage(e,t){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([]),setTimeout(()=>this.focusPreviousPage(e,t),0))}}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 oT(this.user,"Invalid index "+e);const i=this.view.getScrollTop(),n=this.view.elementTop(e),o=this.view.elementHeight(e);if(Ns(t)){const e=o-this.view.renderHeight;this.view.setScrollTop(e*Nr(t,0,1)+n)}else{const e=n+o,t=i+this.view.renderHeight;n=t||(n=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e){if(e<0||e>=this.length)throw new oT(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()}}yT([dm],GT.prototype,"onDidChangeFocus",null),yT([dm],GT.prototype,"onDidChangeSelection",null),yT([dm],GT.prototype,"onContextMenu",null);class YT{constructor(e,t){this.renderer=e,this.modelProvider=t}get templateId(){return this.renderer.templateId}renderTemplate(e){const t=this.renderer.renderTemplate(e);return{data:t,disposable:We.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 it,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 XT{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}}function ZT(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new XT(e,t.accessibilityProvider)})}class QT{constructor(e,t,i,n,o={}){const s=()=>this.model,r=n.map(e=>new YT(e,s));this.list=new GT(e,t,i,r,ZT(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 je.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 je.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 onDidChangeFocus(){return je.map(this.list.onDidChangeFocus,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(e=>this._model.get(e)),indexes:t,browserEvent:i}))}get onDidChangeSelection(){return je.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,fc(e.length))}getFocus(){return this.list.getFocus()}setSelection(e,t){this.list.setSelection(e,t)}style(e){this.list.style(e)}dispose(){this.list.dispose()}}const JT="inputFocus";var eM;i("72b1");(function(e){e[e["Unknown"]=0]="Unknown",e[e["Twistie"]=1]="Twistie",e[e["Element"]=2]="Element"})(eM||(eM={}));class tM extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class iM{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}}function nM(e){return"object"===typeof e&&"visibility"in e&&"data"in e}function oM(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function sM(e){return"boolean"===typeof e.collapsible}class rM{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Ze,this._onDidChangeCollapseState=new Ye,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new Ye,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new Ye,this.onDidSplice=this._onDidSplice.event,this.collapseByDefault="undefined"!==typeof n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren="undefined"!==typeof 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=Ee.empty(),n={}){if(0===e.length)throw new tM(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=Ee.empty()),void 0===s&&(s=null!==(r=o.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t),l=[...n],c=t[t.length-1],d=new yc({getElements:()=>a.children.map(t=>e.getId(t.element).toString())},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(t=>e.getId(t.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return this.spliceSimple(t,i,l,o);const h=t.slice(0,-1),u=(t,i,n)=>{if(s>0)for(let r=0;rt.originalStart-e.originalStart))u(g,f,g-(m.originalStart+m.originalLength)),g=m.originalStart,f=m.modifiedStart-c,this.spliceSimple([...h,g],m.originalLength,Ee.slice(l,f,f+m.modifiedLength),o);u(g,f,g)}spliceSimple(e,t,i=Ee.empty(),{onDidCreateNode:n,onDidDeleteNode:o}){const{parentNode:s,listIndex:r,revealed:a,visible:l}=this.getParentNodeWithListIndex(e),c=[],d=Ee.map(i,e=>this.createTreeNode(e,s,s.visible?1:0,a,c,n)),h=e[e.length-1],u=s.children.length>0;let g=0;for(let C=h;C>=0&&Ce+(t.visible?t.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(s,p-e),this.list.splice(r,e,c)}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:f,deletedNodes:_});let w=s;while(w){if(2===w.visibility){this.refilter();break}w=w.parent}}rerender(e){if(0===e.length)throw new tM(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);"undefined"===typeof 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);"undefined"===typeof 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&&!sM(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:(sM(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})),!sM(t)&&t.recursive)for(const o of e.children)n=this._setNodeCollapseState(o,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);while(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:"undefined"!==typeof e.collapsed,collapsed:"undefined"===typeof 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||Ee.empty(),c=n&&0!==a&&!r.collapsed,d=Ee.map(l,e=>this.createTreeNode(e,r,a,c,o,s));let h=0,u=1;for(const g of d)r.children.push(g),u+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=h++);return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=h,r.visible=2===a?h>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)while(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):nM(i)?(e.filterData=i.data,oM(i.visibility)):(e.filterData=void 0,oM(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 tM(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 tM(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 tM(this.user,"Invalid tree location");for(let a=0;ae.element)),this.data=e}}function gM(e){return e instanceof fT?new uM(e):e}class fM{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=We.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(gM(e),t)}onDragOver(e,t,i,n,o=!0){const s=this.dnd.onDragOver(gM(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),"undefined"===typeof t)return s;if(r&&"boolean"!==typeof s&&s.autoExpand&&(this.autoExpandDisposable=Fn(()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0},500)),"boolean"===typeof s||!s.accept||"undefined"===typeof s.bubble||s.feedback){if(!o){const e="boolean"===typeof s?s:s.accept,t="boolean"===typeof s?void 0:s.effect;return{accept:e,effect:t,feedback:[i]}}return s}if(1===s.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 a=this.modelProvider(),l=a.getNodeLocation(t),c=a.getListIndex(l),d=a.getListRenderCount(l);return Object.assign(Object.assign({},s),{feedback:fc(c,c+d)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(gM(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function mM(e,t){return t&&Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId(e){return t.identityProvider.getId(e.element)}},dnd:t.dnd&&new fM(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return t.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return t.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:t.accessibilityProvider&&Object.assign(Object.assign({},t.accessibilityProvider),{getSetSize(t){const i=e(),n=i.getNodeLocation(t),o=i.getParentNodeLocation(n),s=i.getNode(o);return s.visibleChildrenCount},getPosInSet(e){return e.visibleChildIndex+1},isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel(e){return t.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return t.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),enableKeyboardNavigation:t.simpleKeyboardNavigation})}class pM{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 _M;(function(e){e["None"]="none",e["OnHover"]="onHover",e["Always"]="always"})(_M||(_M={}));class bM{constructor(e,t=[]){this._elements=t,this.onDidChange=je.forEach(e,e=>this._elements=e)}get elements(){return this._elements}}class vM{constructor(e,t,i,n,o={}){this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=vM.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.renderedIndentGuides=new nu,this.activeIndentNodes=new Set,this.indentGuidesDisposable=We.None,this.disposables=new Fe,this.templateId=e.templateId,this.updateOptions(o),je.map(i,e=>e.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState&&e.onDidChangeTwistieState(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if("undefined"!==typeof e.indent&&(this.indent=Nr(e.indent,0,40)),"undefined"!==typeof e.renderIndentGuides){const t=e.renderIndentGuides!==_M.None;if(t!==this.shouldRenderIndentGuides&&(this.shouldRenderIndentGuides=t,this.indentGuidesDisposable.dispose(),t)){const e=new Fe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}"undefined"!==typeof e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Ko(e,Yo(".monaco-tl-row")),i=Ko(t,Yo(".monaco-tl-indent")),n=Ko(t,Yo(".monaco-tl-twistie")),o=Ko(t,Yo(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:n,indentGuidesDisposable:We.None,templateData:s}}renderElement(e,t,i,n){"number"===typeof n&&(this.renderedNodes.set(e,{templateData:i,height:n}),this.renderedElements.set(e.element,e));const o=vM.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(...aM.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(...aM.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(Gn(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new Fe,n=this.modelProvider();let o=e;while(1){const e=n.getNodeLocation(o),s=n.getParentNodeLocation(e);if(!s)break;const r=n.getNode(s),a=Yo(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(Pe(()=>this.renderedIndentGuides.delete(r,a))),o=r}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(o){}}),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(),Ae(this.disposables)}}vM.DefaultIndent=8;class wM{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 Fe,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:nM(i)?oM(i.visibility):i,0===n)return!1}if(this._totalCount++,this.tree.options.simpleKeyboardNavigation||!this._pattern)return this._matchCount++,{data:mI.Default,visibility:!0};const i=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),n=Array.isArray(i)?i:[i];for(const o of n){const e=o&&o.toString();if("undefined"===typeof e)return{data:mI.Default,visibility:!0};const t=pI(this._pattern,this._lowercasePattern,0,e,e.toLowerCase(),0,!0);if(t)return this._matchCount++,1===n.length?{data:t,visibility:!0}:{data:{label:e,score:t},visibility:!0}}return this.tree.options.filterOnType?2:{data:mI.Default,visibility:!0}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Ae(this.disposables)}}class CM{constructor(e,t,i,n,s){this.tree=e,this.view=i,this.filter=n,this.keyboardNavigationDelegate=s,this._enabled=!1,this._pattern="",this._empty=!1,this._onDidChangeEmptyState=new Ye,this.positionClassName="ne",this.automaticKeyboardNavigation=!0,this.triggered=!1,this._onDidChangePattern=new Ye,this.enabledDisposables=new Fe,this.disposables=new Fe,this.domNode=Yo(".monaco-list-type-filter."+this.positionClassName),this.domNode.draggable=!0,_n(this.domNode,"dragstart")(this.onDragStart,this,this.disposables),this.messageDomNode=Ko(i.getHTMLElement(),Yo(".monaco-list-type-filter-message")),this.labelDomNode=Ko(this.domNode,Yo("span.label"));const r=Ko(this.domNode,Yo(".controls"));this._filterOnType=!!e.options.filterOnType,this.filterOnTypeDomNode=Ko(r,Yo("input.filter")),this.filterOnTypeDomNode.type="checkbox",this.filterOnTypeDomNode.checked=this._filterOnType,this.filterOnTypeDomNode.tabIndex=-1,this.updateFilterOnTypeTitleAndIcon(),_n(this.filterOnTypeDomNode,"input")(this.onDidChangeFilterOnType,this,this.disposables),this.clearDomNode=Ko(r,Yo("button.clear"+dM.cssSelector)),this.clearDomNode.tabIndex=-1,this.clearDomNode.title=o("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(),"undefined"!==typeof e.filterOnType&&(this._filterOnType=!!e.filterOnType,this.filterOnTypeDomNode.checked=this._filterOnType),"undefined"!==typeof e.automaticKeyboardNavigation&&(this.automaticKeyboardNavigation=e.automaticKeyboardNavigation),this.tree.refilter(),this.render(),this.automaticKeyboardNavigation||this.onEventOrInput("")}enable(){if(this._enabled)return;const e=je.chain(_n(this.view.getHTMLElement(),"keydown")).filter(e=>!ET(e.target)||e.target===this.filterOnTypeDomNode).filter(e=>"Dead"!==e.key&&!/^Media/.test(e.key)).map(e=>new Ln(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&&(s["f"]?e.altKey&&!e.metaKey:e.ctrlKey)&&!e.shiftKey).forEach(e=>{e.stopPropagation(),e.preventDefault()}).event,t=_n(this.clearDomNode,"click");je.chain(je.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&&(s["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=>!mI.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}=bo(e),i=e.clientWidth,n=i/2,o=this.domNode.clientWidth,s=new Fe;let r=this.positionClassName;const a=()=>{switch(r){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-o-6+"px";break}},l=e=>{e.preventDefault();const i=e.clientX-t;e.dataTransfer&&(e.dataTransfer.dropEffect="none"),r=i{this.positionClassName=r,this.domNode.className="monaco-list-type-filter "+this.positionClassName,this.domNode.style.top="",this.domNode.style.left="",Ae(s)};a(),this.domNode.classList.remove(r),this.domNode.classList.add("dragging"),s.add(Pe(()=>this.domNode.classList.remove("dragging"))),_n(document,"dragover")(l,null,s),_n(this.domNode,"dragend")(c,null,s),pk.CurrentDragAndDropData=new mk("vscode-ui"),s.add(Pe(()=>pk.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(...cM.classNamesArray),this.filterOnTypeDomNode.classList.add(...lM.classNamesArray),this.filterOnTypeDomNode.title=o("disable filter on type","Disable Filter on Type")):(this.filterOnTypeDomNode.classList.remove(...lM.classNamesArray),this.filterOnTypeDomNode.classList.add(...cM.classNamesArray),this.filterOnTypeDomNode.title=o("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=o("empty","No elements found"),this._empty=!0):(this.messageDomNode.innerText="",this._empty=!1),this.domNode.classList.toggle("no-matches",e),this.domNode.title=o("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||!mI.isDefault(e.filterData))}dispose(){this._enabled&&(this.domNode.remove(),this.enabledDisposables.dispose(),this._enabled=!1,this.triggered=!1),this._onDidChangePattern.dispose(),Ae(this.disposables)}}function yM(e){let t=eM.Unknown;return ko(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=eM.Twistie:ko(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")&&(t=eM.Element),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function SM(e,t){t(e),e.children.forEach(e=>SM(e,t))}class xM{constructor(e){this.identityProvider=e,this.nodes=[],this._onDidChange=new Ye,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)&&nc(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=>SM(e,i)),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach(e=>SM(e,n));const o=new Map,s=e=>o.set(this.identityProvider.getId(e.element).toString(),e);e.forEach(e=>SM(e,s));const r=[];for(const a of this.nodes){const e=this.identityProvider.getId(a.element).toString(),t=i.has(e);if(t){const t=o.get(e);t&&r.push(t)}else r.push(a)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class LM extends FT{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(ET(e.browserEvent.target)||DT(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.expandOnlyOnDoubleClick&&2!==e.browserEvent.detail&&!n)return super.onViewPointer(e);if(t.collapsible){const i=this.tree.model,s=i.getNodeLocation(t),r=e.browserEvent.altKey;if(i.setCollapsed(s,void 0,r),o&&n)return}super.onViewPointer(e)}onDoubleClick(e){const t=e.browserEvent.target.classList.contains("monaco-tl-twistie");t||super.onDoubleClick(e)}}class kM extends GT{constructor(e,t,i,n,o,s,r){super(e,t,i,n,r),this.focusTrait=o,this.selectionTrait=s}createMouseController(e){return new LM(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],o=[];i.forEach((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&o.push(e+i)}),n.length>0&&super.setFocus(uc([...super.getFocus(),...n])),o.length>0&&super.setSelection(uc([...super.getSelection(),...o]))}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)}}class EM{constructor(e,t,i,n,o={}){this._options=o,this.eventBufferer=new Ze,this.disposables=new Fe,this._onWillRefilter=new Ye,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new Ye;const s=new pM(i),r=new Qe,a=new Qe,l=new bM(a.event);this.renderers=n.map(e=>new vM(e,()=>this.model,r.event,l,o));for(let h of this.renderers)this.disposables.add(h);let c;o.keyboardNavigationLabelProvider&&(c=new wM(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:c}),this.disposables.add(c)),this.focus=new xM(o.identityProvider),this.selection=new xM(o.identityProvider),this.view=new kM(e,t,s,this.renderers,this.focus,this.selection,Object.assign(Object.assign({},mM(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),r.input=this.model.onDidChangeCollapseState;const d=je.forEach(this.model.onDidSplice,e=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)})});if(d(()=>null,null,this.disposables),a.input=je.chain(je.any(d,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!==o.keyboardSupport){const e=je.chain(this.view.onKeyDown).filter(e=>!ET(e.target)).map(e=>new Ln(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(o.keyboardNavigationLabelProvider){const e=o.keyboardNavigationDelegate||IT;this.typeFilterController=new CM(this,this.model,this.view,c,e),this.focusNavigationFilter=e=>this.typeFilterController.shouldAllowFocus(e),this.disposables.add(this.typeFilterController)}this.styleElement=To(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===_M.Always)}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return je.map(this.view.onMouseDblClick,yM)}get onPointer(){return je.map(this.view.onPointer,yM)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get expandOnlyOnDoubleClick(){var e;return null!==(e=this._options.expandOnlyOnDoubleClick)&&void 0!==e&&e}get expandOnlyOnTwistieClick(){return"undefined"!==typeof 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===_M.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),o=this.model.setCollapsed(n,!0);if(!o){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),o=this.model.setCollapsed(n,!1);if(!o){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(){Ae(this.disposables),this.view.dispose()}}class DM{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new rM(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){return i.sorter.compare(e.element,t.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=Ee.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Ee.empty(),i){const n=new Set,o=new Set,s=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)},r=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)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:s,onDidDeleteNode:r}))}preserveCollapseState(e=Ee.empty()){return this.sorter&&(e=sc([...e],this.sorter.compare.bind(this.sorter))),Ee.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="undefined"!==typeof 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 tM(this.user,"Tree element not found: "+e);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new tM(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new tM(this.user,"Tree element not found: "+e);const i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i),o=this.model.getNode(n);return o.element}getElementLocation(e){if(null===e)return[];const t=this.nodes.get(e);if(!t)throw new tM(this.user,"Tree element not found: "+e);return this.model.getNodeLocation(t)}}function NM(e){const t=[e.element],i=e.incompressible||!1;return{element:{elements:t,incompressible:i},children:Ee.map(Ee.from(e.children),NM),collapsible:e.collapsible,collapsed:e.collapsed}}function IM(e){const t=[e.element],i=e.incompressible||!1;let n,o;while(1){if([o,n]=Ee.consume(Ee.from(e.children),2),1!==o.length)break;if(o[0].incompressible)break;e=o[0],t.push(e.element)}return{element:{elements:t,incompressible:i},children:Ee.map(Ee.concat(o,n),IM),collapsible:e.collapsible,collapsed:e.collapsed}}function TM(e,t=0){let i;return i=tTM(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 MM(e){return TM(e,0)}function OM(e,t,i){return e.element===t?Object.assign(Object.assign({},e),{children:i}):Object.assign(Object.assign({},e),{children:Ee.map(Ee.from(e.children),e=>OM(e,t,i))})}const AM=e=>({getId(t){return t.elements.map(t=>e.getId(t).toString()).join("\0")}});class RM{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new DM(e,t,i),this.enabled="undefined"===typeof 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=Ee.empty(),i){const n=i.diffIdentityProvider&&AM(i.diffIdentityProvider);if(null===e){const e=Ee.map(t,this.enabled?IM:NM);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const o=this.nodes.get(e);if(!o)throw new Error("Unknown compressed tree node");const s=this.model.getNode(o),r=this.model.getParentNodeLocation(o),a=this.model.getNode(r),l=MM(s),c=OM(l,e,t),d=(this.enabled?IM:NM)(c),h=a.children.map(e=>e===s?d:e);this._setChildren(a.element,h,{diffIdentityProvider:n,diffDepth:s.depth-a.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode(),i=t.children,n=Ee.map(i,MM),o=Ee.map(n,e?IM:NM);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set,o=e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},s=e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:s}))}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("undefined"===typeof 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 tM(this.user,"Tree element not found: "+e);return t}}const PM=e=>e[e.length-1];class FM{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 FM(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}}function WM(e,t){return{splice(i,n,o){t.splice(i,n,o.map(t=>e.map(t)))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}function BM(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId(i){return t.identityProvider.getId(e(i))}},sorter:t.sorter&&{compare(e,i){return t.sorter.compare(e.elements[0],i.elements[0])}},filter:t.filter&&{filter(i,n){return t.filter.filter(e(i),n)}}})}class VM{constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||PM;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new iM(e=>new FM(n,e)),this.model=new RM(e,WM(this.nodeMapper,t),BM(n,i))}get onDidSplice(){return je.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 je.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return je.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}setChildren(e,t=Ee.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 HM=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};class zM extends EM{constructor(e,t,i,n,o={}){super(e,t,i,n,o)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}setChildren(e,t=Ee.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 DM(e,t,i)}}class UM{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){const t=this.renderer.renderTemplate(e);return{compressedTreeNode:void 0,data:t}}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 KM(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(o){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}HM([dm],UM.prototype,"compressedTreeNodeProvider",null);class jM extends zM{constructor(e,t,i,n,o={}){const s=()=>this,r=n.map(e=>new UM(s,e));super(e,t,i,r,KM(s,o))}setChildren(e,t=Ee.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new VM(e,t,i)}updateOptions(e={}){super.updateOptions(e),"undefined"!==typeof e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var qM=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function $M(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function GM(e,t){return!!t.parent&&(t.parent===e||GM(e,t.parent))}function YM(e,t){return e===t||GM(e,t)||GM(t,e)}class XM{constructor(e){this.node=e}get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new XM(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 ZM{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){const t=this.renderer.renderTemplate(e);return{templateData:t}}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(...hM.classNamesArray),!0):(t.classList.remove(...hM.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 QM(e){return{browserEvent:e.browserEvent,elements:e.elements.map(e=>e.element)}}function JM(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class eO extends fT{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function tO(e){return e instanceof fT?new eO(e):e}class iO{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(tO(e),t)}onDragOver(e,t,i,n,o=!0){return this.dnd.onDragOver(tO(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(tO(e),t&&t.element,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}}function nO(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new iO(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return 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){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return 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){return e.filter.filter(t.element,i)}},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}}),sorter:void 0,expandOnlyOnTwistieClick:"undefined"===typeof e.expandOnlyOnTwistieClick?void 0:"function"!==typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),additionalScrollHeight:e.additionalScrollHeight})}function oO(e,t){t(e),e.children.forEach(e=>oO(e,t))}class sO{constructor(e,t,i,n,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new Ye,this._onDidChangeNodeSlowState=new Ye,this.nodeMapper=new iM(e=>new XM(e)),this.disposables=new Fe,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren="undefined"!==typeof s.autoExpandSingleChildren&&s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,i,n,s),this.root=$M({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 je.map(this.tree.onDidChangeFocus,QM)}get onDidChangeSelection(){return je.map(this.tree.onDidChangeSelection,QM)}get onMouseDblClick(){return je.map(this.tree.onMouseDblClick,JM)}get onPointer(){return je.map(this.tree.onPointer,JM)}get onDidFocus(){return this.tree.onDidFocus}get onDidDispose(){return this.tree.onDidDispose}createTree(e,t,i,n,o){const s=new pM(i),r=n.map(e=>new ZM(e,this.nodeMapper,this._onDidChangeNodeSlowState.event)),a=nO(o)||{};return new zM(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 qM(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 qM(this,void 0,void 0,(function*(){if("undefined"===typeof this.root.element)throw new tM(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield je.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,n,o),i)try{this.tree.rerender(s)}catch(r){}}))}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 qM(this,void 0,void 0,(function*(){if("undefined"===typeof this.root.element)throw new tM(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield je.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 je.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 je.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setSelection(i,t)}getSelection(){const e=this.tree.getSelection();return e.map(e=>e.element)}setFocus(e,t){const i=e.map(e=>this.getDataNode(e));this.tree.setFocus(i,t)}getFocus(){const e=this.tree.getFocus();return e.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 tM(this.user,"Data tree node not found: "+e);return t}refreshAndRenderNode(e,t,i,n){return qM(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)}))}refreshNode(e,t,i){return qM(this,void 0,void 0,(function*(){let n;return this.subTreeRefreshPromises.forEach((o,s)=>{!n&&YM(s,e)&&(n=o.then(()=>this.refreshNode(e,t,i)))}),n||this.doRefreshSubTree(e,t,i)}))}doRefreshSubTree(e,t,i){return qM(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 o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield Promise.all(o.map(e=>this.doRefreshSubTree(e,t,i)))}finally{n()}}))}doRefreshNode(e,t,i){return qM(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=Pn(800);t.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},e=>null),n=this.doGetChildren(e).finally(()=>t.cancel())}else n=Promise.resolve(Ee.empty());try{const o=yield n;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Se(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}))}doGetChildren(e){let t=this.refreshPromises.get(e);return t||(t=An(()=>qM(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(ve))}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 c of e.children)if(s.set(c.element,c),this.identityProvider){const e=this.tree.isCollapsed(c);r.set(c.id,{node:c,collapsed:e})}const a=[],l=o.map(t=>{const o=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=$M({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(),c=r.get(l);if(c){const e=c.node;return s.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=o,i?c.collapsed?(e.children.forEach(e=>oO(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 d=$M({element:t,parent:e,id:l,hasChildren:o});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(d),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(d),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(d):o&&this.collapseByDefault&&!this.collapseByDefault(t)&&(d.collapsedByDefault=!1,a.push(d)),d});for(const c of s.values())oO(c,e=>this.nodes.delete(e.element));for(const c of l)this.nodes.set(c.element,c);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){return 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?Ee.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 rO{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 rO(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 aO{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){const t=this.renderer.renderTemplate(e);return{templateData:t}}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(...hM.classNamesArray),!0):(t.classList.remove(...hM.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=Ae(this.disposables)}}function lO(e){const t=e&&nO(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(e=>e.element))}})})}class cO extends sO{constructor(e,t,i,n,o,s,r={}){super(e,t,i,o,s,r),this.compressionDelegate=n,this.compressibleNodeMapper=new iM(e=>new rO(e)),this.filter=r.filter}createTree(e,t,i,n,o){const s=new pM(i),r=n.map(e=>new aO(e,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),a=lO(o)||{};return new jM(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 c=!1;const d=e=>{const t=e.element;if(t)for(let n=0;n{const t=this.filter.filter(e,1),i=dO(t);if(2===i)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===i})),super.processChildren(e)}}function dO(e){return"boolean"===typeof e?e?1:0:nM(e)?oM(e.visibility):oM(e)}class hO extends EM{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 DM(e,t,i)}}var uO=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=function(e,t){return function(i,n){t(i,n,e)}};const fO=Zi("listService");let mO=class{constructor(e){this._themeService=e,this.disposables=new Fe,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 WT(To(),"");this.disposables.add(WI(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),Re(e.onDidFocus(()=>this._lastFocusedWidget=e),Pe(()=>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()}};mO=uO([gO(0,kf)],mO);const pO=new wf("listFocus",!0),_O=new wf("listSupportsMultiselect",!0),bO=(tf.and(pO,tf.not(JT)),new wf("listHasSelectionOrFocus",!1)),vO=new wf("listDoubleSelection",!1),wO=new wf("listMultiSelection",!1),CO=new wf("listSupportsKeyboardNavigation",!0),yO="listAutomaticKeyboardNavigation",SO=new wf(yO,!0);let xO=!1;function LO(e,t){const i=e.createScoped(t.getHTMLElement());return pO.bindTo(i),i}const kO="workbench.list.multiSelectModifier",EO="workbench.list.openMode",DO="workbench.list.horizontalScrolling",NO="workbench.list.keyboardNavigation",IO="workbench.list.automaticKeyboardNavigation",TO="workbench.tree.indent",MO="workbench.tree.renderIndentGuides",OO="workbench.list.smoothScrolling",AO="workbench.tree.expandMode";function RO(e){return"alt"===e.getValue(kO)}class PO extends We{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=RO(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(kO)&&(this.useAltAsMultipleSelectionModifier=RO(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:OT(e)}isSelectionRangeChangeEvent(e){return AT(e)}}function FO(e,t,i){const n=new Fe,o=Object.assign({},e);if(!1!==e.multipleSelectionSupport&&!e.multipleSelectionController){const e=new PO(t);o.multipleSelectionController=e,n.add(e)}return o.keyboardNavigationDelegate={mightProducePrintableCharacter(e){return i.mightProducePrintableCharacter(e)}},o.smoothScrolling=t.getValue(OO),[o,n]}let WO=class extends GT{constructor(e,t,i,n,o,s,r,a,l,c){const d="undefined"!==typeof o.horizontalScrolling?o.horizontalScrolling:l.getValue(DO),[h,u]=FO(o,l,c);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},PI(a.getColorTheme(),BI)),h),{horizontalScrolling:d})),this.disposables.add(u),this.contextKeyService=LO(s,this),this.themeService=a;const g=_O.bindTo(this.contextKeyService);g.set(!(!1===o.multipleSelectionSupport)),this.listHasSelectionOrFocus=bO.bindTo(this.contextKeyService),this.listDoubleSelection=vO.bindTo(this.contextKeyService),this.listMultiSelection=wO.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=RO(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(kO)&&(this._useAltAsMultipleSelectionModifier=RO(l));let t={};if(e.affectsConfiguration(DO)&&void 0===this.horizontalScrolling){const e=l.getValue(DO);t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(OO)){const e=l.getValue(OO);t=Object.assign(Object.assign({},t),{smoothScrolling:e})}Object.keys(t).length>0&&this.updateOptions(t)}))}updateOptions(e){super.updateOptions(e),e.overrideStyles&&this.updateStyles(e.overrideStyles)}dispose(){super.dispose(),this._styler&&this._styler.dispose()}updateStyles(e){this._styler&&this._styler.dispose(),this._styler=WI(this,this.themeService,e)}};WO=uO([gO(5,Cf),gO(6,fO),gO(7,kf),gO(8,Cu),gO(9,_E)],WO);let BO=class extends QT{constructor(e,t,i,n,o,s,r,a,l,c){const d="undefined"!==typeof o.horizontalScrolling?o.horizontalScrolling:l.getValue(DO),[h,u]=FO(o,l,c);super(e,t,i,n,Object.assign(Object.assign(Object.assign({keyboardSupport:!1},PI(a.getColorTheme(),BI)),h),{horizontalScrolling:d})),this.disposables=new Fe,this.disposables.add(u),this.contextKeyService=LO(s,this),this.horizontalScrolling=o.horizontalScrolling;const g=_O.bindTo(this.contextKeyService);g.set(!(!1===o.multipleSelectionSupport)),this._useAltAsMultipleSelectionModifier=RO(l),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),o.overrideStyles&&this.disposables.add(WI(this,a,o.overrideStyles)),this.disposables.add(l.onDidChangeConfiguration(e=>{e.affectsConfiguration(kO)&&(this._useAltAsMultipleSelectionModifier=RO(l));let t={};if(e.affectsConfiguration(DO)&&void 0===this.horizontalScrolling){const e=l.getValue(DO);t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(OO)){const e=l.getValue(OO);t=Object.assign(Object.assign({},t),{smoothScrolling:e})}Object.keys(t).length>0&&this.updateOptions(t)}))}dispose(){super.dispose(),this.disposables.dispose()}};BO=uO([gO(5,Cf),gO(6,fO),gO(7,kf),gO(8,Cu),gO(9,_E)],BO);class VO extends We{constructor(e,t){var i,n;super(),this.widget=e,this._onDidOpen=this._register(new Ye),this.onDidOpen=this._onDidOpen.event,this.openOnFocus=null!==(i=null===t||void 0===t?void 0:t.openOnFocus)&&void 0!==i&&i,this._register(je.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))),this.openOnFocus&&this._register(je.filter(this.widget.onDidChangeFocus,e=>e.browserEvent instanceof KeyboardEvent)(e=>this.onFocusFromKeyboard(e))),"boolean"!==typeof(null===t||void 0===t?void 0:t.openOnSingleClick)&&(null===t||void 0===t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null===t||void 0===t?void 0:t.configurationService.getValue(EO)),this._register(null===t||void 0===t?void 0:t.configurationService.onDidChangeConfiguration(()=>{this.openOnSingleClick="doubleClick"!==(null===t||void 0===t?void 0:t.configurationService.getValue(EO))}))):this.openOnSingleClick=null===(n=null===t||void 0===t?void 0:t.openOnSingleClick)||void 0===n||n}onFocusFromKeyboard(e){const t=this.widget.getFocus();this.widget.setSelection(t,e.browserEvent);const i=e.browserEvent,n="boolean"!==typeof i.preserveFocus||i.preserveFocus,o="boolean"===typeof i.pinned?i.pinned:!n,s=!1;this._open(this.getSelectedElement(),n,o,s,e.browserEvent)}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,o=!1;this._open(this.getSelectedElement(),i,n,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;const i=2===t.detail;if(i)return;const n=1===t.button,o=!0,s=n,r=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,r,t)}onMouseDblClick(e,t){if(!t)return;const i=!1,n=!0,o=t.ctrlKey||t.metaKey||t.altKey;this._open(e,i,n,o,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 HO extends VO{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function zO(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 UO=class extends zM{constructor(e,t,i,n,o,s,r,a,l,c,d){const{options:h,getAutomaticKeyboardNavigation:u,disposable:g}=GO(t,o,s,l,c,d);super(e,t,i,n,h),this.disposables.add(g),this.internals=new YO(this,o,u,o.overrideStyles,s,r,a,l,d),this.disposables.add(this.internals)}};UO=uO([gO(5,Cf),gO(6,fO),gO(7,kf),gO(8,Cu),gO(9,_E),gO(10,CL)],UO);let KO=class extends jM{constructor(e,t,i,n,o,s,r,a,l,c,d){const{options:h,getAutomaticKeyboardNavigation:u,disposable:g}=GO(t,o,s,l,c,d);super(e,t,i,n,h),this.disposables.add(g),this.internals=new YO(this,o,u,o.overrideStyles,s,r,a,l,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};KO=uO([gO(5,Cf),gO(6,fO),gO(7,kf),gO(8,Cu),gO(9,_E),gO(10,CL)],KO);let jO=class extends hO{constructor(e,t,i,n,o,s,r,a,l,c,d,h){const{options:u,getAutomaticKeyboardNavigation:g,disposable:f}=GO(t,s,r,c,d,h);super(e,t,i,n,o,u),this.disposables.add(f),this.internals=new YO(this,s,g,s.overrideStyles,r,a,l,c,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};jO=uO([gO(6,Cf),gO(7,fO),gO(8,kf),gO(9,Cu),gO(10,_E),gO(11,CL)],jO);let qO=class extends sO{constructor(e,t,i,n,o,s,r,a,l,c,d,h){const{options:u,getAutomaticKeyboardNavigation:g,disposable:f}=GO(t,s,r,c,d,h);super(e,t,i,n,o,u),this.disposables.add(f),this.internals=new YO(this,s,g,s.overrideStyles,r,a,l,c,h),this.disposables.add(this.internals)}get onDidOpen(){return this.internals.onDidOpen}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles)}};qO=uO([gO(6,Cf),gO(7,fO),gO(8,kf),gO(9,Cu),gO(10,_E),gO(11,CL)],qO);let $O=class extends cO{constructor(e,t,i,n,o,s,r,a,l,c,d,h,u){const{options:g,getAutomaticKeyboardNavigation:f,disposable:m}=GO(t,r,a,d,h,u);super(e,t,i,n,o,s,g),this.disposables.add(m),this.internals=new YO(this,r,f,r.overrideStyles,a,l,c,d,u),this.disposables.add(this.internals)}};function GO(e,t,i,n,o,s){var r;CO.bindTo(i),xO||(SO.bindTo(i),xO=!0);const a=()=>{let e=i.getContextKeyValue(yO);return e&&(e=n.getValue(IO)),e},l=s.isScreenReaderOptimized(),c=t.simpleKeyboardNavigation||l?"simple":n.getValue(NO),d=void 0!==t.horizontalScrolling?t.horizontalScrolling:n.getValue(DO),[h,u]=FO(t,n,o),g=t.additionalScrollHeight;return{getAutomaticKeyboardNavigation:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},h),{indent:n.getValue(TO),renderIndentGuides:n.getValue(MO),smoothScrolling:n.getValue(OO),automaticKeyboardNavigation:a(),simpleKeyboardNavigation:"simple"===c,filterOnType:"filter"===c,horizontalScrolling:d,keyboardNavigationEventFilter:zO(e,o),additionalScrollHeight:g,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnDoubleClick:"doubleClick"===n.getValue(EO),expandOnlyOnTwistieClick:null!==(r=t.expandOnlyOnTwistieClick)&&void 0!==r?r:"doubleClick"===n.getValue(AO)})}}$O=uO([gO(7,Cf),gO(8,fO),gO(9,kf),gO(10,Cu),gO(11,_E),gO(12,CL)],$O);let YO=class{constructor(e,t,i,n,o,s,r,a,l){this.tree=e,this.themeService=r,this.disposables=[],this.contextKeyService=LO(o,e);const c=_O.bindTo(this.contextKeyService);c.set(!(!1===t.multipleSelectionSupport)),this.hasSelectionOrFocus=bO.bindTo(this.contextKeyService),this.hasDoubleSelection=vO.bindTo(this.contextKeyService),this.hasMultiSelection=wO.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=RO(a);const d=new Set;d.add(yO);const h=()=>{const t=l.isScreenReaderOptimized(),i=t?"simple":a.getValue(NO);e.updateOptions({simpleKeyboardNavigation:"simple"===i,filterOnType:"filter"===i})};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(kO)&&(this._useAltAsMultipleSelectionModifier=RO(a)),n.affectsConfiguration(TO)){const e=a.getValue(TO);o=Object.assign(Object.assign({},o),{indent:e})}if(n.affectsConfiguration(MO)){const e=a.getValue(MO);o=Object.assign(Object.assign({},o),{renderIndentGuides:e})}if(n.affectsConfiguration(OO)){const e=a.getValue(OO);o=Object.assign(Object.assign({},o),{smoothScrolling:e})}if(n.affectsConfiguration(NO)&&h(),n.affectsConfiguration(IO)&&(o=Object.assign(Object.assign({},o),{automaticKeyboardNavigation:i()})),n.affectsConfiguration(DO)&&void 0===t.horizontalScrolling){const e=a.getValue(DO);o=Object.assign(Object.assign({},o),{horizontalScrolling:e})}n.affectsConfiguration(EO)&&(o=Object.assign(Object.assign({},o),{expandOnlyOnDoubleClick:"doubleClick"===a.getValue(EO)})),n.affectsConfiguration(AO)&&void 0===t.expandOnlyOnTwistieClick&&(o=Object.assign(Object.assign({},o),{expandOnlyOnTwistieClick:"doubleClick"===a.getValue(AO)})),Object.keys(o).length>0&&e.updateOptions(o)}),this.contextKeyService.onDidChangeContext(t=>{t.affectsSome(d)&&e.updateOptions({automaticKeyboardNavigation:i()})}),l.onDidChangeScreenReaderOptimized(()=>h())),this.navigator=new HO(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}get onDidOpen(){return this.navigator.onDidOpen}updateStyleOverrides(e){Ae(this.styler),this.styler=e?WI(this.tree,this.themeService,e):We.None}dispose(){this.disposables=Ae(this.disposables),Ae(this.styler),this.styler=void 0}};YO=uO([gO(4,Cf),gO(5,fO),gO(6,kf),gO(7,Cu),gO(8,CL)],YO);const XO=Ah.as(Bh.Configuration);var ZO,QO;XO.registerConfiguration({id:"workbench",order:7,title:o("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[kO]:{type:"string",enum:["ctrlCmd","alt"],enumDescriptions:[o("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),o("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:o({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.")},[EO]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:o({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). For parents with children in trees, this setting will control if a single click expands the parent or a double click. Note that some trees and lists might choose to ignore this setting if it is not applicable. ")},[DO]:{type:"boolean",default:!1,description:o("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[TO]:{type:"number",default:8,minimum:0,maximum:40,description:o("tree indent setting","Controls tree indentation in pixels.")},[MO]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:o("render tree indent guides","Controls whether the tree should render indent guides.")},[OO]:{type:"boolean",default:!1,description:o("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[NO]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[o("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),o("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),o("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:o("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter.")},[IO]:{type:"boolean",default:!0,markdownDescription:o("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.")},[AO]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:o("expand mode","Controls how tree folders are expanded when clicking the folder names.")}}}),function(e){e[e["Hint"]=1]="Hint",e[e["Info"]=2]="Info",e[e["Warning"]=4]="Warning",e[e["Error"]=8]="Error"}(ZO||(ZO={})),function(e){function t(e,t){return t-e}e.compare=t;const i=Object.create(null);function n(e){return i[e]||""}function s(t){switch(t){case Lh.Error:return e.Error;case Lh.Warning:return e.Warning;case Lh.Info:return e.Info;case Lh.Ignore:return e.Hint}}function r(t){switch(t){case e.Error:return Lh.Error;case e.Warning:return Lh.Warning;case e.Info:return Lh.Info;case e.Hint:return Lh.Ignore}}i[e.Error]=o("sev.error","Error"),i[e.Warning]=o("sev.warning","Warning"),i[e.Info]=o("sev.info","Info"),e.toString=n,e.fromSeverity=s,e.toSeverity=r}(ZO||(ZO={})),function(e){const t="";function i(e){return n(e,!0)}function n(e,i){let n=[t];return e.source?n.push(e.source.replace("¦","\\¦")):n.push(t),e.code?"string"===typeof e.code?n.push(e.code.replace("¦","\\¦")):n.push(e.code.value.replace("¦","\\¦")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(ZO.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("¦","\\¦")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("¦")}e.makeKey=i,e.makeKeyOptionalMessage=n}(QO||(QO={}));const JO=Zi("markerService");class eA{constructor(){this._byResource=new gs,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 gs,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){let i=this._byResource.get(e);return null===i||void 0===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:Ee.empty():Xt.isUri(e)?null!==(o=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==o?o:Ee.empty():Ee.map(Ee.concat(...this._byOwner.values()),e=>e[1])}}class tA{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new gs,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===zn.inMemory||e.scheme===zn.walkThrough||e.scheme===zn.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e}))i===ZO.Error?t.errors+=1:i===ZO.Warning?t.warnings+=1:i===ZO.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 iA{constructor(){this._onMarkerChanged=new Ye,this.onMarkerChanged=je.debounce(this._onMarkerChanged.event,iA._debouncer,0),this._data=new eA,this._stats=new tA(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(cc(i)){const i=this._data.delete(t,e);i&&this._onMarkerChanged.fire([t])}else{const n=[];for(const o of i){const i=iA._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:c,endColumn:d,relatedInformation:h,tags:u}=i;if(s)return a=a>0?a:1,l=l>0?l:1,c=c>=a?c:a,d=d>0?d:l,{resource:t,owner:e,code:n,severity:o,message:s,source:r,startLineNumber:a,startColumn:l,endLineNumber:c,endColumn:d,relatedInformation:h,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(iA._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&&void 0!==i?i:t),s=[];for(const t of e)for(const e of t)if(iA._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(iA._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||(iA._dedupeMap=new gs,e=[]);for(const i of t)iA._dedupeMap.has(i)||(iA._dedupeMap.set(i,!0),e.push(i));return e}}const nA="__$__targetStorageMarker",oA=Zi("storageService");var sA;(function(e){e[e["NONE"]=0]="NONE",e[e["SHUTDOWN"]=1]="SHUTDOWN"})(sA||(sA={}));class rA extends We{constructor(){super(...arguments),this._onDidChangeValue=this._register(new Xe),this._onDidChangeTarget=this._register(new Xe),this._onWillSaveState=this._register(new Ye),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._globalKeyTargets=void 0}emitDidChangeValue(e,t){t===nA?(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]})}store(e,t,i,n){Ms(t)?this.remove(e,i):this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),this.doStore(e,t,i)})}remove(e,t){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.doRemove(e,t)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i){const n=this.getKeyTargets(t);"number"===typeof i?n[e]!==i&&(n[e]=i,this.doStore(nA,JSON.stringify(n),t)):"number"===typeof n[e]&&(delete n[e],this.doStore(nA,JSON.stringify(n),t))}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(nA,e);if(t)try{return JSON.parse(t)}catch(i){}return Object.create(null)}}class aA extends rA{constructor(){super(...arguments),this.globalCache=new Map,this.workspaceCache=new Map}getCache(e){return 0===e?this.globalCache:this.workspaceCache}get(e,t,i){const n=this.getCache(t).get(e);return Ms(n)?i:n}getBoolean(e,t,i){const n=this.getCache(t).get(e);return Ms(n)?i:"true"===n}getNumber(e,t,i){const n=this.getCache(t).get(e);return Ms(n)?i:parseInt(n,10)}doStore(e,t,i){const n=String(t),o=this.getCache(i).get(e);o!==n&&(this.getCache(i).set(e,n),this.emitDidChangeValue(i,e))}doRemove(e,t){const i=this.getCache(t).delete(e);i&&this.emitDidChangeValue(t,e)}}var lA=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},cA=function(e,t){return function(i,n){t(i,n,e)}};let dA=class{constructor(e){this._commandService=e}createMenu(e,t){return new hA(e,this._commandService,t,this)}};dA=lA([cA(0,Hs)],dA);let hA=class e{constructor(e,t,i,n){this._id=e,this._commandService=t,this._contextKeyService=i,this._menuService=n,this._dispoables=new Fe,this._onDidChange=new Ye,this.onDidChange=this._onDidChange.event,this._menuGroups=[],this._contextKeys=new Set,this._build();const o=new Vn(()=>this._build(),50);this._dispoables.add(o),this._dispoables.add(Hf.onDidChangeMenu(t=>{t.has(e)&&o.schedule()}));const s=new Vn(()=>this._onDidChange.fire(this),50);this._dispoables.add(s),this._dispoables.add(i.onDidChangeContext(e=>{e.affectsSome(this._contextKeys)&&s.schedule()}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const t=Hf.getMenuItems(this._id);let i;t.sort(e._compareMenuItems);for(let n of t){const t=n.group||"";if(i&&i[0]===t||(i=[t,[]],this._menuGroups.push(i)),i[1].push(n),e._fillInKbExprKeys(n.when,this._contextKeys),Wf(n)&&(n.command.precondition&&e._fillInKbExprKeys(n.command.precondition,this._contextKeys),n.command.toggled)){const t=n.command.toggled.condition||n.command.toggled;e._fillInKbExprKeys(t,this._contextKeys)}}this._onDidChange.fire(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=Wf(t)?new Uf(t.command,t.alt,e,this._contextKeyService,this._commandService):new zf(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(Wf(t)?t.command.title:t.title,Wf(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)}};hA=lA([cA(1,Hs),cA(2,Cf),cA(3,Vf)],hA);const uA=Zi("markerDecorationsService");var gA=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},fA=function(e,t){return function(i,n){t(i,n,e)}};function mA(e){return e.toString()}class pA extends We{constructor(e){super(),this.model=e,this._markersData=new Map,this._register(Pe(()=>{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 o=0;othis._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(mA(e));return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(e=>{const t=this._markerDecorations.get(mA(e));t&&this._updateDecorations(t)})}_onModelAdded(e){const t=new pA(e);this._markerDecorations.set(mA(e.uri),t),this._updateDecorations(t)}_onModelRemoved(e){const t=this._markerDecorations.get(mA(e.uri));t&&(t.dispose(),this._markerDecorations.delete(mA(e.uri))),e.uri.scheme!==zn.inMemory&&e.uri.scheme!==zn.internal&&e.uri.scheme!==zn.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=li.lift(t);if(t.severity!==ZO.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 li(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 li(i.startLineNumber,t-1,i.endLineNumber,t):new li(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}};_A=gA([fA(0,aa),fA(1,JO)],_A);var bA=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},vA=function(e,t){return function(i,n){t(i,n,e)}};let wA=class extends We{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new Ye,this._accessibilityModeEnabledContext=yL.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}};wA=bA([vA(0,Cf),vA(1,Cu)],wA);var CA=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class yA{constructor(){this.mapTextToType=new Map,this.findText=""}writeText(e,t){return CA(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,n=document.body.appendChild(Yo("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 CA(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}}))}readFindText(){return CA(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return CA(this,void 0,void 0,(function*(){this.findText=e}))}}var SA=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},xA=function(e,t){return function(i,n){t(i,n,e)}},LA=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const kA=!1;function EA(e){return e.scheme===zn.file?e.fsPath:e.path}let DA=0;class NA{constructor(e,t,i,n,o,s,r){this.id=++DA,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 IA{constructor(e,t){this.resourceLabel=e,this.reason=t}}class TA{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements){const i=0===n.reason?e:t;i.push(n.resourceLabel)}let i=[];return e.length>0&&i.push(o({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(o({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 MA{constructor(e,t,i,n,o,s,r){this.id=++DA,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 TA),this.removedResources.has(t)||this.removedResources.set(t,new IA(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 TA),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new IA(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class OA{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 t of this._future)1===t.type&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i=0;i--)t.push(this._future[i].id);return new YE(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let r=0,a=this._past.length;r=t||s.id!==e.elements[n])&&(i=!1,o=0),i||1!==s.type||s.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let r=this._future.length-1;r>=0;r--,n++){const o=this._future[r];i&&(n>=t||o.id!==e.elements[n])&&(i=!1,s=r),i||1!==o.type||o.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 i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.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 AA{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=s,i=n))}return[t,i]}canUndo(e){if(e instanceof ZE){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const e=this._editStacks.get(t);return e.hasPastElements()}return!1}_onError(e,t){ve(e);for(const i of t.strResources)this.removeElements(i);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(a){return s(),n.dispose(),this._onError(a,e)}return r?r.then(()=>(s(),n.dispose(),o()),t=>(s(),n.dispose(),this._onError(t,e))):(s(),n.dispose(),o())}_invokeWorkspacePrepare(e){return LA(this,void 0,void 0,(function*(){if("undefined"===typeof e.actual.prepareUndoRedo)return We.None;const t=e.actual.prepareUndoRedo();return"undefined"===typeof t?We.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||"undefined"===typeof e.actual.prepareUndoRedo)return t(We.None);const i=e.actual.prepareUndoRedo();return i?Oe(i)?t(i):i.then(e=>t(e)):t(We.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||RA);return new AA(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.info(n),new FA(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.info(n),new FA}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,o({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,o({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 s=[];for(const o of i.editStacks)o.getClosestPastElement()!==t&&s.push(o.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,o({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,s.join(", ")));const r=[];for(const o of i.editStacks)o.locked&&r.push(o.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,o({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,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,o({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 LA(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){const s=yield this._dialogService.show(Lh.Info,o("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),[o({key:"ok",comment:["{0} denotes a number that is > 1"]},"Undo in {0} Files",i.editStacks.length),o("nok","Undo this File"),o("cancel","Cancel")],{cancelId:2});if(2===s.choice)return;if(1===s.choice)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const r=this._checkWorkspaceUndo(e,t,i,!1);if(r)return r.returnValue;n=!0}let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return s.dispose(),r.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,s,()=>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 AA([e]),n,()=>this._continueUndoInGroup(t.groupId,i))));{const e=o({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.info(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 ZE){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)return;if(o.groupId){const[e,n]=this._findClosestUndoElementInGroup(o.groupId);if(o!==e&&n)return this._undo(n,t,i)}const s=o.sourceId!==t||o.confirmBeforeUndo;if(s&&!i)return this._confirmAndContinueUndo(e,t,o);try{return 1===o.type?this._workspaceUndo(e,o,i):this._resourceUndo(n,o,i)}finally{kA&&this._print("undo")}}_confirmAndContinueUndo(e,t,i){return LA(this,void 0,void 0,(function*(){const n=yield this._dialogService.show(Lh.Info,o("confirmDifferentSource","Would you like to undo '{0}'?",i.label),[o("confirmDifferentSource.ok","Undo"),o("cancel","Cancel")],{cancelId:1});if(1!==n.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,o({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,s.join(", ")));const r=[];for(const o of i.editStacks)o.locked&&r.push(o.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,o({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,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,o({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 LA(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,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 AA([e]),i,()=>this._continueRedoInGroup(t.groupId))));{const e=o({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.info(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{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});function HA(e,t,i=!1){const n=e||"",o=t||"",s=VA.value.collator.compare(n,o);return VA.value.collatorIsNumeric&&0===s&&n!==o?no.length)return 1}return 0}i("8c32");const KA=/(\\)?\$\(([a-z\-]+(?:~[a-z\-]+)?)\)/gi;function jA(e){const t=new Array;let i,n=0,o=0;while(null!==(i=KA.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})`:qA({id:r}))}return n{n="\r\n"===e?-1:0,o+=i;for(const i of t)i.end<=o||(i.start>=o&&(i.start+=n),i.end>=o&&(i.end+=n));return i+=n,"⏎"})}}var GA=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class YA{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 XA extends We{constructor(e,t){super(),this.hoverDelegate=void 0,this.customHovers=new Map,this.domNode=this._register(new YA(Ko(e,Yo(".monaco-icon-label")))),this.labelContainer=Ko(this.domNode.element,Yo(".monaco-icon-label-container"));const i=Ko(this.labelContainer,Yo("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new YA(Ko(this.labelContainer,Yo("span.monaco-icon-description-container")))),(null===t||void 0===t?void 0:t.supportHighlights)?this.nameNode=new JA(i,!!t.supportIcons):this.nameNode=new ZA(i),(null===t||void 0===t?void 0:t.supportDescriptionHighlights)?this.descriptionNodeFactory=()=>new $A(Ko(this.descriptionContainer.element,Yo("span.label-description")),!!t.supportIcons):this.descriptionNodeFactory=()=>this._register(new YA(Ko(this.descriptionContainer.element,Yo("span.label-description")))),(null===t||void 0===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?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof $A?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,null===i||void 0===i?void 0:i.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(null===i||void 0===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){e&&n&&(void 0!==t&&(e.target.x=t+10),i.showHover(e))}getTooltipForCustom(e){if(Es(e))return()=>GA(this,void 0,void 0,(function*(){return e}));if(As(e.markdown))return e.markdown;{const t=e.markdown;return()=>GA(this,void 0,void 0,(function*(){return t}))}}setupCustomHover(e,t,i){t.setAttribute("title",""),t.removeAttribute("title");let n=this.getTooltipForCustom(i);const r=s["f"]?1500:500;let a,l,c,d=!1;function h(i){if(d)return;function s(e){d=!1,a=void 0,c.dispose(!0),h.dispose(),u.dispose()}c=new it;const h=_n(t,Wo.MOUSE_LEAVE,!0)(s.bind(t)),u=_n(t,Wo.MOUSE_DOWN,!0)(s.bind(t));function g(e){l=e.x}d=!0;const f=_n(t,Wo.MOUSE_MOVE,!0)(g.bind(t));setTimeout(()=>GA(this,void 0,void 0,(function*(){if(d&&n){if(!a){const t={targetElements:[this],dispose:()=>{}};a={text:o("iconLabel.loading","Loading..."),target:t,anchorPosition:0},XA.adjustXAndShowCustomHover(a,l,e,d);const i=yield n(c.token);i&&(a={text:i,target:t,anchorPosition:0})}XA.adjustXAndShowCustomHover(a,l,e,d)}f.dispose()})),r)}const u=this._register(_n(t,Wo.MOUSE_OVER,!0)(h.bind(t)));this.customHovers.set(t,u)}setupNativeHover(e,t){let i="";Es(t)?i=t:(null===t||void 0===t?void 0:t.markdownNotSupportedFallback)&&(i=t.markdownNotSupportedFallback),e.title=i}}class ZA{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!or(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=Ko(this.container,Yo("a.label-name",{id:null===t||void 0===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=>xN.intersect(o,e)).filter(e=>!xN.isEmpty(e)).map(({start:e,end:t})=>({start:e-n,end:t-n}));return n=o.end+t.length,s})}class JA{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!or(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=new $A(Ko(this.container,Yo("a.label-name",{id:null===t||void 0===t?void 0:t.domId})),this.supportIcons)),this.singleLabel.set(e,null===t||void 0===t?void 0:t.matches,void 0,null===t||void 0===t?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(null===t||void 0===t?void 0:t.separator)||"/",n=QA(e,i,null===t||void 0===t?void 0:t.matches);for(let o=0;o=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},aR=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const lR=Yo;class cR{constructor(e){this.hidden=!1,this._onChecked=new Ye,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 dR{get templateId(){return dR.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Ko(e,lR(".quick-input-list-entry"));const i=Ko(t.entry,lR("label.quick-input-list-label"));t.toDisposeTemplate.push(eo(i,Wo.CLICK,e=>{t.checkbox.offsetParent||e.preventDefault()})),t.checkbox=Ko(i,lR("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(eo(t.checkbox,Wo.CHANGE,e=>{t.element.checked=t.checkbox.checked}));const n=Ko(i,lR(".quick-input-list-rows")),o=Ko(n,lR(".quick-input-list-row")),r=Ko(n,lR(".quick-input-list-row"));t.label=new XA(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0});const a=Ko(o,lR(".quick-input-list-entry-keybinding"));t.keybinding=new sR(a,s["a"]);const l=Ko(r,lR(".quick-input-list-label-meta"));return t.detail=new $A(l,!0),t.separator=Ko(t.entry,lR(".quick-input-list-separator")),t.actionBar=new vk(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=Ae(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?nR(t.iconPath):void 0);t.alwaysVisible&&(n=n?n+" always-visible":"always-visible");const o=new $g("id-"+i,"",n,!0,()=>aR(this,void 0,void 0,(function*(){e.fireButtonTriggered({button:t,item:e.item})})));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=Ae(i.toDisposeElement)}disposeTemplate(e){e.toDisposeElement=Ae(e.toDisposeElement),e.toDisposeTemplate=Ae(e.toDisposeTemplate)}}dR.ID="listelement";class hR{getHeight(e){return e.saneDetail?44:22}getTemplateId(e){return dR.ID}}var uR;(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"})(uR||(uR={}));class gR{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 Ye,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new Ye,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new Ye,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new Ye,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new Ye,this.onButtonTriggered=this._onButtonTriggered.event,this._onKeyDown=new Ye,this.onKeyDown=this._onKeyDown.event,this._onLeave=new Ye,this.onLeave=this._onLeave.event,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Ko(this.parent,lR(".quick-input-list"));const n=new hR,o=new mR;this.list=i.createList("QuickInput",this.container,n,[new dR],{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 Ln(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(s["f"]?e.metaKey:e.ctrlKey)&&this.list.setFocus(fc(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();break}this._onKeyDown.fire(t)})),this.disposables.push(this.list.onMouseDown(e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()})),this.disposables.push(Zn(this.container,Wo.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 je.map(this.list.onDidChangeFocus,e=>e.elements.map(e=>e.item))}get onDidChangeSelection(){return je.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=Ae(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],c=n.label&&n.label.replace(/\r?\n/g," "),d=n.meta&&n.meta.replace(/\r?\n/g," "),h=n.description&&n.description.replace(/\r?\n/g," "),u=n.detail&&n.detail.replace(/\r?\n/g," "),g=n.ariaLabel||[c,h,u].map(e=>e&&yI(e).text).filter(e=>!!e).join(", ");i.push(new cR({index:o,item:n,saneLabel:c,saneMeta:d,saneAriaLabel:g,saneDescription:h,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===uR.Next&&this.list.getFocus()[0]===this.list.length-1&&(e=uR.First),e===uR.Previous&&0===this.list.getFocus()[0]&&(e=uR.Last),e===uR.Second&&this.list.length<2&&(e=uR.First),e){case uR.First:this.list.focusFirst();break;case uR.Second:this.list.focusNth(1);break;case uR.Last:this.list.focusLast();break;case uR.Next:this.list.focusNext();break;case uR.Previous:this.list.focusPrevious();break;case uR.NextPage:this.list.focusNextPage();break;case uR.PreviousPage:this.list.focusPreviousPage();break}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;e=e.trim(),e&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)?this.elements.forEach(t=>{const i=this.matchOnLabel?Vs(xI(e,yI(t.saneLabel))):void 0,n=this.matchOnDescription?Vs(xI(e,yI(t.saneDescription||""))):void 0,o=this.matchOnDetail?Vs(xI(e,yI(t.saneDetail||""))):void 0,s=this.matchOnMeta?Vs(xI(e,yI(t.saneMeta||""))):void 0;i||n||o||s?(t.labelHighlights=i,t.descriptionHighlights=n,t.detailHighlights=o,t.hidden=!1):(t.labelHighlights=void 0,t.descriptionHighlights=void 0,t.detailHighlights=void 0,t.hidden=!t.item.alwaysShow),t.separator=void 0}):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)=>fR(e,t,i))}return this.elementsToIndexes=t.reduce((e,t,i)=>(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=Ae(this.elementDisposables),this.disposables=Ae(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)}}function fR(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:zA(e.saneLabel,t.saneLabel,i)}rR([dm],gR.prototype,"onDidChangeFocus",null),rR([dm],gR.prototype,"onDidChangeSelection",null);class mR{getWidgetAriaLabel(){return o("quickInput","Quick Input")}getAriaLabel(e){return e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(){return"option"}}i("eba9");function pR(e,t={}){const i=bR(t);return i.textContent=e,i}function _R(e,t={}){const i=bR(t);return wR(i,CR(e),t.actionHandler),i}function bR(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}class vR{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 wR(e,t,i){let n;if(2===t.type)n=document.createTextNode(t.content||"");else if(3===t.type)n=document.createElement("b");else if(4===t.type)n=document.createElement("i");else if(5===t.type&&i){const e=document.createElement("a");e.href="#",i.disposeables.add(eo(e,"click",e=>{i.callback(String(t.index),e)})),n=e}else 7===t.type?n=document.createElement("br"):1===t.type&&(n=e);n&&e!==n&&e.appendChild(n),n&&Array.isArray(t.children)&&t.children.forEach(e=>{wR(n,e,i)})}function CR(e){const t={type:1,children:[]};let i=0,n=t;const o=[],s=new vR(e);while(!s.eos()){let e=s.next();const t="\\"===e&&0!==SR(s.peek());if(t&&(e=s.next()),!t&&yR(e)&&e===s.peek()){s.advance(),2===n.type&&(n=o.pop());const t=SR(e);if(n.type===t||5===n.type&&6===t)n=o.pop();else{const e={type:t,children:[]};5===t&&(e.index=i,i++),n.children.push(e),o.push(n),n=e}}else if("\n"===e)2===n.type&&(n=o.pop()),n.children.push({type:7});else if(2!==n.type){const t={type:2,content:e};n.children.push(t),o.push(n),n=t}else n.content+=e}return 2===n.type&&(n=o.pop()),o.length,t}function yR(e){return 0!==SR(e)}function SR(e){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;default:return 0}}const xR=Yo,LR={inputBackground:eb.fromHex("#3C3C3C"),inputForeground:eb.fromHex("#CCCCCC"),inputValidationInfoBorder:eb.fromHex("#55AAFF"),inputValidationInfoBackground:eb.fromHex("#063B49"),inputValidationWarningBorder:eb.fromHex("#B89500"),inputValidationWarningBackground:eb.fromHex("#352A05"),inputValidationErrorBorder:eb.fromHex("#BE1100"),inputValidationErrorBackground:eb.fromHex("#5A1D1D")};class kR extends Ry{constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new Ye),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new Ye),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),nr(this.options,LR,!1),this.message=null,this.placeholder=this.options.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=Ko(e,xR(".monaco-inputbox.idle"));let n=this.options.flexibleHeight?"textarea":"input",o=Ko(this.element,xR(".ibwrapper"));if(this.input=Ko(o,xR(n+".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=Ko(o,xR("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new cS(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Ko(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(e=>this.input.scrollTop=e.scrollTop));const t=je.filter(_n(document,"selectionchange"),()=>{const e=document.getSelection();return(null===e||void 0===e?void 0:e.anchorNode)===o});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.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 vk(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),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:So(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)}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 wo(this.input)}set width(e){if(this.options.flexibleHeight&&this.options.flexibleWidth){let t=0;if(this.mirror){const e=parseFloat(this.mirror.style.paddingLeft||"")||0,i=parseFloat(this.mirror.style.paddingRight||"")||0;t=e+i}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?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=wo(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:t=>{if(!this.message)return null;e=Ko(t,xR(".monaco-inputbox-container")),i();const n={inline:!0,className:"monaco-inputbox-message"},o=this.message.formatContent?_R(this.message.content,n):pR(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:"",Ko(e,o),null},onHide:()=>{this.state="closed"},layout:i}),t=3===this.message.type?o("alertErrorMessage","Error: {0}",this.message.content):2===this.message.type?o("alertWarningMessage","Warning: {0}",this.message.content):o("alertInfoMessage","Info: {0}",this.message.content),Pg(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=e.charCodeAt(e.length-1),i=10===t?" ":"",n=e+i;n?this.mirror.textContent=e+i: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=So(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 ER=Yo;class DR extends We{constructor(e){super(),this.parent=e,this.onKeyDown=e=>Zn(this.inputBox.inputElement,Wo.KEY_DOWN,t=>{e(new Ln(t))}),this.onMouseDown=e=>Zn(this.inputBox.inputElement,Wo.MOUSE_DOWN,t=>{e(new Tn(t))}),this.onDidChange=e=>this.inputBox.onDidChange(e),this.container=Ko(this.parent,ER(".quick-input-box")),this.inputBox=this._register(new kR(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===Lh.Ignore?this.inputBox.hideMessage():this.inputBox.showMessage({type:e===Lh.Info?1:e===Lh.Warning?2:3,content:""})}stylesForType(e){return this.inputBox.stylesForType(e===Lh.Info?1:e===Lh.Warning?2:3)}setFocus(){this.inputBox.focus()}layout(){this.inputBox.layout()}style(e){this.inputBox.style(e)}}i("f5ab");const NR={badgeBackground:eb.fromHex("#4D4D4D"),badgeForeground:eb.fromHex("#FFFFFF")};class IR{constructor(e,t){this.count=0,this.options=t||Object.create(null),nr(this.options,NR,!1),this.badgeBackground=this.options.badgeBackground,this.badgeForeground=this.options.badgeForeground,this.badgeBorder=this.options.badgeBorder,this.element=Ko(e,Yo(".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(rs["v"])(this.countFormat,this.count),this.element.title=Object(rs["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}}}i("2adc");const TR="done",MR="active",OR="infinite",AR="discrete",RR={progressBarBackground:eb.fromHex("#0E70C0")};class PR extends We{constructor(e,t){super(),this.options=t||Object.create(null),nr(this.options,RR,!1),this.workedVal=0,this.progressBarBackground=this.options.progressBarBackground,this._register(this.showDelayedScheduler=new Vn(()=>Xo(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(MR,OR,AR),this.workedVal=0,this.totalWork=void 0}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(TR),this.element.classList.contains(OR)?(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(AR,TR),this.element.classList.add(MR,OR),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}}}i("e635");const FR={buttonBackground:eb.fromHex("#0E639C"),buttonHoverBackground:eb.fromHex("#006BB3"),buttonForeground:eb.white};class WR extends We{constructor(e,t){super(),this._onDidClick=this._register(new Ye),this.options=t||Object.create(null),nr(this.options,FR,!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(gm.addTarget(this._element)),[Wo.CLICK,hm.Tap].forEach(e=>{this._register(Zn(this._element,e,e=>{this.enabled?this._onDidClick.fire(e):Bo.stop(e)}))}),this._register(Zn(this._element,Wo.KEY_DOWN,e=>{const t=new Ln(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&&Bo.stop(t,!0)})),this._register(Zn(this._element,Wo.MOUSE_OVER,e=>{this._element.classList.contains("disabled")||this.setHoverBackground()})),this._register(Zn(this._element,Wo.MOUSE_OUT,e=>{this.applyStyles()})),this.focusTracker=this._register(Uo(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?jo(this._element,...jA(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)),Jo(this._element))}get enabled(){return!this._element.classList.contains("disabled")}}var BR=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const VR=Yo,HR=ma("quick-input-back",pa.arrowLeft),zR={iconClass:HR.classNames,tooltip:o("quickInput.back","Back"),handle:-1};class UR extends We{constructor(e){super(),this.ui=e,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this.onDidTriggerButtonEmitter=this._register(new Ye),this.onDidHideEmitter=this._register(new Ye),this.onDisposeEmitter=this._register(new Ye),this.visibleDisposables=this._register(new Fe),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()}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(){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire()}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 Wn,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===zR);this.ui.leftActionBar.push(e.map((e,t)=>{const i=new $g("id-"+t,"",e.iconClass||nR(e.iconPath),!0,()=>BR(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!==zR);this.ui.rightActionBar.push(t.map((e,t)=>{const i=new $g("id-"+t,"",e.iconClass||nR(e.iconPath),!0,()=>BR(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)}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?o("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e===Lh.Error){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()}}class KR extends UR{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new Ye),this.onDidAcceptEmitter=this._register(new Ye),this.onDidCustomEmitter=this._register(new Ye),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()?BA.NONE:BA.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new Ye),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new Ye),this.onDidTriggerItemButtonEmitter=this._register(new Ye),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?WA:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,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(uR.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{if(e===this.value)return;this._value=e;const t=this.ui.list.filter(this.filterValue(this.ui.inputBox.value));t&&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(uR.Next),this.canSelectMany&&this.ui.list.domFocus(),Bo.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(uR.Previous):this.ui.list.focus(uR.Last),this.canSelectMany&&this.ui.list.domFocus(),Bo.stop(e,!0);break;case 12:this.ui.list.focus(uR.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Bo.stop(e,!0);break;case 11:this.ui.list.focus(uR.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Bo.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(uR.First),Bo.stop(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(uR.Last),Bo.stop(e,!0));break}})),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&&nc(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&&nc(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&&nc(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 Zn(this.ui.container,Wo.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Ln(e),i=t.keyCode,n=this._quickNavigate.keybindings,o=n.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)))});o&&(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;let e=!1,t=!1;this._hideInput&&this._items.length>0&&(this.ui.isScreenReaderOptimized()?t=!0:e=!0),this.ui.container.classList.toggle("hidden-input",e&&!this.description);const i={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};if(this.ui.setVisibilities(i),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||""),t)this.ui.inputBox.ariaLabel="";else{const e=this.ariaLabel||this.placeholder||KR.DEFAULT_ARIA_LABEL;this.ui.inputBox.ariaLabel!==e&&(this.ui.inputBox.ariaLabel=e)}if(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 BA.NONE:this._itemActivation=BA.FIRST;break;case BA.SECOND:this.ui.list.focus(uR.Second),this._itemActivation=BA.FIRST;break;case BA.LAST:this.ui.list.focus(uR.Last),this._itemActivation=BA.FIRST;break;default:this.trySelectFirst();break}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));const n=this.validationMessage||"";this._lastValidationMessage!==n&&(this._lastValidationMessage=n,jo(this.ui.message,...jA(Object(rs["s"])(n))),this.showMessageDecoration(this.validationMessage?Lh.Error:Lh.Ignore)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",this.ui.setComboboxAccessibility(!0),i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(uR.First))}}KR.DEFAULT_ARIA_LABEL=o("quickInputBox.ariaLabel","Type to narrow down results.");class jR extends We{constructor(e){super(),this.options=e,this.comboboxAccessibility=!1,this.enabled=!0,this.onDidAcceptEmitter=this._register(new Ye),this.onDidCustomEmitter=this._register(new Ye),this.onDidTriggerButtonEmitter=this._register(new Ye),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new Ye),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new Ye),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(Zn(window,Wo.KEY_DOWN,e,!0)),this._register(Zn(window,Wo.KEY_UP,e,!0)),this._register(Zn(window,Wo.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Ko(this.parentElement,VR(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=To(e),i=Ko(e,VR(".quick-input-titlebar")),n=this._register(new vk(i));n.domNode.classList.add("quick-input-left-action-bar");const s=Ko(i,VR(".quick-input-title")),r=this._register(new vk(i));r.domNode.classList.add("quick-input-right-action-bar");const a=Ko(e,VR(".quick-input-description")),l=Ko(e,VR(".quick-input-header")),c=Ko(l,VR("input.quick-input-check-all"));c.type="checkbox",this._register(eo(c,Wo.CHANGE,e=>{const t=c.checked;x.setAllVisibleChecked(t)})),this._register(Zn(c,Wo.CLICK,e=>{(e.x||e.y)&&g.setFocus()}));const d=Ko(l,VR(".quick-input-description")),h=Ko(l,VR(".quick-input-and-message")),u=Ko(h,VR(".quick-input-filter")),g=this._register(new DR(u));g.setAttribute("aria-describedby",this.idPrefix+"message");const f=Ko(u,VR(".quick-input-visible-count"));f.setAttribute("aria-live","polite"),f.setAttribute("aria-atomic","true");const m=new IR(f,{countFormat:o({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=Ko(u,VR(".quick-input-count"));p.setAttribute("aria-live","polite");const _=new IR(p,{countFormat:o({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")}),b=Ko(l,VR(".quick-input-action")),v=new WR(b);v.label=o("ok","OK"),this._register(v.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));const w=Ko(l,VR(".quick-input-action")),C=new WR(w);C.label=o("custom","Custom"),this._register(C.onDidClick(e=>{this.onDidCustomEmitter.fire()}));const y=Ko(h,VR(`#${this.idPrefix}message.quick-input-message`)),S=new PR(e);S.getContainer().classList.add("quick-input-progress");const x=this._register(new gR(e,this.idPrefix+"list",this.options));this._register(x.onChangedAllVisibleChecked(e=>{c.checked=e})),this._register(x.onChangedVisibleCount(e=>{m.setCount(e)})),this._register(x.onChangedCheckedCount(e=>{_.setCount(e)})),this._register(x.onLeave(()=>{setTimeout(()=>{g.setFocus(),this.controller instanceof KR&&this.controller.canSelectMany&&x.clearFocus()},0)})),this._register(x.onDidChangeFocus(()=>{this.comboboxAccessibility&&this.getUI().inputBox.setAttribute("aria-activedescendant",this.getUI().list.getActiveDescendant()||"")}));const L=Uo(e);return this._register(L),this._register(Zn(e,Wo.FOCUS,e=>{this.previousFocusElement=e.relatedTarget instanceof HTMLElement?e.relatedTarget:void 0},!0)),this._register(L.onDidBlur(()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(),this.previousFocusElement=void 0})),this._register(Zn(e,Wo.FOCUS,e=>{g.setFocus()})),this._register(Zn(e,Wo.KEY_DOWN,t=>{const i=new Ln(t);switch(i.keyCode){case 3:Bo.stop(t,!0),this.onDidAcceptEmitter.fire();break;case 9:Bo.stop(t,!0),this.hide();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]?(Bo.stop(t,!0),o[o.length-1].focus()):i.shiftKey||i.target!==o[o.length-1]||(Bo.stop(t,!0),o[0].focus())}break}})),this.ui={container:e,styleSheet:t,leftActionBar:n,titleBar:i,title:s,description1:a,description2:d,rightActionBar:r,checkAll:c,filterContainer:u,inputBox:g,visibleCountContainer:f,visibleCount:m,countContainer:p,count:_,okContainer:b,ok:v,message:y,customButtonContainer:w,customButton:C,progressBar:S,list:x,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=et.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();e.splice(t,1),r.items=e}}}))),r.onDidChangeValue(e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])}),i.onCancellationRequested(()=>{r.hide()}),r.onDidHide(()=>{Ae(l),s(void 0)})];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 KR(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(Lh.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),jo(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();zR.tooltip=n?o("quickInput.backWithKeybinding","Back ({0})",n):o("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(){var e;const t=this.controller;if(t){const i=!(null===(e=this.ui)||void 0===e?void 0:e.container.contains(document.activeElement));this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",i||(this.previousFocusElement&&this.previousFocusElement.offsetParent?(this.previousFocusElement.focus(),this.previousFocusElement=void 0):this.options.returnFocus()),t.didHide()}}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,jR.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.listInactiveFocusForeground&&(s.push(`.monaco-list .monaco-list-row.focused { color: ${this.styles.list.listInactiveFocusForeground}; }`),s.push(`.monaco-list .monaco-list-row.focused:hover { color: ${this.styles.list.listInactiveFocusForeground}; }`)),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}; }`);const r=s.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}}jR.MAX_WIDTH=600;const qR=Zi("quickInputService");var $R;(function(e){e[e["PRESERVE"]=0]="PRESERVE",e[e["LAST"]=1]="LAST"})($R||($R={}));const GR={Quickaccess:"workbench.contributions.quickaccess"};class YR{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),Pe(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return lc([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){const t=e&&this.providers.find(t=>e.startsWith(t.prefix))||void 0;return t||this.defaultProvider}}Ah.add(GR.Quickaccess,new YR);var XR=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=function(e,t){return function(i,n){t(i,n,e)}};let QR=class extends We{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Ah.as(GR.Quickaccess),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?void 0:s.descriptor;if(s&&o&&r===o)return e===o.prefix||(null===t||void 0===t?void 0:t.preserveValue)||(s.picker.value=e),void this.adjustValueSelection(s.picker,o,t);if(o&&!(null===t||void 0===t?void 0:t.preserveValue)){let t=void 0;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?void 0:n.defaultFilterValue;e===$R.LAST?t=this.lastAcceptedPickerValues.get(o):"string"===typeof e&&(t=`${o.prefix}${e}`)}"string"===typeof t&&(e=t)}const a=new Fe,l=a.add(this.quickInputService.createQuickPick());l.value=e,this.adjustValueSelection(l,o,t),l.placeholder=null===o||void 0===o?void 0:o.placeholder,l.quickNavigate=null===t||void 0===t?void 0:t.quickNavigateConfiguration,l.hideInput=!!l.quickNavigate&&!s,("number"===typeof(null===t||void 0===t?void 0:t.itemActivation)||(null===t||void 0===t?void 0:t.quickNavigateConfiguration))&&(l.itemActivation=null!==(i=null===t||void 0===t?void 0:t.itemActivation)&&void 0!==i?i:BA.SECOND),l.contextKey=null===o||void 0===o?void 0:o.contextKey,l.filterValue=e=>e.substring(o?o.prefix.length:0),(null===o||void 0===o?void 0:o.placeholder)&&(l.ariaLabel=null===o||void 0===o?void 0:o.placeholder);const c=this.registerPickerListeners(l,n,o,e,a);n&&a.add(n.provide(l,c)),l.show()}adjustValueSelection(e,t,i){var n;let o;o=(null===i||void 0===i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null===t||void 0===t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,n,o){const s=this.visibleQuickAccess={picker:e,descriptor:i,value:n};o.add(Pe(()=>{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)}));const r=o.add(new it);return NS(e.onDidHide)(()=>{0===e.selectedItems.length&&r.cancel(),o.dispose()}),r.token}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]}};QR=XR([ZR(0,qR),ZR(1,Yi)],QR);var 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},eP=function(e,t){return function(i,n){t(i,n,e)}};let tP=class extends Rf{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(QR))),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(WO,e,t,i,n,o),styles:this.computeStyles()},s=this._register(new jR(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.onLayout(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 wf(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=et.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}updateStyles(){this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:Object.assign({},PI(this.theme,{quickInputBackground:sw,quickInputForeground:rw,quickInputTitleBackground:aw,contrastBorder:pv,widgetShadow:bv})),inputBox:PI(this.theme,{inputForeground:wv,inputBackground:vv,inputBorder:Cv,inputValidationInfoBackground:yv,inputValidationInfoForeground:Sv,inputValidationInfoBorder:xv,inputValidationWarningBackground:Lv,inputValidationWarningForeground:kv,inputValidationWarningBorder:Ev,inputValidationErrorBackground:Dv,inputValidationErrorForeground:Nv,inputValidationErrorBorder:Iv}),countBadge:PI(this.theme,{badgeBackground:Pv,badgeForeground:Fv,badgeBorder:pv}),button:PI(this.theme,{buttonForeground:Ov,buttonBackground:Av,buttonHoverBackground:Rv,buttonBorder:pv}),progressBar:PI(this.theme,{progressBarBackground:zv}),list:PI(this.theme,{listBackground:sw,listInactiveFocusForeground:Lw,listInactiveFocusBackground:xw,listFocusOutline:_v,listInactiveFocusOutline:_v,pickerGroupBorder:cw,pickerGroupForeground:lw})}}};tP=JR([eP(0,Yi),eP(1,Cf),eP(2,kf),eP(3,CL),eP(4,qI)],tP);var iP=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},nP=function(e,t){return function(i,n){t(i,n,e)}};let oP=class extends tP{constructor(e,t,i,n,o,s){super(t,i,n,o,s),this.host=void 0;const r=rP.get(e);this.host={_serviceBrand:void 0,get container(){return r.widget.getDomNode()},get dimension(){return e.getLayoutInfo()},get onLayout(){return e.onDidLayoutChange},focus:()=>e.focus()}}createController(){return super.createController(this.host)}};oP=iP([nP(1,Yi),nP(2,Cf),nP(3,kf),nP(4,CL),nP(5,qI)],oP);let sP=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(oP,e);this.mapEditorToService.set(e,t),NS(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}pick(e,t={},i=et.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}};sP=iP([nP(0,Yi),nP(1,Ji)],sP);class rP{constructor(e){this.editor=e,this.widget=new aP(this.editor)}static get(e){return e.getContribution(rP.ID)}dispose(){this.widget.dispose()}}rP.ID="editor.controller.quickInput";class aP{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return aP.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}var lP;aP.ID="editor.contrib.quickInputWidget",Qf(rP.ID,rP),function(e){const t=new wL;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}function s(e){let t=new wL;for(const[n,o]of dk())t.set(n,o);for(let n in e)e.hasOwnProperty(n)&&t.set(Zi(n),e[n]);n.forEach(i=>t.set(i.id,i.get(e)));let i=new tT(t,!0);return t.set(Yi,i),[t,i]}e.init=s,e.instantiationService=o(Yi,()=>new tT(t,!0));const r=new wg;e.configurationService=o(Cu,()=>r),e.resourceConfigurationService=o(Qc,()=>new Cg(r)),e.resourcePropertiesService=o(Jc,()=>new yg(r)),e.contextService=o(Zu,()=>new xg),e.labelService=o(nT,()=>new Eg),e.telemetryService=o(Kf,()=>new Sg),e.dialogService=o(XI,()=>new mg),e.notificationService=o(Yu,()=>new pg),e.markerService=o(JO,()=>new iA),e.modeService=o(nl,e=>new $E),e.standaloneThemeService=o(pE,()=>new cN),e.logService=o(ed,()=>new od),e.undoRedoService=o(GE,t=>new PA(e.dialogService.get(t),e.notificationService.get(t))),e.modelService=o(aa,t=>new wD(e.configurationService.get(t),e.resourcePropertiesService.get(t),e.standaloneThemeService.get(t),e.logService.get(t),e.undoRedoService.get(t))),e.markerDecorationsService=o(uA,t=>new _A(e.modelService.get(t),e.markerService.get(t))),e.codeEditorService=o(Ji,t=>new WD(e.standaloneThemeService.get(t))),e.editorProgressService=o(qk,()=>new fg),e.storageService=o(oA,()=>new aA),e.editorWorkerService=o(il,t=>new hd(e.modelService.get(t),e.resourceConfigurationService.get(t),e.logService.get(t)))}(lP||(lP={}));class cP extends We{constructor(e,t){super();const[i,n]=lP.init(t);this._serviceCollection=i,this._instantiationService=n;const o=this.get(Cu),s=this.get(Yu),r=this.get(Kf),a=this.get(kf),l=this.get(ed);let c=(e,i)=>{let n=null;return t&&(n=t[e.toString()]),n||(n=i()),this._serviceCollection.set(e,n),n},d=c(Cf,()=>this._register(new CN(o)));c(CL,()=>new wA(d,o)),c(fO,()=>new mO(a));let h=c(Hs,()=>new _g(this._instantiationService)),u=c(_E,()=>this._register(new bg(d,h,r,s,l,e))),g=c(qI,()=>new Dg(lP.codeEditorService.get(Ji),e));c(qR,()=>new sP(n,lP.codeEditorService.get(Ji)));let f=c(Vk,()=>this._register(new YI(g)));c(Kk,()=>new yA),c(Hk,()=>{const e=new jI(r,s,f,u,a);return e.configure({blockMouse:!1}),this._register(e)}),c(Vf,()=>new dA(h)),c(Eh,()=>new kg(lP.modelService.get(aa)))}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 dP(e,t,i){let n=new cP(e,t),o=null;n.has(ol)||(o=new gg(lP.modelService.get()),n.set(ol,o)),n.has(js)||n.set(js,new Qs(n.get(Ji),n.get(Hs)));let s=i(n);return o&&o.setEditor(s),s}function hP(e,t,i){return dP(e,i||{},i=>new xE(e,t,i,i.get(Yi),i.get(Ji),i.get(Hs),i.get(Cf),i.get(_E),i.get(Vk),i.get(pE),i.get(Yu),i.get(Cu),i.get(CL),i.get(aa),i.get(nl)))}function uP(e){return lP.codeEditorService.get().onCodeEditorAdd(t=>{e(t)})}function gP(e,t,i){return dP(e,i||{},i=>new LE(e,t,i,i.get(Yi),i.get(Cf),i.get(_E),i.get(Vk),i.get(il),i.get(Ji),i.get(pE),i.get(Yu),i.get(Cu),i.get(Hk),i.get(qk),i.get(Kk)))}function fP(e,t){return new ar(e,t)}function mP(e,t,i){return kE(lP.modelService.get(),lP.modeService.get(),e,t,i)}function pP(e,t){lP.modelService.get().setMode(e,lP.modeService.get().create(t))}function _P(e,t,i){e&&lP.markerService.get().changeOne(t,e.uri,i)}function bP(e){return lP.markerService.get().read(e)}function vP(e){return lP.markerService.get().onMarkerChanged(e)}function wP(e){return lP.modelService.get().getModel(e)}function CP(){return lP.modelService.get().getModels()}function yP(e){return lP.modelService.get().onModelAdded(e)}function SP(e){return lP.modelService.get().onModelRemoved(e)}function xP(e){return lP.modelService.get().onModelModeChanged(t=>{e({model:t.model,oldLanguage:t.oldModeId})})}function LP(e){return bd(lP.modelService.get(),e)}function kP(e,t){const i=lP.standaloneThemeService.get();return i.registerEditorContainer(e),wh.colorizeElement(i,lP.modeService.get(),e,t)}function EP(e,t,i){const n=lP.standaloneThemeService.get();return n.registerEditorContainer(document.body),wh.colorize(lP.modeService.get(),e,t,i)}function DP(e,t,i=4){const n=lP.standaloneThemeService.get();return n.registerEditorContainer(document.body),wh.colorizeModelLine(e,t,i)}function NP(e){let t=Ga.get(e);return t||{getInitialState:()=>Xa,tokenize:(t,i,n,o)=>Ja(e,t,n,o)}}function IP(e,t){let i=lP.modeService.get();i.triggerMode(t);let n=NP(t),o=Object(rs["P"])(e),s=[],r=n.getInitialState();for(let a=0,l=o.length;a=0&&i<5)i++,t=t.replace(/@(\w+)/g,(function(i,n){let o="";if("string"===typeof e[n])o=e[n];else{if(!(e[n]&&e[n]instanceof RegExp))throw void 0===e[n]?nh(e,"language definition does not contain attribute '"+n+"', used at: "+t):nh(e,"attribute reference '"+n+"' must be a string, used at: "+t);o=e[n].source}return Jd(o)?"":"(?:"+o+")"}));let n=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,n)}function zP(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 nh(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 nh(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&&!rh(e,oh(e,o,"",[],""))))throw nh(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=HP(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=KP(e,this.name,t)}}function qP(e,t){if(!t||"object"!==typeof t)throw new Error("Monarch: expecting a language definition object");let i={};i.languageId=e,i.includeLF=FP(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"===typeof t.start?t.start:null,i.ignoreCase=FP(t.ignoreCase,!1),i.unicode=FP(t.unicode,!1),i.tokenPostfix=WP(t.tokenPostfix,"."+i.languageId),i.defaultToken=WP(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 nh(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw nh(i,"include target '"+r+"' is not defined at: "+e);o(e+"."+r,s,t.tokenizer[r])}else{const t=new jP(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 nh(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 nh(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=FP(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 nh(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(let r in t.tokenizer)if(t.tokenizer.hasOwnProperty(r)){i.start||(i.start=r);const e=t.tokenizer[r];i.tokenizer[r]=new Array,o("tokenizer."+r,i.tokenizer[r],e)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw nh(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 r of t.brackets){let e=r;if(e&&Array.isArray(e)&&3===e.length&&(e={token:e[2],open:e[0],close:e[1]}),e.open===e.close)throw nh(i,"open and close brackets in a 'brackets' attribute must be different: "+e.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!==typeof e.open||"string"!==typeof e.token||"string"!==typeof e.close)throw nh(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");s.push({token:e.token+i.tokenPostfix,open:eh(i,e.open),close:eh(i,e.close)})}return i.brackets=s,i.noThrow=!0,i}function $P(e){HE.registerLanguage(e)}function GP(){let e=[];return e=e.concat(HE.getLanguages()),e}function YP(e){let t=lP.modeService.get().getLanguageIdentifier(e);return t?t.id:0}function XP(e,t){let i=lP.modeService.get().onDidCreateMode(n=>{n.getId()===e&&(i.dispose(),t())});return i}function ZP(e,t){let i=lP.modeService.get().getLanguageIdentifier(e);if(!i)throw new Error("Cannot set configuration for unknown language "+e);return ec.register(i,t)}class QP{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 JP.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 ui(n.tokens,n.endState)}}class JP{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]===c)continue;let d=a.startIndex;0===l?d=0:deF(e)?new QP(i,e):new JP(lP.standaloneThemeService.get(),i,e);return tF(t)?Ga.registerPromise(e,t.then(e=>n(e))):Ga.register(e,n(t))}function oF(e,t){const i=t=>_h(lP.modeService.get(),lP.standaloneThemeService.get(),e,qP(e,t));return tF(t)?Ga.registerPromise(e,t.then(e=>i(e))):Ga.register(e,i(t))}function sF(e,t){return xa.register(e,t)}function rF(e,t){return La.register(e,t)}function aF(e,t){return Ea.register(e,t)}function lF(e,t){return Da.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 li(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)),e.range||(e.range=new li(i.lineNumber,i.column,i.lineNumber,i.column)),e})}})}function cF(e,t){return Na.register(e,t)}function dF(e,t){return Ia.register(e,t)}function hF(e,t){return Ta.register(e,t)}function uF(e,t){return Ma.register(e,t)}function gF(e,t){return Aa.register(e,t)}function fF(e,t){return Ra.register(e,t)}function mF(e,t){return Pa.register(e,t)}function pF(e,t){return Wa.register(e,{provideCodeActions:(e,i,n,o)=>{let s=lP.markerService.get().read({resource:e.uri}).filter(e=>li.areIntersectingOrTouching(e,i));return t.provideCodeActions(e,i,{markers:s,only:n.only},o)}})}function _F(e,t){return Ba.register(e,t)}function bF(e,t){return Va.register(e,t)}function vF(e,t){return Ha.register(e,t)}function wF(e,t){return za.register(e,t)}function CF(e,t){return ka.register(e,t)}function yF(e,t){return Ua.register(e,t)}function SF(e,t){return ja.register(e,t)}function xF(e,t){return Oa.register(e,t)}function LF(e,t){return Ka.register(e,t)}function kF(e,t){return qa.register(e,t)}function EF(e,t){return $a.register(e,t)}function DF(){return{register:$P,getLanguages:GP,onLanguage:XP,getEncodedLanguageId:YP,setLanguageConfiguration:ZP,setColorMap:iF,setTokensProvider:nF,setMonarchTokensProvider:oF,registerReferenceProvider:sF,registerRenameProvider:rF,registerCompletionItemProvider:CF,registerSignatureHelpProvider:aF,registerHoverProvider:lF,registerDocumentSymbolProvider:cF,registerDocumentHighlightProvider:dF,registerLinkedEditingRangeProvider:hF,registerDefinitionProvider:uF,registerImplementationProvider:gF,registerTypeDefinitionProvider:fF,registerCodeLensProvider:mF,registerCodeActionProvider:pF,registerDocumentFormattingEditProvider:_F,registerDocumentRangeFormattingEditProvider:bF,registerOnTypeFormattingEditProvider:vF,registerLinkProvider:wF,registerColorProvider:yF,registerFoldingRangeProvider:SF,registerDeclarationProvider:xF,registerSelectionRangeProvider:LF,registerDocumentSemanticTokensProvider:kF,registerDocumentRangeSemanticTokensProvider:EF,DocumentHighlightKind:Ci,CompletionItemKind:mi,CompletionItemTag:pi,CompletionItemInsertTextRule:fi,SymbolKind:Vi,SymbolTag:Hi,IndentAction:ki,CompletionTriggerKind:_i,SignatureHelpTriggerKind:Bi,FoldingRangeKind:Sa}}class NF{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"===typeof e?e.toLowerCase():e._lower}}var IF,TF,MF=function(e,t,i,n){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function r(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n["throw"](e))}catch(t){s(t)}}function l(e){e.done?i(e.value):o(e.value).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function OF(e){const t=[],i=new Set,n=Ba.ordered(e);for(const s of n)t.push(s),s.extensionId&&i.add(NF.toKey(s.extensionId));const o=Va.ordered(e);for(const s of o){if(s.extensionId){if(i.has(NF.toKey(s.extensionId)))continue;i.add(NF.toKey(s.extensionId))}t.push({displayName:s.displayName,extensionId:s.extensionId,provideDocumentFormattingEdits(e,t,i){return s.provideDocumentRangeFormattingEdits(e,e.getFullModelRange(),t,i)}})}return t}class AF{static setFormatterSelector(e){const t=AF._selectors.unshift(e);return{dispose:t}}static select(e,t,i){return MF(this,void 0,void 0,(function*(){if(0===e.length)return;const n=Ee.first(AF._selectors);return n?yield n(e,t,i):void 0}))}}function RF(e,t,i,n,o){return MF(this,void 0,void 0,(function*(){const s=Va.ordered(t);for(const r of s){let s=yield Promise.resolve(r.provideDocumentRangeFormattingEdits(t,i,n,o)).catch(we);if(dc(s))return yield e.computeMoreMinimalEdits(t.uri,s)}}))}function PF(e,t,i,n){return MF(this,void 0,void 0,(function*(){const o=OF(t);for(const s of o){let o=yield Promise.resolve(s.provideDocumentFormattingEdits(t,i,n)).catch(we);if(dc(o))return yield e.computeMoreMinimalEdits(t.uri,o)}}))}function FF(e,t,i,n,o){const s=Ha.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,et.None)).catch(we).then(i=>e.computeMoreMinimalEdits(t.uri,i))}AF._selectors=new ze,zs.registerCommand("_executeFormatRangeProvider",(function(e,...t){const[i,n,o]=t;Os(Xt.isUri(i)),Os(li.isIRange(n));const s=e.get(aa).getModel(i);if(!s)throw Le("resource");return RF(e.get(il),s,li.lift(n),o,et.None)})),zs.registerCommand("_executeFormatDocumentProvider",(function(e,...t){const[i,n]=t;Os(Xt.isUri(i));const o=e.get(aa).getModel(i);if(!o)throw Le("resource");return PF(e.get(il),o,n,et.None)})),zs.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){const[i,n,o,s]=t;Os(Xt.isUri(i)),Os(ai.isIPosition(n)),Os("string"===typeof o);const r=e.get(aa).getModel(i);if(!r)throw Le("resource");return FF(e.get(il),r,ai.lift(n),o,s)})),pe.wrappingIndent.defaultValue=0,pe.glyphMargin.defaultValue=!1,pe.autoIndent.defaultValue=3,pe.overviewRulerLanes.defaultValue=2,AF.setFormatterSelector((e,t,i)=>Promise.resolve(e[0]));const WF=$i();WF.editor=RP(),WF.languages=DF();const BF=WF.CancellationTokenSource,VF=WF.Emitter,HF=WF.KeyCode,zF=WF.KeyMod,UF=WF.Position,KF=WF.Range,jF=WF.Selection,qF=WF.SelectionDirection,$F=WF.MarkerSeverity,GF=WF.MarkerTag,YF=WF.Uri,XF=WF.Token,ZF=WF.editor,QF=WF.languages;((null===(IF=s["b"].MonacoEnvironment)||void 0===IF?void 0:IF.globalAPI)||(null===(TF=s["b"].define)||void 0===TF?void 0:TF.amd))&&(self.monaco=WF),"undefined"!==typeof 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"]})},"7f17":function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},"7f36":function(e,t,i){"use strict";var n=i("7eca");i.d(t,"a",(function(){return n["languages"]}))},"7f82":function(e,t,i){var n=i("eee7");e.exports=function(e,t){if(!n(e))return e;var i,o;if(t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;if("function"==typeof(i=e.valueOf)&&!n(o=i.call(e)))return o;if(!t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},"80db":function(e,t){var i=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:i)(e)}},8120:function(e,t,i){"use strict";var n=i("83ec"),o=i("3395").trim,s=i("c55c");n({target:"String",proto:!0,forced:s("trim")},{trim:function(){return o(this)}})},"826e":function(e,t,i){"use strict";i.d(t,"a",(function(){return d}));i("eb46"),i("2c50"),i("9bf1"),i("d927"),i("ef61"),i("fa89"),i("2eb0"),i("f05e"),i("b485"),i("a8de"),i("7352"),i("8120"),i("f96e"),i("b13d");var n,o,s,r=i("5491"),a=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/,c={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"'":"\\'","\\":"\\\\"};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.space||2,n=0!=t.dropQuotesOnKeys,o=t.dropQuotesOnNumbers||!1,s=t.inlineShortArrays||!1,r=t.inlineShortArraysDepth||1,a=t.quoteType||"single",l=t.minify||!1;o&&h(e);var c=f(e,null,l?void 0:i,n,a);if(s&&!l){var d=g(c);if(r>1)for(var u=1;ux;x++)if((g||x in C)&&(b=C[x],v=y(b,x,w),e))if(t)k[x]=v;else if(v)switch(e){case 3:return!0;case 5:return b;case 6:return x;case 2:l.call(k,b)}else switch(e){case 4:return!1;case 7:l.call(k,b)}return h?-1:c||d?d:k}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},"8c32":function(e,t,i){var n=i("e09a");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("bbcfab50",n,!0,{sourceMap:!1,shadowMode:!1})},"8c42":function(e,t,i){var n=i("fe32"),o=i("c1ca"),s=i("42b1"),r=i("b896");e.exports=function(e,t){for(var i=o(t),a=r.f,l=s.f,c=0;c1?arguments[1]:void 0)}})},"8dab":function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{-moz-user-select:none;user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;-ms-touch-action:none;touch-action:none}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-multiple,.monaco-list.selection-single{outline:0!important}.monaco-list:focus .monaco-list-row.selected .codicon{color:inherit}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000}.monaco-list-type-filter{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;border-radius:2px;padding:0 3px;max-width:calc(100% - 10px);text-overflow:ellipsis;overflow:hidden;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:all-scroll;font-size:13px;line-height:18px;height:20px;z-index:1;top:4px}.monaco-list-type-filter.dragging{-webkit-transition:top .2s,left .2s;transition:top .2s,left .2s}.monaco-list-type-filter.ne{right:4px}.monaco-list-type-filter.nw{left:4px}.monaco-list-type-filter>.controls{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .2s;transition:width .2s;width:0}.monaco-list-type-filter.dragging>.controls,.monaco-list-type-filter:hover>.controls{width:36px}.monaco-list-type-filter>.controls>*{border:none;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;background:none;width:16px;height:16px;-ms-flex-negative:0;flex-shrink:0;margin:0;padding:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;cursor:pointer}.monaco-list-type-filter>.controls>.filter{margin-left:4px}.monaco-list-type-filter-message{position:absolute;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-list-type-filter{cursor:-webkit-grab;cursor:grab}.monaco-list-type-filter.dragging{cursor:-webkit-grabbing;cursor:grabbing}",""]),e.exports=t},"8fed":function(e,t,i){var n=i("f79e"),o=i("2c21"),s=i("ac97");e.exports=!!Object.getOwnPropertySymbols&&!s((function(){return!Symbol.sham&&(n?38===o:o>37&&o<41)}))},9368:function(e,t,i){var n=i("3c82");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("3e21d075",n,!0,{sourceMap:!1,shadowMode:!1})},9532:function(e,t,i){var n=i("8a16");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("3f644738",n,!0,{sourceMap:!1,shadowMode:!1})},9550:function(e,t,i){var n=i("2f6c"),o=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(e){return o.call(e)}),e.exports=n.inspectSource},"95d1":function(e,t,i){var n=i("e244"),o=i("a909"),s=i("e2da"),r=i("69f1"),a=i("1810"),l=a("iterator"),c=a("toStringTag"),d=s.values;for(var h in o){var u=n[h],g=u&&u.prototype;if(g){if(g[l]!==d)try{r(g,l,d)}catch(m){g[l]=d}if(g[c]||r(g,c,h),o[h])for(var f in s)if(g[f]!==s[f])try{r(g,f,s[f])}catch(m){g[f]=s[f]}}}},"986e":function(e,t,i){var n=i("f0db"),o=i("2f6c");(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.11.0",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"99ab":function(e,t,i){var n=i("83ec"),o=i("d362");n({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},"9b3a":function(e,t,i){"use strict";var n=i("88d2"),o=i.n(n);o.a},"9bf1":function(e,t,i){"use strict";var n=i("83ec"),o=i("eee7"),s=i("5a43"),r=i("3352"),a=i("ce47"),l=i("45ad"),c=i("acd4"),d=i("1810"),h=i("72d4"),u=h("slice"),g=d("species"),f=[].slice,m=Math.max;n({target:"Array",proto:!0,forced:!u},{slice:function(e,t){var i,n,d,h=l(this),u=a(h.length),p=r(e,u),_=r(void 0===t?u:t,u);if(s(h)&&(i=h.constructor,"function"!=typeof i||i!==Array&&!s(i.prototype)?o(i)&&(i=i[g],null===i&&(i=void 0)):i=void 0,i===Array||void 0===i))return f.call(h,p,_);for(n=new(void 0===i?Array:i)(m(_-p,0)),d=0;p<_;p++,d++)p in h&&c(n,d,h[p]);return n.length=d,n}})},"9c85":function(e,t,i){var n=i("eca0");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("46bf518f",n,!0,{sourceMap:!1,shadowMode:!1})},"9d6f":function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{-moz-user-select:none;user-select:none;-webkit-user-select:none;-ms-user-select:none}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .mtkz{display:inline-block}",""]),e.exports=t},a056:function(e,t,i){var n=i("ac97"),o=/#|\.prototype\./,s=function(e,t){var i=a[r(e)];return i==c||i!=l&&("function"==typeof t?n(t):!!t)},r=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},a=s.data={},l=s.NATIVE="N",c=s.POLYFILL="P";e.exports=s},a078:function(e,t,i){"use strict";var n=i("4eaf").charAt,o=i("35d6"),s=i("325d"),r="String Iterator",a=o.set,l=o.getterFor(r);s(String,"String",(function(e){a(this,{type:r,string:String(e),index:0})}),(function(){var e,t=l(this),i=t.string,o=t.index;return o>=i.length?{value:void 0,done:!0}:(e=n(i,o),t.index+=e.length,{value:e,done:!1})}))},a0c9:function(e,t,i){"use strict";e.exports=function(e,t){return t||(t={}),e=e&&e.__esModule?e.default:e,"string"!==typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},a23c:function(e,t,i){var n=i("e263");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("f22d8072",n,!0,{sourceMap:!1,shadowMode:!1})},a2e5:function(e,t,i){var n=i("3f13");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("b6bc25aa",n,!0,{sourceMap:!1,shadowMode:!1})},a52d:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}",""]),e.exports=t},a53d:function(e,t,i){var n=i("1810"),o=i("d85b"),s=n("iterator"),r=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||r[s]===e)}},a55b:function(e,t,i){var n=i("fbcf"),o=i("7f17"),s=i("1810"),r=s("species");e.exports=function(e,t){var i,s=n(e).constructor;return void 0===s||void 0==(i=n(s)[r])?t:o(i)}},a5f6:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"form-config-container"},[i("el-form",{attrs:{"label-position":"left","label-suffix":":","label-width":"130px",size:"small"}},[i("el-form-item",{attrs:{label:"标签对齐方式"}},[i("el-select",{attrs:{placeholder:"标签对齐方式"},model:{value:e.data.labelPosition,callback:function(t){e.$set(e.data,"labelPosition",t)},expression:"data.labelPosition"}},[i("el-option",{attrs:{label:"左对齐",value:"left"}}),i("el-option",{attrs:{label:"右对齐",value:"right"}}),i("el-option",{attrs:{label:"顶部对齐",value:"top"}})],1)],1),i("el-form-item",{attrs:{label:"标签宽度"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{min:80,max:200,step:10,"controls-position":"right",placeholder:"标签宽度"},model:{value:e.data.labelWidth,callback:function(t){e.$set(e.data,"labelWidth",t)},expression:"data.labelWidth"}})],1),i("el-form-item",{attrs:{label:"标签后缀"}},[i("el-input",{attrs:{placeholder:"标签后缀"},model:{value:e.data.labelSuffix,callback:function(t){e.$set(e.data,"labelSuffix",t)},expression:"data.labelSuffix"}})],1),i("el-form-item",{attrs:{label:"项之间的间隔"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{min:0,max:60,step:5,"controls-position":"right",placeholder:"项之间的间隔"},model:{value:e.data.gutter,callback:function(t){e.$set(e.data,"gutter",t)},expression:"data.gutter"}})],1),i("el-form-item",{attrs:{label:"多分组转标签"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.tabs,callback:function(t){e.$set(e.data,"tabs",t)},expression:"data.tabs"}})],1),i("el-form-item",{attrs:{label:"详情模式"}},[i("el-switch",{model:{value:e.data.detail,callback:function(t){e.$set(e.data,"detail",t)},expression:"data.detail"}})],1),i("el-form-item",{attrs:{label:"显示按钮"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.menuBtn,callback:function(t){e.$set(e.data,"menuBtn",t)},expression:"data.menuBtn"}})],1),e.data.menuBtn?i("el-form-item",{attrs:{label:"显示提交按钮"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.submitBtn,callback:function(t){e.$set(e.data,"submitBtn",t)},expression:"data.submitBtn"}})],1):e._e(),e.data.menuBtn&&e.data.submitBtn?i("el-form-item",{attrs:{label:"提交按钮的文字"}},[i("el-input",{attrs:{placeholder:"提交按钮的文字"},model:{value:e.data.submitText,callback:function(t){e.$set(e.data,"submitText",t)},expression:"data.submitText"}})],1):e._e(),e.data.menuBtn?i("el-form-item",{attrs:{label:"显示清空按钮"}},[i("el-switch",{attrs:{"active-color":"#409EFF"},model:{value:e.data.emptyBtn,callback:function(t){e.$set(e.data,"emptyBtn",t)},expression:"data.emptyBtn"}})],1):e._e(),e.data.menuBtn&&e.data.emptyBtn?i("el-form-item",{attrs:{label:"清空按钮的文字"}},[i("el-input",{attrs:{placeholder:"提交按钮的文字"},model:{value:e.data.emptyText,callback:function(t){e.$set(e.data,"emptyText",t)},expression:"data.emptyText"}})],1):e._e(),i("el-form-item",{attrs:{label:"全局只读"}},[i("el-switch",{model:{value:e.data.readonly,callback:function(t){e.$set(e.data,"readonly",t)},expression:"data.readonly"}})],1),i("el-form-item",{attrs:{label:"全局禁用"}},[i("el-switch",{model:{value:e.data.disabled,callback:function(t){e.$set(e.data,"disabled",t)},expression:"data.disabled"}})],1)],1)],1)},o=[],s={name:"form-config",props:["data"]},r=s,a=i("e3d4"),l=Object(a["a"])(r,n,o,!1,null,null,null);t["a"]=l.exports},a780:function(e,t,i){var n=i("6043");e.exports=n("document","documentElement")},a7f7:function(e,t,i){var n=i("fe32"),o=i("c673"),s=i("5350"),r=i("4467"),a=s("IE_PROTO"),l=Object.prototype;e.exports=r?Object.getPrototypeOf:function(e){return e=o(e),n(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},a8de:function(e,t,i){"use strict";var n=i("e820"),o=i("fbcf"),s=i("ce47"),r=i("80db"),a=i("0874"),l=i("61c0"),c=i("c243"),d=i("ec23"),h=Math.max,u=Math.min,g=function(e){return void 0===e?e:String(e)};n("replace",2,(function(e,t,i,n){var f=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,m=n.REPLACE_KEEPS_$0,p=f?"$":"$0";return[function(i,n){var o=a(this),s=void 0==i?void 0:i[e];return void 0!==s?s.call(i,o,n):t.call(String(o),i,n)},function(e,n){if(!f&&m||"string"===typeof n&&-1===n.indexOf(p)){var a=i(t,e,this,n);if(a.done)return a.value}var _=o(e),b=String(this),v="function"===typeof n;v||(n=String(n));var w=_.global;if(w){var C=_.unicode;_.lastIndex=0}var y=[];while(1){var S=d(_,b);if(null===S)break;if(y.push(S),!w)break;var x=String(S[0]);""===x&&(_.lastIndex=l(b,s(_.lastIndex),C))}for(var L="",k=0,E=0;E=k&&(L+=b.slice(k,N)+A,k=N+D.length)}return L+b.slice(k)}]}))},a909:function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},ac97:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},aca4:function(e,t,i){var n=i("1810");t.f=n},acd4:function(e,t,i){"use strict";var n=i("7f82"),o=i("b896"),s=i("4d82");e.exports=function(e,t,i){var r=n(t);r in e?o.f(e,r,s(0,i)):e[r]=i}},ad2f:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-count-badge{padding:3px 6px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}",""]),e.exports=t},adf0:function(e,t,i){var n=i("a52d");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("44843bab",n,!0,{sourceMap:!1,shadowMode:!1})},b012:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{-webkit-transition:all 80ms;transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{-webkit-box-sizing:border-box;box-sizing:border-box;background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important;-webkit-box-sizing:border-box;box-sizing:border-box}@-webkit-keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@-webkit-keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@-webkit-keyframes monaco-cursor-expand{0%,20%{-webkit-transform:scaleY(1);transform:scaleY(1)}80%,to{-webkit-transform:scaleY(0);transform:scaleY(0)}}@keyframes monaco-cursor-expand{0%,20%{-webkit-transform:scaleY(1);transform:scaleY(1)}80%,to{-webkit-transform:scaleY(0);transform:scaleY(0)}}.cursor-smooth{-webkit-animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{-webkit-animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{-webkit-animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate;animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}",""]),e.exports=t},b042:function(e,t,i){var n=i("e4f5");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("7223b90e",n,!0,{sourceMap:!1,shadowMode:!1})},b105:function(e,t,i){"use strict";var n=i("83ec"),o=i("8aa3").findIndex,s=i("6e10"),r="findIndex",a=!0;r in[]&&Array(1)[r]((function(){a=!1})),n({target:"Array",proto:!0,forced:a},{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),s(r)},b13d:function(e,t,i){"use strict";var n=i("83ec");n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},b485:function(e,t,i){"use strict";var n=i("e820"),o=i("fbcf"),s=i("ce47"),r=i("0874"),a=i("61c0"),l=i("ec23");n("match",1,(function(e,t,i){return[function(t){var i=r(this),n=void 0==t?void 0:t[e];return void 0!==n?n.call(t,i):new RegExp(t)[e](String(i))},function(e){var n=i(t,e,this);if(n.done)return n.value;var r=o(e),c=String(this);if(!r.global)return l(r,c);var d=r.unicode;r.lastIndex=0;var h,u=[],g=0;while(null!==(h=l(r,c))){var f=String(h[0]);u[g]=f,""===f&&(r.lastIndex=a(c,s(r.lastIndex),d)),g++}return 0===g?null:u}]}))},b4fd:function(e,t,i){var n=i("ac97"),o=i("c401"),s="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?s.call(e,""):Object(e)}:Object},b856:function(e,t,i){var n=i("b012");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("6a89fb2a",n,!0,{sourceMap:!1,shadowMode:!1})},b896:function(e,t,i){var n=i("55ab"),o=i("bf6f"),s=i("fbcf"),r=i("7f82"),a=Object.defineProperty;t.f=n?a:function(e,t,i){if(s(e),t=r(t,!0),s(i),o)try{return a(e,t,i)}catch(n){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},bd77:function(e,t,i){var n=i("8fed");e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},bf1d:function(e,t,i){var n=i("45ad"),o=i("f0f1").f,s={}.toString,r="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(e){try{return o(e)}catch(t){return r.slice()}};e.exports.f=function(e){return r&&"[object Window]"==s.call(e)?a(e):o(n(e))}},bf6f:function(e,t,i){var n=i("55ab"),o=i("ac97"),s=i("f146");e.exports=!n&&!o((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},c09a:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:rgba(0,0,0,.03)}.monaco-diff-editor.vs-dark .diffOverview{background:hsla(0,0%,100%,.01)}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar{background:transparent}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:hsla(0,0%,67.1%,.4)}.modified-in-monaco-diff-editor.hc-black .slider.active{background:none}.monaco-diff-editor .delete-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-editor .insert-sign{font-size:11px!important;opacity:.7!important;display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.monaco-diff-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-editor.hc-black .insert-sign{opacity:1}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .inline-deleted-margin-view-zone{text-align:right}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}",""]),e.exports=t},c1ca:function(e,t,i){var n=i("6043"),o=i("f0f1"),s=i("0ef1"),r=i("fbcf");e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(r(e)),i=s.f;return i?t.concat(i(e)):t}},c223: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 c})),i.d(t,"c",(function(){return d})),i.d(t,"f",(function(){return h})),i.d(t,"d",(function(){return u})),i.d(t,"g",(function(){return g}));var n=i("3fa4");const o="undefined"!==typeof 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 c(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function d(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 h(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("f20c").Buffer)},c225:function(e,t,i){"use strict";var n=i("83ec"),o=i("e244"),s=i("6043"),r=i("f0db"),a=i("55ab"),l=i("8fed"),c=i("bd77"),d=i("ac97"),h=i("fe32"),u=i("5a43"),g=i("eee7"),f=i("fbcf"),m=i("c673"),p=i("45ad"),_=i("7f82"),b=i("4d82"),v=i("ca2b"),w=i("3e1a"),C=i("f0f1"),y=i("bf1d"),S=i("0ef1"),x=i("42b1"),L=i("b896"),k=i("11b0"),E=i("69f1"),D=i("7d86"),N=i("986e"),I=i("5350"),T=i("fd3f"),M=i("76b2"),O=i("1810"),A=i("aca4"),R=i("6baf"),P=i("63ef"),F=i("35d6"),W=i("8aa3").forEach,B=I("hidden"),V="Symbol",H="prototype",z=O("toPrimitive"),U=F.set,K=F.getterFor(V),j=Object[H],q=o.Symbol,$=s("JSON","stringify"),G=x.f,Y=L.f,X=y.f,Z=k.f,Q=N("symbols"),J=N("op-symbols"),ee=N("string-to-symbol-registry"),te=N("symbol-to-string-registry"),ie=N("wks"),ne=o.QObject,oe=!ne||!ne[H]||!ne[H].findChild,se=a&&d((function(){return 7!=v(Y({},"a",{get:function(){return Y(this,"a",{value:7}).a}})).a}))?function(e,t,i){var n=G(j,t);n&&delete j[t],Y(e,t,i),n&&e!==j&&Y(j,t,n)}:Y,re=function(e,t){var i=Q[e]=v(q[H]);return U(i,{type:V,tag:e,description:t}),a||(i.description=t),i},ae=c?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof q},le=function(e,t,i){e===j&&le(J,t,i),f(e);var n=_(t,!0);return f(i),h(Q,n)?(i.enumerable?(h(e,B)&&e[B][n]&&(e[B][n]=!1),i=v(i,{enumerable:b(0,!1)})):(h(e,B)||Y(e,B,b(1,{})),e[B][n]=!0),se(e,n,i)):Y(e,n,i)},ce=function(e,t){f(e);var i=p(t),n=w(i).concat(fe(i));return W(n,(function(t){a&&!he.call(i,t)||le(e,t,i[t])})),e},de=function(e,t){return void 0===t?v(e):ce(v(e),t)},he=function(e){var t=_(e,!0),i=Z.call(this,t);return!(this===j&&h(Q,t)&&!h(J,t))&&(!(i||!h(this,t)||!h(Q,t)||h(this,B)&&this[B][t])||i)},ue=function(e,t){var i=p(e),n=_(t,!0);if(i!==j||!h(Q,n)||h(J,n)){var o=G(i,n);return!o||!h(Q,n)||h(i,B)&&i[B][n]||(o.enumerable=!0),o}},ge=function(e){var t=X(p(e)),i=[];return W(t,(function(e){h(Q,e)||h(T,e)||i.push(e)})),i},fe=function(e){var t=e===j,i=X(t?J:p(e)),n=[];return W(i,(function(e){!h(Q,e)||t&&!h(j,e)||n.push(Q[e])})),n};if(l||(q=function(){if(this instanceof q)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=M(e),i=function(e){this===j&&i.call(J,e),h(this,B)&&h(this[B],t)&&(this[B][t]=!1),se(this,t,b(1,e))};return a&&oe&&se(j,t,{configurable:!0,set:i}),re(t,e)},D(q[H],"toString",(function(){return K(this).tag})),D(q,"withoutSetter",(function(e){return re(M(e),e)})),k.f=he,L.f=le,x.f=ue,C.f=y.f=ge,S.f=fe,A.f=function(e){return re(O(e),e)},a&&(Y(q[H],"description",{configurable:!0,get:function(){return K(this).description}}),r||D(j,"propertyIsEnumerable",he,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:q}),W(w(ie),(function(e){R(e)})),n({target:V,stat:!0,forced:!l},{for:function(e){var t=String(e);if(h(ee,t))return ee[t];var i=q(t);return ee[t]=i,te[i]=t,i},keyFor:function(e){if(!ae(e))throw TypeError(e+" is not a symbol");if(h(te,e))return te[e]},useSetter:function(){oe=!0},useSimple:function(){oe=!1}}),n({target:"Object",stat:!0,forced:!l,sham:!a},{create:de,defineProperty:le,defineProperties:ce,getOwnPropertyDescriptor:ue}),n({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:ge,getOwnPropertySymbols:fe}),n({target:"Object",stat:!0,forced:d((function(){S.f(1)}))},{getOwnPropertySymbols:function(e){return S.f(m(e))}}),$){var me=!l||d((function(){var e=q();return"[null]"!=$([e])||"{}"!=$({a:e})||"{}"!=$(Object(e))}));n({target:"JSON",stat:!0,forced:me},{stringify:function(e,t,i){var n,o=[e],s=1;while(arguments.length>s)o.push(arguments[s++]);if(n=t,(g(t)||void 0!==e)&&!ae(e))return u(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!ae(t))return t}),o[1]=t,$.apply(null,o)}})}q[H][z]||E(q[H],z,q[H].valueOf),P(q,V),T[B]=!0},c243:function(e,t,i){var n=i("c673"),o=Math.floor,s="".replace,r=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,i,l,c,d){var h=i+e.length,u=l.length,g=a;return void 0!==c&&(c=n(c),g=r),s.call(d,g,(function(n,s){var r;switch(s.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,i);case"'":return t.slice(h);case"<":r=c[s.slice(1,-1)];break;default:var a=+s;if(0===a)return n;if(a>u){var d=o(a/10);return 0===d?n:d<=u?void 0===l[d-1]?s.charAt(1):l[d-1]+s.charAt(1):n}r=l[a-1]}return void 0===r?"":r}))}},c293:function(module,__webpack_exports__,__webpack_require__){"use strict";var _utils_monaco_editor__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("d895");__webpack_exports__["a"]={name:"config-custom",components:{MonacoEditor:_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_0__["a"]},props:["data"],data:function(){return{params:this.data.params||{},event:this.data.event||{},options:{minimap:{enabled:!1}}}},methods:{},watch:{"data.params":function(e){this.params=e||{}},"data.event":function(e){this.event=e||{}},params:function params(val){try{this.data.params=eval("("+val+")")}catch(e){}},event:function event(val){try{this.data.event=eval("("+val+")")}catch(e){}}}}},c3b4:function(e,t,i){var n=i("10b1");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("77038fc2",n,!0,{sourceMap:!1,shadowMode:!1})},c401:function(e,t){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},c55c:function(e,t,i){var n=i("ac97"),o=i("d554"),s="​…᠎";e.exports=function(e){return n((function(){return!!o[e]()||s[e]()!=s||o[e].name!==e}))}},c673:function(e,t,i){var n=i("0874");e.exports=function(e){return Object(n(e))}},c6b4:function(e,t,i){var n=i("6aad");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("1a9cb28d",n,!0,{sourceMap:!1,shadowMode:!1})},c732:function(e,t,i){var n=i("55ab"),o=i("b896"),s=i("fbcf"),r=i("3e1a");e.exports=n?Object.defineProperties:function(e,t){s(e);var i,n=r(t),a=n.length,l=0;while(a>l)o.f(e,i=n[l++],t[i]);return e}},c8ed:function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(n){"object"===typeof window&&(i=window)}e.exports=i},c901:function(e,t,i){var n=i("f39a");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("635cd606",n,!0,{sourceMap:!1,shadowMode:!1})},c91b:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-text-button{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;padding:4px;text-align:center;cursor:pointer;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled{opacity:.4;cursor:default}.monaco-text-button>.codicon{margin:0 .2em;color:inherit!important}.monaco-button-dropdown{display:-webkit-box;display:-ms-flexbox;display:flex}.monaco-button-dropdown>.monaco-dropdown-button{margin-left:1px}",""]),e.exports=t},ca23:function(e,t,i){var n=i("eee7"),o=i("13a8");e.exports=function(e,t,i){var s,r;return o&&"function"==typeof(s=t.constructor)&&s!==i&&n(r=s.prototype)&&r!==i.prototype&&o(e,r),e}},ca2b:function(e,t,i){var n,o=i("fbcf"),s=i("c732"),r=i("e629"),a=i("fd3f"),l=i("a780"),c=i("f146"),d=i("5350"),h=">",u="<",g="prototype",f="script",m=d("IE_PROTO"),p=function(){},_=function(e){return u+f+h+e+u+"/"+f+h},b=function(e){e.write(_("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){var e,t=c("iframe"),i="java"+f+":";return t.style.display="none",l.appendChild(t),t.src=String(i),e=t.contentWindow.document,e.open(),e.write(_("document.F=Object")),e.close(),e.F},w=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(t){}w=n?b(n):v();var e=r.length;while(e--)delete w[g][r[e]];return w()};a[m]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(p[g]=o(e),i=new p,p[g]=null,i[m]=e):i=w(),void 0===t?i:s(i,t)}},ca84:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".el-tag[data-v-1938f570]{vertical-align:top}.el-tag+.el-tag[data-v-1938f570],.input-new-tag[data-v-1938f570]{margin-left:5px}.input-new-tag[data-v-1938f570]{width:90px;vertical-align:bottom}.color-picker[data-v-1938f570]{left:10px;vertical-align:top}",""]),e.exports=t},cc1a:function(e,t,i){var n=i("11e2");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("52b97b55",n,!0,{sourceMap:!1,shadowMode:!1})},ce47:function(e,t,i){var n=i("80db"),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},d30c:function(e,t,i){"use strict";var n=i("6043"),o=i("b896"),s=i("1810"),r=i("55ab"),a=s("species");e.exports=function(e){var t=n(e),i=o.f;r&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},d31d:function(e,t,i){"use strict";var n,o,s,r,a=i("83ec"),l=i("f0db"),c=i("e244"),d=i("6043"),h=i("fc9a"),u=i("7d86"),g=i("6161"),f=i("63ef"),m=i("d30c"),p=i("eee7"),_=i("7f17"),b=i("d6e4"),v=i("9550"),w=i("d75f"),C=i("59cf"),y=i("a55b"),S=i("59e5").set,x=i("f652"),L=i("3073"),k=i("4fe1"),E=i("fc01"),D=i("53ff"),N=i("35d6"),I=i("a056"),T=i("1810"),M=i("f79e"),O=i("2c21"),A=T("species"),R="Promise",P=N.get,F=N.set,W=N.getterFor(R),B=h,V=c.TypeError,H=c.document,z=c.process,U=d("fetch"),K=E.f,j=K,q=!!(H&&H.createEvent&&c.dispatchEvent),$="function"==typeof PromiseRejectionEvent,G="unhandledrejection",Y="rejectionhandled",X=0,Z=1,Q=2,J=1,ee=2,te=I(R,(function(){var e=v(B)!==String(B);if(!e){if(66===O)return!0;if(!M&&!$)return!0}if(l&&!B.prototype["finally"])return!0;if(O>=51&&/native code/.test(B))return!1;var t=B.resolve(1),i=function(e){e((function(){}),(function(){}))},n=t.constructor={};return n[A]=i,!(t.then((function(){}))instanceof i)})),ie=te||!C((function(e){B.all(e)["catch"]((function(){}))})),ne=function(e){var t;return!(!p(e)||"function"!=typeof(t=e.then))&&t},oe=function(e,t){if(!e.notified){e.notified=!0;var i=e.reactions;x((function(){var n=e.value,o=e.state==Z,s=0;while(i.length>s){var r,a,l,c=i[s++],d=o?c.ok:c.fail,h=c.resolve,u=c.reject,g=c.domain;try{d?(o||(e.rejection===ee&&le(e),e.rejection=J),!0===d?r=n:(g&&g.enter(),r=d(n),g&&(g.exit(),l=!0)),r===c.promise?u(V("Promise-chain cycle")):(a=ne(r))?a.call(r,h,u):h(r)):u(n)}catch(f){g&&!l&&g.exit(),u(f)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&re(e)}))}},se=function(e,t,i){var n,o;q?(n=H.createEvent("Event"),n.promise=t,n.reason=i,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:i},!$&&(o=c["on"+e])?o(n):e===G&&k("Unhandled promise rejection",i)},re=function(e){S.call(c,(function(){var t,i=e.facade,n=e.value,o=ae(e);if(o&&(t=D((function(){M?z.emit("unhandledRejection",n,i):se(G,i,n)})),e.rejection=M||ae(e)?ee:J,t.error))throw t.value}))},ae=function(e){return e.rejection!==J&&!e.parent},le=function(e){S.call(c,(function(){var t=e.facade;M?z.emit("rejectionHandled",t):se(Y,t,e.value)}))},ce=function(e,t,i){return function(n){e(t,n,i)}},de=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=Q,oe(e,!0))},he=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw V("Promise can't be resolved itself");var n=ne(t);n?x((function(){var i={done:!1};try{n.call(t,ce(he,i,e),ce(de,i,e))}catch(o){de(i,o,e)}})):(e.value=t,e.state=Z,oe(e,!1))}catch(o){de({done:!1},o,e)}}};te&&(B=function(e){b(this,B,R),_(e),n.call(this);var t=P(this);try{e(ce(he,t),ce(de,t))}catch(i){de(t,i)}},n=function(e){F(this,{type:R,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:X,value:void 0})},n.prototype=g(B.prototype,{then:function(e,t){var i=W(this),n=K(y(this,B));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=M?z.domain:void 0,i.parent=!0,i.reactions.push(n),i.state!=X&&oe(i,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new n,t=P(e);this.promise=e,this.resolve=ce(he,t),this.reject=ce(de,t)},E.f=K=function(e){return e===B||e===s?new o(e):j(e)},l||"function"!=typeof h||(r=h.prototype.then,u(h.prototype,"then",(function(e,t){var i=this;return new B((function(e,t){r.call(i,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof U&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return L(B,U.apply(c,arguments))}}))),a({global:!0,wrap:!0,forced:te},{Promise:B}),f(B,R,!1,!0),m(R),s=d(R),a({target:R,stat:!0,forced:te},{reject:function(e){var t=K(this);return t.reject.call(void 0,e),t.promise}}),a({target:R,stat:!0,forced:l||te},{resolve:function(e){return L(l&&this===s?B:this,e)}}),a({target:R,stat:!0,forced:ie},{all:function(e){var t=this,i=K(t),n=i.resolve,o=i.reject,s=D((function(){var i=_(t.resolve),s=[],r=0,a=1;w(e,(function(e){var l=r++,c=!1;s.push(void 0),a++,i.call(t,e).then((function(e){c||(c=!0,s[l]=e,--a||n(s))}),o)})),--a||n(s)}));return s.error&&o(s.value),i.promise},race:function(e){var t=this,i=K(t),n=i.reject,o=D((function(){var o=_(t.resolve);w(e,(function(e){o.call(t,e).then(i.resolve,n)}))}));return o.error&&n(o.value),i.promise}})},d362:function(e,t,i){"use strict";var n=i("55ab"),o=i("ac97"),s=i("3e1a"),r=i("0ef1"),a=i("11b0"),l=i("c673"),c=i("b4fd"),d=Object.assign,h=Object.defineProperty;e.exports=!d||o((function(){if(n&&1!==d({b:1},d(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),o="abcdefghijklmnopqrst";return e[i]=7,o.split("").forEach((function(e){t[e]=e})),7!=d({},e)[i]||s(d({},t)).join("")!=o}))?function(e,t){var i=l(e),o=arguments.length,d=1,h=r.f,u=a.f;while(o>d){var g,f=c(arguments[d++]),m=h?s(f).concat(h(f)):s(f),p=m.length,_=0;while(p>_)g=m[_++],n&&!u.call(f,g)||(i[g]=f[g])}return i}:d},d53b:function(e,t,i){var n=i("6965"),o=i("c401"),s=i("1810"),r=s("toStringTag"),a="Arguments"==o(function(){return arguments}()),l=function(e,t){try{return e[t]}catch(i){}};e.exports=n?o:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=l(t=Object(e),r))?i:a?o(t):"Object"==(n=o(t))&&"function"==typeof t.callee?"Arguments":n}},d543:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));i("fa89");function n(e,t,i,n,o,s,r){try{var a=e[s](r),l=a.value}catch(c){return void i(c)}a.done?t(l):Promise.resolve(l).then(n,o)}function o(e){return function(){var t=this,i=arguments;return new Promise((function(o,s){var r=e.apply(t,i);function a(e){n(r,o,s,a,l,"next",e)}function l(e){n(r,o,s,a,l,"throw",e)}a(void 0)}))}}},d554:function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},d557:function(e,t,i){var n=i("312a");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("7bb72351",n,!0,{sourceMap:!1,shadowMode:!1})},d6e4:function(e,t){e.exports=function(e,t,i){if(!(e instanceof t))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return e}},d6ed:function(e,t,i){var n=i("7f17");e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 0:return function(){return e.call(t)};case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,o){return e.call(t,i,n,o)}}return function(){return e.apply(t,arguments)}}},d75f:function(e,t,i){var n=i("fbcf"),o=i("a53d"),s=i("ce47"),r=i("d6ed"),a=i("6023"),l=i("dc8c"),c=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,i){var d,h,u,g,f,m,p,_=i&&i.that,b=!(!i||!i.AS_ENTRIES),v=!(!i||!i.IS_ITERATOR),w=!(!i||!i.INTERRUPTED),C=r(t,_,1+b+w),y=function(e){return d&&l(d),new c(!0,e)},S=function(e){return b?(n(e),w?C(e[0],e[1],y):C(e[0],e[1])):w?C(e,y):C(e)};if(v)d=e;else{if(h=a(e),"function"!=typeof h)throw TypeError("Target is not iterable");if(o(h)){for(u=0,g=s(e.length);g>u;u++)if(f=S(e[u]),f&&f instanceof c)return f;return new c(!1)}d=h.call(e)}m=d.next;while(!(p=m.call(d)).done){try{f=S(p.value)}catch(x){throw l(d),x}if("object"==typeof f&&f&&f instanceof c)return f}return new c(!1)}},d80d:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"widget-config"},[this.data&&Object.keys(this.data).length>0?i("el-form",{attrs:{"label-suffix":":",labelPosition:"left",labelWidth:"90px",size:"small"}},[i("el-collapse",{model:{value:e.collapse,callback:function(t){e.collapse=t},expression:"collapse"}},[i("el-collapse-item",{attrs:{name:"1",title:"基本属性"}},[e.data.type&&!e.data.component?i("el-form-item",{attrs:{label:"类型"}},[i("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型"},on:{change:e.handleChangeType},model:{value:e.data.type,callback:function(t){e.$set(e.data,"type",t)},expression:"data.type"}},e._l(e.fields,(function(t){return i("el-option-group",{key:t.title,attrs:{label:t.title}},e._l(t.list,(function(e){return i("el-option",{key:e.type,attrs:{label:e.label,value:e.type}})})),1)})),1)],1):e._e(),i("el-form-item",{attrs:{label:"属性值"}},[i("el-input",{attrs:{clearable:"",placeholder:"属性值"},model:{value:e.data.prop,callback:function(t){e.$set(e.data,"prop",t)},expression:"data.prop"}})],1),i("el-form-item",{attrs:{label:"标题"}},[i("el-input",{attrs:{clearable:"",placeholder:"标题"},model:{value:e.data.label,callback:function(t){e.$set(e.data,"label",t)},expression:"data.label"}})],1),e.data.subfield?i("el-form-item",{attrs:{label:"宽度"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{"controls-position":"right",placeholder:"宽度",min:100},model:{value:e.data.width,callback:function(t){e.$set(e.data,"width",t)},expression:"data.width"}})],1):e._e(),e.data.subfield||["group"].includes(e.data.type)?e._e():i("el-form-item",{attrs:{label:"表单栅格"}},[i("el-input-number",{staticStyle:{width:"100%"},attrs:{"controls-position":"right",placeholder:"表单栅格",min:8,max:24},model:{value:e.data.span,callback:function(t){e.$set(e.data,"span",t)},expression:"data.span"}})],1),["cascader","checkbox","radio","select","tree","upload","img","array","slider","timerange","daterange","datetimerange"].includes(e.data.type)?i("el-form-item",{attrs:{label:"数据类型"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/doc/dataType",target:"_blank"}},[e._v("数据类型 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-select",{attrs:{placeholder:"数据类型",clearable:""},model:{value:e.data.dataType,callback:function(t){e.$set(e.data,"dataType",t)},expression:"data.dataType"}},[i("el-option",{attrs:{label:"String",value:"string"}}),i("el-option",{attrs:{label:"Number",value:"number"}}),i("el-option",{attrs:{label:"Array",value:"array"}})],1)],2):e._e(),e.data.type&&!e.data.component?i("el-form-item",{attrs:{label:"深结构"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/doc/form/form-bind",target:"_blank"}},[e._v("深结构 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-input",{attrs:{clearable:"",placeholder:"深结构"},model:{value:e.data.bind,callback:function(t){e.$set(e.data,"bind",t)},expression:"data.bind"}})],2):e._e(),i("el-form-item",{attrs:{label:"字段提示"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/doc/form/form-tip",target:"_blank"}},[e._v("字段提示 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-input",{attrs:{clearable:"",placeholder:"字段提示"},model:{value:e.data.tip,callback:function(t){e.$set(e.data,"tip",t)},expression:"data.tip"}})],2),e.data.tip&&!["upload"].includes(e.data.type)?i("el-form-item",{attrs:{label:"字段提示位置","label-width":"110px"}},[i("el-select",{attrs:{placeholder:"字段提示位置",clearable:""},model:{value:e.data.tipPlacement,callback:function(t){e.$set(e.data,"tipPlacement",t)},expression:"data.tipPlacement"}},[i("el-option",{attrs:{label:"上",value:"top"}}),i("el-option",{attrs:{label:"下",value:"bottom"}}),i("el-option",{attrs:{label:"左",value:"left"}}),i("el-option",{attrs:{label:"右",value:"right"}})],1)],1):e._e(),i("el-form-item",{attrs:{label:"标题提示"}},[i("template",{slot:"label"},[i("el-link",{attrs:{underline:!1,href:"https://avuejs.com/doc/form/form-tip",target:"_blank"}},[e._v("标题提示 "),i("i",{staticClass:"el-icon-question"})])],1),i("el-input",{attrs:{clearable:"",placeholder:"标题提示"},model:{value:e.data.labelTip,callback:function(t){e.$set(e.data,"labelTip",t)},expression:"data.labelTip"}})],2),e.data.labelTip&&!["upload"].includes(e.data.type)?i("el-form-item",{attrs:{label:"标题提示位置","label-width":"110px"}},[i("el-select",{attrs:{placeholder:"标题提示位置",clearable:""},model:{value:e.data.labelTipPlacement,callback:function(t){e.$set(e.data,"labelTipPlacement",t)},expression:"data.labelTipPlacement"}},[i("el-option",{attrs:{label:"上",value:"top"}}),i("el-option",{attrs:{label:"下",value:"bottom"}}),i("el-option",{attrs:{label:"左",value:"left"}}),i("el-option",{attrs:{label:"右",value:"right"}})],1)],1):e._e(),["color","dynamic","group","ueditor","upload","map"].includes(e.data.type)?e._e():i("el-form-item",{attrs:{label:"默认值"}},[e.defaultValues&&e.defaultValues[e.data.type]?[i("el-select",{attrs:{"allow-create":"",clearable:"",filterable:"",placeholder:"默认值"},model:{value:e.data.value,callback:function(t){e.$set(e.data,"value",t)},expression:"data.value"}},e._l(e.defaultValues[e.data.type],(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)]:[i("el-input",{attrs:{clearable:"",placeholder:"默认值"},model:{value:e.data.value,callback:function(t){e.$set(e.data,"value",t)},expression:"data.value"}})]],2),i(e.getComponent,{tag:"component",attrs:{data:e.data,"default-values":e.defaultValues}})],1),["group"].includes(e.data.type)?e._e():i("el-collapse-item",{attrs:{name:"2",title:"事件属性"}},[i("config-event",{attrs:{data:e.data}})],1)],1)],1):i("avue-empty",{staticStyle:{"margin-top":"100%"},attrs:{desc:"拖拽字段进行配置"}})],1)},o=[],s=(i("eb46"),i("2f62"),i("fa89"),i("d31d"),i("f96e"),i("fc08"),i("d543")),r=i("1e33"),a=["year","month","week","date","datetime","time","daterange","timerange","datetimerange","dates"],l={name:"widget-config",props:["data","defaultValues"],computed:{getComponent:function(){var e="config-",t=this.data,i=t.type,n=t.component;if((!i||n)&&"ueditor"!=i)return e+"custom";var o="input";return o=[void 0,"input","password","url"].includes(i)?"input":a.includes(i)?"date":["array","img"].includes(i)?"array":["tree","cascader"].includes(i)?"tree":["radio","checkbox","select"].includes(i)?"select":i,e+o}},data:function(){return{fields:r["a"],collapse:["1","2"]}},methods:{handleChangeType:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function i(){var n,o,s;return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(!e){i.next=6;break}return i.next=3,t.getConfigByType(e);case 3:for(o in n=i.sent,n.prop=t.data.prop,n)n&&Object.prototype.hasOwnProperty.call(n,o)&&!["icon","label","span"].includes(o)&&(s=n[o],t.$set(t.data,o,s));case 6:case"end":return i.stop()}}),i)})))()},getConfigByType:function(e){return new Promise((function(t,i){r["a"].forEach((function(i){i.list.forEach((function(i){i.type==e&&t(i)}))})),i()}))}}},c=l,d=i("e3d4"),h=Object(d["a"])(c,n,o,!1,null,null,null);t["a"]=h.exports},d85b:function(e,t){e.exports={}},d895:function(e,t,i){"use strict";i("085b"),i("99ab");var n=i("863c"),o=i("5491"),s=i("7eca"),r=i("7f36"),a={},l={},c=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 l[t]||(l[t]=new e(t)),l[t]},e.prototype.whenLoaded=function(){return this._lazyLoadPromise},e.prototype.load=function(){var e=this;return this._loadingTriggered||(this._loadingTriggered=!0,a[this._languageId].loader().then((function(t){return e._lazyLoadPromiseResolve(t)}),(function(t){return e._lazyLoadPromiseReject(t)}))),this._lazyLoadPromise},e}();function d(e){var t=e.id;a[t]=e,r["a"].register(e);var i=c.getOrCreate(t);r["a"].setMonarchTokensProvider(t,i.whenLoaded().then((function(e){return e.language}))),r["a"].onLanguage(t,(function(){i.load().then((function(e){r["a"].setLanguageConfiguration(t,e.conf)}))}))}d({id:"javascript",extensions:[".js",".es6",".jsx",".mjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:function(){return i.e(1).then(i.bind(null,"f8f9"))}});var h=i("826e");function u(){}t["a"]={name:"MonacoEditor",props:{diffEditor:{type:Boolean,default:!1},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},original:String,value:[String,Object],language:{type:String,default:"javascript"},theme:{type:String,default:"vs"},readOnly:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},editorMounted:{type:Function,default:u},editorBeforeMount:{type:Function,default:u},keyIndex:{type:String}},watch:{options:{deep:!0,handler:function(e){this.editor&&this.editor.updateOptions(e)}},keyIndex:function(){var e=this.value;"object"==Object(o["a"])(e)&&(e=Object(h["a"])(e)),this.editor&&e!==this._getValue()&&this._setValue(e)},language:function(){if(this.editor)if(this.diffEditor){var e=this.editor.getModel(),t=e.original,i=e.modified;s["editor"].setModelLanguage(t,this.language),s["editor"].setModelLanguage(i,this.language)}else s["editor"].setModelLanguage(this.editor.getModel(),this.language)},theme:function(){this.editor&&s["editor"].setTheme(this.theme)},style:function(){var e=this;this.editor&&this.$nextTick((function(){e.editor.layout()}))}},computed:{style:function(){return{width:/^\d+$/.test(this.width)?"".concat(this.width,"px"):this.width,height:/^\d+$/.test(this.height)?"".concat(this.height,"px"):this.height}}},mounted:function(){this.initMonaco()},beforeDestroy:function(){this.editor&&this.editor.dispose()},render:function(){var e=arguments[0];return e("div",{class:"monaco_editor_container",style:this.style})},methods:{initMonaco:function(){var e=this.value,t=this.language,i=this.theme,o=this.readOnly,r=this.options;Object.assign(r,this._editorBeforeMount()),this.editor=s["editor"][this.diffEditor?"createDiffEditor":"create"](this.$el,Object(n["a"])({value:"string"==typeof e?e:Object(h["a"])(e),language:t,theme:i,readOnly:o},r)),this.diffEditor&&this._setModel(this.value,this.original),this._editorMounted(this.editor)},_getEditor:function(){return this.editor?this.diffEditor?this.editor.modifiedEditor:this.editor:null},_setModel:function(e,t){var i=this.language,n=s["editor"].createModel(t,i),o=s["editor"].createModel(e,i);this.editor.setModel({original:n,modified:o})},_setValue:function(e){var t=this._getEditor();if(t)return t.setValue(e)},_getValue:function(){var e=this._getEditor();return e?e.getValue():""},_editorBeforeMount:function(){var e=this.editorBeforeMount(s);return e||{}},_editorMounted:function(e){var t=this;this.editorMounted(e,s),this.diffEditor?e.onDidUpdateDiff((function(e){var i=t._getValue();t._emitChange(i,e)})):e.onDidChangeModelContent((function(e){var i=t._getValue();t._emitChange(i,e)}))},_emitChange:function(e,t){this.$emit("change",e,t),this.$emit("input",e)}}}},d927:function(e,t,i){"use strict";var n=i("83ec"),o=i("3352"),s=i("80db"),r=i("ce47"),a=i("c673"),l=i("f152"),c=i("acd4"),d=i("72d4"),h=d("splice"),u=Math.max,g=Math.min,f=9007199254740991,m="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!h},{splice:function(e,t){var i,n,d,h,p,_,b=a(this),v=r(b.length),w=o(e,v),C=arguments.length;if(0===C?i=n=0:1===C?(i=0,n=v-w):(i=C-2,n=g(u(s(t),0),v-w)),v+i-n>f)throw TypeError(m);for(d=l(b,n),h=0;hv-n+i;h--)delete b[h-1]}else if(i>n)for(h=v-n;h>w;h--)p=h+n-1,_=h+i-1,p in b?b[_]=b[p]:delete b[_];for(h=0;h=c?e?"":void 0:(s=a.charCodeAt(l),s<55296||s>56319||l+1===c||(r=a.charCodeAt(l+1))<56320||r>57343?e?a.charAt(l):s:e?a.slice(l,l+2):r-56320+(s-55296<<10)+65536)}}},"0390":function(e,t,i){"use strict";var n=i("02f4")(!0);e.exports=function(e,t,i){return t+(i?n(e,t).length:1)}},"0bfb":function(e,t,i){"use strict";var n=i("cb7c");e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"0d58":function(e,t,i){var n=i("ce10"),o=i("e11e");e.exports=Object.keys||function(e){return n(e,o)}},1495:function(e,t,i){var n=i("86cc"),o=i("cb7c"),s=i("0d58");e.exports=i("9e1e")?Object.defineProperties:function(e,t){o(e);var i,r=s(t),a=r.length,l=0;while(a>l)n.f(e,i=r[l++],t[i]);return e}},"214f":function(e,t,i){"use strict";i("b0c5");var n=i("2aba"),o=i("32e9"),s=i("79e5"),r=i("be13"),a=i("2b4c"),l=i("520a"),c=a("species"),d=!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$
")})),h=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2===i.length&&"a"===i[0]&&"b"===i[1]}();e.exports=function(e,t,i){var u=a(e),g=!s((function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})),f=g?!s((function(){var t=!1,i=/a/;return i.exec=function(){return t=!0,null},"split"===e&&(i.constructor={},i.constructor[c]=function(){return i}),i[u](""),!t})):void 0;if(!g||!f||"replace"===e&&!d||"split"===e&&!h){var m=/./[u],p=i(r,u,""[e],(function(e,t,i,n,o){return t.exec===l?g&&!o?{done:!0,value:m.call(t,i,n)}:{done:!0,value:e.call(i,t,n)}:{done:!1}})),_=p[0],b=p[1];n(String.prototype,e,_),o(RegExp.prototype,u,2==t?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}}},"230e":function(e,t,i){var n=i("d3f4"),o=i("7726").document,s=n(o)&&n(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},"23c6":function(e,t,i){var n=i("2d95"),o=i("2b4c")("toStringTag"),s="Arguments"==n(function(){return arguments}()),r=function(e,t){try{return e[t]}catch(i){}};e.exports=function(e){var t,i,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=r(t=Object(e),o))?i:s?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},2621:function(e,t){t.f=Object.getOwnPropertySymbols},"2aba":function(e,t,i){var n=i("7726"),o=i("32e9"),s=i("69a8"),r=i("ca5a")("src"),a=i("fa5b"),l="toString",c=(""+a).split(l);i("8378").inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,i,a){var l="function"==typeof i;l&&(s(i,"name")||o(i,"name",t)),e[t]!==i&&(l&&(s(i,r)||o(i,r,e[t]?""+e[t]:c.join(String(t)))),e===n?e[t]=i:a?e[t]?e[t]=i:o(e,t,i):(delete e[t],o(e,t,i)))})(Function.prototype,l,(function(){return"function"==typeof this&&this[r]||a.call(this)}))},"2aeb":function(e,t,i){var n=i("cb7c"),o=i("1495"),s=i("e11e"),r=i("613b")("IE_PROTO"),a=function(){},l="prototype",c=function(){var e,t=i("230e")("iframe"),n=s.length,o="<",r=">";t.style.display="none",i("fab2").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(o+"script"+r+"document.F=Object"+o+"/script"+r),e.close(),c=e.F;while(n--)delete c[l][s[n]];return c()};e.exports=Object.create||function(e,t){var i;return null!==e?(a[l]=n(e),i=new a,a[l]=null,i[r]=e):i=c(),void 0===t?i:o(i,t)}},"2b4c":function(e,t,i){var n=i("5537")("wks"),o=i("ca5a"),s=i("7726").Symbol,r="function"==typeof s,a=e.exports=function(e){return n[e]||(n[e]=r&&s[e]||(r?s:o)("Symbol."+e))};a.store=n},"2d00":function(e,t){e.exports=!1},"2d95":function(e,t){var i={}.toString;e.exports=function(e){return i.call(e).slice(8,-1)}},"2fdb":function(e,t,i){"use strict";var n=i("5ca1"),o=i("d2c8"),s="includes";n(n.P+n.F*i("5147")(s),"String",{includes:function(e){return!!~o(this,e,s).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},"32e9":function(e,t,i){var n=i("86cc"),o=i("4630");e.exports=i("9e1e")?function(e,t,i){return n.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},"38fd":function(e,t,i){var n=i("69a8"),o=i("4bf8"),s=i("613b")("IE_PROTO"),r=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?r:null}},"41a0":function(e,t,i){"use strict";var n=i("2aeb"),o=i("4630"),s=i("7f20"),r={};i("32e9")(r,i("2b4c")("iterator"),(function(){return this})),e.exports=function(e,t,i){e.prototype=n(r,{next:o(1,i)}),s(e,t+" Iterator")}},"456d":function(e,t,i){var n=i("4bf8"),o=i("0d58");i("5eda")("keys",(function(){return function(e){return o(n(e))}}))},4588:function(e,t){var i=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:i)(e)}},4630:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"4bf8":function(e,t,i){var n=i("be13");e.exports=function(e){return Object(n(e))}},5147:function(e,t,i){var n=i("2b4c")("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(i){try{return t[n]=!1,!"/./"[e](t)}catch(o){}}return!0}},"520a":function(e,t,i){"use strict";var n=i("0bfb"),o=RegExp.prototype.exec,s=String.prototype.replace,r=o,a="lastIndex",l=function(){var e=/a/,t=/b*/g;return o.call(e,"a"),o.call(t,"a"),0!==e[a]||0!==t[a]}(),c=void 0!==/()??/.exec("")[1],d=l||c;d&&(r=function(e){var t,i,r,d,h=this;return c&&(i=new RegExp("^"+h.source+"$(?!\\s)",n.call(h))),l&&(t=h[a]),r=o.call(h,e),l&&r&&(h[a]=h.global?r.index+r[0].length:t),c&&r&&r.length>1&&s.call(r[0],i,(function(){for(d=1;d1?arguments[1]:void 0)}}),i("9c6c")("includes")},6821:function(e,t,i){var n=i("626a"),o=i("be13");e.exports=function(e){return n(o(e))}},"69a8":function(e,t){var i={}.hasOwnProperty;e.exports=function(e,t){return i.call(e,t)}},"6a99":function(e,t,i){var n=i("d3f4");e.exports=function(e,t){if(!n(e))return e;var i,o;if(t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;if("function"==typeof(i=e.valueOf)&&!n(o=i.call(e)))return o;if(!t&&"function"==typeof(i=e.toString)&&!n(o=i.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},7333:function(e,t,i){"use strict";var n=i("0d58"),o=i("2621"),s=i("52a7"),r=i("4bf8"),a=i("626a"),l=Object.assign;e.exports=!l||i("79e5")((function(){var e={},t={},i=Symbol(),n="abcdefghijklmnopqrst";return e[i]=7,n.split("").forEach((function(e){t[e]=e})),7!=l({},e)[i]||Object.keys(l({},t)).join("")!=n}))?function(e,t){var i=r(e),l=arguments.length,c=1,d=o.f,h=s.f;while(l>c){var u,g=a(arguments[c++]),f=d?n(g).concat(d(g)):n(g),m=f.length,p=0;while(m>p)h.call(g,u=f[p++])&&(i[u]=g[u])}return i}:l},7726:function(e,t){var i=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},"77f1":function(e,t,i){var n=i("4588"),o=Math.max,s=Math.min;e.exports=function(e,t){return e=n(e),e<0?o(e+t,0):s(e,t)}},"79e5":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"7f20":function(e,t,i){var n=i("86cc").f,o=i("69a8"),s=i("2b4c")("toStringTag");e.exports=function(e,t,i){e&&!o(e=i?e:e.prototype,s)&&n(e,s,{configurable:!0,value:t})}},8378:function(e,t){var i=e.exports={version:"2.6.5"};"number"==typeof __e&&(__e=i)},"84f2":function(e,t){e.exports={}},"86cc":function(e,t,i){var n=i("cb7c"),o=i("c69a"),s=i("6a99"),r=Object.defineProperty;t.f=i("9e1e")?Object.defineProperty:function(e,t,i){if(n(e),t=s(t,!0),n(i),o)try{return r(e,t,i)}catch(a){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(e[t]=i.value),e}},"9b43":function(e,t,i){var n=i("d8e8");e.exports=function(e,t,i){if(n(e),void 0===t)return e;switch(i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,o){return e.call(t,i,n,o)}}return function(){return e.apply(t,arguments)}}},"9c6c":function(e,t,i){var n=i("2b4c")("unscopables"),o=Array.prototype;void 0==o[n]&&i("32e9")(o,n,{}),e.exports=function(e){o[n][e]=!0}},"9def":function(e,t,i){var n=i("4588"),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},"9e1e":function(e,t,i){e.exports=!i("79e5")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},a352:function(t,i){t.exports=e},a481:function(e,t,i){"use strict";var n=i("cb7c"),o=i("4bf8"),s=i("9def"),r=i("4588"),a=i("0390"),l=i("5f1b"),c=Math.max,d=Math.min,h=Math.floor,u=/\$([$&`']|\d\d?|<[^>]*>)/g,g=/\$([$&`']|\d\d?)/g,f=function(e){return void 0===e?e:String(e)};i("214f")("replace",2,(function(e,t,i,m){return[function(n,o){var s=e(this),r=void 0==n?void 0:n[t];return void 0!==r?r.call(n,s,o):i.call(String(s),n,o)},function(e,t){var o=m(i,e,this,t);if(o.done)return o.value;var h=n(e),u=String(this),g="function"===typeof t;g||(t=String(t));var _=h.global;if(_){var b=h.unicode;h.lastIndex=0}var v=[];while(1){var w=l(h,u);if(null===w)break;if(v.push(w),!_)break;var C=String(w[0]);""===C&&(h.lastIndex=a(u,s(h.lastIndex),b))}for(var y="",S=0,x=0;x=S&&(y+=u.slice(S,k)+T,S=k+L.length)}return y+u.slice(S)}];function p(e,t,n,s,r,a){var l=n+e.length,c=s.length,d=g;return void 0!==r&&(r=o(r),d=u),i.call(a,d,(function(i,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(l);case"<":a=r[o.slice(1,-1)];break;default:var d=+o;if(0===d)return i;if(d>c){var u=h(d/10);return 0===u?i:u<=c?void 0===s[u-1]?o.charAt(1):s[u-1]+o.charAt(1):i}a=s[d-1]}return void 0===a?"":a}))}}))},aae3:function(e,t,i){var n=i("d3f4"),o=i("2d95"),s=i("2b4c")("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==o(e))}},ac6a:function(e,t,i){for(var n=i("cadf"),o=i("0d58"),s=i("2aba"),r=i("7726"),a=i("32e9"),l=i("84f2"),c=i("2b4c"),d=c("iterator"),h=c("toStringTag"),u=l.Array,g={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},f=o(g),m=0;md)if(a=l[d++],a!=a)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===i)return e||d||0;return!e&&-1}}},c649:function(e,t,i){"use strict";(function(e){i.d(t,"c",(function(){return c})),i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return o})),i.d(t,"d",(function(){return l}));i("a481");function n(){return"undefined"!==typeof window?window.console:e.console}var o=n();function s(e){var t=Object.create(null);return function(i){var n=t[i];return n||(t[i]=e(i))}}var r=/-(\w)/g,a=s((function(e){return e.replace(r,(function(e,t){return t?t.toUpperCase():""}))}));function l(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function c(e,t,i){var n=0===i?e.children[0]:e.children[i-1].nextSibling;e.insertBefore(t,n)}}).call(this,i("c8ba"))},c69a:function(e,t,i){e.exports=!i("9e1e")&&!i("79e5")((function(){return 7!=Object.defineProperty(i("230e")("div"),"a",{get:function(){return 7}}).a}))},c8ba:function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(n){"object"===typeof window&&(i=window)}e.exports=i},ca5a:function(e,t){var i=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++i+n).toString(36))}},cadf:function(e,t,i){"use strict";var n=i("9c6c"),o=i("d53b"),s=i("84f2"),r=i("6821");e.exports=i("01f9")(Array,"Array",(function(e,t){this._t=r(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,i=this._i++;return!e||i>=e.length?(this._t=void 0,o(1)):o(0,"keys"==t?i:"values"==t?e[i]:[i,e[i]])}),"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},cb7c:function(e,t,i){var n=i("d3f4");e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},ce10:function(e,t,i){var n=i("69a8"),o=i("6821"),s=i("c366")(!1),r=i("613b")("IE_PROTO");e.exports=function(e,t){var i,a=o(e),l=0,c=[];for(i in a)i!=r&&n(a,i)&&c.push(i);while(t.length>l)n(a,i=t[l++])&&(~s(c,i)||c.push(i));return c}},d2c8:function(e,t,i){var n=i("aae3"),o=i("be13");e.exports=function(e,t,i){if(n(t))throw TypeError("String#"+i+" doesn't accept regex!");return String(o(e))}},d3f4:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},d53b:function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},d8e8:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},e11e:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},f559:function(e,t,i){"use strict";var n=i("5ca1"),o=i("9def"),s=i("d2c8"),r="startsWith",a=""[r];n(n.P+n.F*i("5147")(r),"String",{startsWith:function(e){var t=s(this,e,r),i=o(Math.min(arguments.length>1?arguments[1]:void 0,t.length)),n=String(e);return a?a.call(t,n,i):t.slice(i,i+n.length)===n}})},f6fd:function(e,t){(function(e){var t="currentScript",i=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(n){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(n.stack)||[!1])[1];for(e in i)if(i[e].src==t||"interactive"==i[e].readyState)return i[e];return null}}})})(document)},f751:function(e,t,i){var n=i("5ca1");n(n.S+n.F,"Object",{assign:i("7333")})},fa5b:function(e,t,i){e.exports=i("5537")("native-function-to-string",Function.toString)},fab2:function(e,t,i){var n=i("7726").document;e.exports=n&&n.documentElement},fb15:function(e,t,i){"use strict";var n;(i.r(t),"undefined"!==typeof window)&&(i("f6fd"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(i.p=n[1]));i("f751"),i("f559"),i("ac6a"),i("cadf"),i("456d");function o(e){if(Array.isArray(e))return e}function s(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var i=[],n=!0,o=!1,s=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done);n=!0)if(i.push(r.value),t&&i.length===t)break}catch(l){o=!0,s=l}finally{try{n||null==a["return"]||a["return"]()}finally{if(o)throw s}}return i}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i=s?o.length:o.indexOf(e)}));return i?r.filter((function(e){return-1!==e})):r}function w(e,t){var i=this;this.$nextTick((function(){return i.$emit(e.toLowerCase(),t)}))}function C(e){var t=this;return function(i){null!==t.realList&&t["onDrag"+e](i),w.call(t,e,i)}}function y(e){return["transition-group","TransitionGroup"].includes(e)}function S(e){if(!e||1!==e.length)return!1;var t=c(e,1),i=t[0].componentOptions;return!!i&&y(i.tag)}function x(e,t,i){return e[i]||(t[i]?t[i]():void 0)}function L(e,t,i){var n=0,o=0,s=x(t,i,"header");s&&(n=s.length,e=e?[].concat(g(s),g(e)):g(s));var r=x(t,i,"footer");return r&&(o=r.length,e=e?[].concat(g(e),g(r)):g(r)),{children:e,headerOffset:n,footerOffset:o}}function k(e,t){var i=null,n=function(e,t){i=_(i,e,t)},o=Object.keys(e).filter((function(e){return"id"===e||e.startsWith("data-")})).reduce((function(t,i){return t[i]=e[i],t}),{});if(n("attrs",o),!t)return i;var s=t.on,r=t.props,a=t.attrs;return n("on",s),n("props",r),Object.assign(i.attrs,a),i}var E=["Start","Add","Remove","Update","End"],D=["Choose","Unchoose","Sort","Filter","Clone"],N=["Move"].concat(E,D).map((function(e){return"on"+e})),I=null,T={options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:function(e){return e}},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},M={name:"draggable",inheritAttrs:!1,props:T,data:function(){return{transitionMode:!1,noneFunctionalComponentMode:!1}},render:function(e){var t=this.$slots.default;this.transitionMode=S(t);var i=L(t,this.$slots,this.$scopedSlots),n=i.children,o=i.headerOffset,s=i.footerOffset;this.headerOffset=o,this.footerOffset=s;var r=k(this.$attrs,this.componentData);return e(this.getTag(),r,n)},created:function(){null!==this.list&&null!==this.value&&p["b"].error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&p["b"].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&p["b"].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted:function(){var e=this;if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));var t={};E.forEach((function(i){t["on"+i]=C.call(e,i)})),D.forEach((function(i){t["on"+i]=w.bind(e,i)}));var i=Object.keys(this.$attrs).reduce((function(t,i){return t[Object(p["a"])(i)]=e.$attrs[i],t}),{}),n=Object.assign({},this.options,i,t,{onMove:function(t,i){return e.onDragMove(t,i)}});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new m.a(this.rootContainer,n),this.computeIndexes()},beforeDestroy:function(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer:function(){return this.transitionMode?this.$el.children[0]:this.$el},realList:function(){return this.list?this.list:this.value}},watch:{options:{handler:function(e){this.updateOptions(e)},deep:!0},$attrs:{handler:function(e){this.updateOptions(e)},deep:!0},realList:function(){this.computeIndexes()}},methods:{getIsFunctional:function(){var e=this._vnode.fnOptions;return e&&e.functional},getTag:function(){return this.tag||this.element},updateOptions:function(e){for(var t in e){var i=Object(p["a"])(t);-1===N.indexOf(i)&&this._sortable.option(i,e[t])}},getChildrenNodes:function(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;var e=this.$slots.default;return this.transitionMode?e[0].child.$slots.default:e},computeIndexes:function(){var e=this;this.$nextTick((function(){e.visibleIndexes=v(e.getChildrenNodes(),e.rootContainer.children,e.transitionMode,e.footerOffset)}))},getUnderlyingVm:function(e){var t=b(this.getChildrenNodes()||[],e);if(-1===t)return null;var i=this.realList[t];return{index:t,element:i}},getUnderlyingPotencialDraggableComponent:function(e){var t=e.__vue__;return t&&t.$options&&y(t.$options._componentTag)?t.$parent:!("realList"in t)&&1===t.$children.length&&"realList"in t.$children[0]?t.$children[0]:t},emitChanges:function(e){var t=this;this.$nextTick((function(){t.$emit("change",e)}))},alterList:function(e){if(this.list)e(this.list);else{var t=g(this.value);e(t),this.$emit("input",t)}},spliceList:function(){var e=arguments,t=function(t){return t.splice.apply(t,g(e))};this.alterList(t)},updatePosition:function(e,t){var i=function(i){return i.splice(t,0,i.splice(e,1)[0])};this.alterList(i)},getRelatedContextFromMoveEvent:function(e){var t=e.to,i=e.related,n=this.getUnderlyingPotencialDraggableComponent(t);if(!n)return{component:n};var o=n.realList,s={list:o,component:n};if(t!==i&&o&&n.getUnderlyingVm){var r=n.getUnderlyingVm(i);if(r)return Object.assign(r,s)}return s},getVmIndex:function(e){var t=this.visibleIndexes,i=t.length;return e>i-1?i:t[e]},getComponent:function(){return this.$slots.default[0].componentInstance},resetTransitionData:function(e){if(this.noTransitionOnDrag&&this.transitionMode){var t=this.getChildrenNodes();t[e].data=null;var i=this.getComponent();i.children=[],i.kept=void 0}},onDragStart:function(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),I=e.item},onDragAdd:function(e){var t=e.item._underlying_vm_;if(void 0!==t){Object(p["d"])(e.item);var i=this.getVmIndex(e.newIndex);this.spliceList(i,0,t),this.computeIndexes();var n={element:t,newIndex:i};this.emitChanges({added:n})}},onDragRemove:function(e){if(Object(p["c"])(this.rootContainer,e.item,e.oldIndex),"clone"!==e.pullMode){var t=this.context.index;this.spliceList(t,1);var i={element:this.context.element,oldIndex:t};this.resetTransitionData(t),this.emitChanges({removed:i})}else Object(p["d"])(e.clone)},onDragUpdate:function(e){Object(p["d"])(e.item),Object(p["c"])(e.from,e.item,e.oldIndex);var t=this.context.index,i=this.getVmIndex(e.newIndex);this.updatePosition(t,i);var n={element:this.context.element,oldIndex:t,newIndex:i};this.emitChanges({moved:n})},updateProperty:function(e,t){e.hasOwnProperty(t)&&(e[t]+=this.headerOffset)},computeFutureIndex:function(e,t){if(!e.element)return 0;var i=g(t.to.children).filter((function(e){return"none"!==e.style["display"]})),n=i.indexOf(t.related),o=e.component.getVmIndex(n),s=-1!==i.indexOf(I);return s||!t.willInsertAfter?o:o+1},onDragMove:function(e,t){var i=this.move;if(!i||!this.realList)return!0;var n=this.getRelatedContextFromMoveEvent(e),o=this.context,s=this.computeFutureIndex(n,e);Object.assign(o,{futureIndex:s});var r=Object.assign({},e,{relatedContext:n,draggedContext:o});return i(r,t)},onDragEnd:function(){this.computeIndexes(),I=null}}};"undefined"!==typeof window&&"Vue"in window&&window.Vue.component("draggable",M);var O=M;t["default"]=O}})["default"]}))},dbc3:function(e,t,i){var n=i("eb42");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("21a18477",n,!0,{sourceMap:!1,shadowMode:!1})},dc8c:function(e,t,i){var n=i("fbcf");e.exports=function(e){var t=e["return"];if(void 0!==t)return n(t.call(e)).value}},df3c:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".context-view{position:absolute;z-index:2500}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;z-index:2500;color:inherit}",""]),e.exports=t},df70:function(e,t,i){var n=i("139d");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("a4992a28",n,!0,{sourceMap:!1,shadowMode:!1})},df93:function(e,t,i){var n=i("e577");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("0e249fd5",n,!0,{sourceMap:!1,shadowMode:!1})},dff0:function(e,t,i){var n=i("8dab");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("24132abe",n,!0,{sourceMap:!1,shadowMode:!1})},e09a:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-icon-label{display:-webkit-box;display:-ms-flexbox;display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:0;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;-ms-flex-negative:0;flex-shrink:0}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;-webkit-box-flex:1;-ms-flex:1;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;padding:0 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}",""]),e.exports=t},e0e0:function(e,t,i){"use strict";var n=i("15b2").IteratorPrototype,o=i("ca2b"),s=i("4d82"),r=i("63ef"),a=i("d85b"),l=function(){return this};e.exports=function(e,t,i){var c=t+" Iterator";return e.prototype=o(n,{next:s(1,i)}),r(e,c,!1,!0),a[c]=l,e}},e244:function(e,t,i){(function(t){var i=function(e){return e&&e.Math==Math&&e};e.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,i("c8ed"))},e248:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".context-view .monaco-menu{min-width:130px}",""]),e.exports=t},e263:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}",""]),e.exports=t},e2da:function(e,t,i){"use strict";var n=i("45ad"),o=i("6e10"),s=i("d85b"),r=i("35d6"),a=i("325d"),l="Array Iterator",c=r.set,d=r.getterFor(l);e.exports=a(Array,"Array",(function(e,t){c(this,{type:l,target:n(e),index:0,kind:t})}),(function(){var e=d(this),t=e.target,i=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),s.Arguments=s.Array,o("keys"),o("values"),o("entries")},e3d4:function(e,t,i){"use strict";function n(e,t,i,n,o,s,r,a){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),r?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):o&&(l=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",(function(){return n}))},e3f4:function(e,t,i){(function(e){function i(e,t){for(var i=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),i++):i&&(e.splice(n,1),i--)}if(t)for(;i--;i)e.unshift("..");return e}function n(e){"string"!==typeof e&&(e+="");var t,i=0,n=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){i=t+1;break}}else-1===n&&(o=!1,n=t+1);return-1===n?"":e.slice(i,n)}function o(e,t){if(e.filter)return e.filter(t);for(var i=[],n=0;n=-1&&!n;s--){var r=s>=0?arguments[s]:e.cwd();if("string"!==typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,n="/"===r.charAt(0))}return t=i(o(t.split("/"),(function(e){return!!e})),!n).join("/"),(n?"/":"")+t||"."},t.normalize=function(e){var n=t.isAbsolute(e),r="/"===s(e,-1);return e=i(o(e.split("/"),(function(e){return!!e})),!n).join("/"),e||n||(e="."),e&&r&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,i){function n(e){for(var t=0;t=0;i--)if(""!==e[i])break;return t>i?[]:e.slice(t,i-t+1)}e=t.resolve(e).substr(1),i=t.resolve(i).substr(1);for(var o=n(e.split("/")),s=n(i.split("/")),r=Math.min(o.length,s.length),a=r,l=0;l=1;--s)if(t=e.charCodeAt(s),47===t){if(!o){n=s;break}}else o=!1;return-1===n?i?"/":".":i&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var i=n(e);return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,i=0,n=-1,o=!0,s=0,r=e.length-1;r>=0;--r){var a=e.charCodeAt(r);if(47!==a)-1===n&&(o=!1,n=r+1),46===a?-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)};var s="b"==="ab".substr(-1)?function(e,t,i){return e.substr(t,i)}:function(e,t,i){return t<0&&(t=e.length+t),e.substr(t,i)}}).call(this,i("2552"))},e4f5:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}",""]),e.exports=t},e577:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .view-ruler{position:absolute;top:0}",""]),e.exports=t},e5d9:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:transparent;-webkit-transition:opacity .1s linear;transition:opacity .1s linear}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{-webkit-transition:opacity .8s linear;transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;-webkit-box-shadow:#ddd 0 6px 6px -6px inset;box-shadow:inset 0 6px 6px -6px #ddd}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;-webkit-box-shadow:#ddd 6px 0 6px -6px inset;box-shadow:inset 6px 0 6px -6px #ddd}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{-webkit-box-shadow:#ddd 6px 6px 6px -6px inset;box-shadow:inset 6px 6px 6px -6px #ddd}.vs .monaco-scrollable-element>.scrollbar>.slider{background:hsla(0,0%,39.2%,.4)}.vs-dark .monaco-scrollable-element>.scrollbar>.slider{background:hsla(0,0%,47.5%,.4)}.hc-black .monaco-scrollable-element>.scrollbar>.slider{background:rgba(111,195,223,.6)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:hsla(0,0%,39.2%,.7)}.hc-black .monaco-scrollable-element>.scrollbar>.slider:hover{background:rgba(111,195,223,.8)}.monaco-scrollable-element>.scrollbar>.slider.active{background:rgba(0,0,0,.6)}.vs-dark .monaco-scrollable-element>.scrollbar>.slider.active{background:hsla(0,0%,74.9%,.4)}.hc-black .monaco-scrollable-element>.scrollbar>.slider.active{background:#6fc3df}.vs-dark .monaco-scrollable-element .shadow.top{-webkit-box-shadow:none;box-shadow:none}.vs-dark .monaco-scrollable-element .shadow.left{-webkit-box-shadow:#000 6px 0 6px -6px inset;box-shadow:inset 6px 0 6px -6px #000}.vs-dark .monaco-scrollable-element .shadow.top.left{-webkit-box-shadow:#000 6px 6px 6px -6px inset;box-shadow:inset 6px 6px 6px -6px #000}.hc-black .monaco-scrollable-element .shadow.left,.hc-black .monaco-scrollable-element .shadow.top,.hc-black .monaco-scrollable-element .shadow.top.left{-webkit-box-shadow:none;box-shadow:none}",""]),e.exports=t},e629:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},e635:function(e,t,i){var n=i("c91b");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("0091cd35",n,!0,{sourceMap:!1,shadowMode:!1})},e669:function(module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es_array_find_index__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("b105"),core_js_modules_es_array_find_index__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_find_index__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("eb46"),core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("2f62"),core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_array_includes__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("d927"),core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_splice__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("085b"),core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_number_constructor__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("fa89"),core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("d31d"),core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("f96e"),core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each__WEBPACK_IMPORTED_MODULE_7__),_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("5491"),regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("fc08"),regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(regenerator_runtime_runtime__WEBPACK_IMPORTED_MODULE_9__),_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("d543"),_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("863c"),_fieldsConfig_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("1e33"),_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("826e"),_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("d895"),_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("3a5d"),_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_15__),_mixins_history__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("2790"),vuedraggable__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("d958"),vuedraggable__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(vuedraggable__WEBPACK_IMPORTED_MODULE_17__),_WidgetForm__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("17b9"),_FormConfig__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("a5f6"),_WidgetConfig__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("d80d");__webpack_exports__["a"]={name:"FormDesign",components:{Draggable:vuedraggable__WEBPACK_IMPORTED_MODULE_17___default.a,MonacoEditor:_utils_monaco_editor__WEBPACK_IMPORTED_MODULE_14__["a"],WidgetForm:_WidgetForm__WEBPACK_IMPORTED_MODULE_18__["a"],FormConfig:_FormConfig__WEBPACK_IMPORTED_MODULE_19__["a"],WidgetConfig:_WidgetConfig__WEBPACK_IMPORTED_MODULE_20__["a"]},mixins:[_mixins_history__WEBPACK_IMPORTED_MODULE_16__["a"]],props:{options:{type:[Object,String],default:function(){return{column:[]}}},storage:{type:Boolean,default:!1},asideLeftWidth:{type:[String,Number],default:"270px"},asideRightWidth:{type:[String,Number],default:"380px"},showGithubStar:{type:Boolean,default:!0},toolbar:{type:Array,default:function(){return["import","generate","preview","clear"]}},undoRedo:{type:Boolean,default:!0},includeFields:{type:Array,default:function(){var e=[];return _fieldsConfig_js__WEBPACK_IMPORTED_MODULE_12__["a"].forEach((function(t){t.list.forEach((function(t){e.push(t.type)}))})),e}},customFields:{type:Array},defaultValues:{type:Object}},watch:{options:{handler:function handler(val){var _this=this,options=val;if("string"==typeof options)try{options=eval("("+options+")")}catch(e){console.error("非法配置"),options={column:[]}}this.transAvueOptionsToFormDesigner(options).then((function(e){_this.widgetForm=Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])(Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])({},_this.widgetForm),e)}))},deep:!0}},computed:{leftWidth:function(){return"string"==typeof this.asideLeftWidth?this.asideLeftWidth:"".concat(this.asideLeftWidth,"px")},rightWidth:function(){return"string"==typeof this.asideRightWidth?this.asideRightWidth:"".concat(this.asideRightWidth,"px")}},data:function(){return{widgetEmpty:_assets_widget_empty_png__WEBPACK_IMPORTED_MODULE_15___default.a,fields:_fieldsConfig_js__WEBPACK_IMPORTED_MODULE_12__["a"],widgetForm:{column:[],labelPosition:"left",labelSuffix:":",labelWidth:120,gutter:0,menuBtn:!0,submitBtn:!0,submitText:"提交",emptyBtn:!0,emptyText:"清空",menuPosition:"center"},widgetFormPreview:{},configTab:"widget",widgetFormSelect:{},previewVisible:!1,generateJsonVisible:!1,importJsonVisible:!1,importJson:{},widgetModels:{},configOption:{generateType:"json",space:2,quoteType:"single",dropQuotesOnKeys:!0},history:{index:0,maxStep:20,steps:[]}}},mounted:function(){this.handleLoadStorage(),this.handleLoadCss()},methods:{handleLoadStorage:function handleLoadStorage(){var _this2=this;return Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_10__["a"])(regeneratorRuntime.mark((function _callee(){var options;return regeneratorRuntime.wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(options=_this2.options,"string"==typeof options)try{options=eval("("+options+")")}catch(e){console.error("非法配置"),options={column:[]}}return options.column||(options.column=[]),_context.t0=_this2,_context.next=6,_this2.transAvueOptionsToFormDesigner(Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])(Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])({},_this2.widgetForm),options));case 6:_context.t1=_context.sent,_context.t2=[_context.t1],_context.t3=_this2.storage,_context.t4={index:0,maxStep:20,steps:_context.t2,storage:_context.t3},_this2.widgetForm=_context.t0.initHistory.call(_context.t0,_context.t4),_this2.undoRedo&&window.addEventListener("keydown",(function(e){(e.metaKey&&!e.shiftKey&&90==e.keyCode||e.ctrlKey&&!e.shiftKey&&90==e.keyCode)&&(_this2.widgetForm=_this2.handleUndo()),(e.metaKey&&e.shiftKey&&90==e.keyCode||e.ctrlKey&&e.shiftKey&&90==e.keyCode||e.ctrlKey&&89==e.keyCode)&&(_this2.widgetForm=_this2.handleRedo())}),!1);case 12:case"end":return _context.stop()}}),_callee)})))()},handleLoadCss:function(){var e=document.getElementsByTagName("head")[0],t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href="https://at.alicdn.com/t/font_1254447_zc9iezc230c.css",e.appendChild(t)},handleAvueDoc:function(){window.open("https://avuejs.com/doc/form/form-doc","_blank")},handleFieldClick:function(e){var t=this,i=this.widgetForm.column.findIndex((function(e){return e.prop==t.widgetFormSelect.prop}))+1,n=0;-1==i?(this.widgetForm.column.push(e),n=this.widgetForm.column.length-1):(this.widgetForm.column.splice(i,0,e),n=i),this.$refs.widgetForm.handleWidgetAdd({newIndex:n})},handlePreview:function(){var e=this;this.widgetForm.column&&0!=this.widgetForm.column.length?this.transformToAvueOptions(this.widgetForm).then((function(t){e.widgetFormPreview=t,e.previewVisible=!0})):this.$message.error("没有需要展示的内容")},handleImportJsonSubmit:function(){var e=this;try{this.transAvueOptionsToFormDesigner(this.importJson).then((function(t){e.widgetForm=t,e.importJsonVisible=!1,e.handleHistoryChange(e.widgetForm)}))}catch(t){this.$message.error(t.message)}},handleGenerateJson:function(){var e=this;this.transformToAvueOptions(this.widgetForm).then((function(t){e.widgetFormPreview=t,e.generateJsonVisible=!0}))},handleGenerate:function(){var e=this;this.transformToAvueOptions(this.widgetForm).then((function(t){e.configOption.generateType&&"string"==e.configOption.generateType?e.$emit("submit",Object(_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_13__["a"])(t,Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])({minify:!0},e.configOption))):e.$emit("submit",t)}))},handleCopy:function(){var e=this;this.transformToAvueOptions(this.widgetForm).then((function(t){e.$Clipboard({text:Object(_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_13__["a"])(t,Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_11__["a"])({minify:!0},e.configOption))}).then((function(){e.$message.success("复制成功")})).catch((function(){e.$message.error("复制失败")}))}))},handlePreviewSubmit:function(e,t){var i=this;t?this.$alert(this.widgetModels).then((function(){t()})).catch((function(){t()})):this.$refs.form.validate((function(e,t){e&&i.$alert(i.widgetModels).then((function(){t()})).catch((function(){t()}))}))},handleBeforeClose:function(){this.$refs.form.resetForm(),this.widgetModels={},this.previewVisible=!1},handleClear:function(){var e=this;this.widgetForm&&this.widgetForm.column&&this.widgetForm.column.length>0?this.$confirm("确定要清空吗?","警告",{type:"warning"}).then((function(){e.$set(e.widgetForm,"column",[]),e.$set(e,"widgetModels",{}),e.$set(e,"widgetFormSelect",{}),e.handleHistoryChange(e.widgetForm)})).catch((function(){})):this.$message.error("没有需要清空的内容")},transformToAvueOptions:function(e){var t=this;return new Promise((function(i,n){try{(function(){for(var n=t.deepClone(e),o=function(e){var i=n.column[e];if("dynamic"==i.type&&i.children&&i.children.column&&i.children.column.length>0){var o=i.children.column;o.forEach((function(e){delete e.subfield})),t.transformToAvueOptions(i.children).then((function(e){i.children=e}))}else if("group"==i.type){n.group||(n.group=[]);var r={label:i.label,icon:i.icon,prop:i.prop,arrow:i.arrow,collapse:i.collapse,display:i.display};t.transformToAvueOptions(i.children).then((function(e){r.column=e.column,n.group.push(r)})),n.column.splice(e,1),e--}else if(["checkbox","radio","tree","cascader","select"].includes(i.type)){if("static"==i.dicOption)delete i.dicUrl,delete i.dicMethod,delete i.dicQuery,delete i.dicQueryConfig;else if("remote"==i.dicOption)if(delete i.dicData,i.dicQueryConfig&&i.dicQueryConfig.length>0){var a={};i.dicQueryConfig.forEach((function(e){e.key&&e.value&&(a[e.key]=e.value)})),i.dicQuery=a,delete i.dicQueryConfig}else delete i.dicQueryConfig;delete i.dicOption}else if(["upload"].includes(i.type)){if(i.headersConfig&&i.headersConfig.length>0){var l={};i.headersConfig.forEach((function(e){e.key&&e.value&&(l[e.key]=e.value)})),i.headers=l}else delete i.headers;if(delete i.headersConfig,i.dataConfig&&i.dataConfig.length>0){var c={};i.dataConfig.forEach((function(e){e.key&&e.value&&(c[e.key]=e.value)})),i.data=c}else delete i.data;delete i.dataConfig}s=e},s=0;s0&&data.column.forEach((function(e){if("dynamic"==e.type&&e.children&&e.children.column&&e.children.column.length>0){var t=e.children.column;t.forEach((function(e){e.subfield=!0})),_this12.transAvueOptionsToFormDesigner(e.children).then((function(t){e.children=t}))}else if(["checkbox","radio","tree","cascader","select"].includes(e.type)){if(!e.dicData&&e.dicQuery&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_8__["a"])(e.dicQuery)){var i=[];for(var n in e.dicQuery)i.push({key:n,value:e.dicQuery[n],$cellEdit:!0});e.dicQueryConfig=i}e.dicUrl?e.dicOption="remote":e.dicOption="static",e.dicData||(e.dicData=[])}else if(["upload"].includes(e.type)){if(e.headers&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_8__["a"])(e.headers)){var o=[];for(var s in e.headers)o.push({key:s,value:e.headers[s],$cellEdit:!0});e.headersConfig=o}else e.headersConfig=[];if(e.data&&"object"==Object(_Users_ssc_Documents_myProjects_avue_form_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_8__["a"])(e.data)){var r=[];for(var a in e.data)r.push({key:a,value:e.data[a],$cellEdit:!0});e.dataConfig=r}else e.dataConfig=[]}})),data.group&&data.group.length>0){for(var i=function(e){data.column||(data.column=[]);var t=data.group[e],i={type:"group",label:t.label,icon:t.icon,prop:t.prop,arrow:t.arrow,collapse:t.collapse,display:t.display};_this12.transAvueOptionsToFormDesigner(t).then((function(e){i.children=e,data.column.push(i)}))},n=0;n0&&void 0!==e[0]?e[0]:"json","string"!=n){i.next=10;break}return i.t0=_utils_json_beautifier__WEBPACK_IMPORTED_MODULE_13__["a"],i.next=5,t.transformToAvueOptions(t.widgetForm);case 5:return i.t1=i.sent,i.t2={minify:!0},i.abrupt("return",(0,i.t0)(i.t1,i.t2));case 10:return i.next=12,t.transformToAvueOptions(t.widgetForm);case 12:return i.abrupt("return",i.sent);case 13:case"end":return i.stop()}}),i)})))()}}}},e743:function(e,t,i){var n=i("2273");e.exports=/web0s(?!.*chrome)/i.test(n)},e820:function(e,t,i){"use strict";i("2eb0");var n=i("7d86"),o=i("ac97"),s=i("1810"),r=i("69f1"),a=s("species"),l=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),c=function(){return"$0"==="a".replace(/./,"$0")}(),d=s("replace"),h=function(){return!!/./[d]&&""===/./[d]("a","$0")}(),u=!o((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2!==i.length||"a"!==i[0]||"b"!==i[1]}));e.exports=function(e,t,i,d){var g=s(e),f=!o((function(){var t={};return t[g]=function(){return 7},7!=""[e](t)})),m=f&&!o((function(){var t=!1,i=/a/;return"split"===e&&(i={},i.constructor={},i.constructor[a]=function(){return i},i.flags="",i[g]=/./[g]),i.exec=function(){return t=!0,null},i[g](""),!t}));if(!f||!m||"replace"===e&&(!l||!c||h)||"split"===e&&!u){var p=/./[g],_=i(g,""[e],(function(e,t,i,n,o){return t.exec===RegExp.prototype.exec?f&&!o?{done:!0,value:p.call(t,i,n)}:{done:!0,value:e.call(i,t,n)}:{done:!1}}),{REPLACE_KEEPS_$0:c,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:h}),b=_[0],v=_[1];n(String.prototype,e,b),n(RegExp.prototype,g,2==t?function(e,t){return v.call(e,this,t)}:function(e){return v.call(e,this)})}d&&r(RegExp.prototype[g],"sham",!0)}},eb42:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".dic[data-v-332ffb4a]{display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:5px}",""]),e.exports=t},eb46:function(e,t,i){"use strict";var n=i("83ec"),o=i("370b");n({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},eba9:function(e,t,i){var n=i("58a5");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var o=i("4974").default;o("fb80cdb8",n,!0,{sourceMap:!1,shadowMode:!1})},ec23:function(e,t,i){var n=i("c401"),o=i("6e1d");e.exports=function(e,t){var i=e.exec;if("function"===typeof i){var s=i.call(e,t);if("object"!==typeof s)throw TypeError("RegExp exec method returned something other than an Object or null");return s}if("RegExp"!==n(e))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},eca0:function(e,t,i){var n=i("53c2");t=n(!1),t.push([e.i,".monaco-editor .lines-content .cigr,.monaco-editor .lines-content .cigra{position:absolute}",""]),e.exports=t},eee7:function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},ef61:function(e,t,i){var n=i("83ec"),o=i("c673"),s=i("3e1a"),r=i("ac97"),a=r((function(){s(1)}));n({target:"Object",stat:!0,forced:a},{keys:function(e){return s(o(e))}})},f05e:function(e,t,i){"use strict";var n=i("7d86"),o=i("fbcf"),s=i("ac97"),r=i("ff5c"),a="toString",l=RegExp.prototype,c=l[a],d=s((function(){return"/a/b"!=c.call({source:"a",flags:"b"})})),h=c.name!=a;(d||h)&&n(RegExp.prototype,a,(function(){var e=o(this),t=String(e.source),i=e.flags,n=String(void 0===i&&e instanceof RegExp&&!("flags"in l)?r.call(e):i);return"/"+t+"/"+n}),{unsafe:!0})},f0db:function(e,t){e.exports=!1},f0f1:function(e,t,i){var n=i("396d"),o=i("e629"),s=o.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,s)}},f146:function(e,t,i){var n=i("e244"),o=i("eee7"),s=n.document,r=o(s)&&o(s.createElement);e.exports=function(e){return r?s.createElement(e):{}}},f152:function(e,t,i){var n=i("eee7"),o=i("5a43"),s=i("1810"),r=s("species");e.exports=function(e,t){var i;return o(e)&&(i=e.constructor,"function"!=typeof i||i!==Array&&!o(i.prototype)?n(i)&&(i=i[r],null===i&&(i=void 0)):i=void 0),new(void 0===i?Array:i)(0===t?0:t)}},f20c:function(e,t,i){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * diff --git a/src/api/plugin/workflow/ops.js b/src/api/plugin/workflow/ops.js index 9002477..2739aad 100644 --- a/src/api/plugin/workflow/ops.js +++ b/src/api/plugin/workflow/ops.js @@ -17,6 +17,21 @@ export const getList = (current, size, params) => { }) } +/** + * 所有办结流程 + */ + export const getDoneList = (current, size, params) => { + return request({ + url: `${prefix}/doneList`, + method: 'get', + params: { + ...params, + current, + size, + } + }) +} + /** * 完成任务 */ diff --git a/src/views/plugin/workflow/design/index.vue b/src/views/plugin/workflow/design/index.vue index 5a99e3b..975ae9b 100644 --- a/src/views/plugin/workflow/design/index.vue +++ b/src/views/plugin/workflow/design/index.vue @@ -30,8 +30,9 @@ :underline="false" @click="$router.push('/plugin/workflow/design/form')">没有想要的表单?点击去设计 - @@ -183,7 +184,7 @@ export default { label: '表单', prop: 'formKey', type: 'select', - dicUrl: '/api/blade-workflow/design/form/list?current=1&size=99', + dicUrl: '/api/blade-workflow/design/form/list?size=-1&status=1', dicFormatter: (data) => { return data.data.records }, diff --git a/src/views/plugin/workflow/mixins/ex-form.js b/src/views/plugin/workflow/mixins/ex-form.js index 6f354ca..9ff0c6d 100644 --- a/src/views/plugin/workflow/mixins/ex-form.js +++ b/src/views/plugin/workflow/mixins/ex-form.js @@ -30,7 +30,7 @@ export default { }, methods: { // 动态路由跳转 - dynamicRoute(row, type) { + dynamicRoute(row, type, async = false) { const { id, taskId, processInstanceId, processId, formKey, formUrl } = row let param = Buffer.from(JSON.stringify({ processId: id, @@ -55,7 +55,13 @@ export default { this.$router.push(`/workflow/process/external/${formKey.substring(6)}/${type}?p=${param}`) } } else { - this.$router.push(`/workflow/process/${type}/${param}`) + if (async) { + return new Promise((resolve) => { + resolve({ row, type, param }) + }) + } else { + this.$router.push(`/workflow/process/${type}/${param}`) + } } }, // 根据可读可写,过滤avue column diff --git a/src/views/plugin/workflow/ops/done.vue b/src/views/plugin/workflow/ops/done.vue new file mode 100644 index 0000000..1c7324a --- /dev/null +++ b/src/views/plugin/workflow/ops/done.vue @@ -0,0 +1,245 @@ + + + + + diff --git a/src/views/plugin/workflow/ops/index.vue b/src/views/plugin/workflow/ops/index.vue index 4b91c60..e6fe984 100644 --- a/src/views/plugin/workflow/ops/index.vue +++ b/src/views/plugin/workflow/ops/index.vue @@ -326,8 +326,10 @@ export default { }).catch(() => { }) }, handleDetail(row) { - this.form = { ...row } - this.detailVisible = true + this.dynamicRoute(row, 'detail', true).then(() => { + this.form = { ...row } + this.detailVisible = true + }) }, rollbackTask, dispatchTask, diff --git a/src/views/plugin/workflow/process/components/form.vue b/src/views/plugin/workflow/process/components/form.vue index 213e931..de4afca 100644 --- a/src/views/plugin/workflow/process/components/form.vue +++ b/src/views/plugin/workflow/process/components/form.vue @@ -32,6 +32,7 @@ diff --git a/src/views/plugin/workflow/process/components/user-select.vue b/src/views/plugin/workflow/process/components/user-select.vue index fe30522..a331b7d 100644 --- a/src/views/plugin/workflow/process/components/user-select.vue +++ b/src/views/plugin/workflow/process/components/user-select.vue @@ -208,10 +208,12 @@ export default { this.selectionClear() const checks = defaultChecked.split(",") if (checks.length > 0) { - checks.forEach(c => { - const row = this.data.find(d => d.id == c) - if (row && this.$refs.crud) this.$refs.crud.toggleRowSelection(row, true) - }) + setTimeout(() => { + checks.forEach(c => { + const row = this.data.find(d => d.id == c) + if (row && this.$refs.crud) this.$refs.crud.toggleRowSelection(row, true) + }) + }, 500); } } else { const row = this.data.find(d => d.id == defaultChecked) @@ -236,7 +238,7 @@ export default { this.data = this.getAsVal(res, this.props.records) || [] this.loading = false - this.changeDefaultChecked() + // this.changeDefaultChecked() }) }, getAsVal(obj, bind = '') { diff --git a/src/views/plugin/workflow/process/done.vue b/src/views/plugin/workflow/process/done.vue index c89ecdc..f9f5e9d 100644 --- a/src/views/plugin/workflow/process/done.vue +++ b/src/views/plugin/workflow/process/done.vue @@ -94,7 +94,7 @@ export default { }, { label: "流程分类", - type: "select", + type: "tree", row: true, dicUrl: '/api/blade-workflow/design/category/tree', props: { diff --git a/src/views/plugin/workflow/process/my-done.vue b/src/views/plugin/workflow/process/my-done.vue index 07f1d25..11b9b99 100644 --- a/src/views/plugin/workflow/process/my-done.vue +++ b/src/views/plugin/workflow/process/my-done.vue @@ -90,7 +90,7 @@ export default { }, { label: "流程分类", - type: "select", + type: "tree", row: true, dicUrl: '/api/blade-workflow/design/category/tree', props: {