/*! For license information please see languageserver-web.js.LICENSE.txt */ var serverExportVar;(()=>{var e={8533:(e,t)=>{t.l=class{constructor(){}configure(){}format(){return[]}}},4063:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){var s=o[i];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},6486:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",c=32,u=128,l=1/0,f=9007199254740991,h=NaN,d=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",c],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",y="[object Boolean]",v="[object Date]",b="[object Error]",w="[object Function]",_="[object GeneratorFunction]",S="[object Map]",k="[object Number]",x="[object Object]",C="[object Promise]",T="[object RegExp]",E="[object Set]",P="[object String]",R="[object Symbol]",A="[object WeakMap]",O="[object ArrayBuffer]",$="[object DataView]",N="[object Float32Array]",j="[object Float64Array]",I="[object Int8Array]",D="[object Int16Array]",M="[object Int32Array]",q="[object Uint8Array]",F="[object Uint8ClampedArray]",L="[object Uint16Array]",V="[object Uint32Array]",W=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,z=/[&<>"']/g,H=RegExp(K.source),J=RegExp(z.source),G=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,se=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,we=/['\n\r\u2028\u2029\\]/g,_e="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ke="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Ee="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="["+_e+"]",Re="["+Ee+"]",Ae="["+Se+"]",Oe="\\d+",$e="["+ke+"]",Ne="["+xe+"]",je="[^"+_e+Ee+Oe+ke+xe+Ce+"]",Ie="\\ud83c[\\udffb-\\udfff]",De="[^"+_e+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",qe="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Ce+"]",Le="\\u200d",Ve="(?:"+Ne+"|"+je+")",We="(?:"+Fe+"|"+je+")",Ue="(?:['’](?:d|ll|m|re|s|t|ve))?",Be="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ke="(?:"+Ae+"|"+Ie+")?",ze="["+Te+"]?",He=ze+Ke+"(?:"+Le+"(?:"+[De,Me,qe].join("|")+")"+ze+Ke+")*",Je="(?:"+[$e,Me,qe].join("|")+")"+He,Ge="(?:"+[De+Ae+"?",Ae,Me,qe,Pe].join("|")+")",Ye=RegExp("['’]","g"),Qe=RegExp(Ae,"g"),Xe=RegExp(Ie+"(?="+Ie+")|"+Ge+He,"g"),Ze=RegExp([Fe+"?"+Ne+"+"+Ue+"(?="+[Re,Fe,"$"].join("|")+")",We+"+"+Be+"(?="+[Re,Fe+Ve,"$"].join("|")+")",Fe+"?"+Ve+"+"+Ue,Fe+"+"+Be,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Je].join("|"),"g"),et=RegExp("["+Le+_e+Se+Te+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,it={};it[N]=it[j]=it[I]=it[D]=it[M]=it[q]=it[F]=it[L]=it[V]=!0,it[m]=it[g]=it[O]=it[y]=it[$]=it[v]=it[b]=it[w]=it[S]=it[k]=it[x]=it[T]=it[E]=it[P]=it[A]=!1;var ot={};ot[m]=ot[g]=ot[O]=ot[$]=ot[y]=ot[v]=ot[N]=ot[j]=ot[I]=ot[D]=ot[M]=ot[S]=ot[k]=ot[x]=ot[T]=ot[E]=ot[P]=ot[R]=ot[q]=ot[F]=ot[L]=ot[V]=!0,ot[b]=ot[w]=ot[A]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,ct=parseInt,ut="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,lt="object"==typeof self&&self&&self.Object===Object&&self,ft=ut||lt||Function("return this")(),ht=t&&!t.nodeType&&t,dt=ht&&e&&!e.nodeType&&e,pt=dt&&dt.exports===ht,mt=pt&&ut.process,gt=function(){try{return dt&&dt.require&&dt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),yt=gt&>.isArrayBuffer,vt=gt&>.isDate,bt=gt&>.isMap,wt=gt&>.isRegExp,_t=gt&>.isSet,St=gt&>.isTypedArray;function kt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function xt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function At(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function Zt(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}var en=Bt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+st[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"}),pn=function e(t){var n,r=(t=null==t?ft:pn.defaults(ft.Object(),t,pn.pick(ft,nt))).Array,ie=t.Date,_e=t.Error,Se=t.Function,ke=t.Math,xe=t.Object,Ce=t.RegExp,Te=t.String,Ee=t.TypeError,Pe=r.prototype,Re=Se.prototype,Ae=xe.prototype,Oe=t["__core-js_shared__"],$e=Re.toString,Ne=Ae.hasOwnProperty,je=0,Ie=(n=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",De=Ae.toString,Me=$e.call(xe),qe=ft._,Fe=Ce("^"+$e.call(Ne).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Le=pt?t.Buffer:i,Ve=t.Symbol,We=t.Uint8Array,Ue=Le?Le.allocUnsafe:i,Be=sn(xe.getPrototypeOf,xe),Ke=xe.create,ze=Ae.propertyIsEnumerable,He=Pe.splice,Je=Ve?Ve.isConcatSpreadable:i,Ge=Ve?Ve.iterator:i,Xe=Ve?Ve.toStringTag:i,et=function(){try{var e=co(xe,"defineProperty");return e({},"",{}),e}catch(e){}}(),st=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,ut=ie&&ie.now!==ft.Date.now&&ie.now,lt=t.setTimeout!==ft.setTimeout&&t.setTimeout,ht=ke.ceil,dt=ke.floor,mt=xe.getOwnPropertySymbols,gt=Le?Le.isBuffer:i,Dt=t.isFinite,Bt=Pe.join,mn=sn(xe.keys,xe),gn=ke.max,yn=ke.min,vn=ie.now,bn=t.parseInt,wn=ke.random,_n=Pe.reverse,Sn=co(t,"DataView"),kn=co(t,"Map"),xn=co(t,"Promise"),Cn=co(t,"Set"),Tn=co(t,"WeakMap"),En=co(xe,"create"),Pn=Tn&&new Tn,Rn={},An=Mo(Sn),On=Mo(kn),$n=Mo(xn),Nn=Mo(Cn),jn=Mo(Tn),In=Ve?Ve.prototype:i,Dn=In?In.valueOf:i,Mn=In?In.toString:i;function qn(e){if(ea(e)&&!Us(e)&&!(e instanceof Wn)){if(e instanceof Vn)return e;if(Ne.call(e,"__wrapped__"))return qo(e)}return new Vn(e)}var Fn=function(){function e(){}return function(t){if(!Zs(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Ln(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Wn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Un(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,n,r,o,s){var a,c=1&t,u=2&t,l=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!Zs(e))return e;var f=Us(e);if(f){if(a=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ne.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!c)return Ti(e,a)}else{var h=fo(e),d=h==w||h==_;if(Hs(e))return wi(e,c);if(h==x||h==m||d&&!o){if(a=u||d?{}:po(e),!c)return u?function(e,t){return Ei(e,lo(e),t)}(e,function(e,t){return e&&Ei(t,Oa(t),e)}(a,e)):function(e,t){return Ei(e,uo(e),t)}(e,nr(a,e))}else{if(!ot[h])return o?e:{};a=function(e,t,n){var r,i=e.constructor;switch(t){case O:return _i(e);case y:case v:return new i(+e);case $:return function(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case N:case j:case I:case D:case M:case q:case F:case L:case V:return Si(e,n);case S:return new i;case k:case P:return new i(e);case T:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new i;case R:return r=e,Dn?xe(Dn.call(r)):{}}}(e,h,c)}}s||(s=new Hn);var p=s.get(e);if(p)return p;s.set(e,a),oa(e)?e.forEach((function(r){a.add(sr(r,t,n,r,e,s))})):ta(e)&&e.forEach((function(r,i){a.set(i,sr(r,t,n,i,e,s))}));var g=f?i:(l?u?to:eo:u?Oa:Aa)(e);return Ct(g||e,(function(r,i){g&&(r=e[i=r]),Zn(a,i,sr(r,t,n,i,e,s))})),a}function ar(e,t,n){var r=n.length;if(null==e)return!r;for(e=xe(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function cr(e,t,n){if("function"!=typeof e)throw new Ee(o);return Po((function(){e.apply(i,n)}),t)}function ur(e,t,n,r){var i=-1,o=Rt,s=!0,a=e.length,c=[],u=t.length;if(!a)return c;n&&(t=Ot(t,Gt(n))),r?(o=At,s=!1):t.length>=200&&(o=Qt,s=!1,t=new zn(t));e:for(;++i-1},Bn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Kn.prototype.clear=function(){this.size=0,this.__data__={hash:new Un,map:new(kn||Bn),string:new Un}},Kn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Kn.prototype.get=function(e){return so(this,e).get(e)},Kn.prototype.has=function(e){return so(this,e).has(e)},Kn.prototype.set=function(e,t){var n=so(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},zn.prototype.add=zn.prototype.push=function(e){return this.__data__.set(e,s),this},zn.prototype.has=function(e){return this.__data__.has(e)},Hn.prototype.clear=function(){this.__data__=new Bn,this.size=0},Hn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Hn.prototype.get=function(e){return this.__data__.get(e)},Hn.prototype.has=function(e){return this.__data__.has(e)},Hn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Bn){var r=n.__data__;if(!kn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Kn(r)}return n.set(e,t),this.size=n.size,this};var lr=Ai(vr),fr=Ai(br,!0);function hr(e,t){var n=!0;return lr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function dr(e,t,n){for(var r=-1,o=e.length;++r0&&n(a)?t>1?mr(a,t-1,n,r,i):$t(i,a):r||(i[i.length]=a)}return i}var gr=Oi(),yr=Oi(!0);function vr(e,t){return e&&gr(e,t,Aa)}function br(e,t){return e&&yr(e,t,Aa)}function wr(e,t){return Pt(t,(function(t){return Ys(e[t])}))}function _r(e,t){for(var n=0,r=(t=gi(t,e)).length;null!=e&&nt}function Cr(e,t){return null!=e&&Ne.call(e,t)}function Tr(e,t){return null!=e&&t in xe(e)}function Er(e,t,n){for(var o=n?At:Rt,s=e[0].length,a=e.length,c=a,u=r(a),l=1/0,f=[];c--;){var h=e[c];c&&t&&(h=Ot(h,Gt(t))),l=yn(h.length,l),u[c]=!n&&(t||s>=120&&h.length>=120)?new zn(c&&h):i}h=e[0];var d=-1,p=u[0];e:for(;++d=a?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}));r--;)e[r]=e[r].value;return e}(i)}function Wr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&He.call(a,c,1),He.call(e,c,1);return e}function Br(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;go(i)?He.call(e,i,1):ci(e,i)}}return e}function Kr(e,t){return e+dt(wn()*(t-e+1))}function zr(e,t){var n="";if(!e||t<1||t>f)return n;do{t%2&&(n+=e),(t=dt(t/2))&&(e+=e)}while(t);return n}function Hr(e,t){return Ro(xo(e,t,nc),e+"")}function Jr(e){return Gn(Fa(e))}function Gr(e,t){var n=Fa(e);return $o(n,or(t,0,n.length))}function Yr(e,t,n,r){if(!Zs(e))return e;for(var o=-1,s=(t=gi(t,e)).length,a=s-1,c=e;null!=c&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i>>1,s=e[o];null!==s&&!aa(s)&&(n?s<=t:s=200){var u=t?null:zi(e);if(u)return cn(u);s=!1,i=Qt,c=new zn}else c=t?[]:a;e:for(;++r=r?e:ei(e,t,n)}var bi=st||function(e){return ft.clearTimeout(e)};function wi(e,t){if(t)return e.slice();var n=e.length,r=Ue?Ue(n):new e.constructor(n);return e.copy(r),r}function _i(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function Si(e,t){var n=t?_i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=aa(e),a=t!==i,c=null===t,u=t==t,l=aa(t);if(!c&&!l&&!s&&e>t||s&&a&&u&&!c&&!l||r&&a&&u||!n&&u||!o)return 1;if(!r&&!s&&!l&&e1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&yo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=xe(t);++r-1?o[s?t[a]:a]:i}}function Di(e){return Zi((function(t){var n=t.length,r=n,s=Vn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ee(o);if(s&&!c&&"wrapper"==ro(a))var c=new Vn([],!0)}for(r=c?r:n;++r1&&w.reverse(),d&&fc))return!1;var l=s.get(e),f=s.get(t);if(l&&f)return l==t&&f==e;var h=-1,d=!0,p=2&n?new zn:i;for(s.set(e,t),s.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ct(p,(function(n){var r="_."+n[0];t&n[1]&&!Rt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(se);return t?t[1].split(ae):[]}(r),n)))}function Oo(e){var t=0,n=0;return function(){var r=vn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function $o(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,is(e,n)}));function fs(e){var t=qn(e);return t.__chain__=!0,t}function hs(e,t){return t(e)}var ds=Zi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return ir(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Wn&&go(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:hs,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ps=Pi((function(e,t,n){Ne.call(e,n)?++e[n]:rr(e,n,1)})),ms=Ii(Wo),gs=Ii(Uo);function ys(e,t){return(Us(e)?Ct:lr)(e,oo(t,3))}function vs(e,t){return(Us(e)?Tt:fr)(e,oo(t,3))}var bs=Pi((function(e,t,n){Ne.call(e,n)?e[n].push(t):rr(e,n,[t])})),ws=Hr((function(e,t,n){var i=-1,o="function"==typeof t,s=Ks(e)?r(e.length):[];return lr(e,(function(e){s[++i]=o?kt(t,e,n):Pr(e,t,n)})),s})),_s=Pi((function(e,t,n){rr(e,n,t)}));function Ss(e,t){return(Us(e)?Ot:Dr)(e,oo(t,3))}var ks=Pi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),xs=Hr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Vr(e,mr(t,1),[])})),Cs=ut||function(){return ft.Date.now()};function Ts(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ji(e,u,i,i,i,i,t)}function Es(e,t){var n;if("function"!=typeof t)throw new Ee(o);return e=da(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ps=Hr((function(e,t,n){var r=1;if(n.length){var i=an(n,io(Ps));r|=c}return Ji(e,r,t,n,i)})),Rs=Hr((function(e,t,n){var r=3;if(n.length){var i=an(n,io(Rs));r|=c}return Ji(t,r,e,n,i)}));function As(e,t,n){var r,s,a,c,u,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof e)throw new Ee(o);function m(t){var n=r,o=s;return r=s=i,f=t,c=e.apply(o,n)}function g(e){var n=e-l;return l===i||n>=t||n<0||d&&e-f>=a}function y(){var e=Cs();if(g(e))return v(e);u=Po(y,function(e){var n=t-(e-l);return d?yn(n,a-(e-f)):n}(e))}function v(e){return u=i,p&&r?m(e):(r=s=i,c)}function b(){var e=Cs(),n=g(e);if(r=arguments,s=this,l=e,n){if(u===i)return function(e){return f=e,u=Po(y,t),h?m(e):c}(l);if(d)return bi(u),u=Po(y,t),m(l)}return u===i&&(u=Po(y,t)),c}return t=ma(t)||0,Zs(n)&&(h=!!n.leading,a=(d="maxWait"in n)?gn(ma(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),b.cancel=function(){u!==i&&bi(u),f=0,r=l=s=u=i},b.flush=function(){return u===i?c:v(Cs())},b}var Os=Hr((function(e,t){return cr(e,1,t)})),$s=Hr((function(e,t,n){return cr(e,ma(t)||0,n)}));function Ns(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Ns.Cache||Kn),n}function js(e){if("function"!=typeof e)throw new Ee(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ns.Cache=Kn;var Is=yi((function(e,t){var n=(t=1==t.length&&Us(t[0])?Ot(t[0],Gt(oo())):Ot(mr(t,1),Gt(oo()))).length;return Hr((function(r){for(var i=-1,o=yn(r.length,n);++i=t})),Ws=Rr(function(){return arguments}())?Rr:function(e){return ea(e)&&Ne.call(e,"callee")&&!ze.call(e,"callee")},Us=r.isArray,Bs=yt?Gt(yt):function(e){return ea(e)&&kr(e)==O};function Ks(e){return null!=e&&Xs(e.length)&&!Ys(e)}function zs(e){return ea(e)&&Ks(e)}var Hs=gt||mc,Js=vt?Gt(vt):function(e){return ea(e)&&kr(e)==v};function Gs(e){if(!ea(e))return!1;var t=kr(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ra(e)}function Ys(e){if(!Zs(e))return!1;var t=kr(e);return t==w||t==_||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qs(e){return"number"==typeof e&&e==da(e)}function Xs(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function Zs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ea(e){return null!=e&&"object"==typeof e}var ta=bt?Gt(bt):function(e){return ea(e)&&fo(e)==S};function na(e){return"number"==typeof e||ea(e)&&kr(e)==k}function ra(e){if(!ea(e)||kr(e)!=x)return!1;var t=Be(e);if(null===t)return!0;var n=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&$e.call(n)==Me}var ia=wt?Gt(wt):function(e){return ea(e)&&kr(e)==T},oa=_t?Gt(_t):function(e){return ea(e)&&fo(e)==E};function sa(e){return"string"==typeof e||!Us(e)&&ea(e)&&kr(e)==P}function aa(e){return"symbol"==typeof e||ea(e)&&kr(e)==R}var ca=St?Gt(St):function(e){return ea(e)&&Xs(e.length)&&!!it[kr(e)]},ua=Ui(Ir),la=Ui((function(e,t){return e<=t}));function fa(e){if(!e)return[];if(Ks(e))return sa(e)?fn(e):Ti(e);if(Ge&&e[Ge])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ge]());var t=fo(e);return(t==S?on:t==E?cn:Fa)(e)}function ha(e){return e?(e=ma(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function da(e){var t=ha(e),n=t%1;return t==t?n?t-n:t:0}function pa(e){return e?or(da(e),0,d):0}function ma(e){if("number"==typeof e)return e;if(aa(e))return h;if(Zs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Zs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var n=pe.test(e);return n||ge.test(e)?ct(e.slice(2),n?2:8):de.test(e)?h:+e}function ga(e){return Ei(e,Oa(e))}function ya(e){return null==e?"":si(e)}var va=Ri((function(e,t){if(_o(t)||Ks(t))Ei(t,Aa(t),e);else for(var n in t)Ne.call(t,n)&&Zn(e,n,t[n])})),ba=Ri((function(e,t){Ei(t,Oa(t),e)})),wa=Ri((function(e,t,n,r){Ei(t,Oa(t),e,r)})),_a=Ri((function(e,t,n,r){Ei(t,Aa(t),e,r)})),Sa=Zi(ir),ka=Hr((function(e,t){e=xe(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(r=1);++n1),t})),Ei(e,to(e),n),r&&(n=sr(n,7,Qi));for(var i=t.length;i--;)ci(n,t[i]);return n})),Ia=Zi((function(e,t){return null==e?{}:function(e,t){return Wr(e,t,(function(t,n){return Ta(e,n)}))}(e,t)}));function Da(e,t){if(null==e)return{};var n=Ot(to(e),(function(e){return[e]}));return t=oo(t),Wr(e,n,(function(e,n){return t(e,n[0])}))}var Ma=Hi(Aa),qa=Hi(Oa);function Fa(e){return null==e?[]:Yt(e,Aa(e))}var La=Ni((function(e,t,n){return t=t.toLowerCase(),e+(n?Va(t):t)}));function Va(e){return Ga(ya(e).toLowerCase())}function Wa(e){return(e=ya(e))&&e.replace(ve,en).replace(Qe,"")}var Ua=Ni((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ba=Ni((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ka=$i("toLowerCase"),za=Ni((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Ha=Ni((function(e,t,n){return e+(n?" ":"")+Ga(t)})),Ja=Ni((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ga=$i("toUpperCase");function Ya(e,t,n){return e=ya(e),(t=n?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Qa=Hr((function(e,t){try{return kt(e,i,t)}catch(e){return Gs(e)?e:new _e(e)}})),Xa=Zi((function(e,t){return Ct(t,(function(t){t=Do(t),rr(e,t,Ps(e[t],e))})),e}));function Za(e){return function(){return e}}var ec=Di(),tc=Di(!0);function nc(e){return e}function rc(e){return Nr("function"==typeof e?e:sr(e,1))}var ic=Hr((function(e,t){return function(n){return Pr(n,e,t)}})),oc=Hr((function(e,t){return function(n){return Pr(e,n,t)}}));function sc(e,t,n){var r=Aa(t),i=wr(t,r);null!=n||Zs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=wr(t,Aa(t)));var o=!(Zs(n)&&"chain"in n&&!n.chain),s=Ys(e);return Ct(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=Ti(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,$t([this.value()],arguments))})})),e}function ac(){}var cc=Li(Ot),uc=Li(Et),lc=Li(It);function fc(e){return vo(e)?Ut(Do(e)):function(e){return function(t){return _r(t,e)}}(e)}var hc=Wi(),dc=Wi(!0);function pc(){return[]}function mc(){return!1}var gc,yc=Fi((function(e,t){return e+t}),0),vc=Ki("ceil"),bc=Fi((function(e,t){return e/t}),1),wc=Ki("floor"),_c=Fi((function(e,t){return e*t}),1),Sc=Ki("round"),kc=Fi((function(e,t){return e-t}),0);return qn.after=function(e,t){if("function"!=typeof t)throw new Ee(o);return e=da(e),function(){if(--e<1)return t.apply(this,arguments)}},qn.ary=Ts,qn.assign=va,qn.assignIn=ba,qn.assignInWith=wa,qn.assignWith=_a,qn.at=Sa,qn.before=Es,qn.bind=Ps,qn.bindAll=Xa,qn.bindKey=Rs,qn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Us(e)?e:[e]},qn.chain=fs,qn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===i)?1:gn(da(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,c=r(ht(o/t));so?0:o+n),(r=r===i||r>o?o:da(r))<0&&(r+=o),r=n>r?0:pa(r);n>>0)?(e=ya(e))&&("string"==typeof t||null!=t&&!ia(t))&&!(t=si(t))&&rn(e)?vi(fn(e),0,n):e.split(t,n):[]},qn.spread=function(e,t){if("function"!=typeof e)throw new Ee(o);return t=null==t?0:gn(da(t),0),Hr((function(n){var r=n[t],i=vi(n,0,t);return r&&$t(i,r),kt(e,this,i)}))},qn.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},qn.take=function(e,t,n){return e&&e.length?ei(e,0,(t=n||t===i?1:da(t))<0?0:t):[]},qn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?ei(e,(t=r-(t=n||t===i?1:da(t)))<0?0:t,r):[]},qn.takeRightWhile=function(e,t){return e&&e.length?li(e,oo(t,3),!1,!0):[]},qn.takeWhile=function(e,t){return e&&e.length?li(e,oo(t,3)):[]},qn.tap=function(e,t){return t(e),e},qn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ee(o);return Zs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),As(e,t,{leading:r,maxWait:t,trailing:i})},qn.thru=hs,qn.toArray=fa,qn.toPairs=Ma,qn.toPairsIn=qa,qn.toPath=function(e){return Us(e)?Ot(e,Do):aa(e)?[e]:Ti(Io(ya(e)))},qn.toPlainObject=ga,qn.transform=function(e,t,n){var r=Us(e),i=r||Hs(e)||ca(e);if(t=oo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Zs(e)&&Ys(o)?Fn(Be(e)):{}}return(i?Ct:vr)(e,(function(e,r,i){return t(n,e,r,i)})),n},qn.unary=function(e){return Ts(e,1)},qn.union=es,qn.unionBy=ts,qn.unionWith=ns,qn.uniq=function(e){return e&&e.length?ai(e):[]},qn.uniqBy=function(e,t){return e&&e.length?ai(e,oo(t,2)):[]},qn.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?ai(e,i,t):[]},qn.unset=function(e,t){return null==e||ci(e,t)},qn.unzip=rs,qn.unzipWith=is,qn.update=function(e,t,n){return null==e?e:ui(e,t,mi(n))},qn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ui(e,t,mi(n),r)},qn.values=Fa,qn.valuesIn=function(e){return null==e?[]:Yt(e,Oa(e))},qn.without=os,qn.words=Ya,qn.wrap=function(e,t){return Ds(mi(t),e)},qn.xor=ss,qn.xorBy=as,qn.xorWith=cs,qn.zip=us,qn.zipObject=function(e,t){return di(e||[],t||[],Zn)},qn.zipObjectDeep=function(e,t){return di(e||[],t||[],Yr)},qn.zipWith=ls,qn.entries=Ma,qn.entriesIn=qa,qn.extend=ba,qn.extendWith=wa,sc(qn,qn),qn.add=yc,qn.attempt=Qa,qn.camelCase=La,qn.capitalize=Va,qn.ceil=vc,qn.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ma(n))==n?n:0),t!==i&&(t=(t=ma(t))==t?t:0),or(ma(e),t,n)},qn.clone=function(e){return sr(e,4)},qn.cloneDeep=function(e){return sr(e,5)},qn.cloneDeepWith=function(e,t){return sr(e,5,t="function"==typeof t?t:i)},qn.cloneWith=function(e,t){return sr(e,4,t="function"==typeof t?t:i)},qn.conformsTo=function(e,t){return null==t||ar(e,t,Aa(t))},qn.deburr=Wa,qn.defaultTo=function(e,t){return null==e||e!=e?t:e},qn.divide=bc,qn.endsWith=function(e,t,n){e=ya(e),t=si(t);var r=e.length,o=n=n===i?r:or(da(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},qn.eq=Fs,qn.escape=function(e){return(e=ya(e))&&J.test(e)?e.replace(z,tn):e},qn.escapeRegExp=function(e){return(e=ya(e))&&ne.test(e)?e.replace(te,"\\$&"):e},qn.every=function(e,t,n){var r=Us(e)?Et:hr;return n&&yo(e,t,n)&&(t=i),r(e,oo(t,3))},qn.find=ms,qn.findIndex=Wo,qn.findKey=function(e,t){return Mt(e,oo(t,3),vr)},qn.findLast=gs,qn.findLastIndex=Uo,qn.findLastKey=function(e,t){return Mt(e,oo(t,3),br)},qn.floor=wc,qn.forEach=ys,qn.forEachRight=vs,qn.forIn=function(e,t){return null==e?e:gr(e,oo(t,3),Oa)},qn.forInRight=function(e,t){return null==e?e:yr(e,oo(t,3),Oa)},qn.forOwn=function(e,t){return e&&vr(e,oo(t,3))},qn.forOwnRight=function(e,t){return e&&br(e,oo(t,3))},qn.get=Ca,qn.gt=Ls,qn.gte=Vs,qn.has=function(e,t){return null!=e&&ho(e,t,Cr)},qn.hasIn=Ta,qn.head=Ko,qn.identity=nc,qn.includes=function(e,t,n,r){e=Ks(e)?e:Fa(e),n=n&&!r?da(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),sa(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},qn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:da(n);return i<0&&(i=gn(r+i,0)),Ft(e,t,i)},qn.inRange=function(e,t,n){return t=ha(t),n===i?(n=t,t=0):n=ha(n),function(e,t,n){return e>=yn(t,n)&&e=-9007199254740991&&e<=f},qn.isSet=oa,qn.isString=sa,qn.isSymbol=aa,qn.isTypedArray=ca,qn.isUndefined=function(e){return e===i},qn.isWeakMap=function(e){return ea(e)&&fo(e)==A},qn.isWeakSet=function(e){return ea(e)&&"[object WeakSet]"==kr(e)},qn.join=function(e,t){return null==e?"":Bt.call(e,t)},qn.kebabCase=Ua,qn.last=Go,qn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=da(n))<0?gn(r+o,0):yn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):qt(e,Vt,o,!0)},qn.lowerCase=Ba,qn.lowerFirst=Ka,qn.lt=ua,qn.lte=la,qn.max=function(e){return e&&e.length?dr(e,nc,xr):i},qn.maxBy=function(e,t){return e&&e.length?dr(e,oo(t,2),xr):i},qn.mean=function(e){return Wt(e,nc)},qn.meanBy=function(e,t){return Wt(e,oo(t,2))},qn.min=function(e){return e&&e.length?dr(e,nc,Ir):i},qn.minBy=function(e,t){return e&&e.length?dr(e,oo(t,2),Ir):i},qn.stubArray=pc,qn.stubFalse=mc,qn.stubObject=function(){return{}},qn.stubString=function(){return""},qn.stubTrue=function(){return!0},qn.multiply=_c,qn.nth=function(e,t){return e&&e.length?Lr(e,da(t)):i},qn.noConflict=function(){return ft._===this&&(ft._=qe),this},qn.noop=ac,qn.now=Cs,qn.pad=function(e,t,n){e=ya(e);var r=(t=da(t))?ln(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Vi(dt(i),n)+e+Vi(ht(i),n)},qn.padEnd=function(e,t,n){e=ya(e);var r=(t=da(t))?ln(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=wn();return yn(e+o*(t-e+at("1e-"+((o+"").length-1))),t)}return Kr(e,t)},qn.reduce=function(e,t,n){var r=Us(e)?Nt:Kt,i=arguments.length<3;return r(e,oo(t,4),n,i,lr)},qn.reduceRight=function(e,t,n){var r=Us(e)?jt:Kt,i=arguments.length<3;return r(e,oo(t,4),n,i,fr)},qn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===i)?1:da(t),zr(ya(e),t)},qn.replace=function(){var e=arguments,t=ya(e[0]);return e.length<3?t:t.replace(e[1],e[2])},qn.result=function(e,t,n){var r=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=i);++rf)return[];var n=d,r=yn(e,d);t=oo(t),e-=d;for(var i=Ht(r,t);++n=s)return e;var c=n-ln(r);if(c<1)return r;var u=a?vi(a,0,c).join(""):e.slice(0,c);if(o===i)return u+r;if(a&&(c+=u.length-c),ia(o)){if(e.slice(c).search(o)){var l,f=u;for(o.global||(o=Ce(o.source,ya(he.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;u=u.slice(0,h===i?c:h)}}else if(e.indexOf(si(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r},qn.unescape=function(e){return(e=ya(e))&&H.test(e)?e.replace(K,dn):e},qn.uniqueId=function(e){var t=++je;return ya(e)+t},qn.upperCase=Ja,qn.upperFirst=Ga,qn.each=ys,qn.eachRight=vs,qn.first=Ko,sc(qn,(gc={},vr(qn,(function(e,t){Ne.call(qn.prototype,t)||(gc[t]=e)})),gc),{chain:!1}),qn.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){qn[e].placeholder=qn})),Ct(["drop","take"],(function(e,t){Wn.prototype[e]=function(n){n=n===i?1:gn(da(n),0);var r=this.__filtered__&&!t?new Wn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,d),type:e+(r.__dir__<0?"Right":"")}),r},Wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Wn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ct(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Wn.prototype[e]=function(){return this[n](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Wn.prototype[e]=function(){return this.__filtered__?new Wn(this):this[n](1)}})),Wn.prototype.compact=function(){return this.filter(nc)},Wn.prototype.find=function(e){return this.filter(e).head()},Wn.prototype.findLast=function(e){return this.reverse().find(e)},Wn.prototype.invokeMap=Hr((function(e,t){return"function"==typeof e?new Wn(this):this.map((function(n){return Pr(n,e,t)}))})),Wn.prototype.reject=function(e){return this.filter(js(oo(e)))},Wn.prototype.slice=function(e,t){e=da(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Wn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=da(t))<0?n.dropRight(-t):n.take(t-e)),n)},Wn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Wn.prototype.toArray=function(){return this.take(d)},vr(Wn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=qn[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&(qn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,c=t instanceof Wn,u=a[0],l=c||Us(t),f=function(e){var t=o.apply(qn,$t([e],a));return r&&h?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,m=c&&!d;if(!s&&l){t=m?t:new Wn(this);var g=e.apply(t,a);return g.__actions__.push({func:hs,args:[f],thisArg:i}),new Vn(g,h)}return p&&m?e.apply(this,a):(g=this.thru(f),p?r?g.value()[0]:g.value():g)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);qn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Us(i)?i:[],e)}return this[n]((function(n){return t.apply(Us(n)?n:[],e)}))}})),vr(Wn.prototype,(function(e,t){var n=qn[t];if(n){var r=n.name+"";Ne.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:t,func:n})}})),Rn[Mi(i,2).name]=[{name:"wrapper",func:i}],Wn.prototype.clone=function(){var e=new Wn(this.__wrapped__);return e.__actions__=Ti(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ti(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ti(this.__views__),e},Wn.prototype.reverse=function(){if(this.__filtered__){var e=new Wn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Wn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Us(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},qn.prototype.plant=function(e){for(var t,n=this;n instanceof Ln;){var r=qo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},qn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Wn){var t=e;return this.__actions__.length&&(t=new Wn(this)),(t=t.reverse()).__actions__.push({func:hs,args:[Zo],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(Zo)},qn.prototype.toJSON=qn.prototype.valueOf=qn.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},qn.prototype.first=qn.prototype.head,Ge&&(qn.prototype[Ge]=function(){return this}),qn}();ft._=pn,(r=function(){return pn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},6470:(e,t,n)=>{"use strict";var r=n(4155);function i(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function o(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var s={resolve:function(){for(var e,t="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=r.cwd()),a=e),i(a),0!==a.length&&(t=a+"/"+t,n=47===a.charCodeAt(0))}return t=o(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(i(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=o(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return i(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":s.normalize(e)},relative:function(e,t){if(i(e),i(t),e===t)return"";if((e=s.resolve(e))===(t=s.resolve(t)))return"";for(var n=1;nu){if(47===t.charCodeAt(a+f))return t.slice(a+f+1);if(0===f)return t.slice(a+f)}else o>u&&(47===e.charCodeAt(n+f)?l=f:0===f&&(l=0));break}var h=e.charCodeAt(n+f);if(h!==t.charCodeAt(a+f))break;47===h&&(l=f)}var d="";for(f=n+l+1;f<=r;++f)f!==r&&47!==e.charCodeAt(f)||(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(a+l):(a+=l,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(i(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!o){r=s;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"//":e.slice(0,r)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');i(e);var n,r=0,o=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!s){r=n+1;break}}else-1===c&&(s=!1,c=n+1),a>=0&&(u===t.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=c))}return r===o?o=c:-1===o&&(o=e.length),e.slice(r,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){r=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(r,o)},extname:function(e){i(e);for(var t=-1,n=0,r=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===r&&(o=!1,r=a+1),46===c?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!o){n=a+1;break}}return-1===t||-1===r||0===s||1===s&&t===r-1&&t===n+1?"":e.slice(t,r)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){i(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,r=e.charCodeAt(0),o=47===r;o?(t.root="/",n=1):n=0;for(var s=-1,a=0,c=-1,u=!0,l=e.length-1,f=0;l>=n;--l)if(47!==(r=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===r?-1===s?s=l:1!==f&&(f=1):-1!==s&&(f=-1);else if(!u){a=l+1;break}return-1===s||-1===c||0===f||1===f&&s===c-1&&s===a+1?-1!==c&&(t.base=t.name=0===a&&o?e.slice(1,c):e.slice(a,c)):(0===a&&o?(t.name=e.slice(1,s),t.base=e.slice(1,c)):(t.name=e.slice(a,s),t.base=e.slice(a,c)),t.ext=e.slice(s,c)),a>0?t.dir=e.slice(0,a-1):o&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s},4155:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var a,c=[],u=!1,l=-1;function f(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&h())}function h(){if(!u){var e=s(f);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l1)for(var n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-u,_=Math.floor,S=String.fromCharCode;function k(e){throw RangeError(b[e])}function x(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function C(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+x((e=e.replace(v,".")).split("."),t).join(".")}function T(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=S((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+S(e)})).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function R(e,t,n){var r=0;for(e=n?_(e/h):e>>1,e+=_(e/t);e>w*l>>1;r+=c)e=_(e/w);return _(r+(w+1)*e/(e+f))}function A(e){var t,n,r,i,o,s,f,h,g,y,v,b=[],w=e.length,S=0,x=p,C=d;for((n=e.lastIndexOf(m))<0&&(n=0),r=0;r=128&&k("not-basic"),b.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=w&&k("invalid-input"),((h=(v=e.charCodeAt(i++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||h>_((a-S)/s))&&k("overflow"),S+=h*s,!(h<(g=f<=C?u:f>=C+l?l:f-C));f+=c)s>_(a/(y=c-g))&&k("overflow"),s*=y;C=R(S-o,t=b.length+1,0==o),_(S/t)>a-x&&k("overflow"),x+=_(S/t),S%=t,b.splice(S++,0,x)}return E(b)}function O(e){var t,n,r,i,o,s,f,h,g,y,v,b,w,x,C,E=[];for(b=(e=T(e)).length,t=p,n=0,o=d,s=0;s=t&&v_((a-n)/(w=r+1))&&k("overflow"),n+=(f-t)*w,t=f,s=0;sa&&k("overflow"),v==t){for(h=n,g=c;!(h<(y=g<=o?u:g>=o+l?l:g-o));g+=c)C=h-y,x=c-y,E.push(S(P(y+C%x,0))),h=_(C/x);E.push(S(P(h,0))),o=R(n,w,r==i),n=0,++r}++n,++t}return E.join("")}s={version:"1.3.2",ucs2:{decode:T,encode:E},decode:A,encode:O,toASCII:function(e){return C(e,(function(e){return y.test(e)?"xn--"+O(e):e}))},toUnicode:function(e){return C(e,(function(e){return g.test(e)?A(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return s}.call(t,n,t,e))||(e.exports=r)}()},2587:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,i){n=n||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(n);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var u=0;u=0?(l=p.substr(0,m),f=p.substr(m+1)):(l=p,f=""),h=decodeURIComponent(l),d=decodeURIComponent(f),t(o,h)?Array.isArray(o[h])?o[h].push(d):o[h]=[o[h],d]:o[h]=d}return o}},2361:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,i){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var o=encodeURIComponent(t(i))+r;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(t(e))})).join(n):o+encodeURIComponent(t(e[i]))})).join(n):i?encodeURIComponent(t(i))+r+encodeURIComponent(t(e)):""}},7673:(e,t,n)=>{"use strict";t.decode=t.parse=n(2587),t.encode=t.stringify=n(2361)},7510:(e,t)=>{(()=>{"use strict";var e={};(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorStatusDescription=t.xhr=t.configure=void 0,t.configure=(e,t)=>{},t.xhr=async e=>{const t=new Headers;if(e.headers)for(const n in e.headers){const r=e.headers[n];Array.isArray(r)?r.forEach((e=>t.set(n,e))):t.set(n,r)}e.user&&e.password&&t.set("Authorization","Basic "+btoa(e.user+":"+e.password));const n={method:e.type,redirect:e.followRedirects>0?"follow":"manual",mode:"cors",headers:t};e.data&&(n.body=e.data);const r=new Request(e.url,n),i=await fetch(r),o={};i.headers.forEach(((e,t)=>{o[t]=e}));const s=await i.arrayBuffer();return new class{constructor(){this.status=i.status,this.headers=o}get responseText(){return(new TextDecoder).decode(s)}get body(){return new Uint8Array(s)}}},t.getErrorStatusDescription=function(e){return String(e)}})();var n=t;for(var r in e)n[r]=e[r];e.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})()},540:function(e,t){!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),n=0;n1){t[0]=t[0].slice(0,-1);for(var r=t.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function y(e){throw new RangeError(p[e])}function v(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+function(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}((e=e.replace(d,".")).split("."),t).join(".")}function b(e){for(var t=[],n=0,r=e.length;n=55296&&i<=56319&&n>1,e+=m(e/t);e>455;r+=l)e=m(e/35);return m(r+36*e/(e+38))},S=function(e){var t,n=[],r=e.length,i=0,o=128,s=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var c=0;c=128&&y("not-basic"),n.push(e.charCodeAt(c));for(var f=a>0?a+1:0;f=r&&y("invalid-input");var g=(t=e.charCodeAt(f++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l;(g>=l||g>m((u-i)/d))&&y("overflow"),i+=g*d;var v=p<=s?1:p>=s+26?26:p-s;if(gm(u/b)&&y("overflow"),d*=b}var w=n.length+1;s=_(i-h,w,0==h),m(i/w)>u-o&&y("overflow"),o+=m(i/w),i%=w,n.splice(i++,0,o)}return String.fromCodePoint.apply(String,n)},k=function(e){var t=[],n=(e=b(e)).length,r=128,i=0,o=72,s=!0,a=!1,c=void 0;try{for(var f,h=e[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var d=f.value;d<128&&t.push(g(d))}}catch(e){a=!0,c=e}finally{try{!s&&h.return&&h.return()}finally{if(a)throw c}}var p=t.length,v=p;for(p&&t.push("-");v=r&&Pm((u-i)/R)&&y("overflow"),i+=(S-r)*R,r=S;var A=!0,O=!1,$=void 0;try{for(var N,j=e[Symbol.iterator]();!(A=(N=j.next()).done);A=!0){var I=N.value;if(Iu&&y("overflow"),I==r){for(var D=i,M=l;;M+=l){var q=M<=o?1:M>=o+26?26:M-o;if(D>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function E(e){for(var t="",n=0,r=e.length;n=194&&i<224){if(r-n>=6){var o=parseInt(e.substr(n+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(n,6);n+=6}else if(i>=224){if(r-n>=9){var s=parseInt(e.substr(n+4,2),16),a=parseInt(e.substr(n+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}else t+=e.substr(n,9);n+=9}else t+=e.substr(n,3),n+=3}return t}function P(e,t){function n(e){var n=E(e);return n.match(t.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,n).replace(t.NOT_USERINFO,T).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,n).toLowerCase().replace(t.NOT_HOST,T).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,n).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,T).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,n).replace(t.NOT_QUERY,T).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,n).replace(t.NOT_FRAGMENT,T).replace(t.PCT_ENCODED,i)),e}function R(e){return e.replace(/^0*(.*)/,"$1")||"0"}function A(e,t){var n=e.match(t.IPV4ADDRESS)||[],r=c(n,2)[1];return r?r.split(".").map(R).join("."):e}function O(e,t){var n=e.match(t.IPV6ADDRESS)||[],r=c(n,3),i=r[1],o=r[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),a=c(s,2),u=a[0],l=a[1],f=l?l.split(":").map(R):[],h=u.split(":").map(R),d=t.IPV4ADDRESS.test(h[h.length-1]),p=d?7:8,m=h.length-p,g=Array(p),y=0;y1){var w=g.slice(0,v.index),_=g.slice(v.index+v.length);b=w.join(":")+"::"+_.join(":")}else b=g.join(":");return o&&(b+="%"+o),b}return e}var $=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,N=void 0==="".match(/(){0}/)[1];function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={},r=!1!==t.iri?a:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match($);if(i){N?(n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5])):(n.scheme=i[1]||void 0,n.userinfo=-1!==e.indexOf("@")?i[3]:void 0,n.host=-1!==e.indexOf("//")?i[4]:void 0,n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=-1!==e.indexOf("?")?i[7]:void 0,n.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),n.host&&(n.host=O(A(n.host,r),r)),void 0!==n.scheme||void 0!==n.userinfo||void 0!==n.host||void 0!==n.port||n.path||void 0!==n.query?void 0===n.scheme?n.reference="relative":void 0===n.fragment?n.reference="absolute":n.reference="uri":n.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");var o=C[(t.scheme||n.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)P(n,r);else{if(n.host&&(t.domainHost||o&&o.domainHost))try{n.host=x.toASCII(n.host.replace(r.PCT_ENCODED,E).toLowerCase())}catch(e){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+e}P(n,s)}o&&o.parse&&o.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return n}var I=/^\.\.?\//,D=/^\/\.(\/|$)/,M=/^\/\.\.(\/|$)/,q=/^\/?(?:.|\n)*?(?=\/|$)/;function F(e){for(var t=[];e.length;)if(e.match(I))e=e.replace(I,"");else if(e.match(D))e=e.replace(D,"/");else if(e.match(M))e=e.replace(M,"/"),t.pop();else if("."===e||".."===e)e="";else{var n=e.match(q);if(!n)throw new Error("Unexpected dot segment condition");var r=n[0];e=e.slice(r.length),t.push(r)}return t.join("")}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.iri?a:s,r=[],i=C[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(n.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?x.toUnicode(e.host):x.toASCII(e.host.replace(n.PCT_ENCODED,E).toLowerCase())}catch(n){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+n}P(e,n),"suffix"!==t.reference&&e.scheme&&(r.push(e.scheme),r.push(":"));var o=function(e,t){var n=!1!==t.iri?a:s,r=[];return void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(O(A(String(e.host),n),n).replace(n.IPV6ADDRESS,(function(e,t,n){return"["+t+(n?"%25"+n:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0}(e,t);if(void 0!==o&&("suffix"!==t.reference&&r.push("//"),r.push(o),e.path&&"/"!==e.path.charAt(0)&&r.push("/")),void 0!==e.path){var c=e.path;t.absolutePath||i&&i.absolutePath||(c=F(c)),void 0===o&&(c=c.replace(/^\/\//,"/%2F")),r.push(c)}return void 0!==e.query&&(r.push("?"),r.push(e.query)),void 0!==e.fragment&&(r.push("#"),r.push(e.fragment)),r.join("")}function V(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return arguments[3]||(e=j(L(e,n),n),t=j(L(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(r.scheme=t.scheme,r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=F(t.path||""),r.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(r.userinfo=t.userinfo,r.host=t.host,r.port=t.port,r.path=F(t.path||""),r.query=t.query):(t.path?("/"===t.path.charAt(0)?r.path=F(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?r.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:r.path=t.path:r.path="/"+t.path,r.path=F(r.path)),r.query=t.query):(r.path=e.path,void 0!==t.query?r.query=t.query:r.query=e.query),r.userinfo=e.userinfo,r.host=e.host,r.port=e.port),r.scheme=e.scheme),r.fragment=t.fragment,r}function W(e,t){return e&&e.toString().replace(t&&t.iri?a.PCT_ENCODED:s.PCT_ENCODED,E)}var U={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},B={scheme:"https",domainHost:U.domainHost,parse:U.parse,serialize:U.serialize};function K(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var z={scheme:"ws",domainHost:!0,parse:function(e,t){var n=e;return n.secure=K(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n},serialize:function(e,t){if(e.port!==(K(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var n=e.resourceName.split("?"),r=c(n,2),i=r[0],o=r[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},H={scheme:"wss",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},J={},G="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",Q=n(n("%[EFef]"+Y+"%"+Y+Y+"%"+Y+Y)+"|"+n("%[89A-Fa-f]"+Y+"%"+Y+Y)+"|"+n("%"+Y+Y)),X=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(G,"g"),ee=new RegExp(Q,"g"),te=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',X),"g"),ne=new RegExp(t("[^]",G,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),re=ne;function ie(e){var t=E(e);return t.match(Z)?t:e}var oe={scheme:"mailto",parse:function(e,t){var n=e,r=n.to=n.path?n.path.split(","):[];if(n.path=void 0,n.query){for(var i=!1,o={},s=n.query.split("&"),a=0,c=s.length;a{"use strict";var r=n(4971),i=n(2502);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.DB=function(e,t){return b(e,!1,!0).resolve(t)};var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=n(7673);function b(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o127?N+="x":N+=$[j];if(!N.match(d)){var D=A.slice(0,E),M=A.slice(E+1),q=$.match(p);q&&(D.push(q[1]),M.unshift(q[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=r.toASCII(this.hostname));var F=this.port?":"+this.port:"",L=this.hostname||"";this.host=L+F,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[S])for(E=0,O=l.length;E0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift())),n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=k.slice(-1)[0],T=(n.host||e.host||k.length>1)&&("."===C||".."===C)||""===C,E=0,P=k.length;P>=0;P--)"."===(C=k[P])?k.splice(P,1):".."===C?(k.splice(P,1),E++):E&&(k.splice(P,1),E--);if(!_&&!S)for(;E--;E)k.unshift("..");!_||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),T&&"/"!==k.join("/").substr(-1)&&k.push("");var R,A=""===k[0]||k[0]&&"/"===k[0].charAt(0);return x&&(n.hostname=n.host=A?"":k.length?k.shift():"",(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift())),(_=_||n.host&&k.length)&&!A&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},2502:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},3022:function(e,t,n){"use strict";var r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.loadMessageBundle=t.localize=t.format=t.setPseudo=t.isPseudo=t.isDefined=t.BundleFormat=t.MessageFormat=void 0;var r,i,o,s=n(2952);function a(e){return void 0!==e}function c(e,n){return t.isPseudo&&(e="["+e.replace(/[aouei]/g,"$&$&")+"]"),0===n.length?e:e.replace(/\{(\d+)\}/g,(function(e,t){var r=t[0],i=n[r],o=e;return"string"==typeof i?o=i:"number"!=typeof i&&"boolean"!=typeof i&&null!=i||(o=String(i)),o}))}(o=t.MessageFormat||(t.MessageFormat={})).file="file",o.bundle="bundle",o.both="both",(i=t.BundleFormat||(t.BundleFormat={})).standalone="standalone",i.languagePack="languagePack",function(e){e.is=function(e){var t=e;return t&&a(t.key)&&a(t.comment)}}(r||(r={})),t.isDefined=a,t.isPseudo=!1,t.setPseudo=function(e){t.isPseudo=e},t.format=c,t.localize=function(e,t){for(var n=[],r=2;r{"use strict";var n;function r(){if(void 0===n)throw new Error("No runtime abstraction layer installed");return n}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");n=e}}(r||(r={})),t.default=r},1169:(e,t,n)=>{"use strict";e.exports=n(9054)},9054:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,n(5669).default.install();const o=n(3870);i(n(3870),t);class s extends o.AbstractMessageReader{constructor(e){super(),this._onData=new o.Emitter,this._messageListener=e=>{this._onData.fire(e.data)},e.addEventListener("error",(e=>this.fireError(e))),e.onmessage=this._messageListener}listen(e){return this._onData.event(e)}}t.BrowserMessageReader=s;class a extends o.AbstractMessageWriter{constructor(e){super(),this.context=e,this.errorCount=0,e.addEventListener("error",(e=>this.fireError(e)))}write(e){try{return this.context.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}t.BrowserMessageWriter=a,t.createMessageConnection=function(e,t,n,r){return void 0===n&&(n=o.NullLogger),o.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),o.createMessageConnection(e,t,n,r)}},5669:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(147),i=n(3911),o=n(7135),s=n(5530);class a extends s.AbstractMessageBuffer{constructor(e="utf-8"){super(e),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return a.emptyBuffer}fromString(e,t){return(new TextEncoder).encode(e)}toString(e,t){return"ascii"===t?this.asciiDecoder.decode(e):new TextDecoder(t).decode(e)}asNative(e,t){return void 0===t?e:e.slice(0,t)}allocNative(e){return new Uint8Array(e)}}a.emptyBuffer=new Uint8Array(0);class c{constructor(e){this.socket=e,this._onData=new o.Emitter,this._messageListener=e=>{e.data.arrayBuffer().then((e=>{this._onData.fire(new Uint8Array(e))}))},this.socket.addEventListener("message",this._messageListener)}onClose(e){return this.socket.addEventListener("close",e),i.Disposable.create((()=>this.socket.removeEventListener("close",e)))}onError(e){return this.socket.addEventListener("error",e),i.Disposable.create((()=>this.socket.removeEventListener("error",e)))}onEnd(e){return this.socket.addEventListener("end",e),i.Disposable.create((()=>this.socket.removeEventListener("end",e)))}onData(e){return this._onData.event(e)}}class u{constructor(e){this.socket=e}onClose(e){return this.socket.addEventListener("close",e),i.Disposable.create((()=>this.socket.removeEventListener("close",e)))}onError(e){return this.socket.addEventListener("error",e),i.Disposable.create((()=>this.socket.removeEventListener("error",e)))}onEnd(e){return this.socket.addEventListener("end",e),i.Disposable.create((()=>this.socket.removeEventListener("end",e)))}write(e,t){if("string"==typeof e){if(void 0!==t&&"utf-8"!==t)throw new Error(`In a Browser environments only utf-8 text encding is supported. But got encoding: ${t}`);this.socket.send(e)}else this.socket.send(e);return Promise.resolve()}end(){this.socket.close()}}const l=new TextEncoder,f=Object.freeze({messageBuffer:Object.freeze({create:e=>new a(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{if("utf-8"!==t.charset)throw new Error(`In a Browser environments only utf-8 text encding is supported. But got encoding: ${t.charset}`);return Promise.resolve(l.encode(JSON.stringify(e,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{if(!(e instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(t.charset).decode(e)))}})}),stream:Object.freeze({asReadableStream:e=>new c(e),asWritableStream:e=>new u(e)}),console,timer:Object.freeze({setTimeout:(e,t,...n)=>setTimeout(e,t,...n),clearTimeout(e){clearTimeout(e)},setImmediate:(e,...t)=>setTimeout(e,0,...t),clearImmediate(e){clearTimeout(e)}})});function h(){return f}!function(e){e.install=function(){r.default.install(f)}}(h||(h={})),t.default=h},3870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.Trace=t.ProgressType=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.RAL=void 0,t.CancellationStrategy=void 0;const r=n(839);Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return r.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return r.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return r.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return r.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return r.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return r.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return r.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return r.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return r.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return r.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return r.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return r.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return r.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return r.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return r.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return r.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return r.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return r.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return r.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return r.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return r.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return r.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return r.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return r.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return r.ParameterStructures}});const i=n(3911);Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return i.Disposable}});const o=n(7135);Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return o.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return o.Emitter}});const s=n(3881);Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=n(6525);Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=n(6654);Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const u=n(1343);Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return u.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return u.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return u.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return u.createMessageConnection}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return u.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return u.Trace}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return u.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return u.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return u.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return u.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return u.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return u.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return u.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return u.CancellationStrategy}});const l=n(147);t.RAL=l.default},3881:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellationTokenSource=t.CancellationToken=void 0;const r=n(147),i=n(7574),o=n(7135);var s;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:o.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:o.Event.None}),e.is=function(t){const n=t;return n&&(n===e.None||n===e.Cancelled||i.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(s=t.CancellationToken||(t.CancellationToken={}));const a=Object.freeze((function(e,t){const n=r.default().timer.setTimeout(e.bind(t),0);return{dispose(){r.default().timer.clearTimeout(n)}}}));class c{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||(this._emitter=new o.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}t.CancellationTokenSource=class{get token(){return this._token||(this._token=new c),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof c&&this._token.dispose():this._token=s.None}}},1343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.Trace=t.NullLogger=t.ProgressType=void 0;const r=n(147),i=n(7574),o=n(839),s=n(6184),a=n(7135),c=n(3881);var u,l,f,h,d,p,m,g,y,v,b,w,_;!function(e){e.type=new o.NotificationType("$/cancelRequest")}(u||(u={})),function(e){e.type=new o.NotificationType("$/progress")}(l||(l={})),t.ProgressType=class{constructor(){}},function(e){e.is=function(e){return i.func(e)}}(f||(f={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(h=t.Trace||(t.Trace={})),function(e){e.fromString=function(t){if(!i.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Verbose:return"verbose";default:return"off"}}}(h=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(d=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new o.NotificationType("$/setTrace")}(p=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new o.NotificationType("$/logTrace")}(m=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(g=t.ConnectionErrors||(t.ConnectionErrors={}));class S extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,S.prototype)}}t.ConnectionError=S,function(e){e.is=function(e){const t=e;return t&&i.func(t.cancelUndispatched)}}(y=t.ConnectionStrategy||(t.ConnectionStrategy={})),function(e){e.Message=Object.freeze({createCancellationTokenSource:e=>new c.CancellationTokenSource}),e.is=function(e){const t=e;return t&&i.func(t.createCancellationTokenSource)}}(v=t.CancellationReceiverStrategy||(t.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation(e,t){e.sendNotification(u.type,{id:t})},cleanup(e){}}),e.is=function(e){const t=e;return t&&i.func(t.sendCancellation)&&i.func(t.cleanup)}}(b=t.CancellationSenderStrategy||(t.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:v.Message,sender:b.Message}),e.is=function(e){const t=e;return t&&v.is(t.receiver)&&b.is(t.sender)}}(w=t.CancellationStrategy||(t.CancellationStrategy={})),(t.ConnectionOptions||(t.ConnectionOptions={})).is=function(e){const t=e;return t&&(w.is(t.cancellationStrategy)||y.is(t.connectionStrategy))},function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(_||(_={})),t.createMessageConnection=function(e,n,y,v){const b=void 0!==y?y:t.NullLogger;let k=0,x=0,C=0;const T="2.0";let E;const P=Object.create(null);let R;const A=Object.create(null),O=new Map;let $,N,j=new s.LinkedMap,I=Object.create(null),D=Object.create(null),M=h.Off,q=d.Text,F=_.New;const L=new a.Emitter,V=new a.Emitter,W=new a.Emitter,U=new a.Emitter,B=new a.Emitter,K=v&&v.cancellationStrategy?v.cancellationStrategy:w.Message;function z(e){if(null===e)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+e.toString()}function H(e){}function J(){return F===_.Listening}function G(){return F===_.Closed}function Y(){return F===_.Disposed}function Q(){F!==_.New&&F!==_.Listening||(F=_.Closed,V.fire(void 0))}function X(){$||0===j.size||($=r.default().timer.setImmediate((()=>{$=void 0,function(){if(0===j.size)return;const e=j.shift();try{o.isRequestMessage(e)?function(e){if(Y())return;function t(t,r,i){const s={jsonrpc:T,id:e.id};t instanceof o.ResponseError?s.error=t.toJson():s.result=void 0===t?null:t,ee(s,r,i),n.write(s)}function r(t,r,i){const o={jsonrpc:T,id:e.id,error:t.toJson()};ee(o,r,i),n.write(o)}!function(e){if(M!==h.Off&&N)if(q===d.Text){let t;M===h.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),N.log(`Received request '${e.method} - (${e.id})'.`,t)}else te("receive-request",e)}(e);const s=P[e.method];let a,c;s&&(a=s.type,c=s.handler);const u=Date.now();if(c||E){const s=String(e.id),l=K.receiver.createCancellationTokenSource(s);D[s]=l;try{let f;if(c)if(void 0===e.params){if(void 0!==a&&0!==a.numberOfParams)return void r(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but recevied none.`),e.method,u);f=c(l.token)}else if(Array.isArray(e.params)){if(void 0!==a&&a.parameterStructures===o.ParameterStructures.byName)return void r(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,u);f=c(...e.params,l.token)}else{if(void 0!==a&&a.parameterStructures===o.ParameterStructures.byPosition)return void r(new o.ResponseError(o.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,u);f=c(e.params,l.token)}else E&&(f=E(e.method,e.params,l.token));const h=f;f?h.then?h.then((n=>{delete D[s],t(n,e.method,u)}),(t=>{delete D[s],t instanceof o.ResponseError?r(t,e.method,u):t&&i.string(t.message)?r(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):r(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)})):(delete D[s],t(f,e.method,u)):(delete D[s],function(t,r,i){void 0===t&&(t=null);const o={jsonrpc:T,id:e.id,result:t};ee(o,r,i),n.write(o)}(f,e.method,u))}catch(n){delete D[s],n instanceof o.ResponseError?t(n,e.method,u):n&&i.string(n.message)?r(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${n.message}`),e.method,u):r(new o.ResponseError(o.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else r(new o.ResponseError(o.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):o.isNotificationMessage(e)?function(e){if(Y())return;let t,n;if(e.method===u.type.method)n=e=>{const t=e.id,n=D[String(t)];n&&n.cancel()};else{const r=A[e.method];r&&(n=r.handler,t=r.type)}if(n||R)try{!function(e){if(M!==h.Off&&N&&e.method!==m.type.method)if(q===d.Text){let t;M===h.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),N.log(`Received notification '${e.method}'.`,t)}else te("receive-notification",e)}(e),n?void 0===e.params?(void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==o.ParameterStructures.byName&&b.error(`Notification ${e.method} defines ${t.numberOfParams} params but recevied none.`),n()):Array.isArray(e.params)?(void 0!==t&&(t.parameterStructures===o.ParameterStructures.byName&&b.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&b.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${e.params.length} argumennts`)),n(...e.params)):(void 0!==t&&t.parameterStructures===o.ParameterStructures.byPosition&&b.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params)):R&&R(e.method,e.params)}catch(t){t.message?b.error(`Notification handler '${e.method}' failed with message: ${t.message}`):b.error(`Notification handler '${e.method}' failed unexpectedly.`)}else W.fire(e)}(e):o.isResponseMessage(e)?function(e){if(!Y())if(null===e.id)e.error?b.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):b.error("Received response message without id. No further error information provided.");else{const t=String(e.id),n=I[t];if(function(e,t){if(M!==h.Off&&N)if(q===d.Text){let n;if(M===h.Verbose&&(e.error&&e.error.data?n=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?n=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){const r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";N.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else N.log(`Received response ${e.id} without active response promise.`,n)}else te("receive-response",e)}(e,n),n){delete I[t];try{if(e.error){const t=e.error;n.reject(new o.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");n.resolve(e.result)}}catch(e){e.message?b.error(`Response handler '${n.method}' failed with message: ${e.message}`):b.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void b.error("Received empty message.");b.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);const t=e;if(i.string(t.id)||i.number(t.id)){const e=String(t.id),n=I[e];n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{X()}}()})))}e.onClose(Q),e.onError((function(e){L.fire([e,void 0,void 0])})),n.onClose(Q),n.onError((function(e){L.fire(e)}));const Z=e=>{try{if(o.isNotificationMessage(e)&&e.method===u.type.method){const t=z(e.params.id),r=j.get(t);if(o.isRequestMessage(r)){const i=null==v?void 0:v.connectionStrategy,o=i&&i.cancelUndispatched?i.cancelUndispatched(r,H):void 0;if(o&&(void 0!==o.error||void 0!==o.result))return j.delete(t),o.id=r.id,ee(o,e.method,Date.now()),void n.write(o)}}!function(e,t){var n;o.isRequestMessage(t)?e.set(z(t.id),t):o.isResponseMessage(t)?e.set(null===(n=t.id)?"res-unknown-"+(++C).toString():"res-"+n.toString(),t):e.set("not-"+(++x).toString(),t)}(j,e)}finally{X()}};function ee(e,t,n){if(M!==h.Off&&N)if(q===d.Text){let r;M===h.Verbose&&(e.error&&e.error.data?r=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?r=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),N.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else te("send-response",e)}function te(e,t){if(!N||M===h.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};N.log(n)}function ne(){if(G())throw new S(g.Closed,"Connection is closed.");if(Y())throw new S(g.Disposed,"Connection is disposed.")}function re(e){return void 0===e?null:e}function ie(e){return null===e?void 0:e}function oe(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function se(e,t){switch(e){case o.ParameterStructures.auto:return oe(t)?ie(t):[re(t)];case o.ParameterStructures.byName:if(!oe(t))throw new Error("Recevied parameters by name but param is not an object literal.");return ie(t);case o.ParameterStructures.byPosition:return[re(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function ae(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=se(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e{let r,s;if(ne(),i.string(e)){r=e;const n=t[0];let i=0,a=o.ParameterStructures.auto;o.ParameterStructures.is(n)&&(i=1,a=n);let c=t.length;const u=c-i;switch(u){case 0:s=void 0;break;case 1:s=se(a,t[i]);break;default:if(a===o.ParameterStructures.byName)throw new Error(`Recevied ${u} parameters for 'by Name' notification parameter structure.`);s=t.slice(i,c).map((e=>re(e)))}}else{const n=t;r=e.method,s=ae(e,n)}const a={jsonrpc:T,method:r,params:s};!function(e){if(M!==h.Off&&N)if(q===d.Text){let t;M===h.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),N.log(`Sending notification '${e.method}'.`,t)}else te("send-notification",e)}(a),n.write(a)},onNotification:(e,t)=>{let n;return ne(),i.func(e)?R=e:t&&(i.string(e)?(n=e,A[e]={type:void 0,handler:t}):(n=e.method,A[e.method]={type:e,handler:t})),{dispose:()=>{void 0!==n?delete A[n]:R=void 0}}},onProgress:(e,t,n)=>{if(O.has(t))throw new Error(`Progress handler for token ${t} already registered`);return O.set(t,n),{dispose:()=>{O.delete(t)}}},sendProgress:(e,t,n)=>{ce.sendNotification(l.type,{token:t,value:n})},onUnhandledProgress:U.event,sendRequest:(e,...t)=>{let r,s,a;if(ne(),function(){if(!J())throw new Error("Call listen() first.")}(),i.string(e)){r=e;const n=t[0],i=t[t.length-1];let u=0,l=o.ParameterStructures.auto;o.ParameterStructures.is(n)&&(u=1,l=n);let f=t.length;c.CancellationToken.is(i)&&(f-=1,a=i);const h=f-u;switch(h){case 0:s=void 0;break;case 1:s=se(l,t[u]);break;default:if(l===o.ParameterStructures.byName)throw new Error(`Recevied ${h} parameters for 'by Name' request parameter structure.`);s=t.slice(u,f).map((e=>re(e)))}}else{const n=t;r=e.method,s=ae(e,n);const i=e.numberOfParams;a=c.CancellationToken.is(n[i])?n[i]:void 0}const u=k++;let l;return a&&(l=a.onCancellationRequested((()=>{K.sender.sendCancellation(ce,u)}))),new Promise(((e,t)=>{const i={jsonrpc:T,id:u,method:r,params:s};let a={method:r,timerStart:Date.now(),resolve:t=>{e(t),K.sender.cleanup(u),null==l||l.dispose()},reject:e=>{t(e),K.sender.cleanup(u),null==l||l.dispose()}};!function(e){if(M!==h.Off&&N)if(q===d.Text){let t;M===h.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),N.log(`Sending request '${e.method} - (${e.id})'.`,t)}else te("send-request",e)}(i);try{n.write(i)}catch(e){a.reject(new o.ResponseError(o.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),a=null}a&&(I[String(u)]=a)}))},onRequest:(e,t)=>{ne();let n=null;return f.is(e)?(n=void 0,E=e):i.string(e)?(n=null,void 0!==t&&(n=e,P[e]={handler:t,type:void 0})):void 0!==t&&(n=e.method,P[e.method]={type:e,handler:t}),{dispose:()=>{null!==n&&(void 0!==n?delete P[n]:E=void 0)}}},trace:(e,t,n)=>{let r=!1,o=d.Text;void 0!==n&&(i.boolean(n)?r=n:(r=n.sendNotification||!1,o=n.traceFormat||d.Text)),M=e,q=o,N=M===h.Off?void 0:t,!r||G()||Y()||ce.sendNotification(p.type,{value:h.toString(e)})},onError:L.event,onClose:V.event,onUnhandledNotification:W.event,onDispose:B.event,end:()=>{n.end()},dispose:()=>{if(Y())return;F=_.Disposed,B.fire(void 0);const t=new Error("Connection got disposed.");Object.keys(I).forEach((e=>{I[e].reject(t)})),I=Object.create(null),D=Object.create(null),j=new s.LinkedMap,i.func(n.dispose)&&n.dispose(),i.func(e.dispose)&&e.dispose()},listen:()=>{ne(),function(){if(J())throw new S(g.AlreadyListening,"Connection is already listening")}(),F=_.Listening,e.listen(Z)},inspect:()=>{r.default().console.log("inspect")}};return ce.onNotification(m.type,(e=>{M!==h.Off&&N&&N.log(e.message,M===h.Verbose?e.verbose:void 0)})),ce.onNotification(l.type,(e=>{const t=O.get(e.token);t?t(e.value):U.fire(e)})),ce}},3911:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Disposable=void 0,(t.Disposable||(t.Disposable={})).create=function(e){return{dispose:e}}},7135:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=t.Event=void 0;const r=n(147);!function(e){const t={dispose(){}};e.None=function(){return t}}(t.Event||(t.Event={}));class i{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r{this._callbacks||(this._callbacks=new i),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const r={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),r.dispose=o._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(n)&&n.push(r),r}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}t.Emitter=o,o._noop=function(){}},7574:(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))}},6184:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=t.LinkedMap=t.Touch=void 0,function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last}(n=t.Touch||(t.Touch={}));class r{constructor(){this[Symbol.toStringTag]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=n.None){const r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.key,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:n.value,done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let n=this._head;const r={[Symbol.iterator]:()=>r,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(n){const e={value:[n.key,n.value],done:!1};return n=n.next,e}return{value:void 0,done:!0}}};return r}[Symbol.iterator](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===n.First||t===n.Last)if(t===n.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}t.LinkedMap=r,t.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}},5530:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMessageBuffer=void 0,t.AbstractMessageBuffer=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t="string"==typeof e?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(){if(0===this._chunks.length)return;let e=0,t=0,n=0,r=0;e:for(;tthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){const t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}const t=this.allocNative(e);let n=0;for(;e>0;){const r=this._chunks[0];if(r.byteLength>e){const i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}},6525:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=void 0;const r=n(147),i=n(7574),o=n(7135);var s;(t.MessageReader||(t.MessageReader={})).is=function(e){let t=e;return t&&i.func(t.listen)&&i.func(t.dispose)&&i.func(t.onError)&&i.func(t.onClose)&&i.func(t.onPartialMessage)};class a{constructor(){this.errorEmitter=new o.Emitter,this.closeEmitter=new o.Emitter,this.partialMessageEmitter=new o.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${i.string(e.message)?e.message:"unknown"}`)}}t.AbstractMessageReader=a,function(e){e.fromOptions=function(e){var t;let n,i;const o=new Map;let s;const a=new Map;if(void 0===e||"string"==typeof e)n=null!=e?e:"utf-8";else{if(n=null!==(t=e.charset)&&void 0!==t?t:"utf-8",void 0!==e.contentDecoder&&(i=e.contentDecoder,o.set(i.name,i)),void 0!==e.contentDecoders)for(const t of e.contentDecoders)o.set(t.name,t);if(void 0!==e.contentTypeDecoder&&(s=e.contentTypeDecoder,a.set(s.name,s)),void 0!==e.contentTypeDecoders)for(const t of e.contentTypeDecoders)a.set(t.name,t)}return void 0===s&&(s=r.default().applicationJson.decoder,a.set(s.name,s)),{charset:n,contentDecoder:i,contentDecoders:o,contentTypeDecoder:s,contentTypeDecoders:a}}}(s||(s={})),t.ReadableStreamMessageReader=class extends a{constructor(e,t){super(),this.readable=e,this.options=s.fromOptions(t),this.buffer=r.default().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const t=this.readable.onData((e=>{this.onData(e)}));return this.readable.onError((e=>this.fireError(e))),this.readable.onClose((()=>this.fireClose())),t}onData(e){for(this.buffer.append(e);;){if(-1===this.nextMessageLength){const e=this.buffer.tryReadHeaders();if(!e)return;const t=e.get("Content-Length");if(!t)throw new Error("Header must provide a Content-Length property.");const n=parseInt(t);if(isNaN(n))throw new Error("Content-Length value must be a number.");this.nextMessageLength=n}const e=this.buffer.tryReadBody(this.nextMessageLength);if(void 0===e)return void this.setPartialMessageTimer();let t;this.clearPartialMessageTimer(),this.nextMessageLength=-1,t=void 0!==this.options.contentDecoder?this.options.contentDecoder.decode(e):Promise.resolve(e),t.then((e=>{this.options.contentTypeDecoder.decode(e,this.options).then((e=>{this.callback(e)}),(e=>{this.fireError(e)}))}),(e=>{this.fireError(e)}))}}clearPartialMessageTimer(){this.partialMessageTimer&&(r.default().timer.clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=r.default().timer.setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}},6654:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=void 0;const r=n(147),i=n(7574),o=n(142),s=n(7135);var a;(t.MessageWriter||(t.MessageWriter={})).is=function(e){let t=e;return t&&i.func(t.dispose)&&i.func(t.onClose)&&i.func(t.onError)&&i.func(t.write)};class c{constructor(){this.errorEmitter=new s.Emitter,this.closeEmitter=new s.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${i.string(e.message)?e.message:"unknown"}`)}}t.AbstractMessageWriter=c,function(e){e.fromOptions=function(e){var t,n;return void 0===e||"string"==typeof e?{charset:null!=e?e:"utf-8",contentTypeEncoder:r.default().applicationJson.encoder}:{charset:null!==(t=e.charset)&&void 0!==t?t:"utf-8",contentEncoder:e.contentEncoder,contentTypeEncoder:null!==(n=e.contentTypeEncoder)&&void 0!==n?n:r.default().applicationJson.encoder}}}(a||(a={})),t.WriteableStreamMessageWriter=class extends c{constructor(e,t){super(),this.writable=e,this.options=a.fromOptions(t),this.errorCount=0,this.writeSemaphore=new o.Semaphore(1),this.writable.onError((e=>this.fireError(e))),this.writable.onClose((()=>this.fireClose()))}async write(e){return this.writeSemaphore.lock((async()=>this.options.contentTypeEncoder.encode(e,this.options).then((e=>void 0!==this.options.contentEncoder?this.options.contentEncoder.encode(e):e)).then((t=>{const n=[];return n.push("Content-Length: ",t.byteLength.toString(),"\r\n"),n.push("\r\n"),this.doWrite(e,n,t)}),(e=>{throw this.fireError(e),e}))))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}},839:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isResponseMessage=t.isNotificationMessage=t.isRequestMessage=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType=t.RequestType0=t.AbstractMessageSignature=t.ParameterStructures=t.ResponseError=t.ErrorCodes=void 0;const r=n(7574);var i;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=e.jsonrpcReservedErrorRangeStart,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=e.jsonrpcReservedErrorRangeEnd}(i=t.ErrorCodes||(t.ErrorCodes={}));class o extends Error{constructor(e,t,n){super(t),this.code=r.number(e)?e:i.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,o.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}}t.ResponseError=o;class s{constructor(e){this.kind=e}static is(e){return e===s.auto||e===s.byName||e===s.byPosition}toString(){return this.kind}}t.ParameterStructures=s,s.auto=new s("auto"),s.byPosition=new s("byPosition"),s.byName=new s("byName");class a{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return s.auto}}t.AbstractMessageSignature=a,t.RequestType0=class extends a{constructor(e){super(e,0)}},t.RequestType=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType1=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.RequestType2=class extends a{constructor(e){super(e,2)}},t.RequestType3=class extends a{constructor(e){super(e,3)}},t.RequestType4=class extends a{constructor(e){super(e,4)}},t.RequestType5=class extends a{constructor(e){super(e,5)}},t.RequestType6=class extends a{constructor(e){super(e,6)}},t.RequestType7=class extends a{constructor(e){super(e,7)}},t.RequestType8=class extends a{constructor(e){super(e,8)}},t.RequestType9=class extends a{constructor(e){super(e,9)}},t.NotificationType=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType0=class extends a{constructor(e){super(e,0)}},t.NotificationType1=class extends a{constructor(e,t=s.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},t.NotificationType2=class extends a{constructor(e){super(e,2)}},t.NotificationType3=class extends a{constructor(e){super(e,3)}},t.NotificationType4=class extends a{constructor(e){super(e,4)}},t.NotificationType5=class extends a{constructor(e){super(e,5)}},t.NotificationType6=class extends a{constructor(e){super(e,6)}},t.NotificationType7=class extends a{constructor(e){super(e,7)}},t.NotificationType8=class extends a{constructor(e){super(e,8)}},t.NotificationType9=class extends a{constructor(e){super(e,9)}},t.isRequestMessage=function(e){const t=e;return t&&r.string(t.method)&&(r.string(t.id)||r.number(t.id))},t.isNotificationMessage=function(e){const t=e;return t&&r.string(t.method)&&void 0===e.id},t.isResponseMessage=function(e){const t=e;return t&&(void 0!==t.result||!!t.error)&&(r.string(t.id)||r.number(t.id)||null===t.id)}},147:(e,t)=>{"use strict";let n;function r(){if(void 0===n)throw new Error("No runtime abstraction layer installed");return n}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");n=e}}(r||(r={})),t.default=r},142:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;const r=n(147);t.Semaphore=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise(((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()}))}get active(){return this._active}runNext(){0!==this._waiting.length&&this._active!==this._capacity&&r.default().timer.setImmediate((()=>this.doRunNext()))}doRunNext(){if(0===this._waiting.length||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then((t=>{this._active--,e.resolve(t),this.runNext()}),(t=>{this._active--,e.reject(t),this.runNext()})):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}},5224:(e,t,n)=>{"use strict";e.exports=n(152)},152:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const o=n(1169);i(n(1169),t),i(n(1661),t),t.createProtocolConnection=function(e,t,n,r){return o.createMessageConnection(e,t,n,r)}},1661:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,i(n(9054),t),i(n(5882),t),i(n(6140),t),i(n(542),t);var o,s=n(3767);Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return s.createProtocolConnection}}),(o=t.LSPErrorCodes||(t.LSPErrorCodes={})).lspReservedErrorRangeStart=-32899,o.ContentModified=-32801,o.RequestCancelled=-32800,o.lspReservedErrorRangeEnd=-32800},3767:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=n(9054);t.createProtocolConnection=function(e,t,n,i){return r.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),r.createMessageConnection(e,t,n,i)}},6140:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProtocolNotificationType=t.ProtocolNotificationType0=t.ProtocolRequestType=t.ProtocolRequestType0=t.RegistrationType=void 0;const r=n(9054);t.RegistrationType=class{constructor(e){this.method=e}};class i extends r.RequestType0{constructor(e){super(e)}}t.ProtocolRequestType0=i;class o extends r.RequestType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolRequestType=o;class s extends r.NotificationType0{constructor(e){super(e)}}t.ProtocolNotificationType0=s;class a extends r.NotificationType{constructor(e){super(e,r.ParameterStructures.byName)}}t.ProtocolNotificationType=a},2918:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.CallHierarchyPrepareRequest=void 0;const r=n(6140);var i,o,s;(s=t.CallHierarchyPrepareRequest||(t.CallHierarchyPrepareRequest={})).method="textDocument/prepareCallHierarchy",s.type=new r.ProtocolRequestType(s.method),(o=t.CallHierarchyIncomingCallsRequest||(t.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",o.type=new r.ProtocolRequestType(o.method),(i=t.CallHierarchyOutgoingCallsRequest||(t.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",i.type=new r.ProtocolRequestType(i.method)},9891:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorPresentationRequest=t.DocumentColorRequest=void 0;const r=n(6140);var i;(i=t.DocumentColorRequest||(t.DocumentColorRequest={})).method="textDocument/documentColor",i.type=new r.ProtocolRequestType(i.method),(t.ColorPresentationRequest||(t.ColorPresentationRequest={})).type=new r.ProtocolRequestType("textDocument/colorPresentation")},5934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationRequest=void 0;const r=n(6140);(t.ConfigurationRequest||(t.ConfigurationRequest={})).type=new r.ProtocolRequestType("workspace/configuration")},764:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeclarationRequest=void 0;const r=n(6140);var i;(i=t.DeclarationRequest||(t.DeclarationRequest={})).method="textDocument/declaration",i.type=new r.ProtocolRequestType(i.method)},7846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.DidRenameFilesNotification=t.WillRenameFilesRequest=t.DidCreateFilesNotification=t.WillCreateFilesRequest=t.FileOperationPatternKind=void 0;const r=n(6140);var i,o,s,a,c,u,l;(l=t.FileOperationPatternKind||(t.FileOperationPatternKind={})).file="file",l.folder="folder",(u=t.WillCreateFilesRequest||(t.WillCreateFilesRequest={})).method="workspace/willCreateFiles",u.type=new r.ProtocolRequestType(u.method),(c=t.DidCreateFilesNotification||(t.DidCreateFilesNotification={})).method="workspace/didCreateFiles",c.type=new r.ProtocolNotificationType(c.method),(a=t.WillRenameFilesRequest||(t.WillRenameFilesRequest={})).method="workspace/willRenameFiles",a.type=new r.ProtocolRequestType(a.method),(s=t.DidRenameFilesNotification||(t.DidRenameFilesNotification={})).method="workspace/didRenameFiles",s.type=new r.ProtocolNotificationType(s.method),(o=t.DidDeleteFilesNotification||(t.DidDeleteFilesNotification={})).method="workspace/didDeleteFiles",o.type=new r.ProtocolNotificationType(o.method),(i=t.WillDeleteFilesRequest||(t.WillDeleteFilesRequest={})).method="workspace/willDeleteFiles",i.type=new r.ProtocolRequestType(i.method)},3394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FoldingRangeRequest=t.FoldingRangeKind=void 0;const r=n(6140);var i,o;(o=t.FoldingRangeKind||(t.FoldingRangeKind={})).Comment="comment",o.Imports="imports",o.Region="region",(i=t.FoldingRangeRequest||(t.FoldingRangeRequest={})).method="textDocument/foldingRange",i.type=new r.ProtocolRequestType(i.method)},2122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImplementationRequest=void 0;const r=n(6140);var i;(i=t.ImplementationRequest||(t.ImplementationRequest={})).method="textDocument/implementation",i.type=new r.ProtocolRequestType(i.method)},542:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeError=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.DocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=void 0;const r=n(9533),i=n(6140),o=n(2122);Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return o.ImplementationRequest}});const s=n(1589);Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const a=n(9795);Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return a.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return a.DidChangeWorkspaceFoldersNotification}});const c=n(5934);Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return c.ConfigurationRequest}});const u=n(9891);Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return u.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return u.ColorPresentationRequest}});const l=n(3394);Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}});const f=n(764);Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return f.DeclarationRequest}});const h=n(5206);Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const d=n(1862);Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const p=n(2918);Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const m=n(9434);Object.defineProperty(t,"SemanticTokenTypes",{enumerable:!0,get:function(){return m.SemanticTokenTypes}}),Object.defineProperty(t,"SemanticTokenModifiers",{enumerable:!0,get:function(){return m.SemanticTokenModifiers}}),Object.defineProperty(t,"SemanticTokens",{enumerable:!0,get:function(){return m.SemanticTokens}}),Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return m.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return m.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return m.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return m.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return m.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return m.SemanticTokensRegistrationType}});const g=n(5726);Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return g.ShowDocumentRequest}});const y=n(6305);Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return y.LinkedEditingRangeRequest}});const v=n(7846);Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return v.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return v.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return v.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return v.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return v.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return v.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return v.WillDeleteFilesRequest}});const b=n(3443);var w,_,S,k,x,C,T,E,P,R,A,O,$,N,j,I,D,M,q,F,L,V,W,U,B,K,z,H,J,G,Y,Q,X,Z,ee,te,ne,re,ie,oe;Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return b.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return b.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return b.MonikerRequest}}),function(e){e.is=function(e){const t=e;return r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(w=t.DocumentFilter||(t.DocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!w.is(t))return!1;return!0}}(_=t.DocumentSelector||(t.DocumentSelector={})),(t.RegistrationRequest||(t.RegistrationRequest={})).type=new i.ProtocolRequestType("client/registerCapability"),(t.UnregistrationRequest||(t.UnregistrationRequest={})).type=new i.ProtocolRequestType("client/unregisterCapability"),(oe=t.ResourceOperationKind||(t.ResourceOperationKind={})).Create="create",oe.Rename="rename",oe.Delete="delete",(ie=t.FailureHandlingKind||(t.FailureHandlingKind={})).Abort="abort",ie.Transactional="transactional",ie.TextOnlyTransactional="textOnlyTransactional",ie.Undo="undo",(t.StaticRegistrationOptions||(t.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0},(t.TextDocumentRegistrationOptions||(t.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||_.is(t.documentSelector))},(re=t.WorkDoneProgressOptions||(t.WorkDoneProgressOptions={})).is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},re.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)},(t.InitializeRequest||(t.InitializeRequest={})).type=new i.ProtocolRequestType("initialize"),(t.InitializeError||(t.InitializeError={})).unknownProtocolVersion=1,(t.InitializedNotification||(t.InitializedNotification={})).type=new i.ProtocolNotificationType("initialized"),(t.ShutdownRequest||(t.ShutdownRequest={})).type=new i.ProtocolRequestType0("shutdown"),(t.ExitNotification||(t.ExitNotification={})).type=new i.ProtocolNotificationType0("exit"),(t.DidChangeConfigurationNotification||(t.DidChangeConfigurationNotification={})).type=new i.ProtocolNotificationType("workspace/didChangeConfiguration"),(ne=t.MessageType||(t.MessageType={})).Error=1,ne.Warning=2,ne.Info=3,ne.Log=4,(t.ShowMessageNotification||(t.ShowMessageNotification={})).type=new i.ProtocolNotificationType("window/showMessage"),(t.ShowMessageRequest||(t.ShowMessageRequest={})).type=new i.ProtocolRequestType("window/showMessageRequest"),(t.LogMessageNotification||(t.LogMessageNotification={})).type=new i.ProtocolNotificationType("window/logMessage"),(t.TelemetryEventNotification||(t.TelemetryEventNotification={})).type=new i.ProtocolNotificationType("telemetry/event"),(te=t.TextDocumentSyncKind||(t.TextDocumentSyncKind={})).None=0,te.Full=1,te.Incremental=2,(ee=t.DidOpenTextDocumentNotification||(t.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",ee.type=new i.ProtocolNotificationType(ee.method),(Z=t.TextDocumentContentChangeEvent||(t.TextDocumentContentChangeEvent={})).isIncremental=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},Z.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(X=t.DidChangeTextDocumentNotification||(t.DidChangeTextDocumentNotification={})).method="textDocument/didChange",X.type=new i.ProtocolNotificationType(X.method),(Q=t.DidCloseTextDocumentNotification||(t.DidCloseTextDocumentNotification={})).method="textDocument/didClose",Q.type=new i.ProtocolNotificationType(Q.method),(Y=t.DidSaveTextDocumentNotification||(t.DidSaveTextDocumentNotification={})).method="textDocument/didSave",Y.type=new i.ProtocolNotificationType(Y.method),(G=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,G.AfterDelay=2,G.FocusOut=3,(J=t.WillSaveTextDocumentNotification||(t.WillSaveTextDocumentNotification={})).method="textDocument/willSave",J.type=new i.ProtocolNotificationType(J.method),(H=t.WillSaveTextDocumentWaitUntilRequest||(t.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",H.type=new i.ProtocolRequestType(H.method),(t.DidChangeWatchedFilesNotification||(t.DidChangeWatchedFilesNotification={})).type=new i.ProtocolNotificationType("workspace/didChangeWatchedFiles"),(z=t.FileChangeType||(t.FileChangeType={})).Created=1,z.Changed=2,z.Deleted=3,(K=t.WatchKind||(t.WatchKind={})).Create=1,K.Change=2,K.Delete=4,(t.PublishDiagnosticsNotification||(t.PublishDiagnosticsNotification={})).type=new i.ProtocolNotificationType("textDocument/publishDiagnostics"),(B=t.CompletionTriggerKind||(t.CompletionTriggerKind={})).Invoked=1,B.TriggerCharacter=2,B.TriggerForIncompleteCompletions=3,(U=t.CompletionRequest||(t.CompletionRequest={})).method="textDocument/completion",U.type=new i.ProtocolRequestType(U.method),(W=t.CompletionResolveRequest||(t.CompletionResolveRequest={})).method="completionItem/resolve",W.type=new i.ProtocolRequestType(W.method),(V=t.HoverRequest||(t.HoverRequest={})).method="textDocument/hover",V.type=new i.ProtocolRequestType(V.method),(L=t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})).Invoked=1,L.TriggerCharacter=2,L.ContentChange=3,(F=t.SignatureHelpRequest||(t.SignatureHelpRequest={})).method="textDocument/signatureHelp",F.type=new i.ProtocolRequestType(F.method),(q=t.DefinitionRequest||(t.DefinitionRequest={})).method="textDocument/definition",q.type=new i.ProtocolRequestType(q.method),(M=t.ReferencesRequest||(t.ReferencesRequest={})).method="textDocument/references",M.type=new i.ProtocolRequestType(M.method),(D=t.DocumentHighlightRequest||(t.DocumentHighlightRequest={})).method="textDocument/documentHighlight",D.type=new i.ProtocolRequestType(D.method),(I=t.DocumentSymbolRequest||(t.DocumentSymbolRequest={})).method="textDocument/documentSymbol",I.type=new i.ProtocolRequestType(I.method),(j=t.CodeActionRequest||(t.CodeActionRequest={})).method="textDocument/codeAction",j.type=new i.ProtocolRequestType(j.method),(N=t.CodeActionResolveRequest||(t.CodeActionResolveRequest={})).method="codeAction/resolve",N.type=new i.ProtocolRequestType(N.method),($=t.WorkspaceSymbolRequest||(t.WorkspaceSymbolRequest={})).method="workspace/symbol",$.type=new i.ProtocolRequestType($.method),(O=t.CodeLensRequest||(t.CodeLensRequest={})).method="textDocument/codeLens",O.type=new i.ProtocolRequestType(O.method),(A=t.CodeLensResolveRequest||(t.CodeLensResolveRequest={})).method="codeLens/resolve",A.type=new i.ProtocolRequestType(A.method),(R=t.CodeLensRefreshRequest||(t.CodeLensRefreshRequest={})).method="workspace/codeLens/refresh",R.type=new i.ProtocolRequestType0(R.method),(P=t.DocumentLinkRequest||(t.DocumentLinkRequest={})).method="textDocument/documentLink",P.type=new i.ProtocolRequestType(P.method),(E=t.DocumentLinkResolveRequest||(t.DocumentLinkResolveRequest={})).method="documentLink/resolve",E.type=new i.ProtocolRequestType(E.method),(T=t.DocumentFormattingRequest||(t.DocumentFormattingRequest={})).method="textDocument/formatting",T.type=new i.ProtocolRequestType(T.method),(C=t.DocumentRangeFormattingRequest||(t.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",C.type=new i.ProtocolRequestType(C.method),(x=t.DocumentOnTypeFormattingRequest||(t.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",x.type=new i.ProtocolRequestType(x.method),(t.PrepareSupportDefaultBehavior||(t.PrepareSupportDefaultBehavior={})).Identifier=1,(k=t.RenameRequest||(t.RenameRequest={})).method="textDocument/rename",k.type=new i.ProtocolRequestType(k.method),(S=t.PrepareRenameRequest||(t.PrepareRenameRequest={})).method="textDocument/prepareRename",S.type=new i.ProtocolRequestType(S.method),(t.ExecuteCommandRequest||(t.ExecuteCommandRequest={})).type=new i.ProtocolRequestType("workspace/executeCommand"),(t.ApplyWorkspaceEditRequest||(t.ApplyWorkspaceEditRequest={})).type=new i.ProtocolRequestType("workspace/applyEdit")},6305:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeRequest=void 0;const r=n(6140);var i;(i=t.LinkedEditingRangeRequest||(t.LinkedEditingRangeRequest={})).method="textDocument/linkedEditingRange",i.type=new r.ProtocolRequestType(i.method)},3443:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=void 0;const r=n(6140);var i,o,s;(s=t.UniquenessLevel||(t.UniquenessLevel={})).document="document",s.project="project",s.group="group",s.scheme="scheme",s.global="global",(o=t.MonikerKind||(t.MonikerKind={})).import="import",o.export="export",o.local="local",(i=t.MonikerRequest||(t.MonikerRequest={})).method="textDocument/moniker",i.type=new r.ProtocolRequestType(i.method)},1862:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=void 0;const r=n(9054),i=n(6140);var o;(o=t.WorkDoneProgress||(t.WorkDoneProgress={})).type=new r.ProgressType,o.is=function(e){return e===o.type},(t.WorkDoneProgressCreateRequest||(t.WorkDoneProgressCreateRequest={})).type=new i.ProtocolRequestType("window/workDoneProgress/create"),(t.WorkDoneProgressCancelNotification||(t.WorkDoneProgressCancelNotification={})).type=new i.ProtocolNotificationType("window/workDoneProgress/cancel")},5206:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRangeRequest=void 0;const r=n(6140);var i;(i=t.SelectionRangeRequest||(t.SelectionRangeRequest={})).method="textDocument/selectionRange",i.type=new r.ProtocolRequestType(i.method)},9434:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.SemanticTokensRegistrationType=t.TokenFormat=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=void 0;const r=n(6140);var i,o,s,a,c,u,l;(l=t.SemanticTokenTypes||(t.SemanticTokenTypes={})).namespace="namespace",l.type="type",l.class="class",l.enum="enum",l.interface="interface",l.struct="struct",l.typeParameter="typeParameter",l.parameter="parameter",l.variable="variable",l.property="property",l.enumMember="enumMember",l.event="event",l.function="function",l.method="method",l.macro="macro",l.keyword="keyword",l.modifier="modifier",l.comment="comment",l.string="string",l.number="number",l.regexp="regexp",l.operator="operator",(u=t.SemanticTokenModifiers||(t.SemanticTokenModifiers={})).declaration="declaration",u.definition="definition",u.readonly="readonly",u.static="static",u.deprecated="deprecated",u.abstract="abstract",u.async="async",u.modification="modification",u.documentation="documentation",u.defaultLibrary="defaultLibrary",(t.SemanticTokens||(t.SemanticTokens={})).is=function(e){const t=e;return void 0!==t&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])},(t.TokenFormat||(t.TokenFormat={})).Relative="relative",(c=t.SemanticTokensRegistrationType||(t.SemanticTokensRegistrationType={})).method="textDocument/semanticTokens",c.type=new r.RegistrationType(c.method),(a=t.SemanticTokensRequest||(t.SemanticTokensRequest={})).method="textDocument/semanticTokens/full",a.type=new r.ProtocolRequestType(a.method),(s=t.SemanticTokensDeltaRequest||(t.SemanticTokensDeltaRequest={})).method="textDocument/semanticTokens/full/delta",s.type=new r.ProtocolRequestType(s.method),(o=t.SemanticTokensRangeRequest||(t.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",o.type=new r.ProtocolRequestType(o.method),(i=t.SemanticTokensRefreshRequest||(t.SemanticTokensRefreshRequest={})).method="workspace/semanticTokens/refresh",i.type=new r.ProtocolRequestType0(i.method)},5726:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentRequest=void 0;const r=n(6140);var i;(i=t.ShowDocumentRequest||(t.ShowDocumentRequest={})).method="window/showDocument",i.type=new r.ProtocolRequestType(i.method)},1589:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeDefinitionRequest=void 0;const r=n(6140);var i;(i=t.TypeDefinitionRequest||(t.TypeDefinitionRequest={})).method="textDocument/typeDefinition",i.type=new r.ProtocolRequestType(i.method)},9795:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=void 0;const r=n(6140);(t.WorkspaceFoldersRequest||(t.WorkspaceFoldersRequest={})).type=new r.ProtocolRequestType0("workspace/workspaceFolders"),(t.DidChangeWorkspaceFoldersNotification||(t.DidChangeWorkspaceFoldersNotification={})).type=new r.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")},9533:(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.objectLiteral=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.objectLiteral=function(e){return null!==e&&"object"==typeof e}},5882:(e,t,n)=>{"use strict";var r,i,o,s,a,c,u,l,f,h,d,p,m,g,y,v,b,w,_,S,k,x,C,T,E,P;n.r(t),n.d(t,{AnnotatedTextEdit:()=>k,ChangeAnnotation:()=>_,ChangeAnnotationIdentifier:()=>S,CodeAction:()=>ee,CodeActionContext:()=>Z,CodeActionKind:()=>X,CodeDescription:()=>y,CodeLens:()=>te,Color:()=>u,ColorInformation:()=>l,ColorPresentation:()=>f,Command:()=>b,CompletionItem:()=>L,CompletionItemKind:()=>I,CompletionItemTag:()=>M,CompletionList:()=>V,CreateFile:()=>C,DeleteFile:()=>E,Diagnostic:()=>v,DiagnosticRelatedInformation:()=>p,DiagnosticSeverity:()=>m,DiagnosticTag:()=>g,DocumentHighlight:()=>H,DocumentHighlightKind:()=>z,DocumentLink:()=>re,DocumentSymbol:()=>Q,EOL:()=>ue,FoldingRange:()=>d,FoldingRangeKind:()=>h,FormattingOptions:()=>ne,Hover:()=>U,InsertReplaceEdit:()=>q,InsertTextFormat:()=>D,InsertTextMode:()=>F,Location:()=>a,LocationLink:()=>c,MarkedString:()=>W,MarkupContent:()=>j,MarkupKind:()=>N,OptionalVersionedTextDocumentIdentifier:()=>O,ParameterInformation:()=>B,Position:()=>o,Range:()=>s,RenameFile:()=>T,SelectionRange:()=>ie,SignatureInformation:()=>K,SymbolInformation:()=>Y,SymbolKind:()=>J,SymbolTag:()=>G,TextDocument:()=>ce,TextDocumentEdit:()=>x,TextDocumentIdentifier:()=>R,TextDocumentItem:()=>$,TextEdit:()=>w,VersionedTextDocumentIdentifier:()=>A,WorkspaceChange:()=>ae,WorkspaceEdit:()=>P,integer:()=>r,uinteger:()=>i}),function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647}(r||(r={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647}(i||(i={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=i.MAX_VALUE),t===Number.MAX_VALUE&&(t=i.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return le.objectLiteral(t)&&le.uinteger(t.line)&&le.uinteger(t.character)}}(o||(o={})),function(e){e.create=function(e,t,n,r){if(le.uinteger(e)&&le.uinteger(t)&&le.uinteger(n)&&le.uinteger(r))return{start:o.create(e,t),end:o.create(n,r)};if(o.is(e)&&o.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+r+"]")},e.is=function(e){var t=e;return le.objectLiteral(t)&&o.is(t.start)&&o.is(t.end)}}(s||(s={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return le.defined(t)&&s.is(t.range)&&(le.string(t.uri)||le.undefined(t.uri))}}(a||(a={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return le.defined(t)&&s.is(t.targetRange)&&le.string(t.targetUri)&&(s.is(t.targetSelectionRange)||le.undefined(t.targetSelectionRange))&&(s.is(t.originSelectionRange)||le.undefined(t.originSelectionRange))}}(c||(c={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return le.numberRange(t.red,0,1)&&le.numberRange(t.green,0,1)&&le.numberRange(t.blue,0,1)&&le.numberRange(t.alpha,0,1)}}(u||(u={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return s.is(t.range)&&u.is(t.color)}}(l||(l={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return le.string(t.label)&&(le.undefined(t.textEdit)||w.is(t))&&(le.undefined(t.additionalTextEdits)||le.typedArray(t.additionalTextEdits,w.is))}}(f||(f={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(h||(h={})),function(e){e.create=function(e,t,n,r,i){var o={startLine:e,endLine:t};return le.defined(n)&&(o.startCharacter=n),le.defined(r)&&(o.endCharacter=r),le.defined(i)&&(o.kind=i),o},e.is=function(e){var t=e;return le.uinteger(t.startLine)&&le.uinteger(t.startLine)&&(le.undefined(t.startCharacter)||le.uinteger(t.startCharacter))&&(le.undefined(t.endCharacter)||le.uinteger(t.endCharacter))&&(le.undefined(t.kind)||le.string(t.kind))}}(d||(d={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return le.defined(t)&&a.is(t.location)&&le.string(t.message)}}(p||(p={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(m||(m={})),function(e){e.Unnecessary=1,e.Deprecated=2}(g||(g={})),function(e){e.is=function(e){var t=e;return null!=t&&le.string(t.href)}}(y||(y={})),function(e){e.create=function(e,t,n,r,i,o){var s={range:e,message:t};return le.defined(n)&&(s.severity=n),le.defined(r)&&(s.code=r),le.defined(i)&&(s.source=i),le.defined(o)&&(s.relatedInformation=o),s},e.is=function(e){var t,n=e;return le.defined(n)&&s.is(n.range)&&le.string(n.message)&&(le.number(n.severity)||le.undefined(n.severity))&&(le.integer(n.code)||le.string(n.code)||le.undefined(n.code))&&(le.undefined(n.codeDescription)||le.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(le.string(n.source)||le.undefined(n.source))&&(le.undefined(n.relatedInformation)||le.typedArray(n.relatedInformation,p.is))}}(v||(v={})),function(e){e.create=function(e,t){for(var n=[],r=2;r0&&(i.arguments=n),i},e.is=function(e){var t=e;return le.defined(t)&&le.string(t.title)&&le.string(t.command)}}(b||(b={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return le.objectLiteral(t)&&le.string(t.newText)&&s.is(t.range)}}(w||(w={})),function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){var t=e;return void 0!==t&&le.objectLiteral(t)&&le.string(t.label)&&(le.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(le.string(t.description)||void 0===t.description)}}(_||(_={})),function(e){e.is=function(e){return"string"==typeof e}}(S||(S={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return w.is(t)&&(_.is(t.annotationId)||S.is(t.annotationId))}}(k||(k={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return le.defined(t)&&O.is(t.textDocument)&&Array.isArray(t.edits)}}(x||(x={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"create"===t.kind&&le.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||le.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||le.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||S.is(t.annotationId))}}(C||(C={})),function(e){e.create=function(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){var t=e;return t&&"rename"===t.kind&&le.string(t.oldUri)&&le.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||le.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||le.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||S.is(t.annotationId))}}(T||(T={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"delete"===t.kind&&le.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||le.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||le.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||S.is(t.annotationId))}}(E||(E={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return le.string(e.kind)?C.is(e)||T.is(e)||E.is(e):x.is(e)})))}}(P||(P={}));var R,A,O,$,N,j,I,D,M,q,F,L,V,W,U,B,K,z,H,J,G,Y,Q,X,Z,ee,te,ne,re,ie,oe=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=w.insert(e,t):S.is(n)?(i=n,r=k.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=k.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=w.replace(e,t):S.is(n)?(i=n,r=k.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=k.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=w.del(e):S.is(t)?(r=t,n=k.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=k.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),se=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(S.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id "+n+" is already in use.");if(void 0===t)throw new Error("No annotation provided for id "+n);return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),ae=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new se(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(x.is(e)){var n=new oe(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new oe(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(O.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new oe(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new oe(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new se,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(_.is(t)||S.is(t)?r=t:n=t,void 0===r?i=C.create(e,n):(o=S.is(r)?r:this._changeAnnotations.manage(r),i=C.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,s;if(_.is(n)||S.is(n)?i=n:r=n,void 0===i?o=T.create(e,t,r):(s=S.is(i)?i:this._changeAnnotations.manage(i),o=T.create(e,t,r,s)),this._workspaceEdit.documentChanges.push(o),void 0!==s)return s},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(_.is(t)||S.is(t)?r=t:n=t,void 0===r?i=E.create(e,n):(o=S.is(r)?r:this._changeAnnotations.manage(r),i=E.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return le.defined(t)&&le.string(t.uri)}}(R||(R={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return le.defined(t)&&le.string(t.uri)&&le.integer(t.version)}}(A||(A={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return le.defined(t)&&le.string(t.uri)&&(null===t.version||le.integer(t.version))}}(O||(O={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return le.defined(t)&&le.string(t.uri)&&le.string(t.languageId)&&le.integer(t.version)&&le.string(t.text)}}($||($={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(N||(N={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(N||(N={})),function(e){e.is=function(e){var t=e;return le.objectLiteral(e)&&N.is(t.kind)&&le.string(t.value)}}(j||(j={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(I||(I={})),function(e){e.PlainText=1,e.Snippet=2}(D||(D={})),function(e){e.Deprecated=1}(M||(M={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&le.string(t.newText)&&s.is(t.insert)&&s.is(t.replace)}}(q||(q={})),function(e){e.asIs=1,e.adjustIndentation=2}(F||(F={})),function(e){e.create=function(e){return{label:e}}}(L||(L={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(V||(V={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return le.string(t)||le.objectLiteral(t)&&le.string(t.language)&&le.string(t.value)}}(W||(W={})),function(e){e.is=function(e){var t=e;return!!t&&le.objectLiteral(t)&&(j.is(t.contents)||W.is(t.contents)||le.typedArray(t.contents,W.is))&&(void 0===e.range||s.is(e.range))}}(U||(U={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(B||(B={})),function(e){e.create=function(e,t){for(var n=[],r=2;r=0;s--){var a=i[s],c=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=o))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(u,r.length),o=c}return r}}(ce||(ce={}));var le,fe=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return o.create(0,e);for(;ne?r=i:n=i+1}var s=n-1;return o.create(s,e-t[s])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1{"use strict";e.exports=n(7630)},7630:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=void 0;const o=n(6265);i(n(5224),t),i(n(6265),t);let s=!1;const a={initialize:e=>{},get shutdownReceived(){return s},set shutdownReceived(e){s=e},exit:e=>{}};t.createConnection=function(e,t,n,r){let i,s,c,u;return void 0!==e&&"features"===e.__brand&&(i=e,e=t,t=n,n=r),o.ConnectionStrategy.is(e)||o.ConnectionOptions.is(e)?u=e:(s=e,c=t,u=n),o.createConnection((e=>o.createProtocolConnection(s,c,e,u)),a,i)}},6265:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.SemanticTokensBuilder=void 0;const o=n(9817);Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return o.SemanticTokensBuilder}}),i(n(152),t),i(n(5878),t),(t.ProposedFeatures||(t.ProposedFeatures={})).all={__brand:"features"}},7985:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CallHierarchyFeature=void 0;const r=n(152);t.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>{this.connection.onRequest(r.CallHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))},onIncomingCalls:e=>{const t=r.CallHierarchyIncomingCallsRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=r.CallHierarchyOutgoingCallsRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},2507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationFeature=void 0;const r=n(152),i=n(289);t.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?i.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(r.ConfigurationRequest.type,t).then((t=>Array.isArray(e)?t:t[0]))}}},828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileOperationsFeature=void 0;const r=n(152);t.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){this.connection.onNotification(r.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){this.connection.onNotification(r.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){this.connection.onNotification(r.DidDeleteFilesNotification.type,(t=>{e(t)}))}onWillCreateFiles(e){return this.connection.onRequest(r.WillCreateFilesRequest.type,((t,n)=>e(t,n)))}onWillRenameFiles(e){return this.connection.onRequest(r.WillRenameFilesRequest.type,((t,n)=>e(t,n)))}onWillDeleteFiles(e){return this.connection.onRequest(r.WillDeleteFilesRequest.type,((t,n)=>e(t,n)))}}},2776:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkedEditingRangeFeature=void 0;const r=n(152);t.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){this.connection.onRequest(r.LinkedEditingRangeRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))}}},8120:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MonikerFeature=void 0;const r=n(152);t.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{const t=r.MonikerRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}}},2731:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attachPartialResult=t.ProgressFeature=t.attachWorkDone=void 0;const r=n(152),i=n(7560);class o{constructor(e,t){this._connection=e,this._token=t,o.Instances.set(this._token,this)}begin(e,t,n,i){let o={kind:"begin",title:e,percentage:t,message:n,cancellable:i};this._connection.sendProgress(r.WorkDoneProgress.type,this._token,o)}report(e,t){let n={kind:"report"};"number"==typeof e?(n.percentage=e,void 0!==t&&(n.message=t)):n.message=e,this._connection.sendProgress(r.WorkDoneProgress.type,this._token,n)}done(){o.Instances.delete(this._token),this._connection.sendProgress(r.WorkDoneProgress.type,this._token,{kind:"end"})}}o.Instances=new Map;class s extends o{constructor(e,t){super(e,t),this._source=new r.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class a{constructor(){}begin(){}report(){}done(){}}class c extends a{constructor(){super(),this._source=new r.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}var u;t.attachWorkDone=function(e,t){if(void 0===t||void 0===t.workDoneToken)return new a;const n=t.workDoneToken;return delete t.workDoneToken,new o(e,n)},t.ProgressFeature=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(e){var t;!0===(null===(t=null==e?void 0:e.window)||void 0===t?void 0:t.workDoneProgress)&&(this._progressSupported=!0,this.connection.onNotification(r.WorkDoneProgressCancelNotification.type,(e=>{let t=o.Instances.get(e.token);(t instanceof s||t instanceof c)&&t.cancel()})))}attachWorkDoneProgress(e){return void 0===e?new a:new o(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=i.generateUuid();return this.connection.sendRequest(r.WorkDoneProgressCreateRequest.type,{token:e}).then((()=>new s(this.connection,e)))}return Promise.resolve(new c)}},function(e){e.type=new r.ProgressType}(u||(u={}));class l{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(u.type,this._token,e)}}t.attachPartialResult=function(e,t){if(void 0===t||void 0===t.partialResultToken)return;const n=t.partialResultToken;return delete t.partialResultToken,new l(e,n)}},9817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SemanticTokensBuilder=t.SemanticTokensFeature=void 0;const r=n(152);t.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{on:e=>{const t=r.SemanticTokensRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=r.SemanticTokensDeltaRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=r.SemanticTokensRangeRequest.type;this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}},t.SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,n,r,i){let o=e,s=t;this._dataLen>0&&(o-=this._prevLine,0===o&&(s-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return void 0!==this._prevData}buildEdits(){if(void 0!==this._prevData){const e=this._prevData.length,t=this._data.length;let n=0;for(;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.combineFeatures=t.combineLanguagesFeatures=t.combineWorkspaceFeatures=t.combineWindowFeatures=t.combineClientFeatures=t.combineTracerFeatures=t.combineTelemetryFeatures=t.combineConsoleFeatures=t._LanguagesImpl=t.BulkUnregistration=t.BulkRegistration=t.ErrorMessageTracker=t.TextDocuments=void 0;const r=n(152),i=n(289),o=n(7560),s=n(2731),a=n(2507),c=n(8634),u=n(7985),l=n(9817),f=n(5421),h=n(828),d=n(2776),p=n(8120);function m(e){if(null!==e)return e}t.TextDocuments=class{constructor(e){this._documents=Object.create(null),this._configuration=e,this._onDidChangeContent=new r.Emitter,this._onDidOpen=new r.Emitter,this._onDidClose=new r.Emitter,this._onDidSave=new r.Emitter,this._onWillSave=new r.Emitter}get onDidChangeContent(){return this._onDidChangeContent.event}get onDidOpen(){return this._onDidOpen.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._documents[e]}all(){return Object.keys(this._documents).map((e=>this._documents[e]))}keys(){return Object.keys(this._documents)}listen(e){e.__textDocumentSync=r.TextDocumentSyncKind.Full,e.onDidOpenTextDocument((e=>{let t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._documents[t.uri]=n;let r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)})),e.onDidChangeTextDocument((e=>{let t=e.textDocument,n=e.contentChanges;if(0===n.length)return;let r=this._documents[t.uri];const{version:i}=t;if(null==i)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);r=this._configuration.update(r,n,i),this._documents[t.uri]=r,this._onDidChangeContent.fire(Object.freeze({document:r}))})),e.onDidCloseTextDocument((e=>{let t=this._documents[e.textDocument.uri];t&&(delete this._documents[e.textDocument.uri],this._onDidClose.fire(Object.freeze({document:t})))})),e.onWillSaveTextDocument((e=>{let t=this._documents[e.textDocument.uri];t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))})),e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._documents[e.textDocument.uri];return n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]})),e.onDidSaveTextDocument((e=>{let t=this._documents[e.textDocument.uri];t&&this._onDidSave.fire(Object.freeze({document:t}))}))}},t.ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach((t=>{e.window.showErrorMessage(t)}))}};class g{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(r.MessageType.Error,e)}warn(e){this.send(r.MessageType.Warning,e)}info(e){this.send(r.MessageType.Info,e)}log(e){this.send(r.MessageType.Log,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(r.LogMessageNotification.type,{type:e,message:t})}}const y=f.ShowDocumentFeature(s.ProgressFeature(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let n={type:r.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(m)}showWarningMessage(e,...t){let n={type:r.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(m)}showInformationMessage(e,...t){let n={type:r.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(r.ShowMessageRequest.type,n).then(m)}}));(t.BulkRegistration||(t.BulkRegistration={})).create=function(){return new v};class v{constructor(){this._registrations=[],this._registered=new Set}add(e,t){const n=i.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);const r=o.generateUuid();this._registrations.push({id:r,method:n,registerOptions:t||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}}(t.BulkUnregistration||(t.BulkUnregistration={})).create=function(){return new b(void 0,[])};class b{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach((e=>{this._unregistrations.set(e.method,e)}))}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let t of this._unregistrations.values())e.push(t);let t={unregisterations:e};this._connection.sendRequest(r.UnregistrationRequest.type,t).then(void 0,(e=>{this._connection.console.info("Bulk unregistration failed.")}))}disposeSingle(e){const t=i.string(e)?e:e.method,n=this._unregistrations.get(t);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(r.UnregistrationRequest.type,o).then((()=>{this._unregistrations.delete(t)}),(e=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)})),!0}}class w{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof v?this.registerMany(e):e instanceof b?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,t,n){const s=i.string(t)?t:t.method,a=o.generateUuid();let c={registrations:[{id:a,method:s,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(r.RegistrationRequest.type,c).then((t=>(e.add({id:a,method:s}),e)),(e=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(e))))}registerSingle2(e,t){const n=i.string(e)?e:e.method,s=o.generateUuid();let a={registrations:[{id:s,method:n,registerOptions:t||{}}]};return this.connection.sendRequest(r.RegistrationRequest.type,a).then((e=>r.Disposable.create((()=>{this.unregisterSingle(s,n)}))),(e=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(e))))}unregisterSingle(e,t){let n={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(r.UnregistrationRequest.type,n).then(void 0,(t=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)}))}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(r.RegistrationRequest.type,t).then((()=>new b(this._connection,t.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const _=h.FileOperationsFeature(c.WorkspaceFoldersFeature(a.ConfigurationFeature(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){let t=(n=e)&&n.edit?e:{edit:e};var n;return this.connection.sendRequest(r.ApplyWorkspaceEditRequest.type,t)}})));class S{constructor(){this._trace=r.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==r.Trace.Off&&this.connection.sendNotification(r.LogTraceNotification.type,{message:e,verbose:this._trace===r.Trace.Verbose?t:void 0})}}class k{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(r.TelemetryEventNotification.type,e)}}class x{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return s.attachWorkDone(this.connection,e)}attachPartialResultProgress(e,t){return s.attachPartialResult(this.connection,t)}}t._LanguagesImpl=x;const C=p.MonikerFeature(d.LinkedEditingRangeFeature(l.SemanticTokensFeature(u.CallHierarchyFeature(x))));function T(e,t){return function(n){return t(e(n))}}function E(e,t){return function(n){return t(e(n))}}function P(e,t){return function(n){return t(e(n))}}function R(e,t){return function(n){return t(e(n))}}function A(e,t){return function(n){return t(e(n))}}function O(e,t){return function(n){return t(e(n))}}t.combineConsoleFeatures=T,t.combineTelemetryFeatures=E,t.combineTracerFeatures=P,t.combineClientFeatures=R,t.combineWindowFeatures=A,t.combineWorkspaceFeatures=O,t.combineLanguagesFeatures=function(e,t){return function(n){return t(e(n))}},t.combineFeatures=function(e,t){function n(e,t,n){return e&&t?n(e,t):e||t}return{__brand:"features",console:n(e.console,t.console,T),tracer:n(e.tracer,t.tracer,P),telemetry:n(e.telemetry,t.telemetry,E),client:n(e.client,t.client,R),window:n(e.window,t.window,A),workspace:n(e.workspace,t.workspace,O)}},t.createConnection=function(e,t,n){const o=n&&n.console?new(n.console(g)):new g,a=e(o);o.rawAttach(a);const c=n&&n.tracer?new(n.tracer(S)):new S,u=n&&n.telemetry?new(n.telemetry(k)):new k,l=n&&n.client?new(n.client(w)):new w,f=n&&n.window?new(n.window(y)):new y,h=n&&n.workspace?new(n.workspace(_)):new _,d=n&&n.languages?new(n.languages(C)):new C,p=[o,c,u,l,f,h,d];let m,v,b,x={listen:()=>a.listen(),sendRequest:(e,...t)=>a.sendRequest(i.string(e)?e:e.method,...t),onRequest:(e,t)=>a.onRequest(e,t),sendNotification:(e,t)=>{const n=i.string(e)?e:e.method;1===arguments.length?a.sendNotification(n):a.sendNotification(n,t)},onNotification:(e,t)=>a.onNotification(e,t),onProgress:a.onProgress,sendProgress:a.sendProgress,onInitialize:e=>v=e,onInitialized:e=>a.onNotification(r.InitializedNotification.type,e),onShutdown:e=>m=e,onExit:e=>b=e,get console(){return o},get telemetry(){return u},get tracer(){return c},get client(){return l},get window(){return f},get workspace(){return h},get languages(){return d},onDidChangeConfiguration:e=>a.onNotification(r.DidChangeConfigurationNotification.type,e),onDidChangeWatchedFiles:e=>a.onNotification(r.DidChangeWatchedFilesNotification.type,e),__textDocumentSync:void 0,onDidOpenTextDocument:e=>a.onNotification(r.DidOpenTextDocumentNotification.type,e),onDidChangeTextDocument:e=>a.onNotification(r.DidChangeTextDocumentNotification.type,e),onDidCloseTextDocument:e=>a.onNotification(r.DidCloseTextDocumentNotification.type,e),onWillSaveTextDocument:e=>a.onNotification(r.WillSaveTextDocumentNotification.type,e),onWillSaveTextDocumentWaitUntil:e=>a.onRequest(r.WillSaveTextDocumentWaitUntilRequest.type,e),onDidSaveTextDocument:e=>a.onNotification(r.DidSaveTextDocumentNotification.type,e),sendDiagnostics:e=>a.sendNotification(r.PublishDiagnosticsNotification.type,e),onHover:e=>a.onRequest(r.HoverRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onCompletion:e=>a.onRequest(r.CompletionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCompletionResolve:e=>a.onRequest(r.CompletionResolveRequest.type,e),onSignatureHelp:e=>a.onRequest(r.SignatureHelpRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onDeclaration:e=>a.onRequest(r.DeclarationRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDefinition:e=>a.onRequest(r.DefinitionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onTypeDefinition:e=>a.onRequest(r.TypeDefinitionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onImplementation:e=>a.onRequest(r.ImplementationRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onReferences:e=>a.onRequest(r.ReferencesRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDocumentHighlight:e=>a.onRequest(r.DocumentHighlightRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDocumentSymbol:e=>a.onRequest(r.DocumentSymbolRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onWorkspaceSymbol:e=>a.onRequest(r.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCodeAction:e=>a.onRequest(r.CodeActionRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCodeActionResolve:e=>a.onRequest(r.CodeActionResolveRequest.type,((t,n)=>e(t,n))),onCodeLens:e=>a.onRequest(r.CodeLensRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onCodeLensResolve:e=>a.onRequest(r.CodeLensResolveRequest.type,((t,n)=>e(t,n))),onDocumentFormatting:e=>a.onRequest(r.DocumentFormattingRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onDocumentRangeFormatting:e=>a.onRequest(r.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onDocumentOnTypeFormatting:e=>a.onRequest(r.DocumentOnTypeFormattingRequest.type,((t,n)=>e(t,n))),onRenameRequest:e=>a.onRequest(r.RenameRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),onPrepareRename:e=>a.onRequest(r.PrepareRenameRequest.type,((t,n)=>e(t,n))),onDocumentLinks:e=>a.onRequest(r.DocumentLinkRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onDocumentLinkResolve:e=>a.onRequest(r.DocumentLinkResolveRequest.type,((t,n)=>e(t,n))),onDocumentColor:e=>a.onRequest(r.DocumentColorRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onColorPresentation:e=>a.onRequest(r.ColorPresentationRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onFoldingRanges:e=>a.onRequest(r.FoldingRangeRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onSelectionRanges:e=>a.onRequest(r.SelectionRangeRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),s.attachPartialResult(a,t)))),onExecuteCommand:e=>a.onRequest(r.ExecuteCommandRequest.type,((t,n)=>e(t,n,s.attachWorkDone(a,t),void 0))),dispose:()=>a.dispose()};for(let e of p)e.attach(x);return a.onRequest(r.InitializeRequest.type,(e=>{t.initialize(e),i.string(e.trace)&&(c.trace=r.Trace.fromString(e.trace));for(let t of p)t.initialize(e.capabilities);if(v){let t=v(e,(new r.CancellationTokenSource).token,s.attachWorkDone(a,e),void 0);return(n=t,n instanceof Promise?n:i.thenable(n)?new Promise(((e,t)=>{n.then((t=>e(t)),(e=>t(e)))})):Promise.resolve(n)).then((e=>{if(e instanceof r.ResponseError)return e;let t=e;t||(t={capabilities:{}});let n=t.capabilities;n||(n={},t.capabilities=n),void 0===n.textDocumentSync||null===n.textDocumentSync?n.textDocumentSync=i.number(x.__textDocumentSync)?x.__textDocumentSync:r.TextDocumentSyncKind.None:i.number(n.textDocumentSync)||i.number(n.textDocumentSync.change)||(n.textDocumentSync.change=i.number(x.__textDocumentSync)?x.__textDocumentSync:r.TextDocumentSyncKind.None);for(let e of p)e.fillServerCapabilities(n);return t}))}{let e={capabilities:{textDocumentSync:r.TextDocumentSyncKind.None}};for(let t of p)t.fillServerCapabilities(e.capabilities);return e}var n})),a.onRequest(r.ShutdownRequest.type,(()=>(t.shutdownReceived=!0,m?m((new r.CancellationTokenSource).token):void 0))),a.onNotification(r.ExitNotification.type,(()=>{try{b&&b()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}})),a.onNotification(r.SetTraceNotification.type,(e=>{c.trace=r.Trace.fromString(e.value)})),x}},5421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowDocumentFeature=void 0;const r=n(152);t.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(r.ShowDocumentRequest.type,e)}}},289:(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return"function"==typeof e}function i(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.thenable=t.typedArray=t.stringArray=t.array=t.func=t.error=t.number=t.string=t.boolean=void 0,t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=r,t.array=i,t.stringArray=function(e){return i(e)&&e.every((e=>n(e)))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.thenable=function(e){return e&&r(e.then)}},7560:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateUuid=t.parse=t.isUUID=t.v4=t.empty=void 0;class n{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class r extends n{constructor(){super([r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),"-","4",r._randomHex(),r._randomHex(),r._randomHex(),"-",r._oneOf(r._timeHighBits),r._randomHex(),r._randomHex(),r._randomHex(),"-",r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex(),r._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return r._oneOf(r._chars)}}function i(){return new r}r._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],r._timeHighBits=["8","9","a","b"],t.empty=new n("00000000-0000-0000-0000-000000000000"),t.v4=i;const o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function s(e){return o.test(e)}t.isUUID=s,t.parse=function(e){if(!s(e))throw new Error("invalid uuid");return new n(e)},t.generateUuid=function(){return i().asHex()}},8634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceFoldersFeature=void 0;const r=n(152);t.WorkspaceFoldersFeature=e=>class extends e{initialize(e){let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new r.Emitter,this.connection.onNotification(r.DidChangeWorkspaceFoldersNotification.type,(e=>{this._onDidChangeWorkspaceFolders.fire(e.event)})))}getWorkspaceFolders(){return this.connection.sendRequest(r.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._unregistration||(this._unregistration=this.connection.client.register(r.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}}},585:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=n(4108),i=n(1378),o=n(4415),s=n(2365),a=["/properties"],c="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var l=n(4351);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var f=n(9186);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var h=n(5551);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var d=n(7642);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})},7293:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class n{}t._CodeOrName=n,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends n{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class i extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function o(e,...t){const n=[e[0]];let r=0;for(;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const r=n(7293),i=n(2117);var o=n(7293);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var s=n(2117);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const n=e?i.varKinds.var:this.varKind,r=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=O(this.rhs,e,t)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof r.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=O(this.rhs,e,t),this}get names(){return A(this.lhs instanceof r.Name?{}:{...this.lhs.names},this.rhs)}}class l extends u{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class f extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=O(this.code,e,t),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const i=n[r];i.optimizeNames(e,t)||($(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>R(e,t.names)),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends m{}class v extends g{}v.kind="else";class b extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}return t?!1===e?t instanceof b?t:t.nodes:this.nodes.length?this:new b(N(e),t instanceof b?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=O(this.condition,e,t),this}get names(){const e=super.names;return A(e,this.condition),this.else&&R(e,this.else.names),e}}b.kind="if";class w extends g{}w.kind="for";class _ extends w{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=O(this.iteration,e,t),this}get names(){return R(super.names,this.iteration.names)}}class S extends w{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?i.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=A(super.names,this.from);return A(e,this.to)}}class k extends w{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=O(this.iterable,e,t),this}get names(){return R(super.names,this.iterable.names)}}class x extends g{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}x.kind="func";class C extends m{render(e){return"return "+super.render(e)}}C.kind="return";class T extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&R(e,this.catch.names),this.finally&&R(e,this.finally.names),e}}class E extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}E.kind="catch";class P extends g{render(e){return"finally"+super.render(e)}}function R(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function A(e,t){return t instanceof r._CodeOrName?R(e,t.names):e}function O(e,t,n){return e instanceof r.Name?o(e):(i=e)instanceof r._Code&&i._items.some((e=>e instanceof r.Name&&1===t[e.str]&&void 0!==n[e.str]))?new r._Code(e._items.reduce(((e,t)=>(t instanceof r.Name&&(t=o(t)),t instanceof r._Code?e.push(...t._items):e.push(t),e)),[])):e;var i;function o(e){const r=n[e.str];return void 0===r||1!==t[e.str]?e:(delete t[e.str],r)}}function $(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function N(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:r._`!${M(e)}`}P.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const i=this._scope.toName(t);return void 0!==n&&r&&(this._constants[i.str]=n),this._leafNode(new c(e,i,n)),i}const(e,t,n){return this._def(i.varKinds.const,e,t,n)}let(e,t,n){return this._def(i.varKinds.let,e,t,n)}var(e,t,n){return this._def(i.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new u(e,t,n))}add(e,n){return this._leafNode(new l(e,t.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==r.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[n,i]of e)t.length>1&&t.push(","),t.push(n),(n!==i||this.opts.es5)&&(t.push(":"),(0,r.addCodeArg)(t,i));return t.push("}"),new r._Code(t)}if(e,t,n){if(this._blockNode(new b(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new b(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(b,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,n,r,o=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const s=this._scope.toName(e);return this._for(new S(o,s,t,n),(()=>r(s)))}forOf(e,t,n,o=i.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof r.Name?t:this.var("_arr",t);return this.forRange("_i",0,r._`${e}.length`,(t=>{this.var(s,r._`${e}[${t}]`),n(s)}))}return this._for(new k("of",o,s,t),(()=>n(s)))}forIn(e,t,n,o=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,r._`Object.keys(${t})`,n);const s=this._scope.toName(e);return this._for(new k("in",o,s,t),(()=>n(s)))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new f(e))}break(e){return this._leafNode(new h(e))}return(e){const t=new C;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new T;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new E(e),t(e)}return n&&(this._currNode=r.finally=new P,this.code(n)),this._endBlockNode(E,P)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=r.nil,n,i){return this._blockNode(new x(e,t,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(x)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=N;const j=D(t.operators.AND);t.and=function(...e){return e.reduce(j)};const I=D(t.operators.OR);function D(e){return(t,n)=>t===r.nil?n:n===r.nil?t:r._`${M(t)} ${e} ${M(n)}`}function M(e){return e instanceof r.Name?e:r._`(${e})`}t.or=function(...e){return e.reduce(I)}},2117:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const r=n(7293);class i extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof r.Name?e:this.name(e)}name(e){return new r.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends r.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=r._`.${new r.Name(t)}[${n}]`}}t.ValueScopeName=a;const c=r._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:r.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:i}=r,o=null!==(n=t.key)&&void 0!==n?n:t.ref;let s=this._values[i];if(s){const e=s.get(o);if(e)return e}else s=this._values[i]=new Map;s.set(o,r);const a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:i,itemIndex:c}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return r._`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(e,n,s={},a){let c=r.nil;for(const u in e){const l=e[u];if(!l)continue;const f=s[u]=s[u]||new Map;l.forEach((e=>{if(f.has(e))return;f.set(e,o.Started);let s=n(e);if(s){const n=this.opts.es5?t.varKinds.var:t.varKinds.const;c=r._`${c}${n} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new i(e);c=r._`${c}${s}${this.opts._n}`}f.set(e,o.Completed)}))}return c}}},7377:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const r=n(9186),i=n(1799),o=n(4224);function s(e,t){const n=e.const("err",t);e.if(r._`${o.default.vErrors} === null`,(()=>e.assign(o.default.vErrors,r._`[${n}]`)),r._`${o.default.vErrors}.push(${n})`),e.code(r._`${o.default.errors}++`)}function a(e,t){const{gen:n,validateName:i,schemaEnv:o}=e;o.$async?n.throw(r._`new ${e.ValidationError}(${t})`):(n.assign(r._`${i}.errors`,t),n.return(!1))}t.keywordError={message:({keyword:e})=>r.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?r.str`"${e}" keyword must be ${t} ($data)`:r.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,n=t.keywordError,i,o){const{it:c}=e,{gen:l,compositeRule:f,allErrors:h}=c,d=u(e,n,i);(null!=o?o:f||h)?s(l,d):a(c,r._`[${d}]`)},t.reportExtraError=function(e,n=t.keywordError,r){const{it:i}=e,{gen:c,compositeRule:l,allErrors:f}=i;s(c,u(e,n,r)),l||f||a(i,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(r._`${o.default.vErrors} !== null`,(()=>e.if(t,(()=>e.assign(r._`${o.default.vErrors}.length`,t)),(()=>e.assign(o.default.vErrors,null)))))},t.extendErrors=function({gen:e,keyword:t,schemaValue:n,data:i,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,o.default.errors,(s=>{e.const(c,r._`${o.default.vErrors}[${s}]`),e.if(r._`${c}.instancePath === undefined`,(()=>e.assign(r._`${c}.instancePath`,(0,r.strConcat)(o.default.instancePath,a.errorPath)))),e.assign(r._`${c}.schemaPath`,r.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(r._`${c}.schema`,n),e.assign(r._`${c}.data`,i))}))};const c={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function u(e,t,n){const{createErrors:i}=e.it;return!1===i?r._`{}`:function(e,t,n={}){const{gen:i,it:s}=e,a=[l(s,n),f(e,n)];return function(e,{params:t,message:n},i){const{keyword:s,data:a,schemaValue:u,it:l}=e,{opts:f,propertyName:h,topSchemaRef:d,schemaPath:p}=l;i.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||r._`{}`]),f.messages&&i.push([c.message,"function"==typeof n?n(e):n]),f.verbose&&i.push([c.schema,u],[c.parentSchema,r._`${d}${p}`],[o.default.data,a]),h&&i.push([c.propertyName,h])}(e,t,a),i.object(...a)}(e,t,n)}function l({errorPath:e},{instancePath:t}){const n=t?r.str`${e}${(0,i.getErrorPath)(t,i.Type.Str)}`:e;return[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,n)]}function f({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:o}){let s=o?t:r.str`${t}/${e}`;return n&&(s=r.str`${s}${(0,i.getErrorPath)(n,i.Type.Str)}`),[c.schemaPath,s]}},6258:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const r=n(9186),i=n(5551),o=n(4224),s=n(5571),a=n(1799),c=n(4351);class u{constructor(e){var t;let n;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==n?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==n?void 0:n.$async,this.refs={}}}function l(e){const t=h.call(this,e);if(t)return t;const n=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:u}=this.opts.code,{ownProperties:l}=this.opts,f=new r.CodeGen(this.scope,{es5:a,lines:u,ownProperties:l});let d;e.$async&&(d=f.scopeValue("Error",{ref:i.default,code:r._`require("ajv/dist/runtime/validation_error").default`}));const p=f.scopeName("validate");e.validateName=p;const m={gen:f,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,r.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:d,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:r.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:r._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),f.optimize(this.opts.code.optimize);const t=f.toString();g=`${f.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const n=new Function(`${o.default.self}`,`${o.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{ref:n}),n.errors=null,n.schema=e.schema,n.schemaEnv=e,e.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:p,validateCode:t,scopeValues:f._values}),this.opts.unevaluated){const{props:e,items:t}=m;n.evaluated={props:e instanceof r.Name?void 0:e,items:t instanceof r.Name?void 0:t,dynamicProps:e instanceof r.Name,dynamicItems:t instanceof r.Name},n.source&&(n.source.evaluated=(0,r.stringify)(n.evaluated))}return e.validate=n,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function f(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function h(e){for(const r of this._compilations)if(n=e,(t=r).schema===n.schema&&t.root===n.root&&t.baseId===n.baseId)return r;var t,n}function d(e,t){let n;for(;"string"==typeof(n=this.refs[t]);)t=n;return n||this.schemas[t]||p.call(this,e,t)}function p(e,t){const n=this.opts.uriResolver.parse(t),r=(0,s._getFullPath)(this.opts.uriResolver,n);let i=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===i)return g.call(this,n,e);const o=(0,s.normalizeId)(r),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=p.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,n,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||l.call(this,a),o===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:n}=this.opts,r=t[n];return r&&(i=(0,s.resolveUrl)(this.opts.uriResolver,i,r)),new u({schema:t,schemaId:n,root:e,baseId:i})}return g.call(this,n,a)}}t.SchemaEnv=u,t.compileSchema=l,t.resolveRef=function(e,t,n){var r;n=(0,s.resolveUrl)(this.opts.uriResolver,t,n);const i=e.refs[n];if(i)return i;let o=d.call(this,e,n);if(void 0===o){const i=null===(r=e.localRefs)||void 0===r?void 0:r[n],{schemaId:s}=this.opts;i&&(o=new u({schema:i,schemaId:s,root:e,baseId:t}))}return void 0!==o?e.refs[n]=f.call(this,o):void 0},t.getCompilingSchema=h,t.resolveSchema=p;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:n,root:r}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const r of e.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const e=n[(0,a.unescapeFragment)(r)];if(void 0===e)return;const i="object"==typeof(n=e)&&n[this.opts.schemaId];!m.has(r)&&i&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof n&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=p.call(this,r,e)}const{schemaId:c}=this.opts;return o=o||new u({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema?o:void 0}},4224:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};t.default=i},7642:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5571);class i extends Error{constructor(e,t,n,i){super(i||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,r.resolveUrl)(e,t,n),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(e,this.missingRef))}}t.default=i},5571:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const r=n(1799),i=n(4063),o=n(8304),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&u(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(c))return!0;if("object"==typeof n&&c(n))return!0}return!1}function u(e){let t=0;for(const n in e){if("$ref"===n)return 1/0;if(t++,!s.has(n)&&("object"==typeof e[n]&&(0,r.eachItem)(e[n],(e=>t+=u(e))),t===1/0))return 1/0}return t}function l(e,t="",n){!1!==n&&(t=d(t));const r=e.parse(t);return f(e,r)}function f(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=l,t._getFullPath=f;const h=/#\/?$/;function d(e){return e?e.replace(h,""):""}t.normalizeId=d,t.resolveUrl=function(e,t,n){return n=d(n),e.resolve(t,n)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:r}=this.opts,s=d(e[n]||t),a={"":s},c=l(r,s,!1),u={},f=new Set;return o(e,{allKeys:!0},((e,t,r,i)=>{if(void 0===i)return;const o=c+t;let s=a[i];function l(t){const n=this.opts.uriResolver.resolve;if(t=d(s?n(s,t):t),f.has(t))throw m(t);f.add(t);let r=this.refs[t];return"string"==typeof r&&(r=this.refs[r]),"object"==typeof r?h(e,r.schema,t):t!==d(o)&&("#"===t[0]?(h(e,u[t],t),u[t]=e):this.refs[t]=o),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}"string"==typeof e[n]&&(s=l.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=s})),u;function h(e,t,n){if(void 0!==t&&!i(e,t))throw m(n)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},6865:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const n=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&n.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},1799:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const r=n(9186),i=n(7293);function o(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const i=r.RULES.keywords;for(const n in t)i[n]||p(e,`unknown keyword: "${n}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function u({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:i}){return(o,s,a,c)=>{const u=void 0===a?s:a instanceof r.Name?(s instanceof r.Name?e(o,s,a):t(o,s,a),a):s instanceof r.Name?(t(o,a,s),s):n(s,a);return c!==r.Name||u instanceof r.Name?u:i(o,u)}}function l(e,t){if(!0===t)return e.var("props",!0);const n=e.var("props",r._`{}`);return void 0!==t&&f(e,n,t),n}function f(e,t,n){Object.keys(n).forEach((n=>e.assign(r._`${t}${(0,r.getProperty)(n)}`,!0)))}t.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},n,i,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return r._`${n}`}return r._`${e}${t}${(0,r.getProperty)(i)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},t.mergeEvaluated={props:u({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>{e.if(r._`${t} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,r._`${n} || {}`).code(r._`Object.assign(${n}, ${t})`)))})),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>{!0===t?e.assign(n,!0):(e.assign(n,r._`${n} || {}`),f(e,n,t))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:l}),items:u({mergeNames:(e,t,n)=>e.if(r._`${n} !== true && ${t} !== undefined`,(()=>e.assign(n,r._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`))),mergeToName:(e,t,n)=>e.if(r._`${n} !== true`,(()=>e.assign(n,!0===t||r._`${n} > ${t} ? ${n} : ${t}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=l,t.setEvaluated=f;const h={};var d;function p(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new i._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=t.Type||(t.Type={})),t.getErrorPath=function(e,t,n){if(e instanceof r.Name){const i=t===d.Num;return n?i?r._`"[" + ${e} + "]"`:r._`"['" + ${e} + "']"`:i?r._`"/" + ${e}`:r._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,r.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=p},2528:(e,t)=>{"use strict";function n(e,t){return t.rules.some((t=>r(e,t)))}function r(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},r){const i=t.RULES.types[r];return i&&!0!==i&&n(e,i)},t.shouldUseGroup=n,t.shouldUseRule=r},8590:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const r=n(7377),i=n(9186),o=n(4224),s={message:"boolean schema is false"};function a(e,t){const{gen:n,data:i}=e,o={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,r.reportError)(o,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:n,validateName:r}=e;!1===n?a(e,!1):"object"==typeof n&&!0===n.$async?t.return(o.default.data):(t.assign(i._`${r}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),a(e)):n.var(t,!0)}},9653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const r=n(6865),i=n(2528),o=n(7377),s=n(9186),a=n(1799);var c;function u(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(r.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(c=t.DataType||(t.DataType={})),t.getSchemaTypes=function(e){const t=u(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=u,t.coerceAndCheckDataType=function(e,t){const{gen:n,data:r,opts:o}=e,a=function(e,t){return t?e.filter((e=>l.has(e)||"array"===t&&"array"===e)):[]}(t,o.coerceTypes),u=t.length>0&&!(0===a.length&&1===t.length&&(0,i.schemaHasRulesForType)(e,t[0]));if(u){const i=h(t,r,o.strictNumbers,c.Wrong);n.if(i,(()=>{a.length?function(e,t,n){const{gen:r,data:i,opts:o}=e,a=r.let("dataType",s._`typeof ${i}`),c=r.let("coerced",s._`undefined`);"array"===o.coerceTypes&&r.if(s._`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,(()=>r.assign(i,s._`${i}[0]`).assign(a,s._`typeof ${i}`).if(h(t,i,o.strictNumbers),(()=>r.assign(c,i))))),r.if(s._`${c} !== undefined`);for(const e of n)(l.has(e)||"array"===e&&"array"===o.coerceTypes)&&u(e);function u(e){switch(e){case"string":return void r.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(c,s._`"" + ${i}`).elseIf(s._`${i} === null`).assign(c,s._`""`);case"number":return void r.elseIf(s._`${a} == "boolean" || ${i} === null || (${a} == "string" && ${i} && ${i} == +${i})`).assign(c,s._`+${i}`);case"integer":return void r.elseIf(s._`${a} === "boolean" || ${i} === null || (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,s._`+${i}`);case"boolean":return void r.elseIf(s._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf(s._`${i} === "true" || ${i} === 1`).assign(c,!0);case"null":return r.elseIf(s._`${i} === "" || ${i} === 0 || ${i} === false`),void r.assign(c,null);case"array":r.elseIf(s._`${a} === "string" || ${a} === "number" || ${a} === "boolean" || ${i} === null`).assign(c,s._`[${i}]`)}}r.else(),p(e),r.endIf(),r.if(s._`${c} !== undefined`,(()=>{r.assign(i,c),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${n}]`,r)))}(e,c)}))}(e,t,a):p(e)}))}return u};const l=new Set(["string","number","integer","boolean","null"]);function f(e,t,n,r=c.Correct){const i=r===c.Correct?s.operators.EQ:s.operators.NEQ;let o;switch(e){case"null":return s._`${t} ${i} null`;case"array":o=s._`Array.isArray(${t})`;break;case"object":o=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return s._`typeof ${t} ${i} ${e}`}return r===c.Correct?o:(0,s.not)(o);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,n?s._`isFinite(${t})`:s.nil)}}function h(e,t,n,r){if(1===e.length)return f(e[0],t,n,r);let i;const o=(0,a.toHash)(e);if(o.array&&o.object){const e=s._`typeof ${t} != "object"`;i=o.null?e:s._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=s.nil;o.number&&delete o.integer;for(const e in o)i=(0,s.and)(i,f(e,t,n,r));return i}t.checkDataType=f,t.checkDataTypes=h;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}(e);(0,o.reportError)(t,d)}t.reportTypeError=p},9217:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(9186),i=n(1799);function o(e,t,n){const{gen:o,compositeRule:s,data:a,opts:c}=e;if(void 0===n)return;const u=r._`${a}${(0,r.getProperty)(t)}`;if(s)return void(0,i.checkStrictMode)(e,`default is ignored for: ${u}`);let l=r._`${u} === undefined`;"empty"===c.useDefaults&&(l=r._`${l} || ${u} === null || ${u} === ""`),o.if(l,r._`${u} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)o(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>o(e,n,t.default)))}},4351:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(8590),i=n(9653),o=n(2528),s=n(9653),a=n(9217),c=n(3092),u=n(3237),l=n(9186),f=n(4224),h=n(5571),d=n(1799),p=n(7377);function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},o){i.code.es5?e.func(t,l._`${f.default.data}, ${f.default.valCxt}`,r.$async,(()=>{e.code(l._`"use strict"; ${g(n,i)}`),function(e,t){e.if(f.default.valCxt,(()=>{e.var(f.default.instancePath,l._`${f.default.valCxt}.${f.default.instancePath}`),e.var(f.default.parentData,l._`${f.default.valCxt}.${f.default.parentData}`),e.var(f.default.parentDataProperty,l._`${f.default.valCxt}.${f.default.parentDataProperty}`),e.var(f.default.rootData,l._`${f.default.valCxt}.${f.default.rootData}`),t.dynamicRef&&e.var(f.default.dynamicAnchors,l._`${f.default.valCxt}.${f.default.dynamicAnchors}`)}),(()=>{e.var(f.default.instancePath,l._`""`),e.var(f.default.parentData,l._`undefined`),e.var(f.default.parentDataProperty,l._`undefined`),e.var(f.default.rootData,f.default.data),t.dynamicRef&&e.var(f.default.dynamicAnchors,l._`{}`)}))}(e,i),e.code(o)})):e.func(t,l._`${f.default.data}, ${function(e){return l._`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${e.dynamicRef?l._`, ${f.default.dynamicAnchors}={}`:l.nil}}={}`}(i)}`,r.$async,(()=>e.code(g(n,i)).code(o)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?l._`/*# sourceURL=${n} */`:l.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function b(e){(0,d.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function w(e,t){if(e.opts.jtd)return S(e,[],!1,t);const n=(0,i.getSchemaTypes)(e.schema);S(e,n,!(0,i.coerceAndCheckDataType)(e,n),t)}function _({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){const o=n.$comment;if(!0===i.$comment)e.code(l._`${f.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const n=l.str`${r}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(l._`${f.default.self}.opts.$comment(${o}, ${n}, ${i}.schema)`)}}function S(e,t,n,r){const{gen:i,schema:a,data:c,allErrors:u,opts:h,self:p}=e,{RULES:m}=p;function g(d){(0,o.shouldUseGroup)(a,d)&&(d.type?(i.if((0,s.checkDataType)(d.type,c,h.strictNumbers)),k(e,d),1===t.length&&t[0]===d.type&&n&&(i.else(),(0,s.reportTypeError)(e)),i.endIf()):k(e,d),u||i.if(l._`${f.default.errors} === ${r||0}`))}!a.$ref||!h.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(a,m)?(h.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{x(e.dataTypes,t)||C(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const n=[];for(const r of e.dataTypes)x(t,r)?n.push(r):t.includes("integer")&&"number"===r&&n.push("integer");e.dataTypes=n}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&C(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const r in n){const i=n[r];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){const{type:n}=i.definition;n.length&&!n.some((e=>{return r=e,(n=t).includes(r)||"number"===r&&n.includes("integer");var n,r}))&&C(e,`missing type "${n.join(",")}" for keyword "${r}"`)}}}(e,e.dataTypes))}(e,t),i.block((()=>{for(const e of m.rules)g(e);g(m.post)}))):i.block((()=>E(e,"$ref",m.all.$ref.definition)))}function k(e,t){const{gen:n,schema:r,opts:{useDefaults:i}}=e;i&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,o.shouldUseRule)(r,n)&&E(e,n.keyword,n.definition,t.type)}))}function x(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function C(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){v(e)&&(b(e),y(e))?function(e){const{schema:t,opts:n,gen:r}=e;m(e,(()=>{n.$comment&&t.$comment&&_(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(f.default.vErrors,null),r.let(f.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",l._`${n}.evaluated`),t.if(l._`${e.evaluated}.dynamicProps`,(()=>t.assign(l._`${e.evaluated}.props`,l._`undefined`))),t.if(l._`${e.evaluated}.dynamicItems`,(()=>t.assign(l._`${e.evaluated}.items`,l._`undefined`)))}(e),w(e),function(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:o}=e;n.$async?t.if(l._`${f.default.errors} === 0`,(()=>t.return(f.default.data)),(()=>t.throw(l._`new ${i}(${f.default.vErrors})`))):(t.assign(l._`${r}.errors`,f.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:n,items:r}){n instanceof l.Name&&e.assign(l._`${t}.props`,n),r instanceof l.Name&&e.assign(l._`${t}.items`,r)}(e),t.return(l._`${f.default.errors} === 0`))}(e)}))}(e):m(e,(()=>(0,r.topBoolOrEmptySchema)(e)))};class T{constructor(e,t,n){if((0,c.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",A(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",f.default.errors))}result(e,t,n){this.failResult((0,l.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(l._`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=l.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=l.nil,t=l.nil){if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:i,def:o}=this;n.if((0,l.or)(l._`${r} === undefined`,t)),e!==l.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:r,it:i}=this;return(0,l.or)(function(){if(n.length){if(!(t instanceof l.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return l._`${(0,s.checkDataTypes)(e,t,i.opts.strictNumbers,s.DataType.Wrong)}`}return l.nil}(),function(){if(r.validateSchema){const n=e.scopeValue("validate$data",{ref:r.validateSchema});return l._`!${n}(${t})`}return l.nil}())}subschema(e,t){const n=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(n,this.it,e),(0,u.extendSubschemaMode)(n,e);const i={...this.it,...n,items:void 0,props:void 0};return function(e,t){v(e)&&(b(e),y(e))?function(e,t){const{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&_(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,h.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=r.const("_errs",f.default.errors);w(e,o),r.var(t,l._`${o} === ${f.default.errors}`)}(e,t):(0,r.boolOrEmptySchema)(e,t)}(i,t),i}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,(()=>this.mergeEvaluated(e,l.Name))),!0}}function E(e,t,n,r){const i=new T(e,n,t);"code"in n?n.code(i,r):i.$data&&n.validate?(0,c.funcKeywordCode)(i,n):"macro"in n?(0,c.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,c.funcKeywordCode)(i,n)}t.KeywordCxt=T;const P=/^\/(?:[^~]|~0|~1)*$/,R=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function A(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,o;if(""===e)return f.default.rootData;if("/"===e[0]){if(!P.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=f.default.rootData}else{const s=R.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(i=s[2],"#"===i){if(a>=t)throw new Error(c("property/index",a));return r[t-a]}if(a>t)throw new Error(c("data",a));if(o=n[t-a],!i)return o}let s=o;const a=i.split("/");for(const e of a)e&&(o=l._`${o}${(0,l.getProperty)((0,d.unescapeJsonPointer)(e))}`,s=l._`${s} && ${o}`);return s;function c(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=A},3092:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const r=n(9186),i=n(4224),o=n(1239),s=n(7377);function a(e){const{gen:t,data:n,it:i}=e;t.if(i.parentData,(()=>t.assign(n,r._`${i.parentData}[${i.parentDataProperty}]`)))}function c(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,r.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:i,schema:o,parentSchema:s,it:a}=e,u=t.macro.call(a.self,o,s,a),l=c(n,i,u);!1!==a.opts.validateSchema&&a.self.validateSchema(u,!0);const f=n.name("valid");e.subschema({schema:u,schemaPath:r.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},f),e.pass(f,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:u,keyword:l,schema:f,parentSchema:h,$data:d,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const m=!d&&t.compile?t.compile.call(p.self,f,h,p):t.validate,g=c(u,l,m),y=u.let("valid");function v(n=(t.async?r._`await `:r.nil)){const s=p.opts.passContext?i.default.this:i.default.self,a=!("compile"in t&&!d||!1===t.schema);u.assign(y,r._`${n}${(0,o.callValidateCode)(e,g,s,a)}`,t.modifying)}function b(e){var n;u.if((0,r.not)(null!==(n=t.valid)&&void 0!==n?n:y),e)}e.block$data(y,(function(){if(!1===t.errors)v(),t.modifying&&a(e),b((()=>e.error()));else{const n=t.async?function(){const e=u.let("ruleErrs",null);return u.try((()=>v(r._`await `)),(t=>u.assign(y,!1).if(r._`${t} instanceof ${p.ValidationError}`,(()=>u.assign(e,r._`${t}.errors`)),(()=>u.throw(t))))),e}():function(){const e=r._`${g}.errors`;return u.assign(e,null),v(r.nil),e}();t.modifying&&a(e),b((()=>function(e,t){const{gen:n}=e;n.if(r._`Array.isArray(${t})`,(()=>{n.assign(i.default.vErrors,r._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`).assign(i.default.errors,r._`${i.default.vErrors}.length`),(0,s.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:y)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:r},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const s=i.dependencies;if(null==s?void 0:s.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},3237:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const r=n(9186),i=n(1799);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:o,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const o=e.schema[t];return void 0===n?{schema:o,schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[n],schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}${(0,r.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,i.escapeFragment)(n)}`}}if(void 0!==o){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:o,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=t;if(void 0!==n){const{errorPath:s,dataPathArr:a,opts:c}=t;l(u.let("data",r._`${t.data}${(0,r.getProperty)(n)}`,!0)),e.errorPath=r.str`${s}${(0,i.getErrorPath)(n,o,c.jsPropertySyntax)}`,e.parentDataProperty=r._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}function l(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}void 0!==s&&(l(s instanceof r.Name?s:u.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:o}){void 0!==r&&(e.compositeRule=r),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=n}},4108:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=n(4351);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var i=n(9186);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});const o=n(5551),s=n(7642),a=n(6865),c=n(6258),u=n(9186),l=n(5571),f=n(9653),h=n(1799),d=n(3164),p=n(6327),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},w=200;function _(e){var t,n,r,i,o,s,a,c,u,l,f,h,d,g,y,v,b,_,S,k,x,C,T,E,P;const R=e.strict,A=null===(t=e.code)||void 0===t?void 0:t.optimize,O=!0===A||void 0===A?1:A||0,$=null!==(r=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==r?r:m,N=null!==(i=e.uriResolver)&&void 0!==i?i:p.default;return{strictSchema:null===(s=null!==(o=e.strictSchema)&&void 0!==o?o:R)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:R)||void 0===c||c,strictTypes:null!==(l=null!==(u=e.strictTypes)&&void 0!==u?u:R)&&void 0!==l?l:"log",strictTuples:null!==(h=null!==(f=e.strictTuples)&&void 0!==f?f:R)&&void 0!==h?h:"log",strictRequired:null!==(g=null!==(d=e.strictRequired)&&void 0!==d?d:R)&&void 0!==g&&g,code:e.code?{...e.code,optimize:O,regExp:$}:{optimize:O,regExp:$},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:w,loopEnum:null!==(v=e.loopEnum)&&void 0!==v?v:w,meta:null===(b=e.meta)||void 0===b||b,messages:null===(_=e.messages)||void 0===_||_,inlineRefs:null===(S=e.inlineRefs)||void 0===S||S,schemaId:null!==(k=e.schemaId)&&void 0!==k?k:"$id",addUsedSchema:null===(x=e.addUsedSchema)||void 0===x||x,validateSchema:null===(C=e.validateSchema)||void 0===C||C,validateFormats:null===(T=e.validateFormats)||void 0===T||T,unicodeRegExp:null===(E=e.unicodeRegExp)||void 0===E||E,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:N}}class S{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,..._(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:y,es5:t,lines:n}),this.logger=function(e){if(!1===e)return R;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),k.call(this,v,e,"NOT SUPPORTED"),k.call(this,b,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&E.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),C.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=d;"id"===n&&(r={...d},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const n=await u.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,r);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=x.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new c.SchemaEnv({schema:{},schemaId:n});if(t=c.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=x.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(O.call(this,n,t),!t)return(0,h.eachItem)(n,(e=>$.call(this,e))),this;j.call(this,t);const r={...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(n,0===r.type.length?e=>$.call(this,e,r):e=>r.type.forEach((t=>$.call(this,e,r,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,o=i[e];r&&o&&(i[e]=D(o))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,l.normalizeId)(o||n);const u=l.getSchemaRefs.call(this,e,n);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:u}),this._cache.set(a.schema,a),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),r&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function k(e,t,n,r="error"){for(const i in e){const o=i;o in t&&this.logger[r](`${n}: option ${i}. ${e[o]}`)}}function x(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function C(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function T(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function E(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function P(){const e={...this.opts};for(const t of g)delete e[t];return e}t.default=S,S.ValidationError=o.default,S.MissingRefError=s.default;const R={log(){},warn(){},error(){}},A=/^[a-z_$][a-z0-9_$:-]*$/i;function O(e,t){const{RULES:n}=this;if((0,h.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!A.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function $(e,t,n){var r;const i=null==t?void 0:t.post;if(n&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let s=i?o.post:o.rules.find((({type:e})=>e===n));if(s||(s={type:n,rules:[]},o.rules.push(s)),o.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)}};t.before?N.call(this,s,a,t.before):s.rules.push(a),o.all[e]=a,null===(r=t.implements)||void 0===r||r.forEach((e=>this.addKeyword(e)))}function N(e,t,n){const r=e.rules.findIndex((e=>e.keyword===n));r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function j(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=D(t)),e.validateSchema=this.compile(t,!0))}const I={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function D(e){return{anyOf:[e,I]}}},2377:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4063);r.code='require("ajv/dist/runtime/equal").default',t.default=r},8991:(e,t)=>{"use strict";function n(e){const t=e.length;let n,r=0,i=0;for(;i=55296&&n<=56319&&i{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(540);r.code='require("ajv/dist/runtime/uri").default',t.default=r},5551:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},7979:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const r=n(9186),i=n(1799),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?s(e,r):(0,i.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:n,schema:o,data:s,keyword:a,it:c}=e;c.items=!0;const u=n.const("len",r._`${s}.length`);if(!1===o)e.setParams({len:t.length}),e.pass(r._`${u} <= ${t.length}`);else if("object"==typeof o&&!(0,i.alwaysValidSchema)(c,o)){const o=n.var("valid",r._`${u} <= ${t.length}`);n.if((0,r.not)(o),(()=>function(o){n.forRange("i",t.length,u,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:i.Type.Num},o),c.allErrors||n.if((0,r.not)(o),(()=>n.break()))}))}(o))),e.ok(o)}}t.validateAdditionalItems=s,t.default=o},3353:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1239),i=n(9186),o=n(4224),s=n(1799),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>i._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:c,errsCount:u,it:l}=e;if(!u)throw new Error("ajv implementation error");const{allErrors:f,opts:h}=l;if(l.props=!0,"all"!==h.removeAdditional&&(0,s.alwaysValidSchema)(l,n))return;const d=(0,r.allSchemaProperties)(a.properties),p=(0,r.allSchemaProperties)(a.patternProperties);function m(e){t.code(i._`delete ${c}[${e}]`)}function g(r){if("all"===h.removeAdditional||h.removeAdditional&&!1===n)m(r);else{if(!1===n)return e.setParams({additionalProperty:r}),e.error(),void(f||t.break());if("object"==typeof n&&!(0,s.alwaysValidSchema)(l,n)){const n=t.name("valid");"failing"===h.removeAdditional?(y(r,n,!1),t.if((0,i.not)(n),(()=>{e.reset(),m(r)}))):(y(r,n),f||t.if((0,i.not)(n),(()=>t.break())))}}}function y(t,n,r){const i={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===r&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,n)}t.forIn("key",c,(n=>{d.length||p.length?t.if(function(n){let o;if(d.length>8){const e=(0,s.schemaRefOrVal)(l,a.properties,"properties");o=(0,r.isOwnProperty)(t,e,n)}else o=d.length?(0,i.or)(...d.map((e=>i._`${n} === ${e}`))):i.nil;return p.length&&(o=(0,i.or)(o,...p.map((t=>i._`${(0,r.usePattern)(e,t)}.test(${n})`)))),(0,i.not)(o)}(n),(()=>g(n))):g(n)})),e.ok(i._`${u} === ${o.default.errors}`)}};t.default=a},6092:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1799),i={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach(((t,n)=>{if((0,r.alwaysValidSchema)(i,t))return;const s=e.subschema({keyword:"allOf",schemaProp:n},o);e.ok(o),e.mergeEvaluated(s)}))}};t.default=i},9546:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(1239).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r},774:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=n(1799),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?r.str`must contain at least ${e} valid item(s)`:r.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?r._`{minContains: ${e}}`:r._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:o,data:s,it:a}=e;let c,u;const{minContains:l,maxContains:f}=o;a.opts.next?(c=void 0===l?1:l,u=f):c=1;const h=t.const("len",r._`${s}.length`);if(e.setParams({min:c,max:u}),void 0===u&&0===c)return void(0,i.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==u&&c>u)return(0,i.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,i.alwaysValidSchema)(a,n)){let t=r._`${h} >= ${c}`;return void 0!==u&&(t=r._`${t} && ${h} <= ${u}`),void e.pass(t)}a.items=!0;const d=t.name("valid");function p(){const e=t.name("_valid"),n=t.let("count",0);m(e,(()=>t.if(e,(()=>function(e){t.code(r._`${e}++`),void 0===u?t.if(r._`${e} >= ${c}`,(()=>t.assign(d,!0).break())):(t.if(r._`${e} > ${u}`,(()=>t.assign(d,!1).break())),1===c?t.assign(d,!0):t.if(r._`${e} >= ${c}`,(()=>t.assign(d,!0))))}(n)))))}function m(n,r){t.forRange("i",0,h,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:i.Type.Num,compositeRule:!0},n),r()}))}void 0===u&&1===c?m(d,(()=>t.if(d,(()=>t.break())))):0===c?(t.let(d,!0),void 0!==u&&t.if(r._`${s}.length > 0`,p)):(t.let(d,!1),p()),e.result(d,(()=>e.reset()))}};t.default=o},1109:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const r=n(9186),i=n(1799),o=n(1239);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const i=1===t?"property":"properties";return r.str`must have ${i} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:i}})=>r._`{property: ${e}, missingProperty: ${i}, depsCount: ${t}, deps: ${n}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);a(e,t),c(e,n)}};function a(e,t=e.schema){const{gen:n,data:i,it:s}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const c in t){const u=t[c];if(0===u.length)continue;const l=(0,o.propertyInData)(n,i,c,s.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),s.allErrors?n.if(l,(()=>{for(const t of u)(0,o.checkReportMissingProp)(e,t)})):(n.if(r._`${l} && (${(0,o.checkMissingProp)(e,u,a)})`),(0,o.reportMissingProp)(e,a),n.else())}}function c(e,t=e.schema){const{gen:n,data:r,keyword:s,it:a}=e,c=n.name("valid");for(const u in t)(0,i.alwaysValidSchema)(a,t[u])||(n.if((0,o.propertyInData)(n,r,u,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:s,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>n.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},4489:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=n(1799),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const a=s(o,"then"),c=s(o,"else");if(!a&&!c)return;const u=t.let("valid",!0),l=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(t)}(),e.reset(),a&&c){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(l,f("then",n),f("else",n))}else a?t.if(l,f("then")):t.if((0,r.not)(l),f("else"));function f(n,i){return()=>{const o=e.subschema({keyword:n},l);t.assign(u,l),e.mergeValidEvaluated(o,u),i?t.assign(i,r._`${n}`):e.setParams({ifClause:n})}}e.pass(u,(()=>e.error(!0)))}};function s(e,t){const n=e.schema[t];return void 0!==n&&!(0,i.alwaysValidSchema)(e,n)}t.default=o},9386:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7979),i=n(9444),o=n(6204),s=n(9478),a=n(774),c=n(1109),u=n(3242),l=n(3353),f=n(5531),h=n(7645),d=n(8510),p=n(9546),m=n(3992),g=n(6092),y=n(4489),v=n(5868);t.default=function(e=!1){const t=[d.default,p.default,m.default,g.default,y.default,v.default,u.default,l.default,c.default,f.default,h.default];return e?t.push(i.default,s.default):t.push(r.default,o.default),t.push(a.default),t}},6204:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(9186),i=n(1799),o=n(1239),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,i.alwaysValidSchema)(n,t)||e.ok((0,o.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:o,parentSchema:s,data:a,keyword:c,it:u}=e;!function(e){const{opts:r,errSchemaPath:o}=u,s=n.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(r.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(u,e,r.strictTuples)}}(s),u.opts.unevaluated&&n.length&&!0!==u.items&&(u.items=i.mergeEvaluated.items(o,n.length,u.items));const l=o.name("valid"),f=o.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,i.alwaysValidSchema)(u,t)||(o.if(r._`${f} > ${n}`,(()=>e.subschema({keyword:c,schemaProp:n,dataProp:n},l))),e.ok(l))}))}t.validateTuple=a,t.default=s},9478:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=n(1799),o=n(1239),s=n(7979),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,(0,i.alwaysValidSchema)(r,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,o.validateArray)(e)))}};t.default=a},8510:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1799),i={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:i}=e;if((0,r.alwaysValidSchema)(i,n))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=i},3992:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=n(1799),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:o,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&o.discriminator)return;const a=n,c=t.let("valid",!1),u=t.let("passing",null),l=t.name("_valid");e.setParams({passing:u}),t.block((function(){a.forEach(((n,o)=>{let a;(0,i.alwaysValidSchema)(s,n)?t.var(l,!0):a=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},l),o>0&&t.if(r._`${l} && ${c}`).assign(c,!1).assign(u,r._`[${u}, ${o}]`).else(),t.if(l,(()=>{t.assign(c,!0),t.assign(u,o),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=o},7645:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1239),i=n(9186),o=n(1799),s=n(1799),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:c,it:u}=e,{opts:l}=u,f=(0,r.allSchemaProperties)(n),h=f.filter((e=>(0,o.alwaysValidSchema)(u,n[e])));if(0===f.length||h.length===f.length&&(!u.opts.unevaluated||!0===u.props))return;const d=l.strictSchema&&!l.allowMatchingProperties&&c.properties,p=t.name("valid");!0===u.props||u.props instanceof i.Name||(u.props=(0,s.evaluatedPropsToName)(t,u.props));const{props:m}=u;function g(e){for(const t in d)new RegExp(e).test(t)&&(0,o.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(n){t.forIn("key",a,(o=>{t.if(i._`${(0,r.usePattern)(e,n)}.test(${o})`,(()=>{const r=h.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:o,dataPropType:s.Type.Str},p),u.opts.unevaluated&&!0!==m?t.assign(i._`${m}[${o}]`,!0):r||u.allErrors||t.if((0,i.not)(p),(()=>t.break()))}))}))}!function(){for(const e of f)d&&g(e),u.allErrors?y(e):(t.var(p,!0),y(e),t.if(p))}()}};t.default=a},9444:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6204),i={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=i},5531:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4351),i=n(1239),o=n(1799),s=n(3353),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:c,it:u}=e;"all"===u.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new r.KeywordCxt(u,s.default,"additionalProperties"));const l=(0,i.allSchemaProperties)(n);for(const e of l)u.definedProperties.add(e);u.opts.unevaluated&&l.length&&!0!==u.props&&(u.props=o.mergeEvaluated.props(t,(0,o.toHash)(l),u.props));const f=l.filter((e=>!(0,o.alwaysValidSchema)(u,n[e])));if(0===f.length)return;const h=t.name("valid");for(const n of f)d(n)?p(n):(t.if((0,i.propertyInData)(t,c,n,u.opts.ownProperties)),p(n),u.allErrors||t.else().var(h,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(h);function d(e){return u.opts.useDefaults&&!u.compositeRule&&void 0!==n[e].default}function p(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},h)}}};t.default=a},3242:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=n(1799),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>r._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:o,it:s}=e;if((0,i.alwaysValidSchema)(s,n))return;const a=t.name("valid");t.forIn("key",o,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,r.not)(a),(()=>{e.error(!0),s.allErrors||t.break()}))})),e.ok(a)}};t.default=o},5868:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1799),i={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,r.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=i},1239:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=n(9186),i=n(1799),o=n(4224),s=n(1799);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}function c(e,t,n){return r._`${a(e)}.call(${t}, ${n})`}function u(e,t,n,i){const o=r._`${t}${(0,r.getProperty)(n)} === undefined`;return i?(0,r.or)(o,(0,r.not)(c(e,t,n))):o}function l(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:i,it:o}=e;n.if(u(n,i,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},i,o){return(0,r.or)(...i.map((i=>(0,r.and)(u(e,t,i,n.ownProperties),r._`${o} = ${i}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,n,i){const o=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return i?r._`${o} && ${c(e,t,n)}`:o},t.noPropertyInData=u,t.allSchemaProperties=l,t.schemaProperties=function(e,t){return l(t).filter((n=>!(0,i.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:i,schemaPath:s,errorPath:a},it:c},u,l,f){const h=f?r._`${e}, ${t}, ${i}${s}`:t,d=[[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,a)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&d.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const p=r._`${h}, ${n.object(...d)}`;return l!==r.nil?r._`${u}.call(${l}, ${p})`:r._`${u}(${p})`};const f=r._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},n){const i=t.unicodeRegExp?"u":"",{regExp:o}=t.code,a=o(n,i);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:r._`${"new RegExp"===o.code?f:(0,s.useFunc)(e,o)}(${n}, ${i})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:o,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(s){const c=t.const("len",r._`${n}.length`);t.forRange("i",0,c,(n=>{e.subschema({keyword:o,dataProp:n,dataPropType:i.Type.Num},a),t.if((0,r.not)(a),s)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:o,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,i.alwaysValidSchema)(s,e)))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,i)=>{const s=e.subschema({keyword:o,schemaProp:i,compositeRule:!0},c);t.assign(a,r._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,r.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},9922:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},7197:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9922),i=n(5660),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,i.default];t.default=o},5660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(7642),i=n(1239),o=n(9186),s=n(4224),a=n(6258),c=n(1799),u={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:i}=e,{baseId:s,schemaEnv:c,validateName:u,opts:h,self:d}=i,{root:p}=c;if(("#"===n||"#/"===n)&&s===p.baseId)return function(){if(c===p)return f(e,u,c,c.$async);const n=t.scopeValue("root",{ref:p});return f(e,o._`${n}.validate`,p,p.$async)}();const m=a.resolveRef.call(d,p,s,n);if(void 0===m)throw new r.default(i.opts.uriResolver,s,n);return m instanceof a.SchemaEnv?function(t){const n=l(e,t);f(e,n,t,t.$async)}(m):function(r){const i=t.scopeValue("schema",!0===h.code.source?{ref:r,code:(0,o.stringify)(r)}:{ref:r}),s=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:o.nil,topSchemaRef:i,errSchemaPath:n},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function l(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):o._`${n.scopeValue("wrapper",{ref:t})}.validate`}function f(e,t,n,r){const{gen:a,it:u}=e,{allErrors:l,schemaEnv:f,opts:h}=u,d=h.passContext?s.default.this:o.nil;function p(e){const t=o._`${e}.errors`;a.assign(s.default.vErrors,o._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,o._`${s.default.vErrors}.length`)}function m(e){var t;if(!u.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==u.props)if(r&&!r.dynamicProps)void 0!==r.props&&(u.props=c.mergeEvaluated.props(a,r.props,u.props));else{const t=a.var("props",o._`${e}.evaluated.props`);u.props=c.mergeEvaluated.props(a,t,u.props,o.Name)}if(!0!==u.items)if(r&&!r.dynamicItems)void 0!==r.items&&(u.items=c.mergeEvaluated.items(a,r.items,u.items));else{const t=a.var("items",o._`${e}.evaluated.items`);u.items=c.mergeEvaluated.items(a,t,u.items,o.Name)}}r?function(){if(!f.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(o._`await ${(0,i.callValidateCode)(e,t,d)}`),m(t),l||a.assign(n,!0)}),(e=>{a.if(o._`!(${e} instanceof ${u.ValidationError})`,(()=>a.throw(e))),p(e),l||a.assign(n,!1)})),e.ok(n)}():e.result((0,i.callValidateCode)(e,t,d),(()=>m(t)),(()=>p(t)))}t.getValidate=l,t.callRef=f,t.default=u},4415:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=n(3224),o=n(6258),s=n(1799),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===i.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>r._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:a,parentSchema:c,it:u}=e,{oneOf:l}=c;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const f=a.propertyName;if("string"!=typeof f)throw new Error("discriminator: requires propertyName");if(a.mapping)throw new Error("discriminator: mapping is not supported");if(!l)throw new Error("discriminator: requires oneOf keyword");const h=t.let("valid",!1),d=t.const("tag",r._`${n}${(0,r.getProperty)(f)}`);function p(n){const i=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:n},i);return e.mergeEvaluated(o,r.Name),i}t.if(r._`typeof ${d} == "string"`,(()=>function(){const n=function(){var e;const t={},n=i(c);let r=!0;for(let t=0;te.error(!1,{discrError:i.DiscrError.Tag,tag:d,tagName:f}))),e.ok(h)}};t.default=a},3224:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,(n=t.DiscrError||(t.DiscrError={})).Tag="tag",n.Mapping="mapping"},1378:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7197),i=n(116),o=n(9386),s=n(5627),a=n(8384),c=[r.default,i.default,(0,o.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},2024:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>r.str`must match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`},code(e,t){const{gen:n,data:i,$data:o,schema:s,schemaCode:a,it:c}=e,{opts:u,errSchemaPath:l,schemaEnv:f,self:h}=c;u.validateFormats&&(o?function(){const o=n.scopeValue("formats",{ref:h.formats,code:u.code.formats}),s=n.const("fDef",r._`${o}[${a}]`),c=n.let("fType"),l=n.let("format");n.if(r._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,(()=>n.assign(c,r._`${s}.type || "string"`).assign(l,r._`${s}.validate`)),(()=>n.assign(c,r._`"string"`).assign(l,s))),e.fail$data((0,r.or)(!1===u.strictSchema?r.nil:r._`${a} && !${l}`,function(){const e=f.$async?r._`(${s}.async ? await ${l}(${i}) : ${l}(${i}))`:r._`${l}(${i})`,n=r._`(typeof ${l} == "function" ? ${e} : ${l}.test(${i}))`;return r._`${l} && ${l} !== true && ${c} === ${t} && !${n}`}()))}():function(){const o=h.formats[s];if(!o)return void function(){if(!1!==u.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${l}"`}h.logger.warn(e())}();if(!0===o)return;const[a,c,d]=function(e){const t=e instanceof RegExp?(0,r.regexpCode)(e):u.code.formats?r._`${u.code.formats}${(0,r.getProperty)(s)}`:void 0,i=n.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,i]:[e.type||"string",e.validate,r._`${i}.validate`]}(o);a===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!f.$async)throw new Error("async format in sync schema");return r._`await ${d}(${i})`}return"function"==typeof c?r._`${d}(${i})`:r._`${d}.test(${i})`}())}())}};t.default=i},5627:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=[n(2024).default];t.default=r},8384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},8470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=n(1799),o=n(2377),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(r._`!${(0,i.useFunc)(t,o.default)}(${n}, ${a})`):e.fail(r._`${c} !== ${n}`)}};t.default=s},6860:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=n(1799),o=n(2377),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:s,schema:a,schemaCode:c,it:u}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const l=a.length>=u.opts.loopEnum;let f;const h=()=>null!=f?f:f=(0,i.useFunc)(t,o.default);let d;if(l||s)d=t.let("valid"),e.block$data(d,(function(){t.assign(d,!1),t.forOf("v",c,(e=>t.if(r._`${h()}(${n}, ${e})`,(()=>t.assign(d,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);d=(0,r.or)(...a.map(((t,i)=>function(e,t){const i=a[t];return"object"==typeof i&&null!==i?r._`${h()}(${n}, ${e}[${t}])`:r._`${n} === ${i}`}(e,i))))}e.pass(d)}};t.default=s},116:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2679),i=n(5006),o=n(5337),s=n(1403),a=n(1173),c=n(4346),u=n(9656),l=n(6526),f=n(8470),h=n(6860),d=[r.default,i.default,o.default,s.default,a.default,c.default,u.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,h.default];t.default=d},9656:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:i}=e,o="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${o} ${i}`)}};t.default=i},5337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=n(1799),o=n(8991),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s,it:a}=e,c="maxLength"===t?r.operators.GT:r.operators.LT,u=!1===a.opts.unicode?r._`${n}.length`:r._`${(0,i.useFunc)(e.gen,o.default)}(${n})`;e.fail$data(r._`${u} ${c} ${s}`)}};t.default=s},2679:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i=r.operators,o={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:e,schemaCode:t})=>r.str`must be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${o[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:n,schemaCode:i}=e;e.fail$data(r._`${n} ${o[t].fail} ${i} || isNaN(${n})`)}};t.default=a},1173:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:i}=e,o="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${o} ${i}`)}};t.default=i},5006:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9186),i={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>r.str`must be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:i,it:o}=e,s=o.opts.multipleOfPrecision,a=t.let("res"),c=s?r._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:r._`${a} !== parseInt(${a})`;e.fail$data(r._`(${i} === 0 || (${a} = ${n}/${i}, ${c}))`)}};t.default=i},1403:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1239),i=n(9186),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>i.str`must match pattern "${e}"`,params:({schemaCode:e})=>i._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:o,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",u=n?i._`(new RegExp(${s}, ${c}))`:(0,r.usePattern)(e,o);e.fail$data(i._`!${u}.test(${t})`)}};t.default=o},4346:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1239),i=n(9186),o=n(1799),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>i.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>i._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:s,data:a,$data:c,it:u}=e,{opts:l}=u;if(!c&&0===n.length)return;const f=n.length>=l.loopRequired;if(u.allErrors?function(){if(f||c)e.block$data(i.nil,h);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const o=t.let("missing");if(f||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,o){e.setParams({missingProperty:n}),t.forOf(n,s,(()=>{t.assign(o,(0,r.propertyInData)(t,a,n,l.ownProperties)),t.if((0,i.not)(o),(()=>{e.error(),t.break()}))}),i.nil)}(o,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,o)),(0,r.reportMissingProp)(e,o),t.else()}(),l.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${u.schemaEnv.baseId+u.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(u,t,u.opts.strictRequired)}}function h(){t.forOf("prop",s,(n=>{e.setParams({missingProperty:n}),t.if((0,r.noPropertyInData)(t,a,n,l.ownProperties),(()=>e.error()))}))}}};t.default=s},6526:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9653),i=n(9186),o=n(1799),s=n(2377),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>i.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>i._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:c,parentSchema:u,schemaCode:l,it:f}=e;if(!a&&!c)return;const h=t.let("valid"),d=u.items?(0,r.getSchemaTypes)(u.items):[];function p(o,s){const a=t.name("item"),c=(0,r.checkDataTypes)(d,a,f.opts.strictNumbers,r.DataType.Wrong),u=t.const("indices",i._`{}`);t.for(i._`;${o}--;`,(()=>{t.let(a,i._`${n}[${o}]`),t.if(c,i._`continue`),d.length>1&&t.if(i._`typeof ${a} == "string"`,i._`${a} += "_"`),t.if(i._`typeof ${u}[${a}] == "number"`,(()=>{t.assign(s,i._`${u}[${a}]`),e.error(),t.assign(h,!1).break()})).code(i._`${u}[${a}] = ${o}`)}))}function m(r,a){const c=(0,o.useFunc)(t,s.default),u=t.name("outer");t.label(u).for(i._`;${r}--;`,(()=>t.for(i._`${a} = ${r}; ${a}--;`,(()=>t.if(i._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(h,!1).break(u)}))))))}e.block$data(h,(function(){const r=t.let("i",i._`${n}.length`),o=t.let("j");e.setParams({i:r,j:o}),t.assign(h,!0),t.if(i._`${r} > 1`,(()=>(d.length>0&&!d.some((e=>"object"===e||"array"===e))?p:m)(r,o)))}),i._`${l} === false`),e.ok(h)}};t.default=a},8304:e=>{"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,i,o,s,a,c,u,l,f){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var h in r(o,s,a,c,u,l,f),o){var d=o[h];if(Array.isArray(d)){if(h in t.arrayKeywords)for(var p=0;p{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.loadMessageBundle=t.localize=t.format=t.setPseudo=t.isPseudo=t.isDefined=t.BundleFormat=t.MessageFormat=void 0;var r,i,o,s=n(4574);function a(e){return void 0!==e}function c(e,n){return t.isPseudo&&(e="["+e.replace(/[aouei]/g,"$&$&")+"]"),0===n.length?e:e.replace(/\{(\d+)\}/g,(function(e,t){var r=t[0],i=n[r],o=e;return"string"==typeof i?o=i:"number"!=typeof i&&"boolean"!=typeof i&&null!=i||(o=String(i)),o}))}(o=t.MessageFormat||(t.MessageFormat={})).file="file",o.bundle="bundle",o.both="both",(i=t.BundleFormat||(t.BundleFormat={})).standalone="standalone",i.languagePack="languagePack",function(e){e.is=function(e){var t=e;return t&&a(t.key)&&a(t.comment)}}(r||(r={})),t.isDefined=a,t.isPseudo=!1,t.setPseudo=function(e){t.isPseudo=e},t.format=c,t.localize=function(e,t){for(var n=[],r=2;r{"use strict";var n;function r(){if(void 0===n)throw new Error("No runtime abstraction layer installed");return n}Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.install=function(e){if(void 0===e)throw new Error("No runtime abstraction layer provided");n=e}}(r||(r={})),t.default=r},3164:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},2365:e=>{"use strict";e.exports=JSON.parse('{"$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":true,"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":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"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":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"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":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"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":true}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};(()=>{"use strict";n.r(r);var e,t=n(7630),i=n(3984),o=n(4155);(()=>{var t={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,s=arguments.length-1;s>=-1&&!i;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=o.cwd()),a=e),t(a),0!==a.length&&(r=a+"/"+r,i=47===a.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;iu){if(47===n.charCodeAt(a+f))return n.slice(a+f+1);if(0===f)return n.slice(a+f)}else s>u&&(47===e.charCodeAt(i+f)?l=f:0===f&&(l=0));break}var h=e.charCodeAt(i+f);if(h!==n.charCodeAt(a+f))break;47===h&&(l=f)}var d="";for(f=i+l+1;f<=o;++f)f!==o&&47!==e.charCodeAt(f)||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(a+l):(a+=l,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){i=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(u===n.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=c))}return i===o?o=c:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(o=!1,i=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!o){r=a+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,u=!0,l=e.length-1,f=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===i?-1===s?s=l:1!==f&&(f=1):-1!==s&&(f=-1);else if(!u){a=l+1;break}return-1===s||-1===c||0===f||1===f&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&o?e.slice(1,c):e.slice(a,c)):(0===a&&o?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{var e;if(r.r(i),r.d(i,{URI:()=>m,Utils:()=>T}),"object"==typeof o)e="win32"===o.platform;else if("object"==typeof navigator){var t=navigator.userAgent;e=t.indexOf("Windows")>=0}var n,s,a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=/^\w[\w\d+.-]*$/,u=/^\//,l=/^\/\//;function f(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(e.authority,'", path: "').concat(e.path,'", query: "').concat(e.query,'", fragment: "').concat(e.fragment,'"}'));if(e.scheme&&!c.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!u.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}var h="",d="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,m=function(){function t(e,t,n,r,i,o){void 0===o&&(o=!1),"object"==typeof e?(this.scheme=e.scheme||h,this.authority=e.authority||h,this.path=e.path||h,this.query=e.query||h,this.fragment=e.fragment||h):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||h,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==d&&(t=d+t):t=d}return t}(this.scheme,n||h),this.query=r||h,this.fragment=i||h,f(this,o))}return t.isUri=function(e){return e instanceof t||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString},Object.defineProperty(t.prototype,"fsPath",{get:function(){return _(this,!1)},enumerable:!1,configurable:!0}),t.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=h),void 0===n?n=this.authority:null===n&&(n=h),void 0===r?r=this.path:null===r&&(r=h),void 0===i?i=this.query:null===i&&(i=h),void 0===o?o=this.fragment:null===o&&(o=h),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new y(t,n,r,i,o)},t.parse=function(e,t){void 0===t&&(t=!1);var n=p.exec(e);return n?new y(n[2]||h,C(n[4]||h),C(n[5]||h),C(n[7]||h),C(n[9]||h),t):new y(h,h,h,h,h)},t.file=function(t){var n=h;if(e&&(t=t.replace(/\\/g,d)),t[0]===d&&t[1]===d){var r=t.indexOf(d,2);-1===r?(n=t.substring(2),t=d):(n=t.substring(2,r),t=t.substring(r)||d)}return new y("file",n,t,h,h)},t.from=function(e){var t=new y(e.scheme,e.authority,e.path,e.query,e.fragment);return f(t,!0),t},t.prototype.toString=function(e){return void 0===e&&(e=!1),S(this,e)},t.prototype.toJSON=function(){return this},t.revive=function(e){if(e){if(e instanceof t)return e;var n=new y(e);return n._formatted=e.external,n._fsPath=e._sep===g?e.fsPath:null,n}return e},t}(),g=e?1:void 0,y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return a(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=_(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?S(this,!0):(this._formatted||(this._formatted=S(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=g),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(m),v=((s={})[58]="%3A",s[47]="%2F",s[63]="%3F",s[35]="%23",s[91]="%5B",s[93]="%5D",s[64]="%40",s[33]="%21",s[36]="%24",s[38]="%26",s[39]="%27",s[40]="%28",s[41]="%29",s[42]="%2A",s[43]="%2B",s[44]="%2C",s[59]="%3B",s[61]="%3D",s[32]="%20",s);function b(e,t,n){for(var r=void 0,i=-1,o=0;o=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s||n&&91===s||n&&93===s||n&&58===s)-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),void 0!==r&&(r+=e.charAt(o));else{void 0===r&&(r=e.substr(0,o));var a=v[s];void 0!==a?(-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),r+=a):-1===i&&(i=o)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function w(e){for(var t=void 0,n=0;n1&&"file"===t.scheme?"//".concat(t.authority).concat(t.path):47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function S(e,t){var n=t?w:b,r="",i=e.scheme,o=e.authority,s=e.path,a=e.query,c=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=d,r+=d),o){var u=o.indexOf("@");if(-1!==u){var l=o.substr(0,u);o=o.substr(u+1),-1===(u=l.lastIndexOf(":"))?r+=n(l,!1,!1):(r+=n(l.substr(0,u),!1,!1),r+=":",r+=n(l.substr(u+1),!1,!0)),r+="@"}-1===(u=(o=o.toLowerCase()).lastIndexOf(":"))?r+=n(o,!1,!0):(r+=n(o.substr(0,u),!1,!0),r+=o.substr(u))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(f=s.charCodeAt(1))>=65&&f<=90&&(s="/".concat(String.fromCharCode(f+32),":").concat(s.substr(3)));else if(s.length>=2&&58===s.charCodeAt(1)){var f;(f=s.charCodeAt(0))>=65&&f<=90&&(s="".concat(String.fromCharCode(f+32),":").concat(s.substr(2)))}r+=n(s,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),c&&(r+="#",r+=t?c:b(c,!1,!1)),r}function k(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+k(e.substr(3)):e}}var x=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function C(e){return e.match(x)?e.replace(x,(function(e){return k(e)})):e}var T,E=r(470),P=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i/^(((\.\.?)|([\w-@. ]+))(\/|\\\\?))*[\w-. ]*\.[\w-]+$/i.test(e),S=(e,t,n)=>{for(const t of e)if(n.startsWith(t.name)){const e=s.parse(t.uri).fsPath,r=n.split(w.sep);return r.shift(),s.file((0,w.join)(e,r.join())).toString()}return t?s.file((0,w.join)(t.fsPath,n)).toString():(0,w.normalize)(n)},k={resolveRelativePath:(e,t)=>b.DB(t,e)};function x(e,t=!1){const n=e.length;let r=0,i="",o=0,s=16,a=0,c=0,u=0,l=0,f=0;function h(t,n){let i=0,o=0;for(;i=48&&t<=57)o=16*o+t-48;else if(t>=65&&t<=70)o=16*o+t-65+10;else{if(!(t>=97&&t<=102))break;o=16*o+t-97+10}r++,i++}return i=n)return o=n,s=17;let t=e.charCodeAt(r);if(C(t)){do{r++,i+=String.fromCharCode(t),t=e.charCodeAt(r)}while(C(t));return s=15}if(T(t))return r++,i+=String.fromCharCode(t),13===t&&10===e.charCodeAt(r)&&(r++,i+="\n"),a++,u=r,s=14;switch(t){case 123:return r++,s=1;case 125:return r++,s=2;case 91:return r++,s=3;case 93:return r++,s=4;case 58:return r++,s=6;case 44:return r++,s=5;case 34:return r++,i=function(){let t="",i=r;for(;;){if(r>=n){t+=e.substring(i,r),f=2;break}const o=e.charCodeAt(r);if(34===o){t+=e.substring(i,r),r++;break}if(92!==o){if(o>=0&&o<=31){if(T(o)){t+=e.substring(i,r),f=2;break}f=6}r++}else{if(t+=e.substring(i,r),r++,r>=n){f=2;break}switch(e.charCodeAt(r++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:const e=h(4,!0);e>=0?t+=String.fromCharCode(e):f=4;break;default:f=5}i=r}}return t}(),s=10;case 47:const c=r-1;if(47===e.charCodeAt(r+1)){for(r+=2;rr,scan:t?function(){let e;do{e=d()}while(e>=12&&e<=15);return e}:d,getToken:()=>s,getTokenValue:()=>i,getTokenOffset:()=>o,getTokenLength:()=>r-o,getTokenStartLine:()=>c,getTokenStartCharacter:()=>o-l,getTokenError:()=>f}}function C(e){return 32===e||9===e}function T(e){return 10===e||13===e}function E(e){return e>=48&&e<=57}var P,R;!function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"}(P||(P={})),function(e){e.DEFAULT={allowTrailingComma:!1}}(R||(R={}));const A=x;var O,$;!function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"}(O||(O={})),function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"}($||($={}));const N=function(e,t=[],n=R.DEFAULT){let r=null,i=[];const o=[];function s(e){Array.isArray(i)?i.push(e):null!==r&&(i[r]=e)}return function(e,t,n=R.DEFAULT){const r=x(e,!1),i=[];function o(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),(()=>i.slice())):()=>!0}function a(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),(()=>i.slice())):()=>!0}const u=s(t.onObjectBegin),l=c(t.onObjectProperty),f=o(t.onObjectEnd),h=s(t.onArrayBegin),d=o(t.onArrayEnd),p=c(t.onLiteralValue),m=a(t.onSeparator),g=o(t.onComment),y=a(t.onError),v=n&&n.disallowComments,b=n&&n.allowTrailingComma;function w(){for(;;){const e=r.scan();switch(r.getTokenError()){case 4:_(14);break;case 5:_(15);break;case 3:_(13);break;case 1:v||_(11);break;case 2:_(12);break;case 6:_(16)}switch(e){case 12:case 13:v?_(10):g();break;case 16:_(1);break;case 15:case 14:break;default:return e}}}function _(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;17!==e;){if(-1!==t.indexOf(e)){w();break}if(-1!==n.indexOf(e))break;e=w()}}}function S(e){const t=r.getTokenValue();return e?p(t):(l(t),i.push(t)),w(),!0}w(),17===r.getToken()?!!n.allowEmptyContent||_(4,[],[]):function e(){switch(r.getToken()){case 3:return function(){h(),w();let t=!0,n=!1;for(;4!==r.getToken()&&17!==r.getToken();){if(5===r.getToken()){if(n||_(4,[],[]),m(","),w(),4===r.getToken()&&b)break}else n&&_(6,[],[]);t?(i.push(0),t=!1):i[i.length-1]++,e()||_(4,[],[4,5]),n=!0}return d(),t||i.pop(),4!==r.getToken()?_(8,[4],[]):w(),!0}();case 1:return function(){u(),w();let t=!1;for(;2!==r.getToken()&&17!==r.getToken();){if(5===r.getToken()){if(t||_(4,[],[]),m(","),w(),2===r.getToken()&&b)break}else t&&_(6,[],[]);(10!==r.getToken()?(_(3,[],[2,5]),0):(S(!1),6===r.getToken()?(m(":"),w(),e()||_(4,[],[2,5])):_(5,[],[2,5]),i.pop(),1))||_(4,[],[2,5]),t=!0}return f(),2!==r.getToken()?_(7,[2],[]):w(),!0}();case 10:return S(!0);default:return function(){switch(r.getToken()){case 11:const e=r.getTokenValue();let t=Number(e);isNaN(t)&&(_(2),t=0),p(t);break;case 7:p(null);break;case 8:p(!0);break;case 9:p(!1);break;default:return!1}return w(),!0}()}}()?17!==r.getToken()&&_(9,[],[]):_(4,[],[])}(e,{onObjectBegin:()=>{const e={};s(e),o.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=o.pop()},onArrayBegin:()=>{const e=[];s(e),o.push(i),i=e,r=null},onArrayEnd:()=>{i=o.pop()},onLiteralValue:s,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]},j=function e(t,n,r=!1){if(function(e,t,n=!1){return t>=e.offset&&t{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=F.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;iu){if(47===n.charCodeAt(a+f))return n.slice(a+f+1);if(0===f)return n.slice(a+f)}else s>u&&(47===e.charCodeAt(i+f)?l=f:0===f&&(l=0));break}var h=e.charCodeAt(i+f);if(h!==n.charCodeAt(a+f))break;47===h&&(l=f)}var d="";for(f=i+l+1;f<=o;++f)f!==o&&47!==e.charCodeAt(f)||(0===d.length?d+="..":d+="/..");return d.length>0?d+n.slice(a+l):(a+=l,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){i=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(u===n.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=c))}return i===o?o=c:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(o=!1,i=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!o){r=a+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,u=!0,l=e.length-1,f=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===i?-1===s?s=l:1!==f&&(f=1):-1!==s&&(f=-1);else if(!u){a=l+1;break}return-1===s||-1===c||0===f||1===f&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&o?e.slice(1,c):e.slice(a,c)):(0===a&&o?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{var e;if(n.r(r),n.d(r,{URI:()=>p,Utils:()=>C}),"object"==typeof F)e="win32"===F.platform;else if("object"==typeof navigator){var t=navigator.userAgent;e=t.indexOf("Windows")>=0}var i,o,s=(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=/^\w[\w\d+.-]*$/,c=/^\//,u=/^\/\//;function l(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(e.authority,'", path: "').concat(e.path,'", query: "').concat(e.query,'", fragment: "').concat(e.fragment,'"}'));if(e.scheme&&!a.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!c.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}var f="",h="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,p=function(){function t(e,t,n,r,i,o){void 0===o&&(o=!1),"object"==typeof e?(this.scheme=e.scheme||f,this.authority=e.authority||f,this.path=e.path||f,this.query=e.query||f,this.fragment=e.fragment||f):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||f,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==h&&(t=h+t):t=h}return t}(this.scheme,n||f),this.query=r||f,this.fragment=i||f,l(this,o))}return t.isUri=function(e){return e instanceof t||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString},Object.defineProperty(t.prototype,"fsPath",{get:function(){return w(this,!1)},enumerable:!1,configurable:!0}),t.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=f),void 0===n?n=this.authority:null===n&&(n=f),void 0===r?r=this.path:null===r&&(r=f),void 0===i?i=this.query:null===i&&(i=f),void 0===o?o=this.fragment:null===o&&(o=f),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new g(t,n,r,i,o)},t.parse=function(e,t){void 0===t&&(t=!1);var n=d.exec(e);return n?new g(n[2]||f,x(n[4]||f),x(n[5]||f),x(n[7]||f),x(n[9]||f),t):new g(f,f,f,f,f)},t.file=function(t){var n=f;if(e&&(t=t.replace(/\\/g,h)),t[0]===h&&t[1]===h){var r=t.indexOf(h,2);-1===r?(n=t.substring(2),t=h):(n=t.substring(2,r),t=t.substring(r)||h)}return new g("file",n,t,f,f)},t.from=function(e){var t=new g(e.scheme,e.authority,e.path,e.query,e.fragment);return l(t,!0),t},t.prototype.toString=function(e){return void 0===e&&(e=!1),_(this,e)},t.prototype.toJSON=function(){return this},t.revive=function(e){if(e){if(e instanceof t)return e;var n=new g(e);return n._formatted=e.external,n._fsPath=e._sep===m?e.fsPath:null,n}return e},t}(),m=e?1:void 0,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return s(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=w(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?_(this,!0):(this._formatted||(this._formatted=_(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=m),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(p),y=((o={})[58]="%3A",o[47]="%2F",o[63]="%3F",o[35]="%23",o[91]="%5B",o[93]="%5D",o[64]="%40",o[33]="%21",o[36]="%24",o[38]="%26",o[39]="%27",o[40]="%28",o[41]="%29",o[42]="%2A",o[43]="%2B",o[44]="%2C",o[59]="%3B",o[61]="%3D",o[32]="%20",o);function v(e,t,n){for(var r=void 0,i=-1,o=0;o=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s||n&&91===s||n&&93===s||n&&58===s)-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),void 0!==r&&(r+=e.charAt(o));else{void 0===r&&(r=e.substr(0,o));var a=y[s];void 0!==a?(-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),r+=a):-1===i&&(i=o)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function b(e){for(var t=void 0,n=0;n1&&"file"===t.scheme?"//".concat(t.authority).concat(t.path):47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function _(e,t){var n=t?b:v,r="",i=e.scheme,o=e.authority,s=e.path,a=e.query,c=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=h,r+=h),o){var u=o.indexOf("@");if(-1!==u){var l=o.substr(0,u);o=o.substr(u+1),-1===(u=l.lastIndexOf(":"))?r+=n(l,!1,!1):(r+=n(l.substr(0,u),!1,!1),r+=":",r+=n(l.substr(u+1),!1,!0)),r+="@"}-1===(u=(o=o.toLowerCase()).lastIndexOf(":"))?r+=n(o,!1,!0):(r+=n(o.substr(0,u),!1,!0),r+=o.substr(u))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(f=s.charCodeAt(1))>=65&&f<=90&&(s="/".concat(String.fromCharCode(f+32),":").concat(s.substr(3)));else if(s.length>=2&&58===s.charCodeAt(1)){var f;(f=s.charCodeAt(0))>=65&&f<=90&&(s="".concat(String.fromCharCode(f+32),":").concat(s.substr(2)))}r+=n(s,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),c&&(r+="#",r+=t?c:v(c,!1,!1)),r}function S(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+S(e.substr(3)):e}}var k=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function x(e){return e.match(k)?e.replace(k,(function(e){return S(e)})):e}var C,T=n(470),E=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i0?e.lastIndexOf(t)===n:0===n&&e===t}function B(e){return W(e,"(?i)")?new RegExp(e.substring(4),"i"):new RegExp(e)}function K(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;var n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n0&&(i.arguments=n),i},e.is=function(e){var t=e;return kt.defined(t)&&kt.string(t.title)&&kt.string(t.command)}}(de||(de={})),(ke=pe||(pe={})).replace=function(e,t){return{range:e,newText:t}},ke.insert=function(e,t){return{range:{start:e,end:e},newText:t}},ke.del=function(e){return{range:e,newText:""}},ke.is=function(e){var t=e;return kt.objectLiteral(t)&&kt.string(t.newText)&&ee.is(t.range)},function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){var t=e;return kt.objectLiteral(t)&&kt.string(t.label)&&(kt.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(kt.string(t.description)||void 0===t.description)}}(me||(me={})),function(e){e.is=function(e){var t=e;return kt.string(t)}}(ge||(ge={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return pe.is(t)&&(me.is(t.annotationId)||ge.is(t.annotationId))}}(ye||(ye={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return kt.defined(t)&&Oe.is(t.textDocument)&&Array.isArray(t.edits)}}(ve||(ve={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"create"===t.kind&&kt.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||kt.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||kt.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||ge.is(t.annotationId))}}(be||(be={})),function(e){e.create=function(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){var t=e;return t&&"rename"===t.kind&&kt.string(t.oldUri)&&kt.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||kt.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||kt.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||ge.is(t.annotationId))}}(we||(we={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"delete"===t.kind&&kt.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||kt.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||kt.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||ge.is(t.annotationId))}}(_e||(_e={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return kt.string(e.kind)?be.is(e)||we.is(e)||_e.is(e):ve.is(e)})))}}(Se||(Se={}));var Re,Ae,Oe,$e,Ne,je,Ie,De,Me,qe,Fe,Le,Ve,We,Ue,Be,Ke,ze,He,Je,Ge,Ye,Qe,Xe,Ze,et,tt,nt,rt,it,ot,st,at,ct,ut,lt,ft,ht,dt,pt,mt,gt,yt,vt,bt,wt,_t=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=pe.insert(e,t):ge.is(n)?(i=n,r=ye.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=ye.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=pe.replace(e,t):ge.is(n)?(i=n,r=ye.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=ye.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=pe.del(e):ge.is(t)?(r=t,n=ye.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=ye.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),St=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(ge.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();!function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new St(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(ve.is(e)){var n=new _t(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new _t(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(Oe.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new _t(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new _t(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new St,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(me.is(t)||ge.is(t)?r=t:n=t,void 0===r?i=be.create(e,n):(o=ge.is(r)?r:this._changeAnnotations.manage(r),i=be.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,s;if(me.is(n)||ge.is(n)?i=n:r=n,void 0===i?o=we.create(e,t,r):(s=ge.is(i)?i:this._changeAnnotations.manage(i),o=we.create(e,t,r,s)),this._workspaceEdit.documentChanges.push(o),void 0!==s)return s},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(me.is(t)||ge.is(t)?r=t:n=t,void 0===r?i=_e.create(e,n):(o=ge.is(r)?r:this._changeAnnotations.manage(r),i=_e.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o}}(),function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return kt.defined(t)&&kt.string(t.uri)}}(Re||(Re={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return kt.defined(t)&&kt.string(t.uri)&&kt.integer(t.version)}}(Ae||(Ae={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return kt.defined(t)&&kt.string(t.uri)&&(null===t.version||kt.integer(t.version))}}(Oe||(Oe={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return kt.defined(t)&&kt.string(t.uri)&&kt.string(t.languageId)&&kt.integer(t.version)&&kt.string(t.text)}}($e||($e={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(Ne||(Ne={})),function(e){e.is=function(e){var t=e;return kt.objectLiteral(e)&&Ne.is(t.kind)&&kt.string(t.value)}}(je||(je={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(Ie||(Ie={})),function(e){e.PlainText=1,e.Snippet=2}(De||(De={})),function(e){e.Deprecated=1}(Me||(Me={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&kt.string(t.newText)&&ee.is(t.insert)&&ee.is(t.replace)}}(qe||(qe={})),function(e){e.asIs=1,e.adjustIndentation=2}(Fe||(Fe={})),function(e){e.is=function(e){var t=e;return t&&(kt.string(t.detail)||void 0===t.detail)&&(kt.string(t.description)||void 0===t.description)}}(Le||(Le={})),function(e){e.create=function(e){return{label:e}}}(Ve||(Ve={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(We||(We={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return kt.string(t)||kt.objectLiteral(t)&&kt.string(t.language)&&kt.string(t.value)}}(Ue||(Ue={})),function(e){e.is=function(e){var t=e;return!!t&&kt.objectLiteral(t)&&(je.is(t.contents)||Ue.is(t.contents)||kt.typedArray(t.contents,Ue.is))&&(void 0===e.range||ee.is(e.range))}}(Be||(Be={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(Ke||(Ke={})),function(e){e.create=function(e,t){for(var n=[],r=2;r=0;s--){var a=i[s],c=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=o))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(u,r.length),o=c}return r}}(wt||(wt={}));var kt,xt=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return Z.create(0,e);for(;ne?r=i:n=i+1}var o=n-1;return Z.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1e?r=i:n=i+1}var o=n-1;return{line:o,character:e-t[o]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function It(e){var t=jt(e.range);return t!==e.range?{newText:e.newText,range:t}:e}(Rt=Ct||(Ct={})).create=function(e,t,n,r){return new Ot(e,t,n,r)},Rt.update=function(e,t,n){if(e instanceof Ot)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},Rt.applyEdits=function(e,t){for(var n=e.getText(),r=$t(t.map(It),(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),i=0,o=[],s=0,a=r;si&&o.push(n.substring(i,u)),c.newText.length&&o.push(c.newText),i=e.offsetAt(c.range.end)}return o.push(n.substr(i)),o.join("")},(Pt=Tt||(Tt={}))[Pt.Undefined=0]="Undefined",Pt[Pt.EnumValueMismatch=1]="EnumValueMismatch",Pt[Pt.Deprecated=2]="Deprecated",Pt[Pt.UnexpectedEndOfComment=257]="UnexpectedEndOfComment",Pt[Pt.UnexpectedEndOfString=258]="UnexpectedEndOfString",Pt[Pt.UnexpectedEndOfNumber=259]="UnexpectedEndOfNumber",Pt[Pt.InvalidUnicode=260]="InvalidUnicode",Pt[Pt.InvalidEscapeCharacter=261]="InvalidEscapeCharacter",Pt[Pt.InvalidCharacter=262]="InvalidCharacter",Pt[Pt.PropertyExpected=513]="PropertyExpected",Pt[Pt.CommaExpected=514]="CommaExpected",Pt[Pt.ColonExpected=515]="ColonExpected",Pt[Pt.ValueExpected=516]="ValueExpected",Pt[Pt.CommaOrCloseBacketExpected=517]="CommaOrCloseBacketExpected",Pt[Pt.CommaOrCloseBraceExpected=518]="CommaOrCloseBraceExpected",Pt[Pt.TrailingComma=519]="TrailingComma",Pt[Pt.DuplicateKey=520]="DuplicateKey",Pt[Pt.CommentNotPermitted=521]="CommentNotPermitted",Pt[Pt.SchemaResolveError=768]="SchemaResolveError",function(e){e.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[Ne.Markdown,Ne.PlainText],commitCharactersSupport:!0}}}}}(Et||(Et={}));var Dt,Mt,qt,Ft=n(3022),Lt=(Dt=function(e,t){return Dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Dt(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Dt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Vt=Ft.loadMessageBundle(),Wt={"color-hex":{errorMessage:Vt("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:Vt("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:Vt("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:Vt("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:Vt("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,}))$/}},Ut=function(){function e(e,t,n){void 0===n&&(n=0),this.offset=t,this.length=n,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 Bt(e){return J(e)?e?{}:{not:{}}:e}Lt((function(e,t){var n=qt.call(this,e,t)||this;return n.type="null",n.value=null,n}),qt=Ut),function(e){Lt((function(t,n,r){var i=e.call(this,t,r)||this;return i.type="boolean",i.value=n,i}),e)}(Ut),function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="array",r.items=[],r}Lt(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!1,configurable:!0})}(Ut),function(e){Lt((function(t,n){var r=e.call(this,t,n)||this;return r.type="number",r.isInteger=!0,r.value=Number.NaN,r}),e)}(Ut),function(e){Lt((function(t,n,r){var i=e.call(this,t,n,r)||this;return i.type="string",i.value="",i}),e)}(Ut),function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.type="property",i.colonOffset=-1,i.keyNode=r,i}Lt(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!1,configurable:!0})}(Ut),function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type="object",r.properties=[],r}Lt(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!1,configurable:!0})}(Ut),function(e){e[e.Key=0]="Key",e[e.Enum=1]="Enum"}(Mt||(Mt={}));var Kt=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||Yt(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e}(),zt=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}(),Ht=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,n=e;t=e.offset&&t=0;)o.splice(t,1),t=o.indexOf(e)};if(t.properties)for(var d=0,p=Object.keys(t.properties);d0)for(var E=0,P=o;Et.maxProperties&&n.problems.push({location:{offset:e.offset,length:e.length},message:Vt("MaxPropWarning","Object has more properties than limit of {0}.",t.maxProperties)}),z(t.minProperties)&&e.properties.length=i.length&&n.propertiesValueMatches++}if(e.items.length>i.length)if("object"==typeof t.additionalItems)for(var c=i.length;ct.maxItems&&n.problems.push({location:{offset:e.offset,length:e.length},message:Vt("maxItemsWarning","Array has too many items. Expected {0} or fewer.",t.maxItems)}),!0===t.uniqueItems){var m=Jt(e),g=m.some((function(e,t){return t!==m.lastIndexOf(e)}));g&&n.problems.push({location:{offset:e.offset,length:e.length},message:Vt("uniqueItemsWarning","Array has duplicate items.")})}}(i,t,n,r);break;case"string":!function(e,t,n,r){if(z(t.minLength)&&e.value.lengtht.maxLength&&n.problems.push({location:{offset:e.offset,length:e.length},message:Vt("maxLengthWarning","String is longer than the maximum length of {0}.",t.maxLength)}),"string"==typeof t.pattern&&(B(t.pattern).test(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||Vt("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 o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(e.value);o?o[2]||"uri"!==t.format||(i=Vt("uriSchemeMissing","URI with a scheme is expected.")):i=Vt("uriMissing","URI is expected.")}else i=Vt("uriEmpty","URI expected.");i&&n.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||Vt("uriFormatWarning","String is not a URI: {0}",i)});break;case"color-hex":case"date-time":case"date":case"time":case"email":var s=Wt[t.format];e.value&&s.pattern.exec(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||s.errorMessage})}}(i,t,n);break;case"number":!function(e,t,n,r){var i=e.value;function o(e){var t,n=/^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(e.toString());return n&&{value:Number(n[1]+(n[2]||"")),multiplier:((null===(t=n[2])||void 0===t?void 0:t.length)||0)-(parseInt(n[3])||0)}}if(z(t.multipleOf)){var s=-1;if(Number.isInteger(t.multipleOf))s=i%t.multipleOf;else{var a=o(t.multipleOf),c=o(i);if(a&&c){var u=Math.pow(10,Math.abs(c.multiplier-a.multiplier));c.multiplier=d&&n.problems.push({location:{offset:e.offset,length:e.length},message:Vt("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",d)});var p=f(t.minimum,t.exclusiveMinimum);z(p)&&im&&n.problems.push({location:{offset:e.offset,length:e.length},message:Vt("maximumWarning","Value is above the maximum of {0}.",m)})}(i,t,n);break;case"property":return Qt(i.valueNode,t,n,r)}!function(){function e(e){return i.type===e||"integer"===e&&"number"===i.type&&i.isInteger}if(Array.isArray(t.type)?t.type.some(e)||n.problems.push({location:{offset:i.offset,length:i.length},message:t.errorMessage||Vt("typeArrayMismatchWarning","Incorrect type. Expected one of {0}.",t.type.join(", "))}):t.type&&(e(t.type)||n.problems.push({location:{offset:i.offset,length:i.length},message:t.errorMessage||Vt("typeMismatchWarning",'Incorrect type. Expected "{0}".',t.type)})),Array.isArray(t.allOf))for(var o=0,s=t.allOf;o0?s={schema:u,validationResult:l,matchingSchemas:f}:0===h&&(s.matchingSchemas.merge(f),s.validationResult.mergeEnumValues(l))}else s.matchingSchemas.merge(f),s.validationResult.propertiesMatches+=l.propertiesMatches,s.validationResult.propertiesValueMatches+=l.propertiesValueMatches;else s={schema:u,validationResult:l,matchingSchemas:f}}return o.length>1&&t&&n.problems.push({location:{offset:i.offset,length:1},message:Vt("oneOfWarning","Matches multiple schemas when only one must validate.")}),s&&(n.merge(s.validationResult),n.propertiesMatches+=s.validationResult.propertiesMatches,n.propertiesValueMatches+=s.validationResult.propertiesValueMatches,r.merge(s.matchingSchemas)),o.length};Array.isArray(t.anyOf)&&p(t.anyOf,!1),Array.isArray(t.oneOf)&&p(t.oneOf,!0);var m=function(e){var t=new Ht,o=r.newSub();Qt(i,Bt(e),t,o),n.merge(t),n.propertiesMatches+=t.propertiesMatches,n.propertiesValueMatches+=t.propertiesValueMatches,r.merge(o)},g=Bt(t.if);if(g&&function(e,t,n){var o=Bt(e),s=new Ht,a=r.newSub();Qt(i,o,s,a),r.merge(a),s.hasProblems()?n&&m(n):t&&m(t)}(g,Bt(t.then),Bt(t.else)),Array.isArray(t.enum)){for(var y=Jt(i),v=!1,b=0,w=t.enum;b1)||"/"!==f&&void 0!==f&&"{"!==f&&","!==f||"/"!==d&&void 0!==d&&","!==d&&"}"!==d?i+="([^/]*)":("/"===d?u++:"/"===f&&i.endsWith("\\/")&&(i=i.substr(0,i.length-2)),i+="((?:[^/]*(?:/|$))*)"):i+=".*";break;default:i+=n}return c&&~c.indexOf("g")||(i="^"+i+"$"),new RegExp(i,c)}!function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=[]),this.root=e,this.syntaxErrors=t,this.comments=n}e.prototype.getNodeFromOffset=function(e,t){if(void 0===t&&(t=!1),this.root)return j(this.root,e,t)},e.prototype.visit=function(e){if(this.root){var t=function(n){var r=e(n),i=n.children;if(Array.isArray(i))for(var o=0;o0&&("/"===i[0]&&(i=i.substring(1)),this.globWrappers.push({regexp:Xt("**/"+i,{extended:!0,globstar:!0}),include:o}))}this.uris=t}catch(e){this.globWrappers.length=0,this.uris=[]}}return e.prototype.matchesPattern=function(e){for(var t=!1,n=0,r=this.globWrappers;n0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){var t=this;this.cachedSchemaForResource=void 0;for(var n=!1,r=[e=an(e)],i=Object.keys(this.schemasById).map((function(e){return t.schemasById[e]}));r.length;)for(var o=r.pop(),s=0;s1&&(n=r[1]),U(n,".")&&(n=n.substr(0,n.length-1)),new nn({},[Zt("json.schema.nocontent","Unable to load schema from '{0}': {1}.",cn(e),n)])}))},e.prototype.resolveSchemaContent=function(e,t,n){var r=this,i=e.errors.slice(0),o=e.schema;if(o.$schema){var s=an(o.$schema);if("http://json-schema.org/draft-03/schema"===s)return this.promise.resolve(new rn({},[Zt("json.schema.draft03.notsupported","Draft-03 schemas are not supported.")]));"https://json-schema.org/draft/2019-09/schema"===s&&i.push(Zt("json.schema.draft201909.notsupported","Draft 2019-09 schemas are not yet fully supported."))}var a=this.contextService,c=function(e,t,n,r){var o=r?decodeURIComponent(r):void 0,s=function(e,t){if(!t)return e;var n=e;return"/"===t[0]&&(t=t.substr(1)),t.split("/").some((function(e){return e=e.replace(/~1/g,"/").replace(/~0/g,"~"),!(n=n[e])})),n}(t,o);if(s)for(var a in s)s.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(e[a]=s[a]);else i.push(Zt("json.schema.invalidref","$ref '{0}' in '{1}' can not be resolved.",o,n))},u=function(e,t,n,o,s){a&&!/^[A-Za-z][A-Za-z0-9+\-.+]*:\/\/.*/.test(t)&&(t=a.resolveRelativePath(t,o)),t=an(t);var u=r.getOrAddSchemaHandle(t);return u.getUnresolvedSchema().then((function(r){if(s[t]=!0,r.errors.length){var o=n?t+"#"+n:t;i.push(Zt("json.schema.problemloadingref","Problems loading reference '{0}': {1}",o,r.errors[0]))}return c(e,r.schema,t,n),l(e,r.schema,t,u.dependencies)}))},l=function(e,t,n,i){if(!e||"object"!=typeof e)return Promise.resolve(null);for(var o=[e],s=[],a=[],l=function(e){for(var r=[];e.$ref;){var s=e.$ref,l=s.split("#",2);if(delete e.$ref,l[0].length>0)return void a.push(u(e,l[0],l[1],n,i));-1===r.indexOf(s)&&(c(e,t,n,l[1]),r.push(s))}!function(){for(var e=[],t=0;t=0||(s.push(f),l(f))}return r.promise.all(a)};return l(o,o,t,n).then((function(e){return new rn(o,i)}))},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&"object"===t.root.type){var n=t.root.properties.filter((function(e){return"$schema"===e.keyNode.value&&e.valueNode&&"string"===e.valueNode.type}));if(n.length>0){var r=n[0].valueNode;if(r&&"string"===r.type){var i=Jt(r);if(i&&W(i,".")&&this.contextService&&(i=this.contextService.resolveRelativePath(i,e)),i){var o=an(i);return this.getOrAddSchemaHandle(o).getResolvedSchema()}}}}if(this.cachedSchemaForResource&&this.cachedSchemaForResource.resource===e)return this.cachedSchemaForResource.resolvedSchema;for(var s=Object.create(null),a=[],c=function(e){try{return L.parse(e).with({fragment:null,query:null}).toString()}catch(t){return e}}(e),u=0,l=this.filePatternAssociations;u0?this.createCombinedSchema(e,a).getResolvedSchema():this.promise.resolve(void 0);return this.cachedSchemaForResource={resource:e,resolvedSchema:m},m},e.prototype.createCombinedSchema=function(e,t){if(1===t.length)return this.getOrAddSchemaHandle(t[0]);var n="schemaservice://combinedSchema/"+encodeURIComponent(e),r={allOf:t.map((function(e){return{$ref:e}}))};return this.addSchemaHandle(n,r)},e.prototype.getMatchingSchemas=function(e,t,n){if(n){var r=n.id||"schemaservice://untitled/matchingSchemas/"+sn++;return this.resolveSchemaContent(new nn(n),r,{}).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}(),sn=0;function an(e){try{return L.parse(e).toString()}catch(t){return e}}function cn(e){try{var t=L.parse(e);if("file"===t.scheme)return t.fsPath}catch(e){}return e}var un=n(4458);function ln(e){try{return new RegExp(e,"u")}catch(t){return new RegExp(e)}}function fn(e,t){for(let n=++t;n!!e&&"object"==typeof e&&e[vn]===hn,wn=e=>!!e&&"object"==typeof e&&e[vn]===dn,_n=e=>!!e&&"object"==typeof e&&e[vn]===pn,Sn=e=>!!e&&"object"==typeof e&&e[vn]===mn,kn=e=>!!e&&"object"==typeof e&&e[vn]===gn,xn=e=>!!e&&"object"==typeof e&&e[vn]===yn;function Cn(e){if(e&&"object"==typeof e)switch(e[vn]){case pn:case yn:return!0}return!1}function Tn(e){if(e&&"object"==typeof e)switch(e[vn]){case hn:case pn:case gn:case yn:return!0}return!1}const En=e=>(kn(e)||Cn(e))&&!!e.anchor;class Pn{constructor(e){Object.defineProperty(this,vn,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}}const Rn=Symbol("break visit"),An=Symbol("skip children"),On=Symbol("remove node");function $n(e,t){const n=Dn(t);wn(e)?Nn(null,e.contents,n,Object.freeze([e]))===On&&(e.contents=null):Nn(null,e,n,Object.freeze([]))}function Nn(e,t,n,r){const i=Mn(e,t,n,r);if(Tn(i)||Sn(i))return qn(e,r,i),Nn(e,i,n,r);if("symbol"!=typeof i)if(Cn(t)){r=Object.freeze(r.concat(t));for(let e=0;e"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,r]=e.match(/^(.*!)([^!]*)$/);r||t(`The ${e} tag has no suffix`);const i=this.tags[n];return i?i+decodeURIComponent(r):"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+e.substring(n.length).replace(/[!,[\]{}]/g,(e=>Fn[e]));return"!"===e[0]?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(e&&n.length>0&&Tn(e.contents)){const t={};$n(e.contents,((e,n)=>{Tn(n)&&n.tag&&(t[n.tag]=!0)})),r=Object.keys(t)}else r=[];for(const[i,o]of n)"!!"===i&&"tag:yaml.org,2002:"===o||e&&!r.some((e=>e.startsWith(o)))||t.push(`%TAG ${i} ${o}`);return t.join("\n")}}function Vn(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function Wn(e){const t=new Set;return $n(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Un(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}Ln.defaultYaml={explicit:!1,version:"1.2"},Ln.defaultTags={"!!":"tag:yaml.org,2002:"};class Bn extends Pn{constructor(e){super(hn),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return $n(e,{Node:(e,n)=>{if(n===this)return $n.BREAK;n.anchor===this.source&&(t=n)}}),t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r);if(!o){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}const s=n.get(o);if(!s||void 0===s.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(s.count+=1,0===s.aliasCount&&(s.aliasCount=Kn(r,o,n)),s.count*s.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return s.res}toString(e,t,n){const r=`*${this.source}`;if(e){if(Vn(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${r} `}return r}}function Kn(e,t,n){if(bn(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Cn(t)){let r=0;for(const i of t.items){const t=Kn(e,i,n);t>r&&(r=t)}return r}if(Sn(t)){const r=Kn(e,t.key,n),i=Kn(e,t.value,n);return Math.max(r,i)}return 1}function zn(e,t,n){if(Array.isArray(e))return e.map(((e,t)=>zn(e,String(t),n)));if(e&&"function"==typeof e.toJSON){if(!n||!En(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof e||n?.keep?e:Number(e)}const Hn=e=>!e||"function"!=typeof e&&"object"!=typeof e;class Jn extends Pn{constructor(e){super(gn),this.value=e}toJSON(e,t){return t?.keep?this.value:zn(this.value,e,t)}toString(){return String(this.value)}}Jn.BLOCK_FOLDED="BLOCK_FOLDED",Jn.BLOCK_LITERAL="BLOCK_LITERAL",Jn.PLAIN="PLAIN",Jn.QUOTE_DOUBLE="QUOTE_DOUBLE",Jn.QUOTE_SINGLE="QUOTE_SINGLE";const Gn="tag:yaml.org,2002:";function Yn(e,t,n){if(wn(e)&&(e=e.contents),Tn(e))return e;if(Sn(e)){const t=n.schema[pn].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n;let c;if(r&&e&&"object"==typeof e){if(c=a.get(e),c)return c.anchor||(c.anchor=i(e)),new Bn(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=Gn+t.slice(2));let u=function(e,t,n){if(t){const e=n.filter((e=>e.tag===t)),r=e.find((e=>!e.format))??e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find((t=>t.identify?.(e)&&!t.format))}(e,t,s.tags);if(!u){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){const t=new Jn(e);return c&&(c.node=t),t}u=e instanceof Map?s[pn]:Symbol.iterator in Object(e)?s[yn]:s[pn]}o&&(o(u),delete n.onTagObj);const l=u?.createNode?u.createNode(n.schema,e,n):new Jn(e);return t&&(l.tag=t),c&&(c.node=l),l}function Qn(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){const n=t[e];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Yn(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Xn=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class Zn extends Pn{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map((t=>Tn(t)||Sn(t)?t.clone(e):t)),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Xn(e))this.add(t);else{const[n,...r]=e,i=this.get(n,!0);if(Cn(i))i.addIn(r,t);else{if(void 0!==i||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Qn(this.schema,r,t))}}}deleteIn(e){const[t,...n]=e;if(0===n.length)return this.delete(t);const r=this.get(t,!0);if(Cn(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...r]=e,i=this.get(n,!0);return 0===r.length?!t&&kn(i)?i.value:i:Cn(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every((t=>{if(!Sn(t))return!1;const n=t.value;return null==n||e&&kn(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn(e){const[t,...n]=e;if(0===n.length)return this.has(t);const r=this.get(t,!0);return!!Cn(r)&&r.hasIn(n)}setIn(e,t){const[n,...r]=e;if(0===r.length)this.set(n,t);else{const e=this.get(n,!0);if(Cn(e))e.setIn(r,t);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,Qn(this.schema,r,t))}}}}Zn.maxFlowStringSingleLineLength=60;const er=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function tr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const nr=(e,t,n)=>e.endsWith("\n")?tr(n,t):n.includes("\n")?"\n"+tr(n,t):(e.endsWith(" ")?"":" ")+n,rr="flow",ir="block",or="quoted";function sr(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return e;const c=Math.max(1+o,1+i-t.length);if(e.length<=c)return e;const u=[],l={};let f,h,d=i-t.length;"number"==typeof r&&(r>i-Math.max(2,o)?u.push(0):d=i-r);let p=!1,m=-1,g=-1,y=-1;n===ir&&(m=ar(e,m),-1!==m&&(d=m+c));for(let t;t=e[m+=1];){if(n===or&&"\\"===t){switch(g=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if("\n"===t)n===ir&&(m=ar(e,m)),d=m+c,f=void 0;else{if(" "===t&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const t=e[m+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(f=m)}if(m>=d)if(f)u.push(f),d=f+c,f=void 0;else if(n===or){for(;" "===h||"\t"===h;)h=t,t=e[m+=1],p=!0;const n=m>y+1?m-2:g-1;if(l[n])return e;u.push(n),l[n]=!0,d=n+c,f=void 0}else p=!0}h=t}if(p&&a&&a(),0===u.length)return e;s&&s();let v=e.slice(0,u[0]);for(let r=0;r({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ur=e=>/^(%|---|\.\.\.)/m.test(e);function lr(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(ur(e)?" ":"");let s="",a=0;for(let e=0,t=n[e];t;t=n[++e])if(" "===t&&"\\"===n[e+1]&&"n"===n[e+2]&&(s+=n.slice(a,e)+"\\ ",e+=1,a=e,t="\\"),"\\"===t)switch(n[e+1]){case"u":{s+=n.slice(a,e);const t=n.substr(e+2,4);switch(t){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:"00"===t.substr(0,2)?s+="\\x"+t.substr(2):s+=n.substr(e,6)}e+=5,a=e+1}break;case"n":if(r||'"'===n[e+2]||n.lengthr)return!0;if(n=t+1,i-n<=r)return!1}return!0}(n,c,u.length));if(!n)return l?"|\n":">\n";let f,h;for(h=n.length;h>0;--h){const e=n[h-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let d=n.substring(h);const p=d.indexOf("\n");-1===p?f="-":n===d||p!==d.length-1?(f="+",o&&o()):f="",d&&(n=n.slice(0,-d.length),"\n"===d[d.length-1]&&(d=d.slice(0,-1)),d=d.replace(/\n+(?!\n|$)/g,`$&${u}`));let m,g=!1,y=-1;for(m=0;m")+(g?u?"2":"1":"")+f;return e&&(b+=" "+a(e.replace(/ ?[\r\n]+/g," ")),i&&i()),l?`${b}\n${u}${v}${n=n.replace(/\n+/g,`$&${u}`)}${d}`:`${b}\n${u}${sr(`${v}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`)}${d}`,u,ir,cr(r,!0))}`}function pr(e,t,n,r){const{implicitKey:i,inFlow:o}=t,s="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==Jn.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Jn.QUOTE_DOUBLE);const c=e=>{switch(e){case Jn.BLOCK_FOLDED:case Jn.BLOCK_LITERAL:return i||o?hr(s.value,t):dr(s,t,n,r);case Jn.QUOTE_DOUBLE:return lr(s.value,t);case Jn.QUOTE_SINGLE:return fr(s.value,t);case Jn.PLAIN:return function(e,t,n,r){const{type:i,value:o}=e,{actualString:s,implicitKey:a,indent:c,indentStep:u,inFlow:l}=t;if(a&&/[\n[\]{},]/.test(o)||l&&/[[\]{},]/.test(o))return hr(o,t);if(!o||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||l||!o.includes("\n")?hr(o,t):dr(e,t,n,r);if(!a&&!l&&i!==Jn.PLAIN&&o.includes("\n"))return dr(e,t,n,r);if(ur(o)){if(""===c)return t.forceBlockIndent=!0,dr(e,t,n,r);if(a&&c===u)return hr(o,t)}const f=o.replace(/\n+/g,`$&\n${c}`);if(s){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(f),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return hr(o,t)}return a?f:sr(f,c,rr,cr(t,!1))}(s,t,n,r);default:return null}};let u=c(a);if(null===u){const{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(u=c(r),null===u)throw new Error(`Unsupported default string type ${r}`)}return u}function mr(e,t){const n=Object.assign({blockQuote:!0,commentString:er,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:r,options:n}}function gr(e,t,n,r){if(Sn(e))return e.toString(t,n,r);if(bn(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const o=Tn(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i||(i=function(e,t){if(t.tag){const n=e.filter((e=>e.tag===t.tag));if(n.length>0)return n.find((e=>e.format===t.format))??n[0]}let n,r;if(kn(t)){r=t.value;const i=e.filter((e=>e.identify?.(r)));n=i.find((e=>e.format===t.format))??i.find((e=>!e.format))}else r=t,n=e.find((e=>e.nodeClass&&r instanceof e.nodeClass));if(!n)throw new Error(`Tag not resolved for ${r?.constructor?.name??typeof r} value`);return n}(t.doc.schema.tags,o));const s=function(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],o=(kn(e)||Cn(e))&&e.anchor;o&&Vn(o)&&(n.add(o),i.push(`&${o}`));const s=e.tag?e.tag:t.default?null:t.tag;return s&&i.push(r.directives.tagString(s)),i.join(" ")}(o,i,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);const a="function"==typeof i.stringify?i.stringify(o,t,n,r):kn(o)?pr(o,t,n,r):o.toString(t,n,r);return s?kn(o)||"{"===a[0]||"["===a[0]?`${s} ${a}`:`${s}\n${t.indent}${a}`:a}var yr=n(4155);function vr(e,t){"debug"!==e&&"warn"!==e||(void 0!==yr&&yr.emitWarning?yr.emitWarning(t):console.warn(t))}function br(e,t,{key:n,value:r}){if(e?.doc.schema.merge&&wr(n))if(r=bn(r)?r.resolve(e.doc):r,xn(r))for(const n of r.items)_r(e,t,n);else if(Array.isArray(r))for(const n of r)_r(e,t,n);else _r(e,t,r);else{const i=zn(n,"",e);if(t instanceof Map)t.set(i,zn(r,i,e));else if(t instanceof Set)t.add(i);else{const o=function(e,t,n){if(null===t)return"";if("object"!=typeof t)return String(t);if(Tn(e)&&n&&n.doc){const t=mr(n.doc,{});t.anchors=new Set;for(const e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+'..."'),vr(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}(n,i,e),s=zn(r,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}const wr=e=>"<<"===e||kn(e)&&"<<"===e.value&&(!e.type||e.type===Jn.PLAIN);function _r(e,t,n){const r=e&&bn(n)?n.resolve(e.doc):n;if(!_n(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Sr(e,t,n){const r=Yn(e,void 0,n),i=Yn(t,void 0,n);return new kr(r,i)}class kr{constructor(e,t=null){Object.defineProperty(this,vn,{value:mn}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Tn(t)&&(t=t.clone(e)),Tn(n)&&(n=n.clone(e)),new kr(t,n)}toJSON(e,t){return br(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?function({key:e,value:t},n,r,i){const{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:u,indentSeq:l,simpleKeys:f}}=n;let h=Tn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Cn(e))throw new Error("With simple keys, collection cannot be used as a key value")}let d=!f&&(!e||h&&null==t&&!n.inFlow||Cn(e)||(kn(e)?e.type===Jn.BLOCK_FOLDED||e.type===Jn.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!d&&(f||!o),indent:a+c});let p,m,g,y=!1,v=!1,b=gr(e,n,(()=>y=!0),(()=>v=!0));if(!d&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(n.inFlow){if(o||null==t)return y&&r&&r(),""===b?"?":d?`? ${b}`:b}else if(o&&!f||null==t&&d)return b=`? ${b}`,h&&!y?b+=nr(b,n.indent,u(h)):v&&i&&i(),b;y&&(h=null),d?(h&&(b+=nr(b,n.indent,u(h))),b=`? ${b}\n${a}:`):(b=`${b}:`,h&&(b+=nr(b,n.indent,u(h)))),Tn(t)?(p=!!t.spaceBefore,m=t.commentBefore,g=t.comment):(p=!1,m=null,g=null,t&&"object"==typeof t&&(t=s.createNode(t))),n.implicitKey=!1,d||h||!kn(t)||(n.indentAtStart=b.length+1),v=!1,l||!(c.length>=2)||n.inFlow||d||!xn(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let w=!1;const _=gr(t,n,(()=>w=!0),(()=>v=!0));let S=" ";if(h||p||m)S=p?"\n":"",m&&(S+=`\n${tr(u(m),n.indent)}`),""!==_||n.inFlow?S+=`\n${n.indent}`:"\n"===S&&(S="\n\n");else if(!d&&Cn(t)){const e=_[0],r=_.indexOf("\n"),i=-1!==r,o=n.inFlow??t.flow??0===t.items.length;if(i||!o){let t=!1;if(i&&("&"===e||"!"===e)){let n=_.indexOf(" ");"&"===e&&-1!==n&&ns=null),(()=>f=!0));s&&(a+=nr(a,o,u(s))),f&&s&&(f=!1),h.push(r+a)}let d;if(0===h.length)d=i.start+i.end;else{d=h[0];for(let e=1;eo=null));eh||s.includes("\n"))&&(f=!0),d.push(s),h=d.length}let p;const{start:m,end:g}=r;if(0===d.length)p=m+g;else if(f||(f=d.reduce(((e,t)=>e+t.length+2),2)>Zn.maxFlowStringSingleLineLength),f){p=m;for(const e of d)p+=e?`\n${a}${s}${e}`:"\n";p+=`\n${s}${g}`}else p=`${m}${c}${d.join(" ")}${c}${g}`;return e&&(p+=nr(p,s,u(e)),o&&o()),p}function Er({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const i=tr(t(r),e);n.push(i.trimStart())}}function Pr(e,t){const n=kn(t)?t.value:t;for(const r of e)if(Sn(r)){if(r.key===t||r.key===n)return r;if(kn(r.key)&&r.key.value===n)return r}}class Rr extends Zn{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(pn,e),this.items=[]}add(e,t){let n;n=Sn(e)?e:e&&"object"==typeof e&&"key"in e?new kr(e.key,e.value):new kr(e,e?.value);const r=Pr(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);kn(r.value)&&Hn(n.value)?r.value.value=n.value:r.value=n.value}else if(i){const e=this.items.findIndex((e=>i(n,e)<0));-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=Pr(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=Pr(this.items,e),r=n?.value;return(!t&&kn(r)?r.value:r)??void 0}has(e){return!!Pr(this.items,e)}set(e,t){this.add(new kr(e,t),!0)}toJSON(e,t,n){const r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(const e of this.items)br(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!Sn(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),xr(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Ar={collection:"map",createNode:function(e,t,n){const{keepUndefined:r,replacer:i}=n,o=new Rr(e),s=(e,s)=>{if("function"==typeof i)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==s||r)&&o.items.push(Sr(e,s,n))};if(t instanceof Map)for(const[e,n]of t)s(e,n);else if(t&&"object"==typeof t)for(const e of Object.keys(t))s(e,t[e]);return"function"==typeof e.sortMapEntries&&o.items.sort(e.sortMapEntries),o},default:!0,nodeClass:Rr,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(_n(e)||t("Expected a mapping for this tag"),e)};class Or extends Zn{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(yn,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=$r(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){const n=$r(e);if("number"!=typeof n)return;const r=this.items[n];return!t&&kn(r)?r.value:r}has(e){const t=$r(e);return"number"==typeof t&&t=0?t:null}const Nr={collection:"seq",createNode:function(e,t,n){const{replacer:r}=n,i=new Or(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let o of t){if("function"==typeof r){const n=t instanceof Set?o:String(e++);o=r.call(t,n,o)}i.items.push(Yn(o,void 0,n))}}return i},default:!0,nodeClass:Or,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(xn(e)||t("Expected a sequence for this tag"),e)},jr={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,n,r)=>pr(e,t=Object.assign({actualString:!0},t),n,r)},Ir={identify:e=>null==e,createNode:()=>new Jn(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Jn(null),stringify:({source:e},t)=>"string"==typeof e&&Ir.test.test(e)?e:t.options.nullStr},Dr={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Jn("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},n)=>e&&Dr.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?n.options.trueStr:n.options.falseStr};function Mr({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);const i="number"==typeof r?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(o)){let e=o.indexOf(".");e<0&&(e=o.length,o+=".");let n=t-(o.length-e-1);for(;n-- >0;)o+="0"}return o}const qr={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Mr},Fr={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Mr(e)}},Lr={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Jn(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Mr},Vr=e=>"bigint"==typeof e||Number.isInteger(e),Wr=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Ur(e,t,n){const{value:r}=e;return Vr(r)&&r>=0?n+r.toString(t):Mr(e)}const Br={identify:e=>Vr(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Wr(e,2,8,n),stringify:e=>Ur(e,8,"0o")},Kr={identify:Vr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Wr(e,0,10,n),stringify:Mr},zr={identify:e=>Vr(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Wr(e,2,16,n),stringify:e=>Ur(e,16,"0x")},Hr=[Ar,Nr,jr,Ir,Dr,Br,Kr,zr,qr,Fr,Lr];function Jr(e){return"bigint"==typeof e||Number.isInteger(e)}const Gr=({value:e})=>JSON.stringify(e),Yr=[Ar,Nr].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Gr},{identify:e=>null==e,createNode:()=>new Jn(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Gr},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:Gr},{identify:Jr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Jr(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Gr}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),Qr={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"==typeof Buffer)return Buffer.from(e,"base64");if("function"==typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let e=0;e1&&t("Each pair must have its own sequence indicator");const e=r.items[0]||new kr(new Jn(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){const t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=Sn(r)?r:new kr(r)}}else t("Expected a sequence for this tag");return e}function Zr(e,t,n){const{replacer:r}=n,i=new Or(e);i.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let s,a;if("function"==typeof r&&(e=r.call(t,String(o++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);s=e[0],a=e[1]}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected { key: value } tuple: ${e}`);s=t[0],a=e[s]}else s=e;i.items.push(Sr(s,a,n))}return i}const ei={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Xr,createNode:Zr};class ti extends Or{constructor(){super(),this.add=Rr.prototype.add.bind(this),this.delete=Rr.prototype.delete.bind(this),this.get=Rr.prototype.get.bind(this),this.has=Rr.prototype.has.bind(this),this.set=Rr.prototype.set.bind(this),this.tag=ti.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t?.onCreate&&t.onCreate(n);for(const e of this.items){let r,i;if(Sn(e)?(r=zn(e.key,"",t),i=zn(e.value,r,t)):r=zn(e,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}}ti.tag="tag:yaml.org,2002:omap";const ni={collection:"seq",identify:e=>e instanceof Map,nodeClass:ti,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Xr(e,t),r=[];for(const{key:e}of n.items)kn(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new ti,n)},createNode(e,t,n){const r=Zr(e,t,n),i=new ti;return i.items=r.items,i}};function ri({value:e,source:t},n){return t&&(e?ii:oi).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const ii={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Jn(!0),stringify:ri},oi={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new Jn(!1),stringify:ri},si={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Mr},ai={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Mr(e)}},ci={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Jn(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(-1!==n){const r=e.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(t.minFractionDigits=r.length)}return t},stringify:Mr},ui=e=>"bigint"==typeof e||Number.isInteger(e);function li(e,t,n,{intAsBigInt:r}){const i=e[0];if("-"!==i&&"+"!==i||(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===i?BigInt(-1)*t:t}const o=parseInt(e,n);return"-"===i?-1*o:o}function fi(e,t,n){const{value:r}=e;if(ui(r)){const e=r.toString(t);return r<0?"-"+n+e.substr(1):n+e}return Mr(e)}const hi={identify:ui,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>li(e,2,2,n),stringify:e=>fi(e,2,"0b")},di={identify:ui,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>li(e,1,8,n),stringify:e=>fi(e,8,"0")},pi={identify:ui,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>li(e,0,10,n),stringify:Mr},mi={identify:ui,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>li(e,2,16,n),stringify:e=>fi(e,16,"0x")};class gi extends Rr{constructor(e){super(e),this.tag=gi.tag}add(e){let t;t=Sn(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new kr(e.key,null):new kr(e,null),Pr(this.items,t.key)||this.items.push(t)}get(e,t){const n=Pr(this.items,e);return!t&&Sn(n)?kn(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const n=Pr(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new kr(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}}gi.tag="tag:yaml.org,2002:set";const yi={collection:"map",identify:e=>e instanceof Set,nodeClass:gi,default:!1,tag:"tag:yaml.org,2002:set",resolve(e,t){if(_n(e)){if(e.hasAllNullValues(!0))return Object.assign(new gi,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e},createNode(e,t,n){const{replacer:r}=n,i=new gi(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof r&&(e=r.call(t,e,e)),i.items.push(Sr(e,null,n));return i}};function vi(e,t){const n=e[0],r="-"===n||"+"===n?e.substring(1):e,i=e=>t?BigInt(e):Number(e),o=r.replace(/_/g,"").split(":").reduce(((e,t)=>e*i(60)+i(t)),i(0));return"-"===n?i(-1)*o:o}function bi(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Mr(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),o=[t%i];return t<60?o.unshift(0):(t=(t-o[0])/i,o.unshift(t%i),t>=60&&(t=(t-o[0])/i,o.unshift(t))),r+o.map((e=>e<10?"0"+String(e):String(e))).join(":").replace(/000000\d*$/,"")}const wi={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>vi(e,n),stringify:bi},_i={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>vi(e,!1),stringify:bi},Si={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Si.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,o,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,r-1,i,o||0,s||0,a||0,c);const l=t[8];if(l&&"Z"!==l){let e=vi(l,!1);Math.abs(e)<30&&(e*=60),u-=6e4*e}return new Date(u)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},ki=[Ar,Nr,jr,Ir,ii,oi,hi,di,pi,mi,si,ai,ci,Qr,ni,ei,yi,wi,_i,Si],xi=new Map([["core",Hr],["failsafe",[Ar,Nr,jr]],["json",Yr],["yaml11",ki],["yaml-1.1",ki]]),Ci={binary:Qr,bool:Dr,float:Lr,floatExp:Fr,floatNaN:qr,floatTime:_i,int:Kr,intHex:zr,intOct:Br,intTime:wi,map:Ar,null:Ir,omap:ni,pairs:ei,seq:Nr,set:yi,timestamp:Si},Ti={"tag:yaml.org,2002:binary":Qr,"tag:yaml.org,2002:omap":ni,"tag:yaml.org,2002:pairs":ei,"tag:yaml.org,2002:set":yi,"tag:yaml.org,2002:timestamp":Si};function Ei(e,t){let n=xi.get(t);if(!n){if(!Array.isArray(e)){const e=Array.from(xi.keys()).filter((e=>"yaml11"!==e)).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}n=[]}if(Array.isArray(e))for(const t of e)n=n.concat(t);else"function"==typeof e&&(n=e(n.slice()));return n.map((e=>{if("string"!=typeof e)return e;const t=Ci[e];if(t)return t;const n=Object.keys(Ci).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${e}"; use one of ${n}`)}))}const Pi=(e,t)=>e.keyt.key?1:0;class Ri{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Ei(e,"compat"):e?Ei(null,e):null,this.merge=!!n,this.name="string"==typeof i&&i||"core",this.knownTags=r?Ti:{},this.tags=Ei(t,this.name),this.toStringOptions=s??null,Object.defineProperty(this,pn,{value:Ar}),Object.defineProperty(this,gn,{value:jr}),Object.defineProperty(this,yn,{value:Nr}),this.sortMapEntries="function"==typeof o?o:!0===o?Pi:null}clone(){const e=Object.create(Ri.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Ai(e,t,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let t=0,n=r.length;t"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),r=t}else void 0===n&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:s,keepUndefined:a,onTagObj:c,tag:u}=n??{},{onAnchor:l,setAnchors:f,sourceObjects:h}=function(e,t){const n=[],r=new Map;let i=null;return{onAnchor:r=>{n.push(r),i||(i=Wn(e));const o=Un(t,i);return i.add(o),o},setAnchors:()=>{for(const e of n){const t=r.get(e);if("object"!=typeof t||!t.anchor||!kn(t.node)&&!Cn(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:r}}(this,o||"a"),d=Yn(e,u,{aliasDuplicateObjects:i??!0,keepUndefined:a??!1,onAnchor:l,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:h});return s&&Cn(d)&&(d.flow=!0),f(),d}createPair(e,t,n={}){const r=this.createNode(e,null,n),i=this.createNode(t,null,n);return new kr(r,i)}delete(e){return!!$i(this.contents)&&this.contents.delete(e)}deleteIn(e){return Xn(e)?null!=this.contents&&(this.contents=null,!0):!!$i(this.contents)&&this.contents.deleteIn(e)}get(e,t){return Cn(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Xn(e)?!t&&kn(this.contents)?this.contents.value:this.contents:Cn(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!Cn(this.contents)&&this.contents.has(e)}hasIn(e){return Xn(e)?void 0!==this.contents:!!Cn(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=Qn(this.schema,[e],t):$i(this.contents)&&this.contents.set(e,t)}setIn(e,t){Xn(e)?this.contents=t:null==this.contents?this.contents=Qn(this.schema,Array.from(e),t):$i(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ln({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ln({version:e}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new Ri(Object.assign(n,t))}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){const s={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100,stringify:gr},a=zn(this.contents,t??"",s);if("function"==typeof i)for(const{count:e,res:t}of s.anchors.values())i(t,e);return"function"==typeof o?Ai(o,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){const n=[];let r=!0===t.directives;if(!1!==t.directives&&e.directives){const t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=mr(e,t),{commentString:o}=i.options;if(e.commentBefore){1!==n.length&&n.unshift("");const t=o(e.commentBefore);n.unshift(tr(t,""))}let s=!1,a=null;if(e.contents){if(Tn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const t=o(e.contents.commentBefore);n.push(tr(t,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}const t=a?void 0:()=>s=!0;let c=gr(e.contents,i,(()=>a=null),t);a&&(c+=nr(c,"",o(a))),"|"!==c[0]&&">"!==c[0]||"---"!==n[n.length-1]?n.push(c):n[n.length-1]=`--- ${c}`}else n.push(gr(e.contents,i));if(e.directives?.docEnd)if(e.comment){const t=o(e.comment);t.includes("\n")?(n.push("..."),n.push(tr(t,""))):n.push(`... ${t}`)}else n.push("...");else{let t=e.comment;t&&s&&(t=t.replace(/^\n+/,"")),t&&(s&&!a||""===n[n.length-1]||n.push(""),n.push(tr(o(t),"")))}return n.join("\n")+"\n"}(this,e)}}function $i(e){if(Cn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Ni extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}}class ji extends Ni{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Ii extends Ni{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const Di=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((e=>t.linePos(e)));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,s=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){const e=Math.min(o-39,s.length-79);s="…"+s.substring(e),o-=e-1}if(s.length>80&&(s=s.substring(0,79)+"…"),r>1&&/^ *$/.test(s.substring(0,o))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),s=n+s}if(/[^ ]/.test(s)){let e=1;const t=n.linePos[1];t&&t.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-o)));const a=" ".repeat(o)+"^".repeat(e);n.message+=`:\n\n${s}\n${a}\n`}};function Mi(e,{flow:t,indicator:n,next:r,offset:i,onError:o,startOnNewline:s}){let a=!1,c=s,u=s,l="",f="",h=!1,d=!1,p=!1,m=null,g=null,y=null,v=null,b=null;for(const r of e)switch(p&&("space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p=!1),r.type){case"space":!t&&c&&"doc-start"!==n&&"\t"===r.source[0]&&o(r,"TAB_AS_INDENT","Tabs are not allowed as indentation"),u=!0;break;case"comment":{u||o(r,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=r.source.substring(1)||" ";l?l+=f+e:l=e,f="",c=!1;break}case"newline":c?l?l+=r.source:a=!0:f+=r.source,c=!0,h=!0,(m||g)&&(d=!0),u=!0;break;case"anchor":m&&o(r,"MULTIPLE_ANCHORS","A node can have at most one anchor"),r.source.endsWith(":")&&o(r.offset+r.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=r,null===b&&(b=r.offset),c=!1,u=!1,p=!0;break;case"tag":g&&o(r,"MULTIPLE_TAGS","A node can have at most one tag"),g=r,null===b&&(b=r.offset),c=!1,u=!1,p=!0;break;case n:(m||g)&&o(r,"BAD_PROP_ORDER",`Anchors and tags must be after the ${r.source} indicator`),v&&o(r,"UNEXPECTED_TOKEN",`Unexpected ${r.source} in ${t??"collection"}`),v=r,c=!1,u=!1;break;case"comma":if(t){y&&o(r,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),y=r,c=!1,u=!1;break}default:o(r,"UNEXPECTED_TOKEN",`Unexpected ${r.type} token`),c=!1,u=!1}const w=e[e.length-1],_=w?w.offset+w.source.length:i;return p&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),{comma:y,found:v,spaceBefore:a,comment:l,hasNewline:h,hasNewlineAfterProp:d,anchor:m,tag:g,end:_,start:b??_}}function qi(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end)for(const t of e.end)if("newline"===t.type)return!0;return!1;case"flow-collection":for(const t of e.items){for(const e of t.start)if("newline"===e.type)return!0;if(t.sep)for(const e of t.sep)if("newline"===e.type)return!0;if(qi(t.key)||qi(t.value))return!0}return!1;default:return!0}}function Fi(e,t,n){if("flow-collection"===t?.type){const r=t.end[0];r.indent!==e||"]"!==r.source&&"}"!==r.source||!qi(t)||n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Li(e,t,n){const{uniqueKeys:r}=e.options;if(!1===r)return!1;const i="function"==typeof r?r:(t,n)=>t===n||kn(t)&&kn(n)&&t.value===n.value&&!("<<"===t.value&&e.schema.merge);return t.some((e=>i(e.key,n)))}const Vi="All mapping items must start at the same column";function Wi(e,t,n,r){let i="";if(e){let o=!1,s="";for(const a of e){const{source:e,type:c}=a;switch(c){case"space":o=!0;break;case"comment":{n&&!o&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";i?i+=s+t:i=t,s="";break}case"newline":i&&(s+=e),o=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}const Ui="Block collections are not allowed within flow collections",Bi=e=>e&&("block-map"===e.type||"block-seq"===e.type);function Ki(e){let t,n;try{t=new RegExp("(.*?)(?"===i.mode?Jn.BLOCK_FOLDED:Jn.BLOCK_LITERAL,s=e.source?function(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let e=1;e=0;--e){const t=s[e][1];if(""!==t&&"\r"!==t)break;a=e}if(0===a){const t="+"===i.chomp&&s.length>0?"\n".repeat(Math.max(1,s.length-1)):"";let n=r+i.length;return e.source&&(n+=e.source.length),{value:t,type:o,comment:i.comment,range:[r,n,n]}}let c=e.indent+i.indent,u=e.offset+i.length,l=0;for(let e=0;ec&&(c=t.length),u+=t.length+r.length+1}for(let e=s.length-1;e>=a;--e)s[e][0].length>c&&(a=e+1);let f="",h="",d=!1;for(let e=0;ec||"\t"===r[0]?(" "===h?h="\n":d||"\n"!==h||(h="\n\n"),f+=h+t.slice(c)+r,h="\n",d=!0):""===r?"\n"===h?f+="\n":h="\n":(f+=h+r,h=" ",d=!1)}switch(i.chomp){case"-":break;case"+":for(let e=a;en(r+e,t,i);switch(i){case"scalar":a=Jn.PLAIN,c=function(e,t){let n="";switch(e[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${e[0]}`;break;case"@":case"`":n=`reserved character ${e[0]}`}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Ki(e)}(o,u);break;case"single-quoted-scalar":a=Jn.QUOTE_SINGLE,c=function(e,t){return"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote"),Ki(e.slice(1,-1)).replace(/''/g,"'")}(o,u);break;case"double-quoted-scalar":a=Jn.QUOTE_DOUBLE,c=function(e,t){let n="";for(let r=1;rt?e.slice(t,r+1):i)}else n+=i}return'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}(o,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const l=r+o.length,f=Wi(s,l,t,n);return{value:c,type:a,comment:f.comment,range:[r,l,f.offset]}}(t,e.options.strict,r),c=n?e.directives.tagName(n.source,(e=>r(n,"TAG_RESOLVE_FAILED",e))):null,u=n&&c?function(e,t,n,r,i){if("!"===n)return e[gn];const o=[];for(const t of e.tags)if(!t.collection&&t.tag===n){if(!t.default||!t.test)return t;o.push(t)}for(const e of o)if(e.test?.test(t))return e;const s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),e[gn])}(e.schema,i,c,n,r):"scalar"===t.type?function({directives:e,schema:t},n,r,i){const o=t.tags.find((e=>e.default&&e.test?.test(n)))||t[gn];if(t.compat){const s=t.compat.find((e=>e.default&&e.test?.test(n)))??t[gn];o.tag!==s.tag&&i(r,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${e.tagString(o.tag)} or ${e.tagString(s.tag)}`,!0)}return o}(e,i,t,r):e.schema[gn];let l;try{const o=u.resolve(i,(e=>r(n??t,"TAG_RESOLVE_FAILED",e)),e.options);l=kn(o)?o:new Jn(o)}catch(e){const o=e instanceof Error?e.message:String(e);r(n??t,"TAG_RESOLVE_FAILED",o),l=new Jn(i)}return l.range=a,l.source=i,o&&(l.type=o),c&&(l.tag=c),u.format&&(l.format=u.format),s&&(l.comment=s),l}function Yi(e,t,n){if(t){null===n&&(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}for(n=t[++r];"space"===n?.type;)e+=n.source.length,n=t[++r];break}}return e}const Qi={composeNode:Xi,composeEmptyNode:Zi};function Xi(e,t,n,r){const{spaceBefore:i,comment:o,anchor:s,tag:a}=n;let c,u=!0;switch(t.type){case"alias":c=function({options:e},{offset:t,source:n,end:r},i){const o=new Bn(n.substring(1));""===o.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const s=t+n.length,a=Wi(r,s,e.strict,i);return o.range=[t,s,a.offset],a.comment&&(o.comment=a.comment),o}(e,t,r),(s||a)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Gi(e,t,a,r),s&&(c.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=function(e,t,n,r,i){let o;switch(n.type){case"block-map":o=function({composeNode:e,composeEmptyNode:t},n,r,i){const o=new Rr(n.schema);n.atRoot&&(n.atRoot=!1);let s=r.offset,a=null;for(const c of r.items){const{start:u,key:l,sep:f,value:h}=c,d=Mi(u,{indicator:"explicit-key-ind",next:l??f?.[0],offset:s,onError:i,startOnNewline:!0}),p=!d.found;if(p){if(l&&("block-seq"===l.type?i(s,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in l&&l.indent!==r.indent&&i(s,"BAD_INDENT",Vi)),!d.anchor&&!d.tag&&!f){a=d.end,d.comment&&(o.comment?o.comment+="\n"+d.comment:o.comment=d.comment);continue}(d.hasNewlineAfterProp||qi(l))&&i(l??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==r.indent&&i(s,"BAD_INDENT",Vi);const m=d.end,g=l?e(n,l,d,i):t(n,m,u,null,d,i);n.schema.compat&&Fi(r.indent,l,i),Li(n,o.items,g)&&i(m,"DUPLICATE_KEY","Map keys must be unique");const y=Mi(f??[],{indicator:"map-value-ind",next:h,offset:g.range[2],onError:i,startOnNewline:!l||"block-scalar"===l.type});if(s=y.end,y.found){p&&("block-map"!==h?.type||y.hasNewline||i(s,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&d.start0){const e=Wi(h,d,n.options.strict,i);e.comment&&(a.comment?a.comment+="\n"+e.comment:a.comment=e.comment),a.range=[r.offset,d,e.offset]}else a.range=[r.offset,d,d];return a}(e,t,n,i)}if(!r)return o;const s=t.directives.tagName(r.source,(e=>i(r,"TAG_RESOLVE_FAILED",e)));if(!s)return o;const a=o.constructor;if("!"===s||s===a.tagName)return o.tag=a.tagName,o;const c=_n(o)?"map":"seq";let u=t.schema.tags.find((e=>e.collection===c&&e.tag===s));if(!u){const e=t.schema.knownTags[s];if(!e||e.collection!==c)return i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),o.tag=s,o;t.schema.tags.push(Object.assign({},e,{default:!1})),u=e}const l=u.resolve(o,(e=>i(r,"TAG_RESOLVE_FAILED",e)),t.options),f=Tn(l)?l:new Jn(l);return f.range=o.range,f.tag=s,u?.format&&(f.format=u.format),f}(Qi,e,t,a,r),s&&(c.anchor=s.source.substring(1));break;default:r(t,"UNEXPECTED_TOKEN","error"===t.type?t.message:`Unsupported token (type: ${t.type})`),c=Zi(e,t.offset,void 0,null,n,r),u=!1}return s&&""===c.anchor&&r(s,"BAD_ALIAS","Anchor cannot be an empty string"),i&&(c.spaceBefore=!0),o&&("scalar"===t.type&&""===t.source?c.comment=o:c.commentBefore=o),e.options.keepSourceTokens&&u&&(c.srcToken=t),c}function Zi(e,t,n,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},u){const l=Gi(e,{type:"scalar",offset:Yi(t,n,r),indent:-1,source:""},a,u);return s&&(l.anchor=s.source.substring(1),""===l.anchor&&u(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(l.spaceBefore=!0),o&&(l.comment=o,l.range[2]=c),l}function eo(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+("string"==typeof n?n.length:1)]}function to(e){let t="",n=!1,r=!1;for(let i=0;i{const i=eo(e);r?this.warnings.push(new Ii(i,t,n)):this.errors.push(new ji(i,t,n))},this.directives=new Ln({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:r}=to(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Cn(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Sn(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{const e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:to(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,((t,n,r)=>{const i=eo(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,r)})),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=function(e,t,{offset:n,start:r,value:i,end:o},s){const a=Object.assign({_directives:t},e),c=new Oi(void 0,a),u={atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},l=Mi(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:s,startOnNewline:!0});l.found&&(c.directives.docStart=!0,!i||"block-map"!==i.type&&"block-seq"!==i.type||l.hasNewline||s(l.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Xi(u,i,l,s):Zi(u,l.end,r,null,l,s);const f=c.contents.range[2],h=Wi(o,f,!1,s);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new ji(eo(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new ji(eo(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=!0;const t=Wi(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ji(eo(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),n=new Oi(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}}const ro=e=>"type"in e?io(e):oo(e);function io(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=io(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=oo(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=oo(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=oo(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function oo({start:e,key:t,sep:n,value:r}){let i="";for(const t of e)i+=t.source;if(t&&(i+=io(t)),n)for(const e of n)i+=e.source;return r&&(i+=io(r)),i}const so=Symbol("break visit"),ao=Symbol("skip children"),co=Symbol("remove item");function uo(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),lo(Object.freeze([]),e,t)}function lo(e,t,n){let r=n(t,e);if("symbol"==typeof r)return r;for(const i of["key","value"]){const o=t[i];if(o&&"items"in o){for(let t=0;t{let n=e;for(const[e,r]of t){const t=n?.[e];if(!t||!("items"in t))return;n=t.items[r]}return n},uo.parentCollection=(e,t)=>{const n=uo.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};const fo=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type);function ho(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const po="0123456789ABCDEFabcdef".split(""),mo="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""),go=",[]{}".split(""),yo=" ,[]{}\n\r\t".split(""),vo=e=>!e||yo.includes(e);class bo{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){e&&(this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null),this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;" "===t;)t=this.buffer[++n+e];if("\r"===t){const t=this.buffer[n+e+1];if("\n"===t||!t&&!this.atEnd)return e+n+1}return"\n"===t||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if("-"===t||"."===t){const t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&ho(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&ethis.indentValue&&!ho(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&ho(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(vo),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(!0)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do{e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=(yield*this.pushSpaces(!0))}while(e+t>0);const r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil((e=>ho(e)||"#"===e))}*parseBlockScalar(){let e,t=this.pos-1,n=0;e:for(let r=this.pos;e=this.buffer[r];++r)switch(e){case" ":n+=1;break;case"\n":t=r,n=0;break;case"\r":{const e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext+=this.blockScalarIndent;do{const e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t);if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}if(!this.blockScalarKeep)for(;;){let e=t-1,r=this.buffer[e];"\r"===r&&(r=this.buffer[--e]);const i=e;for(;" "===r||"\t"===r;)r=this.buffer[--e];if(!("\n"===r&&e>=this.pos&&e+1+n>i))break;t=e}return yield"",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t,n=this.pos-1,r=this.pos-1;for(;t=this.buffer[++r];)if(":"===t){const t=this.buffer[r+1];if(ho(t)||e&&","===t)break;n=r}else if(ho(t)){let i=this.buffer[r+1];if("\r"===t&&("\n"===i?(r+=1,t="\n",i=this.buffer[r+1]):n=r),"#"===i||e&&go.includes(i))break;if("\n"===t){const e=this.continueScalar(r+1);if(-1===e)break;r=Math.max(r,e-2)}}else{if(e&&go.includes(t))break;n=r}return t||this.atEnd?(yield"",yield*this.pushToIndex(n+1,!0),e?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(vo))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(ho(t)||e&&go.includes(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!ho(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(mo.includes(t))t=this.buffer[++e];else{if("%"!==t||!po.includes(this.buffer[e+1])||!po.includes(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n]}while(" "===t||e&&"\t"===t);const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class wo{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[r]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;"space"===e[++t]?.type;);return e.splice(t,e.length)}function To(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||_o(t.start,"explicit-key-ind")||_o(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,ko(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class Eo{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new bo,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=e.length);const t=function(e){switch(e){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&To(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!_o(n.start,"explicit-key-ind"));n.value=t;break}case"block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t)}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===So(n.start)&&(0===t.indent||n.start.every((e=>"comment"!==e.type||e.indent=e.indent){const n=!this.onKeyLine&&this.indent===e.indent&&t.sep;let r=[];if(n&&t.sep&&!t.value){const n=[];for(let r=0;re.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(r=t.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(n||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"explicit-key-ind":return t.sep||_o(t.start,"explicit-key-ind")?n||t.value?(r.push(this.sourceToken),e.items.push({start:r})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}):t.start.push(this.sourceToken),void(this.onKeyLine=!0);case"map-value-ind":if(_o(t.start,"explicit-key-ind"))if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_o(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(ko(t.key)&&!_o(t.sep,"newline")){const e=Co(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(_o(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const e=Co(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:r,key:null,sep:[this.sourceToken]}):_o(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);return void(n||t.value?(e.items.push({start:r,key:i,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(i):(Object.assign(t,{key:i,sep:[]}),this.onKeyLine=!0))}default:{const i=this.startBlockValue(e);if(i)return n&&"block-seq"!==i.type&&_o(t.start,"explicit-key-ind")&&e.items.push({start:r}),void this.stack.push(i)}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;"comment"===r?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r))return Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;return void t.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==e.indent)break;return void(t.value||_o(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1)}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void e.end.push(this.sourceToken)}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const n=Co(xo(t));To(e);const r=e.end.splice(1,e.end.length);r.push(this.sourceToken);const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=Co(xo(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Co(xo(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every((e=>"newline"===e.type||"space"===e.type))}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}function Po(e,t,n){let r;"function"==typeof t?r=t:void 0===n&&t&&"object"==typeof t&&(n=t);const i=function(e,t={}){const{lineCounter:n,prettyErrors:r}=function(e){const t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new wo||null,prettyErrors:t}}(t),i=new Eo(n?.addNewLine),o=new no(t);let s=null;for(const t of o.compose(i.parse(e),!0,e.length))if(s){if("silent"!==s.options.logLevel){s.errors.push(new ji(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else s=t;return r&&n&&(s.errors.forEach(Di(e,n)),s.warnings.forEach(Di(e,n))),s}(e,n);if(!i)return null;if(i.warnings.forEach((e=>vr(i.options.logLevel,e))),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Ro(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n=0;t--){var n=this.contributions[t].resolveCompletion;if(n){var r=n(e);if(r)return r}}return this.promiseConstructor.resolve(e)},e.prototype.doComplete=function(e,t,n){var r=this,i={items:[],isIncomplete:!1},o=e.getText(),s=e.offsetAt(t),a=n.getNodeFromOffset(s,!0);if(this.isInComment(e,a?a.offset:0,s))return Promise.resolve(i);if(a&&s===a.offset+a.length&&s>0){var c=o[s-1];("object"===a.type&&"}"===c||"array"===a.type&&"]"===c)&&(a=a.parent)}var u,l=this.getCurrentWord(e,s);if(!a||"string"!==a.type&&"number"!==a.type&&"boolean"!==a.type&&"null"!==a.type){var f=s-l.length;f>0&&'"'===o[f-1]&&f--,u=ee.create(e.positionAt(f),t)}else u=ee.create(e.positionAt(a.offset),e.positionAt(a.offset+a.length));var h={},d={add:function(e){var t=e.label,n=h[t];if(n)n.documentation||(n.documentation=e.documentation),n.detail||(n.detail=e.detail);else{if((t=t.replace(/[\n]/g,"↵")).length>60){var r=t.substr(0,57).trim()+"...";h[r]||(t=r)}u&&void 0!==e.insertText&&(e.textEdit=pe.replace(u,e.insertText)),e.label=t,h[t]=e,i.items.push(e)}},setAsIncomplete:function(){i.isIncomplete=!0},error:function(e){console.error(e)},log:function(e){console.log(e)},getNumberOfProposals:function(){return i.items.length}};return this.schemaService.getSchemaForResource(e.uri,n).then((function(t){var c=[],f=!0,p="",m=void 0;if(a&&"string"===a.type){var g=a.parent;g&&"property"===g.type&&g.keyNode===a&&(f=!g.valueNode,m=g,p=o.substr(a.offset+1,a.length-2),g&&(a=g.parent))}if(a&&"object"===a.type){if(a.offset===s)return i;a.properties.forEach((function(e){m&&m===e||(h[e.keyNode.value]=Ve.create("__"))}));var y="";f&&(y=r.evaluateSeparatorAfter(e,e.offsetAt(u.end))),t?r.getPropertyCompletions(t,n,a,f,y,d):r.getSchemaLessPropertyCompletions(n,a,p,d);var v=Gt(a);r.contributions.forEach((function(t){var n=t.collectPropertyCompletions(e.uri,v,l,f,""===y,d);n&&c.push(n)})),!t&&l.length>0&&'"'!==o.charAt(s-l.length-1)&&(d.add({kind:Ie.Property,label:r.getLabelForValue(l),insertText:r.getInsertTextForProperty(l,void 0,!1,y),insertTextFormat:De.Snippet,documentation:""}),d.setAsIncomplete())}var b={};return t?r.getValueCompletions(t,n,a,s,e,d,b):r.getSchemaLessValueCompletions(n,a,s,e,d),r.contributions.length>0&&r.getContributedValueCompletions(n,a,s,e,d,c),r.promiseConstructor.all(c).then((function(){if(0===d.getNumberOfProposals()){var t=s;!a||"string"!==a.type&&"number"!==a.type&&"boolean"!==a.type&&"null"!==a.type||(t=a.offset+a.length);var n=r.evaluateSeparatorAfter(e,t);r.addFillerValueCompletions(b,n,d)}return i}))}))},e.prototype.getPropertyCompletions=function(e,t,n,r,i,o){var s=this;t.getMatchingSchemas(e.schema,n.offset).forEach((function(e){if(e.node===n&&!e.inverted){var t=e.schema.properties;t&&Object.keys(t).forEach((function(e){var n=t[e];if("object"==typeof n&&!n.deprecationMessage&&!n.doNotSuggest){var a={kind:Ie.Property,label:e,insertText:s.getInsertTextForProperty(e,n,r,i),insertTextFormat:De.Snippet,filterText:s.getFilterTextForValue(e),documentation:s.fromMarkup(n.markdownDescription)||n.description||""};void 0!==n.suggestSortText&&(a.sortText=n.suggestSortText),a.insertText&&U(a.insertText,"$1"+i)&&(a.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(a)}}));var a=e.schema.propertyNames;if("object"==typeof a&&!a.deprecationMessage&&!a.doNotSuggest){var c=function(e,t){void 0===t&&(t=void 0);var n={kind:Ie.Property,label:e,insertText:s.getInsertTextForProperty(e,void 0,r,i),insertTextFormat:De.Snippet,filterText:s.getFilterTextForValue(e),documentation:t||s.fromMarkup(a.markdownDescription)||a.description||""};void 0!==a.suggestSortText&&(n.sortText=a.suggestSortText),n.insertText&&U(n.insertText,"$1"+i)&&(n.command={title:"Suggest",command:"editor.action.triggerSuggest"}),o.add(n)};if(a.enum)for(var u=0;u(t.colonOffset||0)){var u=t.valueNode;if(u&&(n>u.offset+u.length||"object"===u.type||"array"===u.type))return;var l=t.keyNode.value;e.visit((function(e){return"property"===e.type&&e.keyNode.value===l&&e.valueNode&&c(e.valueNode),!0})),"$schema"===l&&t.parent&&!t.parent.parent&&this.addDollarSchemaCompletions(a,i)}if("array"===t.type)if(t.parent&&"property"===t.parent.type){var f=t.parent.keyNode.value;e.visit((function(e){return"property"===e.type&&e.keyNode.value===f&&e.valueNode&&"array"===e.valueNode.type&&e.valueNode.items.forEach(c),!0}))}else t.items.forEach(c)},e.prototype.getValueCompletions=function(e,t,n,r,i,o,s){var a=r,c=void 0,u=void 0;if(!n||"string"!==n.type&&"number"!==n.type&&"boolean"!==n.type&&"null"!==n.type||(a=n.offset+n.length,u=n,n=n.parent),n){if("property"===n.type&&r>(n.colonOffset||0)){var l=n.valueNode;if(l&&r>l.offset+l.length)return;c=n.keyNode.value,n=n.parent}if(n&&(void 0!==c||"array"===n.type)){for(var f=this.evaluateSeparatorAfter(i,a),h=0,d=t.getMatchingSchemas(e.schema,n.offset,u);h(t.colonOffset||0)){var s=t.keyNode.value,a=t.valueNode;if((!a||n<=a.offset+a.length)&&t.parent){var c=Gt(t.parent);this.contributions.forEach((function(e){var t=e.collectValueCompletions(r.uri,c,s,i);t&&o.push(t)}))}}}else this.contributions.forEach((function(e){var t=e.collectDefaultCompletions(r.uri,i);t&&o.push(t)}))},e.prototype.addSchemaValueCompletions=function(e,t,n,r){var i=this;"object"==typeof e&&(this.addEnumValueCompletions(e,t,n),this.addDefaultValueCompletions(e,t,n),this.collectTypes(e,r),Array.isArray(e.allOf)&&e.allOf.forEach((function(e){return i.addSchemaValueCompletions(e,t,n,r)})),Array.isArray(e.anyOf)&&e.anyOf.forEach((function(e){return i.addSchemaValueCompletions(e,t,n,r)})),Array.isArray(e.oneOf)&&e.oneOf.forEach((function(e){return i.addSchemaValueCompletions(e,t,n,r)})))},e.prototype.addDefaultValueCompletions=function(e,t,n,r){var i=this;void 0===r&&(r=0);var o=!1;if(H(e.default)){for(var s=e.type,a=e.default,c=r;c>0;c--)a=[a],s="array";n.add({kind:this.getSuggestionKind(s),label:this.getLabelForValue(a),insertText:this.getInsertTextForValue(a,t),insertTextFormat:De.Snippet,detail:Vo("json.suggest.default","Default value")}),o=!0}Array.isArray(e.examples)&&e.examples.forEach((function(s){for(var a=e.type,c=s,u=r;u>0;u--)c=[c],a="array";n.add({kind:i.getSuggestionKind(a),label:i.getLabelForValue(c),insertText:i.getInsertTextForValue(c,t),insertTextFormat:De.Snippet}),o=!0})),Array.isArray(e.defaultSnippets)&&e.defaultSnippets.forEach((function(s){var a,c,u=e.type,l=s.body,f=s.label;if(H(l)){e.type;for(var h=r;h>0;h--)l=[l];a=i.getInsertTextForSnippetValue(l,t),c=i.getFilterTextForSnippetValue(l),f=f||i.getLabelForSnippetValue(l)}else{if("string"!=typeof s.bodyText)return;var d="",p="",m="";for(h=r;h>0;h--)d=d+m+"[\n",p=p+"\n"+m+"]",m+="\t",u="array";a=d+m+s.bodyText.split("\n").join("\n"+m)+p+t,f=f||a,c=a.replace(/[\n]/g,"")}n.add({kind:i.getSuggestionKind(u),label:f,documentation:i.fromMarkup(s.markdownDescription)||s.description,insertText:a,insertTextFormat:De.Snippet,filterText:c}),o=!0})),!o&&"object"==typeof e.items&&!Array.isArray(e.items)&&r<5&&this.addDefaultValueCompletions(e.items,t,n,r+1)},e.prototype.addEnumValueCompletions=function(e,t,n){if(H(e.const)&&n.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,t),insertTextFormat:De.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(var r=0,i=e.enum.length;r0?t[0]:void 0}if(!e)return Ie.Value;switch(e){case"string":default:return Ie.Value;case"object":return Ie.Module;case"property":return Ie.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,n){switch(e.type){case"array":return this.getInsertTextForValue([],n);case"object":return this.getInsertTextForValue({},n);default:var r=t.getText().substr(e.offset,e.length)+n;return this.getInsertTextForPlainText(r)}},e.prototype.getInsertTextForProperty=function(e,t,n,r){var i=this.getInsertTextForValue(e,"");if(!n)return i;var o,s=i+": ",a=0;if(t){if(Array.isArray(t.defaultSnippets)){if(1===t.defaultSnippets.length){var c=t.defaultSnippets[0].body;H(c)&&(o=this.getInsertTextForSnippetValue(c,""))}a+=t.defaultSnippets.length}if(t.enum&&(o||1!==t.enum.length||(o=this.getInsertTextForGuessedValue(t.enum[0],"")),a+=t.enum.length),H(t.default)&&(o||(o=this.getInsertTextForGuessedValue(t.default,"")),a++),Array.isArray(t.examples)&&t.examples.length&&(o||(o=this.getInsertTextForGuessedValue(t.examples[0],"")),a+=t.examples.length),0===a){var u=Array.isArray(t.type)?t.type[0]:t.type;switch(u||(t.properties?u="object":t.items&&(u="array")),u){case"boolean":o="$1";break;case"string":o='"$1"';break;case"object":o="{$1}";break;case"array":o="[$1]";break;case"number":case"integer":o="${1:0}";break;case"null":o="${1:null}";break;default:return i}}}return(!o||a>1)&&(o="$1"),s+o+r},e.prototype.getCurrentWord=function(e,t){for(var n=t-1,r=e.getText();n>=0&&-1===' \t\n\r\v":{[,]}'.indexOf(r.charAt(n));)n--;return r.substring(n+1,t)},e.prototype.evaluateSeparatorAfter=function(e,t){var n=A(e.getText(),!0);switch(n.setPosition(t),n.scan()){case 5:case 2:case 4:case 17:return"";default:return","}},e.prototype.findItemAtOffset=function(e,t,n){for(var r=A(t.getText(),!0),i=e.items,o=i.length-1;o>=0;o--){var s=i[o];if(n>s.offset+s.length)return r.setPosition(s.offset+s.length),5===r.scan()&&n>=r.getTokenOffset()+r.getTokenLength()?o+1:o;if(n>=s.offset)return o}return 0},e.prototype.isInComment=function(e,t,n){var r=A(e.getText(),!1);r.setPosition(t);for(var i=r.scan();17!==i&&r.getTokenOffset()+r.getTokenLength()=Qo&&e<=Xo?e-Qo+10:0)}function es(e){if("#"===e[0])switch(e.length){case 4:return{red:17*Zo(e.charCodeAt(1))/255,green:17*Zo(e.charCodeAt(2))/255,blue:17*Zo(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*Zo(e.charCodeAt(1))/255,green:17*Zo(e.charCodeAt(2))/255,blue:17*Zo(e.charCodeAt(3))/255,alpha:17*Zo(e.charCodeAt(4))/255};case 7:return{red:(16*Zo(e.charCodeAt(1))+Zo(e.charCodeAt(2)))/255,green:(16*Zo(e.charCodeAt(3))+Zo(e.charCodeAt(4)))/255,blue:(16*Zo(e.charCodeAt(5))+Zo(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*Zo(e.charCodeAt(1))+Zo(e.charCodeAt(2)))/255,green:(16*Zo(e.charCodeAt(3))+Zo(e.charCodeAt(4)))/255,blue:(16*Zo(e.charCodeAt(5))+Zo(e.charCodeAt(6)))/255,alpha:(16*Zo(e.charCodeAt(7))+Zo(e.charCodeAt(8)))/255}}}var ts=function(){function e(e){this.schemaService=e}return e.prototype.findDocumentSymbols=function(e,t,n){var r=this;void 0===n&&(n={resultLimit:Number.MAX_VALUE});var i=t.root;if(!i)return[];var o=n.resultLimit||Number.MAX_VALUE,s=e.uri;if(("vscode://defaultsettings/keybindings.json"===s||U(s.toLowerCase(),"/user/keybindings.json"))&&"array"===i.type){for(var a=[],c=0,u=i.items;c0){o--;var s=te.create(e.uri,ns(e,t)),a=n?n+"."+t.keyNode.value:t.keyNode.value;v.push({name:r.getKeyLabel(t),kind:r.getSymbolKind(i.type),location:s,containerName:n}),m.push({node:i,containerName:a})}else y=!0}))};g0){o--;var s=ns(e,t),a=s,c={name:String(i),kind:r.getSymbolKind(t.type),range:s,selectionRange:a,children:[]};n.push(c),y.push({result:c.children,node:t})}else b=!0})):"object"===t.type&&t.properties.forEach((function(t){var i=t.valueNode;if(i)if(o>0){o--;var s=ns(e,t),a=ns(e,t.keyNode),c=[],u={name:r.getKeyLabel(t),kind:r.getSymbolKind(i.type),range:s,selectionRange:a,children:c,detail:r.getDetail(i)};n.push(u),y.push({result:c,node:i})}else b=!0}))};v=e)return n;return 1===t.documents.length?t.documents[0]:null}function gs(e){const t=["mapping","scalar","sequence"];return e?e.filter((e=>{if("string"==typeof e){const n=e.split(" "),r=n[1]&&n[1].toLowerCase()||"scalar";return"map"!==r&&-1!==t.indexOf(r)}return!1})):[]}function ys(e,t){if(!t||!e)return!1;if(t.length!==e.length)return!1;for(let n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}const vs=un.loadMessageBundle(),bs="Property {0} is not allowed.",ws={"color-hex":{errorMessage:vs("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:vs("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:vs("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:vs("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:vs("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,}))$/},ipv4:{errorMessage:vs("ipv4FormatWarning","String does not match IPv4 format."),pattern:/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/},ipv6:{errorMessage:vs("ipv6FormatWarning","String does not match IPv6 format."),pattern:/^([0-9a-f]|:){1,4}(:([0-9a-f]{0,4})*){1,7}$/i}},_s="YAML",Ss="yaml-schema: ";var ks;!function(e){e.missingRequiredPropWarning="missingRequiredPropWarning",e.typeMismatchWarning="typeMismatchWarning",e.constWarning="constWarning"}(ks||(ks={}));const xs={[ks.missingRequiredPropWarning]:'Missing property "{0}".',[ks.typeMismatchWarning]:'Incorrect type. Expected "{0}".',[ks.constWarning]:"Value must be {0}."};class Cs{constructor(e,t,n,r){this.offset=n,this.length=r,this.parent=e,this.internalNode=t}getNodeFromOffsetEndInclusive(e){const t=[],n=r=>{if(e>=r.offset&&e<=r.offset+r.length){const i=r.children;for(let r=0;rJSON.stringify(e))).join(", ")))}}mergeWarningGeneric(e,t){if(this.problems?.length)for(const n of t){const t=this.problems.filter((e=>e.problemType===n));for(const r of t){const t=e.problems?.find((e=>e.problemType===n&&r.location.offset===e.location.offset&&(n!==ks.missingRequiredPropWarning||ys(e.problemArgs,r.problemArgs))));t&&(t.problemArgs?.length&&(t.problemArgs.filter((e=>!r.problemArgs.includes(e))).forEach((e=>r.problemArgs.push(e))),r.message=Ks(r.problemType,r.problemArgs)),this.mergeSources(t,r))}}}mergePropertyMatch(e){this.merge(e),this.propertiesMatches++,(e.enumValueMatch||!e.hasProblems()&&e.propertiesMatches)&&this.propertiesValueMatches++,e.enumValueMatch&&e.enumValues&&this.primaryValueMatches++}mergeSources(e,t){const n=e.source.replace(Ss,"");t.source.includes(n)||(t.source=t.source+" | "+n),t.schemaUri.includes(e.schemaUri[0])||(t.schemaUri=t.schemaUri.concat(e.schemaUri))}compareGeneric(e){const t=this.hasProblems();return t!==e.hasProblems()?t?-1:1:this.enumValueMatch!==e.enumValueMatch?e.enumValueMatch?-1:1:this.propertiesValueMatches!==e.propertiesValueMatches?this.propertiesValueMatches-e.propertiesValueMatches:this.primaryValueMatches!==e.primaryValueMatches?this.primaryValueMatches-e.primaryValueMatches:this.propertiesMatches-e.propertiesMatches}compareKubernetes(e){const t=this.hasProblems();return this.propertiesMatches!==e.propertiesMatches?this.propertiesMatches-e.propertiesMatches:this.enumValueMatch!==e.enumValueMatch?e.enumValueMatch?-1:1:this.primaryValueMatches!==e.primaryValueMatches?this.primaryValueMatches-e.primaryValueMatches:this.propertiesValueMatches!==e.propertiesValueMatches?this.propertiesValueMatches-e.propertiesValueMatches:t!==e.hasProblems()?t?-1:1:this.propertiesMatches-e.propertiesMatches}}function qs(e){switch(e.type){case"array":return e.children.map(qs);case"object":{const t=Object.create(null);for(let n=0,r=e.children;n=e.offset&&t<=e.offset+e.length||n&&t===e.offset+e.length}function Ls(e,t,n){if(void 0===n&&(n=!1),Fs(e,t,n)){const r=e.children;if(Array.isArray(r))for(let e=0;e{let r=e(n);const i=n.children;if(Array.isArray(i))for(let e=0;e{const n=ee.create(e.positionAt(t.location.offset),e.positionAt(t.location.offset+t.location.length)),r=he.create(n,t.message,t.severity,t.code?t.code:Tt.Undefined,t.source);return r.data={schemaUri:t.schemaUri,...t.data},r}))}return null}getMatchingSchemas(e,t=-1,n=null,r){const i=new Is(t,n);return this.root&&e&&Ws(this.root,e,e,new Ms(this.isKubernetes),i,{isKubernetes:this.isKubernetes,disableAdditionalProperties:this.disableAdditionalProperties,uri:this.uri,callFromAutoComplete:r}),i.schemas}}function Ws(e,t,n,r,i,o){const{isKubernetes:a,callFromAutoComplete:c}=o;if(e&&"object"==typeof t){switch(t.url||(t.url=n.url),t.closestTitle=t.title||n.closestTitle,e.type){case"object":!function(e,t,r,i){const s=Object.create(null),c=[],u=[...e.properties];for(;u.length>0;){const e=u.pop(),t=e.keyNode.value;if("<<"===t&&e.valueNode)switch(e.valueNode.type){case"object":u.push(...e.valueNode.properties);break;case"array":e.valueNode.items.forEach((e=>{var t;e&&(t=e.properties,Symbol.iterator in Object(t))&&u.push(...e.properties)}))}else s[t]=e.valueNode,c.push(t)}if(Array.isArray(t.required))for(const i of t.required)if(void 0===s[i]){const o=e.parent&&"property"===e.parent.type&&e.parent.keyNode,s=o?{offset:o.offset,length:o.length}:{offset:e.offset,length:1};r.problems.push({location:s,severity:ue.Warning,message:Ks(ks.missingRequiredPropWarning,[i]),source:Us(t,n),schemaUri:Bs(t,n),problemArgs:[i],problemType:ks.missingRequiredPropWarning})}const l=e=>{let t=c.indexOf(e);for(;t>=0;)c.splice(t,1),t=c.indexOf(e)};if(t.properties)for(const e of Object.keys(t.properties)){l(e);const c=t.properties[e],u=s[e];if(u)if($o(c))if(c)r.propertiesMatches++,r.propertiesValueMatches++;else{const i=u.parent;r.problems.push({location:{offset:i.keyNode.offset,length:i.keyNode.length},severity:ue.Warning,message:t.errorMessage||vs("DisallowedExtraPropWarning",bs,e),source:Us(t,n),schemaUri:Bs(t,n)})}else{c.url=t.url??n.url;const e=new Ms(a);Ws(u,c,t,e,i,o),r.mergePropertyMatch(e),r.mergeEnumValues(e)}}if(t.patternProperties)for(const e of Object.keys(t.patternProperties)){const u=ln(e);for(const f of c.slice(0))if(u.test(f)){l(f);const c=s[f];if(c){const s=t.patternProperties[e];if($o(s))if(s)r.propertiesMatches++,r.propertiesValueMatches++;else{const e=c.parent;r.problems.push({location:{offset:e.keyNode.offset,length:e.keyNode.length},severity:ue.Warning,message:t.errorMessage||vs("DisallowedExtraPropWarning",bs,f),source:Us(t,n),schemaUri:Bs(t,n)})}else{const e=new Ms(a);Ws(c,s,t,e,i,o),r.mergePropertyMatch(e),r.mergeEnumValues(e)}}}}if("object"==typeof t.additionalProperties)for(const e of c){const n=s[e];if(n){const e=new Ms(a);Ws(n,t.additionalProperties,t,e,i,o),r.mergePropertyMatch(e),r.mergeEnumValues(e)}}else if((!1===t.additionalProperties||"object"===t.type&&void 0===t.additionalProperties&&!0===o.disableAdditionalProperties)&&c.length>0){const e=t.properties&&Object.keys(t.properties).filter((e=>!s[e]));for(const i of c){const o=s[i];if(o){let s=null;"property"!==o.type?(s=o.parent,"object"===s.type&&(s=s.properties[0])):s=o;const a={location:{offset:s.keyNode.offset,length:s.keyNode.length},severity:ue.Warning,message:t.errorMessage||vs("DisallowedExtraPropWarning",bs,i),source:Us(t,n),schemaUri:Bs(t,n)};e?.length&&(a.data={properties:e}),r.problems.push(a)}}}if(Ao(t.maxProperties)&&e.properties.length>t.maxProperties&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("MaxPropWarning","Object has more properties than limit of {0}.",t.maxProperties),source:Us(t,n),schemaUri:Bs(t,n)}),Ao(t.minProperties)&&e.properties.length=s.length&&r.propertiesValueMatches++}if(e.items.length>s.length)if("object"==typeof t.additionalItems)for(let n=s.length;n{if(n.oneOf&&1===n.oneOf.length){const a={...Ns(n.oneOf[0])};a.title=t.title,a.closestTitle=t.closestTitle,Ws(e,a,t,s,i,o),r.mergePropertyMatch(s),r.mergeEnumValues(s)}else Ws(e,n,t,s,i,o),r.mergePropertyMatch(s),r.mergeEnumValues(s)}))}}const s=Ns(t.contains);if(s&&(e.items.some((e=>{const n=new Ms(a);return Ws(e,s,t,n,Ds.instance,o),!n.hasProblems()}))||r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:t.errorMessage||vs("requiredItemMissingWarning","Array does not contain required item."),source:Us(t,n),schemaUri:Bs(t,n)})),Ao(t.minItems)&&e.items.lengtht.maxItems&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("maxItemsWarning","Array has too many items. Expected {0} or fewer.",t.maxItems),source:Us(t,n),schemaUri:Bs(t,n)}),!0===t.uniqueItems){const i=qs(e);i.some(((e,t)=>t!==i.lastIndexOf(e)))&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("uniqueItemsWarning","Array has duplicate items."),source:Us(t,n),schemaUri:Bs(t,n)})}}(e,t,r,i);break;case"string":!function(e,t,r){if(Ao(t.minLength)&&e.value.lengtht.maxLength&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("maxLengthWarning","String is longer than the maximum length of {0}.",t.maxLength),source:Us(t,n),schemaUri:Bs(t,n)}),No(t.pattern)&&(ln(t.pattern).test(e.value)||r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:t.patternErrorMessage||t.errorMessage||vs("patternWarning",'String does not match the pattern of "{0}".',t.pattern),source:Us(t,n),schemaUri:Bs(t,n)})),t.format)switch(t.format){case"uri":case"uri-reference":{let i;if(e.value)try{s.parse(e.value).scheme||"uri"!==t.format||(i=vs("uriSchemeMissing","URI with a scheme is expected."))}catch(e){i=e.message}else i=vs("uriEmpty","URI expected.");i&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:t.patternErrorMessage||t.errorMessage||vs("uriFormatWarning","String is not a URI: {0}",i),source:Us(t,n),schemaUri:Bs(t,n)})}break;case"color-hex":case"date-time":case"date":case"time":case"email":case"ipv4":case"ipv6":{const i=ws[t.format];e.value&&i.pattern.test(e.value)||r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:t.patternErrorMessage||t.errorMessage||i.errorMessage,source:Us(t,n),schemaUri:Bs(t,n)})}}}(e,t,r);break;case"number":!function(e,t,r){const i=e.value;function o(e,t){return Ao(t)?t:$o(t)&&t?e:void 0}function s(e,t){if(!$o(t)||!t)return e}Ao(t.multipleOf)&&i%t.multipleOf!=0&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("multipleOfWarning","Value is not divisible by {0}.",t.multipleOf),source:Us(t,n),schemaUri:Bs(t,n)});const a=o(t.minimum,t.exclusiveMinimum);Ao(a)&&i<=a&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("exclusiveMinimumWarning","Value is below the exclusive minimum of {0}.",a),source:Us(t,n),schemaUri:Bs(t,n)});const c=o(t.maximum,t.exclusiveMaximum);Ao(c)&&i>=c&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}.",c),source:Us(t,n),schemaUri:Bs(t,n)});const u=s(t.minimum,t.exclusiveMinimum);Ao(u)&&il&&r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("maximumWarning","Value is above the maximum of {0}.",l),source:Us(t,n),schemaUri:Bs(t,n)})}(e,t,r);break;case"property":return Ws(e.valueNode,t,t,r,i,o)}!function(){function s(t){return e.type===t||"integer"===t&&"number"===e.type&&e.isInteger}if(Array.isArray(t.type))t.type.some(s)||r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:t.errorMessage||vs("typeArrayMismatchWarning","Incorrect type. Expected one of {0}.",t.type.join(", ")),source:Us(t,n),schemaUri:Bs(t,n)});else if(t.type&&!s(t.type)){const i="object"===t.type?Io(t):t.type;r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:t.errorMessage||Ks(ks.typeMismatchWarning,[i]),source:Us(t,n),schemaUri:Bs(t,n),problemType:ks.typeMismatchWarning,problemArgs:[i]})}if(Array.isArray(t.allOf))for(const n of t.allOf)Ws(e,Ns(n),t,r,i,o);const f=Ns(t.not);if(f){const s=new Ms(a),c=i.newSub();Ws(e,f,t,s,c,o),s.hasProblems()||r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("notSchemaWarning","Matches a schema that is not allowed."),source:Us(t,n),schemaUri:Bs(t,n)});for(const e of c.schemas)e.inverted=!e.inverted,i.add(e)}const h=(s,f)=>{const h=[],d=[],p=[];let m=null;for(const n of s){const r={...Ns(n)},s=new Ms(a),g=i.newSub();Ws(e,r,t,s,g,o),s.hasProblems()&&!c||(h.push(r),d.push(r),0===s.propertiesMatches&&p.push(r),r.format&&d.pop()),m=m?a?u(s,m,r,g):l(e,f,s,m,r,g):{schema:r,validationResult:s,matchingSchemas:g}}return d.length>1&&(d.length>1||0===p.length)&&f&&r.problems.push({location:{offset:e.offset,length:1},severity:ue.Warning,message:vs("oneOfWarning","Matches multiple schemas when only one must validate."),source:Us(t,n),schemaUri:Bs(t,n)}),null!==m&&(r.merge(m.validationResult),r.propertiesMatches+=m.validationResult.propertiesMatches,r.propertiesValueMatches+=m.validationResult.propertiesValueMatches,r.enumValueMatch=r.enumValueMatch||m.validationResult.enumValueMatch,m.validationResult.enumValues?.length&&(r.enumValues=(r.enumValues||[]).concat(m.validationResult.enumValues)),i.merge(m.matchingSchemas)),h.length};Array.isArray(t.anyOf)&&h(t.anyOf,!1),Array.isArray(t.oneOf)&&h(t.oneOf,!0);const d=(t,n)=>{const s=new Ms(a),c=i.newSub();Ws(e,Ns(t),n,s,c,o),r.merge(s),r.propertiesMatches+=s.propertiesMatches,r.propertiesValueMatches+=s.propertiesValueMatches,i.merge(c)},p=Ns(t.if);if(p&&((n,r,s,c)=>{const u=Ns(n),l=new Ms(a),f=i.newSub();Ws(e,u,r,l,f,o),i.merge(f);const{filePatternAssociation:h}=u;h&&(new ya(h).matchesPattern(o.uri)||l.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,message:vs("ifFilePatternAssociation",`filePatternAssociation '${h}' does not match with doc uri '${o.uri}'.`),source:Us(t,r),schemaUri:Bs(t,r)})),l.hasProblems()?c&&d(c,r):s&&d(s,r)})(p,t,Ns(t.then),Ns(t.else)),Array.isArray(t.enum)){const i=qs(e);let o=!1;for(const e of t.enum)if(Ro(i,e)||c&&No(i)&&No(e)&&i&&e.startsWith(i)){o=!0;break}r.enumValues=t.enum,r.enumValueMatch=o,o||r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,code:Tt.EnumValueMismatch,message:t.errorMessage||vs("enumWarning","Value is not accepted. Valid values: {0}.",t.enum.map((e=>JSON.stringify(e))).join(", ")),source:Us(t,n),schemaUri:Bs(t,n)})}if(Oo(t.const)){const i=qs(e);Ro(i,t.const)||c&&No(i)&&No(t.const)&&t.const.startsWith(i)?r.enumValueMatch=!0:(r.problems.push({location:{offset:e.offset,length:e.length},severity:ue.Warning,code:Tt.EnumValueMismatch,problemType:ks.constWarning,message:t.errorMessage||Ks(ks.constWarning,[JSON.stringify(t.const)]),source:Us(t,n),schemaUri:Bs(t,n),problemArgs:[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:ue.Warning,message:t.deprecationMessage,source:Us(t,n),schemaUri:Bs(t,n)})}(),i.add({node:e,schema:t})}function u(e,t,n,r){const i=e.compareKubernetes(t.validationResult);return i>0?t={schema:n,validationResult:e,matchingSchemas:r}:0===i&&(t.matchingSchemas.merge(r),t.validationResult.mergeEnumValues(e)),t}function l(e,t,n,r,i,o){if(t||n.hasProblems()||r.validationResult.hasProblems()&&!c){const s=n.compareGeneric(r.validationResult);s>0||0===s&&t&&"object"===r.schema.type&&"null"!==e.type&&e.type!==r.schema.type?r={schema:i,validationResult:n,matchingSchemas:o}:0===s&&(r.matchingSchemas.merge(o),r.validationResult.mergeEnumValues(n),r.validationResult.mergeWarningGeneric(n,[ks.missingRequiredPropWarning,ks.typeMismatchWarning,ks.constWarning]))}else r.matchingSchemas.merge(o),r.validationResult.propertiesMatches+=n.propertiesMatches,r.validationResult.propertiesValueMatches+=n.propertiesValueMatches;return r}}function Us(e,t){if(e){let n;if(e.title)n=e.title;else if(e.closestTitle)n=e.closestTitle;else if(t.closestTitle)n=t.closestTitle;else{const r=e.url??t.url;if(r){const e=s.parse(r);"file"===e.scheme&&(n=e.fsPath),n=e.toString()}}if(n)return`${Ss}${n}`}return _s}function Bs(e,t){const n=e.url??t.url;return n?[n]:[]}function Ks(e,t){return vs(e,xs[e],t.join(" | "))}const zs=1e3;let Hs=0;const Js=new Set;function Gs(e,t,n,r){if(e||(Hs=0),!t)return null;if(_n(t))return function(e,t,n,r){let i;i=e.flow&&!e.range?function(e){let t=Number.MAX_SAFE_INTEGER,n=0;for(const r of e.items)Sn(r)&&(Tn(r.key)&&r.key.range&&r.key.range[0]<=t&&(t=r.key.range[0]),Tn(r.value)&&r.value.range&&r.value.range[2]>=n&&(n=r.value.range[2]));return[t,n,n]}(e):e.range;const o=new $s(t,e,...Qs(i,r));for(const t of e.items)Sn(t)&&o.properties.push(Gs(o,t,n,r));return o}(t,e,n,r);if(Sn(t))return function(e,t,n,r){const i=e.key,o=e.value,s=i.range[0];let a=i.range[1],c=i.range[2];o&&(a=o.range[1],c=o.range[2]);const u=new Os(t,e,...Qs([s,a,c],r));if(bn(i)){const e=new As(t,i,...Ys(i.range));e.value=i.source,u.keyNode=e}else u.keyNode=Gs(u,i,n,r);return u.valueNode=Gs(u,o,n,r),u}(t,e,n,r);if(xn(t))return function(e,t,n,r){const i=new Ps(t,e,...Ys(e.range));for(const t of e.items)if(Tn(t)){const e=Gs(i,t,n,r);e&&i.children.push(e)}return i}(t,e,n,r);if(kn(t))return function(e,t){if(null===e.value)return new Ts(t,e,...Ys(e.range));switch(typeof e.value){case"string":{const n=new As(t,e,...Ys(e.range));return n.value=e.value,n}case"boolean":return new Es(t,e,e.value,...Ys(e.range));case"number":{const n=new Rs(t,e,...Ys(e.range));return n.value=e.value,n.isInteger=Number.isInteger(n.value),n}default:{const n=new As(t,e,...Ys(e.range));return n.value=e.source,n}}}(t,e);if(bn(t)&&!Js.has(t)&&Hsthis._lineComments.push(`#${e}`))),$n(this.internalDocument,((e,t)=>{if(t?.commentBefore){const e=t?.commentBefore.split("\n");e.forEach((e=>this._lineComments.push(`#${e}`)))}t?.comment&&this._lineComments.push(`#${t.comment}`)})),this._internalDocument.comment&&this._lineComments.push(`#${this._internalDocument.comment}`)}updateFromInternalDocument(){this.root=Gs(null,this._internalDocument.contents,this._internalDocument,this.lineCounter)}set internalDocument(e){this._internalDocument=e,this.updateFromInternalDocument()}get internalDocument(){return this._internalDocument}get lineComments(){return this._lineComments||this.collectLineComments(),this._lineComments}set lineComments(e){this._lineComments=e}get errors(){return this.internalDocument.errors.map(ra)}get warnings(){return this.internalDocument.warnings.map(ra)}getNodeFromPosition(e,t,n){const r=t.getPosition(e),i=t.getLineContent(r.line);if(0===i.trim().length)return[this.findClosestNode(e,t,n),!0];const o=i.substring(r.character).match(/^([ ]+)\n?$/),s=!!o,a=o?.[1].length;let c;return $n(this.internalDocument,((t,n)=>{if(!n)return;const r=n.range;return r?r[0]<=e&&r[1]>=e||s&&e+a===r[2]&&kn(n)&&null===n.value?void(c=n):$n.SKIP:void 0})),[c,!1]}findClosestNode(e,t,n){let r,i=this.internalDocument.range[2],o=this.internalDocument.range[0];$n(this.internalDocument,((t,n)=>{if(!n)return;const s=n.range;if(!s)return;const a=s[1]-e;o<=s[0]&&a<=0&&Math.abs(a)<=i&&(i=Math.abs(a),o=s[0],r=n)}));const s=t.getPosition(e),a=function(e,t){if(e.lengthe&&s.character>0){const s=this.getParent(t);if(s)return this.getProperParentByIndentation(e,s,n,r,i,o)}else{if(!(s.character{if(r===t)return n=i[i.length-1],$n.BREAK})),!wn(n))return n}(this.internalDocument,e)}}class ta{constructor(e,t){this.documents=e,this.tokens=t,this.errors=[],this.warnings=[]}}const na=new class{constructor(){this.cache=new Map}getYamlDocument(e,t,n=!1){return this.ensureCache(e,t??ca,n),this.cache.get(e.uri).document}clear(){this.cache.clear()}ensureCache(e,t,n){const r=e.uri;this.cache.has(r)||this.cache.set(r,{version:-1,document:new ta([],[]),parserOptions:ca});const i=this.cache.get(r);if(i.version!==e.version||t.customTags&&!ys(i.parserOptions.customTags,t.customTags)){let r=e.getText();n&&!/\S/.test(r)&&(r=`{${r}}`);const o=function(e,t=ca,n){const r={strict:!1,customTags:sa(t.customTags),version:t.yamlVersion??ca.yamlVersion,keepSourceTokens:!0},i=new no(r),o=new wo;let s=!1;if(n){const t=new aa(n),r=t.getPosition(e.length);s=0===t.getLineContent(r.line).trim().length}const a=(s?new Eo:new Eo(o.addNewLine)).parse(e),c=Array.from(a),u=i.compose(c,!0,e.length),l=Array.from(u,(e=>function(e,t){const n=new ea(t);return n.internalDocument=e,n}(e,o)));return new ta(l,c)}(r,t,e);i.document=o,i.version=e.version,i.parserOptions=t}}};function ra(e){return{message:e.message,location:{start:e.pos[0],end:e.pos[1],toLineEnd:!0},severity:1,code:Tt.Undefined}}class ia{constructor(e,t){this.tag=e,this.type=t}get collection(){return"mapping"===this.type?"map":"sequence"===this.type?"seq":void 0}resolve(e){return _n(e)&&"mapping"===this.type||xn(e)&&"sequence"===this.type||"string"==typeof e&&"scalar"===this.type?e:void 0}}class oa{constructor(){this.tag="!include",this.type="scalar"}resolve(e,t){if(e&&e.length>0&&e.trim())return e;t("!include without value")}}function sa(e){const t=[],n=gs(e);for(const e of n){const n=e.split(" "),r=n[0],i=n[1]&&n[1].toLowerCase()||"scalar";t.push(new ia(r,i))}return t.push(new oa),t}class aa{constructor(e){this.doc=e}getLineCount(){return this.doc.lineCount}getLineLength(e){const t=this.doc.getLineOffsets();return e>=t.length?this.doc.getText().length:e<0?0:(e+1=t.length)return this.doc.getText();if(e<0)return"";const n=e+1{const o=((e,t)=>{if(!t)return e;let n=e;return"/"===t[0]&&(t=t.substr(1)),t.split("/").some((e=>(n=n[e],!n))),n})(t,i);if(o)for(const t in o)Object.prototype.hasOwnProperty.call(o,t)&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=o[t]);else r.push(ha("json.schema.invalidref","$ref '{0}' in '{1}' can not be resolved.",i,n))},a=(e,t,n,i,a)=>{o&&!/^\w+:\/\/.*/.test(t)&&(t=o.resolveRelativePath(t,i)),t=this.normalizeId(t);const u=this.getOrAddSchemaHandle(t);return u.getUnresolvedSchema().then((i=>{if(a[t]=!0,i.errors.length){const e=n?t+"#"+n:t;r.push(ha("json.schema.problemloadingref","Problems loading reference '{0}': {1}",e,i.errors[0]))}return s(e,i.schema,t,n),e.url=t,c(e,i.schema,t,u.dependencies)}))},c=async(e,t,n,r)=>{if(!e||"object"!=typeof e)return null;const o=[e],c=new Set,u=[],l=e=>{const i=new Set;for(;e.$ref;){const o=e.$ref,c=o.split("#",2);if(e._$ref=e.$ref,delete e.$ref,c[0].length>0)return void u.push(a(e,c[0],c[1],n,r));i.has(o)||(s(e,t,n,c[1]),i.add(o))}((...e)=>{for(const t of e)"object"==typeof t&&o.push(t)})(e.items,e.additionalItems,e.additionalProperties,e.not,e.contains,e.propertyNames,e.if,e.then,e.else),((...e)=>{for(const t of e)if("object"==typeof t)for(const e in t){const n=t[e];"object"==typeof n&&o.push(n)}})(e.definitions,e.properties,e.patternProperties,e.dependencies),((...e)=>{for(const t of e)if(Array.isArray(t))for(const e of t)"object"==typeof e&&o.push(e)})(e.anyOf,e.allOf,e.oneOf,e.items,e.schemaSequence)};if(n.indexOf("#")>0){const e=n.split("#",2);if(e[0].length>0&&e[1].length>0){const t={};await a(t,e[0],e[1],n,r);for(const e in i)"required"!==e&&Object.prototype.hasOwnProperty.call(i,e)&&!Object.prototype.hasOwnProperty.call(t,e)&&(t[e]=i[e]);i=t}}for(;o.length;){const e=o.pop();c.has(e)||(c.add(e),l(e))}return Promise.all(u)};return await c(i,i,t,n),new rn(i,r)}getSchemaForResource(e,t){const n=n=>{const r=super.createCombinedSchema(e,n);return r.getResolvedSchema().then((e=>(e.schema&&"object"==typeof e.schema&&(e.schema.url=r.url),e.schema&&e.schema.schemaSequence&&e.schema.schemaSequence[t.currentDocIndex]?new rn(e.schema.schemaSequence[t.currentDocIndex]):e)))},r=()=>{const t=Object.create(null),r=[];for(const n of this.filePatternAssociations)if(n.matchesPattern(e))for(const e of n.getURIs())t[e]||(r.push(e),t[e]=!0);if(r.length>0){const e=this.highestPrioritySchemas(r);return n(e)}return Promise.resolve(null)},i=(()=>{let n=function(e){if(e instanceof ea){const t=e.lineComments.find((e=>ua(e)));if(null!=t){const e=t.match(/\$schema=\S+/g);if(null!==e&&e.length>=1)return e.length>=2&&console.log("Several $schema attributes have been found on the yaml-language-server modeline. The first one will be picked."),e[0].substring("$schema=".length)}}}(t);if(void 0!==n){if(!n.startsWith("file:")&&!n.startsWith("http")){let t="";if(n.indexOf("#")>0){const e=n.split("#",2);n=e[0],t=e[1]}if(w.isAbsolute(n))n=s.file(n).toString();else{const t=s.parse(e);n=s.file(w.resolve(w.parse(t.fsPath).dir,n)).toString()}t.length>0&&(n+="#"+t)}return n}})();return i?n([i]):this.customSchemaProvider?this.customSchemaProvider(e).then((e=>Array.isArray(e)?0===e.length?r():Promise.all(e.map((e=>this.resolveCustomSchema(e,t)))).then((e=>({errors:[],schema:{allOf:e.map((e=>e.schema))}})),(()=>r())):e?this.resolveCustomSchema(e,t):r())).then((e=>e),(()=>r())):r()}addSchemaPriority(e,t){let n=this.schemaPriorityMapping.get(e);n?(n=n.add(t),this.schemaPriorityMapping.set(e,n)):this.schemaPriorityMapping.set(e,(new Set).add(t))}highestPrioritySchemas(e){let t=0;const n=new Map;return e.forEach((e=>{(this.schemaPriorityMapping.get(e)||[0]).forEach((r=>{r>t&&(t=r);let i=n.get(r);i?(i=i.concat(e),n.set(r,i)):n.set(r,[e])}))})),n.get(t)||[]}async resolveCustomSchema(e,t){const n=await this.loadSchema(e),r=await this.resolveSchemaContent(n,e,[]);return r.schema&&"object"==typeof r.schema&&(r.schema.url=e),r.schema&&r.schema.schemaSequence&&r.schema.schemaSequence[t.currentDocIndex]?new rn(r.schema.schemaSequence[t.currentDocIndex],r.errors):r}async saveSchema(e,t){const n=this.normalizeId(e);return this.getOrAddSchemaHandle(n,t),this.schemaPriorityMapping.set(n,(new Set).add(hc.Settings)),Promise.resolve(void 0)}async deleteSchemas(e){return e.schemas.forEach((e=>{this.deleteSchema(e)})),Promise.resolve(void 0)}async deleteSchema(e){const t=this.normalizeId(e);return this.schemasById[t]&&delete this.schemasById[t],this.schemaPriorityMapping.delete(t),Promise.resolve(void 0)}async addContent(e){const t=await this.getResolvedSchema(e.schema);if(t){const n=this.resolveJSONSchemaToSection(t.schema,e.path);"object"==typeof n&&(n[e.key]=e.content),await this.saveSchema(e.schema,t.schema)}}async deleteContent(e){const t=await this.getResolvedSchema(e.schema);if(t){const n=this.resolveJSONSchemaToSection(t.schema,e.path);"object"==typeof n&&delete n[e.key],await this.saveSchema(e.schema,t.schema)}}resolveJSONSchemaToSection(e,t){const n=t.split("/");let r=e;for(const e of n)""!==e&&(this.resolveNext(r,e),r=r[e]);return r}resolveNext(e,t){if(Array.isArray(e)&&isNaN(t))throw new Error("Expected a number after the array object");if("object"==typeof e&&"string"!=typeof t)throw new Error("Expected a string after the object")}normalizeId(e){try{return s.parse(e).toString()}catch(t){return e}}getOrAddSchemaHandle(e,t){return super.getOrAddSchemaHandle(e,t)}loadSchema(e){const t=this.requestService;return super.loadSchema(e).then((n=>{if(n.errors&&void 0===n.schema)return t(e).then((t=>{if(!t){const t=ha("json.schema.nocontent","Unable to load schema from '{0}': No content. {1}",ba(e),n.errors);return new nn({},[t])}try{const e=Po(t);return new nn(e,[])}catch(t){const n=ha("json.schema.invalidFormat","Unable to parse content from '{0}': {1}.",ba(e),t);return new nn({},[n])}}),(e=>{let t=e.toString();const n=e.toString().split("Error: ");return n.length>1&&(t=n[1]),new nn({},[t])}));if(n.uri=e,this.schemaUriToNameAndDescription.has(e)){const{name:t,description:r,versions:i}=this.schemaUriToNameAndDescription.get(e);n.schema.title=t??n.schema.title,n.schema.description=r??n.schema.description,n.schema.versions=i??n.schema.versions}return n}))}registerExternalSchema(e,t,n,r,i,o){return(r||i)&&this.schemaUriToNameAndDescription.set(e,{name:r,description:i,versions:o}),super.registerExternalSchema(e,t,n)}clearExternalSchemas(){super.clearExternalSchemas()}setSchemaContributions(e){super.setSchemaContributions(e)}getRegisteredSchemaIds(e){return super.getRegisteredSchemaIds(e)}getResolvedSchema(e){return super.getResolvedSchema(e)}onResourceChange(e){return super.onResourceChange(e)}}function ba(e){try{const t=s.parse(e);if("file"===t.scheme)return t.fsPath}catch(e){}return e}class wa{constructor(e,t){this.telemetry=t,this.jsonDocumentSymbols=new ts(e),this.jsonDocumentSymbols.getKeyLabel=e=>{const t=e.keyNode.internalNode;let n="";return n=_n(t)?"{}":xn(t)?"[]":t.source,n}}findDocumentSymbols(e,t={resultLimit:Number.MAX_VALUE}){let n=[];try{const r=na.getYamlDocument(e);if(!r||0===r.documents.length)return null;for(const i of r.documents)i.root&&(n=n.concat(this.jsonDocumentSymbols.findDocumentSymbols(e,i,t)))}catch(e){this.telemetry?.sendError("yaml.documentSymbols.error",{error:jo(e)})}return n}findHierarchicalDocumentSymbols(e,t={resultLimit:Number.MAX_VALUE}){let n=[];try{const r=na.getYamlDocument(e);if(!r||0===r.documents.length)return null;for(const i of r.documents)i.root&&(n=n.concat(this.jsonDocumentSymbols.findDocumentSymbols2(e,i,t)))}catch(e){this.telemetry?.sendError("yaml.hierarchicalDocumentSymbols.error",{error:jo(e)})}return n}}function _a(e,t){for(const n of e)n.isKubernetes=t}function Sa(e,t){for(const n in t){const r=t[n];if(new ya(r).matchesPattern(e.uri))return!0}return!1}class ka{constructor(e,t){this.telemetry=t,this.shouldHover=!0,this.schemaService=e}configure(e){e&&(this.shouldHover=e.hover,this.indentation=e.indentation)}doHover(e,t,n=!1){try{if(!this.shouldHover||!e)return Promise.resolve(void 0);const r=na.getYamlDocument(e),i=ms(e.offsetAt(t),r);if(null===i)return Promise.resolve(void 0);_a(r.documents,n);const o=r.documents.indexOf(i);return i.currentDocIndex=o,this.getHover(e,t,i)}catch(e){this.telemetry?.sendError("yaml.hover.error",{error:jo(e)})}}getHover(e,t,n){const r=e.offsetAt(t);let i=n.getNodeFromOffset(r);if(!i||("object"===i.type||"array"===i.type)&&r>i.offset+1&&re.replace(/\|\|\s*$/,"");return this.schemaService.getSchemaForResource(e.uri,n).then((e=>{if(e&&i&&!e.errors.length){const r=n.getMatchingSchemas(e.schema,i.offset);let o,u,l=[];const f=[],h=[];r.every((e=>((e.node===i||"property"===i.type&&i.valueNode===e.node)&&!e.inverted&&e.schema&&(o=o||e.schema.title||e.schema.closestTitle,u=u||e.schema.markdownDescription||this.toMarkdown(e.schema.description),e.schema.enum&&(l=e.schema.markdownEnumDescriptions?e.schema.markdownEnumDescriptions:e.schema.enumDescriptions?e.schema.enumDescriptions.map(this.toMarkdown,this):[],e.schema.enum.forEach(((e,t)=>{"string"!=typeof e&&(e=JSON.stringify(e)),h.push({value:e,description:l[t]})}))),e.schema.anyOf&&function(e,t,n){let r=0;for(const i of t)e===i.node&&i.schema!==n&&n.anyOf.forEach((e=>{i.schema.title===e.title&&i.schema.description===e.description&&i.schema.properties===e.properties&&r++}));return r===n.anyOf.length}(i,r,e.schema)&&(o="",u="",e.schema.anyOf.forEach(((t,n)=>{o+=t.title||e.schema.closestTitle||"",u+=t.markdownDescription||this.toMarkdown(t.description)||"",n!==e.schema.anyOf.length-1&&(o+=" || ",u+=" || ")})),o=c(o),u=c(u)),e.schema.examples&&e.schema.examples.forEach((e=>{f.push(function(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),"string"==typeof n&&(n=n.length),"number"==typeof n){const e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=n??t??{};if(!e)return}return new Oi(e,r,n).toString(n)}(e,null,2))}))),!0)));let d="";return o&&(d="#### "+this.toMarkdown(o)),u&&(d=xa(d),d+=u),0!==h.length&&(d=xa(d),d+="Allowed Values:\n\n",h.forEach((e=>{e.description?d+=`* \`${Ca(e.value)}\`: ${e.description}\n`:d+=`* \`${Ca(e.value)}\`\n`}))),0!==f.length&&f.forEach((e=>{d=xa(d),d+="Example:\n\n",d+=`\`\`\`yaml\n${e}\`\`\`\n`})),d.length>0&&e.schema.url&&(d=xa(d),d+=`Source: [${function(e){let t="JSON Schema";const n=e.url;if(n){const e=s.parse(n);t=w.basename(e.fsPath)}else e.title&&(t=e.title);return t}(e.schema)}](${e.schema.url})`),t=d,{contents:{kind:Ne.Markdown,value:t},range:a}}var t;return null}))}toMarkdown(e){if(e){let t=e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,"$1\n\n$3");if(t=t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&"),void 0!==this.indentation){const e=new RegExp(` {${this.indentation.length}}`,"g");t=t.replace(e," ")}return t}}}function xa(e){return 0===e.length?e:(e.endsWith("\n")||(e+="\n"),e+"\n")}function Ca(e){return-1!==e.indexOf("`")?"`` "+e+" ``":e}class Ta{validate(e,t){const n=[],r=new Set,i=new Set,o=new Map;$n(t.internalDocument,((e,n,s)=>{Tn(n)&&((Cn(n)||kn(n))&&n.anchor&&(r.add(n),o.set(n,s[s.length-1])),bn(n)&&i.add(n.resolve(t.internalDocument)))}));for(const t of r)if(!i.has(t)){const r=this.getAnchorNode(o.get(t),t);if(r){const t=ee.create(e.positionAt(r.offset),e.positionAt(r.offset+r.source.length)),i=he.create(t,`Unused anchor "${r.source}"`,ue.Hint,0);i.tags=[le.Unnecessary],n.push(i)}}return n}getAnchorNode(e,t){if(e&&e.srcToken){const n=e.srcToken;if(Xs(n))return Ea(n);if((e=>!!e&&"items"in e)(n))for(const e of n.items){if(t.srcToken!==e.value)continue;const n=Ea(e);if(n)return n}}}}function Ea(e){for(const t of e.start)if("anchor"===t.type)return t;if(e.sep&&Array.isArray(e.sep))for(const t of e.sep)if("anchor"===t.type)return t}class Pa{constructor(e){this.forbidMapping="forbid"===e.flowMapping,this.forbidSequence="forbid"===e.flowSequence}validate(e,t){const n=[];return $n(t.internalDocument,((t,r)=>{this.forbidMapping&&_n(r)&&"flow-collection"===r.srcToken?.type&&n.push(he.create(this.getRangeOf(e,r.srcToken),"Flow style mapping is forbidden",ue.Error,"flowMap")),this.forbidSequence&&xn(r)&&"flow-collection"===r.srcToken?.type&&n.push(he.create(this.getRangeOf(e,r.srcToken),"Flow style sequence is forbidden",ue.Error,"flowSeq"))})),n}getRangeOf(e,t){return ee.create(e.positionAt(t.start.offset),e.positionAt(t.end.pop().offset))}}class Ra{validate(e,t){const n=[];return $n(t.internalDocument,((t,r)=>{if(_n(r))for(let t=1;t0){const i=Aa(e,r.items[t-1]);n.push(he.create(i,`Wrong ordering of key "${r.items[t-1].key}" in mapping`,ue.Error,"mapKeyOrder"))}})),n}}function Aa(e,t){const n=t?.srcToken.start[0]?.offset??t?.srcToken?.key.offset??t?.srcToken?.sep[0]?.offset,r=t?.srcToken?.value.offset||t?.srcToken?.sep[0]?.offset||t?.srcToken?.key.offset||t?.srcToken.start[t.srcToken.start.length-1]?.offset;return ee.create(e.positionAt(n),e.positionAt(r))}function Oa(e,t){const n=String(t.key);return String(e.key).localeCompare(n)}const $a=(e,t)=>{const n=t.positionAt(e.location.start),r={start:n,end:e.location.toLineEnd?Z.create(n.line,new aa(t).getLineLength(n.line)):t.positionAt(e.location.end)};return he.create(r,e.message,e.severity,e.code,_s)};class Na{constructor(e,t){this.telemetry=t,this.validators=[],this.MATCHES_MULTIPLE="Matches multiple schemas when only one must validate.",this.validationEnabled=!0,this.jsonValidation=new Uo(e,Promise)}configure(e){this.validators=[],e&&(this.validationEnabled=e.validate,this.customTags=e.customTags,this.disableAdditionalProperties=e.disableAdditionalProperties,this.yamlVersion=e.yamlVersion,"forbid"!==e.flowMapping&&"forbid"!==e.flowSequence||this.validators.push(new Pa(e)),e.keyOrdering&&this.validators.push(new Ra)),this.validators.push(new Ta)}async doValidation(e,t=!1){if(!this.validationEnabled)return Promise.resolve([]);const n=[];try{const r=na.getYamlDocument(e,{customTags:this.customTags,yamlVersion:this.yamlVersion},!0);let i=0;for(const o of r.documents){o.isKubernetes=t,o.currentDocIndex=i,o.disableAdditionalProperties=this.disableAdditionalProperties,o.uri=e.uri;const r=await this.jsonValidation.doValidation(e,o),s=o;s.errors.length>0&&n.push(...s.errors),s.warnings.length>0&&n.push(...s.warnings),n.push(...r),n.push(...this.runAdditionalValidators(e,o)),i++}}catch(e){this.telemetry?.sendError("yaml.validation.error",{error:jo(e)})}let r;const i=new Set,o=[];for(let s of n){if(t&&s.message===this.MATCHES_MULTIPLE)continue;if(Object.prototype.hasOwnProperty.call(s,"location")&&(s=$a(s,e)),s.source||(s.source=_s),r&&r.message===s.message&&r.range.end.line===s.range.start.line&&Math.abs(r.range.end.character-s.range.end.character)>=1){r.range.end=s.range.end;continue}r=s;const n=s.range.start.line+" "+s.range.start.character+" "+s.message;i.has(n)||(o.push(s),i.add(n))}return o}runAdditionalValidators(e,t){const n=[];for(const r of this.validators)n.push(...r.validate(e,t));return n}}var ja,Ia=n(8533);class Da{constructor(e){this.telemetry=e}findLinks(e){try{const t=na.getYamlDocument(e),n=[];for(const r of t.documents)n.push(fs(e,r));return Promise.all(n).then((e=>[].concat(...e)))}catch(e){this.telemetry?.sendError("yaml.documentLink.error",{error:jo(e)})}}}function Ma(e,t){if(!e)return;const n=[],r=na.getYamlDocument(e);for(const t of r.documents)r.documents.length>1&&n.push(qa(e,t.root)),t.visit((t=>{if("object"===t.type&&"array"===t.parent?.type&&n.push(qa(e,t)),"property"===t.type&&t.valueNode)switch(t.valueNode.type){case"array":case"object":n.push(qa(e,t));break;case"string":{const r=e.positionAt(t.offset),i=e.positionAt(t.valueNode.offset+t.valueNode.length);r.line!==i.line&&n.push(qa(e,t));break}default:return!0}return!0}));const i=t&&t.rangeLimit;return"number"!=typeof i||n.length<=i?n:(t&&t.onRangeLimitExceeded&&t.onRangeLimitExceeded(e.uri),n.slice(0,t.rangeLimit))}function qa(e,t){const n=e.positionAt(t.offset);let r=e.positionAt(t.offset+t.length);const i=e.getText(ee.create(n,r)),o=i.length-i.trimRight().length;return o>0&&(r=e.positionAt(t.offset+t.length-o)),ae.create(n.line,r.line,n.character,r.character)}!function(e){e.JUMP_TO_SCHEMA="jumpToSchema"}(ja||(ja={}));class Fa{constructor(e){this.indentation=e}write(e){if("flow-collection"!==e.internalNode.srcToken.type)return null;const t=e.internalNode.srcToken,n="flow-map-start"===t.start.type?"block-map":"block-seq",r=e.parent.type,i={type:n,offset:t.offset,indent:t.indent,items:[]};for(const e of t.items)uo(e,(({key:e,sep:t,value:o})=>{if("block-map"===n){const n=[{type:"space",indent:0,offset:e.offset,source:this.indentation}];"property"===r&&n.unshift({type:"newline",indent:0,offset:e.offset,source:"\n"}),i.items.push({start:n,key:e,sep:t,value:o})}else"block-seq"===n&&i.items.push({start:[{type:"newline",indent:0,offset:o.offset,source:"\n"},{type:"space",indent:0,offset:o.offset,source:this.indentation},{type:"seq-item-ind",indent:0,offset:o.offset,source:"-"},{type:"space",indent:0,offset:o.offset,source:" "}],value:o});if("flow-collection"===o.type)return $n.SKIP}));return ro(i)}}var La=n(6486);class Va{constructor(e){this.clientCapabilities=e,this.indentation=" "}configure(e){this.indentation=e.indentation}getCodeAction(e,t){if(!t.context.diagnostics)return;const n=[];return n.push(...this.getConvertToBooleanActions(t.context.diagnostics,e)),n.push(...this.getJumpToSchemaActions(t.context.diagnostics)),n.push(...this.getTabToSpaceConverting(t.context.diagnostics,e)),n.push(...this.getUnusedAnchorsDelete(t.context.diagnostics,e)),n.push(...this.getConvertToBlockStyleActions(t.context.diagnostics,e)),n.push(...this.getKeyOrderActions(t.context.diagnostics,e)),n}getJumpToSchemaActions(e){if(!this.clientCapabilities?.window?.showDocument?.support)return[];const t=new Map;for(const n of e){const e=n.data?.schemaUri||[];for(const r of e)r&&(t.has(r)||t.set(r,[]),t.get(r).push(n))}const n=[];for(const e of t.keys()){const r=rt.create(`Jump to schema location (${w.basename(e)})`,de.create("JumpToSchema",ja.JUMP_TO_SCHEMA,e));r.diagnostics=t.get(e),n.push(r)}return n}getTabToSpaceConverting(e,t){const n=[],r=new aa(t),i=[];for(const o of e)if("Using tabs can lead to unpredictable results"===o.message){if(i.includes(o.range.start.line))continue;const e=r.getLineContent(o.range.start.line);let s=0,a="";for(let t=o.range.start.character;t<=o.range.end.character&&"\t"===e.charAt(t);t++)s++,a+=this.indentation;i.push(o.range.start.line);let c=o.range;s!==o.range.end.character-o.range.start.character&&(c=ee.create(o.range.start,Z.create(o.range.end.line,o.range.start.character+s))),n.push(rt.create("Convert Tab to Spaces",Ua(t.uri,[pe.replace(c,a)]),et.QuickFix))}if(0!==n.length){const e=[];for(let t=0;t<=r.getLineCount();t++){const n=r.getLineContent(t);let i=0,o="";for(let r=0;r0&&n.push(rt.create("Convert all Tabs to Spaces",Ua(t.uri,e),et.QuickFix))}return n}getUnusedAnchorsDelete(e,t){const n=[],r=new aa(t);for(const i of e)if(i.message.startsWith("Unused anchor")&&i.source===_s){const e=ee.create(i.range.start,i.range.end),o=r.getText(e),s=fn(r.getLineContent(e.end.line),e.end.character);e.end.character=s;const a=rt.create(`Delete unused anchor: ${o}`,Ua(t.uri,[pe.del(e)]),et.QuickFix);a.diagnostics=[i],n.push(a)}return n}getConvertToBooleanActions(e,t){const n=[];for(const r of e)if('Incorrect type. Expected "boolean".'===r.message){const e=t.getText(r.range).toLocaleLowerCase();if('"true"'===e||'"false"'===e||"'true'"===e||"'false'"===e){const i=e.includes("true")?"true":"false";n.push(rt.create("Convert to boolean",Ua(t.uri,[pe.replace(r.range,i)]),et.QuickFix))}}return n}getConvertToBlockStyleActions(e,t){const n=[];for(const r of e)if("flowMap"===r.code||"flowSeq"===r.code){const e=Wa(t,r);if(_n(e.internalNode)||xn(e.internalNode)){const i=_n(e.internalNode)?"map":"sequence",o=new Fa(this.indentation);n.push(rt.create(`Convert to block style ${i}`,Ua(t.uri,[pe.replace(r.range,o.write(e))]),et.QuickFix))}}return n}getKeyOrderActions(e,t){const n=[];for(const r of e)if("mapKeyOrder"===r?.code){let e=Wa(t,r);for(;e&&"object"!==e.type;)e=e.parent;if(e&&_n(e.internalNode)){const r=La.cloneDeep(e.internalNode);if(!("block-map"!==r.srcToken.type&&"flow-collection"!==r.srcToken.type||"block-map"!==e.internalNode.srcToken.type&&"flow-collection"!==e.internalNode.srcToken.type)){r.srcToken.items.sort(((e,t)=>e.key&&t.key&&fo(e.key)&&fo(t.key)?e.key.source.localeCompare(t.key.source):!e.key&&t.key?-1:e.key&&!t.key?1:e.key||t.key?void 0:0));for(let t=0;t"newline"===e.type))??-1;let t=null;"block-scalar"===i.value?.type?t=i.value?.props?.find((e=>"newline"===e.type)):fo(i.value)&&(t=i.value?.end?.find((e=>"newline"===e.type))),t&&e<0&&(n.value.end=n.value.end??[],n.value.end.push(t)),!t&&e>-1&&n.value.end.splice(e,1)}else"block-scalar"===n.value?.type&&(n.value.props.find((e=>"newline"===e.type))||n.value.props.push({type:"newline",indent:0,offset:n.value.offset,source:"\n"}))}}const i=ee.create(t.positionAt(e.offset),t.positionAt(e.offset+e.length));n.push(rt.create("Fix key order for this map",Ua(t.uri,[pe.replace(i,ro(r.srcToken))]),et.QuickFix))}}return n}}function Wa(e,t){const n=na.getYamlDocument(e),r=e.offsetAt(t.range.start);return ms(r,n).getNodeFromOffset(r)}function Ua(e,t){const n={};return n[e]=t,{changes:n}}function Ba(e,t){const{position:n}=t,r=new aa(e);if("\n"===t.ch){const e=r.getLineContent(n.line-1);if(e.trimRight().endsWith(":")){const i=r.getLineContent(n.line),o=i.substring(n.character,i.length),s=-1!==e.indexOf(" - ");if(0===o.trimRight().length){const r=n.character-(e.length-e.trimLeft().length);if(r===t.options.tabSize&&!s)return;const o=[];return i.length>0&&o.push(pe.del(ee.create(n,Z.create(n.line,i.length-1)))),o.push(pe.insert(n," ".repeat(t.options.tabSize+(s?2-r:0)))),o}if(s)return[pe.insert(n," ".repeat(t.options.tabSize))]}if(e.trimRight().endsWith("|"))return[pe.insert(n," ".repeat(t.options.tabSize))];if(e.includes(" - ")&&!e.includes(": "))return[pe.insert(n,"- ")];if(e.includes(" - ")&&e.includes(": "))return[pe.insert(n," ")]}}const Ka="https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.22.4-standalone-strict/all.json",za="https://www.schemastore.org/api/json/catalog.json";function Ha(e,t,n,r){return"kubernetes"===n.trim().toLowerCase()?(r.send({name:"yaml.schema.configured",properties:{kubernetes:!0}}),Ka):_(n)?S(e,t,n):n}function Ja(e){const t=new Map;return e?(e.url?e.url.startsWith("schemaservice://combinedSchema/")?Ga(e,t):t.set(e.url,e):Ga(e,t),t):t}function Ga(e,t){e.allOf&&Ya(e.allOf,t),e.anyOf&&Ya(e.anyOf,t),e.oneOf&&Ya(e.oneOf,t)}function Ya(e,t){for(const n of e)$o(n)||!n.url||t.has(n.url)||t.set(n.url,n)}class Qa{constructor(e,t){this.schemaService=e,this.telemetry=t}async getCodeLens(e){const t=[];try{const n=na.getYamlDocument(e);let r=new Map;for(const t of n.documents){const n=await this.schemaService.getSchemaForResource(e.uri,t);n?.schema&&(r=new Map([...Ja(n?.schema),...r]))}for(const e of r){const n=it.create(ee.create(0,0,0,0));n.command={title:Mo(e[1],e[0]),command:ja.JUMP_TO_SCHEMA,arguments:[e[0]]},t.push(n)}}catch(e){this.telemetry?.sendError("yaml.codeLens.error",{error:jo(e)})}return t}resolveCodeLens(e){return e}}class Xa{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function Za(e,t,n,r,i){let o;for(i.spacesDiff=0,i.looksLikeAlignment=!1,o=0;o0&&a>0)return;if(c>0&&u>0)return;const l=Math.abs(a-u),f=Math.abs(s-c);if(0===l)return i.spacesDiff=f,void(f>0&&0<=c-1&&c-10?t+r.indentation:"";if(Array.isArray(e)){if(o+=1,0===e.length)return"";let a="";for(let c=0;c0?"\n":"",c=!0;for(let u=0;u0?i++:d>1&&o++,Za(s,a,r,h,l),l.looksLikeAlignment&&2!==l.spacesDiff)continue;const m=l.spacesDiff;m<=8&&u[m]++,s=r,a=h}let f=true;i!==o&&(f=i{const n=u[t];n>e&&(e=n,h=t)})),4===h&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(h=2)}return{insertSpaces:f,tabSize:h}}(s);this.indentation=e.insertSpaces?" ".repeat(e.tabSize):"\t"}_a(o.documents,n);for(const t of o.documents)t.uri=e.uri;const a=e.offsetAt(t),c=e.getText();if(":"===c.charAt(a-1))return Promise.resolve(i);let u=ms(a,o);if(null===u)return Promise.resolve(i);u=u.clone();let[l,f]=u.getNodeFromPosition(a,s,this.indentation.length);const h=this.getCurrentWord(e,a);let d=s.getLineContent(t.line);const p=d.substring(t.character),m=/^[ ]+\n?$/.test(p);this.arrayPrefixIndentation="";let g=null;if(m){g=ee.create(t,Z.create(t.line,d.length));const e=0===d.trim().length,n=d.match(/^\s*(-)\s*$/);if(l&&kn(l)&&!e&&!n){const e=d.substring(0,t.character),n=e.match(/^[\s-]*([^:]+)?$/)||e.match(/:[ \t]((?!:[ \t]).*)$/);n?.[1]&&(g=ee.create(Z.create(t.line,t.character-n[1].length),Z.create(t.line,d.length)))}}else if(l&&kn(l)&&"null"===l.value){const t=e.positionAt(l.range[0]);t.character+=1;const n=e.positionAt(l.range[2]);n.character+=1,g=ee.create(t,n)}else if(l&&kn(l)&&l.value){const t=e.positionAt(l.range[0]);g=ee.create(t,e.positionAt(l.range[1]))}else if(l&&kn(l)&&null===l.value&&"-"===h)g=ee.create(t,t),this.arrayPrefixIndentation=" ";else{let n=a-h.length;n>0&&'"'===c[n-1]&&n--,g=ee.create(e.positionAt(n),t)}const y={},v={add:(e,t)=>{const n=!!e.parent;let r=e.label;if(!r)return void console.warn(`Ignoring CompletionItem without label: ${JSON.stringify(e)}`);if(No(r)||(r=String(r)),r=r.replace(/[\n]/g,"↵"),r.length>60){const e=r.substr(0,57).trim()+"...";y[e]||(r=e)}if(e.insertText.endsWith("$1")&&!n&&(e.insertText=e.insertText.substr(0,e.insertText.length-2)),g&&g.start.line===g.end.line&&(e.textEdit=pe.replace(g,e.insertText)),e.label=r,n)return void function(e){if(y[e.label]?.label===oc)return;const t=e.parent.schema,n=Io(t),r=t.markdownDescription||t.description;let o=i.items.find((e=>e.parent?.schema===t&&e.kind===ic));o&&o.parent.insertTexts.includes(e.insertText)||(o?o.parent.insertTexts.push(e.insertText):(o={...e,label:n,documentation:r,sortText:"_"+n,kind:ic},o.label=o.label||e.label,o.parent.insertTexts=[e.insertText],i.items.push(o)))}(e);this.arrayPrefixIndentation&&this.updateCompletionText(e,this.arrayPrefixIndentation+e.insertText);const o=y[r],s=o?.label!==oc&&o?.insertText!==e.insertText;if(o){if(s){const n=this.mergeSimpleInsertTexts(r,o.insertText,e.insertText,t);n?this.updateCompletionText(o,n):(y[r]=e,i.items.push(e))}}else y[r]=e,i.items.push(e);o&&!o.documentation&&e.documentation&&(o.documentation=e.documentation)},error:e=>{this.telemetry?.sendError("yaml.completion.error",{error:jo(e)})},log:e=>{console.log(e)},getNumberOfProposals:()=>i.items.length,result:i,proposed:y};this.customTags&&this.customTags.length>0&&this.getCustomTagValueCompletions(v),d.endsWith("\n")&&(d=d.substr(0,d.length-1));try{const n=await this.schemaService.getSchemaForResource(e.uri,u);if((!n||n.errors.length)&&0===t.line&&0===t.character&&!ua(d)){const e={kind:Ie.Text,label:"Inline schema",insertText:"# yaml-language-server: $schema=",insertTextFormat:De.PlainText};i.items.push(e)}if(ua(d)||function(e,t){let n=!1;for(const r of e){if("document"===r.type)Zs([],r,(e=>{if(Xs(e)&&"comment"===e.value?.type){if(r.offset<=t&&e.value.source.length+e.value.offset>=t)return n=!0,$n.BREAK}else if("comment"===e.type&&e.offset<=t&&e.offset+e.source.length>=t)return n=!0,$n.BREAK}));else if("comment"===r.type&&r.offset<=t&&r.source.length+r.offset>=t)return!0;if(n)break}return n}(o.tokens,a)){const e=d.indexOf("$schema=");return-1!==e&&e+"$schema=".length<=t.character&&this.schemaService.getAllSchemas().forEach((e=>{const t={kind:Ie.Constant,label:e.name??e.uri,detail:e.description,insertText:e.uri,insertTextFormat:De.PlainText,insertTextMode:Fe.asIs};i.items.push(t)})),i}if(!n||n.errors.length)return i;let p=null;if(!l)if(!u.internalDocument.contents||kn(u.internalDocument.contents)){const e=u.internalDocument.createNode({});e.range=[a,a+1,a+1],u.internalDocument.contents=e,u.updateFromInternalDocument(),l=e}else l=u.findClosestNode(a,s),f=!0;const m=l;if(l)if(0===d.length)l=u.internalDocument.contents;else{const n=u.getParent(l);if(n){if(kn(l)){if(l.value){if(Sn(n)){if(n.value===l){if(d.trim().length>0&&d.indexOf(":")<0){const e=this.createTempObjNode(h,l,u),t=u.getParent(n);if(xn(u.internalDocument.contents)){const t=function(e,t){for(const[n,r]of e.items.entries())if(t===r)return n}(u.internalDocument.contents,n);"number"==typeof t&&(u.internalDocument.set(t,e),u.updateFromInternalDocument())}else t&&(_n(t)||xn(t))?(t.set(n.key,e),u.updateFromInternalDocument()):(u.internalDocument.set(n.key,e),u.updateFromInternalDocument());p=e.items[0],l=e}else if(0===d.trim().length){const e=u.getParent(n);e&&(l=e)}}else if(n.key===l){const e=u.getParent(n);p=n,e&&(l=e)}}else if(xn(n))if(d.trim().length>0){const e=this.createTempObjNode(h,l,u);n.delete(l),n.add(e),u.updateFromInternalDocument(),l=e}else l=n}else if(null===l.value)if(Sn(n)){if(n.key===l)l=n;else if(Tn(n.key)&&n.key.range){const r=u.getParent(n);if(f&&r&&_n(r)&&function(e){if(e.items.length>1)return!1;const t=e.items[0];return kn(t.key)&&kn(t.value)&&""===t.key.value&&!t.value.value}(r))l=r;else{const i=e.positionAt(n.key.range[0]);if(t.character>i.character&&t.line!==i.line){const e=this.createTempObjNode(h,l,u);r&&(_n(r)||xn(r))?(r.set(n.key,e),u.updateFromInternalDocument()):(u.internalDocument.set(n.key,e),u.updateFromInternalDocument()),p=e.items[0],l=e}else i.character===t.character&&r&&(l=r)}}}else if(xn(n))if("-"!==d.charAt(t.character-1)){const e=this.createTempObjNode(h,l,u);n.delete(l),n.add(e),u.updateFromInternalDocument(),l=e}else if("-"===d.charAt(t.character-1)){const e=this.createTempObjNode("",l,u);n.delete(l),n.add(e),u.updateFromInternalDocument(),l=e}else l=n}else if(_n(l)&&!f&&0===d.trim().length&&xn(n)){const e=s.getLineContent(t.line+1);s.getLineCount()!==t.line+1&&0!==e.trim().length||(l=n)}}else if(kn(l)){const e=this.createTempObjNode(h,l,u);u.internalDocument.contents=e,u.updateFromInternalDocument(),p=e.items[0],l=e}else if(_n(l))for(const e of l.items)Tn(e.value)&&e.value.range&&e.value.range[0]===a+1&&(l=e.value);else if(xn(l)&&"-"!==d.charAt(t.character-1)){const e=this.createTempObjNode(h,l,u);e.items=[],u.updateFromInternalDocument();for(const t of l.items)_n(t)&&t.items.forEach((t=>{e.items.push(t)}));l=e}}if(l&&_n(l)){const e=l.items;for(const t of e)p&&p===t||kn(t.key)&&(y[t.key.value+""]=Ve.create(oc));this.addPropertyCompletions(n,u,l,m,"",v,s,g,r),!n&&h.length>0&&'"'!==c.charAt(a-h.length-1)&&v.add({kind:Ie.Property,label:h,insertText:this.getInsertTextForProperty(h,null,""),insertTextFormat:De.Snippet})}const b={};this.getValueCompletions(n,u,l,a,e,v,b,r)}catch(e){this.telemetry?.sendError("yaml.completion.error",{error:jo(e)})}this.finalizeParentCompletion(i);const b=i.items.filter(((e,t,n)=>t===n.findIndex((t=>t.label===e.label&&t.insertText===e.insertText&&t.kind===e.kind))));return b?.length>0&&(i.items=b),i}updateCompletionText(e,t){e.insertText=t,e.textEdit&&(e.textEdit.newText=t)}mergeSimpleInsertTexts(e,t,n,r){const i=e=>e.includes("\n"),o=e=>{const t=e.indexOf("\n");return t>0&&0===e.substring(t,e.length).trim().length};if(i(t)||i(n))return r&&o(t)&&!o(n)&&!n.startsWith("\n")?n:void 0;const s=this.getValuesFromInsertText(t),a=this.getValuesFromInsertText(n),c=Array.prototype.concat(s,a);return c.length?1===c.length?`${e}: \${1:${c[0]}}`:`${e}: \${1|${c.join(",")}|}`:void 0}getValuesFromInsertText(e){const t=e.substring(e.indexOf(":")+1).trim();if(!t)return[];const n=t.match(/^\${1[|:]([^|]*)+\|?}$/);return n?n[1].split(","):[t]}finalizeParentCompletion(e){e.items.forEach((e=>{if("parent"in e){const t=e.parent.indent||"";let n=(e=>{let t=0;return e.map((e=>{const n=e.match(/\$([0-9]+)|\${[0-9]+:/g);if(!n)return e;const r=n.map((e=>+e.replace(/\${([0-9]+)[:|]/g,"$1").replace("$",""))).reduce(((e,t)=>t>e?t:e),0),i=e.replace(/\$([0-9]+)/g,((e,n)=>"$"+(+n+t))).replace(/\${([0-9]+)[:|]/g,((e,n)=>"${"+(+n+t)+":"));return t+=r,i}))})(e.parent.insertTexts).join(`\n${t}`);n.endsWith("$1")&&(n=n.substring(0,n.length-2)),e.insertText=this.arrayPrefixIndentation+n,e.textEdit&&(e.textEdit.newText=e.insertText);const r=n.replace(/\${[0-9]+[:|](.*)}/g,((e,t)=>t)).replace(/\$([0-9]+)/g,""),i=e.documentation?[e.documentation,"","----",""]:[];e.documentation={kind:Ne.Markdown,value:[...i,"```yaml",t+r,"```"].join("\n")},delete e.parent}}))}createTempObjNode(e,t,n){const r={};r[e]=null;const i=n.internalDocument.createNode(r);return i.range=t.range,i.items[0].key.range=t.range,i.items[0].value.range=t.range,i}addPropertyCompletions(e,t,n,r,i,o,s,a,c){const u=t.getMatchingSchemas(e.schema,-1,null,c),l=s.getText(a),f=s.getLineContent(a.start.line),h=0===f.trim().length,d=-1!==f.indexOf(":"),p=0===f.trimLeft().indexOf("-"),m=t.getParent(n),g=u.find((e=>e.node.internalNode===r&&e.schema.properties)),y=u.filter((e=>e.schema.oneOf)).map((e=>e.schema.oneOf))[0];let v=!1;y?.length{u[t]?.schema.oneOf||u[t]?.schema.properties!==e.properties||(v=!0)}));for(const e of u){if((e.node.internalNode===n&&!g||e.node.internalNode===r&&!d||e.node.parent?.internalNode===r&&!d)&&!e.inverted){this.collectDefaultSnippets(e.schema,i,o,{newLineFirst:!1,indentFirstObject:!1,shouldIndentWithTab:p});const t=e.schema.properties;if(t){const c=e.schema.maxProperties;if(void 0===c||void 0===n.items||n.items.length=0){const r=a.end.character-a.start.character;f=" "+e.slice(t+1,n.range[1]-r)}}f+=this.arrayPrefixIndentation,"array"===u.type&&(t=n.items.find((e=>kn(e.key)&&e.key.range&&e.key.value===c&&kn(e.value)&&!e.value.value&&s.getPosition(e.key.range[2]).line===a.end.line-1)))&&t&&(Array.isArray(u.items)?this.addSchemaValueCompletions(u.items[0],i,o,{},"property"):"object"==typeof u.items&&"object"===u.items.type&&this.addArrayItemValueCompletion(u.items,i,o));let p=c;c.startsWith(l)&&d||(p=this.getInsertTextForProperty(c,u,i,f+this.indentation));const g=kn(r)&&null===r.value||_n(r)&&0===r.items.length,y=e.schema.required?.length>0;this.parentSkeletonSelectedFirst&&g&&y||o.add({kind:Ie.Property,label:c,insertText:p,insertTextFormat:De.Snippet,documentation:this.fromMarkup(u.markdownDescription)||u.description||""},v),e.schema.required?.includes(c)&&o.add({label:c,insertText:this.getInsertTextForProperty(c,u,i,f+this.indentation),insertTextFormat:De.Snippet,documentation:this.fromMarkup(u.markdownDescription)||u.description||"",parent:{schema:e.schema,indent:f}})}}}if(m&&xn(m)&&qo(e.schema)&&this.addSchemaValueCompletions(e.schema,i,o,{},"property",Array.isArray(m.items)),e.schema.propertyNames&&e.schema.additionalProperties&&"object"===e.schema.type){const t=Ns(e.schema.propertyNames),n=t.title||"property";o.add({kind:Ie.Property,label:n,insertText:`\${1:${n}}: `,insertTextFormat:De.Snippet,documentation:this.fromMarkup(t.markdownDescription)||t.description||""})}}m&&e.node.internalNode===m&&e.schema.defaultSnippets&&(1===n.items.length?this.collectDefaultSnippets(e.schema,i,o,{newLineFirst:!1,indentFirstObject:!1,shouldIndentWithTab:!0},1):this.collectDefaultSnippets(e.schema,i,o,{newLineFirst:!1,indentFirstObject:!0,shouldIndentWithTab:!1},1))}}getValueCompletions(e,t,n,r,i,o,s,a){let c=null;if(n&&kn(n)&&(n=t.getParent(n)),n){if(Sn(n)){const e=n.value;if(e&&e.range&&r>e.range[0]+e.range[2])return;c=kn(n.key)?n.key.value+"":null,n=t.getParent(n)}if(n&&(null!==c||xn(n))){const u="",l=t.getMatchingSchemas(e.schema,-1,null,a);for(const e of l)if(e.node.internalNode===n&&!e.inverted&&e.schema){if(e.schema.items&&(this.collectDefaultSnippets(e.schema,u,o,{newLineFirst:!1,indentFirstObject:!1,shouldIndentWithTab:!1}),xn(n)&&n.items))if(Array.isArray(e.schema.items)){const t=this.findItemAtOffset(n,i,r);t1)&&(s=" $1"),o+s+n}getInsertTextForObject(e,t,n=this.indentation,r=1){let i="";return e.properties?(Object.keys(e.properties).forEach((o=>{const s=e.properties[o];let a=Array.isArray(s.type)?s.type[0]:s.type;if(a||(s.anyOf&&(a="anyOf"),s.properties&&(a="object"),s.items&&(a="array")),e.required&&e.required.indexOf(o)>-1)switch(a){case"boolean":case"string":case"number":case"integer":case"anyOf":{let e=s.default||s.const;e?("string"===a&&(e=cc(e)),i+=`${n}${o}: \${${r++}:${e}}\n`):i+=`${n}${o}: $${r++}\n`;break}case"array":{const e=this.getInsertTextForArray(s.items,t,r++,n),a=e.insertText.split("\n");let c=e.insertText;if(a.length>1){for(let e=1;ethis.addSchemaValueCompletions(e,t,n,r,i,o))),Array.isArray(e.anyOf)&&e.anyOf.forEach((e=>this.addSchemaValueCompletions(e,t,n,r,i,o))),Array.isArray(e.oneOf)&&e.oneOf.forEach((e=>this.addSchemaValueCompletions(e,t,n,r,i,o))))}collectTypes(e,t){if(Array.isArray(e.enum)||Oo(e.const))return;const n=e.type;Array.isArray(n)?n.forEach((function(e){return t[e]=!0})):n&&(t[n]=!0)}addDefaultValueCompletions(e,t,n,r=0){let i=!1;if(Oo(e.default)){let o,s=e.type,a=e.default;for(let e=r;e>0;e--)a=[a],s="array";o="object"==typeof a?"Default value":a.toString().replace(rc,'"'),n.add({kind:this.getSuggestionKind(s),label:o,insertText:this.getInsertTextForValue(a,t,s),insertTextFormat:De.Snippet,detail:nc("json.suggest.default","Default value")}),i=!0}Array.isArray(e.examples)&&e.examples.forEach((o=>{let s=e.type,a=o;for(let e=r;e>0;e--)a=[a],s="array";n.add({kind:this.getSuggestionKind(s),label:this.getLabelForValue(a),insertText:this.getInsertTextForValue(a,t,s),insertTextFormat:De.Snippet}),i=!0})),this.collectDefaultSnippets(e,t,n,{newLineFirst:!0,indentFirstObject:!0,shouldIndentWithTab:!0}),i||"object"!=typeof e.items||Array.isArray(e.items)||this.addDefaultValueCompletions(e.items,t,n,r+1)}addEnumValueCompletions(e,t,n,r){if(Oo(e.const)&&!r&&n.add({kind:this.getSuggestionKind(e.type),label:this.getLabelForValue(e.const),insertText:this.getInsertTextForValue(e.const,t,e.type),insertTextFormat:De.Snippet,documentation:this.fromMarkup(e.markdownDescription)||e.description}),Array.isArray(e.enum))for(let r=0,i=e.enum.length;r{0!==n||t.startsWith("-")?e[` ${t}`]=u[t]:e[`- ${t}`]=u[t]})),u=e}const c=Object.keys(n.proposed).filter((e=>n.proposed[e].label===oc));if(s=this.getInsertTextForSnippetValue(u,t,r,c),""===s&&u)continue;l=l||this.getLabelForSnippetValue(u)}else if("string"==typeof o.bodyText){let e="",n="",r="";for(let t=i;t>0;t--)e=e+r+"[\n",n=n+"\n"+r+"]",r+=this.indentation,c="array";s=e+r+o.bodyText.split("\n").join("\n"+r)+n+t,l=l||s,a=s.replace(/[\n]/g,"")}n.add({kind:o.suggestionKind||this.getSuggestionKind(c),label:l,sortText:o.sortText||o.label,documentation:this.fromMarkup(o.markdownDescription)||o.description,insertText:s,insertTextFormat:De.Snippet,filterText:a})}}getInsertTextForSnippetValue(e,t,n,r,i){return ec(e,"",(e=>{if("string"==typeof e){if("^"===e[0])return e.substr(1);if("true"===e||"false"===e)return`"${e}"`}return e}),{...n,indentation:this.indentation,existingProps:r},i)+t}addBooleanValueCompletion(e,t,n){n.add({kind:this.getSuggestionKind("boolean"),label:e?"true":"false",insertText:this.getInsertTextForValue(e,t,"boolean"),insertTextFormat:De.Snippet,documentation:""})}addNullValueCompletion(e,t){t.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+e,insertTextFormat:De.Snippet,documentation:""})}getLabelForSnippetValue(e){return JSON.stringify(e).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")}getCustomTagValueCompletions(e){gs(this.customTags).forEach((t=>{const n=t.split(" ")[0];this.addCustomTagValueCompletion(e," ",n)}))}addCustomTagValueCompletion(e,t,n){e.add({kind:this.getSuggestionKind("string"),label:n,insertText:n+t,insertTextFormat:De.Snippet,documentation:""})}getDocumentationWithMarkdownText(e,t){let n=e;return this.doesSupportMarkdown()&&(t=t.replace(/\${[0-9]+[:|](.*)}/g,((e,t)=>t)).replace(/\$([0-9]+)/g,""),n=this.fromMarkup(`${e}\n \`\`\`\n${t}\n\`\`\``)),n}getSuggestionKind(e){if(Array.isArray(e)){const t=e;e=t.length>0?t[0]:null}if(!e)return Ie.Value;switch(e){case"string":default:return Ie.Value;case"object":return Ie.Module;case"property":return Ie.Property}}getCurrentWord(e,t){let n=t-1;const r=e.getText();for(;n>=0&&-1===' \t\n\r\v":{[,]}'.indexOf(r.charAt(n));)n--;return r.substring(n+1,t)}fromMarkup(e){if(e&&this.doesSupportMarkdown())return{kind:Ne.Markdown,value:e}}doesSupportMarkdown(){if(void 0===this.supportsMarkdown){const e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=e&&e.completionItem&&Array.isArray(e.completionItem.documentationFormat)&&-1!==e.completionItem.documentationFormat.indexOf(Ne.Markdown)}return this.supportsMarkdown}findItemAtOffset(e,t,n){for(let t=e.items.length-1;t>=0;t--){const r=e.items[t];if(Tn(r)&&r.range){if(n>r.range[1])return t;if(n>=r.range[0])return t}}return 0}}const ac=/^\d+$/;function cc(e){let t;if(t="string"==typeof e?e:""+e,0===t.length)return t;if("true"===t||"false"===t||"null"===t||ac.test(t))return`"${t}"`;-1!==t.indexOf('"')&&(t=t.replace(rc,'"'));let n=!isNaN(parseInt(t))||"@"===t.charAt(0);if(!n){let e=t.indexOf(":",0);for(;e>0&&ethis.getSchemas(e))),this.connection?.onRequest(y.getAllSchemas,(e=>this.getAllSchemas(e)))}async getSchemas(e){const t=await this.getSchemasForFile(e);return Array.from(t).map((e=>({name:e[1].title,uri:e[0],description:e[1].description,versions:e[1].versions})))}async getSchemasForFile(e){const t=this.yamlSettings?.documents.get(e),n=new Map;if(!t)return n;const r=na.getYamlDocument(t);for(const e of r.documents){const r=await this.schemaService.getSchemaForResource(t.uri,e);if(r?.schema){const e=Ja(r?.schema);if(0===e.size)continue;for(const t of e)n.set(t[0],t[1])}}return n}async getAllSchemas(e){const t=await this.getSchemasForFile(e),n=Array.from(t.entries()).map((e=>({uri:e[0],fromStore:!1,usedForCurrentFile:!0,name:e[1].title,description:e[1].description,versions:e[1].versions}))),r=[];let i=this.schemaService.getAllSchemas();return i=i.filter((e=>!t.has(e.uri))),r.push(...n),r.push(...i),r}}class lc{constructor(e){this.telemetry=e}getDefinition(e,t){try{const n=na.getYamlDocument(e),r=e.offsetAt(t.position),i=ms(r,n);if(i){const[t]=i.getNodeFromPosition(r,new aa(e));if(t&&bn(t)){const n=t.resolve(i.internalDocument);if(n&&n.range){const t=ee.create(e.positionAt(n.range[0]),e.positionAt(n.range[2])),r=ee.create(e.positionAt(n.range[0]),e.positionAt(n.range[1]));return[ne.create(e.uri,t,r)]}}}}catch(e){this.telemetry?.sendError("yaml.definition.error",{error:jo(e)})}}}function fc(e,t){const n=na.getYamlDocument(e);return t.map((t=>{const o=function(t){const o=e.offsetAt(t),s=[];for(const c of n.documents){let n,u;for(c.visit((e=>{const s=e.offset+e.length;if(so){const n=r(e,t);if(!n||n>o)return!0;a=n}return(!n||a>=n.offset)&&(n=e,u=a),!0}));n;){const t=u??n.offset,r=n.offset+n.length,i={start:e.positionAt(t),end:e.positionAt(r)},c=(a=e.getText(i)).endsWith("\r\n")?a.substring(0,a.length-2):a.endsWith("\n")?a.substring(0,a.length-1):a,l=t+c.length;l>=o&&(i.end=e.positionAt(l));const f=(e,t)=>c.startsWith(e)&&c.endsWith(t||e);("string"===n.type&&(f("'")||f('"'))||"object"===n.type&&f("{","}")||"array"===n.type&&f("[","]"))&&s.push({start:e.positionAt(t+1),end:e.positionAt(r-1)}),s.push(i),n=n.parent,u=void 0}if(s.length>0)break}var a;return s.reverse()}(t);let s;for(const e of o)s=at.create(e,s);return s??at.create({start:t,end:t})}));function r(t,n){const r=e.positionAt(t.offset);if(r.line===n.line){if("array"===t.parent?.type&&"- "===i(t.offset-2,t.offset))return t.offset-2;if("array"===t.type||"object"===t.type){const t={line:r.line,character:0};if(0===e.getText({start:t,end:r}).trim().length)return e.offsetAt(t)}}}function i(t,n){return e.getText({start:e.positionAt(t),end:e.positionAt(n)})}}var hc;!function(e){e[e.SchemaStore=1]="SchemaStore",e[e.SchemaAssociation=2]="SchemaAssociation",e[e.Settings=3]="Settings"}(hc||(hc={}));class dc{constructor(e,t,n,r){this.connection=e,this.languageService=t,this.yamlSettings=n,this.validationHandler=r,this.pendingLimitExceededWarnings={}}registerHandlers(){this.connection.onDocumentLinks((e=>this.documentLinkHandler(e))),this.connection.onDocumentSymbol((e=>this.documentSymbolHandler(e))),this.connection.onDocumentFormatting((e=>this.formatterHandler(e))),this.connection.onHover((e=>this.hoverHandler(e))),this.connection.onCompletion((e=>this.completionHandler(e))),this.connection.onDidChangeWatchedFiles((e=>this.watchedFilesHandler(e))),this.connection.onFoldingRanges((e=>this.foldingRangeHandler(e))),this.connection.onSelectionRanges((e=>this.selectionRangeHandler(e))),this.connection.onCodeAction((e=>this.codeActionHandler(e))),this.connection.onDocumentOnTypeFormatting((e=>this.formatOnTypeHandler(e))),this.connection.onCodeLens((e=>this.codeLensHandler(e))),this.connection.onCodeLensResolve((e=>this.codeLensResolveHandler(e))),this.connection.onDefinition((e=>this.definitionHandler(e))),this.yamlSettings.documents.onDidChangeContent((e=>this.cancelLimitExceededWarnings(e.document.uri))),this.yamlSettings.documents.onDidClose((e=>this.cancelLimitExceededWarnings(e.document.uri)))}documentLinkHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);return t?this.languageService.findLinks(t):Promise.resolve([])}documentSymbolHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);if(!t)return;const n=this.onResultLimitExceeded(t.uri,this.yamlSettings.maxItemsComputed,"document symbols"),r={resultLimit:this.yamlSettings.maxItemsComputed,onResultLimitExceeded:n};return this.yamlSettings.hierarchicalDocumentSymbolSupport?this.languageService.findDocumentSymbols2(t,r):this.languageService.findDocumentSymbols(t,r)}formatterHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);if(!t)return;const n={tabWidth:e.options.tabSize,...this.yamlSettings.yamlFormatterSettings};return this.languageService.doFormat(t,n)}formatOnTypeHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);if(t)return this.languageService.doDocumentOnTypeFormatting(t,e)}hoverHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);return t?this.languageService.doHover(t,e.position):Promise.resolve(void 0)}completionHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);return t?this.languageService.doComplete(t,e.position,Sa(t,this.yamlSettings.specificValidatorPaths)):Promise.resolve({items:[],isIncomplete:!1})}watchedFilesHandler(e){let t=!1;e.changes.forEach((e=>{this.languageService.resetSchema(e.uri)&&(t=!0)})),t&&this.yamlSettings.documents.all().forEach((e=>this.validationHandler.validate(e)))}foldingRangeHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);if(!t)return;const n=this.yamlSettings.capabilities.textDocument.foldingRange,r=this.yamlSettings.maxItemsComputed||n.rangeLimit,i={rangeLimit:r,onRangeLimitExceeded:this.onResultLimitExceeded(t.uri,r,"folding ranges"),lineFoldingOnly:n.lineFoldingOnly};return this.languageService.getFoldingRanges(t,i)}selectionRangeHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);if(t)return this.languageService.getSelectionRanges(t,e.positions)}codeActionHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);if(t)return this.languageService.getCodeAction(t,e)}codeLensHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);if(t)return this.languageService.getCodeLens(t)}codeLensResolveHandler(e){return this.languageService.resolveCodeLens(e)}definitionHandler(e){const t=this.yamlSettings.documents.get(e.textDocument.uri);if(t)return this.languageService.doDefinition(t,e)}cancelLimitExceededWarnings(e){const t=this.pendingLimitExceededWarnings[e];t&&t.timeout&&(clearTimeout(t.timeout),delete this.pendingLimitExceededWarnings[e])}onResultLimitExceeded(e,t,n){return()=>{let r=this.pendingLimitExceededWarnings[e];if(r){if(!r.timeout)return;r.features[n]=n,r.timeout.refresh()}else r={features:{[n]:n}},r.timeout=setTimeout((()=>{this.connection.sendNotification(f.type,`${w.basename(e)}: For performance reasons, ${Object.keys(r.features).join(" and ")} have been limited to ${t} items.`),r.timeout=void 0}),2e3),this.pendingLimitExceededWarnings[e]=r}}}class pc{constructor(e,t,n,r){this.connection=e,this.languageService=t,this.yamlSettings=n,this.settingsHandler=r}registerHandlers(){this.connection.onNotification(c.type,(e=>this.schemaAssociationNotificationHandler(e))),this.connection.onNotification(u.type,(()=>this.dynamicSchemaRequestHandler())),this.connection.onNotification(l.type,(()=>this.vscodeContentRequestHandler())),this.connection.onNotification(y.type,(()=>this.schemaSelectionRequestHandler()))}schemaAssociationNotificationHandler(e){this.yamlSettings.schemaAssociations=e,this.yamlSettings.specificValidatorPaths=[],this.settingsHandler.pullConfiguration().catch((e=>console.log(e)))}dynamicSchemaRequestHandler(){this.languageService.registerCustomSchemaProvider((e=>this.connection.sendRequest(p.type,e)))}vscodeContentRequestHandler(){this.yamlSettings.useVSCodeContentRequest=!0}schemaSelectionRequestHandler(){this.yamlSettings.useSchemaSelectionRequests=!0}}class mc{constructor(e,t){this.connection=e,this.languageService=t}registerHandlers(){this.connection.onRequest(g.type,(e=>this.registerSchemaModificationNotificationHandler(e)))}registerSchemaModificationNotificationHandler(e){e.action===ga.add?this.languageService.modifySchemaContent(e):e.action===ga.delete?this.languageService.deleteSchemaContent(e):e.action===ga.deleteAll&&this.languageService.deleteSchemasWhole(e)}}class gc{constructor(e,t,n){this.connection=e,this.languageService=t,this.yamlSettings=n,this.yamlSettings.documents.onDidChangeContent((e=>{this.validate(e.document)})),this.yamlSettings.documents.onDidClose((e=>{this.cleanPendingValidation(e.document),this.connection.sendDiagnostics({uri:e.document.uri,diagnostics:[]})}))}validate(e){this.cleanPendingValidation(e),this.yamlSettings.pendingValidationRequests[e.uri]=setTimeout((()=>{delete this.yamlSettings.pendingValidationRequests[e.uri],this.validateTextDocument(e)}),this.yamlSettings.validationDelayMs)}cleanPendingValidation(e){const t=this.yamlSettings.pendingValidationRequests[e.uri];t&&(clearTimeout(t),delete this.yamlSettings.pendingValidationRequests[e.uri])}validateTextDocument(e){if(e)return this.languageService.doValidation(e,Sa(e,this.yamlSettings.specificValidatorPaths)).then((t=>{const n=[];for(const e of t)2===e.severity&&(e.severity=1),n.push(e);const r=function(e){const t=new Set,n=[];for(const r in e){const i=e[r],o=JSON.stringify(i);t.has(o)||(n.push(i),t.add(o))}return n}(n);return this.connection.sendDiagnostics({uri:e.uri,diagnostics:r}),r}))}}class yc{constructor(e,t,n,r,i){this.connection=e,this.languageService=t,this.yamlSettings=n,this.validationHandler=r,this.telemetry=i}async registerHandlers(){if(this.yamlSettings.hasConfigurationCapability&&this.yamlSettings.clientDynamicRegisterSupport)try{await this.connection.client.register(t.DidChangeConfigurationNotification.type)}catch(e){this.telemetry.sendError("yaml.settings.error",{error:jo(e)})}this.connection.onDidChangeConfiguration((()=>this.pullConfiguration()))}async pullConfiguration(){const e=await this.connection.workspace.getConfiguration([{section:"yaml"},{section:"http"},{section:"[yaml]"},{section:"editor"},{section:"files"}]),t={yaml:e[0],http:{proxy:e[1]?.proxy??"",proxyStrictSSL:e[1]?.proxyStrictSSL??!1},yamlEditor:e[2],vscodeEditor:e[3],files:e[4]};await this.setConfiguration(t)}async setConfiguration(e){if((0,v.configure)(e.http&&e.http.proxy,e.http&&e.http.proxyStrictSSL),this.yamlSettings.specificValidatorPaths=[],e.yaml){if(Object.prototype.hasOwnProperty.call(e.yaml,"schemas")&&(this.yamlSettings.yamlConfigurationSettings=e.yaml.schemas),Object.prototype.hasOwnProperty.call(e.yaml,"validate")&&(this.yamlSettings.yamlShouldValidate=e.yaml.validate),Object.prototype.hasOwnProperty.call(e.yaml,"hover")&&(this.yamlSettings.yamlShouldHover=e.yaml.hover),Object.prototype.hasOwnProperty.call(e.yaml,"completion")&&(this.yamlSettings.yamlShouldCompletion=e.yaml.completion),this.yamlSettings.customTags=e.yaml.customTags?e.yaml.customTags:[],this.yamlSettings.maxItemsComputed=Math.trunc(Math.max(0,Number(e.yaml.maxItemsComputed)))||5e3,e.yaml.schemaStore&&(this.yamlSettings.schemaStoreEnabled=e.yaml.schemaStore.enable,0!==e.yaml.schemaStore.url?.length&&(this.yamlSettings.schemaStoreUrl=e.yaml.schemaStore.url)),e.files?.associations)for(const[t,n]of Object.entries(e.files.associations))"yaml"===n&&this.yamlSettings.fileExtensions.push(t);this.yamlSettings.yamlVersion=e.yaml.yamlVersion??"1.2",e.yaml.format&&(this.yamlSettings.yamlFormatterSettings={proseWrap:e.yaml.format.proseWrap||"preserve",printWidth:e.yaml.format.printWidth||80},void 0!==e.yaml.format.singleQuote&&(this.yamlSettings.yamlFormatterSettings.singleQuote=e.yaml.format.singleQuote),void 0!==e.yaml.format.bracketSpacing&&(this.yamlSettings.yamlFormatterSettings.bracketSpacing=e.yaml.format.bracketSpacing),void 0!==e.yaml.format.enable&&(this.yamlSettings.yamlFormatterSettings.enable=e.yaml.format.enable)),this.yamlSettings.disableAdditionalProperties=e.yaml.disableAdditionalProperties,this.yamlSettings.disableDefaultProperties=e.yaml.disableDefaultProperties,e.yaml.suggest&&(this.yamlSettings.suggest.parentSkeletonSelectedFirst=e.yaml.suggest.parentSkeletonSelectedFirst),this.yamlSettings.style={flowMapping:e.yaml.style?.flowMapping??"allow",flowSequence:e.yaml.style?.flowSequence??"allow"},this.yamlSettings.keyOrdering=e.yaml.keyOrdering??!1}this.yamlSettings.schemaConfigurationSettings=[];let n=2;e.vscodeEditor&&(n=!e.vscodeEditor.detectIndentation&&e.yamlEditor?e.yamlEditor["editor.tabSize"]:n),e.yamlEditor&&e.yamlEditor["editor.tabSize"]&&(this.yamlSettings.indentation=" ".repeat(n));for(const e in this.yamlSettings.yamlConfigurationSettings){const t=this.yamlSettings.yamlConfigurationSettings[e],n={fileMatch:Array.isArray(t)?t:[t],uri:Ha(this.yamlSettings.workspaceFolders,this.yamlSettings.workspaceRoot,e,this.telemetry)};this.yamlSettings.schemaConfigurationSettings.push(n)}await this.setSchemaStoreSettingsIfNotSet(),this.updateConfiguration(),this.yamlSettings.useSchemaSelectionRequests&&this.connection.sendNotification(y.schemaStoreInitialized,{}),this.yamlSettings.clientDynamicRegisterSupport&&(e&&e.yaml&&e.yaml.format&&e.yaml.format.enable?this.yamlSettings.formatterRegistration||(this.yamlSettings.formatterRegistration=this.connection.client.register(t.DocumentFormattingRequest.type,{documentSelector:[{language:"yaml"}]})):this.yamlSettings.formatterRegistration&&(this.yamlSettings.formatterRegistration.then((e=>e.dispose())),this.yamlSettings.formatterRegistration=null))}async setSchemaStoreSettingsIfNotSet(){const e=0!==this.yamlSettings.schemaStoreSettings.length;let t="";if(t=0!==this.yamlSettings.schemaStoreUrl?.length?this.yamlSettings.schemaStoreUrl:za,this.yamlSettings.schemaStoreEnabled&&!e)try{const e=await this.getSchemaStoreMatchingSchemas(t);this.yamlSettings.schemaStoreSettings=e.schemas}catch(e){}else this.yamlSettings.schemaStoreEnabled||(this.yamlSettings.schemaStoreSettings=[])}async getSchemaStoreMatchingSchemas(e){const t=await(0,v.xhr)({url:e}),n={schemas:[]},r=JSON.parse(t.responseText);for(const e in r.schemas){const t=r.schemas[e];if(t&&t.fileMatch)for(const e in t.fileMatch){const r=t.fileMatch[e];this.yamlSettings.fileExtensions.findIndex((e=>r.indexOf(e)>-1))>-1&&n.schemas.push({uri:t.url,fileMatch:[r],priority:hc.SchemaStore,name:t.name,description:t.description,versions:t.versions})}}return n}updateConfiguration(){let e={validate:this.yamlSettings.yamlShouldValidate,hover:this.yamlSettings.yamlShouldHover,completion:this.yamlSettings.yamlShouldCompletion,schemas:[],customTags:this.yamlSettings.customTags,format:this.yamlSettings.yamlFormatterSettings.enable,indentation:this.yamlSettings.indentation,disableAdditionalProperties:this.yamlSettings.disableAdditionalProperties,disableDefaultProperties:this.yamlSettings.disableDefaultProperties,parentSkeletonSelectedFirst:this.yamlSettings.suggest.parentSkeletonSelectedFirst,flowMapping:this.yamlSettings.style?.flowMapping,flowSequence:this.yamlSettings.style?.flowSequence,yamlVersion:this.yamlSettings.yamlVersion,keyOrdering:this.yamlSettings.keyOrdering};if(this.yamlSettings.schemaAssociations)if(Array.isArray(this.yamlSettings.schemaAssociations))this.yamlSettings.schemaAssociations.forEach((t=>{e=this.configureSchemas(t.uri,t.fileMatch,t.schema,e,hc.SchemaAssociation)}));else for(const t in this.yamlSettings.schemaAssociations){const n=this.yamlSettings.schemaAssociations[t];e=this.configureSchemas(t,n,null,e,hc.SchemaAssociation)}this.yamlSettings.schemaConfigurationSettings&&this.yamlSettings.schemaConfigurationSettings.forEach((t=>{let n=t.uri;!n&&t.schema&&(n=t.schema.id),!n&&t.fileMatch&&(n="vscode://schemas/custom/"+encodeURIComponent(t.fileMatch.join("&"))),n&&(_(n)&&(n=S(this.yamlSettings.workspaceFolders,this.yamlSettings.workspaceRoot,n)),e=this.configureSchemas(n,t.fileMatch,t.schema,e,hc.Settings))})),this.yamlSettings.schemaStoreSettings&&(e.schemas=e.schemas.concat(this.yamlSettings.schemaStoreSettings)),this.languageService.configure(e),this.yamlSettings.documents.all().forEach((e=>this.validationHandler.validate(e)))}configureSchemas(e,t,n,r,i){return e=Ha(this.yamlSettings.workspaceFolders,this.yamlSettings.workspaceRoot,e,this.telemetry),null===n?r.schemas.push({uri:e,fileMatch:t,priority:i}):r.schemas.push({uri:e,fileMatch:t,schema:n,priority:i}),t.constructor===Array&&e===Ka?t.forEach((e=>{this.yamlSettings.specificValidatorPaths.push(e)})):e===Ka&&this.yamlSettings.specificValidatorPaths.push(t),r}}class vc{constructor(e,t){this.connection=e,this.commandExecutor=t}registerHandlers(){this.connection.onExecuteCommand((e=>this.executeCommand(e)))}executeCommand(e){return this.commandExecutor.executeCommand(e)}}const bc=new class{constructor(){this.commands=new Map}executeCommand(e){if(this.commands.has(e.command))return this.commands.get(e.command)(...e.arguments);throw new Error(`Command '${e.command}' not found`)}registerCommand(e,t){this.commands.set(e,t)}};var wc;!function(e){e.type=new t.RequestType("fs/readFile")}(wc||(wc={}));const _c=new i.BrowserMessageReader(globalThis),Sc=new i.BrowserMessageWriter(globalThis),kc=(0,i.createConnection)(_c,Sc),xc=new class{constructor(){this.yamlConfigurationSettings=void 0,this.schemaAssociations=void 0,this.formatterRegistration=null,this.specificValidatorPaths=[],this.schemaConfigurationSettings=[],this.yamlShouldValidate=!0,this.yamlFormatterSettings={singleQuote:!1,bracketSpacing:!0,proseWrap:"preserve",printWidth:80,enable:!0},this.yamlShouldHover=!0,this.yamlShouldCompletion=!0,this.schemaStoreSettings=[],this.customTags=[],this.schemaStoreEnabled=!0,this.schemaStoreUrl=za,this.indentation=void 0,this.disableAdditionalProperties=!1,this.disableDefaultProperties=!1,this.suggest={parentSkeletonSelectedFirst:!1},this.keyOrdering=!1,this.maxItemsComputed=5e3,this.pendingValidationRequests={},this.validationDelayMs=200,this.documents=new t.TextDocuments(Ct),this.workspaceRoot=null,this.workspaceFolders=[],this.clientDynamicRegisterSupport=!1,this.hierarchicalDocumentSymbolSupport=!1,this.hasWorkspaceFolderCapability=!1,this.hasConfigurationCapability=!1,this.useVSCodeContentRequest=!1,this.yamlVersion="1.2",this.useSchemaSelectionRequests=!1,this.hasWsChangeWatchedFileDynamicRegistration=!1,this.fileExtensions=[".yml",".yaml"]}},Cc={readFile:e=>kc.sendRequest(wc.type,e)},Tc=((e,t)=>((e,t,n,r,i,o)=>{if(!t)return Promise.reject("No schema specified");_(t)&&(t=S(n,r,t));let a=s.parse(t).scheme.toLowerCase();if(/^[a-z]:[\\/]/i.test(t)){const e=s.file(t);a=e.scheme.toLowerCase(),t=e.toString()}if("file"===a){const e=s.parse(t).fsPath;return o.readFile(e,"UTF-8").catch((()=>""))}if("http"===a||"https"===a){if(i)return e.sendRequest(h.type,t).then((e=>e),(e=>Promise.reject(e.message)));const n={"Accept-Encoding":"gzip, deflate"};return(0,v.xhr)({url:t,followRedirects:5,headers:n}).then((e=>e.responseText),(e=>Promise.reject(e.responseText||(0,v.getErrorStatusDescription)(e.status)||e.toString())))}return e.sendRequest(d.type,t)})(e,t,xc.workspaceFolders,xc.workspaceRoot,xc.useVSCodeContentRequest,Cc)).bind(void 0,kc),Ec=new class{constructor(e){this.connection=e}send(e){this.connection.telemetry.logEvent(e)}sendError(e,t){this.send({name:e,type:"track",properties:t})}sendTrack(e,t){this.send({name:e,type:"track",properties:t})}}(kc);new class{constructor(e,t,n,r,i){this.connection=e,this.yamlSettings=t,this.workspaceContext=n,this.schemaRequestService=r,this.telemetry=i,this.yamlSettings.documents.listen(this.connection),this.connection.onInitialize((e=>this.connectionInitialized(e))),this.connection.onInitialized((()=>{this.yamlSettings.hasWsChangeWatchedFileDynamicRegistration&&this.connection.workspace.onDidChangeWorkspaceFolders((e=>{this.yamlSettings.workspaceFolders=((e,t)=>(e=e.filter((e=>!t.removed.some((t=>t.uri===e.uri)))),e=e.filter((e=>!t.added.some((t=>t.uri===e.uri)))).concat(t.added),e))(this.yamlSettings.workspaceFolders,e)})),this.settingsHandler.registerHandlers(),this.settingsHandler.pullConfiguration()}))}connectionInitialized(e){return this.yamlSettings.capabilities=e.capabilities,this.languageService=function(e){const t=new va(e.schemaRequestService,e.workspaceContext),n=new sc(t,e.clientCapabilities,na,e.telemetry),r=new ka(t,e.telemetry),i=new wa(t,e.telemetry),o=new Na(t,e.telemetry),s=new Ia.l,a=new Va(e.clientCapabilities),c=new Qa(t,e.telemetry),u=new Da(e.telemetry),l=new lc(e.telemetry);return new uc(t,e.yamlSettings,e.connection),{configure:e=>{t.clearExternalSchemas(),e.schemas&&(t.schemaPriorityMapping=new Map,e.schemas.forEach((e=>{const n=e.priority?e.priority:0;t.addSchemaPriority(e.uri,n),t.registerExternalSchema(e.uri,e.fileMatch,e.schema,e.name,e.description,e.versions)}))),o.configure(e),r.configure(e),n.configure(e),s.configure(e),a.configure(e)},registerCustomSchemaProvider:e=>{t.registerCustomSchemaProvider(e)},findLinks:u.findLinks.bind(u),doComplete:n.doComplete.bind(n),doValidation:o.doValidation.bind(o),doHover:r.doHover.bind(r),findDocumentSymbols:i.findDocumentSymbols.bind(i),findDocumentSymbols2:i.findHierarchicalDocumentSymbols.bind(i),doDefinition:l.getDefinition.bind(l),resetSchema:e=>t.onResourceChange(e),doFormat:s.format.bind(s),doDocumentOnTypeFormatting:Ba,addSchema:(e,n)=>t.saveSchema(e,n),deleteSchema:e=>t.deleteSchema(e),modifySchemaContent:e=>t.addContent(e),deleteSchemaContent:e=>t.deleteContent(e),deleteSchemasWhole:e=>t.deleteSchemas(e),getFoldingRanges:Ma,getSelectionRanges:fc,getCodeAction:(e,t)=>a.getCodeAction(e,t),getCodeLens:e=>c.getCodeLens(e),resolveCodeLens:e=>c.resolveCodeLens(e)}}({schemaRequestService:this.schemaRequestService,workspaceContext:this.workspaceContext,connection:this.connection,yamlSettings:this.yamlSettings,telemetry:this.telemetry,clientCapabilities:e.capabilities}),e.rootUri&&(this.yamlSettings.workspaceRoot=s.parse(e.rootUri)),this.yamlSettings.workspaceFolders=e.workspaceFolders||[],this.yamlSettings.hierarchicalDocumentSymbolSupport=!!(this.yamlSettings.capabilities.textDocument&&this.yamlSettings.capabilities.textDocument.documentSymbol&&this.yamlSettings.capabilities.textDocument.documentSymbol.hierarchicalDocumentSymbolSupport),this.yamlSettings.clientDynamicRegisterSupport=!!(this.yamlSettings.capabilities.textDocument&&this.yamlSettings.capabilities.textDocument.rangeFormatting&&this.yamlSettings.capabilities.textDocument.rangeFormatting.dynamicRegistration),this.yamlSettings.hasWorkspaceFolderCapability=this.yamlSettings.capabilities.workspace&&!!this.yamlSettings.capabilities.workspace.workspaceFolders,this.yamlSettings.hasConfigurationCapability=!(!this.yamlSettings.capabilities.workspace||!this.yamlSettings.capabilities.workspace.configuration),this.yamlSettings.hasWsChangeWatchedFileDynamicRegistration=!!(this.yamlSettings.capabilities.workspace&&this.yamlSettings.capabilities.workspace.didChangeWatchedFiles&&this.yamlSettings.capabilities.workspace.didChangeWatchedFiles.dynamicRegistration),this.registerHandlers(),function(e,t){e.registerCommand(ja.JUMP_TO_SCHEMA,(async e=>{if(e){if(!e.startsWith("file")&&!/^[a-z]:[\\/]/i.test(e)){const t=s.parse(e);e=s.from({scheme:"json-schema",authority:t.authority,path:t.path.endsWith(".json")?t.path:t.path+".json",fragment:e}).toString()}/^[a-z]:[\\/]/i.test(e)&&(e=s.file(e).toString()),await t.window.showDocument({uri:e,external:!1,takeFocus:!0})||t.window.showErrorMessage(`Cannot open ${e}`)}}))}(bc,this.connection),{capabilities:{textDocumentSync:t.TextDocumentSyncKind.Incremental,completionProvider:{resolveProvider:!1},hoverProvider:!0,documentSymbolProvider:!0,documentFormattingProvider:!1,documentOnTypeFormattingProvider:{firstTriggerCharacter:"\n"},documentRangeFormattingProvider:!1,definitionProvider:!0,documentLinkProvider:{},foldingRangeProvider:!0,selectionRangeProvider:!0,codeActionProvider:!0,codeLensProvider:{resolveProvider:!1},executeCommandProvider:{commands:Object.keys(ja).map((e=>ja[e]))},workspace:{workspaceFolders:{changeNotifications:!0,supported:!0}}}}}registerHandlers(){this.validationHandler=new gc(this.connection,this.languageService,this.yamlSettings),this.settingsHandler=new yc(this.connection,this.languageService,this.yamlSettings,this.validationHandler,this.telemetry),this.languageHandler=new dc(this.connection,this.languageService,this.yamlSettings,this.validationHandler),this.languageHandler.registerHandlers(),new pc(this.connection,this.languageService,this.yamlSettings,this.settingsHandler).registerHandlers(),new mc(this.connection,this.languageService).registerHandlers(),new vc(this.connection,bc).registerHandlers()}start(){this.connection.listen()}}(kc,xc,k,Tc,Ec).start()})(),serverExportVar=r})(); //# sourceMappingURL=languageserver-web.js.map