32 lines
125 KiB
JavaScript
32 lines
125 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[202],{"6a/n":function(Br,Je,je){"use strict";(function(qe){je.d(Je,"a",function(){return Ae});var ht=function(){var C=function(j,P){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(z,U){z.__proto__=U}||function(z,U){for(var R in U)U.hasOwnProperty(R)&&(z[R]=U[R])},C(j,P)};return function(k,j){C(k,j);function P(){this.constructor=k}k.prototype=j===null?Object.create(j):(P.prototype=j.prototype,new P)}}(),H,ue;if(typeof qe=="object")ue=qe.platform==="win32";else if(typeof navigator=="object"){var Se=navigator.userAgent;ue=Se.indexOf("Windows")>=0}function xe(C){return 55296<=C&&C<=56319}function dt(C){return 56320<=C&&C<=57343}function He(C){return C>=97&&C<=102}function pt(C){return C>=97&&C<=122}function mt(C){return C>=65&&C<=90}function Pe(C){return pt(C)||mt(C)}var Ee=/^\w[\w\d+.-]*$/,gt=/^\//,vt=/^\/\//;function ze(C,k){if(!C.scheme&&k)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+C.authority+'", path: "'+C.path+'", query: "'+C.query+'", fragment: "'+C.fragment+'"}');if(C.scheme&&!Ee.test(C.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(C.path){if(C.authority){if(!gt.test(C.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(vt.test(C.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function _e(C,k){return!C&&!k?"file":C}function Ke(C,k){switch(C){case"https":case"http":case"file":k?k[0]!==re&&(k=re+k):k=re;break}return k}var W="",re="/",Ge=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,Ae=function(){function C(k,j,P,z,U,R){R===void 0&&(R=!1),typeof k=="object"?(this.scheme=k.scheme||W,this.authority=k.authority||W,this.path=k.path||W,this.query=k.query||W,this.fragment=k.fragment||W):(this.scheme=_e(k,R),this.authority=j||W,this.path=Ke(this.scheme,P||W),this.query=z||W,this.fragment=U||W,ze(this,R))}return C.isUri=function(k){return k instanceof C?!0:k?typeof k.authority=="string"&&typeof k.fragment=="string"&&typeof k.path=="string"&&typeof k.query=="string"&&typeof k.scheme=="string"&&typeof k.fsPath=="function"&&typeof k.with=="function"&&typeof k.toString=="function":!1},Object.defineProperty(C.prototype,"fsPath",{get:function(){return Ne(this)},enumerable:!0,configurable:!0}),C.prototype.with=function(k){if(!k)return this;var j=k.scheme,P=k.authority,z=k.path,U=k.query,R=k.fragment;return j===void 0?j=this.scheme:j===null&&(j=W),P===void 0?P=this.authority:P===null&&(P=W),z===void 0?z=this.path:z===null&&(z=W),U===void 0?U=this.query:U===null&&(U=W),R===void 0?R=this.fragment:R===null&&(R=W),j===this.scheme&&P===this.authority&&z===this.path&&U===this.query&&R===this.fragment?this:new fe(j,P,z,U,R)},C.parse=function(k,j){j===void 0&&(j=!1);var P=Ge.exec(k);return P?new fe(P[2]||W,decodeURIComponent(P[4]||W),decodeURIComponent(P[5]||W),decodeURIComponent(P[7]||W),decodeURIComponent(P[9]||W),j):new fe(W,W,W,W,W)},C.file=function(k){var j=W;if(ue&&(k=k.replace(/\\/g,re)),k[0]===re&&k[1]===re){var P=k.indexOf(re,2);P===-1?(j=k.substring(2),k=re):(j=k.substring(2,P),k=k.substring(P)||re)}return new fe("file",j,k,W,W)},C.from=function(k){return new fe(k.scheme,k.authority,k.path,k.query,k.fragment)},C.prototype.toString=function(k){return k===void 0&&(k=!1),Ze(this,k)},C.prototype.toJSON=function(){return this},C.revive=function(k){if(k){if(k instanceof C)return k;var j=new fe(k);return j._formatted=k.external,j._fsPath=k._sep===Qe?k.fsPath:null,j}else return k},C}(),Qe=ue?1:void 0,fe=function(C){ht(k,C);function k(){var j=C!==null&&C.apply(this,arguments)||this;return j._formatted=null,j._fsPath=null,j}return Object.defineProperty(k.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=Ne(this)),this._fsPath},enumerable:!0,configurable:!0}),k.prototype.toString=function(j){return j===void 0&&(j=!1),j?Ze(this,!0):(this._formatted||(this._formatted=Ze(this,!1)),this._formatted)},k.prototype.toJSON=function(){var j={$mid:1};return this._fsPath&&(j.fsPath=this._fsPath,j._sep=Qe),this._formatted&&(j.external=this._formatted),this.path&&(j.path=this.path),this.scheme&&(j.scheme=this.scheme),this.authority&&(j.authority=this.authority),this.query&&(j.query=this.query),this.fragment&&(j.fragment=this.fragment),j},k}(Ae),yt=(H={},H[58]="%3A",H[47]="%2F",H[63]="%3F",H[35]="%23",H[91]="%5B",H[93]="%5D",H[64]="%40",H[33]="%21",H[36]="%24",H[38]="%26",H[39]="%27",H[40]="%28",H[41]="%29",H[42]="%2A",H[43]="%2B",H[44]="%2C",H[59]="%3B",H[61]="%3D",H[32]="%20",H);function Fe(C,k){for(var j=void 0,P=-1,z=0;z<C.length;z++){var U=C.charCodeAt(z);if(U>=97&&U<=122||U>=65&&U<=90||U>=48&&U<=57||U===45||U===46||U===95||U===126||k&&U===47)P!==-1&&(j+=encodeURIComponent(C.substring(P,z)),P=-1),j!==void 0&&(j+=C.charAt(z));else{j===void 0&&(j=C.substr(0,z));var R=yt[U];R!==void 0?(P!==-1&&(j+=encodeURIComponent(C.substring(P,z)),P=-1),j+=R):P===-1&&(P=z)}}return P!==-1&&(j+=encodeURIComponent(C.substring(P))),j!==void 0?j:C}function ve(C){for(var k=void 0,j=0;j<C.length;j++){var P=C.charCodeAt(j);P===35||P===63?(k===void 0&&(k=C.substr(0,j)),k+=yt[P]):k!==void 0&&(k+=C[j])}return k!==void 0?k:C}function Ne(C){var k;return C.authority&&C.path.length>1&&C.scheme==="file"?k="//"+C.authority+C.path:C.path.charCodeAt(0)===47&&(C.path.charCodeAt(1)>=65&&C.path.charCodeAt(1)<=90||C.path.charCodeAt(1)>=97&&C.path.charCodeAt(1)<=122)&&C.path.charCodeAt(2)===58?k=C.path[1].toLowerCase()+C.path.substr(2):k=C.path,ue&&(k=k.replace(/\//g,"\\")),k}function Ze(C,k){var j=k?ve:Fe,P="",z=C.scheme,U=C.authority,R=C.path,Xe=C.query,Ye=C.fragment;if(z&&(P+=z,P+=":"),(U||z==="file")&&(P+=re,P+=re),U){var ie=U.indexOf("@");if(ie!==-1){var De=U.substr(0,ie);U=U.substr(ie+1),ie=De.indexOf(":"),ie===-1?P+=j(De,!1):(P+=j(De.substr(0,ie),!1),P+=":",P+=j(De.substr(ie+1),!1)),P+="@"}U=U.toLowerCase(),ie=U.indexOf(":"),ie===-1?P+=j(U,!1):(P+=j(U.substr(0,ie),!1),P+=U.substr(ie))}if(R){if(R.length>=3&&R.charCodeAt(0)===47&&R.charCodeAt(2)===58){var he=R.charCodeAt(1);he>=65&&he<=90&&(R="/"+String.fromCharCode(he+32)+":"+R.substr(3))}else if(R.length>=2&&R.charCodeAt(1)===58){var he=R.charCodeAt(0);he>=65&&he<=90&&(R=String.fromCharCode(he+32)+":"+R.substr(2))}P+=j(R,!0)}return Xe&&(P+="?",P+=j(Xe,!1)),Ye&&(P+="#",P+=k?Ye:Fe(Ye,!1)),P}}).call(this,je("7vYp"))},cm7A:function(Br,Je,je){"use strict";je.r(Je),je.d(Je,"setupMode",function(){return Yn});var qe=2*60*1e3,ht=function(){function e(t){var n=this;this._defaults=t,this._worker=null,this._idleCheckInterval=setInterval(function(){return n._checkIfIdle()},30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(function(){return n._stopWorker()})}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){if(!this._worker)return;var t=Date.now()-this._lastUsedTime;t>qe&&this._stopWorker()},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/json/jsonWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i;return this._getClient().then(function(a){i=a}).then(function(a){return t._worker.withSyncedResources(n)}).then(function(a){return i})},e}();function H(e,t){t===void 0&&(t=!1);var n=e.length,r=0,i="",a=0,c=16,u=0,l=0,s=0,o=0,f=0;function h(p,I){for(var S=0,A=0;S<p||!I;){var x=e.charCodeAt(r);if(x>=48&&x<=57)A=A*16+x-48;else if(x>=65&&x<=70)A=A*16+x-65+10;else if(x>=97&&x<=102)A=A*16+x-97+10;else break;r++,S++}return S<p&&(A=-1),A}function d(p){r=p,i="",a=0,c=16,f=0}function v(){var p=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&xe(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&xe(e.charCodeAt(r)))for(r++;r<e.length&&xe(e.charCodeAt(r));)r++;else return f=3,e.substring(p,r);var I=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&xe(e.charCodeAt(r))){for(r++;r<e.length&&xe(e.charCodeAt(r));)r++;I=r}else f=3;return e.substring(p,I)}function m(){for(var p="",I=r;;){if(r>=n){p+=e.substring(I,r),f=2;break}var S=e.charCodeAt(r);if(S===34){p+=e.substring(I,r),r++;break}if(S===92){if(p+=e.substring(I,r),r++,r>=n){f=2;break}var A=e.charCodeAt(r++);switch(A){case 34:p+='"';break;case 92:p+="\\";break;case 47:p+="/";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+=`
|
|
`;break;case 114:p+="\r";break;case 116:p+=" ";break;case 117:var x=h(4,!0);x>=0?p+=String.fromCharCode(x):f=4;break;default:f=5}I=r;continue}if(S>=0&&S<=31)if(Se(S)){p+=e.substring(I,r),f=2;break}else f=6;r++}return p}function T(){if(i="",f=0,a=r,l=u,o=s,r>=n)return a=n,c=17;var p=e.charCodeAt(r);if(ue(p)){do r++,i+=String.fromCharCode(p),p=e.charCodeAt(r);while(ue(p));return c=15}if(Se(p))return r++,i+=String.fromCharCode(p),p===13&&e.charCodeAt(r)===10&&(r++,i+=`
|
|
`),u++,s=r,c=14;switch(p){case 123:return r++,c=1;case 125:return r++,c=2;case 91:return r++,c=3;case 93:return r++,c=4;case 58:return r++,c=6;case 44:return r++,c=5;case 34:return r++,i=m(),c=10;case 47:var I=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!Se(e.charCodeAt(r));)r++;return i=e.substring(I,r),c=12}if(e.charCodeAt(r+1)===42){r+=2;for(var S=n-1,A=!1;r<S;){var x=e.charCodeAt(r);if(x===42&&e.charCodeAt(r+1)===47){r+=2,A=!0;break}r++,Se(x)&&(x===13&&e.charCodeAt(r)===10&&r++,u++,s=r)}return A||(r++,f=1),i=e.substring(I,r),c=13}return i+=String.fromCharCode(p),r++,c=16;case 45:if(i+=String.fromCharCode(p),r++,r===n||!xe(e.charCodeAt(r)))return c=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=v(),c=11;default:for(;r<n&&b(p);)r++,p=e.charCodeAt(r);if(a!==r){i=e.substring(a,r);switch(i){case"true":return c=8;case"false":return c=9;case"null":return c=7}return c=16}return i+=String.fromCharCode(p),r++,c=16}}function b(p){if(ue(p)||Se(p))return!1;switch(p){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function y(){var p;do p=T();while(p>=12&&p<=15);return p}return{setPosition:d,getPosition:function(){return r},scan:t?y:T,getToken:function(){return c},getTokenValue:function(){return i},getTokenOffset:function(){return a},getTokenLength:function(){return r-a},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return a-o},getTokenError:function(){return f}}}function ue(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 Se(e){return e===10||e===13||e===8232||e===8233}function xe(e){return e>=48&&e<=57}function dt(e,t,n){var r,i,a,c,u;if(t){for(c=t.offset,u=c+t.length,a=c;a>0&&!Pe(e,a-1);)a--;for(var l=u;l<e.length&&!Pe(e,l);)l++;i=e.substring(a,l),r=pt(i,n)}else i=e,r=0,a=0,c=0,u=e.length;var s=mt(n,e),o=!1,f=0,h;n.insertSpaces?h=He(" ",n.tabSize||4):h=" ";var d=H(i,!1),v=!1;function m(){return s+He(h,r+f)}function T(){var w=d.scan();for(o=!1;w===15||w===14;)o=o||w===14,w=d.scan();return v=w===16||d.getTokenError()!==0,w}var b=[];function y(w,N,D){!v&&N<u&&D>c&&e.substring(N,D)!==w&&b.push({offset:N,length:D-N,content:w})}var p=T();if(p!==17){var I=d.getTokenOffset()+a,S=He(h,r);y(S,a,I)}for(;p!==17;){for(var A=d.getTokenOffset()+d.getTokenLength()+a,x=T(),O="";!o&&(x===12||x===13);){var E=d.getTokenOffset()+a;y(" ",A,E),A=d.getTokenOffset()+d.getTokenLength()+a,O=x===12?m():"",x=T()}if(x===2)p!==1&&(f--,O=m());else if(x===4)p!==3&&(f--,O=m());else{switch(p){case 3:case 1:f++,O=m();break;case 5:case 12:O=m();break;case 13:o?O=m():O=" ";break;case 6:O=" ";break;case 10:if(x===6){O="";break}case 7:case 8:case 9:case 11:case 2:case 4:x===12||x===13?O=" ":x!==5&&x!==17&&(v=!0);break;case 16:v=!0;break}o&&(x===12||x===13)&&(O=m())}var L=d.getTokenOffset()+a;y(O,A,L),p=x}return b}function He(e,t){for(var n="",r=0;r<t;r++)n+=e;return n}function pt(e,t){for(var n=0,r=0,i=t.tabSize||4;n<e.length;){var a=e.charAt(n);if(a===" ")r++;else if(a===" ")r+=i;else break;n++}return Math.floor(r/i)}function mt(e,t){for(var n=0;n<t.length;n++){var r=t.charAt(n);if(r==="\r")return n+1<t.length&&t.charAt(n+1)===`
|
|
`?`\r
|
|
`:"\r";if(r===`
|
|
`)return`
|
|
`}return e&&e.eol||`
|
|
`}function Pe(e,t){return`\r
|
|
`.indexOf(e.charAt(t))!==-1}var Ee;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Ee||(Ee={}));function gt(e,t){var n=[],r=new Object,i=void 0,a={value:{},offset:0,length:0,type:"object",parent:void 0},c=!1;function u(l,s,o,f){a.value=l,a.offset=s,a.length=o,a.type=f,a.colonOffset=void 0,i=a}try{Ae(e,{onObjectBegin:function(s,o){if(t<=s)throw r;i=void 0,c=t>s,n.push("")},onObjectProperty:function(s,o,f){if(t<o)throw r;if(u(s,o,f,"property"),n[n.length-1]=s,t<=o+f)throw r},onObjectEnd:function(s,o){if(t<=s)throw r;i=void 0,n.pop()},onArrayBegin:function(s,o){if(t<=s)throw r;i=void 0,n.push(0)},onArrayEnd:function(s,o){if(t<=s)throw r;i=void 0,n.pop()},onLiteralValue:function(s,o,f){if(t<o)throw r;if(u(s,o,f,fe(s)),t<=o+f)throw r},onSeparator:function(s,o,f){if(t<=o)throw r;if(s===":"&&i&&i.type==="property")i.colonOffset=o,c=!1,i=void 0;else if(s===","){var h=n[n.length-1];typeof h=="number"?n[n.length-1]=h+1:(c=!0,n[n.length-1]=""),i=void 0}}})}catch(l){if(l!==r)throw l}return{path:n,previousNode:i,isAtPropertyKey:c,matches:function(s){for(var o=0,f=0;o<s.length&&f<n.length;f++)if(s[o]===n[f]||s[o]==="*")o++;else if(s[o]!=="**")return!1;return o===s.length}}}function vt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=Ee.DEFAULT);var r=null,i=[],a=[];function c(l){Array.isArray(i)?i.push(l):r!==null&&(i[r]=l)}var u={onObjectBegin:function(){var s={};c(s),a.push(i),i=s,r=null},onObjectProperty:function(s){r=s},onObjectEnd:function(){i=a.pop()},onArrayBegin:function(){var s=[];c(s),a.push(i),i=s,r=null},onArrayEnd:function(){i=a.pop()},onLiteralValue:c,onError:function(s,o,f){t.push({error:s,offset:o,length:f})}};return Ae(e,u,n),i[0]}function ze(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=Ee.DEFAULT);var r={type:"array",offset:-1,length:-1,children:[],parent:void 0};function i(l){r.type==="property"&&(r.length=l-r.offset,r=r.parent)}function a(l){return r.children.push(l),l}var c={onObjectBegin:function(s){r=a({type:"object",offset:s,length:-1,parent:r,children:[]})},onObjectProperty:function(s,o,f){r=a({type:"property",offset:o,length:-1,parent:r,children:[]}),r.children.push({type:"string",value:s,offset:o,length:f,parent:r})},onObjectEnd:function(s,o){r.length=s+o-r.offset,r=r.parent,i(s+o)},onArrayBegin:function(s,o){r=a({type:"array",offset:s,length:-1,parent:r,children:[]})},onArrayEnd:function(s,o){r.length=s+o-r.offset,r=r.parent,i(s+o)},onLiteralValue:function(s,o,f){a({type:fe(s),offset:o,length:f,parent:r,value:s}),i(o+f)},onSeparator:function(s,o,f){r.type==="property"&&(s===":"?r.colonOffset=o:s===","&&i(o))},onError:function(s,o,f){t.push({error:s,offset:o,length:f})}};Ae(e,c,n);var u=r.children[0];return u&&delete u.parent,u}function _e(e,t){if(!e)return;for(var n=e,r=0,i=t;r<i.length;r++){var a=i[r];if(typeof a=="string"){if(n.type!=="object"||!Array.isArray(n.children))return;for(var c=!1,u=0,l=n.children;u<l.length;u++){var s=l[u];if(Array.isArray(s.children)&&s.children[0].value===a){n=s.children[1],c=!0;break}}if(!c)return}else{var o=a;if(n.type!=="array"||o<0||!Array.isArray(n.children)||o>=n.children.length)return;n=n.children[o]}}return n}function Ke(e){if(!e.parent||!e.parent.children)return[];var t=Ke(e.parent);if(e.parent.type==="property"){var n=e.parent.children[0].value;t.push(n)}else if(e.parent.type==="array"){var r=e.parent.children.indexOf(e);r!==-1&&t.push(r)}return t}function W(e){switch(e.type){case"array":return e.children.map(W);case"object":for(var t=Object.create(null),n=0,r=e.children;n<r.length;n++){var i=r[n],a=i.children[1];a&&(t[i.children[0].value]=W(a))}return t;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function re(e,t,n){return n===void 0&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function Ge(e,t,n){if(n===void 0&&(n=!1),re(e,t,n)){var r=e.children;if(Array.isArray(r))for(var i=0;i<r.length&&r[i].offset<=t;i++){var a=Ge(r[i],t,n);if(a)return a}return e}return}function Ae(e,t,n){n===void 0&&(n=Ee.DEFAULT);var r=H(e,!1);function i(E){return E?function(){return E(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:function(){return!0}}function a(E){return E?function(L){return E(L,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:function(){return!0}}var c=i(t.onObjectBegin),u=a(t.onObjectProperty),l=i(t.onObjectEnd),s=i(t.onArrayBegin),o=i(t.onArrayEnd),f=a(t.onLiteralValue),h=a(t.onSeparator),d=i(t.onComment),v=a(t.onError),m=n&&n.disallowComments,T=n&&n.allowTrailingComma;function b(){for(;;){var E=r.scan();switch(r.getTokenError()){case 4:y(14);break;case 5:y(15);break;case 3:y(13);break;case 1:m||y(11);break;case 2:y(12);break;case 6:y(16);break}switch(E){case 12:case 13:m?y(10):d();break;case 16:y(1);break;case 15:case 14:break;default:return E}}}function y(E,L,w){if(L===void 0&&(L=[]),w===void 0&&(w=[]),v(E),L.length+w.length>0)for(var N=r.getToken();N!==17;){if(L.indexOf(N)!==-1){b();break}else if(w.indexOf(N)!==-1)break;N=b()}}function p(E){var L=r.getTokenValue();return E?f(L):u(L),b(),!0}function I(){switch(r.getToken()){case 11:var E=0;try{E=JSON.parse(r.getTokenValue()),typeof E!="number"&&(y(2),E=0)}catch(L){y(2)}f(E);break;case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return b(),!0}function S(){return r.getToken()!==10?(y(3,[],[2,5]),!1):(p(!1),r.getToken()===6?(h(":"),b(),O()||y(4,[],[2,5])):y(5,[],[2,5]),!0)}function A(){c(),b();for(var E=!1;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(E||y(4,[],[]),h(","),b(),r.getToken()===2&&T)break}else E&&y(6,[],[]);S()||y(4,[],[2,5]),E=!0}return l(),r.getToken()!==2?y(7,[2],[]):b(),!0}function x(){s(),b();for(var E=!1;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(E||y(4,[],[]),h(","),b(),r.getToken()===4&&T)break}else E&&y(6,[],[]);O()||y(4,[],[4,5]),E=!0}return o(),r.getToken()!==4?y(8,[4],[]):b(),!0}function O(){switch(r.getToken()){case 3:return x();case 1:return A();case 10:return p(!0);default:return I()}}return b(),r.getToken()===17?n.allowEmptyContent?!0:(y(4,[],[]),!1):O()?(r.getToken()!==17&&y(9,[],[]),!0):(y(4,[],[]),!1)}function Qe(e,t){var n=H(e),r=[],i,a=0,c;do{c=n.getPosition(),i=n.scan();switch(i){case 12:case 13:case 17:a!==c&&r.push(e.substring(a,c)),t!==void 0&&r.push(n.getTokenValue().replace(/[^\r\n]/g,t)),a=n.getPosition();break}}while(i!==17);return r.join("")}function fe(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(e){if(Array.isArray(e))return"array"}else return"null";return"object"}default:return"null"}}function yt(e,t,n){return Fe(e,t,void 0,n)}function Fe(e,t,n,r,i){for(var a,c=t.slice(),u=[],l=ze(e,u),s=void 0,o=void 0;c.length>0&&(o=c.pop(),s=_e(l,c),s===void 0&&n!==void 0);)typeof o=="string"?n=(a={},a[o]=n,a):n=[n];if(s)if(s.type==="object"&&typeof o=="string"&&Array.isArray(s.children)){var f=_e(s,[o]);if(f!==void 0)if(n===void 0){if(!f.parent)throw new Error("Malformed AST");var h=s.children.indexOf(f.parent),d=void 0,v=f.parent.offset+f.parent.length;if(h>0){var m=s.children[h-1];d=m.offset+m.length}else if(d=s.offset+1,s.children.length>1){var T=s.children[1];v=T.offset}return ve(e,{offset:d,length:v-d,content:""},r)}else return ve(e,{offset:f.offset,length:f.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];var b=JSON.stringify(o)+": "+JSON.stringify(n),y=i?i(s.children.map(function(E){return E.children[0].value})):s.children.length,p=void 0;if(y>0){var m=s.children[y-1];p={offset:m.offset+m.length,length:0,content:","+b}}else s.children.length===0?p={offset:s.offset+1,length:0,content:b}:p={offset:s.offset+1,length:0,content:b+","};return ve(e,p,r)}}else if(s.type==="array"&&typeof o=="number"&&Array.isArray(s.children)){var I=o;if(I===-1){var b=""+JSON.stringify(n),p=void 0;if(s.children.length===0)p={offset:s.offset+1,length:0,content:b};else{var m=s.children[s.children.length-1];p={offset:m.offset+m.length,length:0,content:","+b}}return ve(e,p,r)}else if(n===void 0&&s.children.length>=0){var S=o,A=s.children[S],p=void 0;if(s.children.length===1)p={offset:s.offset+1,length:s.length-2,content:""};else if(s.children.length-1===S){var m=s.children[S-1],x=m.offset+m.length,O=s.offset+s.length;p={offset:x,length:O-2-x,content:""}}else p={offset:A.offset,length:s.children[S+1].offset-A.offset,content:""};return ve(e,p,r)}else throw new Error("Array modification not supported yet")}else throw new Error("Can not add "+(typeof o!="number"?"index":"property")+" to parent of type "+s.type);else{if(n===void 0)throw new Error("Can not delete in empty document");return ve(e,{offset:l?l.offset:0,length:l?l.length:0,content:JSON.stringify(n)},r)}}function ve(e,t,n){var r=Ne(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!Pe(r,i-1);)i--;for(;a<r.length&&!Pe(r,a);)a++}for(var c=dt(r,{offset:i,length:a-i},n),u=c.length-1;u>=0;u--){var l=c[u];r=Ne(r,l),i=Math.min(i,l.offset),a=Math.max(a,l.offset+l.length),a+=l.content.length-l.length}var s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function Ne(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}function Ze(e,t){return`\r
|
|
`.indexOf(e.charAt(t))!==-1}var C=H,k=gt,j=vt,P=ze,z=_e,U=Ge,R=Ke,Xe=W,Ye=Ae,ie=Qe;function De(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function he(e,t,n){return dt(e,t,n)}function ni(e,t,n,r){return Fe(e,t,n,r.formattingOptions,r.getInsertionIndex)}function ii(e,t){for(var n=t.length-1;n>=0;n--)e=Ne(e,t[n]);return e}function Ve(e,t){if(e===t)return!0;if(e==null||t===null||t===void 0)return!1;if(typeof e!==typeof t)return!1;if(typeof e!="object")return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!Ve(e[n],t[n]))return!1}else{var i=[];for(r in e)i.push(r);i.sort();var a=[];for(r in t)a.push(r);if(a.sort(),!Ve(i,a))return!1;for(n=0;n<i.length;n++)if(!Ve(e[i[n]],t[i[n]]))return!1}return!0}function ne(e){return typeof e=="number"}function de(e){return typeof e!="undefined"}function ce(e){return typeof e=="boolean"}function $r(e){return typeof e=="string"}var se;(function(e){function t(r,i){return{line:r,character:i}}e.create=t;function n(r){var i=r;return g.objectLiteral(i)&&g.number(i.line)&&g.number(i.character)}e.is=n})(se||(se={}));var q;(function(e){function t(r,i,a,c){if(g.number(r)&&g.number(i)&&g.number(a)&&g.number(c))return{start:se.create(r,i),end:se.create(a,c)};if(se.is(r)&&se.is(i))return{start:r,end:i};throw new Error("Range#create called with invalid arguments["+r+", "+i+", "+a+", "+c+"]")}e.create=t;function n(r){var i=r;return g.objectLiteral(i)&&se.is(i.start)&&se.is(i.end)}e.is=n})(q||(q={}));var Ue;(function(e){function t(r,i){return{uri:r,range:i}}e.create=t;function n(r){var i=r;return g.defined(i)&&q.is(i.range)&&(g.string(i.uri)||g.undefined(i.uri))}e.is=n})(Ue||(Ue={}));var Rt;(function(e){function t(r,i,a,c){return{targetUri:r,targetRange:i,targetSelectionRange:a,originSelectionRange:c}}e.create=t;function n(r){var i=r;return g.defined(i)&&q.is(i.targetRange)&&g.string(i.targetUri)&&(q.is(i.targetSelectionRange)||g.undefined(i.targetSelectionRange))&&(q.is(i.originSelectionRange)||g.undefined(i.originSelectionRange))}e.is=n})(Rt||(Rt={}));var bt;(function(e){function t(r,i,a,c){return{red:r,green:i,blue:a,alpha:c}}e.create=t;function n(r){var i=r;return g.number(i.red)&&g.number(i.green)&&g.number(i.blue)&&g.number(i.alpha)}e.is=n})(bt||(bt={}));var Bt;(function(e){function t(r,i){return{range:r,color:i}}e.create=t;function n(r){var i=r;return q.is(i.range)&&bt.is(i.color)}e.is=n})(Bt||(Bt={}));var $t;(function(e){function t(r,i,a){return{label:r,textEdit:i,additionalTextEdits:a}}e.create=t;function n(r){var i=r;return g.string(i.label)&&(g.undefined(i.textEdit)||le.is(i))&&(g.undefined(i.additionalTextEdits)||g.typedArray(i.additionalTextEdits,le.is))}e.is=n})($t||($t={}));var ye;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(ye||(ye={}));var Wt;(function(e){function t(r,i,a,c,u){var l={startLine:r,endLine:i};return g.defined(a)&&(l.startCharacter=a),g.defined(c)&&(l.endCharacter=c),g.defined(u)&&(l.kind=u),l}e.create=t;function n(r){var i=r;return g.number(i.startLine)&&g.number(i.startLine)&&(g.undefined(i.startCharacter)||g.number(i.startCharacter))&&(g.undefined(i.endCharacter)||g.number(i.endCharacter))&&(g.undefined(i.kind)||g.string(i.kind))}e.is=n})(Wt||(Wt={}));var kt;(function(e){function t(r,i){return{location:r,message:i}}e.create=t;function n(r){var i=r;return g.defined(i)&&Ue.is(i.location)&&g.string(i.message)}e.is=n})(kt||(kt={}));var V;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(V||(V={}));var Jt;(function(e){e.Unnecessary=1,e.Deprecated=2})(Jt||(Jt={}));var pe;(function(e){function t(r,i,a,c,u,l){var s={range:r,message:i};return g.defined(a)&&(s.severity=a),g.defined(c)&&(s.code=c),g.defined(u)&&(s.source=u),g.defined(l)&&(s.relatedInformation=l),s}e.create=t;function n(r){var i=r;return g.defined(i)&&q.is(i.range)&&g.string(i.message)&&(g.number(i.severity)||g.undefined(i.severity))&&(g.number(i.code)||g.string(i.code)||g.undefined(i.code))&&(g.string(i.source)||g.undefined(i.source))&&(g.undefined(i.relatedInformation)||g.typedArray(i.relatedInformation,kt.is))}e.is=n})(pe||(pe={}));var Re;(function(e){function t(r,i){for(var a=[],c=2;c<arguments.length;c++)a[c-2]=arguments[c];var u={title:r,command:i};return g.defined(a)&&a.length>0&&(u.arguments=a),u}e.create=t;function n(r){var i=r;return g.defined(i)&&g.string(i.title)&&g.string(i.command)}e.is=n})(Re||(Re={}));var le;(function(e){function t(a,c){return{range:a,newText:c}}e.replace=t;function n(a,c){return{range:{start:a,end:a},newText:c}}e.insert=n;function r(a){return{range:a,newText:""}}e.del=r;function i(a){var c=a;return g.objectLiteral(c)&&g.string(c.newText)&&q.is(c.range)}e.is=i})(le||(le={}));var et;(function(e){function t(r,i){return{textDocument:r,edits:i}}e.create=t;function n(r){var i=r;return g.defined(i)&&at.is(i.textDocument)&&Array.isArray(i.edits)}e.is=n})(et||(et={}));var tt;(function(e){function t(r,i){var a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),a}e.create=t;function n(r){var i=r;return i&&i.kind==="create"&&g.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||g.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||g.boolean(i.options.ignoreIfExists)))}e.is=n})(tt||(tt={}));var rt;(function(e){function t(r,i,a){var c={kind:"rename",oldUri:r,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(c.options=a),c}e.create=t;function n(r){var i=r;return i&&i.kind==="rename"&&g.string(i.oldUri)&&g.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||g.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||g.boolean(i.options.ignoreIfExists)))}e.is=n})(rt||(rt={}));var nt;(function(e){function t(r,i){var a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),a}e.create=t;function n(r){var i=r;return i&&i.kind==="delete"&&g.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||g.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||g.boolean(i.options.ignoreIfNotExists)))}e.is=n})(nt||(nt={}));var Ct;(function(e){function t(n){var r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(function(i){return g.string(i.kind)?tt.is(i)||rt.is(i)||nt.is(i):et.is(i)}))}e.is=t})(Ct||(Ct={}));var it=function(){function e(t){this.edits=t}return e.prototype.insert=function(t,n){this.edits.push(le.insert(t,n))},e.prototype.replace=function(t,n){this.edits.push(le.replace(t,n))},e.prototype.delete=function(t){this.edits.push(le.del(t))},e.prototype.add=function(t){this.edits.push(t)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),ai=function(){function e(t){var n=this;this._textEditChanges=Object.create(null),t&&(this._workspaceEdit=t,t.documentChanges?t.documentChanges.forEach(function(r){if(et.is(r)){var i=new it(r.edits);n._textEditChanges[r.textDocument.uri]=i}}):t.changes&&Object.keys(t.changes).forEach(function(r){var i=new it(t.changes[r]);n._textEditChanges[r]=i}))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(t){if(at.is(t)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var n=t,r=this._textEditChanges[n.uri];if(!r){var i=[],a={textDocument:n,edits:i};this._workspaceEdit.documentChanges.push(a),r=new it(i),this._textEditChanges[n.uri]=r}return r}else{if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r=this._textEditChanges[t];if(!r){var i=[];this._workspaceEdit.changes[t]=i,r=new it(i),this._textEditChanges[t]=r}return r}},e.prototype.createFile=function(t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(tt.create(t,n))},e.prototype.renameFile=function(t,n,r){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(rt.create(t,n,r))},e.prototype.deleteFile=function(t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(nt.create(t,n))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")},e}(),qt;(function(e){function t(r){return{uri:r}}e.create=t;function n(r){var i=r;return g.defined(i)&&g.string(i.uri)}e.is=n})(qt||(qt={}));var at;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){var i=r;return g.defined(i)&&g.string(i.uri)&&(i.version===null||g.number(i.version))}e.is=n})(at||(at={}));var Ht;(function(e){function t(r,i,a,c){return{uri:r,languageId:i,version:a,text:c}}e.create=t;function n(r){var i=r;return g.defined(i)&&g.string(i.uri)&&g.string(i.languageId)&&g.number(i.version)&&g.string(i.text)}e.is=n})(Ht||(Ht={}));var me;(function(e){e.PlainText="plaintext",e.Markdown="markdown"})(me||(me={})),function(e){function t(n){var r=n;return r===e.PlainText||r===e.Markdown}e.is=t}(me||(me={}));var Tt;(function(e){function t(n){var r=n;return g.objectLiteral(n)&&me.is(r.kind)&&g.string(r.value)}e.is=t})(Tt||(Tt={}));var _;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(_||(_={}));var Z;(function(e){e.PlainText=1,e.Snippet=2})(Z||(Z={}));var zt;(function(e){e.Deprecated=1})(zt||(zt={}));var wt;(function(e){function t(n){return{label:n}}e.create=t})(wt||(wt={}));var Kt;(function(e){function t(n,r){return{items:n||[],isIncomplete:!!r}}e.create=t})(Kt||(Kt={}));var ot;(function(e){function t(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(r){var i=r;return g.string(i)||g.objectLiteral(i)&&g.string(i.language)&&g.string(i.value)}e.is=n})(ot||(ot={}));var Gt;(function(e){function t(n){var r=n;return!!r&&g.objectLiteral(r)&&(Tt.is(r.contents)||ot.is(r.contents)||g.typedArray(r.contents,ot.is))&&(n.range===void 0||q.is(n.range))}e.is=t})(Gt||(Gt={}));var Qt;(function(e){function t(n,r){return r?{label:n,documentation:r}:{label:n}}e.create=t})(Qt||(Qt={}));var Zt;(function(e){function t(n,r){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var c={label:n};return g.defined(r)&&(c.documentation=r),g.defined(i)?c.parameters=i:c.parameters=[],c}e.create=t})(Zt||(Zt={}));var Xt;(function(e){e.Text=1,e.Read=2,e.Write=3})(Xt||(Xt={}));var Yt;(function(e){function t(n,r){var i={range:n};return g.number(r)&&(i.kind=r),i}e.create=t})(Yt||(Yt={}));var J;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(J||(J={}));var er;(function(e){e.Deprecated=1})(er||(er={}));var tr;(function(e){function t(n,r,i,a,c){var u={name:n,kind:r,location:{uri:a,range:i}};return c&&(u.containerName=c),u}e.create=t})(tr||(tr={}));var rr;(function(e){function t(r,i,a,c,u,l){var s={name:r,detail:i,kind:a,range:c,selectionRange:u};return l!==void 0&&(s.children=l),s}e.create=t;function n(r){var i=r;return i&&g.string(i.name)&&g.number(i.kind)&&q.is(i.range)&&q.is(i.selectionRange)&&(i.detail===void 0||g.string(i.detail))&&(i.deprecated===void 0||g.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))}e.is=n})(rr||(rr={}));var nr;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(nr||(nr={}));var ir;(function(e){function t(r,i){var a={diagnostics:r};return i!=null&&(a.only=i),a}e.create=t;function n(r){var i=r;return g.defined(i)&&g.typedArray(i.diagnostics,pe.is)&&(i.only===void 0||g.typedArray(i.only,g.string))}e.is=n})(ir||(ir={}));var ar;(function(e){function t(r,i,a){var c={title:r};return Re.is(i)?c.command=i:c.edit=i,a!==void 0&&(c.kind=a),c}e.create=t;function n(r){var i=r;return i&&g.string(i.title)&&(i.diagnostics===void 0||g.typedArray(i.diagnostics,pe.is))&&(i.kind===void 0||g.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Re.is(i.command))&&(i.isPreferred===void 0||g.boolean(i.isPreferred))&&(i.edit===void 0||Ct.is(i.edit))}e.is=n})(ar||(ar={}));var or;(function(e){function t(r,i){var a={range:r};return g.defined(i)&&(a.data=i),a}e.create=t;function n(r){var i=r;return g.defined(i)&&q.is(i.range)&&(g.undefined(i.command)||Re.is(i.command))}e.is=n})(or||(or={}));var sr;(function(e){function t(r,i){return{tabSize:r,insertSpaces:i}}e.create=t;function n(r){var i=r;return g.defined(i)&&g.number(i.tabSize)&&g.boolean(i.insertSpaces)}e.is=n})(sr||(sr={}));var cr;(function(e){function t(r,i,a){return{range:r,target:i,data:a}}e.create=t;function n(r){var i=r;return g.defined(i)&&q.is(i.range)&&(g.undefined(i.target)||g.string(i.target))}e.is=n})(cr||(cr={}));var st;(function(e){function t(r,i){return{range:r,parent:i}}e.create=t;function n(r){var i=r;return i!==void 0&&q.is(i.range)&&(i.parent===void 0||e.is(i.parent))}e.is=n})(st||(st={}));var oi=[`
|
|
`,`\r
|
|
`,"\r"],lr;(function(e){function t(a,c,u,l){return new Wr(a,c,u,l)}e.create=t;function n(a){var c=a;return!!(g.defined(c)&&g.string(c.uri)&&(g.undefined(c.languageId)||g.string(c.languageId))&&g.number(c.lineCount)&&g.func(c.getText)&&g.func(c.positionAt)&&g.func(c.offsetAt))}e.is=n;function r(a,c){for(var u=a.getText(),l=i(c,function(v,m){var T=v.range.start.line-m.range.start.line;return T===0?v.range.start.character-m.range.start.character:T}),s=u.length,o=l.length-1;o>=0;o--){var f=l[o],h=a.offsetAt(f.range.start),d=a.offsetAt(f.range.end);if(d<=s)u=u.substring(0,h)+f.newText+u.substring(d,u.length);else throw new Error("Overlapping edit");s=h}return u}e.applyEdits=r;function i(a,c){if(a.length<=1)return a;var u=a.length/2|0,l=a.slice(0,u),s=a.slice(u);i(l,c),i(s,c);for(var o=0,f=0,h=0;o<l.length&&f<s.length;){var d=c(l[o],s[f]);d<=0?a[h++]=l[o++]:a[h++]=s[f++]}for(;o<l.length;)a[h++]=l[o++];for(;f<s.length;)a[h++]=s[f++];return a}})(lr||(lr={}));var Wr=function(){function e(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(t){if(t){var n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content},e.prototype.update=function(t,n){this._content=t.text,this._version=n,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var t=[],n=this._content,r=!0,i=0;i<n.length;i++){r&&(t.push(i),r=!1);var a=n.charAt(i);r=a==="\r"||a===`
|
|
`,a==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
`&&i++}r&&n.length>0&&t.push(n.length),this._lineOffsets=t}return this._lineOffsets},e.prototype.positionAt=function(t){t=Math.max(Math.min(t,this._content.length),0);var n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return se.create(0,t);for(;r<i;){var a=Math.floor((r+i)/2);n[a]>t?i=a:r=a+1}var c=r-1;return se.create(c,t-n[c])},e.prototype.offsetAt=function(t){var n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;var r=n[t.line],i=t.line+1<n.length?n[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,i),r)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}(),g;(function(e){var t=Object.prototype.toString;function n(o){return typeof o!="undefined"}e.defined=n;function r(o){return typeof o=="undefined"}e.undefined=r;function i(o){return o===!0||o===!1}e.boolean=i;function a(o){return t.call(o)==="[object String]"}e.string=a;function c(o){return t.call(o)==="[object Number]"}e.number=c;function u(o){return t.call(o)==="[object Function]"}e.func=u;function l(o){return o!==null&&typeof o=="object"}e.objectLiteral=l;function s(o,f){return Array.isArray(o)&&o.every(f)}e.typedArray=s})(g||(g={}));var ur=function(){function e(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(t){if(t){var n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content},e.prototype.update=function(t,n){for(var r=0,i=t;r<i.length;r++){var a=i[r];if(e.isIncremental(a)){var c=dr(a.range),u=this.offsetAt(c.start),l=this.offsetAt(c.end);this._content=this._content.substring(0,u)+a.text+this._content.substring(l,this._content.length);var s=Math.max(c.start.line,0),o=Math.max(c.end.line,0),f=this._lineOffsets,h=hr(a.text,!1,u);if(o-s===h.length)for(var d=0,v=h.length;d<v;d++)f[d+s+1]=h[d];else h.length<1e4?f.splice.apply(f,[s+1,o-s].concat(h)):this._lineOffsets=f=f.slice(0,s+1).concat(h,f.slice(o+1));var m=a.text.length-(l-u);if(m!==0)for(var d=s+1+h.length,v=f.length;d<v;d++)f[d]=f[d]+m}else if(e.isFull(a))this._content=a.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=n},e.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=hr(this._content,!0)),this._lineOffsets},e.prototype.positionAt=function(t){t=Math.max(Math.min(t,this._content.length),0);var n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:t};for(;r<i;){var a=Math.floor((r+i)/2);n[a]>t?i=a:r=a+1}var c=r-1;return{line:c,character:t-n[c]}},e.prototype.offsetAt=function(t){var n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;var r=n[t.line],i=t.line+1<n.length?n[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,i),r)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e.isIncremental=function(t){var n=t;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")},e.isFull=function(t){var n=t;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0},e}(),fr;(function(e){function t(i,a,c,u){return new ur(i,a,c,u)}e.create=t;function n(i,a,c){if(i instanceof ur)return i.update(a,c),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=n;function r(i,a){for(var c=i.getText(),u=St(a.map(Jr),function(d,v){var m=d.range.start.line-v.range.start.line;return m===0?d.range.start.character-v.range.start.character:m}),l=c.length,s=u.length-1;s>=0;s--){var o=u[s],f=i.offsetAt(o.range.start),h=i.offsetAt(o.range.end);if(h<=l)c=c.substring(0,f)+o.newText+c.substring(h,c.length);else throw new Error("Overlapping edit");l=f}return c}e.applyEdits=r})(fr||(fr={}));function St(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);St(r,t),St(i,t);for(var a=0,c=0,u=0;a<r.length&&c<i.length;){var l=t(r[a],i[c]);l<=0?e[u++]=r[a++]:e[u++]=i[c++]}for(;a<r.length;)e[u++]=r[a++];for(;c<i.length;)e[u++]=i[c++];return e}function hr(e,t,n){n===void 0&&(n=0);for(var r=t?[n]:[],i=0;i<e.length;i++){var a=e.charCodeAt(i);(a===13||a===10)&&(a===13&&i+1<e.length&&e.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function dr(e){var t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function Jr(e){var t=dr(e.range);return t!==e.range?{newText:e.newText,range:t}:e}var B;(function(e){e[e.Undefined=0]="Undefined",e[e.EnumValueMismatch=1]="EnumValueMismatch",e[e.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=258]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",e[e.InvalidUnicode=260]="InvalidUnicode",e[e.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",e[e.InvalidCharacter=262]="InvalidCharacter",e[e.PropertyExpected=513]="PropertyExpected",e[e.CommaExpected=514]="CommaExpected",e[e.ColonExpected=515]="ColonExpected",e[e.ValueExpected=516]="ValueExpected",e[e.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",e[e.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",e[e.TrailingComma=519]="TrailingComma",e[e.DuplicateKey=520]="DuplicateKey",e[e.CommentNotPermitted=521]="CommentNotPermitted",e[e.SchemaResolveError=768]="SchemaResolveError"})(B||(B={}));var pr;(function(e){e.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[me.Markdown,me.PlainText],commitCharactersSupport:!0}}}}})(pr||(pr={}));function qr(e,t){var n;return t.length===0?n=e:n=e.replace(/\{(\d+)\}/g,function(r,i){var a=i[0];return typeof t[a]!="undefined"?t[a]:r}),n}function Hr(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return qr(t,n)}function Le(e){return Hr}function si(e){return Le}var Oe=function(){var e=function(n,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var c in a)a.hasOwnProperty(c)&&(i[c]=a[c])},e(n,r)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=Le(),zr={"color-hex":{errorMessage:M("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:M("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:M("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:M("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:M("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,}))$/}},Ie=function(){function e(t,n,r){this.offset=n,this.length=r,this.parent=t}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},e}(),Kr=function(e){Oe(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.type="null",i.value=null,i}return t}(Ie),mr=function(e){Oe(t,e);function t(n,r,i){var a=e.call(this,n,i)||this;return a.type="boolean",a.value=r,a}return t}(Ie),Gr=function(e){Oe(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.type="array",i.items=[],i}return Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0}),t}(Ie),Qr=function(e){Oe(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.type="number",i.isInteger=!0,i.value=Number.NaN,i}return t}(Ie),gr=function(e){Oe(t,e);function t(n,r,i){var a=e.call(this,n,r,i)||this;return a.type="string",a.value="",a}return t}(Ie),Zr=function(e){Oe(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.type="property",i.colonOffset=-1,i}return Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0}),t}(Ie),Xr=function(e){Oe(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.type="object",i.properties=[],i}return Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0}),t}(Ie);function Y(e){return ce(e)?e?{}:{not:{}}:e}var vr;(function(e){e[e.Key=0]="Key",e[e.Enum=1]="Enum"})(vr||(vr={}));var Yr=function(){function e(t,n){t===void 0&&(t=-1),n===void 0&&(n=null),this.focusOffset=t,this.exclude=n,this.schemas=[]}return e.prototype.add=function(t){this.schemas.push(t)},e.prototype.merge=function(t){var n;(n=this.schemas).push.apply(n,t.schemas)},e.prototype.include=function(t){return(this.focusOffset===-1||yr(t,this.focusOffset))&&t!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),xt=function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.add=function(t){},e.prototype.merge=function(t){},e.prototype.include=function(t){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e}(),ee=function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(t){for(var n=0,r=t;n<r.length;n++){var i=r[n];this.merge(i)}},e.prototype.merge=function(t){this.problems=this.problems.concat(t.problems)},e.prototype.mergeEnumValues=function(t){if(!this.enumValueMatch&&!t.enumValueMatch&&this.enumValues&&t.enumValues){this.enumValues=this.enumValues.concat(t.enumValues);for(var n=0,r=this.problems;n<r.length;n++){var i=r[n];i.code===B.EnumValueMismatch&&(i.message=M("enumWarning","Value is not accepted. Valid values: {0}.",this.enumValues.map(function(a){return JSON.stringify(a)}).join(", ")))}}},e.prototype.mergePropertyMatch=function(t){this.merge(t),this.propertiesMatches++,(t.enumValueMatch||!t.hasProblems()&&t.propertiesMatches)&&this.propertiesValueMatches++,t.enumValueMatch&&t.enumValues&&t.enumValues.length===1&&this.primaryValueMatches++},e.prototype.compare=function(t){var n=this.hasProblems();return n!==t.hasProblems()?n?-1:1:this.enumValueMatch!==t.enumValueMatch?t.enumValueMatch?-1:1:this.primaryValueMatches!==t.primaryValueMatches?this.primaryValueMatches-t.primaryValueMatches:this.propertiesValueMatches!==t.propertiesValueMatches?this.propertiesValueMatches-t.propertiesValueMatches:this.propertiesMatches-t.propertiesMatches},e}();function en(e,t){return t===void 0&&(t=[]),new br(e,t,[])}function be(e){return Xe(e)}function Et(e){return R(e)}function yr(e,t,n){return n===void 0&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}var br=function(){function e(t,n,r){n===void 0&&(n=[]),r===void 0&&(r=[]),this.root=t,this.syntaxErrors=n,this.comments=r}return e.prototype.getNodeFromOffset=function(t,n){return n===void 0&&(n=!1),this.root?U(this.root,t,n):void 0},e.prototype.visit=function(t){if(this.root){var n=function r(i){var a=t(i),c=i.children;if(Array.isArray(c))for(var u=0;u<c.length&&a;u++)a=r(c[u]);return a};n(this.root)}},e.prototype.validate=function(t,n){if(this.root&&n){var r=new ee;return X(this.root,n,r,xt.instance),r.problems.map(function(i){var a=q.create(t.positionAt(i.location.offset),t.positionAt(i.location.offset+i.location.length));return pe.create(a,i.message,i.severity,i.code)})}return null},e.prototype.getMatchingSchemas=function(t,n,r){n===void 0&&(n=-1),r===void 0&&(r=null);var i=new Yr(n,r);return this.root&&t&&X(this.root,t,new ee,i),i.schemas},e}();function X(e,t,n,r){if(!e||!r.include(e))return;switch(e.type){case"object":l(e,t,n,r);break;case"array":u(e,t,n,r);break;case"string":c(e,t,n,r);break;case"number":a(e,t,n,r);break;case"property":return X(e.valueNode,t,n,r)}i(),r.add({node:e,schema:t});function i(){function s(N){return e.type===N||N==="integer"&&e.type==="number"&&e.isInteger}if(Array.isArray(t.type)?t.type.some(s)||n.problems.push({location:{offset:e.offset,length:e.length},severity:V.Warning,message:t.errorMessage||M("typeArrayMismatchWarning","Incorrect type. Expected one of {0}.",t.type.join(", "))}):t.type&&(s(t.type)||n.problems.push({location:{offset:e.offset,length:e.length},severity:V.Warning,message:t.errorMessage||M("typeMismatchWarning",'Incorrect type. Expected "{0}".',t.type)})),Array.isArray(t.allOf))for(var o=0,f=t.allOf;o<f.length;o++){var h=f[o];X(e,Y(h),n,r)}var d=Y(t.not);if(d){var v=new ee,m=r.newSub();X(e,d,v,m),v.hasProblems()||n.problems.push({location:{offset:e.offset,length:e.length},severity:V.Warning,message:M("notSchemaWarning","Matches a schema that is not allowed.")});for(var T=0,b=m.schemas;T<b.length;T++){var y=b[T];y.inverted=!y.inverted,r.add(y)}}var p=function(D,$){for(var G=[],K=null,te=0,ae=D;te<ae.length;te++){var ft=ae[te],we=Y(ft),oe=new ee,ge=r.newSub();if(X(e,we,oe,ge),oe.hasProblems()||G.push(we),!K)K={schema:we,validationResult:oe,matchingSchemas:ge};else if(!$&&!oe.hasProblems()&&!K.validationResult.hasProblems())K.matchingSchemas.merge(ge),K.validationResult.propertiesMatches+=oe.propertiesMatches,K.validationResult.propertiesValueMatches+=oe.propertiesValueMatches;else{var We=oe.compare(K.validationResult);We>0?K={schema:we,validationResult:oe,matchingSchemas:ge}:We===0&&(K.matchingSchemas.merge(ge),K.validationResult.mergeEnumValues(oe))}}return G.length>1&&$&&n.problems.push({location:{offset:e.offset,length:1},severity:V.Warning,message:M("oneOfWarning","Matches multiple schemas when only one must validate.")}),K!==null&&(n.merge(K.validationResult),n.propertiesMatches+=K.validationResult.propertiesMatches,n.propertiesValueMatches+=K.validationResult.propertiesValueMatches,r.merge(K.matchingSchemas)),G.length};Array.isArray(t.anyOf)&&p(t.anyOf,!1),Array.isArray(t.oneOf)&&p(t.oneOf,!0);var I=function(D){var $=new ee,G=r.newSub();X(e,Y(D),$,G),n.merge($),n.propertiesMatches+=$.propertiesMatches,n.propertiesValueMatches+=$.propertiesValueMatches,r.merge(G)},S=function(D,$,G){var K=Y(D),te=new ee,ae=r.newSub();X(e,K,te,ae),r.merge(ae),te.hasProblems()?G&&I(G):$&&I($)},A=Y(t.if);if(A&&S(A,Y(t.then),Y(t.else)),Array.isArray(t.enum)){for(var x=be(e),O=!1,E=0,L=t.enum;E<L.length;E++){var w=L[E];if(Ve(x,w)){O=!0;break}}n.enumValues=t.enum,n.enumValueMatch=O,O||n.problems.push({location:{offset:e.offset,length:e.length},severity:V.Warning,code:B.EnumValueMismatch,message:t.errorMessage||M("enumWarning","Value is not accepted. Valid values: {0}.",t.enum.map(function(N){return JSON.stringify(N)}).join(", "))})}if(de(t.const)){var x=be(e);Ve(x,t.const)?n.enumValueMatch=!0:(n.problems.push({location:{offset:e.offset,length:e.length},severity:V.Warning,code:B.EnumValueMismatch,message:t.errorMessage||M("constWarning","Value must be {0}.",JSON.stringify(t.const))}),n.enumValueMatch=!1),n.enumValues=[t.const]}t.deprecationMessage&&e.parent&&n.problems.push({location:{offset:e.parent.offset,length:e.parent.length},severity:V.Warning,message:t.deprecationMessage})}function a(s,o,f,h){var d=s.value;ne(o.multipleOf)&&(d%o.multipleOf!==0&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("multipleOfWarning","Value is not divisible by {0}.",o.multipleOf)}));function v(I,S){return ne(S)?S:ce(S)&&S?I:void 0}function m(I,S){return!ce(S)||!S?I:void 0}var T=v(o.minimum,o.exclusiveMinimum);ne(T)&&d<=T&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("exclusiveMinimumWarning","Value is below the exclusive minimum of {0}.",T)});var b=v(o.maximum,o.exclusiveMaximum);ne(b)&&d>=b&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",b)});var y=m(o.minimum,o.exclusiveMinimum);ne(y)&&d<y&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("minimumWarning","Value is below the minimum of {0}.",y)});var p=m(o.maximum,o.exclusiveMaximum);ne(p)&&d>p&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("maximumWarning","Value is above the maximum of {0}.",p)})}function c(s,o,f,h){if(ne(o.minLength)&&s.value.length<o.minLength&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("minLengthWarning","String is shorter than the minimum length of {0}.",o.minLength)}),ne(o.maxLength)&&s.value.length>o.maxLength&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("maxLengthWarning","String is longer than the maximum length of {0}.",o.maxLength)}),$r(o.pattern)){var d=new RegExp(o.pattern);d.test(s.value)||f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:o.patternErrorMessage||o.errorMessage||M("patternWarning",'String does not match the pattern of "{0}".',o.pattern)})}if(o.format)switch(o.format){case"uri":case"uri-reference":{var v=void 0;if(!s.value)v=M("uriEmpty","URI expected.");else{var m=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(s.value);m?!m[2]&&o.format==="uri"&&(v=M("uriSchemeMissing","URI with a scheme is expected.")):v=M("uriMissing","URI is expected.")}v&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:o.patternErrorMessage||o.errorMessage||M("uriFormatWarning","String is not a URI: {0}",v)})}break;case"color-hex":case"date-time":case"date":case"time":case"email":var T=zr[o.format];(!s.value||!T.pattern.exec(s.value))&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:o.patternErrorMessage||o.errorMessage||T.errorMessage});default:}}function u(s,o,f,h){if(Array.isArray(o.items)){for(var d=o.items,v=0;v<d.length;v++){var m=d[v],T=Y(m),b=new ee,y=s.items[v];y?(X(y,T,b,h),f.mergePropertyMatch(b)):s.items.length>=d.length&&f.propertiesValueMatches++}if(s.items.length>d.length)if(typeof o.additionalItems=="object")for(var p=d.length;p<s.items.length;p++){var b=new ee;X(s.items[p],o.additionalItems,b,h),f.mergePropertyMatch(b)}else o.additionalItems===!1&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("additionalItemsWarning","Array has too many items according to schema. Expected {0} or fewer.",d.length)})}else{var I=Y(o.items);if(I)for(var S=0,A=s.items;S<A.length;S++){var y=A[S],b=new ee;X(y,I,b,h),f.mergePropertyMatch(b)}}var x=Y(o.contains);if(x){var O=s.items.some(function(w){var N=new ee;return X(w,x,N,xt.instance),!N.hasProblems()});O||f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:o.errorMessage||M("requiredItemMissingWarning","Array does not contain required item.")})}if(ne(o.minItems)&&s.items.length<o.minItems&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("minItemsWarning","Array has too few items. Expected {0} or more.",o.minItems)}),ne(o.maxItems)&&s.items.length>o.maxItems&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("maxItemsWarning","Array has too many items. Expected {0} or fewer.",o.maxItems)}),o.uniqueItems===!0){var E=be(s),L=E.some(function(w,N){return N!==E.lastIndexOf(w)});L&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("uniqueItemsWarning","Array has duplicate items.")})}}function l(s,o,f,h){for(var d=Object.create(null),v=[],m=0,T=s.properties;m<T.length;m++){var b=T[m],y=b.keyNode.value;d[y]=b.valueNode,v.push(y)}if(Array.isArray(o.required))for(var p=0,I=o.required;p<I.length;p++){var S=I[p];if(!d[S]){var A=s.parent&&s.parent.type==="property"&&s.parent.keyNode,x=A?{offset:A.offset,length:A.length}:{offset:s.offset,length:1};f.problems.push({location:x,severity:V.Warning,message:M("MissingRequiredPropWarning",'Missing property "{0}".',S)})}}var O=function(Rr){for(var Ut=v.indexOf(Rr);Ut>=0;)v.splice(Ut,1),Ut=v.indexOf(Rr)};if(o.properties)for(var E=0,L=Object.keys(o.properties);E<L.length;E++){var S=L[E];O(S);var w=o.properties[S],N=d[S];if(N)if(ce(w))if(w)f.propertiesMatches++,f.propertiesValueMatches++;else{var b=N.parent;f.problems.push({location:{offset:b.keyNode.offset,length:b.keyNode.length},severity:V.Warning,message:o.errorMessage||M("DisallowedExtraPropWarning","Property {0} is not allowed.",S)})}else{var D=new ee;X(N,w,D,h),f.mergePropertyMatch(D)}}if(o.patternProperties)for(var $=0,G=Object.keys(o.patternProperties);$<G.length;$++)for(var K=G[$],te=new RegExp(K),ae=0,ft=v.slice(0);ae<ft.length;ae++){var S=ft[ae];if(te.test(S)){O(S);var N=d[S];if(N){var w=o.patternProperties[K];if(ce(w))if(w)f.propertiesMatches++,f.propertiesValueMatches++;else{var b=N.parent;f.problems.push({location:{offset:b.keyNode.offset,length:b.keyNode.length},severity:V.Warning,message:o.errorMessage||M("DisallowedExtraPropWarning","Property {0} is not allowed.",S)})}else{var D=new ee;X(N,w,D,h),f.mergePropertyMatch(D)}}}}if(typeof o.additionalProperties=="object")for(var we=0,oe=v;we<oe.length;we++){var S=oe[we],N=d[S];if(N){var D=new ee;X(N,o.additionalProperties,D,h),f.mergePropertyMatch(D)}}else if(o.additionalProperties===!1&&v.length>0)for(var ge=0,We=v;ge<We.length;ge++){var S=We[ge],N=d[S];if(N){var b=N.parent;f.problems.push({location:{offset:b.keyNode.offset,length:b.keyNode.length},severity:V.Warning,message:o.errorMessage||M("DisallowedExtraPropWarning","Property {0} is not allowed.",S)})}}if(ne(o.maxProperties)&&(s.properties.length>o.maxProperties&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("MaxPropWarning","Object has more properties than limit of {0}.",o.maxProperties)})),ne(o.minProperties)&&(s.properties.length<o.minProperties&&f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("MinPropWarning","Object has fewer properties than the required number of {0}",o.minProperties)})),o.dependencies)for(var _t=0,_r=Object.keys(o.dependencies);_t<_r.length;_t++){var y=_r[_t],ti=d[y];if(ti){var Ft=o.dependencies[y];if(Array.isArray(Ft))for(var Dt=0,Fr=Ft;Dt<Fr.length;Dt++){var Dr=Fr[Dt];d[Dr]?f.propertiesValueMatches++:f.problems.push({location:{offset:s.offset,length:s.length},severity:V.Warning,message:M("RequiredDependentPropWarning","Object is missing property {0} required by property {1}.",Dr,y)})}else{var w=Y(Ft);if(w){var D=new ee;X(s,w,D,h),f.mergePropertyMatch(D)}}}}var Vr=Y(o.propertyNames);if(Vr)for(var Vt=0,Ur=s.properties;Vt<Ur.length;Vt++){var ri=Ur[Vt],y=ri.keyNode;y&&X(y,Vr,f,xt.instance)}}}function tn(e,t){var n=[],r=-1,i=e.getText(),a=C(i,!1),c=t&&t.collectComments?[]:void 0;function u(){for(;;){var A=a.scan();f();switch(A){case 12:case 13:Array.isArray(c)&&c.push(q.create(e.positionAt(a.getTokenOffset()),e.positionAt(a.getTokenOffset()+a.getTokenLength())));break;case 15:case 14:break;default:return A}}}function l(A){return a.getToken()===A?(u(),!0):!1}function s(A,x,O,E,L){if(L===void 0&&(L=V.Error),n.length===0||O!==r){var w=q.create(e.positionAt(O),e.positionAt(E));n.push(pe.create(w,A,L,x,e.languageId)),r=O}}function o(A,x,O,E,L){O===void 0&&(O=null),E===void 0&&(E=[]),L===void 0&&(L=[]);var w=a.getTokenOffset(),N=a.getTokenOffset()+a.getTokenLength();if(w===N&&w>0){for(w--;w>0&&/\s/.test(i.charAt(w));)w--;N=w+1}if(s(A,x,w,N),O&&h(O,!1),E.length+L.length>0)for(var D=a.getToken();D!==17;){if(E.indexOf(D)!==-1){u();break}else if(L.indexOf(D)!==-1)break;D=u()}return O}function f(){switch(a.getTokenError()){case 4:return o(M("InvalidUnicode","Invalid unicode sequence in string."),B.InvalidUnicode),!0;case 5:return o(M("InvalidEscapeCharacter","Invalid escape character in string."),B.InvalidEscapeCharacter),!0;case 3:return o(M("UnexpectedEndOfNumber","Unexpected end of number."),B.UnexpectedEndOfNumber),!0;case 1:return o(M("UnexpectedEndOfComment","Unexpected end of comment."),B.UnexpectedEndOfComment),!0;case 2:return o(M("UnexpectedEndOfString","Unexpected end of string."),B.UnexpectedEndOfString),!0;case 6:return o(M("InvalidCharacter","Invalid characters in string. Control characters must be escaped."),B.InvalidCharacter),!0}return!1}function h(A,x){return A.length=a.getTokenOffset()+a.getTokenLength()-A.offset,x&&u(),A}function d(A){if(a.getToken()!==3)return null;var x=new Gr(A,a.getTokenOffset());u();for(var O=0,E=!1;a.getToken()!==4&&a.getToken()!==17;){if(a.getToken()===5){E||o(M("ValueExpected","Value expected"),B.ValueExpected);var L=a.getTokenOffset();if(u(),a.getToken()===4){E&&s(M("TrailingComma","Trailing comma"),B.TrailingComma,L,L+1);continue}}else E&&o(M("ExpectedComma","Expected comma"),B.CommaExpected);var w=p(x,O++);w?x.items.push(w):o(M("PropertyExpected","Value expected"),B.ValueExpected,null,[],[4,5]),E=!0}return a.getToken()!==4?o(M("ExpectedCloseBracket","Expected comma or closing bracket"),B.CommaOrCloseBacketExpected,x):h(x,!0)}function v(A,x){var O=new Zr(A,a.getTokenOffset()),E=T(O);if(!E)if(a.getToken()===16){o(M("DoubleQuotesExpected","Property keys must be doublequoted"),B.Undefined);var L=new gr(O,a.getTokenOffset(),a.getTokenLength());L.value=a.getTokenValue(),E=L,u()}else return null;O.keyNode=E;var w=x[E.value];if(w?(s(M("DuplicateKeyWarning","Duplicate object key"),B.DuplicateKey,O.keyNode.offset,O.keyNode.offset+O.keyNode.length,V.Warning),typeof w=="object"&&s(M("DuplicateKeyWarning","Duplicate object key"),B.DuplicateKey,w.keyNode.offset,w.keyNode.offset+w.keyNode.length,V.Warning),x[E.value]=!0):x[E.value]=O,a.getToken()===6)O.colonOffset=a.getTokenOffset(),u();else if(o(M("ColonExpected","Colon expected"),B.ColonExpected),a.getToken()===10&&e.positionAt(E.offset+E.length).line<e.positionAt(a.getTokenOffset()).line)return O.length=E.length,O;var N=p(O,E.value);return N?(O.valueNode=N,O.length=N.offset+N.length-O.offset,O):o(M("ValueExpected","Value expected"),B.ValueExpected,O,[],[2,5])}function m(A){if(a.getToken()!==1)return null;var x=new Xr(A,a.getTokenOffset()),O=Object.create(null);u();for(var E=!1;a.getToken()!==2&&a.getToken()!==17;){if(a.getToken()===5){E||o(M("PropertyExpected","Property expected"),B.PropertyExpected);var L=a.getTokenOffset();if(u(),a.getToken()===2){E&&s(M("TrailingComma","Trailing comma"),B.TrailingComma,L,L+1);continue}}else E&&o(M("ExpectedComma","Expected comma"),B.CommaExpected);var w=v(x,O);w?x.properties.push(w):o(M("PropertyExpected","Property expected"),B.PropertyExpected,null,[],[2,5]),E=!0}return a.getToken()!==2?o(M("ExpectedCloseBrace","Expected comma or closing brace"),B.CommaOrCloseBraceExpected,x):h(x,!0)}function T(A){if(a.getToken()!==10)return null;var x=new gr(A,a.getTokenOffset());return x.value=a.getTokenValue(),h(x,!0)}function b(A){if(a.getToken()!==11)return null;var x=new Qr(A,a.getTokenOffset());if(a.getTokenError()===0){var O=a.getTokenValue();try{var E=JSON.parse(O);if(!ne(E))return o(M("InvalidNumberFormat","Invalid number format."),B.Undefined,x);x.value=E}catch(L){return o(M("InvalidNumberFormat","Invalid number format."),B.Undefined,x)}x.isInteger=O.indexOf(".")===-1}return h(x,!0)}function y(A){var x;switch(a.getToken()){case 7:return h(new Kr(A,a.getTokenOffset()),!0);case 8:return h(new mr(A,!0,a.getTokenOffset()),!0);case 9:return h(new mr(A,!1,a.getTokenOffset()),!0);default:return null}}function p(A,x){return d(A)||m(A)||T(A)||b(A)||y(A)}var I=null,S=u();return S!==17&&(I=p(null,null),I?a.getToken()!==17&&o(M("End of file expected","End of file expected."),B.Undefined):o(M("Invalid symbol","Expected a JSON object, array or literal."),B.Undefined)),new br(I,n,c)}function At(e,t,n){if(e!==null&&typeof e=="object"){var r=t+" ";if(Array.isArray(e)){if(e.length===0)return"[]";for(var i=`[
|
|
`,a=0;a<e.length;a++)i+=r+At(e[a],r,n),a<e.length-1&&(i+=","),i+=`
|
|
`;return i+=t+"]",i}else{var c=Object.keys(e);if(c.length===0)return"{}";for(var i=`{
|
|
`,a=0;a<c.length;a++){var u=c[a];i+=r+JSON.stringify(u)+": "+At(e[u],r,n),a<c.length-1&&(i+=","),i+=`
|
|
`}return i+=t+"}",i}}return n(e)}function rn(e,t){if(e.length<t.length)return!1;for(var n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function ct(e,t){var n=e.length-t.length;return n>0?e.lastIndexOf(t)===n:n===0?e===t:!1}function nn(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function ci(e,t){for(var n="";t>0;)(t&1)===1&&(n+=e),e+=e,t=t>>>1;return n}var Ot=Le(),an=[",","}","]"],on=[":"],sn=function(){function e(t,n,r,i){n===void 0&&(n=[]),r===void 0&&(r=Promise),i===void 0&&(i={}),this.schemaService=t,this.contributions=n,this.promiseConstructor=r,this.clientCapabilities=i,this.templateVarIdCounter=0}return e.prototype.doResolve=function(t){for(var n=this.contributions.length-1;n>=0;n--)if(this.contributions[n].resolveCompletion){var r=this.contributions[n].resolveCompletion(t);if(r)return r}return this.promiseConstructor.resolve(t)},e.prototype.doComplete=function(t,n,r){var i=this,a={items:[],isIncomplete:!1},c=t.getText(),u=t.offsetAt(n),l=r.getNodeFromOffset(u,!0);if(this.isInComment(t,l?l.offset:0,u))return Promise.resolve(a);if(l&&u===l.offset+l.length&&u>0){var s=c[u-1];(l.type==="object"&&s==="}"||l.type==="array"&&s==="]")&&(l=l.parent)}var o=this.getCurrentWord(t,u),f=null;if(l&&(l.type==="string"||l.type==="number"||l.type==="boolean"||l.type==="null"))f=q.create(t.positionAt(l.offset),t.positionAt(l.offset+l.length));else{var h=u-o.length;h>0&&c[h-1]==='"'&&h--,f=q.create(t.positionAt(h),n)}var d=!1,v={},m={add:function(b){var y=b.label,p=v[y];if(p)p.documentation||(p.documentation=b.documentation);else{if(y=y.replace(/[\n]/g,"\u21B5"),y.length>60){var I=y.substr(0,57).trim()+"...";v[I]||(y=I)}f&&(b.textEdit=le.replace(f,b.insertText)),d&&(b.commitCharacters=b.kind===_.Property?on:an),b.label=y,v[y]=b,a.items.push(b)}},setAsIncomplete:function(){a.isIncomplete=!0},error:function(b){console.error(b)},log:function(b){console.log(b)},getNumberOfProposals:function(){return a.items.length}};return this.schemaService.getSchemaForResource(t.uri,r).then(function(T){var b=[],y=!0,p="",I=null;if(l&&l.type==="string"){var S=l.parent;S&&S.type==="property"&&S.keyNode===l&&(y=!S.valueNode,I=S,p=c.substr(l.offset+1,l.length-2),S&&(l=S.parent))}if(l&&l.type==="object"){if(l.offset===u)return a;var A=l.properties;A.forEach(function(L){(!I||I!==L)&&(v[L.keyNode.value]=wt.create("__"))});var x="";y&&(x=i.evaluateSeparatorAfter(t,t.offsetAt(f.end))),T?i.getPropertyCompletions(T,r,l,y,x,m):i.getSchemaLessPropertyCompletions(r,l,p,m);var O=Et(l);i.contributions.forEach(function(L){var w=L.collectPropertyCompletions(t.uri,O,o,y,x==="",m);w&&b.push(w)}),!T&&o.length>0&&c.charAt(u-o.length-1)!=='"'&&(m.add({kind:_.Property,label:i.getLabelForValue(o),insertText:i.getInsertTextForProperty(o,null,!1,x),insertTextFormat:Z.Snippet,documentation:""}),m.setAsIncomplete())}var E={};return T?i.getValueCompletions(T,r,l,u,t,m,E):i.getSchemaLessValueCompletions(r,l,u,t,m),i.contributions.length>0&&i.getContributedValueCompletions(r,l,u,t,m,b),i.promiseConstructor.all(b).then(function(){if(m.getNumberOfProposals()===0){var L=u;l&&(l.type==="string"||l.type==="number"||l.type==="boolean"||l.type==="null")&&(L=l.offset+l.length);var w=i.evaluateSeparatorAfter(t,L);i.addFillerValueCompletions(E,w,m)}return a})})},e.prototype.getPropertyCompletions=function(t,n,r,i,a,c){var u=this,l=n.getMatchingSchemas(t.schema,r.offset);l.forEach(function(s){if(s.node===r&&!s.inverted){var o=s.schema.properties;o&&Object.keys(o).forEach(function(f){var h=o[f];if(typeof h=="object"&&!h.deprecationMessage&&!h.doNotSuggest){var d={kind:_.Property,label:f,insertText:u.getInsertTextForProperty(f,h,i,a),insertTextFormat:Z.Snippet,filterText:u.getFilterTextForValue(f),documentation:u.fromMarkup(h.markdownDescription)||h.description||""};ct(d.insertText,"$1"+a)&&(d.command={title:"Suggest",command:"editor.action.triggerSuggest"}),c.add(d)}})}})},e.prototype.getSchemaLessPropertyCompletions=function(t,n,r,i){var a=this,c=function(s){s.properties.forEach(function(o){var f=o.keyNode.value;i.add({kind:_.Property,label:f,insertText:a.getInsertTextForValue(f,""),insertTextFormat:Z.Snippet,filterText:a.getFilterTextForValue(f),documentation:""})})};if(n.parent)if(n.parent.type==="property"){var u=n.parent.keyNode.value;t.visit(function(l){return l.type==="property"&&l!==n.parent&&l.keyNode.value===u&&l.valueNode&&l.valueNode.type==="object"&&c(l.valueNode),!0})}else n.parent.type==="array"&&n.parent.items.forEach(function(l){l.type==="object"&&l!==n&&c(l)});else n.type==="object"&&i.add({kind:_.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:Z.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},e.prototype.getSchemaLessValueCompletions=function(t,n,r,i,a){var c=this,u=r;if(n&&(n.type==="string"||n.type==="number"||n.type==="boolean"||n.type==="null")&&(u=n.offset+n.length,n=n.parent),!n){a.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:Z.Snippet,documentation:""}),a.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:Z.Snippet,documentation:""});return}var l=this.evaluateSeparatorAfter(i,u),s=function(v){yr(v.parent,r,!0)||a.add({kind:c.getSuggestionKind(v.type),label:c.getLabelTextForMatchingNode(v,i),insertText:c.getInsertTextForMatchingNode(v,i,l),insertTextFormat:Z.Snippet,documentation:""}),v.type==="boolean"&&c.addBooleanValueCompletion(!v.value,l,a)};if(n.type==="property"&&r>n.colonOffset){var o=n.valueNode;if(o&&(r>o.offset+o.length||o.type==="object"||o.type==="array"))return;var f=n.keyNode.value;t.visit(function(d){return d.type==="property"&&d.keyNode.value===f&&d.valueNode&&s(d.valueNode),!0}),f==="$schema"&&n.parent&&!n.parent.parent&&this.addDollarSchemaCompletions(l,a)}if(n.type==="array")if(n.parent&&n.parent.type==="property"){var h=n.parent.keyNode.value;t.visit(function(d){return d.type==="property"&&d.keyNode.value===h&&d.valueNode&&d.valueNode.type==="array"&&d.valueNode.items.forEach(s),!0})}else n.items.forEach(s)},e.prototype.getValueCompletions=function(t,n,r,i,a,c,u){var l=this,s=i,o=null,f=null;if(r&&(r.type==="string"||r.type==="number"||r.type==="boolean"||r.type==="null")&&(s=r.offset+r.length,f=r,r=r.parent),!r){this.addSchemaValueCompletions(t.schema,"",c,u);return}if(r.type==="property"&&i>r.colonOffset){var h=r.valueNode;if(h&&i>h.offset+h.length)return;o=r.keyNode.value,r=r.parent}if(r&&(o!==null||r.type==="array")){var d=this.evaluateSeparatorAfter(a,s),v=n.getMatchingSchemas(t.schema,r.offset,f);v.forEach(function(m){if(m.node===r&&!m.inverted&&m.schema){if(r.type==="array"&&m.schema.items)if(Array.isArray(m.schema.items)){var T=l.findItemAtOffset(r,a,i);T<m.schema.items.length&&l.addSchemaValueCompletions(m.schema.items[T],d,c,u)}else l.addSchemaValueCompletions(m.schema.items,d,c,u);if(m.schema.properties){var b=m.schema.properties[o];b&&l.addSchemaValueCompletions(b,d,c,u)}}}),o==="$schema"&&!r.parent&&this.addDollarSchemaCompletions(d,c),u.boolean&&(this.addBooleanValueCompletion(!0,d,c),this.addBooleanValueCompletion(!1,d,c)),u.null&&this.addNullValueCompletion(d,c)}},e.prototype.getContributedValueCompletions=function(t,n,r,i,a,c){if(!n)this.contributions.forEach(function(o){var f=o.collectDefaultCompletions(i.uri,a);f&&c.push(f)});else if((n.type==="string"||n.type==="number"||n.type==="boolean"||n.type==="null")&&(n=n.parent),n.type==="property"&&r>n.colonOffset){var u=n.keyNode.value,l=n.valueNode;if(!l||r<=l.offset+l.length){var s=Et(n.parent);this.contributions.forEach(function(o){var f=o.collectValueCompletions(i.uri,s,u,a);f&&c.push(f)})}}},e.prototype.addSchemaValueCompletions=function(t,n,r,i){var a=this;typeof t=="object"&&(this.addEnumValueCompletions(t,n,r),this.addDefaultValueCompletions(t,n,r),this.collectTypes(t,i),Array.isArray(t.allOf)&&t.allOf.forEach(function(c){return a.addSchemaValueCompletions(c,n,r,i)}),Array.isArray(t.anyOf)&&t.anyOf.forEach(function(c){return a.addSchemaValueCompletions(c,n,r,i)}),Array.isArray(t.oneOf)&&t.oneOf.forEach(function(c){return a.addSchemaValueCompletions(c,n,r,i)}))},e.prototype.addDefaultValueCompletions=function(t,n,r,i){var a=this;i===void 0&&(i=0);var c=!1;if(de(t.default)){for(var u=t.type,l=t.default,s=i;s>0;s--)l=[l],u="array";r.add({kind:this.getSuggestionKind(u),label:this.getLabelForValue(l),insertText:this.getInsertTextForValue(l,n),insertTextFormat:Z.Snippet,detail:Ot("json.suggest.default","Default value")}),c=!0}Array.isArray(t.examples)&&t.examples.forEach(function(o){for(var f=t.type,h=o,d=i;d>0;d--)h=[h],f="array";r.add({kind:a.getSuggestionKind(f),label:a.getLabelForValue(h),insertText:a.getInsertTextForValue(h,n),insertTextFormat:Z.Snippet}),c=!0}),Array.isArray(t.defaultSnippets)&&t.defaultSnippets.forEach(function(o){var f=t.type,h=o.body,d=o.label,v,m;if(de(h)){for(var T=t.type,b=i;b>0;b--)h=[h],T="array";v=a.getInsertTextForSnippetValue(h,n),m=a.getFilterTextForSnippetValue(h),d=d||a.getLabelForSnippetValue(h)}else if(typeof o.bodyText=="string"){for(var y="",p="",I="",b=i;b>0;b--)y=y+I+`[
|
|
`,p=p+`
|
|
`+I+"]",I+=" ",f="array";v=y+I+o.bodyText.split(`
|
|
`).join(`
|
|
`+I)+p+n,d=d||v,m=v.replace(/[\n]/g,"")}r.add({kind:a.getSuggestionKind(f),label:d,documentation:a.fromMarkup(o.markdownDescription)||o.description,insertText:v,insertTextFormat:Z.Snippet,filterText:m}),c=!0}),!c&&typeof t.items=="object"&&!Array.isArray(t.items)&&this.addDefaultValueCompletions(t.items,n,r,i+1)},e.prototype.addEnumValueCompletions=function(t,n,r){if(de(t.const)&&r.add({kind:this.getSuggestionKind(t.type),label:this.getLabelForValue(t.const),insertText:this.getInsertTextForValue(t.const,n),insertTextFormat:Z.Snippet,documentation:this.fromMarkup(t.markdownDescription)||t.description}),Array.isArray(t.enum))for(var i=0,a=t.enum.length;i<a;i++){var c=t.enum[i],u=this.fromMarkup(t.markdownDescription)||t.description;t.markdownEnumDescriptions&&i<t.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?u=this.fromMarkup(t.markdownEnumDescriptions[i]):t.enumDescriptions&&i<t.enumDescriptions.length&&(u=t.enumDescriptions[i]),r.add({kind:this.getSuggestionKind(t.type),label:this.getLabelForValue(c),insertText:this.getInsertTextForValue(c,n),insertTextFormat:Z.Snippet,documentation:u})}},e.prototype.collectTypes=function(t,n){if(Array.isArray(t.enum)||de(t.const))return;var r=t.type;Array.isArray(r)?r.forEach(function(i){return n[i]=!0}):n[r]=!0},e.prototype.addFillerValueCompletions=function(t,n,r){t.object&&r.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},n),insertTextFormat:Z.Snippet,detail:Ot("defaults.object","New object"),documentation:""}),t.array&&r.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],n),insertTextFormat:Z.Snippet,detail:Ot("defaults.array","New array"),documentation:""})},e.prototype.addBooleanValueCompletion=function(t,n,r){r.add({kind:this.getSuggestionKind("boolean"),label:t?"true":"false",insertText:this.getInsertTextForValue(t,n),insertTextFormat:Z.Snippet,documentation:""})},e.prototype.addNullValueCompletion=function(t,n){n.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+t,insertTextFormat:Z.Snippet,documentation:""})},e.prototype.addDollarSchemaCompletions=function(t,n){var r=this,i=this.schemaService.getRegisteredSchemaIds(function(a){return a==="http"||a==="https"});i.forEach(function(a){return n.add({kind:_.Module,label:r.getLabelForValue(a),filterText:r.getFilterTextForValue(a),insertText:r.getInsertTextForValue(a,t),insertTextFormat:Z.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 n=JSON.stringify(t);return n.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getInsertTextForPlainText=function(t){return t.replace(/[\\\$\}]/g,"\\$&")},e.prototype.getInsertTextForValue=function(t,n){var r=JSON.stringify(t,null," ");return r==="{}"?"{$1}"+n:r==="[]"?"[$1]"+n:this.getInsertTextForPlainText(r+n)},e.prototype.getInsertTextForSnippetValue=function(t,n){var r=function(a){return typeof a=="string"&&a[0]==="^"?a.substr(1):JSON.stringify(a)};return At(t,"",r)+n},e.prototype.getInsertTextForGuessedValue=function(t,n){switch(typeof t){case"object":return t===null?"${1:null}"+n:this.getInsertTextForValue(t,n);case"string":var r=JSON.stringify(t);return r=r.substr(1,r.length-2),r=this.getInsertTextForPlainText(r),'"${1:'+r+'}"'+n;case"number":case"boolean":return"${1:"+JSON.stringify(t)+"}"+n}return this.getInsertTextForValue(t,n)},e.prototype.getSuggestionKind=function(t){if(Array.isArray(t)){var n=t;t=n.length>0?n[0]:null}if(!t)return _.Value;switch(t){case"string":return _.Value;case"object":return _.Module;case"property":return _.Property;default:return _.Value}},e.prototype.getLabelTextForMatchingNode=function(t,n){switch(t.type){case"array":return"[]";case"object":return"{}";default:var r=n.getText().substr(t.offset,t.length);return r}},e.prototype.getInsertTextForMatchingNode=function(t,n,r){switch(t.type){case"array":return this.getInsertTextForValue([],r);case"object":return this.getInsertTextForValue({},r);default:var i=n.getText().substr(t.offset,t.length)+r;return this.getInsertTextForPlainText(i)}},e.prototype.getInsertTextForProperty=function(t,n,r,i){var a=this.getInsertTextForValue(t,"");if(!r)return a;var c=a+": ",u,l=0;if(n){if(Array.isArray(n.defaultSnippets)){if(n.defaultSnippets.length===1){var s=n.defaultSnippets[0].body;de(s)&&(u=this.getInsertTextForSnippetValue(s,""))}l+=n.defaultSnippets.length}if(n.enum&&(!u&&n.enum.length===1&&(u=this.getInsertTextForGuessedValue(n.enum[0],"")),l+=n.enum.length),de(n.default)&&(u||(u=this.getInsertTextForGuessedValue(n.default,"")),l++),Array.isArray(n.examples)&&n.examples.length&&(u||(u=this.getInsertTextForGuessedValue(n.examples[0],"")),l+=n.examples.length),l===0){var o=Array.isArray(n.type)?n.type[0]:n.type;o||(n.properties?o="object":n.items&&(o="array"));switch(o){case"boolean":u="$1";break;case"string":u='"$1"';break;case"object":u="{$1}";break;case"array":u="[$1]";break;case"number":case"integer":u="${1:0}";break;case"null":u="${1:null}";break;default:return a}}}return(!u||l>1)&&(u="$1"),c+u+i},e.prototype.getCurrentWord=function(t,n){for(var r=n-1,i=t.getText();r>=0&&`
|
|
\r\v":{[,]}`.indexOf(i.charAt(r))===-1;)r--;return i.substring(r+1,n)},e.prototype.evaluateSeparatorAfter=function(t,n){var r=C(t.getText(),!0);r.setPosition(n);var i=r.scan();switch(i){case 5:case 2:case 4:case 17:return"";default:return","}},e.prototype.findItemAtOffset=function(t,n,r){for(var i=C(n.getText(),!0),a=t.items,c=a.length-1;c>=0;c--){var u=a[c];if(r>u.offset+u.length){i.setPosition(u.offset+u.length);var l=i.scan();return l===5&&r>=i.getTokenOffset()+i.getTokenLength()?c+1:c}else if(r>=u.offset)return c}return 0},e.prototype.isInComment=function(t,n,r){var i=C(t.getText(),!1);i.setPosition(n);for(var a=i.scan();a!==17&&i.getTokenOffset()+i.getTokenLength()<r;)a=i.scan();return(a===12||a===13)&&i.getTokenOffset()<=r},e.prototype.fromMarkup=function(t){return t&&this.doesSupportMarkdown()?{kind:me.Markdown,value:t}:void 0},e.prototype.doesSupportMarkdown=function(){if(!de(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(me.Markdown)!==-1}return this.supportsMarkdown},e.prototype.doesSupportsCommitCharacters=function(){if(!de(this.supportsCommitCharacters)){var t=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsCommitCharacters=t&&t.completionItem&&!!t.completionItem.commitCharactersSupport}return this.supportsCommitCharacters},e}(),cn=function(){function e(t,n,r){n===void 0&&(n=[]),this.schemaService=t,this.contributions=n,this.promise=r||Promise}return e.prototype.doHover=function(t,n,r){var i=t.offsetAt(n),a=r.getNodeFromOffset(i);if(!a||(a.type==="object"||a.type==="array")&&i>a.offset+1&&i<a.offset+a.length-1)return this.promise.resolve(null);var c=a;if(a.type==="string"){var u=a.parent;if(u&&u.type==="property"&&u.keyNode===a&&(a=u.valueNode,!a))return this.promise.resolve(null)}for(var l=q.create(t.positionAt(c.offset),t.positionAt(c.offset+c.length)),s=function(m){var T={contents:m,range:l};return T},o=Et(a),f=this.contributions.length-1;f>=0;f--){var h=this.contributions[f],d=h.getInfoContribution(t.uri,o);if(d)return d.then(function(v){return s(v)})}return this.schemaService.getSchemaForResource(t.uri,r).then(function(v){if(v){var m=r.getMatchingSchemas(v.schema,a.offset),T=null,b=null,y=null,p=null;m.every(function(S){if(S.node===a&&!S.inverted&&S.schema&&(T=T||S.schema.title,b=b||S.schema.markdownDescription||It(S.schema.description),S.schema.enum)){var A=S.schema.enum.indexOf(be(a));S.schema.markdownEnumDescriptions?y=S.schema.markdownEnumDescriptions[A]:S.schema.enumDescriptions&&(y=It(S.schema.enumDescriptions[A])),y&&(p=S.schema.enum[A],typeof p!="string"&&(p=JSON.stringify(p)))}return!0});var I="";return T&&(I=It(T)),b&&(I.length>0&&(I+=`
|
|
|
|
`),I+=b),y&&(I.length>0&&(I+=`
|
|
|
|
`),I+="`"+ln(p)+"`: "+y),s([I])}return null})},e}();function It(e){if(e){var t=e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
|
|
|
|
$3`);return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}return}function ln(e){return e.indexOf("`")!==-1?"`` "+e+" ``":e}var jt=je("6a/n"),ke=Le(),un=function(){function e(t){try{this.patternRegExp=new RegExp(nn(t)+"$")}catch(n){this.patternRegExp=null}this.schemas=[]}return e.prototype.addSchema=function(t){this.schemas.push(t)},e.prototype.matchesPattern=function(t){return this.patternRegExp&&this.patternRegExp.test(t)},e.prototype.getSchemas=function(){return this.schemas},e}(),fn=function(){function e(t,n,r){this.service=t,this.url=n,this.dependencies={},r&&(this.unresolvedSchema=this.service.promise.resolve(new Me(r)))}return e.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},e.prototype.getResolvedSchema=function(){var t=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(n){return t.service.resolveSchemaContent(n,t.url,t.dependencies)})),this.resolvedSchema},e.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null,this.dependencies={}},e}(),Me=function(){function e(t,n){n===void 0&&(n=[]),this.schema=t,this.errors=n}return e}(),kr=function(){function e(t,n){n===void 0&&(n=[]),this.schema=t,this.errors=n}return e.prototype.getSection=function(t){return Y(this.getSectionRecursive(t,this.schema))},e.prototype.getSectionRecursive=function(t,n){if(!n||typeof n=="boolean"||t.length===0)return n;var r=t.shift();if(n.properties&&typeof n.properties[r])return this.getSectionRecursive(t,n.properties[r]);if(n.patternProperties)for(var i=0,a=Object.keys(n.patternProperties);i<a.length;i++){var c=a[i],u=new RegExp(c);if(u.test(r))return this.getSectionRecursive(t,n.patternProperties[c])}else{if(typeof n.additionalProperties=="object")return this.getSectionRecursive(t,n.additionalProperties);if(r.match("[0-9]+")){if(Array.isArray(n.items)){var l=parseInt(r,10);if(!isNaN(l)&&n.items[l])return this.getSectionRecursive(t,n.items[l])}else if(n.items)return this.getSectionRecursive(t,n.items)}}return null},e}(),hn=function(){function e(t,n,r){this.contextService=n,this.requestService=t,this.promiseConstructor=r||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return e.prototype.getRegisteredSchemaIds=function(t){return Object.keys(this.registeredSchemasIds).filter(function(n){var r=jt.a.parse(n).scheme;return r!=="schemaservice"&&(!t||t(r))})},Object.defineProperty(e.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(t){var n=this,r=!1;t=this.normalizeId(t);for(var i=[t],a=Object.keys(this.schemasById).map(function(s){return n.schemasById[s]});i.length;)for(var c=i.pop(),u=0;u<a.length;u++){var l=a[u];l&&(l.url===c||l.dependencies[c])&&(l.url!==c&&i.push(l.url),l.clearSchema(),a[u]=void 0,r=!0)}return r},e.prototype.normalizeId=function(t){try{return jt.a.parse(t).toString()}catch(n){return t}},e.prototype.setSchemaContributions=function(t){if(t.schemas){var n=t.schemas;for(var r in n){var i=this.normalizeId(r);this.contributionSchemas[i]=this.addSchemaHandle(i,n[r])}}if(t.schemaAssociations){var a=t.schemaAssociations;for(var c in a){var u=a[c];this.contributionAssociations[c]=u;for(var l=this.getOrAddFilePatternAssociation(c),s=0,o=u;s<o.length;s++){var f=o[s],r=this.normalizeId(f);l.addSchema(r)}}}},e.prototype.addSchemaHandle=function(t,n){var r=new fn(this,t,n);return this.schemasById[t]=r,r},e.prototype.getOrAddSchemaHandle=function(t,n){return this.schemasById[t]||this.addSchemaHandle(t,n)},e.prototype.getOrAddFilePatternAssociation=function(t){var n=this.filePatternAssociationById[t];return n||(n=new un(t),this.filePatternAssociationById[t]=n,this.filePatternAssociations.push(n)),n},e.prototype.registerExternalSchema=function(t,n,r){n===void 0&&(n=null);var i=this.normalizeId(t);if(this.registeredSchemasIds[i]=!0,n)for(var a=0,c=n;a<c.length;a++){var u=c[a];this.getOrAddFilePatternAssociation(u).addSchema(i)}return r?this.addSchemaHandle(i,r):this.getOrAddSchemaHandle(i)},e.prototype.clearExternalSchemas=function(){this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var t in this.contributionSchemas)this.schemasById[t]=this.contributionSchemas[t],this.registeredSchemasIds[t]=!0;for(var n in this.contributionAssociations)for(var r=this.getOrAddFilePatternAssociation(n),i=0,a=this.contributionAssociations[n];i<a.length;i++){var c=a[i],t=this.normalizeId(c);r.addSchema(t)}},e.prototype.getResolvedSchema=function(t){var n=this.normalizeId(t),r=this.schemasById[n];return r?r.getResolvedSchema():this.promise.resolve(null)},e.prototype.loadSchema=function(t){if(!this.requestService){var n=ke("json.schema.norequestservice","Unable to load schema from '{0}'. No schema request service available",lt(t));return this.promise.resolve(new Me({},[n]))}return this.requestService(t).then(function(r){if(!r){var i=ke("json.schema.nocontent","Unable to load schema from '{0}': No content.",lt(t));return new Me({},[i])}var a={},c=[];a=j(r,c);var u=c.length?[ke("json.schema.invalidFormat","Unable to parse content from '{0}': Parse error at offset {1}.",lt(t),c[0].offset)]:[];return new Me(a,u)},function(r){var i=r.toString(),a=r.toString().split("Error: ");return a.length>1&&(i=a[1]),ct(i,".")&&(i=i.substr(0,i.length-1)),new Me({},[ke("json.schema.nocontent","Unable to load schema from '{0}': {1}.",lt(t),i)])})},e.prototype.resolveSchemaContent=function(t,n,r){var i=this,a=t.errors.slice(0),c=t.schema;if(c.$schema){var u=this.normalizeId(c.$schema);if(u==="http://json-schema.org/draft-03/schema")return this.promise.resolve(new kr({},[ke("json.schema.draft03.notsupported","Draft-03 schemas are not supported.")]));u==="https://json-schema.org/draft/2019-09/schema"&&t.errors.push(ke("json.schema.draft201909.notsupported","Draft 2019-09 schemas are not yet fully supported."))}var l=this.contextService,s=function(v,m){if(!m)return v;var T=v;return m[0]==="/"&&(m=m.substr(1)),m.split("/").some(function(b){return T=T[b],!T}),T},o=function(v,m,T,b){var y=s(m,b);if(y)for(var p in y)y.hasOwnProperty(p)&&!v.hasOwnProperty(p)&&(v[p]=y[p]);else a.push(ke("json.schema.invalidref","$ref '{0}' in '{1}' can not be resolved.",b,T))},f=function(v,m,T,b,y){l&&!/^\w+:\/\/.*/.test(m)&&(m=l.resolveRelativePath(m,b)),m=i.normalizeId(m);var p=i.getOrAddSchemaHandle(m);return p.getUnresolvedSchema().then(function(I){if(y[m]=!0,I.errors.length){var S=T?m+"#"+T:m;a.push(ke("json.schema.problemloadingref","Problems loading reference '{0}': {1}",S,I.errors[0]))}return o(v,I.schema,m,T),h(v,I.schema,m,p.dependencies)})},h=function(v,m,T,b){if(!v||typeof v!="object")return Promise.resolve(null);for(var y=[v],p=[],I=[],S=function(){for(var w=[],N=0;N<arguments.length;N++)w[N]=arguments[N];for(var D=0,$=w;D<$.length;D++){var G=$[D];typeof G=="object"&&y.push(G)}},A=function(){for(var w=[],N=0;N<arguments.length;N++)w[N]=arguments[N];for(var D=0,$=w;D<$.length;D++){var G=$[D];if(typeof G=="object")for(var K in G){var te=G[K];typeof te=="object"&&y.push(te)}}},x=function(){for(var w=[],N=0;N<arguments.length;N++)w[N]=arguments[N];for(var D=0,$=w;D<$.length;D++){var G=$[D];if(Array.isArray(G))for(var K=0,te=G;K<te.length;K++){var ae=te[K];typeof ae=="object"&&y.push(ae)}}},O=function(w){for(var N=[];w.$ref;){var D=w.$ref,$=D.split("#",2);if(delete w.$ref,$[0].length>0){I.push(f(w,$[0],$[1],T,b));return}else N.indexOf(D)===-1&&(o(w,m,T,$[1]),N.push(D))}S(w.items,w.additionalProperties,w.not,w.contains,w.propertyNames,w.if,w.then,w.else),A(w.definitions,w.properties,w.patternProperties,w.dependencies),x(w.anyOf,w.allOf,w.oneOf,w.items)};y.length;){var E=y.pop();if(p.indexOf(E)>=0)continue;p.push(E),O(E)}return i.promise.all(I)};return h(c,c,n,r).then(function(d){return new kr(c,a)})},e.prototype.getSchemaForResource=function(t,n){if(n&&n.root&&n.root.type==="object"){var r=n.root.properties.filter(function(v){return v.keyNode.value==="$schema"&&v.valueNode&&v.valueNode.type==="string"});if(r.length>0){var i=be(r[0].valueNode);if(i&&rn(i,".")&&this.contextService&&(i=this.contextService.resolveRelativePath(i,t)),i){var a=this.normalizeId(i);return this.getOrAddSchemaHandle(a).getResolvedSchema()}}}for(var c=Object.create(null),u=[],l=0,s=this.filePatternAssociations;l<s.length;l++){var o=s[l];if(o.matchesPattern(t))for(var f=0,h=o.getSchemas();f<h.length;f++){var d=h[f];c[d]||(u.push(d),c[d]=!0)}}return u.length>0?this.createCombinedSchema(t,u).getResolvedSchema():this.promise.resolve(null)},e.prototype.createCombinedSchema=function(t,n){if(n.length===1)return this.getOrAddSchemaHandle(n[0]);var r="schemaservice://combinedSchema/"+encodeURIComponent(t),i={allOf:n.map(function(a){return{$ref:a}})};return this.addSchemaHandle(r,i)},e}();function lt(e){try{var t=jt.a.parse(e);if(t.scheme==="file")return t.fsPath}catch(n){}return e}var dn=Le(),pn=function(){function e(t,n){this.jsonSchemaService=t,this.promise=n,this.validationEnabled=!0}return e.prototype.configure=function(t){t&&(this.validationEnabled=t.validate,this.commentSeverity=t.allowComments?void 0:V.Error)},e.prototype.doValidation=function(t,n,r,i){var a=this;if(!this.validationEnabled)return this.promise.resolve([]);var c=[],u={},l=function(h){var d=h.range.start.line+" "+h.range.start.character+" "+h.message;u[d]||(u[d]=!0,c.push(h))},s=function(h){var d=r?wr(r.trailingCommas):V.Error,v=r?wr(r.comments):a.commentSeverity;if(h){if(h.errors.length&&n.root){var m=n.root,T=m.type==="object"?m.properties[0]:null;if(T&&T.keyNode.value==="$schema"){var b=T.valueNode||T,y=q.create(t.positionAt(b.offset),t.positionAt(b.offset+b.length));l(pe.create(y,h.errors[0],V.Warning,B.SchemaResolveError))}else{var y=q.create(t.positionAt(m.offset),t.positionAt(m.offset+1));l(pe.create(y,h.errors[0],V.Warning,B.SchemaResolveError))}}else{var p=n.validate(t,h.schema);p&&p.forEach(l)}Cr(h.schema)&&(v=void 0),Tr(h.schema)&&(d=void 0)}for(var I=0,S=n.syntaxErrors;I<S.length;I++){var A=S[I];if(A.code===B.TrailingComma){if(typeof d!="number")continue;A.severity=d}l(A)}if(typeof v=="number"){var x=dn("InvalidCommentToken","Comments are not permitted in JSON.");n.comments.forEach(function(O){l(pe.create(O,x,v,B.CommentNotPermitted))})}return c};if(i){var o=i.id||"schemaservice://untitled/"+mn++;return this.jsonSchemaService.resolveSchemaContent(new Me(i),o,{}).then(function(f){return s(f)})}return this.jsonSchemaService.getSchemaForResource(t.uri,n).then(function(f){return s(f)})},e}(),mn=0;function Cr(e){if(e&&typeof e=="object"){if(ce(e.allowComments))return e.allowComments;if(e.allOf)for(var t=0,n=e.allOf;t<n.length;t++){var r=n[t],i=Cr(r);if(ce(i))return i}}return}function Tr(e){if(e&&typeof e=="object"){if(ce(e.allowTrailingCommas))return e.allowTrailingCommas;if(ce(e.allowsTrailingCommas))return e.allowsTrailingCommas;if(e.allOf)for(var t=0,n=e.allOf;t<n.length;t++){var r=n[t],i=Tr(r);if(ce(i))return i}}return}function wr(e){switch(e){case"error":return V.Error;case"warning":return V.Warning;case"ignore":return}return}var Sr=48,gn=57,vn=65,ut=97,yn=102;function Q(e){return e<Sr?0:e<=gn?e-Sr:(e<ut&&(e+=ut-vn),e>=ut&&e<=yn?e-ut+10:0)}function bn(e){if(e[0]!=="#")return null;switch(e.length){case 4:return{red:Q(e.charCodeAt(1))*17/255,green:Q(e.charCodeAt(2))*17/255,blue:Q(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:Q(e.charCodeAt(1))*17/255,green:Q(e.charCodeAt(2))*17/255,blue:Q(e.charCodeAt(3))*17/255,alpha:Q(e.charCodeAt(4))*17/255};case 7:return{red:(Q(e.charCodeAt(1))*16+Q(e.charCodeAt(2)))/255,green:(Q(e.charCodeAt(3))*16+Q(e.charCodeAt(4)))/255,blue:(Q(e.charCodeAt(5))*16+Q(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(Q(e.charCodeAt(1))*16+Q(e.charCodeAt(2)))/255,green:(Q(e.charCodeAt(3))*16+Q(e.charCodeAt(4)))/255,blue:(Q(e.charCodeAt(5))*16+Q(e.charCodeAt(6)))/255,alpha:(Q(e.charCodeAt(7))*16+Q(e.charCodeAt(8)))/255}}return null}function li(e,t,n,r){return r===void 0&&(r=1),{red:e/255,green:t/255,blue:n/255,alpha:r}}var kn=function(){function e(t){this.schemaService=t}return e.prototype.findDocumentSymbols=function(t,n,r){var i=this;r===void 0&&(r={resultLimit:Number.MAX_VALUE});var a=n.root;if(!a)return null;var c=r.resultLimit,u=t.uri;if((u==="vscode://defaultsettings/keybindings.json"||ct(u.toLowerCase(),"/user/keybindings.json"))&&a.type==="array"){for(var l=[],s=0,o=a.items;s<o.length;s++){var f=o[s];if(f.type==="object")for(var h=0,d=f.properties;h<d.length;h++){var v=d[h];if(v.keyNode.value==="key"&&v.valueNode){var m=Ue.create(t.uri,Ce(t,f));if(l.push({name:be(v.valueNode),kind:J.Function,location:m}),c--,c<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(u),l}}}return l}for(var T=[{node:a,containerName:""}],b=0,y=!1,p=[],I=function(x,O){x.type==="array"?x.items.forEach(function(E){E&&T.push({node:E,containerName:O})}):x.type==="object"&&x.properties.forEach(function(E){var L=E.valueNode;if(L)if(c>0){c--;var w=Ue.create(t.uri,Ce(t,E)),N=O?O+"."+E.keyNode.value:E.keyNode.value;p.push({name:i.getKeyLabel(E),kind:i.getSymbolKind(L.type),location:w,containerName:O}),T.push({node:L,containerName:N})}else y=!0})};b<T.length;){var S=T[b++];I(S.node,S.containerName)}return y&&r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(u),p},e.prototype.findDocumentSymbols2=function(t,n,r){var i=this;r===void 0&&(r={resultLimit:Number.MAX_VALUE});var a=n.root;if(!a)return null;var c=r.resultLimit,u=t.uri;if((u==="vscode://defaultsettings/keybindings.json"||ct(u.toLowerCase(),"/user/keybindings.json"))&&a.type==="array"){for(var l=[],s=0,o=a.items;s<o.length;s++){var f=o[s];if(f.type==="object")for(var h=0,d=f.properties;h<d.length;h++){var v=d[h];if(v.keyNode.value==="key"&&v.valueNode){var m=Ce(t,f),T=Ce(t,v.keyNode);if(l.push({name:be(v.valueNode),kind:J.Function,range:m,selectionRange:T}),c--,c<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(u),l}}}return l}for(var b=[],y=[{node:a,result:b}],p=0,I=!1,S=function(O,E){O.type==="array"?O.items.forEach(function(L,w){if(L)if(c>0){c--;var N=Ce(t,L),D=N,$=String(w),G={name:$,kind:i.getSymbolKind(L.type),range:N,selectionRange:D,children:[]};E.push(G),y.push({result:G.children,node:L})}else I=!0}):O.type==="object"&&O.properties.forEach(function(L){var w=L.valueNode;if(w)if(c>0){c--;var N=Ce(t,L),D=Ce(t,L.keyNode),$={name:i.getKeyLabel(L),kind:i.getSymbolKind(w.type),range:N,selectionRange:D,children:[]};E.push($),y.push({result:$.children,node:w})}else I=!0})};p<y.length;){var A=y[p++];S(A.node,A.result)}return I&&r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(u),b},e.prototype.getSymbolKind=function(t){switch(t){case"object":return J.Module;case"string":return J.String;case"number":return J.Number;case"array":return J.Array;case"boolean":return J.Boolean;default:return J.Variable}},e.prototype.getKeyLabel=function(t){var n=t.keyNode.value;return n&&(n=n.replace(/[\n]/g,"\u21B5")),n&&n.trim()?n:'"'+n+'"'},e.prototype.findDocumentColors=function(t,n,r){return this.schemaService.getSchemaForResource(t.uri,n).then(function(i){var a=[];if(i)for(var c=r&&typeof r.resultLimit=="number"?r.resultLimit:Number.MAX_VALUE,u=n.getMatchingSchemas(i.schema),l={},s=0,o=u;s<o.length;s++){var f=o[s];if(!f.inverted&&f.schema&&(f.schema.format==="color"||f.schema.format==="color-hex")&&f.node&&f.node.type==="string"){var h=String(f.node.offset);if(!l[h]){var d=bn(be(f.node));if(d){var v=Ce(t,f.node);a.push({color:d,range:v})}if(l[h]=!0,c--,c<=0)return r&&r.onResultLimitExceeded&&r.onResultLimitExceeded(t.uri),a}}}return a})},e.prototype.getColorPresentations=function(t,n,r,i){var a=[],c=Math.round(r.red*255),u=Math.round(r.green*255),l=Math.round(r.blue*255);function s(f){var h=f.toString(16);return h.length!==2?"0"+h:h}var o;return r.alpha===1?o="#"+s(c)+s(u)+s(l):o="#"+s(c)+s(u)+s(l)+s(Math.round(r.alpha*255)),a.push({label:o,textEdit:le.replace(i,JSON.stringify(o))}),a},e}();function Ce(e,t){return q.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length))}var F=Le(),Nt={schemaAssociations:{},schemas:{"http://json-schema.org/draft-04/schema#":{title:F("schema.json","Describes a JSON file using a schema. See json-schema.org for more info."),$schema:"http://json-schema.org/draft-04/schema#",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{type:"string",enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{allOf:[{$ref:"#/definitions/positiveInteger"}]},minLength:{allOf:[{$ref:"#/definitions/positiveIntegerDefault0"}]},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{allOf:[{$ref:"#/definitions/positiveInteger"}]},minItems:{allOf:[{$ref:"#/definitions/positiveIntegerDefault0"}]},uniqueItems:{type:"boolean",default:!1},maxProperties:{allOf:[{$ref:"#/definitions/positiveInteger"}]},minProperties:{allOf:[{$ref:"#/definitions/positiveIntegerDefault0"}]},required:{allOf:[{$ref:"#/definitions/stringArray"}]},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{anyOf:[{type:"string",enum:["date-time","uri","email","hostname","ipv4","ipv6","regex"]},{type:"string"}]},allOf:{allOf:[{$ref:"#/definitions/schemaArray"}]},anyOf:{allOf:[{$ref:"#/definitions/schemaArray"}]},oneOf:{allOf:[{$ref:"#/definitions/schemaArray"}]},not:{allOf:[{$ref:"#"}]}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}},"http://json-schema.org/draft-07/schema#":{title:F("schema.json","Describes a JSON file using a schema. See json-schema.org for more info."),definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}},Cn={id:F("schema.json.id","A unique identifier for the schema."),$schema:F("schema.json.$schema","The schema to verify this document against."),title:F("schema.json.title","A descriptive title of the element."),description:F("schema.json.description","A long description of the element. Used in hover menus and suggestions."),default:F("schema.json.default","A default value. Used by suggestions."),multipleOf:F("schema.json.multipleOf","A number that should cleanly divide the current value (i.e. have no remainder)."),maximum:F("schema.json.maximum","The maximum numerical value, inclusive by default."),exclusiveMaximum:F("schema.json.exclusiveMaximum","Makes the maximum property exclusive."),minimum:F("schema.json.minimum","The minimum numerical value, inclusive by default."),exclusiveMinimum:F("schema.json.exclusiveMininum","Makes the minimum property exclusive."),maxLength:F("schema.json.maxLength","The maximum length of a string."),minLength:F("schema.json.minLength","The minimum length of a string."),pattern:F("schema.json.pattern","A regular expression to match the string against. It is not implicitly anchored."),additionalItems:F("schema.json.additionalItems","For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail."),items:F("schema.json.items","For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on."),maxItems:F("schema.json.maxItems","The maximum number of items that can be inside an array. Inclusive."),minItems:F("schema.json.minItems","The minimum number of items that can be inside an array. Inclusive."),uniqueItems:F("schema.json.uniqueItems","If all of the items in the array must be unique. Defaults to false."),maxProperties:F("schema.json.maxProperties","The maximum number of properties an object can have. Inclusive."),minProperties:F("schema.json.minProperties","The minimum number of properties an object can have. Inclusive."),required:F("schema.json.required","An array of strings that lists the names of all properties required on this object."),additionalProperties:F("schema.json.additionalProperties","Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail."),definitions:F("schema.json.definitions","Not used for validation. Place subschemas here that you wish to reference inline with $ref."),properties:F("schema.json.properties","A map of property names to schemas for each property."),patternProperties:F("schema.json.patternProperties","A map of regular expressions on property names to schemas for matching properties."),dependencies:F("schema.json.dependencies","A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object."),enum:F("schema.json.enum","The set of literal values that are valid."),type:F("schema.json.type","Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types."),format:F("schema.json.format","Describes the format expected for the value."),allOf:F("schema.json.allOf","An array of schemas, all of which must match."),anyOf:F("schema.json.anyOf","An array of schemas, where at least one must match."),oneOf:F("schema.json.oneOf","An array of schemas, exactly one of which must match."),not:F("schema.json.not","A schema which must not match."),$id:F("schema.json.$id","A unique identifier for the schema."),$ref:F("schema.json.$ref","Reference a definition hosted on any location."),$comment:F("schema.json.$comment","Comments from schema authors to readers or maintainers of the schema."),readOnly:F("schema.json.readOnly","Indicates that the value of the instance is managed exclusively by the owning authority."),examples:F("schema.json.examples","Sample JSON values associated with a particular schema, for the purpose of illustrating usage."),contains:F("schema.json.contains",'An array instance is valid against "contains" if at least one of its elements is valid against the given schema.'),propertyNames:F("schema.json.propertyNames","If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema."),const:F("schema.json.const","An instance validates successfully against this keyword if its value is equal to the value of the keyword."),contentMediaType:F("schema.json.contentMediaType","Describes the media type of a string property."),contentEncoding:F("schema.json.contentEncoding","Describes the content encoding of a string property."),if:F("schema.json.if",'The validation outcome of the "if" subschema controls which of the "then" or "else" keywords are evaluated.'),then:F("schema.json.then",'The "if" subschema is used for validation when the "if" subschema succeeds.'),else:F("schema.json.else",'The "else" subschema is used for validation when the "if" subschema fails.')};for(var Tn in Nt.schemas){var Lt=Nt.schemas[Tn];for(var Be in Lt.properties){var Mt=Lt.properties[Be];Mt===!0&&(Mt=Lt.properties[Be]={});var xr=Cn[Be];xr?Mt.description=xr:console.log(Be+": localize('schema.json."+Be+`', "")`)}}function wn(e,t){var n=[],r=[],i=[],a=-1,c=C(e.getText(),!1),u=c.scan();function l(L){n.push(L),r.push(i.length)}for(;u!==17;){switch(u){case 1:case 3:{var s=e.positionAt(c.getTokenOffset()).line,o={startLine:s,endLine:s,kind:u===1?"object":"array"};i.push(o);break}case 2:case 4:{var f=u===2?"object":"array";if(i.length>0&&i[i.length-1].kind===f){var o=i.pop(),h=e.positionAt(c.getTokenOffset()).line;o&&h>o.startLine+1&&a!==o.startLine&&(o.endLine=h-1,l(o),a=o.startLine)}break}case 13:{var s=e.positionAt(c.getTokenOffset()).line,d=e.positionAt(c.getTokenOffset()+c.getTokenLength()).line;c.getTokenError()===1&&s+1<e.lineCount?c.setPosition(e.offsetAt(se.create(s+1,0))):s<d&&(l({startLine:s,endLine:d,kind:ye.Comment}),a=s);break}case 12:{var v=e.getText().substr(c.getTokenOffset(),c.getTokenLength()),m=v.match(/^\/\/\s*#(region\b)|(endregion\b)/);if(m){var h=e.positionAt(c.getTokenOffset()).line;if(m[1]){var o={startLine:h,endLine:h,kind:ye.Region};i.push(o)}else{for(var T=i.length-1;T>=0&&i[T].kind!==ye.Region;)T--;if(T>=0){var o=i[T];i.length=T,h>o.startLine&&a!==o.startLine&&(o.endLine=h,l(o),a=o.startLine)}}}break}}u=c.scan()}var b=t&&t.rangeLimit;if(typeof b!="number"||n.length<=b)return n;t&&t.onRangeLimitExceeded&&t.onRangeLimitExceeded(e.uri);for(var y=[],p=0,I=r;p<I.length;p++){var S=I[p];S<30&&(y[S]=(y[S]||0)+1)}for(var A=0,x=0,T=0;T<y.length;T++){var O=y[T];if(O){if(O+A>b){x=T;break}A+=O}}for(var E=[],T=0;T<n.length;T++){var S=r[T];typeof S=="number"&&((S<x||S===x&&A++<b)&&E.push(n[T]))}return E}function Sn(e,t,n){function r(u){for(var l=e.offsetAt(u),s=n.getNodeFromOffset(l,!0),o=[];s;){switch(s.type){case"string":case"object":case"array":var f=s.offset+1,h=s.offset+s.length-1;f<h&&l>=f&&l<=h&&o.push(i(f,h)),o.push(i(s.offset,s.offset+s.length));break;case"number":case"boolean":case"null":case"property":o.push(i(s.offset,s.offset+s.length));break}if(s.type==="property"||s.parent&&s.parent.type==="array"){var d=c(s.offset+s.length,5);d!==-1&&o.push(i(s.offset,d))}s=s.parent}for(var v=void 0,m=o.length-1;m>=0;m--)v=st.create(o[m],v);return v||(v=st.create(q.create(u,u))),v}function i(u,l){return q.create(e.positionAt(u),e.positionAt(l))}var a=C(e.getText(),!0);function c(u,l){a.setPosition(u);var s=a.scan();return s===l?a.getTokenOffset()+a.getTokenLength():-1}return t.map(r)}function ui(e){var t=e.promiseConstructor||Promise,n=new hn(e.schemaRequestService,e.workspaceContext,t);n.setSchemaContributions(Nt);var r=new sn(n,e.contributions,t,e.clientCapabilities),i=new cn(n,e.contributions,t),a=new kn(n),c=new pn(n,t);return{configure:function(l){n.clearExternalSchemas(),l.schemas&&l.schemas.forEach(function(s){n.registerExternalSchema(s.uri,s.fileMatch,s.schema)}),c.configure(l)},resetSchema:function(l){return n.onResourceChange(l)},doValidation:c.doValidation.bind(c),parseJSONDocument:function(l){return tn(l,{collectComments:!0})},newJSONDocument:function(l,s){return en(l,s)},doResolve:r.doResolve.bind(r),doComplete:r.doComplete.bind(r),findDocumentSymbols:a.findDocumentSymbols.bind(a),findDocumentSymbols2:a.findDocumentSymbols2.bind(a),findColorSymbols:function(l,s){return a.findDocumentColors(l,s).then(function(o){return o.map(function(f){return f.range})})},findDocumentColors:a.findDocumentColors.bind(a),getColorPresentations:a.getColorPresentations.bind(a),doHover:i.doHover.bind(i),getFoldingRanges:wn,getSelectionRanges:Sn,format:function(l,s,o){var f=void 0;if(s){var h=l.offsetAt(s.start),d=l.offsetAt(s.end)-h;f={offset:h,length:d}}var v={tabSize:o?o.tabSize:4,insertSpaces:o?o.insertSpaces:!0,eol:`
|
|
`};return he(l.getText(),f,v).map(function(m){return le.replace(q.create(l.positionAt(m.offset),l.positionAt(m.offset+m.length)),m.content)})}}}var xn=monaco.Uri,Er=monaco.Range,En=function(){function e(t,n,r){var i=this;this._languageId=t,this._worker=n,this._disposables=[],this._listener=Object.create(null);var a=function(l){var s=l.getModeId();if(s!==i._languageId)return;var o;i._listener[l.uri.toString()]=l.onDidChangeContent(function(){clearTimeout(o),o=setTimeout(function(){return i._doValidate(l.uri,s)},500)}),i._doValidate(l.uri,s)},c=function(l){monaco.editor.setModelMarkers(l,i._languageId,[]);var s=l.uri.toString(),o=i._listener[s];o&&(o.dispose(),delete i._listener[s])};this._disposables.push(monaco.editor.onDidCreateModel(a)),this._disposables.push(monaco.editor.onWillDisposeModel(function(u){c(u),i._resetSchema(u.uri)})),this._disposables.push(monaco.editor.onDidChangeModelLanguage(function(u){c(u.model),a(u.model),i._resetSchema(u.model.uri)})),this._disposables.push(r.onDidChange(function(u){monaco.editor.getModels().forEach(function(l){l.getModeId()===i._languageId&&(c(l),a(l))})})),this._disposables.push({dispose:function(){monaco.editor.getModels().forEach(c);for(var l in i._listener)i._listener[l].dispose()}}),monaco.editor.getModels().forEach(a)}return e.prototype.dispose=function(){this._disposables.forEach(function(t){return t&&t.dispose()}),this._disposables=[]},e.prototype._resetSchema=function(t){this._worker().then(function(n){n.resetSchema(t.toString())})},e.prototype._doValidate=function(t,n){this._worker(t).then(function(r){return r.doValidation(t.toString()).then(function(i){var a=i.map(function(u){return On(t,u)}),c=monaco.editor.getModel(t);c&&c.getModeId()===n&&monaco.editor.setModelMarkers(c,n,a)})}).then(void 0,function(r){console.error(r)})},e}();function An(e){switch(e){case V.Error:return monaco.MarkerSeverity.Error;case V.Warning:return monaco.MarkerSeverity.Warning;case V.Information:return monaco.MarkerSeverity.Info;case V.Hint:return monaco.MarkerSeverity.Hint;default:return monaco.MarkerSeverity.Info}}function On(e,t){var n=typeof t.code=="number"?String(t.code):t.code;return{severity:An(t.severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message,code:n,source:t.source}}function Pt(e){return e?{character:e.column-1,line:e.lineNumber-1}:void 0}function Ar(e){return e?{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}:void 0}function Te(e){return e?new Er(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1):void 0}function In(e){var t=monaco.languages.CompletionItemKind;switch(e){case _.Text:return t.Text;case _.Method:return t.Method;case _.Function:return t.Function;case _.Constructor:return t.Constructor;case _.Field:return t.Field;case _.Variable:return t.Variable;case _.Class:return t.Class;case _.Interface:return t.Interface;case _.Module:return t.Module;case _.Property:return t.Property;case _.Unit:return t.Unit;case _.Value:return t.Value;case _.Enum:return t.Enum;case _.Keyword:return t.Keyword;case _.Snippet:return t.Snippet;case _.Color:return t.Color;case _.File:return t.File;case _.Reference:return t.Reference}return t.Property}function fi(e){var t=monaco.languages.CompletionItemKind;switch(e){case t.Text:return _.Text;case t.Method:return _.Method;case t.Function:return _.Function;case t.Constructor:return _.Constructor;case t.Field:return _.Field;case t.Variable:return _.Variable;case t.Class:return _.Class;case t.Interface:return _.Interface;case t.Module:return _.Module;case t.Property:return _.Property;case t.Unit:return _.Unit;case t.Value:return _.Value;case t.Enum:return _.Enum;case t.Keyword:return _.Keyword;case t.Snippet:return _.Snippet;case t.Color:return _.Color;case t.File:return _.File;case t.Reference:return _.Reference}return _.Property}function $e(e){return e?{range:Te(e.range),text:e.newText}:void 0}var jn=function(){function e(t){this._worker=t}return Object.defineProperty(e.prototype,"triggerCharacters",{get:function(){return[" ",":"]},enumerable:!0,configurable:!0}),e.prototype.provideCompletionItems=function(t,n,r,i){var a=t.uri;return this._worker(a).then(function(c){return c.doComplete(a.toString(),Pt(n))}).then(function(c){if(!c)return;var u=t.getWordUntilPosition(n),l=new Er(n.lineNumber,u.startColumn,n.lineNumber,u.endColumn),s=c.items.map(function(o){var f={label:o.label,insertText:o.insertText||o.label,sortText:o.sortText,filterText:o.filterText,documentation:o.documentation,detail:o.detail,range:l,kind:In(o.kind)};return o.textEdit&&(f.range=Te(o.textEdit.range),f.insertText=o.textEdit.newText),o.additionalTextEdits&&(f.additionalTextEdits=o.additionalTextEdits.map($e)),o.insertTextFormat===Z.Snippet&&(f.insertTextRules=monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet),f});return{isIncomplete:c.isIncomplete,suggestions:s}})},e}();function Nn(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function Or(e){return typeof e=="string"?{value:e}:Nn(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+`
|
|
`+e.value+"\n```\n"}}function Ln(e){return e?Array.isArray(e)?e.map(Or):[Or(e)]:void 0}var Mn=function(){function e(t){this._worker=t}return e.prototype.provideHover=function(t,n,r){var i=t.uri;return this._worker(i).then(function(a){return a.doHover(i.toString(),Pt(n))}).then(function(a){return a?{range:Te(a.range),contents:Ln(a.contents)}:void 0})},e}();function hi(e){return{uri:xn.parse(e.uri),range:Te(e.range)}}function Pn(e){var t=monaco.languages.SymbolKind;switch(e){case J.File:return t.Array;case J.Module:return t.Module;case J.Namespace:return t.Namespace;case J.Package:return t.Package;case J.Class:return t.Class;case J.Method:return t.Method;case J.Property:return t.Property;case J.Field:return t.Field;case J.Constructor:return t.Constructor;case J.Enum:return t.Enum;case J.Interface:return t.Interface;case J.Function:return t.Function;case J.Variable:return t.Variable;case J.Constant:return t.Constant;case J.String:return t.String;case J.Number:return t.Number;case J.Boolean:return t.Boolean;case J.Array:return t.Array}return t.Function}var _n=function(){function e(t){this._worker=t}return e.prototype.provideDocumentSymbols=function(t,n){var r=t.uri;return this._worker(r).then(function(i){return i.findDocumentSymbols(r.toString())}).then(function(i){return i?i.map(function(a){return{name:a.name,detail:"",containerName:a.containerName,kind:Pn(a.kind),range:Te(a.location.range),selectionRange:Te(a.location.range),tags:[]}}):void 0})},e}();function Ir(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var Fn=function(){function e(t){this._worker=t}return e.prototype.provideDocumentFormattingEdits=function(t,n,r){var i=t.uri;return this._worker(i).then(function(a){return a.format(i.toString(),null,Ir(n)).then(function(c){return!c||c.length===0?void 0:c.map($e)})})},e}(),Dn=function(){function e(t){this._worker=t}return e.prototype.provideDocumentRangeFormattingEdits=function(t,n,r,i){var a=t.uri;return this._worker(a).then(function(c){return c.format(a.toString(),Ar(n),Ir(r)).then(function(u){return!u||u.length===0?void 0:u.map($e)})})},e}(),Vn=function(){function e(t){this._worker=t}return e.prototype.provideDocumentColors=function(t,n){var r=t.uri;return this._worker(r).then(function(i){return i.findDocumentColors(r.toString())}).then(function(i){return i?i.map(function(a){return{color:a.color,range:Te(a.range)}}):void 0})},e.prototype.provideColorPresentations=function(t,n,r){var i=t.uri;return this._worker(i).then(function(a){return a.getColorPresentations(i.toString(),n.color,Ar(n.range))}).then(function(a){return a?a.map(function(c){var u={label:c.label};return c.textEdit&&(u.textEdit=$e(c.textEdit)),c.additionalTextEdits&&(u.additionalTextEdits=c.additionalTextEdits.map($e)),u}):void 0})},e}(),Un=function(){function e(t){this._worker=t}return e.prototype.provideFoldingRanges=function(t,n,r){var i=t.uri;return this._worker(i).then(function(a){return a.getFoldingRanges(i.toString(),n)}).then(function(a){return a?a.map(function(c){var u={start:c.startLine+1,end:c.endLine+1};return typeof c.kind!="undefined"&&(u.kind=Rn(c.kind)),u}):void 0})},e}();function Rn(e){switch(e){case ye.Comment:return monaco.languages.FoldingRangeKind.Comment;case ye.Imports:return monaco.languages.FoldingRangeKind.Imports;case ye.Region:return monaco.languages.FoldingRangeKind.Region}return}var Bn=function(){function e(t){this._worker=t}return e.prototype.provideSelectionRanges=function(t,n,r){var i=t.uri;return this._worker(i).then(function(a){return a.getSelectionRanges(i.toString(),n.map(Pt))}).then(function(a){return a?a.map(function(c){for(var u=[];c;)u.push({range:Te(c.range)}),c=c.parent;return u}):void 0})},e}();function $n(e){return{getInitialState:function(){return new Lr(null,null,!1)},tokenize:function(n,r,i,a){return Xn(e,n,r,i,a)}}}var jr="delimiter.bracket.json",Nr="delimiter.array.json",Wn="delimiter.colon.json",Jn="delimiter.comma.json",qn="keyword.json",Hn="keyword.json",zn="string.value.json",Kn="number.json",Gn="string.key.json",Qn="comment.block.json",Zn="comment.line.json",Lr=function(){function e(t,n,r){this._state=t,this.scanError=n,this.lastWasColon=r}return e.prototype.clone=function(){return new e(this._state,this.scanError,this.lastWasColon)},e.prototype.equals=function(t){return t===this?!0:!t||!(t instanceof e)?!1:this.scanError===t.scanError&&this.lastWasColon===t.lastWasColon},e.prototype.getStateData=function(){return this._state},e.prototype.setStateData=function(t){this._state=t},e}();function Xn(e,t,n,r,i){r===void 0&&(r=0);var a=0,c=!1;switch(n.scanError){case 2:t='"'+t,a=1;break;case 1:t="/*"+t,a=2;break}var u=C(t),l,s,o=n.lastWasColon;for(s={tokens:[],endState:n.clone()};;){var f=r+u.getPosition(),h="";if(l=u.scan(),l===17)break;if(f===r+u.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+t.substr(u.getPosition(),3));c&&(f-=a),c=a>0;switch(l){case 1:h=jr,o=!1;break;case 2:h=jr,o=!1;break;case 3:h=Nr,o=!1;break;case 4:h=Nr,o=!1;break;case 6:h=Wn,o=!0;break;case 5:h=Jn,o=!1;break;case 8:case 9:h=qn,o=!1;break;case 7:h=Hn,o=!1;break;case 10:h=o?zn:Gn,o=!1;break;case 11:h=Kn,o=!1;break}if(e)switch(l){case 12:h=Zn;break;case 13:h=Qn;break}s.endState=new Lr(n.getStateData(),u.getTokenError(),o),s.tokens.push({startIndex:f,scopes:h})}return s}function Yn(e){var t=[],n=[],r=new ht(e);t.push(r);var i=function(){for(var l=[],s=0;s<arguments.length;s++)l[s]=arguments[s];return r.getLanguageServiceWorker.apply(r,l)};function a(){var u=e.languageId,l=e.modeConfiguration;Pr(n),l.documentFormattingEdits&&n.push(monaco.languages.registerDocumentFormattingEditProvider(u,new Fn(i))),l.documentRangeFormattingEdits&&n.push(monaco.languages.registerDocumentRangeFormattingEditProvider(u,new Dn(i))),l.completionItems&&n.push(monaco.languages.registerCompletionItemProvider(u,new jn(i))),l.hovers&&n.push(monaco.languages.registerHoverProvider(u,new Mn(i))),l.documentSymbols&&n.push(monaco.languages.registerDocumentSymbolProvider(u,new _n(i))),l.tokens&&n.push(monaco.languages.setTokensProvider(u,$n(!0))),l.colors&&n.push(monaco.languages.registerColorProvider(u,new Vn(i))),l.foldingRanges&&n.push(monaco.languages.registerFoldingRangeProvider(u,new Un(i))),l.diagnostics&&n.push(new En(u,i,e)),l.selectionRanges&&n.push(monaco.languages.registerSelectionRangeProvider(u,new Bn(i)))}a(),t.push(monaco.languages.setLanguageConfiguration(e.languageId,ei));var c=e.modeConfiguration;return e.onDidChange(function(u){u.modeConfiguration!==c&&(c=u.modeConfiguration,a())}),t.push(Mr(n)),Mr(t)}function Mr(e){return{dispose:function(){return Pr(e)}}}function Pr(e){for(;e.length;)e.pop().dispose()}var ei={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}]}}}]);
|