amis.define("1519ff4",function(e,r){"use strict";function t(e){if(e&&"object"==typeof e){if(e.allowComments)return!0;if(e.allOf)return e.allOf.some(t)}return!1}function o(e){switch(e){case"error":return a.DiagnosticSeverity.Error;case"warning":return a.DiagnosticSeverity.Warning;case"ignore":return void 0}return void 0}Object.defineProperty(r,"__esModule",{value:!0});var i=e("11ed2ab"),n=e("a1f43d9"),a=e("737c70e"),s=e("683e3e1"),c=i.__importStar(e("60eaf5a")),f=c.loadMessageBundle(),v=function(){function e(e,r){this.jsonSchemaService=e,this.promise=r,this.validationEnabled=!0}return e.prototype.configure=function(e){e&&(this.validationEnabled=e.validate,this.commentSeverity=e.allowComments?void 0:a.DiagnosticSeverity.Error)},e.prototype.doValidation=function(e,r,i,c){var v=this;if(!this.validationEnabled)return this.promise.resolve([]);var l=[],u={},d=function(e){var r=e.range.start.line+" "+e.range.start.character+" "+e.message;u[r]||(u[r]=!0,l.push(e))},h=function(n){var c=i?o(i.trailingCommas):a.DiagnosticSeverity.Error,m=i?o(i.comments):v.commentSeverity;if(n){if(n.errors.length&&r.root){var u=r.root,h="object"===u.type?u.properties[0]:null;if(h&&"$schema"===h.keyNode.value){var g=h.valueNode||h,S=a.Range.create(e.positionAt(g.offset),e.positionAt(g.offset+g.length));d(a.Diagnostic.create(S,n.errors[0],a.DiagnosticSeverity.Warning,s.ErrorCode.SchemaResolveError))}else{var S=a.Range.create(e.positionAt(u.offset),e.positionAt(u.offset+1));d(a.Diagnostic.create(S,n.errors[0],a.DiagnosticSeverity.Warning,s.ErrorCode.SchemaResolveError))}}else{var p=r.validate(e,n.schema);p&&p.forEach(d)}t(n.schema)&&(c=m=void 0)}for(var y=0,E=r.syntaxErrors;y<E.length;y++){var C=E[y];if(C.code===s.ErrorCode.TrailingComma){if("number"!=typeof c)continue;C.severity=c}d(C)}if("number"==typeof m){var b=f("InvalidCommentToken","Comments are not permitted in JSON.");r.comments.forEach(function(e){d(a.Diagnostic.create(e,b,m,s.ErrorCode.CommentNotPermitted))})}return l};if(c){var g=c.id||"schemaservice://untitled/"+m++;return this.jsonSchemaService.resolveSchemaContent(new n.UnresolvedSchema(c),g,{}).then(function(e){return h(e)})}return this.jsonSchemaService.getSchemaForResource(e.uri,r).then(function(e){return h(e)})},e}();r.JSONValidation=v;var m=0});