iobroker.javascript
Version:
Rules Engine for ioBroker
18 lines • 129 kB
JavaScript
/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
define("vs/language/json/jsonWorker", ["require","require"],(require)=>{
var moduleExports=(()=>{var ct=Object.defineProperty;var Hr=Object.getOwnPropertyDescriptor;var Gr=Object.getOwnPropertyNames;var Xr=Object.prototype.hasOwnProperty;var Zr=t=>ct(t,"__esModule",{value:!0});var Qr=(t,r)=>{for(var i in r)ct(t,i,{get:r[i],enumerable:!0})},Yr=(t,r,i,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Gr(r))!Xr.call(t,n)&&(i||n!=="default")&&ct(t,n,{get:()=>r[n],enumerable:!(e=Hr(r,n))||e.enumerable});return t};var Kr=(t=>(r,i)=>t&&t.get(r)||(i=Yr(Zr({}),r,1),t&&t.set(r,i),i))(typeof WeakMap!="undefined"?new WeakMap:0);var Hn={};Qr(Hn,{JSONWorker:()=>qt,create:()=>_n});function Ce(t,r){r===void 0&&(r=!1);var i=t.length,e=0,n="",a=0,s=16,o=0,f=0,l=0,u=0,c=0;function h(v,O){for(var E=0,j=0;E<v||!O;){var A=t.charCodeAt(e);if(A>=48&&A<=57)j=j*16+A-48;else if(A>=65&&A<=70)j=j*16+A-65+10;else if(A>=97&&A<=102)j=j*16+A-97+10;else break;e++,E++}return E<v&&(j=-1),j}function g(v){e=v,n="",a=0,s=16,c=0}function m(){var v=e;if(t.charCodeAt(e)===48)e++;else for(e++;e<t.length&&Oe(t.charCodeAt(e));)e++;if(e<t.length&&t.charCodeAt(e)===46)if(e++,e<t.length&&Oe(t.charCodeAt(e)))for(e++;e<t.length&&Oe(t.charCodeAt(e));)e++;else return c=3,t.substring(v,e);var O=e;if(e<t.length&&(t.charCodeAt(e)===69||t.charCodeAt(e)===101))if(e++,(e<t.length&&t.charCodeAt(e)===43||t.charCodeAt(e)===45)&&e++,e<t.length&&Oe(t.charCodeAt(e))){for(e++;e<t.length&&Oe(t.charCodeAt(e));)e++;O=e}else c=3;return t.substring(v,O)}function p(){for(var v="",O=e;;){if(e>=i){v+=t.substring(O,e),c=2;break}var E=t.charCodeAt(e);if(E===34){v+=t.substring(O,e),e++;break}if(E===92){if(v+=t.substring(O,e),e++,e>=i){c=2;break}var j=t.charCodeAt(e++);switch(j){case 34:v+='"';break;case 92:v+="\\";break;case 47:v+="/";break;case 98:v+="\b";break;case 102:v+="\f";break;case 110:v+=`
`;break;case 114:v+="\r";break;case 116:v+=" ";break;case 117:var A=h(4,!0);A>=0?v+=String.fromCharCode(A):c=4;break;default:c=5}O=e;continue}if(E>=0&&E<=31)if(Fe(E)){v+=t.substring(O,e),c=2;break}else c=6;e++}return v}function d(){if(n="",c=0,a=e,f=o,u=l,e>=i)return a=i,s=17;var v=t.charCodeAt(e);if(lt(v)){do e++,n+=String.fromCharCode(v),v=t.charCodeAt(e);while(lt(v));return s=15}if(Fe(v))return e++,n+=String.fromCharCode(v),v===13&&t.charCodeAt(e)===10&&(e++,n+=`
`),o++,l=e,s=14;switch(v){case 123:return e++,s=1;case 125:return e++,s=2;case 91:return e++,s=3;case 93:return e++,s=4;case 58:return e++,s=6;case 44:return e++,s=5;case 34:return e++,n=p(),s=10;case 47:var O=e-1;if(t.charCodeAt(e+1)===47){for(e+=2;e<i&&!Fe(t.charCodeAt(e));)e++;return n=t.substring(O,e),s=12}if(t.charCodeAt(e+1)===42){e+=2;for(var E=i-1,j=!1;e<E;){var A=t.charCodeAt(e);if(A===42&&t.charCodeAt(e+1)===47){e+=2,j=!0;break}e++,Fe(A)&&(A===13&&t.charCodeAt(e)===10&&e++,o++,l=e)}return j||(e++,c=1),n=t.substring(O,e),s=13}return n+=String.fromCharCode(v),e++,s=16;case 45:if(n+=String.fromCharCode(v),e++,e===i||!Oe(t.charCodeAt(e)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return n+=m(),s=11;default:for(;e<i&&b(v);)e++,v=t.charCodeAt(e);if(a!==e){switch(n=t.substring(a,e),n){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return n+=String.fromCharCode(v),e++,s=16}}function b(v){if(lt(v)||Fe(v))return!1;switch(v){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function y(){var v;do v=d();while(v>=12&&v<=15);return v}return{setPosition:g,getPosition:function(){return e},scan:r?y:d,getToken:function(){return s},getTokenValue:function(){return n},getTokenOffset:function(){return a},getTokenLength:function(){return e-a},getTokenStartLine:function(){return f},getTokenStartCharacter:function(){return a-u},getTokenError:function(){return c}}}function lt(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function Fe(t){return t===10||t===13||t===8232||t===8233}function Oe(t){return t>=48&&t<=57}function gt(t,r,i){var e,n,a,s,o;if(r){for(s=r.offset,o=s+r.length,a=s;a>0&&!dt(t,a-1);)a--;for(var f=o;f<t.length&&!dt(t,f);)f++;n=t.substring(a,f),e=tn(n,i)}else n=t,e=0,a=0,s=0,o=t.length;var l=rn(i,t),u=!1,c=0,h;i.insertSpaces?h=ht(" ",i.tabSize||4):h=" ";var g=Ce(n,!1),m=!1;function p(){return l+ht(h,e+c)}function d(){var N=g.scan();for(u=!1;N===15||N===14;)u=u||N===14,N=g.scan();return m=N===16||g.getTokenError()!==0,N}var b=[];function y(N,L,R){!m&&(!r||L<o&&R>s)&&t.substring(L,R)!==N&&b.push({offset:L,length:R-L,content:N})}var v=d();if(v!==17){var O=g.getTokenOffset()+a,E=ht(h,e);y(E,a,O)}for(;v!==17;){for(var j=g.getTokenOffset()+g.getTokenLength()+a,A=d(),P="",w=!1;!u&&(A===12||A===13);){var C=g.getTokenOffset()+a;y(" ",j,C),j=g.getTokenOffset()+g.getTokenLength()+a,w=A===12,P=w?p():"",A=d()}if(A===2)v!==1&&(c--,P=p());else if(A===4)v!==3&&(c--,P=p());else{switch(v){case 3:case 1:c++,P=p();break;case 5:case 12:P=p();break;case 13:u?P=p():w||(P=" ");break;case 6:w||(P=" ");break;case 10:if(A===6){w||(P="");break}case 7:case 8:case 9:case 11:case 2:case 4:A===12||A===13?w||(P=" "):A!==5&&A!==17&&(m=!0);break;case 16:m=!0;break}u&&(A===12||A===13)&&(P=p())}A===17&&(P=i.insertFinalNewline?l:"");var F=g.getTokenOffset()+a;y(P,j,F),v=A}return b}function ht(t,r){for(var i="",e=0;e<r;e++)i+=t;return i}function tn(t,r){for(var i=0,e=0,n=r.tabSize||4;i<t.length;){var a=t.charAt(i);if(a===" ")e++;else if(a===" ")e+=n;else break;i++}return Math.floor(e/n)}function rn(t,r){for(var i=0;i<r.length;i++){var e=r.charAt(i);if(e==="\r")return i+1<r.length&&r.charAt(i+1)===`
`?`\r
`:"\r";if(e===`
`)return`
`}return t&&t.eol||`
`}function dt(t,r){return`\r
`.indexOf(t.charAt(r))!==-1}var Be;(function(t){t.DEFAULT={allowTrailingComma:!1}})(Be||(Be={}));function Xt(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=Be.DEFAULT);var e=null,n=[],a=[];function s(f){Array.isArray(n)?n.push(f):e!==null&&(n[e]=f)}var o={onObjectBegin:function(){var f={};s(f),a.push(n),n=f,e=null},onObjectProperty:function(f){e=f},onObjectEnd:function(){n=a.pop()},onArrayBegin:function(){var f=[];s(f),a.push(n),n=f,e=null},onArrayEnd:function(){n=a.pop()},onLiteralValue:s,onError:function(f,l,u){r.push({error:f,offset:l,length:u})}};return Zt(t,o,i),n[0]}function pt(t){if(!t.parent||!t.parent.children)return[];var r=pt(t.parent);if(t.parent.type==="property"){var i=t.parent.children[0].value;r.push(i)}else if(t.parent.type==="array"){var e=t.parent.children.indexOf(t);e!==-1&&r.push(e)}return r}function _e(t){switch(t.type){case"array":return t.children.map(_e);case"object":for(var r=Object.create(null),i=0,e=t.children;i<e.length;i++){var n=e[i],a=n.children[1];a&&(r[n.children[0].value]=_e(a))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function an(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function mt(t,r,i){if(i===void 0&&(i=!1),an(t,r,i)){var e=t.children;if(Array.isArray(e))for(var n=0;n<e.length&&e[n].offset<=r;n++){var a=mt(e[n],r,i);if(a)return a}return t}}function Zt(t,r,i){i===void 0&&(i=Be.DEFAULT);var e=Ce(t,!1);function n(w){return w?function(){return w(e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter())}:function(){return!0}}function a(w){return w?function(C){return w(C,e.getTokenOffset(),e.getTokenLength(),e.getTokenStartLine(),e.getTokenStartCharacter())}:function(){return!0}}var s=n(r.onObjectBegin),o=a(r.onObjectProperty),f=n(r.onObjectEnd),l=n(r.onArrayBegin),u=n(r.onArrayEnd),c=a(r.onLiteralValue),h=a(r.onSeparator),g=n(r.onComment),m=a(r.onError),p=i&&i.disallowComments,d=i&&i.allowTrailingComma;function b(){for(;;){var w=e.scan();switch(e.getTokenError()){case 4:y(14);break;case 5:y(15);break;case 3:y(13);break;case 1:p||y(11);break;case 2:y(12);break;case 6:y(16);break}switch(w){case 12:case 13:p?y(10):g();break;case 16:y(1);break;case 15:case 14:break;default:return w}}}function y(w,C,F){if(C===void 0&&(C=[]),F===void 0&&(F=[]),m(w),C.length+F.length>0)for(var N=e.getToken();N!==17;){if(C.indexOf(N)!==-1){b();break}else if(F.indexOf(N)!==-1)break;N=b()}}function v(w){var C=e.getTokenValue();return w?c(C):o(C),b(),!0}function O(){switch(e.getToken()){case 11:var w=e.getTokenValue(),C=Number(w);isNaN(C)&&(y(2),C=0),c(C);break;case 7:c(null);break;case 8:c(!0);break;case 9:c(!1);break;default:return!1}return b(),!0}function E(){return e.getToken()!==10?(y(3,[],[2,5]),!1):(v(!1),e.getToken()===6?(h(":"),b(),P()||y(4,[],[2,5])):y(5,[],[2,5]),!0)}function j(){s(),b();for(var w=!1;e.getToken()!==2&&e.getToken()!==17;){if(e.getToken()===5){if(w||y(4,[],[]),h(","),b(),e.getToken()===2&&d)break}else w&&y(6,[],[]);E()||y(4,[],[2,5]),w=!0}return f(),e.getToken()!==2?y(7,[2],[]):b(),!0}function A(){l(),b();for(var w=!1;e.getToken()!==4&&e.getToken()!==17;){if(e.getToken()===5){if(w||y(4,[],[]),h(","),b(),e.getToken()===4&&d)break}else w&&y(6,[],[]);P()||y(4,[],[4,5]),w=!0}return u(),e.getToken()!==4?y(8,[4],[]):b(),!0}function P(){switch(e.getToken()){case 3:return A();case 1:return j();case 10:return v(!0);default:return O()}}return b(),e.getToken()===17?i.allowEmptyContent?!0:(y(4,[],[]),!1):P()?(e.getToken()!==17&&y(9,[],[]),!0):(y(4,[],[]),!1)}var le=Ce;var Qt=Xt;var Yt=mt,Kt=pt,er=_e;function tr(t,r,i){return gt(t,r,i)}function Pe(t,r){if(t===r)return!0;if(t==null||r===null||r===void 0||typeof t!=typeof r||typeof t!="object"||Array.isArray(t)!==Array.isArray(r))return!1;var i,e;if(Array.isArray(t)){if(t.length!==r.length)return!1;for(i=0;i<t.length;i++)if(!Pe(t[i],r[i]))return!1}else{var n=[];for(e in t)n.push(e);n.sort();var a=[];for(e in r)a.push(e);if(a.sort(),!Pe(n,a))return!1;for(i=0;i<n.length;i++)if(!Pe(t[n[i]],r[n[i]]))return!1}return!0}function ee(t){return typeof t=="number"}function se(t){return typeof t<"u"}function ie(t){return typeof t=="boolean"}function rr(t){return typeof t=="string"}function cn(t,r){if(t.length<r.length)return!1;for(var i=0;i<r.length;i++)if(t[i]!==r[i])return!1;return!0}function pe(t,r){var i=t.length-r.length;return i>0?t.lastIndexOf(r)===i:i===0?t===r:!1}function xe(t){var r="";cn(t,"(?i)")&&(t=t.substring(4),r="i");try{return new RegExp(t,r+"u")}catch{try{return new RegExp(t,r)}catch{return}}}var ir;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647})(ir||(ir={}));var Ge;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647})(Ge||(Ge={}));var re;(function(t){function r(e,n){return e===Number.MAX_VALUE&&(e=Ge.MAX_VALUE),n===Number.MAX_VALUE&&(n=Ge.MAX_VALUE),{line:e,character:n}}t.create=r;function i(e){var n=e;return x.objectLiteral(n)&&x.uinteger(n.line)&&x.uinteger(n.character)}t.is=i})(re||(re={}));var U;(function(t){function r(e,n,a,s){if(x.uinteger(e)&&x.uinteger(n)&&x.uinteger(a)&&x.uinteger(s))return{start:re.create(e,n),end:re.create(a,s)};if(re.is(e)&&re.is(n))return{start:e,end:n};throw new Error("Range#create called with invalid arguments["+e+", "+n+", "+a+", "+s+"]")}t.create=r;function i(e){var n=e;return x.objectLiteral(n)&&re.is(n.start)&&re.is(n.end)}t.is=i})(U||(U={}));var Se;(function(t){function r(e,n){return{uri:e,range:n}}t.create=r;function i(e){var n=e;return x.defined(n)&&U.is(n.range)&&(x.string(n.uri)||x.undefined(n.uri))}t.is=i})(Se||(Se={}));var ar;(function(t){function r(e,n,a,s){return{targetUri:e,targetRange:n,targetSelectionRange:a,originSelectionRange:s}}t.create=r;function i(e){var n=e;return x.defined(n)&&U.is(n.targetRange)&&x.string(n.targetUri)&&(U.is(n.targetSelectionRange)||x.undefined(n.targetSelectionRange))&&(U.is(n.originSelectionRange)||x.undefined(n.originSelectionRange))}t.is=i})(ar||(ar={}));var Xe;(function(t){function r(e,n,a,s){return{red:e,green:n,blue:a,alpha:s}}t.create=r;function i(e){var n=e;return x.numberRange(n.red,0,1)&&x.numberRange(n.green,0,1)&&x.numberRange(n.blue,0,1)&&x.numberRange(n.alpha,0,1)}t.is=i})(Xe||(Xe={}));var yt;(function(t){function r(e,n){return{range:e,color:n}}t.create=r;function i(e){var n=e;return U.is(n.range)&&Xe.is(n.color)}t.is=i})(yt||(yt={}));var bt;(function(t){function r(e,n,a){return{label:e,textEdit:n,additionalTextEdits:a}}t.create=r;function i(e){var n=e;return x.string(n.label)&&(x.undefined(n.textEdit)||Y.is(n))&&(x.undefined(n.additionalTextEdits)||x.typedArray(n.additionalTextEdits,Y.is))}t.is=i})(bt||(bt={}));var Ae;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Ae||(Ae={}));var xt;(function(t){function r(e,n,a,s,o){var f={startLine:e,endLine:n};return x.defined(a)&&(f.startCharacter=a),x.defined(s)&&(f.endCharacter=s),x.defined(o)&&(f.kind=o),f}t.create=r;function i(e){var n=e;return x.uinteger(n.startLine)&&x.uinteger(n.startLine)&&(x.undefined(n.startCharacter)||x.uinteger(n.startCharacter))&&(x.undefined(n.endCharacter)||x.uinteger(n.endCharacter))&&(x.undefined(n.kind)||x.string(n.kind))}t.is=i})(xt||(xt={}));var St;(function(t){function r(e,n){return{location:e,message:n}}t.create=r;function i(e){var n=e;return x.defined(n)&&Se.is(n.location)&&x.string(n.message)}t.is=i})(St||(St={}));var Z;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Z||(Z={}));var or;(function(t){t.Unnecessary=1,t.Deprecated=2})(or||(or={}));var sr;(function(t){function r(i){var e=i;return e!=null&&x.string(e.href)}t.is=r})(sr||(sr={}));var ae;(function(t){function r(e,n,a,s,o,f){var l={range:e,message:n};return x.defined(a)&&(l.severity=a),x.defined(s)&&(l.code=s),x.defined(o)&&(l.source=o),x.defined(f)&&(l.relatedInformation=f),l}t.create=r;function i(e){var n,a=e;return x.defined(a)&&U.is(a.range)&&x.string(a.message)&&(x.number(a.severity)||x.undefined(a.severity))&&(x.integer(a.code)||x.string(a.code)||x.undefined(a.code))&&(x.undefined(a.codeDescription)||x.string((n=a.codeDescription)===null||n===void 0?void 0:n.href))&&(x.string(a.source)||x.undefined(a.source))&&(x.undefined(a.relatedInformation)||x.typedArray(a.relatedInformation,St.is))}t.is=i})(ae||(ae={}));var Ee;(function(t){function r(e,n){for(var a=[],s=2;s<arguments.length;s++)a[s-2]=arguments[s];var o={title:e,command:n};return x.defined(a)&&a.length>0&&(o.arguments=a),o}t.create=r;function i(e){var n=e;return x.defined(n)&&x.string(n.title)&&x.string(n.command)}t.is=i})(Ee||(Ee={}));var Y;(function(t){function r(a,s){return{range:a,newText:s}}t.replace=r;function i(a,s){return{range:{start:a,end:a},newText:s}}t.insert=i;function e(a){return{range:a,newText:""}}t.del=e;function n(a){var s=a;return x.objectLiteral(s)&&x.string(s.newText)&&U.is(s.range)}t.is=n})(Y||(Y={}));var Ie;(function(t){function r(e,n,a){var s={label:e};return n!==void 0&&(s.needsConfirmation=n),a!==void 0&&(s.description=a),s}t.create=r;function i(e){var n=e;return n!==void 0&&x.objectLiteral(n)&&x.string(n.label)&&(x.boolean(n.needsConfirmation)||n.needsConfirmation===void 0)&&(x.string(n.description)||n.description===void 0)}t.is=i})(Ie||(Ie={}));var X;(function(t){function r(i){var e=i;return typeof e=="string"}t.is=r})(X||(X={}));var me;(function(t){function r(a,s,o){return{range:a,newText:s,annotationId:o}}t.replace=r;function i(a,s,o){return{range:{start:a,end:a},newText:s,annotationId:o}}t.insert=i;function e(a,s){return{range:a,newText:"",annotationId:s}}t.del=e;function n(a){var s=a;return Y.is(s)&&(Ie.is(s.annotationId)||X.is(s.annotationId))}t.is=n})(me||(me={}));var Le;(function(t){function r(e,n){return{textDocument:e,edits:n}}t.create=r;function i(e){var n=e;return x.defined(n)&&Qe.is(n.textDocument)&&Array.isArray(n.edits)}t.is=i})(Le||(Le={}));var Ve;(function(t){function r(e,n,a){var s={kind:"create",uri:e};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(s.options=n),a!==void 0&&(s.annotationId=a),s}t.create=r;function i(e){var n=e;return n&&n.kind==="create"&&x.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||x.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||x.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||X.is(n.annotationId))}t.is=i})(Ve||(Ve={}));var De;(function(t){function r(e,n,a,s){var o={kind:"rename",oldUri:e,newUri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}t.create=r;function i(e){var n=e;return n&&n.kind==="rename"&&x.string(n.oldUri)&&x.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||x.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||x.boolean(n.options.ignoreIfExists)))&&(n.annotationId===void 0||X.is(n.annotationId))}t.is=i})(De||(De={}));var $e;(function(t){function r(e,n,a){var s={kind:"delete",uri:e};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(s.options=n),a!==void 0&&(s.annotationId=a),s}t.create=r;function i(e){var n=e;return n&&n.kind==="delete"&&x.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||x.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||x.boolean(n.options.ignoreIfNotExists)))&&(n.annotationId===void 0||X.is(n.annotationId))}t.is=i})($e||($e={}));var Ze;(function(t){function r(i){var e=i;return e&&(e.changes!==void 0||e.documentChanges!==void 0)&&(e.documentChanges===void 0||e.documentChanges.every(function(n){return x.string(n.kind)?Ve.is(n)||De.is(n)||$e.is(n):Le.is(n)}))}t.is=r})(Ze||(Ze={}));var He=function(){function t(r,i){this.edits=r,this.changeAnnotations=i}return t.prototype.insert=function(r,i,e){var n,a;if(e===void 0?n=Y.insert(r,i):X.is(e)?(a=e,n=me.insert(r,i,e)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(e),n=me.insert(r,i,a)),this.edits.push(n),a!==void 0)return a},t.prototype.replace=function(r,i,e){var n,a;if(e===void 0?n=Y.replace(r,i):X.is(e)?(a=e,n=me.replace(r,i,e)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(e),n=me.replace(r,i,a)),this.edits.push(n),a!==void 0)return a},t.prototype.delete=function(r,i){var e,n;if(i===void 0?e=Y.del(r):X.is(i)?(n=i,e=me.del(r,i)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(i),e=me.del(r,n)),this.edits.push(e),n!==void 0)return n},t.prototype.add=function(r){this.edits.push(r)},t.prototype.all=function(){return this.edits},t.prototype.clear=function(){this.edits.splice(0,this.edits.length)},t.prototype.assertChangeAnnotations=function(r){if(r===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},t}(),fr=function(){function t(r){this._annotations=r===void 0?Object.create(null):r,this._counter=0,this._size=0}return t.prototype.all=function(){return this._annotations},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.manage=function(r,i){var e;if(X.is(r)?e=r:(e=this.nextId(),i=r),this._annotations[e]!==void 0)throw new Error("Id "+e+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+e);return this._annotations[e]=i,this._size++,e},t.prototype.nextId=function(){return this._counter++,this._counter.toString()},t}(),ii=function(){function t(r){var i=this;this._textEditChanges=Object.create(null),r!==void 0?(this._workspaceEdit=r,r.documentChanges?(this._changeAnnotations=new fr(r.changeAnnotations),r.changeAnnotations=this._changeAnnotations.all(),r.documentChanges.forEach(function(e){if(Le.is(e)){var n=new He(e.edits,i._changeAnnotations);i._textEditChanges[e.textDocument.uri]=n}})):r.changes&&Object.keys(r.changes).forEach(function(e){var n=new He(r.changes[e]);i._textEditChanges[e]=n})):this._workspaceEdit={}}return Object.defineProperty(t.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),t.prototype.getTextEditChange=function(r){if(Qe.is(r)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:r.uri,version:r.version},e=this._textEditChanges[i.uri];if(!e){var n=[],a={textDocument:i,edits:n};this._workspaceEdit.documentChanges.push(a),e=new He(n,this._changeAnnotations),this._textEditChanges[i.uri]=e}return e}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var e=this._textEditChanges[r];if(!e){var n=[];this._workspaceEdit.changes[r]=n,e=new He(n),this._textEditChanges[r]=e}return e}},t.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new fr,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},t.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},t.prototype.createFile=function(r,i,e){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;Ie.is(i)||X.is(i)?n=i:e=i;var a,s;if(n===void 0?a=Ve.create(r,e):(s=X.is(n)?n:this._changeAnnotations.manage(n),a=Ve.create(r,e,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s},t.prototype.renameFile=function(r,i,e,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;Ie.is(e)||X.is(e)?a=e:n=e;var s,o;if(a===void 0?s=De.create(r,i,n):(o=X.is(a)?a:this._changeAnnotations.manage(a),s=De.create(r,i,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o},t.prototype.deleteFile=function(r,i,e){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var n;Ie.is(i)||X.is(i)?n=i:e=i;var a,s;if(n===void 0?a=$e.create(r,e):(s=X.is(n)?n:this._changeAnnotations.manage(n),a=$e.create(r,e,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s},t}();var ur;(function(t){function r(e){return{uri:e}}t.create=r;function i(e){var n=e;return x.defined(n)&&x.string(n.uri)}t.is=i})(ur||(ur={}));var At;(function(t){function r(e,n){return{uri:e,version:n}}t.create=r;function i(e){var n=e;return x.defined(n)&&x.string(n.uri)&&x.integer(n.version)}t.is=i})(At||(At={}));var Qe;(function(t){function r(e,n){return{uri:e,version:n}}t.create=r;function i(e){var n=e;return x.defined(n)&&x.string(n.uri)&&(n.version===null||x.integer(n.version))}t.is=i})(Qe||(Qe={}));var cr;(function(t){function r(e,n,a,s){return{uri:e,languageId:n,version:a,text:s}}t.create=r;function i(e){var n=e;return x.defined(n)&&x.string(n.uri)&&x.string(n.languageId)&&x.integer(n.version)&&x.string(n.text)}t.is=i})(cr||(cr={}));var fe;(function(t){t.PlainText="plaintext",t.Markdown="markdown"})(fe||(fe={}));(function(t){function r(i){var e=i;return e===t.PlainText||e===t.Markdown}t.is=r})(fe||(fe={}));var Ye;(function(t){function r(i){var e=i;return x.objectLiteral(i)&&fe.is(e.kind)&&x.string(e.value)}t.is=r})(Ye||(Ye={}));var Q;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Q||(Q={}));var z;(function(t){t.PlainText=1,t.Snippet=2})(z||(z={}));var wt;(function(t){t.Deprecated=1})(wt||(wt={}));var lr;(function(t){function r(e,n,a){return{newText:e,insert:n,replace:a}}t.create=r;function i(e){var n=e;return n&&x.string(n.newText)&&U.is(n.insert)&&U.is(n.replace)}t.is=i})(lr||(lr={}));var hr;(function(t){t.asIs=1,t.adjustIndentation=2})(hr||(hr={}));var Re;(function(t){function r(i){return{label:i}}t.create=r})(Re||(Re={}));var Tt;(function(t){function r(i,e){return{items:i||[],isIncomplete:!!e}}t.create=r})(Tt||(Tt={}));var Ue;(function(t){function r(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=r;function i(e){var n=e;return x.string(n)||x.objectLiteral(n)&&x.string(n.language)&&x.string(n.value)}t.is=i})(Ue||(Ue={}));var kt;(function(t){function r(i){var e=i;return!!e&&x.objectLiteral(e)&&(Ye.is(e.contents)||Ue.is(e.contents)||x.typedArray(e.contents,Ue.is))&&(i.range===void 0||U.is(i.range))}t.is=r})(kt||(kt={}));var dr;(function(t){function r(i,e){return e?{label:i,documentation:e}:{label:i}}t.create=r})(dr||(dr={}));var gr;(function(t){function r(i,e){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];var s={label:i};return x.defined(e)&&(s.documentation=e),x.defined(n)?s.parameters=n:s.parameters=[],s}t.create=r})(gr||(gr={}));var Ot;(function(t){t.Text=1,t.Read=2,t.Write=3})(Ot||(Ot={}));var Ct;(function(t){function r(i,e){var n={range:i};return x.number(e)&&(n.kind=e),n}t.create=r})(Ct||(Ct={}));var oe;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(oe||(oe={}));var pr;(function(t){t.Deprecated=1})(pr||(pr={}));var Pt;(function(t){function r(i,e,n,a,s){var o={name:i,kind:e,location:{uri:a,range:n}};return s&&(o.containerName=s),o}t.create=r})(Pt||(Pt={}));var It;(function(t){function r(e,n,a,s,o,f){var l={name:e,detail:n,kind:a,range:s,selectionRange:o};return f!==void 0&&(l.children=f),l}t.create=r;function i(e){var n=e;return n&&x.string(n.name)&&x.number(n.kind)&&U.is(n.range)&&U.is(n.selectionRange)&&(n.detail===void 0||x.string(n.detail))&&(n.deprecated===void 0||x.boolean(n.deprecated))&&(n.children===void 0||Array.isArray(n.children))&&(n.tags===void 0||Array.isArray(n.tags))}t.is=i})(It||(It={}));var Et;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Et||(Et={}));var jt;(function(t){function r(e,n){var a={diagnostics:e};return n!=null&&(a.only=n),a}t.create=r;function i(e){var n=e;return x.defined(n)&&x.typedArray(n.diagnostics,ae.is)&&(n.only===void 0||x.typedArray(n.only,x.string))}t.is=i})(jt||(jt={}));var Nt;(function(t){function r(e,n,a){var s={title:e},o=!0;return typeof n=="string"?(o=!1,s.kind=n):Ee.is(n)?s.command=n:s.edit=n,o&&a!==void 0&&(s.kind=a),s}t.create=r;function i(e){var n=e;return n&&x.string(n.title)&&(n.diagnostics===void 0||x.typedArray(n.diagnostics,ae.is))&&(n.kind===void 0||x.string(n.kind))&&(n.edit!==void 0||n.command!==void 0)&&(n.command===void 0||Ee.is(n.command))&&(n.isPreferred===void 0||x.boolean(n.isPreferred))&&(n.edit===void 0||Ze.is(n.edit))}t.is=i})(Nt||(Nt={}));var mr;(function(t){function r(e,n){var a={range:e};return x.defined(n)&&(a.data=n),a}t.create=r;function i(e){var n=e;return x.defined(n)&&U.is(n.range)&&(x.undefined(n.command)||Ee.is(n.command))}t.is=i})(mr||(mr={}));var vr;(function(t){function r(e,n){return{tabSize:e,insertSpaces:n}}t.create=r;function i(e){var n=e;return x.defined(n)&&x.uinteger(n.tabSize)&&x.boolean(n.insertSpaces)}t.is=i})(vr||(vr={}));var Mt;(function(t){function r(e,n,a){return{range:e,target:n,data:a}}t.create=r;function i(e){var n=e;return x.defined(n)&&U.is(n.range)&&(x.undefined(n.target)||x.string(n.target))}t.is=i})(Mt||(Mt={}));var je;(function(t){function r(e,n){return{range:e,parent:n}}t.create=r;function i(e){var n=e;return n!==void 0&&U.is(n.range)&&(n.parent===void 0||t.is(n.parent))}t.is=i})(je||(je={}));var yr;(function(t){function r(a,s,o,f){return new ln(a,s,o,f)}t.create=r;function i(a){var s=a;return!!(x.defined(s)&&x.string(s.uri)&&(x.undefined(s.languageId)||x.string(s.languageId))&&x.uinteger(s.lineCount)&&x.func(s.getText)&&x.func(s.positionAt)&&x.func(s.offsetAt))}t.is=i;function e(a,s){for(var o=a.getText(),f=n(s,function(m,p){var d=m.range.start.line-p.range.start.line;return d===0?m.range.start.character-p.range.start.character:d}),l=o.length,u=f.length-1;u>=0;u--){var c=f[u],h=a.offsetAt(c.range.start),g=a.offsetAt(c.range.end);if(g<=l)o=o.substring(0,h)+c.newText+o.substring(g,o.length);else throw new Error("Overlapping edit");l=h}return o}t.applyEdits=e;function n(a,s){if(a.length<=1)return a;var o=a.length/2|0,f=a.slice(0,o),l=a.slice(o);n(f,s),n(l,s);for(var u=0,c=0,h=0;u<f.length&&c<l.length;){var g=s(f[u],l[c]);g<=0?a[h++]=f[u++]:a[h++]=l[c++]}for(;u<f.length;)a[h++]=f[u++];for(;c<l.length;)a[h++]=l[c++];return a}})(yr||(yr={}));var ln=function(){function t(r,i,e,n){this._uri=r,this._languageId=i,this._version=e,this._content=n,this._lineOffsets=void 0}return Object.defineProperty(t.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),t.prototype.getText=function(r){if(r){var i=this.offsetAt(r.start),e=this.offsetAt(r.end);return this._content.substring(i,e)}return this._content},t.prototype.update=function(r,i){this._content=r.text,this._version=i,this._lineOffsets=void 0},t.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var r=[],i=this._content,e=!0,n=0;n<i.length;n++){e&&(r.push(n),e=!1);var a=i.charAt(n);e=a==="\r"||a===`
`,a==="\r"&&n+1<i.length&&i.charAt(n+1)===`
`&&n++}e&&i.length>0&&r.push(i.length),this._lineOffsets=r}return this._lineOffsets},t.prototype.positionAt=function(r){r=Math.max(Math.min(r,this._content.length),0);var i=this.getLineOffsets(),e=0,n=i.length;if(n===0)return re.create(0,r);for(;e<n;){var a=Math.floor((e+n)/2);i[a]>r?n=a:e=a+1}var s=e-1;return re.create(s,r-i[s])},t.prototype.offsetAt=function(r){var i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;var e=i[r.line],n=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(e+r.character,n),e)},Object.defineProperty(t.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),t}(),x;(function(t){var r=Object.prototype.toString;function i(g){return typeof g<"u"}t.defined=i;function e(g){return typeof g>"u"}t.undefined=e;function n(g){return g===!0||g===!1}t.boolean=n;function a(g){return r.call(g)==="[object String]"}t.string=a;function s(g){return r.call(g)==="[object Number]"}t.number=s;function o(g,m,p){return r.call(g)==="[object Number]"&&m<=g&&g<=p}t.numberRange=o;function f(g){return r.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}t.integer=f;function l(g){return r.call(g)==="[object Number]"&&0<=g&&g<=2147483647}t.uinteger=l;function u(g){return r.call(g)==="[object Function]"}t.func=u;function c(g){return g!==null&&typeof g=="object"}t.objectLiteral=c;function h(g,m){return Array.isArray(g)&&g.every(m)}t.typedArray=h})(x||(x={}));var Ne=class{constructor(r,i,e,n){this._uri=r,this._languageId=i,this._version=e,this._content=n,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(r){if(r){let i=this.offsetAt(r.start),e=this.offsetAt(r.end);return this._content.substring(i,e)}return this._content}update(r,i){for(let e of r)if(Ne.isIncremental(e)){let n=xr(e.range),a=this.offsetAt(n.start),s=this.offsetAt(n.end);this._content=this._content.substring(0,a)+e.text+this._content.substring(s,this._content.length);let o=Math.max(n.start.line,0),f=Math.max(n.end.line,0),l=this._lineOffsets,u=br(e.text,!1,a);if(f-o===u.length)for(let h=0,g=u.length;h<g;h++)l[h+o+1]=u[h];else u.length<1e4?l.splice(o+1,f-o,...u):this._lineOffsets=l=l.slice(0,o+1).concat(u,l.slice(f+1));let c=e.text.length-(s-a);if(c!==0)for(let h=o+1+u.length,g=l.length;h<g;h++)l[h]=l[h]+c}else if(Ne.isFull(e))this._content=e.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=i}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=br(this._content,!0)),this._lineOffsets}positionAt(r){r=Math.max(Math.min(r,this._content.length),0);let i=this.getLineOffsets(),e=0,n=i.length;if(n===0)return{line:0,character:r};for(;e<n;){let s=Math.floor((e+n)/2);i[s]>r?n=s:e=s+1}let a=e-1;return{line:a,character:r-i[a]}}offsetAt(r){let i=this.getLineOffsets();if(r.line>=i.length)return this._content.length;if(r.line<0)return 0;let e=i[r.line],n=r.line+1<i.length?i[r.line+1]:this._content.length;return Math.max(Math.min(e+r.character,n),e)}get lineCount(){return this.getLineOffsets().length}static isIncremental(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}static isFull(r){let i=r;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}},We;(function(t){function r(n,a,s,o){return new Ne(n,a,s,o)}t.create=r;function i(n,a,s){if(n instanceof Ne)return n.update(a,s),n;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=i;function e(n,a){let s=n.getText(),o=Ft(a.map(hn),(u,c)=>{let h=u.range.start.line-c.range.start.line;return h===0?u.range.start.character-c.range.start.character:h}),f=0,l=[];for(let u of o){let c=n.offsetAt(u.range.start);if(c<f)throw new Error("Overlapping edit");c>f&&l.push(s.substring(f,c)),u.newText.length&&l.push(u.newText),f=n.offsetAt(u.range.end)}return l.push(s.substr(f)),l.join("")}t.applyEdits=e})(We||(We={}));function Ft(t,r){if(t.length<=1)return t;let i=t.length/2|0,e=t.slice(0,i),n=t.slice(i);Ft(e,r),Ft(n,r);let a=0,s=0,o=0;for(;a<e.length&&s<n.length;)r(e[a],n[s])<=0?t[o++]=e[a++]:t[o++]=n[s++];for(;a<e.length;)t[o++]=e[a++];for(;s<n.length;)t[o++]=n[s++];return t}function br(t,r,i=0){let e=r?[i]:[];for(let n=0;n<t.length;n++){let a=t.charCodeAt(n);(a===13||a===10)&&(a===13&&n+1<t.length&&t.charCodeAt(n+1)===10&&n++,e.push(i+n+1))}return e}function xr(t){let r=t.start,i=t.end;return r.line>i.line||r.line===i.line&&r.character>i.character?{start:i,end:r}:t}function hn(t){let r=xr(t.range);return r!==t.range?{newText:t.newText,range:r}:t}var W;(function(t){t[t.Undefined=0]="Undefined",t[t.EnumValueMismatch=1]="EnumValueMismatch",t[t.Deprecated=2]="Deprecated",t[t.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=258]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",t[t.InvalidUnicode=260]="InvalidUnicode",t[t.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",t[t.InvalidCharacter=262]="InvalidCharacter",t[t.PropertyExpected=513]="PropertyExpected",t[t.CommaExpected=514]="CommaExpected",t[t.ColonExpected=515]="ColonExpected",t[t.ValueExpected=516]="ValueExpected",t[t.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",t[t.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",t[t.TrailingComma=519]="TrailingComma",t[t.DuplicateKey=520]="DuplicateKey",t[t.CommentNotPermitted=521]="CommentNotPermitted",t[t.SchemaResolveError=768]="SchemaResolveError"})(W||(W={}));var Sr;(function(t){t.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[fe.Markdown,fe.PlainText],commitCharactersSupport:!0}}}}})(Sr||(Sr={}));function dn(t,r){let i;return r.length===0?i=t:i=t.replace(/\{(\d+)\}/g,(e,n)=>{let a=n[0];return typeof r[a]<"u"?r[a]:e}),i}function gn(t,r,...i){return dn(r,i)}function he(t){return gn}var we=function(){var t=function(r,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])},t(r,i)};return function(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(r,i);function e(){this.constructor=r}r.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}}(),M=he(),pn={"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-Z0-9-]+\.)+[a-zA-Z]{2,}))$/},hostname:{errorMessage:M("hostnameFormatWarning","String is not a hostname."),pattern:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i},ipv4:{errorMessage:M("ipv4FormatWarning","String is not an IPv4 address."),pattern:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/},ipv6:{errorMessage:M("ipv6FormatWarning","String is not an IPv6 address."),pattern:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i}},Te=function(){function t(r,i,e){e===void 0&&(e=0),this.offset=i,this.length=e,this.parent=r}return Object.defineProperty(t.prototype,"children",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},t}();var mn=function(t){we(r,t);function r(i,e){var n=t.call(this,i,e)||this;return n.type="null",n.value=null,n}return r}(Te);var Ar=function(t){we(r,t);function r(i,e,n){var a=t.call(this,i,n)||this;return a.type="boolean",a.value=e,a}return r}(Te);var vn=function(t){we(r,t);function r(i,e){var n=t.call(this,i,e)||this;return n.type="array",n.items=[],n}return Object.defineProperty(r.prototype,"children",{get:function(){return this.items},enumerable:!1,configurable:!0}),r}(Te);var yn=function(t){we(r,t);function r(i,e){var n=t.call(this,i,e)||this;return n.type="number",n.isInteger=!0,n.value=Number.NaN,n}return r}(Te);var Lt=function(t){we(r,t);function r(i,e,n){var a=t.call(this,i,e,n)||this;return a.type="string",a.value="",a}return r}(Te);var bn=function(t){we(r,t);function r(i,e,n){var a=t.call(this,i,e)||this;return a.type="property",a.colonOffset=-1,a.keyNode=n,a}return Object.defineProperty(r.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!1,configurable:!0}),r}(Te);var xn=function(t){we(r,t);function r(i,e){var n=t.call(this,i,e)||this;return n.type="object",n.properties=[],n}return Object.defineProperty(r.prototype,"children",{get:function(){return this.properties},enumerable:!1,configurable:!0}),r}(Te);function K(t){return ie(t)?t?{}:{not:{}}:t}var wr;(function(t){t[t.Key=0]="Key",t[t.Enum=1]="Enum"})(wr||(wr={}));var Sn=function(){function t(r,i){r===void 0&&(r=-1),this.focusOffset=r,this.exclude=i,this.schemas=[]}return t.prototype.add=function(r){this.schemas.push(r)},t.prototype.merge=function(r){Array.prototype.push.apply(this.schemas,r.schemas)},t.prototype.include=function(r){return(this.focusOffset===-1||Dt(r,this.focusOffset))&&r!==this.exclude},t.prototype.newSub=function(){return new t(-1,this.exclude)},t}(),Vt=function(){function t(){}return Object.defineProperty(t.prototype,"schemas",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.add=function(r){},t.prototype.merge=function(r){},t.prototype.include=function(r){return!0},t.prototype.newSub=function(){return this},t.instance=new t,t}(),te=function(){function t(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=void 0}return t.prototype.hasProblems=function(){return!!this.problems.length},t.prototype.mergeAll=function(r){for(var i=0,e=r;i<e.length;i++){var n=e[i];this.merge(n)}},t.prototype.merge=function(r){this.problems=this.problems.concat(r.problems)},t.prototype.mergeEnumValues=function(r){if(!this.enumValueMatch&&!r.enumValueMatch&&this.enumValues&&r.enumValues){this.enumValues=this.enumValues.concat(r.enumValues);for(var i=0,e=this.problems;i<e.length;i++){var n=e[i];n.code===W.EnumValueMismatch&&(n.message=M("enumWarning","Value is not accepted. Valid values: {0}.",this.enumValues.map(function(a){return JSON.stringify(a)}).join(", ")))}}},t.prototype.mergePropertyMatch=function(r){this.merge(r),this.propertiesMatches++,(r.enumValueMatch||!r.hasProblems()&&r.propertiesMatches)&&this.propertiesValueMatches++,r.enumValueMatch&&r.enumValues&&r.enumValues.length===1&&this.primaryValueMatches++},t.prototype.compare=function(r){var i=this.hasProblems();return i!==r.hasProblems()?i?-1:1:this.enumValueMatch!==r.enumValueMatch?r.enumValueMatch?-1:1:this.primaryValueMatches!==r.primaryValueMatches?this.primaryValueMatches-r.primaryValueMatches:this.propertiesValueMatches!==r.propertiesValueMatches?this.propertiesValueMatches-r.propertiesValueMatches:this.propertiesMatches-r.propertiesMatches},t}();function Tr(t,r){return r===void 0&&(r=[]),new kr(t,r,[])}function ge(t){return er(t)}function qe(t){return Kt(t)}function Dt(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}var kr=function(){function t(r,i,e){i===void 0&&(i=[]),e===void 0&&(e=[]),this.root=r,this.syntaxErrors=i,this.comments=e}return t.prototype.getNodeFromOffset=function(r,i){if(i===void 0&&(i=!1),this.root)return Yt(this.root,r,i)},t.prototype.visit=function(r){if(this.root){var i=function(e){var n=r(e),a=e.children;if(Array.isArray(a))for(var s=0;s<a.length&&n;s++)n=i(a[s]);return n};i(this.root)}},t.prototype.validate=function(r,i,e){if(e===void 0&&(e=Z.Warning),this.root&&i){var n=new te;return _(this.root,i,n,Vt.instance),n.problems.map(function(a){var s,o=U.create(r.positionAt(a.location.offset),r.positionAt(a.location.offset+a.location.length));return ae.create(o,a.message,(s=a.severity)!==null&&s!==void 0?s:e,a.code)})}},t.prototype.getMatchingSchemas=function(r,i,e){i===void 0&&(i=-1);var n=new Sn(i,e);return this.root&&r&&_(this.root,r,new te,n),n.schemas},t}();function _(t,r,i,e){if(!t||!e.include(t))return;var n=t;switch(n.type){case"object":l(n,r,i,e);break;case"array":f(n,r,i,e);break;case"string":o(n,r,i,e);break;case"number":s(n,r,i,e);break;case"property":return _(n.valueNode,r,i,e)}a(),e.add({node:n,schema:r});function a(){function u(L){return n.type===L||L==="integer"&&n.type==="number"&&n.isInteger}if(Array.isArray(r.type)?r.type.some(u)||i.problems.push({location:{offset:n.offset,length:n.length},message:r.errorMessage||M("typeArrayMismatchWarning","Incorrect type. Expected one of {0}.",r.type.join(", "))}):r.type&&(u(r.type)||i.problems.push({location:{offset:n.offset,length:n.length},message:r.errorMessage||M("typeMismatchWarning",'Incorrect type. Expected "{0}".',r.type)})),Array.isArray(r.allOf))for(var c=0,h=r.allOf;c<h.length;c++){var g=h[c];_(n,K(g),i,e)}var m=K(r.not);if(m){var p=new te,d=e.newSub();_(n,m,p,d),p.hasProblems()||i.problems.push({location:{offset:n.offset,length:n.length},message:M("notSchemaWarning","Matches a schema that is not allowed.")});for(var b=0,y=d.schemas;b<y.length;b++){var v=y[b];v.inverted=!v.inverted,e.add(v)}}var O=function(L,R){for(var H=[],q=void 0,T=0,S=L;T<S.length;T++){var k=S[T],I=K(k),V=new te,$=e.newSub();if(_(n,I,V,$),V.hasProblems()||H.push(I),!q)q={schema:I,validationResult:V,matchingSchemas:$};else if(!R&&!V.hasProblems()&&!q.validationResult.hasProblems())q.matchingSchemas.merge($),q.validationResult.propertiesMatches+=V.propertiesMatches,q.validationResult.propertiesValueMatches+=V.propertiesValueMatches;else{var J=V.compare(q.validationResult);J>0?q={schema:I,validationResult:V,matchingSchemas:$}:J===0&&(q.matchingSchemas.merge($),q.validationResult.mergeEnumValues(V))}}return H.length>1&&R&&i.problems.push({location:{offset:n.offset,length:1},message:M("oneOfWarning","Matches multiple schemas when only one must validate.")}),q&&(i.merge(q.validationResult),i.propertiesMatches+=q.validationResult.propertiesMatches,i.propertiesValueMatches+=q.validationResult.propertiesValueMatches,e.merge(q.matchingSchemas)),H.length};Array.isArray(r.anyOf)&&O(r.anyOf,!1),Array.isArray(r.oneOf)&&O(r.oneOf,!0);var E=function(L){var R=new te,H=e.newSub();_(n,K(L),R,H),i.merge(R),i.propertiesMatches+=R.propertiesMatches,i.propertiesValueMatches+=R.propertiesValueMatches,e.merge(H)},j=function(L,R,H){var q=K(L),T=new te,S=e.newSub();_(n,q,T,S),e.merge(S),T.hasProblems()?H&&E(H):R&&E(R)},A=K(r.if);if(A&&j(A,K(r.then),K(r.else)),Array.isArray(r.enum)){for(var P=ge(n),w=!1,C=0,F=r.enum;C<F.length;C++){var N=F[C];if(Pe(P,N)){w=!0;break}}i.enumValues=r.enum,i.enumValueMatch=w,w||i.problems.push({location:{offset:n.offset,length:n.length},code:W.EnumValueMismatch,message:r.errorMessage||M("enumWarning","Value is not accepted. Valid values: {0}.",r.enum.map(function(L){return JSON.stringify(L)}).join(", "))})}if(se(r.const)){var P=ge(n);Pe(P,r.const)?i.enumValueMatch=!0:(i.problems.push({location:{offset:n.offset,length:n.length},code:W.EnumValueMismatch,message:r.errorMessage||M("constWarning","Value must be {0}.",JSON.stringify(r.const))}),i.enumValueMatch=!1),i.enumValues=[r.const]}r.deprecationMessage&&n.parent&&i.problems.push({location:{offset:n.parent.offset,length:n.parent.length},severity:Z.Warning,message:r.deprecationMessage,code:W.Deprecated})}function s(u,c,h,g){var m=u.value;function p(C){var F,N=/^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(C.toString());return N&&{value:Number(N[1]+(N[2]||"")),multiplier:(((F=N[2])===null||F===void 0?void 0:F.length)||0)-(parseInt(N[3])||0)}}if(ee(c.multipleOf)){var d=-1;if(Number.isInteger(c.multipleOf))d=m%c.multipleOf;else{var b=p(c.multipleOf),y=p(m);if(b&&y){var v=Math.pow(10,Math.abs(y.multiplier-b.multiplier));y.multiplier<b.multiplier?y.value*=v:b.value*=v,d=y.value%b.value}}d!==0&&h.problems.push({location:{offset:u.offset,length:u.length},message:M("multipleOfWarning","Value is not divisible by {0}.",c.multipleOf)})}function O(C,F){if(ee(F))return F;if(ie(F)&&F)return C}function E(C,F){if(!ie(F)||!F)return C}var j=O(c.minimum,c.exclusiveMinimum);ee(j)&&m<=j&&h.problems.push({location:{offset:u.offset,length:u.length},message:M("exclusiveMinimumWarning","Value is below the exclusive minimum of {0}.",j)});var A=O(c.maximum,c.exclusiveMaximum);ee(A)&&m>=A&&h.problems.push({location:{offset:u.offset,length:u.length},message:M("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",A)});var P=E(c.minimum,c.exclusiveMinimum);ee(P)&&m<P&&h.problems.push({location:{offset:u.offset,length:u.length},message:M("minimumWarning","Value is below the minimum of {0}.",P)});var w=E(c.maximum,c.exclusiveMaximum);ee(w)&&m>w&&h.problems.push({location:{offset:u.offset,length:u.length},message:M("maximumWarning","Value is above the maximum of {0}.",w)})}function o(u,c,h,g){if(ee(c.minLength)&&u.value.length<c.minLength&&h.problems.push({location:{offset:u.offset,length:u.length},message:M("minLengthWarning","String is shorter than the minimum length of {0}.",c.minLength)}),ee(c.maxLength)&&u.value.length>c.maxLength&&h.problems.push({location:{offset:u.offset,length:u.length},message:M("maxLengthWarning","String is longer than the maximum length of {0}.",c.maxLength)}),rr(c.pattern)){var m=xe(c.pattern);(m==null?void 0:m.test(u.value))||h.problems.push({location:{offset:u.offset,length:u.length},message:c.patternErrorMessage||c.errorMessage||M("patternWarning",'String does not match the pattern of "{0}".',c.pattern)})}if(c.format)switch(c.format){case"uri":case"uri-reference":{var p=void 0;if(!u.value)p=M("uriEmpty","URI expected.");else{var d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(u.value);d?!d[2]&&c.format==="uri"&&(p=M("uriSchemeMissing","URI with a scheme is expected."))