UNPKG

@asyncapi/studio

Version:

One place that allows you to develop an AsyncAPI document, validate it, convert it to the latest version, preview the documentation and visualize the events flow.

1 lines 156 kB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8716],{35529:function(e,t,r){let n,i;var s,o,a,l,c,u,m,h,f,p,d,g,y,v,b,x,S,A,T,w,M,I,C,P,O,k=r(71507),$=r(25036),j=r(95719),V=r(17879),F=r(58923),D=r(82801),N=r(45389),E=r(81139),R=r(2724),L=Object.getOwnPropertyNames,W=(n={"node_modules/yaml-language-server/node_modules/ajv/dist/refs/json-schema-draft-07.json"(e,t){t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}},function(){return i||(0,n[L(n)[0]])((i={exports:{}}).exports,i),i.exports});function U(e,t){if(e.length<t.length)return!1;for(var r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}function K(e,t){var r=e.length-t.length;return r>0?e.lastIndexOf(t)===r:0===r&&e===t}function q(e){return U(e,"(?i)")?RegExp(e.substring(4),"i"):new RegExp(e)}function _(e,t){if(e===t)return!0;if(null==e||null==t||typeof e!=typeof t||"object"!=typeof e||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(!_(e[r],t[r]))return!1}else{var r,n,i=[];for(n in e)i.push(n);i.sort();var s=[];for(n in t)s.push(n);if(s.sort(),!_(i,s))return!1;for(r=0;r<i.length;r++)if(!_(e[i[r]],t[i[r]]))return!1}return!0}function B(e){return"number"==typeof e}function G(e){return void 0!==e}function J(e){return"boolean"==typeof e}function H(e,t,...r){return 0===r.length?t:t.replace(/{(\d+)}/g,(e,t)=>{let[n]=t;return void 0===r[n]?e:r[n]})}(s=y||(y={}))[s.Undefined=0]="Undefined",s[s.EnumValueMismatch=1]="EnumValueMismatch",s[s.Deprecated=2]="Deprecated",s[s.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",s[s.UnexpectedEndOfString=258]="UnexpectedEndOfString",s[s.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",s[s.InvalidUnicode=260]="InvalidUnicode",s[s.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",s[s.InvalidCharacter=262]="InvalidCharacter",s[s.PropertyExpected=513]="PropertyExpected",s[s.CommaExpected=514]="CommaExpected",s[s.ColonExpected=515]="ColonExpected",s[s.ValueExpected=516]="ValueExpected",s[s.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",s[s.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",s[s.TrailingComma=519]="TrailingComma",s[s.DuplicateKey=520]="DuplicateKey",s[s.CommentNotPermitted=521]="CommentNotPermitted",s[s.SchemaResolveError=768]="SchemaResolveError",(v||(v={})).LATEST={textDocument:{completion:{completionItem:{documentationFormat:[F.MarkupKind.Markdown,F.MarkupKind.PlainText],commitCharactersSupport:!0}}}};var z=(o=function(e,t){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Y={"color-hex":{errorMessage:H("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:H("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:H("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:H("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:H("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,}))$/}},Z=function(){function e(e,t,r){void 0===r&&(r=0),this.offset=t,this.length=r,this.parent=e}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"type: "+this.type+" ("+this.offset+"/"+this.length+")"+(this.parent?" parent: {"+this.parent.toString()+"}":"")},e}();function Q(e){return J(e)?e?{}:{not:{}}:e}z(function(e,t){var r=a.call(this,e,t)||this;return r.type="null",r.value=null,r},a=Z),z(function(e,t,r){var n=l.call(this,e,r)||this;return n.type="boolean",n.value=t,n},l=Z),function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="array",n.items=[],n}z(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!1,configurable:!0})}(Z),z(function(e,t){var r=c.call(this,e,t)||this;return r.type="number",r.isInteger=!0,r.value=Number.NaN,r},c=Z),z(function(e,t,r){var n=u.call(this,e,t,r)||this;return n.type="string",n.value="",n},u=Z),function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.type="property",i.colonOffset=-1,i.keyNode=n,i}z(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!1,configurable:!0})}(Z),function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.type="object",n.properties=[],n}z(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!1,configurable:!0})}(Z),(m=b||(b={}))[m.Key=0]="Key",m[m.Enum=1]="Enum";var X=function(){function e(e,t){void 0===e&&(e=-1),this.focusOffset=e,this.exclude=t,this.schemas=[]}return e.prototype.add=function(e){this.schemas.push(e)},e.prototype.merge=function(e){Array.prototype.push.apply(this.schemas,e.schemas)},e.prototype.include=function(e){return(-1===this.focusOffset||en(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),ee=function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!1,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}(),et=function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=void 0}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(e){for(var t=0;t<e.length;t++){var r=e[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,r=this.problems;t<r.length;t++){var n=r[t];n.code===y.EnumValueMismatch&&(n.message=H("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 er(e){return j.zA(e)}function en(e,t,r){return void 0===r&&(r=!1),t>=e.offset&&t<e.offset+e.length||r&&t===e.offset+e.length}function ei(e,t,r,n){if(e&&n.include(e)){switch(e.type){case"object":!function(e,t,r,n){for(var i=Object.create(null),s=[],o=0,a=e.properties;o<a.length;o++){var l=a[o],c=l.keyNode.value;i[c]=l.valueNode,s.push(c)}if(Array.isArray(t.required))for(var u=0,m=t.required;u<m.length;u++){var h=m[u];if(!i[h]){var f=e.parent&&"property"===e.parent.type&&e.parent.keyNode,p=f?{offset:f.offset,length:f.length}:{offset:e.offset,length:1};r.problems.push({location:p,message:H("MissingRequiredPropWarning",'Missing property "{0}".',h)})}}var d=function(e){for(var t=s.indexOf(e);t>=0;)s.splice(t,1),t=s.indexOf(e)};if(t.properties)for(var g=0,y=Object.keys(t.properties);g<y.length;g++){var h=y[g];d(h);var v=t.properties[h],b=i[h];if(b){if(J(v)){if(v)r.propertiesMatches++,r.propertiesValueMatches++;else{var l=b.parent;r.problems.push({location:{offset:l.keyNode.offset,length:l.keyNode.length},message:t.errorMessage||H("DisallowedExtraPropWarning","Property {0} is not allowed.",h)})}}else{var x=new et;ei(b,v,x,n),r.mergePropertyMatch(x)}}}if(t.patternProperties)for(var S=0,A=Object.keys(t.patternProperties);S<A.length;S++)for(var T=A[S],w=q(T),M=0,I=s.slice(0);M<I.length;M++){var h=I[M];if(w.test(h)){d(h);var b=i[h];if(b){var v=t.patternProperties[T];if(J(v)){if(v)r.propertiesMatches++,r.propertiesValueMatches++;else{var l=b.parent;r.problems.push({location:{offset:l.keyNode.offset,length:l.keyNode.length},message:t.errorMessage||H("DisallowedExtraPropWarning","Property {0} is not allowed.",h)})}}else{var x=new et;ei(b,v,x,n),r.mergePropertyMatch(x)}}}}if("object"==typeof t.additionalProperties)for(var C=0;C<s.length;C++){var h=s[C],b=i[h];if(b){var x=new et;ei(b,t.additionalProperties,x,n),r.mergePropertyMatch(x)}}else if(!1===t.additionalProperties&&s.length>0)for(var P=0;P<s.length;P++){var h=s[P],b=i[h];if(b){var l=b.parent;r.problems.push({location:{offset:l.keyNode.offset,length:l.keyNode.length},message:t.errorMessage||H("DisallowedExtraPropWarning","Property {0} is not allowed.",h)})}}if(B(t.maxProperties)&&e.properties.length>t.maxProperties&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("MaxPropWarning","Object has more properties than limit of {0}.",t.maxProperties)}),B(t.minProperties)&&e.properties.length<t.minProperties&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("MinPropWarning","Object has fewer properties than the required number of {0}",t.minProperties)}),t.dependencies)for(var O=0,k=Object.keys(t.dependencies);O<k.length;O++){var c=k[O];if(i[c]){var $=t.dependencies[c];if(Array.isArray($))for(var j=0;j<$.length;j++){var V=$[j];i[V]?r.propertiesValueMatches++:r.problems.push({location:{offset:e.offset,length:e.length},message:H("RequiredDependentPropWarning","Object is missing property {0} required by property {1}.",V,c)})}else{var v=Q($);if(v){var x=new et;ei(e,v,x,n),r.mergePropertyMatch(x)}}}}var F=Q(t.propertyNames);if(F)for(var D=0,N=e.properties;D<N.length;D++){var c=N[D].keyNode;c&&ei(c,F,r,ee.instance)}}(e,t,r,n);break;case"array":!function(e,t,r,n){if(Array.isArray(t.items)){for(var i=t.items,s=0;s<i.length;s++){var o=Q(i[s]),a=new et,l=e.items[s];l?(ei(l,o,a,n),r.mergePropertyMatch(a)):e.items.length>=i.length&&r.propertiesValueMatches++}if(e.items.length>i.length){if("object"==typeof t.additionalItems)for(var c=i.length;c<e.items.length;c++){var a=new et;ei(e.items[c],t.additionalItems,a,n),r.mergePropertyMatch(a)}else!1===t.additionalItems&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("additionalItemsWarning","Array has too many items according to schema. Expected {0} or fewer.",i.length)})}}else{var u=Q(t.items);if(u)for(var m=0,h=e.items;m<h.length;m++){var l=h[m],a=new et;ei(l,u,a,n),r.mergePropertyMatch(a)}}var f=Q(t.contains);if(f&&!e.items.some(function(e){var t=new et;return ei(e,f,t,ee.instance),!t.hasProblems()})&&r.problems.push({location:{offset:e.offset,length:e.length},message:t.errorMessage||H("requiredItemMissingWarning","Array does not contain required item.")}),B(t.minItems)&&e.items.length<t.minItems&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("minItemsWarning","Array has too few items. Expected {0} or more.",t.minItems)}),B(t.maxItems)&&e.items.length>t.maxItems&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("maxItemsWarning","Array has too many items. Expected {0} or fewer.",t.maxItems)}),!0===t.uniqueItems){var p=er(e);p.some(function(e,t){return t!==p.lastIndexOf(e)})&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("uniqueItemsWarning","Array has duplicate items.")})}}(e,t,r,n);break;case"string":!function(e,t,r,n){if(B(t.minLength)&&e.value.length<t.minLength&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("minLengthWarning","String is shorter than the minimum length of {0}.",t.minLength)}),B(t.maxLength)&&e.value.length>t.maxLength&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("maxLengthWarning","String is longer than the maximum length of {0}.",t.maxLength)}),"string"==typeof t.pattern&&(q(t.pattern).test(e.value)||r.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||H("patternWarning",'String does not match the pattern of "{0}".',t.pattern)})),t.format)switch(t.format){case"uri":case"uri-reference":var i=void 0;if(e.value){var s=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(e.value);s?s[2]||"uri"!==t.format||(i=H("uriSchemeMissing","URI with a scheme is expected.")):i=H("uriMissing","URI is expected.")}else i=H("uriEmpty","URI expected.");i&&r.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||H("uriFormatWarning","String is not a URI: {0}",i)});break;case"color-hex":case"date-time":case"date":case"time":case"email":var o=Y[t.format];e.value&&o.pattern.exec(e.value)||r.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||o.errorMessage})}}(e,t,r,0);break;case"number":!function(e,t,r,n){var i=e.value;function s(e){var t,r=/^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(e.toString());return r&&{value:Number(r[1]+(r[2]||"")),multiplier:((null===(t=r[2])||void 0===t?void 0:t.length)||0)-(parseInt(r[3])||0)}}if(B(t.multipleOf)){var o=-1;if(Number.isInteger(t.multipleOf))o=i%t.multipleOf;else{var a=s(t.multipleOf),l=s(i);if(a&&l){var c=Math.pow(10,Math.abs(l.multiplier-a.multiplier));l.multiplier<a.multiplier?l.value*=c:a.value*=c,o=l.value%a.value}}0!==o&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("multipleOfWarning","Value is not divisible by {0}.",t.multipleOf)})}function u(e,t){return B(t)?t:J(t)&&t?e:void 0}function m(e,t){if(!J(t)||!t)return e}var h=u(t.minimum,t.exclusiveMinimum);B(h)&&i<=h&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("exclusiveMinimumWarning","Value is below the exclusive minimum of {0}.",h)});var f=u(t.maximum,t.exclusiveMaximum);B(f)&&i>=f&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",f)});var p=m(t.minimum,t.exclusiveMinimum);B(p)&&i<p&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("minimumWarning","Value is below the minimum of {0}.",p)});var d=m(t.maximum,t.exclusiveMaximum);B(d)&&i>d&&r.problems.push({location:{offset:e.offset,length:e.length},message:H("maximumWarning","Value is above the maximum of {0}.",d)})}(e,t,r,0);break;case"property":return ei(e.valueNode,t,r,n)}(function(){function i(t){return e.type===t||"integer"===t&&"number"===e.type&&e.isInteger}if(Array.isArray(t.type)?t.type.some(i)||r.problems.push({location:{offset:e.offset,length:e.length},message:t.errorMessage||H("typeArrayMismatchWarning","Incorrect type. Expected one of {0}.",t.type.join(", "))}):t.type&&!i(t.type)&&r.problems.push({location:{offset:e.offset,length:e.length},message:t.errorMessage||H("typeMismatchWarning",'Incorrect type. Expected "{0}".',t.type)}),Array.isArray(t.allOf))for(var s,o,a,l,c=0,u=t.allOf;c<u.length;c++)ei(e,Q(u[c]),r,n);var m=Q(t.not);if(m){var h=new et,f=n.newSub();ei(e,m,h,f),h.hasProblems()||r.problems.push({location:{offset:e.offset,length:e.length},message:H("notSchemaWarning","Matches a schema that is not allowed.")});for(var p=0,d=f.schemas;p<d.length;p++){var g=d[p];g.inverted=!g.inverted,n.add(g)}}var v=function(t,i){for(var s=[],o=void 0,a=0;a<t.length;a++){var l=Q(t[a]),c=new et,u=n.newSub();if(ei(e,l,c,u),c.hasProblems()||s.push(l),o){if(i||c.hasProblems()||o.validationResult.hasProblems()){var m=c.compare(o.validationResult);m>0?o={schema:l,validationResult:c,matchingSchemas:u}:0===m&&(o.matchingSchemas.merge(u),o.validationResult.mergeEnumValues(c))}else o.matchingSchemas.merge(u),o.validationResult.propertiesMatches+=c.propertiesMatches,o.validationResult.propertiesValueMatches+=c.propertiesValueMatches}else o={schema:l,validationResult:c,matchingSchemas:u}}return s.length>1&&i&&r.problems.push({location:{offset:e.offset,length:1},message:H("oneOfWarning","Matches multiple schemas when only one must validate.")}),o&&(r.merge(o.validationResult),r.propertiesMatches+=o.validationResult.propertiesMatches,r.propertiesValueMatches+=o.validationResult.propertiesValueMatches,n.merge(o.matchingSchemas)),s.length};Array.isArray(t.anyOf)&&v(t.anyOf,!1),Array.isArray(t.oneOf)&&v(t.oneOf,!0);var b=function(t){var i=new et,s=n.newSub();ei(e,Q(t),i,s),r.merge(i),r.propertiesMatches+=i.propertiesMatches,r.propertiesValueMatches+=i.propertiesValueMatches,n.merge(s)},x=Q(t.if);if(x&&(s=Q(t.then),o=Q(t.else),ei(e,Q(x),a=new et,l=n.newSub()),n.merge(l),a.hasProblems()?o&&b(o):s&&b(s)),Array.isArray(t.enum)){for(var S=er(e),A=!1,T=0,w=t.enum;T<w.length;T++)if(_(S,w[T])){A=!0;break}r.enumValues=t.enum,r.enumValueMatch=A,A||r.problems.push({location:{offset:e.offset,length:e.length},code:y.EnumValueMismatch,message:t.errorMessage||H("enumWarning","Value is not accepted. Valid values: {0}.",t.enum.map(function(e){return JSON.stringify(e)}).join(", "))})}if(G(t.const)){var S=er(e);_(S,t.const)?r.enumValueMatch=!0:(r.problems.push({location:{offset:e.offset,length:e.length},code:y.EnumValueMismatch,message:t.errorMessage||H("constWarning","Value must be {0}.",JSON.stringify(t.const))}),r.enumValueMatch=!1),r.enumValues=[t.const]}t.deprecationMessage&&e.parent&&r.problems.push({location:{offset:e.parent.offset,length:e.parent.length},severity:F.DiagnosticSeverity.Warning,message:t.deprecationMessage,code:y.Deprecated})})(),n.add({node:e,schema:t})}}!function(){function e(e,t,r){void 0===t&&(t=[]),void 0===r&&(r=[]),this.root=e,this.syntaxErrors=t,this.comments=r}e.prototype.getNodeFromOffset=function(e,t){if(void 0===t&&(t=!1),this.root)return j.Hk(this.root,e,t)},e.prototype.visit=function(e){if(this.root){var t=function(r){var n=e(r),i=r.children;if(Array.isArray(i))for(var s=0;s<i.length&&n;s++)n=t(i[s]);return n};t(this.root)}},e.prototype.validate=function(e,t,r){if(void 0===r&&(r=F.DiagnosticSeverity.Warning),this.root&&t){var n=new et;return ei(this.root,t,n,ee.instance),n.problems.map(function(t){var n,i=F.Range.create(e.positionAt(t.location.offset),e.positionAt(t.location.offset+t.location.length));return F.Diagnostic.create(i,t.message,null!==(n=t.severity)&&void 0!==n?n:r,t.code)})}},e.prototype.getMatchingSchemas=function(e,t,r){void 0===t&&(t=-1);var n=new X(t,r);return this.root&&e&&ei(this.root,e,new et,n),n.schemas}}();var es=function(){function e(e,t){this.globWrappers=[];try{for(var r=0;r<e.length;r++){var n=e[r],i="!"!==n[0];i||(n=n.substring(1)),n.length>0&&("/"===n[0]&&(n=n.substring(1)),this.globWrappers.push({regexp:function(e,t){if("string"!=typeof e)throw TypeError("Expected a string");for(var r,n=String(e),i="",s=!!t&&!!t.extended,o=!!t&&!!t.globstar,a=!1,l=t&&"string"==typeof t.flags?t.flags:"",c=0,u=n.length;c<u;c++)switch(r=n[c]){case"/":case"$":case"^":case"+":case".":case"(":case")":case"=":case"!":case"|":i+="\\"+r;break;case"?":if(s){i+=".";break}case"[":case"]":if(s){i+=r;break}case"{":if(s){a=!0,i+="(";break}case"}":if(s){a=!1,i+=")";break}case",":if(a){i+="|";break}i+="\\"+r;break;case"*":for(var m=n[c-1],h=1;"*"===n[c+1];)h++,c++;var f=n[c+1];o?h>1&&("/"===m||void 0===m||"{"===m||","===m)&&("/"===f||void 0===f||","===f||"}"===f)?("/"===f?c++:"/"===m&&i.endsWith("\\/")&&(i=i.substr(0,i.length-2)),i+="((?:[^/]*(?:/|$))*)"):i+="([^/]*)":i+=".*";break;default:i+=r}return l&&~l.indexOf("g")||(i="^"+i+"$"),new RegExp(i,l)}("**/"+n,{extended:!0,globstar:!0}),include:i}))}this.uris=t}catch(e){this.globWrappers.length=0,this.uris=[]}}return e.prototype.matchesPattern=function(e){for(var t=!1,r=0,n=this.globWrappers;r<n.length;r++){var i=n[r],s=i.regexp,o=i.include;s.test(e)&&(t=o)}return t},e.prototype.getURIs=function(){return this.uris},e}(),eo=function(){function e(e,t,r){this.service=e,this.url=t,this.dependencies={},r&&(this.unresolvedSchema=this.service.promise.resolve(new ea(r)))}return e.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},e.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(t){return e.service.resolveSchemaContent(t,e.url,e.dependencies)})),this.resolvedSchema},e.prototype.clearSchema=function(){this.resolvedSchema=void 0,this.unresolvedSchema=void 0,this.dependencies={}},e}(),ea=function(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t},el=function(){function e(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t}return e.prototype.getSection=function(e){var t=this.getSectionRecursive(e,this.schema);if(t)return Q(t)},e.prototype.getSectionRecursive=function(e,t){if(!t||"boolean"==typeof t||0===e.length)return t;var r=e.shift();if(t.properties&&(t.properties[r],1))return this.getSectionRecursive(e,t.properties[r]);if(t.patternProperties)for(var n=0,i=Object.keys(t.patternProperties);n<i.length;n++){var s=i[n];if(q(s).test(r))return this.getSectionRecursive(e,t.patternProperties[s])}else if("object"==typeof t.additionalProperties)return this.getSectionRecursive(e,t.additionalProperties);else if(r.match("[0-9]+")){if(Array.isArray(t.items)){var o=parseInt(r,10);if(!isNaN(o)&&t.items[o])return this.getSectionRecursive(e,t.items[o])}else if(t.items)return this.getSectionRecursive(e,t.items)}},e}(),ec=function(){function e(e,t,r){this.contextService=t,this.requestService=e,this.promiseConstructor=r||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations=[],this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={}}return e.prototype.getRegisteredSchemaIds=function(e){return Object.keys(this.registeredSchemasIds).filter(function(t){var r=V.o.parse(t).scheme;return"schemaservice"!==r&&(!e||e(r))})},Object.defineProperty(e.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){var t=this;this.cachedSchemaForResource=void 0;for(var r=!1,n=[e=em(e)],i=Object.keys(this.schemasById).map(function(e){return t.schemasById[e]});n.length;)for(var s=n.pop(),o=0;o<i.length;o++){var a=i[o];a&&(a.url===s||a.dependencies[s])&&(a.url!==s&&n.push(a.url),a.clearSchema(),i[o]=void 0,r=!0)}return r},e.prototype.setSchemaContributions=function(e){if(e.schemas){var t=e.schemas;for(var r in t){var n=em(r);this.contributionSchemas[n]=this.addSchemaHandle(n,t[r])}}if(Array.isArray(e.schemaAssociations))for(var i=e.schemaAssociations,s=0;s<i.length;s++){var o=i[s],a=o.uris.map(em),l=this.addFilePatternAssociation(o.pattern,a);this.contributionAssociations.push(l)}},e.prototype.addSchemaHandle=function(e,t){var r=new eo(this,e,t);return this.schemasById[e]=r,r},e.prototype.getOrAddSchemaHandle=function(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)},e.prototype.addFilePatternAssociation=function(e,t){var r=new es(e,t);return this.filePatternAssociations.push(r),r},e.prototype.registerExternalSchema=function(e,t,r){var n=em(e);return this.registeredSchemasIds[n]=!0,this.cachedSchemaForResource=void 0,t&&this.addFilePatternAssociation(t,[e]),r?this.addSchemaHandle(n,r):this.getOrAddSchemaHandle(n)},e.prototype.clearExternalSchemas=function(){for(var e in this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={},this.cachedSchemaForResource=void 0,this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(var t=0,r=this.contributionAssociations;t<r.length;t++){var n=r[t];this.filePatternAssociations.push(n)}},e.prototype.getResolvedSchema=function(e){var t=em(e),r=this.schemasById[t];return r?r.getResolvedSchema():this.promise.resolve(void 0)},e.prototype.loadSchema=function(e){if(!this.requestService){var t=H("json.schema.norequestservice","Unable to load schema from '{0}'. No schema request service available",eh(e));return this.promise.resolve(new ea({},[t]))}return this.requestService(e).then(function(t){if(!t)return new ea({},[H("json.schema.nocontent","Unable to load schema from '{0}': No content.",eh(e))]);var r=[];return new ea(j.Qc(t,r),r.length?[H("json.schema.invalidFormat","Unable to parse content from '{0}': Parse error at offset {1}.",eh(e),r[0].offset)]:[])},function(t){var r=t.toString(),n=t.toString().split("Error: ");return n.length>1&&(r=n[1]),K(r,".")&&(r=r.substr(0,r.length-1)),new ea({},[H("json.schema.nocontent","Unable to load schema from '{0}': {1}.",eh(e),r)])})},e.prototype.resolveSchemaContent=function(e,t,r){var n=this,i=e.errors.slice(0),s=e.schema;if(s.$schema){var o=em(s.$schema);if("http://json-schema.org/draft-03/schema"===o)return this.promise.resolve(new el({},[H("json.schema.draft03.notsupported","Draft-03 schemas are not supported.")]));"https://json-schema.org/draft/2019-09/schema"===o&&i.push(H("json.schema.draft201909.notsupported","Draft 2019-09 schemas are not yet fully supported."))}var a=this.contextService,l=function(e,t){if(!t)return e;var r=e;return"/"===t[0]&&(t=t.substr(1)),t.split("/").some(function(e){return!(r=r[e=e.replace(/~1/g,"/").replace(/~0/g,"~")])}),r},c=function(e,t,r,n){var s=n?decodeURIComponent(n):void 0,o=l(t,s);if(o)for(var a in o)o.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(e[a]=o[a]);else i.push(H("json.schema.invalidref","$ref '{0}' in '{1}' can not be resolved.",s,r))},u=function(e,t,r,s,o){a&&!/^[A-Za-z][A-Za-z0-9+\-.+]*:\/\/.*/.test(t)&&(t=a.resolveRelativePath(t,s)),t=em(t);var l=n.getOrAddSchemaHandle(t);return l.getUnresolvedSchema().then(function(n){if(o[t]=!0,n.errors.length){var s=r?t+"#"+r:t;i.push(H("json.schema.problemloadingref","Problems loading reference '{0}': {1}",s,n.errors[0]))}return c(e,n.schema,t,r),m(e,n.schema,t,l.dependencies)})},m=function(e,t,r,i){if(!e||"object"!=typeof e)return Promise.resolve(null);for(var s=[e],o=[],a=[],l=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0;r<e.length;r++){var n=e[r];"object"==typeof n&&s.push(n)}},m=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0;r<e.length;r++){var n=e[r];if("object"==typeof n)for(var i in n){var o=n[i];"object"==typeof o&&s.push(o)}}},h=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0;r<e.length;r++){var n=e[r];if(Array.isArray(n))for(var i=0;i<n.length;i++){var o=n[i];"object"==typeof o&&s.push(o)}}};s.length;){var f=s.pop();o.indexOf(f)>=0||(o.push(f),function(e){for(var n=[];e.$ref;){var s=e.$ref,o=s.split("#",2);if(delete e.$ref,o[0].length>0){a.push(u(e,o[0],o[1],r,i));return}-1===n.indexOf(s)&&(c(e,t,r,o[1]),n.push(s))}l(e.items,e.additionalItems,e.additionalProperties,e.not,e.contains,e.propertyNames,e.if,e.then,e.else),m(e.definitions,e.properties,e.patternProperties,e.dependencies),h(e.anyOf,e.allOf,e.oneOf,e.items)}(f))}return n.promise.all(a)};return m(s,s,t,r).then(function(e){return new el(s,i)})},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&"object"===t.root.type){var r=t.root.properties.filter(function(e){return"$schema"===e.keyNode.value&&e.valueNode&&"string"===e.valueNode.type});if(r.length>0){var n=r[0].valueNode;if(n&&"string"===n.type){var i=er(n);if(i&&U(i,".")&&this.contextService&&(i=this.contextService.resolveRelativePath(i,e)),i){var s=em(i);return this.getOrAddSchemaHandle(s).getResolvedSchema()}}}}if(this.cachedSchemaForResource&&this.cachedSchemaForResource.resource===e)return this.cachedSchemaForResource.resolvedSchema;for(var o=Object.create(null),a=[],l=function(e){try{return V.o.parse(e).with({fragment:null,query:null}).toString()}catch(t){return e}}(e),c=0,u=this.filePatternAssociations;c<u.length;c++){var m=u[c];if(m.matchesPattern(l))for(var h=0,f=m.getURIs();h<f.length;h++){var p=f[h];o[p]||(a.push(p),o[p]=!0)}}var d=a.length>0?this.createCombinedSchema(e,a).getResolvedSchema():this.promise.resolve(void 0);return this.cachedSchemaForResource={resource:e,resolvedSchema:d},d},e.prototype.createCombinedSchema=function(e,t){if(1===t.length)return this.getOrAddSchemaHandle(t[0]);var r="schemaservice://combinedSchema/"+encodeURIComponent(e),n={allOf:t.map(function(e){return{$ref:e}})};return this.addSchemaHandle(r,n)},e.prototype.getMatchingSchemas=function(e,t,r){if(r){var n=r.id||"schemaservice://untitled/matchingSchemas/"+eu++;return this.resolveSchemaContent(new ea(r),n,{}).then(function(e){return t.getMatchingSchemas(e.schema).filter(function(e){return!e.inverted})})}return this.getSchemaForResource(e.uri,t).then(function(e){return e?t.getMatchingSchemas(e.schema).filter(function(e){return!e.inverted}):[]})},e}(),eu=0;function em(e){try{return V.o.parse(e).toString()}catch(t){return e}}function eh(e){try{var t=V.o.parse(e);if("file"===t.scheme)return t.fsPath}catch(e){}return e}function ef(e){try{return RegExp(e,"u")}catch(t){return new RegExp(e)}}function ep(e,t){let r,n;if(e===t)return!0;if(null==e||null==t||typeof e!=typeof t||"object"!=typeof e||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(!ep(e[r],t[r]))return!1}else{let i=[];for(n in e)i.push(n);i.sort();let s=[];for(n in t)s.push(n);if(s.sort(),!ep(i,s))return!1;for(r=0;r<i.length;r++)if(!ep(e[i[r]],t[i[r]]))return!1}return!0}function ed(e){return"number"==typeof e}function eg(e){return void 0!==e}function ey(e){return"boolean"==typeof e}function ev(e){return"string"==typeof e}function eb(e){var t;return e?e instanceof Error&&null!==(t=e.stack)&&void 0!==t?t:e.toString():"null"}function ex(e){return e.title?e.title:e.$id?eS(e.$id):e.$ref||e._$ref?eS(e.$ref||e._$ref):e.closestTitle||(Array.isArray(e.type)?e.type.join(" | "):e.type)}function eS(e){let t=e.match(/^(?:.*\/)?(.*?)(?:\.schema\.json)?$/),r=!!t&&t[1];return r||(r="typeNotFound",console.error(`$ref (${e}) not parsed properly`)),r}function eA(e,t){let r=V.o.parse(t),n=N.basename(r.fsPath);return(N.extname(r.fsPath)||(n+=".json"),Object.getOwnPropertyDescriptor(e,"name"))?Object.getOwnPropertyDescriptor(e,"name").value+` (${n})`:e.title?e.title+` (${n})`:n}function eT(e){if(e)return e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,"$1\n\n$3").replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}!function(){function e(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=Promise),void 0===n&&(n={}),this.schemaService=e,this.contributions=t,this.promiseConstructor=r,this.clientCapabilities=n}e.prototype.doResolve=function(e){for(var t=this.contributions.length-1;t>=0;t--){var r=this.contributions[t].resolveCompletion;if(r){var n=r(e);if(n)return n}}return this.promiseConstructor.resolve(e)},e.prototype.doComplete=function(e,t,r){var n,i=this,s={items:[],isIncomplete:!1},o=e.getText(),a=e.offsetAt(t),l=r.getNodeFromOffset(a,!0);if(this.isInComment(e,l?l.offset:0,a))return Promise.resolve(s);if(l&&a===l.offset+l.length&&a>0){var c=o[a-1];("object"===l.type&&"}"===c||"array"===l.type&&"]"===c)&&(l=l.parent)}var u=this.getCurrentWord(e,a);if(l&&("string"===l.type||"number"===l.type||"boolean"===l.type||"null"===l.type))n=F.Range.create(e.positionAt(l.offset),e.positionAt(l.offset+l.length));else{var m=a-u.length;m>0&&'"'===o[m-1]&&m--,n=F.Range.create(e.positionAt(m),t)}var h={},f={add:function(e){var t=e.label,r=h[t];if(r)r.documentation||(r.documentation=e.documentation),r.detail||(r.detail=e.detail);else{if((t=t.replace(/[\n]/g,"↵")).length>60){var i=t.substr(0,57).trim()+"...";h[i]||(t=i)}n&&void 0!==e.insertText&&(e.textEdit=F.TextEdit.replace(n,e.insertText)),e.label=t,h[t]=e,s.items.push(e)}},setAsIncomplete:function(){s.isIncomplete=!0},error:function(e){console.error(e)},log:function(e){console.log(e)},getNumberOfProposals:function(){return s.items.length}};return this.schemaService.getSchemaForResource(e.uri,r).then(function(t){var c=[],m=!0,p="",d=void 0;if(l&&"string"===l.type){var g=l.parent;g&&"property"===g.type&&g.keyNode===l&&(m=!g.valueNode,d=g,p=o.substr(l.offset+1,l.length-2),g&&(l=g.parent))}if(l&&"object"===l.type){if(l.offset===a)return s;l.properties.forEach(function(e){d&&d===e||(h[e.keyNode.value]=F.CompletionItem.create("__"))});var y,v="";m&&(v=i.evaluateSeparatorAfter(e,e.offsetAt(n.end))),t?i.getPropertyCompletions(t,r,l,m,v,f):i.getSchemaLessPropertyCompletions(r,l,p,f);var b=(y=l,j.F6(y));i.contributions.forEach(function(t){var r=t.collectPropertyCompletions(e.uri,b,u,m,""===v,f);r&&c.push(r)}),!t&&u.length>0&&'"'!==o.charAt(a-u.length-1)&&(f.add({kind:F.CompletionItemKind.Property,label:i.getLabelForValue(u),insertText:i.getInsertTextForProperty(u,void 0,!1,v),insertTextFormat:F.InsertTextFormat.Snippet,documentation:""}),f.setAsIncomplete())}var x={};return t?i.getValueCompletions(t,r,l,a,e,f,x):i.getSchemaLessValueCompletions(r,l,a,e,f),i.contributions.length>0&&i.getContributedValueCompletions(r,l,a,e,f,c),i.promiseConstructor.all(c).then(function(){if(0===f.getNumberOfProposals()){var t=a;l&&("string"===l.type||"number"===l.type||"boolean"===l.type||"null"===l.type)&&(t=l.offset+l.length);var r=i.evaluateSeparatorAfter(e,t);i.addFillerValueCompletions(x,r,f)}return s})})},e.prototype.getPropertyCompletions=function(e,t,r,n,i,s){var o=this;t.getMatchingSchemas(e.schema,r.offset).forEach(function(e){if(e.node===r&&!e.inverted){var t=e.schema.properties;t&&Object.keys(t).forEach(function(e){var r=t[e];if("object"==typeof r&&!r.deprecationMessage&&!r.doNotSuggest){var a={kind:F.CompletionItemKind.Property,label:e,insertText:o.getInsertTextForProperty(e,r,n,i),insertTextFormat:F.InsertTextFormat.Snippet,filterText:o.getFilterTextForValue(e),documentation:o.fromMarkup(r.markdownDescription)||r.description||""};void 0!==r.suggestSortText&&(a.sortText=r.suggestSortText),a.insertText&&K(a.insertText,"$1"+i)&&(a.command={title:"Suggest",command:"editor.action.triggerSuggest"}),s.add(a)}});var a=e.schema.propertyNames;if("object"==typeof a&&!a.deprecationMessage&&!a.doNotSuggest){var l=function(e,t){void 0===t&&(t=void 0);var r={kind:F.CompletionItemKind.Property,label:e,insertText:o.getInsertTextForProperty(e,void 0,n,i),insertTextFormat:F.InsertTextFormat.Snippet,filterText:o.getFilterTextForValue(e),documentation:t||o.fromMarkup(a.markdownDescription)||a.description||""};void 0!==a.suggestSortText&&(r.sortText=a.suggestSortText),r.insertText&&K(r.insertText,"$1"+i)&&(r.command={title:"Suggest",command:"editor.action.triggerSuggest"}),s.add(r)};if(a.enum)for(var c=0;c<a.enum.length;c++){var u=void 0;a.markdownEnumDescriptions&&c<a.markdownEnumDescriptions.length?u=o.fromMarkup(a.markdownEnumDescriptions[c]):a.enumDescriptions&&c<a.enumDescriptions.length&&(u=a.enumDescriptions[c]),l(a.enum[c],u)}a.const&&l(a.const)}}})},e.prototype.getSchemaLessPropertyCompletions=function(e,t,r,n){var i=this,s=function(e){e.properties.forEach(function(e){var t=e.keyNode.value;n.add({kind:F.CompletionItemKind.Property,label:t,insertText:i.getInsertTextForValue(t,""),insertTextFormat:F.InsertTextFormat.Snippet,filterText:i.getFilterTextForValue(t),documentation:""})})};if(t.parent){if("property"===t.parent.type){var o=t.parent.keyNode.value;e.visit(function(e){return"property"===e.type&&e!==t.parent&&e.keyNode.value===o&&e.valueNode&&"object"===e.valueNode.type&&s(e.valueNode),!0})}else"array"===t.parent.type&&t.parent.items.forEach(function(e){"object"===e.type&&e!==t&&s(e)})}else"object"===t.type&&n.add({kind:F.CompletionItemKind.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",void 0,!0,""),insertTextFormat:F.InsertTextFormat.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},e.prototype.getSchemaLessValueCompletions=function(e,t,r,n,i){var s=this,o=r;if(t&&("string"===t.type||"number"===t.type||"boolean"===t.type||"null"===t.type)&&(o=t.offset+t.length,t=t.parent),!t){i.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:F.InsertTextFormat.Snippet,documentation:""}),i.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:F.InsertTextFormat.Snippet,documentation:""});return}var a=this.evaluateSeparatorAfter(n,o),l=function(e){e.parent&&!en(e.parent,r,!0)&&i.add({kind:s.getSuggestionKind(e.type),label:s.getLabelTextForMatchingNode(e,n),insertText:s.getInsertTextForMatchingNode(e,n,a),insertTextFormat:F.InsertTextFormat.Snippet,documentation:""}),"boolean"===e.type&&s.addBooleanValueCompletion(!e.value,a,i)};if("property"===t.type&&r>(t.colonOffset||0)){var c=t.valueNode;if(c&&(r>c.offset+c.length||"object"===c.type||"array"===c.type))return;var u=t.keyNode.value;e.visit(function(e){return"property"===e.type&&e.keyNode.value===u&&e.valueNode&&l(e.valueNode),!0}),"$schema"===u&&t.parent&&!t.parent.parent&&this.addDollarSchemaCompletions(a,i)}if("array"===t.type){if(t.parent&&"property"===t.parent.type){var m=t.parent.keyNode.value;e.visit(function(e){return"property"===e.type&&e.keyNode.value===m&&e.valueNode&&"array"===e.valueNode.type&&e.valueNode.items.forEach(l),!0})}else t.items.forEach(l)}},e.prototype.getValueCompletions=function(e,t,r,n,i,s,o){var a=n,l=void 0,c=void 0;if(r&&("string"===r.type||"number"===r.type||"boolean"===r.type||"null"===r.type)&&(a=r.offset+r.length,c=r,r=r.parent),!r){this.addSchemaValueCompletions(e.schema,"",s,o);return}if("property"===r.type&&n>(r.colonOffset||0)){var u=r.valueNode;if(u&&n>u.offset+u.length)return;l=r.keyNode.value,r=r.parent}if(r&&(void 0!==l||"array"===r.type)){for(var m=this.evaluateSeparatorAfter(i,a),h=t.getMatchingSchemas(e.schema,r.offset,c),f=0;f<h.length;f++){var p=h[f];if(p.node===r&&!p.inverted&&p.schema){if("array"===r.type&&p.schema.items){if(Array.isArray(p.schema.items)){var d=this.findItemAtOffset(r,i,n);d<p.schema.items.length&&this.addSchemaValueCompletions(p.schema.items[d],m,s,o)}else this.addSchemaValueCompletions(p.schema.items,m,s,o)}if(void 0!==l){var g=!1;if(p.schema.properties){var y=p.schema.properties[l];y&&(g=!0,this.addSchemaValueCompletions(y,m,s,o))}if(p.schema.patternProperties&&!g)for(var v=0,b=Object.keys(p.schema.patternProperties);v<b.length;v++){var x=b[v];if(q(x).test(l)){g=!0;var y=p.schema.patternProperties[x];this.addSchemaValueCompletions(y,m,s,o)}}if(p.schema.additionalProperties&&!g){var y=p.schema.additionalProperties;this.addSchemaValueCompletions(y,m,s,o)}}}}"$schema"!==l||r.parent||this.addDollarSchemaCompletions(m,s),o.boolean&&(this.addBooleanValueCompletion(!0,m,s),this.addBooleanValueCompletion(!1,m,s)),o.null&&this.addNullValueCompletion(m,s)}},e.prototype.getContributedValueCompletions=function(e,t,r,n,i,s){if(t){if(("string"===t.type||"number"===t.type||"boolean"===t.type||"null"===t.type)&&(t=t.parent),t&&"property"===t.type&&r>(t.colonOffset||0)){var o=t.keyNode.value,a=t.valueNode;if((!a||r<=a.offset+a.length)&&t.parent){var l,c=(l=t.parent,j.F6(l));this.contributions.forEach(function(e){var t=e.collectValueCompletions(n.uri,c,o,i);t&&s.push(t)})}}}else this.contributions.forEach(function(e){var t=e.collectDefaultCompletions(n.uri,i);t&&s.push(t)})},e.prototype.addSchemaValueCompletions=function(e,t,r,n){var i=this;"object"==typeof e&&(this.addEnumValueCompletions(e,t,r),this.addDefaultValueCompletions(e,t,r),this.collectTypes(e,n),Array.isArray(e.allOf)&&e.allOf.forEach(function(e){return i.addSchemaValueCompletions(e,t,r,n)}),Array.isArray(e.anyOf)&&e.anyOf.forEach(function(e){return i.addSchemaValueCompletions(e,t,r,n)}),Array.isArray(e.oneOf)&&e.oneOf.forEach(function(e){return i.addSchemaValueCompletions(e,t,r,n)}))},e.prototype.addDefaultValueCompletions=function(e,t,r,n){var i=this;void 0===n&&(n=0);var s=!1;if(G(e.default)){for(var o=e.type,a=e.default,l=n;l>0;l--)a=[a],o="array";r.add({kind:this.getSuggestionKind(o),label:this.getLabelForValue(a),insertText:this.getInsertTextForValue(a,t),insertTextFormat:F.InsertTextFormat.Snippet,detail:H("json.suggest.default","Default value")}),s=!0}Array.isArray(e.examples)&&e.examples.forEach(function(o){for(var a=e.type,l=o,c=n;c>0;c--)l=[l],a="array";r.add({kind:i.getSuggestionKind(a),label:i.getLabelForValue(l),insertText:i.getInsertTextForValue(l,t),insertTextFormat:F.InsertTextFormat.Snippet}),s=!0}),Array.isArray(e.defaultSnippets)&&e.defaultSnippets.forEach(function(o){var a,l,c=e.type,u=o.body,m=o.label;if(G(u)){e.type;for(var h=n;h>0;h--)u=[u];a=i.getInsertTextForSnippetValue(u,t),l=i.getFilterTextForSnippetValue(u),m=m||i.getLabelForSnippetValue(u)}else{if("string"!=typeof o.bodyText)return;for(var f="",p="",d="",h=n;h>0;h--)f=f+d+"[\n",p=p+"\n"+d+"]",d+=" ",c="array";a=f+d+o.bodyText.split("\n").join("\n"+d)+p+t,m=m||a,l=a.replace(/[\n]/g,"")}r.add({kind:i.getSuggestionKind(c),label:m,documentation:i.fromMarkup(o.markdownDescription)||o.description,insertText:a,insertTextFormat:F.InsertTextFormat.Snippet,filterText:l}),s=!0}),s||"object"!=typeof e.items||Array.isArray(e.items)||!(n<5)||this.addDefaultValueCompletions(e.items,t,r,n+1)},e.prototype.addEnumValueCompletions=function(e,t,r){if(G(e.const)&&r.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,t),insertTextFormat:F.InsertTextFormat.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(var n=0,i=e.enum.length;n<i;n++){var s=e.enum[n],o=this.fromMarkup(e.markdownDescription)||e.description;e.markdownEnumDescriptions&&n<e.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?o=this.fromMarkup(e.markdownEnumDescriptions[n]):e.enumDescriptions&&n<e.enumDescriptions.length&&(o=e.enumDescriptions[n]),r.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(s),insertText:this.getInsertTextForValue(s,t),insertTextFormat:F.InsertTextFormat.Snippet,documentation:o})}},e.prototype.collectTypes=function(e,t){if(!(Array.isArray(e.enum)||G(e.const))){var r=e.type;Array.isArray(r)?r.forEach(function(e){return t[e]=!0}):r&&(t[r]=!0)}},e.prototype.addFillerValueCompletions=function(e,t,r){e.object&&r.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},t),insertTextFormat:F.InsertTextFormat.Snippet,detail:H("defaults.object","New object"),documentation:""}),e.array&&r.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],t),insertTextFormat:F.InsertTextFormat.Snippet,detail:H("defaults.array","New array"),documentation:""})},e.prototype.addBooleanValueCompletion=function(e,t,r){r.add({kind:this.getSuggestionKind("boolean"),label:e?"true":"false",insertText:this.getInsertTextForValue(e,t),insertTextFormat:F.InsertTextFormat.Snippet,documentation:""})},e.prototype.addNullValueCompletion=function(e,t){t.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+e,insertTextFormat:F.InsertTextFormat.Snippet,documentation:""})},e.prototype.addDollarSchemaCompletions=function(e,t){var r=this;this.schemaService.getRegisteredSchemaIds(function(e){return"http"===e||"https"===e}).forEach(function(n){return t.add({kind:F.CompletionItemKind.Module,label:r.getLabelForValue(n),filterText:r.getFilterTextForValue(n),insertText:r.getInsertTextForValue(n,e),insertTextFormat:F.InsertTextFormat.Snippet,documentation:""})})},e.prototype.getLabelForValue=function(e){return JSON.stringify(e)},e.prototype.getFilterTextForValue=function(e){return JSON.stringify(e)},e.prototype.getFilterTextForSnippetValue=function(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getLabelForSnippetValue=function(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getInsertTextForPlainText=function(e){return e.replace(/[\\\$\}]/g,"\\$&")},e.prototype.getInsertTextForValue=function(e,t){var r=JSON.stringify(e,null," ");return"{}"===r?"{$1}"+t:"[]"===r?"[$1]"+t:this.getInsertTextForPlainText(r+t)},e.prototype.getInsertTextForSnippetValue=function(e,t){return function e(t,r,n){if(null!==t&&"object"==typeof t){var i=r+" ";if(Array.isArray(t)){if(0===t.length)return"[]";for(var s="[\n",o=0;o<t.length;o++)s+=i+e(t[o],i,n),o<t.length-1&&(s+=","),s+="\n";return s+(r+"]")}var a=Object.keys(t);if(0===a.length)return"{}";for(var s="{\n",o=0;o<a.length;o++){var l=a[o];s+=i+JSON.stringify(l)+": "+e(t[l],i,n),o<a.length-1&&(s+=","),s+="\n"}return s+(r+"}")}return n(t)}(e,"",function(e){return"string"==typeof e&&"^"===e[0]?e.substr(1):JSON.stringify(e)})+t},e.prototype.getInsertTextForGuessedValue=function(e,t){switch(typeof e){case"object":if(null===e)return"${1:null}"+t;break;case"string":var r=JSON.stringify(e);return r=r.substr(1,r.length-2),'"${1:'+(r=this.getInsertTextForPlainText(r))+'}"'+t;case"number":case"boolean":return"${1:"+JSON.stringify(e)+"}"+t}return this.getInsertTextForValue(e,t)},e.prototype.getSuggestionKind=function(e){if(Array.isArray(e)){var t=e;e=t.length>0?t[0]:void 0}if(!e)return F.CompletionItemKind.Value;switch(e){case"string":default:return F.CompletionItemKind.Value;case"object":return F.CompletionItemKind.Module;case"property":return F.CompletionItemKind.Property}},e.prototype.getLabelTextForMatchingNode=function(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:return t.getText().substr(e.offset,e.length)}},e.prototype.getInsertTextForMatchingNode=function(e,t,r){switch(e.type){case"array":return this.getInsertTextForValue([],r);case"object":return this.getInsertTextForValue({},r);default:var n=t.getText().substr(e.offset,e.length)+r;return this.getInsertTextForPlainText(n)}},e.prototype.getInsertTextForProperty=function(e,t,r,n){var i,s=this.getInsertTextForValue(e,"");if(!r)return s;var o=0;if(t){if(Array.isArray(t.defaultSnippets)){if(1===t.defaultSnippets.length){var a=t.defaultSnippets[0].body;G(a)&&(i=this.getInsertTextForSnippetValue(a,""))}o+=t.defaultSnippets.length}if(t.enum&&(i||1!==t.enum.length||(i=this.getInsertTextForGuessedValue(t.enum[0],"")),o+=t.enum.length),G(t.default)&&(i||(i=this.getInsertTextForGuessedValue(t.default,"")),o++),Array.isArray(t.examples)&&t.examples.length&&(i||(i=this.getInsertTextForGuessedValue(t.examples[0],"")),o+=t.examples.length),0===o){var l=Array.isArray(t.type)?t.type[0]:t.type;switch(!l&&(t.properties?l="object":t.items&&(l="array")),l){case"boolean":i="$1";break;case"string":i='"$1"';break;case"object":i="{$1}";break;case"array":i="[$1]";break;case"number":case"integer":i="${1:0}";break;case"null":i="${1:null}";break;default:return s}}}return(!i||o>1)&&(i="$1"),s+": "+i+n},e.prototype.getCurrentWord=function(e,t){for(var r=t-1,n=e.getText();r>=0&&-1===' \n\r\v":{[,]}'.indexOf(n.charAt(r));)r--;return