/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.31.1(337587859b1c171314b40503171188b6cea6a32a) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-----------------------------------------------------------------------------*/ define("vs/language/json/jsonWorker",[],()=>{ var moduleExports=(()=>{var _t=Object.defineProperty;var Br=t=>_t(t,"__esModule",{value:!0});var _r=(t,r)=>{Br(t);for(var i in r)_t(t,i,{get:r[i],enumerable:!0})};var Vn={};_r(Vn,{JSONWorker:()=>$t,create:()=>Mn});"use strict";function Ce(t,r){r===void 0&&(r=!1);var i=t.length,e=0,n="",a=0,o=16,s=0,f=0,c=0,u=0,l=0;function h(v,N){for(var P=0,M=0;P=48&&T<=57)M=M*16+T-48;else if(T>=65&&T<=70)M=M*16+T-65+10;else if(T>=97&&T<=102)M=M*16+T-97+10;else break;e++,P++}return P=i){v+=t.substring(N,e),l=2;break}var P=t.charCodeAt(e);if(P===34){v+=t.substring(N,e),e++;break}if(P===92){if(v+=t.substring(N,e),e++,e>=i){l=2;break}var M=t.charCodeAt(e++);switch(M){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 T=h(4,!0);T>=0?v+=String.fromCharCode(T):l=4;break;default:l=5}N=e;continue}if(P>=0&&P<=31)if(Me(P)){v+=t.substring(N,e),l=2;break}else l=6;e++}return v}function d(){if(n="",l=0,a=e,f=s,u=c,e>=i)return a=i,o=17;var v=t.charCodeAt(e);if(st(v)){do e++,n+=String.fromCharCode(v),v=t.charCodeAt(e);while(st(v));return o=15}if(Me(v))return e++,n+=String.fromCharCode(v),v===13&&t.charCodeAt(e)===10&&(e++,n+=` `),s++,c=e,o=14;switch(v){case 123:return e++,o=1;case 125:return e++,o=2;case 91:return e++,o=3;case 93:return e++,o=4;case 58:return e++,o=6;case 44:return e++,o=5;case 34:return e++,n=m(),o=10;case 47:var N=e-1;if(t.charCodeAt(e+1)===47){for(e+=2;e=12&&v<=15);return v}return{setPosition:g,getPosition:function(){return e},scan:r?x:d,getToken:function(){return o},getTokenValue:function(){return n},getTokenOffset:function(){return a},getTokenLength:function(){return e-a},getTokenStartLine:function(){return f},getTokenStartCharacter:function(){return a-u},getTokenError:function(){return l}}}function st(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function Me(t){return t===10||t===13||t===8232||t===8233}function Oe(t){return t>=48&&t<=57}"use strict";function ft(t,r,i){var e,n,a,o,s;if(r){for(o=r.offset,s=o+r.length,a=o;a>0&&!lt(t,a-1);)a--;for(var f=s;fo)&&t.substring(V,$)!==j&&A.push({offset:V,length:$-V,content:j})}var v=d();if(v!==17){var N=g.getTokenOffset()+a,P=ut(h,e);x(P,a,N)}for(;v!==17;){for(var M=g.getTokenOffset()+g.getTokenLength()+a,T=d(),O="",y=!1;!u&&(T===12||T===13);){var k=g.getTokenOffset()+a;x(" ",M,k),M=g.getTokenOffset()+g.getTokenLength()+a,y=T===12,O=y?m():"",T=d()}if(T===2)v!==1&&(l--,O=m());else if(T===4)v!==3&&(l--,O=m());else{switch(v){case 3:case 1:l++,O=m();break;case 5:case 12:O=m();break;case 13:u?O=m():y||(O=" ");break;case 6:y||(O=" ");break;case 10:if(T===6){y||(O="");break}case 7:case 8:case 9:case 11:case 2:case 4:T===12||T===13?y||(O=" "):T!==5&&T!==17&&(p=!0);break;case 16:p=!0;break}u&&(T===12||T===13)&&(O=m())}T===17&&(O=i.insertFinalNewline?c:"");var E=g.getTokenOffset()+a;x(O,M,E),v=T}return A}function ut(t,r){for(var i="",e=0;e=t.offset&&r0)for(var j=e.getToken();j!==17;){if(k.indexOf(j)!==-1){A();break}else if(E.indexOf(j)!==-1)break;j=A()}}function v(y){var k=e.getTokenValue();return y?l(k):s(k),A(),!0}function N(){switch(e.getToken()){case 11:var y=e.getTokenValue(),k=Number(y);isNaN(k)&&(x(2),k=0),l(k);break;case 7:l(null);break;case 8:l(!0);break;case 9:l(!1);break;default:return!1}return A(),!0}function P(){return e.getToken()!==10?(x(3,[],[2,5]),!1):(v(!1),e.getToken()===6?(h(":"),A(),O()||x(4,[],[2,5])):x(5,[],[2,5]),!0)}function M(){o(),A();for(var y=!1;e.getToken()!==2&&e.getToken()!==17;){if(e.getToken()===5){if(y||x(4,[],[]),h(","),A(),e.getToken()===2&&d)break}else y&&x(6,[],[]);P()||x(4,[],[2,5]),y=!0}return f(),e.getToken()!==2?x(7,[2],[]):A(),!0}function T(){c(),A();for(var y=!1;e.getToken()!==4&&e.getToken()!==17;){if(e.getToken()===5){if(y||x(4,[],[]),h(","),A(),e.getToken()===4&&d)break}else y&&x(6,[],[]);O()||x(4,[],[4,5]),y=!0}return u(),e.getToken()!==4?x(8,[4],[]):A(),!0}function O(){switch(e.getToken()){case 3:return T();case 1:return M();case 10:return v(!0);default:return N()}}return A(),e.getToken()===17?i.allowEmptyContent?!0:(x(4,[],[]),!1):O()?(e.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}"use strict";"use strict";var le=Ce;var Gt=zt;var Xt=ht,Zt=ct,Qt=qe;function Yt(t,r,i){return ft(t,r,i)}function je(t,r){if(t===r)return!0;if(t==null||r===null||r===void 0||typeof t!=typeof r||typeof t!="object"||Array.isArray(t)!==Array.isArray(r))return!1;var i,e;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i0?t.lastIndexOf(r)===i:i===0?t===r:!1}function Se(t){var r="";gt(t,"(?i)")&&(t=t.substring(4),r="i");try{return new RegExp(t,r+"u")}catch{try{return new RegExp(t,r)}catch{return}}}"use strict";var er;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(er||(er={}));var Be;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(Be||(Be={}));var ne;(function(t){function r(e,n){return e===Number.MAX_VALUE&&(e=Be.MAX_VALUE),n===Number.MAX_VALUE&&(n=Be.MAX_VALUE),{line:e,character:n}}t.create=r;function i(e){var n=e;return b.objectLiteral(n)&&b.uinteger(n.line)&&b.uinteger(n.character)}t.is=i})(ne||(ne={}));var U;(function(t){function r(e,n,a,o){if(b.uinteger(e)&&b.uinteger(n)&&b.uinteger(a)&&b.uinteger(o))return{start:ne.create(e,n),end:ne.create(a,o)};if(ne.is(e)&&ne.is(n))return{start:e,end:n};throw new Error("Range#create called with invalid arguments["+e+", "+n+", "+a+", "+o+"]")}t.create=r;function i(e){var n=e;return b.objectLiteral(n)&&ne.is(n.start)&&ne.is(n.end)}t.is=i})(U||(U={}));var Ae;(function(t){function r(e,n){return{uri:e,range:n}}t.create=r;function i(e){var n=e;return b.defined(n)&&U.is(n.range)&&(b.string(n.uri)||b.undefined(n.uri))}t.is=i})(Ae||(Ae={}));var tr;(function(t){function r(e,n,a,o){return{targetUri:e,targetRange:n,targetSelectionRange:a,originSelectionRange:o}}t.create=r;function i(e){var n=e;return b.defined(n)&&U.is(n.targetRange)&&b.string(n.targetUri)&&(U.is(n.targetSelectionRange)||b.undefined(n.targetSelectionRange))&&(U.is(n.originSelectionRange)||b.undefined(n.originSelectionRange))}t.is=i})(tr||(tr={}));var _e;(function(t){function r(e,n,a,o){return{red:e,green:n,blue:a,alpha:o}}t.create=r;function i(e){var n=e;return b.numberRange(n.red,0,1)&&b.numberRange(n.green,0,1)&&b.numberRange(n.blue,0,1)&&b.numberRange(n.alpha,0,1)}t.is=i})(_e||(_e={}));var pt;(function(t){function r(e,n){return{range:e,color:n}}t.create=r;function i(e){var n=e;return U.is(n.range)&&_e.is(n.color)}t.is=i})(pt||(pt={}));var dt;(function(t){function r(e,n,a){return{label:e,textEdit:n,additionalTextEdits:a}}t.create=r;function i(e){var n=e;return b.string(n.label)&&(b.undefined(n.textEdit)||Y.is(n))&&(b.undefined(n.additionalTextEdits)||b.typedArray(n.additionalTextEdits,Y.is))}t.is=i})(dt||(dt={}));var Te;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Te||(Te={}));var mt;(function(t){function r(e,n,a,o,s){var f={startLine:e,endLine:n};return b.defined(a)&&(f.startCharacter=a),b.defined(o)&&(f.endCharacter=o),b.defined(s)&&(f.kind=s),f}t.create=r;function i(e){var n=e;return b.uinteger(n.startLine)&&b.uinteger(n.startLine)&&(b.undefined(n.startCharacter)||b.uinteger(n.startCharacter))&&(b.undefined(n.endCharacter)||b.uinteger(n.endCharacter))&&(b.undefined(n.kind)||b.string(n.kind))}t.is=i})(mt||(mt={}));var vt;(function(t){function r(e,n){return{location:e,message:n}}t.create=r;function i(e){var n=e;return b.defined(n)&&Ae.is(n.location)&&b.string(n.message)}t.is=i})(vt||(vt={}));var X;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(X||(X={}));var rr;(function(t){t.Unnecessary=1,t.Deprecated=2})(rr||(rr={}));var nr;(function(t){function r(i){var e=i;return e!=null&&b.string(e.href)}t.is=r})(nr||(nr={}));var ae;(function(t){function r(e,n,a,o,s,f){var c={range:e,message:n};return b.defined(a)&&(c.severity=a),b.defined(o)&&(c.code=o),b.defined(s)&&(c.source=s),b.defined(f)&&(c.relatedInformation=f),c}t.create=r;function i(e){var n,a=e;return b.defined(a)&&U.is(a.range)&&b.string(a.message)&&(b.number(a.severity)||b.undefined(a.severity))&&(b.integer(a.code)||b.string(a.code)||b.undefined(a.code))&&(b.undefined(a.codeDescription)||b.string((n=a.codeDescription)===null||n===void 0?void 0:n.href))&&(b.string(a.source)||b.undefined(a.source))&&(b.undefined(a.relatedInformation)||b.typedArray(a.relatedInformation,vt.is))}t.is=i})(ae||(ae={}));var Pe;(function(t){function r(e,n){for(var a=[],o=2;o0&&(s.arguments=a),s}t.create=r;function i(e){var n=e;return b.defined(n)&&b.string(n.title)&&b.string(n.command)}t.is=i})(Pe||(Pe={}));var Y;(function(t){function r(a,o){return{range:a,newText:o}}t.replace=r;function i(a,o){return{range:{start:a,end:a},newText:o}}t.insert=i;function e(a){return{range:a,newText:""}}t.del=e;function n(a){var o=a;return b.objectLiteral(o)&&b.string(o.newText)&&U.is(o.range)}t.is=n})(Y||(Y={}));var Ee;(function(t){function r(e,n,a){var o={label:e};return n!==void 0&&(o.needsConfirmation=n),a!==void 0&&(o.description=a),o}t.create=r;function i(e){var n=e;return n!==void 0&&b.objectLiteral(n)&&b.string(n.label)&&(b.boolean(n.needsConfirmation)||n.needsConfirmation===void 0)&&(b.string(n.description)||n.description===void 0)}t.is=i})(Ee||(Ee={}));var Z;(function(t){function r(i){var e=i;return typeof e=="string"}t.is=r})(Z||(Z={}));var pe;(function(t){function r(a,o,s){return{range:a,newText:o,annotationId:s}}t.replace=r;function i(a,o,s){return{range:{start:a,end:a},newText:o,annotationId:s}}t.insert=i;function e(a,o){return{range:a,newText:"",annotationId:o}}t.del=e;function n(a){var o=a;return Y.is(o)&&(Ee.is(o.annotationId)||Z.is(o.annotationId))}t.is=n})(pe||(pe={}));var Ve;(function(t){function r(e,n){return{textDocument:e,edits:n}}t.create=r;function i(e){var n=e;return b.defined(n)&&Ge.is(n.textDocument)&&Array.isArray(n.edits)}t.is=i})(Ve||(Ve={}));var Fe;(function(t){function r(e,n,a){var o={kind:"create",uri:e};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(o.options=n),a!==void 0&&(o.annotationId=a),o}t.create=r;function i(e){var n=e;return n&&n.kind==="create"&&b.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||b.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||b.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||Z.is(n.annotationId))}t.is=i})(Fe||(Fe={}));var Le;(function(t){function r(e,n,a,o){var s={kind:"rename",oldUri:e,newUri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(s.options=a),o!==void 0&&(s.annotationId=o),s}t.create=r;function i(e){var n=e;return n&&n.kind==="rename"&&b.string(n.oldUri)&&b.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||b.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||b.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||Z.is(n.annotationId))}t.is=i})(Le||(Le={}));var De;(function(t){function r(e,n,a){var o={kind:"delete",uri:e};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(o.options=n),a!==void 0&&(o.annotationId=a),o}t.create=r;function i(e){var n=e;return n&&n.kind==="delete"&&b.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||b.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||b.boolean(n.options.ignoreIfNotExists)))&&(n.annotationId===void 0||Z.is(n.annotationId))}t.is=i})(De||(De={}));var ze;(function(t){function r(i){var e=i;return e&&(e.changes!==void 0||e.documentChanges!==void 0)&&(e.documentChanges===void 0||e.documentChanges.every(function(n){return b.string(n.kind)?Fe.is(n)||Le.is(n)||De.is(n):Ve.is(n)}))}t.is=r})(ze||(ze={}));var He=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,e){var n,a;if(e===void 0?n=Y.insert(r,i):Z.is(e)?(a=e,n=pe.insert(r,i,e)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(e),n=pe.insert(r,i,a)),this.edits.push(n),a!==void 0)return a},t.prototype.replace=function(r,i,e){var n,a;if(e===void 0?n=Y.replace(r,i):Z.is(e)?(a=e,n=pe.replace(r,i,e)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(e),n=pe.replace(r,i,a)),this.edits.push(n),a!==void 0)return a},t.prototype.delete=function(r,i){var e,n;if(i===void 0?e=Y.del(r):Z.is(i)?(n=i,e=pe.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(i),e=pe.del(r,n)),this.edits.push(e),n!==void 0)return n},t.prototype.add=function(r){this.edits.push(r)},t.prototype.all=function(){return this.edits},t.prototype.clear=function(){this.edits.splice(0,this.edits.length)},t.prototype.assertChangeAnnotations=function(r){if(r===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},t}(),ir=function(){function t(r){this._annotations=r===void 0?Object.create(null):r,this._counter=0,this._size=0}return t.prototype.all=function(){return this._annotations},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.manage=function(r,i){var e;if(Z.is(r)?e=r:(e=this.nextId(),i=r),this._annotations[e]!==void 0)throw new Error("Id "+e+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+e);return this._annotations[e]=i,this._size++,e},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),ti=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new ir(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(e){if(Ve.is(e)){var n=new He(e.edits,i._changeAnnotations);i._textEditChanges[e.textDocument.uri]=n}})):r.changes&&Object.keys(r.changes).forEach(function(e){var n=new He(r.changes[e]);i._textEditChanges[e]=n})):this._workspaceEdit={}}return Object.defineProperty(t.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),t.prototype.getTextEditChange=function(r){if(Ge.is(r)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:r.uri,version:r.version},e=this._textEditChanges[i.uri];if(!e){var n=[],a={textDocument:i,edits:n};this._workspaceEdit.documentChanges.push(a),e=new He(n,this._changeAnnotations),this._textEditChanges[i.uri]=e}return e}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var e=this._textEditChanges[r];if(!e){var n=[];this._workspaceEdit.changes[r]=n,e=new He(n),this._textEditChanges[r]=e}return e}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new ir,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},t.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},t.prototype.createFile=function(r,i,e){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;Ee.is(i)||Z.is(i)?n=i:e=i;var a,o;if(n===void 0?a=Fe.create(r,e):(o=Z.is(n)?n:this._changeAnnotations.manage(n),a=Fe.create(r,e,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o},t.prototype.renameFile=function(r,i,e,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;Ee.is(e)||Z.is(e)?a=e:n=e;var o,s;if(a===void 0?o=Le.create(r,i,n):(s=Z.is(a)?a:this._changeAnnotations.manage(a),o=Le.create(r,i,n,s)),this._workspaceEdit.documentChanges.push(o),s!==void 0)return s},t.prototype.deleteFile=function(r,i,e){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;Ee.is(i)||Z.is(i)?n=i:e=i;var a,o;if(n===void 0?a=De.create(r,e):(o=Z.is(n)?n:this._changeAnnotations.manage(n),a=De.create(r,e,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o},t}();var ar;(function(t){function r(e){return{uri:e}}t.create=r;function i(e){var n=e;return b.defined(n)&&b.string(n.uri)}t.is=i})(ar||(ar={}));var yt;(function(t){function r(e,n){return{uri:e,version:n}}t.create=r;function i(e){var n=e;return b.defined(n)&&b.string(n.uri)&&b.integer(n.version)}t.is=i})(yt||(yt={}));var Ge;(function(t){function r(e,n){return{uri:e,version:n}}t.create=r;function i(e){var n=e;return b.defined(n)&&b.string(n.uri)&&(n.version===null||b.integer(n.version))}t.is=i})(Ge||(Ge={}));var or;(function(t){function r(e,n,a,o){return{uri:e,languageId:n,version:a,text:o}}t.create=r;function i(e){var n=e;return b.defined(n)&&b.string(n.uri)&&b.string(n.languageId)&&b.integer(n.version)&&b.string(n.text)}t.is=i})(or||(or={}));var fe;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(fe||(fe={}));(function(t){function r(i){var e=i;return e===t.PlainText||e===t.Markdown}t.is=r})(fe||(fe={}));var Xe;(function(t){function r(i){var e=i;return b.objectLiteral(i)&&fe.is(e.kind)&&b.string(e.value)}t.is=r})(Xe||(Xe={}));var Q;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Q||(Q={}));var _;(function(t){t.PlainText=1,t.Snippet=2})(_||(_={}));var bt;(function(t){t.Deprecated=1})(bt||(bt={}));var sr;(function(t){function r(e,n,a){return{newText:e,insert:n,replace:a}}t.create=r;function i(e){var n=e;return n&&b.string(n.newText)&&U.is(n.insert)&&U.is(n.replace)}t.is=i})(sr||(sr={}));var fr;(function(t){t.asIs=1,t.adjustIndentation=2})(fr||(fr={}));var $e;(function(t){function r(i){return{label:i}}t.create=r})($e||($e={}));var xt;(function(t){function r(i,e){return{items:i||[],isIncomplete:!!e}}t.create=r})(xt||(xt={}));var Re;(function(t){function r(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(e){var n=e;return b.string(n)||b.objectLiteral(n)&&b.string(n.language)&&b.string(n.value)}t.is=i})(Re||(Re={}));var St;(function(t){function r(i){var e=i;return!!e&&b.objectLiteral(e)&&(Xe.is(e.contents)||Re.is(e.contents)||b.typedArray(e.contents,Re.is))&&(i.range===void 0||U.is(i.range))}t.is=r})(St||(St={}));var ur;(function(t){function r(i,e){return e?{label:i,documentation:e}:{label:i}}t.create=r})(ur||(ur={}));var lr;(function(t){function r(i,e){for(var n=[],a=2;a=0;u--){var l=f[u],h=a.offsetAt(l.range.start),g=a.offsetAt(l.range.end);if(g<=c)s=s.substring(0,h)+l.newText+s.substring(g,s.length);else throw new Error("Overlapping edit");c=h}return s}t.applyEdits=e;function n(a,o){if(a.length<=1)return a;var s=a.length/2|0,f=a.slice(0,s),c=a.slice(s);n(f,o),n(c,o);for(var u=0,l=0,h=0;u0&&r.push(i.length),this._lineOffsets=r}return this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),e=0,n=i.length;if(n===0)return ne.create(0,r);for(;er?n=a:e=a+1}var o=e-1;return ne.create(o,r-i[o])},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var e=i[r.line],n=r.line+1r?n=a:e=a+1}var o=e-1;return{line:o,character:r-i[o]}},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var e=i[r.line],n=r.line+1f&&c.push(o.substring(f,g)),h.newText.length&&c.push(h.newText),f=n.offsetAt(h.range.end)}return c.push(o.substr(f)),c.join("")}t.applyEdits=e})(Ue||(Ue={}));function Et(t,r){if(t.length<=1)return t;var i=t.length/2|0,e=t.slice(0,i),n=t.slice(i);Et(e,r),Et(n,r);for(var a=0,o=0,s=0;ai.line||r.line===i.line&&r.character>i.character?{start:i,end:r}:t}function Kr(t){var r=vr(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var J;(function(t){t[t.Undefined=0]="Undefined",t[t.EnumValueMismatch=1]="EnumValueMismatch",t[t.Deprecated=2]="Deprecated",t[t.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=258]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",t[t.InvalidUnicode=260]="InvalidUnicode",t[t.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",t[t.InvalidCharacter=262]="InvalidCharacter",t[t.PropertyExpected=513]="PropertyExpected",t[t.CommaExpected=514]="CommaExpected",t[t.ColonExpected=515]="ColonExpected",t[t.ValueExpected=516]="ValueExpected",t[t.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",t[t.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",t[t.TrailingComma=519]="TrailingComma",t[t.DuplicateKey=520]="DuplicateKey",t[t.CommentNotPermitted=521]="CommentNotPermitted",t[t.SchemaResolveError=768]="SchemaResolveError"})(J||(J={}));var yr;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[fe.Markdown,fe.PlainText],commitCharactersSupport:!0}}}}})(yr||(yr={}));function en(t,r){let i;return r.length===0?i=t:i=t.replace(/\{(\d+)\}/g,(e,n)=>{let a=n[0];return typeof r[a]!="undefined"?r[a]:e}),i}function tn(t,r,...i){return en(r,i)}function ce(t){return tn}var we=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])},t(r,i)};return function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(r,i);function e(){this.constructor=r}r.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}}(),F=ce(),rn={"color-hex":{errorMessage:F("colorHexFormatWarning","Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA."),pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:F("dateTimeFormatWarning","String is not a RFC3339 date-time."),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:F("dateFormatWarning","String is not a RFC3339 date."),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:F("timeFormatWarning","String is not a RFC3339 time."),pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:F("emailFormatWarning","String is not an e-mail address."),pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},ke=function(){function t(r,i,e){e===void 0&&(e=0),this.offset=i,this.length=e,this.parent=r}return Object.defineProperty(t.prototype,"children",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},t}();var nn=function(t){we(r,t);function r(i,e){var n=t.call(this,i,e)||this;return n.type="null",n.value=null,n}return r}(ke);var br=function(t){we(r,t);function r(i,e,n){var a=t.call(this,i,n)||this;return a.type="boolean",a.value=e,a}return r}(ke);var an=function(t){we(r,t);function r(i,e){var n=t.call(this,i,e)||this;return n.type="array",n.items=[],n}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!1,configurable:!0}),r}(ke);var on=function(t){we(r,t);function r(i,e){var n=t.call(this,i,e)||this;return n.type="number",n.isInteger=!0,n.value=Number.NaN,n}return r}(ke);var It=function(t){we(r,t);function r(i,e,n){var a=t.call(this,i,e,n)||this;return a.type="string",a.value="",a}return r}(ke);var sn=function(t){we(r,t);function r(i,e,n){var a=t.call(this,i,e)||this;return a.type="property",a.colonOffset=-1,a.keyNode=n,a}return Object.defineProperty(r.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!1,configurable:!0}),r}(ke);var fn=function(t){we(r,t);function r(i,e){var n=t.call(this,i,e)||this;return n.type="object",n.properties=[],n}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!1,configurable:!0}),r}(ke);function K(t){return ie(t)?t?{}:{not:{}}:t}var xr;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(xr||(xr={}));var un=function(){function t(r,i){r===void 0&&(r=-1),this.focusOffset=r,this.exclude=i,this.schemas=[]}return t.prototype.add=function(r){this.schemas.push(r)},t.prototype.merge=function(r){Array.prototype.push.apply(this.schemas,r.schemas)},t.prototype.include=function(r){return(this.focusOffset===-1||Mt(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),Nt=function(){function t(){}return Object.defineProperty(t.prototype,"schemas",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.add=function(r){},t.prototype.merge=function(r){},t.prototype.include=function(r){return!0},t.prototype.newSub=function(){return this},t.instance=new t,t}(),te=function(){function t(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=void 0}return t.prototype.hasProblems=function(){return!!this.problems.length},t.prototype.mergeAll=function(r){for(var i=0,e=r;i=t.offset&&r0?w={schema:W,validationResult:L,matchingSchemas:R}:q===0&&(w.matchingSchemas.merge(R),w.validationResult.mergeEnumValues(L))}}return B.length>1&&$&&i.problems.push({location:{offset:n.offset,length:1},message:F("oneOfWarning","Matches multiple schemas when only one must validate.")}),w&&(i.merge(w.validationResult),i.propertiesMatches+=w.validationResult.propertiesMatches,i.propertiesValueMatches+=w.validationResult.propertiesValueMatches,e.merge(w.matchingSchemas)),B.length};Array.isArray(r.anyOf)&&N(r.anyOf,!1),Array.isArray(r.oneOf)&&N(r.oneOf,!0);var P=function(V){var $=new te,B=e.newSub();G(n,K(V),$,B),i.merge($),i.propertiesMatches+=$.propertiesMatches,i.propertiesValueMatches+=$.propertiesValueMatches,e.merge(B)},M=function(V,$,B){var w=K(V),S=new te,C=e.newSub();G(n,w,S,C),e.merge(C),S.hasProblems()?B&&P(B):$&&P($)},T=K(r.if);if(T&&M(T,K(r.then),K(r.else)),Array.isArray(r.enum)){for(var O=ue(n),y=!1,k=0,E=r.enum;k=T&&h.problems.push({location:{offset:u.offset,length:u.length},message:F("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",T)});var O=P(l.minimum,l.exclusiveMinimum);ee(O)&&py&&h.problems.push({location:{offset:u.offset,length:u.length},message:F("maximumWarning","Value is above the maximum of {0}.",y)})}function s(u,l,h,g){if(ee(l.minLength)&&u.value.lengthl.maxLength&&h.problems.push({location:{offset:u.offset,length:u.length},message:F("maxLengthWarning","String is longer than the maximum length of {0}.",l.maxLength)}),Kt(l.pattern)){var p=Se(l.pattern);(p==null?void 0:p.test(u.value))||h.problems.push({location:{offset:u.offset,length:u.length},message:l.patternErrorMessage||l.errorMessage||F("patternWarning",'String does not match the pattern of "{0}".',l.pattern)})}if(l.format)switch(l.format){case"uri":case"uri-reference":{var m=void 0;if(!u.value)m=F("uriEmpty","URI expected.");else{var d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(u.value);d?!d[2]&&l.format==="uri"&&(m=F("uriSchemeMissing","URI with a scheme is expected.")):m=F("uriMissing","URI is expected.")}m&&h.problems.push({location:{offset:u.offset,length:u.length},message:l.patternErrorMessage||l.errorMessage||F("uriFormatWarning","String is not a URI: {0}",m)})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var A=rn[l.format];(!u.value||!A.pattern.exec(u.value))&&h.problems.push({location:{offset:u.offset,length:u.length},message:l.patternErrorMessage||l.errorMessage||A.errorMessage});default:}}function f(u,l,h,g){if(Array.isArray(l.items)){for(var p=l.items,m=0;m=p.length&&h.propertiesValueMatches++}if(u.items.length>p.length)if(typeof l.additionalItems=="object")for(var N=p.length;Nl.maxItems&&h.problems.push({location:{offset:u.offset,length:u.length},message:F("maxItemsWarning","Array has too many items. Expected {0} or fewer.",l.maxItems)}),l.uniqueItems===!0){var k=ue(u),E=k.some(function(j,V){return V!==k.lastIndexOf(j)});E&&h.problems.push({location:{offset:u.offset,length:u.length},message:F("uniqueItemsWarning","Array has duplicate items.")})}}function c(u,l,h,g){for(var p=Object.create(null),m=[],d=0,A=u.properties;d=0;)m.splice(ot,1),ot=m.indexOf(Bt)};if(l.properties)for(var k=0,E=Object.keys(l.properties);k0)for(var q=0,H=m;ql.maxProperties&&h.problems.push({location:{offset:u.offset,length:u.length},message:F("MaxPropWarning","Object has more properties than limit of {0}.",l.maxProperties)}),ee(l.minProperties)&&u.properties.length0){for(j--;j>0&&/\s/.test(n.charAt(j));)j--;V=j+1}if(c(T,O,j,V),y&&h(y,!1),k.length+E.length>0)for(var $=a.getToken();$!==17;){if(k.indexOf($)!==-1){s();break}else if(E.indexOf($)!==-1)break;$=s()}return y}function l(){switch(a.getTokenError()){case 4:return u(F("InvalidUnicode","Invalid unicode sequence in string."),J.InvalidUnicode),!0;case 5:return u(F("InvalidEscapeCharacter","Invalid escape character in string."),J.InvalidEscapeCharacter),!0;case 3:return u(F("UnexpectedEndOfNumber","Unexpected end of number."),J.UnexpectedEndOfNumber),!0;case 1:return u(F("UnexpectedEndOfComment","Unexpected end of comment."),J.UnexpectedEndOfComment),!0;case 2:return u(F("UnexpectedEndOfString","Unexpected end of string."),J.UnexpectedEndOfString),!0;case 6:return u(F("InvalidCharacter","Invalid characters in string. Control characters must be escaped."),J.InvalidCharacter),!0}return!1}function h(T,O){return T.length=a.getTokenOffset()+a.getTokenLength()-T.offset,O&&s(),T}function g(T){if(a.getToken()===3){var O=new an(T,a.getTokenOffset());s();for(var y=0,k=!1;a.getToken()!==4&&a.getToken()!==17;){if(a.getToken()===5){k||u(F("ValueExpected","Value expected"),J.ValueExpected);var E=a.getTokenOffset();if(s(),a.getToken()===4){k&&c(F("TrailingComma","Trailing comma"),J.TrailingComma,E,E+1);continue}}else k&&u(F("ExpectedComma","Expected comma"),J.CommaExpected);var j=N(O);j?O.items.push(j):u(F("PropertyExpected","Value expected"),J.ValueExpected,void 0,[],[4,5]),k=!0}return a.getToken()!==4?u(F("ExpectedCloseBracket","Expected comma or closing bracket"),J.CommaOrCloseBacketExpected,O):h(O,!0)}}var p=new It(void 0,0,0);function m(T,O){var y=new sn(T,a.getTokenOffset(),p),k=A(y);if(!k)if(a.getToken()===16){u(F("DoubleQuotesExpected","Property keys must be doublequoted"),J.Undefined);var E=new It(y,a.getTokenOffset(),a.getTokenLength());E.value=a.getTokenValue(),k=E,s()}else return;y.keyNode=k;var j=O[k.value];if(j?(c(F("DuplicateKeyWarning","Duplicate object key"),J.DuplicateKey,y.keyNode.offset,y.keyNode.offset+y.keyNode.length,X.Warning),typeof j=="object"&&c(F("DuplicateKeyWarning","Duplicate object key"),J.DuplicateKey,j.keyNode.offset,j.keyNode.offset+j.keyNode.length,X.Warning),O[k.value]=!0):O[k.value]=y,a.getToken()===6)y.colonOffset=a.getTokenOffset(),s();else if(u(F("ColonExpected","Colon expected"),J.ColonExpected),a.getToken()===10&&t.positionAt(k.offset+k.length).line=0;i--){var e=this.contributions[i].resolveCompletion;if(e){var n=e(r);if(n)return n}}return this.promiseConstructor.resolve(r)},t.prototype.doComplete=function(r,i,e){var n=this,a={items:[],isIncomplete:!1},o=r.getText(),s=r.offsetAt(i),f=e.getNodeFromOffset(s,!0);if(this.isInComment(r,f?f.offset:0,s))return Promise.resolve(a);if(f&&s===f.offset+f.length&&s>0){var c=o[s-1];(f.type==="object"&&c==="}"||f.type==="array"&&c==="]")&&(f=f.parent)}var u=this.getCurrentWord(r,s),l;if(f&&(f.type==="string"||f.type==="number"||f.type==="boolean"||f.type==="null"))l=U.create(r.positionAt(f.offset),r.positionAt(f.offset+f.length));else{var h=s-u.length;h>0&&o[h-1]==='"'&&h--,l=U.create(r.positionAt(h),i)}var g=!1,p={},m={add:function(d){var A=d.label,x=p[A];if(x)x.documentation||(x.documentation=d.documentation),x.detail||(x.detail=d.detail);else{if(A=A.replace(/[\n]/g,"\u21B5"),A.length>60){var v=A.substr(0,57).trim()+"...";p[v]||(A=v)}l&&d.insertText!==void 0&&(d.textEdit=Y.replace(l,d.insertText)),g&&(d.commitCharacters=d.kind===Q.Property?cn:ln),d.label=A,p[A]=d,a.items.push(d)}},setAsIncomplete:function(){a.isIncomplete=!0},error:function(d){console.error(d)},log:function(d){console.log(d)},getNumberOfProposals:function(){return a.items.length}};return this.schemaService.getSchemaForResource(r.uri,e).then(function(d){var A=[],x=!0,v="",N=void 0;if(f&&f.type==="string"){var P=f.parent;P&&P.type==="property"&&P.keyNode===f&&(x=!P.valueNode,N=P,v=o.substr(f.offset+1,f.length-2),P&&(f=P.parent))}if(f&&f.type==="object"){if(f.offset===s)return a;var M=f.properties;M.forEach(function(k){(!N||N!==k)&&(p[k.keyNode.value]=$e.create("__"))});var T="";x&&(T=n.evaluateSeparatorAfter(r,r.offsetAt(l.end))),d?n.getPropertyCompletions(d,e,f,x,T,m):n.getSchemaLessPropertyCompletions(e,f,v,m);var O=We(f);n.contributions.forEach(function(k){var E=k.collectPropertyCompletions(r.uri,O,u,x,T==="",m);E&&A.push(E)}),!d&&u.length>0&&o.charAt(s-u.length-1)!=='"'&&(m.add({kind:Q.Property,label:n.getLabelForValue(u),insertText:n.getInsertTextForProperty(u,void 0,!1,T),insertTextFormat:_.Snippet,documentation:""}),m.setAsIncomplete())}var y={};return d?n.getValueCompletions(d,e,f,s,r,m,y):n.getSchemaLessValueCompletions(e,f,s,r,m),n.contributions.length>0&&n.getContributedValueCompletions(e,f,s,r,m,A),n.promiseConstructor.all(A).then(function(){if(m.getNumberOfProposals()===0){var k=s;f&&(f.type==="string"||f.type==="number"||f.type==="boolean"||f.type==="null")&&(k=f.offset+f.length);var E=n.evaluateSeparatorAfter(r,k);n.addFillerValueCompletions(y,E,m)}return a})})},t.prototype.getPropertyCompletions=function(r,i,e,n,a,o){var s=this,f=i.getMatchingSchemas(r.schema,e.offset);f.forEach(function(c){if(c.node===e&&!c.inverted){var u=c.schema.properties;u&&Object.keys(u).forEach(function(m){var d=u[m];if(typeof d=="object"&&!d.deprecationMessage&&!d.doNotSuggest){var A={kind:Q.Property,label:m,insertText:s.getInsertTextForProperty(m,d,n,a),insertTextFormat:_.Snippet,filterText:s.getFilterTextForValue(m),documentation:s.fromMarkup(d.markdownDescription)||d.description||""};d.suggestSortText!==void 0&&(A.sortText=d.suggestSortText),A.insertText&&ge(A.insertText,"$1"+a)&&(A.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(A)}});var l=c.schema.propertyNames;if(typeof l=="object"&&!l.deprecationMessage&&!l.doNotSuggest){var h=function(m,d){d===void 0&&(d=void 0);var A={kind:Q.Property,label:m,insertText:s.getInsertTextForProperty(m,void 0,n,a),insertTextFormat:_.Snippet,filterText:s.getFilterTextForValue(m),documentation:d||s.fromMarkup(l.markdownDescription)||l.description||""};l.suggestSortText!==void 0&&(A.sortText=l.suggestSortText),A.insertText&&ge(A.insertText,"$1"+a)&&(A.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(A)};if(l.enum)for(var g=0;g(i.colonOffset||0)){var u=i.valueNode;if(u&&(e>u.offset+u.length||u.type==="object"||u.type==="array"))return;var l=i.keyNode.value;r.visit(function(g){return g.type==="property"&&g.keyNode.value===l&&g.valueNode&&c(g.valueNode),!0}),l==="$schema"&&i.parent&&!i.parent.parent&&this.addDollarSchemaCompletions(f,a)}if(i.type==="array")if(i.parent&&i.parent.type==="property"){var h=i.parent.keyNode.value;r.visit(function(g){return g.type==="property"&&g.keyNode.value===h&&g.valueNode&&g.valueNode.type==="array"&&g.valueNode.items.forEach(c),!0})}else i.items.forEach(c)},t.prototype.getValueCompletions=function(r,i,e,n,a,o,s){var f=n,c=void 0,u=void 0;if(e&&(e.type==="string"||e.type==="number"||e.type==="boolean"||e.type==="null")&&(f=e.offset+e.length,u=e,e=e.parent),!e){this.addSchemaValueCompletions(r.schema,"",o,s);return}if(e.type==="property"&&n>(e.colonOffset||0)){var l=e.valueNode;if(l&&n>l.offset+l.length)return;c=e.keyNode.value,e=e.parent}if(e&&(c!==void 0||e.type==="array")){for(var h=this.evaluateSeparatorAfter(a,f),g=i.getMatchingSchemas(r.schema,e.offset,u),p=0,m=g;p(i.colonOffset||0)){var s=i.keyNode.value,f=i.valueNode;if((!f||e<=f.offset+f.length)&&i.parent){var c=We(i.parent);this.contributions.forEach(function(u){var l=u.collectValueCompletions(n.uri,c,s,a);l&&o.push(l)})}}},t.prototype.addSchemaValueCompletions=function(r,i,e,n){var a=this;typeof r=="object"&&(this.addEnumValueCompletions(r,i,e),this.addDefaultValueCompletions(r,i,e),this.collectTypes(r,n),Array.isArray(r.allOf)&&r.allOf.forEach(function(o){return a.addSchemaValueCompletions(o,i,e,n)}),Array.isArray(r.anyOf)&&r.anyOf.forEach(function(o){return a.addSchemaValueCompletions(o,i,e,n)}),Array.isArray(r.oneOf)&&r.oneOf.forEach(function(o){return a.addSchemaValueCompletions(o,i,e,n)}))},t.prototype.addDefaultValueCompletions=function(r,i,e,n){var a=this;n===void 0&&(n=0);var o=!1;if(se(r.default)){for(var s=r.type,f=r.default,c=n;c>0;c--)f=[f],s="array";e.add({kind:this.getSuggestionKind(s),label:this.getLabelForValue(f),insertText:this.getInsertTextForValue(f,i),insertTextFormat:_.Snippet,detail:Vt("json.suggest.default","Default value")}),o=!0}Array.isArray(r.examples)&&r.examples.forEach(function(u){for(var l=r.type,h=u,g=n;g>0;g--)h=[h],l="array";e.add({kind:a.getSuggestionKind(l),label:a.getLabelForValue(h),insertText:a.getInsertTextForValue(h,i),insertTextFormat:_.Snippet}),o=!0}),Array.isArray(r.defaultSnippets)&&r.defaultSnippets.forEach(function(u){var l=r.type,h=u.body,g=u.label,p,m;if(se(h)){for(var d=r.type,A=n;A>0;A--)h=[h],d="array";p=a.getInsertTextForSnippetValue(h,i),m=a.getFilterTextForSnippetValue(h),g=g||a.getLabelForSnippetValue(h)}else if(typeof u.bodyText=="string"){for(var x="",v="",N="",A=n;A>0;A--)x=x+N+`[ `,v=v+` `+N+"]",N+=" ",l="array";p=x+N+u.bodyText.split(` `).join(` `+N)+v+i,g=g||p,m=p.replace(/[\n]/g,"")}else return;e.add({kind:a.getSuggestionKind(l),label:g,documentation:a.fromMarkup(u.markdownDescription)||u.description,insertText:p,insertTextFormat:_.Snippet,filterText:m}),o=!0}),!o&&typeof r.items=="object"&&!Array.isArray(r.items)&&n<5&&this.addDefaultValueCompletions(r.items,i,e,n+1)},t.prototype.addEnumValueCompletions=function(r,i,e){if(se(r.const)&&e.add({kind:this.getSuggestionKind(r.type),label:this.getLabelForValue(r.const),insertText:this.getInsertTextForValue(r.const,i),insertTextFormat:_.Snippet,documentation:this.fromMarkup(r.markdownDescription)||r.description}),Array.isArray(r.enum))for(var n=0,a=r.enum.length;n0?i[0]:void 0}if(!r)return Q.Value;switch(r){case"string":return Q.Value;case"object":return Q.Module;case"property":return Q.Property;default:return Q.Value}},t.prototype.getLabelTextForMatchingNode=function(r,i){switch(r.type){case"array":return"[]";case"object":return"{}";default:var e=i.getText().substr(r.offset,r.length);return e}},t.prototype.getInsertTextForMatchingNode=function(r,i,e){switch(r.type){case"array":return this.getInsertTextForValue([],e);case"object":return this.getInsertTextForValue({},e);default:var n=i.getText().substr(r.offset,r.length)+e;return this.getInsertTextForPlainText(n)}},t.prototype.getInsertTextForProperty=function(r,i,e,n){var a=this.getInsertTextForValue(r,"");if(!e)return a;var o=a+": ",s,f=0;if(i){if(Array.isArray(i.defaultSnippets)){if(i.defaultSnippets.length===1){var c=i.defaultSnippets[0].body;se(c)&&(s=this.getInsertTextForSnippetValue(c,""))}f+=i.defaultSnippets.length}if(i.enum&&(!s&&i.enum.length===1&&(s=this.getInsertTextForGuessedValue(i.enum[0],"")),f+=i.enum.length),se(i.default)&&(s||(s=this.getInsertTextForGuessedValue(i.default,"")),f++),Array.isArray(i.examples)&&i.examples.length&&(s||(s=this.getInsertTextForGuessedValue(i.examples[0],"")),f+=i.examples.length),f===0){var u=Array.isArray(i.type)?i.type[0]:i.type;switch(u||(i.properties?u="object":i.items&&(u="array")),u){case"boolean":s="$1";break;case"string":s='"$1"';break;case"object":s="{$1}";break;case"array":s="[$1]";break;case"number":case"integer":s="${1:0}";break;case"null":s="${1:null}";break;default:return a}}}return(!s||f>1)&&(s="$1"),o+s+n},t.prototype.getCurrentWord=function(r,i){for(var e=i-1,n=r.getText();e>=0&&` \r\v":{[,]}`.indexOf(n.charAt(e))===-1;)e--;return n.substring(e+1,i)},t.prototype.evaluateSeparatorAfter=function(r,i){var e=le(r.getText(),!0);e.setPosition(i);var n=e.scan();switch(n){case 5:case 2:case 4:case 17:return"";default:return","}},t.prototype.findItemAtOffset=function(r,i,e){for(var n=le(i.getText(),!0),a=r.items,o=a.length-1;o>=0;o--){var s=a[o];if(e>s.offset+s.length){n.setPosition(s.offset+s.length);var f=n.scan();return f===5&&e>=n.getTokenOffset()+n.getTokenLength()?o+1:o}else if(e>=s.offset)return o}return 0},t.prototype.isInComment=function(r,i,e){var n=le(r.getText(),!1);n.setPosition(i);for(var a=n.scan();a!==17&&n.getTokenOffset()+n.getTokenLength()a.offset+1&&n=0;l--){var h=this.contributions[l],g=h.getInfoContribution(r.uri,u);if(g)return g.then(function(p){return c(p)})}return this.schemaService.getSchemaForResource(r.uri,e).then(function(p){if(p&&a){var m=e.getMatchingSchemas(p.schema,a.offset),d=void 0,A=void 0,x=void 0,v=void 0;m.every(function(P){if(P.node===a&&!P.inverted&&P.schema&&(d=d||P.schema.title,A=A||P.schema.markdownDescription||Ft(P.schema.description),P.schema.enum)){var M=P.schema.enum.indexOf(ue(a));P.schema.markdownEnumDescriptions?x=P.schema.markdownEnumDescriptions[M]:P.schema.enumDescriptions&&(x=Ft(P.schema.enumDescriptions[M])),x&&(v=P.schema.enum[M],typeof v!="string"&&(v=JSON.stringify(v)))}return!0});var N="";return d&&(N=Ft(d)),A&&(N.length>0&&(N+=` `),N+=A),x&&(N.length>0&&(N+=` `),N+="`"+hn(v)+"`: "+x),c([N])}return null})},t}();function Ft(t){if(t){var r=t.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1 $3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function hn(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var Cr;Cr=(()=>{"use strict";var t={470:e=>{function n(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function a(s,f){for(var c,u="",l=0,h=-1,g=0,p=0;p<=s.length;++p){if(p2){var m=u.lastIndexOf("/");if(m!==u.length-1){m===-1?(u="",l=0):l=(u=u.slice(0,m)).length-1-u.lastIndexOf("/"),h=p,g=0;continue}}else if(u.length===2||u.length===1){u="",l=0,h=p,g=0;continue}}f&&(u.length>0?u+="/..":u="..",l=2)}else u.length>0?u+="/"+s.slice(h+1,p):u=s.slice(h+1,p),l=p-h-1;h=p,g=0}else c===46&&g!==-1?++g:g=-1}return u}var o={resolve:function(){for(var s,f="",c=!1,u=arguments.length-1;u>=-1&&!c;u--){var l;u>=0?l=arguments[u]:(s===void 0&&(s=process.cwd()),l=s),n(l),l.length!==0&&(f=l+"/"+f,c=l.charCodeAt(0)===47)}return f=a(f,!c),c?f.length>0?"/"+f:"/":f.length>0?f:"."},normalize:function(s){if(n(s),s.length===0)return".";var f=s.charCodeAt(0)===47,c=s.charCodeAt(s.length-1)===47;return(s=a(s,!f)).length!==0||f||(s="."),s.length>0&&c&&(s+="/"),f?"/"+s:s},isAbsolute:function(s){return n(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,f=0;f0&&(s===void 0?s=c:s+="/"+c)}return s===void 0?".":o.normalize(s)},relative:function(s,f){if(n(s),n(f),s===f||(s=o.resolve(s))===(f=o.resolve(f)))return"";for(var c=1;cp){if(f.charCodeAt(h+d)===47)return f.slice(h+d+1);if(d===0)return f.slice(h+d)}else l>p&&(s.charCodeAt(c+d)===47?m=d:d===0&&(m=0));break}var A=s.charCodeAt(c+d);if(A!==f.charCodeAt(h+d))break;A===47&&(m=d)}var x="";for(d=c+m+1;d<=u;++d)d!==u&&s.charCodeAt(d)!==47||(x.length===0?x+="..":x+="/..");return x.length>0?x+f.slice(h+m):(h+=m,f.charCodeAt(h)===47&&++h,f.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(n(s),s.length===0)return".";for(var f=s.charCodeAt(0),c=f===47,u=-1,l=!0,h=s.length-1;h>=1;--h)if((f=s.charCodeAt(h))===47){if(!l){u=h;break}}else l=!1;return u===-1?c?"/":".":c&&u===1?"//":s.slice(0,u)},basename:function(s,f){if(f!==void 0&&typeof f!="string")throw new TypeError('"ext" argument must be a string');n(s);var c,u=0,l=-1,h=!0;if(f!==void 0&&f.length>0&&f.length<=s.length){if(f.length===s.length&&f===s)return"";var g=f.length-1,p=-1;for(c=s.length-1;c>=0;--c){var m=s.charCodeAt(c);if(m===47){if(!h){u=c+1;break}}else p===-1&&(h=!1,p=c+1),g>=0&&(m===f.charCodeAt(g)?--g==-1&&(l=c):(g=-1,l=p))}return u===l?l=p:l===-1&&(l=s.length),s.slice(u,l)}for(c=s.length-1;c>=0;--c)if(s.charCodeAt(c)===47){if(!h){u=c+1;break}}else l===-1&&(h=!1,l=c+1);return l===-1?"":s.slice(u,l)},extname:function(s){n(s);for(var f=-1,c=0,u=-1,l=!0,h=0,g=s.length-1;g>=0;--g){var p=s.charCodeAt(g);if(p!==47)u===-1&&(l=!1,u=g+1),p===46?f===-1?f=g:h!==1&&(h=1):f!==-1&&(h=-1);else if(!l){c=g+1;break}}return f===-1||u===-1||h===0||h===1&&f===u-1&&f===c+1?"":s.slice(f,u)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return function(f,c){var u=c.dir||c.root,l=c.base||(c.name||"")+(c.ext||"");return u?u===c.root?u+l:u+"/"+l:l}(0,s)},parse:function(s){n(s);var f={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return f;var c,u=s.charCodeAt(0),l=u===47;l?(f.root="/",c=1):c=0;for(var h=-1,g=0,p=-1,m=!0,d=s.length-1,A=0;d>=c;--d)if((u=s.charCodeAt(d))!==47)p===-1&&(m=!1,p=d+1),u===46?h===-1?h=d:A!==1&&(A=1):h!==-1&&(A=-1);else if(!m){g=d+1;break}return h===-1||p===-1||A===0||A===1&&h===p-1&&h===g+1?p!==-1&&(f.base=f.name=g===0&&l?s.slice(1,p):s.slice(g,p)):(g===0&&l?(f.name=s.slice(1,h),f.base=s.slice(1,p)):(f.name=s.slice(g,h),f.base=s.slice(g,p)),f.ext=s.slice(h,p)),g>0?f.dir=s.slice(0,g-1):l&&(f.dir="/"),f},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,e.exports=o},447:(e,n,a)=>{var o;if(a.r(n),a.d(n,{URI:()=>A,Utils:()=>j}),typeof process=="object")o=process.platform==="win32";else if(typeof navigator=="object"){var s=navigator.userAgent;o=s.indexOf("Windows")>=0}var f,c,u=(f=function(w,S){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,I){C.__proto__=I}||function(C,I){for(var W in I)Object.prototype.hasOwnProperty.call(I,W)&&(C[W]=I[W])})(w,S)},function(w,S){function C(){this.constructor=w}f(w,S),w.prototype=S===null?Object.create(S):(C.prototype=S.prototype,new C)}),l=/^\w[\w\d+.-]*$/,h=/^\//,g=/^\/\//,p="",m="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,A=function(){function w(S,C,I,W,L,R){R===void 0&&(R=!1),typeof S=="object"?(this.scheme=S.scheme||p,this.authority=S.authority||p,this.path=S.path||p,this.query=S.query||p,this.fragment=S.fragment||p):(this.scheme=function(q,H){return q||H?q:"file"}(S,R),this.authority=C||p,this.path=function(q,H){switch(q){case"https":case"http":case"file":H?H[0]!==m&&(H=m+H):H=m}return H}(this.scheme,I||p),this.query=W||p,this.fragment=L||p,function(q,H){if(!q.scheme&&H)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+q.authority+'", path: "'+q.path+'", query: "'+q.query+'", fragment: "'+q.fragment+'"}');if(q.scheme&&!l.test(q.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(q.path){if(q.authority){if(!h.test(q.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(g.test(q.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}(this,R))}return w.isUri=function(S){return S instanceof w||!!S&&typeof S.authority=="string"&&typeof S.fragment=="string"&&typeof S.path=="string"&&typeof S.query=="string"&&typeof S.scheme=="string"&&typeof S.fsPath=="function"&&typeof S.with=="function"&&typeof S.toString=="function"},Object.defineProperty(w.prototype,"fsPath",{get:function(){return T(this,!1)},enumerable:!1,configurable:!0}),w.prototype.with=function(S){if(!S)return this;var C=S.scheme,I=S.authority,W=S.path,L=S.query,R=S.fragment;return C===void 0?C=this.scheme:C===null&&(C=p),I===void 0?I=this.authority:I===null&&(I=p),W===void 0?W=this.path:W===null&&(W=p),L===void 0?L=this.query:L===null&&(L=p),R===void 0?R=this.fragment:R===null&&(R=p),C===this.scheme&&I===this.authority&&W===this.path&&L===this.query&&R===this.fragment?this:new v(C,I,W,L,R)},w.parse=function(S,C){C===void 0&&(C=!1);var I=d.exec(S);return I?new v(I[2]||p,E(I[4]||p),E(I[5]||p),E(I[7]||p),E(I[9]||p),C):new v(p,p,p,p,p)},w.file=function(S){var C=p;if(o&&(S=S.replace(/\\/g,m)),S[0]===m&&S[1]===m){var I=S.indexOf(m,2);I===-1?(C=S.substring(2),S=m):(C=S.substring(2,I),S=S.substring(I)||m)}return new v("file",C,S,p,p)},w.from=function(S){return new v(S.scheme,S.authority,S.path,S.query,S.fragment)},w.prototype.toString=function(S){return S===void 0&&(S=!1),O(this,S)},w.prototype.toJSON=function(){return this},w.revive=function(S){if(S){if(S instanceof w)return S;var C=new v(S);return C._formatted=S.external,C._fsPath=S._sep===x?S.fsPath:null,C}return S},w}(),x=o?1:void 0,v=function(w){function S(){var C=w!==null&&w.apply(this,arguments)||this;return C._formatted=null,C._fsPath=null,C}return u(S,w),Object.defineProperty(S.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=T(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),S.prototype.toString=function(C){return C===void 0&&(C=!1),C?O(this,!0):(this._formatted||(this._formatted=O(this,!1)),this._formatted)},S.prototype.toJSON=function(){var C={$mid:1};return this._fsPath&&(C.fsPath=this._fsPath,C._sep=x),this._formatted&&(C.external=this._formatted),this.path&&(C.path=this.path),this.scheme&&(C.scheme=this.scheme),this.authority&&(C.authority=this.authority),this.query&&(C.query=this.query),this.fragment&&(C.fragment=this.fragment),C},S}(A),N=((c={})[58]="%3A",c[47]="%2F",c[63]="%3F",c[35]="%23",c[91]="%5B",c[93]="%5D",c[64]="%40",c[33]="%21",c[36]="%24",c[38]="%26",c[39]="%27",c[40]="%28",c[41]="%29",c[42]="%2A",c[43]="%2B",c[44]="%2C",c[59]="%3B",c[61]="%3D",c[32]="%20",c);function P(w,S){for(var C=void 0,I=-1,W=0;W=97&&L<=122||L>=65&&L<=90||L>=48&&L<=57||L===45||L===46||L===95||L===126||S&&L===47)I!==-1&&(C+=encodeURIComponent(w.substring(I,W)),I=-1),C!==void 0&&(C+=w.charAt(W));else{C===void 0&&(C=w.substr(0,W));var R=N[L];R!==void 0?(I!==-1&&(C+=encodeURIComponent(w.substring(I,W)),I=-1),C+=R):I===-1&&(I=W)}}return I!==-1&&(C+=encodeURIComponent(w.substring(I))),C!==void 0?C:w}function M(w){for(var S=void 0,C=0;C1&&w.scheme==="file"?"//"+w.authority+w.path:w.path.charCodeAt(0)===47&&(w.path.charCodeAt(1)>=65&&w.path.charCodeAt(1)<=90||w.path.charCodeAt(1)>=97&&w.path.charCodeAt(1)<=122)&&w.path.charCodeAt(2)===58?S?w.path.substr(1):w.path[1].toLowerCase()+w.path.substr(2):w.path,o&&(C=C.replace(/\//g,"\\")),C}function O(w,S){var C=S?M:P,I="",W=w.scheme,L=w.authority,R=w.path,q=w.query,H=w.fragment;if(W&&(I+=W,I+=":"),(L||W==="file")&&(I+=m,I+=m),L){var re=L.indexOf("@");if(re!==-1){var xe=L.substr(0,re);L=L.substr(re+1),(re=xe.indexOf(":"))===-1?I+=C(xe,!1):(I+=C(xe.substr(0,re),!1),I+=":",I+=C(xe.substr(re+1),!1)),I+="@"}(re=(L=L.toLowerCase()).indexOf(":"))===-1?I+=C(L,!1):(I+=C(L.substr(0,re),!1),I+=L.substr(re))}if(R){if(R.length>=3&&R.charCodeAt(0)===47&&R.charCodeAt(2)===58)(he=R.charCodeAt(1))>=65&&he<=90&&(R="/"+String.fromCharCode(he+32)+":"+R.substr(3));else if(R.length>=2&&R.charCodeAt(1)===58){var he;(he=R.charCodeAt(0))>=65&&he<=90&&(R=String.fromCharCode(he+32)+":"+R.substr(2))}I+=C(R,!0)}return q&&(I+="?",I+=C(q,!1)),H&&(I+="#",I+=S?H:P(H,!1)),I}function y(w){try{return decodeURIComponent(w)}catch{return w.length>3?w.substr(0,3)+y(w.substr(3)):w}}var k=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(w){return w.match(k)?w.replace(k,function(S){return y(S)}):w}var j,V=a(470),$=function(){for(var w=0,S=0,C=arguments.length;S{for(var a in n)i.o(n,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},i.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),i.r=e=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(447)})();var{URI:de,Utils:Ci}=Cr;function Or(t,r){if(typeof t!="string")throw new TypeError("Expected a string");for(var i=String(t),e="",n=r?!!r.extended:!1,a=r?!!r.globstar:!1,o=!1,s=r&&typeof r.flags=="string"?r.flags:"",f,c=0,u=i.length;c1&&(l==="/"||l===void 0||l==="{"||l===",")&&(g==="/"||g===void 0||g===","||g==="}");p?(g==="/"?c++:l==="/"&&e.endsWith("\\/")&&(e=e.substr(0,e.length-2)),e+="((?:[^/]*(?:/|$))*)"):e+="([^/]*)"}break;default:e+=f}return(!s||!~s.indexOf("g"))&&(e="^"+e+"$"),new RegExp(e,s)}var me=ce(),gn="!",pn="/",dn=function(){function t(r,i){this.globWrappers=[];try{for(var e=0,n=r;e0&&(a[0]===pn&&(a=a.substring(1)),this.globWrappers.push({regexp:Or("**/"+a,{extended:!0,globstar:!0}),include:o}))}this.uris=i}catch{this.globWrappers.length=0,this.uris=[]}}return t.prototype.matchesPattern=function(r){for(var i=!1,e=0,n=this.globWrappers;e0;)this.callOnDispose.pop()()},t.prototype.onResourceChange=function(r){var i=this;this.cachedSchemaForResource=void 0;var e=!1;r=ye(r);for(var n=[r],a=Object.keys(this.schemasById).map(function(c){return i.schemasById[c]});n.length;)for(var o=n.pop(),s=0;s1&&(n=a[1]),ge(n,".")&&(n=n.substr(0,n.length-1)),new ve({},[me("json.schema.nocontent","Unable to load schema from '{0}': {1}.",Qe(r),n)])})},t.prototype.resolveSchemaContent=function(r,i,e){var n=this,a=r.errors.slice(0),o=r.schema;if(o.$schema){var s=ye(o.$schema);if(s==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new jr({},[me("json.schema.draft03.notsupported","Draft-03 schemas are not supported.")]));s==="https://json-schema.org/draft/2019-09/schema"&&a.push(me("json.schema.draft201909.notsupported","Draft 2019-09 schemas are not yet fully supported."))}var f=this.contextService,c=function(g,p){if(!p)return g;var m=g;return p[0]==="/"&&(p=p.substr(1)),p.split("/").some(function(d){return d=d.replace(/~1/g,"/").replace(/~0/g,"~"),m=m[d],!m}),m},u=function(g,p,m,d){var A=d?decodeURIComponent(d):void 0,x=c(p,A);if(x)for(var v in x)x.hasOwnProperty(v)&&!g.hasOwnProperty(v)&&(g[v]=x[v]);else a.push(me("json.schema.invalidref","$ref '{0}' in '{1}' can not be resolved.",A,m))},l=function(g,p,m,d,A){f&&!/^[A-Za-z][A-Za-z0-9+\-.+]*:\/\/.*/.test(p)&&(p=f.resolveRelativePath(p,d)),p=ye(p);var x=n.getOrAddSchemaHandle(p);return x.getUnresolvedSchema().then(function(v){if(A[p]=!0,v.errors.length){var N=m?p+"#"+m:p;a.push(me("json.schema.problemloadingref","Problems loading reference '{0}': {1}",N,v.errors[0]))}return u(g,v.schema,p,m),h(g,v.schema,p,x.dependencies)})},h=function(g,p,m,d){if(!g||typeof g!="object")return Promise.resolve(null);for(var A=[g],x=[],v=[],N=function(){for(var y=[],k=0;k0){v.push(l(y,j[0],j[1],m,d));return}else k.indexOf(E)===-1&&(u(y,p,m,j[1]),k.push(E))}N(y.items,y.additionalItems,y.additionalProperties,y.not,y.contains,y.propertyNames,y.if,y.then,y.else),P(y.definitions,y.properties,y.patternProperties,y.dependencies),M(y.anyOf,y.allOf,y.oneOf,y.items)};A.length;){var O=A.pop();x.indexOf(O)>=0||(x.push(O),T(O))}return n.promise.all(v)};return h(o,o,i,e).then(function(g){return new jr(o,a)})},t.prototype.getSchemaForResource=function(r,i){if(i&&i.root&&i.root.type==="object"){var e=i.root.properties.filter(function(A){return A.keyNode.value==="$schema"&&A.valueNode&&A.valueNode.type==="string"});if(e.length>0){var n=e[0].valueNode;if(n&&n.type==="string"){var a=ue(n);if(a&>(a,".")&&this.contextService&&(a=this.contextService.resolveRelativePath(a,r)),a){var o=ye(a);return this.getOrAddSchemaHandle(o).getResolvedSchema()}}}}if(this.cachedSchemaForResource&&this.cachedSchemaForResource.resource===r)return this.cachedSchemaForResource.resolvedSchema;for(var s=Object.create(null),f=[],c=yn(r),u=0,l=this.filePatternAssociations;u0?this.createCombinedSchema(r,f).getResolvedSchema():this.promise.resolve(void 0);return this.cachedSchemaForResource={resource:r,resolvedSchema:d},d},t.prototype.createCombinedSchema=function(r,i){if(i.length===1)return this.getOrAddSchemaHandle(i[0]);var e="schemaservice://combinedSchema/"+encodeURIComponent(r),n={allOf:i.map(function(a){return{$ref:a}})};return this.addSchemaHandle(e,n)},t.prototype.getMatchingSchemas=function(r,i,e){if(e){var n=e.id||"schemaservice://untitled/matchingSchemas/"+vn++;return this.resolveSchemaContent(new ve(e),n,{}).then(function(a){return i.getMatchingSchemas(a.schema).filter(function(o){return!o.inverted})})}return this.getSchemaForResource(r.uri,i).then(function(a){return a?i.getMatchingSchemas(a.schema).filter(function(o){return!o.inverted}):[]})},t}();var vn=0;function ye(t){try{return de.parse(t).toString()}catch{return t}}function yn(t){try{return de.parse(t).with({fragment:null,query:null}).toString()}catch{return t}}function Qe(t){try{var r=de.parse(t);if(r.scheme==="file")return r.fsPath}catch{}return t}var bn=ce(),Er=function(){function t(r,i){this.jsonSchemaService=r,this.promise=i,this.validationEnabled=!0}return t.prototype.configure=function(r){r&&(this.validationEnabled=r.validate!==!1,this.commentSeverity=r.allowComments?void 0:X.Error)},t.prototype.doValidation=function(r,i,e,n){var a=this;if(!this.validationEnabled)return this.promise.resolve([]);var o=[],s={},f=function(l){var h=l.range.start.line+" "+l.range.start.character+" "+l.message;s[h]||(s[h]=!0,o.push(l))},c=function(l){var h=(e==null?void 0:e.trailingCommas)?Ye(e.trailingCommas):X.Error,g=(e==null?void 0:e.comments)?Ye(e.comments):a.commentSeverity,p=(e==null?void 0:e.schemaValidation)?Ye(e.schemaValidation):X.Warning,m=(e==null?void 0:e.schemaRequest)?Ye(e.schemaRequest):X.Warning;if(l){if(l.errors.length&&i.root&&m){var d=i.root,A=d.type==="object"?d.properties[0]:void 0;if(A&&A.keyNode.value==="$schema"){var x=A.valueNode||A,v=U.create(r.positionAt(x.offset),r.positionAt(x.offset+x.length));f(ae.create(v,l.errors[0],m,J.SchemaResolveError))}else{var v=U.create(r.positionAt(d.offset),r.positionAt(d.offset+1));f(ae.create(v,l.errors[0],m,J.SchemaResolveError))}}else if(p){var N=i.validate(r,l.schema,p);N&&N.forEach(f)}Ir(l.schema)&&(g=void 0),Nr(l.schema)&&(h=void 0)}for(var P=0,M=i.syntaxErrors;P=Ke&&t<=Tn?t-Ke+10:0)}function Vr(t){if(t[0]==="#")switch(t.length){case 4:return{red:z(t.charCodeAt(1))*17/255,green:z(t.charCodeAt(2))*17/255,blue:z(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:z(t.charCodeAt(1))*17/255,green:z(t.charCodeAt(2))*17/255,blue:z(t.charCodeAt(3))*17/255,alpha:z(t.charCodeAt(4))*17/255};case 7:return{red:(z(t.charCodeAt(1))*16+z(t.charCodeAt(2)))/255,green:(z(t.charCodeAt(3))*16+z(t.charCodeAt(4)))/255,blue:(z(t.charCodeAt(5))*16+z(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(z(t.charCodeAt(1))*16+z(t.charCodeAt(2)))/255,green:(z(t.charCodeAt(3))*16+z(t.charCodeAt(4)))/255,blue:(z(t.charCodeAt(5))*16+z(t.charCodeAt(6)))/255,alpha:(z(t.charCodeAt(7))*16+z(t.charCodeAt(8)))/255}}}var Fr=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,e){var n=this;e===void 0&&(e={resultLimit:Number.MAX_VALUE});var a=i.root;if(!a)return[];var o=e.resultLimit||Number.MAX_VALUE,s=r.uri;if((s==="vscode://defaultsettings/keybindings.json"||ge(s.toLowerCase(),"/user/keybindings.json"))&&a.type==="array"){for(var f=[],c=0,u=a.items;c0){o--;var k=Ae.create(r.uri,be(r,O)),E=T?T+"."+O.keyNode.value:O.keyNode.value;v.push({name:n.getKeyLabel(O),kind:n.getSymbolKind(y.type),location:k,containerName:T}),d.push({node:y,containerName:E})}else x=!0})};A0){o--;var E=be(r,y),j=E,V=String(k),$={name:V,kind:n.getSymbolKind(y.type),range:E,selectionRange:j,children:[]};O.push($),x.push({result:$.children,node:y})}else N=!0}):T.type==="object"&&T.properties.forEach(function(y){var k=y.valueNode;if(k)if(o>0){o--;var E=be(r,y),j=be(r,y.keyNode),V=[],$={name:n.getKeyLabel(y),kind:n.getSymbolKind(k.type),range:E,selectionRange:j,children:V,detail:n.getDetail(k)};O.push($),x.push({result:V,node:k})}else N=!0})};v0&&n[n.length-1].kind===l){var u=n.pop(),h=t.positionAt(o.getTokenOffset()).line;u&&h>u.startLine+1&&a!==u.startLine&&(u.endLine=h-1,f(u),a=u.startLine)}break}case 13:{var c=t.positionAt(o.getTokenOffset()).line,g=t.positionAt(o.getTokenOffset()+o.getTokenLength()).line;o.getTokenError()===1&&c+1=0&&n[d].kind!==Te.Region;)d--;if(d>=0){var u=n[d];n.length=d,h>u.startLine&&a!==u.startLine&&(u.endLine=h,f(u),a=u.startLine)}}}break}}s=o.scan()}var A=r&&r.rangeLimit;if(typeof A!="number"||i.length<=A)return i;r&&r.onRangeLimitExceeded&&r.onRangeLimitExceeded(t.uri);for(var x=[],v=0,N=e;vA){T=d;break}M+=O}}for(var y=[],d=0;d=l&&f<=h&&u.push(n(l,h)),u.push(n(c.offset,c.offset+c.length));break;case"number":case"boolean":case"null":case"property":u.push(n(c.offset,c.offset+c.length));break}if(c.type==="property"||c.parent&&c.parent.type==="array"){var g=o(c.offset+c.length,5);g!==-1&&u.push(n(c.offset,g))}c=c.parent}for(var p=void 0,m=u.length-1;m>=0;m--)p=Ie.create(u[m],p);return p||(p=Ie.create(U.create(s,s))),p}function n(s,f){return U.create(t.positionAt(s),t.positionAt(f))}var a=le(t.getText(),!0);function o(s,f){a.setPosition(s);var c=a.scan();return c===f?a.getTokenOffset()+a.getTokenLength():-1}return r.map(e)}function Rr(t,r){var i=[];return r.visit(function(e){var n;if(e.type==="property"&&e.keyNode.value==="$ref"&&((n=e.valueNode)===null||n===void 0?void 0:n.type)==="string"){var a=e.valueNode.value,o=Cn(r,a);if(o){var s=t.positionAt(o.offset);i.push({target:t.uri+"#"+(s.line+1)+","+(s.character+1),range:kn(t,e.valueNode)})}}return!0}),Promise.resolve(i)}function kn(t,r){return U.create(t.positionAt(r.offset+1),t.positionAt(r.offset+r.length-1))}function Cn(t,r){var i=On(r);return i?Dt(i,t.root):null}function Dt(t,r){if(!r)return null;if(t.length===0)return r;var i=t.shift();if(r&&r.type==="object"){var e=r.properties.find(function(o){return o.keyNode.value===i});return e?Dt(t,e.valueNode):null}else if(r&&r.type==="array"&&i.match(/^(0|[1-9][0-9]*)$/)){var n=Number.parseInt(i),a=r.items[n];return a?Dt(t,a):null}return null}function On(t){return t==="#"?[]:t[0]!=="#"||t[1]!=="/"?null:t.substring(2).split(/\//).map(jn)}function jn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function Ur(t){var r=t.promiseConstructor||Promise,i=new Pr(t.schemaRequestService,t.workspaceContext,r);i.setSchemaContributions(et);var e=new wr(i,t.contributions,r,t.clientCapabilities),n=new kr(i,t.contributions,r),a=new Fr(i),o=new Er(i,r);return{configure:function(s){i.clearExternalSchemas(),s.schemas&&s.schemas.forEach(function(f){i.registerExternalSchema(f.uri,f.fileMatch,f.schema)}),o.configure(s)},resetSchema:function(s){return i.onResourceChange(s)},doValidation:o.doValidation.bind(o),parseJSONDocument:function(s){return Tr(s,{collectComments:!0})},newJSONDocument:function(s,f){return Sr(s,f)},getMatchingSchemas:i.getMatchingSchemas.bind(i),doResolve:e.doResolve.bind(e),doComplete:e.doComplete.bind(e),findDocumentSymbols:a.findDocumentSymbols.bind(a),findDocumentSymbols2:a.findDocumentSymbols2.bind(a),findDocumentColors:a.findDocumentColors.bind(a),getColorPresentations:a.getColorPresentations.bind(a),doHover:n.doHover.bind(n),getFoldingRanges:Dr,getSelectionRanges:$r,findDefinition:function(){return Promise.resolve([])},findLinks:Rr,format:function(s,f,c){var u=void 0;if(f){var l=s.offsetAt(f.start),h=s.offsetAt(f.end)-l;u={offset:l,length:h}}var g={tabSize:c?c.tabSize:4,insertSpaces:(c==null?void 0:c.insertSpaces)===!0,insertFinalNewline:(c==null?void 0:c.insertFinalNewline)===!0,eol:` `};return Yt(s.getText(),u,g).map(function(p){return Y.replace(U.create(s.positionAt(p.offset),s.positionAt(p.offset+p.length)),p.content)})}}}var Wr;typeof fetch!="undefined"&&(Wr=function(t){return fetch(t).then(r=>r.text())});var $t=class{constructor(r,i){this._ctx=r,this._languageSettings=i.languageSettings,this._languageId=i.languageId,this._languageService=Ur({workspaceContext:{resolveRelativePath:(e,n)=>{let a=n.substr(0,n.lastIndexOf("/")+1);return In(a,e)}},schemaRequestService:i.enableSchemaRequest?Wr:void 0}),this._languageService.configure(this._languageSettings)}async doValidation(r){let i=this._getTextDocument(r);if(i){let e=this._languageService.parseJSONDocument(i);return this._languageService.doValidation(i,e,this._languageSettings)}return Promise.resolve([])}async doComplete(r,i){let e=this._getTextDocument(r);if(!e)return null;let n=this._languageService.parseJSONDocument(e);return this._languageService.doComplete(e,i,n)}async doResolve(r){return this._languageService.doResolve(r)}async doHover(r,i){let e=this._getTextDocument(r);if(!e)return null;let n=this._languageService.parseJSONDocument(e);return this._languageService.doHover(e,i,n)}async format(r,i,e){let n=this._getTextDocument(r);if(!n)return[];let a=this._languageService.format(n,i,e);return Promise.resolve(a)}async resetSchema(r){return Promise.resolve(this._languageService.resetSchema(r))}async findDocumentSymbols(r){let i=this._getTextDocument(r);if(!i)return[];let e=this._languageService.parseJSONDocument(i),n=this._languageService.findDocumentSymbols(i,e);return Promise.resolve(n)}async findDocumentColors(r){let i=this._getTextDocument(r);if(!i)return[];let e=this._languageService.parseJSONDocument(i),n=this._languageService.findDocumentColors(i,e);return Promise.resolve(n)}async getColorPresentations(r,i,e){let n=this._getTextDocument(r);if(!n)return[];let a=this._languageService.parseJSONDocument(n),o=this._languageService.getColorPresentations(n,a,i,e);return Promise.resolve(o)}async getFoldingRanges(r,i){let e=this._getTextDocument(r);if(!e)return[];let n=this._languageService.getFoldingRanges(e,i);return Promise.resolve(n)}async getSelectionRanges(r,i){let e=this._getTextDocument(r);if(!e)return[];let n=this._languageService.parseJSONDocument(e),a=this._languageService.getSelectionRanges(e,i,n);return Promise.resolve(a)}_getTextDocument(r){let i=this._ctx.getMirrorModels();for(let e of i)if(e.uri.toString()===r)return Ue.create(r,this._languageId,e.version,e.getValue());return null}},Pn="/".charCodeAt(0),Rt=".".charCodeAt(0);function En(t){return t.charCodeAt(0)===Pn}function In(t,r){if(En(r)){let i=de.parse(t),e=r.split("/");return i.with({path:Jr(e)}).toString()}return Nn(t,r)}function Jr(t){let r=[];for(let e of t)e.length===0||e.length===1&&e.charCodeAt(0)===Rt||(e.length===2&&e.charCodeAt(0)===Rt&&e.charCodeAt(1)===Rt?r.pop():r.push(e));t.length>1&&t[t.length-1].length===0&&r.push("");let i=r.join("/");return t[0].length===0&&(i="/"+i),i}function Nn(t,...r){let i=de.parse(t),e=i.path.split("/");for(let n of r)e.push(...n.split("/"));return i.with({path:Jr(e)}).toString()}function Mn(t,r){return new $t(t,r)}return Vn;})(); return moduleExports; });