UNPKG

@apitools/openapi-parser

Version:

Resolve OpenAPI Refs and/or convert Swagger 2.0 to OpenAPI

8 lines 453 kB
const e="application/json, application/yaml",t="https://swagger.io",r=Object.freeze({url:"/"}),{fetch:n,Response:i,Headers:s,Request:o,FormData:c,File:a,Blob:u}=globalThis;function l(e,t){return t||"undefined"==typeof navigator||(t=navigator),t&&"ReactNative"===t.product?!(!e||"object"!=typeof e||"string"!=typeof e.uri):"undefined"!=typeof File&&e instanceof File||("undefined"!=typeof Blob&&e instanceof Blob||(!!ArrayBuffer.isView(e)||null!==e&&"object"==typeof e&&"function"==typeof e.pipe))}function h(e,t){return Array.isArray(e)&&e.some((e=>l(e,t)))}void 0===globalThis.fetch&&(globalThis.fetch=n),void 0===globalThis.Headers&&(globalThis.Headers=s),void 0===globalThis.Request&&(globalThis.Request=o),void 0===globalThis.Response&&(globalThis.Response=i),void 0===globalThis.FormData&&(globalThis.FormData=c),void 0===globalThis.File&&(globalThis.File=a),void 0===globalThis.Blob&&(globalThis.Blob=u);class f extends File{constructor(e,t="",r={}){super([e],t,r),this.data=e}valueOf(){return this.data}toString(){return this.valueOf()}}function p(e,t="reserved"){return[...e].map((e=>{if((e=>/^[a-z0-9\-._~]+$/i.test(e))(e))return e;if((e=>":/?#[]@!$&'()*+,;=".indexOf(e)>-1)(e)&&"unsafe"===t)return e;const r=new TextEncoder;return Array.from(r.encode(e)).map((e=>`0${e.toString(16).toUpperCase()}`.slice(-2))).map((e=>`%${e}`)).join("")})).join("")}function d(e){const{value:t}=e;return Array.isArray(t)?function({key:e,value:t,style:r,explode:n,escape:i}){if("simple"===r)return t.map((e=>m(e,i))).join(",");if("label"===r)return`.${t.map((e=>m(e,i))).join(".")}`;if("matrix"===r)return t.map((e=>m(e,i))).reduce(((t,r)=>!t||n?`${t||""};${e}=${r}`:`${t},${r}`),"");if("form"===r){const r=n?`&${e}=`:",";return t.map((e=>m(e,i))).join(r)}if("spaceDelimited"===r){const r=n?`${e}=`:"";return t.map((e=>m(e,i))).join(` ${r}`)}if("pipeDelimited"===r){const r=n?`${e}=`:"";return t.map((e=>m(e,i))).join(`|${r}`)}return}(e):"object"==typeof t?function({key:e,value:t,style:r,explode:n,escape:i}){const s=Object.keys(t);if("simple"===r)return s.reduce(((e,r)=>{const s=m(t[r],i);return`${e?`${e},`:""}${r}${n?"=":","}${s}`}),"");if("label"===r)return s.reduce(((e,r)=>{const s=m(t[r],i);return`${e?`${e}.`:"."}${r}${n?"=":"."}${s}`}),"");if("matrix"===r&&n)return s.reduce(((e,r)=>`${e?`${e};`:";"}${r}=${m(t[r],i)}`),"");if("matrix"===r)return s.reduce(((r,n)=>{const s=m(t[n],i);return`${r?`${r},`:`;${e}=`}${n},${s}`}),"");if("form"===r)return s.reduce(((e,r)=>{const s=m(t[r],i);return`${e?`${e}${n?"&":","}`:""}${r}${n?"=":","}${s}`}),"");return}(e):function({key:e,value:t,style:r,escape:n}){if("simple"===r)return m(t,n);if("label"===r)return`.${m(t,n)}`;if("matrix"===r)return`;${e}=${m(t,n)}`;if("form"===r)return m(t,n);if("deepObject"===r)return m(t,n);return}(e)}function m(e,t=!1){var r;return Array.isArray(e)||null!==e&&"object"==typeof e?e=JSON.stringify(e):"number"!=typeof e&&"boolean"!=typeof e||(e=String(e)),t&&"string"==typeof e&&e.length>0?p(e,t):null!==(r=e)&&void 0!==r?r:""}const v={form:",",spaceDelimited:"%20",pipeDelimited:"|"},y={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function b(e,t,r=!1){const{collectionFormat:n,allowEmptyValue:i,serializationOption:s,encoding:o}=t,c="object"!=typeof t||Array.isArray(t)?t:t.value,a=r?e=>e.toString():e=>encodeURIComponent(e),u=a(e);if(void 0===c&&i)return[[u,""]];if(l(c)||h(c))return[[u,c]];if(s)return g(e,c,r,s);if(o){if([typeof o.style,typeof o.explode,typeof o.allowReserved].some((e=>"undefined"!==e))){const{style:t,explode:n,allowReserved:i}=o;return g(e,c,r,{style:t,explode:n,allowReserved:i})}if("string"==typeof o.contentType){if(o.contentType.startsWith("application/json")){const e=a("string"==typeof c?c:JSON.stringify(c));return[[u,new f(e,"blob",{type:o.contentType})]]}const e=a(String(c));return[[u,new f(e,"blob",{type:o.contentType})]]}return"object"!=typeof c?[[u,a(c)]]:Array.isArray(c)&&c.every((e=>"object"!=typeof e))?[[u,c.map(a).join(",")]]:[[u,a(JSON.stringify(c))]]}return"object"!=typeof c?[[u,a(c)]]:Array.isArray(c)?"multi"===n?[[u,c.map(a)]]:[[u,c.map(a).join(y[n||"csv"])]]:[[u,""]]}function g(e,t,r,n){const i=n.style||"form",s=void 0===n.explode?"form"===i:n.explode,o=!r&&(n&&n.allowReserved?"unsafe":"reserved"),c=e=>m(e,o),a=r?e=>e:e=>c(e);return"object"!=typeof t?[[a(e),c(t)]]:Array.isArray(t)?s?[[a(e),t.map(c)]]:[[a(e),t.map(c).join(v[i])]]:"deepObject"===i?Object.keys(t).map((r=>[a(`${e}[${r}]`),c(t[r])])):s?Object.keys(t).map((e=>[a(e),c(t[e])])):[[a(e),Object.keys(t).map((e=>[`${a(e)},${c(t[e])}`])).join(",")]]}function w(e){return((e,{encode:t=!0}={})=>{const r=(e,t,n)=>(Array.isArray(n)?n.reduce(((n,i)=>r(e,t,i)),e):n instanceof Date?e.append(t,n.toISOString()):"object"==typeof n?Object.entries(n).reduce(((n,[i,s])=>r(e,`${t}[${i}]`,s)),e):e.append(t,n),e),n=Object.entries(e).reduce(((e,[t,n])=>r(e,t,n)),new URLSearchParams),i=String(n);return t?i:decodeURIComponent(i)})(Object.keys(e).reduce(((t,r)=>{for(const[n,i]of b(r,e[r]))t[n]=i instanceof f?i.valueOf():i;return t}),{}),{encode:!1})}function x(e={}){const{url:t="",query:r,form:n}=e;if(n){const t=Object.keys(n).some((e=>{const{value:t}=n[e];return l(t)||h(t)})),r=e.headers["content-type"]||e.headers["Content-Type"];if(t||/multipart\/form-data/i.test(r)){const t=(i=e.form,Object.entries(i).reduce(((e,[t,r])=>{for(const[n,i]of b(t,r,!0))if(Array.isArray(i))for(const t of i)if(ArrayBuffer.isView(t)){const r=new Blob([t]);e.append(n,r)}else e.append(n,t);else if(ArrayBuffer.isView(i)){const t=new Blob([i]);e.append(n,t)}else e.append(n,i);return e}),new FormData));e.formdata=t,e.body=t}else e.body=w(n);delete e.form}var i;if(r){const[n,i]=t.split("?");let s="";if(i){const e=new URLSearchParams(i);Object.keys(r).forEach((t=>e.delete(t))),s=String(e)}const o=((...e)=>{const t=e.filter((e=>e)).join("&");return t?`?${t}`:""})(s,w(r));e.url=n+o,delete e.query}return e} /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function E(e){return null==e}var j=function(e,t){var r,n,i,s;if(t)for(r=0,n=(s=Object.keys(t)).length;r<n;r+=1)e[i=s[r]]=t[i];return e},O={isNothing:E,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:E(e)?[]:[e]},repeat:function(e,t){var r,n="";for(r=0;r<t;r+=1)n+=e;return n},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:j};function $(e,t){var r="",n=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+="\n\n"+e.mark.snippet),n+" "+r):n}function S(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=$(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}S.prototype=Object.create(Error.prototype),S.prototype.constructor=S,S.prototype.toString=function(e){return this.name+": "+$(this,e)};var A=S;function P(e,t,r,n,i){var s="",o="",c=Math.floor(i/2)-1;return n-t>c&&(t=n-c+(s=" ... ").length),r-n>c&&(r=n+c-(o=" ...").length),{str:s+e.slice(t,r).replace(/\t/g,"→")+o,pos:n-t+s.length}}function T(e,t){return O.repeat(" ",t-e.length)+e}var k=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var r,n=/\r?\n|\r|\0/g,i=[0],s=[],o=-1;r=n.exec(e.buffer);)s.push(r.index),i.push(r.index+r[0].length),e.position<=r.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var c,a,u="",l=Math.min(e.line+t.linesAfter,s.length).toString().length,h=t.maxLength-(t.indent+l+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)a=P(e.buffer,i[o-c],s[o-c],e.position-(i[o]-i[o-c]),h),u=O.repeat(" ",t.indent)+T((e.line-c+1).toString(),l)+" | "+a.str+"\n"+u;for(a=P(e.buffer,i[o],s[o],e.position,h),u+=O.repeat(" ",t.indent)+T((e.line+1).toString(),l)+" | "+a.str+"\n",u+=O.repeat("-",t.indent+l+3+a.pos)+"^\n",c=1;c<=t.linesAfter&&!(o+c>=s.length);c++)a=P(e.buffer,i[o+c],s[o+c],e.position-(i[o]-i[o+c]),h),u+=O.repeat(" ",t.indent)+T((e.line+c+1).toString(),l)+" | "+a.str+"\n";return u.replace(/\n$/,"")},F=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],I=["scalar","sequence","mapping"];var R=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===F.indexOf(t))throw new A('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(r){e[r].forEach((function(e){t[String(e)]=r}))})),t}(t.styleAliases||null),-1===I.indexOf(this.kind))throw new A('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function C(e,t){var r=[];return e[t].forEach((function(e){var t=r.length;r.forEach((function(r,n){r.tag===e.tag&&r.kind===e.kind&&r.multi===e.multi&&(t=n)})),r[t]=e})),r}function D(e){return this.extend(e)}D.prototype.extend=function(e){var t=[],r=[];if(e instanceof R)r.push(e);else if(Array.isArray(e))r=r.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new A("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof R))throw new A("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new A("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new A("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),r.forEach((function(e){if(!(e instanceof R))throw new A("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var n=Object.create(D.prototype);return n.implicit=(this.implicit||[]).concat(t),n.explicit=(this.explicit||[]).concat(r),n.compiledImplicit=C(n,"implicit"),n.compiledExplicit=C(n,"explicit"),n.compiledTypeMap=function(){var e,t,r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function n(e){e.multi?(r.multi[e.kind].push(e),r.multi.fallback.push(e)):r[e.kind][e.tag]=r.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(n);return r}(n.compiledImplicit,n.compiledExplicit),n};var _=D,M=new R("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),N=new R("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),q=new R("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),B=new _({explicit:[M,N,q]});var L=new R("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var U=new R("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function J(e){return 48<=e&&e<=55}function G(e){return 48<=e&&e<=57}var V=new R("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,r,n=e.length,i=0,s=!1;if(!n)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===n)return!0;if("b"===(t=e[++i])){for(i++;i<n;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(i++;i<n;i++)if("_"!==(t=e[i])){if(!(48<=(r=e.charCodeAt(i))&&r<=57||65<=r&&r<=70||97<=r&&r<=102))return!1;s=!0}return s&&"_"!==t}if("o"===t){for(i++;i<n;i++)if("_"!==(t=e[i])){if(!J(e.charCodeAt(i)))return!1;s=!0}return s&&"_"!==t}}if("_"===t)return!1;for(;i<n;i++)if("_"!==(t=e[i])){if(!G(e.charCodeAt(i)))return!1;s=!0}return!(!s||"_"===t)},construct:function(e){var t,r=e,n=1;if(-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(t=r[0])&&"+"!==t||("-"===t&&(n=-1),t=(r=r.slice(1))[0]),"0"===r)return 0;if("0"===t){if("b"===r[1])return n*parseInt(r.slice(2),2);if("x"===r[1])return n*parseInt(r.slice(2),16);if("o"===r[1])return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!O.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),H=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var z=/^[-+]?[0-9]+e/;var X=new R("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!H.test(e)||"_"===e[e.length-1])},construct:function(e){var t,r;return r="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:r*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||O.isNegativeZero(e))},represent:function(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(O.isNegativeZero(e))return"-0.0";return r=e.toString(10),z.test(r)?r.replace("e",".e"):r},defaultStyle:"lowercase"}),W=B.extend({implicit:[L,U,V,X]}),Y=W,Z=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),K=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var Q=new R("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Z.exec(e)||null!==K.exec(e))},construct:function(e){var t,r,n,i,s,o,c,a,u=0,l=null;if(null===(t=Z.exec(e))&&(t=K.exec(e)),null===t)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(r,n,i));if(s=+t[4],o=+t[5],c=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(l=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(l=-l)),a=new Date(Date.UTC(r,n,i,s,o,c,u)),l&&a.setTime(a.getTime()-l),a},instanceOf:Date,represent:function(e){return e.toISOString()}});var ee=new R("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var re=new R("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,r,n=0,i=e.length,s=te;for(r=0;r<i;r++)if(!((t=s.indexOf(e.charAt(r)))>64)){if(t<0)return!1;n+=6}return n%8==0},construct:function(e){var t,r,n=e.replace(/[\r\n=]/g,""),i=n.length,s=te,o=0,c=[];for(t=0;t<i;t++)t%4==0&&t&&(c.push(o>>16&255),c.push(o>>8&255),c.push(255&o)),o=o<<6|s.indexOf(n.charAt(t));return 0===(r=i%4*6)?(c.push(o>>16&255),c.push(o>>8&255),c.push(255&o)):18===r?(c.push(o>>10&255),c.push(o>>2&255)):12===r&&c.push(o>>4&255),new Uint8Array(c)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,r,n="",i=0,s=e.length,o=te;for(t=0;t<s;t++)t%3==0&&t&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]),i=(i<<8)+e[t];return 0===(r=s%3)?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]):2===r?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):1===r&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}}),ne=Object.prototype.hasOwnProperty,ie=Object.prototype.toString;var se=new R("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,r,n,i,s,o=[],c=e;for(t=0,r=c.length;t<r;t+=1){if(n=c[t],s=!1,"[object Object]"!==ie.call(n))return!1;for(i in n)if(ne.call(n,i)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==o.indexOf(i))return!1;o.push(i)}return!0},construct:function(e){return null!==e?e:[]}}),oe=Object.prototype.toString;var ce=new R("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,r,n,i,s,o=e;for(s=new Array(o.length),t=0,r=o.length;t<r;t+=1){if(n=o[t],"[object Object]"!==oe.call(n))return!1;if(1!==(i=Object.keys(n)).length)return!1;s[t]=[i[0],n[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,r,n,i,s,o=e;for(s=new Array(o.length),t=0,r=o.length;t<r;t+=1)n=o[t],i=Object.keys(n),s[t]=[i[0],n[i[0]]];return s}}),ae=Object.prototype.hasOwnProperty;var ue=new R("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,r=e;for(t in r)if(ae.call(r,t)&&null!==r[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),le=Y.extend({implicit:[Q,ee],explicit:[re,se,ce,ue]}),he=Object.prototype.hasOwnProperty,fe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,pe=/[\x85\u2028\u2029]/,de=/[,\[\]\{\}]/,me=/^(?:!|!!|![a-z\-]+!)$/i,ve=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ye(e){return Object.prototype.toString.call(e)}function be(e){return 10===e||13===e}function ge(e){return 9===e||32===e}function we(e){return 9===e||32===e||10===e||13===e}function xe(e){return 44===e||91===e||93===e||123===e||125===e}function Ee(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function je(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function Oe(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var $e=new Array(256),Se=new Array(256),Ae=0;Ae<256;Ae++)$e[Ae]=je(Ae)?1:0,Se[Ae]=je(Ae);function Pe(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||le,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Te(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=k(r),new A(t,r)}function ke(e,t){throw Te(e,t)}function Fe(e,t){e.onWarning&&e.onWarning.call(null,Te(e,t))}var Ie={YAML:function(e,t,r){var n,i,s;null!==e.version&&ke(e,"duplication of %YAML directive"),1!==r.length&&ke(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&ke(e,"ill-formed argument of the YAML directive"),i=parseInt(n[1],10),s=parseInt(n[2],10),1!==i&&ke(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&Fe(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var n,i;2!==r.length&&ke(e,"TAG directive accepts exactly two arguments"),n=r[0],i=r[1],me.test(n)||ke(e,"ill-formed tag handle (first argument) of the TAG directive"),he.call(e.tagMap,n)&&ke(e,'there is a previously declared suffix for "'+n+'" tag handle'),ve.test(i)||ke(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){ke(e,"tag prefix is malformed: "+i)}e.tagMap[n]=i}};function Re(e,t,r,n){var i,s,o,c;if(t<r){if(c=e.input.slice(t,r),n)for(i=0,s=c.length;i<s;i+=1)9===(o=c.charCodeAt(i))||32<=o&&o<=1114111||ke(e,"expected valid JSON character");else fe.test(c)&&ke(e,"the stream contains non-printable characters");e.result+=c}}function Ce(e,t,r,n){var i,s,o,c;for(O.isObject(r)||ke(e,"cannot merge mappings; the provided source object is unacceptable"),o=0,c=(i=Object.keys(r)).length;o<c;o+=1)s=i[o],he.call(t,s)||(t[s]=r[s],n[s]=!0)}function De(e,t,r,n,i,s,o,c,a){var u,l;if(Array.isArray(i))for(u=0,l=(i=Array.prototype.slice.call(i)).length;u<l;u+=1)Array.isArray(i[u])&&ke(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===ye(i[u])&&(i[u]="[object Object]");if("object"==typeof i&&"[object Object]"===ye(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(s))for(u=0,l=s.length;u<l;u+=1)Ce(e,t,s[u],r);else Ce(e,t,s,r);else e.json||he.call(r,i)||!he.call(t,i)||(e.line=o||e.line,e.lineStart=c||e.lineStart,e.position=a||e.position,ke(e,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[i]=s,delete r[i];return t}function _e(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):ke(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Me(e,t,r){for(var n=0,i=e.input.charCodeAt(e.position);0!==i;){for(;ge(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!be(i))break;for(_e(e),i=e.input.charCodeAt(e.position),n++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==r&&0!==n&&e.lineIndent<r&&Fe(e,"deficient indentation"),n}function Ne(e){var t,r=e.position;return!(45!==(t=e.input.charCodeAt(r))&&46!==t||t!==e.input.charCodeAt(r+1)||t!==e.input.charCodeAt(r+2)||(r+=3,0!==(t=e.input.charCodeAt(r))&&!we(t)))}function qe(e,t){1===t?e.result+=" ":t>1&&(e.result+=O.repeat("\n",t-1))}function Be(e,t){var r,n,i=e.tag,s=e.anchor,o=[],c=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),n=e.input.charCodeAt(e.position);0!==n&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,ke(e,"tab characters must not be used in indentation")),45===n)&&we(e.input.charCodeAt(e.position+1));)if(c=!0,e.position++,Me(e,!0,-1)&&e.lineIndent<=t)o.push(null),n=e.input.charCodeAt(e.position);else if(r=e.line,Je(e,t,3,!1,!0),o.push(e.result),Me(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&0!==n)ke(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!c&&(e.tag=i,e.anchor=s,e.kind="sequence",e.result=o,!0)}function Le(e){var t,r,n,i,s=!1,o=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&ke(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(s=!0,i=e.input.charCodeAt(++e.position)):33===i?(o=!0,r="!!",i=e.input.charCodeAt(++e.position)):r="!",t=e.position,s){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(n=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):ke(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!we(i);)33===i&&(o?ke(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),me.test(r)||ke(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);n=e.input.slice(t,e.position),de.test(n)&&ke(e,"tag suffix cannot contain flow indicator characters")}n&&!ve.test(n)&&ke(e,"tag name cannot contain such characters: "+n);try{n=decodeURIComponent(n)}catch(t){ke(e,"tag name is malformed: "+n)}return s?e.tag=n:he.call(e.tagMap,r)?e.tag=e.tagMap[r]+n:"!"===r?e.tag="!"+n:"!!"===r?e.tag="tag:yaml.org,2002:"+n:ke(e,'undeclared tag handle "'+r+'"'),!0}function Ue(e){var t,r;if(38!==(r=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&ke(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!we(r)&&!xe(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&ke(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Je(e,t,r,n,i){var s,o,c,a,u,l,h,f,p,d=1,m=!1,v=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=c=4===r||3===r,n&&Me(e,!0,-1)&&(m=!0,e.lineIndent>t?d=1:e.lineIndent===t?d=0:e.lineIndent<t&&(d=-1)),1===d)for(;Le(e)||Ue(e);)Me(e,!0,-1)?(m=!0,c=s,e.lineIndent>t?d=1:e.lineIndent===t?d=0:e.lineIndent<t&&(d=-1)):c=!1;if(c&&(c=m||i),1!==d&&4!==r||(f=1===r||2===r?t:t+1,p=e.position-e.lineStart,1===d?c&&(Be(e,p)||function(e,t,r){var n,i,s,o,c,a,u,l=e.tag,h=e.anchor,f={},p=Object.create(null),d=null,m=null,v=null,y=!1,b=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),u=e.input.charCodeAt(e.position);0!==u;){if(y||-1===e.firstTabInLine||(e.position=e.firstTabInLine,ke(e,"tab characters must not be used in indentation")),n=e.input.charCodeAt(e.position+1),s=e.line,63!==u&&58!==u||!we(n)){if(o=e.line,c=e.lineStart,a=e.position,!Je(e,r,2,!1,!0))break;if(e.line===s){for(u=e.input.charCodeAt(e.position);ge(u);)u=e.input.charCodeAt(++e.position);if(58===u)we(u=e.input.charCodeAt(++e.position))||ke(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(De(e,f,p,d,m,null,o,c,a),d=m=v=null),b=!0,y=!1,i=!1,d=e.tag,m=e.result;else{if(!b)return e.tag=l,e.anchor=h,!0;ke(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!b)return e.tag=l,e.anchor=h,!0;ke(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===u?(y&&(De(e,f,p,d,m,null,o,c,a),d=m=v=null),b=!0,y=!0,i=!0):y?(y=!1,i=!0):ke(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,u=n;if((e.line===s||e.lineIndent>t)&&(y&&(o=e.line,c=e.lineStart,a=e.position),Je(e,t,4,!0,i)&&(y?m=e.result:v=e.result),y||(De(e,f,p,d,m,v,o,c,a),d=m=v=null),Me(e,!0,-1),u=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&0!==u)ke(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&De(e,f,p,d,m,null,o,c,a),b&&(e.tag=l,e.anchor=h,e.kind="mapping",e.result=f),b}(e,p,f))||function(e,t){var r,n,i,s,o,c,a,u,l,h,f,p,d=!0,m=e.tag,v=e.anchor,y=Object.create(null);if(91===(p=e.input.charCodeAt(e.position)))o=93,u=!1,s=[];else{if(123!==p)return!1;o=125,u=!0,s={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),p=e.input.charCodeAt(++e.position);0!==p;){if(Me(e,!0,t),(p=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=m,e.anchor=v,e.kind=u?"mapping":"sequence",e.result=s,!0;d?44===p&&ke(e,"expected the node content, but found ','"):ke(e,"missed comma between flow collection entries"),f=null,c=a=!1,63===p&&we(e.input.charCodeAt(e.position+1))&&(c=a=!0,e.position++,Me(e,!0,t)),r=e.line,n=e.lineStart,i=e.position,Je(e,t,1,!1,!0),h=e.tag,l=e.result,Me(e,!0,t),p=e.input.charCodeAt(e.position),!a&&e.line!==r||58!==p||(c=!0,p=e.input.charCodeAt(++e.position),Me(e,!0,t),Je(e,t,1,!1,!0),f=e.result),u?De(e,s,y,h,l,f,r,n,i):c?s.push(De(e,null,y,h,l,f,r,n,i)):s.push(l),Me(e,!0,t),44===(p=e.input.charCodeAt(e.position))?(d=!0,p=e.input.charCodeAt(++e.position)):d=!1}ke(e,"unexpected end of the stream within a flow collection")}(e,f)?v=!0:(o&&function(e,t){var r,n,i,s,o,c=1,a=!1,u=!1,l=t,h=0,f=!1;if(124===(s=e.input.charCodeAt(e.position)))n=!1;else{if(62!==s)return!1;n=!0}for(e.kind="scalar",e.result="";0!==s;)if(43===(s=e.input.charCodeAt(++e.position))||45===s)1===c?c=43===s?3:2:ke(e,"repeat of a chomping mode identifier");else{if(!((i=48<=(o=s)&&o<=57?o-48:-1)>=0))break;0===i?ke(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?ke(e,"repeat of an indentation width identifier"):(l=t+i-1,u=!0)}if(ge(s)){do{s=e.input.charCodeAt(++e.position)}while(ge(s));if(35===s)do{s=e.input.charCodeAt(++e.position)}while(!be(s)&&0!==s)}for(;0!==s;){for(_e(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!u||e.lineIndent<l)&&32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position);if(!u&&e.lineIndent>l&&(l=e.lineIndent),be(s))h++;else{if(e.lineIndent<l){3===c?e.result+=O.repeat("\n",a?1+h:h):1===c&&a&&(e.result+="\n");break}for(n?ge(s)?(f=!0,e.result+=O.repeat("\n",a?1+h:h)):f?(f=!1,e.result+=O.repeat("\n",h+1)):0===h?a&&(e.result+=" "):e.result+=O.repeat("\n",h):e.result+=O.repeat("\n",a?1+h:h),a=!0,u=!0,h=0,r=e.position;!be(s)&&0!==s;)s=e.input.charCodeAt(++e.position);Re(e,r,e.position,!1)}}return!0}(e,f)||function(e,t){var r,n,i;if(39!==(r=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(r=e.input.charCodeAt(e.position));)if(39===r){if(Re(e,n,e.position,!0),39!==(r=e.input.charCodeAt(++e.position)))return!0;n=e.position,e.position++,i=e.position}else be(r)?(Re(e,n,i,!0),qe(e,Me(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Ne(e)?ke(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);ke(e,"unexpected end of the stream within a single quoted scalar")}(e,f)||function(e,t){var r,n,i,s,o,c,a;if(34!==(c=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;0!==(c=e.input.charCodeAt(e.position));){if(34===c)return Re(e,r,e.position,!0),e.position++,!0;if(92===c){if(Re(e,r,e.position,!0),be(c=e.input.charCodeAt(++e.position)))Me(e,!1,t);else if(c<256&&$e[c])e.result+=Se[c],e.position++;else if((o=120===(a=c)?2:117===a?4:85===a?8:0)>0){for(i=o,s=0;i>0;i--)(o=Ee(c=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+o:ke(e,"expected hexadecimal character");e.result+=Oe(s),e.position++}else ke(e,"unknown escape sequence");r=n=e.position}else be(c)?(Re(e,r,n,!0),qe(e,Me(e,!1,t)),r=n=e.position):e.position===e.lineStart&&Ne(e)?ke(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}ke(e,"unexpected end of the stream within a double quoted scalar")}(e,f)?v=!0:!function(e){var t,r,n;if(42!==(n=e.input.charCodeAt(e.position)))return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!we(n)&&!xe(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&ke(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),he.call(e.anchorMap,r)||ke(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Me(e,!0,-1),!0}(e)?function(e,t,r){var n,i,s,o,c,a,u,l,h=e.kind,f=e.result;if(we(l=e.input.charCodeAt(e.position))||xe(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(we(n=e.input.charCodeAt(e.position+1))||r&&xe(n)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,o=!1;0!==l;){if(58===l){if(we(n=e.input.charCodeAt(e.position+1))||r&&xe(n))break}else if(35===l){if(we(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Ne(e)||r&&xe(l))break;if(be(l)){if(c=e.line,a=e.lineStart,u=e.lineIndent,Me(e,!1,-1),e.lineIndent>=t){o=!0,l=e.input.charCodeAt(e.position);continue}e.position=s,e.line=c,e.lineStart=a,e.lineIndent=u;break}}o&&(Re(e,i,s,!1),qe(e,e.line-c),i=s=e.position,o=!1),ge(l)||(s=e.position+1),l=e.input.charCodeAt(++e.position)}return Re(e,i,s,!1),!!e.result||(e.kind=h,e.result=f,!1)}(e,f,1===r)&&(v=!0,null===e.tag&&(e.tag="?")):(v=!0,null===e.tag&&null===e.anchor||ke(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(v=c&&Be(e,p))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ke(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),a=0,u=e.implicitTypes.length;a<u;a+=1)if((h=e.implicitTypes[a]).resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(he.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,a=0,u=(l=e.typeMap.multi[e.kind||"fallback"]).length;a<u;a+=1)if(e.tag.slice(0,l[a].tag.length)===l[a].tag){h=l[a];break}h||ke(e,"unknown tag !<"+e.tag+">"),null!==e.result&&h.kind!==e.kind&&ke(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ke(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||v}function Ge(e){var t,r,n,i,s=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(Me(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(o=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!we(i);)i=e.input.charCodeAt(++e.position);for(n=[],(r=e.input.slice(t,e.position)).length<1&&ke(e,"directive name must not be less than one character in length");0!==i;){for(;ge(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!be(i));break}if(be(i))break;for(t=e.position;0!==i&&!we(i);)i=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==i&&_e(e),he.call(Ie,r)?Ie[r](e,r,n):Fe(e,'unknown document directive "'+r+'"')}Me(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,Me(e,!0,-1)):o&&ke(e,"directives end mark is expected"),Je(e,e.lineIndent-1,4,!1,!0),Me(e,!0,-1),e.checkLineBreaks&&pe.test(e.input.slice(s,e.position))&&Fe(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ne(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Me(e,!0,-1)):e.position<e.length-1&&ke(e,"end of the stream or a document separator is expected")}function Ve(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var r=new Pe(e,t),n=e.indexOf("\0");for(-1!==n&&(r.position=n,ke(r,"null byte is not allowed in input")),r.input+="\0";32===r.input.charCodeAt(r.position);)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Ge(r);return r.documents}var He=function(e,t,r){null!==t&&"object"==typeof t&&void 0===r&&(r=t,t=null);var n=Ve(e,r);if("function"!=typeof t)return n;for(var i=0,s=n.length;i<s;i+=1)t(n[i])},ze={loadAll:He,load:function(e,t){var r=Ve(e,t);if(0!==r.length){if(1===r.length)return r[0];throw new A("expected a single document in the stream, but found more")}}},Xe=Object.prototype.toString,We=Object.prototype.hasOwnProperty,Ye=65279,Ze={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},Ke=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Qe=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function et(e){var t,r,n;if(t=e.toString(16).toUpperCase(),e<=255)r="x",n=2;else if(e<=65535)r="u",n=4;else{if(!(e<=4294967295))throw new A("code point within a string may not be greater than 0xFFFFFFFF");r="U",n=8}return"\\"+r+O.repeat("0",n-t.length)+t}function tt(e){this.schema=e.schema||le,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=O.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var r,n,i,s,o,c,a;if(null===t)return{};for(r={},i=0,s=(n=Object.keys(t)).length;i<s;i+=1)o=n[i],c=String(t[o]),"!!"===o.slice(0,2)&&(o="tag:yaml.org,2002:"+o.slice(2)),(a=e.compiledTypeMap.fallback[o])&&We.call(a.styleAliases,c)&&(c=a.styleAliases[c]),r[o]=c;return r}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?2:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function rt(e,t){for(var r,n=O.repeat(" ",t),i=0,s=-1,o="",c=e.length;i<c;)-1===(s=e.indexOf("\n",i))?(r=e.slice(i),i=c):(r=e.slice(i,s+1),i=s+1),r.length&&"\n"!==r&&(o+=n),o+=r;return o}function nt(e,t){return"\n"+O.repeat(" ",e.indent*t)}function it(e){return 32===e||9===e}function st(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==Ye||65536<=e&&e<=1114111}function ot(e){return st(e)&&e!==Ye&&13!==e&&10!==e}function ct(e,t,r){var n=ot(e),i=n&&!it(e);return(r?n:n&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e)&&35!==e&&!(58===t&&!i)||ot(t)&&!it(t)&&35===e||58===t&&i}function at(e,t){var r,n=e.charCodeAt(t);return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1))>=56320&&r<=57343?1024*(n-55296)+r-56320+65536:n}function ut(e){return/^\n* /.test(e)}function lt(e,t,r,n,i,s,o,c){var a,u,l=0,h=null,f=!1,p=!1,d=-1!==n,m=-1,v=st(u=at(e,0))&&u!==Ye&&!it(u)&&45!==u&&63!==u&&58!==u&&44!==u&&91!==u&&93!==u&&123!==u&&125!==u&&35!==u&&38!==u&&42!==u&&33!==u&&124!==u&&61!==u&&62!==u&&39!==u&&34!==u&&37!==u&&64!==u&&96!==u&&function(e){return!it(e)&&58!==e}(at(e,e.length-1));if(t||o)for(a=0;a<e.length;l>=65536?a+=2:a++){if(!st(l=at(e,a)))return 5;v=v&&ct(l,h,c),h=l}else{for(a=0;a<e.length;l>=65536?a+=2:a++){if(10===(l=at(e,a)))f=!0,d&&(p=p||a-m-1>n&&" "!==e[m+1],m=a);else if(!st(l))return 5;v=v&&ct(l,h,c),h=l}p=p||d&&a-m-1>n&&" "!==e[m+1]}return f||p?r>9&&ut(e)?5:o?2===s?5:2:p?4:3:!v||o||i(e)?2===s?5:2:1}function ht(e,t,r,n,i){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Ke.indexOf(t)||Qe.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),c=n||e.flowLevel>-1&&r>=e.flowLevel;switch(lt(t,c,e.indent,o,(function(t){return function(e,t){var r,n;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(e.implicitTypes[r].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!n,i)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+ft(t,e.indent)+pt(rt(t,s));case 4:return">"+ft(t,e.indent)+pt(rt(function(e,t){var r,n,i=/(\n+)([^\n]*)/g,s=(c=e.indexOf("\n"),c=-1!==c?c:e.length,i.lastIndex=c,dt(e.slice(0,c),t)),o="\n"===e[0]||" "===e[0];var c;for(;n=i.exec(e);){var a=n[1],u=n[2];r=" "===u[0],s+=a+(o||r||""===u?"":"\n")+dt(u,t),o=r}return s}(t,o),s));case 5:return'"'+function(e){for(var t,r="",n=0,i=0;i<e.length;n>=65536?i+=2:i++)n=at(e,i),!(t=Ze[n])&&st(n)?(r+=e[i],n>=65536&&(r+=e[i+1])):r+=t||et(n);return r}(t)+'"';default:throw new A("impossible error: invalid scalar style")}}()}function ft(e,t){var r=ut(e)?String(t):"",n="\n"===e[e.length-1];return r+(n&&("\n"===e[e.length-2]||"\n"===e)?"+":n?"":"-")+"\n"}function pt(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function dt(e,t){if(""===e||" "===e[0])return e;for(var r,n,i=/ [^ ]/g,s=0,o=0,c=0,a="";r=i.exec(e);)(c=r.index)-s>t&&(n=o>s?o:c,a+="\n"+e.slice(s,n),s=n+1),o=c;return a+="\n",e.length-s>t&&o>s?a+=e.slice(s,o)+"\n"+e.slice(o+1):a+=e.slice(s),a.slice(1)}function mt(e,t,r,n){var i,s,o,c="",a=e.tag;for(i=0,s=r.length;i<s;i+=1)o=r[i],e.replacer&&(o=e.replacer.call(r,String(i),o)),(yt(e,t+1,o,!0,!0,!1,!0)||void 0===o&&yt(e,t+1,null,!0,!0,!1,!0))&&(n&&""===c||(c+=nt(e,t)),e.dump&&10===e.dump.charCodeAt(0)?c+="-":c+="- ",c+=e.dump);e.tag=a,e.dump=c||"[]"}function vt(e,t,r){var n,i,s,o,c,a;for(s=0,o=(i=r?e.explicitTypes:e.implicitTypes).length;s<o;s+=1)if(((c=i[s]).instanceOf||c.predicate)&&(!c.instanceOf||"object"==typeof t&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(r?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(a=e.styleMap[c.tag]||c.defaultStyle,"[object Function]"===Xe.call(c.represent))n=c.represent(t,a);else{if(!We.call(c.represent,a))throw new A("!<"+c.tag+'> tag resolver accepts not "'+a+'" style');n=c.represent[a](t,a)}e.dump=n}return!0}return!1}function yt(e,t,r,n,i,s,o){e.tag=null,e.dump=r,vt(e,r,!1)||vt(e,r,!0);var c,a=Xe.call(e.dump),u=n;n&&(n=e.flowLevel<0||e.flowLevel>t);var l,h,f="[object Object]"===a||"[object Array]"===a;if(f&&(h=-1!==(l=e.duplicates.indexOf(r))),(null!==e.tag&&"?"!==e.tag||h||2!==e.indent&&t>0)&&(i=!1),h&&e.usedDuplicates[l])e.dump="*ref_"+l;else{if(f&&h&&!e.usedDuplicates[l]&&(e.usedDuplicates[l]=!0),"[object Object]"===a)n&&0!==Object.keys(e.dump).length?(!function(e,t,r,n){var i,s,o,c,a,u,l="",h=e.tag,f=Object.keys(r);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new A("sortKeys must be a boolean or a function");for(i=0,s=f.length;i<s;i+=1)u="",n&&""===l||(u+=nt(e,t)),c=r[o=f[i]],e.replacer&&(c=e.replacer.call(r,o,c)),yt(e,t+1,o,!0,!0,!0)&&((a=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,a&&(u+=nt(e,t)),yt(e,t+1,c,!0,a)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",l+=u+=e.dump));e.tag=h,e.dump=l||"{}"}(e,t,e.dump,i),h&&(e.dump="&ref_"+l+e.dump)):(!function(e,t,r){var n,i,s,o,c,a="",u=e.tag,l=Object.keys(r);for(n=0,i=l.length;n<i;n+=1)c="",""!==a&&(c+=", "),e.condenseFlow&&(c+='"'),o=r[s=l[n]],e.replacer&&(o=e.replacer.call(r,s,o)),yt(e,t,s,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),yt(e,t,o,!1,!1)&&(a+=c+=e.dump));e.tag=u,e.dump="{"+a+"}"}(e,t,e.dump),h&&(e.dump="&ref_"+l+" "+e.dump));else if("[object Array]"===a)n&&0!==e.dump.length?(e.noArrayIndent&&!o&&t>0?mt(e,t-1,e.dump,i):mt(e,t,e.dump,i),h&&(e.dump="&ref_"+l+e.dump)):(!function(e,t,r){var n,i,s,o="",c=e.tag;for(n=0,i=r.length;n<i;n+=1)s=r[n],e.replacer&&(s=e.replacer.call(r,String(n),s)),(yt(e,t,s,!1,!1)||void 0===s&&yt(e,t,null,!1,!1))&&(""!==o&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=c,e.dump="["+o+"]"}(e,t,e.dump),h&&(e.dump="&ref_"+l+" "+e.dump));else{if("[object String]"!==a){if("[object Undefined]"===a)return!1;if(e.skipInvalid)return!1;throw new A("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&ht(e,e.dump,t,s,u)}null!==e.tag&&"?"!==e.tag&&(c=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),c="!"===e.tag[0]?"!"+c:"tag:yaml.org,2002:"===c.slice(0,18)?"!!"+c.slice(18):"!<"+c+">",e.dump=c+" "+e.dump)}return!0}function bt(e,t){var r,n,i=[],s=[];for(gt(e,i,s),r=0,n=s.length;r<n;r+=1)t.duplicates.push(i[s[r]]);t.usedDuplicates=new Array(n)}function gt(e,t,r){var n,i,s;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===r.indexOf(i)&&r.push(i);else if(t.push(e),Array.isArray(e))for(i=0,s=e.length;i<s;i+=1)gt(e[i],t,r);else for(i=0,s=(n=Object.keys(e)).length;i<s;i+=1)gt(e[n[i]],t,r)}function wt(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var xt=R,Et=_,jt=B,Ot=W,$t=Y,St=le,At=ze.load,Pt=ze.loadAll,Tt={dump:function(e,t){var r=new tt(t=t||{});r.noRefs||bt(e,r);var n=e;return r.replacer&&(n=r.replacer.call({"":n},"",n)),yt(r,0,n,!0,!0)?r.dump+"\n":""}}.dump,kt=A,Ft={binary:re,float:X,map:q,null:L,pairs:ce,set:ue,timestamp:Q,bool:U,int:V,merge:ee,omap:se,seq:N,str:M},It=wt("safeLoad","load"),Rt=wt("safeLoadAll","loadAll"),Ct=wt("safeDump","dump"),Dt={Type:xt,Schema:Et,FAILSAFE_SCHEMA:jt,JSON_SCHEMA:Ot,CORE_SCHEMA:$t,DEFAULT_SCHEMA:St,load:At,loadAll:Pt,dump:Tt,YAMLException:kt,types:Ft,safeLoad:It,safeLoadAll:Rt,safeDump:Ct};function _t(e={}){return"function"!=typeof e.entries?{}:Array.from(e.entries()).reduce(((e,[t,r])=>(e[t]=function(e){return e.includes(", ")?e.split(", "):e}(r),e)),{})}function Mt(e,t,{loadSpec:r=!1}={}){const n={ok:e.ok,url:e.url||t,status:e.status,statusText:e.statusText,headers:_t(e.headers)},i=n.headers["content-type"],s=r||((e="")=>/(json|xml|yaml|text)\b/.test(e))(i);return(s?e.text:e.blob||e.buffer).call(e).then((e=>{if(n.text=e,n.data=e,s)try{const t=function(e,t){return t&&(0===t.indexOf("application/json")||t.indexOf("+json")>0)?JSON.parse(e):Dt.load(e)}(e,i);n.body=t,n.obj=t}catch(e){n.parseError=e}return n}))}async function Nt(e,t={}){"object"==typeof e&&(e=(t=e).url),t.headers=t.headers||{},(t=x(t)).headers&&Object.keys(t.headers).forEach((e=>{const r=t.headers[e];"string"==typeof r&&(t.headers[e]=r.replace(/\n+/g," "))})),t.requestInterceptor&&(t=await t.requestInterceptor(t)||t);const r=t.headers["content-type"]||t.headers["Content-Type"];let n;/multipart\/form-data/i.test(r)&&(delete t.headers["content-type"],delete t.headers["Content-Type"]);try{n=await(t.userFetch||fetch)(t.url,t),n=await Mt(n,e,t),t.responseInterceptor&&(n=await t.responseInterceptor(n)||n)}catch(e){if(!n)throw e;const t=new Error(n.statusText||`response status is ${n.status}`);throw t.status=n.status,t.statusCode=n.status,t.responseError=e,t}if(!n.ok){const e=new Error(n.statusText||`response status is ${n.status}`);throw e.status=n.status,e.statusCode=n.status,e.response=n,e}return n}function qt(t,r={}){const{requestInterceptor:n,responseInterceptor:i}=r,s=t.withCredentials?"include":"same-origin";return r=>t({url:r,loadSpec:!0,requestInterceptor:n,responseInterceptor:i,headers:{Accept:e},credentials:s}).then((e=>e.body))}const Bt=e=>{var t,r;const{baseDoc:n,url:i}=e,s=null!==(t=null!=n?n:i)&&void 0!==t?t:"";return"string"==typeof(null===(r=globalThis.document)||void 0===r?void 0:r.baseURI)?String(new URL(s,globalThis.document.baseURI)):s},Lt=e=>{const{fetch:t,http:r}=e;return t||r||Nt}; /*! * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2022 Joachim Wester * MIT licensed */ var Ut,Jt=(Ut=function(e,t){return Ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},Ut(e,t)},function(e,t){function r(){this.constructor=e}Ut(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Gt=Object.prototype.hasOwnProperty;function Vt(e,t){return Gt.call(e,t)}function Ht(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var i in e)Vt(e,i)&&n.push(i);return n}function zt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function Xt(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function Wt(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Yt(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Zt(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Zt(e[t]))return!0}else if("object"==typeof e)for(var n=Ht(e),i=n.length,s=0;s<i;s++)if(Zt(e[n[s]]))return!0;return!1}function Kt(e,t){var r=[e];for(var n in t){var i="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==i&&r.push(n+": "+i)}return r.join("\n")}var Qt=function(e){function t(t,r,n,i,s){var o=this.constructor,c=e.call(this,Kt(t,{name:r,index:n,operation:i,tree:s}))||this;return c.name=r,c.index=n,c.operation=i,c.tree=s,Object.setPrototypeOf(c,o.prototype),c.message=Kt(t,{name:r,index:n,operation:i,tree:s}),c}return Jt(t,e),t}(Error),er=Qt,tr=zt,rr={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=ir(r,this.path);n&&(n=zt(n));var i=sr(r,{op:"remove",path:this.from}).removed;return sr(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=ir(r,this.from);return sr(r,{op:"add",path:this.path,value:zt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:ur(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},nr={add:function(e,t,r){return Xt(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:rr.move,copy:rr.copy,test:rr.test,_get:rr._get};function ir(e,t){if(""==t)return e;var r={op:"_get",path:t};return sr(e,r),r.value}function sr(e,t,r,n,i,s){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===s&&(s=0),r&&("function"==typeof r?r(t,0,e,t.path):cr(t,0)),""===t.path){var o={newDocument:e};if("add"===t.op)return o.newDocument=t.value,o;if("replace"===t.op)return o.newDocument=t.value,o.remo