amis.define("f9e39b3",function(e,t){"use strict";function n(e){if(e){var t=e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,"$1\n\n$3");return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}return void 0}Object.defineProperty(t,"__esModule",{value:!0});var r=e("11ed2ab"),i=r.__importStar(e("8408640")),o=e("737c70e"),s=function(){function e(e,t,n){void 0===t&&(t=[]),this.schemaService=e,this.contributions=t,this.promise=n||Promise}return e.prototype.doHover=function(e,t,r){var s=e.offsetAt(t),u=r.getNodeFromOffset(s);if(!u||("object"===u.type||"array"===u.type)&&s>u.offset+1&&s<u.offset+u.length-1)return this.promise.resolve(null);var a=u;if("string"===u.type){var c=u.parent;if(c&&"property"===c.type&&c.keyNode===u&&(u=c.valueNode,!u))return this.promise.resolve(null)}for(var f=o.Range.create(e.positionAt(a.offset),e.positionAt(a.offset+a.length)),m=function(e){var t={contents:e,range:f};return t},h=i.getNodePath(u),l=this.contributions.length-1;l>=0;l--){var p=this.contributions[l],v=p.getInfoContribution(e.uri,h);if(v)return v.then(function(e){return m(e)})}return this.schemaService.getSchemaForResource(e.uri,r).then(function(e){if(e){var t=r.getMatchingSchemas(e.schema,u.offset),o=null,s=null,a=null,c=null;t.every(function(e){if(e.node===u&&!e.inverted&&e.schema&&(o=o||e.schema.title,s=s||e.schema.markdownDescription||n(e.schema.description),e.schema.enum)){var t=e.schema.enum.indexOf(i.getNodeValue(u));e.schema.markdownEnumDescriptions?a=e.schema.markdownEnumDescriptions[t]:e.schema.enumDescriptions&&(a=n(e.schema.enumDescriptions[t])),a&&(c=e.schema.enum[t],"string"!=typeof c&&(c=JSON.stringify(c)))}return!0});var f="";return o&&(f=n(o)),s&&(f.length>0&&(f+="\n\n"),f+=s),a&&(f.length>0&&(f+="\n\n"),f+="`"+n(c)+"`: "+a),m([f])}return null})},e}();t.JSONHover=s});