UNPKG

@favware/yamlreader

Version:

Minimal wrapper around js-yaml for directly reading in YAML files

3 lines (2 loc) 39.3 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={};function t(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var n={},i={},r={};function o(e){return null==e}function a(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.isNothing=o,r.isObject=function(e){return"object"==typeof e&&null!==e},r.toArray=function(e){return Array.isArray(e)?e:o(e)?[]:[e]},r.repeat=function(e,t){var n,i="";for(n=0;n<t;n+=1)i+=e;return i},r.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},r.extend=function(e,t){var n,i,r,o;if(t)for(n=0,i=(o=Object.keys(t)).length;n<i;n+=1)e[r=o[n]]=t[r];return e},a.prototype=Object.create(Error.prototype),a.prototype.constructor=a,a.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t};var l=a,s=r;function c(e,t,n,i,r){this.name=e,this.buffer=t,this.position=n,this.line=i,this.column=r}c.prototype.getSnippet=function(e,t){var n,i,r,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",i=this.position;i>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(i-=1,this.position-i>t/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;o<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(o));)if((o+=1)-this.position>t/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},c.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n};var u=c,p=l,f=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],d=["scalar","sequence","mapping"];var h=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===f.indexOf(t))throw new p('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),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.defaultStyle=t.defaultStyle||null,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===d.indexOf(this.kind))throw new p('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')},g=r,m=l,y=h;function A(e,t,n){var i=[];return e.include.forEach((function(e){n=A(e,t,n)})),e[t].forEach((function(e){n.forEach((function(t,n){t.tag===e.tag&&t.kind===e.kind&&i.push(n)})),n.push(e)})),n.filter((function(e,t){return-1===i.indexOf(t)}))}function v(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach((function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new m("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=A(this,"implicit",[]),this.compiledExplicit=A(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(i);return n}(this.compiledImplicit,this.compiledExplicit)}v.DEFAULT=null,v.create=function(){var e,t;switch(arguments.length){case 1:e=v.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new m("Wrong number of arguments for Schema.create function")}if(e=g.toArray(e),t=g.toArray(t),!e.every((function(e){return e instanceof v})))throw new m("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every((function(e){return e instanceof y})))throw new m("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new v({include:e,explicit:t})};var b=v,w=new b({explicit:[new h("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),new h("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),new h("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})]});var k=new h("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"}},defaultStyle:"lowercase"});var C=new h("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"}),x=r;function S(e){return 48<=e&&e<=55}function I(e){return 48<=e&&e<=57}var O=new h("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=e.length,r=0,o=!1;if(!i)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===i)return!0;if("b"===(t=e[++r])){for(r++;r<i;r++)if("_"!==(t=e[r])){if("0"!==t&&"1"!==t)return!1;o=!0}return o&&"_"!==t}if("x"===t){for(r++;r<i;r++)if("_"!==(t=e[r])){if(!(48<=(n=e.charCodeAt(r))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;o=!0}return o&&"_"!==t}for(;r<i;r++)if("_"!==(t=e[r])){if(!S(e.charCodeAt(r)))return!1;o=!0}return o&&"_"!==t}if("_"===t)return!1;for(;r<i;r++)if("_"!==(t=e[r])){if(":"===t)break;if(!I(e.charCodeAt(r)))return!1;o=!0}return!(!o||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(r)))},construct:function(e){var t,n,i=e,r=1,o=[];return-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),"-"!==(t=i[0])&&"+"!==t||("-"===t&&(r=-1),t=(i=i.slice(1))[0]),"0"===i?0:"0"===t?"b"===i[1]?r*parseInt(i.slice(2),2):"x"===i[1]?r*parseInt(i,16):r*parseInt(i,8):-1!==i.indexOf(":")?(i.split(":").forEach((function(e){o.unshift(parseInt(e,10))})),i=0,n=1,o.forEach((function(e){i+=e*n,n*=60})),r*i):r*parseInt(i,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!x.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?"0"+e.toString(8):"-0"+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"]}}),E=r,j=h,F=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var M=/^[-+]?[0-9]+e/;var N=new b({include:[w],implicit:[k,C,O,new j("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!F.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,i,r;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach((function(e){r.unshift(parseFloat(e,10))})),t=0,i=1,r.forEach((function(e){t+=e*i,i*=60})),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||E.isNegativeZero(e))},represent:function(e,t){var n;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(E.isNegativeZero(e))return"-0.0";return n=e.toString(10),M.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})]}),T=new b({include:[N]}),L=h,_=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),D=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 Y=new L("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==_.exec(e)||null!==D.exec(e))},construct:function(e){var t,n,i,r,o,a,l,s,c=0,u=null;if(null===(t=_.exec(e))&&(t=D.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],a=+t[5],l=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),s=new Date(Date.UTC(n,i,r,o,a,l,c)),u&&s.setTime(s.getTime()-u),s},instanceOf:Date,represent:function(e){return e.toISOString()}});var U,q=new h("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}});try{U=t("buffer").Buffer}catch(e){}var R="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var P=new h("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=0,r=e.length,o=R;for(n=0;n<r;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;i+=6}return i%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=R,a=0,l=[];for(t=0;t<r;t++)t%4==0&&t&&(l.push(a>>16&255),l.push(a>>8&255),l.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return 0===(n=r%4*6)?(l.push(a>>16&255),l.push(a>>8&255),l.push(255&a)):18===n?(l.push(a>>10&255),l.push(a>>2&255)):12===n&&l.push(a>>4&255),U?U.from?U.from(l):new U(l):l},predicate:function(e){return U&&U.isBuffer(e)},represent:function(e){var t,n,i="",r=0,o=e.length,a=R;for(t=0;t<o;t++)t%3==0&&t&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0===(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}}),B=h,W=Object.prototype.hasOwnProperty,K=Object.prototype.toString;var $=new B("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,o,a=[],l=e;for(t=0,n=l.length;t<n;t+=1){if(i=l[t],o=!1,"[object Object]"!==K.call(i))return!1;for(r in i)if(W.call(i,r)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==a.indexOf(r))return!1;a.push(r)}return!0},construct:function(e){return null!==e?e:[]}}),H=h,G=Object.prototype.toString;var V=new H("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(i=a[t],"[object Object]"!==G.call(i))return!1;if(1!==(r=Object.keys(i)).length)return!1;o[t]=[r[0],i[r[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)i=a[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}}),Z=h,z=Object.prototype.hasOwnProperty;var J=new b({include:[T],implicit:[Y,q],explicit:[P,$,V,new Z("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(z.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})]});var Q=new h("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}});var X,ee=new h("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),i="";if("/"===t[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==t[t.length-i.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),i="";return"/"===t[0]&&(n&&(i=n[1]),t=t.slice(1,t.length-i.length-1)),new RegExp(t,i)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}});try{X=t("esprima")}catch(e){"undefined"!=typeof window&&(X=window.esprima)}var te=new h("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=X.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",i=X.parse(n,{range:!0}),r=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"ArrowFunctionExpression"!==i.body[0].expression.type&&"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach((function(e){r.push(e.name)})),t=i.body[0].expression.body.range,"BlockStatement"===i.body[0].expression.body.type?new Function(r,n.slice(t[0]+1,t[1]-1)):new Function(r,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}}),ne=b,ie=ne.DEFAULT=new ne({include:[J],explicit:[Q,ee,te]}),re=r,oe=l,ae=u,le=J,se=ie,ce=Object.prototype.hasOwnProperty,ue=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,pe=/[\x85\u2028\u2029]/,fe=/[,\[\]\{\}]/,de=/^(?:!|!!|![a-z\-]+!)$/i,he=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ge(e){return Object.prototype.toString.call(e)}function me(e){return 10===e||13===e}function ye(e){return 9===e||32===e}function Ae(e){return 9===e||32===e||10===e||13===e}function ve(e){return 44===e||91===e||93===e||123===e||125===e}function be(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function we(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 ke(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var Ce=new Array(256),xe=new Array(256),Se=0;Se<256;Se++)Ce[Se]=we(Se)?1:0,xe[Se]=we(Se);function Ie(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||se,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.documents=[]}function Oe(e,t){return new oe(t,new ae(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function Ee(e,t){throw Oe(e,t)}function je(e,t){e.onWarning&&e.onWarning.call(null,Oe(e,t))}var Fe={YAML:function(e,t,n){var i,r,o;null!==e.version&&Ee(e,"duplication of %YAML directive"),1!==n.length&&Ee(e,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&Ee(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&Ee(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&je(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&Ee(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],de.test(i)||Ee(e,"ill-formed tag handle (first argument) of the TAG directive"),ce.call(e.tagMap,i)&&Ee(e,'there is a previously declared suffix for "'+i+'" tag handle'),he.test(r)||Ee(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[i]=r}};function Me(e,t,n,i){var r,o,a,l;if(t<n){if(l=e.input.slice(t,n),i)for(r=0,o=l.length;r<o;r+=1)9===(a=l.charCodeAt(r))||32<=a&&a<=1114111||Ee(e,"expected valid JSON character");else ue.test(l)&&Ee(e,"the stream contains non-printable characters");e.result+=l}}function Ne(e,t,n,i){var r,o,a,l;for(re.isObject(n)||Ee(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,l=(r=Object.keys(n)).length;a<l;a+=1)o=r[a],ce.call(t,o)||(t[o]=n[o],i[o]=!0)}function Te(e,t,n,i,r,o,a,l){var s,c;if(Array.isArray(r))for(s=0,c=(r=Array.prototype.slice.call(r)).length;s<c;s+=1)Array.isArray(r[s])&&Ee(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===ge(r[s])&&(r[s]="[object Object]");if("object"==typeof r&&"[object Object]"===ge(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(o))for(s=0,c=o.length;s<c;s+=1)Ne(e,t,o[s],n);else Ne(e,t,o,n);else e.json||ce.call(n,r)||!ce.call(t,r)||(e.line=a||e.line,e.position=l||e.position,Ee(e,"duplicated mapping key")),t[r]=o,delete n[r];return t}function Le(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):Ee(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function _e(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);0!==r;){for(;ye(r);)r=e.input.charCodeAt(++e.position);if(t&&35===r)do{r=e.input.charCodeAt(++e.position)}while(10!==r&&13!==r&&0!==r);if(!me(r))break;for(Le(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==n&&0!==i&&e.lineIndent<n&&je(e,"deficient indentation"),i}function De(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!Ae(t)))}function Ye(e,t){1===t?e.result+=" ":t>1&&(e.result+=re.repeat("\n",t-1))}function Ue(e,t){var n,i,r=e.tag,o=e.anchor,a=[],l=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&45===i&&Ae(e.input.charCodeAt(e.position+1));)if(l=!0,e.position++,_e(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,Pe(e,t,3,!1,!0),a.push(e.result),_e(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)Ee(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!l&&(e.tag=r,e.anchor=o,e.kind="sequence",e.result=a,!0)}function qe(e){var t,n,i,r,o=!1,a=!1;if(33!==(r=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&Ee(e,"duplication of a tag property"),60===(r=e.input.charCodeAt(++e.position))?(o=!0,r=e.input.charCodeAt(++e.position)):33===r?(a=!0,n="!!",r=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&62!==r);e.position<e.length?(i=e.input.slice(t,e.position),r=e.input.charCodeAt(++e.position)):Ee(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!Ae(r);)33===r&&(a?Ee(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),de.test(n)||Ee(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),r=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),fe.test(i)&&Ee(e,"tag suffix cannot contain flow indicator characters")}return i&&!he.test(i)&&Ee(e,"tag name cannot contain such characters: "+i),o?e.tag=i:ce.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:"!"===n?e.tag="!"+i:"!!"===n?e.tag="tag:yaml.org,2002:"+i:Ee(e,'undeclared tag handle "'+n+'"'),!0}function Re(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&Ee(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!Ae(n)&&!ve(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Ee(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Pe(e,t,n,i,r){var o,a,l,s,c,u,p,f,d=1,h=!1,g=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=l=4===n||3===n,i&&_e(e,!0,-1)&&(h=!0,e.lineIndent>t?d=1:e.lineIndent===t?d=0:e.lineIndent<t&&(d=-1)),1===d)for(;qe(e)||Re(e);)_e(e,!0,-1)?(h=!0,l=o,e.lineIndent>t?d=1:e.lineIndent===t?d=0:e.lineIndent<t&&(d=-1)):l=!1;if(l&&(l=h||r),1!==d&&4!==n||(p=1===n||2===n?t:t+1,f=e.position-e.lineStart,1===d?l&&(Ue(e,f)||function(e,t,n){var i,r,o,a,l,s=e.tag,c=e.anchor,u={},p={},f=null,d=null,h=null,g=!1,m=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=u),l=e.input.charCodeAt(e.position);0!==l;){if(i=e.input.charCodeAt(e.position+1),o=e.line,a=e.position,63!==l&&58!==l||!Ae(i)){if(!Pe(e,n,2,!1,!0))break;if(e.line===o){for(l=e.input.charCodeAt(e.position);ye(l);)l=e.input.charCodeAt(++e.position);if(58===l)Ae(l=e.input.charCodeAt(++e.position))||Ee(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(Te(e,u,p,f,d,null),f=d=h=null),m=!0,g=!1,r=!1,f=e.tag,d=e.result;else{if(!m)return e.tag=s,e.anchor=c,!0;Ee(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!m)return e.tag=s,e.anchor=c,!0;Ee(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(g&&(Te(e,u,p,f,d,null),f=d=h=null),m=!0,g=!0,r=!0):g?(g=!1,r=!0):Ee(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=i;if((e.line===o||e.lineIndent>t)&&(Pe(e,t,4,!0,r)&&(g?d=e.result:h=e.result),g||(Te(e,u,p,f,d,h,o,a),f=d=h=null),_e(e,!0,-1),l=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==l)Ee(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return g&&Te(e,u,p,f,d,null),m&&(e.tag=s,e.anchor=c,e.kind="mapping",e.result=u),m}(e,f,p))||function(e,t){var n,i,r,o,a,l,s,c,u,p,f=!0,d=e.tag,h=e.anchor,g={};if(91===(p=e.input.charCodeAt(e.position)))r=93,l=!1,i=[];else{if(123!==p)return!1;r=125,l=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),p=e.input.charCodeAt(++e.position);0!==p;){if(_e(e,!0,t),(p=e.input.charCodeAt(e.position))===r)return e.position++,e.tag=d,e.anchor=h,e.kind=l?"mapping":"sequence",e.result=i,!0;f||Ee(e,"missed comma between flow collection entries"),u=null,o=a=!1,63===p&&Ae(e.input.charCodeAt(e.position+1))&&(o=a=!0,e.position++,_e(e,!0,t)),n=e.line,Pe(e,t,1,!1,!0),c=e.tag,s=e.result,_e(e,!0,t),p=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==p||(o=!0,p=e.input.charCodeAt(++e.position),_e(e,!0,t),Pe(e,t,1,!1,!0),u=e.result),l?Te(e,i,g,c,s,u):o?i.push(Te(e,null,g,c,s,u)):i.push(s),_e(e,!0,t),44===(p=e.input.charCodeAt(e.position))?(f=!0,p=e.input.charCodeAt(++e.position)):f=!1}Ee(e,"unexpected end of the stream within a flow collection")}(e,p)?g=!0:(a&&function(e,t){var n,i,r,o,a,l=1,s=!1,c=!1,u=t,p=0,f=!1;if(124===(o=e.input.charCodeAt(e.position)))i=!1;else{if(62!==o)return!1;i=!0}for(e.kind="scalar",e.result="";0!==o;)if(43===(o=e.input.charCodeAt(++e.position))||45===o)1===l?l=43===o?3:2:Ee(e,"repeat of a chomping mode identifier");else{if(!((r=48<=(a=o)&&a<=57?a-48:-1)>=0))break;0===r?Ee(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Ee(e,"repeat of an indentation width identifier"):(u=t+r-1,c=!0)}if(ye(o)){do{o=e.input.charCodeAt(++e.position)}while(ye(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!me(o)&&0!==o)}for(;0!==o;){for(Le(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!c||e.lineIndent<u)&&32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>u&&(u=e.lineIndent),me(o))p++;else{if(e.lineIndent<u){3===l?e.result+=re.repeat("\n",s?1+p:p):1===l&&s&&(e.result+="\n");break}for(i?ye(o)?(f=!0,e.result+=re.repeat("\n",s?1+p:p)):f?(f=!1,e.result+=re.repeat("\n",p+1)):0===p?s&&(e.result+=" "):e.result+=re.repeat("\n",p):e.result+=re.repeat("\n",s?1+p:p),s=!0,c=!0,p=0,n=e.position;!me(o)&&0!==o;)o=e.input.charCodeAt(++e.position);Me(e,n,e.position,!1)}}return!0}(e,p)||function(e,t){var n,i,r;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(Me(e,i,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;i=e.position,e.position++,r=e.position}else me(n)?(Me(e,i,r,!0),Ye(e,_e(e,!1,t)),i=r=e.position):e.position===e.lineStart&&De(e)?Ee(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);Ee(e,"unexpected end of the stream within a single quoted scalar")}(e,p)||function(e,t){var n,i,r,o,a,l,s;if(34!==(l=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(l=e.input.charCodeAt(e.position));){if(34===l)return Me(e,n,e.position,!0),e.position++,!0;if(92===l){if(Me(e,n,e.position,!0),me(l=e.input.charCodeAt(++e.position)))_e(e,!1,t);else if(l<256&&Ce[l])e.result+=xe[l],e.position++;else if((a=120===(s=l)?2:117===s?4:85===s?8:0)>0){for(r=a,o=0;r>0;r--)(a=be(l=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:Ee(e,"expected hexadecimal character");e.result+=ke(o),e.position++}else Ee(e,"unknown escape sequence");n=i=e.position}else me(l)?(Me(e,n,i,!0),Ye(e,_e(e,!1,t)),n=i=e.position):e.position===e.lineStart&&De(e)?Ee(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Ee(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?g=!0:!function(e){var t,n,i;if(42!==(i=e.input.charCodeAt(e.position)))return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!Ae(i)&&!ve(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Ee(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),ce.call(e.anchorMap,n)||Ee(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],_e(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,l,s,c,u,p=e.kind,f=e.result;if(Ae(u=e.input.charCodeAt(e.position))||ve(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(Ae(i=e.input.charCodeAt(e.position+1))||n&&ve(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==u;){if(58===u){if(Ae(i=e.input.charCodeAt(e.position+1))||n&&ve(i))break}else if(35===u){if(Ae(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&De(e)||n&&ve(u))break;if(me(u)){if(l=e.line,s=e.lineStart,c=e.lineIndent,_e(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=l,e.lineStart=s,e.lineIndent=c;break}}a&&(Me(e,r,o,!1),Ye(e,e.line-l),r=o=e.position,a=!1),ye(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return Me(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,p,1===n)&&(g=!0,null===e.tag&&(e.tag="?")):(g=!0,null===e.tag&&null===e.anchor||Ee(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(g=l&&Ue(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&Ee(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),s=0,c=e.implicitTypes.length;s<c;s+=1)if((u=e.implicitTypes[s]).resolve(e.result)){e.result=u.construct(e.result),e.tag=u.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else ce.call(e.typeMap[e.kind||"fallback"],e.tag)?(u=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&u.kind!==e.kind&&Ee(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+u.kind+'", not "'+e.kind+'"'),u.resolve(e.result)?(e.result=u.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):Ee(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):Ee(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||g}function Be(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(r=e.input.charCodeAt(e.position))&&(_e(e,!0,-1),r=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!Ae(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&Ee(e,"directive name must not be less than one character in length");0!==r;){for(;ye(r);)r=e.input.charCodeAt(++e.position);if(35===r){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&!me(r));break}if(me(r))break;for(t=e.position;0!==r&&!Ae(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&Le(e),ce.call(Fe,n)?Fe[n](e,n,i):je(e,'unknown document directive "'+n+'"')}_e(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,_e(e,!0,-1)):a&&Ee(e,"directives end mark is expected"),Pe(e,e.lineIndent-1,4,!1,!0),_e(e,!0,-1),e.checkLineBreaks&&pe.test(e.input.slice(o,e.position))&&je(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&De(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,_e(e,!0,-1)):e.position<e.length-1&&Ee(e,"end of the stream or a document separator is expected")}function We(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 n=new Ie(e,t),i=e.indexOf("\0");for(-1!==i&&(n.position=i,Ee(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Be(n);return n.documents}function Ke(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var i=We(e,n);if("function"!=typeof t)return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function $e(e,t){var n=We(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new oe("expected a single document in the stream, but found more")}}i.loadAll=Ke,i.load=$e,i.safeLoadAll=function(e,t,n){return"object"==typeof t&&null!==t&&void 0===n&&(n=t,t=null),Ke(e,t,re.extend({schema:le},n))},i.safeLoad=function(e,t){return $e(e,re.extend({schema:le},t))};var He={},Ge=r,Ve=l,Ze=ie,ze=J,Je=Object.prototype.toString,Qe=Object.prototype.hasOwnProperty,Xe={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"},et=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function tt(e){var t,n,i;if(t=e.toString(16).toUpperCase(),e<=255)n="x",i=2;else if(e<=65535)n="u",i=4;else{if(!(e<=4294967295))throw new Ve("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+Ge.repeat("0",i-t.length)+t}function nt(e){this.schema=e.schema||Ze,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ge.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,i,r,o,a,l,s;if(null===t)return{};for(n={},r=0,o=(i=Object.keys(t)).length;r<o;r+=1)a=i[r],l=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(s=e.compiledTypeMap.fallback[a])&&Qe.call(s.styleAliases,l)&&(l=s.styleAliases[l]),n[a]=l;return n}(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.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function it(e,t){for(var n,i=Ge.repeat(" ",t),r=0,o=-1,a="",l=e.length;r<l;)-1===(o=e.indexOf("\n",r))?(n=e.slice(r),r=l):(n=e.slice(r,o+1),r=o+1),n.length&&"\n"!==n&&(a+=i),a+=n;return a}function rt(e,t){return"\n"+Ge.repeat(" ",e.indent*t)}function ot(e){return 32===e||9===e}function at(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function lt(e,t){return at(e)&&65279!==e&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e&&58!==e&&(35!==e||t&&function(e){return at(e)&&!ot(e)&&65279!==e&&13!==e&&10!==e}(t))}function st(e){return/^\n* /.test(e)}function ct(e,t,n,i,r){var o,a,l,s,c=!1,u=!1,p=-1!==i,f=-1,d=at(s=e.charCodeAt(0))&&65279!==s&&!ot(s)&&45!==s&&63!==s&&58!==s&&44!==s&&91!==s&&93!==s&&123!==s&&125!==s&&35!==s&&38!==s&&42!==s&&33!==s&&124!==s&&61!==s&&62!==s&&39!==s&&34!==s&&37!==s&&64!==s&&96!==s&&!ot(e.charCodeAt(e.length-1));if(t)for(o=0;o<e.length;o++){if(!at(a=e.charCodeAt(o)))return 5;l=o>0?e.charCodeAt(o-1):null,d=d&&lt(a,l)}else{for(o=0;o<e.length;o++){if(10===(a=e.charCodeAt(o)))c=!0,p&&(u=u||o-f-1>i&&" "!==e[f+1],f=o);else if(!at(a))return 5;l=o>0?e.charCodeAt(o-1):null,d=d&&lt(a,l)}u=u||p&&o-f-1>i&&" "!==e[f+1]}return c||u?n>9&&st(e)?5:u?4:3:d&&!r(e)?1:2}function ut(e,t,n,i){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==et.indexOf(t))return"'"+t+"'";var r=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-r),a=i||e.flowLevel>-1&&n>=e.flowLevel;switch(ct(t,a,e.indent,o,(function(t){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n<i;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}))){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+pt(t,e.indent)+ft(it(t,r));case 4:return">"+pt(t,e.indent)+ft(it(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,o=(l=e.indexOf("\n"),l=-1!==l?l:e.length,r.lastIndex=l,dt(e.slice(0,l),t)),a="\n"===e[0]||" "===e[0];var l;for(;i=r.exec(e);){var s=i[1],c=i[2];n=" "===c[0],o+=s+(a||n||""===c?"":"\n")+dt(c,t),a=n}return o}(t,o),r));case 5:return'"'+function(e){for(var t,n,i,r="",o=0;o<e.length;o++)(t=e.charCodeAt(o))>=55296&&t<=56319&&(n=e.charCodeAt(o+1))>=56320&&n<=57343?(r+=tt(1024*(t-55296)+n-56320+65536),o++):r+=!(i=Xe[t])&&at(t)?e[o]:i||tt(t);return r}(t)+'"';default:throw new Ve("impossible error: invalid scalar style")}}()}function pt(e,t){var n=st(e)?String(t):"",i="\n"===e[e.length-1];return n+(i&&("\n"===e[e.length-2]||"\n"===e)?"+":i?"":"-")+"\n"}function ft(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function dt(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,a=0,l=0,s="";n=r.exec(e);)(l=n.index)-o>t&&(i=a>o?a:l,s+="\n"+e.slice(o,i),o=i+1),a=l;return s+="\n",e.length-o>t&&a>o?s+=e.slice(o,a)+"\n"+e.slice(a+1):s+=e.slice(o),s.slice(1)}function ht(e,t,n){var i,r,o,a,l,s;for(o=0,a=(r=n?e.explicitTypes:e.implicitTypes).length;o<a;o+=1)if(((l=r[o]).instanceOf||l.predicate)&&(!l.instanceOf||"object"==typeof t&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(e.tag=n?l.tag:"?",l.represent){if(s=e.styleMap[l.tag]||l.defaultStyle,"[object Function]"===Je.call(l.represent))i=l.represent(t,s);else{if(!Qe.call(l.represent,s))throw new Ve("!<"+l.tag+'> tag resolver accepts not "'+s+'" style');i=l.represent[s](t,s)}e.dump=i}return!0}return!1}function gt(e,t,n,i,r,o){e.tag=null,e.dump=n,ht(e,n,!1)||ht(e,n,!0);var a=Je.call(e.dump);i&&(i=e.flowLevel<0||e.flowLevel>t);var l,s,c="[object Object]"===a||"[object Array]"===a;if(c&&(s=-1!==(l=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||s||2!==e.indent&&t>0)&&(r=!1),s&&e.usedDuplicates[l])e.dump="*ref_"+l;else{if(c&&s&&!e.usedDuplicates[l]&&(e.usedDuplicates[l]=!0),"[object Object]"===a)i&&0!==Object.keys(e.dump).length?(!function(e,t,n,i){var r,o,a,l,s,c,u="",p=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new Ve("sortKeys must be a boolean or a function");for(r=0,o=f.length;r<o;r+=1)c="",i&&0===r||(c+=rt(e,t)),l=n[a=f[r]],gt(e,t+1,a,!0,!0,!0)&&((s=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,s&&(c+=rt(e,t)),gt(e,t+1,l,!0,s)&&(e.dump&&10===e.dump.charCodeAt(0)?c+=":":c+=": ",u+=c+=e.dump));e.tag=p,e.dump=u||"{}"}(e,t,e.dump,r),s&&(e.dump="&ref_"+l+e.dump)):(!function(e,t,n){var i,r,o,a,l,s="",c=e.tag,u=Object.keys(n);for(i=0,r=u.length;i<r;i+=1)l="",0!==i&&(l+=", "),e.condenseFlow&&(l+='"'),a=n[o=u[i]],gt(e,t,o,!1,!1)&&(e.dump.length>1024&&(l+="? "),l+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),gt(e,t,a,!1,!1)&&(s+=l+=e.dump));e.tag=c,e.dump="{"+s+"}"}(e,t,e.dump),s&&(e.dump="&ref_"+l+" "+e.dump));else if("[object Array]"===a){var u=e.noArrayIndent&&t>0?t-1:t;i&&0!==e.dump.length?(!function(e,t,n,i){var r,o,a="",l=e.tag;for(r=0,o=n.length;r<o;r+=1)gt(e,t+1,n[r],!0,!0)&&(i&&0===r||(a+=rt(e,t)),e.dump&&10===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=l,e.dump=a||"[]"}(e,u,e.dump,r),s&&(e.dump="&ref_"+l+e.dump)):(!function(e,t,n){var i,r,o="",a=e.tag;for(i=0,r=n.length;i<r;i+=1)gt(e,t,n[i],!1,!1)&&(0!==i&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=a,e.dump="["+o+"]"}(e,u,e.dump),s&&(e.dump="&ref_"+l+" "+e.dump))}else{if("[object String]"!==a){if(e.skipInvalid)return!1;throw new Ve("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&ut(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function mt(e,t){var n,i,r=[],o=[];for(yt(e,r,o),n=0,i=o.length;n<i;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function yt(e,t,n){var i,r,o;if(null!==e&&"object"==typeof e)if(-1!==(r=t.indexOf(e)))-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;r<o;r+=1)yt(e[r],t,n);else for(r=0,o=(i=Object.keys(e)).length;r<o;r+=1)yt(e[i[r]],t,n)}function At(e,t){var n=new nt(t=t||{});return n.noRefs||mt(e,n),gt(n,0,e,!0,!0)?n.dump+"\n":""}He.dump=At,He.safeDump=function(e,t){return At(e,Ge.extend({schema:ze},t))};var vt=i,bt=He;function wt(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}n.Type=h,n.Schema=b,n.FAILSAFE_SCHEMA=w,n.JSON_SCHEMA=N,n.CORE_SCHEMA=T,n.DEFAULT_SAFE_SCHEMA=J,n.DEFAULT_FULL_SCHEMA=ie,n.load=vt.load,n.loadAll=vt.loadAll,n.safeLoad=vt.safeLoad,n.safeLoadAll=vt.safeLoadAll,n.dump=bt.dump,n.safeDump=bt.safeDump,n.YAMLException=l,n.MINIMAL_SCHEMA=w,n.SAFE_SCHEMA=J,n.DEFAULT_SCHEMA=ie,n.scan=wt("scan"),n.parse=wt("parse"),n.compose=wt("compose"),n.addConstructor=wt("addConstructor");var kt=n;exports.__moduleExports=kt,exports.readYaml=(t,n)=>{let i;const r={...n,filename:t};try{i=e.readFileSync(t,n)}catch(e){if(/(?:no such file or directory, open)/i.test(e.message))throw"You supplied a file that was not found, please check your file path";throw e}try{const e=kt.load(i.toString("utf8"),r);if("object"!=typeof e)throw new Error("not_valid_yaml");return e}catch(e){if(/(?:not_valid_yaml)/i.test(e.message))throw"It looks like the supplied file was not a valid YAML file!";throw"Something went wrong parsing the YAML file"}}; //# sourceMappingURL=index.js.map