UNPKG

monaco-sqlpad-test

Version:

![preview.gif](https://upload-images.jianshu.io/upload_images/11287122-31aabe9832be213f.gif?imageMogr2/auto-orient/strip)

1 lines 110 kB
(("undefined"!==typeof self?self:this)["webpackJsonpmonaco_sqlpad"]=("undefined"!==typeof self?self:this)["webpackJsonpmonaco_sqlpad"]||[]).push([[5],{"47b9":function(e,t,n){"use strict";n.r(t),n.d(t,"setupMode",(function(){return mn}));var r,i=12e4,o=function(){function e(e){var t=this;this._defaults=e,this._worker=null,this._idleCheckInterval=setInterval((function(){return t._checkIfIdle()}),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange((function(){return t._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){var e=Date.now()-this._lastUsedTime;e>i&&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 e,t=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return this._getClient().then((function(t){e=t})).then((function(e){return t._worker.withSyncedResources(n)})).then((function(t){return e}))},e}();function a(e,t){void 0===t&&(t=!1);var n=e.length,r=0,i="",o=0,a=16,l=0,f=0,h=0,p=0,m=0;function d(t,n){var i=0,o=0;while(i<t||!n){var a=e.charCodeAt(r);if(a>=48&&a<=57)o=16*o+a-48;else if(a>=65&&a<=70)o=16*o+a-65+10;else{if(!(a>=97&&a<=102))break;o=16*o+a-97+10}r++,i++}return i<t&&(o=-1),o}function g(e){r=e,i="",o=0,a=16,m=0}function v(){var t=r;if(48===e.charCodeAt(r))r++;else{r++;while(r<e.length&&c(e.charCodeAt(r)))r++}if(r<e.length&&46===e.charCodeAt(r)){if(r++,!(r<e.length&&c(e.charCodeAt(r))))return m=3,e.substring(t,r);r++;while(r<e.length&&c(e.charCodeAt(r)))r++}var n=r;if(r<e.length&&(69===e.charCodeAt(r)||101===e.charCodeAt(r)))if(r++,(r<e.length&&43===e.charCodeAt(r)||45===e.charCodeAt(r))&&r++,r<e.length&&c(e.charCodeAt(r))){r++;while(r<e.length&&c(e.charCodeAt(r)))r++;n=r}else m=3;return e.substring(t,n)}function y(){var t="",i=r;while(1){if(r>=n){t+=e.substring(i,r),m=2;break}var o=e.charCodeAt(r);if(34===o){t+=e.substring(i,r),r++;break}if(92!==o){if(o>=0&&o<=31){if(u(o)){t+=e.substring(i,r),m=2;break}m=6}r++}else{if(t+=e.substring(i,r),r++,r>=n){m=2;break}var a=e.charCodeAt(r++);switch(a){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:var s=d(4,!0);s>=0?t+=String.fromCharCode(s):m=4;break;default:m=5}i=r}}return t}function b(){if(i="",m=0,o=r,f=l,p=h,r>=n)return o=n,a=17;var t=e.charCodeAt(r);if(s(t)){do{r++,i+=String.fromCharCode(t),t=e.charCodeAt(r)}while(s(t));return a=15}if(u(t))return r++,i+=String.fromCharCode(t),13===t&&10===e.charCodeAt(r)&&(r++,i+="\n"),l++,h=r,a=14;switch(t){case 123:return r++,a=1;case 125:return r++,a=2;case 91:return r++,a=3;case 93:return r++,a=4;case 58:return r++,a=6;case 44:return r++,a=5;case 34:return r++,i=y(),a=10;case 47:var d=r-1;if(47===e.charCodeAt(r+1)){r+=2;while(r<n){if(u(e.charCodeAt(r)))break;r++}return i=e.substring(d,r),a=12}if(42===e.charCodeAt(r+1)){r+=2;var g=n-1,b=!1;while(r<g){var S=e.charCodeAt(r);if(42===S&&47===e.charCodeAt(r+1)){r+=2,b=!0;break}r++,u(S)&&(13===S&&10===e.charCodeAt(r)&&r++,l++,h=r)}return b||(r++,m=1),i=e.substring(d,r),a=13}return i+=String.fromCharCode(t),r++,a=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!c(e.charCodeAt(r)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=v(),a=11;default:while(r<n&&x(t))r++,t=e.charCodeAt(r);if(o!==r){switch(i=e.substring(o,r),i){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return i+=String.fromCharCode(t),r++,a=16}}function x(e){if(s(e)||u(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function S(){var e;do{e=b()}while(e>=12&&e<=15);return e}return{setPosition:g,getPosition:function(){return r},scan:t?S:b,getToken:function(){return a},getTokenValue:function(){return i},getTokenOffset:function(){return o},getTokenLength:function(){return r-o},getTokenStartLine:function(){return f},getTokenStartCharacter:function(){return o-p},getTokenError:function(){return m}}}function s(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function u(e){return 10===e||13===e||8232===e||8233===e}function c(e){return e>=48&&e<=57}function l(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=r.DEFAULT);var i=null,o=[],a=[];function s(e){Array.isArray(o)?o.push(e):null!==i&&(o[i]=e)}var u={onObjectBegin:function(){var e={};s(e),a.push(o),o=e,i=null},onObjectProperty:function(e){i=e},onObjectEnd:function(){o=a.pop()},onArrayBegin:function(){var e=[];s(e),a.push(o),o=e,i=null},onArrayEnd:function(){o=a.pop()},onLiteralValue:s,onError:function(e,n,r){t.push({error:e,offset:n,length:r})}};return d(e,u,n),o[0]}function f(e){if(!e.parent||!e.parent.children)return[];var t=f(e.parent);if("property"===e.parent.type){var n=e.parent.children[0].value;t.push(n)}else if("array"===e.parent.type){var r=e.parent.children.indexOf(e);-1!==r&&t.push(r)}return t}function h(e){switch(e.type){case"array":return e.children.map(h);case"object":for(var t=Object.create(null),n=0,r=e.children;n<r.length;n++){var i=r[n],o=i.children[1];o&&(t[i.children[0].value]=h(o))}return t;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function p(e,t,n){return void 0===n&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function m(e,t,n){if(void 0===n&&(n=!1),p(e,t,n)){var r=e.children;if(Array.isArray(r))for(var i=0;i<r.length&&r[i].offset<=t;i++){var o=m(r[i],t,n);if(o)return o}return e}}function d(e,t,n){void 0===n&&(n=r.DEFAULT);var i=a(e,!1);function o(e){return e?function(){return e(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}function s(e){return e?function(t){return e(t,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}var u=o(t.onObjectBegin),c=s(t.onObjectProperty),l=o(t.onObjectEnd),f=o(t.onArrayBegin),h=o(t.onArrayEnd),p=s(t.onLiteralValue),m=s(t.onSeparator),d=o(t.onComment),g=s(t.onError),v=n&&n.disallowComments,y=n&&n.allowTrailingComma;function b(){while(1){var e=i.scan();switch(i.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:v||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(e){case 12:case 13:v?x(10):d();break;case 16:x(1);break;case 15:case 14:break;default:return e}}}function x(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),g(e),t.length+n.length>0){var r=i.getToken();while(17!==r){if(-1!==t.indexOf(r)){b();break}if(-1!==n.indexOf(r))break;r=b()}}}function S(e){var t=i.getTokenValue();return e?p(t):c(t),b(),!0}function k(){switch(i.getToken()){case 11:var e=0;try{e=JSON.parse(i.getTokenValue()),"number"!==typeof e&&(x(2),e=0)}catch(t){x(2)}p(e);break;case 7:p(null);break;case 8:p(!0);break;case 9:p(!1);break;default:return!1}return b(),!0}function w(){return 10!==i.getToken()?(x(3,[],[2,5]),!1):(S(!1),6===i.getToken()?(m(":"),b(),I()||x(4,[],[2,5])):x(5,[],[2,5]),!0)}function C(){u(),b();var e=!1;while(2!==i.getToken()&&17!==i.getToken()){if(5===i.getToken()){if(e||x(4,[],[]),m(","),b(),2===i.getToken()&&y)break}else e&&x(6,[],[]);w()||x(4,[],[2,5]),e=!0}return l(),2!==i.getToken()?x(7,[2],[]):b(),!0}function A(){f(),b();var e=!1;while(4!==i.getToken()&&17!==i.getToken()){if(5===i.getToken()){if(e||x(4,[],[]),m(","),b(),4===i.getToken()&&y)break}else e&&x(6,[],[]);I()||x(4,[],[4,5]),e=!0}return h(),4!==i.getToken()?x(8,[4],[]):b(),!0}function I(){switch(i.getToken()){case 3:return A();case 1:return C();case 10:return S(!0);default:return k()}}return b(),17===i.getToken()?!!n.allowEmptyContent||(x(4,[],[]),!1):I()?(17!==i.getToken()&&x(9,[],[]),!0):(x(4,[],[]),!1)}(function(e){e.DEFAULT={allowTrailingComma:!1}})(r||(r={}));var g,v,y,b,x,S,k,w,C,A,I,T,E,O,j,P,M,_,V,F,N=a,R=l,$=m,L=f,D=h;function W(e,t){if(e===t)return!0;if(null===e||void 0===e||null===t||void 0===t)return!1;if(typeof e!==typeof t)return!1;if("object"!==typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!W(e[n],t[n]))return!1}else{var i=[];for(r in e)i.push(r);i.sort();var o=[];for(r in t)o.push(r);if(o.sort(),!W(i,o))return!1;for(n=0;n<i.length;n++)if(!W(e[i[n]],t[i[n]]))return!1}return!0}function U(e){return"number"===typeof e}function q(e){return"undefined"!==typeof e}function B(e){return"boolean"===typeof e}function K(e){return"string"===typeof e}(function(e){function t(e,t){return{line:e,character:t}}function n(e){var t=e;return Se.objectLiteral(t)&&Se.number(t.line)&&Se.number(t.character)}e.create=t,e.is=n})(g||(g={})),function(e){function t(e,t,n,r){if(Se.number(e)&&Se.number(t)&&Se.number(n)&&Se.number(r))return{start:g.create(e,t),end:g.create(n,r)};if(g.is(e)&&g.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+r+"]")}function n(e){var t=e;return Se.objectLiteral(t)&&g.is(t.start)&&g.is(t.end)}e.create=t,e.is=n}(v||(v={})),function(e){function t(e,t){return{uri:e,range:t}}function n(e){var t=e;return Se.defined(t)&&v.is(t.range)&&(Se.string(t.uri)||Se.undefined(t.uri))}e.create=t,e.is=n}(y||(y={})),function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}function n(e){var t=e;return Se.defined(t)&&v.is(t.targetRange)&&Se.string(t.targetUri)&&(v.is(t.targetSelectionRange)||Se.undefined(t.targetSelectionRange))&&(v.is(t.originSelectionRange)||Se.undefined(t.originSelectionRange))}e.create=t,e.is=n}(b||(b={})),function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}function n(e){var t=e;return Se.number(t.red)&&Se.number(t.green)&&Se.number(t.blue)&&Se.number(t.alpha)}e.create=t,e.is=n}(x||(x={})),function(e){function t(e,t){return{range:e,color:t}}function n(e){var t=e;return v.is(t.range)&&x.is(t.color)}e.create=t,e.is=n}(S||(S={})),function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}function n(e){var t=e;return Se.string(t.label)&&(Se.undefined(t.textEdit)||j.is(t))&&(Se.undefined(t.additionalTextEdits)||Se.typedArray(t.additionalTextEdits,j.is))}e.create=t,e.is=n}(k||(k={})),function(e){e["Comment"]="comment",e["Imports"]="imports",e["Region"]="region"}(w||(w={})),function(e){function t(e,t,n,r,i){var o={startLine:e,endLine:t};return Se.defined(n)&&(o.startCharacter=n),Se.defined(r)&&(o.endCharacter=r),Se.defined(i)&&(o.kind=i),o}function n(e){var t=e;return Se.number(t.startLine)&&Se.number(t.startLine)&&(Se.undefined(t.startCharacter)||Se.number(t.startCharacter))&&(Se.undefined(t.endCharacter)||Se.number(t.endCharacter))&&(Se.undefined(t.kind)||Se.string(t.kind))}e.create=t,e.is=n}(C||(C={})),function(e){function t(e,t){return{location:e,message:t}}function n(e){var t=e;return Se.defined(t)&&y.is(t.location)&&Se.string(t.message)}e.create=t,e.is=n}(A||(A={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(I||(I={})),function(e){e.Unnecessary=1,e.Deprecated=2}(T||(T={})),function(e){function t(e,t,n,r,i,o){var a={range:e,message:t};return Se.defined(n)&&(a.severity=n),Se.defined(r)&&(a.code=r),Se.defined(i)&&(a.source=i),Se.defined(o)&&(a.relatedInformation=o),a}function n(e){var t=e;return Se.defined(t)&&v.is(t.range)&&Se.string(t.message)&&(Se.number(t.severity)||Se.undefined(t.severity))&&(Se.number(t.code)||Se.string(t.code)||Se.undefined(t.code))&&(Se.string(t.source)||Se.undefined(t.source))&&(Se.undefined(t.relatedInformation)||Se.typedArray(t.relatedInformation,A.is))}e.create=t,e.is=n}(E||(E={})),function(e){function t(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={title:e,command:t};return Se.defined(n)&&n.length>0&&(i.arguments=n),i}function n(e){var t=e;return Se.defined(t)&&Se.string(t.title)&&Se.string(t.command)}e.create=t,e.is=n}(O||(O={})),function(e){function t(e,t){return{range:e,newText:t}}function n(e,t){return{range:{start:e,end:e},newText:t}}function r(e){return{range:e,newText:""}}function i(e){var t=e;return Se.objectLiteral(t)&&Se.string(t.newText)&&v.is(t.range)}e.replace=t,e.insert=n,e.del=r,e.is=i}(j||(j={})),function(e){function t(e,t){return{textDocument:e,edits:t}}function n(e){var t=e;return Se.defined(t)&&z.is(t.textDocument)&&Array.isArray(t.edits)}e.create=t,e.is=n}(P||(P={})),function(e){function t(e,t){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),n}function n(e){var t=e;return t&&"create"===t.kind&&Se.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Se.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Se.boolean(t.options.ignoreIfExists)))}e.create=t,e.is=n}(M||(M={})),function(e){function t(e,t,n){var r={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(r.options=n),r}function n(e){var t=e;return t&&"rename"===t.kind&&Se.string(t.oldUri)&&Se.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Se.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Se.boolean(t.options.ignoreIfExists)))}e.create=t,e.is=n}(_||(_={})),function(e){function t(e,t){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),n}function n(e){var t=e;return t&&"delete"===t.kind&&Se.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Se.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Se.boolean(t.options.ignoreIfNotExists)))}e.create=t,e.is=n}(V||(V={})),function(e){function t(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return Se.string(e.kind)?M.is(e)||_.is(e)||V.is(e):P.is(e)})))}e.is=t}(F||(F={}));var J,z,H,G,Z,X,Q,Y,ee,te,ne,re,ie,oe,ae,se,ue,ce,le,fe,he,pe,me,de,ge,ve,ye,be=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(j.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(j.replace(e,t))},e.prototype.delete=function(e){this.edits.push(j.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}();(function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach((function(e){if(P.is(e)){var n=new be(e.edits);t._textEditChanges[e.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new be(e.changes[n]);t._textEditChanges[n]=r})))}Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(z.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e,n=this._textEditChanges[t.uri];if(!n){var r=[],i={textDocument:t,edits:r};this._workspaceEdit.documentChanges.push(i),n=new be(r),this._textEditChanges[t.uri]=n}return n}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.");n=this._textEditChanges[e];if(!n){r=[];this._workspaceEdit.changes[e]=r,n=new be(r),this._textEditChanges[e]=n}return n},e.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(M.create(e,t))},e.prototype.renameFile=function(e,t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(_.create(e,t,n))},e.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(V.create(e,t))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")}})();(function(e){function t(e){return{uri:e}}function n(e){var t=e;return Se.defined(t)&&Se.string(t.uri)}e.create=t,e.is=n})(J||(J={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return Se.defined(t)&&Se.string(t.uri)&&(null===t.version||Se.number(t.version))}e.create=t,e.is=n}(z||(z={})),function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}function n(e){var t=e;return Se.defined(t)&&Se.string(t.uri)&&Se.string(t.languageId)&&Se.number(t.version)&&Se.string(t.text)}e.create=t,e.is=n}(H||(H={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(G||(G={})),function(e){function t(t){var n=t;return n===e.PlainText||n===e.Markdown}e.is=t}(G||(G={})),function(e){function t(e){var t=e;return Se.objectLiteral(e)&&G.is(t.kind)&&Se.string(t.value)}e.is=t}(Z||(Z={})),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}(X||(X={})),function(e){e.PlainText=1,e.Snippet=2}(Q||(Q={})),function(e){e.Deprecated=1}(Y||(Y={})),function(e){function t(e){return{label:e}}e.create=t}(ee||(ee={})),function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}e.create=t}(te||(te={})),function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(e){var t=e;return Se.string(t)||Se.objectLiteral(t)&&Se.string(t.language)&&Se.string(t.value)}e.fromPlainText=t,e.is=n}(ne||(ne={})),function(e){function t(e){var t=e;return!!t&&Se.objectLiteral(t)&&(Z.is(t.contents)||ne.is(t.contents)||Se.typedArray(t.contents,ne.is))&&(void 0===e.range||v.is(e.range))}e.is=t}(re||(re={})),function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t}(ie||(ie={})),function(e){function t(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={label:e};return Se.defined(t)&&(i.documentation=t),Se.defined(n)?i.parameters=n:i.parameters=[],i}e.create=t}(oe||(oe={})),function(e){e.Text=1,e.Read=2,e.Write=3}(ae||(ae={})),function(e){function t(e,t){var n={range:e};return Se.number(t)&&(n.kind=t),n}e.create=t}(se||(se={})),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}(ue||(ue={})),function(e){e.Deprecated=1}(ce||(ce={})),function(e){function t(e,t,n,r,i){var o={name:e,kind:t,location:{uri:r,range:n}};return i&&(o.containerName=i),o}e.create=t}(le||(le={})),function(e){function t(e,t,n,r,i,o){var a={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==o&&(a.children=o),a}function n(e){var t=e;return t&&Se.string(t.name)&&Se.number(t.kind)&&v.is(t.range)&&v.is(t.selectionRange)&&(void 0===t.detail||Se.string(t.detail))&&(void 0===t.deprecated||Se.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))}e.create=t,e.is=n}(fe||(fe={})),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"}(he||(he={})),function(e){function t(e,t){var n={diagnostics:e};return void 0!==t&&null!==t&&(n.only=t),n}function n(e){var t=e;return Se.defined(t)&&Se.typedArray(t.diagnostics,E.is)&&(void 0===t.only||Se.typedArray(t.only,Se.string))}e.create=t,e.is=n}(pe||(pe={})),function(e){function t(e,t,n){var r={title:e};return O.is(t)?r.command=t:r.edit=t,void 0!==n&&(r.kind=n),r}function n(e){var t=e;return t&&Se.string(t.title)&&(void 0===t.diagnostics||Se.typedArray(t.diagnostics,E.is))&&(void 0===t.kind||Se.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||O.is(t.command))&&(void 0===t.isPreferred||Se.boolean(t.isPreferred))&&(void 0===t.edit||F.is(t.edit))}e.create=t,e.is=n}(me||(me={})),function(e){function t(e,t){var n={range:e};return Se.defined(t)&&(n.data=t),n}function n(e){var t=e;return Se.defined(t)&&v.is(t.range)&&(Se.undefined(t.command)||O.is(t.command))}e.create=t,e.is=n}(de||(de={})),function(e){function t(e,t){return{tabSize:e,insertSpaces:t}}function n(e){var t=e;return Se.defined(t)&&Se.number(t.tabSize)&&Se.boolean(t.insertSpaces)}e.create=t,e.is=n}(ge||(ge={})),function(e){function t(e,t,n){return{range:e,target:t,data:n}}function n(e){var t=e;return Se.defined(t)&&v.is(t.range)&&(Se.undefined(t.target)||Se.string(t.target))}e.create=t,e.is=n}(ve||(ve={})),function(e){function t(e,t){return{range:e,parent:t}}function n(t){var n=t;return void 0!==n&&v.is(n.range)&&(void 0===n.parent||e.is(n.parent))}e.create=t,e.is=n}(ye||(ye={}));var xe;(function(e){function t(e,t,n,r){return new ke(e,t,n,r)}function n(e){var t=e;return!!(Se.defined(t)&&Se.string(t.uri)&&(Se.undefined(t.languageId)||Se.string(t.languageId))&&Se.number(t.lineCount)&&Se.func(t.getText)&&Se.func(t.positionAt)&&Se.func(t.offsetAt))}function r(e,t){for(var n=e.getText(),r=i(t,(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),o=n.length,a=r.length-1;a>=0;a--){var s=r[a],u=e.offsetAt(s.range.start),c=e.offsetAt(s.range.end);if(!(c<=o))throw new Error("Overlapping edit");n=n.substring(0,u)+s.newText+n.substring(c,n.length),o=u}return n}function i(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);i(r,t),i(o,t);var a=0,s=0,u=0;while(a<r.length&&s<o.length){var c=t(r[a],o[s]);e[u++]=c<=0?r[a++]:o[s++]}while(a<r.length)e[u++]=r[a++];while(s<o.length)e[u++]=o[s++];return e}e.create=t,e.is=n,e.applyEdits=r})(xe||(xe={}));var Se,ke=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,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(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var i=t.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return g.create(0,e);while(n<r){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return g.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}();(function(e){var t=Object.prototype.toString;function n(e){return"undefined"!==typeof e}function r(e){return"undefined"===typeof e}function i(e){return!0===e||!1===e}function o(e){return"[object String]"===t.call(e)}function a(e){return"[object Number]"===t.call(e)}function s(e){return"[object Function]"===t.call(e)}function u(e){return null!==e&&"object"===typeof e}function c(e,t){return Array.isArray(e)&&e.every(t)}e.defined=n,e.undefined=r,e.boolean=i,e.string=o,e.number=a,e.func=s,e.objectLiteral=u,e.typedArray=c})(Se||(Se={}));var we,Ce,Ae,Ie=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,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(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(t,n){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(e.isIncremental(o)){var a=Oe(o.range),s=this.offsetAt(a.start),u=this.offsetAt(a.end);this._content=this._content.substring(0,s)+o.text+this._content.substring(u,this._content.length);var c=Math.max(a.start.line,0),l=Math.max(a.end.line,0),f=this._lineOffsets,h=Ee(o.text,!1,s);if(l-c===h.length)for(var p=0,m=h.length;p<m;p++)f[p+c+1]=h[p];else h.length<1e4?f.splice.apply(f,[c+1,l-c].concat(h)):this._lineOffsets=f=f.slice(0,c+1).concat(h,f.slice(l+1));var d=o.text.length-(u-s);if(0!==d)for(p=c+1+h.length,m=f.length;p<m;p++)f[p]=f[p]+d}else{if(!e.isFull(o))throw new Error("Unknown change event received");this._content=o.text,this._lineOffsets=void 0}}this._version=n},e.prototype.getLineOffsets=function(){return void 0===this._lineOffsets&&(this._lineOffsets=Ee(this._content,!0)),this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return{line:0,character:e};while(n<r){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return{line:o,character:e-t[o]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e.isIncremental=function(e){var t=e;return void 0!==t&&null!==t&&"string"===typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"===typeof t.rangeLength)},e.isFull=function(e){var t=e;return void 0!==t&&null!==t&&"string"===typeof t.text&&void 0===t.range&&void 0===t.rangeLength},e}();function Te(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);Te(r,t),Te(i,t);var o=0,a=0,s=0;while(o<r.length&&a<i.length){var u=t(r[o],i[a]);e[s++]=u<=0?r[o++]:i[a++]}while(o<r.length)e[s++]=r[o++];while(a<i.length)e[s++]=i[a++];return e}function Ee(e,t,n){void 0===n&&(n=0);for(var r=t?[n]:[],i=0;i<e.length;i++){var o=e.charCodeAt(i);13!==o&&10!==o||(13===o&&i+1<e.length&&10===e.charCodeAt(i+1)&&i++,r.push(n+i+1))}return r}function Oe(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 je(e){var t=Oe(e.range);return t!==e.range?{newText:e.newText,range:t}:e}function Pe(e,t){var n;return n=0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,n){var r=n[0];return"undefined"!==typeof t[r]?t[r]:e})),n}function Me(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return Pe(t,n)}function _e(e){return Me}(function(e){function t(e,t,n,r){return new Ie(e,t,n,r)}function n(e,t,n){if(e instanceof Ie)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")}function r(e,t){for(var n=e.getText(),r=Te(t.map(je),(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),i=n.length,o=r.length-1;o>=0;o--){var a=r[o],s=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=i))throw new Error("Overlapping edit");n=n.substring(0,s)+a.newText+n.substring(u,n.length),i=s}return n}e.create=t,e.update=n,e.applyEdits=r})(we||(we={})),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"}(Ce||(Ce={})),function(e){e.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[G.Markdown,G.PlainText],commitCharactersSupport:!0}}}}}(Ae||(Ae={}));var Ve,Fe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ne=_e(),Re={"color-hex":{errorMessage:Ne("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:Ne("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:Ne("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:Ne("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:Ne("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,}))$/}},$e=function(){function e(e,t,n){this.offset=t,this.length=n,this.parent=e}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}();(function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="null",r.value=null,r}Fe(t,e)})($e),function(e){function t(t,n,r){var i=e.call(this,t,r)||this;return i.type="boolean",i.value=n,i}Fe(t,e)}($e),function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="array",r.items=[],r}Fe(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!0,configurable:!0})}($e),function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="number",r.isInteger=!0,r.value=Number.NaN,r}Fe(t,e)}($e),function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.type="string",i.value="",i}Fe(t,e)}($e),function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="property",r.colonOffset=-1,r}Fe(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!0,configurable:!0})}($e),function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="object",r.properties=[],r}Fe(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!0,configurable:!0})}($e);function Le(e){return B(e)?e?{}:{not:{}}:e}(function(e){e[e["Key"]=0]="Key",e[e["Enum"]=1]="Enum"})(Ve||(Ve={}));var De=function(){function e(e,t){void 0===e&&(e=-1),void 0===t&&(t=null),this.focusOffset=e,this.exclude=t,this.schemas=[]}return e.prototype.add=function(e){this.schemas.push(e)},e.prototype.merge=function(e){var t;(t=this.schemas).push.apply(t,e.schemas)},e.prototype.include=function(e){return(-1===this.focusOffset||Ke(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),We=function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.add=function(e){},e.prototype.merge=function(e){},e.prototype.include=function(e){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e}(),Ue=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(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];this.merge(r)}},e.prototype.merge=function(e){this.problems=this.problems.concat(e.problems)},e.prototype.mergeEnumValues=function(e){if(!this.enumValueMatch&&!e.enumValueMatch&&this.enumValues&&e.enumValues){this.enumValues=this.enumValues.concat(e.enumValues);for(var t=0,n=this.problems;t<n.length;t++){var r=n[t];r.code===Ce.EnumValueMismatch&&(r.message=Ne("enumWarning","Value is not accepted. Valid values: {0}.",this.enumValues.map((function(e){return JSON.stringify(e)})).join(", ")))}}},e.prototype.mergePropertyMatch=function(e){this.merge(e),this.propertiesMatches++,(e.enumValueMatch||!e.hasProblems()&&e.propertiesMatches)&&this.propertiesValueMatches++,e.enumValueMatch&&e.enumValues&&1===e.enumValues.length&&this.primaryValueMatches++},e.prototype.compare=function(e){var t=this.hasProblems();return t!==e.hasProblems()?t?-1:1:this.enumValueMatch!==e.enumValueMatch?e.enumValueMatch?-1:1:this.primaryValueMatches!==e.primaryValueMatches?this.primaryValueMatches-e.primaryValueMatches:this.propertiesValueMatches!==e.propertiesValueMatches?this.propertiesValueMatches-e.propertiesValueMatches:this.propertiesMatches-e.propertiesMatches},e}();function qe(e){return D(e)}function Be(e){return L(e)}function Ke(e,t,n){return void 0===n&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}(function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=[]),this.root=e,this.syntaxErrors=t,this.comments=n}e.prototype.getNodeFromOffset=function(e,t){if(void 0===t&&(t=!1),this.root)return $(this.root,e,t)},e.prototype.visit=function(e){if(this.root){var t=function(n){var r=e(n),i=n.children;if(Array.isArray(i))for(var o=0;o<i.length&&r;o++)r=t(i[o]);return r};t(this.root)}},e.prototype.validate=function(e,t){if(this.root&&t){var n=new Ue;return Je(this.root,t,n,We.instance),n.problems.map((function(t){var n=v.create(e.positionAt(t.location.offset),e.positionAt(t.location.offset+t.location.length));return E.create(n,t.message,t.severity,t.code)}))}return null},e.prototype.getMatchingSchemas=function(e,t,n){void 0===t&&(t=-1),void 0===n&&(n=null);var r=new De(t,n);return this.root&&e&&Je(this.root,e,new Ue,r),r.schemas}})();function Je(e,t,n,r){if(e&&r.include(e)){switch(e.type){case"object":u(e,t,n,r);break;case"array":s(e,t,n,r);break;case"string":a(e,t,n,r);break;case"number":o(e,t,n,r);break;case"property":return Je(e.valueNode,t,n,r)}i(),r.add({node:e,schema:t})}function i(){function i(t){return e.type===t||"integer"===t&&"number"===e.type&&e.isInteger}if(Array.isArray(t.type)?t.type.some(i)||n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||Ne("typeArrayMismatchWarning","Incorrect type. Expected one of {0}.",t.type.join(", "))}):t.type&&(i(t.type)||n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||Ne("typeMismatchWarning",'Incorrect type. Expected "{0}".',t.type)})),Array.isArray(t.allOf))for(var o=0,a=t.allOf;o<a.length;o++){var s=a[o];Je(e,Le(s),n,r)}var u=Le(t.not);if(u){var c=new Ue,l=r.newSub();Je(e,u,c,l),c.hasProblems()||n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("notSchemaWarning","Matches a schema that is not allowed.")});for(var f=0,h=l.schemas;f<h.length;f++){var p=h[f];p.inverted=!p.inverted,r.add(p)}}var m=function(t,i){for(var o=[],a=null,s=0,u=t;s<u.length;s++){var c=u[s],l=Le(c),f=new Ue,h=r.newSub();if(Je(e,l,f,h),f.hasProblems()||o.push(l),a)if(i||f.hasProblems()||a.validationResult.hasProblems()){var p=f.compare(a.validationResult);p>0?a={schema:l,validationResult:f,matchingSchemas:h}:0===p&&(a.matchingSchemas.merge(h),a.validationResult.mergeEnumValues(f))}else a.matchingSchemas.merge(h),a.validationResult.propertiesMatches+=f.propertiesMatches,a.validationResult.propertiesValueMatches+=f.propertiesValueMatches;else a={schema:l,validationResult:f,matchingSchemas:h}}return o.length>1&&i&&n.problems.push({location:{offset:e.offset,length:1},severity:I.Warning,message:Ne("oneOfWarning","Matches multiple schemas when only one must validate.")}),null!==a&&(n.merge(a.validationResult),n.propertiesMatches+=a.validationResult.propertiesMatches,n.propertiesValueMatches+=a.validationResult.propertiesValueMatches,r.merge(a.matchingSchemas)),o.length};Array.isArray(t.anyOf)&&m(t.anyOf,!1),Array.isArray(t.oneOf)&&m(t.oneOf,!0);var d=function(t){var i=new Ue,o=r.newSub();Je(e,Le(t),i,o),n.merge(i),n.propertiesMatches+=i.propertiesMatches,n.propertiesValueMatches+=i.propertiesValueMatches,r.merge(o)},g=function(t,n,i){var o=Le(t),a=new Ue,s=r.newSub();Je(e,o,a,s),r.merge(s),a.hasProblems()?i&&d(i):n&&d(n)},v=Le(t.if);if(v&&g(v,Le(t.then),Le(t.else)),Array.isArray(t.enum)){for(var y=qe(e),b=!1,x=0,S=t.enum;x<S.length;x++){var k=S[x];if(W(y,k)){b=!0;break}}n.enumValues=t.enum,n.enumValueMatch=b,b||n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,code:Ce.EnumValueMismatch,message:t.errorMessage||Ne("enumWarning","Value is not accepted. Valid values: {0}.",t.enum.map((function(e){return JSON.stringify(e)})).join(", "))})}if(q(t.const)){y=qe(e);W(y,t.const)?n.enumValueMatch=!0:(n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,code:Ce.EnumValueMismatch,message:t.errorMessage||Ne("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:I.Warning,message:t.deprecationMessage})}function o(e,t,n,r){var i=e.value;function o(e,t){return U(t)?t:B(t)&&t?e:void 0}function a(e,t){if(!B(t)||!t)return e}U(t.multipleOf)&&i%t.multipleOf!==0&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("multipleOfWarning","Value is not divisible by {0}.",t.multipleOf)});var s=o(t.minimum,t.exclusiveMinimum);U(s)&&i<=s&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("exclusiveMinimumWarning","Value is below the exclusive minimum of {0}.",s)});var u=o(t.maximum,t.exclusiveMaximum);U(u)&&i>=u&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",u)});var c=a(t.minimum,t.exclusiveMinimum);U(c)&&i<c&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("minimumWarning","Value is below the minimum of {0}.",c)});var l=a(t.maximum,t.exclusiveMaximum);U(l)&&i>l&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("maximumWarning","Value is above the maximum of {0}.",l)})}function a(e,t,n,r){if(U(t.minLength)&&e.value.length<t.minLength&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("minLengthWarning","String is shorter than the minimum length of {0}.",t.minLength)}),U(t.maxLength)&&e.value.length>t.maxLength&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("maxLengthWarning","String is longer than the maximum length of {0}.",t.maxLength)}),K(t.pattern)){var i=new RegExp(t.pattern);i.test(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.patternErrorMessage||t.errorMessage||Ne("patternWarning",'String does not match the pattern of "{0}".',t.pattern)})}if(t.format)switch(t.format){case"uri":case"uri-reference":var o=void 0;if(e.value){var a=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(e.value);a?a[2]||"uri"!==t.format||(o=Ne("uriSchemeMissing","URI with a scheme is expected.")):o=Ne("uriMissing","URI is expected.")}else o=Ne("uriEmpty","URI expected.");o&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.patternErrorMessage||t.errorMessage||Ne("uriFormatWarning","String is not a URI: {0}",o)});break;case"color-hex":case"date-time":case"date":case"time":case"email":var s=Re[t.format];e.value&&s.pattern.exec(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.patternErrorMessage||t.errorMessage||s.errorMessage});default:}}function s(e,t,n,r){if(Array.isArray(t.items)){for(var i=t.items,o=0;o<i.length;o++){var a=i[o],s=Le(a),u=new Ue,c=e.items[o];c?(Je(c,s,u,r),n.mergePropertyMatch(u)):e.items.length>=i.length&&n.propertiesValueMatches++}if(e.items.length>i.length)if("object"===typeof t.additionalItems)for(var l=i.length;l<e.items.length;l++){u=new Ue;Je(e.items[l],t.additionalItems,u,r),n.mergePropertyMatch(u)}else!1===t.additionalItems&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("additionalItemsWarning","Array has too many items according to schema. Expected {0} or fewer.",i.length)})}else{var f=Le(t.items);if(f)for(var h=0,p=e.items;h<p.length;h++){c=p[h],u=new Ue;Je(c,f,u,r),n.mergePropertyMatch(u)}}var m=Le(t.contains);if(m){var d=e.items.some((function(e){var t=new Ue;return Je(e,m,t,We.instance),!t.hasProblems()}));d||n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||Ne("requiredItemMissingWarning","Array does not contain required item.")})}if(U(t.minItems)&&e.items.length<t.minItems&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("minItemsWarning","Array has too few items. Expected {0} or more.",t.minItems)}),U(t.maxItems)&&e.items.length>t.maxItems&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("maxItemsWarning","Array has too many items. Expected {0} or fewer.",t.maxItems)}),!0===t.uniqueItems){var g=qe(e),v=g.some((function(e,t){return t!==g.lastIndexOf(e)}));v&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("uniqueItemsWarning","Array has duplicate items.")})}}function u(e,t,n,r){for(var i=Object.create(null),o=[],a=0,s=e.properties;a<s.length;a++){var u=s[a],c=u.keyNode.value;i[c]=u.valueNode,o.push(c)}if(Array.isArray(t.required))for(var l=0,f=t.required;l<f.length;l++){var h=f[l];if(!i[h]){var p=e.parent&&"property"===e.parent.type&&e.parent.keyNode,m=p?{offset:p.offset,length:p.length}:{offset:e.offset,length:1};n.problems.push({location:m,severity:I.Warning,message:Ne("MissingRequiredPropWarning",'Missing property "{0}".',h)})}}var d=function(e){var t=o.indexOf(e);while(t>=0)o.splice(t,1),t=o.indexOf(e)};if(t.properties)for(var g=0,v=Object.keys(t.properties);g<v.length;g++){h=v[g];d(h);var y=t.properties[h],b=i[h];if(b)if(B(y))if(y)n.propertiesMatches++,n.propertiesValueMatches++;else{u=b.parent;n.problems.push({location:{offset:u.keyNode.offset,length:u.keyNode.length},severity:I.Warning,message:t.errorMessage||Ne("DisallowedExtraPropWarning","Property {0} is not allowed.",h)})}else{var x=new Ue;Je(b,y,x,r),n.mergePropertyMatch(x)}}if(t.patternProperties)for(var S=0,k=Object.keys(t.patternProperties);S<k.length;S++)for(var w=k[S],C=new RegExp(w),A=0,T=o.slice(0);A<T.length;A++){h=T[A];if(C.test(h)){d(h);b=i[h];if(b){y=t.patternProperties[w];if(B(y))if(y)n.propertiesMatches++,n.propertiesValueMatches++;else{u=b.parent;n.problems.push({location:{offset:u.keyNode.offset,length:u.keyNode.length},severity:I.Warning,message:t.errorMessage||Ne("DisallowedExtraPropWarning","Property {0} is not allowed.",h)})}else{x=new Ue;Je(b,y,x,r),n.mergePropertyMatch(x)}}}}if("object"===typeof t.additionalProperties)for(var E=0,O=o;E<O.length;E++){h=O[E],b=i[h];if(b){x=new Ue;Je(b,t.additionalProperties,x,r),n.mergePropertyMatch(x)}}else if(!1===t.additionalProperties&&o.length>0)for(var j=0,P=o;j<P.length;j++){h=P[j],b=i[h];if(b){u=b.parent;n.problems.push({location:{offset:u.keyNode.offset,length:u.keyNode.length},severity:I.Warning,message:t.errorMessage||Ne("DisallowedExtraPropWarning","Property {0} is not allowed.",h)})}}if(U(t.maxProperties)&&e.properties.length>t.maxProperties&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("MaxPropWarning","Object has more properties than limit of {0}.",t.maxProperties)}),U(t.minProperties)&&e.properties.length<t.minProperties&&n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("MinPropWarning","Object has fewer properties than the required number of {0}",t.minProperties)}),t.dependencies)for(var M=0,_=Object.keys(t.dependencies);M<_.length;M++){c=_[M];var V=i[c];if(V){var F=t.dependencies[c];if(Array.isArray(F))for(var N=0,R=F;N<R.length;N++){var $=R[N];i[$]?n.propertiesValueMatches++:n.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:Ne("RequiredDependentPropWarning","Object is missing property {0} required by property {1}.",$,c)})}else{y=Le(F);if(y){x=new Ue;Je(e,y,x,r),n.mergePropertyMatch(x)}}}}var L=Le(t.propertyNames);if(L)for(var D=0,W=e.properties;D<W.length;D++){var q=W[D];c=q.keyNode;c&&Je(c,L,n,We.instance)}}}function ze(e,t,n){if(null!==e&&"object"===typeof e){var r=t+"\t";if(Array.isArray(e)){if(0===e.length)return"[]";for(var i="[\n",o=0;o<e.length;o++)i+=r+ze(e[o],r,n),o<e.length-1&&(i+=","),i+="\n";return i+=t+"]",i}var a=Object.keys(e);if(0===a.length)return"{}";for(i="{\n",o=0;o<a.length;o++){var s=a[o];i+=r+JSON.stringify(s)+": "+ze(e[s],r,n),o<a.length-1&&(i+=","),i+="\n"}return i+=t+"}",i}return n(e)}function He(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 Ge(e,t){var n=e.length-t.length;return n>0?e.lastIndexOf(t)===n:0===n&&e===t}function Ze(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}var Xe=_e(),Qe=[",","}","]"],Ye=[":"];(function(){function e(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=Promise),void 0===r&&(r={}),this.schemaService=e,this.contributions=t,this.promiseConstructor=n,this.clientCapabilities=r,this.templateVarIdCounter=0}e.prototype.doResolve=function(e){for(var t=this.contributions.length-1;t>=0;t--)if(this.contributions[t].resolveCompletion){var n=this.contributions[t].resolveCompletion(e);if(n)return n}return this.promiseConstructor.resolve(e)},e.prototype.doComplete=function(e,t,n){var r=this,i={items:[],isIncomplete:!1},o=e.getText(),a=e.offsetAt(t),s=n.getNodeFromOffset(a,!0);if(this.isInComment(e,s?s.offset:0,a))return Promise.resolve(i);if(s&&a===s.offset+s.length&&a>0){var u=o[a-1];("object"===s.type&&"}"===u||"array"===s.type&&"]"===u)&&(s=s.parent)}var c=this.getCurrentWord(e,a),l=null;if(!s||"string"!==s.type&&"number"!==s.type&&"boolean"!==s.type&&"null"!==s.type){var f=a-c.length;f>0&&'"'===o[f-1]&&f--,l=v.create(e.positionAt(f),t)}else l=v.create(e.positionAt(s.offset),e.positionAt(s.offset+s.length));var h=!1,p={},m={add:function(e){var t=e.label,n=p[t];if(n)n.documentation||(n.documentation=e.documentation);else{if(t=t.replace(/[\n]/g,"↵"),t.length>60){var r=t.substr(0,57).trim()+"...";p[r]||(t=r)}l&&(e.textEdit=j.replace(l,e.insertText)),h&&(e.commitCharacters=e.kind===X.Property?Ye:Qe),e.label=t,p[t]=e,i.items.push(e)}},setAsIncomplete:function(){i.isIncomplete=!0},error:function(e){console.error(e)},log:function(e){console.log(e)},getNumberOfProposals:function(){return i.items.length}};return this.schemaService.getSchemaForResource(e.uri,n).then((function(t){var u=[],f=!0,h="",d=null;if(s&&"string"===s.type){var g=s.parent;g&&"property"===g.type&&g.keyNode===s&&(f=!g.valueNode,d=g,h=o.substr(s.offset+1,s.length-2),g&&(s=g.parent))}if(s&&"object"===s.type){if(s.offset===a)return i;var v=s.properties;v.forEach((function(e){d&&d===e||(p[e.keyNode.value]=ee.create("__"))}));var y="";f&&(y=r.evaluateSeparatorAfter(e,e.offsetAt(l.end))),t?r.getPropertyCompletions(t,n,s,f,y,m):r.getSchemaLessPropertyCompletions(n,s,h,m);var b=Be(s);r.contributions.forEach((function(t){var n=t.collectPropertyCompletions(e.uri,b,c,f,""===y,m);n&&u.push(n)})),!t&&c.length>0&&'"'!==o.charAt(a-c.length-1)&&(m.add({kind:X.Property,lab