38 lines
293 KiB
JavaScript
38 lines
293 KiB
JavaScript
|
var nl=Object.defineProperty;var il=(Me,be,me)=>be in Me?nl(Me,be,{enumerable:!0,configurable:!0,writable:!0,value:me}):Me[be]=me;var Mt=(Me,be,me)=>(il(Me,typeof be!="symbol"?be+"":be,me),me);var ve=(Me,be,me)=>new Promise((Pt,Qe)=>{var ir=we=>{try{ht(me.next(we))}catch(Tt){Qe(Tt)}},ar=we=>{try{ht(me.throw(we))}catch(Tt){Qe(Tt)}},ht=we=>we.done?Pt(we.value):Promise.resolve(we.value).then(ir,ar);ht((me=me.apply(Me,be)).next())});(function(){"use strict";class Me{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?new Error(t.message+`
|
||
|
|
||
|
`+t.stack):t},0)}}emit(t){this.listeners.forEach(r=>{r(t)})}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}}const be=new Me;function me(e){ir(e)||be.onUnexpectedError(e)}function Pt(e){if(e instanceof Error){let{name:t,message:r}=e;const n=e.stacktrace||e.stack;return{$isError:!0,name:t,message:r,stack:n}}return e}const Qe="Canceled";function ir(e){return e instanceof ar?!0:e instanceof Error&&e.name===Qe&&e.message===Qe}class ar extends Error{constructor(){super(Qe),this.name=this.message}}function ht(e){const t=this;let r=!1,n;return function(){return r||(r=!0,n=e.apply(t,arguments)),n}}var we;(function(e){function t(w){return w&&typeof w=="object"&&typeof w[Symbol.iterator]=="function"}e.is=t;const r=Object.freeze([]);function n(){return r}e.empty=n;function*i(w){yield w}e.single=i;function s(w){return w||r}e.from=s;function o(w){return!w||w[Symbol.iterator]().next().done===!0}e.isEmpty=o;function l(w){return w[Symbol.iterator]().next().value}e.first=l;function u(w,v){for(const S of w)if(v(S))return!0;return!1}e.some=u;function c(w,v){for(const S of w)if(v(S))return S}e.find=c;function*h(w,v){for(const S of w)v(S)&&(yield S)}e.filter=h;function*f(w,v){let S=0;for(const A of w)yield v(A,S++)}e.map=f;function*d(...w){for(const v of w)for(const S of v)yield S}e.concat=d;function*m(w){for(const v of w)for(const S of v)yield S}e.concatNested=m;function b(w,v,S){let A=S;for(const y of w)A=v(A,y);return A}e.reduce=b;function*p(w,v,S=w.length){for(v<0&&(v+=w.length),S<0?S+=w.length:S>w.length&&(S=w.length);v<S;v++)yield w[v]}e.slice=p;function g(w,v=Number.POSITIVE_INFINITY){const S=[];if(v===0)return[S,w];const A=w[Symbol.iterator]();for(let y=0;y<v;y++){const C=A.next();if(C.done)return[S,e.empty()];S.push(C.value)}return[S,{[Symbol.iterator](){return A}}]}e.consume=g;function N(w,v,S=(A,y)=>A===y){const A=w[Symbol.iterator](),y=v[Symbol.iterator]();for(;;){const C=A.next(),_=y.next();if(C.done!==_.done)return!1;if(C.done)return!0;if(!S(C.value,_.value))return!1}}e.equals=N})(we||(we={}));function Tt(e){return e}function al(e,t){}class La extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`),this.errors=t}}function on(e){if(we.is(e)){let t=[];for(const r of e)if(r)try{r.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new La(t);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function ka(...e){return Et(()=>on(e))}function Et(e){return{dispose:ht(()=>{e()})}}class Ke{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){try{on(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Ke.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(t),t}}Ke.DISABLE_DISPOSED_WARNING=!1;class sr{constructor(){this._store=new Ke,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}sr.None=Object.freeze({dispose(){}});class xa{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1}set(t){let r=t;return this.unset=()=>r=void 0,this.isset=()=>r!==void 0,this.dispose=()=>{r&&(r(),r=void 0)},this}}class z{constructor(t){this.element=t,this.next=z.Undefined,this.prev=z.Undefined}}z.Undefined=new z(void 0);class ln{constructor(){this._first=z.Undefined,this._last=z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===z.Undefined}clear(){let t=this._first;for(;t!==z.Undefined;){const r=t.next;t.prev=z.Undefined,t.next=z.Undefined,t=r}this._first=z.Undefined,this._last=z.Undefined,this._size=0}unshift(t){return this._insert(t,!1)}push(t){return this._insert(t,!0)}
|
||
|
`).slice(2).join(`
|
||
|
`))}}class Va{constructor(t,r,n){this.callback=t,this.callbackThis=r,this.stack=n,this.subscription=new xa}invoke(t){this.callback.call(this.callbackThis,t)}}class Pe{constructor(t){var r;this._disposed=!1,this._options=t,this._leakageMon=void 0,this._perfMon=!((r=this._options)===null||r===void 0)&&r._profName?new Rt(this._options._profName):void 0}dispose(){var t,r,n,i;this._disposed||(this._disposed=!0,this._listeners&&this._listeners.clear(),(t=this._deliveryQueue)===null||t===void 0||t.clear(),(n=(r=this._options)===null||r===void 0?void 0:r.onLastListenerRemove)===null||n===void 0||n.call(r),(i=this._leakageMon)===null||i===void 0||i.dispose())}get event(){return this._event||(this._event=(t,r,n)=>{var i,s,o;this._listeners||(this._listeners=new ln);const l=this._listeners.isEmpty();l&&(!((i=this._options)===null||i===void 0)&&i.onFirstListenerAdd)&&this._options.onFirstListenerAdd(this);let u,c;this._leakageMon&&this._listeners.size>=30&&(c=dr.create(),u=this._leakageMon.check(c,this._listeners.size+1));const h=new Va(t,r,c),f=this._listeners.push(h);l&&(!((s=this._options)===null||s===void 0)&&s.onFirstListenerDidAdd)&&this._options.onFirstListenerDidAdd(this),!((o=this._options)===null||o===void 0)&&o.onListenerDidAdd&&this._options.onListenerDidAdd(this,t,r);const d=h.subscription.set(()=>{u&&u(),this._disposed||(f(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return n instanceof Ke?n.add(d):Array.isArray(n)&&n.push(d),d}),this._event}fire(t){var r,n;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new ln);for(let i of this._listeners)this._deliveryQueue.push([i,t]);for((r=this._perfMon)===null||r===void 0||r.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,s]=this._deliveryQueue.shift();try{i.invoke(s)}catch(o){me(o)}}(n=this._perfMon)===null||n===void 0||n.stop()}}}function Ia(e){let t=[],r=Object.getPrototypeOf(e);for(;Object.prototype!==r;)t=t.concat(Object.getOwnPropertyNames(r)),r=Object.getPrototypeOf(r);return t}function mr(e){const t=[];for(const r of Ia(e))typeof e[r]=="function"&&t.push(r);return t}function Ra(e,t){const r=i=>function(){const s=Array.prototype.slice.call(arguments,0);return t(i,s)};let n={};for(const i of e)n[i]=r(i);return n}function Da(e,t="Unreachable"){throw new Error(t)}class Oa{constructor(t){this.computeFn=t,this.lastCache=void 0,this.lastArgKey=void 0}get(t){const r=JSON.stringify(t);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this.computeFn(t)),this.lastCache}}class cn{constructor(t){this.executor=t,this._didRun=!1}getValue(){if(!this._didRun)try{this._value=this.executor()}catch(t){this._error=t}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var fn;function Ua(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function ja(e){return e.split(/\r\n|\r|\n/)}function Ba(e){for(let t=0,r=e.length;t<r;t++){const n=e.charCodeAt(t);if(n!==32&&n!==9)return t}return-1}function $a(e,t=e.length-1){for(let r=t;r>=0;r--){const n=e.charCodeAt(r);if(n!==32&&n!==9)return r}return-1}function hn(e){return e>=65&&e<=90}function gr(e){return 55296<=e&&e<=56319}function Wa(e){return 56320<=e&&e<=57343}function qa(e,t){return(e-55296<<10)+(t-56320)+65536}function Ha(e,t,r){const n=e.charCodeAt(r);if(gr(n)&&r+1<t){const i=e.charCodeAt(r+1);if(Wa(i))return qa(n,i)}return n}const za=/^[\t\n\r\x20-\x7E]*$/;function Ga(e){return za.test(e)}class ge{constructor(t){this.confusableDictionary=t}static getInstance(t){return ge.cache.get(Array.from(t))}static getLocales(){return ge._locales.getValue()}isAmbiguous(t){return this.confusableDictionary.has(t)}getPrimaryConfusable(t){return this.confusableDictionary.get(t)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}fn=ge,ge.ambiguousCharacterData=new cn(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,204
|
||
|
`||e===" "}var Ge=function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(h){try{c(n.next(h))}catch(f){o(f)}}function u(h){try{c(n.throw(h))}catch(f){o(f)}}function c(h){h.done?s(h.value):i(h.value).then(l,u)}c((n=n.apply(e,t||[])).next())})};class Zs extends Ss{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(t){return this._lines[t-1]}getWordAtPosition(t,r){const n=Sr(t.column,Ls(r),this._lines[t.lineNumber-1],0);return n?new ze(t.lineNumber,n.startColumn,t.lineNumber,n.endColumn):null}words(t){const r=this._lines,n=this._wordenize.bind(this);let i=0,s="",o=0,l=[];return{*[Symbol.iterator](){for(;;)if(o<l.length){const u=s.substring(l[o].start,l[o].end);o+=1,yield u}else if(i<r.length)s=r[i],l=n(s,t),o=0,i+=1;else break}}}getLineWords(t,r){const n=this._lines[t-1],i=this._wordenize(n,r),s=[];for(const o of i)s.push({word:n.substring(o.start,o.end),startColumn:o.start+1,endColumn:o.end+1});return s}_wordenize(t,r){const n=[];let i;for(r.lastIndex=0;(i=r.exec(t))&&i[0].length!==0;)n.push({start:i.index,end:i.index+i[0].length});return n}getValueInRange(t){if(t=this._validateRange(t),t.startLineNumber===t.endLineNumber)return this._lines[t.startLineNumber-1].substring(t.startColumn-1,t.endColumn-1);const r=this._eol,n=t.startLineNumber-1,i=t.endLineNumber-1,s=[];s.push(this._lines[n].substring(t.startColumn-1));for(let o=n+1;o<i;o++)s.push(this._lines[o]);return s.push(this._lines[i].substring(0,t.endColumn-1)),s.join(r)}offsetAt(t){return t=this._validatePosition(t),this._ensureLineStarts(),this._lineStarts.getPrefixSum(t.lineNumber-2)+(t.column-1)}positionAt(t){t=Math.floor(t),t=Math.max(0,t),this._ensureLineStarts();const r=this._lineStarts.getIndexOf(t),n=this._lines[r.index].length;return{lineNumber:1+r.index,column:1+Math.min(r.remainder,n)}}_validateRange(t){const r=this._validatePosition({lineNumber:t.startLineNumber,column:t.startColumn}),n=this._validatePosition({lineNumber:t.endLineNumber,column:t.endColumn});return r.lineNumber!==t.startLineNumber||r.column!==t.startColumn||n.lineNumber!==t.endLineNumber||n.column!==t.endColumn?{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:n.lineNumber,endColumn:n.column}:t}_validatePosition(t){if(!He.isIPosition(t))throw new Error("bad position");let{lineNumber:r,column:n}=t,i=!1;if(r<1)r=1,n=1,i=!0;else if(r>this._lines.length)r=this._lines.length,n=this._lines[r-1].length+1,i=!0;else{const s=this._lines[r-1].length+1;n<1?(n=1,i=!0):n>s&&(n=s,i=!0)}return i?{lineNumber:r,column:n}:t}}class at{constructor(t,r){this._host=t,this._models=Object.create(null),this._foreignModuleFactory=r,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(t){return this._models[t]}_getModels(){const t=[];return Object.keys(this._models).forEach(r=>t.push(this._models[r])),t}acceptNewModel(t){this._models[t.url]=new Zs(br.parse(t.url),t.lines,t.EOL,t.versionId)}acceptModelChanged(t,r){if(!this._models[t])return;this._models[t].onEvents(r)}acceptRemovedModel(t){this._models[t]&&delete this._models[t]}computeUnicodeHighlights(t,r,n){return Ge(this,void 0,void 0,function*(){const i=this._getModel(t);return i?Gs.computeUnicodeHighlights(i,r,n):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(t,r,n,i){return Ge(this,void 0,void 0,function*(){const s=this._getModel(t),o=this._getModel(r);if(!s||!o)return null;const l=s.getLinesContent(),u=o.getLinesContent(),h=new ys(l,u,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:n,shouldMakePrettyDiff:!0,maxComputationTime:i}).computeDiff(),f=h.changes.length>0?!1:this._modelsAreIdentical(s,o);return{quitEarly:h.quitEarly,identical:f,changes:h.changes}})}_modelsAreIdentical(t,r){const n=t.getLineCount(),i=r.getLineCount();if(n!==i)return!1;for(let s=1;s<=n;s++){const o=t.getLineContent(s),l=r.getLi
|
||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
* Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
|
||
|
* Released under the MIT license
|
||
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||
|
*-----------------------------------------------------------------------------*/function Rr(e,t){t===void 0&&(t=!1);var r=e.length,n=0,i="",s=0,o=16,l=0,u=0,c=0,h=0,f=0;function d(v,S){for(var A=0,y=0;A<v||!S;){var C=e.charCodeAt(n);if(C>=48&&C<=57)y=y*16+C-48;else if(C>=65&&C<=70)y=y*16+C-65+10;else if(C>=97&&C<=102)y=y*16+C-97+10;else break;n++,A++}return A<v&&(y=-1),y}function m(v){n=v,i="",s=0,o=16,f=0}function b(){var v=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&st(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&st(e.charCodeAt(n)))for(n++;n<e.length&&st(e.charCodeAt(n));)n++;else return f=3,e.substring(v,n);var S=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&st(e.charCodeAt(n))){for(n++;n<e.length&&st(e.charCodeAt(n));)n++;S=n}else f=3;return e.substring(v,S)}function p(){for(var v="",S=n;;){if(n>=r){v+=e.substring(S,n),f=2;break}var A=e.charCodeAt(n);if(A===34){v+=e.substring(S,n),n++;break}if(A===92){if(v+=e.substring(S,n),n++,n>=r){f=2;break}var y=e.charCodeAt(n++);switch(y){case 34:v+='"';break;case 92:v+="\\";break;case 47:v+="/";break;case 98:v+="\b";break;case 102:v+="\f";break;case 110:v+=`
|
||
|
`;break;case 114:v+="\r";break;case 116:v+=" ";break;case 117:var C=d(4,!0);C>=0?v+=String.fromCharCode(C):f=4;break;default:f=5}S=n;continue}if(A>=0&&A<=31)if(bt(A)){v+=e.substring(S,n),f=2;break}else f=6;n++}return v}function g(){if(i="",f=0,s=n,u=l,h=c,n>=r)return s=r,o=17;var v=e.charCodeAt(n);if(Dr(v)){do n++,i+=String.fromCharCode(v),v=e.charCodeAt(n);while(Dr(v));return o=15}if(bt(v))return n++,i+=String.fromCharCode(v),v===13&&e.charCodeAt(n)===10&&(n++,i+=`
|
||
|
`),l++,c=n,o=14;switch(v){case 123:return n++,o=1;case 125:return n++,o=2;case 91:return n++,o=3;case 93:return n++,o=4;case 58:return n++,o=6;case 44:return n++,o=5;case 34:return n++,i=p(),o=10;case 47:var S=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<r&&!bt(e.charCodeAt(n));)n++;return i=e.substring(S,n),o=12}if(e.charCodeAt(n+1)===42){n+=2;for(var A=r-1,y=!1;n<A;){var C=e.charCodeAt(n);if(C===42&&e.charCodeAt(n+1)===47){n+=2,y=!0;break}n++,bt(C)&&(C===13&&e.charCodeAt(n)===10&&n++,l++,c=n)}return y||(n++,f=1),i=e.substring(S,n),o=13}return i+=String.fromCharCode(v),n++,o=16;case 45:if(i+=String.fromCharCode(v),n++,n===r||!st(e.charCodeAt(n)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=b(),o=11;default:for(;n<r&&N(v);)n++,v=e.charCodeAt(n);if(s!==n){switch(i=e.substring(s,n),i){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return i+=String.fromCharCode(v),n++,o=16}}function N(v){if(Dr(v)||bt(v))return!1;switch(v){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function w(){var v;do v=g();while(v>=12&&v<=15);return v}return{setPosition:m,getPosition:function(){return n},scan:t?w:g,getToken:function(){return o},getTokenValue:function(){return i},getTokenOffset:function(){return s},getTokenLength:function(){return n-s},getTokenStartLine:function(){return u},getTokenStartCharacter:function(){return s-h},getTokenError:function(){return f}}}function Dr(e){return e===32||e===9||e===11||e===12||e===160||e===5760||e>=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function bt(e){return e===10||e===13||e===8232||e===8233}function st(e){return e>=48&&e<=57}function Xs(e,t,r){var n,i,s,o,l;if(t){for(o=t.offset,l=o+t.length,s=o;s>0&&!ki(e,s-1);)s--;for(var u=l;u<e.length&&!ki(e,u);)u++;i=e.substring(s,u),n=Ys(i,r)}else i=e,n=0,s=0,o=0,l=e.length;var c=Qs(r,e),h=!1,f=0,d;r.insertSpaces?d=Or(" ",r.tabSize||4):d=" ";var m=Rr(i,!1),b=!1;function p(){return c+Or(d,n+f)}function g(){var P=m.scan();for(h=!1;P===15||P===14;)h=h||P===14,P=m.scan();return b=P===16||m.getTokenError()!==0,P}var N=[];function w(P,R,B){!b&&(!t||R<l&&B>o)&&e.substring(R,B)!==P&&N.push({offset:R,length:B-R,content:P})}var v=g();if(v!==17){var S=m.getTokenOffset()+s,A=Or(d,n);w(A,s,S)}for(;v!==17;){for(var y=m.getTokenOffset()+m.getTokenLength()+s,C=g(),_="",L=!1;!h&&(C===12||C===13);){var M=m.getTokenOffset()+s;w(" ",y,M),y=m.getTokenOffset()+m.getTokenLength()+s,L=C===12,_=L?p():"",C=g()}if(C===2)v!==1&&(f--,_=p());else if(C===4)v!==3&&(f--,_=p());else{switch(v){case 3:case 1:f++,_=p();break;case 5:case 12:_=p();break;case 13:h?_=p():L||(_=" ");break;case 6:L||(_=" ");break;case 10:if(C===6){L||(_="");break}case 7:case 8:case 9:case 11:case 2:case 4:C===12||C===13?L||(_=" "):C!==5&&C!==17&&(b=!0);break;case 16:b=!0;break}h&&(C===12||C===13)&&(_=p())}C===17&&(_=r.insertFinalNewline?c:"");var E=m.getTokenOffset()+s;w(_,y,E),v=C}return N}function Or(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function Ys(e,t){for(var r=0,n=0,i=t.tabSize||4;r<e.length;){var s=e.charAt(r);if(s===" ")n++;else if(s===" ")n+=i;else break;r++}return Math.floor(n/i)}function Qs(e,t){for(var r=0;r<t.length;r++){var n=t.charAt(r);if(n==="\r")return r+1<t.length&&t.charAt(r+1)===`
|
||
|
`?`\r
|
||
|
`:"\r";if(n===`
|
||
|
`)return`
|
||
|
`}return e&&e.eol||`
|
||
|
`}function ki(e,t){return`\r
|
||
|
`.indexOf(e.charAt(t))!==-1}var Wt;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Wt||(Wt={}));function Ks(e,t,r){t===void 0&&(t=[]),r===void 0&&(r=Wt.DEFAULT);var n=null,i=[],s=[];function o(u){Array.isArray(i)?i.push(u):n!==null&&(i[n]=u)}var l={onObjectBegin:function(){var u={};o(u),s.push(i),i=u,n=null},onObjectProperty:function(u){n=u},onObjectEnd:function(){i=s.pop()},onArrayBegin:function(){var u=[];o(u),s.push(i),i=u,n=null},onArrayEnd:function(){i=s.pop()},onLiteralValue:o,onError:function(u,c,h){t.push({error:u,offset:c,length:h})}};return to(e,l,r),i[0]}function xi(e){if(!e.parent||!e.parent.children)return[];var t=xi(e.parent);if(e.parent.type==="property"){var r=e.parent.children[0].value;t.push(r)}else if(e.parent.type==="array"){var n=e.parent.children.indexOf(e);n!==-1&&t.push(n)}return t}function Ur(e){switch(e.type){case"array":return e.children.map(Ur);case"object":for(var t=Object.create(null),r=0,n=e.children;r<n.length;r++){var i=n[r],s=i.children[1];s&&(t[i.children[0].value]=Ur(s))}return t;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function eo(e,t,r){return r===void 0&&(r=!1),t>=e.offset&&t<e.offset+e.length||r&&t===e.offset+e.length}function Mi(e,t,r){if(r===void 0&&(r=!1),eo(e,t,r)){var n=e.children;if(Array.isArray(n))for(var i=0;i<n.length&&n[i].offset<=t;i++){var s=Mi(n[i],t,r);if(s)return s}return e}}function to(e,t,r){r===void 0&&(r=Wt.DEFAULT);var n=Rr(e,!1);function i(L){return L?function(){return L(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}function s(L){return L?function(M){return L(M,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}var o=i(t.onObjectBegin),l=s(t.onObjectProperty),u=i(t.onObjectEnd),c=i(t.onArrayBegin),h=i(t.onArrayEnd),f=s(t.onLiteralValue),d=s(t.onSeparator),m=i(t.onComment),b=s(t.onError),p=r&&r.disallowComments,g=r&&r.allowTrailingComma;function N(){for(;;){var L=n.scan();switch(n.getTokenError()){case 4:w(14);break;case 5:w(15);break;case 3:w(13);break;case 1:p||w(11);break;case 2:w(12);break;case 6:w(16);break}switch(L){case 12:case 13:p?w(10):m();break;case 16:w(1);break;case 15:case 14:break;default:return L}}}function w(L,M,E){if(M===void 0&&(M=[]),E===void 0&&(E=[]),b(L),M.length+E.length>0)for(var P=n.getToken();P!==17;){if(M.indexOf(P)!==-1){N();break}else if(E.indexOf(P)!==-1)break;P=N()}}function v(L){var M=n.getTokenValue();return L?f(M):l(M),N(),!0}function S(){switch(n.getToken()){case 11:var L=n.getTokenValue(),M=Number(L);isNaN(M)&&(w(2),M=0),f(M);break;case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return N(),!0}function A(){return n.getToken()!==10?(w(3,[],[2,5]),!1):(v(!1),n.getToken()===6?(d(":"),N(),_()||w(4,[],[2,5])):w(5,[],[2,5]),!0)}function y(){o(),N();for(var L=!1;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(L||w(4,[],[]),d(","),N(),n.getToken()===2&&g)break}else L&&w(6,[],[]);A()||w(4,[],[2,5]),L=!0}return u(),n.getToken()!==2?w(7,[2],[]):N(),!0}function C(){c(),N();for(var L=!1;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(L||w(4,[],[]),d(","),N(),n.getToken()===4&&g)break}else L&&w(6,[],[]);_()||w(4,[],[4,5]),L=!0}return h(),n.getToken()!==4?w(8,[4],[]):N(),!0}function _(){switch(n.getToken()){case 3:return C();case 1:return y();case 10:return v(!0);default:return S()}}return N(),n.getToken()===17?r.allowEmptyContent?!0:(w(4,[],[]),!1):_()?(n.getToken()!==17&&w(9,[],[]),!0):(w(4,[],[]),!1)}var ot=Rr,ro=Ks,no=Mi,io=xi,ao=Ur;function so(e,t,r){return Xs(e,t,r)}function wt(e,t){if(e===t)return!0;if(e==null||t===null||t===void 0||typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;var r,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(!wt(e[r],t[r]))return!1}else{var i=[];for(n in e)i.push(n);i.sort();var s=[];for(n in t)s.push(n);if(s.sort(),!wt(i,s))return!1;for(r=0;r<i.length;r++)if(!wt(e[i[r]],t[i[r]]))return!1}return!0}function fe(e){return typ
|
||
|
`,s==="\r"&&i+1<r.length&&r.charAt(i+1)===`
|
||
|
`&&i++}n&&r.length>0&&t.push(r.length),this._lineOffsets=t}return this._lineOffsets},e.prototype.positionAt=function(t){t=Math.max(Math.min(t,this._content.length),0);var r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return Ce.create(0,t);for(;n<i;){var s=Math.floor((n+i)/2);r[s]>t?i=s:n=s+1}var o=n-1;return Ce.create(o,t-r[o])},e.prototype.offsetAt=function(t){var r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;var n=r[t.line],i=t.line+1<r.length?r[t.line+1]:this._content.length;return Math.max(Math.min(n+t.character,i),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}(),k;(function(e){var t=Object.prototype.toString;function r(m){return typeof m!="undefined"}e.defined=r;function n(m){return typeof m=="undefined"}e.undefined=n;function i(m){return m===!0||m===!1}e.boolean=i;function s(m){return t.call(m)==="[object String]"}e.string=s;function o(m){return t.call(m)==="[object Number]"}e.number=o;function l(m,b,p){return t.call(m)==="[object Number]"&&b<=m&&m<=p}e.numberRange=l;function u(m){return t.call(m)==="[object Number]"&&-2147483648<=m&&m<=2147483647}e.integer=u;function c(m){return t.call(m)==="[object Number]"&&0<=m&&m<=2147483647}e.uinteger=c;function h(m){return t.call(m)==="[object Function]"}e.func=h;function f(m){return m!==null&&typeof m=="object"}e.objectLiteral=f;function d(m,b){return Array.isArray(m)&&m.every(b)}e.typedArray=d})(k||(k={}));var Yt=class{constructor(e,t,r,n){this._uri=e,this._languageId=t,this._version=r,this._content=n,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){for(let r of e)if(Yt.isIncremental(r)){const n=oa(r.range),i=this.offsetAt(n.start),s=this.offsetAt(n.end);this._content=this._content.substring(0,i)+r.text+this._content.substring(s,this._content.length);const o=Math.max(n.start.line,0),l=Math.max(n.end.line,0);let u=this._lineOffsets;const c=sa(r.text,!1,i);if(l-o===c.length)for(let f=0,d=c.length;f<d;f++)u[f+o+1]=c[f];else c.length<1e4?u.splice(o+1,l-o,...c):this._lineOffsets=u=u.slice(0,o+1).concat(c,u.slice(l+1));const h=r.text.length-(s-i);if(h!==0)for(let f=o+1+c.length,d=u.length;f<d;f++)u[f]=u[f]+h}else if(Yt.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=sa(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,n=t.length;if(n===0)return{line:0,character:e};for(;r<n;){let s=Math.floor((r+n)/2);t[s]>e?n=s:r=s+1}let i=r-1;return{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,n),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){let t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}},Hr;(function(e){function t(i,s,o,l){return new Yt(i,s,o,l)}e.create=t;function r(i,s,o){if(i instanceof Yt)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=r;function n(i,s){let o=i.getText(),l=zr(s.map(co),(h,f)=>{let d=h.range.start.line-f.range.start.line;return d===0?h.range.start.character-f.range.start.character:d}),u=0;const c=[];for(const h of l){let f=i.offsetAt(h.range.start);if(f<u)throw new Error("Overlapping edit");f>u&&c.push(o.substring(u,f)),h.newText.length&&c.push(h.newText),u=i.offsetAt(h.range.end)}return c.push(o.substr(u)),c.join("")}
|
||
|
`,s=0;s<e.length;s++)i+=n+Xr(e[s],n,r),s<e.length-1&&(i+=","),i+=`
|
||
|
`;return i+=t+"]",i}else{var o=Object.keys(e);if(o.length===0)return"{}";for(var i=`{
|
||
|
`,s=0;s<o.length;s++){var l=o[s];i+=n+JSON.stringify(l)+": "+Xr(e[l],n,r),s<o.length-1&&(i+=","),i+=`
|
||
|
`}return i+=t+"}",i}}return r(e)}var Yr=kt(),So=function(){function e(t,r,n,i){r===void 0&&(r=[]),n===void 0&&(n=Promise),i===void 0&&(i={}),this.schemaService=t,this.contributions=r,this.promiseConstructor=n,this.clientCapabilities=i}return e.prototype.doResolve=function(t){for(var r=this.contributions.length-1;r>=0;r--){var n=this.contributions[r].resolveCompletion;if(n){var i=n(t);if(i)return i}}return this.promiseConstructor.resolve(t)},e.prototype.doComplete=function(t,r,n){var i=this,s={items:[],isIncomplete:!1},o=t.getText(),l=t.offsetAt(r),u=n.getNodeFromOffset(l,!0);if(this.isInComment(t,u?u.offset:0,l))return Promise.resolve(s);if(u&&l===u.offset+u.length&&l>0){var c=o[l-1];(u.type==="object"&&c==="}"||u.type==="array"&&c==="]")&&(u=u.parent)}var h=this.getCurrentWord(t,l),f;if(u&&(u.type==="string"||u.type==="number"||u.type==="boolean"||u.type==="null"))f=q.create(t.positionAt(u.offset),t.positionAt(u.offset+u.length));else{var d=l-h.length;d>0&&o[d-1]==='"'&&d--,f=q.create(t.positionAt(d),r)}var m={},b={add:function(p){var g=p.label,N=m[g];if(N)N.documentation||(N.documentation=p.documentation),N.detail||(N.detail=p.detail);else{if(g=g.replace(/[\n]/g,"↵"),g.length>60){var w=g.substr(0,57).trim()+"...";m[w]||(g=w)}f&&p.insertText!==void 0&&(p.textEdit=_e.replace(f,p.insertText)),p.label=g,m[g]=p,s.items.push(p)}},setAsIncomplete:function(){s.isIncomplete=!0},error:function(p){console.error(p)},log:function(p){console.log(p)},getNumberOfProposals:function(){return s.items.length}};return this.schemaService.getSchemaForResource(t.uri,n).then(function(p){var g=[],N=!0,w="",v=void 0;if(u&&u.type==="string"){var S=u.parent;S&&S.type==="property"&&S.keyNode===u&&(N=!S.valueNode,v=S,w=o.substr(u.offset+1,u.length-2),S&&(u=S.parent))}if(u&&u.type==="object"){if(u.offset===l)return s;var A=u.properties;A.forEach(function(L){(!v||v!==L)&&(m[L.keyNode.value]=qr.create("__"))});var y="";N&&(y=i.evaluateSeparatorAfter(t,t.offsetAt(f.end))),p?i.getPropertyCompletions(p,n,u,N,y,b):i.getSchemaLessPropertyCompletions(n,u,w,b);var C=Zr(u);i.contributions.forEach(function(L){var M=L.collectPropertyCompletions(t.uri,C,h,N,y==="",b);M&&g.push(M)}),!p&&h.length>0&&o.charAt(l-h.length-1)!=='"'&&(b.add({kind:de.Property,label:i.getLabelForValue(h),insertText:i.getInsertTextForProperty(h,void 0,!1,y),insertTextFormat:Y.Snippet,documentation:""}),b.setAsIncomplete())}var _={};return p?i.getValueCompletions(p,n,u,l,t,b,_):i.getSchemaLessValueCompletions(n,u,l,t,b),i.contributions.length>0&&i.getContributedValueCompletions(n,u,l,t,b,g),i.promiseConstructor.all(g).then(function(){if(b.getNumberOfProposals()===0){var L=l;u&&(u.type==="string"||u.type==="number"||u.type==="boolean"||u.type==="null")&&(L=u.offset+u.length);var M=i.evaluateSeparatorAfter(t,L);i.addFillerValueCompletions(_,M,b)}return s})})},e.prototype.getPropertyCompletions=function(t,r,n,i,s,o){var l=this,u=r.getMatchingSchemas(t.schema,n.offset);u.forEach(function(c){if(c.node===n&&!c.inverted){var h=c.schema.properties;h&&Object.keys(h).forEach(function(p){var g=h[p];if(typeof g=="object"&&!g.deprecationMessage&&!g.doNotSuggest){var N={kind:de.Property,label:p,insertText:l.getInsertTextForProperty(p,g,i,s),insertTextFormat:Y.Snippet,filterText:l.getFilterTextForValue(p),documentation:l.fromMarkup(g.markdownDescription)||g.description||""};g.suggestSortText!==void 0&&(N.sortText=g.suggestSortText),N.insertText&&yt(N.insertText,"$1".concat(s))&&(N.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(N)}});var f=c.schema.propertyNames;if(typeof f=="object"&&!f.deprecationMessage&&!f.doNotSuggest){var d=function(p,g){g===void 0&&(g=void 0);var N={kind:de.Property,label:p,insertText:l.getInsertTextForProperty(p,void 0,i,s),insertTextFormat:Y.Snippet,filterText:l.getFilterTextForValue(p),documentation:g||l.fromMarkup(f.markdownDescription)||f.description||""};f.suggestSortText!==void 0&&(N.sortText=f.suggestSortText),N.insertText&&yt(N.insertText,"$1".concat(s))&&(N.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(N)};if(f.enum)for
|
||
|
`,w=w+`
|
||
|
`+v+"]",v+=" ",f="array";b=N+v+h.bodyText.split(`
|
||
|
`).join(`
|
||
|
`+v)+w+r,m=m||b,p=b.replace(/[\n]/g,"")}else return;n.add({kind:s.getSuggestionKind(f),label:m,documentation:s.fromMarkup(h.markdownDescription)||h.description,insertText:b,insertTextFormat:Y.Snippet,filterText:p}),o=!0}),!o&&typeof t.items=="object"&&!Array.isArray(t.items)&&i<5&&this.addDefaultValueCompletions(t.items,r,n,i+1)},e.prototype.addEnumValueCompletions=function(t,r,n){if(Te(t.const)&&n.add({kind:this.getSuggestionKind(t.type),label:this.getLabelForValue(t.const),insertText:this.getInsertTextForValue(t.const,r),insertTextFormat:Y.Snippet,documentation:this.fromMarkup(t.markdownDescription)||t.description}),Array.isArray(t.enum))for(var i=0,s=t.enum.length;i<s;i++){var o=t.enum[i],l=this.fromMarkup(t.markdownDescription)||t.description;t.markdownEnumDescriptions&&i<t.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?l=this.fromMarkup(t.markdownEnumDescriptions[i]):t.enumDescriptions&&i<t.enumDescriptions.length&&(l=t.enumDescriptions[i]),n.add({kind:this.getSuggestionKind(t.type),label:this.getLabelForValue(o),insertText:this.getInsertTextForValue(o,r),insertTextFormat:Y.Snippet,documentation:l})}},e.prototype.collectTypes=function(t,r){if(!(Array.isArray(t.enum)||Te(t.const))){var n=t.type;Array.isArray(n)?n.forEach(function(i){return r[i]=!0}):n&&(r[n]=!0)}},e.prototype.addFillerValueCompletions=function(t,r,n){t.object&&n.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},r),insertTextFormat:Y.Snippet,detail:Yr("defaults.object","New object"),documentation:""}),t.array&&n.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],r),insertTextFormat:Y.Snippet,detail:Yr("defaults.array","New array"),documentation:""})},e.prototype.addBooleanValueCompletion=function(t,r,n){n.add({kind:this.getSuggestionKind("boolean"),label:t?"true":"false",insertText:this.getInsertTextForValue(t,r),insertTextFormat:Y.Snippet,documentation:""})},e.prototype.addNullValueCompletion=function(t,r){r.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+t,insertTextFormat:Y.Snippet,documentation:""})},e.prototype.addDollarSchemaCompletions=function(t,r){var n=this,i=this.schemaService.getRegisteredSchemaIds(function(s){return s==="http"||s==="https"});i.forEach(function(s){return r.add({kind:de.Module,label:n.getLabelForValue(s),filterText:n.getFilterTextForValue(s),insertText:n.getInsertTextForValue(s,t),insertTextFormat:Y.Snippet,documentation:""})})},e.prototype.getLabelForValue=function(t){return JSON.stringify(t)},e.prototype.getFilterTextForValue=function(t){return JSON.stringify(t)},e.prototype.getFilterTextForSnippetValue=function(t){return JSON.stringify(t).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getLabelForSnippetValue=function(t){var r=JSON.stringify(t);return r.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getInsertTextForPlainText=function(t){return t.replace(/[\\\$\}]/g,"\\$&")},e.prototype.getInsertTextForValue=function(t,r){var n=JSON.stringify(t,null," ");return n==="{}"?"{$1}"+r:n==="[]"?"[$1]"+r:this.getInsertTextForPlainText(n+r)},e.prototype.getInsertTextForSnippetValue=function(t,r){var n=function(i){return typeof i=="string"&&i[0]==="^"?i.substr(1):JSON.stringify(i)};return Xr(t,"",n)+r},e.prototype.getInsertTextForGuessedValue=function(t,r){switch(typeof t){case"object":return t===null?"${1:null}"+r:this.getInsertTextForValue(t,r);case"string":var n=JSON.stringify(t);return n=n.substr(1,n.length-2),n=this.getInsertTextForPlainText(n),'"${1:'+n+'}"'+r;case"number":case"boolean":return"${1:"+JSON.stringify(t)+"}"+r}return this.getInsertTextForValue(t,r)},e.prototype.getSuggestionKind=function(t){if(Array.isArray(t)){var r=t;t=r.length>0?r[0]:void 0}if(!t)return de.Value;switch(t){case"string":return de.Value;case"object":return de.Module;case"property":return de.Property;default:return de.Value}},e.prototype.getLabelTextForMatchingNode=function(t,r){switch(t.type){case"array":return"[]";case"object":return"{}";default:var n=r.getText().substr(t.offset,t.length);return
|
||
|
\r\v":{[,]}`.indexOf(i.charAt(n))===-1;)n--;return i.substring(n+1,r)},e.prototype.evaluateSeparatorAfter=function(t,r){var n=ot(t.getText(),!0);n.setPosition(r);var i=n.scan();switch(i){case 5:case 2:case 4:case 17:return"";default:return","}},e.prototype.findItemAtOffset=function(t,r,n){for(var i=ot(r.getText(),!0),s=t.items,o=s.length-1;o>=0;o--){var l=s[o];if(n>l.offset+l.length){i.setPosition(l.offset+l.length);var u=i.scan();return u===5&&n>=i.getTokenOffset()+i.getTokenLength()?o+1:o}else if(n>=l.offset)return o}return 0},e.prototype.isInComment=function(t,r,n){var i=ot(t.getText(),!1);i.setPosition(r);for(var s=i.scan();s!==17&&i.getTokenOffset()+i.getTokenLength()<n;)s=i.scan();return(s===12||s===13)&&i.getTokenOffset()<=n},e.prototype.fromMarkup=function(t){if(t&&this.doesSupportMarkdown())return{kind:Fe.Markdown,value:t}},e.prototype.doesSupportMarkdown=function(){if(!Te(this.supportsMarkdown)){var t=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=t&&t.completionItem&&Array.isArray(t.completionItem.documentationFormat)&&t.completionItem.documentationFormat.indexOf(Fe.Markdown)!==-1}return this.supportsMarkdown},e.prototype.doesSupportsCommitCharacters=function(){if(!Te(this.supportsCommitCharacters)){var t=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsCommitCharacters=t&&t.completionItem&&!!t.completionItem.commitCharactersSupport}return this.supportsCommitCharacters},e}(),Ao=function(){function e(t,r,n){r===void 0&&(r=[]),this.schemaService=t,this.contributions=r,this.promise=n||Promise}return e.prototype.doHover=function(t,r,n){var i=t.offsetAt(r),s=n.getNodeFromOffset(i);if(!s||(s.type==="object"||s.type==="array")&&i>s.offset+1&&i<s.offset+s.length-1)return this.promise.resolve(null);var o=s;if(s.type==="string"){var l=s.parent;if(l&&l.type==="property"&&l.keyNode===s&&(s=l.valueNode,!s))return this.promise.resolve(null)}for(var u=q.create(t.positionAt(o.offset),t.positionAt(o.offset+o.length)),c=function(b){var p={contents:b,range:u};return p},h=Zr(s),f=this.contributions.length-1;f>=0;f--){var d=this.contributions[f],m=d.getInfoContribution(t.uri,h);if(m)return m.then(function(b){return c(b)})}return this.schemaService.getSchemaForResource(t.uri,n).then(function(b){if(b&&s){var p=n.getMatchingSchemas(b.schema,s.offset),g=void 0,N=void 0,w=void 0,v=void 0;p.every(function(A){if(A.node===s&&!A.inverted&&A.schema&&(g=g||A.schema.title,N=N||A.schema.markdownDescription||Qr(A.schema.description),A.schema.enum)){var y=A.schema.enum.indexOf(Xe(s));A.schema.markdownEnumDescriptions?w=A.schema.markdownEnumDescriptions[y]:A.schema.enumDescriptions&&(w=Qr(A.schema.enumDescriptions[y])),w&&(v=A.schema.enum[y],typeof v!="string"&&(v=JSON.stringify(v)))}return!0});var S="";return g&&(S=Qr(g)),N&&(S.length>0&&(S+=`
|
||
|
|
||
|
`),S+=N),w&&(S.length>0&&(S+=`
|
||
|
|
||
|
`),S+="`".concat(No(v),"`: ").concat(w)),c([S])}return null})},e}();function Qr(e){if(e){var t=e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
|
||
|
|
||
|
$3`);return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function No(e){return e.indexOf("`")!==-1?"`` "+e+" ``":e}var Lo=kt(),ko=function(){function e(t,r){this.jsonSchemaService=t,this.promise=r,this.validationEnabled=!0}return e.prototype.configure=function(t){t&&(this.validationEnabled=t.validate!==!1,this.commentSeverity=t.allowComments?void 0:he.Error)},e.prototype.doValidation=function(t,r,n,i){var s=this;if(!this.validationEnabled)return this.promise.resolve([]);var o=[],l={},u=function(d){var m=d.range.start.line+" "+d.range.start.character+" "+d.message;l[m]||(l[m]=!0,o.push(d))},c=function(d){var m=n!=null&&n.trailingCommas?Qt(n.trailingCommas):he.Error,b=n!=null&&n.comments?Qt(n.comments):s.commentSeverity,p=n!=null&&n.schemaValidation?Qt(n.schemaValidation):he.Warning,g=n!=null&&n.schemaRequest?Qt(n.schemaRequest):he.Warning;if(d){if(d.errors.length&&r.root&&g){var N=r.root,w=N.type==="object"?N.properties[0]:void 0;if(w&&w.keyNode.value==="$schema"){var v=w.valueNode||w,S=q.create(t.positionAt(v.offset),t.positionAt(v.offset+v.length));u(Ee.create(S,d.errors[0],g,$.SchemaResolveError))}else{var S=q.create(t.positionAt(N.offset),t.positionAt(N.offset+1));u(Ee.create(S,d.errors[0],g,$.SchemaResolveError))}}else if(p){var A=r.validate(t,d.schema,p);A&&A.forEach(u)}da(d.schema)&&(b=void 0),ma(d.schema)&&(m=void 0)}for(var y=0,C=r.syntaxErrors;y<C.length;y++){var _=C[y];if(_.code===$.TrailingComma){if(typeof m!="number")continue;_.severity=m}u(_)}if(typeof b=="number"){var L=Lo("InvalidCommentToken","Comments are not permitted in JSON.");r.comments.forEach(function(M){u(Ee.create(M,L,b,$.CommentNotPermitted))})}return o};if(i){var h=i.id||"schemaservice://untitled/"+xo++,f=this.jsonSchemaService.registerExternalSchema(h,[],i);return f.getResolvedSchema().then(function(d){return c(d)})}return this.jsonSchemaService.getSchemaForResource(t.uri,r).then(function(d){return c(d)})},e.prototype.getLanguageStatus=function(t,r){return{schemas:this.jsonSchemaService.getSchemaURIsForResource(t.uri,r)}},e}(),xo=0;function da(e){if(e&&typeof e=="object"){if(Ae(e.allowComments))return e.allowComments;if(e.allOf)for(var t=0,r=e.allOf;t<r.length;t++){var n=r[t],i=da(n);if(Ae(i))return i}}}function ma(e){if(e&&typeof e=="object"){if(Ae(e.allowTrailingCommas))return e.allowTrailingCommas;var t=e;if(Ae(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(e.allOf)for(var r=0,n=e.allOf;r<n.length;r++){var i=n[r],s=ma(i);if(Ae(s))return s}}}function Qt(e){switch(e){case"error":return he.Error;case"warning":return he.Warning;case"ignore":return}}var ga=48,Mo=57,Po=65,Kt=97,To=102;function Z(e){return e<ga?0:e<=Mo?e-ga:(e<Kt&&(e+=Kt-Po),e>=Kt&&e<=To?e-Kt+10:0)}function Eo(e){if(e[0]==="#")switch(e.length){case 4:return{red:Z(e.charCodeAt(1))*17/255,green:Z(e.charCodeAt(2))*17/255,blue:Z(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Z(e.charCodeAt(1))*17/255,green:Z(e.charCodeAt(2))*17/255,blue:Z(e.charCodeAt(3))*17/255,alpha:Z(e.charCodeAt(4))*17/255};case 7:return{red:(Z(e.charCodeAt(1))*16+Z(e.charCodeAt(2)))/255,green:(Z(e.charCodeAt(3))*16+Z(e.charCodeAt(4)))/255,blue:(Z(e.charCodeAt(5))*16+Z(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Z(e.charCodeAt(1))*16+Z(e.charCodeAt(2)))/255,green:(Z(e.charCodeAt(3))*16+Z(e.charCodeAt(4)))/255,blue:(Z(e.charCodeAt(5))*16+Z(e.charCodeAt(6)))/255,alpha:(Z(e.charCodeAt(7))*16+Z(e.charCodeAt(8)))/255}}}var Fo=function(){function e(t){this.schemaService=t}return e.prototype.findDocumentSymbols=function(t,r,n){var i=this;n===void 0&&(n={resultLimit:Number.MAX_VALUE});var s=r.root;if(!s)return[];var o=n.resultLimit||Number.MAX_VALUE,l=t.uri;if((l==="vscode://defaultsettings/keybindings.json"||yt(l.toLowerCase(),"/user/keybindings.json"))&&s.type==="array"){for(var u=[],c=0,h=s.items;c<h.length;c++){var f=h[c];if(f.type==="object")for(var d=0,m=f.properties;d<m.length;d++){var b=m[d];if(b.keyNode.value==="key"&&b.valueNode){var p=Ct.create(t.uri,$e(t,f));if(u.push({name:Xe(b.valueNode),kind:Ne.Function,location:p}),o--,o<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(l),u}
|
||
|
`};return so(l.getText(),h,m).map(function(b){return _e.replace(q.create(l.positionAt(b.offset),l.positionAt(b.offset+b.length)),b.content)})}}}var wa;typeof fetch!="undefined"&&(wa=function(e){return fetch(e).then(t=>t.text())});var Yo=class{constructor(e,t){Mt(this,"_ctx");Mt(this,"_languageService");Mt(this,"_languageSettings");Mt(this,"_languageId");this._ctx=e,this._languageSettings=t.languageSettings,this._languageId=t.languageId,this._languageService=Xo({workspaceContext:{resolveRelativePath:(r,n)=>{const i=n.substr(0,n.lastIndexOf("/")+1);return el(i,r)}},schemaRequestService:t.enableSchemaRequest?wa:void 0}),this._languageService.configure(this._languageSettings)}doValidation(e){return ve(this,null,function*(){let t=this._getTextDocument(e);if(t){let r=this._languageService.parseJSONDocument(t);return this._languageService.doValidation(t,r,this._languageSettings)}return Promise.resolve([])})}doComplete(e,t){return ve(this,null,function*(){let r=this._getTextDocument(e);if(!r)return null;let n=this._languageService.parseJSONDocument(r);return this._languageService.doComplete(r,t,n)})}doResolve(e){return ve(this,null,function*(){return this._languageService.doResolve(e)})}doHover(e,t){return ve(this,null,function*(){let r=this._getTextDocument(e);if(!r)return null;let n=this._languageService.parseJSONDocument(r);return this._languageService.doHover(r,t,n)})}format(e,t,r){return ve(this,null,function*(){let n=this._getTextDocument(e);if(!n)return[];let i=this._languageService.format(n,t,r);return Promise.resolve(i)})}resetSchema(e){return ve(this,null,function*(){return Promise.resolve(this._languageService.resetSchema(e))})}findDocumentSymbols(e){return ve(this,null,function*(){let t=this._getTextDocument(e);if(!t)return[];let r=this._languageService.parseJSONDocument(t),n=this._languageService.findDocumentSymbols(t,r);return Promise.resolve(n)})}findDocumentColors(e){return ve(this,null,function*(){let t=this._getTextDocument(e);if(!t)return[];let r=this._languageService.parseJSONDocument(t),n=this._languageService.findDocumentColors(t,r);return Promise.resolve(n)})}getColorPresentations(e,t,r){return ve(this,null,function*(){let n=this._getTextDocument(e);if(!n)return[];let i=this._languageService.parseJSONDocument(n),s=this._languageService.getColorPresentations(n,i,t,r);return Promise.resolve(s)})}getFoldingRanges(e,t){return ve(this,null,function*(){let r=this._getTextDocument(e);if(!r)return[];let n=this._languageService.getFoldingRanges(r,t);return Promise.resolve(n)})}getSelectionRanges(e,t){return ve(this,null,function*(){let r=this._getTextDocument(e);if(!r)return[];let n=this._languageService.parseJSONDocument(r),i=this._languageService.getSelectionRanges(r,t,n);return Promise.resolve(i)})}_getTextDocument(e){let t=this._ctx.getMirrorModels();for(let r of t)if(r.uri.toString()===e)return Hr.create(e,this._languageId,r.version,r.getValue());return null}},Qo="/".charCodeAt(0),rn=".".charCodeAt(0);function Ko(e){return e.charCodeAt(0)===Qo}function el(e,t){if(Ko(t)){const r=ct.parse(e),n=t.split("/");return r.with({path:ya(n)}).toString()}return tl(e,t)}function ya(e){const t=[];for(const n of e)n.length===0||n.length===1&&n.charCodeAt(0)===rn||(n.length===2&&n.charCodeAt(0)===rn&&n.charCodeAt(1)===rn?t.pop():t.push(n));e.length>1&&e[e.length-1].length===0&&t.push("");let r=t.join("/");return e[0].length===0&&(r="/"+r),r}function tl(e,...t){const r=ct.parse(e),n=r.path.split("/");for(let i of t)n.push(...i.split("/"));return r.with({path:ya(n)}).toString()}self.onmessage=()=>{Li((e,t)=>new Yo(e,t))}})();
|