mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-27 01:33:37 +00:00
37 lines
126 KiB
JavaScript
37 lines
126 KiB
JavaScript
|
/*!-----------------------------------------------------------------------------
|
||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
* Version: 0.46.0(21007360cad28648bdf46282a2592cb47c3a7a6f)
|
||
|
* Released under the MIT license
|
||
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||
|
*-----------------------------------------------------------------------------*/
|
||
|
define("vs/language/json/jsonWorker", ["require","require"],(require)=>{
|
||
|
"use strict";var moduleExports=(()=>{var ht=Object.defineProperty;var Hr=Object.getOwnPropertyDescriptor;var Gr=Object.getOwnPropertyNames;var Xr=Object.prototype.hasOwnProperty;var Zr=(t,r)=>{for(var i in r)ht(t,i,{get:r[i],enumerable:!0})},Qr=(t,r,i,e)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Gr(r))!Xr.call(t,n)&&n!==i&&ht(t,n,{get:()=>r[n],enumerable:!(e=Hr(r,n))||e.enumerable});return t};var Yr=t=>Qr(ht({},"__esModule",{value:!0}),t);var _n={};Zr(_n,{JSONWorker:()=>ft,create:()=>Bn});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,I=0;E<v||!O;){var A=t.charCodeAt(e);if(A>=48&&A<=57)I=I*16+A-48;else if(A>=65&&A<=70)I=I*16+A-65+10;else if(A>=97&&A<=102)I=I*16+A-97+10;else break;e++,E++}return E<v&&(I=-1),I}function d(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 I=t.charCodeAt(e++);switch(I){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(Me(E)){v+=t.substring(O,e),c=2;break}else c=6;e++}return v}function g(){if(n="",c=0,a=e,f=o,u=l,e>=i)return a=i,s=17;var v=t.charCodeAt(e);if(gt(v)){do e++,n+=String.fromCharCode(v),v=t.charCodeAt(e);while(gt(v));return s=15}if(Me(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&&!Me(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,I=!1;e<E;){var A=t.charCodeAt(e);if(A===42&&t.charCodeAt(e+1)===47){e+=2,I=!0;break}e++,Me(A)&&(A===13&&t.charCodeAt(e)===10&&e++,o++,l=e)}return I||(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(gt(v)||Me(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=g();while(v>=12&&v<=15);return v}return{setPosition:d,getPosition:function(){return e},scan:r?y:g,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 gt(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 Me(t){return t===10||t===13||t===8232||t===8233}function Oe(t){return t>=48&&t<=57}function mt(t,r,i){var e,n,a,s,o;if(r){for(s=r.offset,o=s+r.length,a=s;a>0&&!pt(t,a-1);)a--;for(var f=o;f<t.length&&!pt(t,f);)f++;n=t.substring(a,f),e=en(n,i)}else n=t,e=0,a=0,s=0,o=t.length;var l=tn(i,t),u=!1,c=0,h;i.insertSpaces?h=dt(" ",i.tabSize||4):h=" ";var d=Ce(n,!1),m=!1;function p(){return l+dt(h,e+c)}function g(){var N=d.scan();for(u=!1;N===15||N===14;)u=u||N===14,N=d.scan();return m=N===16||d.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=g();if(v!==17){var O=d.getTokenOffset()+a,E=dt(h,e);y(E,a,O)}for(;v!==17;){for(var I=d.getTokenOffset()+d.getTokenLength()+a,A=g(),P="",w=!1;!u&&(A===12||A===13);){var C=d.getTokenOffset()+a;y(" ",I,C),I=d.getTokenOffset()+d.getTokenLength()+a,w=A===12,P=w?p():"",A=g()}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=d.getTokenOffset()+a;y(P,I,F),v=A}return b}function dt(t,r){for(var i="",e=0;e<r;e++)i+=t;return i}function en(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 tn(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 pt(t,r){return`\r
|
||
|
`.indexOf(t.charAt(r))!==-1}var ze;(function(t){t.DEFAULT={allowTrailingComma:!1}})(ze||(ze={}));function Zt(t,r,i){r===void 0&&(r=[]),i===void 0&&(i=ze.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 Qt(t,o,i),n[0]}function vt(t){if(!t.parent||!t.parent.children)return[];var r=vt(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 Be(t){switch(t.type){case"array":return t.children.map(Be);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]=Be(a))}return r;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function nn(t,r,i){return i===void 0&&(i=!1),r>=t.offset&&r<t.offset+t.length||i&&r===t.offset+t.length}function yt(t,r,i){if(i===void 0&&(i=!1),nn(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=yt(e[n],r,i);if(a)return a}return t}}function Qt(t,r,i){i===void 0&&(i=ze.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),d=n(r.onComment),m=a(r.onError),p=i&&i.disallowComments,g=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):d();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 I(){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&&g)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&&g)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 I();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 Yt=Zt;var Kt=yt,er=vt,tr=Be;function rr(t,r,i){return mt(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){re
|
||
|
`,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(d){return typeof d<"u"}t.defined=i;function e(d){return typeof d>"u"}t.undefined=e;function n(d){return d===!0||d===!1}t.boolean=n;function a(d){return r.call(d)==="[object String]"}t.string=a;function s(d){return r.call(d)==="[object Number]"}t.number=s;function o(d,m,p){return r.call(d)==="[object Number]"&&m<=d&&d<=p}t.numberRange=o;function f(d){return r.call(d)==="[object Number]"&&-2147483648<=d&&d<=2147483647}t.integer=f;function l(d){return r.call(d)==="[object Number]"&&0<=d&&d<=2147483647}t.uinteger=l;function u(d){return r.call(d)==="[object Function]"}t.func=u;function c(d){return d!==null&&typeof d=="object"}t.objectLiteral=c;function h(d,m){return Array.isArray(d)&&d.every(m)}t.typedArray=h})(x||(x={}));var Ye=class t{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(t.isIncremental(e)){let n=Sr(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=xr(e.text,!1,a);if(f-o===u.length)for(let h=0,d=u.length;h<d;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,d=l.length;h<d;h++)l[h]=l[h]+c}else if(t.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=xr(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}},Ue;(function(t){function r(n,a,s,o){return new Ye(n,a,s,o)}t.create=r;function i(n,a,s){if(n instanceof Ye)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=Vt(a.map(ln),(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})(Ue||(Ue={}));function Vt(t,
|
||
|
`,a=0;a<t.length;a++)n+=e+tt(t[a],e,i),a<t.length-1&&(n+=","),n+=`
|
||
|
`;return n+=r+"]",n}else{var s=Object.keys(t);if(s.length===0)return"{}";for(var n=`{
|
||
|
`,a=0;a<s.length;a++){var o=s[a];n+=e+JSON.stringify(o)+": "+tt(t[o],e,i),a<s.length-1&&(n+=","),n+=`
|
||
|
`}return n+=r+"}",n}}return i(t)}var Ut=he(),Sn=[",","}","]"],An=[":"],Cr=function(){function t(r,i,e,n){i===void 0&&(i=[]),e===void 0&&(e=Promise),n===void 0&&(n={}),this.schemaService=r,this.contributions=i,this.promiseConstructor=e,this.clientCapabilities=n}return t.prototype.doResolve=function(r){for(var i=this.contributions.length-1;i>=0;i--){var e=this.contributions[i].resolveCompletion;if(e){var n=e(r);if(n)return n}}return this.promiseConstructor.resolve(r)},t.prototype.doComplete=function(r,i,e){var n=this,a={items:[],isIncomplete:!1},s=r.getText(),o=r.offsetAt(i),f=e.getNodeFromOffset(o,!0);if(this.isInComment(r,f?f.offset:0,o))return Promise.resolve(a);if(f&&o===f.offset+f.length&&o>0){var l=s[o-1];(f.type==="object"&&l==="}"||f.type==="array"&&l==="]")&&(f=f.parent)}var u=this.getCurrentWord(r,o),c;if(f&&(f.type==="string"||f.type==="number"||f.type==="boolean"||f.type==="null"))c=U.create(r.positionAt(f.offset),r.positionAt(f.offset+f.length));else{var h=o-u.length;h>0&&s[h-1]==='"'&&h--,c=U.create(r.positionAt(h),i)}var d=!1,m={},p={add:function(g){var b=g.label,y=m[b];if(y)y.documentation||(y.documentation=g.documentation),y.detail||(y.detail=g.detail);else{if(b=b.replace(/[\n]/g,"\u21B5"),b.length>60){var v=b.substr(0,57).trim()+"...";m[v]||(b=v)}c&&g.insertText!==void 0&&(g.textEdit=Y.replace(c,g.insertText)),d&&(g.commitCharacters=g.kind===Q.Property?An:Sn),g.label=b,m[b]=g,a.items.push(g)}},setAsIncomplete:function(){a.isIncomplete=!0},error:function(g){console.error(g)},log:function(g){console.log(g)},getNumberOfProposals:function(){return a.items.length}};return this.schemaService.getSchemaForResource(r.uri,e).then(function(g){var b=[],y=!0,v="",O=void 0;if(f&&f.type==="string"){var E=f.parent;E&&E.type==="property"&&E.keyNode===f&&(y=!E.valueNode,O=E,v=s.substr(f.offset+1,f.length-2),E&&(f=E.parent))}if(f&&f.type==="object"){if(f.offset===o)return a;var I=f.properties;I.forEach(function(C){(!O||O!==C)&&(m[C.keyNode.value]=$e.create("__"))});var A="";y&&(A=n.evaluateSeparatorAfter(r,r.offsetAt(c.end))),g?n.getPropertyCompletions(g,e,f,y,A,p):n.getSchemaLessPropertyCompletions(e,f,v,p);var P=Je(f);n.contributions.forEach(function(C){var F=C.collectPropertyCompletions(r.uri,P,u,y,A==="",p);F&&b.push(F)}),!g&&u.length>0&&s.charAt(o-u.length-1)!=='"'&&(p.add({kind:Q.Property,label:n.getLabelForValue(u),insertText:n.getInsertTextForProperty(u,void 0,!1,A),insertTextFormat:z.Snippet,documentation:""}),p.setAsIncomplete())}var w={};return g?n.getValueCompletions(g,e,f,o,r,p,w):n.getSchemaLessValueCompletions(e,f,o,r,p),n.contributions.length>0&&n.getContributedValueCompletions(e,f,o,r,p,b),n.promiseConstructor.all(b).then(function(){if(p.getNumberOfProposals()===0){var C=o;f&&(f.type==="string"||f.type==="number"||f.type==="boolean"||f.type==="null")&&(C=f.offset+f.length);var F=n.evaluateSeparatorAfter(r,C);n.addFillerValueCompletions(w,F,p)}return a})})},t.prototype.getPropertyCompletions=function(r,i,e,n,a,s){var o=this,f=i.getMatchingSchemas(r.schema,e.offset);f.forEach(function(l){if(l.node===e&&!l.inverted){var u=l.schema.properties;u&&Object.keys(u).forEach(function(p){var g=u[p];if(typeof g=="object"&&!g.deprecationMessage&&!g.doNotSuggest){var b={kind:Q.Property,label:p,insertText:o.getInsertTextForProperty(p,g,n,a),insertTextFormat:z.Snippet,filterText:o.getFilterTextForValue(p),documentation:o.fromMarkup(g.markdownDescription)||g.description||""};g.suggestSortText!==void 0&&(b.sortText=g.suggestSortText),b.insertText&&pe(b.insertText,"$1".concat(a))&&(b.command={title:"Suggest",command:"editor.action.triggerSuggest"}),s.add(b)}});var c=l.schema.propertyNames;if(typeof c=="object"&&!c.deprecationMessage&&!c.doNotSuggest){var h=function(p,g){g===void 0&&(g=void 0);var b={kind:Q.Property,label:p,insertText:o.getInsertTextForProperty(p,void 0,n,a),insertTextFormat:z.Snippet,filterText:o.getFilterTextForValue(p),documentation:g||o.fromMarkup(c.markdownDescription)||c.description||""};c.suggestSortText!==void 0&&(b.sortText=c.suggestSortText),b.insertText&&pe(b.insertText,"$1".concat(a))&&(b.command={
|
||
|
`,v=v+`
|
||
|
`+O+"]",O+=" ",c="array";m=y+O+u.bodyText.split(`
|
||
|
`).join(`
|
||
|
`+O)+v+i,d=d||m,p=m.replace(/[\n]/g,"")}else return;e.add({kind:a.getSuggestionKind(c),label:d,documentation:a.fromMarkup(u.markdownDescription)||u.description,insertText:m,insertTextFormat:z.Snippet,filterText:p}),s=!0}),!s&&typeof r.items=="object"&&!Array.isArray(r.items)&&n<5&&this.addDefaultValueCompletions(r.items,i,e,n+1)},t.prototype.addEnumValueCompletions=function(r,i,e){if(se(r.const)&&e.add({kind:this.getSuggestionKind(r.type),label:this.getLabelForValue(r.const),insertText:this.getInsertTextForValue(r.const,i),insertTextFormat:z.Snippet,documentation:this.fromMarkup(r.markdownDescription)||r.description}),Array.isArray(r.enum))for(var n=0,a=r.enum.length;n<a;n++){var s=r.enum[n],o=this.fromMarkup(r.markdownDescription)||r.description;r.markdownEnumDescriptions&&n<r.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?o=this.fromMarkup(r.markdownEnumDescriptions[n]):r.enumDescriptions&&n<r.enumDescriptions.length&&(o=r.enumDescriptions[n]),e.add({kind:this.getSuggestionKind(r.type),label:this.getLabelForValue(s),insertText:this.getInsertTextForValue(s,i),insertTextFormat:z.Snippet,documentation:o})}},t.prototype.collectTypes=function(r,i){if(!(Array.isArray(r.enum)||se(r.const))){var e=r.type;Array.isArray(e)?e.forEach(function(n){return i[n]=!0}):e&&(i[e]=!0)}},t.prototype.addFillerValueCompletions=function(r,i,e){r.object&&e.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},i),insertTextFormat:z.Snippet,detail:Ut("defaults.object","New object"),documentation:""}),r.array&&e.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],i),insertTextFormat:z.Snippet,detail:Ut("defaults.array","New array"),documentation:""})},t.prototype.addBooleanValueCompletion=function(r,i,e){e.add({kind:this.getSuggestionKind("boolean"),label:r?"true":"false",insertText:this.getInsertTextForValue(r,i),insertTextFormat:z.Snippet,documentation:""})},t.prototype.addNullValueCompletion=function(r,i){i.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+r,insertTextFormat:z.Snippet,documentation:""})},t.prototype.addDollarSchemaCompletions=function(r,i){var e=this,n=this.schemaService.getRegisteredSchemaIds(function(a){return a==="http"||a==="https"});n.forEach(function(a){return i.add({kind:Q.Module,label:e.getLabelForValue(a),filterText:e.getFilterTextForValue(a),insertText:e.getInsertTextForValue(a,r),insertTextFormat:z.Snippet,documentation:""})})},t.prototype.getLabelForValue=function(r){return JSON.stringify(r)},t.prototype.getFilterTextForValue=function(r){return JSON.stringify(r)},t.prototype.getFilterTextForSnippetValue=function(r){return JSON.stringify(r).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},t.prototype.getLabelForSnippetValue=function(r){var i=JSON.stringify(r);return i.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},t.prototype.getInsertTextForPlainText=function(r){return r.replace(/[\\\$\}]/g,"\\$&")},t.prototype.getInsertTextForValue=function(r,i){var e=JSON.stringify(r,null," ");return e==="{}"?"{$1}"+i:e==="[]"?"[$1]"+i:this.getInsertTextForPlainText(e+i)},t.prototype.getInsertTextForSnippetValue=function(r,i){var e=function(n){return typeof n=="string"&&n[0]==="^"?n.substr(1):JSON.stringify(n)};return tt(r,"",e)+i},t.prototype.getInsertTextForGuessedValue=function(r,i){switch(typeof r){case"object":return r===null?"${1:null}"+i:this.getInsertTextForValue(r,i);case"string":var e=JSON.stringify(r);return e=e.substr(1,e.length-2),e=this.getInsertTextForPlainText(e),'"${1:'+e+'}"'+i;case"number":case"boolean":return"${1:"+JSON.stringify(r)+"}"+i}return this.getInsertTextForValue(r,i)},t.prototype.getSuggestionKind=function(r){if(Array.isArray(r)){var i=r;r=i.length>0?i[0]:void 0}if(!r)return Q.Value;switch(r){case"string":return Q.Value;case"object":return Q.Module;case"property":return Q.Property;default:return Q.Value}},t.prototype.getLabelTextForMatchingNode=function(r,i){switch(r.type){case"array":return"[]";case"object":return"{}";default:var e=i.getText().substr(r.offset,r.length);return e}},t
|
||
|
\r\v":{[,]}`.indexOf(n.charAt(e))===-1;)e--;return n.substring(e+1,i)},t.prototype.evaluateSeparatorAfter=function(r,i){var e=le(r.getText(),!0);e.setPosition(i);var n=e.scan();switch(n){case 5:case 2:case 4:case 17:return"";default:return","}},t.prototype.findItemAtOffset=function(r,i,e){for(var n=le(i.getText(),!0),a=r.items,s=a.length-1;s>=0;s--){var o=a[s];if(e>o.offset+o.length){n.setPosition(o.offset+o.length);var f=n.scan();return f===5&&e>=n.getTokenOffset()+n.getTokenLength()?s+1:s}else if(e>=o.offset)return s}return 0},t.prototype.isInComment=function(r,i,e){var n=le(r.getText(),!1);n.setPosition(i);for(var a=n.scan();a!==17&&n.getTokenOffset()+n.getTokenLength()<e;)a=n.scan();return(a===12||a===13)&&n.getTokenOffset()<=e},t.prototype.fromMarkup=function(r){if(r&&this.doesSupportMarkdown())return{kind:fe.Markdown,value:r}},t.prototype.doesSupportMarkdown=function(){if(!se(this.supportsMarkdown)){var r=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=r&&r.completionItem&&Array.isArray(r.completionItem.documentationFormat)&&r.completionItem.documentationFormat.indexOf(fe.Markdown)!==-1}return this.supportsMarkdown},t.prototype.doesSupportsCommitCharacters=function(){if(!se(this.supportsCommitCharacters)){var r=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsCommitCharacters=r&&r.completionItem&&!!r.completionItem.commitCharactersSupport}return this.supportsCommitCharacters},t}();var Pr=function(){function t(r,i,e){i===void 0&&(i=[]),this.schemaService=r,this.contributions=i,this.promise=e||Promise}return t.prototype.doHover=function(r,i,e){var n=r.offsetAt(i),a=e.getNodeFromOffset(n);if(!a||(a.type==="object"||a.type==="array")&&n>a.offset+1&&n<a.offset+a.length-1)return this.promise.resolve(null);var s=a;if(a.type==="string"){var o=a.parent;if(o&&o.type==="property"&&o.keyNode===a&&(a=o.valueNode,!a))return this.promise.resolve(null)}for(var f=U.create(r.positionAt(s.offset),r.positionAt(s.offset+s.length)),l=function(m){var p={contents:m,range:f};return p},u=Je(a),c=this.contributions.length-1;c>=0;c--){var h=this.contributions[c],d=h.getInfoContribution(r.uri,u);if(d)return d.then(function(m){return l(m)})}return this.schemaService.getSchemaForResource(r.uri,e).then(function(m){if(m&&a){var p=e.getMatchingSchemas(m.schema,a.offset),g=void 0,b=void 0,y=void 0,v=void 0;p.every(function(E){if(E.node===a&&!E.inverted&&E.schema&&(g=g||E.schema.title,b=b||E.schema.markdownDescription||Wt(E.schema.description),E.schema.enum)){var I=E.schema.enum.indexOf(de(a));E.schema.markdownEnumDescriptions?y=E.schema.markdownEnumDescriptions[I]:E.schema.enumDescriptions&&(y=Wt(E.schema.enumDescriptions[I])),y&&(v=E.schema.enum[I],typeof v!="string"&&(v=JSON.stringify(v)))}return!0});var O="";return g&&(O=Wt(g)),b&&(O.length>0&&(O+=`
|
||
|
|
||
|
`),O+=b),y&&(O.length>0&&(O+=`
|
||
|
|
||
|
`),O+="`".concat(wn(v),"`: ").concat(y)),l([O])}return null})},t}();function Wt(t){if(t){var r=t.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
|
||
|
|
||
|
$3`);return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function wn(t){return t.indexOf("`")!==-1?"`` "+t+" ``":t}var Tn=he(),jr=function(){function t(r,i){this.jsonSchemaService=r,this.promise=i,this.validationEnabled=!0}return t.prototype.configure=function(r){r&&(this.validationEnabled=r.validate!==!1,this.commentSeverity=r.allowComments?void 0:Z.Error)},t.prototype.doValidation=function(r,i,e,n){var a=this;if(!this.validationEnabled)return this.promise.resolve([]);var s=[],o={},f=function(h){var d=h.range.start.line+" "+h.range.start.character+" "+h.message;o[d]||(o[d]=!0,s.push(h))},l=function(h){var d=e?.trailingCommas?rt(e.trailingCommas):Z.Error,m=e?.comments?rt(e.comments):a.commentSeverity,p=e?.schemaValidation?rt(e.schemaValidation):Z.Warning,g=e?.schemaRequest?rt(e.schemaRequest):Z.Warning;if(h){if(h.errors.length&&i.root&&g){var b=i.root,y=b.type==="object"?b.properties[0]:void 0;if(y&&y.keyNode.value==="$schema"){var v=y.valueNode||y,O=U.create(r.positionAt(v.offset),r.positionAt(v.offset+v.length));f(ae.create(O,h.errors[0],g,W.SchemaResolveError))}else{var O=U.create(r.positionAt(b.offset),r.positionAt(b.offset+1));f(ae.create(O,h.errors[0],g,W.SchemaResolveError))}}else if(p){var E=i.validate(r,h.schema,p);E&&E.forEach(f)}Er(h.schema)&&(m=void 0),Ir(h.schema)&&(d=void 0)}for(var I=0,A=i.syntaxErrors;I<A.length;I++){var P=A[I];if(P.code===W.TrailingComma){if(typeof d!="number")continue;P.severity=d}f(P)}if(typeof m=="number"){var w=Tn("InvalidCommentToken","Comments are not permitted in JSON.");i.comments.forEach(function(C){f(ae.create(C,w,m,W.CommentNotPermitted))})}return s};if(n){var u=n.id||"schemaservice://untitled/"+kn++,c=this.jsonSchemaService.registerExternalSchema(u,[],n);return c.getResolvedSchema().then(function(h){return l(h)})}return this.jsonSchemaService.getSchemaForResource(r.uri,i).then(function(h){return l(h)})},t.prototype.getLanguageStatus=function(r,i){return{schemas:this.jsonSchemaService.getSchemaURIsForResource(r.uri,i)}},t}();var kn=0;function Er(t){if(t&&typeof t=="object"){if(ie(t.allowComments))return t.allowComments;if(t.allOf)for(var r=0,i=t.allOf;r<i.length;r++){var e=i[r],n=Er(e);if(ie(n))return n}}}function Ir(t){if(t&&typeof t=="object"){if(ie(t.allowTrailingCommas))return t.allowTrailingCommas;var r=t;if(ie(r.allowsTrailingCommas))return r.allowsTrailingCommas;if(t.allOf)for(var i=0,e=t.allOf;i<e.length;i++){var n=e[i],a=Ir(n);if(ie(a))return a}}}function rt(t){switch(t){case"error":return Z.Error;case"warning":return Z.Warning;case"ignore":return}}var Nr=48,On=57,Cn=65,nt=97,Pn=102;function B(t){return t<Nr?0:t<=On?t-Nr:(t<nt&&(t+=nt-Cn),t>=nt&&t<=Pn?t-nt+10:0)}function Mr(t){if(t[0]==="#")switch(t.length){case 4:return{red:B(t.charCodeAt(1))*17/255,green:B(t.charCodeAt(2))*17/255,blue:B(t.charCodeAt(3))*17/255,alpha:1};case 5:return{red:B(t.charCodeAt(1))*17/255,green:B(t.charCodeAt(2))*17/255,blue:B(t.charCodeAt(3))*17/255,alpha:B(t.charCodeAt(4))*17/255};case 7:return{red:(B(t.charCodeAt(1))*16+B(t.charCodeAt(2)))/255,green:(B(t.charCodeAt(3))*16+B(t.charCodeAt(4)))/255,blue:(B(t.charCodeAt(5))*16+B(t.charCodeAt(6)))/255,alpha:1};case 9:return{red:(B(t.charCodeAt(1))*16+B(t.charCodeAt(2)))/255,green:(B(t.charCodeAt(3))*16+B(t.charCodeAt(4)))/255,blue:(B(t.charCodeAt(5))*16+B(t.charCodeAt(6)))/255,alpha:(B(t.charCodeAt(7))*16+B(t.charCodeAt(8)))/255}}}var Fr=function(){function t(r){this.schemaService=r}return t.prototype.findDocumentSymbols=function(r,i,e){var n=this;e===void 0&&(e={resultLimit:Number.MAX_VALUE});var a=i.root;if(!a)return[];var s=e.resultLimit||Number.MAX_VALUE,o=r.uri;if((o==="vscode://defaultsettings/keybindings.json"||pe(o.toLowerCase(),"/user/keybindings.json"))&&a.type==="array"){for(var f=[],l=0,u=a.items;l<u.length;l++){var c=u[l];if(c.type==="object")for(var h=0,d=c.properties;h<d.length;h++){var m=d[h];if(m.keyNode.value==="key"&&m.valueNode){var p=Se.create(r.uri,ve(r,c));if(f.push({name:de(m.valueNode),kind:oe.Function,location:p}),s--,s<=0)return e&&e.onResultLimitExceeded&&e.onResultLimitExceeded(o),f}}}return f}for(var g=[{node:a,cont
|
||
|
`};return rr(o.getText(),u,d).map(function(m){return Y.replace(U.create(o.positionAt(m.offset),o.positionAt(m.offset+m.length)),m.content)})}}}var zr;typeof fetch<"u"&&(zr=function(t){return fetch(t).then(r=>r.text())});var ft=class{constructor(r,i){this._ctx=r,this._languageSettings=i.languageSettings,this._languageId=i.languageId,this._languageService=qr({workspaceContext:{resolveRelativePath:(e,n)=>{let a=n.substr(0,n.lastIndexOf("/")+1);return qn(a,e)}},schemaRequestService:i.enableSchemaRequest?zr:void 0,clientCapabilities:Ke.LATEST}),this._languageService.configure(this._languageSettings)}async doValidation(r){let i=this._getTextDocument(r);if(i){let e=this._languageService.parseJSONDocument(i);return this._languageService.doValidation(i,e,this._languageSettings)}return Promise.resolve([])}async doComplete(r,i){let e=this._getTextDocument(r);if(!e)return null;let n=this._languageService.parseJSONDocument(e);return this._languageService.doComplete(e,i,n)}async doResolve(r){return this._languageService.doResolve(r)}async doHover(r,i){let e=this._getTextDocument(r);if(!e)return null;let n=this._languageService.parseJSONDocument(e);return this._languageService.doHover(e,i,n)}async format(r,i,e){let n=this._getTextDocument(r);if(!n)return[];let a=this._languageService.format(n,i,e);return Promise.resolve(a)}async resetSchema(r){return Promise.resolve(this._languageService.resetSchema(r))}async findDocumentSymbols(r){let i=this._getTextDocument(r);if(!i)return[];let e=this._languageService.parseJSONDocument(i),n=this._languageService.findDocumentSymbols2(i,e);return Promise.resolve(n)}async findDocumentColors(r){let i=this._getTextDocument(r);if(!i)return[];let e=this._languageService.parseJSONDocument(i),n=this._languageService.findDocumentColors(i,e);return Promise.resolve(n)}async getColorPresentations(r,i,e){let n=this._getTextDocument(r);if(!n)return[];let a=this._languageService.parseJSONDocument(n),s=this._languageService.getColorPresentations(n,a,i,e);return Promise.resolve(s)}async getFoldingRanges(r,i){let e=this._getTextDocument(r);if(!e)return[];let n=this._languageService.getFoldingRanges(e,i);return Promise.resolve(n)}async getSelectionRanges(r,i){let e=this._getTextDocument(r);if(!e)return[];let n=this._languageService.parseJSONDocument(e),a=this._languageService.getSelectionRanges(e,i,n);return Promise.resolve(a)}async parseJSONDocument(r){let i=this._getTextDocument(r);if(!i)return null;let e=this._languageService.parseJSONDocument(i);return Promise.resolve(e)}async getMatchingSchemas(r){let i=this._getTextDocument(r);if(!i)return[];let e=this._languageService.parseJSONDocument(i);return Promise.resolve(this._languageService.getMatchingSchemas(i,e))}_getTextDocument(r){let i=this._ctx.getMirrorModels();for(let e of i)if(e.uri.toString()===r)return Ue.create(r,this._languageId,e.version,e.getValue());return null}},Wn=47,zt=46;function Jn(t){return t.charCodeAt(0)===Wn}function qn(t,r){if(Jn(r)){let i=ye.parse(t),e=r.split("/");return i.with({path:Br(e)}).toString()}return zn(t,r)}function Br(t){let r=[];for(let e of t)e.length===0||e.length===1&&e.charCodeAt(0)===zt||(e.length===2&&e.charCodeAt(0)===zt&&e.charCodeAt(1)===zt?r.pop():r.push(e));t.length>1&&t[t.length-1].length===0&&r.push("");let i=r.join("/");return t[0].length===0&&(i="/"+i),i}function zn(t,...r){let i=ye.parse(t),e=i.path.split("/");for(let n of r)e.push(...n.split("/"));return i.with({path:Br(e)}).toString()}function Bn(t,r){return new ft(t,r)}return Yr(_n);})();
|
||
|
return moduleExports;
|
||
|
});
|