UNPKG

@pigeon-posse/pkg-extended-scripts

Version:

Separate scripts from package.json

47 lines (44 loc) 49.8 kB
#! /usr/bin/env node var Le={fileNamesAllowed:["package.scripts"],extensionsAllowed:[".yaml",".yml",".js",".json"],argv:process.argv,argvCli:process.argv[1],argvArgs:process.argv.slice(2),argvArgsExtra:process.argv.slice(3)};import{spawnSync as ln}from"child_process";var Re=e=>{ln(e,{shell:!0,stdio:"inherit"})};var Me=(e=0)=>r=>`\x1B[${r+e}m`,Be=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,De=(e=0)=>(r,n,o)=>`\x1B[${38+e};2;${r};${n};${o}m`,A={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},je=Object.keys(A.modifier),se=Object.keys(A.color),he=Object.keys(A.bgColor),Pe=[...se,...he];function un(){let e=new Map;for(let[r,n]of Object.entries(A)){for(let[o,i]of Object.entries(n))A[o]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[o]=A[o],e.set(i[0],i[1]);Object.defineProperty(A,r,{value:n,enumerable:!1})}return Object.defineProperty(A,"codes",{value:e,enumerable:!1}),A.color.close="\x1B[39m",A.bgColor.close="\x1B[49m",A.color.ansi=Me(),A.color.ansi256=Be(),A.color.ansi16m=De(),A.bgColor.ansi=Me(10),A.bgColor.ansi256=Be(10),A.bgColor.ansi16m=De(10),Object.defineProperties(A,{rgbToAnsi256:{value(r,n,o){return r===n&&n===o?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(r){let n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!n)return[0,0,0];let[o]=n;o.length===3&&(o=[...o].map(u=>u+u).join(""));let i=Number.parseInt(o,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:r=>A.rgbToAnsi256(...A.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let n,o,i;if(r>=232)n=((r-232)*10+8)/255,o=n,i=n;else{r-=16;let t=r%36;n=Math.floor(r/36)/5,o=Math.floor(t/6)/5,i=t%6/5}let u=Math.max(n,o,i)*2;if(u===0)return 30;let l=30+(Math.round(i)<<2|Math.round(o)<<1|Math.round(n));return u===2&&(l+=60),l},enumerable:!1},rgbToAnsi:{value:(r,n,o)=>A.ansi256ToAnsi(A.rgbToAnsi256(r,n,o)),enumerable:!1},hexToAnsi:{value:r=>A.ansi256ToAnsi(A.hexToAnsi256(r)),enumerable:!1}}),A}var tn=un(),F=tn;import de from"node:process";import cn from"node:os";import Ye from"node:tty";function O(e,r=globalThis.Deno?globalThis.Deno.args:de.argv){let n=e.startsWith("-")?"":e.length===1?"-":"--",o=r.indexOf(n+e),i=r.indexOf("--");return o!==-1&&(i===-1||o<i)}var{env:v}=de,ne;O("no-color")||O("no-colors")||O("color=false")||O("color=never")?ne=0:(O("color")||O("colors")||O("color=true")||O("color=always"))&&(ne=1);function fn(){if("FORCE_COLOR"in v)return v.FORCE_COLOR==="true"?1:v.FORCE_COLOR==="false"?0:v.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(v.FORCE_COLOR,10),3)}function an(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function pn(e,{streamIsTTY:r,sniffFlags:n=!0}={}){let o=fn();o!==void 0&&(ne=o);let i=n?ne:o;if(i===0)return 0;if(n){if(O("color=16m")||O("color=full")||O("color=truecolor"))return 3;if(O("color=256"))return 2}if("TF_BUILD"in v&&"AGENT_NAME"in v)return 1;if(e&&!r&&i===void 0)return 0;let u=i||0;if(v.TERM==="dumb")return u;if(de.platform==="win32"){let l=cn.release().split(".");return Number(l[0])>=10&&Number(l[2])>=10586?Number(l[2])>=14931?3:2:1}if("CI"in v)return"GITHUB_ACTIONS"in v?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(l=>l in v)||v.CI_NAME==="codeship"?1:u;if("TEAMCITY_VERSION"in v)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(v.TEAMCITY_VERSION)?1:0;if(v.COLORTERM==="truecolor"||v.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in v){let l=Number.parseInt((v.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(v.TERM_PROGRAM){case"iTerm.app":return l>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(v.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(v.TERM)||"COLORTERM"in v?1:u}function He(e,r={}){let n=pn(e,{streamIsTTY:e&&e.isTTY,...r});return an(n)}var sn={stdout:He({isTTY:Ye.isatty(1)}),stderr:He({isTTY:Ye.isatty(2)})},Ue=sn;function Ge(e,r,n){let o=e.indexOf(r);if(o===-1)return e;let i=r.length,u=0,l="";do l+=e.slice(u,o)+r+n,u=o+i,o=e.indexOf(r,u);while(o!==-1);return l+=e.slice(u),l}function Ke(e,r,n,o){let i=0,u="";do{let l=e[o-1]==="\r";u+=e.slice(i,l?o-1:o)+r+(l?`\r `:` `)+n,i=o+1,o=e.indexOf(` `,i)}while(o!==-1);return u+=e.slice(i),u}var{stdout:We,stderr:$e}=Ue,me=Symbol("GENERATOR"),P=Symbol("STYLER"),q=Symbol("IS_EMPTY"),qe=["ansi","ansi","ansi256","ansi16m"],Y=Object.create(null),hn=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let n=We?We.level:0;e.level=r.level===void 0?n:r.level};var dn=e=>{let r=(...n)=>n.join(" ");return hn(r,e),Object.setPrototypeOf(r,V.prototype),r};function V(e){return dn(e)}Object.setPrototypeOf(V.prototype,Function.prototype);for(let[e,r]of Object.entries(F))Y[e]={get(){let n=ie(this,xe(r.open,r.close,this[P]),this[q]);return Object.defineProperty(this,e,{value:n}),n}};Y.visible={get(){let e=ie(this,this[P],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var ge=(e,r,n,...o)=>e==="rgb"?r==="ansi16m"?F[n].ansi16m(...o):r==="ansi256"?F[n].ansi256(F.rgbToAnsi256(...o)):F[n].ansi(F.rgbToAnsi(...o)):e==="hex"?ge("rgb",r,n,...F.hexToRgb(...o)):F[n][e](...o),mn=["rgb","hex","ansi256"];for(let e of mn){Y[e]={get(){let{level:n}=this;return function(...o){let i=xe(ge(e,qe[n],"color",...o),F.color.close,this[P]);return ie(this,i,this[q])}}};let r="bg"+e[0].toUpperCase()+e.slice(1);Y[r]={get(){let{level:n}=this;return function(...o){let i=xe(ge(e,qe[n],"bgColor",...o),F.bgColor.close,this[P]);return ie(this,i,this[q])}}}}var gn=Object.defineProperties(()=>{},{...Y,level:{enumerable:!0,get(){return this[me].level},set(e){this[me].level=e}}}),xe=(e,r,n)=>{let o,i;return n===void 0?(o=e,i=r):(o=n.openAll+e,i=r+n.closeAll),{open:e,close:r,openAll:o,closeAll:i,parent:n}},ie=(e,r,n)=>{let o=(...i)=>xn(o,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(o,gn),o[me]=e,o[P]=r,o[q]=n,o},xn=(e,r)=>{if(e.level<=0||!r)return e[q]?"":r;let n=e[P];if(n===void 0)return r;let{openAll:o,closeAll:i}=n;if(r.includes("\x1B"))for(;n!==void 0;)r=Ge(r,n.close,n.open),n=n.parent;let u=r.indexOf(` `);return u!==-1&&(r=Ke(r,i,o,u)),o+r+i};Object.defineProperties(V.prototype,Y);var An=V(),ol=V({level:$e?$e.level:0});var Ae=An;var k=(e,r)=>Ae[e](r),Q=(e,r,n)=>Ae[e][r](n),vn=e=>{console.table(e)},yn=()=>` `,L={dim:e=>k("dim",e),standard:e=>k("white",e),info:e=>k("gray",e),error:e=>k("red",e),warn:e=>k("yellow",e),success:e=>k("green",e),group:e=>k("cyan",e),title:e=>k("cyan",e),titleDim:e=>Q("cyan","dim",e),infoBg:e=>Q("black","bgGray",e),errorBg:e=>Q("whiteBright","bgRed",e),successBg:e=>Q("whiteBright","bgGreen",e),warnBg:e=>Q("black","bgYellow",e),custom:(e,r)=>k(e,r),table:e=>vn(e),blankLine:yn()};var H=(e,r)=>{let n;switch(e){case"error":n=L.errorBg(" ERROR "),n+=" ",n+=L.error(r);break;case"success":n=L.successBg(" SUCCESS "),n+=" ",n+=L.success(r);break;case"info":n=L.infoBg(" INFO "),n+=" ",n+=L.info(r);break;case"warn":n=L.warnBg(" WARNING "),n+=" ",n+=L.warn(r);break;default:n=r}return n},oe=(e,r)=>{let n="log";return(e=="error"||e=="warn")&&(n=e),console[n](H(e,r))},le=(e,r,n)=>{let o="log";(e=="error"||e=="warn")&&(o=e),console.group(H(e,r)),console[o](n),console.groupEnd()},I={standard:e=>console.log(e),error:e=>oe("error",e),warn:e=>oe("warn",e),info:e=>oe("info",e),success:e=>oe("success",e),throwError:e=>H("error",e),throwSuccess:e=>H("success",e),throwInfo:e=>H("info",e),throwWarn:e=>H("warn",e),groupError:(e,r)=>le("error",e,r),groupSuccess:(e,r)=>le("success",e,r),groupInfo:(e,r)=>le("info",e,r),groupWarn:(e,r)=>le("warn",e,r),blankLine:()=>console.log()};var X=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null;var Ve=e=>!!Number.isInteger(e);var bn=e=>{let r,n;return r=!1,n=Object.entries(e.cmd),n.forEach(([o,i])=>{e.argvArgs.includes(o)&&(r={key:o,value:i})}),r},Qe=e=>{let r,n;return e&&!X(e)?(I.error("Function argument must be an object."),!1):e.cmd?e.cmd&&!X(e.cmd)?(I.error('The value of the "cmd" argument must be an object.'),!1):e.argvNum&&!Ve(e.argvNum)?(I.error('The value of the "cmd" argument must be a integer.'),!1):(r=e.cmd?Object.keys(e.cmd).join(` `):"Does not exist scripts.",e.argvArgs.length==0?(I.groupInfo(`This command requires a argument. Available list:`,r),!1):(n=bn(e),n||(I.groupError(`The argument [${e.argvArgs[0]}] does not exist in the script file. Available list:`,r),!1))):(I.info("Does not exist file: "+e.fileNamesAllowed[0]+"["+e.extensionsAllowed.join(", ")+"]"),!1)};import*as U from"fs";var Xe=e=>!!U.existsSync(e);import*as en from"fs";function sr(e){return typeof e>"u"||e===null}function Cn(e){return typeof e=="object"&&e!==null}function wn(e){return Array.isArray(e)?e:sr(e)?[]:[e]}function En(e,r){var n,o,i,u;if(r)for(u=Object.keys(r),n=0,o=u.length;n<o;n+=1)i=u[n],e[i]=r[i];return e}function _n(e,r){var n="",o;for(o=0;o<r;o+=1)n+=e;return n}function Sn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var On=sr,Tn=Cn,Fn=wn,In=_n,Nn=Sn,kn=En,C={isNothing:On,isObject:Tn,toArray:Fn,repeat:In,isNegativeZero:Nn,extend:kn};function hr(e,r){var n="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(n+=` `+e.mark.snippet),o+" "+n):o}function z(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=hr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}z.prototype=Object.create(Error.prototype);z.prototype.constructor=z;z.prototype.toString=function(r){return this.name+": "+hr(this,r)};var _=z;function ve(e,r,n,o,i){var u="",l="",t=Math.floor(i/2)-1;return o-r>t&&(u=" ... ",r=o-t+u.length),n-o>t&&(l=" ...",n=o+t-l.length),{str:u+e.slice(r,n).replace(/\t/g,"\u2192")+l,pos:o-r+u.length}}function ye(e,r){return C.repeat(" ",r-e.length)+e}function Ln(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var n=/\r?\n|\r|\0/g,o=[0],i=[],u,l=-1;u=n.exec(e.buffer);)i.push(u.index),o.push(u.index+u[0].length),e.position<=u.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);var t="",c,f,p=Math.min(e.line+r.linesAfter,i.length).toString().length,a=r.maxLength-(r.indent+p+3);for(c=1;c<=r.linesBefore&&!(l-c<0);c++)f=ve(e.buffer,o[l-c],i[l-c],e.position-(o[l]-o[l-c]),a),t=C.repeat(" ",r.indent)+ye((e.line-c+1).toString(),p)+" | "+f.str+` `+t;for(f=ve(e.buffer,o[l],i[l],e.position,a),t+=C.repeat(" ",r.indent)+ye((e.line+1).toString(),p)+" | "+f.str+` `,t+=C.repeat("-",r.indent+p+3+f.pos)+`^ `,c=1;c<=r.linesAfter&&!(l+c>=i.length);c++)f=ve(e.buffer,o[l+c],i[l+c],e.position-(o[l]-o[l+c]),a),t+=C.repeat(" ",r.indent)+ye((e.line+c+1).toString(),p)+" | "+f.str+` `;return t.replace(/\n$/,"")}var Rn=Ln,Mn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Bn=["scalar","sequence","mapping"];function Dn(e){var r={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(o){r[String(o)]=n})}),r}function jn(e,r){if(r=r||{},Object.keys(r).forEach(function(n){if(Mn.indexOf(n)===-1)throw new _('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(n){return n},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=Dn(r.styleAliases||null),Bn.indexOf(this.kind)===-1)throw new _('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var w=jn;function Ze(e,r){var n=[];return e[r].forEach(function(o){var i=n.length;n.forEach(function(u,l){u.tag===o.tag&&u.kind===o.kind&&u.multi===o.multi&&(i=l)}),n[i]=o}),n}function Pn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,n;function o(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(o);return e}function Ce(e){return this.extend(e)}Ce.prototype.extend=function(r){var n=[],o=[];if(r instanceof w)o.push(r);else if(Array.isArray(r))o=o.concat(r);else if(r&&(Array.isArray(r.implicit)||Array.isArray(r.explicit)))r.implicit&&(n=n.concat(r.implicit)),r.explicit&&(o=o.concat(r.explicit));else throw new _("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(u){if(!(u instanceof w))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(u.loadKind&&u.loadKind!=="scalar")throw new _("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(u.multi)throw new _("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(u){if(!(u instanceof w))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Ce.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(o),i.compiledImplicit=Ze(i,"implicit"),i.compiledExplicit=Ze(i,"explicit"),i.compiledTypeMap=Pn(i.compiledImplicit,i.compiledExplicit),i};var dr=Ce,mr=new w("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),gr=new w("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),xr=new w("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ar=new dr({explicit:[mr,gr,xr]});function Yn(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function Hn(){return null}function Un(e){return e===null}var vr=new w("tag:yaml.org,2002:null",{kind:"scalar",resolve:Yn,construct:Hn,predicate:Un,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Gn(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function Kn(e){return e==="true"||e==="True"||e==="TRUE"}function Wn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var yr=new w("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Gn,construct:Kn,predicate:Wn,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 $n(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function qn(e){return 48<=e&&e<=55}function Vn(e){return 48<=e&&e<=57}function Qn(e){if(e===null)return!1;var r=e.length,n=0,o=!1,i;if(!r)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===r)return!0;if(i=e[++n],i==="b"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;o=!0}return o&&i!=="_"}if(i==="x"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!$n(e.charCodeAt(n)))return!1;o=!0}return o&&i!=="_"}if(i==="o"){for(n++;n<r;n++)if(i=e[n],i!=="_"){if(!qn(e.charCodeAt(n)))return!1;o=!0}return o&&i!=="_"}}if(i==="_")return!1;for(;n<r;n++)if(i=e[n],i!=="_"){if(!Vn(e.charCodeAt(n)))return!1;o=!0}return!(!o||i==="_")}function Xn(e){var r=e,n=1,o;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),o=r[0],(o==="-"||o==="+")&&(o==="-"&&(n=-1),r=r.slice(1),o=r[0]),r==="0")return 0;if(o==="0"){if(r[1]==="b")return n*parseInt(r.slice(2),2);if(r[1]==="x")return n*parseInt(r.slice(2),16);if(r[1]==="o")return n*parseInt(r.slice(2),8)}return n*parseInt(r,10)}function Zn(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!C.isNegativeZero(e)}var br=new w("tag:yaml.org,2002:int",{kind:"scalar",resolve:Qn,construct:Xn,predicate:Zn,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"]}}),zn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Jn(e){return!(e===null||!zn.test(e)||e[e.length-1]==="_")}function ei(e){var r,n;return r=e.replace(/_/g,"").toLowerCase(),n=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:n*parseFloat(r,10)}var ri=/^[-+]?[0-9]+e/;function ni(e,r){var n;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(C.isNegativeZero(e))return"-0.0";return n=e.toString(10),ri.test(n)?n.replace("e",".e"):n}function ii(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||C.isNegativeZero(e))}var Cr=new w("tag:yaml.org,2002:float",{kind:"scalar",resolve:Jn,construct:ei,predicate:ii,represent:ni,defaultStyle:"lowercase"}),wr=Ar.extend({implicit:[vr,yr,br,Cr]}),Er=wr,_r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Sr=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]))?))?$");function oi(e){return e===null?!1:_r.exec(e)!==null||Sr.exec(e)!==null}function li(e){var r,n,o,i,u,l,t,c=0,f=null,p,a,h;if(r=_r.exec(e),r===null&&(r=Sr.exec(e)),r===null)throw new Error("Date resolve error");if(n=+r[1],o=+r[2]-1,i=+r[3],!r[4])return new Date(Date.UTC(n,o,i));if(u=+r[4],l=+r[5],t=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(p=+r[10],a=+(r[11]||0),f=(p*60+a)*6e4,r[9]==="-"&&(f=-f)),h=new Date(Date.UTC(n,o,i,u,l,t,c)),f&&h.setTime(h.getTime()-f),h}function ui(e){return e.toISOString()}var Or=new w("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:oi,construct:li,instanceOf:Date,represent:ui});function ti(e){return e==="<<"||e===null}var Tr=new w("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ti}),Oe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function ci(e){if(e===null)return!1;var r,n,o=0,i=e.length,u=Oe;for(n=0;n<i;n++)if(r=u.indexOf(e.charAt(n)),!(r>64)){if(r<0)return!1;o+=6}return o%8===0}function fi(e){var r,n,o=e.replace(/[\r\n=]/g,""),i=o.length,u=Oe,l=0,t=[];for(r=0;r<i;r++)r%4===0&&r&&(t.push(l>>16&255),t.push(l>>8&255),t.push(l&255)),l=l<<6|u.indexOf(o.charAt(r));return n=i%4*6,n===0?(t.push(l>>16&255),t.push(l>>8&255),t.push(l&255)):n===18?(t.push(l>>10&255),t.push(l>>2&255)):n===12&&t.push(l>>4&255),new Uint8Array(t)}function ai(e){var r="",n=0,o,i,u=e.length,l=Oe;for(o=0;o<u;o++)o%3===0&&o&&(r+=l[n>>18&63],r+=l[n>>12&63],r+=l[n>>6&63],r+=l[n&63]),n=(n<<8)+e[o];return i=u%3,i===0?(r+=l[n>>18&63],r+=l[n>>12&63],r+=l[n>>6&63],r+=l[n&63]):i===2?(r+=l[n>>10&63],r+=l[n>>4&63],r+=l[n<<2&63],r+=l[64]):i===1&&(r+=l[n>>2&63],r+=l[n<<4&63],r+=l[64],r+=l[64]),r}function pi(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Fr=new w("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ci,construct:fi,predicate:pi,represent:ai}),si=Object.prototype.hasOwnProperty,hi=Object.prototype.toString;function di(e){if(e===null)return!0;var r=[],n,o,i,u,l,t=e;for(n=0,o=t.length;n<o;n+=1){if(i=t[n],l=!1,hi.call(i)!=="[object Object]")return!1;for(u in i)if(si.call(i,u))if(!l)l=!0;else return!1;if(!l)return!1;if(r.indexOf(u)===-1)r.push(u);else return!1}return!0}function mi(e){return e!==null?e:[]}var Ir=new w("tag:yaml.org,2002:omap",{kind:"sequence",resolve:di,construct:mi}),gi=Object.prototype.toString;function xi(e){if(e===null)return!0;var r,n,o,i,u,l=e;for(u=new Array(l.length),r=0,n=l.length;r<n;r+=1){if(o=l[r],gi.call(o)!=="[object Object]"||(i=Object.keys(o),i.length!==1))return!1;u[r]=[i[0],o[i[0]]]}return!0}function Ai(e){if(e===null)return[];var r,n,o,i,u,l=e;for(u=new Array(l.length),r=0,n=l.length;r<n;r+=1)o=l[r],i=Object.keys(o),u[r]=[i[0],o[i[0]]];return u}var Nr=new w("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:xi,construct:Ai}),vi=Object.prototype.hasOwnProperty;function yi(e){if(e===null)return!0;var r,n=e;for(r in n)if(vi.call(n,r)&&n[r]!==null)return!1;return!0}function bi(e){return e!==null?e:{}}var kr=new w("tag:yaml.org,2002:set",{kind:"mapping",resolve:yi,construct:bi}),Te=Er.extend({implicit:[Or,Tr],explicit:[Fr,Ir,Nr,kr]}),B=Object.prototype.hasOwnProperty,ue=1,Lr=2,Rr=3,te=4,be=1,Ci=2,ze=3,wi=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ei=/[\x85\u2028\u2029]/,_i=/[,\[\]\{\}]/,Mr=/^(?:!|!!|![a-z\-]+!)$/i,Br=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Je(e){return Object.prototype.toString.call(e)}function N(e){return e===10||e===13}function j(e){return e===9||e===32}function S(e){return e===9||e===32||e===10||e===13}function K(e){return e===44||e===91||e===93||e===123||e===125}function Si(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function Oi(e){return e===120?2:e===117?4:e===85?8:0}function Ti(e){return 48<=e&&e<=57?e-48:-1}function er(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?` `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Fi(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Dr=new Array(256),jr=new Array(256);for(D=0;D<256;D++)Dr[D]=er(D)?1:0,jr[D]=er(D);var D;function Ii(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||Te,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.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 Pr(e,r){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Rn(n),new _(r,n)}function s(e,r){throw Pr(e,r)}function ce(e,r){e.onWarning&&e.onWarning.call(null,Pr(e,r))}var rr={YAML:function(r,n,o){var i,u,l;r.version!==null&&s(r,"duplication of %YAML directive"),o.length!==1&&s(r,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),i===null&&s(r,"ill-formed argument of the YAML directive"),u=parseInt(i[1],10),l=parseInt(i[2],10),u!==1&&s(r,"unacceptable YAML version of the document"),r.version=o[0],r.checkLineBreaks=l<2,l!==1&&l!==2&&ce(r,"unsupported YAML version of the document")},TAG:function(r,n,o){var i,u;o.length!==2&&s(r,"TAG directive accepts exactly two arguments"),i=o[0],u=o[1],Mr.test(i)||s(r,"ill-formed tag handle (first argument) of the TAG directive"),B.call(r.tagMap,i)&&s(r,'there is a previously declared suffix for "'+i+'" tag handle'),Br.test(u)||s(r,"ill-formed tag prefix (second argument) of the TAG directive");try{u=decodeURIComponent(u)}catch{s(r,"tag prefix is malformed: "+u)}r.tagMap[i]=u}};function M(e,r,n,o){var i,u,l,t;if(r<n){if(t=e.input.slice(r,n),o)for(i=0,u=t.length;i<u;i+=1)l=t.charCodeAt(i),l===9||32<=l&&l<=1114111||s(e,"expected valid JSON character");else wi.test(t)&&s(e,"the stream contains non-printable characters");e.result+=t}}function nr(e,r,n,o){var i,u,l,t;for(C.isObject(n)||s(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),l=0,t=i.length;l<t;l+=1)u=i[l],B.call(r,u)||(r[u]=n[u],o[u]=!0)}function W(e,r,n,o,i,u,l,t,c){var f,p;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),f=0,p=i.length;f<p;f+=1)Array.isArray(i[f])&&s(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Je(i[f])==="[object Object]"&&(i[f]="[object Object]");if(typeof i=="object"&&Je(i)==="[object Object]"&&(i="[object Object]"),i=String(i),r===null&&(r={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(u))for(f=0,p=u.length;f<p;f+=1)nr(e,r,u[f],n);else nr(e,r,u,n);else!e.json&&!B.call(n,i)&&B.call(r,i)&&(e.line=l||e.line,e.lineStart=t||e.lineStart,e.position=c||e.position,s(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(r,i,{configurable:!0,enumerable:!0,writable:!0,value:u}):r[i]=u,delete n[i];return r}function Fe(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):s(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function b(e,r,n){for(var o=0,i=e.input.charCodeAt(e.position);i!==0;){for(;j(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(r&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(N(i))for(Fe(e),i=e.input.charCodeAt(e.position),o++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&o!==0&&e.lineIndent<n&&ce(e,"deficient indentation"),o}function pe(e){var r=e.position,n;return n=e.input.charCodeAt(r),!!((n===45||n===46)&&n===e.input.charCodeAt(r+1)&&n===e.input.charCodeAt(r+2)&&(r+=3,n=e.input.charCodeAt(r),n===0||S(n)))}function Ie(e,r){r===1?e.result+=" ":r>1&&(e.result+=C.repeat(` `,r-1))}function Ni(e,r,n){var o,i,u,l,t,c,f,p,a=e.kind,h=e.result,d;if(d=e.input.charCodeAt(e.position),S(d)||K(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),S(i)||n&&K(i)))return!1;for(e.kind="scalar",e.result="",u=l=e.position,t=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),S(i)||n&&K(i))break}else if(d===35){if(o=e.input.charCodeAt(e.position-1),S(o))break}else{if(e.position===e.lineStart&&pe(e)||n&&K(d))break;if(N(d))if(c=e.line,f=e.lineStart,p=e.lineIndent,b(e,!1,-1),e.lineIndent>=r){t=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=c,e.lineStart=f,e.lineIndent=p;break}}t&&(M(e,u,l,!1),Ie(e,e.line-c),u=l=e.position,t=!1),j(d)||(l=e.position+1),d=e.input.charCodeAt(++e.position)}return M(e,u,l,!1),e.result?!0:(e.kind=a,e.result=h,!1)}function ki(e,r){var n,o,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(M(e,o,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)o=e.position,e.position++,i=e.position;else return!0;else N(n)?(M(e,o,i,!0),Ie(e,b(e,!1,r)),o=i=e.position):e.position===e.lineStart&&pe(e)?s(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);s(e,"unexpected end of the stream within a single quoted scalar")}function Li(e,r){var n,o,i,u,l,t;if(t=e.input.charCodeAt(e.position),t!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(t=e.input.charCodeAt(e.position))!==0;){if(t===34)return M(e,n,e.position,!0),e.position++,!0;if(t===92){if(M(e,n,e.position,!0),t=e.input.charCodeAt(++e.position),N(t))b(e,!1,r);else if(t<256&&Dr[t])e.result+=jr[t],e.position++;else if((l=Oi(t))>0){for(i=l,u=0;i>0;i--)t=e.input.charCodeAt(++e.position),(l=Si(t))>=0?u=(u<<4)+l:s(e,"expected hexadecimal character");e.result+=Fi(u),e.position++}else s(e,"unknown escape sequence");n=o=e.position}else N(t)?(M(e,n,o,!0),Ie(e,b(e,!1,r)),n=o=e.position):e.position===e.lineStart&&pe(e)?s(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}s(e,"unexpected end of the stream within a double quoted scalar")}function Ri(e,r){var n=!0,o,i,u,l=e.tag,t,c=e.anchor,f,p,a,h,d,m=Object.create(null),x,y,T,g;if(g=e.input.charCodeAt(e.position),g===91)p=93,d=!1,t=[];else if(g===123)p=125,d=!0,t={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=t),g=e.input.charCodeAt(++e.position);g!==0;){if(b(e,!0,r),g=e.input.charCodeAt(e.position),g===p)return e.position++,e.tag=l,e.anchor=c,e.kind=d?"mapping":"sequence",e.result=t,!0;n?g===44&&s(e,"expected the node content, but found ','"):s(e,"missed comma between flow collection entries"),y=x=T=null,a=h=!1,g===63&&(f=e.input.charCodeAt(e.position+1),S(f)&&(a=h=!0,e.position++,b(e,!0,r))),o=e.line,i=e.lineStart,u=e.position,$(e,r,ue,!1,!0),y=e.tag,x=e.result,b(e,!0,r),g=e.input.charCodeAt(e.position),(h||e.line===o)&&g===58&&(a=!0,g=e.input.charCodeAt(++e.position),b(e,!0,r),$(e,r,ue,!1,!0),T=e.result),d?W(e,t,m,y,x,T,o,i,u):a?t.push(W(e,null,m,y,x,T,o,i,u)):t.push(x),b(e,!0,r),g=e.input.charCodeAt(e.position),g===44?(n=!0,g=e.input.charCodeAt(++e.position)):n=!1}s(e,"unexpected end of the stream within a flow collection")}function Mi(e,r){var n,o,i=be,u=!1,l=!1,t=r,c=0,f=!1,p,a;if(a=e.input.charCodeAt(e.position),a===124)o=!1;else if(a===62)o=!0;else return!1;for(e.kind="scalar",e.result="";a!==0;)if(a=e.input.charCodeAt(++e.position),a===43||a===45)be===i?i=a===43?ze:Ci:s(e,"repeat of a chomping mode identifier");else if((p=Ti(a))>=0)p===0?s(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?s(e,"repeat of an indentation width identifier"):(t=r+p-1,l=!0);else break;if(j(a)){do a=e.input.charCodeAt(++e.position);while(j(a));if(a===35)do a=e.input.charCodeAt(++e.position);while(!N(a)&&a!==0)}for(;a!==0;){for(Fe(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!l||e.lineIndent<t)&&a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>t&&(t=e.lineIndent),N(a)){c++;continue}if(e.lineIndent<t){i===ze?e.result+=C.repeat(` `,u?1+c:c):i===be&&u&&(e.result+=` `);break}for(o?j(a)?(f=!0,e.result+=C.repeat(` `,u?1+c:c)):f?(f=!1,e.result+=C.repeat(` `,c+1)):c===0?u&&(e.result+=" "):e.result+=C.repeat(` `,c):e.result+=C.repeat(` `,u?1+c:c),u=!0,l=!0,c=0,n=e.position;!N(a)&&a!==0;)a=e.input.charCodeAt(++e.position);M(e,n,e.position,!1)}return!0}function ir(e,r){var n,o=e.tag,i=e.anchor,u=[],l,t=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,s(e,"tab characters must not be used in indentation")),!(c!==45||(l=e.input.charCodeAt(e.position+1),!S(l))));){if(t=!0,e.position++,b(e,!0,-1)&&e.lineIndent<=r){u.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,$(e,r,Rr,!1,!0),u.push(e.result),b(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>r)&&c!==0)s(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return t?(e.tag=o,e.anchor=i,e.kind="sequence",e.result=u,!0):!1}function Bi(e,r,n){var o,i,u,l,t,c,f=e.tag,p=e.anchor,a={},h=Object.create(null),d=null,m=null,x=null,y=!1,T=!1,g;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),g=e.input.charCodeAt(e.position);g!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,s(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),u=e.line,(g===63||g===58)&&S(o))g===63?(y&&(W(e,a,h,d,m,null,l,t,c),d=m=x=null),T=!0,y=!0,i=!0):y?(y=!1,i=!0):s(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,g=o;else{if(l=e.line,t=e.lineStart,c=e.position,!$(e,n,Lr,!1,!0))break;if(e.line===u){for(g=e.input.charCodeAt(e.position);j(g);)g=e.input.charCodeAt(++e.position);if(g===58)g=e.input.charCodeAt(++e.position),S(g)||s(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(W(e,a,h,d,m,null,l,t,c),d=m=x=null),T=!0,y=!1,i=!1,d=e.tag,m=e.result;else if(T)s(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=p,!0}else if(T)s(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=p,!0}if((e.line===u||e.lineIndent>r)&&(y&&(l=e.line,t=e.lineStart,c=e.position),$(e,r,te,!0,i)&&(y?m=e.result:x=e.result),y||(W(e,a,h,d,m,x,l,t,c),d=m=x=null),b(e,!0,-1),g=e.input.charCodeAt(e.position)),(e.line===u||e.lineIndent>r)&&g!==0)s(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return y&&W(e,a,h,d,m,null,l,t,c),T&&(e.tag=f,e.anchor=p,e.kind="mapping",e.result=a),T}function Di(e){var r,n=!1,o=!1,i,u,l;if(l=e.input.charCodeAt(e.position),l!==33)return!1;if(e.tag!==null&&s(e,"duplication of a tag property"),l=e.input.charCodeAt(++e.position),l===60?(n=!0,l=e.input.charCodeAt(++e.position)):l===33?(o=!0,i="!!",l=e.input.charCodeAt(++e.position)):i="!",r=e.position,n){do l=e.input.charCodeAt(++e.position);while(l!==0&&l!==62);e.position<e.length?(u=e.input.slice(r,e.position),l=e.input.charCodeAt(++e.position)):s(e,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!S(l);)l===33&&(o?s(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(r-1,e.position+1),Mr.test(i)||s(e,"named tag handle cannot contain such characters"),o=!0,r=e.position+1)),l=e.input.charCodeAt(++e.position);u=e.input.slice(r,e.position),_i.test(u)&&s(e,"tag suffix cannot contain flow indicator characters")}u&&!Br.test(u)&&s(e,"tag name cannot contain such characters: "+u);try{u=decodeURIComponent(u)}catch{s(e,"tag name is malformed: "+u)}return n?e.tag=u:B.call(e.tagMap,i)?e.tag=e.tagMap[i]+u:i==="!"?e.tag="!"+u:i==="!!"?e.tag="tag:yaml.org,2002:"+u:s(e,'undeclared tag handle "'+i+'"'),!0}function ji(e){var r,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&s(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),r=e.position;n!==0&&!S(n)&&!K(n);)n=e.input.charCodeAt(++e.position);return e.position===r&&s(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function Pi(e){var r,n,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),r=e.position;o!==0&&!S(o)&&!K(o);)o=e.input.charCodeAt(++e.position);return e.position===r&&s(e,"name of an alias node must contain at least one character"),n=e.input.slice(r,e.position),B.call(e.anchorMap,n)||s(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],b(e,!0,-1),!0}function $(e,r,n,o,i){var u,l,t,c=1,f=!1,p=!1,a,h,d,m,x,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,u=l=t=te===n||Rr===n,o&&b(e,!0,-1)&&(f=!0,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)),c===1)for(;Di(e)||ji(e);)b(e,!0,-1)?(f=!0,t=u,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)):t=!1;if(t&&(t=f||i),(c===1||te===n)&&(ue===n||Lr===n?x=r:x=r+1,y=e.position-e.lineStart,c===1?t&&(ir(e,y)||Bi(e,y,x))||Ri(e,x)?p=!0:(l&&Mi(e,x)||ki(e,x)||Li(e,x)?p=!0:Pi(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&s(e,"alias node should not have any properties")):Ni(e,x,ue===n)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(p=t&&ir(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&s(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),a=0,h=e.implicitTypes.length;a<h;a+=1)if(m=e.implicitTypes[a],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(B.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,d=e.typeMap.multi[e.kind||"fallback"],a=0,h=d.length;a<h;a+=1)if(e.tag.slice(0,d[a].tag.length)===d[a].tag){m=d[a];break}m||s(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&s(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):s(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function Yi(e){var r=e.position,n,o,i,u=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(l=e.input.charCodeAt(e.position))!==0&&(b(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(u=!0,l=e.input.charCodeAt(++e.position),n=e.position;l!==0&&!S(l);)l=e.input.charCodeAt(++e.position);for(o=e.input.slice(n,e.position),i=[],o.length<1&&s(e,"directive name must not be less than one character in length");l!==0;){for(;j(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!N(l));break}if(N(l))break;for(n=e.position;l!==0&&!S(l);)l=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}l!==0&&Fe(e),B.call(rr,o)?rr[o](e,o,i):ce(e,'unknown document directive "'+o+'"')}if(b(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,b(e,!0,-1)):u&&s(e,"directives end mark is expected"),$(e,e.lineIndent-1,te,!1,!0),b(e,!0,-1),e.checkLineBreaks&&Ei.test(e.input.slice(r,e.position))&&ce(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&pe(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,b(e,!0,-1));return}if(e.position<e.length-1)s(e,"end of the stream or a document separator is expected");else return}function Yr(e,r){e=String(e),r=r||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=` `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Ii(e,r),o=e.indexOf("\0");for(o!==-1&&(n.position=o,s(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Yi(n);return n.documents}function Hi(e,r,n){r!==null&&typeof r=="object"&&typeof n>"u"&&(n=r,r=null);var o=Yr(e,n);if(typeof r!="function")return o;for(var i=0,u=o.length;i<u;i+=1)r(o[i])}function Ui(e,r){var n=Yr(e,r);if(n.length!==0){if(n.length===1)return n[0];throw new _("expected a single document in the stream, but found more")}}var Gi=Hi,Ki=Ui,Hr={loadAll:Gi,load:Ki},Ur=Object.prototype.toString,Gr=Object.prototype.hasOwnProperty,Ne=65279,Wi=9,J=10,$i=13,qi=32,Vi=33,Qi=34,we=35,Xi=37,Zi=38,zi=39,Ji=42,Kr=44,eo=45,fe=58,ro=61,no=62,io=63,oo=64,Wr=91,$r=93,lo=96,qr=123,uo=124,Vr=125,E={};E[0]="\\0";E[7]="\\a";E[8]="\\b";E[9]="\\t";E[10]="\\n";E[11]="\\v";E[12]="\\f";E[13]="\\r";E[27]="\\e";E[34]='\\"';E[92]="\\\\";E[133]="\\N";E[160]="\\_";E[8232]="\\L";E[8233]="\\P";var to=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],co=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function fo(e,r){var n,o,i,u,l,t,c;if(r===null)return{};for(n={},o=Object.keys(r),i=0,u=o.length;i<u;i+=1)l=o[i],t=String(r[l]),l.slice(0,2)==="!!"&&(l="tag:yaml.org,2002:"+l.slice(2)),c=e.compiledTypeMap.fallback[l],c&&Gr.call(c.styleAliases,t)&&(t=c.styleAliases[t]),n[l]=t;return n}function ao(e){var r,n,o;if(r=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else if(e<=4294967295)n="U",o=8;else throw new _("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+C.repeat("0",o-r.length)+r}var po=1,ee=2;function so(e){this.schema=e.schema||Te,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=C.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=fo(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==='"'?ee:po,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function or(e,r){for(var n=C.repeat(" ",r),o=0,i=-1,u="",l,t=e.length;o<t;)i=e.indexOf(` `,o),i===-1?(l=e.slice(o),o=t):(l=e.slice(o,i+1),o=i+1),l.length&&l!==` `&&(u+=n),u+=l;return u}function Ee(e,r){return` `+C.repeat(" ",e.indent*r)}function ho(e,r){var n,o,i;for(n=0,o=e.implicitTypes.length;n<o;n+=1)if(i=e.implicitTypes[n],i.resolve(r))return!0;return!1}function ae(e){return e===qi||e===Wi}function re(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ne||65536<=e&&e<=1114111}function lr(e){return re(e)&&e!==Ne&&e!==$i&&e!==J}function ur(e,r,n){var o=lr(e),i=o&&!ae(e);return(n?o:o&&e!==Kr&&e!==Wr&&e!==$r&&e!==qr&&e!==Vr)&&e!==we&&!(r===fe&&!i)||lr(r)&&!ae(r)&&e===we||r===fe&&i}function mo(e){return re(e)&&e!==Ne&&!ae(e)&&e!==eo&&e!==io&&e!==fe&&e!==Kr&&e!==Wr&&e!==$r&&e!==qr&&e!==Vr&&e!==we&&e!==Zi&&e!==Ji&&e!==Vi&&e!==uo&&e!==ro&&e!==no&&e!==zi&&e!==Qi&&e!==Xi&&e!==oo&&e!==lo}function go(e){return!ae(e)&&e!==fe}function Z(e,r){var n=e.charCodeAt(r),o;return n>=55296&&n<=56319&&r+1<e.length&&(o=e.charCodeAt(r+1),o>=56320&&o<=57343)?(n-55296)*1024+o-56320+65536:n}function Qr(e){var r=/^\n* /;return r.test(e)}var Xr=1,_e=2,Zr=3,zr=4,G=5;function xo(e,r,n,o,i,u,l,t){var c,f=0,p=null,a=!1,h=!1,d=o!==-1,m=-1,x=mo(Z(e,0))&&go(Z(e,e.length-1));if(r||l)for(c=0;c<e.length;f>=65536?c+=2:c++){if(f=Z(e,c),!re(f))return G;x=x&&ur(f,p,t),p=f}else{for(c=0;c<e.length;f>=65536?c+=2:c++){if(f=Z(e,c),f===J)a=!0,d&&(h=h||c-m-1>o&&e[m+1]!==" ",m=c);else if(!re(f))return G;x=x&&ur(f,p,t),p=f}h=h||d&&c-m-1>o&&e[m+1]!==" "}return!a&&!h?x&&!l&&!i(e)?Xr:u===ee?G:_e:n>9&&Qr(e)?G:l?u===ee?G:_e:h?zr:Zr}function Ao(e,r,n,o,i){e.dump=function(){if(r.length===0)return e.quotingType===ee?'""':"''";if(!e.noCompatMode&&(to.indexOf(r)!==-1||co.test(r)))return e.quotingType===ee?'"'+r+'"':"'"+r+"'";var u=e.indent*Math.max(1,n),l=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-u),t=o||e.flowLevel>-1&&n>=e.flowLevel;function c(f){return ho(e,f)}switch(xo(r,t,e.indent,l,c,e.quotingType,e.forceQuotes&&!o,i)){case Xr:return r;case _e:return"'"+r.replace(/'/g,"''")+"'";case Zr:return"|"+tr(r,e.indent)+cr(or(r,u));case zr:return">"+tr(r,e.indent)+cr(or(vo(r,l),u));case G:return'"'+yo(r)+'"';default:throw new _("impossible error: invalid scalar style")}}()}function tr(e,r){var n=Qr(e)?String(r):"",o=e[e.length-1]===` `,i=o&&(e[e.length-2]===` `||e===` `),u=i?"+":o?"":"-";return n+u+` `}function cr(e){return e[e.length-1]===` `?e.slice(0,-1):e}function vo(e,r){for(var n=/(\n+)([^\n]*)/g,o=function(){var f=e.indexOf(` `);return f=f!==-1?f:e.length,n.lastIndex=f,fr(e.slice(0,f),r)}(),i=e[0]===` `||e[0]===" ",u,l;l=n.exec(e);){var t=l[1],c=l[2];u=c[0]===" ",o+=t+(!i&&!u&&c!==""?` `:"")+fr(c,r),i=u}return o}function fr(e,r){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,o,i=0,u,l=0,t=0,c="";o=n.exec(e);)t=o.index,t-i>r&&(u=l>i?l:t,c+=` `+e.slice(i,u),i=u+1),l=t;return c+=` `,e.length-i>r&&l>i?c+=e.slice(i,l)+` `+e.slice(l+1):c+=e.slice(i),c.slice(1)}function yo(e){for(var r="",n=0,o,i=0;i<e.length;n>=65536?i+=2:i++)n=Z(e,i),o=E[n],!o&&re(n)?(r+=e[i],n>=65536&&(r+=e[i+1])):r+=o||ao(n);return r}function bo(e,r,n){var o="",i=e.tag,u,l,t;for(u=0,l=n.length;u<l;u+=1)t=n[u],e.replacer&&(t=e.replacer.call(n,String(u),t)),(R(e,r,t,!1,!1)||typeof t>"u"&&R(e,r,null,!1,!1))&&(o!==""&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=i,e.dump="["+o+"]"}function ar(e,r,n,o){var i="",u=e.tag,l,t,c;for(l=0,t=n.length;l<t;l+=1)c=n[l],e.replacer&&(c=e.replacer.call(n,String(l),c)),(R(e,r+1,c,!0,!0,!1,!0)||typeof c>"u"&&R(e,r+1,null,!0,!0,!1,!0))&&((!o||i!=="")&&(i+=Ee(e,r)),e.dump&&J===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=u,e.dump=i||"[]"}function Co(e,r,n){var o="",i=e.tag,u=Object.keys(n),l,t,c,f,p;for(l=0,t=u.length;l<t;l+=1)p="",o!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=u[l],f=n[c],e.replacer&&(f=e.replacer.call(n,c,f)),R(e,r,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),R(e,r,f,!1,!1)&&(p+=e.dump,o+=p));e.tag=i,e.dump="{"+o+"}"}function wo(e,r,n,o){var i="",u=e.tag,l=Object.keys(n),t,c,f,p,a,h;if(e.sortKeys===!0)l.sort();else if(typeof e.sortKeys=="function")l.sort(e.sortKeys);else if(e.sortKeys)throw new _("sortKeys must be a boolean or a function");for(t=0,c=l.length;t<c;t+=1)h="",(!o||i!=="")&&(h+=Ee(e,r)),f=l[t],p=n[f],e.replacer&&(p=e.replacer.call(n,f,p)),R(e,r+1,f,!0,!0,!0)&&(a=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,a&&(e.dump&&J===e.dump.charCodeAt(0)?h+="?":h+="? "),h+=e.dump,a&&(h+=Ee(e,r)),R(e,r+1,p,!0,a)&&(e.dump&&J===e.dump.charCodeAt(0)?h+=":":h+=": ",h+=e.dump,i+=h));e.tag=u,e.dump=i||"{}"}function pr(e,r,n){var o,i,u,l,t,c;for(i=n?e.explicitTypes:e.implicitTypes,u=0,l=i.length;u<l;u+=1)if(t=i[u],(t.instanceOf||t.predicate)&&(!t.instanceOf||typeof r=="object"&&r instanceof t.instanceOf)&&(!t.predicate||t.predicate(r))){if(n?t.multi&&t.representName?e.tag=t.representName(r):e.tag=t.tag:e.tag="?",t.represent){if(c=e.styleMap[t.tag]||t.defaultStyle,Ur.call(t.represent)==="[object Function]")o=t.represent(r,c);else if(Gr.call(t.represent,c))o=t.represent[c](r,c);else throw new _("!<"+t.tag+'> tag resolver accepts not "'+c+'" style');e.dump=o}return!0}return!1}function R(e,r,n,o,i,u,l){e.tag=null,e.dump=n,pr(e,n,!1)||pr(e,n,!0);var t=Ur.call(e.dump),c=o,f;o&&(o=e.flowLevel<0||e.flowLevel>r);var p=t==="[object Object]"||t==="[object Array]",a,h;if(p&&(a=e.duplicates.indexOf(n),h=a!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&r>0)&&(i=!1),h&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(p&&h&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),t==="[object Object]")o&&Object.keys(e.dump).length!==0?(wo(e,r,e.dump,i),h&&(e.dump="&ref_"+a+e.dump)):(Co(e,r,e.dump),h&&(e.dump="&ref_"+a+" "+e.dump));else if(t==="[object Array]")o&&e.dump.length!==0?(e.noArrayIndent&&!l&&r>0?ar(e,r-1,e.dump,i):ar(e,r,e.dump,i),h&&(e.dump="&ref_"+a+e.dump)):(bo(e,r,e.dump),h&&(e.dump="&ref_"+a+" "+e.dump));else if(t==="[object String]")e.tag!=="?"&&Ao(e,e.dump,r,u,c);else{if(t==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new _("unacceptable kind of an object to dump "+t)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function Eo(e,r){var n=[],o=[],i,u;for(Se(e,n,o),i=0,u=o.length;i<u;i+=1)r.duplicates.push(n[o[i]]);r.usedDuplicates=new Array(u)}function Se(e,r,n){var o,i,u;if(e!==null&&typeof e=="object")if(i=r.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(r.push(e),Array.isArray(e))for(i=0,u=e.length;i<u;i+=1)Se(e[i],r,n);else for(o=Object.keys(e),i=0,u=o.length;i<u;i+=1)Se(e[o[i]],r,n)}function _o(e,r){r=r||{};var n=new so(r);n.noRefs||Eo(e,n);var o=e;return n.replacer&&(o=n.replacer.call({"":o},"",o)),R(n,0,o,!0,!0)?n.dump+` `:""}var So=_o,Oo={dump:So};function ke(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var To=w,Fo=dr,Io=Ar,No=wr,ko=Er,Lo=Te,Ro=Hr.load,Mo=Hr.loadAll,Bo=Oo.dump,Do=_,jo={binary:Fr,float:Cr,map:xr,null:vr,pairs:Nr,set:kr,timestamp:Or,bool:yr,int:br,merge:Tr,omap:Ir,seq:gr,str:mr},Po=ke("safeLoad","load"),Yo=ke("safeLoadAll","loadAll"),Ho=ke("safeDump","dump"),Uo={Type:To,Schema:Fo,FAILSAFE_SCHEMA:Io,JSON_SCHEMA:No,CORE_SCHEMA:ko,DEFAULT_SCHEMA:Lo,load:Ro,loadAll:Mo,dump:Bo,YAMLException:Do,types:jo,safeLoad:Po,safeLoadAll:Yo,safeDump:Ho},Jr=Uo;var Go=e=>en.readFileSync(e,{encoding:"utf-8"}),Ko=(e,r)=>e.endsWith(".yml")||e.endsWith(".yaml")?Jr.load(r):JSON.parse(r),rn=e=>{let r;return r=Ko(e,Go(e)),X(r)?r:(I.error('File "'+e+'" must return a object'),!1)};var Wo=(e,r)=>{let n=!1;return e.forEach(o=>{r.forEach(i=>{let u="./"+o+i;Xe(u)&&(n=u)})}),n||!1},nn=(e,r)=>{let n=Wo(e,r);return n?rn(n):!1};var on=(e={})=>{let r;if(e.cmd=nn(e.fileNamesAllowed,e.extensionsAllowed),r=Qe(e),!r)return!1;I.info(`Script [${r.key}] executes [${r.value}] and returns:`),Re(r.value)};on(Le); /*! Bundled license information: js-yaml/dist/js-yaml.mjs: (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) */