mirror of
https://github.com/QIDITECH/QIDI_PLUS4.git
synced 2026-01-30 15:38:44 +03:00
654 lines
2.3 MiB
JavaScript
654 lines
2.3 MiB
JavaScript
|
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./setupMonaco.features-Cu88WI8m.js","./index-CxlebU9W.js","./index-BD5rHN8m.css","./setupMonaco-PRM3u-9J.css"])))=>i.map(i=>d[i]);
|
||
|
|
var r5=Object.defineProperty;var a5=(s,e,t)=>e in s?r5(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Zk=(s,e,t)=>a5(s,typeof e!="symbol"?e+"":e,t);import{p as l5,q as vu,_ as c5,M as d5}from"./index-CxlebU9W.js";function xs(s,e=0){return s[s.length-(1+e)]}function u5(s){if(s.length===0)throw new Error("Invalid tail call");return[s.slice(0,s.length-1),s[s.length-1]]}function Wi(s,e,t=(i,n)=>i===n){if(s===e)return!0;if(!s||!e||s.length!==e.length)return!1;for(let i=0,n=s.length;i<n;i++)if(!t(s[i],e[i]))return!1;return!0}function h5(s,e){const t=s.length-1;e<t&&(s[e]=s[t]),s.pop()}function f5(s,e,t){return g5(s.length,i=>t(s[i],e))}function g5(s,e){let t=0,i=s-1;for(;t<=i;){const n=(t+i)/2|0,o=e(n);if(o<0)t=n+1;else if(o>0)i=n-1;else return n}return-(t+1)}function Yk(s,e,t){if(s=s|0,s>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],o=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?o.push(a):r.push(a)}return s<n.length?Yk(s,n,t):s<n.length+r.length?r[0]:Yk(s-(n.length+r.length),o,t)}function hte(s,e){const t=[];let i;for(const n of s.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function*hS(s,e){let t,i;for(const n of s)i!==void 0&&e(i,n)?t.push(n):(t&&(yield t),t=[n]),i=n;t&&(yield t)}function xN(s,e){for(let t=0;t<=s.length;t++)e(t===0?void 0:s[t-1],t===s.length?void 0:s[t])}function m5(s,e){for(let t=0;t<s.length;t++)e(t===0?void 0:s[t-1],s[t],t+1===s.length?void 0:s[t+1])}function EN(s){return s.filter(e=>!!e)}function Qk(s){let e=0;for(let t=0;t<s.length;t++)s[t]&&(s[e]=s[t],e+=1);s.length=e}function p5(s){return!Array.isArray(s)||s.length===0}function L0(s){return Array.isArray(s)&&s.length>0}function Nc(s,e=t=>t){const t=new Set;return s.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function fS(s,e){return s.length>0?s[0]:e}function Rn(s,e){let t=typeof e=="number"?s:0;typeof e=="number"?t=s:(t=0,e=s);const i=[];if(t<=e)for(let n=t;n<e;n++)i.push(n);else for(let n=t;n>e;n--)i.push(n);return i}function k0(s,e,t){const i=s.slice(0,e),n=s.slice(e);return i.concat(t,n)}function V1(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.unshift(e))}function fm(s,e){const t=s.indexOf(e);t>-1&&(s.splice(t,1),s.push(e))}function Cb(s,e){for(const t of e)s.push(t)}function _5(s){return Array.isArray(s)?s:[s]}function v5(s,e,t){const i=IN(s,e),n=s.length,o=t.length;s.length=n+o;for(let r=n-1;r>=i;r--)s[r+o]=s[r];for(let r=0;r<o;r++)s[r+i]=t[r]}function Xk(s,e,t,i){const n=IN(s,e);let o=s.splice(n,t);return o===void 0&&(o=[]),v5(s,n,i),o}function IN(s,e){return e<0?Math.max(e+s.length,0):Math.min(e,s.length)}var Af;(function(s){function e(o){return o<0}s.isLessThan=e;function t(o){return o<=0}s.isLessThanOrEqual=t;function i(o){return o>0}s.isGreaterThan=i;function n(o){return o===0}s.isNeitherLessOrGreaterThan=n,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})(Af||(Af={}));function oo(s,e){return(t,i)=>e(s(t),s(i))}function b5(...s){return(e,t)=>{for(const i of s){const n=i(e,t);if(!Af.isNeitherLessOrGreaterThan(n))return n}return Af.neitherLessOrGreaterThan}}const ul=(s,e)=>s-e,C5=(s,e)=>ul(s?1:0,e?1:0);function w5(s){return(e,t)=>-s(e,t)}class ba{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class _r{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new _r(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new _r(t=>thi
|
||
|
|
- Use 0 to automatically compute the line height from the font size.
|
||
|
|
- Values between 0 and 8 will be used as a multiplier with the font size.
|
||
|
|
- Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class lP extends Bt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:p("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),p("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p("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:p("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:p("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:p("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:p("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:p("minimap.sectionHeaderLetterSpacing","Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){var t,i;if(!e||typeof e!="object")return this.defaultValue;const n=e;return{enabled:le(n.enabled,this.defaultValue.enabled),autohide:le(n.autohide,this.defaultValue.autohide),size:jt(n.size,this.defaultValue.size,["proportional","fill","fit"]),side:jt(n.side,this.defaultValue.side,["right","left"]),showSlider:jt(n.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:le(n.renderCharacters,this.defaultValue.renderCharacters),scale:Lt.clampedInt(n.scale,1,1,3),maxColumn:Lt.clampedInt(n.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:le(n.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:le(n.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:ps.clamp((t=n.sectionHeaderFontSize)!==null&&t!==void 0?t:this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:ps.clamp((i=n.sectionHeaderLetterSpacing)!==null&&i!==void 0?i:this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function cP(s){return s==="ctrlCmd"?Ye?"metaKey":"ctrlKe
|
||
|
|
|
||
|
|
`+e.stack):new Error(e.message+`
|
||
|
|
|
||
|
|
`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const $N=new MP;function At(s){Mg(s)||$N.onUnexpectedError(s)}function bS(s){Mg(s)||$N.onUnexpectedExternalError(s)}function sD(s){if(s instanceof Error){const{name:e,message:t}=s,i=s.stacktrace||s.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:Cu.isErrorNoTelemetry(s)}}return s}const Gp="Canceled";function Mg(s){return s instanceof wl?!0:s instanceof Error&&s.name===Gp&&s.message===Gp}class wl extends Error{constructor(){super(Gp),this.name=this.message}}function RP(){const s=new Error(Gp);return s.name=s.message,s}function x0(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")}function CS(s){return s?new Error(`Illegal state: ${s}`):new Error("Illegal state")}class PP extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Cu extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Cu)return e;const t=new Cu;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Dt extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Dt.prototype)}}function wu(s,e){const t=this;let i=!1,n;return function(){return i||(i=!0,n=s.apply(t,arguments)),n}}function KN(s){return typeof s=="object"&&s!==null&&typeof s.dispose=="function"&&s.dispose.length===0}function Hi(s){if(ot.is(s)){const e=[];for(const t of s)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function br(...s){return Be(()=>Hi(s))}function Be(s){return{dispose:wu(()=>{s()})}}class pe{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Hi(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?pe.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}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}pe.DISABLE_DISPOSED_WARNING=!1;class G{constructor(){this._store=new pe,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}G.None=Object.freeze({dispose(){}});class Ca{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class pte{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class FP{constructor(e){this.object=e}dispose(){}}class wS{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Hi(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(n=this._store.get(e))===null||n===void 0||n.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const OP=globalThis.perform
|
||
|
|
`).slice(2).join(`
|
||
|
|
`))}}class VP extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class HP extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class U1{constructor(e){this.value=e}}const zP=2;let O=class{constructor(e){var t,i,n,o,r,a;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new WP((i=e==null?void 0:e.onListenerError)!==null&&i!==void 0?i:At,(o=(n=this._options)===null||n===void 0?void 0:n.leakWarningThreshold)!==null&&o!==void 0?o:BP):void 0,this._perfMon=!((r=this._options)===null||r===void 0)&&r._profName?new yu(this._options._profName):void 0,this._deliveryQueue=(a=this._options)===null||a===void 0?void 0:a.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||i===void 0||i.call(t),(n=this._leakageMon)===null||n===void 0||n.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,i,n)=>{var o,r,a,l,c,d,u;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);const _=(o=this._leakageMon.getMostFrequentStack())!==null&&o!==void 0?o:["UNKNOWN stack",-1],v=new HP(`${m}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(((r=this._options)===null||r===void 0?void 0:r.onListenerError)||At)(v),G.None}if(this._disposed)return G.None;i&&(t=t.bind(i));const h=new U1(t);let f;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(h.stack=yS.create(),f=this._leakageMon.check(h.stack,this._size+1)),this._listeners?this._listeners instanceof U1?((u=this._deliveryQueue)!==null&&u!==void 0||(this._deliveryQueue=new jN),this._listeners=[this._listeners,h]):this._listeners.push(h):((l=(a=this._options)===null||a===void 0?void 0:a.onWillAddFirstListener)===null||l===void 0||l.call(a,this),this._listeners=h,(d=(c=this._options)===null||c===void 0?void 0:c.onDidAddFirstListener)===null||d===void 0||d.call(c,this)),this._size++;const g=Be(()=>{f==null||f(),this._removeListener(h)});return n instanceof pe?n.add(g):Array.isArray(n)&&n.push(g),g}),this._event}_removeListener(e){var t,i,n,o;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(n=this._options)===null||n===void 0?void 0:n.onDidRemoveLastListener)===null||o===void 0||o.call(n,this),this._size=0;return}const r=this._listeners,a=r.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*zP<=r.length){let c=0;for(let d=0;d<r.length;d++)r[d]?r[c++]=r[d]:l&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=c}}_deliver(e,t){var i;if(!e)return;const n=((i=this._options)===null||i===void 0?void 0:i.onListenerError)||At;if(!n){e.value(t);return}try{e.value(t)}catch(o){n(o)}}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,i,n,o;if(!((t=this._deliveryQueue)===null||t===void 0)&&t.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)===null||i===void 0||i.stop()),(n=this._perfMon)===null||n===void 0||n.start(this._size),this._listeners)if(this._listeners instanceof U1)this._deliver(this._listeners,e);else{const r=this._deliveryQueue;r.enqueue(this,e,this._listeners.length),this._deliverQueue(r)}(o=this._perfMon)===null||o===void 0||o.stop()}hasListeners(){return this._size>0}};const UP=()=>new jN;class jN{construct
|
||
|
|
`+pi),mi&&(pi=po(pi,R," "),pi=po(pi,A," "),pi=po(pi,P," ")),C&&li?C.createHTML(pi):pi},e.setConfig=function(Ve){Pe(Ve),rn=!0},e.clearConfig=function(){qt=null,rn=!1},e.isValidAttribute=function(Ve,$,ue){qt||Pe({});const xe=Ze(Ve),Gt=Ze($);return Kk(xe,Gt,ue)},e.addHook=function(Ve,$){typeof $=="function"&&(W[Ve]=W[Ve]||[],uh(W[Ve],$))},e.removeHook=function(Ve){if(W[Ve])return DD(W[Ve])},e.removeHooks=function(Ve){W[Ve]&&(W[Ve]=[])},e.removeAllHooks=function(){W={}},e}var Ir=wT();Ir.version;Ir.isSupported;const yT=Ir.sanitize;Ir.setConfig;Ir.clearConfig;Ir.isValidAttribute;const ST=Ir.addHook,LT=Ir.removeHook;Ir.removeHooks;Ir.removeAllHooks;var ze;(function(s){s.inMemory="inmemory",s.vscode="vscode",s.internal="private",s.walkThrough="walkThrough",s.walkThroughSnippet="walkThroughSnippet",s.http="http",s.https="https",s.file="file",s.mailto="mailto",s.untitled="untitled",s.data="data",s.command="command",s.vscodeRemote="vscode-remote",s.vscodeRemoteResource="vscode-remote-resource",s.vscodeManagedRemoteResource="vscode-managed-remote-resource",s.vscodeUserData="vscode-userdata",s.vscodeCustomEditor="vscode-custom-editor",s.vscodeNotebookCell="vscode-notebook-cell",s.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",s.vscodeNotebookCellOutput="vscode-notebook-cell-output",s.vscodeInteractiveInput="vscode-interactive-input",s.vscodeSettings="vscode-settings",s.vscodeWorkspaceTrust="vscode-workspace-trust",s.vscodeTerminal="vscode-terminal",s.vscodeChatCodeBlock="vscode-chat-code-block",s.vscodeCopilotBackingChatCodeBlock="vscode-copilot-chat-code-block",s.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",s.vscodeChatSesssion="vscode-chat-editor",s.webviewPanel="webview-panel",s.vscodeWebview="vscode-webview",s.extension="extension",s.vscodeFileResource="vscode-file",s.tmp="tmp",s.vsls="vsls",s.vscodeSourceControl="vscode-scm",s.commentsInput="comment",s.codeSetting="code-setting"})(ze||(ze={}));function BS(s,e){return $e.isUri(s)?Ed(s.scheme,e):ES(s,e+":")}function AD(s,...e){return e.some(t=>BS(s,t))}const CO="tkn";class wO{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return ri.join(this._serverRootPath,ze.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return At(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const n=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${CO}=${encodeURIComponent(o)}`),$e.from({scheme:Yu?this._preferredWebSchema:ze.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}const kT=new wO,yO="vscode-app";class Bf{uriToBrowserUri(e){return e.scheme===ze.vscodeRemote?kT.rewrite(e):e.scheme===ze.file&&(nf||R5===`${ze.vscodeFileResource}://${Bf.FALLBACK_AUTHORITY}`)?e.with({scheme:ze.vscodeFileResource,authority:e.authority||Bf.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}Bf.FALLBACK_AUTHORITY=yO;const DT=new Bf;var MD;(function(s){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);s.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let r;typeof o=="string"?r=new URL(o).searchParams:o instanceof URL?r=o.searchParams:$e.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r==null?void 0:r.get(t);if(a)return e.get(a)}s.getHeadersFromQuery=i;function n(o,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}s.addSearchParam=n})(MD||(MD={}));function xT(s){return T0(s,0)}function T0(s,e){switch(typeof s){case"object":return s===null?na(349,e):Array.isArray(s)?LO(s,e):kO(s,e);case"string":return WS(
|
||
|
|
| KEY '=~' REGEX
|
||
|
|
| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=p("contextkey.parser.error.expectedButGot",`Expected: {0}
|
||
|
|
Received: '{1}'.`,e,lr.getLexeme(t)),o=t.offset,r=lr.getLexeme(t);return this._parsingErrors.push({message:n,offset:o,lexeme:r,additionalInfo:i}),Fh._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};WT._parseError=new Error;class st{static false(){return En.INSTANCE}static true(){return Hn.INSTANCE}static has(e){return Yc.create(e)}static equals(e,t){return Wg.create(e,t)}static notEquals(e,t){return B0.create(e,t)}static regex(e,t){return Hf.create(e,t)}static in(e,t){return F0.create(e,t)}static notIn(e,t){return O0.create(e,t)}static not(e){return Qc.create(e)}static and(...e){return uc.create(e,null,!0)}static or(...e){return Qr.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}st._parser=new WT({regexParsingWithErrorRecovery:!1});function v7(s,e){const t=s?s.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function af(s,e){return s.cmp(e)}class En{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Hn.INSTANCE}}En.INSTANCE=new En;class Hn{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return En.INSTANCE}}Hn.INSTANCE=new Hn;class Yc{static create(e,t=null){const i=on.get(e);return typeof i=="boolean"?i?Hn.INSTANCE:En.INSTANCE:new Yc(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:HT(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=on.get(this.key);return typeof e=="boolean"?e?Hn.INSTANCE:En.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Qc.create(this.key,this)),this.negated}}class Wg{static create(e,t,i=null){if(typeof t=="boolean")return t?Yc.create(e,i):Qc.create(e,i);const n=on.get(e);return typeof n=="boolean"?t===(n?"true":"false")?Hn.INSTANCE:En.INSTANCE:new Wg(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Xc(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=on.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Hn.INSTANCE:En.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=B0.create(this.key,this.value,this)),this.negated}}class F0{static create(e,t){return new F0(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Xc(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?c7.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=O0.create(this.key,this.valueKey)),this.negated}}class O0{static create(e,t){return new O0(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=F0.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}
|
||
|
|
`;Du.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
|
||
|
|
`;function hc(s,e){const t=s.getCount(),i=s.findTokenIndexAtOffset(e),n=s.getLanguageId(i);let o=i;for(;o+1<t&&s.getLanguageId(o+1)===n;)o++;let r=i;for(;r>0&&s.getLanguageId(r-1)===n;)r--;return new z7(s,n,r,o+1,s.getStartOffset(r),s.getEndOffset(o))}class z7{constructor(e,t,i,n,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=o,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function Jo(s){return(s&3)!==0}const qD=typeof Buffer<"u";let lv;class iL{static wrap(e){return qD&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new iL(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return qD?this.buffer.toString():(lv||(lv=new TextDecoder),lv.decode(this.buffer))}}function U7(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0}function $7(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function yo(s,e){return s[e]*2**24+s[e+1]*2**16+s[e+2]*2**8+s[e+3]}function So(s,e,t){s[t+3]=e,e=e>>>8,s[t+2]=e,e=e>>>8,s[t+1]=e,e=e>>>8,s[t]=e}function GD(s,e){return s[e]}function ZD(s,e,t){s[t]=e}let cv;function YT(){return cv||(cv=new TextDecoder("UTF-16LE")),cv}let dv;function K7(){return dv||(dv=new TextDecoder("UTF-16BE")),dv}let uv;function QT(){return uv||(uv=F5()?YT():K7()),uv}function j7(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?q7(s,e,t):YT().decode(i)}function q7(s,e,t){const i=[];let n=0;for(let o=0;o<t;o++){const r=U7(s,e);e+=2,i[n++]=String.fromCharCode(r)}return i.join("")}class j0{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return QT().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||Di(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class o_{constructor(e,t,i,n,o,r){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=r,this._openSet=o_._toSet(this.open),this._closeSet=o_._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}function G7(s){const e=s.length;s=s.map(r=>[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r<e;r++)t[r]=r;const i=(r,a)=>{const[l,c]=r,[d,u]=a;return l===d||l===u||c===d||c===u},n=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d<e;d++)t[d]===c&&(t[d]=l)};for(let r=0;r<e;r++){const a=s[r];for(let l=r+1;l<e;l++){const c=s[l];i(a,c)&&n(t[r],t[l]
|
||
|
|
`)>=0;let t=null;try{t=oT(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new W9(t,this.wordSeparators?Eu(this.wordSeparators,[]):null,i?this.searchString:null)}}function U9(s){if(!s||s.length===0)return!1;for(let e=0,t=s.length;e<t;e++){const i=s.charCodeAt(e);if(i===10)return!0;if(i===92){if(e++,e>=t)break;const n=s.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function ec(s,e,t){if(!t)return new zf(s,null);const i=[];for(let n=0,o=e.length;n<o;n++)i[n]=e[n];return new zf(s,i)}class dx{constructor(e){const t=[];let i=0;for(let n=0,o=e.length;n<o;n++)e.charCodeAt(n)===10&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(n===-1||e<=t[0])return 0;for(;i<n;){const o=i+((n-i)/2>>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class Sm{static findMatches(e,t,i,n,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Nd(r.wordSeparators,r.regex),n,o):this._doFindMatchesLineByLine(e,i,r,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(n){const f=n.findLineFeedCountBeforeOffset(o+r.length)-l;c=a+r.length+f}else c=a+r.length;const d=e.getPositionAt(a),u=e.getPositionAt(c);return new M(d.lineNumber,d.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,i,n,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r
|
||
|
|
`?new dx(a):null,c=[];let d=0,u;for(i.reset(0);u=i.next(a);)if(c[d++]=ec(this._getMultilineMatchRange(e,r,a,l,u.index,u[0]),u,n),d>=o)return c;return c}static _doFindMatchesLineByLine(e,t,i,n,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,o),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,o);for(let c=t.startLineNumber+1;c<t.endLineNumber&&a<o;c++)a=this._findMatchesInLine(i,e.getLineContent(c),c,0,a,r,n,o);if(a<o){const c=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,c,t.endLineNumber,0,a,r,n,o)}return r}static _findMatchesInLine(e,t,i,n,o,r,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=t.length;let m=-f;for(;(m=t.indexOf(h,m+f))!==-1;)if((!c||sL(c,t,g,m,f))&&(r[o++]=new zf(new M(i,m+1+n,i,m+1+f+n),null),o>=l))return o;return o}const d=new Nd(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(r[o++]=ec(new M(i,u.index+1+n,i,u.index+1+u[0].length+n),u,a),o>=l))return o;while(u);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new Nd(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new V(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new M(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r
|
||
|
|
`?new dx(l):null;i.reset(t.column-1);const d=i.next(l);return d?ec(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new V(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let c=1;c<=o;c++){const d=(r+c-1)%o,u=e.getLineContent(d+1),h=this._findFirstMatchInLine(i,u,d+1,1,n);if(h)return h}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const r=e.next(t);return r?ec(new M(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new Nd(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new M(1,1,t.lineNumber,t.column),i,n,10*z9);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new V(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,n);if(l)return l;for(let c=1;c<=o;c++){const d=(o+r-c-1)%o,u=e.getLineContent(d+1),h=this._findLastMatchInLine(i,u,d+1,n);if(h)return h}return null}static _findLastMatchInLine(e,t,i,n){let o=null,r;for(e.reset(0);r=e.next(t);)o=ec(new M(i,r.index+1,i,r.index+1+r[0].length),r,n);return o}}function $9(s,e,t,i,n){if(i===0)return!0;const o=e.charCodeAt(i-1);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i);if(s.get(r)!==0)return!0}return!1}function K9(s,e,t,i,n){if(i+n===t)return!0;const o=e.charCodeAt(i+n);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(s.get(r)!==0)return!0}return!1}function sL(s,e,t,i,n){return $9(s,e,t,i,n)&&K9(s,e,t,i,n)}class Nd{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||(i=this._searchRegex.exec(e),!i))return null;const n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){Jp(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||sL(this._wordSeparators,e,t,n,o))return i}while(i);return null}}class j9{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new ux(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${q9(Array.from(a))}`,"g");const c=new Nd(null,l),d=[];let u=!1,h,f=0,g=0,m=0;e:for(let _=n,v=o;_<=v;_++){const b=e.getLineContent(_),C=b.length;c.reset(0);do if(h=c.next(b),h){let w=h.index,y=h.index+h[0].length;if(w>0){const N=b.charCodeAt(w-1);Di(N)&&w--}if(y+1<C){const N=b.charCodeAt(y-1);Di(N)&&y++}const L=b.substring(w,y);let k=Mf(w+1,_S,b,0);k&&k.endColumn<=w+1&&(k=null);const D=r.shouldHighlightNonBasicASCII(L,k?k.word:null);if(D!==0){if(D===3?f++:D===2?g++:D===1?m++:QS(),d.length>=1e3){u=!0;break e}d.push(new M(_,w+1,_,y+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new ux(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=Tc.getLocales().filter(l=>!Tc.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}c
|
||
|
|
`||s===" "}class yp{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class cA{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Re{static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let n=i;for(;n<t.length&&t[n].start<=e.endExclusive;)n++;if(i===n)t.splice(i,0,e);else{const o=Math.min(e.start,t[i].start),r=Math.max(e.endExclusive,t[n-1].endExclusive);t.splice(i,n-i,new Re(o,r))}}static tryCreate(e,t){if(!(e>t))return new Re(e,t)}static ofLength(e){return new Re(0,e)}static ofStartAndLength(e,t){return new Re(e,e+t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Dt(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Re(this.start+e,this.endExclusive+e)}deltaStart(e){return new Re(this.start+e,this.endExclusive)}deltaEnd(e){return new Re(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new Re(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new Re(t,i)}intersects(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return t<i}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Dt(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Dt(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}}class oL{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const n=Math.min(e.start,this._sortedRanges[t].start),o=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new Re(n,o))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(e){const t=new oL;for(const i of this._sortedRanges){const n=i.intersect(e);n&&t.addRange(n)}return t}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,t)=>e+t.length,0)}}function d_(s,e){const t=G9(s,e);if(t!==-1)return s[t]}function G9(s,e,t=s.length-1){for(let i=t;i>=0;i--){const n=s[i];if(e(n))return i}return-1}function Nu(s,e){const t=Uf(s,e);return t===-1?void 0:s[t]}function Uf(s,e,t=0,i=s.length){let n=t,o=i;for(;n<o;){const r=Math.floor((n+o)/2);e(s[r])?n=r+1:o=r}return n-1}function Z9(s,e){const t=jC(s,e);return t===s.length?void 0:s[t]}function jC(s,e,t=0,i=s.length){let n=t,o=i;for(;n<o;){const r=Math.floor((n+o)/2);e(s[r])?o=r:n=r+1}return n}class Ug{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(Ug.assertInvariants){if(this._prevFindLastPredicate){for(const i of this._array)if(this._prevFindLastPredicate(i)&&!e(i))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const t=Uf(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,t===-1?void 0:this._array[t]}}Ug.assertInvariants=!1;function dA(s,e){if(s.length===0)return;let t=s[0];for(let i=1;i<s.length;i++){const n=s[i];e(n,t)>0&
|
||
|
|
`?(t++,i=0):i++;return new Os(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}createRange(e){return this.lineCount===0?new M(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new M(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}addToPosition(e){return this.lineCount===0?new V(e.lineNumber,e.column+this.columnCount):new V(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}Os.zero=new Os(0,0);class J9{constructor(e){this.text=e,this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)e.charAt(t)===`
|
||
|
|
`&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new Re(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}get textLength(){const e=this.lineStartOffsetByLineIdx.length-1;return new Os(e,this.text.length-this.lineStartOffsetByLineIdx[e])}}class e3{constructor(e){this.edits=e,Pc(()=>XS(e,(t,i)=>t.range.getEndPosition().isBeforeOrEqual(i.range.getStartPosition())))}apply(e){let t="",i=new V(1,1);for(const o of this.edits){const r=o.range,a=r.getStartPosition(),l=r.getEndPosition(),c=fx(i,a);c.isEmpty()||(t+=e.getValueOfRange(c)),t+=o.text,i=l}const n=fx(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){const t=new i3(e);return this.apply(t)}getNewRanges(){const e=[];let t=0,i=0,n=0;for(const o of this.edits){const r=Os.ofText(o.text),a=V.lift({lineNumber:o.range.startLineNumber+i,column:o.range.startColumn+(o.range.startLineNumber===t?n:0)}),l=r.createRange(a);e.push(l),i=l.endLineNumber-o.range.endLineNumber,n=l.endColumn-o.range.endColumn,t=o.range.endLineNumber}return e}}class t3{constructor(e,t){this.range=e,this.text=t}}function fx(s,e){if(s.lineNumber===e.lineNumber&&s.column===Number.MAX_SAFE_INTEGER)return M.fromPositions(e,e);if(!s.isBeforeOrEqual(e))throw new Dt("start must be before end");return new M(s.lineNumber,s.column,e.lineNumber,e.column)}class uA{get endPositionExclusive(){return this.length.addToPosition(new V(1,1))}}class i3 extends uA{constructor(e){super(),this.value=e,this._t=new J9(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}}class kn{static inverse(e,t,i){const n=[];let o=1,r=1;for(const l of e){const c=new kn(new Me(o,l.original.startLineNumber),new Me(r,l.modified.startLineNumber));c.modified.isEmpty||n.push(c),o=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new kn(new Me(o,t+1),new Me(r,i+1));return a.modified.isEmpty||n.push(a),n}static clip(e,t,i){const n=[];for(const o of e){const r=o.original.intersect(t),a=o.modified.intersect(i);r&&!r.isEmpty&&a&&!a.isEmpty&&n.push(new kn(r,a))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new kn(this.modified,this.original)}join(e){return new kn(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){const e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new Ao(e,t);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Dt("not a valid diff");return new Ao(new M(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new M(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new Ao(new M(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new M(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}}class ws extends kn{static fromRangeMappings(e){const t=Me.join(e.map(n=>Me.fromRangeInclusive(n.originalRange))),i=Me.join(e.map(n=>Me.fromRangeInclusive(n.modifiedRange)));return new ws(t,i,e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new ws(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}withInnerChangesFromLineRanges(){return new ws(this.original,this.modified,[this.toRangeMapping()])}}class Ao{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new Ao(this.modifiedRange,this.originalRange)}toTextEdit(e){const t=e.getValueOfRange(this.modifiedRange);return new t3(this.originalRange,t)}}const n3=3;class s3{computeDiff(e,t,i){var n;const r=new a3(e,t,{maxComputationTi
|
||
|
|
`);this.histogram[a]=(this.histogram[a]||0)+1}this.totalCount=n}computeSimilarity(e){var t,i;let n=0;const o=Math.max(this.histogram.length,e.histogram.length);for(let r=0;r<o;r++)n+=Math.abs(((t=this.histogram[r])!==null&&t!==void 0?t:0)-((i=e.histogram[r])!==null&&i!==void 0?i:0));return 1-n/(this.totalCount+e.totalCount)}}Tu.chrKeys=new Map;class c3{compute(e,t,i=$f.instance,n){if(e.length===0||t.length===0)return _a.trivial(e,t);const o=new mv(e.length,t.length),r=new mv(e.length,t.length),a=new mv(e.length,t.length);for(let g=0;g<e.length;g++)for(let m=0;m<t.length;m++){if(!i.isValid())return _a.trivialTimedOut(e,t);const _=g===0?0:o.get(g-1,m),v=m===0?0:o.get(g,m-1);let b;e.getElement(g)===t.getElement(m)?(g===0||m===0?b=0:b=o.get(g-1,m-1),g>0&&m>0&&r.get(g-1,m-1)===3&&(b+=a.get(g-1,m-1)),b+=n?n(g,m):1):b=-1;const C=Math.max(_,v,b);if(C===b){const w=g>0&&m>0?a.get(g-1,m-1):0;a.set(g,m,w+1),r.set(g,m,3)}else C===_?(a.set(g,m,0),r.set(g,m,1)):C===v&&(a.set(g,m,0),r.set(g,m,2));o.set(g,m,C)}const l=[];let c=e.length,d=t.length;function u(g,m){(g+1!==c||m+1!==d)&&l.push(new _i(new Re(g+1,c),new Re(m+1,d))),c=g,d=m}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)r.get(h,f)===3?(u(h,f),h--,f--):r.get(h,f)===1?h--:f--;return u(-1,-1),l.reverse(),new _a(l,!1)}}class fA{compute(e,t,i=$f.instance){if(e.length===0||t.length===0)return _a.trivial(e,t);const n=e,o=t;function r(m,_){for(;m<n.length&&_<o.length&&n.getElement(m)===o.getElement(_);)m++,_++;return m}let a=0;const l=new d3;l.set(0,r(0,0));const c=new u3;c.set(0,l.get(0)===0?null:new px(null,0,0,l.get(0)));let d=0;e:for(;;){if(a++,!i.isValid())return _a.trivialTimedOut(n,o);const m=-Math.min(a,o.length+a%2),_=Math.min(a,n.length+a%2);for(d=m;d<=_;d+=2){const v=d===_?-1:l.get(d+1),b=d===m?-1:l.get(d-1)+1,C=Math.min(Math.max(v,b),n.length),w=C-d;if(C>n.length||w>o.length)continue;const y=r(C,w);l.set(d,y);const L=C===v?c.get(d+1):c.get(d-1);if(c.set(d,y!==C?new px(L,C,w,y-C):L),l.get(d)===n.length&&l.get(d)-d===o.length)break e}}let u=c.get(d);const h=[];let f=n.length,g=o.length;for(;;){const m=u?u.x+u.length:0,_=u?u.y+u.length:0;if((m!==f||_!==g)&&h.push(new _i(new Re(m,f),new Re(_,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new _a(h,!1)}}class px{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class d3{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class u3{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class u_{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let n=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Re(t.start-1,t.endExclusive),n=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;o<this.lineRange.endExclusive;o++){let r=e[o],a=0;if(n)a=r.length,r="",n=!1;else if(!i){const l=r.trimStart();a=r.length-l.length,r=l.trimEnd()}this.additionalOffsetByLine.push(a);for(let l=0;l<r.length;l++)this.elements.push(r.charCodeAt(l));o<e.length-1&&(this.elements.push(10),this.firstCharOffsetByLine[o-this.lineRange.start+1]=this.elements.length)}this.additionalOffsetByLine.push(0)}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new Re(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(t=>String.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=vx(e>0?this.elements[e-1]:-1),i=vx(e<this.elements.length?this.elements[e]:-1);if(
|
||
|
|
`).length>=15&&g3(u,f=>f.length>=2)>=2}),r=v3(s,r),r}function g3(s,e){let t=0;for(const i of s)e(i)&&t++;return t}function m3(s,e,t,i){const n=[],o=s.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Tu(l.original,e,l)),r=new Set(s.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Tu(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,d;for(const u of r){const h=l.computeSimilarity(u);h>c&&(c=h,d=u)}if(c>.9&&d&&(r.delete(d),n.push(new kn(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:n,excludedChanges:a}}return{moves:n,excludedChanges:a}}function p3(s,e,t,i,n,o){const r=[],a=new lA;for(const h of s)for(let f=h.original.startLineNumber;f<h.original.endLineNumberExclusive-2;f++){const g=`${e[f-1]}:${e[f+1-1]}:${e[f+2-1]}`;a.add(g,{range:new Me(f,f+3)})}const l=[];s.sort(oo(h=>h.modified.startLineNumber,ul));for(const h of s){let f=[];for(let g=h.modified.startLineNumber;g<h.modified.endLineNumberExclusive-2;g++){const m=`${t[g-1]}:${t[g+1-1]}:${t[g+2-1]}`,_=new Me(g,g+3),v=[];a.forEach(m,({range:b})=>{for(const w of f)if(w.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){w.originalLineRange=new Me(w.originalLineRange.startLineNumber,b.endLineNumberExclusive),w.modifiedLineRange=new Me(w.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(w);return}const C={modifiedLineRange:_,originalLineRange:b};l.push(C),v.push(C)}),f=v}if(!o.isValid())return[]}l.sort(w5(oo(h=>h.modifiedLineRange.length,ul)));const c=new Ms,d=new Ms;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),m=d.subtractFrom(h.originalLineRange).getWithDelta(f),_=g.getIntersection(m);for(const v of _.ranges){if(v.length<3)continue;const b=v,C=v.delta(-f);r.push(new kn(C,b)),c.addRange(b),d.addRange(C)}}r.sort(oo(h=>h.original.startLineNumber,ul));const u=new Ug(s);for(let h=0;h<r.length;h++){const f=r[h],g=u.findLastMonotonous(L=>L.original.startLineNumber<=f.original.startLineNumber),m=Nu(s,L=>L.modified.startLineNumber<=f.modified.startLineNumber),_=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-m.modified.startLineNumber),v=u.findLastMonotonous(L=>L.original.startLineNumber<f.original.endLineNumberExclusive),b=Nu(s,L=>L.modified.startLineNumber<f.modified.endLineNumberExclusive),C=Math.max(v.original.endLineNumberExclusive-f.original.endLineNumberExclusive,b.modified.endLineNumberExclusive-f.modified.endLineNumberExclusive);let w;for(w=0;w<_;w++){const L=f.original.startLineNumber-w-1,k=f.modified.startLineNumber-w-1;if(L>i.length||k>n.length||c.contains(k)||d.contains(L)||!bx(i[L-1],n[k-1],o))break}w>0&&(d.addRange(new Me(f.original.startLineNumber-w,f.original.startLineNumber)),c.addRange(new Me(f.modified.startLineNumber-w,f.modified.startLineNumber)));let y;for(y=0;y<C;y++){const L=f.original.endLineNumberExclusive+y,k=f.modified.endLineNumberExclusive+y;if(L>i.length||k>n.length||c.contains(k)||d.contains(L)||!bx(i[L-1],n[k-1],o))break}y>0&&(d.addRange(new Me(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+y)),c.addRange(new Me(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+y))),(w>0||y>0)&&(r[h]=new kn(new Me(f.original.startLineNumber-w,f.original.endLineNumberExclusive+y),new Me(f.modified.startLineNumber-w,f.modified.endLineNumberExclusive+y)))}return r}function bx(s,e,t){if(s.trim()===e.trim())return!0;if(s.length>300&&e.length>300)return!1;const n=new fA().compute(new u_([s],new Re(0,1),!1),new u_([e],new Re(0,1),!1),t);let o=0;const r=_i.invert(n.diffs,s.length);for(const d of r)d.seq1Range.forEach(u=>{ZC(s.charCodeAt(u))||o++});function a(d){let u=0;for(let h=0;h<s.length;h++)ZC(d.charCodeAt(h))||u++;return u}const l=a(s.length>e.length?s:e);return o/l>.6&&l>10}function _3(s){if(s.length===0)return s;s.sort(oo(t=>t.original.startLineNumber,ul));const e=[s[0]];for(let t=1;t<s.length;t++){const i=e[e.length-1],n=s[t]
|
||
|
|
`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function Sx(s){let e=0;for(;e<s.length&&(s.charCodeAt(e)===32||s.charCodeAt(e)===9);)e++;return e}class gA{constructor(){this.dynamicProgrammingDiffing=new c3,this.myersDiffingAlgorithm=new fA}computeDiff(e,t,i){if(e.length<=1&&Wi(e,t,(y,L)=>y===L))return new yp([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new yp([new ws(new Me(1,e.length+1),new Me(1,t.length+1),[new Ao(new M(1,1,e.length,e[e.length-1].length+1),new M(1,1,t.length,t[t.length-1].length+1))])],[],!1);const n=i.maxComputationTimeMs===0?$f.instance:new l3(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(y){let L=r.get(y);return L===void 0&&(L=r.size,r.set(y,L)),L}const l=e.map(y=>a(y.trim())),c=t.map(y=>a(y.trim())),d=new yx(l,e),u=new yx(c,t),h=d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,n,(y,L)=>e[y]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,u,n);let f=h.diffs,g=h.hitTimeout;f=YC(d,u,f),f=S3(d,u,f);const m=[],_=y=>{if(o)for(let L=0;L<y;L++){const k=v+L,D=b+L;if(e[k]!==t[D]){const N=this.refineDiff(e,t,new _i(new Re(k,k+1),new Re(D,D+1)),n,o);for(const W of N.mappings)m.push(W);N.hitTimeout&&(g=!0)}}};let v=0,b=0;for(const y of f){Pc(()=>y.seq1Range.start-v===y.seq2Range.start-b);const L=y.seq1Range.start-v;_(L),v=y.seq1Range.endExclusive,b=y.seq2Range.endExclusive;const k=this.refineDiff(e,t,y,n,o);k.hitTimeout&&(g=!0);for(const D of k.mappings)m.push(D)}_(e.length-v);const C=Lx(m,e,t);let w=[];return i.computeMoves&&(w=this.computeMoves(C,e,t,l,c,n,o)),Pc(()=>{function y(k,D){if(k.lineNumber<1||k.lineNumber>D.length)return!1;const N=D[k.lineNumber-1];return!(k.column<1||k.column>N.length+1)}function L(k,D){return!(k.startLineNumber<1||k.startLineNumber>D.length+1||k.endLineNumberExclusive<1||k.endLineNumberExclusive>D.length+1)}for(const k of C){if(!k.innerChanges)return!1;for(const D of k.innerChanges)if(!(y(D.modifiedRange.getStartPosition(),t)&&y(D.modifiedRange.getEndPosition(),t)&&y(D.originalRange.getStartPosition(),e)&&y(D.originalRange.getEndPosition(),e)))return!1;if(!L(k.modified,t)||!L(k.original,e))return!1}return!0}),new yp(C,w,g)}computeMoves(e,t,i,n,o,r,a){return f3(e,t,i,n,o,r).map(d=>{const u=this.refineDiff(t,i,new _i(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),h=Lx(u.mappings,t,i,!0);return new cA(d,h)})}refineDiff(e,t,i,n,o){const r=new u_(e,i.seq1Range,o),a=new u_(t,i.seq2Range,o),l=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,n):this.myersDiffingAlgorithm.compute(r,a,n);let c=l.diffs;return c=YC(r,a,c),c=w3(r,a,c),c=C3(r,a,c),c=L3(r,a,c),{mappings:c.map(u=>new Ao(r.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function Lx(s,e,t,i=!1){const n=[];for(const o of hS(s.map(r=>k3(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];n.push(new ws(r.original.join(a.original),r.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Pc(()=>!i&&n.length>0&&(n[0].modified.startLineNumber!==n[0].original.startLineNumber||t.length-n[n.length-1].modified.endLineNumberExclusive!==e.length-n[n.length-1].original.endLineNumberExclusive)?!1:XS(n,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive<r.original.startLineNumber&&o.modified.endLineNumberExclusive<r.modified.startLineNumber)),n}function k3(s,e,t){let i=0,n=0;s.modifiedRange.endColumn===1&&s.originalRange.endColumn===1&&s.originalRange.startLineNumber+i<=s.originalRange.endLineNumber&&s.modifiedRange.startLineNumber+i<=s.modifiedRange.endLineNumber&&(n=-1),s.modifiedRange.startColumn-1>=t[s.modifiedRange.startLineNumber-1].length&&s.originalRange.startColumn-1>=e[s.originalRange.startLineNumber-1].length&&s.originalRange.startLineNumber<=s.originalRange.endLineNumber+n&&s.modifiedRange.startLineNumber<=s.modifiedRange.endLineNumber+n&&(i=1
|
||
|
|
`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,u=0,h=null,f=!0;for(;f||u<l;){const g=u,m=d.depth,_=h?h.groups.length:0,v=d.state;let b=null,C=null,w=null,y=null,L=null;if(h){b=h.matches;const N=h.groups.shift();C=N.matched,w=N.action,y=h.rule,h.groups.length===0&&(h=null)}else{if(!f&&u>=l)break;f=!1;let N=this._lexer.tokenizer[v];if(!N&&(N=Lm(this._lexer,v),!N))throw Pt(this._lexer,"tokenizer state is not defined: "+v);const W=a.substr(u);for(const R of N)if((u===0||!R.matchOnlyAtLineStart)&&(b=W.match(R.resolveRegex(v)),b)){C=b[0],w=R.action;break}}if(b||(b=[""],C=""),w||(u<l&&(b=[a.charAt(u)],C=b[0]),w=this._lexer.defaultToken),C===null)break;for(u+=C.length;i8(w)&&Rx(w)&&w.test;)w=w.test(C,b,v,u===l);let k=null;if(typeof w=="string"||Array.isArray(w))k=w;else if(w.group)k=w.group;else if(w.token!==null&&w.token!==void 0){if(w.tokenSubst?k=ja(this._lexer,w.token,C,b,v):k=w.token,w.nextEmbedded)if(w.nextEmbedded==="@pop"){if(!c)throw Pt(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw Pt(this._lexer,"cannot enter embedded language from within an embedded language");L=ja(this._lexer,w.nextEmbedded,C,b,v)}if(w.goBack&&(u=Math.max(0,u-w.goBack)),w.switchTo&&typeof w.switchTo=="string"){let N=ja(this._lexer,w.switchTo,C,b,v);if(N[0]==="@"&&(N=N.substr(1)),Lm(this._lexer,N))d=d.switchTo(N);else throw Pt(this._lexer,"trying to switch to a state '"+N+"' that is undefined in rule: "+this._safeRuleName(y))}else{if(w.transform&&typeof w.transform=="function")throw Pt(this._lexer,"action.transform not supported");if(w.next)if(w.next==="@push"){if(d.depth>=this._lexer.maxStack)throw Pt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(w.next==="@pop"){if(d.depth<=1)throw Pt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(y));d=d.pop()}else if(w.next==="@popall")d=d.popall();else{let N=ja(this._lexer,w.next,C,b,v);if(N[0]==="@"&&(N=N.substr(1)),Lm(this._lexer,N))d=d.push(N);else throw Pt(this._lexer,"trying to set a next state '"+N+"' that is undefined in rule: "+this._safeRuleName(y))}}w.log&&typeof w.log=="string"&&n8(this._lexer,this._lexer.languageId+": "+ja(this._lexer,w.log,C,b,v))}if(k===null)throw Pt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(y));const D=N=>{const W=this._languageService.getLanguageIdByLanguageName(N)||this._languageService.getLanguageIdByMimeType(N)||N,R=this._getNestedEmbeddedLanguageData(W);if(u<l){const A=e.substr(u);return this._nestedTokenize(A,t,qa.create(d,R),n+u,o)}else return qa.create(d,R)};if(Array.isArray(k)){if(h&&h.groups.length>0)throw Pt(this._lexer,"groups cannot be nested: "+this._safeRuleName(y));if(b.length!==k.length+1)throw Pt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(y));let N=0;for(let W=1;W<b.length;W++)N+=b[W].length;if(N!==C.length)throw Pt(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(y));h={rule:y,matches:b,groups:[]};for(let W=0;W<k.length;W++)h.groups[W]={action:k[W],matched:b[W+1]};u-=C.length;continue}else{if(k==="@rematch"&&(u-=C.length,C="",b=null,k="",L!==null))return D(L);if(C.length===0){if(l===0||m!==d.depth||v!==d.state||(h?h.groups.length:0)!==_)continue;throw Pt(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(y))}let N=null;if(kA(k)&&k.indexOf("@brackets")===0){const W=k.substr(9),R=c8(this._lexer,C);if(!R)throw Pt(this._lexer,"@brackets token returned but no bracket defined as: "+C);N=Px(R.token+W)}else{const W=k===""?"":k+this._lexer.tokenPostfix;N=Px(W)}g<r&&o.emit(g+n,N)}if(L!==null)return D(L)}return qa.create(d,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new Ad(e,Kf);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),oi.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=oi.get(e);return t?new Ad(e,t.getInitialState()):new Ad(e,Kf)}};Gf=JC=r8([a8(4,Xt)],Gf);function c8(s,e)
|
||
|
|
`)}}const Q0=new D8;zi.add(IA.ColorContribution,Q0);function T(s,e,t,i,n){return Q0.registerColor(s,e,t,i,n)}function x8(s,e){var t,i,n,o;switch(s.op){case 0:return(t=bo(s.value,e))===null||t===void 0?void 0:t.darken(s.factor);case 1:return(i=bo(s.value,e))===null||i===void 0?void 0:i.lighten(s.factor);case 2:return(n=bo(s.value,e))===null||n===void 0?void 0:n.transparent(s.factor);case 3:{const r=bo(s.background,e);return r?(o=bo(s.value,e))===null||o===void 0?void 0:o.makeOpaque(r):bo(s.value,e)}case 4:for(const r of s.values){const a=bo(r,e);if(a)return a}return;case 6:return bo(e.defines(s.if)?s.then:s.else,e);case 5:{const r=bo(s.value,e);if(!r)return;const a=bo(s.background,e);return a?r.isDarkerThan(a)?K.getLighterColor(r,a,s.factor).transparent(s.transparency):K.getDarkerColor(r,a,s.factor).transparent(s.transparency):r.transparent(s.factor*s.transparency)}default:throw QS()}}function id(s,e){return{op:0,value:s,factor:e}}function Mo(s,e){return{op:1,value:s,factor:e}}function Le(s,e){return{op:2,value:s,factor:e}}function Wx(...s){return{op:4,values:s}}function E8(s,e,t){return{op:6,if:s,then:e,else:t}}function Vx(s,e,t,i){return{op:5,value:s,background:e,factor:t,transparency:i}}function bo(s,e){if(s!==null){if(typeof s=="string")return s[0]==="#"?K.fromHex(s):e.getColor(s);if(s instanceof K)return s;if(typeof s=="object")return x8(s,e)}}const NA="vscode://schemas/workbench-colors",TA=zi.as(G0.JSONContribution);TA.registerSchema(NA,Q0.getColorSchema());const Hx=new _n(()=>TA.notifySchemaChanged(NA),200);Q0.onDidChangeSchema(()=>{Hx.isScheduled()||Hx.schedule()});const Ke=T("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},p("foreground","Overall foreground color. This color is only used if not overridden by a component."));T("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},p("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));T("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},p("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));T("descriptionForeground",{light:"#717171",dark:Le(Ke,.7),hcDark:Le(Ke,.7),hcLight:Le(Ke,.7)},p("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Md=T("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},p("iconForeground","The default color for icons in the workbench.")),Ws=T("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},p("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),tt=T("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),si=T("contrastActiveBorder",{light:null,dark:null,hcDark:Ws,hcLight:Ws},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));T("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},p("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));const I8=T("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkForeground","Foreground color for links in text."));T("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));T("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:K.black,hcLight:"#292929"},p("textSeparatorForeground","Color for text separators."));T("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},p("textPref
|
||
|
|
${a}: ${r};`}return i+=`
|
||
|
|
}`,i}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function oB(s){return s.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class jg extends G{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<n;i++){const o=e[i];switch(o.type){case 0:this.onCompositionStart(o)&&(t=!0);break;case 1:this.onCompositionEnd(o)&&(t=!0);break;case 2:this.onConfigurationChanged(o)&&(t=!0);break;case 3:this.onCursorStateChanged(o)&&(t=!0);break;case 4:this.onDecorationsChanged(o)&&(t=!0);break;case 5:this.onFlushed(o)&&(t=!0);break;case 6:this.onFocusChanged(o)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(o)&&(t=!0);break;case 8:this.onLineMappingChanged(o)&&(t=!0);break;case 9:this.onLinesChanged(o)&&(t=!0);break;case 10:this.onLinesDeleted(o)&&(t=!0);break;case 11:this.onLinesInserted(o)&&(t=!0);break;case 12:this.onRevealRangeRequest(o)&&(t=!0);break;case 13:this.onScrollChanged(o)&&(t=!0);break;case 15:this.onTokensChanged(o)&&(t=!0);break;case 14:this.onThemeChanged(o)&&(t=!0);break;case 16:this.onTokensColorsChanged(o)&&(t=!0);break;case 17:this.onZonesChanged(o)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(o)}}t&&(this._shouldRender=!0)}}class os extends jg{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class Fo{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(n);for(let r=0;r<n;r++)o[r]=i[n-r-1];return o}}class rB{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class aB extends rB{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class lB{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class J0{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const o=e[i];t[i]=new J0(o.left,o.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){r
|
||
|
|
target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&this.hitTestResult.value.hitTarget!==null&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?vi.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return mn.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return mn.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return mn.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return mn.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return mn.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return mn.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return mn.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return mn.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return mn.createOverlayWidget(this.target,this._getMouseColumn(),e)}}const Jx={isAfterLines:!0};function bv(s){return{isAfterLines:!1,horizontalDistanceToText:s}}class fn{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=Fo.collect(t,this._viewHelper.viewDomNode);return!!(wn.isChildOfContentWidgets(i)||wn.isChildOfOverflowingContentWidgets(i)||wn.isChildOfOverlayWidgets(i)||wn.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,n,o){const r=new Ru(this._context,this._viewHelper,e),a=new pB(r,t,i,n,o);try{const l=fn._createMouseTarget(r,a);if(l.type===6&&r.stickyTabStops&&l.position!==null){const c=fn._snapToSoftTabBoundary(l.position,r.viewModel),d=M.fromPositions(c,c).plusRange(l.range);return a.fulfillContentText(c,d,l.detail)}return l}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t){if(t.target===null)return t.fulfillUnknown();const i=t;let n=null;return!wn.isChildOfOverflowGuard(t.targetPath)&&!wn.isChildOfOverflowingContentWidgets(t.targetPath)&&!wn.isChildOfOverflowingOverlayWidgets(t.targetPath)&&(n=n||t.fulfillUnknown()),n=n||fn._hitTestContentWidget(e,i),n=n||fn._hitTestOverlayWidget(e,i),n=n||fn._hitTestMinimap(e,i),n=n||fn._hitTestScrollbarSlider(e,i),n=n||fn._hitTestViewZone(e,i),n=n||fn._hitTestMargin(e,i),n=n||fn._hitTestViewCursor(e,i),n=n||fn._hitTestTextArea(e,i),n=n||fn._hitTestViewLines(e,i),n=n||fn._hitTestScrollbar(e,i),n||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(wn.isChildOfContentWidgets(t.targetPath)||wn.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(wn.isChildOfOverlayWidgets(t.targetPath)||wn.isChildOfOverflowingOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const n of i)if(t.target===n.domNode)return t.fulfillContentText(n.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const r of i){if(n<r.contentLeft||n>r.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return wn.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContent
|
||
|
|
`,o+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(LC(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(kC(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);const r=t.value.substring(n,t.value.length-o),a=e.selectionStart-n,l=e.selectionEnd-n,c=t.selectionStart-n,d=t.selectionEnd-n;if(c===d){const h=e.selectionStart-n;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(LC(e.value,t.value),e.selectionEnd),n=Math.min(kC(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-r.length}}}Pi.EMPTY=new Pi("",0,0,null,void 0);class Vd{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 M(n,1,o+1,1)}static fromEditorSelection(e,t,i,n){const r=Vd._getPageOfLine(t.startLineNumber,i),a=Vd._getRangeForPage(r,i),l=Vd._getPageOfLine(t.endLineNumber,i),c=Vd._getRangeForPage(l,i);let d=a.intersectRanges(new M(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(d,1)>500){const v=e.modifyPosition(d.getEndPosition(),-500);d=M.fromPositions(v,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new M(t.endLineNumber,t.endColumn,h,f));if(n&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=M.fromPositions(g.getStartPosition(),v)}const m=e.getValueInRange(g,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=c.intersectRanges(t);_=e.getValueInRange(v,1)+"…"+e.getValueInRange(b,1)}return n&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new Pi(u+_+m,u.length,u.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var PB=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},i2=function(s,e){return function(t,i){e(t,i,s)}},w_;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(w_||(w_={}));const FB={forceCopyWithSyntaxHighlighting:!1};class y_{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)}}y_.INSTANCE=new y_;class OB{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let cw=class extends G{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,o,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=o,this._logService=r,this._onFocus=this._register(new O),this.onFocus=this._onFocus.event,this._onBlur=this._register(new O),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new O),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new O),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new O),this.onCut=this._onCut.event,this._onPaste=this._register(new O),this.onPaste=this._onPaste.event,this._onType=this._register(new O),this.onType=this
|
||
|
|
`):t.text,i),e.preventDefault(),e.clipboardData&&n2.setTextData(e.clipboardData,t.text,t.html,i)}};cw=PB([i2(4,Uo),i2(5,uo)],cw);const n2={getTextData(s){const e=s.getData(Jr.text);let t=null;const i=s.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&s.files.length>0?[Array.prototype.slice.call(s.files,0).map(o=>o.name).join(`
|
||
|
|
`),null]:[e,t]},setTextData(s,e,t,i){s.setData(Jr.text,e),typeof t=="string"&&s.setData("text/html",t),s.setData("vscode-editor-data",JSON.stringify(i))}};class BB extends G{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Ue(this._actual,"keydown")).event,this.onKeyUp=this._register(new Ue(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Ue(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Ue(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Ue(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Ue(this._actual,"beforeinput")).event,this.onInput=this._register(new Ue(this._actual,"input")).event,this.onCut=this._register(new Ue(this._actual,"cut")).event,this.onCopy=this._register(new Ue(this._actual,"copy")).event,this.onPaste=this._register(new Ue(this._actual,"paste")).event,this.onFocus=this._register(new Ue(this._actual,"focus")).event,this.onBlur=this._register(new Ue(this._actual,"blur")).event,this._onSyntheticTap=this._register(new O),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>el.onKeyDown())),this._register(this.onBeforeInput(()=>el.onBeforeInput())),this._register(this.onInput(()=>el.onInput())),this._register(this.onKeyUp(()=>el.onKeyUp())),this._register(j(this._actual,w_.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=ku(this._actual);return e?e.activeElement===this._actual:this._actual.isConnected?vn()===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const r=ku(n);r?o=r.activeElement:o=vn();const a=be(o),l=o===n,c=n.selectionStart,d=n.selectionEnd;if(l&&c===t&&d===i){lo&&a.parent!==a&&n.focus();return}if(l){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),lo&&a.parent!==a&&n.focus();return}try{const u=zO(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),UO(n,u)}catch{}}}class WB extends vL{constructor(e,t,i){super(e,t,i),this._register(Ft.addTarget(this.viewHelper.linesContentDomNode)),this._register(j(this.viewHelper.linesContentDomNode,It.Tap,o=>this.onTap(o))),this._register(j(this.viewHelper.linesContentDomNode,It.Change,o=>this.onChange(o))),this._register(j(this.viewHelper.linesContentDomNode,It.Contextmenu,o=>this._onContextMenu(new Dl(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(j(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new iB(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget)||(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),this._lastPointerType==="pen"&&this._dispatchGes
|
||
|
|
`),w=b.substring(C+1),y=w.lastIndexOf(" "),L=w.length-y-1,k=g.getStartPosition(),D=Math.min(k.column-1,L),N=k.column-1-D,W=w.substring(0,w.length-D),{tabSize:R}=this._context.viewModel.model.getOptions(),A=DW(this.textArea.domNode.ownerDocument,W,this._fontInfo,R);return{distanceToModelLineStart:N,widthOfHiddenTextBefore:A}})(),{distanceToModelLineEnd:v}=(()=>{const b=f.value.substring(Math.max(f.selectionStart,f.selectionEnd)),C=b.indexOf(`
|
||
|
|
`),w=C===-1?b:b.substring(0,C),y=w.indexOf(" "),L=y===-1?w.length:w.length-y-1,k=g.getEndPosition(),D=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,L);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-D}})();this._context.viewModel.revealRange("keyboard",!0,M.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new kW(this._context,g.startLineNumber,m,_,v),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${su} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(h=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${su}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(hf.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=Eu(t,[]);let o=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);n.get(d)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);n.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Eu(this._context.configuration.options.get(131),[]);let n=e.column,o=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||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 i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Di(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,n;if(e.get(2)===1){const r=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(n=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||n===void 0?void 0:n.getAriaLabel(),c=p("accessibilityModeOff","The editor is not accessible at this time.");return r?p("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,r):a?p("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?p("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===jc.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(145).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=wv?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(145);this._setAccessibil
|
||
|
|
`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:wv?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;nn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?K.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(57)?i.setClassName("monaco-editor-background textAreaCover "+Oc.OUTER_CLASS_NAME):n.get(68).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+Zg.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};uw=LW([o2(3,Zi),o2(4,vt)],uw);function DW(s,e,t,i){if(e.length===0)return 0;const n=s.createElement("div");n.style.position="absolute",n.style.top="-50000px",n.style.width="50000px";const o=s.createElement("span");nn(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),n.appendChild(o),s.body.appendChild(n);const r=o.offsetWidth;return s.body.removeChild(n),r}function xW(s,e,t){let i=0;for(let o=0;o<s.length;o++)s.charAt(o)===" "?i=vi.nextIndentTabStop(i,e):i++;let n="";if(!t){const o=Math.floor(i/e);i=i%e;for(let r=0;r<o;r++)n+=" "}for(let o=0;o<i;o++)n+=" ";return n}function iM(s,e,t){let i=es(s);return i===-1&&(i=s.length),xW(s.substring(0,i),e,t)+s.substring(i)}const EW=()=>!0,IW=()=>!1,NW=s=>s===" "||s===" ";class _d{static shouldRecreate(e){return e.hasChanged(145)||e.hasChanged(131)||e.hasChanged(37)||e.hasChanged(77)||e.hasChanged(79)||e.hasChanged(80)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(128)||e.hasChanged(50)||e.hasChanged(91)||e.hasChanged(130)}constructor(e,t,i,n){var o;this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const r=i.options,a=r.get(145),l=r.get(50);this.readOnly=r.get(91),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(116),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=r.get(128),this.wordSeparators=r.get(131),this.emptySelectionClipboard=r.get(37),this.copyWithSyntaxHighlighting=r.get(25),this.multiCursorMergeOverlapping=r.get(77),this.multiCursorPaste=r.get(79),this.multiCursorLimit=r.get(80),this.autoClosingBrackets=r.get(6),this.autoClosingComments=r.get(7),this.autoClosingQuotes=r.get(11),this.autoClosingDelete=r.get(9),this.autoClosingOvertype=r.get(10),this.autoSurround=r.get(14),this.autoIndent=r.get(12),this.wordSegmenterLocales=r.get(130),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const u of c)this.surroundingPairs[u.open]=u.close;const d=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=d==null?void 0:d.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){cons
|
||
|
|
* 'to': A mandatory logical position value providing where to move the cursor.
|
||
|
|
\`\`\`
|
||
|
|
'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
|
||
|
|
'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
|
||
|
|
'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
|
||
|
|
'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
|
||
|
|
\`\`\`
|
||
|
|
* 'by': Unit to move. Default is computed based on 'to' value.
|
||
|
|
\`\`\`
|
||
|
|
'line', 'wrappedLine', 'character', 'halfLine'
|
||
|
|
\`\`\`
|
||
|
|
* 'value': Number of units to move. Default is '1'.
|
||
|
|
* 'select': If 'true' makes the selection. Default is 'false'.
|
||
|
|
`,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},s.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},s.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case s.RawDirection.Left:n=0;break;case s.RawDirection.Right:n=1;break;case s.RawDirection.Up:n=2;break;case s.RawDirection.Down:n=3;break;case s.RawDirection.PrevBlankLine:n=4;break;case s.RawDirection.NextBlankLine:n=5;break;case s.RawDirection.WrappedLineStart:n=6;break;case s.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case s.RawDirection.WrappedLineColumnCenter:n=8;break;case s.RawDirection.WrappedLineEnd:n=9;break;case s.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case s.RawDirection.ViewPortTop:n=11;break;case s.RawDirection.ViewPortBottom:n=13;break;case s.RawDirection.ViewPortCenter:n=12;break;case s.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let o=0;switch(i.by){case s.RawUnit.Line:o=1;break;case s.RawUnit.WrappedLine:o=2;break;case s.RawUnit.Character:o=3;break;case s.RawUnit.HalfLine:o=4;break}return{direction:n,unit:o,select:!!i.select,value:i.value||1}}s.parse=t})(S_||(S_={}));class nM{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new sM(e,i)}shouldIncrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){const i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class bL{constructor(e,t){this.model=e,this.indentationLineProcessor=new sM(e,t)}getProcessedTokenContextAroundRange(e){const t=this._getProcessedTokensBeforeRange(e),i=this._getProcessedTokensAfterRange(e),n=this._getProcessedPreviousLineTokens(e);return{beforeRangeProcessedTokens:t,afterRangeProcessedTokens:i,previousLineProcessedTokens:n}}_getProcessedTokensBeforeRange(e){this.model.tokenization.forceTokenization(e.startLineNumber);const t=this.model.tokenization.getLineTokens(e.startLineNumber),i=hc(t,e.startColumn-1);let n;if(CL(this.model,e.getStartPosition())){const r=e.startColumn-1-i.firstCharOffset,a=i.firstCharOffset,l=a+r;n=t.sliceAndInflate(a,l,0)}else{const r=e.startColumn-1;n=t.sliceAndInflate(0,r,0)}return this.indentationLineProcessor.getProcessedTokens(n)}_getProcessedTokensAfterRange(e){const t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);const i=this.model.tokenization.getLineTokens(t.lineNumber),n=hc(i,t.column-1),o=t.column-1-n.firstCharOffset,r=n.firstCharOffset+o,a=n.firstCharOffset+n.getLineLength(),l=i.sliceAndInflate(r,a,0);return this.indentationLineProcessor.getProcessedTokens(l)}_getProcessedPreviousLineTokens(e){const t=f=>{this.model.tokenization.forceTokenization(f);const g=this.model.tokenization.getLineToken
|
||
|
|
`)!==n.length-1&&(o=!1),o){const u=new M(d.lineNumber,1,d.lineNumber,1);r[a]=new MW(u,n,c,!0)}else r[a]=new qn(c,n)}return new An(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,o){if(n||t.length===1)return null;if(o&&o.length===t.length)return o;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substr(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substr(0,i.length-1));const r=Xu(i);if(r.length===t.length)return r}return null}static paste(e,t,i,n,o,r){const a=this._distributePasteToCursors(e,i,n,o,r);return a?(i=i.sort(M.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,o)}static _goodIndentForLine(e,t,i){let n=null,o="";const r=n1(e.autoIndent,t,i,!1,e.languageConfigurationService);if(r)n=r.action,o=r.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Gc(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=hw(e.autoIndent,t,new M(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return n&&(n===xi.Indent&&(o=Zt.shiftIndent(e,o)),n===xi.Outdent&&(o=Zt.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;d<c;d++)o+=" "}else o=" ";return new qn(i,o,n)}static tab(e,t,i){const n=[];for(let o=0,r=i.length;o<r;o++){const a=i[o];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let c=this._goodIndentForLine(e,t,a.startLineNumber);c=c||" ";const d=e.normalizeIndentation(c);if(!l.startsWith(d)){n[o]=new qn(new M(a.startLineNumber,1,a.startLineNumber,l.length+1),d,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){const l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){n[o]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}n[o]=new rc(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static compositionType(e,t,i,n,o,r,a,l){const c=n.map(d=>this._compositionType(i,d,o,r,a,l));return new An(4,c,{shouldPushStackElementBefore:Fm(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new M(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new xp(d,i,0,r)}static _typeCommand(e,t,i){return i?new Rm(e,t,!0):new qn(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return Zt._typeCommand(n,`
|
||
|
|
`,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),c=gn(l).substring(0,n.startColumn-1);return Zt._typeCommand(n,`
|
||
|
|
`+e.normalizeIndentation(c),i)}const o=hw(e.autoIndent,t,n,e.languageConfigurationService);if(o){if(o.indentAction===xi.None)return Zt._typeCommand(n,`
|
||
|
|
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===xi.Indent)return Zt._typeCommand(n,`
|
||
|
|
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===xi.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),d=`
|
||
|
|
`+c+`
|
||
|
|
`+l;return i?new Rm(n,d,!0):new xp(n,d,-1,c.length-l.length,!0)}else if(o.indentAction===xi.Outdent){const l=Zt.unshiftIndent(e,o.indentation);return Zt._typeCommand(n,`
|
||
|
|
`+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=gn(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=WW(e.autoIndent,t,n,{unshiftIndent:c=>Zt.unshiftIndent(e,c),shiftIndent:c=>Zt.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,n.getEndPosition());const d=n.endColumn,u=t.getLineContent(n.endLineNumber),h=es(u);if(h>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,h+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Rm(n,`
|
||
|
|
`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return d<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new xp(n,`
|
||
|
|
`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return Zt._typeCommand(n,`
|
||
|
|
`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;n<o;n++)if(!t.tokenization.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const o=oA(t,i.startLineNumber,i.startColumn),r=VW(e.autoIndent,t,i,n,{shiftIndent:a=>Zt.shiftIndent(e,a),unshiftIndent:a=>Zt.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Zt._typeCommand(new M(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+n,!1):Zt._typeCommand(new M(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r<a;r++){const l=i[r];if(!l.isEmpty())return!1;const c=l.getPosition(),d=t.getLineContent(c.lineNumber);if(d.charAt(c.column-1)!==o)return!1;const h=Oa(o);if((c.column>2?d.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let m=0,_=n.length;m<_;m++){const v=n[m];if(c.lineNumber===v.startLineNumber&&c.column===v.startColumn){g=!0;break}}if(!g)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,o){const r=[];for(let a=0,l=n.length;a<l;a++){const d=n[a].getPosition(),u=new M(d.lineNumber,d.column,d.lineNumber,d.column+1);r[a]=new qn(u,o)}return new An(4,r,{shouldPushStackElementBefore:Fm(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(l=>t.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new M(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+n!==a.open){l=!1;break}l&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,n,o){for(const g of i)if(!g.isEmpty())return null;const r=i.map(g=>{const m=g.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-n.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(g=>new V(g.lineNumber,g.beforeColumn)),n);if(!a)return null;let l,c;if(Oa(n)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const u=this._findContainedAutoClosingPair(e,a),h=u?u.close:"";let f=!0;for(const g of r){const{lineNumber:m,beforeColumn:_,afterColumn:v}=g,b=t.getLineContent(m),C=b.substring(0,_-1),w=b.substring(v-1);if(w.startsWith(h)||(f=!1),w.length>0){const D=w.charAt(0);if(!Zt._isBeforeClosingBrace(e,w)&&!c(D))return null}if(a.open.length===1&&(n==="'"||n==='"')&&l!=="always"){const D=Eu(e.wordSeparators,[]);if(C.length>0){const N=C.charCodeAt(C.length-1);if(D.get(N)===0)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const y=t.tokenization.getLineTokens(m),L=hc(y,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;const k=a.findNeutralCharacter();if(k){const D=t.tokenization.getTokenTypeIfInsertingCharacter(m,_,k);if(!a.isOK(D))return null}}ret
|
||
|
|
`){const d=[];for(let u=0,h=o.length;u<h;u++)d[u]=Zt._enter(i,n,!1,o[u]);return new An(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,o)){const d=[];let u=!1;for(let h=0,f=o.length;h<f;h++)if(d[h]=this._runAutoIndentType(i,n,o[h],a),!d[h]){u=!0;break}if(!u)return new An(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,o,r,a))return this._runAutoClosingOvertype(t,i,n,o,a);if(!e){const d=this._getAutoClosingPairClose(i,n,o,a,!1);if(d)return this._runAutoClosingOpenCharType(t,i,n,o,a,!1,d)}if(!e&&this._isSurroundSelectionType(i,n,o,a))return this._runSurroundSelectionType(t,i,n,o,a);if(!e&&this._isTypeInterceptorElectricChar(i,n,o)){const d=this._typeInterceptorElectricChar(t,i,n,o[0],a);if(d)return d}const l=[];for(let d=0,u=o.length;d<u;d++)l[d]=new qn(o[d],a);const c=Lv(a,t);return new An(c,l,{shouldPushStackElementBefore:Fm(t,c),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,o){const r=[];for(let l=0,c=n.length;l<c;l++)r[l]=new qn(n[l],o);const a=Lv(o,e);return new An(a,r,{shouldPushStackElementBefore:Fm(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let o=0,r=i.length;o<r;o++){let a=i[o].positionLineNumber;if(a===1)n[o]=new Rm(new M(1,1,1,1),`
|
||
|
|
`);else{a--;const l=t.getLineMaxColumn(a);n[o]=this._enter(e,t,!1,new M(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const n=[];for(let o=0,r=i.length;o<r;o++){const a=i[o].positionLineNumber,l=t.getLineMaxColumn(a);n[o]=this._enter(e,t,!1,new M(a,l,a,l))}return n}static lineBreakInsert(e,t,i){const n=[];for(let o=0,r=i.length;o<r;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class oM extends xp{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new M(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new M(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}class zW{constructor(e,t,i,n,o,r){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=o,this.insertedSelectionEnd=r}}function Lv(s,e){return s===" "?e===5||e===6?6:5:4}function Fm(s,e){return a2(s)&&!a2(e)?!0:s===5?!1:r2(s)!==r2(e)}function r2(s){return s===6||s===5?"space":s}function a2(s){return s===4||s===5||s===6}var ae;(function(s){s.editorSimpleInput=new me("editorSimpleInput",!1,!0),s.editorTextFocus=new me("editorTextFocus",!1,p("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),s.focus=new me("editorFocus",!1,p("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),s.textInputFocus=new me("textInputFocus",!1,p("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),s.readOnly=new me("editorReadonly",!1,p("editorReadonly","Whether the editor is read-only")),s.inDiffEditor=new me("inDiffEditor",!1,p("inDiffEditor","Whether the context is a diff editor")),s.isEmbeddedDiffEditor=new me("isEmbeddedDiffEditor",!1,p("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),s.inMultiDiffEditor=new me("inMultiDiffEditor",!1,p("inMultiDiffEditor","Whether the context is a multi diff editor")),s.multiDiffEditorAllCollapsed=new me("multiDiffEditorAllCollapsed",void 0,p("multiDiffEditorAllCollapsed","Whether all files in multi diff editor are collapsed")),s.hasChanges=new me("diffEditorHasChanges",!1,p("diffEditorHasChanges","Whether the diff editor has changes")),s.comparingMovedCode=new me("comparingMovedCode",!1,p("comparingMovedCode","Whether a moved code block is selected for comparison")),s.accessibleDiffViewerVisible=new me("accessibleDiffViewerVisible",!1,p("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),s.diffEditorRenderSideBySideInlineBreakpointReached=new me("diffEditorRenderSideBySideInlineBreakpointReached",!1,p("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),s.diffEditorInlineMode=new me("diffEditorInlineMode",!1,p("diffEditorInlineMode","Whether inline mode is active")),s.diffEditorOriginalWritable=new me("diffEditorOriginalWritable",!1,p("diffEditorOriginalWritable","Whether modified is writable in the diff editor")),s.diffEditorModifiedWritable=new me("diffEditorModifiedWritable",!1,p("diffEditorModifiedWritable","Whether modified is writable in the diff editor")),s.diffEditorOriginalUri=new me("diffEditorOriginalUri","",p("diffEditorOriginalUri","The uri of the original document")),s.diffEditorModifiedUri=new me("diffEditorModifiedUri","",p("diffEditorModifiedUri","The uri of the modified document")),s.columnSelection=new me("editorColumnSelection",!1,p("editorColumnSelection","Whether `editor.columnSelection` is enabled")),s.writable=s.readOnly.toNegated(),s.hasNonEmptySelection=new me("editorHasSelection",!1,p("editorHasSelection","Whether the editor has text selected")),s.hasOnlyEmptySelection=s.hasNonEmptySelection.toNegated(),s.hasMultipleSelections=new me("editorH
|
||
|
|
`,"gi"):null,o=[];let r,a=0,l=0,c=0,d=0;const u=[];for(let g=0;g<60;g++)u.push(new Za(ni(0,g),0,-1,ui.getEmpty(),new ac(ni(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new Za(ni(1,g),0,-1,ui.getEmpty(),new ac(ni(1,g))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const g=r.index,m=r[0];if(m===`
|
||
|
|
`)a++,l=g+1;else{if(c!==g){let _;if(d===a){const v=g-c;if(v<u.length)_=u[v];else{const b=ni(0,v);_=new Za(b,0,-1,ui.getEmpty(),new ac(b))}}else{const v=a-d,b=g-l;if(v===1&&b<h.length)_=h[b];else{const C=ni(v,b);_=new Za(C,0,-1,ui.getEmpty(),new ac(C))}}o.push(_)}o.push(t.getToken(m)),c=g+m.length,d=a}}const f=e.length;if(c!==f){const g=d===a?ni(0,f-c):ni(a-d,f-l);o.push(new Za(g,0,-1,ui.getEmpty(),new ac(g)))}this.length=ni(a,f-l),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new PP}}class DL{static createFromLanguage(e,t){function i(o){return t.getKey(`${o.languageId}:::${o.bracketText}`)}const n=new Map;for(const o of e.bracketsNew.openingBrackets){const r=ni(0,o.bracketText.length),a=i(o),l=ui.getEmpty().add(a,k2);n.set(o.bracketText,new Za(r,1,a,l,x_.create(r,o,l)))}for(const o of e.bracketsNew.closingBrackets){const r=ni(0,o.bracketText.length);let a=ui.getEmpty();const l=o.getOpeningBrackets();for(const c of l)a=a.add(i(c),k2);n.set(o.bracketText,new Za(r,2,i(l[0]),a,x_.create(r,o,a)))}return new DL(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>cH(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function cH(s){let e=wa(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class dH{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=DL.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function uH(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const r=e,a=s[r].listHeight;for(e++;e<s.length&&s[e].listHeight===a;)e++;return e-r>=2?_M(r===0&&e===s.length?s:s.slice(r,e),!1):s[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())D2(i,n)<=D2(n,r)?(i=Nv(i,n),n=r):n=Nv(n,r);return Nv(i,n)}function _M(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const o=n<<1;s[n]=Lr.create23(s[o],s[o+1],o+3===t?s[o+2]:null,e)}t=i}return Lr.create23(s[0],s[1],t>=3?s[2]:null,e)}function D2(s,e){return Math.abs(s.listHeight-e.listHeight)}function Nv(s,e){return s.listHeight===e.listHeight?Lr.create23(s,e,null,!1):s.listHeight>e.listHeight?hH(s,e):fH(e,s)}function hH(s,e){s=s.toMutable();let t=s;const i=[];let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Lr.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Lr.create23(s,n,null,!1):s}function fH(s,e){s=s.toMutable();let t=s;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=Lr.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Lr.create23(n,s,null,!1):s}class gH{constructor(e){this.lastOffset=Bn,this.nextNodes=[e],this.offsets=[Bn],this.idxs=[]}readLongestNodeAt(e,t){if(au(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=yh(this.nextNodes);if(!i)return;const n=yh(this.offsets);if(au(e,n))return;if(au(n,e))if(hi(n,i.length)<=e)this.nextNodeAfterCurre
|
||
|
|
`?0:1}function qr(s){return s?s instanceof SM||s instanceof xH:!1}class EL{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);qr(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);qr(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(qr(i)&&i.canAppend(this._model))return i;const n=new SM(p("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],ww(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const o=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=EL._computeCursorState(i,r),l=r.map((c,d)=>({index:d,textChange:c.textChange}));return l.sort((c,d)=>c.textChange.oldPosition===d.textChange.oldPosition?c.index-d.index:c.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),ww(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return At(i),null}}}class EH{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function IH(s,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let o;for(o=0;o<e&&o<i;o++){const h=s.charCodeAt(o),f=t.charCodeAt(o);if(h!==f)break}let r=0,a=0;for(let h=o;h<e;h++)s.charCodeAt(h)===32?r++:a++;let l=0,c=0;for(let h=o;h<i;h++)t.charCodeAt(h)===32?l++:c++;if(r>0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(r-l);if(d===0){n.spacesDiff=u,u>0&&0<=l-1&&l-1<s.length&&l<t.length&&t.charCodeAt(l)!==32&&s.charCodeAt(l-1)===32&&s.charCodeAt(s.length-1)===44&&(n.looksLikeAlignment=!0);return}if(u%d===0){n.spacesDiff=u/d;return}}function M2(s,e,t){const i=Math.min(s.getLineCount(),1e4);let n=0,o=0,r="",a=0;const l=[2,4,6,8,3,5,7],c=8,d=[0,0,0,0,0,0,0,0,0],u=new EH;for(let g=1;g<=i;g++){const m=s.getLineLength(g),_=s.getLineContent(g),v=m<=65536;let b=!1,C=0,w=0,y=0;for(let k=0,D=m;k<D;k++){const N=v?_.charCodeAt(k):s.getLineCharCode(g,k);if(N===9)y++;else if(N===32)w++;else{b=!0,C=k;break}}if(!b||(y>0?n++:w>1&&o++,IH(r,a,_,C,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const L=u.spacesDiff;L<=c&&d[L]++,r=_,a=C}let h=t;n!==o&&(h=n<o);let f=e;if(h){let g=h?0:.1*i;l.forEach(m=>{const _=d[m];_>g&&(g=_,f=m)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function Mn(s){return(s.metadata&1)>>>0}function Rt(s,e){s.metadata=s.metadata&254|e<<0}function Gi(s){return(s.metadata&2)>>>1===1}function Nt(s,e){s.metadata=s.metadata&253|(e?1:0)<<1}function LM(s){return(s.metadata&4)>>>2===1}function R2(s,e){s.metadata=s.metadata&251|(e?1:0)<<2}function kM(s){return(s.metadata&64)>>>6===1}function P2(s,e){s.metadata=s.metadata&191|(e?1:0)<<6}function NH(s){return(s.metadata&24)>>>3}function F2(s,e){s.metadata=s.metadata&231|e<<3}function TH(s){return(s.metadata&32)>>>5===1}function O2(s,e){s.metadata=s.metadata&223|(e?1:0)<<5}class DM{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Rt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,R2(this,!1),P2(this,!1),F2(this,1),O2(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Nt(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;const t=this.options.className;R2(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),P2(this,this.options.glyphMarginClassName!==null),F2(this,this.options.stickiness),O2(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}deta
|
||
|
|
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,o-1)===13){const m=this.positionInBuffer(n,o-1);this.deleteNodeTail(n,m),t="\r"+t,n.piece.length===0&&d.push(n)}else this.deleteNodeTail(n,c);else this.deleteNodeTail(n,c);const h=this.createNewPieces(t);u.length>0&&this.rbInsertRight(n,u);let f=n;for(let g=0;g<h.length;g++)f=this.rbInsertRight(f,h[g]);this.deleteNodes(d)}else this.insertContentToNodeRight(t,n)}else{const n=this.createNewPieces(t);let o=this.rbInsertLeft(null,n[0]);for(let r=1;r<n.length;r++)o=this.rbInsertRight(o,n[r])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===Te)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),o=i.node,r=n.node;if(o===r){const h=this.positionInBuffer(o,i.remainder),f=this.positionInBuffer(o,n.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const g=o.next();Hm(this,o),this.validateCRLFWithPrevNode(g),this.computeBufferMetadata();return}this.deleteNodeHead(o,f),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),this.computeBufferMetadata();return}if(i.nodeStartOffset+o.piece.length===e+t){this.deleteNodeTail(o,h),this.validateCRLFWithNextNode(o),this.computeBufferMetadata();return}this.shrinkNode(o,h,f),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,l),this._searchCache.validate(e),o.piece.length===0&&a.push(o);const c=this.positionInBuffer(r,n.remainder);this.deleteNodeHead(r,c),r.piece.length===0&&a.push(r);const d=o.next();for(let h=d;h!==Te&&h!==r;h=h.next())a.push(h);const u=o.piece.length===0?o.prev():o;this.deleteNodes(a),this.validateCRLFWithNextNode(u),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const r=t.piece,a={line:r.start.line+1,column:0},l=new Un(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=l,e+=`
|
||
|
|
`,Vr(this,t,-1,-1),t.piece.length===0&&i.push(t)}const n=this.createNewPieces(e);let o=this.rbInsertLeft(t,n[n.length-1]);for(let r=n.length-2;r>=0;r--)o=this.rbInsertLeft(o,n[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
|
||
|
|
`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let r=1;r<i.length;r++)o=this.rbInsertRight(o,i[r]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,o=e.piece.bufferIndex,r=this._buffers[o].lineStarts,l=r[n.start.line]+n.start.column+t;let c=n.start.line,d=n.end.line,u=0,h=0,f=0;for(;c<=d&&(u=c+(d-c)/2|0,f=r[u],u!==d);)if(h=r[u+1],l<f)d=u-1;else if(l>=h)c=u+1;else break;return i?(i.line=u,i.column=l-f,null):{line:u,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],r=n[i.line]+i.column;if(o>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)Hm(this,e[t])}createNewPieces(e){if(e.length>Pr){const d=[];for(;e.length>Pr;){const h=e.charCodeAt(Pr-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,Pr-1),e=e.substring(Pr-1)):(f=e.substring(0,Pr),e=e.substring(Pr));const g=zr(f);d.push(new Un(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new lc(f,g))}const u=zr(e);return d.push(new Un(this._buffers.length,{line:0,column:0},{line:u.length-1,column:e.length-u[u.length-1]},u.length-1,e.length)),this._buffers.push(new lc(e,u)),d}let t=this._buffers[0].buffer.length;const i=zr(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&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 d=0;d<i.length;d++)i[d]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let d=0;d<i.length;d++)i[d]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,r=this._buffers[0].lineStarts.length-1,a=o-this._buffers[0].lineStarts[r],l={line:r,column:a},c=new Un(0,n,l,this.getLineFeedCnt(0,n,l),o-t);return this._lastChangeBufferPos=l,[c]}getLineRawContent(e,t=0){let i=this.root,n="";const o=this._searchCache.get2(e);if(o){i=o.node;const r=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=a.substring(l+r,l+i.piece.length);else{const c=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return a.substring(l+r,l+c-t)}}else{let r=0;const a=e;for(;i!==Te;)if(i.left!==Te&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,u=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(u+l,u+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Te;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Te;)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.
|
||
|
|
`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=zr(t,!1);for(let f=0;f<o.length;f++)o[f]+=n;if(i){const f=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-f}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const r=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[r],l={line:r,column:a},c=e.piece.length+t.length,d=e.piece.lineFeedCnt,u=this.getLineFeedCnt(0,e.piece.start,l),h=u-d;e.piece=new Un(e.piece.bufferIndex,e.piece.start,l,u,c),this._lastChangeBufferPos=l,Vr(this,e,t.length,h)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==Te;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==Te;)if(i.left!==Te&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const 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}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Te;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
|
||
|
|
`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Te||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n===i.length-1||i[n+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Te||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Un(e.piece.bufferIndex,e.piece.start,o,a,r),Vr(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Un(t.piece.bufferIndex,l,t.piece.end,d,c),Vr(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces(`\r
|
||
|
|
`);this.rbInsertRight(e,u[0]);for(let h=0;h<i.length;h++)Hm(this,i[h])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+=`
|
||
|
|
`,i.piece.length===1)Hm(this,i);else{const n=i.piece,o={line:n.start.line+1,column:0},r=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,o,n.end);i.piece=new Un(n.bufferIndex,o,n.end,a,r),Vr(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===Te)return t(Te);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===Te)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),o=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,o)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){const i=new yw(t,1);if(i.left=Te,i.right=Te,i.parent=Te,i.size_left=0,i.lf_left=0,this.root===Te)this.root=i,i.color=0;else if(e.right===Te)e.right=i,i.parent=e;else{const o=IL(e.right);o.left=i,i.parent=o}return V2(this,i),i}rbInsertLeft(e,t){const i=new yw(t,1);if(i.left=Te,i.right=Te,i.parent=Te,i.size_left=0,i.lf_left=0,this.root===Te)this.root=i,i.color=0;else if(e.left===Te)e.left=i,i.parent=e;else{const n=EM(e.left);n.right=i,i.parent=n}return V2(this,i),i}}class cu extends G{constructor(e,t,i,n,o,r,a){super(),this._onDidChangeContent=this._register(new O),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new qH(e,i,a)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new M(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){const l=r.length-a.length,c=e.endLineNumber-e.startLineNumber;o=l*c}return n-i+o}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let r=n;r<=o;r++){const a=this.getLineContent(r),l=r===n?e.startColumn-1:0,c=r===o?e.endColumn-1:a.length;for(let d=l;d<c;d++)Di(a.charCodeAt(d))?(i=i+1,d=d+1):i=i+1}return i+=this._getEndOfLine(t).length*(o-n),i}return this.getValueLengthInRange(e,t)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){const t=es(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Gc(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return`
|
||
|
|
`;case 2:return`\r
|
||
|
|
`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let m=0;m<e.length;m++){const _=e[m];a&&_._isTracked&&(a=!1);const v=_.range;if(_.text){let L=!0;r||(L=!AS(_.text),r=L),!n&&L&&(n=Ff(_.text)),!o&&L&&(o=lT(_.text))}let b="",C=0,w=0,y=0;if(_.text){let L;[C,w,y,L]=Wc(_.text);const k=this.getEOL();L===0||L===(k===`\r
|
||
|
|
`?2:1)?b=_.text:b=_.text.replace(/\r\n|\r|\n/g,k)}l[m]={sortIndex:m,identifier:_.identifier||null,range:v,rangeOffset:this.getOffsetAt(v.startLineNumber,v.startColumn),rangeLength:this.getValueLengthInRange(v),text:b,eolCount:C,firstLineLength:w,lastLineLength:y,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(cu._sortOpsAscending);let c=!1;for(let m=0,_=l.length-1;m<_;m++){const v=l[m].range.getEndPosition(),b=l[m+1].range.getStartPosition();if(b.isBeforeOrEqual(v)){if(b.isBefore(v))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const d=i||t?cu._getInverseEditRanges(l):[],u=[];if(t)for(let m=0;m<l.length;m++){const _=l[m],v=d[m];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let b=v.startLineNumber;b<=v.endLineNumber;b++){let C="";b===v.startLineNumber&&(C=this.getLineContent(_.range.startLineNumber),es(C)!==-1)||u.push({lineNumber:b,oldContent:C})}}let h=null;if(i){let m=0;h=[];for(let _=0;_<l.length;_++){const v=l[_],b=d[_],C=this.getValueInRange(v.range),w=v.rangeOffset+m;m+=v.text.length-C.length,h[_]={sortIndex:v.sortIndex,identifier:v.identifier,range:b,text:C,textChange:new Ki(v.rangeOffset,C,w,v.text)}}c||h.sort((_,v)=>_.sortIndex-v.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let g=null;if(t&&u.length>0){u.sort((m,_)=>_.lineNumber-m.lineNumber),g=[];for(let m=0,_=u.length;m<_;m++){const v=u[m].lineNumber;if(m>0&&u[m-1].lineNumber===v)continue;const b=u[m].oldContent,C=this.getLineContent(v);C.length===0||C===b||es(C)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new V9(h,f,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 M(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f<g;f++){const m=e[f],_=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new M(r,a,_.startLineNumber,_.startColumn))),m.text.length>0&&l.push(m.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,u,h]=Wc(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:d,firstLineLength:u,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(cu._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],o=n.range.startLineNumber,r=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(o===a&&r===l&&n.text.length===0)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);const c=new M(o,r,a,l);t.push({range:c,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){const t=[];let i=0,n=0,o=null;for(let r=0,a=e.length;r<a;r++){const l=e[r];let c,d;o?o.range.endLineNumber===l.range.startLineNumber?(c=i,d=n+(l.range.startColumn-o.range.endColumn)):(c=i+(l.range.startLineNumber-o.range.endLineNumber),d=l.range.startColumn):(c=l.range.startLineNumber,d=l.range.startColumn);let u;if(l.text.length>0){const h=l.eolCount+1;h===1?u=new M(c,d,c,d+l.firstLineLength):u=new M(c,d,c+h-1,l.lastLineLength+1)}else u=new M(c,d,c,d);i=u.endLineNumber,n=u.endColumn,t.push(u),o=l}return t}static _sortOpsAscending(e,t){const i=M.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=M.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class GH{constructor(e,t,i,n,o,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._n
|
||
|
|
`:`\r
|
||
|
|
`:i>t/2?`\r
|
||
|
|
`:`
|
||
|
|
`}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r
|
||
|
|
`&&(this._cr>0||this._lf>0)||t===`
|
||
|
|
`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o<r;o++){const a=i[o].buffer.replace(/\r\n|\r|\n/g,t),l=zr(a);i[o]=new lc(a,l)}const n=new cu(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class NM{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&RS(e)&&(this.BOM=MF,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===13||t>=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&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=$H(this._tmpLineStarts,e);this.chunks.push(new lc(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Ff(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=lT(e)))}finish(e=!0){return this._finish(),new GH(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=zr(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class ZH{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const n=this._store.slice(0,e),o=this._store.slice(e+t),r=YH(i,this._default);this._store=n.concat(r,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let n=0;n<t;n++)i[n]=this._default;this._store=k0(this._store,e,i)}}function YH(s,e){const t=[];for(let i=0;i<s;i++)t[i]=e;return t}class QH{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class Sw{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new QH(e,[t]))}finalize(){return this._tokens}}class XH{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new Lw(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class JH extends XH{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const o=this._textModel.getLineContent(n.lineNumber),r=Sh(this._languageIdCodec,i,this.tokenizationSupport,o,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=Sh(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),l=new bn(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.co
|
||
|
|
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=G.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Lc(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw x0();const{textBuffer:t,disposable:i}=z2(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new U2,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new ru([new VV],this._versionId,!1,!1),this._createContentChanged2(new M(1,1,o,r),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
|
||
|
|
`:`
|
||
|
|
`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new ru([new UV],this._versionId,!1,!1),this._createContentChanged2(new M(1,1,o,r),0,n,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const o=t[i],r=o.range,a=o.cachedAbsoluteStart-o.start,l=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),c=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);o.cachedAbsoluteStart=l,o.cachedAbsoluteEnd=c,o.cachedVersionId=e,o.start=l-a,o.end=c-a,xl(o)}}onBeforeAttached(){return this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}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 o=this._buffer.getLineLength(n);o>=cz?t+=o:e+=o}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();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new wp({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=M2(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),iM(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(aT.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.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();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.ge
|
||
|
|
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Dt("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Dt("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Dt("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const u=this.getLineMaxColumn(o);r>=u&&(r=u)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const u=this.getLineMaxColumn(c);d>=u&&(d=u)}return i===o&&n===r&&a===c&&l===d&&e instanceof M&&!(e instanceof yt)?e:new M(o,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(Di(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new V(1,1);if(n>r)return new V(r,this.getLineMaxColumn(r));if(o<=1)return new V(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new V(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,o-2);if(Di(l))return new V(n,o-1)}return new V(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof V&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(o,r,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,c=Di(a),d=Di(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof M&&!(e instanceof yt)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const c=r>1?this._buffer.getLineCharCode(o,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=Di(c),h=Di(d);return!u&&!h?new M(o,r,a,l):o===a&&r===l?new M(o,r-1,a,l-1):u&&h?new M(o,r-1,a,l+1):u?new M(o,r-1,a,l):new M(o,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const 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 M(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,r,a=lz){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>M.isIRange(u))&&(l=t.map(u=>this.validateRange(u)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((u,h)=>u.startLineNumber-h.startLineNumber||u.startColumn-h.startColumn);const c=[];c.push(l.reduce((u,h)=>M.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!i&&e.indexOf(`
|
||
|
|
`)<0){const h=new md(e,i,n,o).parseSearchRequest();if(!h)return[];d=f=>this.findMatchesLineByLine(f,h,r,a)}else d=u=>Sm.findMatches(this,new md(e,i,n,o),u,r,a);return c.map(d).reduce((u,h)=>u.concat(h),[])}findNextMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
|
||
|
|
`)<0){const c=new md(e,i,n,o).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new M(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),h=this.findMatchesLineByLine(u,c,r,1);return Sm.findNextMatch(this,new md(e,i,n,o),a,r),h.length>0||(u=new M(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,c,r,1),h.length>0)?h[0]:null}return Sm.findNextMatch(this,new md(e,i,n,o),a,r)}findPreviousMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return Sm.findPreviousMatch(this,new md(e,i,n,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===`
|
||
|
|
`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof gv?e:new gv(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<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const o=t.map(a=>({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;a<l;a++){const c=e[a];let d=!1;for(let u=0,h=o.length;u<h;u++){const f=o[u].range,g=f.startLineNumber>c.endLineNumber,m=c.startLineNumber>f.endLineNumber;if(!g&&!m){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;a<l;a++){const c=this._trimAutoWhitespaceLines[a],d=this.getLineMaxColumn(c);let u=!0;for(let h=0,f=o.length;h<f;h++){const g=o[h].range,m=o[h].text;if(!(c<g.startLineNumber||c>g.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&m&&m.length>0&&m.charAt(0)===`
|
||
|
|
`)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===`
|
||
|
|
`)){u=!1;break}}if(u){const h=new M(c,1,c,d);t.push(new gv(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new M(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new M(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,r){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(r),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(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c<d;c++){const u=r[c];this._decorationsTree.acceptReplace(u.rangeOffset,u.rangeLength,u.text.length,u.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let c=0,d=r.length;c<d;c++){const u=r[c],[h]=Wc(u.text);this._onDidChangeDecorations.fire();const f=u.range.startLineNumber,g=u.range.endLineNumber,m=g-f,_=h,v=Math.min(m,_),b=_-m,C=o-l-b+f,w=C,y=C+_,L=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new V(w,1)),this.getOffsetAt(new V(y,this.getLineMaxColumn(y))),0),k=Oo.fromDecorations(L),D=new ba(k);for(let N=v;N>=0;N--){const W=f+N,R=C+N;D.takeFromEndWhile(P=>P.lineNumber>R);const A=D.takeFromEndWhile(P=>P.lineNumber===R);a.push(new S2(W,this.getLineContent(R),A))}if(v<m){const N=f+v;a.push(new HV(N+1,g))}if(v<_){const N=new ba(k),W=f+v,R=_-v,A=o-l-R+W+1,P=[],H=[];for(let q=0;q<R;q++){const re=A+q;H[q]=this.getLineContent(re),N.takeWhile(de=>de.lineNumber<re),P[q]=N.takeWhile(de=>de.lineNumber===re)}a.push(new zV(W+1,f+_,H,P))}l+=b}this._emitContentChangedEvent(new ru(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(n=>new S2(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new gM(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,K2(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let n=null;try{n=t(i)}catch(o){At(o)}return i.addDecoration=Lh,i.changeDecoration=Lh,i.changeDecorationOptions=Lh,i.removeDecoration=Lh,
|
||
|
|
`)>=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=o.text.length-r[2].length-1,u=o.text.lastIndexOf(c,d-1);if(u===-1)return null;t.push([u,d])}return t}executeEdits(e,t,i,n){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(o)for(let u=0,h=o.length;u<h;u++){const[f,g]=o[u],m=c[u],_=m.range.startLineNumber,v=m.range.startColumn-1+f,b=m.range.startColumn-1+g;r.push(new M(_,b+1,_,b+2)),a.push(new M(_,v+1,_,b+2))}const d=n(c);return d&&(this._isHandling=!0),d});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),r.length>0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=Sf.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){At(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return Z2.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new Lf(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(Zt.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let o=0;for(;o<n;){const r=TS(t,o),a=t.substr(o,r);this._executeEditOperation(Zt.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),o+=r}}else this._executeEditOperation(Zt.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,o,r){if(t.length===0&&i===0&&n===0){if(o!==0){const a=this.getSelections().map(l=>{const c=l.getPosition();return new yt(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Zt.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,r)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(Zt.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Bc.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new An(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new An(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class Sf{static from(e,t){return new Sf(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class Z2{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._mod
|
||
|
|
`:this.model.getEOL();e=e.slice(0),e.sort(M.compareRangesUsingStarts);let o=!1,r=!1;for(const l of e)l.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d<l.length;d++)d>0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+n);return c}if(o&&t){const l=[];let c=0;for(const d of e){const u=d.startLineNumber;d.isEmpty()?u!==c&&l.push(this.model.getLineContent(u)):l.push(this.model.getValueInRange(d,i?2:0)),c=u}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===ro||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const d=n.startLineNumber;n=new M(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Cs.fontFamily;let c;return l?c=Cs.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Cs.fontFamily}`),{mode:i,html:`<div style="color: ${r[1]};background-color: ${r[2]};font-family: ${c};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,r)+"</div>"}}_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 d=this.model.tokenization.getLineTokens(c),u=d.getLineContent(),h=c===i?n-1:0,f=c===o?r-1:u.length;u===""?l+="<br>":l+=Zz(u,d.inflate(),t,h,f,a,Wn)}return l}_getColorMap(){const e=oi.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=K.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new Bz);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new M(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new yf(e,!1,i,n
|
||
|
|
`?i=1:e&&e.lineEnding&&e.lineEnding===`\r
|
||
|
|
`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){var t;try{this._beginUpdate();const i=e;if(this._modelData===null&&i===null||this._modelData&&this._modelData.model===i)return;const n={oldModelUrl:((t=this._modelData)===null||t===void 0?void 0:t.model.uri)||null,newModelUrl:(i==null?void 0:i.uri)||null};this._onWillChangeModel.fire(n);const o=this.hasTextFocus(),r=this._detachModel();this._attachModel(i),o&&this.hasModel()&&this.focus(),this._removeDecorationTypes(),this._onDidChangeModel.fire(n),this._postDetachModelCleanup(r),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Xl._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Xl._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?Xl._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(n=>M.lift(n)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return vi.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!V.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!M.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,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(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new M(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(!V.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new M(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.ge
|
||
|
|
`)}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 PU{constructor(e,t,i,n,o,r,a){this.id=++VM,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=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new aE),this.removedResources.has(t)||this.removedResources.set(t,new rE(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new aE),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new rE(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class HM{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)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(`
|
||
|
|
`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?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)t.type===1&&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<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new TM(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const c=this._past[a];i&&(n>=t||c.id!==e.elements[n])&&(i=!1,o=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+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 this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?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 Hv{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}const zM=new HM("","");zM.locked=!0;let Mw=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(`
|
||
|
|
`))}pushElement(e,t=Ou.None,i=dr.None){if(e.type===0){const n=Km(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new jm(e,n,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,o=[],r=[];for(const a of e.resources){const l=Km(a),c=this.getUriComparisonKey(a);n.has(c)||(n.add(c),o.push(l),r.push(c))}o.length===1?this._pushElement(new jm(e,o[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new PU(e,o,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const n=e.resourceLabels[t],o=e.strResources[t];let r;this._editStacks.has(o)?r=this._editStacks.get(o):(r=new HM(n,o),this._editStacks.set(o,r)),r.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const n=i.getClosestPastElement();return n?n.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const o of i){const r=Km(o.resource),a=this.getUriComparisonKey(o.resource),l=new jm(o,r,a,0,0,0,0);n.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const o of i){const r=Km(o.resource),a=this.getUriComparisonKey(o.resource),l=new jm(o,r,a,0,0,0,0);n.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitFutureWorkspaceElement(e,n)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new TM(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof dr){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){At(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 r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),n.dispose(),o()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),o())}async _invokeWorkspacePrepare(e){if(typeof e.actual.prepareUndoRedo>"u")return G.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?G.None:t}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(G.None);const i=e.actual.prepareUndoRedo();return i?KN(i)?t(i):i.then(n=>t(n)):t(G.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||zM);return new Hv(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new qm(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new qm}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)
|
||
|
|
`)n.type===2&&(n=o.pop()),n.children.push({type:8});else if(n.type!==2){const c={type:2,content:a};n.children.push(c),o.push(n),n=c}else n.content+=a}return n.type===2&&(n=o.pop()),t}function _$(s,e){return Ow(s,e)!==0}function Ow(s,e){switch(s){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const v$=new RegExp(`(\\\\)?\\$\\((${et.iconNameExpression}(?:${et.iconModifierExpression})?)\\)`,"g");function Dc(s){const e=new Array;let t,i=0,n=0;for(;(t=v$.exec(s))!==null;){n=t.index||0,i<n&&e.push(s.substring(i,n)),i=(t.index||0)+t[0].length;const[,o,r]=t;e.push(o?`$(${r})`:W_({id:r}))}return i<s.length&&e.push(s.substring(i)),e}function W_(s){const e=De("span");return e.classList.add(...et.asClassNameArray(s)),e}function b$(s){const e=C$(s);if(e&&e.length>0)return new Uint32Array(e)}let us=0;const Ya=new Uint32Array(10);function C$(s){if(us=0,Zo(s,Kv,4352),us>0||(Zo(s,jv,4449),us>0)||(Zo(s,qv,4520),us>0)||(Zo(s,Ul,12593),us))return Ya.subarray(0,us);if(s>=44032&&s<=55203){const e=s-44032,t=e%588,i=Math.floor(e/588),n=Math.floor(t/28),o=t%28-1;if(i<Kv.length?Zo(i,Kv,0):4352+i-12593<Ul.length&&Zo(4352+i,Ul,12593),n<jv.length?Zo(n,jv,0):4449+n-12593<Ul.length&&Zo(4449+n-12593,Ul,12593),o>=0&&(o<qv.length?Zo(o,qv,0):4520+o-12593<Ul.length&&Zo(4520+o-12593,Ul,12593)),us>0)return Ya.subarray(0,us)}}function Zo(s,e,t){s>=t&&s<t+e.length&&w$(e[s-t])}function w$(s){s!==0&&(Ya[us++]=s&255,s>>8&&(Ya[us++]=s>>8&255),s>>16&&(Ya[us++]=s>>16&255))}const Kv=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),jv=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),qv=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Ul=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function QM(...s){return function(e,t){for(let i=0,n=s.length;i<n;i++){const o=s[i](e,t);if(o)return o}return null}}XM.bind(void 0,!1);const V_=XM.bind(void 0,!0);function XM(s,e,t){if(!t||t.length<e.length)return null;let i;return s?i=ES(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function y$(s,e){const t=e.toLowerCase().indexOf(s.toLowerCase());return t===-1?null:[{start:t,end:t+s.length}]}function S$(s,e){return Bw(s.toLowerCase(),e.toLowerCase(),0,0)}function Bw(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]===e[i]){let n=null;return(n=Bw(s,e,t+1,i+1))?$L({start:i,end:i+1},n):null}return Bw(s,e,t,i+1)}function zL(s){return 97<=s&&s<=122}function r1(s){return 65<=s&&s<=90}function UL(s){return 48<=s&&s<=57}function JM(s){return s===32||s===9||s===10||s===13}const eR=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(s=>eR.add(s.charCodeAt(0)));function H_(s){return JM(s)||eR.has(s)}function bE(s,e){return s===e||H_(s)&&H_(e)}const Gv=new Map;function CE(s){if(Gv.has(s))return Gv.get(s);let e;const t=b$(s);return t&&(e=t),Gv.set(s,e),e}function tR(s){return zL(s)||r1(s)||UL(s)}function $L(s,e){return e.length===0?e=[s]:s.end===e[0].start?e[0].start=s.start:e.unshift(s),e}function iR(s,e){for(let t=e;t<s.length;t++){const i=s.charCodeAt(t);if(r1(i)||UL(i)||t>0&&!tR(s.charCodeAt(t-1)))return t}return s.length}function Ww(s,e,t,i){if(t===s.length)return[];if(i===e.length)return null;if(s[t]!==e[i].toLowerCase())return null;{let n=null,o=i+1;for(n=Ww(s,e,t+1,i+1);!n&&(o=iR(e,o))<e.length;)n=Ww(s,e,t+1,o),o++;return n===null?null:$L({start:i,end:i+1},n)}}function L$(s){let e=0,t=0,i=0,n=0,o=0;for(let d=0;d<s.length;d++)o=s.charCodeAt(d),r1(o)&&e++,zL(o)&&t++,tR(o)&&i++,UL(o)&&n++;const r=e/s.length,a=t/s.length,l=i/s.length,c=n/s.length;return{upperPercent:r,lowerPercent:a,alphaPercent:l,numericPercent:c}}function k$(s){const{upperPercent:e,lowerPercent:t}=s;return t===0&&e>.6}function D$(s){c
|
||
|
|
`:`
|
||
|
|
|
||
|
|
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`
|
||
|
|
${q$(t,e)}
|
||
|
|
`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(wa(t),"g");return e.replace(i,(n,o)=>e.charAt(o-1)!=="\\"?`\\${n}`:n)}}function $$(s){return xc(s)?!s.value:Array.isArray(s)?s.every($$):!0}function xc(s){return s instanceof cR?!0:s&&typeof s=="object"?typeof s.value=="string"&&(typeof s.isTrusted=="boolean"||typeof s.isTrusted=="object"||s.isTrusted===void 0)&&(typeof s.supportThemeIcons=="boolean"||s.supportThemeIcons===void 0):!1}function K$(s,e){return s===e?!0:!s||!e?!1:s.value===e.value&&s.isTrusted===e.isTrusted&&s.supportThemeIcons===e.supportThemeIcons&&s.supportHtml===e.supportHtml&&(s.baseUri===e.baseUri||!!s.baseUri&&!!e.baseUri&&LH($e.from(s.baseUri),$e.from(e.baseUri)))}function j$(s){return s.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function q$(s,e){var t,i;const n=(i=(t=s.match(/^`+/gm))===null||t===void 0?void 0:t.reduce((r,a)=>r.length>a.length?r:a).length)!==null&&i!==void 0?i:0,o=n>=3?n+1:3;return[`${"`".repeat(o)}${e}`,s,`${"`".repeat(o)}`].join(`
|
||
|
|
`)}function Xm(s){return s.replace(/"/g,""")}function Qv(s){return s&&s.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function G$(s){const e=[],t=s.split("|").map(n=>n.trim());s=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=n?n[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:s,dimensions:e}}class dR{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const LE=new dR("id#");let In={};(function(){function s(e,t){t(In)}s.amd=!0,function(e,t){typeof s=="function"&&s.amd?s(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){function t(Q,U){for(var z=0;z<U.length;z++){var E=U[z];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(Q,E.key,E)}}function i(Q,U,z){return z&&t(Q,z),Object.defineProperty(Q,"prototype",{writable:!1}),Q}function n(Q,U){if(Q){if(typeof Q=="string")return o(Q,U);var z=Object.prototype.toString.call(Q).slice(8,-1);if(z==="Object"&&Q.constructor&&(z=Q.constructor.name),z==="Map"||z==="Set")return Array.from(Q);if(z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z))return o(Q,U)}}function o(Q,U){(U==null||U>Q.length)&&(U=Q.length);for(var z=0,E=new Array(U);z<U;z++)E[z]=Q[z];return E}function r(Q,U){var z=typeof Symbol<"u"&&Q[Symbol.iterator]||Q["@@iterator"];if(z)return(z=z.call(Q)).next.bind(z);if(Array.isArray(Q)||(z=n(Q))||U){z&&(Q=z);var E=0;return function(){return E>=Q.length?{done:!0}:{done:!1,value:Q[E++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(Q){e.defaults=Q}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(U){return f[U]};function m(Q,U){if(U){if(c.test(Q))return Q.replace(d,g)}else if(u.test(Q))return Q.replace(h,g);return Q}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(Q){return Q.replace(_,function(U,z){return z=z.toLowerCase(),z==="colon"?":":z.charAt(0)==="#"?z.charAt(1)==="x"?String.fromCharCode(parseInt(z.substring(2),16)):String.fromCharCode(+z.substring(1)):""})}var b=/(^|[^\[])\^/g;function C(Q,U){Q=typeof Q=="string"?Q:Q.source,U=U||"";var z={replace:function(I,B){return B=B.source||B,B=B.replace(b,"$1"),Q=Q.replace(I,B),z},getRegex:function(){return new RegExp(Q,U)}};return z}var w=/[^\w:]/g,y=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(Q,U,z){if(Q){var E;try{E=decodeURIComponent(v(z)).replace(w,"").toLowerCase()}catch{return null}if(E.indexOf("javascript:")===0||E.indexOf("vbscript:")===0||E.indexOf("data:")===0)return null}U&&!y.test(z)&&(z=R(U,z));try{z=encodeURI(z).replace(/%25/g,"%")}catch{return null}return z}var k={},D=/^[^:]+:\/*[^/]*$/,N=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function R(Q,U){k[" "+Q]||(D.test(Q)?k[" "+Q]=Q+"/":k[" "+Q]=q(Q,"/",!0)),Q=k[" "+Q];var z=Q.indexOf(":")===-1;return U.substring(0,2)==="//"?z?U:Q.replace(N,"$1")+U:U.charAt(0)==="/"?z?U:Q.replace(W,"$1")+U:Q+U}var A={exec:function(){}};function P(Q){for(var U=1,z,E;U<arguments.length;U++){z=arguments[U];for(E in z)Object.prototype.hasOwnProperty.call(z,E)&&(Q[E]=z[E])}return Q}function H(Q,U){var z=Q.replace(/\|/g,function(B,F,Z){for(var ee=!1,_e=F;--_e>=0&&Z[_e]==="\\";)ee=!ee;return ee?"|":" |"}),E=z.split(/ \|/),I=0;if(E[0].trim()||E.shift(),E.length>0&&!E[E.length-1].trim()&&E.pop(),E.length>U)E.splice(U);else for(;E.length<U;)E.push("");for(;I<E.length;I++)E[I]=E[I].trim().replace(/\\\|/g,"|");return E}function q(Q,U,z){var E=Q.length;if(E===0)return"";for(var I=0;I<E;){var B=Q.charAt(E-I-1);if(B===U&&!z)I++;else if(B!==U&&z)I++;else break}return Q.slice(0,E-I)}function re(Q,U){if(Q.indexOf(U[1])===-1)return-1;for(var z=Q.length,E=0,I=0;I<z;I++)if(Q[I]==="\\")I++;else if(Q[I]===U[0])E++;else if(Q[I]===U[1]&&(E--,E<0))return I;return-1}function de(Q){Q&&Q.sanitize&&!Q.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function ve(Q,U){if(U<1)return"";for(var z="";U>1;)U&1&&(z+=Q),U>>=1,Q+=Q;return z+Q}function se(Q,U,z,E){var I=U.href,B=U.title?m(U.title):null,F=Q[1].replace(/\\([\[\]])/g,"$1");if(Q[0].charAt(0)!=="!"){E.state.inLink=!0;var Z={type:"link",raw:z,href:I,title:B,text:F,tokens:E.inlineTokens(F)};return E.state.inLink=!1,Z}return{type:"image",raw:z,href:I,title:B,text:m(F)}}function Ce(Q,U){var z=Q.match(/^(\s+)(?:```)/);if(z===null)return U;var E=z[1];return U.split(`
|
||
|
|
`).map(function(I){var B=I.match(/^\s+/);if(B===null)return I;var F=B[0];return F.length>=E.length?I.slice(E.length):I}).join(`
|
||
|
|
`)}var Ee=function(){function Q(z){this.options=z||e.defaults}var U=Q.prototype;return U.space=function(E){var I=this.rules.block.newline.exec(E);if(I&&I[0].length>0)return{type:"space",raw:I[0]}},U.code=function(E){var I=this.rules.block.code.exec(E);if(I){var B=I[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:I[0],codeBlockStyle:"indented",text:this.options.pedantic?B:q(B,`
|
||
|
|
`)}}},U.fences=function(E){var I=this.rules.block.fences.exec(E);if(I){var B=I[0],F=Ce(B,I[3]||"");return{type:"code",raw:B,lang:I[2]?I[2].trim():I[2],text:F}}},U.heading=function(E){var I=this.rules.block.heading.exec(E);if(I){var B=I[2].trim();if(/#$/.test(B)){var F=q(B,"#");(this.options.pedantic||!F||/ $/.test(F))&&(B=F.trim())}return{type:"heading",raw:I[0],depth:I[1].length,text:B,tokens:this.lexer.inline(B)}}},U.hr=function(E){var I=this.rules.block.hr.exec(E);if(I)return{type:"hr",raw:I[0]}},U.blockquote=function(E){var I=this.rules.block.blockquote.exec(E);if(I){var B=I[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:I[0],tokens:this.lexer.blockTokens(B,[]),text:B}}},U.list=function(E){var I=this.rules.block.list.exec(E);if(I){var B,F,Z,ee,_e,we,Oe,Ae,St,ht,Ie,Ut,zt=I[1].trim(),ls=zt.length>1,Ze={type:"list",raw:"",ordered:ls,start:ls?+zt.slice(0,-1):"",loose:!1,items:[]};zt=ls?"\\d{1,9}\\"+zt.slice(-1):"\\"+zt,this.options.pedantic&&(zt=ls?zt:"[*+-]");for(var qt=new RegExp("^( {0,3}"+zt+")((?:[ ][^\\n]*)?(?:\\n|$))");E&&(Ut=!1,!(!(I=qt.exec(E))||this.rules.block.hr.test(E)));){if(B=I[0],E=E.substring(B.length),Ae=I[2].split(`
|
||
|
|
`,1)[0],St=E.split(`
|
||
|
|
`,1)[0],this.options.pedantic?(ee=2,Ie=Ae.trimLeft()):(ee=I[2].search(/[^ ]/),ee=ee>4?1:ee,Ie=Ae.slice(ee),ee+=I[1].length),we=!1,!Ae&&/^ *$/.test(St)&&(B+=St+`
|
||
|
|
`,E=E.substring(St.length+1),Ut=!0),!Ut)for(var oe=new RegExp("^ {0,"+Math.min(3,ee-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),ge=new RegExp("^ {0,"+Math.min(3,ee-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Pe=new RegExp("^ {0,"+Math.min(3,ee-1)+"}(?:```|~~~)"),ei=new RegExp("^ {0,"+Math.min(3,ee-1)+"}#");E&&(ht=E.split(`
|
||
|
|
`,1)[0],Ae=ht,this.options.pedantic&&(Ae=Ae.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Pe.test(Ae)||ei.test(Ae)||oe.test(Ae)||ge.test(E)));){if(Ae.search(/[^ ]/)>=ee||!Ae.trim())Ie+=`
|
||
|
|
`+Ae.slice(ee);else if(!we)Ie+=`
|
||
|
|
`+Ae;else break;!we&&!Ae.trim()&&(we=!0),B+=ht+`
|
||
|
|
`,E=E.substring(ht.length+1)}Ze.loose||(Oe?Ze.loose=!0:/\n *\n *$/.test(B)&&(Oe=!0)),this.options.gfm&&(F=/^\[[ xX]\] /.exec(Ie),F&&(Z=F[0]!=="[ ] ",Ie=Ie.replace(/^\[[ xX]\] +/,""))),Ze.items.push({type:"list_item",raw:B,task:!!F,checked:Z,loose:!1,text:Ie}),Ze.raw+=B}Ze.items[Ze.items.length-1].raw=B.trimRight(),Ze.items[Ze.items.length-1].text=Ie.trimRight(),Ze.raw=Ze.raw.trimRight();var ci=Ze.items.length;for(_e=0;_e<ci;_e++){this.lexer.state.top=!1,Ze.items[_e].tokens=this.lexer.blockTokens(Ze.items[_e].text,[]);var Ct=Ze.items[_e].tokens.filter(function(at){return at.type==="space"}),ft=Ct.every(function(at){for(var Ui=at.raw.split(""),yi=0,Ds=r(Ui),Na;!(Na=Ds()).done;){var Ta=Na.value;if(Ta===`
|
||
|
|
`&&(yi+=1),yi>1)return!0}return!1});!Ze.loose&&Ct.length&&ft&&(Ze.loose=!0,Ze.items[_e].loose=!0)}return Ze}},U.html=function(E){var I=this.rules.block.html.exec(E);if(I){var B={type:"html",raw:I[0],pre:!this.options.sanitizer&&(I[1]==="pre"||I[1]==="script"||I[1]==="style"),text:I[0]};if(this.options.sanitize){var F=this.options.sanitizer?this.options.sanitizer(I[0]):m(I[0]);B.type="paragraph",B.text=F,B.tokens=this.lexer.inline(F)}return B}},U.def=function(E){var I=this.rules.block.def.exec(E);if(I){I[3]&&(I[3]=I[3].substring(1,I[3].length-1));var B=I[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:B,raw:I[0],href:I[2],title:I[3]}}},U.table=function(E){var I=this.rules.block.table.exec(E);if(I){var B={type:"table",header:H(I[1]).map(function(Oe){return{text:Oe}}),align:I[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:I[3]&&I[3].trim()?I[3].replace(/\n[ \t]*$/,"").split(`
|
||
|
|
`):[]};if(B.header.length===B.align.length){B.raw=I[0];var F=B.align.length,Z,ee,_e,we;for(Z=0;Z<F;Z++)/^ *-+: *$/.test(B.align[Z])?B.align[Z]="right":/^ *:-+: *$/.test(B.align[Z])?B.align[Z]="center":/^ *:-+ *$/.test(B.align[Z])?B.align[Z]="left":B.align[Z]=null;for(F=B.rows.length,Z=0;Z<F;Z++)B.rows[Z]=H(B.rows[Z],B.header.length).map(function(Oe){return{text:Oe}});for(F=B.header.length,ee=0;ee<F;ee++)B.header[ee].tokens=this.lexer.inline(B.header[ee].text);for(F=B.rows.length,ee=0;ee<F;ee++)for(we=B.rows[ee],_e=0;_e<we.length;_e++)we[_e].tokens=this.lexer.inline(we[_e].text);return B}}},U.lheading=function(E){var I=this.rules.block.lheading.exec(E);if(I)return{type:"heading",raw:I[0],depth:I[2].charAt(0)==="="?1:2,text:I[1],tokens:this.lexer.inline(I[1])}},U.paragraph=function(E){var I=this.rules.block.paragraph.exec(E);if(I){var B=I[1].charAt(I[1].length-1)===`
|
||
|
|
`?I[1].slice(0,-1):I[1];return{type:"paragraph",raw:I[0],text:B,tokens:this.lexer.inline(B)}}},U.text=function(E){var I=this.rules.block.text.exec(E);if(I)return{type:"text",raw:I[0],text:I[0],tokens:this.lexer.inline(I[0])}},U.escape=function(E){var I=this.rules.inline.escape.exec(E);if(I)return{type:"escape",raw:I[0],text:m(I[1])}},U.tag=function(E){var I=this.rules.inline.tag.exec(E);if(I)return!this.lexer.state.inLink&&/^<a /i.test(I[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(I[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(I[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(I[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:I[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):m(I[0]):I[0]}},U.link=function(E){var I=this.rules.inline.link.exec(E);if(I){var B=I[2].trim();if(!this.options.pedantic&&/^</.test(B)){if(!/>$/.test(B))return;var F=q(B.slice(0,-1),"\\");if((B.length-F.length)%2===0)return}else{var Z=re(I[2],"()");if(Z>-1){var ee=I[0].indexOf("!")===0?5:4,_e=ee+I[1].length+Z;I[2]=I[2].substring(0,Z),I[0]=I[0].substring(0,_e).trim(),I[3]=""}}var we=I[2],Oe="";if(this.options.pedantic){var Ae=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);Ae&&(we=Ae[1],Oe=Ae[3])}else Oe=I[3]?I[3].slice(1,-1):"";return we=we.trim(),/^</.test(we)&&(this.options.pedantic&&!/>$/.test(B)?we=we.slice(1):we=we.slice(1,-1)),se(I,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},I[0],this.lexer)}},U.reflink=function(E,I){var B;if((B=this.rules.inline.reflink.exec(E))||(B=this.rules.inline.nolink.exec(E))){var F=(B[2]||B[1]).replace(/\s+/g," ");if(F=I[F.toLowerCase()],!F||!F.href){var Z=B[0].charAt(0);return{type:"text",raw:Z,text:Z}}return se(B,F,B[0],this.lexer)}},U.emStrong=function(E,I,B){B===void 0&&(B="");var F=this.rules.inline.emStrong.lDelim.exec(E);if(F&&!(F[3]&&B.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u
|
||
|
|
]`).replace("lheading",fe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:A,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:A,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};X._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",X.punctuation=C(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,X.escapedEmSt=/\\\*|\\_/g,X._comment=C(fe._comment).replace("(?:-->|$)","-->").getRegex(),X.emStrong.lDelim=C(X.emStrong.lDelim).replace(/punct/g,X._punctuation).getRegex(),X.emStrong.rDelimAst=C(X.emStrong.rDelimAst,"g").replace(/punct/g,X._punctuation).getRegex(),X.emStrong.rDelimUnd=C(X.emStrong.rDelimUnd,"g").replace(/punct/g,X._punctuation).getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,X.autolink=C(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=C(X.tag).replace("comment",X._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=C(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=C(X.reflink).replace("label",X._label).replace("ref",fe._label).getRegex(),X.nolink=C(X.nolink).replace("ref",fe._label).getRegex(),X.reflinkSearch=C(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=P({},X),X.pedantic=P({},X.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:C(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=P({},X.normal,{escape:C(X.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),X.gfm.url=C(X.gfm.url,"i").replace("email",X.gfm._extended_email).getRegex(),X.breaks=P({},X.gfm,{br:C(X.br).replace("{2,}","*").getRegex(),text:C(X.gfm.text).r
|
||
|
|
`),this.blockTokens(E,this.tokens);for(var I;I=this.inlineQueue.shift();)this.inlineTokens(I.src,I.tokens);return this.tokens},U.blockTokens=function(E,I){var B=this;I===void 0&&(I=[]),this.options.pedantic?E=E.replace(/\t/g," ").replace(/^ +$/gm,""):E=E.replace(/^( *)(\t+)/gm,function(Oe,Ae,St){return Ae+" ".repeat(St.length)});for(var F,Z,ee,_e;E;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Oe){return(F=Oe.call({lexer:B},E,I))?(E=E.substring(F.raw.length),I.push(F),!0):!1}))){if(F=this.tokenizer.space(E)){E=E.substring(F.raw.length),F.raw.length===1&&I.length>0?I[I.length-1].raw+=`
|
||
|
|
`:I.push(F);continue}if(F=this.tokenizer.code(E)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&(Z.type==="paragraph"||Z.type==="text")?(Z.raw+=`
|
||
|
|
`+F.raw,Z.text+=`
|
||
|
|
`+F.text,this.inlineQueue[this.inlineQueue.length-1].src=Z.text):I.push(F);continue}if(F=this.tokenizer.fences(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.heading(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.hr(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.blockquote(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.list(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.html(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.def(E)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&(Z.type==="paragraph"||Z.type==="text")?(Z.raw+=`
|
||
|
|
`+F.raw,Z.text+=`
|
||
|
|
`+F.raw,this.inlineQueue[this.inlineQueue.length-1].src=Z.text):this.tokens.links[F.tag]||(this.tokens.links[F.tag]={href:F.href,title:F.title});continue}if(F=this.tokenizer.table(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.lheading(E)){E=E.substring(F.raw.length),I.push(F);continue}if(ee=E,this.options.extensions&&this.options.extensions.startBlock&&function(){var Oe=1/0,Ae=E.slice(1),St=void 0;B.options.extensions.startBlock.forEach(function(ht){St=ht.call({lexer:this},Ae),typeof St=="number"&&St>=0&&(Oe=Math.min(Oe,St))}),Oe<1/0&&Oe>=0&&(ee=E.substring(0,Oe+1))}(),this.state.top&&(F=this.tokenizer.paragraph(ee))){Z=I[I.length-1],_e&&Z.type==="paragraph"?(Z.raw+=`
|
||
|
|
`+F.raw,Z.text+=`
|
||
|
|
`+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Z.text):I.push(F),_e=ee.length!==E.length,E=E.substring(F.raw.length);continue}if(F=this.tokenizer.text(E)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&Z.type==="text"?(Z.raw+=`
|
||
|
|
`+F.raw,Z.text+=`
|
||
|
|
`+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Z.text):I.push(F);continue}if(E){var we="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(we);break}else throw new Error(we)}}return this.state.top=!0,I},U.inline=function(E,I){return I===void 0&&(I=[]),this.inlineQueue.push({src:E,tokens:I}),I},U.inlineTokens=function(E,I){var B=this;I===void 0&&(I=[]);var F,Z,ee,_e=E,we,Oe,Ae;if(this.tokens.links){var St=Object.keys(this.tokens.links);if(St.length>0)for(;(we=this.tokenizer.rules.inline.reflinkSearch.exec(_e))!=null;)St.includes(we[0].slice(we[0].lastIndexOf("[")+1,-1))&&(_e=_e.slice(0,we.index)+"["+ve("a",we[0].length-2)+"]"+_e.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(we=this.tokenizer.rules.inline.blockSkip.exec(_e))!=null;)_e=_e.slice(0,we.index)+"["+ve("a",we[0].length-2)+"]"+_e.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(we=this.tokenizer.rules.inline.escapedEmSt.exec(_e))!=null;)_e=_e.slice(0,we.index)+"++"+_e.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;E;)if(Oe||(Ae=""),Oe=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Ie){return(F=Ie.call({lexer:B},E,I))?(E=E.substring(F.raw.length),I.push(F),!0):!1}))){if(F=this.tokenizer.escape(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.tag(E)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&F.type==="text"&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):I.push(F);continue}if(F=this.tokenizer.link(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.reflink(E,this.tokens.links)){E=E.substring(F.raw.length),Z=I[I.length-1],Z&&F.type==="text"&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):I.push(F);continue}if(F=this.tokenizer.emStrong(E,_e,Ae)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.codespan(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.br(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.del(E)){E=E.substring(F.raw.length),I.push(F);continue}if(F=this.tokenizer.autolink(E,ut)){E=E.substring(F.raw.length),I.push(F);continue}if(!this.state.inLink&&(F=this.tokenizer.url(E,ut))){E=E.substring(F.raw.length),I.push(F);continue}if(ee=E,this.options.extensions&&this.options.extensions.startInline&&function(){var Ie=1/0,Ut=E.slice(1),zt=void 0;B.options.extensions.startInline.forEach(function(ls){zt=ls.call({lexer:this},Ut),typeof zt=="number"&&zt>=0&&(Ie=Math.min(Ie,zt))}),Ie<1/0&&Ie>=0&&(ee=E.substring(0,Ie+1))}(),F=this.tokenizer.inlineText(ee,ie)){E=E.substring(F.raw.length),F.raw.slice(-1)!=="_"&&(Ae=F.raw.slice(-1)),Oe=!0,Z=I[I.length-1],Z&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):I.push(F);continue}if(E){var ht="Infinite loop on byte: "+E.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return I},i(Q,null,[{key:"rules",get:function(){return{block:fe,inline:X}}}]),Q}(),it=function(){function Q(z){this.options=z||e.defaults}var U=Q.prototype;return U.code=function(E,I,B){var F=(I||"").match(/\S*/)[0];if(this.options.highlight){var Z=this.options.highlight(E,F);Z!=null&&Z!==E&&(B=!0,E=Z)}return E=E.replace(/\n$/,"")+`
|
||
|
|
`,F?'<pre><code class="'+this.options.langPrefix+m(F,!0)+'">'+(B?E:m(E,!0))+`</code></pre>
|
||
|
|
`:"<pre><code>"+(B?E:m(E,!0))+`</code></pre>
|
||
|
|
`},U.blockquote=function(E){return`<blockquote>
|
||
|
|
`+E+`</blockquote>
|
||
|
|
`},U.html=function(E){return E},U.heading=function(E,I,B,F){if(this.options.headerIds){var Z=this.options.headerPrefix+F.slug(B);return"<h"+I+' id="'+Z+'">'+E+"</h"+I+`>
|
||
|
|
`}return"<h"+I+">"+E+"</h"+I+`>
|
||
|
|
`},U.hr=function(){return this.options.xhtml?`<hr/>
|
||
|
|
`:`<hr>
|
||
|
|
`},U.list=function(E,I,B){var F=I?"ol":"ul",Z=I&&B!==1?' start="'+B+'"':"";return"<"+F+Z+`>
|
||
|
|
`+E+"</"+F+`>
|
||
|
|
`},U.listitem=function(E){return"<li>"+E+`</li>
|
||
|
|
`},U.checkbox=function(E){return"<input "+(E?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},U.paragraph=function(E){return"<p>"+E+`</p>
|
||
|
|
`},U.table=function(E,I){return I&&(I="<tbody>"+I+"</tbody>"),`<table>
|
||
|
|
<thead>
|
||
|
|
`+E+`</thead>
|
||
|
|
`+I+`</table>
|
||
|
|
`},U.tablerow=function(E){return`<tr>
|
||
|
|
`+E+`</tr>
|
||
|
|
`},U.tablecell=function(E,I){var B=I.header?"th":"td",F=I.align?"<"+B+' align="'+I.align+'">':"<"+B+">";return F+E+("</"+B+`>
|
||
|
|
`)},U.strong=function(E){return"<strong>"+E+"</strong>"},U.em=function(E){return"<em>"+E+"</em>"},U.codespan=function(E){return"<code>"+E+"</code>"},U.br=function(){return this.options.xhtml?"<br/>":"<br>"},U.del=function(E){return"<del>"+E+"</del>"},U.link=function(E,I,B){if(E=L(this.options.sanitize,this.options.baseUrl,E),E===null)return B;var F='<a href="'+m(E)+'"';return I&&(F+=' title="'+I+'"'),F+=">"+B+"</a>",F},U.image=function(E,I,B){if(E=L(this.options.sanitize,this.options.baseUrl,E),E===null)return B;var F='<img src="'+E+'" alt="'+B+'"';return I&&(F+=' title="'+I+'"'),F+=this.options.xhtml?"/>":">",F},U.text=function(E){return E},Q}(),ai=function(){function Q(){}var U=Q.prototype;return U.strong=function(E){return E},U.em=function(E){return E},U.codespan=function(E){return E},U.del=function(E){return E},U.html=function(E){return E},U.text=function(E){return E},U.link=function(E,I,B){return""+B},U.image=function(E,I,B){return""+B},U.br=function(){return""},Q}(),Yi=function(){function Q(){this.seen={}}var U=Q.prototype;return U.serialize=function(E){return E.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},U.getNextSafeSlug=function(E,I){var B=E,F=0;if(this.seen.hasOwnProperty(B)){F=this.seen[E];do F++,B=E+"-"+F;while(this.seen.hasOwnProperty(B))}return I||(this.seen[E]=F,this.seen[B]=0),B},U.slug=function(E,I){I===void 0&&(I={});var B=this.serialize(E);return this.getNextSafeSlug(B,I.dryrun)},Q}(),mi=function(){function Q(z){this.options=z||e.defaults,this.options.renderer=this.options.renderer||new it,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ai,this.slugger=new Yi}Q.parse=function(E,I){var B=new Q(I);return B.parse(E)},Q.parseInline=function(E,I){var B=new Q(I);return B.parseInline(E)};var U=Q.prototype;return U.parse=function(E,I){I===void 0&&(I=!0);var B="",F,Z,ee,_e,we,Oe,Ae,St,ht,Ie,Ut,zt,ls,Ze,qt,oe,ge,Pe,ei,ci=E.length;for(F=0;F<ci;F++){if(Ie=E[F],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Ie.type]&&(ei=this.options.extensions.renderers[Ie.type].call({parser:this},Ie),ei!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(Ie.type))){B+=ei||"";continue}switch(Ie.type){case"space":continue;case"hr":{B+=this.renderer.hr();continue}case"heading":{B+=this.renderer.heading(this.parseInline(Ie.tokens),Ie.depth,v(this.parseInline(Ie.tokens,this.textRenderer)),this.slugger);continue}case"code":{B+=this.renderer.code(Ie.text,Ie.lang,Ie.escaped);continue}case"table":{for(St="",Ae="",_e=Ie.header.length,Z=0;Z<_e;Z++)Ae+=this.renderer.tablecell(this.parseInline(Ie.header[Z].tokens),{header:!0,align:Ie.align[Z]});for(St+=this.renderer.tablerow(Ae),ht="",_e=Ie.rows.length,Z=0;Z<_e;Z++){for(Oe=Ie.rows[Z],Ae="",we=Oe.length,ee=0;ee<we;ee++)Ae+=this.renderer.tablecell(this.parseInline(Oe[ee].tokens),{header:!1,align:Ie.align[ee]});ht+=this.renderer.tablerow(Ae)}B+=this.renderer.table(St,ht);continue}case"blockquote":{ht=this.parse(Ie.tokens),B+=this.renderer.blockquote(ht);continue}case"list":{for(Ut=Ie.ordered,zt=Ie.start,ls=Ie.loose,_e=Ie.items.length,ht="",Z=0;Z<_e;Z++)qt=Ie.items[Z],oe=qt.checked,ge=qt.task,Ze="",qt.task&&(Pe=this.renderer.checkbox(oe),ls?qt.tokens.length>0&&qt.tokens[0].type==="paragraph"?(qt.tokens[0].text=Pe+" "+qt.tokens[0].text,qt.tokens[0].tokens&&qt.tokens[0].tokens.length>0&&qt.tokens[0].tokens[0].type==="text"&&(qt.tokens[0].tokens[0].text=Pe+" "+qt.tokens[0].tokens[0].text)):qt.tokens.unshift({type:"text",text:Pe}):Ze+=Pe),Ze+=this.parse(qt.tokens,ls),ht+=this.renderer.listitem(Ze,ge,oe);B+=this.renderer.list(ht,Ut,zt);continue}case"html":{B+=this.renderer.html(Ie.text);continue}case"paragraph":{B+=this.renderer.paragraph(this.parseInline(Ie.tokens));continue}case"text":{for(ht=Ie.tokens?this.parseInline(Ie.tokens):Ie.text;F+1<ci&&E[F+1].type==="text";)Ie=E[++F],ht+=`
|
||
|
|
`+(Ie.tokens?this.parseInline(Ie.tokens):Ie.text);B+=I?this.renderer.paragraph(ht):ht;continue}default:{var Ct='Token with "'+Ie.type+'" type was not found.';if(this.options.silent){console.error(Ct);return}else throw new Error(Ct)}}}return B},U.parseInline=function(E,I){I=I||this.renderer;var B="",F,Z,ee,_e=E.length;for(F=0;F<_e;F++){if(Z=E[F],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Z.type]&&(ee=this.options.extensions.renderers[Z.type].call({parser:this},Z),ee!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(Z.type))){B+=ee||"";continue}switch(Z.type){case"escape":{B+=I.text(Z.text);break}case"html":{B+=I.html(Z.text);break}case"link":{B+=I.link(Z.href,Z.title,this.parseInline(Z.tokens,I));break}case"image":{B+=I.image(Z.href,Z.title,Z.text);break}case"strong":{B+=I.strong(this.parseInline(Z.tokens,I));break}case"em":{B+=I.em(this.parseInline(Z.tokens,I));break}case"codespan":{B+=I.codespan(Z.text);break}case"br":{B+=I.br();break}case"del":{B+=I.del(this.parseInline(Z.tokens,I));break}case"text":{B+=I.text(Z.text);break}default:{var we='Token with "'+Z.type+'" type was not found.';if(this.options.silent){console.error(we);return}else throw new Error(we)}}}return B},Q}();function ke(Q,U,z){if(typeof Q>"u"||Q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Q)+", string expected");if(typeof U=="function"&&(z=U,U=null),U=P({},ke.defaults,U||{}),de(U),z){var E=U.highlight,I;try{I=Mt.lex(Q,U)}catch(_e){return z(_e)}var B=function(we){var Oe;if(!we)try{U.walkTokens&&ke.walkTokens(I,U.walkTokens),Oe=mi.parse(I,U)}catch(Ae){we=Ae}return U.highlight=E,we?z(we):z(null,Oe)};if(!E||E.length<3||(delete U.highlight,!I.length))return B();var F=0;ke.walkTokens(I,function(_e){_e.type==="code"&&(F++,setTimeout(function(){E(_e.text,_e.lang,function(we,Oe){if(we)return B(we);Oe!=null&&Oe!==_e.text&&(_e.text=Oe,_e.escaped=!0),F--,F===0&&B()})},0))}),F===0&&B();return}function Z(_e){if(_e.message+=`
|
||
|
|
Please report this to https://github.com/markedjs/marked.`,U.silent)return"<p>An error occurred:</p><pre>"+m(_e.message+"",!0)+"</pre>";throw _e}try{var ee=Mt.lex(Q,U);if(U.walkTokens){if(U.async)return Promise.all(ke.walkTokens(ee,U.walkTokens)).then(function(){return mi.parse(ee,U)}).catch(Z);ke.walkTokens(ee,U.walkTokens)}return mi.parse(ee,U)}catch(_e){Z(_e)}}ke.options=ke.setOptions=function(Q){return P(ke.defaults,Q),l(ke.defaults),ke},ke.getDefaults=a,ke.defaults=e.defaults,ke.use=function(){for(var Q=arguments.length,U=new Array(Q),z=0;z<Q;z++)U[z]=arguments[z];var E=P.apply(void 0,[{}].concat(U)),I=ke.defaults.extensions||{renderers:{},childTokens:{}},B;U.forEach(function(F){if(F.extensions&&(B=!0,F.extensions.forEach(function(ee){if(!ee.name)throw new Error("extension name required");if(ee.renderer){var _e=I.renderers?I.renderers[ee.name]:null;_e?I.renderers[ee.name]=function(){for(var we=arguments.length,Oe=new Array(we),Ae=0;Ae<we;Ae++)Oe[Ae]=arguments[Ae];var St=ee.renderer.apply(this,Oe);return St===!1&&(St=_e.apply(this,Oe)),St}:I.renderers[ee.name]=ee.renderer}if(ee.tokenizer){if(!ee.level||ee.level!=="block"&&ee.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");I[ee.level]?I[ee.level].unshift(ee.tokenizer):I[ee.level]=[ee.tokenizer],ee.start&&(ee.level==="block"?I.startBlock?I.startBlock.push(ee.start):I.startBlock=[ee.start]:ee.level==="inline"&&(I.startInline?I.startInline.push(ee.start):I.startInline=[ee.start]))}ee.childTokens&&(I.childTokens[ee.name]=ee.childTokens)})),F.renderer&&function(){var ee=ke.defaults.renderer||new it,_e=function(Ae){var St=ee[Ae];ee[Ae]=function(){for(var ht=arguments.length,Ie=new Array(ht),Ut=0;Ut<ht;Ut++)Ie[Ut]=arguments[Ut];var zt=F.renderer[Ae].apply(ee,Ie);return zt===!1&&(zt=St.apply(ee,Ie)),zt}};for(var we in F.renderer)_e(we);E.renderer=ee}(),F.tokenizer&&function(){var ee=ke.defaults.tokenizer||new Ee,_e=function(Ae){var St=ee[Ae];ee[Ae]=function(){for(var ht=arguments.length,Ie=new Array(ht),Ut=0;Ut<ht;Ut++)Ie[Ut]=arguments[Ut];var zt=F.tokenizer[Ae].apply(ee,Ie);return zt===!1&&(zt=St.apply(ee,Ie)),zt}};for(var we in F.tokenizer)_e(we);E.tokenizer=ee}(),F.walkTokens){var Z=ke.defaults.walkTokens;E.walkTokens=function(ee){var _e=[];return _e.push(F.walkTokens.call(this,ee)),Z&&(_e=_e.concat(Z.call(this,ee))),_e}}B&&(E.extensions=I),ke.setOptions(E)})},ke.walkTokens=function(Q,U){for(var z=[],E=function(){var Z=B.value;switch(z=z.concat(U.call(ke,Z)),Z.type){case"table":{for(var ee=r(Z.header),_e;!(_e=ee()).done;){var we=_e.value;z=z.concat(ke.walkTokens(we.tokens,U))}for(var Oe=r(Z.rows),Ae;!(Ae=Oe()).done;)for(var St=Ae.value,ht=r(St),Ie;!(Ie=ht()).done;){var Ut=Ie.value;z=z.concat(ke.walkTokens(Ut.tokens,U))}break}case"list":{z=z.concat(ke.walkTokens(Z.items,U));break}default:ke.defaults.extensions&&ke.defaults.extensions.childTokens&&ke.defaults.extensions.childTokens[Z.type]?ke.defaults.extensions.childTokens[Z.type].forEach(function(zt){z=z.concat(ke.walkTokens(Z[zt],U))}):Z.tokens&&(z=z.concat(ke.walkTokens(Z.tokens,U)))}},I=r(Q),B;!(B=I()).done;)E();return z},ke.parseInline=function(Q,U){if(typeof Q>"u"||Q===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Q!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Q)+", string expected");U=P({},ke.defaults,U||{}),de(U);try{var z=Mt.lexInline(Q,U);return U.walkTokens&&ke.walkTokens(z,U.walkTokens),mi.parseInline(z,U)}catch(E){if(E.message+=`
|
||
|
|
Please report this to https://github.com/markedjs/marked.`,U.silent)return"<p>An error occurred:</p><pre>"+m(E.message+"",!0)+"</pre>";throw E}},ke.Parser=mi,ke.parser=mi.parse,ke.Renderer=it,ke.TextRenderer=ai,ke.Lexer=Mt,ke.lexer=Mt.lex,ke.Tokenizer=Ee,ke.Slugger=Yi,ke.parse=ke;var rn=ke.options,rs=ke.setOptions,Tn=ke.use,Cn=ke.walkTokens,li=ke.parseInline,as=ke,ks=mi.parse,cd=Mt.lex;e.Lexer=Mt,e.Parser=mi,e.Renderer=it,e.Slugger=Yi,e.TextRenderer=ai,e.Tokenizer=Ee,e.getDefaults=a,e.lexer=cd,e.marked=ke,e.options=rn,e.parse=as,e.parseInline=li,e.parser=ks,e.setOptions=rs,e.use=Tn,e.walkTokens=Cn,Object.defineProperty(e,"__esModule",{value:!0})})})();In.Lexer||exports.Lexer;In.Parser||exports.Parser;In.Renderer||exports.Renderer;In.Slugger||exports.Slugger;In.TextRenderer||exports.TextRenderer;In.Tokenizer||exports.Tokenizer;In.getDefaults||exports.getDefaults;In.lexer||exports.lexer;var Eo=In.marked||exports.marked;In.options||exports.options;In.parse||exports.parse;In.parseInline||exports.parseInline;In.parser||exports.parser;In.setOptions||exports.setOptions;In.use||exports.use;In.walkTokens||exports.walkTokens;function Z$(s){return JSON.stringify(s,Y$)}function zw(s){let e=JSON.parse(s);return e=Uw(e),e}function Y$(s,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function Uw(s,e=0){if(!s||e>200)return s;if(typeof s=="object"){switch(s.$mid){case 1:return $e.revive(s);case 2:return new RegExp(s.source,s.flags);case 17:return new Date(s.source)}if(s instanceof iL||s instanceof Uint8Array)return s;if(Array.isArray(s))for(let t=0;t<s.length;++t)s[t]=Uw(s[t],e+1);else for(const t in s)Object.hasOwnProperty.call(s,t)&&(s[t]=Uw(s[t],e+1))}return s}const Xv=Object.freeze({image:(s,e,t)=>{let i=[],n=[];return s&&({href:s,dimensions:i}=G$(s),n.push(`src="${Xm(s)}"`)),t&&n.push(`alt="${Xm(t)}"`),e&&n.push(`title="${Xm(e)}"`),i.length&&(n=n.concat(i)),"<img "+n.join(" ")+">"},paragraph:s=>`<p>${s}</p>`,link:(s,e,t)=>typeof s!="string"?"":(s===t&&(t=Qv(t)),e=typeof e=="string"?Xm(Qv(e)):"",s=Qv(s),s=s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),`<a href="${s}" title="${e||s}" draggable="false">${t}</a>`)});function qL(s,e={},t={}){var i,n;const o=new pe;let r=!1;const a=HL(e),l=function(v){let b;try{b=zw(decodeURIComponent(v))}catch{}return b?(b=MN(b,C=>{if(s.uris&&s.uris[C])return $e.revive(s.uris[C])}),encodeURIComponent(JSON.stringify(b))):v},c=function(v,b){const C=s.uris&&s.uris[v];let w=$e.revive(C);return b?v.startsWith(ze.data+":")?v:(w||(w=$e.parse(v)),DT.uriToBrowserUri(w).toString(!0)):!w||$e.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},d=new Eo.Renderer;d.image=Xv.image,d.link=Xv.link,d.paragraph=Xv.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(v,b)=>{const C=LE.nextId(),w=e.codeBlockRendererSync(kE(b),v);return h.push([C,w]),`<div class="code" data-code="${C}">${of(v)}</div>`}:e.codeBlockRenderer&&(d.code=(v,b)=>{const C=LE.nextId(),w=e.codeBlockRenderer(kE(b),v);return u.push(w.then(y=>[C,y])),`<div class="code" data-code="${C}">${of(v)}</div>`}),e.actionHandler){const v=function(w){let y=w.target;if(!(y.tagName!=="A"&&(y=y.parentElement,!y||y.tagName!=="A")))try{let L=y.dataset.href;L&&(s.baseUri&&(L=Jv($e.from(s.baseUri),L)),e.actionHandler.callback(L,w))}catch(L){At(L)}finally{w.preventDefault()}},b=e.actionHandler.disposables.add(new Ue(a,"click")),C=e.actionHandler.disposables.add(new Ue(a,"auxclick"));e.actionHandler.disposables.add(te.any(b.event,C.event)(w=>{const y=new Io(be(a),w);!y.leftButton&&!y.middleButton||v(y)})),e.actionHandler.disposables.add(j(a,"keydown",w=>{const y=new Ot(w);!y.equals(10)&&!y.equals(3)||v(y)}))}s.supportHtml||(t.sanitizer=v=>{var b;return!((b=e.sanitizerOptions)===null||b===void 0)&&b.replaceWithPlaintext?of(v):(s.isTrusted?v.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?v:""},t.sanitize=!0,t.silent=!0),t.renderer=d;let f=(i=s.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),s.supportThemeIcons&&(f=H$(f
|
||
|
|
`,s.hr=()=>"",s.list=(e,t)=>e,s.listitem=e=>e+`
|
||
|
|
`,s.paragraph=e=>e+`
|
||
|
|
`,s.table=(e,t)=>e+t+`
|
||
|
|
`,s.tablerow=e=>e,s.tablecell=(e,t)=>e+" ",s.strong=e=>e,s.em=e=>e,s.codespan=e=>e,s.br=()=>`
|
||
|
|
`,s.del=e=>e,s.image=(e,t,i)=>"",s.text=e=>e,s.link=(e,t,i)=>i,s}const sK=new Ml(s=>nK());function dg(s){let e="";return s.forEach(t=>{e+=t.raw}),e}function uR(s){var e,t;if(s.tokens)for(let i=s.tokens.length-1;i>=0;i--){const n=s.tokens[i];if(n.type==="text"){const o=n.raw.split(`
|
||
|
|
`),r=o[o.length-1];if(r.includes("`"))return hK(s);if(r.includes("**"))return vK(s);if(r.match(/\*\w/))return fK(s);if(r.match(/(^|\s)__\w/))return bK(s);if(r.match(/(^|\s)_\w/))return gK(s);if(oK(r)||rK(r)&&s.tokens.slice(0,i).some(a=>a.type==="text"&&a.raw.match(/\[[^\]]*$/))){const a=s.tokens.slice(i+1);return((e=a[0])===null||e===void 0?void 0:e.type)==="link"&&((t=a[1])===null||t===void 0?void 0:t.type)==="text"&&a[1].raw.match(/^ *"[^"]*$/)||r.match(/^[^"]* +"[^"]*$/)?pK(s):mK(s)}else if(r.match(/(^|\s)\[\w*/))return _K(s)}}}function oK(s){return!!s.match(/(^|\s)\[.*\]\(\w*/)}function rK(s){return!!s.match(/^[^\[]*\]\([^\)]*$/)}function aK(s){var e;const t=s.items[s.items.length-1],i=t.tokens?t.tokens[t.tokens.length-1]:void 0;let n;if((i==null?void 0:i.type)==="text"&&!("inRawBlock"in t)&&(n=uR(i)),!n||n.type!=="paragraph")return;const o=dg(s.items.slice(0,-1)),r=(e=t.raw.match(/^(\s*(-|\d+\.) +)/))===null||e===void 0?void 0:e[0];if(!r)return;const a=r+dg(t.tokens.slice(0,-1))+n.raw,l=Eo.lexer(o+a)[0];if(l.type==="list")return l}const lK=3;function cK(s){for(let e=0;e<lK;e++){const t=dK(s);if(t)s=t;else break}return s}function dK(s){let e,t;for(e=0;e<s.length;e++){const i=s[e];let n;if(i.type==="paragraph"&&(n=i.raw.match(/(\n|^)(````*)/))){const o=n[2];t=uK(s.slice(e),o);break}if(i.type==="paragraph"&&i.raw.match(/(\n|^)\|/)){t=CK(s.slice(e));break}if(e===s.length-1&&i.type==="list"){const o=aK(i);if(o){t=[o];break}}if(e===s.length-1&&i.type==="paragraph"){const o=uR(i);if(o){t=[o];break}}}if(t){const i=[...s.slice(0,e),...t];return i.links=s.links,i}return null}function uK(s,e){const t=dg(s);return Eo.lexer(t+`
|
||
|
|
${e}`)}function hK(s){return Fl(s,"`")}function fK(s){return Fl(s,"*")}function gK(s){return Fl(s,"_")}function mK(s){return Fl(s,")")}function pK(s){return Fl(s,'")')}function _K(s){return Fl(s,"](https://microsoft.com)")}function vK(s){return Fl(s,"**")}function bK(s){return Fl(s,"__")}function Fl(s,e){const t=dg(Array.isArray(s)?s:[s]);return Eo.lexer(t+e)[0]}function CK(s){const e=dg(s),t=e.split(`
|
||
|
|
`);let i,n=!1;for(let o=0;o<t.length;o++){const r=t[o].trim();if(typeof i>"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(o!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const o=n?t.slice(0,-1).join(`
|
||
|
|
`):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+`
|
||
|
|
|${" --- |".repeat(i)}`;return Eo.lexer(a)}}function DE(s,e){return ST(s,e),Be(()=>LT(s))}var wK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},xE=function(s,e){return function(t,i){e(t,i,s)}},Kw;let z_=Kw=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new O,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const n=new pe,o=n.add(qL(e,{...this._getRenderOptions(e,n),...t},i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,n)=>{var o,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=ro);const c=await Gz(this._languageService,n,l),d=document.createElement("span");if(d.innerHTML=(a=(r=Kw._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const u=this._options.editor.getOption(50);nn(d,u)}else this._options.codeBlockFontFamily&&(d.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(d.style.fontSize=this._options.codeBlockFontSize),d},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>hR(this._openerService,i,e.isTrusted),disposables:t}}}};z_._ttpTokenizer=ed("tokenizeToString",{createHTML(s){return s}});z_=Kw=wK([xE(1,Mi),xE(2,em)],z_);async function hR(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:yK(t)})}catch(i){return At(i),!1}}function yK(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}var SK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},kh=function(s,e){return function(t,i){e(t,i,s)}};const Yo=De;let jw=class extends La{get _targetWindow(){return be(this._target.targetElements[0])}get _targetDocumentElement(){return be(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,o,r){var a,l,c,d,u,h,f,g;super(),this._keybindingService=t,this._configurationService=i,this._openerService=n,this._instantiationService=o,this._accessibilityService=r,this._messageListeners=new pe,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._onDispose=this._register(new O),this._onRequestLayout=this._register(new O),this._linkHandler=e.linkHandler||(w=>hR(this._openerService,w,xc(e.content)?e.content.isTrusted:void 0)),this._target="targetElements"in e.target?e.target:new LK(e.target),this._hoverPointer=!((a=e.appearance)===null||a===void 0)&&a.showPointer?Yo("div.workbench-hover-pointer"):void 0,this._hover=this._register(new l$),this._hover.containerDomNode.classList.add("workbench-hover","fadeIn"),!((l=e.appearance)===null||l===void 0)&&l.compact&&this._hover.containerDomNode.class
|
||
|
|
:host {
|
||
|
|
all: initial; /* 1st rule so subsequent properties are reset. */
|
||
|
|
}
|
||
|
|
|
||
|
|
.codicon[class*='codicon-'] {
|
||
|
|
font: normal normal normal 16px/1 codicon;
|
||
|
|
display: inline-block;
|
||
|
|
text-decoration: none;
|
||
|
|
text-rendering: auto;
|
||
|
|
text-align: center;
|
||
|
|
-webkit-font-smoothing: antialiased;
|
||
|
|
-moz-osx-font-smoothing: grayscale;
|
||
|
|
user-select: none;
|
||
|
|
-webkit-user-select: none;
|
||
|
|
-ms-user-select: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
:host {
|
||
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
|
||
|
|
}
|
||
|
|
|
||
|
|
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
|
||
|
|
:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
|
||
|
|
:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
|
||
|
|
:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
|
||
|
|
:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
|
||
|
|
|
||
|
|
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
|
||
|
|
:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
|
||
|
|
:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
|
||
|
|
:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
|
||
|
|
:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
|
||
|
|
|
||
|
|
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
|
||
|
|
: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; }
|
||
|
|
: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; }
|
||
|
|
: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; }
|
||
|
|
: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; }
|
||
|
|
`;var xK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},EK=function(s,e){return function(t,i){e(t,i,s)}};let U_=class extends G{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new Bu(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;t?t===this.layoutService.getContainer(be(t))?n=1:i?n=3:n=2:n=1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};U_=xK([EK(0,Pl)],U_);class IK extends U_{getContextViewElement(){return this.contextView.getViewElement()}}class NK{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){var n;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Jn(e)||Vi(e))o=e;else if(!$p(e.markdown))o=(n=e.markdown)!==null&&n!==void 0?n:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(p("iconLabel.loading","Loading..."),t,i),this._cancellationTokenSource=new Ho;const r=this._cancellationTokenSource.token;if(o=await e.markdown(r),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(o,t,i)}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o={content:e,target:this.target,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!n},position:{hoverPosition:2},...i};this._hoverWidget=this.hoverDelegate.showHover(o,t)}n==null||n.dispose()}hasContent(e){return e?xc(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}var TK=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Dh=function(s,e){return function(t,i){e(t,i,s)}};let qw=class extends G{constructor(e,t,i,n,o){super(),this._instantiationService=e,this._keybindingService=i,this._layoutService=n,this._accessibilityService=o,this._existingHovers=new Map,t.onDidShowContextMenu(()=>this.hideHover()),this._contextViewHandler=this._register(new U_(this._layoutService))}showHover(e,t,i){var n,o,r,a;if(IE(this._currentHoverOptions)===IE(e)||this._currentHover&&(!((o=(n=this._currentHoverOptions)===null||n===void 0?void 0:n.persistence)===null||o===void 0)&&o.sticky))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const l=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),c=vn();i||(l&&c?c.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=c):this._lastFocusedElementBeforeOpen=void 0);const d=new pe,u=this._instantiationService.createInstance(jw,e);if(!((r=e.persistence)===null||r===void 0)&&r.sticky&&(u.isLocked=!0),u.onDispose(()=>{var h,f;((h=this._currentHover)===null||h===void 0?void 0:h.domNode)&&MT(this._currentHover.domNode)&&((f=this._lastFocusedElementBeforeOpen)===null||f===void 0||f.focus()),this._currentHoverOptions===e&&(this._currentHoverOptions=void 0),d.dispose()},void 0,d),!e.container){const h=Vi(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(be
|
||
|
|
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=a1.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,o=this._affectsConfigStr.indexOf(n);if(o<0)return!1;const r=o+n.length;if(r>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!bs(l,c)}return!0}}const K_={kind:0},zK={kind:1};function UK(s,e,t){return{kind:2,commandId:s,commandArgs:e,isBubble:t}}class Df{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Df.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o<r;o++){const a=this._keybindings[o];if(a.chords.length===0)continue;const l=(n=a.when)===null||n===void 0?void 0:n.substituteConstants();l&&l.type===0||this._addKeyPress(a.chords[0],a)}}static _isTargetedForRemoval(e,t,i){if(t){for(let n=0;n<t.length;n++)if(t[n]!==e.chords[n])return!1}return!(i&&i.type!==1&&(!e.when||!v7(i,e.when)))}static handleRemovals(e){const t=new Map;for(let n=0,o=e.length;n<o;n++){const r=e[n];if(r.command&&r.command.charAt(0)==="-"){const a=r.command.substring(1);t.has(a)?t.get(a).push(r):t.set(a,[r])}}if(t.size===0)return e;const i=[];for(let n=0,o=e.length;n<o;n++){const r=e[n];if(!r.command||r.command.length===0){i.push(r);continue}if(r.command.charAt(0)==="-")continue;const a=t.get(r.command);if(!a||!r.isDefault){i.push(r);continue}let l=!1;for(const c of a){const d=c.when;if(this._isTargetedForRemoval(r,c.chords,d)){l=!0;break}}if(!l){i.push(r);continue}}return i}_addKeyPress(e,t){const i=this._map.get(e);if(typeof i>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const o=i[n];if(o.command===t.command)continue;let r=!0;for(let a=1;a<o.chords.length&&a<t.chords.length;a++)if(o.chords[a]!==t.chords[a]){r=!1;break}r&&Df.whenIsEntirelyIncluded(o.when,t.when)&&this._removeFromLookupMap(o)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);typeof t>"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i<n;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:VC(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let n=i.length-1;n>=0;n--){const o=i[n];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const o=this._map.get(n[0]);if(o===void 0)return this._log("\\ No keybinding entries."),K_;let r=null;if(n.length<2)r=o;else{r=[];for(let l=0,c=o.length;l<c;l++){const d=o[l];if(n.length>d.chords.length)continue;let u=!0;for(let h=1;h<n.length;h++)if(d.chords[h]!==n[h]){u=!1;break}u&&r.push(d)}}const a=this._findCommand(e,r);return a?n.length<a.chords.length?(this._log(`\\ From ${r.length} keybinding entries, awaiting ${a.chords.length-n.length} more chord(s), when: ${TE(a.when)}, source: ${AE(a)}.`),zK):(this._log(`\\ From ${r.length} keybinding entries
|
||
|
|
.monaco-drag-image,
|
||
|
|
.monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
|
||
|
|
`),e.listFocusAndSelectionForeground&&o.push(`
|
||
|
|
.monaco-drag-image,
|
||
|
|
.monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
|
||
|
|
`),e.listInactiveFocusForeground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const r=ga(e.listFocusAndSelectionOutline,ga(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&o.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(`
|
||
|
|
.monaco-drag-image,
|
||
|
|
.monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
|
||
|
|
.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
|
||
|
|
`);const a=ga(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&o.push(`
|
||
|
|
.monaco-list${n}.drop-target,
|
||
|
|
.monaco-list${n} .monaco-list-rows.drop-target,
|
||
|
|
.monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }
|
||
|
|
`),e.listDropBetweenBackground&&(o.push(`
|
||
|
|
.monaco-list${n} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,
|
||
|
|
.monaco-list${n} .monaco-list-row.drop-target-before::before {
|
||
|
|
content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;
|
||
|
|
background-color: ${e.listDropBetweenBackground};
|
||
|
|
}`),o.push(`
|
||
|
|
.monaco-list${n} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,
|
||
|
|
.monaco-list${n} .monaco-list-row.drop-target-after::after {
|
||
|
|
content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;
|
||
|
|
background-color: ${e.listDropBetweenBackground};
|
||
|
|
}`)),e.tableColumnsBorder&&o.push(`
|
||
|
|
.monaco-table > .monaco-split-view2,
|
||
|
|
.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,
|
||
|
|
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,
|
||
|
|
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
|
||
|
|
border-color: ${e.tableColumnsBorder};
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,
|
||
|
|
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
|
||
|
|
border-color: transparent;
|
||
|
|
}
|
||
|
|
`),e.tableOddRowsBackgroundColor&&o.push(`
|
||
|
|
.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
|
||
|
|
.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
|
||
|
|
.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
|
||
|
|
background-color: ${e.tableOddRowsBackgroundColor};
|
||
|
|
}
|
||
|
|
`),this.styleElement.textContent=o.join(`
|
||
|
|
`)}}const iq={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:K.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:K.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:K.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},nq={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function sq(s,e){const t=s.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&s[n]===e-(t-n);)i.push(s[n--]);for(i.reverse(),n=t;n<s.length&&s[n]===e+(n-t);)i.push(s[n++]);return i}function Jw(s,e){const t=[];let i=0,n=0;for(;i<s.length||n<e.length;)if(i>=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){t.push(s[i]),i++,n++;continue}else s[i]<e[n]?t.push(s[i++]):t.push(e[n++]);return t}function oq(s,e){const t=[];let i=0,n=0;for(;i<s.length||n<e.length;)if(i>=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){i++,n++;continue}else s[i]<e[n]?t.push(s[i++]):n++;return t}const YE=(s,e)=>s-e;class rq{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 r of this.renderers)r.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){var o;let r=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[r],n),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class aq{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new pe}}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e),o=n&&typeof n!="string"?n:q_(n);i.disposables.add(_t(a=>{this.setAriaLabel(a.readObservable(o),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i,n){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class lq{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,e,t)}onDragOver(e,t,i,n,o){return this.dnd.onDragOver(e,t,i,n,o)}onDragLeave(e,t,i,n){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,n)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,n,o){this.dnd.drop(e,t,i,n,o)}dispose(){this.dnd.dispose()}}class Ko{get onDidChangeFocus(){return te.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return te.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll()
|
||
|
|
`)}styleSelectElement(){var e,t,i;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",r=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=o,this.selectElement.style.borderColor=r}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",n=ga(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=be(this.selectElement),i=Fs(this.selectElement),n=be(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-hr.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let u=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const h=this._hasDetails?this._cachedMaxDetailsHeight:0,f=u+o+h,g=Math.floor((r-o-h)/this.getHeight()),m=Math.floor((a-o-h)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.top<hr.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||g<1&&m<1?!1:(g<hr.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&m>g&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classLi
|
||
|
|
[{1}] {2}`,o,ZL.modifierLabels[to].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&mq(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(et.isThemeIcon(n)){const o=et.asClassNameArray(n);i.classList.add(...o),this._itemClassDispose.value=Be(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=e1(this._themeService.getColorTheme().type)?Sa(n.dark):Sa(n.light),i.classList.add("icon"),this._itemClassDispose.value=br(Be(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};mg=_1([On(2,Zi),On(3,$o),On(4,bt),On(5,ho),On(6,Da),On(7,Uo)],mg);let ey=class extends Z_{constructor(e,t,i,n,o){var r,a,l;const c={...t,menuAsChild:(r=t==null?void 0:t.menuAsChild)!==null&&r!==void 0?r:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:et.isThemeIcon(e.item.icon)?et.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:d=>i.lookupKeybinding(d.id)};super(e,{getActions:()=>e.actions},n,c),this._keybindingService=i,this._contextMenuService=n,this._themeService=o}render(e){super.render(e),vr(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!et.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=e1(this._themeService.getColorTheme().type)?Sa(i.dark):Sa(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};ey=_1([On(2,Zi),On(3,Da),On(4,ho)],ey);let ty=class extends ko{constructor(e,t,i,n,o,r,a,l){var c,d,u;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(m=>f===m.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(mg,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g={keybindingProvider:m=>this._keybindingService.lookupKeybinding(m.id),...t,menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(d=t==null?void 0:t.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(u=t==null?void 0:t.actionRunner)!==null&&u!==void 0?u:new Rc};this._dropdown=new Z_(e,e.actions,this._contextMenuService,g),this._register(this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof pa&&this.update(m.action)}))}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(mg,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends Rc{async runAction(i,n){await i.run(void 0)}},this._container&&this._defaultAction.render(qS(this._container,De(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const n=this._keybindingService.lookupKeybinding(e.id);n&&(i=`(${n.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=De(".action-container");this._defaultAction.render(he(this._container,t)),this._register(j(t,J.KEY_DOWN,n=>{const o=new Ot(n);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=De(".dropdown
|
||
|
|
.monaco-menu {
|
||
|
|
font-size: 13px;
|
||
|
|
border-radius: 5px;
|
||
|
|
min-width: 160px;
|
||
|
|
}
|
||
|
|
|
||
|
|
${eI(ce.menuSelection)}
|
||
|
|
${eI(ce.menuSubmenu)}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar {
|
||
|
|
text-align: right;
|
||
|
|
overflow: hidden;
|
||
|
|
white-space: nowrap;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .actions-container {
|
||
|
|
display: flex;
|
||
|
|
margin: 0 auto;
|
||
|
|
padding: 0;
|
||
|
|
width: 100%;
|
||
|
|
justify-content: flex-end;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .actions-container {
|
||
|
|
display: inline-block;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.reverse .actions-container {
|
||
|
|
flex-direction: row-reverse;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item {
|
||
|
|
cursor: pointer;
|
||
|
|
display: inline-block;
|
||
|
|
transition: transform 50ms ease;
|
||
|
|
position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item.disabled {
|
||
|
|
cursor: default;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item .icon,
|
||
|
|
.monaco-menu .monaco-action-bar .action-item .codicon {
|
||
|
|
display: inline-block;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item .codicon {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-label {
|
||
|
|
font-size: 11px;
|
||
|
|
margin-right: 4px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
|
||
|
|
.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
|
||
|
|
color: var(--vscode-disabledForeground);
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Vertical actions */
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical {
|
||
|
|
text-align: left;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item {
|
||
|
|
display: block;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
|
||
|
|
display: block;
|
||
|
|
border-bottom: 1px solid var(--vscode-menu-separatorBackground);
|
||
|
|
padding-top: 1px;
|
||
|
|
padding: 30px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .secondary-actions .monaco-action-bar .action-label {
|
||
|
|
margin-left: 6px;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Action Items */
|
||
|
|
.monaco-menu .monaco-action-bar .action-item.select-container {
|
||
|
|
overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
|
||
|
|
flex: 1;
|
||
|
|
max-width: 170px;
|
||
|
|
min-width: 60px;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
margin-right: 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical {
|
||
|
|
margin-left: 0;
|
||
|
|
overflow: visible;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .actions-container {
|
||
|
|
display: block;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item {
|
||
|
|
padding: 0;
|
||
|
|
transform: none;
|
||
|
|
display: flex;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item.active {
|
||
|
|
transform: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
|
||
|
|
flex: 1 1 auto;
|
||
|
|
display: flex;
|
||
|
|
height: 2em;
|
||
|
|
align-items: center;
|
||
|
|
position: relative;
|
||
|
|
margin: 0 4px;
|
||
|
|
border-radius: 4px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {
|
||
|
|
opacity: unset;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label {
|
||
|
|
flex: 1 1 auto;
|
||
|
|
text-decoration: none;
|
||
|
|
padding: 0 1em;
|
||
|
|
background: none;
|
||
|
|
font-size: 12px;
|
||
|
|
line-height: 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .keybinding,
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
|
||
|
|
display: inline-block;
|
||
|
|
flex: 2 1 auto;
|
||
|
|
padding: 0 1em;
|
||
|
|
text-align: right;
|
||
|
|
font-size: 12px;
|
||
|
|
line-height: 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
|
||
|
|
height: 100%;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
|
||
|
|
font-size: 16px !important;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
|
||
|
|
margin-left: auto;
|
||
|
|
margin-right: -20px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
|
||
|
|
opacity: 0.4;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
|
||
|
|
display: inline-block;
|
||
|
|
box-sizing: border-box;
|
||
|
|
margin: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item {
|
||
|
|
position: static;
|
||
|
|
overflow: visible;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
|
||
|
|
position: absolute;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
|
||
|
|
width: 100%;
|
||
|
|
height: 0px !important;
|
||
|
|
opacity: 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
|
||
|
|
padding: 0.7em 1em 0.1em 1em;
|
||
|
|
font-weight: bold;
|
||
|
|
opacity: 1;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label:hover {
|
||
|
|
color: inherit;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
|
||
|
|
position: absolute;
|
||
|
|
visibility: hidden;
|
||
|
|
width: 1em;
|
||
|
|
height: 100%;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
|
||
|
|
visibility: visible;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Context Menu */
|
||
|
|
|
||
|
|
.context-view.monaco-menu-container {
|
||
|
|
outline: 0;
|
||
|
|
border: none;
|
||
|
|
animation: fadeIn 0.083s linear;
|
||
|
|
-webkit-app-region: no-drag;
|
||
|
|
}
|
||
|
|
|
||
|
|
.context-view.monaco-menu-container :focus,
|
||
|
|
.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
|
||
|
|
.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
|
||
|
|
outline: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.hc-black .context-view.monaco-menu-container,
|
||
|
|
.hc-light .context-view.monaco-menu-container,
|
||
|
|
:host-context(.hc-black) .context-view.monaco-menu-container,
|
||
|
|
:host-context(.hc-light) .context-view.monaco-menu-container {
|
||
|
|
box-shadow: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,
|
||
|
|
.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,
|
||
|
|
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,
|
||
|
|
:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
|
||
|
|
background: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Vertical Action Bar Styles */
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical {
|
||
|
|
padding: 4px 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
|
||
|
|
height: 2em;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .keybinding {
|
||
|
|
font-size: inherit;
|
||
|
|
padding: 0 2em;
|
||
|
|
max-height: 100%;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
|
||
|
|
font-size: inherit;
|
||
|
|
width: 2em;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
|
||
|
|
font-size: inherit;
|
||
|
|
margin: 5px 0 !important;
|
||
|
|
padding: 0;
|
||
|
|
border-radius: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,
|
||
|
|
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
|
||
|
|
margin-left: 0;
|
||
|
|
margin-right: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
|
||
|
|
font-size: 60%;
|
||
|
|
padding: 0 1.8em;
|
||
|
|
}
|
||
|
|
|
||
|
|
.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,
|
||
|
|
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
|
||
|
|
height: 100%;
|
||
|
|
mask-size: 10px 10px;
|
||
|
|
-webkit-mask-size: 10px 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-menu .action-item {
|
||
|
|
cursor: default;
|
||
|
|
}`;if(e){t+=`
|
||
|
|
/* Arrows */
|
||
|
|
.monaco-scrollable-element > .scrollbar > .scra {
|
||
|
|
cursor: pointer;
|
||
|
|
font-size: 11px !important;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-scrollable-element > .visible {
|
||
|
|
opacity: 1;
|
||
|
|
|
||
|
|
/* Background rule added for IE9 - to allow clicks on dom node */
|
||
|
|
background:rgba(0,0,0,0);
|
||
|
|
|
||
|
|
transition: opacity 100ms linear;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .invisible {
|
||
|
|
opacity: 0;
|
||
|
|
pointer-events: none;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .invisible.fade {
|
||
|
|
transition: opacity 800ms linear;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Scrollable Content Inset Shadow */
|
||
|
|
.monaco-scrollable-element > .shadow {
|
||
|
|
position: absolute;
|
||
|
|
display: none;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .shadow.top {
|
||
|
|
display: block;
|
||
|
|
top: 0;
|
||
|
|
left: 3px;
|
||
|
|
height: 3px;
|
||
|
|
width: 100%;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .shadow.left {
|
||
|
|
display: block;
|
||
|
|
top: 3px;
|
||
|
|
left: 0;
|
||
|
|
height: 100%;
|
||
|
|
width: 3px;
|
||
|
|
}
|
||
|
|
.monaco-scrollable-element > .shadow.top-left-corner {
|
||
|
|
display: block;
|
||
|
|
top: 0;
|
||
|
|
left: 0;
|
||
|
|
height: 3px;
|
||
|
|
width: 3px;
|
||
|
|
}
|
||
|
|
`;const i=s.scrollbarShadow;i&&(t+=`
|
||
|
|
.monaco-scrollable-element > .shadow.top {
|
||
|
|
box-shadow: ${i} 0 6px 6px -6px inset;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-scrollable-element > .shadow.left {
|
||
|
|
box-shadow: ${i} 6px 0 6px -6px inset;
|
||
|
|
}
|
||
|
|
|
||
|
|
.monaco-scrollable-element > .shadow.top.left {
|
||
|
|
box-shadow: ${i} 6px 6px 6px -6px inset;
|
||
|
|
}
|
||
|
|
`);const n=s.scrollbarSliderBackground;n&&(t+=`
|
||
|
|
.monaco-scrollable-element > .scrollbar > .slider {
|
||
|
|
background: ${n};
|
||
|
|
}
|
||
|
|
`);const o=s.scrollbarSliderHoverBackground;o&&(t+=`
|
||
|
|
.monaco-scrollable-element > .scrollbar > .slider:hover {
|
||
|
|
background: ${o};
|
||
|
|
}
|
||
|
|
`);const r=s.scrollbarSliderActiveBackground;r&&(t+=`
|
||
|
|
.monaco-scrollable-element > .scrollbar > .slider.active {
|
||
|
|
background: ${r};
|
||
|
|
}
|
||
|
|
`)}return t}class Tq{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=vn();let i;const n=Vi(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var r;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(De(".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",(r=this.blockDisposable)===null||r===void 0||r.dispose(),this.blockDisposable=j(this.block,J.MOUSE_DOWN,u=>u.stopPropagation()));const l=new pe,c=e.actionRunner||new Rc;c.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new gu(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},kq),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l);const d=be(o);return l.add(j(d,J.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(j(d,J.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const h=new Io(d,u);let f=h.target;if(!h.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),br(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)===null||r===void 0||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(vn()===this.lastContainer||Ni(vn(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Mg(e.error)&&this.notificationService.error(e.error)}}var Aq=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},wd=function(s,e){return function(t,i){e(t,i,s)}};let oy=class extends G{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Tq(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new O),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new O)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=ry.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}}),Ja.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};oy=Aq([wd(0,Rl),wd(1,$o),wd(2,Jg),wd(3,Zi),wd(4,Jc),wd(5,bt)],oy);var ry;(function(s){function e(i){return i&&i.menuId instanceof x}function t(i,n,o){if(!e(i))return i;con
|
||
|
|
`?a=2:l===`
|
||
|
|
`&&(a=1);let c=en.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=en.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=en.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=en.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:r,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:u,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:to===3||to===2?`
|
||
|
|
`:`\r
|
||
|
|
`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[n+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);o=Sd._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,o=i.length;n<o;n++){const r=i[n],a=this._models[r],l=a.model.getLanguageId(),c=a.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:l,resource:c})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:l,resource:c}))continue;const d=t[l+c],u=this.getCreationOptions(l,c,a.model.isForSimpleWidget);Sd._setModelOptionsForModel(a.model,u,d)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&bs(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions))&&(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(ql(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(ql(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(ql(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),r=new El(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(ql(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),u=this._getSHA1Computer(),h=u.canComputeSHA1(r)?u.computeSHA1(r)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of d.past)qr(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)qr(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>qr(f)&&f.matchesResource(i)),h&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=ql(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new Bq(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,n=!1){let o;return t?o=this._createModelData(e,t,i,n):o=this._createModelData(e,ro,i,n),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const o=t[i];e.push(this._models[o].model)}return e}getModel(e){const t=ql(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===ze.file||e.scheme===ze.vscodeRemote||e.scheme===ze.vscodeUserData||e.scheme===ze.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=ql(e.uri),i=this._models[t],n=this._undo
|
||
|
|
`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:i,skipFadeInAnimation:!0}}}};gy=Yq([sI(0,Xt),sI(1,Xg)],gy);K.white.toString(),K.white.toString();class my extends G{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new O),this._onDidEscape=this._register(new O),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this._register(Ft.addTarget(this._element)),[J.CLICK,It.Tap].forEach(o=>{this._register(j(this._element,o,r=>{if(!this.enabled){Ge.stop(r);return}this._onDidClick.fire(r)}))}),this._register(j(this._element,J.KEY_DOWN,o=>{const r=new Ot(o);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(o),a=!0):r.equals(9)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&Ge.stop(r,!0)})),this._register(j(this._element,J.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(j(this._element,J.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(Wf(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of Dc(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const n=document.createElement("span");n.textContent=i,t.push(n)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||xc(this._label)&&xc(e)&&K$(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(xc(e)){const o=qL(e,{inline:!0});o.dispose();const r=(t=o.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(r){const a=yT(r,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=a}else xn(i)}else this.options.supportIcons?xn(i,...this.getContentElements(e)):i.textContent=e;let n="";typeof this.options.title=="string"?n=this.options.title:this.options.title&&(n=eK(e)),this.setTitle(n),typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):this.options.ariaLabel&&this._element.setAttribute("aria-label",n),this._label=e}get label(){return this._label}set icon(e){this._element.classList.add(...et.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){var t;!this._hover&&e!==""?this._hover=this._register(Tr().setupUpdatableHover((t=this.options.hoverDelegate
|
||
|
|
top: ${this.virtualDelegate.headerRowHeight+1}px;
|
||
|
|
height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
|
||
|
|
}`),this.styleElement.textContent=t.join(`
|
||
|
|
`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}y1.InstanceCount=0;var hs;(function(s){s[s.Expanded=0]="Expanded",s[s.Collapsed=1]="Collapsed",s[s.PreserveOrExpanded=2]="PreserveOrExpanded",s[s.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(hs||(hs={}));var _c;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element",s[s.Filter=3]="Filter"})(_c||(_c={}));class ms extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class ak{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 lk(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function _g(s){switch(s){case!0:return 1;case!1:return 0;default:return s}}function rb(s){return typeof s.collapsible=="boolean"}class AG{constructor(e,t,i,n={}){var o;this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new E0,this._onDidChangeCollapseState=new O,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new O,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new O,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Og(hT),this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.allowNonCollapsibleParents=(o=n.allowNonCollapsibleParents)!==null&&o!==void 0?o:!1,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren>"u"?!1: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=ot.empty(),n={}){if(e.length===0)throw new ms(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,r){var a;n===void 0&&(n=ot.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,n,o);const c=[...n],d=t[t.length-1],u=new ea({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,d),...c,...l.children.slice(d+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),f=(_,v,b)=>{if(r>0)for(let C=0;C<b;C++)_--,v--,this.spliceSmart(e,[...h,_,0],Number.MAX_SAFE_INTEGER,c[v].children,o,r-1)};let g=Math.min(l.children.length,d+i),m=c.length;for(const _ of u.changes.sort((v,b)=>b.originalStart-v.originalStart))f(g,m,g-(_.originalStart+_.originalLength)),g=_.originalStart,m=_.modifiedStart-d,this.spliceSimple([...h,g],_.originalLength,ot.slice(c,m,m+_.modifiedLength),o);f(g,m,g)}spliceSimple(e,t,i=ot.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=ot.map(i,y=>this.createTreeNode(y,a,a.visible?1:0,c,u,n)),f=e[e.length-1];let g=0;for(let y=f;y>=0&&y<a.children.length;y--){const L=a.children[y];if(L.visible){g=L.visibleChildIndex;break}}const m=[];let _=0,v=0;for(const y of h)m.push(y),v+=y.renderNodeCount,y.visible&&(y.visibleChildIndex=g+_++);const b=Xk(a.children,f,t,m);r?a.lastDiffIds?Xk(a.lastDiffIds,f,t,m.map(y=>r.getId(y.element).toString())):a.lastDiffIds=a.children.map(y=>r.getId(y.element).toString()):a.lastDiffIds=void 0;let C=0;for(const y of b)y.visible&&C++;if(C!==0)for(let y=f+m.length;y<a.children.length;y++){const L=a.children[y];L.visible&&(L.visibleChildIndex-=C)}if(a.visibleChildrenCount+=_-C,c&&d){const y=b.reduce((L,k)=>L+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,v-y),this.list.splice(l,y,u)}if(b.length>0&&o){const y=L=>{o(L),L.children.forEach(y)};b.forEach(y)}this._o
|
||
|
|
`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,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){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=$a(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=$a(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=$a(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=$a(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i,n;return(n=(i=this.stickyScrollController)===null||i===void 0?void 0:i.height)!==null&&n!==void 0?n:0})}focusFirst(e,t=$a(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){var e;Hi(this.disposables),(e=this.stickyScrollController)===null||e===void 0||e.dispose(),this.view.dispose()}}class dk{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new AG(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,o){return i.sorter.compare(n.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=ot.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=ot.empty(),i){const n=new Set,o=new Set,r=l=>{var c;if(l.element===null)return;const d=l;if(n.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.add(u),this.nodesByIdentity.set(u,d)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,d)},a=l=>{var c;if(l.element===null)return;const d=l;if(n.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const u=this.identityProvider.
|
||
|
|
`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class Ih{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 SI extends G{constructor(e,t){var i;super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new Ih(he(e,De(".monaco-icon-label")))),this.labelContainer=he(this.domNode.element,De(".monaco-icon-label-container")),this.nameContainer=he(this.labelContainer,De("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=this._register(new DZ(this.nameContainer,!!t.supportIcons)):this.nameNode=new LZ(this.nameContainer),this.hoverDelegate=(i=t==null?void 0:t.hoverDelegate)!==null&&i!==void 0?i:$s("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){var n;const o=["monaco-icon-label"],r=["monaco-icon-label-container"];let a="";i&&(i.extraClasses&&o.push(...i.extraClasses),i.italic&&o.push("italic"),i.strikethrough&&o.push("strikethrough"),i.disabledCommand&&r.push("disabled"),i.title&&(typeof i.title=="string"?a+=i.title:a+=e));const l=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i!=null&&i.iconPath){let c;!l||!Vi(l)?(c=De(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=l,c.style.backgroundImage=Sa(i==null?void 0:i.iconPath)}else l&&l.remove();if(this.domNode.className=o.join(" "),this.domNode.element.setAttribute("aria-label",a),this.labelContainer.className=r.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const c=this.getOrCreateDescriptionNode();c instanceof Ic?(c.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(c.element,i==null?void 0:i.descriptionTitle)):(c.textContent=t&&(i!=null&&i.labelEscapeNewLines)?Ic.escapeNewLines(t,[]):t||"",this.setupHover(c.element,(i==null?void 0:i.descriptionTitle)||""),c.empty=!t)}if(i!=null&&i.suffix||this.suffixNode){const c=this.getOrCreateSuffixNode();c.textContent=(n=i==null?void 0:i.suffix)!==null&&n!==void 0?n:""}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(this.hoverDelegate.showNativeHover)(function(o,r){Jn(r)?o.title=lR(r):r!=null&&r.markdownNotSupportedFallback?o.title=r.markdownNotSupportedFallback:o.removeAttribute("title")})(e,t);else{const n=Tr().setupUpdatableHover(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new Ih($O(this.nameContainer,De("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new Ih(he(e.element,De("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new Ih(he(this.labelContainer,De("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new Ic(he(t.element,De("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons})):this.descriptionNode=this._register(new Ih(he(t.element,De("span.label-description"))))}return this.descriptionNode}}class LZ{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&bs(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=he(this.container,De("a.label-name",{id:
|
||
|
|
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}};l0.MAX_WIDTH=600;l0=yy=PZ([ub(1,Pl),ub(2,vt),ub(3,bt)],l0);var FZ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Nh=function(s,e){return function(t,i){e(t,i,s)}};let Sy=class extends UB{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(hy))),this._quickAccess}constructor(e,t,i,n,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=o,this._onShow=this._register(new O),this._onHide=this._register(new O),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(em).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(gy))},n=this._register(this.instantiationService.createInstance(l0,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{be(e.activeContainer)===be(n.container)&&n.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new me(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=ao.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ne(Zx),quickInputForeground:ne(Y6),quickInputTitleBackground:ne(Q6),widgetBorder:ne(W8),widgetShadow:ne(sl)},inputBox:TR,toggle:NR,countBadge:Sq,button:Cq,progressBar:wq,keybindingLabel:bq,list:sm({listBackground:Zx,listFocusBackground:lw,listFocusForeground:aw,listInactiveFocusForeground:aw,listInactiveSelectionIconForeground:BA,listInactiveFocusBackground:lw,listFocusOutline:si,listInactiveFocusOutline:si}),pickerGroup:{pickerGroupBorder:ne(X6),pickerGroupForeground:ne(OA)}}}};Sy=FZ([Nh(0,vt),Nh(1,bt),Nh(2,ho),Nh(3,Pl),Nh(4,Xt)],Sy);var s4=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},cc=function(s,e){return function(t,i){e(t,i,s)}};let Ly=class extends Sy{constructor(e,t,i,n,o,r){super(t,i,n,new Aw(e.getContainerDomNode(),o),r),this.host=void 0;const a=zu.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo(
|
||
|
|
`)}const GZ={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[tn]:"#FFFFFE",[Kg]:"#000000",[AA]:"#E5EBF1",[qg]:"#D3D3D3",[Gg]:"#939393",[MA]:"#ADD6FF4D"}},ZZ={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[tn]:"#1E1E1E",[Kg]:"#D4D4D4",[A
|
||
|
|
`)}}const ld=new JZ;zi.add(XZ.IconContribution,ld);function Bl(s,e,t,i){return ld.registerIcon(s,e,t,i)}function l4(){return ld}function eY(){const s=iT();for(const e in s){const t="\\"+s[e].toString(16);ld.registerIcon(e,{fontCharacter:t})}}eY();const c4="vscode://schemas/icons",d4=zi.as(G0.JSONContribution);d4.registerSchema(c4,ld.getIconSchema());const NI=new _n(()=>d4.notifySchemaChanged(c4),200);ld.onDidChange(()=>{NI.isScheduled()||NI.schedule()});const Zne=Bl("widget-close",ce.close,p("widgetClose","Icon for the close action in widgets."));Bl("goto-previous-location",ce.arrowUp,p("previousChangeIcon","Icon for goto previous editor location."));Bl("goto-next-location",ce.arrowDown,p("nextChangeIcon","Icon for goto next editor location."));et.modify(ce.sync,"spin");et.modify(ce.loading,"spin");function tY(s){const e=new pe,t=e.add(new O),i=l4();return e.add(i.onDidChange(()=>t.fire())),s&&e.add(s.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const n=s?s.getProductIconTheme():new u4,o={},r=[],a=[];for(const l of i.getIcons()){const c=n.getIcon(l);if(!c)continue;const d=c.font,u=`--vscode-icon-${l.id}-font-family`,h=`--vscode-icon-${l.id}-content`;d?(o[d.id]=d.definition,a.push(`${u}: ${nv(d.id)};`,`${h}: '${c.fontCharacter}';`),r.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${nv(d.id)}; }`)):(a.push(`${h}: '${c.fontCharacter}'; ${u}: 'codicon';`),r.push(`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`))}for(const l in o){const c=o[l],d=c.weight?`font-weight: ${c.weight};`:"",u=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${Sa(f.location)} format('${f.format}')`).join(", ");r.push(`@font-face { src: ${h}; font-family: ${nv(l)};${d}${u} font-display: block; }`)}return r.push(`:root { ${a.join(" ")} }`),r.join(`
|
||
|
|
`)}}}class u4{getIcon(e){const t=l4();let i=e.defaults;for(;et.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const Qa="vs",If="vs-dark",mu="hc-black",pu="hc-light",h4=zi.as(IA.ColorContribution),iY=zi.as(KA.ThemingContribution);class f4{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(Vp(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(const t in this.themeData.colors)e.set(t,K.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=Dy(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,K.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=h4.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Qa:return Hs.LIGHT;case mu:return Hs.HIGH_CONTRAST_DARK;case pu:return Hs.HIGH_CONTRAST_LIGHT;default:return Hs.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=Dy(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const o={token:""};i&&(o.foreground=i),n&&(o.background=n),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=o4.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Zn.getForeground(o),a=Zn.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function Vp(s){return s===Qa||s===If||s===mu||s===pu}function Dy(s){switch(s){case Qa:return GZ;case If:return ZZ;case mu:return YZ;case pu:return QZ}}function ap(s){const e=Dy(s);return new f4(s,e)}class nY extends G{constructor(){super(),this._onColorThemeChange=this._register(new O),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new O),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new u4,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Qa,ap(Qa)),this._knownThemes.set(If,ap(If)),this._knownThemes.set(mu,ap(mu)),this._knownThemes.set(pu,ap(pu));const e=this._register(tY(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
|
||
|
|
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Qa),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),dT(wt,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return i_(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=ys(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),G.None}_registerShadowDomContainer(e){const t=ys(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!Vp(t.base)&&!Vp(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new f4(e,t)),Vp(e)&&this._knownThemes.forEach(i=>{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Qa),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=wt.matchMedia("(forced-colors: active)").matches;if(e!==iu(this._theme.type)){let t;e1(this._theme.type)?t=e?mu:If:t=e?pu:Qa,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};iY.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of h4.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${hL(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join(`
|
||
|
|
`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(qZ(o)),this._themeCSS=e.join(`
|
||
|
|
`),this._updateCSS(),oi.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}
|
||
|
|
${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const fo=Qe("themeService");var sY=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},hb=function(s,e){return function(t,i){e(t,i,s)}};let xy=class extends G{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new O,this._onDidChangeReducedMotion=new O,this._accessibilityModeEnabledContext=v8.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const o=wt.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){this._register(j(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("reduce-motion",i),this._layoutService.mainContainer.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};xy=sY([hb(0,bt),hb(1,Pl),hb(2,Xt)],xy);var N1=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},yr=function(s,e){return function(t,i){e(t,i,s)}},Ld,Va;let Ey=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new c0(i)}createMenu(e,t,i){return new Ny(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};Ey=N1([yr(0,Ls),yr(1,Zi),yr(2,m1)],Ey);let c0=Ld=class{constructor(e){this._storageService=e,this._disposables=new pe,this._onDidChange=new O,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(Ld._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,Ld._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(Ld._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==voi
|
||
|
|
(-> incoming)[${[...i.incoming.keys()].join(", ")}]
|
||
|
|
(outgoing ->)[${[...i.outgoing.keys()].join(",")}]
|
||
|
|
`);return e.join(`
|
||
|
|
`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(n,t);if(o)return o;t.delete(i)}}}const _Y=!1;class PI extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph:
|
||
|
|
${e.toString()}`}}class u0{constructor(e=new Qg,t=!1,i,n=_Y){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(vt,this),this._globalGraph=n?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new RI(r=>r):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,Hi(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)KN(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,n=new class extends u0{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t==null||t.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();const i=Fn.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw CS("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,n;return e instanceof or?(i=Fn.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Fn.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=No.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof or)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof or?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){var n;const o=new RI(l=>l.id.toString());let r=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(o.lookupOrInsertNode(l),r++>1e3)throw new PI(o);for(const c of No.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(n=this._globalGraph)===null||n===void 0||n.insertEdge(String(l.id),String(c.id)),d instanceof or){const u={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};o.insertEdge(l,u),a.push(u)}}}for(;;){const l=o.roots();if(l.length===0){if(!o.isEmpty())throw new PI(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof or){const u=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setCreatedServiceInstance(c.id,u)}o.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,
|
||
|
|
`).slice(3,4).join(`
|
||
|
|
`)):Fn._None}static traceCreation(e,t){return e?new Fn(1,t.name):Fn._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Fn(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Fn._totals+=e;let t=!1;function i(o,r){const a=[],l=new Array(o+1).join(" ");for(const[c,d,u]of r._dep)if(d&&u){t=!0,a.push(`${l}CREATES -> ${c}`);const h=i(o+1,u);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(`
|
||
|
|
`)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Fn._totals.toFixed(2)}ms)`];(e>2||t)&&Fn.all.add(n.join(`
|
||
|
|
`))}}Fn.all=new Set;Fn._None=new class extends Fn{constructor(){super(0,null)}stop(){}branch(){return this}};Fn._totals=0;const vY=new Set([ze.inMemory,ze.vscodeSourceControl,ze.walkThrough,ze.walkThroughSnippet,ze.vscodeChatCodeBlock,ze.vscodeCopilotBackingChatCodeBlock]);class bY{constructor(){this._byResource=new pn,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 pn,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:ot.empty():$e.isUri(e)?(o=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&o!==void 0?o:ot.empty():ot.map(ot.concat(...this._byOwner.values()),r=>r[1])}}class CY{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new pn,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(vY.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Ps.Error?t.errors+=1:i===Ps.Warning?t.warnings+=1:i===Ps.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 Ua{constructor(){this._onMarkerChanged=new qN({delay:0,merge:Ua._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new bY,this._stats=new CY(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(p5(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const r=Ua._toMarker(e,t,o);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,u=u>0?u:c,{resource:t,owner:e,code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const o of n){const r=ot.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(L0(t)){const o=new pn;for(const{resource:r,marker:a}of t){const l=Ua._toMarker(e,r,a);if(!l)continue;const c=o.get(r);c?c.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Ua._accept(l,n)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Ua._accept(l,n)){const c=r.push(l);if(o>0&&c===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const c of l)if(Ua._accept(c,n)){const d=a.push(c);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new pn;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}class wY extends G{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=Bi.createEmptyModel(this.logService)}reload(){return this.resetConfigurationModel(),this.configurat
|
||
|
|
|
||
|
|
`+t),wt.confirm(i)}async prompt(e){var t,i;let n;if(this.doConfirm(e.message,e.detail)){const r=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),n=await((i=r[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1}))}return{result:n}}async error(e,t){await this.prompt({type:fi.Error,message:e,detail:t})}}class Lg{info(e){return this.notify({severity:fi.Info,message:e})}warn(e){return this.notify({severity:fi.Warning,message:e})}error(e){return this.notify({severity:fi.Error,message:e})}notify(e){switch(e.severity){case fi.Error:console.error(e.message);break;case fi.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Lg.NO_OP}prompt(e,t,i,n){return Lg.NO_OP}status(e,t){return G.None}}Lg.NO_OP=new vU;let Ry=class{constructor(e){this._onWillExecuteCommand=new O,this._onDidExecuteCommand=new O,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=sn.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)}}};Ry=Ia([Ii(0,vt)],Ry);let $u=class extends KK{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new pe;g.add(j(f,J.KEY_DOWN,m=>{const _=new Ot(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(j(f,J.KEY_UP,m=>{const _=new Ot(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new IY(f,g))},l=f=>{for(let g=0;g<this._domNodeListeners.length;g++){const m=this._domNodeListeners[g];m.domNode===f&&(this._domNodeListeners.splice(g,1),m.dispose())}},c=f=>{f.getOption(61)||a(f.getContainerDomNode())},d=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const u=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(u)),this._register(r.onDiffEditorRemove(h)),r.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,i,n){return br(sn.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>{var n;return{keybinding:xC(i.keybinding,to),command:(n=i.command)!==null&&n!==void 0?n:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Be(()=>{for(let i=0;i<this._dynamicKeybindings.length;i++)if(this._dynamicKeybindings[i]===t[0]){this._dynamicKeybindings.splice(i,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(Fc.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new Df(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return wt.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new ME(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=ug.resolveKeybinding(a,to);for(const c of l)i[n++]=new ME(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Ac(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new ug([t],to)}};$u=Ia([Ii(0,bt),Ii(1,Ls),Ii(2,Rl),Ii(3,$o),Ii(4,uo),Ii(5,gi)],$u);class IY extends G{constructor(e,t){super(),this.domNode=e,this._register(t)}}function FI(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource|
|
||
|
|
`:`\r
|
||
|
|
`}};Fy=Ia([Ii(0,Xt)],Fy);class NY{publicLog2(){}}class kg{constructor(){const e=$e.from({scheme:kg.SCHEME,authority:"model",path:"/"});this.workspace={id:gR,folders:[new lj({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===kg.SCHEME?this.workspace.folders[0]:null}}kg.SCHEME="inmemory";function f0(s,e,t){if(!e||!(s instanceof h0))return;const i=[];Object.keys(e).forEach(n=>{FK(n)&&i.push([`editor.${n}`,e[n]]),t&&OK(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}let Oy=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:GL.convert(e),n=new Map;for(const a of i){if(!(a instanceof Ec))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=n.get(l);c||(c=[],n.set(l,c)),c.push(Gw.replaceMove(M.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,o+=l.length;return{ariaSummary:Xp(Yw.bulkEditServiceSummary,o,r),isApplied:o>0}}};Oy=Ia([Ii(0,ns)],Oy);class TY{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return xL(e)}}let By=class extends IK{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};By=Ia([Ii(0,Pl),Ii(1,gi)],By);class AY{constructor(){this._neverEmitter=new O,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class MY extends fg{constructor(){super()}}class RY extends SY{constructor(){super(new k7)}}let Wy=class extends oy{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r),this.configure({blockMouse:!1})}};Wy=Ia([Ii(0,Rl),Ii(1,$o),Ii(2,Jg),Ii(3,Zi),Ii(4,Jc),Ii(5,bt)],Wy);class PY{async playSignal(e,t){}}rt(uo,RY,0);rt(Xt,h0,0);rt(_A,Py,0);rt(vA,Fy,0);rt(sj,kg,0);rt(QK,TY,0);rt(Rl,NY,0);rt(WM,EY,0);rt($M,xY,0);rt($o,Lg,0);rt(rd,Ua,0);rt(Mi,MY,0);rt(fo,nY,0);rt(ns,J_,0);rt(xA,dy,0);rt(bt,Ay,0);rt(XK,DY,0);rt(YL,T1,0);rt(m1,_q,0);rt(od,QC,0);rt(MK,Oy,0);rt(dj,AY,0);rt(Bg,My,0);rt(Uo,xy,0);rt(Ar,hZ,0);rt(Ls,Ry,0);rt(Zi,$u,0);rt(b1,ky,0);rt(Jg,By,0);rt(em,cy,0);rt(Sk,d0,0);rt(Da,Wy,0);rt(Jc,Ey,0);rt(ah,PY,0);var Se;(function(s){const e=new Qg;for(const[l,c]of QD())e.set(l,c);const t=new u0(e,!0);e.set(vt,t);function i(l){n||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof or?t.invokeFunction(d=>d.get(l)):c}s.get=i;let n=!1;const o=new O;function r(l){if(n)return t;n=!0;for(const[d,u]of QD())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=Qe(d);e.get(u)instanceof or&&e.set(u,l[d])}const c=LY();for(const d of c)try{t.createInstance(d)}catch(u){At(u)}return o.fire(),t}s.initialize=r;function a(l){if(n)return l();const c=new pe,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}s.withServices=a})(Se||(Se={}));class Dg{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Dg(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;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 Dg(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor
|
||
|
|
`:`\r
|
||
|
|
`),await this._clipboardService.writeText(w)})),i.getOption(91)||v.push(new ma("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(Ai(this._diffActions,"mousedown",g=>{if(!g.leftButton)return;const{top:m,height:_}=Fs(this._diffActions),v=Math.floor(d/3);g.preventDefault(),f(g.posx,m+_+v)})),this._register(i.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.leftButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),f(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:n}=Fs(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;c<this._viewLineCounts.length;c++)if(l+=this._viewLineCounts[c],r<l)return c}return r}}const KI=ed("diffEditorWidget",{createHTML:s=>s});function uQ(s,e,t,i){nn(i,e.fontInfo);const n=t.length>0,o=new j0(1e4);let r=0,a=0;const l=[];for(let h=0;h<s.lineTokens.length;h++){const f=h+1,g=s.lineTokens[h],m=s.lineBreakData[h],_=no.filter(t,f,1,Number.MAX_SAFE_INTEGER);if(m){let v=0;for(const b of m.breakOffsets){const C=g.sliceAndInflate(v,b,0);r=Math.max(r,jI(a,C,no.extractWrapped(_,v,b),n,s.mightContainNonBasicASCII,s.mightContainRTL,e,o)),a++,v=b}l.push(m.breakOffsets.length)}else l.push(1),r=Math.max(r,jI(a,g,_,n,s.mightContainNonBasicASCII,s.mightContainRTL,e,o)),a++}r+=e.scrollBeyondLastColumn;const c=o.build(),d=KI?KI.createHTML(c):c;i.innerHTML=d;const u=r*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:u,viewLineCounts:l}}class hQ{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class Nk{static fromEditor(e){var t;const i=e.getOptions(),n=i.get(50),o=i.get(145);return new Nk(((t=e.getModel())===null||t===void 0?void 0:t.getOptions().tabSize)||0,n,i.get(33),n.typicalHalfwidthCharacterWidth,i.get(104),i.get(67),o.decorationsWidth,i.get(117),i.get(99),i.get(94),i.get(51))}constructor(e,t,i,n,o,r,a,l,c,d,u){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=o,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=u}}function jI(s,e,t,i,n,o,r,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(s*r.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),c=Ss.isBasicASCII(l,n),d=Ss.containsRTL(l,c,o),u=cL(new th(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Ns.OFF,null),a);return a.appendString("</div>"),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var fQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},qI=function(s,e){return function(t,i){e(t,i,s)}};let jy=class extends G{constructor(e,t,i,n,o,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuS
|
||
|
|
`);let r=t;return o!==-1&&(r=t.substring(0,o)),iN(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return iN(s,t,e.createById(i),n)}function iN(s,e,t,i){return s.createModel(e,t,i)}var NQ=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},TQ=function(s,e){return function(t,i){e(t,i,s)}};class AQ{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let y0=class extends G{constructor(e,t,i,n){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=lt(this,void 0),this._collapsed=He(this,r=>{var a;return(a=this._viewModel.read(r))===null||a===void 0?void 0:a.collapsed.read(r)}),this._editorContentHeight=lt(this,500),this.contentHeight=He(this,r=>(this._collapsed.read(r)?0:this._editorContentHeight.read(r))+this._outerEditorHeight),this._modifiedContentWidth=lt(this,0),this._modifiedWidth=lt(this,0),this._originalContentWidth=lt(this,0),this._originalWidth=lt(this,0),this.maxScroll=He(this,r=>{const a=this._modifiedContentWidth.read(r)-this._modifiedWidth.read(r),l=this._originalContentWidth.read(r)-this._originalWidth.read(r);return a>l?{maxScroll:a,width:this._modifiedWidth.read(r)}:{maxScroll:l,width:this._originalWidth.read(r)}}),this._elements=dt("div.multiDiffEntry",[dt("div.header@header",[dt("div.header-content",[dt("div.collapse-button@collapseButton"),dt("div.file-path",[dt("div.title.modified.show-file-icons@primaryPath",[]),dt("div.status.deleted@status",["R"]),dt("div.title.original.show-file-icons@secondaryPath",[])]),dt("div.actions@actions")])]),dt("div.editorParent",[dt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(C0,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode},{})),this.isModifedFocused=nN(this.editor.getModifiedEditor()),this.isOriginalFocused=nN(this.editor.getOriginalEditor()),this.isFocused=He(this,r=>this.isModifedFocused.read(r)||this.isOriginalFocused.read(r)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=new pe,this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const o=new my(this._elements.collapseButton,{});this._register(_t(r=>{o.element.className="",o.icon=this._collapsed.read(r)?ce.chevronRight:ce.chevronDown})),this._register(o.onDidClick(()=>{var r;(r=this._viewModel.get())===null||r===void 0||r.collapsed.set(!this._collapsed.get(),void 0)})),this._register(_t(r=>{this._elements.editor.style.display=this._collapsed.read(r)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(r=>{const a=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(a,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(r=>{const a=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(a,void 0)})),this._register(this.editor.onDidContentSizeChange(r=>{Rp(a=>{this._editorContentHeight.set(r.contentHeight,a),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),a),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),a)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(r=>{if(this._isSettingScrollTop||!r.scrollTopChanged||!this._data)return;const a=r.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(a)})),this._register(_t(r=>{var a;const l=(a=this._viewModel.read(r))===null||a===void 0?void 0:a.isActive.read(r);thi
|
||
|
|
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:va(t,a.open),close:va(t,a.close)});else throw Pt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function SX(s){xu.registerLanguage(s)}function LX(){let s=[];return s=s.concat(xu.getLanguages()),s}function kX(s){return Se.get(Mi).languageIdCodec.encodeLanguageId(s)}function DX(s,e){return Se.withServices(()=>{const i=Se.get(Mi).onDidRequestRichLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function xX(s,e){return Se.withServices(()=>{const i=Se.get(Mi).onDidRequestBasicLanguageFeatures(n=>{n===s&&(i.dispose(),e())});return i})}function EX(s,e){if(!Se.get(Mi).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return Se.get(Nr).register(s,e,100)}class IX{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return Eg.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new I0(n.tokens,n.endState)}}class Eg{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,r=e.length;o<r;o++){const a=e[o];let l=a.startIndex;o===0?l=0:l<n&&(l=n),i[o]=new Pf(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),r=Eg._toClassicTokens(o.tokens,e);let a;return o.endState.equals(n)?a=n:a=o.endState,new DS(r,a)}tokenize(e,t,i){return Eg.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let r=0,a=0;for(let c=0,d=t.length;c<d;c++){const u=t[c],h=n.match(i,u.scopes)|1024;if(r>0&&o[r-1]===h)continue;let f=u.startIndex;c===0?f=0:f<a&&(f=a),o[r++]=f,o[r++]=h,a=f}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=o[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new I0(o,r)}}function NX(s){return typeof s.getInitialState=="function"}function TX(s){return"tokenizeEncoded"in s}function T4(s){return s&&typeof s.then=="function"}function AX(s){const e=Se.get(fo);if(s){const t=[null];for(let i=1,n=s.length;i<n;i++)t[i]=K.fromHex(s[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function A4(s,e){return TX(e)?new IX(s,e):new Eg(s,e,Se.get(Mi),Se.get(fo))}function Ak(s,e){const t=new CF(async()=>{const i=await Promise.resolve(e.create());return i?NX(i)?A4(s,i):new Gf(Se.get(Mi),Se.get(fo),s,N4(s,i),Se.get(Xt)):null});return oi.registerFactory(s,t)}function MX(s,e){if(!Se.get(Mi).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return T4(e)?Ak(s,{create:()=>e}):oi.register(s,A4(s,e))}function RX(s,e){const t=i=>new Gf(Se.get(Mi),Se.get(fo),s,N4(s,i),Se.get(Xt));return T4(e)?Ak(s,{create:()=>e}):oi.register(s,t(e))}function PX(s,e){return Se.get(kt).referenceProvider.register(s,e)}function FX(s,e){return Se.get(kt).renameProvider.register(s,e)}function OX(s,e){return Se.get(kt).newSymbolNamesProvider.register(s,e)}function BX(s,e){return Se.get(kt).signatureHelpProvider.register(s,e)}function WX(s,e){return Se.get(kt).hoverProvider.register(s,{provideHover:async(i,n,o,r)=>{const a=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new M(n.lineNumber,a.startColumn,n.lineNumber,a.endColumn)),l.range||(l.range=new M(n.lineNumber,n.column,n.lineNumber,n.column)),l})}})}function VX(s,e){return Se.get(kt).documentSymbo
|
||
|
|
`;var h=Ji.createOnigString(e),f=Ji.getString(h).length,g=new Lee(i,e,this._tokenTypeMatchers),m=G4(this,h,n,0,t,g);return{lineLength:f,lineTokens:g,ruleStack:m}},s}();jo.Grammar=q4;function wN(s,e){return s=mee.clone(s),s.repository=s.repository||{},s.repository.$self={$vscodeTextmateLocation:s.$vscodeTextmateLocation,patterns:s.patterns,name:s.scopeName},s.repository.$base=e||s.repository.$self,s}function tf(s,e,t,i,n,o,r){if(o.length!==0){for(var a=Math.min(o.length,r.length),l=[],c=r[0].end,d=0;d<a;d++){var u=o[d];if(u!==null){var h=r[d];if(h.length!==0){if(h.start>c)break;for(;l.length>0&&l[l.length-1].endPos<=h.start;)n.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?n.produceFromScopes(l[l.length-1].scopes,h.start):n.produce(i,h.start),u.retokenizeCapturedWithRuleId){var f=u.getName(Ji.getString(e),r),g=i.contentNameScopesList.push(s,f),m=u.getContentName(Ji.getString(e),r),_=g.push(s,m),v=i.push(u.retokenizeCapturedWithRuleId,h.start,null,g,_);G4(s,Ji.createOnigString(Ji.getString(e).substring(0,h.end)),t&&h.start===0,h.start,v,n);continue}var b=u.getName(Ji.getString(e),r);if(b!==null){var C=l.length>0?l[l.length-1].scopes:i.contentNameScopesList,w=C.push(s,b);l.push(new Z4(w,h.end))}}}}for(;l.length>0;)n.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}}function Wk(s){for(var e=[],t=0,i=s.rules.length;t<i;t++)e.push(" - "+s.rules[t]+": "+s.debugRegExps[t]);return e.join(`
|
||
|
|
`)}function Cee(s,e,t,i,n,o,r){for(var a=Number.MAX_VALUE,l=null,c,d=0,u=o.contentNameScopesList.generateScopes(),h=0,f=s.length;h<f;h++){var g=s[h];if(g.matcher(u)){var m=e.getRule(g.ruleId).compile(e,null,i,n===r),_=m.scanner.findNextMatchSync(t,n);if(Do.IN_DEBUG_MODE&&(console.log(" scanning for injections"),console.log(Wk(m))),!!_){var v=_.captureIndices[0].start;if(!(v>=a)&&(a=v,l=_.captureIndices,c=m.rules[_.index],d=g.priority,a===n))break}}}return l?{priorityMatch:d===-1,captureIndices:l,matchedRuleId:c}:null}function wee(s,e,t,i,n,o){var r=n.getRule(s),a=r.compile(s,n.endRule,t,i===o),l=a.scanner.findNextMatchSync(e,i);return Do.IN_DEBUG_MODE&&(console.log(" scanning for"),console.log(Wk(a))),l?{captureIndices:l.captureIndices,matchedRuleId:a.rules[l.index]}:null}function yee(s,e,t,i,n,o){var r=wee(s,e,t,i,n,o),a=s.getInjections();if(a.length===0)return r;var l=Cee(a,s,e,t,i,n,o);if(!l)return r;if(!r)return l;var c=r.captureIndices[0].start,d=l.captureIndices[0].start;return d<c||l.priorityMatch&&d===c?l:r}function See(s,e,t,i,n,o){for(var r=-1,a=[],l=n;l;l=l.pop()){var c=l.getRule(s);c instanceof Ji.BeginWhileRule&&a.push({rule:c,stack:l})}for(var d=a.pop();d;d=a.pop()){var u=d.rule.compileWhile(s,d.stack.endRule,t,r===i),h=u.scanner.findNextMatchSync(e,i);if(Do.IN_DEBUG_MODE&&(console.log(" scanning for while rule"),console.log(Wk(u))),h){var f=u.rules[h.index];if(f!==-2){n=d.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(o.produce(d.stack,h.captureIndices[0].start),tf(s,e,t,d.stack,o,d.rule.whileCaptures,h.captureIndices),o.produce(d.stack,h.captureIndices[0].end),r=h.captureIndices[0].end,h.captureIndices[0].end>i&&(i=h.captureIndices[0].end,t=!1))}else{n=d.stack.pop();break}}return{stack:n,linePos:i,anchorPosition:r,isFirstLine:t}}function G4(s,e,t,i,n,o){var r=Ji.getString(e).length,a=!1,l=See(s,e,t,i,n,o);n=l.stack,i=l.linePos,t=l.isFirstLine;for(var c=l.anchorPosition;!a;)d();function d(){Do.IN_DEBUG_MODE&&(console.log(""),console.log("@@scanNext: |"+Ji.getString(e).replace(/\n$/,"\\n").substr(i)+"|"));var u=yee(s,e,t,i,n,c);if(!u){Do.IN_DEBUG_MODE&&console.log(" no more matches."),o.produce(n,r),a=!0;return}var h=u.captureIndices,f=u.matchedRuleId,g=h&&h.length>0?h[0].end>i:!1;if(f===-1){var m=n.getRule(s);Do.IN_DEBUG_MODE&&console.log(" popping "+m.debugName+" - "+m.debugEndRegExp),o.produce(n,h[0].start),n=n.setContentNameScopesList(n.nameScopesList),tf(s,e,t,n,o,m.endCaptures,h),o.produce(n,h[0].end);var _=n;if(n=n.pop(),!g&&_.getEnterPos()===i){console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),n=_,o.produce(n,r),a=!0;return}}else{var v=s.getRule(f);o.produce(n,h[0].start);var b=n,C=v.getName(Ji.getString(e),h),w=n.contentNameScopesList.push(s,C);if(n=n.push(f,i,null,w,w),v instanceof Ji.BeginEndRule){var y=v;Do.IN_DEBUG_MODE&&console.log(" pushing "+y.debugName+" - "+y.debugBeginRegExp),tf(s,e,t,n,o,y.beginCaptures,h),o.produce(n,h[0].end),c=h[0].end;var L=y.getContentName(Ji.getString(e),h),k=w.push(s,L);if(n=n.setContentNameScopesList(k),y.endHasBackReferences&&(n=n.setEndRule(y.getEndWithResolvedBackReferences(Ji.getString(e),h))),!g&&b.hasSameRuleAs(n)){console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),n=n.pop(),o.produce(n,r),a=!0;return}}else if(v instanceof Ji.BeginWhileRule){var y=v;Do.IN_DEBUG_MODE&&console.log(" pushing "+y.debugName),tf(s,e,t,n,o,y.beginCaptures,h),o.produce(n,h[0].end),c=h[0].end;var L=y.getContentName(Ji.getString(e),h),k=w.push(s,L);if(n=n.setContentNameScopesList(k),y.whileHasBackReferences&&(n=n.setEndRule(y.getWhileWithResolvedBackReferences(Ji.getString(e),h))),!g&&b.hasSameRuleAs(n)){console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),n=n.pop(),o.produce(n,r),a=!0;return}}else{var D=v;if(Do.IN_DEBUG_MODE&&console.log(" matched "+D.debugName+" - "+D.debugMatchRegExp),tf(s,e,t,n,o,D.captures,h),o.produce(n,h[0].end),n=n.pop(),!g){console.error("[4] - Grammar is in an endless loop - Grammar
|
||
|
|
`;case"r":return"\r";case"t":return" ";default:Q4(s,"invalid escape sequence")}})}else if(a===91)e.type=2,i++,r++;else if(a===123)e.type=3,i++,r++;else if(a===93)e.type=4,i++,r++;else if(a===125)e.type=5,i++,r++;else if(a===58)e.type=6,i++,r++;else if(a===44)e.type=7,i++,r++;else if(a===110){if(e.type=8,i++,r++,a=t.charCodeAt(i),a!==117||(i++,r++,a=t.charCodeAt(i),a!==108)||(i++,r++,a=t.charCodeAt(i),a!==108))return!1;i++,r++}else if(a===116){if(e.type=9,i++,r++,a=t.charCodeAt(i),a!==114||(i++,r++,a=t.charCodeAt(i),a!==117)||(i++,r++,a=t.charCodeAt(i),a!==101))return!1;i++,r++}else if(a===102){if(e.type=10,i++,r++,a=t.charCodeAt(i),a!==97||(i++,r++,a=t.charCodeAt(i),a!==108)||(i++,r++,a=t.charCodeAt(i),a!==115)||(i++,r++,a=t.charCodeAt(i),a!==101))return!1;i++,r++}else{e.type=11;do{if(i>=n)return!1;if(a=t.charCodeAt(i),a===46||a>=48&&a<=57||a===101||a===69||a===45||a===43){i++,r++;continue}break}while(!0)}return e.len=i-e.offset,e.value===null&&(e.value=t.substr(e.offset,e.len)),s.pos=i,s.line=o,s.char=r,!0}Object.defineProperty(O1,"__esModule",{value:!0});var SN=Gu,X4=hm,Aee=Vk;function Mee(s,e){return X4.CAPTURE_METADATA?Aee.parse(s,e,!0):JSON.parse(s)}O1.parseJSONGrammar=Mee;function Ree(s,e){return X4.CAPTURE_METADATA?SN.parseWithLocation(s,e,"$vscodeTextmateLocation"):SN.parse(s)}O1.parsePLISTGrammar=Ree;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});var J4=function(){function s(e,t,i,n,o,r){this.scope=e,this.parentScopes=t,this.index=i,this.fontStyle=n,this.foreground=o,this.background=r}return s}();Mr.ParsedThemeRule=J4;function LN(s){return!!(/^#[0-9a-f]{6}$/i.test(s)||/^#[0-9a-f]{8}$/i.test(s)||/^#[0-9a-f]{3}$/i.test(s)||/^#[0-9a-f]{4}$/i.test(s))}function e5(s){if(!s)return[];if(!s.settings||!Array.isArray(s.settings))return[];for(var e=s.settings,t=[],i=0,n=0,o=e.length;n<o;n++){var r=e[n];if(r.settings){var a=void 0;if(typeof r.scope=="string"){var l=r.scope;l=l.replace(/^[,]+/,""),l=l.replace(/[,]+$/,""),a=l.split(",")}else Array.isArray(r.scope)?a=r.scope:a=[""];var c=-1;if(typeof r.settings.fontStyle=="string"){c=0;for(var d=r.settings.fontStyle.split(" "),u=0,h=d.length;u<h;u++){var f=d[u];switch(f){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break}}}var g=null;typeof r.settings.foreground=="string"&&LN(r.settings.foreground)&&(g=r.settings.foreground);var m=null;typeof r.settings.background=="string"&&LN(r.settings.background)&&(m=r.settings.background);for(var u=0,h=a.length;u<h;u++){var l=a[u].trim(),d=l.split(" "),_=d[d.length-1],v=null;d.length>1&&(v=d.slice(0,d.length-1),v.reverse()),t[i++]=new J4(_,v,n,c,g,m)}}}return t}Mr.parseTheme=e5;function Pee(s){s.sort(function(u,h){var f=Hk(u.scope,h.scope);return f!==0||(f=zk(u.parentScopes,h.parentScopes),f!==0)?f:u.index-h.index});for(var e=0,t="#000000",i="#ffffff";s.length>=1&&s[0].scope==="";){var n=s.shift();n.fontStyle!==-1&&(e=n.fontStyle),n.foreground!==null&&(t=n.foreground),n.background!==null&&(i=n.background)}for(var o=new t5,r=new Ng(0,null,e,o.getId(t),o.getId(i)),a=new n5(new Ng(0,null,-1,0,0),[]),l=0,c=s.length;l<c;l++){var d=s[l];a.insert(0,d.scope,d.parentScopes,d.fontStyle,o.getId(d.foreground),o.getId(d.background))}return new i5(o,r,a)}var t5=function(){function s(){this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null)}return s.prototype.getId=function(e){if(e===null)return 0;e=e.toUpperCase();var t=this._color2id[e];return t||(t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t)},s.prototype.getColorMap=function(){return this._id2color.slice(0)},s}();Mr.ColorMap=t5;var i5=function(){function s(e,t,i){this._colorMap=e,this._root=i,this._defaults=t,this._cache={}}return s.createFromRawTheme=function(e){return this.createFromParsedTheme(e5(e))},s.createFromParsedTheme=function(e){return Pee(e)},s.prototype.getColorMap=function(){return this._colorMap.getColorMap()},s.prototype.getDefaults=function(){return this._defaults},s.prototype.match=function(e){return this._cache.hasOwnProperty(e)||(this._cache[e]=this._root.match(e)),this._cache[e]},s}();Mr.Theme=i5;function
|