pubo-node 1.0.149 → 1.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pubo-node.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["pubo-node"]=t():e["pubo-node"]=t()}(this,(()=>(()=>{var e={649:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=649,e.exports=t},1:e=>{"use strict";e.exports=require("cluster")},808:e=>{"use strict";e.exports=require("net")},453:(e,t,n)=>{"use strict";var r=n(487),s=n(314),i=n(359);const o={get binary(){return s.binaryOptions},set binary(e){Object.assign(s.binaryOptions,e)},get bool(){return s.boolOptions},set bool(e){Object.assign(s.boolOptions,e)},get int(){return s.intOptions},set int(e){Object.assign(s.intOptions,e)},get null(){return s.nullOptions},set null(e){Object.assign(s.nullOptions,e)},get str(){return s.strOptions},set str(e){Object.assign(s.strOptions,e)}},a={"1.0":{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:r.defaultTagPrefix},{handle:"!!",prefix:"tag:private.yaml.org,2002:"}]},1.1:{schema:"yaml-1.1",merge:!0,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:r.defaultTagPrefix}]},1.2:{schema:"core",merge:!1,tagPrefixes:[{handle:"!",prefix:"!"},{handle:"!!",prefix:r.defaultTagPrefix}]}};function c(e,t){if("1.0"===(e.version||e.options.version)){const e=t.match(/^tag:private\.yaml\.org,2002:([^:/]+)$/);if(e)return"!"+e[1];const n=t.match(/^tag:([a-zA-Z0-9-]+)\.yaml\.org,2002:(.*)/);return n?`!${n[1]}/${n[2]}`:`!${t.replace(/^tag:/,"")}`}let n=e.tagPrefixes.find((e=>0===t.indexOf(e.prefix)));if(!n){const r=e.getDefaults().tagPrefixes;n=r&&r.find((e=>0===t.indexOf(e.prefix)))}if(!n)return"!"===t[0]?t:`!<${t}>`;const r=t.substr(n.prefix.length).replace(/[!,[\]{}]/g,(e=>({"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"}[e])));return n.handle+r}function l(e,t,n,r){const{anchors:i,schema:o}=t.doc;let a;if(!(e instanceof s.Node)){const t={aliasNodes:[],onTagObj:e=>a=e,prevObjects:new Map};e=o.createNode(e,!0,null,t);for(const e of t.aliasNodes){e.source=e.source.node;let t=i.getName(e.source);t||(t=i.newName(),i.map[t]=e.source)}}if(e instanceof s.Pair)return e.toString(t,n,r);a||(a=function(e,t){if(t instanceof s.Alias)return s.Alias;if(t.tag){const n=e.filter((e=>e.tag===t.tag));if(n.length>0)return n.find((e=>e.format===t.format))||n[0]}let n,r;if(t instanceof s.Scalar){r=t.value;const s=e.filter((e=>e.identify&&e.identify(r)||e.class&&r instanceof e.class));n=s.find((e=>e.format===t.format))||s.find((e=>!e.format))}else r=t,n=e.find((e=>e.nodeClass&&r instanceof e.nodeClass));if(!n){const e=r&&r.constructor?r.constructor.name:typeof r;throw new Error(`Tag not resolved for ${e} value`)}return n}(o.tags,e));const l=function(e,t,{anchors:n,doc:r}){const s=[],i=r.anchors.getName(e);return i&&(n[i]=e,s.push(`&${i}`)),e.tag?s.push(c(r,e.tag)):t.default||s.push(c(r,t.tag)),s.join(" ")}(e,a,t);l.length>0&&(t.indentAtStart=(t.indentAtStart||0)+l.length+1);const u="function"==typeof a.stringify?a.stringify(e,t,n,r):e instanceof s.Scalar?s.stringifyString(e,t,n,r):e.toString(t,n,r);return l?e instanceof s.Scalar||"{"===u[0]||"["===u[0]?`${l} ${u}`:`${l}\n${t.indent}${u}`:u}class u{static validAnchorNode(e){return e instanceof s.Scalar||e instanceof s.YAMLSeq||e instanceof s.YAMLMap}constructor(e){r._defineProperty(this,"map",Object.create(null)),this.prefix=e}createAlias(e,t){return this.setAnchor(e,t),new s.Alias(e)}createMergePair(...e){const t=new s.Merge;return t.value.items=e.map((e=>{if(e instanceof s.Alias){if(e.source instanceof s.YAMLMap)return e}else if(e instanceof s.YAMLMap)return this.createAlias(e);throw new Error("Merge sources must be Map nodes or their Aliases")})),t}getName(e){const{map:t}=this;return Object.keys(t).find((n=>t[n]===e))}getNames(){return Object.keys(this.map)}getNode(e){return this.map[e]}newName(e){e||(e=this.prefix);const t=Object.keys(this.map);for(let n=1;;++n){const r=`${e}${n}`;if(!t.includes(r))return r}}resolveNodes(){const{map:e,_cstAliases:t}=this;Object.keys(e).forEach((t=>{e[t]=e[t].resolved})),t.forEach((e=>{e.source=e.source.resolved})),delete this._cstAliases}setAnchor(e,t){if(null!=e&&!u.validAnchorNode(e))throw new Error("Anchors may only be set for Scalar, Seq and Map nodes");if(t&&/[\x00-\x19\s,[\]{}]/.test(t))throw new Error("Anchor names must not contain whitespace or control characters");const{map:n}=this,r=e&&Object.keys(n).find((t=>n[t]===e));if(r){if(!t)return r;r!==t&&(delete n[r],n[t]=e)}else{if(!t){if(!e)return null;t=this.newName()}n[t]=e}return t}}const f=(e,t)=>{if(e&&"object"==typeof e){const{tag:n}=e;e instanceof s.Collection?(n&&(t[n]=!0),e.items.forEach((e=>f(e,t)))):e instanceof s.Pair?(f(e.key,t),f(e.value,t)):e instanceof s.Scalar&&n&&(t[n]=!0)}return t};function h({tagPrefixes:e},t){const[n,s]=t.parameters;if(!n||!s){const e="Insufficient parameters given for %TAG directive";throw new r.YAMLSemanticError(t,e)}if(e.some((e=>e.handle===n))){const e="The %TAG directive must only be given at most once per handle in the same document.";throw new r.YAMLSemanticError(t,e)}return{handle:n,prefix:s}}function p(e,t){let[n]=t.parameters;if("YAML:1.0"===t.name&&(n="1.0"),!n){const e="Insufficient parameters given for %YAML directive";throw new r.YAMLSemanticError(t,e)}if(!a[n]){const s=`Document will be parsed as YAML ${e.version||e.options.version} rather than YAML ${n}`;e.warnings.push(new r.YAMLWarning(t,s))}return n}function d(e){if(e instanceof s.Collection)return!0;throw new Error("Expected a YAML collection as document contents")}class g{constructor(e){this.anchors=new u(e.anchorPrefix),this.commentBefore=null,this.comment=null,this.contents=null,this.directivesEndMarker=null,this.errors=[],this.options=e,this.schema=null,this.tagPrefixes=[],this.version=null,this.warnings=[]}add(e){return d(this.contents),this.contents.add(e)}addIn(e,t){d(this.contents),this.contents.addIn(e,t)}delete(e){return d(this.contents),this.contents.delete(e)}deleteIn(e){return s.isEmptyPath(e)?null!=this.contents&&(this.contents=null,!0):(d(this.contents),this.contents.deleteIn(e))}getDefaults(){return g.defaults[this.version]||g.defaults[this.options.version]||{}}get(e,t){return this.contents instanceof s.Collection?this.contents.get(e,t):void 0}getIn(e,t){return s.isEmptyPath(e)?!t&&this.contents instanceof s.Scalar?this.contents.value:this.contents:this.contents instanceof s.Collection?this.contents.getIn(e,t):void 0}has(e){return this.contents instanceof s.Collection&&this.contents.has(e)}hasIn(e){return s.isEmptyPath(e)?void 0!==this.contents:this.contents instanceof s.Collection&&this.contents.hasIn(e)}set(e,t){d(this.contents),this.contents.set(e,t)}setIn(e,t){s.isEmptyPath(e)?this.contents=t:(d(this.contents),this.contents.setIn(e,t))}setSchema(e,t){if(!e&&!t&&this.schema)return;"number"==typeof e&&(e=e.toFixed(1)),"1.0"===e||"1.1"===e||"1.2"===e?(this.version?this.version=e:this.options.version=e,delete this.options.schema):e&&"string"==typeof e&&(this.options.schema=e),Array.isArray(t)&&(this.options.customTags=t);const n=Object.assign({},this.getDefaults(),this.options);this.schema=new i.Schema(n)}parse(e,t){this.options.keepCstNodes&&(this.cstNode=e),this.options.keepNodeTypes&&(this.type="DOCUMENT");const{directives:n=[],contents:i=[],directivesEndMarker:o,error:a,valueRange:c}=e;if(a&&(a.source||(a.source=this),this.errors.push(a)),function(e,t,n){const s=[];let i=!1;for(const n of t){const{comment:t,name:o}=n;switch(o){case"TAG":try{e.tagPrefixes.push(h(e,n))}catch(t){e.errors.push(t)}i=!0;break;case"YAML":case"YAML:1.0":if(e.version){const t="The %YAML directive must only be given at most once per document.";e.errors.push(new r.YAMLSemanticError(n,t))}try{e.version=p(e,n)}catch(t){e.errors.push(t)}i=!0;break;default:if(o){const t=`YAML only supports %TAG and %YAML directives, and not %${o}`;e.warnings.push(new r.YAMLWarning(n,t))}}t&&s.push(t)}if(n&&!i&&"1.1"===(e.version||n.version||e.options.version)){const t=({handle:e,prefix:t})=>({handle:e,prefix:t});e.tagPrefixes=n.tagPrefixes.map(t),e.version=n.version}e.commentBefore=s.join("\n")||null}(this,n,t),o&&(this.directivesEndMarker=!0),this.range=c?[c.start,c.end]:null,this.setSchema(),this.anchors._cstAliases=[],function(e,t){const n={before:[],after:[]};let i,o=!1;for(const a of t)if(a.valueRange){if(void 0!==i){const t="Document contains trailing content not separated by a ... or --- line";e.errors.push(new r.YAMLSyntaxError(a,t));break}const t=s.resolveNode(e,a);o&&(t.spaceBefore=!0,o=!1),i=t}else null!==a.comment?(void 0===i?n.before:n.after).push(a.comment):a.type===r.Type.BLANK_LINE&&(o=!0,void 0===i&&n.before.length>0&&!e.commentBefore&&(e.commentBefore=n.before.join("\n"),n.before=[]));if(e.contents=i||null,i){const t=n.before.join("\n");if(t){const e=i instanceof s.Collection&&i.items[0]?i.items[0]:i;e.commentBefore=e.commentBefore?`${t}\n${e.commentBefore}`:t}e.comment=n.after.join("\n")||null}else e.comment=n.before.concat(n.after).join("\n")||null}(this,i),this.anchors.resolveNodes(),this.options.prettyErrors){for(const e of this.errors)e instanceof r.YAMLError&&e.makePretty();for(const e of this.warnings)e instanceof r.YAMLError&&e.makePretty()}return this}listNonDefaultTags(){return(e=this.contents,Object.keys(f(e,{}))).filter((e=>0!==e.indexOf(i.Schema.defaultPrefix)));var e}setTagPrefix(e,t){if("!"!==e[0]||"!"!==e[e.length-1])throw new Error("Handle must start and end with !");if(t){const n=this.tagPrefixes.find((t=>t.handle===e));n?n.prefix=t:this.tagPrefixes.push({handle:e,prefix:t})}else this.tagPrefixes=this.tagPrefixes.filter((t=>t.handle!==e))}toJSON(e,t){const{keepBlobsInJSON:n,mapAsMap:r,maxAliasCount:i}=this.options,o=n&&("string"!=typeof e||!(this.contents instanceof s.Scalar)),a={doc:this,indentStep:" ",keep:o,mapAsMap:o&&!!r,maxAliasCount:i,stringify:l},c=Object.keys(this.anchors.map);c.length>0&&(a.anchors=new Map(c.map((e=>[this.anchors.map[e],{alias:[],aliasCount:0,count:1}]))));const u=s.toJSON(this.contents,e,a);if("function"==typeof t&&a.anchors)for(const{count:e,res:n}of a.anchors.values())t(n,e);return u}toString(){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");const e=this.options.indent;if(!Number.isInteger(e)||e<=0){const t=JSON.stringify(e);throw new Error(`"indent" option must be a positive integer, not ${t}`)}this.setSchema();const t=[];let n=!1;if(this.version){let e="%YAML 1.2";"yaml-1.1"===this.schema.name&&("1.0"===this.version?e="%YAML:1.0":"1.1"===this.version&&(e="%YAML 1.1")),t.push(e),n=!0}const r=this.listNonDefaultTags();this.tagPrefixes.forEach((({handle:e,prefix:s})=>{r.some((e=>0===e.indexOf(s)))&&(t.push(`%TAG ${e} ${s}`),n=!0)})),(n||this.directivesEndMarker)&&t.push("---"),this.commentBefore&&(!n&&this.directivesEndMarker||t.unshift(""),t.unshift(this.commentBefore.replace(/^/gm,"#")));const i={anchors:Object.create(null),doc:this,indent:"",indentStep:" ".repeat(e),stringify:l};let o=!1,a=null;if(this.contents){this.contents instanceof s.Node&&(this.contents.spaceBefore&&(n||this.directivesEndMarker)&&t.push(""),this.contents.commentBefore&&t.push(this.contents.commentBefore.replace(/^/gm,"#")),i.forceBlockIndent=!!this.comment,a=this.contents.comment);const e=a?null:()=>o=!0,r=l(this.contents,i,(()=>a=null),e);t.push(s.addComment(r,"",a))}else void 0!==this.contents&&t.push(l(this.contents,i));return this.comment&&(o&&!a||""===t[t.length-1]||t.push(""),t.push(this.comment.replace(/^/gm,"#"))),t.join("\n")+"\n"}}r._defineProperty(g,"defaults",a),t.Document=g,t.defaultOptions={anchorPrefix:"a",customTags:null,indent:2,indentSeq:!0,keepCstNodes:!1,keepNodeTypes:!0,keepBlobsInJSON:!0,mapAsMap:!1,maxAliasCount:100,prettyErrors:!1,simpleKeys:!1,version:"1.2"},t.scalarOptions=o},487:(e,t)=>{"use strict";const n={ANCHOR:"&",COMMENT:"#",TAG:"!",DIRECTIVES_END:"-",DOCUMENT_END:"."},r={ALIAS:"ALIAS",BLANK_LINE:"BLANK_LINE",BLOCK_FOLDED:"BLOCK_FOLDED",BLOCK_LITERAL:"BLOCK_LITERAL",COMMENT:"COMMENT",DIRECTIVE:"DIRECTIVE",DOCUMENT:"DOCUMENT",FLOW_MAP:"FLOW_MAP",FLOW_SEQ:"FLOW_SEQ",MAP:"MAP",MAP_KEY:"MAP_KEY",MAP_VALUE:"MAP_VALUE",PLAIN:"PLAIN",QUOTE_DOUBLE:"QUOTE_DOUBLE",QUOTE_SINGLE:"QUOTE_SINGLE",SEQ:"SEQ",SEQ_ITEM:"SEQ_ITEM"};function s(e){const t=[0];let n=e.indexOf("\n");for(;-1!==n;)n+=1,t.push(n),n=e.indexOf("\n",n);return t}function i(e){let t,n;return"string"==typeof e?(t=s(e),n=e):(Array.isArray(e)&&(e=e[0]),e&&e.context&&(e.lineStarts||(e.lineStarts=s(e.context.src)),t=e.lineStarts,n=e.context.src)),{lineStarts:t,src:n}}function o(e,t){if("number"!=typeof e||e<0)return null;const{lineStarts:n,src:r}=i(t);if(!n||!r||e>r.length)return null;for(let t=0;t<n.length;++t){const r=n[t];if(e<r)return{line:t,col:e-n[t-1]+1};if(e===r)return{line:t+1,col:1}}const s=n.length;return{line:s,col:e-n[s-1]+1}}class a{static copy(e){return new a(e.start,e.end)}constructor(e,t){this.start=e,this.end=t||e}isEmpty(){return"number"!=typeof this.start||!this.end||this.end<=this.start}setOrigRange(e,t){const{start:n,end:r}=this;if(0===e.length||r<=e[0])return this.origStart=n,this.origEnd=r,t;let s=t;for(;s<e.length&&!(e[s]>n);)++s;this.origStart=n+s;const i=s;for(;s<e.length&&!(e[s]>=r);)++s;return this.origEnd=r+s,i}}class c{static addStringTerminator(e,t,n){if("\n"===n[n.length-1])return n;const r=c.endOfWhiteSpace(e,t);return r>=e.length||"\n"===e[r]?n+"\n":n}static atDocumentBoundary(e,t,r){const s=e[t];if(!s)return!0;const i=e[t-1];if(i&&"\n"!==i)return!1;if(r){if(s!==r)return!1}else if(s!==n.DIRECTIVES_END&&s!==n.DOCUMENT_END)return!1;const o=e[t+1],a=e[t+2];if(o!==s||a!==s)return!1;const c=e[t+3];return!c||"\n"===c||"\t"===c||" "===c}static endOfIdentifier(e,t){let n=e[t];const r="<"===n,s=r?["\n","\t"," ",">"]:["\n","\t"," ","[","]","{","}",","];for(;n&&-1===s.indexOf(n);)n=e[t+=1];return r&&">"===n&&(t+=1),t}static endOfIndent(e,t){let n=e[t];for(;" "===n;)n=e[t+=1];return t}static endOfLine(e,t){let n=e[t];for(;n&&"\n"!==n;)n=e[t+=1];return t}static endOfWhiteSpace(e,t){let n=e[t];for(;"\t"===n||" "===n;)n=e[t+=1];return t}static startOfLine(e,t){let n=e[t-1];if("\n"===n)return t;for(;n&&"\n"!==n;)n=e[t-=1];return t+1}static endOfBlockIndent(e,t,n){const r=c.endOfIndent(e,n);if(r>n+t)return r;{const t=c.endOfWhiteSpace(e,r),n=e[t];if(!n||"\n"===n)return t}return null}static atBlank(e,t,n){const r=e[t];return"\n"===r||"\t"===r||" "===r||n&&!r}static nextNodeIsIndented(e,t,n){return!(!e||t<0)&&(t>0||n&&"-"===e)}static normalizeOffset(e,t){const n=e[t];return n?"\n"!==n&&"\n"===e[t-1]?t-1:c.endOfWhiteSpace(e,t):t}static foldNewline(e,t,n){let r=0,s=!1,i="",o=e[t+1];for(;" "===o||"\t"===o||"\n"===o;){switch(o){case"\n":r=0,t+=1,i+="\n";break;case"\t":r<=n&&(s=!0),t=c.endOfWhiteSpace(e,t+2)-1;break;case" ":r+=1,t+=1}o=e[t+1]}return i||(i=" "),o&&r<=n&&(s=!0),{fold:i,offset:t,error:s}}constructor(e,t,n){Object.defineProperty(this,"context",{value:n||null,writable:!0}),this.error=null,this.range=null,this.valueRange=null,this.props=t||[],this.type=e,this.value=null}getPropValue(e,t,n){if(!this.context)return null;const{src:r}=this.context,s=this.props[e];return s&&r[s.start]===t?r.slice(s.start+(n?1:0),s.end):null}get anchor(){for(let e=0;e<this.props.length;++e){const t=this.getPropValue(e,n.ANCHOR,!0);if(null!=t)return t}return null}get comment(){const e=[];for(let t=0;t<this.props.length;++t){const r=this.getPropValue(t,n.COMMENT,!0);null!=r&&e.push(r)}return e.length>0?e.join("\n"):null}commentHasRequiredWhitespace(e){const{src:t}=this.context;if(this.header&&e===this.header.end)return!1;if(!this.valueRange)return!1;const{end:n}=this.valueRange;return e!==n||c.atBlank(t,n-1)}get hasComment(){if(this.context){const{src:e}=this.context;for(let t=0;t<this.props.length;++t)if(e[this.props[t].start]===n.COMMENT)return!0}return!1}get hasProps(){if(this.context){const{src:e}=this.context;for(let t=0;t<this.props.length;++t)if(e[this.props[t].start]!==n.COMMENT)return!0}return!1}get includesTrailingLines(){return!1}get jsonLike(){return-1!==[r.FLOW_MAP,r.FLOW_SEQ,r.QUOTE_DOUBLE,r.QUOTE_SINGLE].indexOf(this.type)}get rangeAsLinePos(){if(!this.range||!this.context)return;const e=o(this.range.start,this.context.root);return e?{start:e,end:o(this.range.end,this.context.root)}:void 0}get rawValue(){if(!this.valueRange||!this.context)return null;const{start:e,end:t}=this.valueRange;return this.context.src.slice(e,t)}get tag(){for(let e=0;e<this.props.length;++e){const t=this.getPropValue(e,n.TAG,!1);if(null!=t){if("<"===t[1])return{verbatim:t.slice(2,-1)};{const[e,n,r]=t.match(/^(.*!)([^!]*)$/);return{handle:n,suffix:r}}}}return null}get valueRangeContainsNewline(){if(!this.valueRange||!this.context)return!1;const{start:e,end:t}=this.valueRange,{src:n}=this.context;for(let r=e;r<t;++r)if("\n"===n[r])return!0;return!1}parseComment(e){const{src:t}=this.context;if(t[e]===n.COMMENT){const n=c.endOfLine(t,e+1),r=new a(e,n);return this.props.push(r),n}return e}setOrigRanges(e,t){return this.range&&(t=this.range.setOrigRange(e,t)),this.valueRange&&this.valueRange.setOrigRange(e,t),this.props.forEach((n=>n.setOrigRange(e,t))),t}toString(){const{context:{src:e},range:t,value:n}=this;if(null!=n)return n;const r=e.slice(t.start,t.end);return c.addStringTerminator(e,t.end,r)}}class l extends Error{constructor(e,t,n){if(!(n&&t instanceof c))throw new Error(`Invalid arguments for new ${e}`);super(),this.name=e,this.message=n,this.source=t}makePretty(){if(!this.source)return;this.nodeType=this.source.type;const e=this.source.context&&this.source.context.root;if("number"==typeof this.offset){this.range=new a(this.offset,this.offset+1);const t=e&&o(this.offset,e);if(t){const e={line:t.line,col:t.col+1};this.linePos={start:t,end:e}}delete this.offset}else this.range=this.source.range,this.linePos=this.source.rangeAsLinePos;if(this.linePos){const{line:t,col:n}=this.linePos.start;this.message+=` at line ${t}, column ${n}`;const r=e&&function({start:e,end:t},n,r=80){let s=function(e,t){const{lineStarts:n,src:r}=i(t);if(!n||!(e>=1)||e>n.length)return null;const s=n[e-1];let o=n[e];for(;o&&o>s&&"\n"===r[o-1];)--o;return r.slice(s,o)}(e.line,n);if(!s)return null;let{col:o}=e;if(s.length>r)if(o<=r-10)s=s.substr(0,r-1)+"…";else{const e=Math.round(r/2);s.length>o+e&&(s=s.substr(0,o+e-1)+"…"),o-=s.length-r,s="…"+s.substr(1-r)}let a=1,c="";return t&&(t.line===e.line&&o+(t.col-e.col)<=r+1?a=t.col-e.col:(a=Math.min(s.length+1,r)-o,c="…")),`${s}\n${o>1?" ".repeat(o-1):""}${"^".repeat(a)}${c}`}(this.linePos,e);r&&(this.message+=`:\n\n${r}\n`)}delete this.source}}class u extends l{constructor(e,t){super("YAMLSemanticError",e,t)}}class f extends c{static endOfLine(e,t,n){let r=e[t],s=t;for(;r&&"\n"!==r&&(!n||"["!==r&&"]"!==r&&"{"!==r&&"}"!==r&&","!==r);){const t=e[s+1];if(":"===r&&(!t||"\n"===t||"\t"===t||" "===t||n&&","===t))break;if((" "===r||"\t"===r)&&"#"===t)break;s+=1,r=t}return s}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:t}=this.valueRange;const{src:n}=this.context;let r=n[t-1];for(;e<t&&("\n"===r||"\t"===r||" "===r);)r=n[--t-1];let s="";for(let r=e;r<t;++r){const e=n[r];if("\n"===e){const{fold:e,offset:t}=c.foldNewline(n,r,-1);s+=e,r=t}else if(" "===e||"\t"===e){const i=r;let o=n[r+1];for(;r<t&&(" "===o||"\t"===o);)r+=1,o=n[r+1];"\n"!==o&&(s+=r>i?n.slice(i,r+1):e)}else s+=e}const i=n[e];switch(i){case"\t":return{errors:[new u(this,"Plain value cannot start with a tab character")],str:s};case"@":case"`":return{errors:[new u(this,`Plain value cannot start with reserved character ${i}`)],str:s};default:return s}}parseBlockValue(e){const{indent:t,inFlow:n,src:r}=this.context;let s=e,i=e;for(let e=r[s];"\n"===e&&!c.atDocumentBoundary(r,s+1);e=r[s]){const e=c.endOfBlockIndent(r,t,s+1);if(null===e||"#"===r[e])break;"\n"===r[e]?s=e:(i=f.endOfLine(r,e,n),s=i)}return this.valueRange.isEmpty()&&(this.valueRange.start=e),this.valueRange.end=i,i}parse(e,t){this.context=e;const{inFlow:n,src:r}=e;let s=t;const i=r[s];return i&&"#"!==i&&"\n"!==i&&(s=f.endOfLine(r,t,n)),this.valueRange=new a(t,s),s=c.endOfWhiteSpace(r,s),s=this.parseComment(s),this.hasComment&&!this.valueRange.isEmpty()||(s=this.parseBlockValue(s)),s}}t.Char=n,t.Node=c,t.PlainValue=f,t.Range=a,t.Type=r,t.YAMLError=l,t.YAMLReferenceError=class extends l{constructor(e,t){super("YAMLReferenceError",e,t)}},t.YAMLSemanticError=u,t.YAMLSyntaxError=class extends l{constructor(e,t){super("YAMLSyntaxError",e,t)}},t.YAMLWarning=class extends l{constructor(e,t){super("YAMLWarning",e,t)}},t._defineProperty=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},t.defaultTagPrefix="tag:yaml.org,2002:",t.defaultTags={MAP:"tag:yaml.org,2002:map",SEQ:"tag:yaml.org,2002:seq",STR:"tag:yaml.org,2002:str"}},359:(e,t,n)=>{"use strict";var r=n(487),s=n(314),i=n(125);const o={createNode:function(e,t,n){const r=new s.YAMLMap(e);if(t instanceof Map)for(const[s,i]of t)r.items.push(e.createPair(s,i,n));else if(t&&"object"==typeof t)for(const s of Object.keys(t))r.items.push(e.createPair(s,t[s],n));return"function"==typeof e.sortMapEntries&&r.items.sort(e.sortMapEntries),r},default:!0,nodeClass:s.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:s.resolveMap},a={createNode:function(e,t,n){const r=new s.YAMLSeq(e);if(t&&t[Symbol.iterator])for(const s of t){const t=e.createNode(s,n.wrapScalars,null,n);r.items.push(t)}return r},default:!0,nodeClass:s.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:s.resolveSeq},c={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:s.resolveString,stringify:(e,t,n,r)=>(t=Object.assign({actualString:!0},t),s.stringifyString(e,t,n,r)),options:s.strOptions},l=[o,a,c],u=e=>"bigint"==typeof e||Number.isInteger(e),f=(e,t,n)=>s.intOptions.asBigInt?BigInt(e):parseInt(t,n);function h(e,t,n){const{value:r}=e;return u(r)&&r>=0?n+r.toString(t):s.stringifyNumber(e)}const p={identify:e=>null==e,createNode:(e,t,n)=>n.wrapScalars?new s.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:s.nullOptions,stringify:()=>s.nullOptions.nullStr},d={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>"t"===e[0]||"T"===e[0],options:s.boolOptions,stringify:({value:e})=>e?s.boolOptions.trueStr:s.boolOptions.falseStr},g={identify:e=>u(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o([0-7]+)$/,resolve:(e,t)=>f(e,t,8),options:s.intOptions,stringify:e=>h(e,8,"0o")},m={identify:u,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:e=>f(e,e,10),options:s.intOptions,stringify:s.stringifyNumber},y={identify:e=>u(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x([0-9a-fA-F]+)$/,resolve:(e,t)=>f(e,t,16),options:s.intOptions,stringify:e=>h(e,16,"0x")},v={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(e,t)=>t?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:s.stringifyNumber},b={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify:({value:e})=>Number(e).toExponential()},w={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.([0-9]+)|[0-9]+\.([0-9]*))$/,resolve(e,t,n){const r=t||n,i=new s.Scalar(parseFloat(e));return r&&"0"===r[r.length-1]&&(i.minFractionDigits=r.length),i},stringify:s.stringifyNumber},S=l.concat([p,d,g,m,y,v,b,w]),E=e=>"bigint"==typeof e||Number.isInteger(e),O=({value:e})=>JSON.stringify(e),N=[o,a,{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:s.resolveString,stringify:O},{identify:e=>null==e,createNode:(e,t,n)=>n.wrapScalars?new s.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:O},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:O},{identify:E,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:e=>s.intOptions.asBigInt?BigInt(e):parseInt(e,10),stringify:({value:e})=>E(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:O}];N.scalarFallback=e=>{throw new SyntaxError(`Unresolved plain scalar ${JSON.stringify(e)}`)};const L=({value:e})=>e?s.boolOptions.trueStr:s.boolOptions.falseStr,A=e=>"bigint"==typeof e||Number.isInteger(e);function T(e,t,n){let r=t.replace(/_/g,"");if(s.intOptions.asBigInt){switch(n){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`}const t=BigInt(r);return"-"===e?BigInt(-1)*t:t}const i=parseInt(r,n);return"-"===e?-1*i:i}function M(e,t,n){const{value:r}=e;if(A(r)){const e=r.toString(t);return r<0?"-"+n+e.substr(1):n+e}return s.stringifyNumber(e)}const x=l.concat([{identify:e=>null==e,createNode:(e,t,n)=>n.wrapScalars?new s.Scalar(null):null,default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>null,options:s.nullOptions,stringify:()=>s.nullOptions.nullStr},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>!0,options:s.boolOptions,stringify:L},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>!1,options:s.boolOptions,stringify:L},{identify:A,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^([-+]?)0b([0-1_]+)$/,resolve:(e,t,n)=>T(t,n,2),stringify:e=>M(e,2,"0b")},{identify:A,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^([-+]?)0([0-7_]+)$/,resolve:(e,t,n)=>T(t,n,8),stringify:e=>M(e,8,"0")},{identify:A,default:!0,tag:"tag:yaml.org,2002:int",test:/^([-+]?)([0-9][0-9_]*)$/,resolve:(e,t,n)=>T(t,n,10),stringify:s.stringifyNumber},{identify:A,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^([-+]?)0x([0-9a-fA-F_]+)$/,resolve:(e,t,n)=>T(t,n,16),stringify:e=>M(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.inf|(\.nan))$/i,resolve:(e,t)=>t?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:s.stringifyNumber},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?([0-9][0-9_]*)?(\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify:({value:e})=>Number(e).toExponential()},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.([0-9_]*)$/,resolve(e,t){const n=new s.Scalar(parseFloat(e.replace(/_/g,"")));if(t){const e=t.replace(/_/g,"");"0"===e[e.length-1]&&(n.minFractionDigits=e.length)}return n},stringify:s.stringifyNumber}],i.binary,i.omap,i.pairs,i.set,i.intTime,i.floatTime,i.timestamp),k={core:S,failsafe:l,json:N,yaml11:x},P={binary:i.binary,bool:d,float:w,floatExp:b,floatNaN:v,floatTime:i.floatTime,int:m,intHex:y,intOct:g,intTime:i.intTime,map:o,null:p,omap:i.omap,pairs:i.pairs,seq:a,set:i.set,timestamp:i.timestamp};const I=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class C{constructor({customTags:e,merge:t,schema:n,sortMapEntries:r,tags:s}){this.merge=!!t,this.name=n,this.sortMapEntries=!0===r?I:r||null,!e&&s&&i.warnOptionDeprecation("tags","customTags"),this.tags=function(e,t,n,r){let s=e[r.replace(/\W/g,"")];if(!s){const t=Object.keys(e).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown schema "${r}"; use one of ${t}`)}if(Array.isArray(n))for(const e of n)s=s.concat(e);else"function"==typeof n&&(s=n(s.slice()));for(let e=0;e<s.length;++e){const n=s[e];if("string"==typeof n){const r=t[n];if(!r){const e=Object.keys(t).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${n}"; use one of ${e}`)}s[e]=r}}return s}(k,P,e||s,n)}createNode(e,t,n,r){const i={defaultPrefix:C.defaultPrefix,schema:this,wrapScalars:t};return function(e,t,n){if(e instanceof s.Node)return e;const{defaultPrefix:r,onTagObj:i,prevObjects:c,schema:l,wrapScalars:u}=n;t&&t.startsWith("!!")&&(t=r+t.slice(2));let f=function(e,t,n){if(t){const e=n.filter((e=>e.tag===t)),r=e.find((e=>!e.format))||e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find((t=>(t.identify&&t.identify(e)||t.class&&e instanceof t.class)&&!t.format))}(e,t,l.tags);if(!f){if("function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e)return u?new s.Scalar(e):e;f=e instanceof Map?o:e[Symbol.iterator]?a:o}i&&(i(f),delete n.onTagObj);const h={value:void 0,node:void 0};if(e&&"object"==typeof e&&c){const t=c.get(e);if(t){const e=new s.Alias(t);return n.aliasNodes.push(e),e}h.value=e,c.set(e,h)}return h.node=f.createNode?f.createNode(n.schema,e,n):u?new s.Scalar(e):e,t&&h.node instanceof s.Node&&(h.node.tag=t),h.node}(e,n,r?Object.assign(r,i):i)}createPair(e,t,n){n||(n={wrapScalars:!0});const r=this.createNode(e,n.wrapScalars,null,n),i=this.createNode(t,n.wrapScalars,null,n);return new s.Pair(r,i)}}r._defineProperty(C,"defaultPrefix",r.defaultTagPrefix),r._defineProperty(C,"defaultTags",r.defaultTags),t.Schema=C},667:(e,t,n)=>{"use strict";var r=n(24),s=n(453),i=n(359),o=n(487),a=n(125);n(314);class c extends s.Document{constructor(e){super(Object.assign({},s.defaultOptions,e))}}function l(e,t){const n=r.parse(e),s=new c(t).parse(n[0]);if(n.length>1){const e="Source contains multiple documents; please use YAML.parseAllDocuments()";s.errors.unshift(new o.YAMLSemanticError(n[1],e))}return s}const u={createNode:function(e,t=!0,n){void 0===n&&"string"==typeof t&&(n=t,t=!0);const r=Object.assign({},s.Document.defaults[s.defaultOptions.version],s.defaultOptions);return new i.Schema(r).createNode(e,t,n)},defaultOptions:s.defaultOptions,Document:c,parse:function(e,t){const n=l(e,t);if(n.warnings.forEach((e=>a.warn(e))),n.errors.length>0)throw n.errors[0];return n.toJSON()},parseAllDocuments:function(e,t){const n=[];let s;for(const i of r.parse(e)){const e=new c(t);e.parse(i,s),n.push(e),s=e}return n},parseCST:r.parse,parseDocument:l,scalarOptions:s.scalarOptions,stringify:function(e,t){const n=new c(t);return n.contents=e,String(n)}};t.YAML=u},24:(e,t,n)=>{"use strict";var r=n(487);class s extends r.Node{constructor(){super(r.Type.BLANK_LINE)}get includesTrailingLines(){return!0}parse(e,t){return this.context=e,this.range=new r.Range(t,t+1),t+1}}class i extends r.Node{constructor(e,t){super(e,t),this.node=null}get includesTrailingLines(){return!!this.node&&this.node.includesTrailingLines}parse(e,t){this.context=e;const{parseNode:n,src:i}=e;let{atLineStart:o,lineStart:a}=e;o||this.type!==r.Type.SEQ_ITEM||(this.error=new r.YAMLSemanticError(this,"Sequence items must not have preceding content on the same line"));const c=o?t-a:e.indent;let l=r.Node.endOfWhiteSpace(i,t+1),u=i[l];const f="#"===u,h=[];let p=null;for(;"\n"===u||"#"===u;){if("#"===u){const e=r.Node.endOfLine(i,l+1);h.push(new r.Range(l,e)),l=e}else o=!0,a=l+1,"\n"===i[r.Node.endOfWhiteSpace(i,a)]&&0===h.length&&(p=new s,a=p.parse({src:i},a)),l=r.Node.endOfIndent(i,a);u=i[l]}if(r.Node.nextNodeIsIndented(u,l-(a+c),this.type!==r.Type.SEQ_ITEM)?this.node=n({atLineStart:o,inCollection:!1,indent:c,lineStart:a,parent:this},l):u&&a>t+1&&(l=a-1),this.node){if(p){const t=e.parent.items||e.parent.contents;t&&t.push(p)}h.length&&Array.prototype.push.apply(this.props,h),l=this.node.range.end}else if(f){const e=h[0];this.props.push(e),l=e.end}else l=r.Node.endOfLine(i,t+1);const d=this.node?this.node.valueRange.end:l;return this.valueRange=new r.Range(t,d),l}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.node?this.node.setOrigRanges(e,t):t}toString(){const{context:{src:e},node:t,range:n,value:s}=this;if(null!=s)return s;const i=t?e.slice(n.start,t.range.start)+String(t):e.slice(n.start,n.end);return r.Node.addStringTerminator(e,n.end,i)}}class o extends r.Node{constructor(){super(r.Type.COMMENT)}parse(e,t){this.context=e;const n=this.parseComment(t);return this.range=new r.Range(t,n),n}}function a(e){let t=e;for(;t instanceof i;)t=t.node;if(!(t instanceof c))return null;const n=t.items.length;let s=-1;for(let e=n-1;e>=0;--e){const n=t.items[e];if(n.type===r.Type.COMMENT){const{indent:t,lineStart:r}=n.context;if(t>0&&n.range.start>=r+t)break;s=e}else{if(n.type!==r.Type.BLANK_LINE)break;s=e}}if(-1===s)return null;const o=t.items.splice(s,n-s),a=o[0].range.start;for(;t.range.end=a,t.valueRange&&t.valueRange.end>a&&(t.valueRange.end=a),t!==e;)t=t.context.parent;return o}class c extends r.Node{static nextContentHasIndent(e,t,n){const s=r.Node.endOfLine(e,t)+1,i=e[t=r.Node.endOfWhiteSpace(e,s)];return!!i&&(t>=s+n||("#"===i||"\n"===i)&&c.nextContentHasIndent(e,t,n))}constructor(e){super(e.type===r.Type.SEQ_ITEM?r.Type.SEQ:r.Type.MAP);for(let t=e.props.length-1;t>=0;--t)if(e.props[t].start<e.context.lineStart){this.props=e.props.slice(0,t+1),e.props=e.props.slice(t+1);const n=e.props[0]||e.valueRange;e.range.start=n.start;break}this.items=[e];const t=a(e);t&&Array.prototype.push.apply(this.items,t)}get includesTrailingLines(){return this.items.length>0}parse(e,t){this.context=e;const{parseNode:n,src:i}=e;let l=r.Node.startOfLine(i,t);const u=this.items[0];u.context.parent=this,this.valueRange=r.Range.copy(u.valueRange);const f=u.range.start-u.context.lineStart;let h=t;h=r.Node.normalizeOffset(i,h);let p=i[h],d=r.Node.endOfWhiteSpace(i,l)===h,g=!1;for(;p;){for(;"\n"===p||"#"===p;){if(d&&"\n"===p&&!g){const e=new s;if(h=e.parse({src:i},h),this.valueRange.end=h,h>=i.length){p=null;break}this.items.push(e),h-=1}else if("#"===p){if(h<l+f&&!c.nextContentHasIndent(i,h,f))return h;const e=new o;if(h=e.parse({indent:f,lineStart:l,src:i},h),this.items.push(e),this.valueRange.end=h,h>=i.length){p=null;break}}if(l=h+1,h=r.Node.endOfIndent(i,l),r.Node.atBlank(i,h)){const e=r.Node.endOfWhiteSpace(i,h),t=i[e];t&&"\n"!==t&&"#"!==t||(h=e)}p=i[h],d=!0}if(!p)break;if(h!==l+f&&(d||":"!==p)){if(h<l+f){l>t&&(h=l);break}if(!this.error){const e="All collection items must start at the same column";this.error=new r.YAMLSyntaxError(this,e)}}if(u.type===r.Type.SEQ_ITEM){if("-"!==p){l>t&&(h=l);break}}else if("-"===p&&!this.error){const e=i[h+1];if(!e||"\n"===e||"\t"===e||" "===e){const e="A collection cannot be both a mapping and a sequence";this.error=new r.YAMLSyntaxError(this,e)}}const e=n({atLineStart:d,inCollection:!0,indent:f,lineStart:l,parent:this},h);if(!e)return h;if(this.items.push(e),this.valueRange.end=e.valueRange.end,h=r.Node.normalizeOffset(i,e.range.end),p=i[h],d=!1,g=e.includesTrailingLines,p){let e=h-1,t=i[e];for(;" "===t||"\t"===t;)t=i[--e];"\n"===t&&(l=e+1,d=!0)}const m=a(e);m&&Array.prototype.push.apply(this.items,m)}return h}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.items.forEach((n=>{t=n.setOrigRanges(e,t)})),t}toString(){const{context:{src:e},items:t,range:n,value:s}=this;if(null!=s)return s;let i=e.slice(n.start,t[0].range.start)+String(t[0]);for(let e=1;e<t.length;++e){const n=t[e],{atLineStart:r,indent:s}=n.context;if(r)for(let e=0;e<s;++e)i+=" ";i+=String(n)}return r.Node.addStringTerminator(e,n.end,i)}}class l extends r.Node{constructor(){super(r.Type.DIRECTIVE),this.name=null}get parameters(){const e=this.rawValue;return e?e.trim().split(/[ \t]+/):[]}parseName(e){const{src:t}=this.context;let n=e,r=t[n];for(;r&&"\n"!==r&&"\t"!==r&&" "!==r;)r=t[n+=1];return this.name=t.slice(e,n),n}parseParameters(e){const{src:t}=this.context;let n=e,s=t[n];for(;s&&"\n"!==s&&"#"!==s;)s=t[n+=1];return this.valueRange=new r.Range(e,n),n}parse(e,t){this.context=e;let n=this.parseName(t+1);return n=this.parseParameters(n),n=this.parseComment(n),this.range=new r.Range(t,n),n}}class u extends r.Node{static startCommentOrEndBlankLine(e,t){const n=r.Node.endOfWhiteSpace(e,t),s=e[n];return"#"===s||"\n"===s?n:t}constructor(){super(r.Type.DOCUMENT),this.directives=null,this.contents=null,this.directivesEndMarker=null,this.documentEndMarker=null}parseDirectives(e){const{src:t}=this.context;this.directives=[];let n=!0,i=!1,a=e;for(;!r.Node.atDocumentBoundary(t,a,r.Char.DIRECTIVES_END);)switch(a=u.startCommentOrEndBlankLine(t,a),t[a]){case"\n":if(n){const e=new s;a=e.parse({src:t},a),a<t.length&&this.directives.push(e)}else a+=1,n=!0;break;case"#":{const e=new o;a=e.parse({src:t},a),this.directives.push(e),n=!1}break;case"%":{const e=new l;a=e.parse({parent:this,src:t},a),this.directives.push(e),i=!0,n=!1}break;default:return i?this.error=new r.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),a}return t[a]?(this.directivesEndMarker=new r.Range(a,a+3),a+3):(i?this.error=new r.YAMLSemanticError(this,"Missing directives-end indicator line"):this.directives.length>0&&(this.contents=this.directives,this.directives=[]),a)}parseContents(e){const{parseNode:t,src:n}=this.context;this.contents||(this.contents=[]);let i=e;for(;"-"===n[i-1];)i-=1;let c=r.Node.endOfWhiteSpace(n,e),l=i===e;for(this.valueRange=new r.Range(c);!r.Node.atDocumentBoundary(n,c,r.Char.DOCUMENT_END);){switch(n[c]){case"\n":if(l){const e=new s;c=e.parse({src:n},c),c<n.length&&this.contents.push(e)}else c+=1,l=!0;i=c;break;case"#":{const e=new o;c=e.parse({src:n},c),this.contents.push(e),l=!1}break;default:{const e=r.Node.endOfIndent(n,c),s=t({atLineStart:l,indent:-1,inFlow:!1,inCollection:!1,lineStart:i,parent:this},e);if(!s)return this.valueRange.end=e;this.contents.push(s),c=s.range.end,l=!1;const o=a(s);o&&Array.prototype.push.apply(this.contents,o)}}c=u.startCommentOrEndBlankLine(n,c)}if(this.valueRange.end=c,n[c]&&(this.documentEndMarker=new r.Range(c,c+3),c+=3,n[c])){if(c=r.Node.endOfWhiteSpace(n,c),"#"===n[c]){const e=new o;c=e.parse({src:n},c),this.contents.push(e)}switch(n[c]){case"\n":c+=1;break;case void 0:break;default:this.error=new r.YAMLSyntaxError(this,"Document end marker line cannot have a non-comment suffix")}}return c}parse(e,t){e.root=this,this.context=e;const{src:n}=e;let r=65279===n.charCodeAt(t)?t+1:t;return r=this.parseDirectives(r),r=this.parseContents(r),r}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.directives.forEach((n=>{t=n.setOrigRanges(e,t)})),this.directivesEndMarker&&(t=this.directivesEndMarker.setOrigRange(e,t)),this.contents.forEach((n=>{t=n.setOrigRanges(e,t)})),this.documentEndMarker&&(t=this.documentEndMarker.setOrigRange(e,t)),t}toString(){const{contents:e,directives:t,value:n}=this;if(null!=n)return n;let s=t.join("");return e.length>0&&((t.length>0||e[0].type===r.Type.COMMENT)&&(s+="---\n"),s+=e.join("")),"\n"!==s[s.length-1]&&(s+="\n"),s}}class f extends r.Node{parse(e,t){this.context=e;const{src:n}=e;let s=r.Node.endOfIdentifier(n,t+1);return this.valueRange=new r.Range(t+1,s),s=r.Node.endOfWhiteSpace(n,s),s=this.parseComment(s),s}}const h="KEEP",p="STRIP";class d extends r.Node{constructor(e,t){super(e,t),this.blockIndent=null,this.chomping="CLIP",this.header=null}get includesTrailingLines(){return this.chomping===h}get strValue(){if(!this.valueRange||!this.context)return null;let{start:e,end:t}=this.valueRange;const{indent:n,src:s}=this.context;if(this.valueRange.isEmpty())return"";let i=null,o=s[t-1];for(;"\n"===o||"\t"===o||" "===o;){if(t-=1,t<=e){if(this.chomping===h)break;return""}"\n"===o&&(i=t),o=s[t-1]}let a=t+1;i&&(this.chomping===h?(a=i,t=this.valueRange.end):t=i);const c=n+this.blockIndent,l=this.type===r.Type.BLOCK_FOLDED;let u=!0,f="",d="",g=!1;for(let n=e;n<t;++n){for(let e=0;e<c&&" "===s[n];++e)n+=1;const e=s[n];if("\n"===e)"\n"===d?f+="\n":d="\n";else{const i=r.Node.endOfLine(s,n),o=s.slice(n,i);n=i,l&&(" "===e||"\t"===e)&&n<a?(" "===d?d="\n":g||u||"\n"!==d||(d="\n\n"),f+=d+o,d=i<t&&s[i]||"",g=!0):(f+=d+o,d=l&&n<a?" ":"\n",g=!1),u&&""!==o&&(u=!1)}}return this.chomping===p?f:f+"\n"}parseBlockHeader(e){const{src:t}=this.context;let n=e+1,s="";for(;;){const i=t[n];switch(i){case"-":this.chomping=p;break;case"+":this.chomping=h;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":s+=i;break;default:return this.blockIndent=Number(s)||null,this.header=new r.Range(e,n),n}n+=1}}parseBlockValue(e){const{indent:t,src:n}=this.context,s=!!this.blockIndent;let i=e,o=e,a=1;for(let e=n[i];"\n"===e&&(i+=1,!r.Node.atDocumentBoundary(n,i));e=n[i]){const e=r.Node.endOfBlockIndent(n,t,i);if(null===e)break;const c=n[e],l=e-(i+t);if(this.blockIndent){if(c&&"\n"!==c&&l<this.blockIndent){if("#"===n[e])break;if(!this.error){const e="Block scalars must not be less indented than their "+(s?"explicit indentation indicator":"first line");this.error=new r.YAMLSemanticError(this,e)}}}else if("\n"!==n[e]){if(l<a){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";this.error=new r.YAMLSemanticError(this,e)}this.blockIndent=l}else l>a&&(a=l);i="\n"===n[e]?e:o=r.Node.endOfLine(n,e)}return this.chomping!==h&&(i=n[o]?o+1:o),this.valueRange=new r.Range(e+1,i),i}parse(e,t){this.context=e;const{src:n}=e;let s=this.parseBlockHeader(t);return s=r.Node.endOfWhiteSpace(n,s),s=this.parseComment(s),s=this.parseBlockValue(s),s}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.header?this.header.setOrigRange(e,t):t}}class g extends r.Node{constructor(e,t){super(e,t),this.items=null}prevNodeIsJsonLike(e=this.items.length){const t=this.items[e-1];return!!t&&(t.jsonLike||t.type===r.Type.COMMENT&&this.prevNodeIsJsonLike(e-1))}parse(e,t){this.context=e;const{parseNode:n,src:i}=e;let{indent:a,lineStart:c}=e,l=i[t];this.items=[{char:l,offset:t}];let u=r.Node.endOfWhiteSpace(i,t+1);for(l=i[u];l&&"]"!==l&&"}"!==l;){switch(l){case"\n":if(c=u+1,"\n"===i[r.Node.endOfWhiteSpace(i,c)]){const e=new s;c=e.parse({src:i},c),this.items.push(e)}if(u=r.Node.endOfIndent(i,c),u<=c+a&&(l=i[u],u<c+a||"]"!==l&&"}"!==l)){const e="Insufficient indentation in flow collection";this.error=new r.YAMLSemanticError(this,e)}break;case",":this.items.push({char:l,offset:u}),u+=1;break;case"#":{const e=new o;u=e.parse({src:i},u),this.items.push(e)}break;case"?":case":":{const e=i[u+1];if("\n"===e||"\t"===e||" "===e||","===e||":"===l&&this.prevNodeIsJsonLike()){this.items.push({char:l,offset:u}),u+=1;break}}default:{const e=n({atLineStart:!1,inCollection:!1,inFlow:!0,indent:-1,lineStart:c,parent:this},u);if(!e)return this.valueRange=new r.Range(t,u),u;this.items.push(e),u=r.Node.normalizeOffset(i,e.range.end)}}u=r.Node.endOfWhiteSpace(i,u),l=i[u]}return this.valueRange=new r.Range(t,u+1),l&&(this.items.push({char:l,offset:u}),u=r.Node.endOfWhiteSpace(i,u+1),u=this.parseComment(u)),u}setOrigRanges(e,t){return t=super.setOrigRanges(e,t),this.items.forEach((n=>{if(n instanceof r.Node)t=n.setOrigRanges(e,t);else if(0===e.length)n.origOffset=n.offset;else{let r=t;for(;r<e.length&&!(e[r]>n.offset);)++r;n.origOffset=n.offset+r,t=r}})),t}toString(){const{context:{src:e},items:t,range:n,value:s}=this;if(null!=s)return s;const i=t.filter((e=>e instanceof r.Node));let o="",a=n.start;return i.forEach((t=>{const n=e.slice(a,t.range.start);a=t.range.end,o+=n+String(t),"\n"===o[o.length-1]&&"\n"!==e[a-1]&&"\n"===e[a]&&(a+=1)})),o+=e.slice(a,n.end),r.Node.addStringTerminator(e,n.end,o)}}class m extends r.Node{static endOfQuote(e,t){let n=e[t];for(;n&&'"'!==n;)n=e[t+="\\"===n?2:1];return t+1}get strValue(){if(!this.valueRange||!this.context)return null;const e=[],{start:t,end:n}=this.valueRange,{indent:s,src:i}=this.context;'"'!==i[n-1]&&e.push(new r.YAMLSyntaxError(this,'Missing closing "quote'));let o="";for(let a=t+1;a<n-1;++a){const t=i[a];if("\n"===t){r.Node.atDocumentBoundary(i,a+1)&&e.push(new r.YAMLSemanticError(this,"Document boundary indicators are not allowed within string values"));const{fold:t,offset:n,error:c}=r.Node.foldNewline(i,a,s);o+=t,a=n,c&&e.push(new r.YAMLSemanticError(this,"Multi-line double-quoted string needs to be sufficiently indented"))}else if("\\"===t)switch(a+=1,i[a]){case"0":o+="\0";break;case"a":o+="";break;case"b":o+="\b";break;case"e":o+="";break;case"f":o+="\f";break;case"n":o+="\n";break;case"r":o+="\r";break;case"t":case"\t":o+="\t";break;case"v":o+="\v";break;case"N":o+="
";break;case"_":o+=" ";break;case"L":o+="\u2028";break;case"P":o+="\u2029";break;case" ":o+=" ";break;case'"':o+='"';break;case"/":o+="/";break;case"\\":o+="\\";break;case"x":o+=this.parseCharCode(a+1,2,e),a+=2;break;case"u":o+=this.parseCharCode(a+1,4,e),a+=4;break;case"U":o+=this.parseCharCode(a+1,8,e),a+=8;break;case"\n":for(;" "===i[a+1]||"\t"===i[a+1];)a+=1;break;default:e.push(new r.YAMLSyntaxError(this,`Invalid escape sequence ${i.substr(a-1,2)}`)),o+="\\"+i[a]}else if(" "===t||"\t"===t){const e=a;let n=i[a+1];for(;" "===n||"\t"===n;)a+=1,n=i[a+1];"\n"!==n&&(o+=a>e?i.slice(e,a+1):t)}else o+=t}return e.length>0?{errors:e,str:o}:o}parseCharCode(e,t,n){const{src:s}=this.context,i=s.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;return isNaN(o)?(n.push(new r.YAMLSyntaxError(this,`Invalid escape sequence ${s.substr(e-2,t+2)}`)),s.substr(e-2,t+2)):String.fromCodePoint(o)}parse(e,t){this.context=e;const{src:n}=e;let s=m.endOfQuote(n,t+1);return this.valueRange=new r.Range(t,s),s=r.Node.endOfWhiteSpace(n,s),s=this.parseComment(s),s}}class y extends r.Node{static endOfQuote(e,t){let n=e[t];for(;n;)if("'"===n){if("'"!==e[t+1])break;n=e[t+=2]}else n=e[t+=1];return t+1}get strValue(){if(!this.valueRange||!this.context)return null;const e=[],{start:t,end:n}=this.valueRange,{indent:s,src:i}=this.context;"'"!==i[n-1]&&e.push(new r.YAMLSyntaxError(this,"Missing closing 'quote"));let o="";for(let a=t+1;a<n-1;++a){const t=i[a];if("\n"===t){r.Node.atDocumentBoundary(i,a+1)&&e.push(new r.YAMLSemanticError(this,"Document boundary indicators are not allowed within string values"));const{fold:t,offset:n,error:c}=r.Node.foldNewline(i,a,s);o+=t,a=n,c&&e.push(new r.YAMLSemanticError(this,"Multi-line single-quoted string needs to be sufficiently indented"))}else if("'"===t)o+=t,a+=1,"'"!==i[a]&&e.push(new r.YAMLSyntaxError(this,"Unescaped single quote? This should not happen."));else if(" "===t||"\t"===t){const e=a;let n=i[a+1];for(;" "===n||"\t"===n;)a+=1,n=i[a+1];"\n"!==n&&(o+=a>e?i.slice(e,a+1):t)}else o+=t}return e.length>0?{errors:e,str:o}:o}parse(e,t){this.context=e;const{src:n}=e;let s=y.endOfQuote(n,t+1);return this.valueRange=new r.Range(t,s),s=r.Node.endOfWhiteSpace(n,s),s=this.parseComment(s),s}}class v{static parseType(e,t,n){switch(e[t]){case"*":return r.Type.ALIAS;case">":return r.Type.BLOCK_FOLDED;case"|":return r.Type.BLOCK_LITERAL;case"{":return r.Type.FLOW_MAP;case"[":return r.Type.FLOW_SEQ;case"?":return!n&&r.Node.atBlank(e,t+1,!0)?r.Type.MAP_KEY:r.Type.PLAIN;case":":return!n&&r.Node.atBlank(e,t+1,!0)?r.Type.MAP_VALUE:r.Type.PLAIN;case"-":return!n&&r.Node.atBlank(e,t+1,!0)?r.Type.SEQ_ITEM:r.Type.PLAIN;case'"':return r.Type.QUOTE_DOUBLE;case"'":return r.Type.QUOTE_SINGLE;default:return r.Type.PLAIN}}constructor(e={},{atLineStart:t,inCollection:n,inFlow:s,indent:o,lineStart:a,parent:l}={}){r._defineProperty(this,"parseNode",((e,t)=>{if(r.Node.atDocumentBoundary(this.src,t))return null;const n=new v(this,e),{props:s,type:o,valueStart:a}=n.parseProps(t),l=function(e,t){switch(e){case r.Type.ALIAS:return new f(e,t);case r.Type.BLOCK_FOLDED:case r.Type.BLOCK_LITERAL:return new d(e,t);case r.Type.FLOW_MAP:case r.Type.FLOW_SEQ:return new g(e,t);case r.Type.MAP_KEY:case r.Type.MAP_VALUE:case r.Type.SEQ_ITEM:return new i(e,t);case r.Type.COMMENT:case r.Type.PLAIN:return new r.PlainValue(e,t);case r.Type.QUOTE_DOUBLE:return new m(e,t);case r.Type.QUOTE_SINGLE:return new y(e,t);default:return null}}(o,s);let u=l.parse(n,a);if(l.range=new r.Range(t,u),u<=t&&(l.error=new Error("Node#parse consumed no characters"),l.error.parseEnd=u,l.error.source=l,l.range.end=t+1),n.nodeStartsCollection(l)){l.error||n.atLineStart||n.parent.type!==r.Type.DOCUMENT||(l.error=new r.YAMLSyntaxError(l,"Block collection must not have preceding content here (e.g. directives-end indicator)"));const e=new c(l);return u=e.parse(new v(n),u),e.range=new r.Range(t,u),e}return l})),this.atLineStart=null!=t?t:e.atLineStart||!1,this.inCollection=null!=n?n:e.inCollection||!1,this.inFlow=null!=s?s:e.inFlow||!1,this.indent=null!=o?o:e.indent,this.lineStart=null!=a?a:e.lineStart,this.parent=null!=l?l:e.parent||{},this.root=e.root,this.src=e.src}nodeStartsCollection(e){const{inCollection:t,inFlow:n,src:s}=this;if(t||n)return!1;if(e instanceof i)return!0;let o=e.range.end;return"\n"!==s[o]&&"\n"!==s[o-1]&&(o=r.Node.endOfWhiteSpace(s,o),":"===s[o])}parseProps(e){const{inFlow:t,parent:n,src:s}=this,i=[];let o=!1,a=s[e=this.atLineStart?r.Node.endOfIndent(s,e):r.Node.endOfWhiteSpace(s,e)];for(;a===r.Char.ANCHOR||a===r.Char.COMMENT||a===r.Char.TAG||"\n"===a;){if("\n"===a){let t,i=e;do{t=i+1,i=r.Node.endOfIndent(s,t)}while("\n"===s[i]);const a=i-(t+this.indent),c=n.type===r.Type.SEQ_ITEM&&n.context.atLineStart;if("#"!==s[i]&&!r.Node.nextNodeIsIndented(s[i],a,!c))break;this.atLineStart=!0,this.lineStart=t,o=!1,e=i}else if(a===r.Char.COMMENT){const t=r.Node.endOfLine(s,e+1);i.push(new r.Range(e,t)),e=t}else{let t=r.Node.endOfIdentifier(s,e+1);a===r.Char.TAG&&","===s[t]&&/^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+,\d\d\d\d(-\d\d){0,2}\/\S/.test(s.slice(e+1,t+13))&&(t=r.Node.endOfIdentifier(s,t+5)),i.push(new r.Range(e,t)),o=!0,e=r.Node.endOfWhiteSpace(s,t)}a=s[e]}return o&&":"===a&&r.Node.atBlank(s,e+1,!0)&&(e-=1),{props:i,type:v.parseType(s,e,t),valueStart:e}}}t.parse=function(e){const t=[];-1!==e.indexOf("\r")&&(e=e.replace(/\r\n?/g,((e,n)=>(e.length>1&&t.push(n),"\n"))));const n=[];let r=0;do{const t=new u,s=new v({src:e});r=t.parse(s,r),n.push(t)}while(r<e.length);return n.setOrigRanges=()=>{if(0===t.length)return!1;for(let e=1;e<t.length;++e)t[e]-=e;let e=0;for(let r=0;r<n.length;++r)e=n[r].setOrigRanges(t,e);return t.splice(0,t.length),!0},n.toString=()=>n.join("...\n"),n}},314:(e,t,n)=>{"use strict";var r=n(487);function s(e,t,n){return n?-1===n.indexOf("\n")?`${e} #${n}`:`${e}\n`+n.replace(/^/gm,`${t||""}#`):e}class i{}function o(e,t,n){if(Array.isArray(e))return e.map(((e,t)=>o(e,String(t),n)));if(e&&"function"==typeof e.toJSON){const r=n&&n.anchors&&n.anchors.get(e);r&&(n.onCreate=e=>{r.res=e,delete n.onCreate});const s=e.toJSON(t,n);return r&&n.onCreate&&n.onCreate(s),s}return n&&n.keep||"bigint"!=typeof e?e:Number(e)}class a extends i{constructor(e){super(),this.value=e}toJSON(e,t){return t&&t.keep?this.value:o(this.value,e,t)}toString(){return String(this.value)}}function c(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){const n=t[e];if(Number.isInteger(n)&&n>=0){const e=[];e[n]=r,r=e}else{const e={};Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0}),r=e}}return e.createNode(r,!1)}const l=e=>null==e||"object"==typeof e&&e[Symbol.iterator]().next().done;class u extends i{constructor(e){super(),r._defineProperty(this,"items",[]),this.schema=e}addIn(e,t){if(l(e))this.add(t);else{const[n,...r]=e,s=this.get(n,!0);if(s instanceof u)s.addIn(r,t);else{if(void 0!==s||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);this.set(n,c(this.schema,r,t))}}}deleteIn([e,...t]){if(0===t.length)return this.delete(e);const n=this.get(e,!0);if(n instanceof u)return n.deleteIn(t);throw new Error(`Expected YAML collection at ${e}. Remaining path: ${t}`)}getIn([e,...t],n){const r=this.get(e,!0);return 0===t.length?!n&&r instanceof a?r.value:r:r instanceof u?r.getIn(t,n):void 0}hasAllNullValues(){return this.items.every((e=>{if(!e||"PAIR"!==e.type)return!1;const t=e.value;return null==t||t instanceof a&&null==t.value&&!t.commentBefore&&!t.comment&&!t.tag}))}hasIn([e,...t]){if(0===t.length)return this.has(e);const n=this.get(e,!0);return n instanceof u&&n.hasIn(t)}setIn([e,...t],n){if(0===t.length)this.set(e,n);else{const r=this.get(e,!0);if(r instanceof u)r.setIn(t,n);else{if(void 0!==r||!this.schema)throw new Error(`Expected YAML collection at ${e}. Remaining path: ${t}`);this.set(e,c(this.schema,t,n))}}}toJSON(){return null}toString(e,{blockItem:t,flowChars:n,isMap:i,itemIndent:o},a,c){const{indent:l,indentStep:f,stringify:h}=e,p=this.type===r.Type.FLOW_MAP||this.type===r.Type.FLOW_SEQ||e.inFlow;p&&(o+=f);const d=i&&this.hasAllNullValues();e=Object.assign({},e,{allNullValues:d,indent:o,inFlow:p,type:null});let g=!1,m=!1;const y=this.items.reduce(((t,n,r)=>{let i;n&&(!g&&n.spaceBefore&&t.push({type:"comment",str:""}),n.commentBefore&&n.commentBefore.match(/^.*$/gm).forEach((e=>{t.push({type:"comment",str:`#${e}`})})),n.comment&&(i=n.comment),p&&(!g&&n.spaceBefore||n.commentBefore||n.comment||n.key&&(n.key.commentBefore||n.key.comment)||n.value&&(n.value.commentBefore||n.value.comment))&&(m=!0)),g=!1;let a=h(n,e,(()=>i=null),(()=>g=!0));return p&&!m&&a.includes("\n")&&(m=!0),p&&r<this.items.length-1&&(a+=","),a=s(a,o,i),g&&(i||p)&&(g=!1),t.push({type:"item",str:a}),t}),[]);let v;if(0===y.length)v=n.start+n.end;else if(p){const{start:e,end:t}=n,r=y.map((e=>e.str));if(m||r.reduce(((e,t)=>e+t.length+2),2)>u.maxFlowStringSingleLineLength){v=e;for(const e of r)v+=e?`\n${f}${l}${e}`:"\n";v+=`\n${l}${t}`}else v=`${e} ${r.join(" ")} ${t}`}else{const e=y.map(t);v=e.shift();for(const t of e)v+=t?`\n${l}${t}`:"\n"}return this.comment?(v+="\n"+this.comment.replace(/^/gm,`${l}#`),a&&a()):g&&c&&c(),v}}function f(e){let t=e instanceof a?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),Number.isInteger(t)&&t>=0?t:null}r._defineProperty(u,"maxFlowStringSingleLineLength",60);class h extends u{add(e){this.items.push(e)}delete(e){const t=f(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){const n=f(e);if("number"!=typeof n)return;const r=this.items[n];return!t&&r instanceof a?r.value:r}has(e){const t=f(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=f(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);this.items[n]=t}toJSON(e,t){const n=[];t&&t.onCreate&&t.onCreate(n);let r=0;for(const e of this.items)n.push(o(e,String(r++),t));return n}toString(e,t,n){return e?super.toString(e,{blockItem:e=>"comment"===e.type?e.str:`- ${e.str}`,flowChars:{start:"[",end:"]"},isMap:!1,itemIndent:(e.indent||"")+" "},t,n):JSON.stringify(this)}}class p extends i{constructor(e,t=null){super(),this.key=e,this.value=t,this.type=p.Type.PAIR}get commentBefore(){return this.key instanceof i?this.key.commentBefore:void 0}set commentBefore(e){if(null==this.key&&(this.key=new a(null)),!(this.key instanceof i))throw new Error("Pair.commentBefore is an alias for Pair.key.commentBefore. To set it, the key must be a Node.");this.key.commentBefore=e}addToJSMap(e,t){const n=o(this.key,"",e);if(t instanceof Map){const r=o(this.value,n,e);t.set(n,r)}else if(t instanceof Set)t.add(n);else{const r=((e,t,n)=>null===t?"":"object"!=typeof t?String(t):e instanceof i&&n&&n.doc?e.toString({anchors:Object.create(null),doc:n.doc,indent:"",indentStep:n.indentStep,inFlow:!0,inStringifyKey:!0,stringify:n.stringify}):JSON.stringify(t))(this.key,n,e),s=o(this.value,r,e);r in t?Object.defineProperty(t,r,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[r]=s}return t}toJSON(e,t){const n=t&&t.mapAsMap?new Map:{};return this.addToJSMap(t,n)}toString(e,t,n){if(!e||!e.doc)return JSON.stringify(this);const{indent:o,indentSeq:c,simpleKeys:l}=e.doc.options;let{key:f,value:p}=this,d=f instanceof i&&f.comment;if(l){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(f instanceof u)throw new Error("With simple keys, collection cannot be used as a key value")}let g=!l&&(!f||d||(f instanceof i?f instanceof u||f.type===r.Type.BLOCK_FOLDED||f.type===r.Type.BLOCK_LITERAL:"object"==typeof f));const{doc:m,indent:y,indentStep:v,stringify:b}=e;e=Object.assign({},e,{implicitKey:!g,indent:y+v});let w=!1,S=b(f,e,(()=>d=null),(()=>w=!0));if(S=s(S,e.indent,d),!g&&S.length>1024){if(l)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(e.allNullValues&&!l)return this.comment?(S=s(S,e.indent,this.comment),t&&t()):w&&!d&&n&&n(),e.inFlow&&!g?S:`? ${S}`;S=g?`? ${S}\n${y}:`:`${S}:`,this.comment&&(S=s(S,e.indent,this.comment),t&&t());let E="",O=null;p instanceof i?(p.spaceBefore&&(E="\n"),p.commentBefore&&(E+=`\n${p.commentBefore.replace(/^/gm,`${e.indent}#`)}`),O=p.comment):p&&"object"==typeof p&&(p=m.schema.createNode(p,!0)),e.implicitKey=!1,!g&&!this.comment&&p instanceof a&&(e.indentAtStart=S.length+1),w=!1,!c&&o>=2&&!e.inFlow&&!g&&p instanceof h&&p.type!==r.Type.FLOW_SEQ&&!p.tag&&!m.anchors.getName(p)&&(e.indent=e.indent.substr(2));const N=b(p,e,(()=>O=null),(()=>w=!0));let L=" ";return E||this.comment?L=`${E}\n${e.indent}`:!g&&p instanceof u?("["===N[0]||"{"===N[0])&&!N.includes("\n")||(L=`\n${e.indent}`):"\n"===N[0]&&(L=""),w&&!O&&n&&n(),s(S+L+N,e.indent,O)}}r._defineProperty(p,"Type",{PAIR:"PAIR",MERGE_PAIR:"MERGE_PAIR"});const d=(e,t)=>{if(e instanceof g){const n=t.get(e.source);return n.count*n.aliasCount}if(e instanceof u){let n=0;for(const r of e.items){const e=d(r,t);e>n&&(n=e)}return n}if(e instanceof p){const n=d(e.key,t),r=d(e.value,t);return Math.max(n,r)}return 1};class g extends i{static stringify({range:e,source:t},{anchors:n,doc:r,implicitKey:s,inStringifyKey:i}){let o=Object.keys(n).find((e=>n[e]===t));if(!o&&i&&(o=r.anchors.getName(t)||r.anchors.newName()),o)return`*${o}${s?" ":""}`;const a=r.anchors.getName(t)?"Alias node must be after source node":"Source node not found for alias node";throw new Error(`${a} [${e}]`)}constructor(e){super(),this.source=e,this.type=r.Type.ALIAS}set tag(e){throw new Error("Alias nodes cannot have tags")}toJSON(e,t){if(!t)return o(this.source,e,t);const{anchors:n,maxAliasCount:s}=t,i=n.get(this.source);if(!i||void 0===i.res){const e="This should not happen: Alias anchor was not resolved?";throw this.cstNode?new r.YAMLReferenceError(this.cstNode,e):new ReferenceError(e)}if(s>=0&&(i.count+=1,0===i.aliasCount&&(i.aliasCount=d(this.source,n)),i.count*i.aliasCount>s)){const e="Excessive alias count indicates a resource exhaustion attack";throw this.cstNode?new r.YAMLReferenceError(this.cstNode,e):new ReferenceError(e)}return i.res}toString(e){return g.stringify(this,e)}}function m(e,t){const n=t instanceof a?t.value:t;for(const r of e)if(r instanceof p){if(r.key===t||r.key===n)return r;if(r.key&&r.key.value===n)return r}}r._defineProperty(g,"default",!0);class y extends u{add(e,t){e?e instanceof p||(e=new p(e.key||e,e.value)):e=new p(e);const n=m(this.items,e.key),r=this.schema&&this.schema.sortMapEntries;if(n){if(!t)throw new Error(`Key ${e.key} already set`);n.value=e.value}else if(r){const t=this.items.findIndex((t=>r(e,t)<0));-1===t?this.items.push(e):this.items.splice(t,0,e)}else this.items.push(e)}delete(e){const t=m(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=m(this.items,e),r=n&&n.value;return!t&&r instanceof a?r.value:r}has(e){return!!m(this.items,e)}set(e,t){this.add(new p(e,t),!0)}toJSON(e,t,n){const r=n?new n:t&&t.mapAsMap?new Map:{};t&&t.onCreate&&t.onCreate(r);for(const e of this.items)e.addToJSMap(t,r);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!(e instanceof p))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return super.toString(e,{blockItem:e=>e.str,flowChars:{start:"{",end:"}"},isMap:!0,itemIndent:e.indent||""},t,n)}}class v extends p{constructor(e){if(e instanceof p){let t=e.value;t instanceof h||(t=new h,t.items.push(e.value),t.range=e.value.range),super(e.key,t),this.range=e.range}else super(new a("<<"),new h);this.type=p.Type.MERGE_PAIR}addToJSMap(e,t){for(const{source:n}of this.value.items){if(!(n instanceof y))throw new Error("Merge sources must be maps");const r=n.toJSON(null,e,Map);for(const[e,n]of r)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}return t}toString(e,t){const n=this.value;if(n.items.length>1)return super.toString(e,t);this.value=n.items[0];const r=super.toString(e,t);return this.value=n,r}}const b={defaultType:r.Type.BLOCK_LITERAL,lineWidth:76},w={defaultType:r.Type.PLAIN,doubleQuoted:{jsonEncoding:!1,minMultiLineLength:40},fold:{lineWidth:80,minContentWidth:20}};function S(e,t,n){for(const{format:n,test:r,resolve:s}of t)if(r){const t=e.match(r);if(t){let e=s.apply(null,t);return e instanceof a||(e=new a(e)),n&&(e.format=n),e}}return n&&(e=n(e)),new a(e)}const E="flow",O="block",N="quoted",L=(e,t)=>{let n=e[t+1];for(;" "===n||"\t"===n;){do{n=e[t+=1]}while(n&&"\n"!==n);n=e[t+1]}return t};function A(e,t,n,{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}){if(!s||s<0)return e;const c=Math.max(1+i,1+s-t.length);if(e.length<=c)return e;const l=[],u={};let f,h,p=s-t.length;"number"==typeof r&&(r>s-Math.max(2,i)?l.push(0):p=s-r);let d=!1,g=-1,m=-1,y=-1;n===O&&(g=L(e,g),-1!==g&&(p=g+c));for(let t;t=e[g+=1];){if(n===N&&"\\"===t){switch(m=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}y=g}if("\n"===t)n===O&&(g=L(e,g)),p=g+c,f=void 0;else{if(" "===t&&h&&" "!==h&&"\n"!==h&&"\t"!==h){const t=e[g+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(f=g)}if(g>=p)if(f)l.push(f),p=f+c,f=void 0;else if(n===N){for(;" "===h||"\t"===h;)h=t,t=e[g+=1],d=!0;const n=g>y+1?g-2:m-1;if(u[n])return e;l.push(n),u[n]=!0,p=n+c,f=void 0}else d=!0}h=t}if(d&&a&&a(),0===l.length)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){const s=l[r],i=l[r+1]||e.length;0===s?v=`\n${t}${e.slice(0,i)}`:(n===N&&u[s]&&(v+=`${e[s]}\\`),v+=`\n${t}${e.slice(s+1,i)}`)}return v}const T=({indentAtStart:e})=>e?Object.assign({indentAtStart:e},w.fold):w.fold,M=e=>/^(%|---|\.\.\.)/m.test(e);function x(e,t){const{implicitKey:n}=t,{jsonEncoding:r,minMultiLineLength:s}=w.doubleQuoted,i=JSON.stringify(e);if(r)return i;const o=t.indent||(M(e)?" ":"");let a="",c=0;for(let e=0,t=i[e];t;t=i[++e])if(" "===t&&"\\"===i[e+1]&&"n"===i[e+2]&&(a+=i.slice(c,e)+"\\ ",e+=1,c=e,t="\\"),"\\"===t)switch(i[e+1]){case"u":{a+=i.slice(c,e);const t=i.substr(e+2,4);switch(t){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:"00"===t.substr(0,2)?a+="\\x"+t.substr(2):a+=i.substr(e,6)}e+=5,c=e+1}break;case"n":if(n||'"'===i[e+2]||i.length<s)e+=1;else{for(a+=i.slice(c,e)+"\n\n";"\\"===i[e+2]&&"n"===i[e+3]&&'"'!==i[e+4];)a+="\n",e+=2;a+=o," "===i[e+2]&&(a+="\\"),e+=1,c=e+1}break;default:e+=1}return a=c?a+i.slice(c):i,n?a:A(a,o,N,T(t))}function k(e,t){if(t.implicitKey){if(/\n/.test(e))return x(e,t)}else if(/[ \t]\n|\n[ \t]/.test(e))return x(e,t);const n=t.indent||(M(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${n}`)+"'";return t.implicitKey?r:A(r,n,E,T(t))}function P({comment:e,type:t,value:n},s,i,o){if(/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return x(n,s);const a=s.indent||(s.forceBlockIndent||M(n)?" ":""),c=a?"2":"1",l=t!==r.Type.BLOCK_FOLDED&&(t===r.Type.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let t=0,n=0;t<s;++t)if("\n"===e[t]){if(t-n>r)return!0;if(n=t+1,s-n<=r)return!1}return!0}(n,w.fold.lineWidth,a.length));let u=l?"|":">";if(!n)return u+"\n";let f="",h="";if(n=n.replace(/[\n\t ]*$/,(e=>{const t=e.indexOf("\n");return-1===t?u+="-":n!==e&&t===e.length-1||(u+="+",o&&o()),h=e.replace(/\n$/,""),""})).replace(/^[\n ]*/,(e=>{-1!==e.indexOf(" ")&&(u+=c);const t=e.match(/ +$/);return t?(f=e.slice(0,-t[0].length),t[0]):(f=e,"")})),h&&(h=h.replace(/\n+(?!\n|$)/g,`$&${a}`)),f&&(f=f.replace(/\n+/g,`$&${a}`)),e&&(u+=" #"+e.replace(/ ?[\r\n]+/g," "),i&&i()),!n)return`${u}${c}\n${a}${h}`;if(l)return n=n.replace(/\n+/g,`$&${a}`),`${u}\n${a}${f}${n}${h}`;n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${a}`);const p=A(`${f}${n}${h}`,a,O,w.fold);return`${u}\n${a}${p}`}function I(e,t){let n,s,i;switch(t.type){case r.Type.FLOW_MAP:n="}",s="flow map";break;case r.Type.FLOW_SEQ:n="]",s="flow sequence";break;default:return void e.push(new r.YAMLSemanticError(t,"Not a flow collection!?"))}for(let e=t.items.length-1;e>=0;--e){const n=t.items[e];if(!n||n.type!==r.Type.COMMENT){i=n;break}}if(i&&i.char!==n){const o=`Expected ${s} to end with ${n}`;let a;"number"==typeof i.offset?(a=new r.YAMLSemanticError(t,o),a.offset=i.offset+1):(a=new r.YAMLSemanticError(i,o),i.range&&i.range.end&&(a.offset=i.range.end-i.range.start)),e.push(a)}}function C(e,t){const n=t.context.src[t.range.start-1];if("\n"!==n&&"\t"!==n&&" "!==n){const n="Comments must be separated from other tokens by white space characters";e.push(new r.YAMLSemanticError(t,n))}}function _(e,t){const n=String(t),s=n.substr(0,8)+"..."+n.substr(-8);return new r.YAMLSemanticError(e,`The "${s}" key is too long`)}function $(e,t){for(const{afterKey:n,before:r,comment:s}of t){let t=e.items[r];t?(n&&t.value&&(t=t.value),void 0===s?!n&&t.commentBefore||(t.spaceBefore=!0):t.commentBefore?t.commentBefore+="\n"+s:t.commentBefore=s):void 0!==s&&(e.comment?e.comment+="\n"+s:e.comment=s)}}function R(e,t){const n=t.strValue;return n?"string"==typeof n?n:(n.errors.forEach((n=>{n.source||(n.source=t),e.errors.push(n)})),n.str):""}function B(e,t,n){const{tags:r}=e.schema,s=[];for(const i of r)if(i.tag===n){if(!i.test){const n=i.resolve(e,t);return n instanceof u?n:new a(n)}s.push(i)}const i=R(e,t);return"string"==typeof i&&s.length>0?S(i,s,r.scalarFallback):null}const Y=e=>{if(!e)return!1;const{type:t}=e;return t===r.Type.MAP_KEY||t===r.Type.MAP_VALUE||t===r.Type.SEQ_ITEM};function j(e,t){if(!t)return null;t.error&&e.errors.push(t.error);const{comments:n,hasAnchor:s,hasTag:i}=function(e,t){const n={before:[],after:[]};let s=!1,i=!1;const o=Y(t.context.parent)?t.context.parent.props.concat(t.props):t.props;for(const{start:a,end:c}of o)switch(t.context.src[a]){case r.Char.COMMENT:{if(!t.commentHasRequiredWhitespace(a)){const n="Comments must be separated from other tokens by white space characters";e.push(new r.YAMLSemanticError(t,n))}const{header:s,valueRange:i}=t;(i&&(a>i.start||s&&a>s.start)?n.after:n.before).push(t.context.src.slice(a+1,c));break}case r.Char.ANCHOR:if(s){const n="A node can have at most one anchor";e.push(new r.YAMLSemanticError(t,n))}s=!0;break;case r.Char.TAG:if(i){const n="A node can have at most one tag";e.push(new r.YAMLSemanticError(t,n))}i=!0}return{comments:n,hasAnchor:s,hasTag:i}}(e.errors,t);if(s){const{anchors:n}=e,r=t.anchor,s=n.getNode(r);s&&(n.map[n.newName(r)]=s),n.map[r]=t}if(t.type===r.Type.ALIAS&&(s||i)){const n="An alias node must not specify any properties";e.errors.push(new r.YAMLSemanticError(t,n))}const o=function(e,t){const{anchors:n,errors:s,schema:i}=e;if(t.type===r.Type.ALIAS){const e=t.rawValue,i=n.getNode(e);if(!i){const n=`Aliased anchor not found: ${e}`;return s.push(new r.YAMLReferenceError(t,n)),null}const o=new g(i);return n._cstAliases.push(o),o}const o=function(e,t){const{tag:n,type:s}=t;let i=!1;if(n){const{handle:s,suffix:o,verbatim:a}=n;if(a){if("!"!==a&&"!!"!==a)return a;const n=`Verbatim tags aren't resolved, so ${a} is invalid.`;e.errors.push(new r.YAMLSemanticError(t,n))}else if("!"!==s||o)try{return function(e,t){const{handle:n,suffix:s}=t.tag;let i=e.tagPrefixes.find((e=>e.handle===n));if(!i){const s=e.getDefaults().tagPrefixes;if(s&&(i=s.find((e=>e.handle===n))),!i)throw new r.YAMLSemanticError(t,`The ${n} tag handle is non-default and was not declared.`)}if(!s)throw new r.YAMLSemanticError(t,`The ${n} tag has no suffix.`);if("!"===n&&"1.0"===(e.version||e.options.version)){if("^"===s[0])return e.warnings.push(new r.YAMLWarning(t,"YAML 1.0 ^ tag expansion is not supported")),s;if(/[:/]/.test(s)){const e=s.match(/^([a-z0-9-]+)\/(.*)/i);return e?`tag:${e[1]}.yaml.org,2002:${e[2]}`:`tag:${s}`}}return i.prefix+decodeURIComponent(s)}(e,t)}catch(t){e.errors.push(t)}else i=!0}switch(s){case r.Type.BLOCK_FOLDED:case r.Type.BLOCK_LITERAL:case r.Type.QUOTE_DOUBLE:case r.Type.QUOTE_SINGLE:return r.defaultTags.STR;case r.Type.FLOW_MAP:case r.Type.MAP:return r.defaultTags.MAP;case r.Type.FLOW_SEQ:case r.Type.SEQ:return r.defaultTags.SEQ;case r.Type.PLAIN:return i?r.defaultTags.STR:null;default:return null}}(e,t);if(o)return function(e,t,n){try{const r=B(e,t,n);if(r)return n&&t.tag&&(r.tag=n),r}catch(n){return n.source||(n.source=t),e.errors.push(n),null}try{const s=function({type:e}){switch(e){case r.Type.FLOW_MAP:case r.Type.MAP:return r.defaultTags.MAP;case r.Type.FLOW_SEQ:case r.Type.SEQ:return r.defaultTags.SEQ;default:return r.defaultTags.STR}}(t);if(!s)throw new Error(`The tag ${n} is unavailable`);const i=`The tag ${n} is unavailable, falling back to ${s}`;e.warnings.push(new r.YAMLWarning(t,i));const o=B(e,t,s);return o.tag=n,o}catch(n){const s=new r.YAMLReferenceError(t,n.message);return s.stack=n.stack,e.errors.push(s),null}}(e,t,o);if(t.type!==r.Type.PLAIN){const e=`Failed to resolve ${t.type} node here`;return s.push(new r.YAMLSyntaxError(t,e)),null}try{return S(R(e,t),i.tags,i.tags.scalarFallback)}catch(e){return e.source||(e.source=t),s.push(e),null}}(e,t);if(o){o.range=[t.range.start,t.range.end],e.options.keepCstNodes&&(o.cstNode=t),e.options.keepNodeTypes&&(o.type=t.type);const r=n.before.join("\n");r&&(o.commentBefore=o.commentBefore?`${o.commentBefore}\n${r}`:r);const s=n.after.join("\n");s&&(o.comment=o.comment?`${o.comment}\n${s}`:s)}return t.resolved=o}const D=({context:{lineStart:e,node:t,src:n},props:s})=>{if(0===s.length)return!1;const{start:i}=s[0];if(t&&i>t.valueRange.start)return!1;if(n[i]!==r.Char.COMMENT)return!1;for(let t=e;t<i;++t)if("\n"===n[t])return!1;return!0};function F(e,t){if(!D(e))return;const n=e.getPropValue(0,r.Char.COMMENT,!0);let s=!1;const i=t.value.commentBefore;if(i&&i.startsWith(n))t.value.commentBefore=i.substr(n.length+1),s=!0;else{const r=t.value.comment;!e.node&&r&&r.startsWith(n)&&(t.value.comment=r.substr(n.length+1),s=!0)}s&&(t.comment=n)}t.Alias=g,t.Collection=u,t.Merge=v,t.Node=i,t.Pair=p,t.Scalar=a,t.YAMLMap=y,t.YAMLSeq=h,t.addComment=s,t.binaryOptions=b,t.boolOptions={trueStr:"true",falseStr:"false"},t.findPair=m,t.intOptions={asBigInt:!1},t.isEmptyPath=l,t.nullOptions={nullStr:"null"},t.resolveMap=function(e,t){if(t.type!==r.Type.MAP&&t.type!==r.Type.FLOW_MAP){const n=`A ${t.type} node cannot be resolved as a mapping`;return e.errors.push(new r.YAMLSyntaxError(t,n)),null}const{comments:n,items:s}=t.type===r.Type.FLOW_MAP?function(e,t){const n=[],s=[];let i,o=!1,a="{";for(let c=0;c<t.items.length;++c){const l=t.items[c];if("string"==typeof l.char){const{char:n,offset:u}=l;if("?"===n&&void 0===i&&!o){o=!0,a=":";continue}if(":"===n){if(void 0===i&&(i=null),":"===a){a=",";continue}}else if(o&&(void 0===i&&","!==n&&(i=null),o=!1),void 0!==i&&(s.push(new p(i)),i=void 0,","===n)){a=":";continue}if("}"===n){if(c===t.items.length-1)continue}else if(n===a){a=":";continue}const f=`Flow map contains an unexpected ${n}`,h=new r.YAMLSyntaxError(t,f);h.offset=u,e.errors.push(h)}else l.type===r.Type.BLANK_LINE?n.push({afterKey:!!i,before:s.length}):l.type===r.Type.COMMENT?(C(e.errors,l),n.push({afterKey:!!i,before:s.length,comment:l.comment})):void 0===i?(","===a&&e.errors.push(new r.YAMLSemanticError(l,"Separator , missing in flow map")),i=j(e,l)):(","!==a&&e.errors.push(new r.YAMLSemanticError(l,"Indicator : missing in flow map entry")),s.push(new p(i,j(e,l))),i=void 0,o=!1)}return I(e.errors,t),void 0!==i&&s.push(new p(i)),{comments:n,items:s}}(e,t):function(e,t){const n=[],s=[];let i,o=null;for(let a=0;a<t.items.length;++a){const c=t.items[a];switch(c.type){case r.Type.BLANK_LINE:n.push({afterKey:!!i,before:s.length});break;case r.Type.COMMENT:n.push({afterKey:!!i,before:s.length,comment:c.comment});break;case r.Type.MAP_KEY:void 0!==i&&s.push(new p(i)),c.error&&e.errors.push(c.error),i=j(e,c.node),o=null;break;case r.Type.MAP_VALUE:{if(void 0===i&&(i=null),c.error&&e.errors.push(c.error),!c.context.atLineStart&&c.node&&c.node.type===r.Type.MAP&&!c.node.context.atLineStart){const t="Nested mappings are not allowed in compact mappings";e.errors.push(new r.YAMLSemanticError(c.node,t))}let n=c.node;if(!n&&c.props.length>0){n=new r.PlainValue(r.Type.PLAIN,[]),n.context={parent:c,src:c.context.src};const e=c.range.start+1;if(n.range={start:e,end:e},n.valueRange={start:e,end:e},"number"==typeof c.range.origStart){const e=c.range.origStart+1;n.range.origStart=n.range.origEnd=e,n.valueRange.origStart=n.valueRange.origEnd=e}}const a=new p(i,j(e,n));F(c,a),s.push(a),i&&"number"==typeof o&&c.range.start>o+1024&&e.errors.push(_(t,i)),i=void 0,o=null}break;default:void 0!==i&&s.push(new p(i)),i=j(e,c),o=c.range.start,c.error&&e.errors.push(c.error);e:for(let n=a+1;;++n){const s=t.items[n];switch(s&&s.type){case r.Type.BLANK_LINE:case r.Type.COMMENT:continue e;case r.Type.MAP_VALUE:break e;default:{const t="Implicit map keys need to be followed by map values";e.errors.push(new r.YAMLSemanticError(c,t));break e}}}if(c.valueRangeContainsNewline){const t="Implicit map keys need to be on a single line";e.errors.push(new r.YAMLSemanticError(c,t))}}}return void 0!==i&&s.push(new p(i)),{comments:n,items:s}}(e,t),i=new y;i.items=s,$(i,n);let o=!1;for(let n=0;n<s.length;++n){const{key:i}=s[n];if(i instanceof u&&(o=!0),e.schema.merge&&i&&"<<"===i.value){s[n]=new v(s[n]);const i=s[n].value.items;let o=null;i.some((e=>{if(e instanceof g){const{type:t}=e.source;return t!==r.Type.MAP&&t!==r.Type.FLOW_MAP&&(o="Merge nodes aliases can only point to maps")}return o="Merge nodes can only have Alias nodes as values"})),o&&e.errors.push(new r.YAMLSemanticError(t,o))}else for(let o=n+1;o<s.length;++o){const{key:n}=s[o];if(i===n||i&&n&&Object.prototype.hasOwnProperty.call(i,"value")&&i.value===n.value){const n=`Map keys must be unique; "${i}" is repeated`;e.errors.push(new r.YAMLSemanticError(t,n));break}}}if(o&&!e.options.mapAsMap){const n="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";e.warnings.push(new r.YAMLWarning(t,n))}return t.resolved=i,i},t.resolveNode=j,t.resolveSeq=function(e,t){if(t.type!==r.Type.SEQ&&t.type!==r.Type.FLOW_SEQ){const n=`A ${t.type} node cannot be resolved as a sequence`;return e.errors.push(new r.YAMLSyntaxError(t,n)),null}const{comments:n,items:s}=t.type===r.Type.FLOW_SEQ?function(e,t){const n=[],s=[];let i,o=!1,a=null,c="[",l=null;for(let u=0;u<t.items.length;++u){const f=t.items[u];if("string"==typeof f.char){const{char:n,offset:h}=f;if(":"===n||!o&&void 0===i||(o&&void 0===i&&(i=c?s.pop():null),s.push(new p(i)),o=!1,i=void 0,a=null),n===c)c=null;else if(c||"?"!==n){if("["!==c&&":"===n&&void 0===i){if(","===c){if(i=s.pop(),i instanceof p){const n="Chaining flow sequence pairs is invalid",s=new r.YAMLSemanticError(t,n);s.offset=h,e.errors.push(s)}if(!o&&"number"==typeof a){const n=f.range?f.range.start:f.offset;n>a+1024&&e.errors.push(_(t,i));const{src:s}=l.context;for(let t=a;t<n;++t)if("\n"===s[t]){const t="Implicit keys of flow sequence pairs need to be on a single line";e.errors.push(new r.YAMLSemanticError(l,t));break}}}else i=null;a=null,o=!1,c=null}else if("["===c||"]"!==n||u<t.items.length-1){const s=`Flow sequence contains an unexpected ${n}`,i=new r.YAMLSyntaxError(t,s);i.offset=h,e.errors.push(i)}}else o=!0}else if(f.type===r.Type.BLANK_LINE)n.push({before:s.length});else if(f.type===r.Type.COMMENT)C(e.errors,f),n.push({comment:f.comment,before:s.length});else{if(c){const t=`Expected a ${c} in flow sequence`;e.errors.push(new r.YAMLSemanticError(f,t))}const t=j(e,f);void 0===i?(s.push(t),l=f):(s.push(new p(i,t)),i=void 0),a=f.range.start,c=","}}return I(e.errors,t),void 0!==i&&s.push(new p(i)),{comments:n,items:s}}(e,t):function(e,t){const n=[],s=[];for(let i=0;i<t.items.length;++i){const o=t.items[i];switch(o.type){case r.Type.BLANK_LINE:n.push({before:s.length});break;case r.Type.COMMENT:n.push({comment:o.comment,before:s.length});break;case r.Type.SEQ_ITEM:if(o.error&&e.errors.push(o.error),s.push(j(e,o.node)),o.hasProps){const t="Sequence items cannot have tags or anchors before the - indicator";e.errors.push(new r.YAMLSemanticError(o,t))}break;default:o.error&&e.errors.push(o.error),e.errors.push(new r.YAMLSyntaxError(o,`Unexpected ${o.type} node in sequence`))}}return{comments:n,items:s}}(e,t),i=new h;if(i.items=s,$(i,n),!e.options.mapAsMap&&s.some((e=>e instanceof p&&e.key instanceof u))){const n="Keys with collection values will be stringified as YAML due to JS Object restrictions. Use mapAsMap: true to avoid this.";e.warnings.push(new r.YAMLWarning(t,n))}return t.resolved=i,i},t.resolveString=R,t.strOptions=w,t.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(s)){let e=s.indexOf(".");e<0&&(e=s.length,s+=".");let n=t-(s.length-e-1);for(;n-- >0;)s+="0"}return s},t.stringifyString=function(e,t,n,s){const{defaultType:i}=w,{implicitKey:o,inFlow:a}=t;let{type:c,value:l}=e;"string"!=typeof l&&(l=String(l),e=Object.assign({},e,{value:l}));const u=i=>{switch(i){case r.Type.BLOCK_FOLDED:case r.Type.BLOCK_LITERAL:return P(e,t,n,s);case r.Type.QUOTE_DOUBLE:return x(l,t);case r.Type.QUOTE_SINGLE:return k(l,t);case r.Type.PLAIN:return function(e,t,n,s){const{comment:i,type:o,value:a}=e,{actualString:c,implicitKey:l,indent:u,inFlow:f}=t;if(l&&/[\n[\]{},]/.test(a)||f&&/[[\]{},]/.test(a))return x(a,t);if(!a||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return l||f||-1===a.indexOf("\n")?-1!==a.indexOf('"')&&-1===a.indexOf("'")?k(a,t):x(a,t):P(e,t,n,s);if(!l&&!f&&o!==r.Type.PLAIN&&-1!==a.indexOf("\n"))return P(e,t,n,s);if(""===u&&M(a))return t.forceBlockIndent=!0,P(e,t,n,s);const h=a.replace(/\n+/g,`$&\n${u}`);if(c){const{tags:e}=t.doc.schema;if("string"!=typeof S(h,e,e.scalarFallback).value)return x(a,t)}const p=l?h:A(h,u,E,T(t));return!i||f||-1===p.indexOf("\n")&&-1===i.indexOf("\n")?p:(n&&n(),function(e,t,n){return n?`#${n.replace(/[\s\S]^/gm,`$&${t}#`)}\n${t}${e}`:e}(p,u,i))}(e,t,n,s);default:return null}};c!==r.Type.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f]/.test(l)?c=r.Type.QUOTE_DOUBLE:!o&&!a||c!==r.Type.BLOCK_FOLDED&&c!==r.Type.BLOCK_LITERAL||(c=r.Type.QUOTE_DOUBLE);let f=u(c);if(null===f&&(f=u(i),null===f))throw new Error(`Unsupported default string type ${i}`);return f},t.toJSON=o},125:(e,t,n)=>{"use strict";var r=n(487),s=n(314);const i={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve:(e,t)=>{const n=s.resolveString(e,t);if("function"==typeof Buffer)return Buffer.from(n,"base64");if("function"==typeof atob){const e=atob(n.replace(/[\n\r]/g,"")),t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}{const n="This environment does not support reading binary tags; either Buffer or atob is required";return e.errors.push(new r.YAMLReferenceError(t,n)),null}},options:s.binaryOptions,stringify:({comment:e,type:t,value:n},i,o,a)=>{let c;if("function"==typeof Buffer)c=n instanceof Buffer?n.toString("base64"):Buffer.from(n.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<n.length;++t)e+=String.fromCharCode(n[t]);c=btoa(e)}}if(t||(t=s.binaryOptions.defaultType),t===r.Type.QUOTE_DOUBLE)n=c;else{const{lineWidth:e}=s.binaryOptions,i=Math.ceil(c.length/e),o=new Array(i);for(let t=0,n=0;t<i;++t,n+=e)o[t]=c.substr(n,e);n=o.join(t===r.Type.BLOCK_LITERAL?"\n":" ")}return s.stringifyString({comment:e,type:t,value:n},i,o,a)}};function o(e,t){const n=s.resolveSeq(e,t);for(let e=0;e<n.items.length;++e){let i=n.items[e];if(!(i instanceof s.Pair)){if(i instanceof s.YAMLMap){if(i.items.length>1){const e="Each pair must have its own sequence indicator";throw new r.YAMLSemanticError(t,e)}const e=i.items[0]||new s.Pair;i.commentBefore&&(e.commentBefore=e.commentBefore?`${i.commentBefore}\n${e.commentBefore}`:i.commentBefore),i.comment&&(e.comment=e.comment?`${i.comment}\n${e.comment}`:i.comment),i=e}n.items[e]=i instanceof s.Pair?i:new s.Pair(i)}}return n}function a(e,t,n){const r=new s.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";for(const s of t){let t,i;if(Array.isArray(s)){if(2!==s.length)throw new TypeError(`Expected [key, value] tuple: ${s}`);t=s[0],i=s[1]}else if(s&&s instanceof Object){const e=Object.keys(s);if(1!==e.length)throw new TypeError(`Expected { key: value } tuple: ${s}`);t=e[0],i=s[t]}else t=s;const o=e.createPair(t,i,n);r.items.push(o)}return r}const c={default:!1,tag:"tag:yaml.org,2002:pairs",resolve:o,createNode:a};class l extends s.YAMLSeq{constructor(){super(),r._defineProperty(this,"add",s.YAMLMap.prototype.add.bind(this)),r._defineProperty(this,"delete",s.YAMLMap.prototype.delete.bind(this)),r._defineProperty(this,"get",s.YAMLMap.prototype.get.bind(this)),r._defineProperty(this,"has",s.YAMLMap.prototype.has.bind(this)),r._defineProperty(this,"set",s.YAMLMap.prototype.set.bind(this)),this.tag=l.tag}toJSON(e,t){const n=new Map;t&&t.onCreate&&t.onCreate(n);for(const e of this.items){let r,i;if(e instanceof s.Pair?(r=s.toJSON(e.key,"",t),i=s.toJSON(e.value,r,t)):r=s.toJSON(e,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}}r._defineProperty(l,"tag","tag:yaml.org,2002:omap");const u={identify:e=>e instanceof Map,nodeClass:l,default:!1,tag:"tag:yaml.org,2002:omap",resolve:function(e,t){const n=o(e,t),i=[];for(const{key:e}of n.items)if(e instanceof s.Scalar){if(i.includes(e.value)){const e="Ordered maps must not include duplicate keys";throw new r.YAMLSemanticError(t,e)}i.push(e.value)}return Object.assign(new l,n)},createNode:function(e,t,n){const r=a(e,t,n),s=new l;return s.items=r.items,s}};class f extends s.YAMLMap{constructor(){super(),this.tag=f.tag}add(e){const t=e instanceof s.Pair?e:new s.Pair(e);s.findPair(this.items,t.key)||this.items.push(t)}get(e,t){const n=s.findPair(this.items,e);return!t&&n instanceof s.Pair?n.key instanceof s.Scalar?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const n=s.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new s.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues())return super.toString(e,t,n);throw new Error("Set items must all have null values")}}r._defineProperty(f,"tag","tag:yaml.org,2002:set");const h={identify:e=>e instanceof Set,nodeClass:f,default:!1,tag:"tag:yaml.org,2002:set",resolve:function(e,t){const n=s.resolveMap(e,t);if(!n.hasAllNullValues())throw new r.YAMLSemanticError(t,"Set items must all have null values");return Object.assign(new f,n)},createNode:function(e,t,n){const r=new f;for(const s of t)r.items.push(e.createPair(s,null,n));return r}},p=(e,t)=>{const n=t.split(":").reduce(((e,t)=>60*e+Number(t)),0);return"-"===e?-n:n},d=({value:e})=>{if(isNaN(e)||!isFinite(e))return s.stringifyNumber(e);let t="";e<0&&(t="-",e=Math.abs(e));const n=[e%60];return e<60?n.unshift(0):(e=Math.round((e-n[0])/60),n.unshift(e%60),e>=60&&(e=Math.round((e-n[0])/60),n.unshift(e))),t+n.map((e=>e<10?"0"+String(e):String(e))).join(":").replace(/000000\d*$/,"")},g={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+)$/,resolve:(e,t,n)=>p(t,n.replace(/_/g,"")),stringify:d},m={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^([-+]?)([0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*)$/,resolve:(e,t,n)=>p(t,n.replace(/_/g,"")),stringify:d},y={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^(?:([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?)$"),resolve:(e,t,n,r,s,i,o,a,c)=>{a&&(a=(a+"00").substr(1,3));let l=Date.UTC(t,n-1,r,s||0,i||0,o||0,a||0);if(c&&"Z"!==c){let e=p(c[0],c.slice(1));Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};function v(e){const t="undefined"!=typeof process&&process.env||{};return e?"undefined"!=typeof YAML_SILENCE_DEPRECATION_WARNINGS?!YAML_SILENCE_DEPRECATION_WARNINGS:!t.YAML_SILENCE_DEPRECATION_WARNINGS:"undefined"!=typeof YAML_SILENCE_WARNINGS?!YAML_SILENCE_WARNINGS:!t.YAML_SILENCE_WARNINGS}function b(e,t){if(v(!1)){const n="undefined"!=typeof process&&process.emitWarning;n?n(e,t):console.warn(t?`${t}: ${e}`:e)}}const w={};t.binary=i,t.floatTime=m,t.intTime=g,t.omap=u,t.pairs=c,t.set=h,t.timestamp=y,t.warn=b,t.warnFileDeprecation=function(e){v(!0)&&b(`The endpoint 'yaml/${e.replace(/.*yaml[/\\]/i,"").replace(/\.js$/,"").replace(/\\/g,"/")}' will be removed in a future release.`,"DeprecationWarning")},t.warnOptionDeprecation=function(e,t){if(!w[e]&&v(!0)){w[e]=!0;let n=`The option '${e}' will be removed in a future release`;n+=t?`, use '${t}' instead.`:".",b(n,"DeprecationWarning")}}},78:(e,t,n)=>{e.exports=n(667).YAML}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{FtpClient:()=>k,FtpClientPool:()=>P,JsonStorage:()=>v,PuboFileSystem:()=>D,RosTopic:()=>de,RosTopicManager:()=>ge,SIGKILL:()=>Z,createRpcClient:()=>Y,getNetworks:()=>he,getProcessByPpid:()=>se,getProcessCommandByPid:()=>re,getProcessCpuUseByPid:()=>ne,getProcessName:()=>te,getProcessTree:()=>oe,getWifiName:()=>fe,heartbeat:()=>ce,isPortAvailable:()=>le,isProcessDied:()=>ee,pitch:()=>ue});const e=require("fs"),t=require("pubo-utils"),s=require("crypto");var i=n.n(s);const o={randomUUID:i().randomUUID},a=new Uint8Array(256);let c=a.length;function l(){return c>a.length-16&&(i().randomFillSync(a),c=0),a.slice(c,c+=16)}const u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).slice(1));const f=function(e,t,n){if(o.randomUUID&&!t&&!e)return o.randomUUID();const r=(e=e||{}).random||(e.rng||l)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+"-"+u[e[t+4]]+u[e[t+5]]+"-"+u[e[t+6]]+u[e[t+7]]+"-"+u[e[t+8]]+u[e[t+9]]+"-"+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]}(r)};function h(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var p=n(1);function d(){}var g=function(){function n(e,n){var r=this;this.path=void 0,this._state={},this.queue=new t.SyncQueue,this.key=void 0,this.defaultState=void 0,this.path=e,this.defaultState=n,this.key=encodeURIComponent(e),p.on("online",(function(e){e.on("message",(function(t){r.onMessage(t,e),t=null}))})),p.on("exit",(function(e){e.removeAllListeners("message"),e=null})),this.restore()}var r=n.prototype;return r.onMessage=function(e,t){try{var n,r=this;return e.key!==r.key?h():h((s=function(){t.send({uid:e.uid,key:r.key,payload:n}),e=null,t=null},(i="get"===e.type?h(r.getState(),(function(e){n=e})):function(e){var t=e();if(t&&t.then)return t.then(d)}((function(){if("set"===e.type)return h(r.setState(e.payload),(function(e){n=e}))})))&&i.then?i.then(s):s()))}catch(e){return Promise.reject(e)}var s,i},r.sync=function(){try{var e=this;return e.queue.length>0?h():h(y(e.queue.push(e._syncFile.bind(e))))}catch(e){return Promise.reject(e)}},r._syncFile=function(){try{var t=this;return h(new Promise((function(n,r){(0,e.writeFile)(t.path,JSON.stringify(t._state),(function(e){e?r(e):n("")}))})))}catch(e){return Promise.reject(e)}},r.restore=function(){try{var t=(0,e.readFileSync)(this.path);this._state=JSON.parse(t.toString())}catch(t){var n,r="win32"===process.platform?"\\":"/";r&&(0,e.mkdirSync)(this.path.split(r).slice(0,-1).join(r),{recursive:!0}),this.setState(null!=(n=this.defaultState)?n:{})}},r.getState=function(){try{return h(this._state)}catch(e){return Promise.reject(e)}},r.setState=function(e){try{return this._state=e,h(y(this.sync()))}catch(e){return Promise.reject(e)}},n}(),m=function(){function e(e){this.key=void 0,this.callback={},this.key=encodeURIComponent(e),process.on("message",this.onMessage.bind(this))}var t=e.prototype;return t.onMessage=function(e){e.key===this.key&&("function"==typeof this.callback[e.uid]&&(this.callback[e.uid](e.payload),delete this.callback[e.uid]),e=null)},t.call=function(e){var t=e.type,n=e.payload;try{var r=this;return h(new Promise((function(e){var s=f();r.callback[s]=function(t){return e(t)},process.send({uid:s,type:t,payload:n,key:r.key}),n=null,t=null})))}catch(e){return Promise.reject(e)}},t.getState=function(){try{return h(this.call({type:"get",payload:{}}))}catch(e){return Promise.reject(e)}},t.setState=function(e){try{return h(this.call({type:"set",payload:e}))}catch(e){return Promise.reject(e)}},e}();function y(e,t){if(!t)return e&&e.then?e.then(d):Promise.resolve()}var v=function(){function e(e,t){var n;void 0===t&&(t={}),this.instance=void 0,p.isPrimary?this.instance=new g(e,t.defaultState):this.instance=new m(e),null!=(n=t)&&n.initialState&&this.merge(t.initialState)}var t=e.prototype;return t.getState=function(){try{return h(this.instance.getState())}catch(e){return Promise.reject(e)}},t.setState=function(e){try{return h(this.instance.setState(e))}catch(e){return Promise.reject(e)}},t.get=function(e){try{return e?h(this.getState(),(function(t){return t[e]})):h(this.getState())}catch(e){return Promise.reject(e)}},t.set=function(e,t){try{var n=this;return h(n.getState(),(function(r){return r[e]=t,y(n.setState(r))}))}catch(e){return Promise.reject(e)}},t.merge=function(e){try{var t=this;return h(t.getState(),(function(n){for(var r=0,s=Object.keys(e);r<s.length;r++){var i=s[r];n[i]=e[i]}return y(t.setState(n))}))}catch(e){return Promise.reject(e)}},t.remove=function(e){try{var t=this;return h(t.getState(),(function(n){return delete n[e],y(t.setState(n))}))}catch(e){return Promise.reject(e)}},e}(),b=["driver"],w=["maxConnection"];function S(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function E(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function O(){}function N(e,t){if(!t)return e&&e.then?e.then(O):Promise.resolve()}function L(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A.apply(this,arguments)}function T(e,t){if(null==e)return{};var n,r,s={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(s[n]=e[n]);return s}function M(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,"symbol"==typeof(s=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key))?s:String(s)),r)}var s}function x(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var k=function(){function e(e){var n=e.driver,r=T(e,b);this.driver=void 0,this.options=void 0,this.state={running:!1,connected:!1,destroyed:!1,connecting:!1},this.client=void 0,this._len=0,this.id=(0,t.random)(),this.put=this.bind("put"),this.delete=this.bind("delete"),this.list=this.bind("list"),this.rename=this.bind("rename"),this.driver=n,this.options=r}var n=e.prototype;return n.connect=function(){try{var e=!1,n=this;return n.client||(n.client=new n.driver),n.state.destroyed=!1,S(E((function(){if(n.state.connecting)return S((0,t.waitFor)((function(){return n.state.connected}),{checkTime:1e3,timeout:1e4}),(function(){return e=!0,"connected"}))}),(function(t){return e?t:(n.state.connecting=!0,new Promise((function(e,t){n.client.once("ready",(function(){n.state.connected=!0,e("connected"),n.state.connecting=!1})),n.client.once("error",(function(e){t(e),n.close()})),n.client.connect(A({},n.options))})))})))}catch(e){return Promise.reject(e)}},n.close=function(){this.client.end(),this.state.connected=!1,this.state.destroyed=!0,this.state.connecting=!1,this.client=null},n.run=function(e){var n=e.fn,r=e.args;try{var s=this;return s.len+=1,S(E((function(){if(!s.state.connected)return N(s.connect())}),(function(){return E((function(){if(s.state.running)return N((0,t.waitFor)((function(){return!s.state.running}),{checkTime:1e3,timeout:6e6}))}),(function(){return s.state.running=!0,new Promise((function(e,t){var i;(i=s.client)[n].apply(i,r.concat([function(n,r){n?t(n):e(r)}]))}))}))})))}catch(e){return Promise.reject(e)}},n.bind=function(e){var t=this;return L((function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return S(t.run({fn:e,args:r}),(function(e){return t.state.running=!1,t.len-=1,e}))}))},n.get=function(){try{for(var e=this,t=Buffer.alloc(0),n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return S(e.run({fn:"get",args:r}),(function(n){return new Promise((function(r){n.on("data",(function(e){t=Buffer.concat([t,e],t.byteLength+e.byteLength)})),n.on("end",(function(){r(t),e.state.running=!1,e.len-=1}))}))}))}catch(e){return Promise.reject(e)}},x(e,[{key:"len",get:function(){return this._len},set:function(e){this._len=e,this._len<1&&this.close()}}]),e}(),P=function(){function e(e){var t=e.maxConnection,n=void 0===t?5:t,r=T(e,w);this.options=void 0,this.maxConnection=void 0,this.pool=[],this.get=this.bind("get"),this.put=this.bind("put"),this.delete=this.bind("delete"),this.list=this.bind("list"),this.rename=this.bind("rename"),this.options=r,this.maxConnection=n}return e.prototype.bind=function(e){var t=this;return L((function(){var n=t.client;return S(n[e].apply(n,arguments),(function(e){if(n.len<1){var r=t.pool.findIndex((function(e){return e.id===n.id}));t.pool.splice(r,1)}return e}))}))},x(e,[{key:"len",get:function(){return this.pool.length}},{key:"client",get:function(){if(this.pool.length<this.maxConnection){var e=new k(this.options);return this.pool.push(e),e}return this.pool.sort((function(e,t){return e.len-t.len})),this.pool[0]}}]),e}();function I(){}function C(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_.apply(this,arguments)}function $(e){return e}var R=function(){function e(e){var t,n=e.url,r=e.options,s=void 0===r?{}:r,i=e.Grpc,o=e.cert;this.url=void 0,this.options=void 0,this.Grpc=void 0,this.credentials=void 0,this.client=void 0,this._timeout=void 0,this.connections=0,this.closing=!1;var a=_({"grpc.max_send_message_length":-1,"grpc.max_receive_message_length":-1},s),c=o?i.credentials.createSsl(o):i.credentials.createInsecure();this.url=n,this.Grpc=i,this.credentials=c,this.options=a,this.options.timeout=null!=(t=this.options.timeout)?t:6e4}var n=e.prototype;return n.request=function(e,n,r){try{var s=this;return C((i=function(){if(s.closing)return e=(0,t.waitFor)((n=function(){return!s.closing},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(n.apply(this,e))}catch(e){return Promise.reject(e)}}),{checkTime:100,timeout:2e4}),e&&e.then?e.then(I):Promise.resolve();var e,n},o=function(){var t;s.connections+=1,s.client||(s.client=new s.Grpc.Client(s.url,s.credentials,s.options));var i,o,a=Buffer.alloc(0);return i=function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return C(s._request({service:e,method:n,data:r}),(function(e){a=e}))}),(function(e){t=e})),o=function(){if(s.connections-=1,s.connections<0&&(s.connections=0),s.connections<1&&(s._timeout&&(clearTimeout(s._timeout),s._timeout=null),s._timeout=setTimeout((function(){return s.close()}),6e4)),t)throw s.restart(),new Error("grpc connection error.");return a},i&&i.then?i.then(o):o()},(a=i())&&a.then?a.then(o):o()))}catch(e){return Promise.reject(e)}var i,o,a},n._request=function(e){var t=this,n=e.service,r=e.method,s=e.data;return new Promise((function(e,i){var o=!1,a=setTimeout((function(){o=!0,t.restart(),console.log("rpc request timeout"),i(new Error("timeout"))}),t.options.timeout),c=function(t,n){o||(clearTimeout(a),t?i(t):e(n),c=null)};t.client.makeUnaryRequest("/"+n+"/"+r,$,$,s,c)}))},n.restart=function(){try{var e=this;return e.closing?C():(console.log("rpc client restarting."),e.closing=!0,e.close(),C((0,t.sleep)(2e3),(function(){e.closing=!1})))}catch(e){return Promise.reject(e)}},n.close=function(){var e;null==(e=this.client)||e.close(),this.client=null,delete this.client},e}(),B=[];function Y(e){var t=e.url,n=e.options,r=void 0===n?{}:n,s=e.ServiceImp,i=e.Grpc,o=e.cert,a=new R({url:t,options:r,Grpc:i,cert:o});return B.push(a),new s({request:a.request.bind(a)})}var j=function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new Promise((function(t,r){e.apply(void 0,n.concat([function(e){e&&r(e);for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];s.length<2?t(s[0]):t([].concat(s))}]))}))}},D={read:j(e.read),readFile:j(e.readFile),writeFile:j(e.writeFile),readdir:j(e.readdir),open:j(e.open),close:j(e.close),write:j(e.write),stat:j(e.stat)};const F=require("child_process");function W(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function U(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}var K="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Q(e,t,n){if(!e.s){if(n instanceof q){if(!n.s)return void(n.o=Q.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Q.bind(null,e,t),Q.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}var q=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,s=this.s;if(s){var i=1&s?t:n;if(i){try{Q(r,1,i(this.v))}catch(e){Q(r,2,e)}return r}return this}return this.o=function(e){try{var s=e.v;1&e.s?Q(r,1,t?t(s):s):n?Q(r,1,n(s)):Q(r,2,s)}catch(e){Q(r,2,e)}},r},e}();function J(e){return e instanceof q&&1&e.s}function V(e,t,n){if("function"==typeof e[K]){var r,s,i,o=e[K]();if(function e(a){try{for(;!((r=o.next()).done||n&&n());)if((a=t(r.value))&&a.then){if(!J(a))return void a.then(e,i||(i=Q.bind(null,s=new q,2)));a=a.v}s?Q(s,1,a):s=a}catch(e){Q(s||(s=new q),2,e)}}(),o.return){var a=function(e){try{r.done||o.return()}catch(e){}return e};if(s&&s.then)return s.then(a,(function(e){throw a(e)}));a()}return s}if(!("length"in e))throw new TypeError("Object is not iterable");for(var c=[],l=0;l<e.length;l++)c.push(e[l]);return function(e,t,n){var r,s,i=-1;return function o(a){try{for(;++i<e.length&&(!n||!n());)if((a=t(i))&&a.then){if(!J(a))return void a.then(o,s||(s=Q.bind(null,r=new q,2)));a=a.v}r?Q(r,1,a):r=a}catch(e){Q(r||(r=new q),2,e)}}(),r}(c,(function(e){return t(c[e])}),n)}function G(e,t){return e&&e.then?e.then(t):t(e)}function H(){}function z(e,t){if(!t)return e&&e.then?e.then(H):Promise.resolve()}var Z=U((function(e,t){return void 0===t&&(t=2),"win32"===process.platform?new Promise((function(t,n){(0,F.exec)("taskkill /pid "+e+" /T /F",(function(e){e?n(e):t("")}))})):W(oe(e),(function(e){var n=[e.pid];return ae(e,n),n.reverse(),e=null,G(V(n,(function(e){return z(X(e,t))})),(function(){return"success"}))}))})),X=U((function(e,n,r){if(void 0===n&&(n=2),void 0===r&&(r=1),r>5)throw new Error("SIGKILL 失败. times > 5");if("win32"!==process.platform)return(0,F.exec)("kill -"+n+" "+e),function(e){if(e&&e.then)return e.then(H)}(function(n,r){try{var s=z((0,t.waitFor)((function(){return ee(e)}),{checkTime:1e3,timeout:1e4}))}catch(e){return r()}return s&&s.then?s.then(void 0,r):s}(0,(function(){return z(X(e,9,r+1))})));process.kill(e,n)})),ee=U((function(e){return W(ne(e),(function(e){return e<0}))}));function te(e){return new Promise((function(t,n){(0,F.exec)('grep "Name:" /proc/'+e+"/status",(function(e,r){e?n(e):t(r)}))}))}function ne(e){return new Promise((function(t){(0,F.exec)("ps -p "+e+" -o %cpu=",(function(e,n){t(e?-1:parseFloat(n.toString()))}))}))}function re(e){return new Promise((function(t){(0,F.exec)("ps -p "+e+" -o command=",(function(e,n){t(e?"":n.toString().split("\n")[0])}))}))}function se(e){return new Promise((function(t){(0,F.exec)("ps -o pid --no-headers --ppid "+e,(function(e,n){t(e?[]:n.split("\n").filter((function(e){return!!e})).map((function(e){return parseFloat(e.trim())})))}))}))}var ie,oe=U((function(e,t){var n=!1;return t||(n=!0,t={pid:e,children:[]}),W(se(e),(function(e){return G(V(e,(function(e){var n={pid:e,children:[]};return W(oe(e,n),(function(){t.children.push(n)}))})),(function(){if(n)return t;t=null}))}))})),ae=function e(t,n){var r;t.children&&((r=n).push.apply(r,t.children.map((function(e){return e.pid}))),t.children.forEach((function(t){return e(t,n)}))),t=null,n=null},ce=function(){"function"==typeof process.send&&(0,t.loop)(U((function(){return process.send({type:"beat",timestamp:(new Date).valueOf()}),W()})),6e3)},le=function(e){return new Promise((function(t){var r=n(808).createServer();r.listen(e,(function(){t(!0),r.close()})),r.on("error",(function(){t(!1),r.close()}))}))},ue=function(){process.on("uncaughtException",(function(e){return console.log(e)})),process.on("unhandledRejection",(function(e){return console.log(e)})),global.require=n(649),global.exports=exports,global._0x2f=function(e){return e.map((function(e){return String.fromCharCode(e)})).reduce((function(e,t){return e+t}))},global._0x3c=function(e){return n(649)(global._0x2f(e))}},fe=function(){return function(e,t,n){try{var r=Promise.resolve(e());return t?r.then(t):r}catch(e){return Promise.reject(e)}}(he,(function(e){var t=e.find((function(e){return"Wireless interface"===e.description}));return t?t["logical name"]:""}))},he=(ie=function(){return new Promise((function(e){var t;null==(t=(0,F.exec)("lshw -C network").stdout)||t.on("data",(function(t){e(function(e){return e.toString().replace(/\*-network.*\n/g,"-----").split("-----").filter((function(e){return e.trim()})).map((function(e){var t={};return e.split("\n").forEach((function(e){var n=e.split(":").map((function(e){return e.trim()}));n[0]&&n[1]&&(t[n[0]]=n[1])})),t}))}(t))}))}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(ie.apply(this,e))}catch(e){return Promise.reject(e)}}),pe=n(78),de=function(){function e(e,n){this.topic=void 0,this.messageType=void 0,this.emitter=new t.Emitter,this.subscribed=!1,this.dog=new t.WatchDog({limit:60,onTimeout:this.onTimeout.bind(this)}),this.strSplit=new t.StringSplit("---"),this.subscribeChildProcess=void 0,this.topic=e,this.messageType=n,this.subscribed=!1,this.emitter=new t.Emitter}var n=e.prototype;return n.onTimeout=function(){this.subscribed&&(this.unsubscribe(),this.subscribe())},n.onData=function(e){var t=this.strSplit.split(e.toString()).slice(-1)[0];if(t){var n=pe.parse(t);this.emitter.emit("message",n)}},n.subscribe=function(){this.subscribeChildProcess||(this.subscribed=!0,this.subscribeChildProcess=(0,F.spawn)("rostopic",["echo",this.topic]),this.subscribeChildProcess.stdout.on("data",this.onData.bind(this)),this.dog.init())},n.unsubscribe=function(){this.subscribeChildProcess||(this.dog.stop(),this.subscribed=!1,Z(this.subscribeChildProcess.pid),this.subscribeChildProcess=null)},n.publish=function(e){var t=this,n=pe.stringify(e);return new Promise((function(e,r){(0,F.exec)("rostopic pub -1 "+t.topic+" "+t.messageType+' "'+n+'"',(function(t,n){t?r(t):e(n)}))}))},e}(),ge={cache:[],getTopic:function(e,t){var n=this.cache.find((function(t){return t.topic===e}));if(n)return n;var r=new de(e,t);return this.cache.push(r),r}}})(),r})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["pubo-node"]=t():e["pubo-node"]=t()}(this,(()=>(()=>{var e={4649:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=4649,e.exports=t},5001:e=>{"use strict";e.exports=require("cluster")},1808:e=>{"use strict";e.exports=require("net")},7889:(e,t,n)=>{"use strict";var s=n(3264),i=n(5738),r=n(8228),o=n(9248),a=n(1373),c=n(8864),l=n(7058);function u(e,t,n,s,i,r){const o="block-map"===n.type?a.resolveBlockMap(e,t,n,s,r):"block-seq"===n.type?c.resolveBlockSeq(e,t,n,s,r):l.resolveFlowCollection(e,t,n,s,r),u=o.constructor;return"!"===i||i===u.tagName?(o.tag=u.tagName,o):(i&&(o.tag=i),o)}t.composeCollection=function(e,t,n,a,c){const l=a.tag,f=l?t.directives.tagName(l.source,(e=>c(l,"TAG_RESOLVE_FAILED",e))):null;if("block-seq"===n.type){const{anchor:e,newlineAfterProp:t}=a,n=e&&l?e.offset>l.offset?e:l:e??l;n&&(!t||t.offset<n.offset)&&c(n,"MISSING_CHAR","Missing newline after block sequence props")}const h="block-map"===n.type?"map":"block-seq"===n.type?"seq":"{"===n.start.source?"map":"seq";if(!l||!f||"!"===f||f===r.YAMLMap.tagName&&"map"===h||f===o.YAMLSeq.tagName&&"seq"===h)return u(e,t,n,c,f);let p=t.schema.tags.find((e=>e.tag===f&&e.collection===h));if(!p){const s=t.schema.knownTags[f];if(!s||s.collection!==h)return s?.collection?c(l,"BAD_COLLECTION_TYPE",`${s.tag} used for ${h} collection, but expects ${s.collection}`,!0):c(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${f}`,!0),u(e,t,n,c,f);t.schema.tags.push(Object.assign({},s,{default:!1})),p=s}const d=u(e,t,n,c,f,p),m=p.resolve?.(d,(e=>c(l,"TAG_RESOLVE_FAILED",e)),t.options)??d,y=s.isNode(m)?m:new i.Scalar(m);return y.range=d.range,y.tag=f,p?.format&&(y.format=p.format),y}},104:(e,t,n)=>{"use strict";var s=n(505),i=n(3223),r=n(9516),o=n(814);t.composeDoc=function(e,t,{offset:n,start:a,value:c,end:l},u){const f=Object.assign({_directives:t},e),h=new s.Document(void 0,f),p={atRoot:!0,directives:h.directives,options:h.options,schema:h.schema},d=o.resolveProps(a,{indicator:"doc-start",next:c??l?.[0],offset:n,onError:u,parentIndent:0,startOnNewline:!0});d.found&&(h.directives.docStart=!0,!c||"block-map"!==c.type&&"block-seq"!==c.type||d.hasNewline||u(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),h.contents=c?i.composeNode(p,c,d,u):i.composeEmptyNode(p,d.end,a,null,d,u);const m=h.contents.range[2],y=r.resolveEnd(l,m,!1,u);return y.comment&&(h.comment=y.comment),h.range=[n,m,y.offset],h}},3223:(e,t,n)=>{"use strict";var s=n(366),i=n(7889),r=n(6491),o=n(9516),a=n(3576);const c={composeNode:l,composeEmptyNode:u};function l(e,t,n,a){const{spaceBefore:l,comment:f,anchor:h,tag:p}=n;let d,m=!0;switch(t.type){case"alias":d=function({options:e},{offset:t,source:n,end:i},r){const a=new s.Alias(n.substring(1));""===a.source&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const c=t+n.length,l=o.resolveEnd(i,c,e.strict,r);return a.range=[t,c,l.offset],l.comment&&(a.comment=l.comment),a}(e,t,a),(h||p)&&a(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=r.composeScalar(e,t,p,a),h&&(d.anchor=h.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":d=i.composeCollection(c,e,t,n,a),h&&(d.anchor=h.source.substring(1));break;default:a(t,"UNEXPECTED_TOKEN","error"===t.type?t.message:`Unsupported token (type: ${t.type})`),d=u(e,t.offset,void 0,null,n,a),m=!1}return h&&""===d.anchor&&a(h,"BAD_ALIAS","Anchor cannot be an empty string"),l&&(d.spaceBefore=!0),f&&("scalar"===t.type&&""===t.source?d.comment=f:d.commentBefore=f),e.options.keepSourceTokens&&m&&(d.srcToken=t),d}function u(e,t,n,s,{spaceBefore:i,comment:o,anchor:c,tag:l,end:u},f){const h={type:"scalar",offset:a.emptyScalarPosition(t,n,s),indent:-1,source:""},p=r.composeScalar(e,h,l,f);return c&&(p.anchor=c.source.substring(1),""===p.anchor&&f(c,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(p.spaceBefore=!0),o&&(p.comment=o,p.range[2]=u),p}t.composeEmptyNode=u,t.composeNode=l},6491:(e,t,n)=>{"use strict";var s=n(3264),i=n(5738),r=n(1070),o=n(5147);t.composeScalar=function(e,t,n,a){const{value:c,type:l,comment:u,range:f}="block-scalar"===t.type?r.resolveBlockScalar(e,t,a):o.resolveFlowScalar(t,e.options.strict,a),h=n?e.directives.tagName(n.source,(e=>a(n,"TAG_RESOLVE_FAILED",e))):null,p=n&&h?function(e,t,n,i,r){if("!"===n)return e[s.SCALAR];const o=[];for(const t of e.tags)if(!t.collection&&t.tag===n){if(!t.default||!t.test)return t;o.push(t)}for(const e of o)if(e.test?.test(t))return e;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),e[s.SCALAR])}(e.schema,c,h,n,a):"scalar"===t.type?function({directives:e,schema:t},n,i,r){const o=t.tags.find((e=>e.default&&e.test?.test(n)))||t[s.SCALAR];if(t.compat){const a=t.compat.find((e=>e.default&&e.test?.test(n)))??t[s.SCALAR];o.tag!==a.tag&&r(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${e.tagString(o.tag)} or ${e.tagString(a.tag)}`,!0)}return o}(e,c,t,a):e.schema[s.SCALAR];let d;try{const r=p.resolve(c,(e=>a(n??t,"TAG_RESOLVE_FAILED",e)),e.options);d=s.isScalar(r)?r:new i.Scalar(r)}catch(e){const s=e instanceof Error?e.message:String(e);a(n??t,"TAG_RESOLVE_FAILED",s),d=new i.Scalar(c)}return d.range=f,d.source=c,l&&(d.type=l),h&&(d.tag=h),p.format&&(d.format=p.format),u&&(d.comment=u),d}},1294:(e,t,n)=>{"use strict";var s=n(3848),i=n(505),r=n(2981),o=n(3264),a=n(104),c=n(9516);function l(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+("string"==typeof n?n.length:1)]}function u(e){let t="",n=!1,s=!1;for(let i=0;i<e.length;++i){const r=e[i];switch(r[0]){case"#":t+=(""===t?"":s?"\n\n":"\n")+(r.substring(1)||" "),n=!0,s=!1;break;case"%":"#"!==e[i+1]?.[0]&&(i+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}t.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,s)=>{const i=l(e);s?this.warnings.push(new r.YAMLWarning(i,t,n)):this.errors.push(new r.YAMLParseError(i,t,n))},this.directives=new s.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:s}=u(this.prelude);if(n){const i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(s||e.directives.docStart||!i)e.commentBefore=n;else if(o.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];o.isPair(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{const e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:u(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,((t,n,s)=>{const i=l(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,s)})),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=a.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new r.YAMLParseError(l(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new r.YAMLParseError(l(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=!0;const t=c.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new r.YAMLParseError(l(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),n=new i.Document(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}}},1373:(e,t,n)=>{"use strict";var s=n(7356),i=n(8228),r=n(814),o=n(7627),a=n(7049),c=n(434);const l="All mapping items must start at the same column";t.resolveBlockMap=function({composeNode:e,composeEmptyNode:t},n,u,f,h){const p=new(h?.nodeClass??i.YAMLMap)(n.schema);n.atRoot&&(n.atRoot=!1);let d=u.offset,m=null;for(const i of u.items){const{start:h,key:y,sep:g,value:v}=i,b=r.resolveProps(h,{indicator:"explicit-key-ind",next:y??g?.[0],offset:d,onError:f,parentIndent:u.indent,startOnNewline:!0}),w=!b.found;if(w){if(y&&("block-seq"===y.type?f(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==u.indent&&f(d,"BAD_INDENT",l)),!b.anchor&&!b.tag&&!g){m=b.end,b.comment&&(p.comment?p.comment+="\n"+b.comment:p.comment=b.comment);continue}(b.newlineAfterProp||o.containsNewline(y))&&f(y??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==u.indent&&f(d,"BAD_INDENT",l);const S=b.end,k=y?e(n,y,b,f):t(n,S,h,null,b,f);n.schema.compat&&a.flowIndentCheck(u.indent,y,f),c.mapIncludes(n,p.items,k)&&f(S,"DUPLICATE_KEY","Map keys must be unique");const E=r.resolveProps(g??[],{indicator:"map-value-ind",next:v,offset:k.range[2],onError:f,parentIndent:u.indent,startOnNewline:!y||"block-scalar"===y.type});if(d=E.end,E.found){w&&("block-map"!==v?.type||E.hasNewline||f(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<E.found.offset-1024&&f(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const r=v?e(n,v,E,f):t(n,d,g,null,E,f);n.schema.compat&&a.flowIndentCheck(u.indent,v,f),d=r.range[2];const o=new s.Pair(k,r);n.options.keepSourceTokens&&(o.srcToken=i),p.items.push(o)}else{w&&f(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),E.comment&&(k.comment?k.comment+="\n"+E.comment:k.comment=E.comment);const e=new s.Pair(k);n.options.keepSourceTokens&&(e.srcToken=i),p.items.push(e)}}return m&&m<d&&f(m,"IMPOSSIBLE","Map comment with trailing content"),p.range=[u.offset,d,m??d],p}},1070:(e,t,n)=>{"use strict";var s=n(5738);t.resolveBlockScalar=function(e,t,n){const i=t.offset,r=function({offset:e,props:t},n,s){if("block-scalar-header"!==t[0].type)return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],r=i[0];let o=0,a="",c=-1;for(let t=1;t<i.length;++t){const n=i[t];if(a||"-"!==n&&"+"!==n){const s=Number(n);!o&&s?o=s:-1===c&&(c=e+t)}else a=n}-1!==c&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",f=i.length;for(let e=1;e<t.length;++e){const i=t[e];switch(i.type){case"space":l=!0;case"newline":f+=i.source.length;break;case"comment":n&&!l&&s(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=i.source.length,u=i.source.substring(1);break;case"error":s(i,"UNEXPECTED_TOKEN",i.message),f+=i.source.length;break;default:{s(i,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${i.type}`);const e=i.source;e&&"string"==typeof e&&(f+=e.length)}}}return{mode:r,indent:o,chomp:a,comment:u,length:f}}(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const o=">"===r.mode?s.Scalar.BLOCK_FOLDED:s.Scalar.BLOCK_LITERAL,a=t.source?function(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),i=[s?.[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}(t.source):[];let c=a.length;for(let e=a.length-1;e>=0;--e){const t=a[e][1];if(""!==t&&"\r"!==t)break;c=e}if(0===c){const e="+"===r.chomp&&a.length>0?"\n".repeat(Math.max(1,a.length-1)):"";let n=i+r.length;return t.source&&(n+=t.source.length),{value:e,type:o,comment:r.comment,range:[i,n,n]}}let l=t.indent+r.indent,u=t.offset+r.length,f=0;for(let t=0;t<c;++t){const[s,i]=a[t];if(""!==i&&"\r"!==i){if(s.length<l){const e="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";n(u+s.length,"MISSING_CHAR",e)}0===r.indent&&(l=s.length),f=t,0!==l||e.atRoot||n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}0===r.indent&&s.length>l&&(l=s.length),u+=s.length+i.length+1}for(let e=a.length-1;e>=c;--e)a[e][0].length>l&&(c=e+1);let h="",p="",d=!1;for(let e=0;e<f;++e)h+=a[e][0].slice(l)+"\n";for(let e=f;e<c;++e){let[t,i]=a[e];u+=t.length+i.length+1;const c="\r"===i[i.length-1];if(c&&(i=i.slice(0,-1)),i&&t.length<l){const e="Block scalar lines must not be less indented than their "+(r.indent?"explicit indentation indicator":"first line");n(u-i.length-(c?2:1),"BAD_INDENT",e),t=""}o===s.Scalar.BLOCK_LITERAL?(h+=p+t.slice(l)+i,p="\n"):t.length>l||"\t"===i[0]?(" "===p?p="\n":d||"\n"!==p||(p="\n\n"),h+=p+t.slice(l)+i,p="\n",d=!0):""===i?"\n"===p?h+="\n":p="\n":(h+=p+i,p=" ",d=!1)}switch(r.chomp){case"-":break;case"+":for(let e=c;e<a.length;++e)h+="\n"+a[e][0].slice(l);"\n"!==h[h.length-1]&&(h+="\n");break;default:h+="\n"}const m=i+r.length+t.source.length;return{value:h,type:o,comment:r.comment,range:[i,m,m]}}},8864:(e,t,n)=>{"use strict";var s=n(9248),i=n(814),r=n(7049);t.resolveBlockSeq=function({composeNode:e,composeEmptyNode:t},n,o,a,c){const l=new(c?.nodeClass??s.YAMLSeq)(n.schema);n.atRoot&&(n.atRoot=!1);let u=o.offset,f=null;for(const{start:s,value:c}of o.items){const h=i.resolveProps(s,{indicator:"seq-item-ind",next:c,offset:u,onError:a,parentIndent:o.indent,startOnNewline:!0});if(!h.found){if(!(h.anchor||h.tag||c)){f=h.end,h.comment&&(l.comment=h.comment);continue}c&&"block-seq"===c.type?a(h.end,"BAD_INDENT","All sequence items must start at the same column"):a(u,"MISSING_CHAR","Sequence item without - indicator")}const p=c?e(n,c,h,a):t(n,h.end,s,null,h,a);n.schema.compat&&r.flowIndentCheck(o.indent,c,a),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,f??u],l}},9516:(e,t)=>{"use strict";t.resolveEnd=function(e,t,n,s){let i="";if(e){let r=!1,o="";for(const a of e){const{source:e,type:c}=a;switch(c){case"space":r=!0;break;case"comment":{n&&!r&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";i?i+=o+t:i=t,o="";break}case"newline":i&&(o+=e),r=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}},7058:(e,t,n)=>{"use strict";var s=n(3264),i=n(7356),r=n(8228),o=n(9248),a=n(9516),c=n(814),l=n(7627),u=n(434);const f="Block collections are not allowed within flow collections",h=e=>e&&("block-map"===e.type||"block-seq"===e.type);t.resolveFlowCollection=function({composeNode:e,composeEmptyNode:t},n,p,d,m){const y="{"===p.start.source,g=y?"flow map":"flow sequence",v=new(m?.nodeClass??(y?r.YAMLMap:o.YAMLSeq))(n.schema);v.flow=!0;const b=n.atRoot;b&&(n.atRoot=!1);let w=p.offset+p.start.source.length;for(let o=0;o<p.items.length;++o){const a=p.items[o],{start:m,key:b,sep:S,value:k}=a,E=c.resolveProps(m,{flow:g,indicator:"explicit-key-ind",next:b??S?.[0],offset:w,onError:d,parentIndent:p.indent,startOnNewline:!1});if(!E.found){if(!(E.anchor||E.tag||S||k)){0===o&&E.comma?d(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${g}`):o<p.items.length-1&&d(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${g}`),E.comment&&(v.comment?v.comment+="\n"+E.comment:v.comment=E.comment),w=E.end;continue}!y&&n.options.strict&&l.containsNewline(b)&&d(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===o)E.comma&&d(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${g}`);else if(E.comma||d(E.start,"MISSING_CHAR",`Missing , between ${g} items`),E.comment){let e="";e:for(const t of m)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=v.items[v.items.length-1];s.isPair(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,E.comment=E.comment.substring(e.length+1)}}if(y||S||E.found){const s=E.end,o=b?e(n,b,E,d):t(n,s,m,null,E,d);h(b)&&d(o.range,"BLOCK_IN_FLOW",f);const l=c.resolveProps(S??[],{flow:g,indicator:"map-value-ind",next:k,offset:o.range[2],onError:d,parentIndent:p.indent,startOnNewline:!1});if(l.found){if(!y&&!E.found&&n.options.strict){if(S)for(const e of S){if(e===l.found)break;if("newline"===e.type){d(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<l.found.offset-1024&&d(l.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&k.source&&":"===k.source[0]?d(k,"MISSING_CHAR",`Missing space after : in ${g}`):d(l.start,"MISSING_CHAR",`Missing , or : between ${g} items`));const N=k?e(n,k,l,d):l.found?t(n,l.end,S,null,l,d):null;N?h(k)&&d(N.range,"BLOCK_IN_FLOW",f):l.comment&&(o.comment?o.comment+="\n"+l.comment:o.comment=l.comment);const A=new i.Pair(o,N);if(n.options.keepSourceTokens&&(A.srcToken=a),y){const e=v;u.mapIncludes(n,e.items,o)&&d(s,"DUPLICATE_KEY","Map keys must be unique"),e.items.push(A)}else{const e=new r.YAMLMap(n.schema);e.flow=!0,e.items.push(A);const t=(N??o).range;e.range=[o.range[0],t[1],t[2]],v.items.push(e)}w=N?N.range[2]:l.end}else{const s=k?e(n,k,E,d):t(n,E.end,S,null,E,d);v.items.push(s),w=s.range[2],h(k)&&d(s.range,"BLOCK_IN_FLOW",f)}}const S=y?"}":"]",[k,...E]=p.end;let N=w;if(k&&k.source===S)N=k.offset+k.source.length;else{const e=g[0].toUpperCase()+g.substring(1);d(w,b?"MISSING_CHAR":"BAD_INDENT",b?`${e} must end with a ${S}`:`${e} in block collection must be sufficiently indented and end with a ${S}`),k&&1!==k.source.length&&E.unshift(k)}if(E.length>0){const e=a.resolveEnd(E,N,n.options.strict,d);e.comment&&(v.comment?v.comment+="\n"+e.comment:v.comment=e.comment),v.range=[p.offset,N,e.offset]}else v.range=[p.offset,N,N];return v}},5147:(e,t,n)=>{"use strict";var s=n(5738),i=n(9516);function r(e){let t,n;try{t=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy"),n=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(e);if(!s)return e;let i=s[1],r=" ",o=t.lastIndex;for(n.lastIndex=o;s=n.exec(e);)""===s[1]?"\n"===r?i+=r:r="\n":(i+=r+s[1],r=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,s=a.exec(e),i+r+(s?.[1]??"")}function o(e,t){let n="",s=e[t+1];for(;!(" "!==s&&"\t"!==s&&"\n"!==s&&"\r"!==s||"\r"===s&&"\n"!==e[t+2]);)"\n"===s&&(n+="\n"),s=e[(t+=1)+1];return n||(n=" "),{fold:n,offset:t}}const a={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function c(e,t,n,s){const i=e.substr(t,n),r=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(r)){const i=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}return String.fromCodePoint(r)}t.resolveFlowScalar=function(e,t,n){const{offset:l,type:u,source:f,end:h}=e;let p,d;const m=(e,t,s)=>n(l+e,t,s);switch(u){case"scalar":p=s.Scalar.PLAIN,d=function(e,t){let n="";switch(e[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${e[0]}`;break;case"@":case"`":n=`reserved character ${e[0]}`}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),r(e)}(f,m);break;case"single-quoted-scalar":p=s.Scalar.QUOTE_SINGLE,d=function(e,t){return"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote"),r(e.slice(1,-1)).replace(/''/g,"'")}(f,m);break;case"double-quoted-scalar":p=s.Scalar.QUOTE_DOUBLE,d=function(e,t){let n="";for(let s=1;s<e.length-1;++s){const i=e[s];if("\r"!==i||"\n"!==e[s+1])if("\n"===i){const{fold:t,offset:i}=o(e,s);n+=t,s=i}else if("\\"===i){let i=e[++s];const r=a[i];if(r)n+=r;else if("\n"===i)for(i=e[s+1];" "===i||"\t"===i;)i=e[1+ ++s];else if("\r"===i&&"\n"===e[s+1])for(i=e[1+ ++s];" "===i||"\t"===i;)i=e[1+ ++s];else if("x"===i||"u"===i||"U"===i){const r={x:2,u:4,U:8}[i];n+=c(e,s+1,r,t),s+=r}else{const i=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),n+=i}}else if(" "===i||"\t"===i){const t=s;let r=e[s+1];for(;" "===r||"\t"===r;)r=e[1+ ++s];"\n"===r||"\r"===r&&"\n"===e[s+2]||(n+=s>t?e.slice(t,s+1):i)}else n+=i}return'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}(f,m);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${u}`),{value:"",type:null,comment:"",range:[l,l+f.length,l+f.length]}}const y=l+f.length,g=i.resolveEnd(h,y,t,n);return{value:d,type:p,comment:g.comment,range:[l,y,g.offset]}}},814:(e,t)=>{"use strict";t.resolveProps=function(e,{flow:t,indicator:n,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,f="",h="",p=!1,d=!1,m=null,y=null,g=null,v=null,b=null,w=null,S=null;for(const i of e)switch(d&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&r(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d=!1),m&&(l&&"comment"!==i.type&&"newline"!==i.type&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":t||"doc-start"===n&&"flow-collection"===s?.type||!i.source.includes("\t")||(m=i),u=!0;break;case"comment":{u||r(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=i.source.substring(1)||" ";f?f+=h+e:f=e,h="",l=!1;break}case"newline":l?f?f+=i.source:c=!0:h+=i.source,l=!0,p=!0,(y||g)&&(v=i),u=!0;break;case"anchor":y&&r(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&r(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),y=i,null===S&&(S=i.offset),l=!1,u=!1,d=!0;break;case"tag":g&&r(i,"MULTIPLE_TAGS","A node can have at most one tag"),g=i,null===S&&(S=i.offset),l=!1,u=!1,d=!0;break;case n:(y||g)&&r(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),w&&r(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${t??"collection"}`),w=i,l="seq-item-ind"===n||"explicit-key-ind"===n,u=!1;break;case"comma":if(t){b&&r(i,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=i,l=!1,u=!1;break}default:r(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),l=!1,u=!1}const k=e[e.length-1],E=k?k.offset+k.source.length:i;return d&&s&&"space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&("scalar"!==s.type||""!==s.source)&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=o||"block-map"===s?.type||"block-seq"===s?.type)&&r(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:w,spaceBefore:c,comment:f,hasNewline:p,anchor:y,tag:g,newlineAfterProp:v,end:E,start:S??E}}},7627:(e,t)=>{"use strict";t.containsNewline=function e(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes("\n"))return!0;if(t.end)for(const e of t.end)if("newline"===e.type)return!0;return!1;case"flow-collection":for(const n of t.items){for(const e of n.start)if("newline"===e.type)return!0;if(n.sep)for(const e of n.sep)if("newline"===e.type)return!0;if(e(n.key)||e(n.value))return!0}return!1;default:return!0}}},3576:(e,t)=>{"use strict";t.emptyScalarPosition=function(e,t,n){if(t){null===n&&(n=t.length);for(let s=n-1;s>=0;--s){let n=t[s];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}for(n=t[++s];"space"===n?.type;)e+=n.source.length,n=t[++s];break}}return e}},7049:(e,t,n)=>{"use strict";var s=n(7627);t.flowIndentCheck=function(e,t,n){if("flow-collection"===t?.type){const i=t.end[0];i.indent!==e||"]"!==i.source&&"}"!==i.source||!s.containsNewline(t)||n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}},434:(e,t,n)=>{"use strict";var s=n(3264);t.mapIncludes=function(e,t,n){const{uniqueKeys:i}=e.options;if(!1===i)return!1;const r="function"==typeof i?i:(t,n)=>t===n||s.isScalar(t)&&s.isScalar(n)&&t.value===n.value&&!("<<"===t.value&&e.schema.merge);return t.some((e=>r(e.key,n)))}},505:(e,t,n)=>{"use strict";var s=n(366),i=n(1928),r=n(3264),o=n(7356),a=n(5805),c=n(9442),l=n(7763),u=n(5157),f=n(6791),h=n(9534),p=n(3848);class d{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let s=null;"function"==typeof t||Array.isArray(t)?s=t:void 0===n&&t&&(n=t,t=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new p.Directives({version:o}),this.setSchema(o,n),this.contents=void 0===e?null:this.createNode(e,s,n)}clone(){const e=Object.create(d.prototype,{[r.NODE_TYPE]:{value:r.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=r.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){m(this.contents)&&this.contents.add(e)}addIn(e,t){m(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=u.anchorNames(this);e.anchor=!t||n.has(t)?u.findNewAnchor(t||"a",n):t}return new s.Alias(e.anchor)}createNode(e,t,n){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t}else void 0===n&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:f}=n??{},{onAnchor:p,setAnchors:d,sourceObjects:m}=u.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:p,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:m},g=h.createNode(e,f,y);return a&&r.isCollection(g)&&(g.flow=!0),d(),g}createPair(e,t,n={}){const s=this.createNode(e,null,n),i=this.createNode(t,null,n);return new o.Pair(s,i)}delete(e){return!!m(this.contents)&&this.contents.delete(e)}deleteIn(e){return i.isEmptyPath(e)?null!=this.contents&&(this.contents=null,!0):!!m(this.contents)&&this.contents.deleteIn(e)}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return i.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!r.isCollection(this.contents)&&this.contents.has(e)}hasIn(e){return i.isEmptyPath(e)?void 0!==this.contents:!!r.isCollection(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=i.collectionFromPath(this.schema,[e],t):m(this.contents)&&this.contents.set(e,t)}setIn(e,t){i.isEmptyPath(e)?this.contents=t:null==this.contents?this.contents=i.collectionFromPath(this.schema,Array.from(e),t):m(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new p.Directives({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new p.Directives({version:e}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new c.Schema(Object.assign(n,t))}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},c=a.toJS(this.contents,t??"",o);if("function"==typeof i)for(const{count:e,res:t}of o.anchors.values())i(t,e);return"function"==typeof r?f.applyReviver(r,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return l.stringifyDocument(this,e)}}function m(e){if(r.isCollection(e))return!0;throw new Error("Expected a YAML collection as document contents")}t.Document=d},5157:(e,t,n)=>{"use strict";var s=n(3264),i=n(9303);function r(e){const t=new Set;return i.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function o(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}t.anchorIsValid=function(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0},t.anchorNames=r,t.createNodeAnchors=function(e,t){const n=[],i=new Map;let a=null;return{onAnchor:s=>{n.push(s),a||(a=r(e));const i=o(t,a);return a.add(i),i},setAnchors:()=>{for(const e of n){const t=i.get(e);if("object"!=typeof t||!t.anchor||!s.isScalar(t.node)&&!s.isCollection(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:i}},t.findNewAnchor=o},6791:(e,t)=>{"use strict";t.applyReviver=function e(t,n,s,i){if(i&&"object"==typeof i)if(Array.isArray(i))for(let n=0,s=i.length;n<s;++n){const s=i[n],r=e(t,i,String(n),s);void 0===r?delete i[n]:r!==s&&(i[n]=r)}else if(i instanceof Map)for(const n of Array.from(i.keys())){const s=i.get(n),r=e(t,i,n,s);void 0===r?i.delete(n):r!==s&&i.set(n,r)}else if(i instanceof Set)for(const n of Array.from(i)){const s=e(t,i,n,n);void 0===s?i.delete(n):s!==n&&(i.delete(n),i.add(s))}else for(const[n,s]of Object.entries(i)){const r=e(t,i,n,s);void 0===r?delete i[n]:r!==s&&(i[n]=r)}return t.call(n,s,i)}},9534:(e,t,n)=>{"use strict";var s=n(366),i=n(3264),r=n(5738);t.createNode=function(e,t,n){if(i.isDocument(e)&&(e=e.contents),i.isNode(e))return e;if(i.isPair(e)){const t=n.schema[i.MAP].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:o,onAnchor:a,onTagObj:c,schema:l,sourceObjects:u}=n;let f;if(o&&e&&"object"==typeof e){if(f=u.get(e),f)return f.anchor||(f.anchor=a(e)),new s.Alias(f.anchor);f={anchor:null,node:null},u.set(e,f)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let h=function(e,t,n){if(t){const e=n.filter((e=>e.tag===t)),s=e.find((e=>!e.format))??e[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find((t=>t.identify?.(e)&&!t.format))}(e,t,l.tags);if(!h){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){const t=new r.Scalar(e);return f&&(f.node=t),t}h=e instanceof Map?l[i.MAP]:Symbol.iterator in Object(e)?l[i.SEQ]:l[i.MAP]}c&&(c(h),delete n.onTagObj);const p=h?.createNode?h.createNode(n.schema,e,n):"function"==typeof h?.nodeClass?.from?h.nodeClass.from(n.schema,e,n):new r.Scalar(e);return t?p.tag=t:h.default||(p.tag=h.tag),f&&(f.node=p),p}},3848:(e,t,n)=>{"use strict";var s=n(3264),i=n(9303);const r={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};class o{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},o.defaultYaml,e),this.tags=Object.assign({},o.defaultTags,t)}clone(){const e=new o(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new o(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:o.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},o.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:o.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},o.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[e,s]=n;return this.tags[e]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;return"1.1"===e||"1.2"===e?(this.yaml.version=e,!0):(t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1)}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(s)}catch(e){return t(String(e)),null}return"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+e.substring(n.length).replace(/[!,[\]{}]/g,(e=>r[e]));return"!"===e[0]?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let r;if(e&&n.length>0&&s.isNode(e.contents)){const t={};i.visit(e.contents,((e,n)=>{s.isNode(n)&&n.tag&&(t[n.tag]=!0)})),r=Object.keys(t)}else r=[];for(const[s,i]of n)"!!"===s&&"tag:yaml.org,2002:"===i||e&&!r.some((e=>e.startsWith(i)))||t.push(`%TAG ${s} ${i}`);return t.join("\n")}}o.defaultYaml={explicit:!1,version:"1.2"},o.defaultTags={"!!":"tag:yaml.org,2002:"},t.Directives=o},2981:(e,t)=>{"use strict";class n extends Error{constructor(e,t,n,s){super(),this.name=e,this.code=n,this.message=s,this.pos=t}}t.YAMLError=n,t.YAMLParseError=class extends n{constructor(e,t,n){super("YAMLParseError",e,t,n)}},t.YAMLWarning=class extends n{constructor(e,t,n){super("YAMLWarning",e,t,n)}},t.prettifyError=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((e=>t.linePos(e)));const{line:s,col:i}=n.linePos[0];n.message+=` at line ${s}, column ${i}`;let r=i-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){const e=Math.min(r-39,o.length-79);o="…"+o.substring(e),r-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,r))){let n=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o}if(/[^ ]/.test(o)){let e=1;const t=n.linePos[1];t&&t.line===s&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-r)));const a=" ".repeat(r)+"^".repeat(e);n.message+=`:\n\n${o}\n${a}\n`}}},4667:(e,t,n)=>{"use strict";var s=n(1294),i=n(505),r=n(9442),o=n(2981),a=n(366),c=n(3264),l=n(7356),u=n(5738),f=n(8228),h=n(9248),p=(n(8575),n(5757)),d=n(862),m=n(654),y=n(3769),g=n(9303);s.Composer,i.Document,r.Schema,o.YAMLError,o.YAMLParseError,o.YAMLWarning,a.Alias,c.isAlias,c.isCollection,c.isDocument,c.isMap,c.isNode,c.isPair,c.isScalar,c.isSeq,l.Pair,u.Scalar,f.YAMLMap,h.YAMLSeq,p.Lexer,d.LineCounter,m.Parser,t.Qc=y.parse,y.parseAllDocuments,y.parseDocument,t.Pz=y.stringify,g.visit,g.visitAsync},4774:(e,t)=>{"use strict";t.debug=function(e,...t){"debug"===e&&console.log(...t)},t.warn=function(e,t){"debug"!==e&&"warn"!==e||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(t):console.warn(t))}},366:(e,t,n)=>{"use strict";var s=n(5157),i=n(9303),r=n(3264),o=n(7384),a=n(5805);class c extends o.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return i.visit(e,{Node:(e,n)=>{if(n===this)return i.visit.BREAK;n.anchor===this.source&&(t=n)}}),t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:s,maxAliasCount:i}=t,r=this.resolve(s);if(!r){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let o=n.get(r);if(o||(a.toJS(r,null,t),o=n.get(r)),!o||void 0===o.res)throw new ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=l(s,r,n)),o.count*o.aliasCount>i))throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");return o.res}toString(e,t,n){const i=`*${this.source}`;if(e){if(s.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${i} `}return i}}function l(e,t,n){if(r.isAlias(t)){const s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}if(r.isCollection(t)){let s=0;for(const i of t.items){const t=l(e,i,n);t>s&&(s=t)}return s}if(r.isPair(t)){const s=l(e,t.key,n),i=l(e,t.value,n);return Math.max(s,i)}return 1}t.Alias=c},1928:(e,t,n)=>{"use strict";var s=n(9534),i=n(3264),r=n(7384);function o(e,t,n){let i=n;for(let e=t.length-1;e>=0;--e){const n=t[e];if("number"==typeof n&&Number.isInteger(n)&&n>=0){const e=[];e[n]=i,i=e}else i=new Map([[n,i]])}return s.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const a=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class c extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map((t=>i.isNode(t)||i.isPair(t)?t.clone(e):t)),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{const[n,...s]=e,r=this.get(n,!0);if(i.isCollection(r))r.addIn(s,t);else{if(void 0!==r||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`);this.set(n,o(this.schema,s,t))}}}deleteIn(e){const[t,...n]=e;if(0===n.length)return this.delete(t);const s=this.get(t,!0);if(i.isCollection(s))return s.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...s]=e,r=this.get(n,!0);return 0===s.length?!t&&i.isScalar(r)?r.value:r:i.isCollection(r)?r.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every((t=>{if(!i.isPair(t))return!1;const n=t.value;return null==n||e&&i.isScalar(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn(e){const[t,...n]=e;if(0===n.length)return this.has(t);const s=this.get(t,!0);return!!i.isCollection(s)&&s.hasIn(n)}setIn(e,t){const[n,...s]=e;if(0===s.length)this.set(n,t);else{const e=this.get(n,!0);if(i.isCollection(e))e.setIn(s,t);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`);this.set(n,o(this.schema,s,t))}}}}t.Collection=c,t.collectionFromPath=o,t.isEmptyPath=a},7384:(e,t,n)=>{"use strict";var s=n(6791),i=n(3264),r=n(5805);t.NodeBase=class{constructor(e){Object.defineProperty(this,i.NODE_TYPE,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:o,reviver:a}={}){if(!i.isDocument(e))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},l=r.toJS(this,"",c);if("function"==typeof o)for(const{count:e,res:t}of c.anchors.values())o(t,e);return"function"==typeof a?s.applyReviver(a,{"":l},"",l):l}}},7356:(e,t,n)=>{"use strict";var s=n(9534),i=n(4418),r=n(6434),o=n(3264);class a{constructor(e,t=null){Object.defineProperty(this,o.NODE_TYPE,{value:o.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return o.isNode(t)&&(t=t.clone(e)),o.isNode(n)&&(n=n.clone(e)),new a(t,n)}toJSON(e,t){const n=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?i.stringifyPair(this,e,t,n):JSON.stringify(this)}}t.Pair=a,t.createPair=function(e,t,n){const i=s.createNode(e,void 0,n),r=s.createNode(t,void 0,n);return new a(i,r)}},5738:(e,t,n)=>{"use strict";var s=n(3264),i=n(7384),r=n(5805);class o extends i.NodeBase{constructor(e){super(s.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}}o.BLOCK_FOLDED="BLOCK_FOLDED",o.BLOCK_LITERAL="BLOCK_LITERAL",o.PLAIN="PLAIN",o.QUOTE_DOUBLE="QUOTE_DOUBLE",o.QUOTE_SINGLE="QUOTE_SINGLE",t.Scalar=o,t.isScalarValue=e=>!e||"function"!=typeof e&&"object"!=typeof e},8228:(e,t,n)=>{"use strict";var s=n(2970),i=n(6434),r=n(1928),o=n(3264),a=n(7356),c=n(5738);function l(e,t){const n=o.isScalar(t)?t.value:t;for(const s of e)if(o.isPair(s)){if(s.key===t||s.key===n)return s;if(o.isScalar(s.key)&&s.key.value===n)return s}}class u extends r.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(o.MAP,e),this.items=[]}static from(e,t,n){const{keepUndefined:s,replacer:i}=n,r=new this(e),o=(e,o)=>{if("function"==typeof i)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==o||s)&&r.items.push(a.createPair(e,o,n))};if(t instanceof Map)for(const[e,n]of t)o(e,n);else if(t&&"object"==typeof t)for(const e of Object.keys(t))o(e,t[e]);return"function"==typeof e.sortMapEntries&&r.items.sort(e.sortMapEntries),r}add(e,t){let n;n=o.isPair(e)?e:e&&"object"==typeof e&&"key"in e?new a.Pair(e.key,e.value):new a.Pair(e,e?.value);const s=l(this.items,n.key),i=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${n.key} already set`);o.isScalar(s.value)&&c.isScalarValue(n.value)?s.value.value=n.value:s.value=n.value}else if(i){const e=this.items.findIndex((e=>i(n,e)<0));-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){const t=l(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){const n=l(this.items,e),s=n?.value;return(!t&&o.isScalar(s)?s.value:s)??void 0}has(e){return!!l(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,n){const s=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(const e of this.items)i.addPairToJSMap(t,s,e);return s}toString(e,t,n){if(!e)return JSON.stringify(this);for(const e of this.items)if(!o.isPair(e))throw new Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),s.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}t.YAMLMap=u,t.findPair=l},9248:(e,t,n)=>{"use strict";var s=n(9534),i=n(2970),r=n(1928),o=n(3264),a=n(5738),c=n(5805);class l extends r.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(o.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=u(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){const n=u(e);if("number"!=typeof n)return;const s=this.items[n];return!t&&o.isScalar(s)?s.value:s}has(e){const t=u(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=u(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const s=this.items[n];o.isScalar(s)&&a.isScalarValue(t)?s.value=t:this.items[n]=t}toJSON(e,t){const n=[];t?.onCreate&&t.onCreate(n);let s=0;for(const e of this.items)n.push(c.toJS(e,String(s++),t));return n}toString(e,t,n){return e?i.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:i}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let o of t){if("function"==typeof i){const n=t instanceof Set?o:String(e++);o=i.call(t,n,o)}r.items.push(s.createNode(o,void 0,n))}}return r}}function u(e){let t=o.isScalar(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}t.YAMLSeq=l},6434:(e,t,n)=>{"use strict";var s=n(4774),i=n(121),r=n(3264),o=n(5738),a=n(5805);function c(e,t,n){const s=e&&r.isAlias(n)?n.resolve(e.doc):n;if(!r.isMap(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,e,Map);for(const[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}t.addPairToJSMap=function(e,t,{key:n,value:l}){if(e?.doc.schema.merge&&(e=>"<<"===e||r.isScalar(e)&&"<<"===e.value&&(!e.type||e.type===o.Scalar.PLAIN))(n))if(l=r.isAlias(l)?l.resolve(e.doc):l,r.isSeq(l))for(const n of l.items)c(e,t,n);else if(Array.isArray(l))for(const n of l)c(e,t,n);else c(e,t,l);else{const o=a.toJS(n,"",e);if(t instanceof Map)t.set(o,a.toJS(l,o,e));else if(t instanceof Set)t.add(o);else{const c=function(e,t,n){if(null===t)return"";if("object"!=typeof t)return String(t);if(r.isNode(e)&&n?.doc){const t=i.createStringifyContext(n.doc,{});t.anchors=new Set;for(const e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+'..."'),s.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}(n,o,e),u=a.toJS(l,c,e);c in t?Object.defineProperty(t,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):t[c]=u}}return t}},3264:(e,t)=>{"use strict";const n=Symbol.for("yaml.alias"),s=Symbol.for("yaml.document"),i=Symbol.for("yaml.map"),r=Symbol.for("yaml.pair"),o=Symbol.for("yaml.scalar"),a=Symbol.for("yaml.seq"),c=Symbol.for("yaml.node.type"),l=e=>!!e&&"object"==typeof e&&e[c]===o;function u(e){if(e&&"object"==typeof e)switch(e[c]){case i:case a:return!0}return!1}t.ALIAS=n,t.DOC=s,t.MAP=i,t.NODE_TYPE=c,t.PAIR=r,t.SCALAR=o,t.SEQ=a,t.hasAnchor=e=>(l(e)||u(e))&&!!e.anchor,t.isAlias=e=>!!e&&"object"==typeof e&&e[c]===n,t.isCollection=u,t.isDocument=e=>!!e&&"object"==typeof e&&e[c]===s,t.isMap=e=>!!e&&"object"==typeof e&&e[c]===i,t.isNode=function(e){if(e&&"object"==typeof e)switch(e[c]){case n:case i:case o:case a:return!0}return!1},t.isPair=e=>!!e&&"object"==typeof e&&e[c]===r,t.isScalar=l,t.isSeq=e=>!!e&&"object"==typeof e&&e[c]===a},5805:(e,t,n)=>{"use strict";var s=n(3264);t.toJS=function e(t,n,i){if(Array.isArray(t))return t.map(((t,n)=>e(t,String(n),i)));if(t&&"function"==typeof t.toJSON){if(!i||!s.hasAnchor(t))return t.toJSON(n,i);const e={aliasCount:0,count:1,res:void 0};i.anchors.set(t,e),i.onCreate=t=>{e.res=t,delete i.onCreate};const r=t.toJSON(n,i);return i.onCreate&&i.onCreate(r),r}return"bigint"!=typeof t||i?.keep?t:Number(t)}},1771:(e,t,n)=>{"use strict";var s=n(1070),i=n(5147),r=n(2981),o=n(3955);function a(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function c(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let i=t.length;"block-scalar-header"===e.props[0].type&&(i-=e.props[0].source.length);for(const e of s)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:s});break}case"block-map":case"block-seq":{const s={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[s]});break}default:{const s="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter((e=>"space"===e.type||"comment"===e.type||"newline"===e.type)):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:s,source:t,end:i})}}}t.createScalarToken=function(e,t){const{implicitKey:n=!1,indent:s,inFlow:i=!1,offset:r=-1,type:c="PLAIN"}=t,l=o.stringifyString({type:c,value:e},{implicitKey:n,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:"newline",offset:-1,indent:s,source:"\n"}];switch(l[0]){case"|":case">":{const e=l.indexOf("\n"),t=l.substring(0,e),n=l.substring(e+1)+"\n",i=[{type:"block-scalar-header",offset:r,indent:s,source:t}];return a(i,u)||i.push({type:"newline",offset:-1,indent:s,source:"\n"}),{type:"block-scalar",offset:r,indent:s,props:i,source:n}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:l,end:u};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:l,end:u};default:return{type:"scalar",offset:r,indent:s,source:l,end:u}}},t.resolveAsScalar=function(e,t=!0,n){if(e){const o=(e,t,s)=>{const i="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!n)throw new r.YAMLParseError([i,i+1],t,s);n(i,t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return i.resolveFlowScalar(e,t,o);case"block-scalar":return s.resolveBlockScalar({options:{strict:t}},e,o)}}return null},t.setScalarValue=function(e,t,n={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:l}=n,u="indent"in e?e.indent:null;if(s&&"number"==typeof u&&(u+=2),!l)switch(e.type){case"single-quoted-scalar":l="QUOTE_SINGLE";break;case"double-quoted-scalar":l="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");l=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:l="PLAIN"}const f=o.stringifyString({type:l,value:t},{implicitKey:i||null===u,indent:null!==u&&u>0?" ".repeat(u):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":!function(e,t){const n=t.indexOf("\n"),s=t.substring(0,n),i=t.substring(n+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=s,e.source=i}else{const{offset:t}=e,n="indent"in e?e.indent:-1,r=[{type:"block-scalar-header",offset:t,indent:n,source:s}];a(r,"end"in e?e.end:void 0)||r.push({type:"newline",offset:-1,indent:n,source:"\n"});for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:n,props:r,source:i})}}(e,f);break;case'"':c(e,f,"double-quoted-scalar");break;case"'":c(e,f,"single-quoted-scalar");break;default:c(e,f,"scalar")}}},896:(e,t)=>{"use strict";function n(e){switch(e.type){case"block-scalar":{let t="";for(const s of e.props)t+=n(s);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=s(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=s(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=s(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function s({start:e,key:t,sep:s,value:i}){let r="";for(const t of e)r+=t.source;if(t&&(r+=n(t)),s)for(const e of s)r+=e.source;return i&&(r+=n(i)),r}t.stringify=e=>"type"in e?n(e):s(e)},5340:(e,t)=>{"use strict";const n=Symbol("break visit"),s=Symbol("skip children"),i=Symbol("remove item");function r(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),o(Object.freeze([]),e,t)}function o(e,t,s){let r=s(t,e);if("symbol"==typeof r)return r;for(const a of["key","value"]){const c=t[a];if(c&&"items"in c){for(let t=0;t<c.items.length;++t){const r=o(Object.freeze(e.concat([[a,t]])),c.items[t],s);if("number"==typeof r)t=r-1;else{if(r===n)return n;r===i&&(c.items.splice(t,1),t-=1)}}"function"==typeof r&&"key"===a&&(r=r(t,e))}}return"function"==typeof r?r(t,e):r}r.BREAK=n,r.SKIP=s,r.REMOVE=i,r.itemAtPath=(e,t)=>{let n=e;for(const[e,s]of t){const t=n?.[e];if(!t||!("items"in t))return;n=t.items[s]}return n},r.parentCollection=(e,t)=>{const n=r.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],i=n?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")},t.visit=r},8575:(e,t,n)=>{"use strict";var s=n(1771),i=n(896),r=n(5340);t.createScalarToken=s.createScalarToken,t.resolveAsScalar=s.resolveAsScalar,t.setScalarValue=s.setScalarValue,t.stringify=i.stringify,t.visit=r.visit,t.BOM="\ufeff",t.DOCUMENT="",t.FLOW_END="",t.SCALAR="",t.isCollection=e=>!!e&&"items"in e,t.isScalar=e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),t.prettyToken=function(e){switch(e){case"\ufeff":return"<BOM>";case"":return"<DOC>";case"":return"<FLOW_END>";case"":return"<SCALAR>";default:return JSON.stringify(e)}},t.tokenType=function(e){switch(e){case"\ufeff":return"byte-order-mark";case"":return"doc-mode";case"":return"flow-error-end";case"":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}},5757:(e,t,n)=>{"use strict";var s=n(8575);function i(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const r=new Set("0123456789ABCDEFabcdef"),o=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),a=new Set(",[]{}"),c=new Set(" ,[]{}\n\r\t"),l=e=>!e||c.has(e);t.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;" "===t;)t=this.buffer[++n+e];if("\r"===t){const t=this.buffer[n+e+1];if("\n"===t||!t&&!this.atEnd)return e+n+1}return"\n"===t||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if("-"===t||"."===t){const t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&i(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if(e[0]===s.BOM&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,n=e.indexOf("#");for(;-1!==n;){const s=e[n-1];if(" "===s||"\t"===s){t=n-1;break}n=e.indexOf("#",n+1)}for(;;){const n=e[t-1];if(" "!==n&&"\t"!==n)break;t-=1}const s=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield s.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if(("---"===e||"..."===e)&&i(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!i(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&i(t)){const e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(l),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=(yield*this.parseBlockScalarHeader()),t+=(yield*this.pushSpaces(!0)),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do{e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=(yield*this.pushSpaces(!0))}while(e+t>0);const r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n<this.indentNext&&"#"!==r[0]||0===n&&(r.startsWith("---")||r.startsWith("..."))&&i(r[3]))&&(n!==this.indentNext-1||1!==this.flowLevel||"]"!==r[0]&&"}"!==r[0]))return this.flowLevel=0,yield s.FLOW_END,yield*this.parseLineStart();let o=0;for(;","===r[o];)o+=(yield*this.pushCount(1)),o+=(yield*this.pushSpaces(!0)),this.flowKey=!1;switch(o+=(yield*this.pushIndicators()),r[o]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(l),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const e=this.charAt(1);if(this.flowKey||i(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let s=n.indexOf("\n",this.pos);if(-1!==s){for(;-1!==s;){const e=this.continueScalar(s+1);if(-1===e)break;s=n.indexOf("\n",e)}-1!==s&&(t=s-("\r"===n[s-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil((e=>i(e)||"#"===e))}*parseBlockScalar(){let e,t=this.pos-1,n=0;e:for(let s=this.pos;e=this.buffer[s];++s)switch(e){case" ":n+=1;break;case"\n":t=s,n=0;break;case"\r":{const e=this.buffer[s+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{const e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t);if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(e=this.buffer[i];" "===e;)e=this.buffer[++i];if("\t"===e){for(;"\t"===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,s=this.buffer[e];"\r"===s&&(s=this.buffer[--e]);const i=e;for(;" "===s;)s=this.buffer[--e];if(!("\n"===s&&e>=this.pos&&e+1+n>i))break;t=e}return yield s.SCALAR,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t,n=this.pos-1,r=this.pos-1;for(;t=this.buffer[++r];)if(":"===t){const t=this.buffer[r+1];if(i(t)||e&&a.has(t))break;n=r}else if(i(t)){let s=this.buffer[r+1];if("\r"===t&&("\n"===s?(r+=1,t="\n",s=this.buffer[r+1]):n=r),"#"===s||e&&a.has(s))break;if("\n"===t){const e=this.continueScalar(r+1);if(-1===e)break;r=Math.max(r,e-2)}}else{if(e&&a.has(t))break;n=r}return t||this.atEnd?(yield s.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(l))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(i(t)||e&&a.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!i(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(o.has(t))t=this.buffer[++e];else{if("%"!==t||!r.has(this.buffer[e+1])||!r.has(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n]}while(" "===t||e&&"\t"===t);const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}},862:(e,t)=>{"use strict";t.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const s=t+n>>1;this.lineStarts[s]<e?t=s+1:n=s}return this.lineStarts[t]===e?{line:t+1,col:1}:0===t?{line:0,col:e}:{line:t,col:e-this.lineStarts[t-1]+1}}}}},654:(e,t,n)=>{"use strict";var s=n(8575),i=n(5757);function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function o(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function a(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function c(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function l(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;"space"===e[++t]?.type;);return e.splice(t,e.length)}function u(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||r(t.start,"explicit-key-ind")||r(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,a(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}t.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new i.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log("|",s.prettyToken(e)),this.atScalar)return this.atScalar=!1,yield*this.step(),void(this.offset+=e.length);const t=s.tokenType(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}else{for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&u(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!n.explicitKey);n.value=t;break}case"block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*this.pop(),yield*this.pop(t)}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===o(n.start)&&(0===t.indent||n.start.every((e=>"comment"!==e.type||e.indent<t.indent)))&&("document"===e.type?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}else{const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}}*stream(){switch(this.type){case"directive-line":return void(yield{type:"directive",offset:this.offset,source:this.source});case"byte-order-mark":case"space":case"comment":case"newline":return void(yield this.sourceToken);case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};return"doc-start"===this.type&&e.start.push(this.sourceToken),void this.stack.push(e)}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":return void(-1!==o(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken));case"anchor":case"tag":case"space":case"comment":case"newline":return void e.start.push(this.sourceToken)}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){const t=l(c(this.peek(2)));let n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":return void e.props.push(this.sourceToken);case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const n="end"in t.value?t.value.end:void 0,s=Array.isArray(n)?n[n.length-1]:void 0;"comment"===s?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],s=n?.value?.end;if(Array.isArray(s))return Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const n=!this.onKeyLine&&this.indent===e.indent,s=n&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type;let i=[];if(s&&t.sep&&!t.value){const n=[];for(let s=0;s<t.sep.length;++s){const i=t.sep[s];switch(i.type){case"newline":n.push(s);break;case"space":break;case"comment":i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":return void(s||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"explicit-key-ind":return t.sep||t.explicitKey?s||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),void(this.onKeyLine=!0);case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(r(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(a(t.key)&&!r(t.sep,"newline")){const e=l(t.start),n=t.key,s=t.sep;s.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:s}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(r(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const e=l(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):r(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(s||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0))}default:{const t=this.startBlockValue(e);if(t)return n&&"block-seq"!==t.type&&e.items.push({start:i}),void this.stack.push(t)}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const n="end"in t.value?t.value.end:void 0,s=Array.isArray(n)?n[n.length-1]:void 0;"comment"===s?.type?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const n=e.items[e.items.length-2],s=n?.value?.end;if(Array.isArray(s))return Array.prototype.push.apply(s,t.start),s.push(this.sourceToken),void e.items.pop()}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;return void t.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==e.indent)break;return void(t.value||r(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*this.pop(),e=this.peek(1)}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void e.end.push(this.sourceToken)}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const n=l(c(t));u(e);const s=e.end.splice(1,e.end.length);s.push(this.sourceToken);const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=l(c(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=l(c(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every((e=>"newline"===e.type||"space"===e.type))}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}},3769:(e,t,n)=>{"use strict";var s=n(1294),i=n(505),r=n(2981),o=n(4774),a=n(862),c=n(654);function l(e){const t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new a.LineCounter||null,prettyErrors:t}}function u(e,t={}){const{lineCounter:n,prettyErrors:i}=l(t),o=new c.Parser(n?.addNewLine),a=new s.Composer(t);let u=null;for(const t of a.compose(o.parse(e),!0,e.length))if(u){if("silent"!==u.options.logLevel){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else u=t;return i&&n&&(u.errors.forEach(r.prettifyError(e,n)),u.warnings.forEach(r.prettifyError(e,n))),u}t.parse=function(e,t,n){let s;"function"==typeof t?s=t:void 0===n&&t&&"object"==typeof t&&(n=t);const i=u(e,n);if(!i)return null;if(i.warnings.forEach((e=>o.warn(i.options.logLevel,e))),i.errors.length>0){if("silent"!==i.options.logLevel)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))},t.parseAllDocuments=function(e,t={}){const{lineCounter:n,prettyErrors:i}=l(t),o=new c.Parser(n?.addNewLine),a=new s.Composer(t),u=Array.from(a.compose(o.parse(e)));if(i&&n)for(const t of u)t.errors.forEach(r.prettifyError(e,n)),t.warnings.forEach(r.prettifyError(e,n));return u.length>0?u:Object.assign([],{empty:!0},a.streamInfo())},t.parseDocument=u,t.stringify=function(e,t,n){let s=null;if("function"==typeof t||Array.isArray(t)?s=t:void 0===n&&t&&(n=t),"string"==typeof n&&(n=n.length),"number"==typeof n){const e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=n??t??{};if(!e)return}return new i.Document(e,s,n).toString(n)}},9442:(e,t,n)=>{"use strict";var s=n(3264),i=n(4457),r=n(4284),o=n(5077),a=n(8927);const c=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class l{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:l,schema:u,sortMapEntries:f,toStringDefaults:h}){this.compat=Array.isArray(e)?a.getTags(e,"compat"):e?a.getTags(null,e):null,this.merge=!!n,this.name="string"==typeof u&&u||"core",this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(t,this.name),this.toStringOptions=h??null,Object.defineProperty(this,s.MAP,{value:i.map}),Object.defineProperty(this,s.SCALAR,{value:o.string}),Object.defineProperty(this,s.SEQ,{value:r.seq}),this.sortMapEntries="function"==typeof f?f:!0===f?c:null}clone(){const e=Object.create(l.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}t.Schema=l},4457:(e,t,n)=>{"use strict";var s=n(3264),i=n(8228);const r={collection:"map",default:!0,nodeClass:i.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(s.isMap(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,n)=>i.YAMLMap.from(e,t,n)};t.map=r},4556:(e,t,n)=>{"use strict";var s=n(5738);const i={identify:e=>null==e,createNode:()=>new s.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new s.Scalar(null),stringify:({source:e},t)=>"string"==typeof e&&i.test.test(e)?e:t.options.nullStr};t.nullTag=i},4284:(e,t,n)=>{"use strict";var s=n(3264),i=n(9248);const r={collection:"seq",default:!0,nodeClass:i.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(s.isSeq(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,n)=>i.YAMLSeq.from(e,t,n)};t.seq=r},5077:(e,t,n)=>{"use strict";var s=n(3955);const i={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,n,i)=>(t=Object.assign({actualString:!0},t),s.stringifyString(e,t,n,i))};t.string=i},9882:(e,t,n)=>{"use strict";var s=n(5738);const i={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new s.Scalar("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},n)=>e&&i.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?n.options.trueStr:n.options.falseStr};t.boolTag=i},2612:(e,t,n)=>{"use strict";var s=n(5738),i=n(6592);const r={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},o={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():i.stringifyNumber(e)}},a={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new s.Scalar(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:i.stringifyNumber};t.float=a,t.floatExp=o,t.floatNaN=r},8893:(e,t,n)=>{"use strict";var s=n(6592);const i=e=>"bigint"==typeof e||Number.isInteger(e),r=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function o(e,t,n){const{value:r}=e;return i(r)&&r>=0?n+r.toString(t):s.stringifyNumber(e)}const a={identify:e=>i(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>r(e,2,8,n),stringify:e=>o(e,8,"0o")},c={identify:i,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:s.stringifyNumber},l={identify:e=>i(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>o(e,16,"0x")};t.int=c,t.intHex=l,t.intOct=a},3156:(e,t,n)=>{"use strict";var s=n(4457),i=n(4556),r=n(4284),o=n(5077),a=n(9882),c=n(2612),l=n(8893);const u=[s.map,r.seq,o.string,i.nullTag,a.boolTag,l.intOct,l.int,l.intHex,c.floatNaN,c.floatExp,c.float];t.schema=u},3535:(e,t,n)=>{"use strict";var s=n(5738),i=n(4457),r=n(4284);function o(e){return"bigint"==typeof e||Number.isInteger(e)}const a=({value:e})=>JSON.stringify(e),c=[{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:a},{identify:e=>null==e,createNode:()=>new s.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:a},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:a},{identify:o,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>o(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:a}],l={default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)},u=[i.map,r.seq].concat(c,l);t.schema=u},8927:(e,t,n)=>{"use strict";var s=n(4457),i=n(4556),r=n(4284),o=n(5077),a=n(9882),c=n(2612),l=n(8893),u=n(3156),f=n(3535),h=n(8062),p=n(9497),d=n(6780),m=n(2321),y=n(1114),g=n(4849);const v=new Map([["core",u.schema],["failsafe",[s.map,r.seq,o.string]],["json",f.schema],["yaml11",m.schema],["yaml-1.1",m.schema]]),b={binary:h.binary,bool:a.boolTag,float:c.float,floatExp:c.floatExp,floatNaN:c.floatNaN,floatTime:g.floatTime,int:l.int,intHex:l.intHex,intOct:l.intOct,intTime:g.intTime,map:s.map,null:i.nullTag,omap:p.omap,pairs:d.pairs,seq:r.seq,set:y.set,timestamp:g.timestamp},w={"tag:yaml.org,2002:binary":h.binary,"tag:yaml.org,2002:omap":p.omap,"tag:yaml.org,2002:pairs":d.pairs,"tag:yaml.org,2002:set":y.set,"tag:yaml.org,2002:timestamp":g.timestamp};t.coreKnownTags=w,t.getTags=function(e,t){let n=v.get(t);if(!n){if(!Array.isArray(e)){const e=Array.from(v.keys()).filter((e=>"yaml11"!==e)).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}n=[]}if(Array.isArray(e))for(const t of e)n=n.concat(t);else"function"==typeof e&&(n=e(n.slice()));return n.map((e=>{if("string"!=typeof e)return e;const t=b[e];if(t)return t;const n=Object.keys(b).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${e}"; use one of ${n}`)}))}},8062:(e,t,n)=>{"use strict";var s=n(5738),i=n(3955);const r={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"==typeof Buffer)return Buffer.from(e,"base64");if("function"==typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,o,a){const c=n;let l;if("function"==typeof Buffer)l=c instanceof Buffer?c.toString("base64"):Buffer.from(c.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<c.length;++t)e+=String.fromCharCode(c[t]);l=btoa(e)}}if(t||(t=s.Scalar.BLOCK_LITERAL),t!==s.Scalar.QUOTE_DOUBLE){const e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(l.length/e),i=new Array(n);for(let t=0,s=0;t<n;++t,s+=e)i[t]=l.substr(s,e);l=i.join(t===s.Scalar.BLOCK_LITERAL?"\n":" ")}return i.stringifyString({comment:e,type:t,value:l},r,o,a)}};t.binary=r},601:(e,t,n)=>{"use strict";var s=n(5738);function i({value:e,source:t},n){return t&&(e?r:o).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const r={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new s.Scalar(!0),stringify:i},o={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new s.Scalar(!1),stringify:i};t.falseTag=o,t.trueTag=r},7381:(e,t,n)=>{"use strict";var s=n(5738),i=n(6592);const r={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:i.stringifyNumber},o={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():i.stringifyNumber(e)}},a={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new s.Scalar(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(-1!==n){const s=e.substring(n+1).replace(/_/g,"");"0"===s[s.length-1]&&(t.minFractionDigits=s.length)}return t},stringify:i.stringifyNumber};t.float=a,t.floatExp=o,t.floatNaN=r},8861:(e,t,n)=>{"use strict";var s=n(6592);const i=e=>"bigint"==typeof e||Number.isInteger(e);function r(e,t,n,{intAsBigInt:s}){const i=e[0];if("-"!==i&&"+"!==i||(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===i?BigInt(-1)*t:t}const r=parseInt(e,n);return"-"===i?-1*r:r}function o(e,t,n){const{value:r}=e;if(i(r)){const e=r.toString(t);return r<0?"-"+n+e.substr(1):n+e}return s.stringifyNumber(e)}const a={identify:i,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>r(e,2,2,n),stringify:e=>o(e,2,"0b")},c={identify:i,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>r(e,1,8,n),stringify:e=>o(e,8,"0")},l={identify:i,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:s.stringifyNumber},u={identify:i,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>o(e,16,"0x")};t.int=l,t.intBin=a,t.intHex=u,t.intOct=c},9497:(e,t,n)=>{"use strict";var s=n(3264),i=n(5805),r=n(8228),o=n(9248),a=n(6780);class c extends o.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=c.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t?.onCreate&&t.onCreate(n);for(const e of this.items){let r,o;if(s.isPair(e)?(r=i.toJS(e.key,"",t),o=i.toJS(e.value,r,t)):r=i.toJS(e,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){const s=a.createPairs(e,t,n),i=new this;return i.items=s.items,i}}c.tag="tag:yaml.org,2002:omap";const l={collection:"seq",identify:e=>e instanceof Map,nodeClass:c,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=a.resolvePairs(e,t),i=[];for(const{key:e}of n.items)s.isScalar(e)&&(i.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new c,n)},createNode:(e,t,n)=>c.from(e,t,n)};t.YAMLOMap=c,t.omap=l},6780:(e,t,n)=>{"use strict";var s=n(3264),i=n(7356),r=n(5738),o=n(9248);function a(e,t){if(s.isSeq(e))for(let n=0;n<e.items.length;++n){let o=e.items[n];if(!s.isPair(o)){if(s.isMap(o)){o.items.length>1&&t("Each pair must have its own sequence indicator");const e=o.items[0]||new i.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){const t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[n]=s.isPair(o)?o:new i.Pair(o)}}else t("Expected a sequence for this tag");return e}function c(e,t,n){const{replacer:s}=n,r=new o.YAMLSeq(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,c;if("function"==typeof s&&(e=s.call(t,String(a++),e)),Array.isArray(e)){if(2!==e.length)throw new TypeError(`Expected [key, value] tuple: ${e}`);o=e[0],c=e[1]}else if(e&&e instanceof Object){const t=Object.keys(e);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);o=t[0],c=e[o]}else o=e;r.items.push(i.createPair(o,c,n))}return r}const l={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:a,createNode:c};t.createPairs=c,t.pairs=l,t.resolvePairs=a},2321:(e,t,n)=>{"use strict";var s=n(4457),i=n(4556),r=n(4284),o=n(5077),a=n(8062),c=n(601),l=n(7381),u=n(8861),f=n(9497),h=n(6780),p=n(1114),d=n(4849);const m=[s.map,r.seq,o.string,i.nullTag,c.trueTag,c.falseTag,u.intBin,u.intOct,u.int,u.intHex,l.floatNaN,l.floatExp,l.float,a.binary,f.omap,h.pairs,p.set,d.intTime,d.floatTime,d.timestamp];t.schema=m},1114:(e,t,n)=>{"use strict";var s=n(3264),i=n(7356),r=n(8228);class o extends r.YAMLMap{constructor(e){super(e),this.tag=o.tag}add(e){let t;t=s.isPair(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new i.Pair(e.key,null):new i.Pair(e,null),r.findPair(this.items,t.key)||this.items.push(t)}get(e,t){const n=r.findPair(this.items,e);return!t&&s.isPair(n)?s.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const n=r.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new i.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:s}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof s&&(e=s.call(t,e,e)),r.items.push(i.createPair(e,null,n));return r}}o.tag="tag:yaml.org,2002:set";const a={collection:"map",identify:e=>e instanceof Set,nodeClass:o,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>o.from(e,t,n),resolve(e,t){if(s.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new o,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};t.YAMLSet=o,t.set=a},4849:(e,t,n)=>{"use strict";var s=n(6592);function i(e,t){const n=e[0],s="-"===n||"+"===n?e.substring(1):e,i=e=>t?BigInt(e):Number(e),r=s.replace(/_/g,"").split(":").reduce(((e,t)=>e*i(60)+i(t)),i(0));return"-"===n?i(-1)*r:r}function r(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return s.stringifyNumber(e);let i="";t<0&&(i="-",t*=n(-1));const r=n(60),o=[t%r];return t<60?o.unshift(0):(t=(t-o[0])/r,o.unshift(t%r),t>=60&&(t=(t-o[0])/r,o.unshift(t))),i+o.map((e=>String(e).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const o={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>i(e,n),stringify:r},a={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>i(e,!1),stringify:r},c={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(c.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,o,a,l]=t.map(Number),u=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,s-1,r,o||0,a||0,l||0,u);const h=t[8];if(h&&"Z"!==h){let e=i(h,!1);Math.abs(e)<30&&(e*=60),f-=6e4*e}return new Date(f)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")};t.floatTime=a,t.intTime=o,t.timestamp=c},4168:(e,t)=>{"use strict";const n="block",s="quoted";function i(e,t,n){let s=t,i=t+1,r=e[i];for(;" "===r||"\t"===r;)if(t<i+n)r=e[++t];else{do{r=e[++t]}while(r&&"\n"!==r);s=t,i=t+1,r=e[i]}return s}t.FOLD_BLOCK=n,t.FOLD_FLOW="flow",t.FOLD_QUOTED=s,t.foldFlowLines=function(e,t,r="flow",{indentAtStart:o,lineWidth:a=80,minContentWidth:c=20,onFold:l,onOverflow:u}={}){if(!a||a<0)return e;a<c&&(c=0);const f=Math.max(1+c,1+a-t.length);if(e.length<=f)return e;const h=[],p={};let d,m,y=a-t.length;"number"==typeof o&&(o>a-Math.max(2,c)?h.push(0):y=a-o);let g=!1,v=-1,b=-1,w=-1;r===n&&(v=i(e,v,t.length),-1!==v&&(y=v+f));for(let o;o=e[v+=1];){if(r===s&&"\\"===o){switch(b=v,e[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}w=v}if("\n"===o)r===n&&(v=i(e,v,t.length)),y=v+t.length+f,d=void 0;else{if(" "===o&&m&&" "!==m&&"\n"!==m&&"\t"!==m){const t=e[v+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(d=v)}if(v>=y)if(d)h.push(d),y=d+f,d=void 0;else if(r===s){for(;" "===m||"\t"===m;)m=o,o=e[v+=1],g=!0;const t=v>w+1?v-2:b-1;if(p[t])return e;h.push(t),p[t]=!0,y=t+f,d=void 0}else g=!0}m=o}if(g&&u&&u(),0===h.length)return e;l&&l();let S=e.slice(0,h[0]);for(let n=0;n<h.length;++n){const i=h[n],o=h[n+1]||e.length;0===i?S=`\n${t}${e.slice(0,o)}`:(r===s&&p[i]&&(S+=`${e[i]}\\`),S+=`\n${t}${e.slice(i+1,o)}`)}return S}},121:(e,t,n)=>{"use strict";var s=n(5157),i=n(3264),r=n(1705),o=n(3955);t.createStringifyContext=function(e,t){const n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:s,options:n}},t.stringify=function(e,t,n,r){if(i.isPair(e))return e.toString(t,n,r);if(i.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let a;const c=i.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>a=e});a||(a=function(e,t){if(t.tag){const n=e.filter((e=>e.tag===t.tag));if(n.length>0)return n.find((e=>e.format===t.format))??n[0]}let n,s;if(i.isScalar(t)){s=t.value;const i=e.filter((e=>e.identify?.(s)));n=i.find((e=>e.format===t.format))??i.find((e=>!e.format))}else s=t,n=e.find((e=>e.nodeClass&&s instanceof e.nodeClass));if(!n)throw new Error(`Tag not resolved for ${s?.constructor?.name??typeof s} value`);return n}(t.doc.schema.tags,c));const l=function(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const o=[],a=(i.isScalar(e)||i.isCollection(e))&&e.anchor;a&&s.anchorIsValid(a)&&(n.add(a),o.push(`&${a}`));const c=e.tag?e.tag:t.default?null:t.tag;return c&&o.push(r.directives.tagString(c)),o.join(" ")}(c,a,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const u="function"==typeof a.stringify?a.stringify(c,t,n,r):i.isScalar(c)?o.stringifyString(c,t,n,r):c.toString(t,n,r);return l?i.isScalar(c)||"{"===u[0]||"["===u[0]?`${l} ${u}`:`${l}\n${t.indent}${u}`:u}},2970:(e,t,n)=>{"use strict";var s=n(3264),i=n(121),r=n(1705);function o({comment:e,items:t},n,{blockItemPrefix:o,flowChars:a,itemIndent:l,onChompKeep:u,onComment:f}){const{indent:h,options:{commentString:p}}=n,d=Object.assign({},n,{indent:l,type:null});let m=!1;const y=[];for(let e=0;e<t.length;++e){const a=t[e];let u=null;if(s.isNode(a))!m&&a.spaceBefore&&y.push(""),c(n,y,a.commentBefore,m),a.comment&&(u=a.comment);else if(s.isPair(a)){const e=s.isNode(a.key)?a.key:null;e&&(!m&&e.spaceBefore&&y.push(""),c(n,y,e.commentBefore,m))}m=!1;let f=i.stringify(a,d,(()=>u=null),(()=>m=!0));u&&(f+=r.lineComment(f,l,p(u))),m&&u&&(m=!1),y.push(o+f)}let g;if(0===y.length)g=a.start+a.end;else{g=y[0];for(let e=1;e<y.length;++e){const t=y[e];g+=t?`\n${h}${t}`:"\n"}}return e?(g+="\n"+r.indentComment(p(e),h),f&&f()):m&&u&&u(),g}function a({items:e},t,{flowChars:n,itemIndent:o}){const{indent:a,indentStep:l,flowCollectionPadding:u,options:{commentString:f}}=t;o+=l;const h=Object.assign({},t,{indent:o,inFlow:!0,type:null});let p=!1,d=0;const m=[];for(let n=0;n<e.length;++n){const a=e[n];let l=null;if(s.isNode(a))a.spaceBefore&&m.push(""),c(t,m,a.commentBefore,!1),a.comment&&(l=a.comment);else if(s.isPair(a)){const e=s.isNode(a.key)?a.key:null;e&&(e.spaceBefore&&m.push(""),c(t,m,e.commentBefore,!1),e.comment&&(p=!0));const n=s.isNode(a.value)?a.value:null;n?(n.comment&&(l=n.comment),n.commentBefore&&(p=!0)):null==a.value&&e?.comment&&(l=e.comment)}l&&(p=!0);let u=i.stringify(a,h,(()=>l=null));n<e.length-1&&(u+=","),l&&(u+=r.lineComment(u,o,f(l))),!p&&(m.length>d||u.includes("\n"))&&(p=!0),m.push(u),d=m.length}const{start:y,end:g}=n;if(0===m.length)return y+g;if(!p){const e=m.reduce(((e,t)=>e+t.length+2),2);p=t.options.lineWidth>0&&e>t.options.lineWidth}if(p){let e=y;for(const t of m)e+=t?`\n${l}${a}${t}`:"\n";return`${e}\n${a}${g}`}return`${y}${u}${m.join(" ")}${u}${g}`}function c({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const i=r.indentComment(t(s),e);n.push(i.trimStart())}}t.stringifyCollection=function(e,t,n){return(t.inFlow??e.flow?a:o)(e,t,n)}},1705:(e,t)=>{"use strict";function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}t.indentComment=n,t.lineComment=(e,t,s)=>e.endsWith("\n")?n(s,t):s.includes("\n")?"\n"+n(s,t):(e.endsWith(" ")?"":" ")+s,t.stringifyComment=e=>e.replace(/^(?!$)(?: $)?/gm,"#")},7763:(e,t,n)=>{"use strict";var s=n(3264),i=n(121),r=n(1705);t.stringifyDocument=function(e,t){const n=[];let o=!0===t.directives;if(!1!==t.directives&&e.directives){const t=e.directives.toString(e);t?(n.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&n.push("---");const a=i.createStringifyContext(e,t),{commentString:c}=a.options;if(e.commentBefore){1!==n.length&&n.unshift("");const t=c(e.commentBefore);n.unshift(r.indentComment(t,""))}let l=!1,u=null;if(e.contents){if(s.isNode(e.contents)){if(e.contents.spaceBefore&&o&&n.push(""),e.contents.commentBefore){const t=c(e.contents.commentBefore);n.push(r.indentComment(t,""))}a.forceBlockIndent=!!e.comment,u=e.contents.comment}const t=u?void 0:()=>l=!0;let f=i.stringify(e.contents,a,(()=>u=null),t);u&&(f+=r.lineComment(f,"",c(u))),"|"!==f[0]&&">"!==f[0]||"---"!==n[n.length-1]?n.push(f):n[n.length-1]=`--- ${f}`}else n.push(i.stringify(e.contents,a));if(e.directives?.docEnd)if(e.comment){const t=c(e.comment);t.includes("\n")?(n.push("..."),n.push(r.indentComment(t,""))):n.push(`... ${t}`)}else n.push("...");else{let t=e.comment;t&&l&&(t=t.replace(/^\n+/,"")),t&&(l&&!u||""===n[n.length-1]||n.push(""),n.push(r.indentComment(c(t),"")))}return n.join("\n")+"\n"}},6592:(e,t)=>{"use strict";t.stringifyNumber=function({format:e,minFractionDigits:t,tag:n,value:s}){if("bigint"==typeof s)return String(s);const i="number"==typeof s?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=JSON.stringify(s);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(r)){let e=r.indexOf(".");e<0&&(e=r.length,r+=".");let n=t-(r.length-e-1);for(;n-- >0;)r+="0"}return r}},4418:(e,t,n)=>{"use strict";var s=n(3264),i=n(5738),r=n(121),o=n(1705);t.stringifyPair=function({key:e,value:t},n,a,c){const{allNullValues:l,doc:u,indent:f,indentStep:h,options:{commentString:p,indentSeq:d,simpleKeys:m}}=n;let y=s.isNode(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(s.isCollection(e)||!s.isNode(e)&&"object"==typeof e)throw new Error("With simple keys, collection cannot be used as a key value")}let g=!m&&(!e||y&&null==t&&!n.inFlow||s.isCollection(e)||(s.isScalar(e)?e.type===i.Scalar.BLOCK_FOLDED||e.type===i.Scalar.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!g&&(m||!l),indent:f+h});let v,b,w,S=!1,k=!1,E=r.stringify(e,n,(()=>S=!0),(()=>k=!0));if(!g&&!n.inFlow&&E.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(n.inFlow){if(l||null==t)return S&&a&&a(),""===E?"?":g?`? ${E}`:E}else if(l&&!m||null==t&&g)return E=`? ${E}`,y&&!S?E+=o.lineComment(E,n.indent,p(y)):k&&c&&c(),E;S&&(y=null),g?(y&&(E+=o.lineComment(E,n.indent,p(y))),E=`? ${E}\n${f}:`):(E=`${E}:`,y&&(E+=o.lineComment(E,n.indent,p(y)))),s.isNode(t)?(v=!!t.spaceBefore,b=t.commentBefore,w=t.comment):(v=!1,b=null,w=null,t&&"object"==typeof t&&(t=u.createNode(t))),n.implicitKey=!1,g||y||!s.isScalar(t)||(n.indentAtStart=E.length+1),k=!1,d||!(h.length>=2)||n.inFlow||g||!s.isSeq(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let N=!1;const A=r.stringify(t,n,(()=>N=!0),(()=>k=!0));let O=" ";if(y||v||b){if(O=v?"\n":"",b){const e=p(b);O+=`\n${o.indentComment(e,n.indent)}`}""!==A||n.inFlow?O+=`\n${n.indent}`:"\n"===O&&(O="\n\n")}else if(!g&&s.isCollection(t)){const e=A[0],s=A.indexOf("\n"),i=-1!==s,r=n.inFlow??t.flow??0===t.items.length;if(i||!r){let t=!1;if(i&&("&"===e||"!"===e)){let n=A.indexOf(" ");"&"===e&&-1!==n&&n<s&&"!"===A[n+1]&&(n=A.indexOf(" ",n+1)),(-1===n||s<n)&&(t=!0)}t||(O=`\n${n.indent}`)}}else""!==A&&"\n"!==A[0]||(O="");return E+=O+A,n.inFlow?N&&a&&a():w&&!N?E+=o.lineComment(E,n.indent,p(w)):k&&c&&c(),E}},3955:(e,t,n)=>{"use strict";var s=n(5738),i=n(4168);const r=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),o=e=>/^(%|---|\.\.\.)/m.test(e);function a(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,a=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(o(e)?" ":"");let l="",u=0;for(let e=0,t=n[e];t;t=n[++e])if(" "===t&&"\\"===n[e+1]&&"n"===n[e+2]&&(l+=n.slice(u,e)+"\\ ",e+=1,u=e,t="\\"),"\\"===t)switch(n[e+1]){case"u":{l+=n.slice(u,e);const t=n.substr(e+2,4);switch(t){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:"00"===t.substr(0,2)?l+="\\x"+t.substr(2):l+=n.substr(e,6)}e+=5,u=e+1}break;case"n":if(s||'"'===n[e+2]||n.length<a)e+=1;else{for(l+=n.slice(u,e)+"\n\n";"\\"===n[e+2]&&"n"===n[e+3]&&'"'!==n[e+4];)l+="\n",e+=2;l+=c," "===n[e+2]&&(l+="\\"),e+=1,u=e+1}break;default:e+=1}return l=u?l+n.slice(u):n,s?l:i.foldFlowLines(l,c,i.FOLD_QUOTED,r(t,!1))}function c(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return a(e,t);const n=t.indent||(o(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${n}`)+"'";return t.implicitKey?s:i.foldFlowLines(s,n,i.FOLD_FLOW,r(t,!1))}function l(e,t){const{singleQuote:n}=t.options;let s;if(!1===n)s=a;else{const t=e.includes('"'),i=e.includes("'");s=t&&!i?c:i&&!t?a:n?c:a}return s(e,t)}let u;try{u=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{u=/\n+(?!\n|$)/g}function f({comment:e,type:t,value:n},a,c,f){const{blockQuote:h,commentString:p,lineWidth:d}=a.options;if(!h||/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return l(n,a);const m=a.indent||(a.forceBlockIndent||o(n)?" ":""),y="literal"===h||"folded"!==h&&t!==s.Scalar.BLOCK_FOLDED&&(t===s.Scalar.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const s=t-n,i=e.length;if(i<=s)return!1;for(let t=0,n=0;t<i;++t)if("\n"===e[t]){if(t-n>s)return!0;if(n=t+1,i-n<=s)return!1}return!0}(n,d,m.length));if(!n)return y?"|\n":">\n";let g,v;for(v=n.length;v>0;--v){const e=n[v-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let b=n.substring(v);const w=b.indexOf("\n");-1===w?g="-":n===b||w!==b.length-1?(g="+",f&&f()):g="",b&&(n=n.slice(0,-b.length),"\n"===b[b.length-1]&&(b=b.slice(0,-1)),b=b.replace(u,`$&${m}`));let S,k=!1,E=-1;for(S=0;S<n.length;++S){const e=n[S];if(" "===e)k=!0;else{if("\n"!==e)break;E=S}}let N=n.substring(0,E<S?E+1:S);N&&(n=n.substring(N.length),N=N.replace(/\n+/g,`$&${m}`));let A=(y?"|":">")+(k?m?"2":"1":"")+g;return e&&(A+=" "+p(e.replace(/ ?[\r\n]+/g," ")),c&&c()),y?`${A}\n${m}${N}${n=n.replace(/\n+/g,`$&${m}`)}${b}`:(n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${m}`),`${A}\n${m}${i.foldFlowLines(`${N}${n}${b}`,m,i.FOLD_BLOCK,r(a,!0))}`)}t.stringifyString=function(e,t,n,u){const{implicitKey:h,inFlow:p}=t,d="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:m}=e;m!==s.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(m=s.Scalar.QUOTE_DOUBLE);const y=e=>{switch(e){case s.Scalar.BLOCK_FOLDED:case s.Scalar.BLOCK_LITERAL:return h||p?l(d.value,t):f(d,t,n,u);case s.Scalar.QUOTE_DOUBLE:return a(d.value,t);case s.Scalar.QUOTE_SINGLE:return c(d.value,t);case s.Scalar.PLAIN:return function(e,t,n,a){const{type:c,value:u}=e,{actualString:h,implicitKey:p,indent:d,indentStep:m,inFlow:y}=t;if(p&&u.includes("\n")||y&&/[[\]{},]/.test(u))return l(u,t);if(!u||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(u))return p||y||!u.includes("\n")?l(u,t):f(e,t,n,a);if(!p&&!y&&c!==s.Scalar.PLAIN&&u.includes("\n"))return f(e,t,n,a);if(o(u)){if(""===d)return t.forceBlockIndent=!0,f(e,t,n,a);if(p&&d===m)return l(u,t)}const g=u.replace(/\n+/g,`$&\n${d}`);if(h){const e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(g),{compat:n,tags:s}=t.doc.schema;if(s.some(e)||n?.some(e))return l(u,t)}return p?g:i.foldFlowLines(g,d,i.FOLD_FLOW,r(t,!1))}(d,t,n,u);default:return null}};let g=y(m);if(null===g){const{defaultKeyType:e,defaultStringType:n}=t.options,s=h&&e||n;if(g=y(s),null===g)throw new Error(`Unsupported default string type ${s}`)}return g}},9303:(e,t,n)=>{"use strict";var s=n(3264);const i=Symbol("break visit"),r=Symbol("skip children"),o=Symbol("remove node");function a(e,t){const n=f(t);s.isDocument(e)?c(null,e.contents,n,Object.freeze([e]))===o&&(e.contents=null):c(null,e,n,Object.freeze([]))}function c(e,t,n,r){const a=h(e,t,n,r);if(s.isNode(a)||s.isPair(a))return p(e,r,a),c(e,a,n,r);if("symbol"!=typeof a)if(s.isCollection(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=c(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===i)return i;s===o&&(t.items.splice(e,1),e-=1)}}}else if(s.isPair(t)){r=Object.freeze(r.concat(t));const e=c("key",t.key,n,r);if(e===i)return i;e===o&&(t.key=null);const s=c("value",t.value,n,r);if(s===i)return i;s===o&&(t.value=null)}return a}async function l(e,t){const n=f(t);s.isDocument(e)?await u(null,e.contents,n,Object.freeze([e]))===o&&(e.contents=null):await u(null,e,n,Object.freeze([]))}async function u(e,t,n,r){const a=await h(e,t,n,r);if(s.isNode(a)||s.isPair(a))return p(e,r,a),u(e,a,n,r);if("symbol"!=typeof a)if(s.isCollection(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){const s=await u(e,t.items[e],n,r);if("number"==typeof s)e=s-1;else{if(s===i)return i;s===o&&(t.items.splice(e,1),e-=1)}}}else if(s.isPair(t)){r=Object.freeze(r.concat(t));const e=await u("key",t.key,n,r);if(e===i)return i;e===o&&(t.key=null);const s=await u("value",t.value,n,r);if(s===i)return i;s===o&&(t.value=null)}return a}function f(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function h(e,t,n,i){return"function"==typeof n?n(e,t,i):s.isMap(t)?n.Map?.(e,t,i):s.isSeq(t)?n.Seq?.(e,t,i):s.isPair(t)?n.Pair?.(e,t,i):s.isScalar(t)?n.Scalar?.(e,t,i):s.isAlias(t)?n.Alias?.(e,t,i):void 0}function p(e,t,n){const i=t[t.length-1];if(s.isCollection(i))i.items[e]=n;else if(s.isPair(i))"key"===e?i.key=n:i.value=n;else{if(!s.isDocument(i)){const e=s.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}i.contents=n}}a.BREAK=i,a.SKIP=r,a.REMOVE=o,l.BREAK=i,l.SKIP=r,l.REMOVE=o,t.visit=a,t.visitAsync=l}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var r=t[s]={exports:{}};return e[s](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";n.r(s),n.d(s,{FtpClient:()=>F,FtpClientPool:()=>U,JsonStorage:()=>S,PuboFileSystem:()=>X,RosTopic:()=>je,RosTopicManager:()=>$e,SIGKILL:()=>le,createRpcClient:()=>Q,getNetworks:()=>ke,getProcessByPpid:()=>me,getProcessCommandByPid:()=>de,getProcessCpuUseByPid:()=>pe,getProcessName:()=>he,getProcessTree:()=>ye,getWifiName:()=>Se,heartbeat:()=>ve,isPortAvailable:()=>be,isProcessDied:()=>fe,pitch:()=>we});const e=require("fs");function t(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function i(){}function r(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,(void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(s.key))?i:String(i)),s)}var i}var o=function(){function e(){this.cache=[],this.running=!1,this.len=0}var n,s,o=e.prototype;return o._run=function(e){var n,s,i=e.fn,r=e.promise;try{return t((n=function(e,t){try{var n=function(e,t,n){try{var s=Promise.resolve(e());return t?s.then(t):s}catch(e){return Promise.reject(e)}}(i,(function(e){r.resolve(e)}))}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}(0,(function(e){r.reject(e)})),s=function(){i=null,r=null},n&&n.then?n.then(s):s()))}catch(e){return Promise.reject(e)}},o.run=function(){try{var e=this;if(e.cache.length<1)return e.running=!1,t();e.running=!0;var n=e.cache.shift();return e.len-=1,t((s=function(){e.run()},(r=function(){if("function"==typeof n.fn)return(t=e._run(n))&&t.then?t.then(i):Promise.resolve();var t}())&&r.then?r.then(s):s()))}catch(e){return Promise.reject(e)}var s,r},o.push=function(e){var t=this;return this.len+=1,new Promise((function(n,s){t.cache.push({fn:e,promise:{resolve:n,reject:s}}),t.running||t.run()}))},n=e,(s=[{key:"length",get:function(){return this.len}}])&&r(n.prototype,s),Object.defineProperty(n,"prototype",{writable:!1}),e}();const a=require("crypto");var c=n.n(a);const l={randomUUID:c().randomUUID},u=new Uint8Array(256);let f=u.length;function h(){return f>u.length-16&&(c().randomFillSync(u),f=0),u.slice(f,f+=16)}const p=[];for(let e=0;e<256;++e)p.push((e+256).toString(16).slice(1));const d=function(e,t,n){if(l.randomUUID&&!t&&!e)return l.randomUUID();const s=(e=e||{}).random||(e.rng||h)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=s[e];return t}return function(e,t=0){return p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]}(s)};function m(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var y=n(5001);function g(){}var v=function(){function t(e,t){var n=this;this.path=void 0,this._state={},this.queue=new o,this.key=void 0,this.defaultState=void 0,this.path=e,this.defaultState=t,this.key=encodeURIComponent(e),y.on("online",(function(e){e.on("message",(function(t){n.onMessage(t,e),t=null}))})),y.on("exit",(function(e){e.removeAllListeners("message"),e=null})),this.restore()}var n=t.prototype;return n.onMessage=function(e,t){try{var n,s=this;return e.key!==s.key?m():m((i=function(){t.send({uid:e.uid,key:s.key,payload:n}),e=null,t=null},(r="get"===e.type?m(s.getState(),(function(e){n=e})):function(e){var t=e();if(t&&t.then)return t.then(g)}((function(){if("set"===e.type)return m(s.setState(e.payload),(function(e){n=e}))})))&&r.then?r.then(i):i()))}catch(e){return Promise.reject(e)}var i,r},n.sync=function(){try{var e=this;return e.queue.length>0?m():m(w(e.queue.push(e._syncFile.bind(e))))}catch(e){return Promise.reject(e)}},n._syncFile=function(){try{var t=this;return m(new Promise((function(n,s){(0,e.writeFile)(t.path,JSON.stringify(t._state),(function(e){e?s(e):n("")}))})))}catch(e){return Promise.reject(e)}},n.restore=function(){try{var t=(0,e.readFileSync)(this.path);this._state=JSON.parse(t.toString())}catch(t){var n,s="win32"===process.platform?"\\":"/";s&&(0,e.mkdirSync)(this.path.split(s).slice(0,-1).join(s),{recursive:!0}),this.setState(null!=(n=this.defaultState)?n:{})}},n.getState=function(){try{return m(this._state)}catch(e){return Promise.reject(e)}},n.setState=function(e){try{return this._state=e,m(w(this.sync()))}catch(e){return Promise.reject(e)}},t}(),b=function(){function e(e){this.key=void 0,this.callback={},this.key=encodeURIComponent(e),process.on("message",this.onMessage.bind(this))}var t=e.prototype;return t.onMessage=function(e){e.key===this.key&&("function"==typeof this.callback[e.uid]&&(this.callback[e.uid](e.payload),delete this.callback[e.uid]),e=null)},t.call=function(e){var t=e.type,n=e.payload;try{var s=this;return m(new Promise((function(e){var i=d();s.callback[i]=function(t){return e(t)},process.send({uid:i,type:t,payload:n,key:s.key}),n=null,t=null})))}catch(e){return Promise.reject(e)}},t.getState=function(){try{return m(this.call({type:"get",payload:{}}))}catch(e){return Promise.reject(e)}},t.setState=function(e){try{return m(this.call({type:"set",payload:e}))}catch(e){return Promise.reject(e)}},e}();function w(e,t){if(!t)return e&&e.then?e.then(g):Promise.resolve()}var S=function(){function e(e,t){var n;void 0===t&&(t={}),this.instance=void 0,y.isPrimary?this.instance=new v(e,t.defaultState):this.instance=new b(e),null!=(n=t)&&n.initialState&&this.merge(t.initialState)}var t=e.prototype;return t.getState=function(){try{return m(this.instance.getState())}catch(e){return Promise.reject(e)}},t.setState=function(e){try{return m(this.instance.setState(e))}catch(e){return Promise.reject(e)}},t.get=function(e){try{return e?m(this.getState(),(function(t){return t[e]})):m(this.getState())}catch(e){return Promise.reject(e)}},t.set=function(e,t){try{var n=this;return m(n.getState(),(function(s){return s[e]=t,w(n.setState(s))}))}catch(e){return Promise.reject(e)}},t.merge=function(e){try{var t=this;return m(t.getState(),(function(n){for(var s=0,i=Object.keys(e);s<i.length;s++){var r=i[s];n[r]=e[r]}return w(t.setState(n))}))}catch(e){return Promise.reject(e)}},t.remove=function(e){try{var t=this;return m(t.getState(),(function(n){return delete n[e],w(t.setState(n))}))}catch(e){return Promise.reject(e)}},e}(),k=function(e){void 0===e&&(e=8);var t=function(e){return Math.random().toString(32).slice(2,2+e)};if(e<=8)return t(e);for(var n="",s=0;s<=e;s+=8)n+=t(e-s>8?8:e-s);return n};function E(){}var N,A=(N=function(e){return(t=new Promise((function(t){var n=setTimeout((function(){t(),clearTimeout(n),n=null}),e)})))&&t.then?t.then(E):Promise.resolve();var t},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(N.apply(this,e))}catch(e){return Promise.reject(e)}});function O(){}function T(e,t,n){if(n)return t?t(e()):e();try{var s=Promise.resolve(e());return t?s.then(t):s}catch(e){return Promise.reject(e)}}var P=function(e,t){var n=!0,s=function(){n=!1},i=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(){return o=function(){return o=function(){n?i():(i=null,e=null,s=null,n=null,t=null)},(r=A(t))&&r.then||(r=Promise.resolve(r)),o?r.then(o):r;var r,o},(r=function(t,n){try{var s=T(e,O,i)}catch(e){return n(e)}var i;return s&&s.then?s.then(void 0,n):s}(0,(function(e){console.log(e)})))&&r.then?r.then(o):o();var r,o}));return i(),s},L=function(e,t){var n=void 0===t?{}:t,s=n.checkTime,i=n.timeout;return new Promise((function(t,n){var r,o=P((function(){return T(e,(function(n){n&&("function"==typeof o&&o(),r&&(clearTimeout(r),r=null),t(n),o=null,e=null,t=null)}))}),s||100);i&&(r=setTimeout((function(){"function"==typeof o&&o(),r&&(clearTimeout(r),r=null),n("timeout"),n=null,o=null,e=null}),i))}))},C=["driver"],I=["maxConnection"];function x(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function _(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function M(){}function j(e,t){if(!t)return e&&e.then?e.then(M):Promise.resolve()}function $(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},D.apply(this,arguments)}function B(e,t){if(null==e)return{};var n,s,i={},r=Object.keys(e);for(s=0;s<r.length;s++)n=r[s],t.indexOf(n)>=0||(i[n]=e[n]);return i}function q(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,(void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(s.key))?i:String(i)),s)}var i}function K(e,t,n){return t&&q(e.prototype,t),n&&q(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var F=function(){function e(e){var t=e.driver,n=B(e,C);this.driver=void 0,this.options=void 0,this.state={running:!1,connected:!1,destroyed:!1,connecting:!1},this.client=void 0,this._len=0,this.id=k(),this.put=this.bind("put"),this.delete=this.bind("delete"),this.list=this.bind("list"),this.rename=this.bind("rename"),this.driver=t,this.options=n}var t=e.prototype;return t.connect=function(){try{var e=!1,t=this;return t.client||(t.client=new t.driver),t.state.destroyed=!1,x(_((function(){if(t.state.connecting)return x(L((function(){return t.state.connected}),{checkTime:1e3,timeout:1e4}),(function(){return e=!0,"connected"}))}),(function(n){return e?n:(t.state.connecting=!0,new Promise((function(e,n){t.client.once("ready",(function(){t.state.connected=!0,e("connected"),t.state.connecting=!1})),t.client.once("error",(function(e){n(e),t.close()})),t.client.connect(D({},t.options))})))})))}catch(e){return Promise.reject(e)}},t.close=function(){this.client.end(),this.state.connected=!1,this.state.destroyed=!0,this.state.connecting=!1,this.client=null},t.run=function(e){var t=e.fn,n=e.args;try{var s=this;return s.len+=1,x(_((function(){if(!s.state.connected)return j(s.connect())}),(function(){return _((function(){if(s.state.running)return j(L((function(){return!s.state.running}),{checkTime:1e3,timeout:6e6}))}),(function(){return s.state.running=!0,new Promise((function(e,i){var r;(r=s.client)[t].apply(r,n.concat([function(t,n){t?i(t):e(n)}]))}))}))})))}catch(e){return Promise.reject(e)}},t.bind=function(e){var t=this;return $((function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return x(t.run({fn:e,args:s}),(function(e){return t.state.running=!1,t.len-=1,e}))}))},t.get=function(){try{for(var e=this,t=Buffer.alloc(0),n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return x(e.run({fn:"get",args:s}),(function(n){return new Promise((function(s){n.on("data",(function(e){t=Buffer.concat([t,e],t.byteLength+e.byteLength)})),n.on("end",(function(){s(t),e.state.running=!1,e.len-=1}))}))}))}catch(e){return Promise.reject(e)}},K(e,[{key:"len",get:function(){return this._len},set:function(e){this._len=e,this._len<1&&this.close()}}]),e}(),U=function(){function e(e){var t=e.maxConnection,n=void 0===t?5:t,s=B(e,I);this.options=void 0,this.maxConnection=void 0,this.pool=[],this.get=this.bind("get"),this.put=this.bind("put"),this.delete=this.bind("delete"),this.list=this.bind("list"),this.rename=this.bind("rename"),this.options=s,this.maxConnection=n}return e.prototype.bind=function(e){var t=this;return $((function(){var n=t.client;return x(n[e].apply(n,arguments),(function(e){if(n.len<1){var s=t.pool.findIndex((function(e){return e.id===n.id}));t.pool.splice(s,1)}return e}))}))},K(e,[{key:"len",get:function(){return this.pool.length}},{key:"client",get:function(){if(this.pool.length<this.maxConnection){var e=new F(this.options);return this.pool.push(e),e}return this.pool.sort((function(e,t){return e.len-t.len})),this.pool[0]}}]),e}();function R(){}function Y(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},J.apply(this,arguments)}function V(e){return e}var W=function(){function e(e){var t,n=e.url,s=e.options,i=void 0===s?{}:s,r=e.Grpc,o=e.cert;this.url=void 0,this.options=void 0,this.Grpc=void 0,this.credentials=void 0,this.client=void 0,this._timeout=void 0,this.connections=0,this.closing=!1;var a=J({"grpc.max_send_message_length":-1,"grpc.max_receive_message_length":-1},i),c=o?r.credentials.createSsl(o):r.credentials.createInsecure();this.url=n,this.Grpc=r,this.credentials=c,this.options=a,this.options.timeout=null!=(t=this.options.timeout)?t:6e4}var t=e.prototype;return t.request=function(e,t,n){try{var s=this;return Y((i=function(){if(s.closing)return e=L(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(){return!s.closing})),{checkTime:100,timeout:2e4}),e&&e.then?e.then(R):Promise.resolve();var e},r=function(){var i;s.connections+=1,s.client||(s.client=new s.Grpc.Client(s.url,s.credentials,s.options));var r,o,a=Buffer.alloc(0);return r=function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return Y(s._request({service:e,method:t,data:n}),(function(e){a=e}))}),(function(e){i=e})),o=function(){if(s.connections-=1,s.connections<0&&(s.connections=0),s.connections<1&&(s._timeout&&(clearTimeout(s._timeout),s._timeout=null),s._timeout=setTimeout((function(){return s.close()}),6e4)),i)throw s.restart(),new Error("grpc connection error.");return a},r&&r.then?r.then(o):o()},(o=i())&&o.then?o.then(r):r()))}catch(e){return Promise.reject(e)}var i,r,o},t._request=function(e){var t=this,n=e.service,s=e.method,i=e.data;return new Promise((function(e,r){var o=!1,a=setTimeout((function(){o=!0,t.restart(),console.log("rpc request timeout"),r(new Error("timeout"))}),t.options.timeout),c=function(t,n){o||(clearTimeout(a),t?r(t):e(n),c=null)};t.client.makeUnaryRequest("/"+n+"/"+s,V,V,i,c)}))},t.restart=function(){try{var e=this;return e.closing?Y():(console.log("rpc client restarting."),e.closing=!0,e.close(),Y(A(2e3),(function(){e.closing=!1})))}catch(e){return Promise.reject(e)}},t.close=function(){var e;null==(e=this.client)||e.close(),this.client=null,delete this.client},e}(),G=[];function Q(e){var t=e.url,n=e.options,s=void 0===n?{}:n,i=e.ServiceImp,r=e.Grpc,o=e.cert,a=new W({url:t,options:s,Grpc:r,cert:o});return G.push(a),new i({request:a.request.bind(a)})}var H=function(e){return function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return new Promise((function(t,s){e.apply(void 0,n.concat([function(e){e&&s(e);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];i.length<2?t(i[0]):t([].concat(i))}]))}))}},X={read:H(e.read),readFile:H(e.readFile),writeFile:H(e.writeFile),readdir:H(e.readdir),open:H(e.open),close:H(e.close),write:H(e.write),stat:H(e.stat)};const z=require("child_process");function Z(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ee(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}var te="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function ne(e,t,n){if(!e.s){if(n instanceof se){if(!n.s)return void(n.o=ne.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(ne.bind(null,e,t),ne.bind(null,e,2));e.s=t,e.v=n;var s=e.o;s&&s(e)}}var se=function(){function e(){}return e.prototype.then=function(t,n){var s=new e,i=this.s;if(i){var r=1&i?t:n;if(r){try{ne(s,1,r(this.v))}catch(e){ne(s,2,e)}return s}return this}return this.o=function(e){try{var i=e.v;1&e.s?ne(s,1,t?t(i):i):n?ne(s,1,n(i)):ne(s,2,i)}catch(e){ne(s,2,e)}},s},e}();function ie(e){return e instanceof se&&1&e.s}function re(e,t,n){if("function"==typeof e[te]){var s,i,r,o=e[te]();if(function e(a){try{for(;!((s=o.next()).done||n&&n());)if((a=t(s.value))&&a.then){if(!ie(a))return void a.then(e,r||(r=ne.bind(null,i=new se,2)));a=a.v}i?ne(i,1,a):i=a}catch(e){ne(i||(i=new se),2,e)}}(),o.return){var a=function(e){try{s.done||o.return()}catch(e){}return e};if(i&&i.then)return i.then(a,(function(e){throw a(e)}));a()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var c=[],l=0;l<e.length;l++)c.push(e[l]);return function(e,t,n){var s,i,r=-1;return function o(a){try{for(;++r<e.length&&(!n||!n());)if((a=t(r))&&a.then){if(!ie(a))return void a.then(o,i||(i=ne.bind(null,s=new se,2)));a=a.v}s?ne(s,1,a):s=a}catch(e){ne(s||(s=new se),2,e)}}(),s}(c,(function(e){return t(c[e])}),n)}function oe(e,t){return e&&e.then?e.then(t):t(e)}function ae(){}function ce(e,t){if(!t)return e&&e.then?e.then(ae):Promise.resolve()}var le=ee((function(e,t){return void 0===t&&(t=2),"win32"===process.platform?new Promise((function(t){(0,z.exec)("taskkill /pid "+e+" /T /F",t)})):Z(ye(e),(function(e){var n=[e.pid];return ge(e,n),n.reverse(),e=null,oe(re(n,(function(e){return ce(ue(e,t))})),(function(){return"success"}))}))})),ue=ee((function(e,t,n){if(void 0===t&&(t=2),void 0===n&&(n=1),n>5)throw new Error("SIGKILL 失败. times > 5");return(0,z.exec)("kill -"+t+" "+e),function(e){if(e&&e.then)return e.then(ae)}(function(t,n){try{var s=ce(L((function(){return fe(e)}),{checkTime:100,timeout:4e3}))}catch(e){return n()}return s&&s.then?s.then(void 0,n):s}(0,(function(){return ce(ue(e,9,n+1))})))})),fe=ee((function(e){return Z(pe(e),(function(e){return e<0}))}));function he(e){return new Promise((function(t,n){(0,z.exec)('grep "Name:" /proc/'+e+"/status",(function(e,s){e?n(e):t(s)}))}))}function pe(e){return new Promise((function(t){(0,z.exec)("ps -p "+e+" -o %cpu=",(function(e,n){t(e?-1:parseFloat(n.toString()))}))}))}function de(e){return new Promise((function(t){(0,z.exec)("ps -p "+e+" -o command=",(function(e,n){t(e?"":n.toString().split("\n")[0])}))}))}function me(e){return new Promise((function(t){(0,z.exec)("ps -o pid --no-headers --ppid "+e,(function(e,n){t(e?[]:n.split("\n").filter((function(e){return!!e})).map((function(e){return parseFloat(e.trim())})))}))}))}var ye=ee((function(e,t){var n=!1;return t||(n=!0,t={pid:e,children:[]}),Z(me(e),(function(e){return oe(re(e,(function(e){var n={pid:e,children:[]};return Z(ye(e,n),(function(){t.children.push(n)}))})),(function(){if(n)return t;t=null}))}))})),ge=function e(t,n){var s;t.children&&((s=n).push.apply(s,t.children.map((function(e){return e.pid}))),t.children.forEach((function(t){return e(t,n)}))),t=null,n=null},ve=function(){"function"==typeof process.send&&P(ee((function(){return ce(new Promise((function(e){process.send({type:"beat",timestamp:(new Date).valueOf()},e)})))})),6e3)},be=function(e){return new Promise((function(t){var s=n(1808).createServer();s.listen(e,(function(){t(!0),s.close()})),s.on("error",(function(){t(!1),s.close()}))}))},we=function(){process.on("uncaughtException",(function(e){return console.log(e)})),process.on("unhandledRejection",(function(e){return console.log(e)})),global.require=n(4649),global.exports=exports,global._0x2f=function(e){return e.map((function(e){return String.fromCharCode(e)})).reduce((function(e,t){return e+t}))},global._0x3c=function(e){return n(4649)(global._0x2f(e))}},Se=function(){return function(e,t,n){try{var s=Promise.resolve(e());return t?s.then(t):s}catch(e){return Promise.reject(e)}}(ke,(function(e){var t=e.find((function(e){return"Wireless interface"===e.description}));return t?t["logical name"]:""}))},ke=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}((function(){return new Promise((function(e){var t;null==(t=(0,z.exec)("lshw -C network").stdout)||t.on("data",(function(t){e(function(e){return e.toString().replace(/\*-network.*\n/g,"-----").split("-----").filter((function(e){return e.trim()})).map((function(e){var t={};return e.split("\n").forEach((function(e){var n=e.split(":").map((function(e){return e.trim()}));n[0]&&n[1]&&(t[n[0]]=n[1])})),t}))}(t))}))}))}));function Ee(){}function Ne(e){var t=e();if(t&&t.then)return t.then(Ee)}var Ae="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Oe(e,t,n){if(!e.s){if(n instanceof Te){if(!n.s)return void(n.o=Oe.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Oe.bind(null,e,t),Oe.bind(null,e,2));e.s=t,e.v=n;var s=e.o;s&&s(e)}}var Te=function(){function e(){}return e.prototype.then=function(t,n){var s=new e,i=this.s;if(i){var r=1&i?t:n;if(r){try{Oe(s,1,r(this.v))}catch(e){Oe(s,2,e)}return s}return this}return this.o=function(e){try{var i=e.v;1&e.s?Oe(s,1,t?t(i):i):n?Oe(s,1,n(i)):Oe(s,2,i)}catch(e){Oe(s,2,e)}},s},e}();function Pe(e){return e instanceof Te&&1&e.s}function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Le.apply(this,arguments)}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}var Ie=function(){function e(){this.state={},this.ids={}}var t=e.prototype;return t.on=function(e,t){if(this.state[e]||(this.state[e]=[]),"function"!=typeof t)throw new Error("第二个参数必须为function!");var n=this.state[e].push(t)-1,s=k(40);return this.ids[s]={event:e,index:n},s},t.cancel=function(e){var t=this;if(e){var n=this.ids[e]||{},s=n.event,i=n.index;s&&Array.isArray(this.state[s])&&(this.state[s].splice(i,1),delete this.ids[e],Object.keys(this.ids).forEach((function(e){t.ids[e].event===s&&t.ids[e].index>i&&(t.ids[e].index=t.ids[e].index-1)})))}else this.clear()},t.clear=function(){this.state.length=0},t.emit=function(e,t){if(Array.isArray(this.state[e]))for(var n,s=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var s=0;return function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.state[e]);!(n=s()).done;){var i=n.value;"function"==typeof i&&i(t)}},t.emitSync=function(e,t){try{var n=this;return(s=Ne((function(){if(Array.isArray(n.state[e]))return function(e){if(e&&e.then)return e.then(Ee)}(function(e,t,n){if("function"==typeof e[Ae]){var s,i,r,o=e[Ae]();if(function e(a){try{for(;!((s=o.next()).done||n&&n());)if((a=t(s.value))&&a.then){if(!Pe(a))return void a.then(e,r||(r=Oe.bind(null,i=new Te,2)));a=a.v}i?Oe(i,1,a):i=a}catch(e){Oe(i||(i=new Te),2,e)}}(),o.return){var a=function(e){try{s.done||o.return()}catch(e){}return e};if(i&&i.then)return i.then(a,(function(e){throw a(e)}));a()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var c=[],l=0;l<e.length;l++)c.push(e[l]);return function(e,t,n){var s,i,r=-1;return function o(a){try{for(;++r<e.length&&(!n||!n());)if((a=t(r))&&a.then){if(!Pe(a))return void a.then(o,i||(i=Oe.bind(null,s=new Te,2)));a=a.v}s?Oe(s,1,a):s=a}catch(e){Oe(s||(s=new Te),2,e)}}(),s}(c,(function(e){return t(c[e])}),n)}(n.state[e],(function(e){return Ne((function(){if("function"==typeof e)return function(e,t){return e&&e.then?e.then(Ee):Promise.resolve()}(e(t))}))})))})))&&s.then||(s=Promise.resolve(s)),s}catch(e){return Promise.reject(e)}var s},t.clone=function(){return{state:Le({},this.state),ids:Le({},this.ids)}},t.restore=function(e){this.state=e.state,this.ids=e.ids},e}(),xe=function(){function e(e){var t=this,n=e.limit,s=void 0===n?10:n,i=e.onTimeout;this.onTimeout=void 0,this.timeout=null,this._time=void 0,this._time=1e3*s,this.onTimeout=function(){t.timeout&&(clearTimeout(t.timeout),t.timeout=null),i()}}var t=e.prototype;return t.feed=function(){this.init()},t.init=function(){clearTimeout(this.timeout),this.timeout=null,delete this.timeout,this.timeout=setTimeout(this.onTimeout,this._time)},t.stop=function(){this.timeout&&clearTimeout(this.timeout),delete this.timeout},e}(),_e=function(){function e(e){this._splitSymbol=void 0,this._cache="",this._splitSymbol=e}return e.prototype.split=function(e){var t=(this._cache+e).split(this._splitSymbol);return this._cache=t.splice(t.length-1,1)[0],t},e}(),Me=n(4667),je=function(){function e(e,t){this.topic=void 0,this.messageType=void 0,this.emitter=new Ie,this.subscribed=!1,this.dog=new xe({limit:60,onTimeout:this.onTimeout.bind(this)}),this.strSplit=new _e("---"),this.subscribeChildProcess=void 0,this.topic=e,this.messageType=t,this.subscribed=!1,this.emitter=new Ie}var t=e.prototype;return t.onTimeout=function(){this.subscribed&&(this.unsubscribe(),this.subscribe())},t.onData=function(e){var t=this.strSplit.split(e.toString()).slice(-1)[0];if(t){var n=Me.Qc(t);this.emitter.emit("message",n)}},t.subscribe=function(){this.subscribeChildProcess||(this.subscribed=!0,this.subscribeChildProcess=(0,z.spawn)("rostopic",["echo",this.topic]),this.subscribeChildProcess.stdout.on("data",this.onData.bind(this)),this.dog.init())},t.unsubscribe=function(){this.subscribeChildProcess||(this.dog.stop(),this.subscribed=!1,le(this.subscribeChildProcess.pid),this.subscribeChildProcess=null)},t.publish=function(e){var t=this,n=Me.Pz(e);return new Promise((function(e,s){(0,z.exec)("rostopic pub -1 "+t.topic+" "+t.messageType+' "'+n+'"',(function(t,n){t?s(t):e(n)}))}))},e}(),$e={cache:[],getTopic:function(e,t){var n=this.cache.find((function(t){return t.topic===e}));if(n)return n;var s=new je(e,t);return this.cache.push(s),s}}})(),s})()));
|
|
@@ -6,3 +6,7 @@ export declare function getProcessByPpid(pid: number): Promise<number[]>;
|
|
|
6
6
|
export declare const getProcessTree: (pid: number, tree?: any) => Promise<any>;
|
|
7
7
|
export declare function SIGKILL(pid: number, signal?: number): Promise<unknown>;
|
|
8
8
|
export declare const heartbeat: () => void;
|
|
9
|
+
export declare const getAudioCards: (filter?: string) => Promise<{
|
|
10
|
+
text: string;
|
|
11
|
+
index: string;
|
|
12
|
+
}[]>;
|
|
@@ -208,14 +208,8 @@ export var SIGKILL = _async(function (pid, signal) {
|
|
|
208
208
|
if (signal === void 0) {
|
|
209
209
|
signal = 2;
|
|
210
210
|
}
|
|
211
|
-
return process.platform === 'win32' ? new Promise(function (resolve
|
|
212
|
-
exec("taskkill /pid " + pid + " /T /F",
|
|
213
|
-
if (err) {
|
|
214
|
-
reject(err);
|
|
215
|
-
} else {
|
|
216
|
-
resolve('');
|
|
217
|
-
}
|
|
218
|
-
});
|
|
211
|
+
return process.platform === 'win32' ? new Promise(function (resolve) {
|
|
212
|
+
exec("taskkill /pid " + pid + " /T /F", resolve);
|
|
219
213
|
}) : _await(getProcessTree(pid), function (tree) {
|
|
220
214
|
// 获取所有进程PID,从叶到根
|
|
221
215
|
var tmp = [tree.pid];
|
|
@@ -240,17 +234,13 @@ var _SIGKILL = _async(function (pid, signal, times) {
|
|
|
240
234
|
if (times > 5) {
|
|
241
235
|
throw new Error('SIGKILL 失败. times > 5');
|
|
242
236
|
}
|
|
243
|
-
if (process.platform === 'win32') {
|
|
244
|
-
process.kill(pid, signal);
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
237
|
exec("kill -" + signal + " " + pid);
|
|
248
238
|
return _continueIgnored(_catch(function () {
|
|
249
239
|
return _awaitIgnored(waitFor(function () {
|
|
250
240
|
return isProcessDied(pid);
|
|
251
241
|
}, {
|
|
252
|
-
checkTime:
|
|
253
|
-
timeout:
|
|
242
|
+
checkTime: 100,
|
|
243
|
+
timeout: 4000
|
|
254
244
|
}));
|
|
255
245
|
}, function () {
|
|
256
246
|
return _awaitIgnored(_SIGKILL(pid, 9, times + 1));
|
|
@@ -359,10 +349,41 @@ export var heartbeat = function heartbeat() {
|
|
|
359
349
|
return;
|
|
360
350
|
}
|
|
361
351
|
loop(_async(function () {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
352
|
+
return _awaitIgnored(new Promise(function (resolve) {
|
|
353
|
+
process.send({
|
|
354
|
+
type: 'beat',
|
|
355
|
+
timestamp: new Date().valueOf()
|
|
356
|
+
}, resolve);
|
|
357
|
+
}));
|
|
367
358
|
}), 6000);
|
|
359
|
+
};
|
|
360
|
+
var parseAudioCard = function parseAudioCard(v) {
|
|
361
|
+
var _exec, _exec2;
|
|
362
|
+
var card = (_exec = /card \d/.exec(v)) != null ? _exec : ['card 1'];
|
|
363
|
+
card = parseInt(card[0].replace('card ', ''), 10);
|
|
364
|
+
var device = (_exec2 = /device \d/.exec(v)) != null ? _exec2 : ['device 0'];
|
|
365
|
+
device = parseInt(device[0].replace('device ', ''), 10);
|
|
366
|
+
return {
|
|
367
|
+
text: v,
|
|
368
|
+
index: "hw:" + card + "," + device
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
export var getAudioCards = function getAudioCards(filter) {
|
|
372
|
+
if (filter === void 0) {
|
|
373
|
+
filter = '';
|
|
374
|
+
}
|
|
375
|
+
return new Promise(function (resolve, reject) {
|
|
376
|
+
exec("arecord -l", function (err, stdout) {
|
|
377
|
+
if (err) {
|
|
378
|
+
reject(err);
|
|
379
|
+
} else {
|
|
380
|
+
var arr = stdout.toString().split('\n').filter(function (item) {
|
|
381
|
+
return item.includes('card') && (filter ? item.includes(filter) : true);
|
|
382
|
+
}).map(function (item) {
|
|
383
|
+
return parseAudioCard(item);
|
|
384
|
+
});
|
|
385
|
+
resolve(arr);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
});
|
|
368
389
|
};
|
|
@@ -6,3 +6,7 @@ export declare function getProcessByPpid(pid: number): Promise<number[]>;
|
|
|
6
6
|
export declare const getProcessTree: (pid: number, tree?: any) => Promise<any>;
|
|
7
7
|
export declare function SIGKILL(pid: number, signal?: number): Promise<unknown>;
|
|
8
8
|
export declare const heartbeat: () => void;
|
|
9
|
+
export declare const getAudioCards: (filter?: string) => Promise<{
|
|
10
|
+
text: string;
|
|
11
|
+
index: string;
|
|
12
|
+
}[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.heartbeat = exports.SIGKILL = exports.getProcessTree = exports.getProcessByPpid = exports.isProcessDied = exports.getProcessCommandByPid = exports.getProcessCpuUseByPid = exports.getProcessName = void 0;
|
|
3
|
+
exports.getAudioCards = exports.heartbeat = exports.SIGKILL = exports.getProcessTree = exports.getProcessByPpid = exports.isProcessDied = exports.getProcessCommandByPid = exports.getProcessCpuUseByPid = exports.getProcessName = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const pubo_utils_1 = require("pubo-utils");
|
|
6
6
|
// 获取进程名称
|
|
@@ -94,13 +94,9 @@ async function _SIGKILL(pid, signal = 2, times = 1) {
|
|
|
94
94
|
if (times > 5) {
|
|
95
95
|
throw new Error('SIGKILL 失败. times > 5');
|
|
96
96
|
}
|
|
97
|
-
if (process.platform === 'win32') {
|
|
98
|
-
process.kill(pid, signal);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
97
|
(0, child_process_1.exec)(`kill -${signal} ${pid}`);
|
|
102
98
|
try {
|
|
103
|
-
await (0, pubo_utils_1.waitFor)(async () => isProcessDied(pid), { checkTime:
|
|
99
|
+
await (0, pubo_utils_1.waitFor)(async () => isProcessDied(pid), { checkTime: 100, timeout: 4000 });
|
|
104
100
|
}
|
|
105
101
|
catch (err) {
|
|
106
102
|
await _SIGKILL(pid, 9, times + 1);
|
|
@@ -117,15 +113,8 @@ const flatProcessTree = (tree, tmp) => {
|
|
|
117
113
|
};
|
|
118
114
|
async function SIGKILL(pid, signal = 2) {
|
|
119
115
|
if (process.platform === 'win32') {
|
|
120
|
-
return new Promise((resolve
|
|
121
|
-
(0, child_process_1.exec)(`taskkill /pid ${pid} /T /F`,
|
|
122
|
-
if (err) {
|
|
123
|
-
reject(err);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
resolve('');
|
|
127
|
-
}
|
|
128
|
-
});
|
|
116
|
+
return new Promise((resolve) => {
|
|
117
|
+
(0, child_process_1.exec)(`taskkill /pid ${pid} /T /F`, resolve);
|
|
129
118
|
});
|
|
130
119
|
}
|
|
131
120
|
let tree = await (0, exports.getProcessTree)(pid);
|
|
@@ -146,7 +135,34 @@ const heartbeat = () => {
|
|
|
146
135
|
return;
|
|
147
136
|
}
|
|
148
137
|
(0, pubo_utils_1.loop)(async () => {
|
|
149
|
-
|
|
138
|
+
await new Promise((resolve) => {
|
|
139
|
+
process.send({ type: 'beat', timestamp: new Date().valueOf() }, resolve);
|
|
140
|
+
});
|
|
150
141
|
}, 6000);
|
|
151
142
|
};
|
|
152
143
|
exports.heartbeat = heartbeat;
|
|
144
|
+
const parseAudioCard = (v) => {
|
|
145
|
+
let card = /card \d/.exec(v) ?? ['card 1'];
|
|
146
|
+
card = parseInt(card[0].replace('card ', ''), 10);
|
|
147
|
+
let device = /device \d/.exec(v) ?? ['device 0'];
|
|
148
|
+
device = parseInt(device[0].replace('device ', ''), 10);
|
|
149
|
+
return { text: v, index: `hw:${card},${device}` };
|
|
150
|
+
};
|
|
151
|
+
const getAudioCards = (filter = '') => {
|
|
152
|
+
return new Promise((resolve, reject) => {
|
|
153
|
+
(0, child_process_1.exec)(`arecord -l`, (err, stdout) => {
|
|
154
|
+
if (err) {
|
|
155
|
+
reject(err);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
const arr = stdout
|
|
159
|
+
.toString()
|
|
160
|
+
.split('\n')
|
|
161
|
+
.filter((item) => item.includes('card') && (filter ? item.includes(filter) : true))
|
|
162
|
+
.map((item) => parseAudioCard(item));
|
|
163
|
+
resolve(arr);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
exports.getAudioCards = getAudioCards;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pubo-node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.152",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -20,11 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@types/node": "^17.0.25",
|
|
23
|
-
"pako": "^2.0.4",
|
|
24
23
|
"pubo-utils": "^1.0.149",
|
|
25
|
-
"
|
|
24
|
+
"yaml": "^2.5.1"
|
|
26
25
|
},
|
|
27
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "979ca9bba4c9d5b9b7b9192e835bb0ef8e50ad67",
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"@babel/cli": "^7.10.1",
|
|
30
29
|
"@babel/core": "^7.10.2",
|