codeassembly-guidance 0.0.0 → 0.1.0
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/.meta/changelog.json +563 -0
- package/CHANGELOG.md +134 -0
- package/LICENSE +7 -0
- package/README.md +165 -1
- package/content/_partials/README.md +192 -0
- package/content/_partials/code-descriptions.md +4 -0
- package/content/_partials/code-style.md +7 -0
- package/content/_partials/comment-discipline.md +89 -0
- package/content/_partials/concision.md +3 -0
- package/content/_partials/diff-audit-checklist.md +9 -0
- package/content/_partials/file-access.md +4 -0
- package/content/_partials/live-repo-writes.md +13 -0
- package/content/_partials/plain-speech-calibration.md +66 -0
- package/content/_partials/plain-speech.md +13 -0
- package/content/_partials/prose-line-breaks.md +3 -0
- package/content/_partials/record-marker.md +1 -0
- package/content/_partials/reduced-object-relative.md +28 -0
- package/content/_partials/shell-commands.md +3 -0
- package/content/_partials/target-file-set-resolution.md +22 -0
- package/content/_partials/technical-recommendations.md +5 -0
- package/content/_partials/test-structure-audit-checklist.md +7 -0
- package/content/_partials/ticket-assessment-baseline.md +12 -0
- package/content/_partials/ticket-assessment.md +202 -0
- package/content/_partials/work-type-choice.md +13 -0
- package/content/codeassembly-content.yaml +49 -0
- package/content/collections/all.md +11 -0
- package/content/collections/atlassian.md +16 -0
- package/content/collections/recommended.md +34 -0
- package/content/collections/triage.md +77 -0
- package/content/collections/williamthorsen.md +25 -0
- package/content/guidance/README.md +22 -0
- package/content/guidance/_harnesses/claude/CLAUDE.md +6 -0
- package/content/guidance/_harnesses/rovo/AGENTS.md +5 -0
- package/content/guidance/_harnesses/rovo/codeassembly-guidance.md +4 -0
- package/content/guidance/rulebooks/accessibility-conventions.md +20 -0
- package/content/guidance/rulebooks/codeassembly-content-specification.md +161 -0
- package/content/guidance/rulebooks/command-output-conventions.md +14 -0
- package/content/guidance/rulebooks/commit-conventions.md +72 -0
- package/content/guidance/rulebooks/generated-content-policy.md +10 -0
- package/content/guidance/rulebooks/live-worktree-policy.md +18 -0
- package/content/guidance/rulebooks/readme-conventions.md +74 -0
- package/content/guidance/rulebooks/shared-data-conventions.md +14 -0
- package/content/guidance/rulebooks/shell-conventions.md +279 -0
- package/content/guidance/rulebooks/williamthorsen-code-layout-preferences.md +102 -0
- package/content/guidance/rulebooks/williamthorsen-collaboration-preferences.md +58 -0
- package/content/guidance/rulebooks/williamthorsen-comment-preferences.md +30 -0
- package/content/guidance/rulebooks/williamthorsen-subagent-model-preferences.md +15 -0
- package/content/guidance/rulebooks/williamthorsen-ticketing-preferences.md +22 -0
- package/content/guidance/rulebooks/williamthorsen-tooling-preferences.md +36 -0
- package/content/guidance/rulebooks/williamthorsen-typescript-preferences.md +90 -0
- package/content/guidance/rulebooks/williamthorsen-workflow-preferences.md +58 -0
- package/content/guidance/rulebooks/williamthorsen-writing-preferences.md +80 -0
- package/content/guidance/shared/AGENTS.md +43 -0
- package/content/scripts/README.md +41 -0
- package/content/scripts/describe-change.mjs +165 -0
- package/content/scripts/get-ticket-id.sh +131 -0
- package/content/scripts/manage-jira-ticket.mjs +209 -0
- package/content/scripts/resolve-frontmatter.sh +540 -0
- package/content/scripts/resolve-review-run.mjs +12 -0
- package/content/scripts/select-lede-exemplars.mjs +208 -0
- package/content/skills/_data/action-items.md +83 -0
- package/content/skills/_data/artifact-conventions.md +969 -0
- package/content/skills/_data/bitbucket-pr-access.md +89 -0
- package/content/skills/_data/branch-format.md +34 -0
- package/content/skills/_data/change-record.md +163 -0
- package/content/skills/_data/complexity-classification.md +58 -0
- package/content/skills/_data/concision.md +23 -0
- package/content/skills/_data/deployed-file-provenance.md +46 -0
- package/content/skills/_data/design-priorities.md +76 -0
- package/content/skills/_data/gh-body-file.md +30 -0
- package/content/skills/_data/git-commands.md +39 -0
- package/content/skills/_data/naming-conventions.md +50 -0
- package/content/skills/_data/pr-resolution.md +25 -0
- package/content/skills/_data/pr-source-resolution.md +36 -0
- package/content/skills/_data/recommendation-gradient.md +90 -0
- package/content/skills/_data/scope-and-deferral.md +83 -0
- package/content/skills/_data/spike-conventions.md +89 -0
- package/content/skills/_data/ticket-evaluation.md +13 -0
- package/content/skills/_data/ticket-id-extraction.md +43 -0
- package/content/skills/_data/ticket-source-resolution.md +147 -0
- package/content/skills/_data/title-templates.md +624 -0
- package/content/skills/_data/title-voice.md +17 -0
- package/content/skills/_data/work-types.json +168 -0
- package/content/skills/_partials/acceptance-criteria-scaffold.md +15 -0
- package/content/skills/_partials/action-items.md +22 -0
- package/content/skills/_partials/bitbucket-delete-both-refusal.md +3 -0
- package/content/skills/_partials/commit-title-rendering.md +14 -0
- package/content/skills/_partials/gh-body-file.md +22 -0
- package/content/skills/_partials/nested-list-indent.md +9 -0
- package/content/skills/_partials/next-steps-after-plan.md +99 -0
- package/content/skills/_partials/next-steps-after-review.md +350 -0
- package/content/skills/_partials/option-format.md +84 -0
- package/content/skills/_partials/plan-template.md +97 -0
- package/content/skills/_partials/split-launch-prompts.md +5 -0
- package/content/skills/_partials/split-ticket-compose.md +5 -0
- package/content/skills/_partials/split-ticket-create.md +3 -0
- package/content/skills/_partials/ticket-and-plan-completeness.md +33 -0
- package/content/skills/_partials/ticket-concision.md +18 -0
- package/content/skills/_partials/ticket-criteria-conventions.md +7 -0
- package/content/skills/_partials/ticket-placement.md +14 -0
- package/content/skills/_partials/ticket-skeleton-tiers.md +6 -0
- package/content/skills/_partials/ticket-skeleton.md +13 -0
- package/content/skills/add-change-record/SKILL.md +136 -0
- package/content/skills/add-test-ids/SKILL.md +51 -0
- package/content/skills/align-ticket-with-implementation/SKILL.md +115 -0
- package/content/skills/anti-patterns/SKILL.md +57 -0
- package/content/skills/assess-ticket/SKILL.md +46 -0
- package/content/skills/assess-ticket/next-steps-after-assessment.md +98 -0
- package/content/skills/brainstorming/SKILL.md +107 -0
- package/content/skills/capture-event/SKILL.md +108 -0
- package/content/skills/capture-event/capture-event.mjs +216 -0
- package/content/skills/capture-feedback/SKILL.md +71 -0
- package/content/skills/capture-lede-decision/SKILL.md +163 -0
- package/content/skills/capture-lede-decision/capture-lede-decision.mjs +231 -0
- package/content/skills/classify-complexity/SKILL.md +92 -0
- package/content/skills/collaborate/SKILL.md +86 -0
- package/content/skills/condense-branch/SKILL.md +83 -0
- package/content/skills/create-bitbucket-pr/SKILL.md +87 -0
- package/content/skills/create-commit/SKILL.md +65 -0
- package/content/skills/create-devlog/SKILL.md +108 -0
- package/content/skills/create-gh-pr/SKILL.md +106 -0
- package/content/skills/create-pr/SKILL.md +150 -0
- package/content/skills/create-ticket/SKILL.md +350 -0
- package/content/skills/derive-session-context/derive-session-context.mjs +148 -0
- package/content/skills/design-and-plan/SKILL.md +194 -0
- package/content/skills/development-workflows/SKILL.md +41 -0
- package/content/skills/get-ticket-id/SKILL.md +67 -0
- package/content/skills/groom-backlog/SKILL.md +245 -0
- package/content/skills/groom-backlog/groom-backlog.mjs +106 -0
- package/content/skills/implement-plan/SKILL.md +164 -0
- package/content/skills/index-prototypes/SKILL.md +145 -0
- package/content/skills/index-prototypes/index-prototypes.mjs +328 -0
- package/content/skills/kb-add/SKILL.md +156 -0
- package/content/skills/kb-add/kb-add.mjs +216 -0
- package/content/skills/kb-curate/SKILL.md +117 -0
- package/content/skills/kb-curate/kb-curate.mjs +213 -0
- package/content/skills/kb-edit/SKILL.md +128 -0
- package/content/skills/kb-edit/kb-edit.mjs +219 -0
- package/content/skills/kb-retrieve/SKILL.md +100 -0
- package/content/skills/kb-retrieve/kb-retrieve.mjs +206 -0
- package/content/skills/kb-retrieve-events/SKILL.md +98 -0
- package/content/skills/kb-retrieve-events/kb-retrieve-events.mjs +206 -0
- package/content/skills/kb-update-events/SKILL.md +77 -0
- package/content/skills/kb-update-events/kb-update-events.mjs +215 -0
- package/content/skills/merge-bb-pr/SKILL.md +136 -0
- package/content/skills/merge-gh-pr/SKILL.md +167 -0
- package/content/skills/merge-gh-pr/merge-gh-pr.mjs +10 -0
- package/content/skills/merge-pr/SKILL.md +368 -0
- package/content/skills/migrate-feedback-memories/SKILL.md +136 -0
- package/content/skills/migrate-feedback-memories/feedback-memories.mjs +161 -0
- package/content/skills/people-report/SKILL.md +208 -0
- package/content/skills/plan/SKILL.md +87 -0
- package/content/skills/prepare-prototype-brief/SKILL.md +126 -0
- package/content/skills/pull-from-backlog/SKILL.md +83 -0
- package/content/skills/pull-from-backlog/pull-from-backlog.mjs +208 -0
- package/content/skills/refine-plan/SKILL.md +259 -0
- package/content/skills/respond-to-review/SKILL.md +292 -0
- package/content/skills/review-bb-pr/SKILL.md +161 -0
- package/content/skills/review-branch/SKILL.md +301 -0
- package/content/skills/review-criteria/SKILL.md +108 -0
- package/content/skills/review-gh-pr/SKILL.md +155 -0
- package/content/skills/review-gh-pr/select-pr-ticket.mjs +8 -0
- package/content/skills/review-permissions/SKILL.md +39 -0
- package/content/skills/review-pr/SKILL.md +123 -0
- package/content/skills/revise-comments/SKILL.md +115 -0
- package/content/skills/revise-prose/SKILL.md +197 -0
- package/content/skills/revise-prose/revise-prose.mjs +229 -0
- package/content/skills/save-artifact/SKILL.md +69 -0
- package/content/skills/save-plan/SKILL.md +55 -0
- package/content/skills/software-engineering/SKILL.md +74 -0
- package/content/skills/streamline-guidance/SKILL.md +174 -0
- package/content/skills/streamline-guidance/streamline-guidance.mjs +211 -0
- package/content/skills/summarize-change/SKILL.md +308 -0
- package/content/skills/summarize-chat/SKILL.md +100 -0
- package/content/skills/systematic-debugging/SKILL.md +308 -0
- package/content/skills/systematic-debugging/condition-based-waiting-example.ts +160 -0
- package/content/skills/systematic-debugging/condition-based-waiting.md +122 -0
- package/content/skills/systematic-debugging/defense-in-depth.md +130 -0
- package/content/skills/systematic-debugging/find-polluter.sh +68 -0
- package/content/skills/systematic-debugging/root-cause-tracing.md +185 -0
- package/content/skills/systematic-debugging/test-academic.md +16 -0
- package/content/skills/systematic-debugging/test-pressure-1.md +67 -0
- package/content/skills/systematic-debugging/test-pressure-2.md +77 -0
- package/content/skills/systematic-debugging/test-pressure-3.md +77 -0
- package/content/skills/testing-conventions/SKILL.md +168 -0
- package/content/skills/testing-conventions/mistakes.md +1 -0
- package/content/skills/typescript-testing-conventions/SKILL.md +129 -0
- package/content/skills/update-jira-ticket/SKILL.md +245 -0
- package/content/skills/update-jira-ticket/update-jira-ticket.mjs +9 -0
- package/content/skills/update-project-guidance/SKILL.md +300 -0
- package/content/skills/upgrade-dependencies/SKILL.md +139 -0
- package/content/skills/wrap-up/SKILL.md +431 -0
- package/content/subagents/_data/claude.yaml +19 -0
- package/content/subagents/_data/rovo.yaml +31 -0
- package/content/subagents/canary.md +11 -0
- package/content/subagents/entry-drafter.md +187 -0
- package/content/subagents/handoff-reviewer.md +75 -0
- package/content/subagents/plan-reviewer.md +184 -0
- package/content/subagents/plan-reviser.md +88 -0
- package/content/subagents/prose-reviser.md +130 -0
- package/content/subagents/ticket-assessor.md +139 -0
- package/package.json +70 -2
- package/schemas/preferences.v1.json +294 -0
- package/schemas/work-types.v1.json +142 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { createRequire as __cjsCreateRequire } from 'node:module';
|
|
2
|
+
const require = __cjsCreateRequire(import.meta.url);
|
|
3
|
+
var el=Object.create;var jn=Object.defineProperty;var tl=Object.getOwnPropertyDescriptor;var nl=Object.getOwnPropertyNames;var rl=Object.getPrototypeOf,il=Object.prototype.hasOwnProperty;var o=(t,e)=>jn(t,"name",{value:e,configurable:!0}),$t=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var y=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}};var sl=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nl(e))!il.call(t,i)&&i!==n&&jn(t,i,{get:()=>e[i],enumerable:!(r=tl(e,i))||r.enumerable});return t};var Re=(t,e,n)=>(n=t!=null?el(rl(t)):{},sl(e||!t||!t.__esModule?jn(n,"default",{value:t,enumerable:!0}):n,t));var R=y(M=>{"use strict";var Yn=Symbol.for("yaml.alias"),ss=Symbol.for("yaml.document"),_t=Symbol.for("yaml.map"),os=Symbol.for("yaml.pair"),Jn=Symbol.for("yaml.scalar"),Dt=Symbol.for("yaml.seq"),z=Symbol.for("yaml.node.type"),xl=o(t=>!!t&&typeof t=="object"&&t[z]===Yn,"isAlias"),Bl=o(t=>!!t&&typeof t=="object"&&t[z]===ss,"isDocument"),Fl=o(t=>!!t&&typeof t=="object"&&t[z]===_t,"isMap"),jl=o(t=>!!t&&typeof t=="object"&&t[z]===os,"isPair"),as=o(t=>!!t&&typeof t=="object"&&t[z]===Jn,"isScalar"),Kl=o(t=>!!t&&typeof t=="object"&&t[z]===Dt,"isSeq");function cs(t){if(t&&typeof t=="object")switch(t[z]){case _t:case Dt:return!0}return!1}o(cs,"isCollection");function Vl(t){if(t&&typeof t=="object")switch(t[z]){case Yn:case _t:case Jn:case Dt:return!0}return!1}o(Vl,"isNode");var Ul=o(t=>(as(t)||cs(t))&&!!t.anchor,"hasAnchor");M.ALIAS=Yn;M.DOC=ss;M.MAP=_t;M.NODE_TYPE=z;M.PAIR=os;M.SCALAR=Jn;M.SEQ=Dt;M.hasAnchor=Ul;M.isAlias=xl;M.isCollection=cs;M.isDocument=Bl;M.isMap=Fl;M.isNode=Vl;M.isPair=jl;M.isScalar=as;M.isSeq=Kl});var Qe=y(Gn=>{"use strict";var q=R(),D=Symbol("break visit"),ls=Symbol("skip children"),G=Symbol("remove node");function It(t,e){let n=us(e);q.isDocument(t)?Oe(null,t.contents,n,Object.freeze([t]))===G&&(t.contents=null):Oe(null,t,n,Object.freeze([]))}o(It,"visit");It.BREAK=D;It.SKIP=ls;It.REMOVE=G;function Oe(t,e,n,r){let i=fs(t,e,n,r);if(q.isNode(i)||q.isPair(i))return ds(t,r,i),Oe(t,i,n,r);if(typeof i!="symbol"){if(q.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let a=Oe(s,e.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===D)return D;a===G&&(e.items.splice(s,1),s-=1)}}}else if(q.isPair(e)){r=Object.freeze(r.concat(e));let s=Oe("key",e.key,n,r);if(s===D)return D;s===G&&(e.key=null);let a=Oe("value",e.value,n,r);if(a===D)return D;a===G&&(e.value=null)}}return i}o(Oe,"visit_");async function xt(t,e){let n=us(e);q.isDocument(t)?await Ne(null,t.contents,n,Object.freeze([t]))===G&&(t.contents=null):await Ne(null,t,n,Object.freeze([]))}o(xt,"visitAsync");xt.BREAK=D;xt.SKIP=ls;xt.REMOVE=G;async function Ne(t,e,n,r){let i=await fs(t,e,n,r);if(q.isNode(i)||q.isPair(i))return ds(t,r,i),Ne(t,i,n,r);if(typeof i!="symbol"){if(q.isCollection(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){let a=await Ne(s,e.items[s],n,r);if(typeof a=="number")s=a-1;else{if(a===D)return D;a===G&&(e.items.splice(s,1),s-=1)}}}else if(q.isPair(e)){r=Object.freeze(r.concat(e));let s=await Ne("key",e.key,n,r);if(s===D)return D;s===G&&(e.key=null);let a=await Ne("value",e.value,n,r);if(a===D)return D;a===G&&(e.value=null)}}return i}o(Ne,"visitAsync_");function us(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}o(us,"initVisitor");function fs(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(q.isMap(e))return n.Map?.(t,e,r);if(q.isSeq(e))return n.Seq?.(t,e,r);if(q.isPair(e))return n.Pair?.(t,e,r);if(q.isScalar(e))return n.Scalar?.(t,e,r);if(q.isAlias(e))return n.Alias?.(t,e,r)}o(fs,"callVisitor");function ds(t,e,n){let r=e[e.length-1];if(q.isCollection(r))r.items[t]=n;else if(q.isPair(r))t==="key"?r.key=n:r.value=n;else if(q.isDocument(r))r.contents=n;else{let i=q.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}o(ds,"replaceNode");Gn.visit=It;Gn.visitAsync=xt});var Hn=y(ms=>{"use strict";var ps=R(),Wl=Qe(),Yl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Jl=o(t=>t.replace(/[!,[\]{}]/g,e=>Yl[e]),"escapeTagName"),ze=class t{static{o(this,"Directives")}constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[s,a]=r;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,a),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}let[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(a){return n(String(a)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+Jl(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&ps.isNode(e.contents)){let s={};Wl.visit(e.contents,(a,c)=>{ps.isNode(c)&&c.tag&&(s[c.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of r)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(c=>c.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(`
|
|
4
|
+
`)}};ze.defaultYaml={explicit:!1,version:"1.2"};ze.defaultTags={"!!":"tag:yaml.org,2002:"};ms.Directives=ze});var Bt=y(Xe=>{"use strict";var hs=R(),Gl=Qe();function Hl(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}o(Hl,"anchorIsValid");function gs(t){let e=new Set;return Gl.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}o(gs,"anchorNames");function ys(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}o(ys,"findNewAnchor");function Ql(t,e){let n=[],r=new Map,i=null;return{onAnchor:o(s=>{n.push(s),i??(i=gs(t));let a=ys(e,i);return i.add(a),a},"onAnchor"),setAnchors:o(()=>{for(let s of n){let a=r.get(s);if(typeof a=="object"&&a.anchor&&(hs.isScalar(a.node)||hs.isCollection(a.node)))a.node.anchor=a.anchor;else{let c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=s,c}}},"setAnchors"),sourceObjects:r}}o(Ql,"createNodeAnchors");Xe.anchorIsValid=Hl;Xe.anchorNames=gs;Xe.createNodeAnchors=Ql;Xe.findNewAnchor=ys});var Qn=y(bs=>{"use strict";function Ze(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){let a=r[i],c=Ze(t,r,String(i),a);c===void 0?delete r[i]:c!==a&&(r[i]=c)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let s=r.get(i),a=Ze(t,r,i,s);a===void 0?r.delete(i):a!==s&&r.set(i,a)}else if(r instanceof Set)for(let i of Array.from(r)){let s=Ze(t,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(let[i,s]of Object.entries(r)){let a=Ze(t,r,i,s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}return t.call(e,n,r)}o(Ze,"applyReviver");bs.applyReviver=Ze});var ne=y(ws=>{"use strict";var zl=R();function ks(t,e,n){if(Array.isArray(t))return t.map((r,i)=>ks(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!zl.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}o(ks,"toJS");ws.toJS=ks});var Ft=y(vs=>{"use strict";var Xl=Qn(),Ss=R(),Zl=ne(),zn=class{static{o(this,"NodeBase")}constructor(e){Object.defineProperty(this,Ss.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!Ss.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Zl.toJS(this,"",a);if(typeof i=="function")for(let{count:l,res:u}of a.anchors.values())i(u,l);return typeof s=="function"?Xl.applyReviver(s,{"":c},"",c):c}};vs.NodeBase=zn});var et=y(Es=>{"use strict";var eu=Bt(),tu=Qe(),Le=R(),nu=Ft(),ru=ne(),Xn=class extends nu.NodeBase{static{o(this,"Alias")}constructor(e){super(Le.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],tu.visit(e,{Node:o((s,a)=>{(Le.isAlias(a)||Le.hasAnchor(a))&&r.push(a)},"Node")}),n&&(n.aliasResolveCache=r));let i;for(let s of r){if(s===this)break;s.anchor===this.source&&(i=s)}if(i&&n){let{anchors:s,doc:a,maxAliasCount:c}=n,l=s.get(i);if(l||(ru.toJS(i,null,n),l=s.get(i)),l?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(c>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=jt(a,i,s)),l.count*l.aliasCount>c)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}}return i}toJSON(e,n){if(!n)return{source:this.source};let r=this.resolve(n.doc,n);if(!r){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return n.anchors.get(r).res}toString(e,n,r){let i=`*${this.source}`;if(e){if(eu.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function jt(t,e,n){if(Le.isAlias(e)){let r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Le.isCollection(e)){let r=0;for(let i of e.items){let s=jt(t,i,n);s>r&&(r=s)}return r}else if(Le.isPair(e)){let r=jt(t,e.key,n),i=jt(t,e.value,n);return Math.max(r,i)}return 1}o(jt,"getAliasCount");Es.Alias=Xn});var L=y(Zn=>{"use strict";var iu=R(),su=Ft(),ou=ne(),au=o(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),re=class extends su.NodeBase{static{o(this,"Scalar")}constructor(e){super(iu.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:ou.toJS(this.value,e,n)}toString(){return String(this.value)}};re.BLOCK_FOLDED="BLOCK_FOLDED";re.BLOCK_LITERAL="BLOCK_LITERAL";re.PLAIN="PLAIN";re.QUOTE_DOUBLE="QUOTE_DOUBLE";re.QUOTE_SINGLE="QUOTE_SINGLE";Zn.Scalar=re;Zn.isScalarValue=au});var tt=y(Cs=>{"use strict";var cu=et(),ye=R(),As=L(),lu="tag:yaml.org,2002:";function uu(t,e,n){if(e){let r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>r.identify?.(t)&&!r.format)}o(uu,"findTagObject");function fu(t,e,n){if(ye.isDocument(t)&&(t=t.contents),ye.isNode(t))return t;if(ye.isPair(t)){let f=n.schema[ye.MAP].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:a,sourceObjects:c}=n,l;if(r&&t&&typeof t=="object"){if(l=c.get(t),l)return l.anchor??(l.anchor=i(t)),new cu.Alias(l.anchor);l={anchor:null,node:null},c.set(t,l)}e?.startsWith("!!")&&(e=lu+e.slice(2));let u=uu(t,e,a.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new As.Scalar(t);return l&&(l.node=f),f}u=t instanceof Map?a[ye.MAP]:Symbol.iterator in Object(t)?a[ye.SEQ]:a[ye.MAP]}s&&(s(u),delete n.onTagObj);let p=u?.createNode?u.createNode(n.schema,t,n):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(n.schema,t,n):new As.Scalar(t);return e?p.tag=e:u.default||(p.tag=u.tag),l&&(l.node=p),p}o(fu,"createNode");Cs.createNode=fu});var Vt=y(Kt=>{"use strict";var du=tt(),H=R(),pu=Ft();function er(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=r,r=a}else r=new Map([[s,r]])}return du.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:o(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:t,sourceObjects:new Map})}o(er,"collectionFromPath");var Rs=o(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),tr=class extends pu.NodeBase{static{o(this,"Collection")}constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>H.isNode(r)||H.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Rs(e))this.add(n);else{let[r,...i]=e,s=this.get(r,!0);if(H.isCollection(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,er(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(H.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&H.isScalar(s)?s.value:s:H.isCollection(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!H.isPair(n))return!1;let r=n.value;return r==null||e&&H.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let i=this.get(n,!0);return H.isCollection(i)?i.hasIn(r):!1}setIn(e,n){let[r,...i]=e;if(i.length===0)this.set(r,n);else{let s=this.get(r,!0);if(H.isCollection(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,er(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};Kt.Collection=tr;Kt.collectionFromPath=er;Kt.isEmptyPath=Rs});var nt=y(Ut=>{"use strict";var mu=o(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function nr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}o(nr,"indentComment");var hu=o((t,e,n)=>t.endsWith(`
|
|
5
|
+
`)?nr(n,e):n.includes(`
|
|
6
|
+
`)?`
|
|
7
|
+
`+nr(n,e):(t.endsWith(" ")?"":" ")+n,"lineComment");Ut.indentComment=nr;Ut.lineComment=hu;Ut.stringifyComment=mu});var Os=y(rt=>{"use strict";var gu="flow",rr="block",Wt="quoted";function yu(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:c}={}){if(!i||i<0)return t;i<s&&(s=0);let l=Math.max(1+s,1+i-e.length);if(t.length<=l)return t;let u=[],p={},f=i-e.length;typeof r=="number"&&(r>i-Math.max(2,s)?u.push(0):f=i-r);let d,h,b=!1,m=-1,g=-1,w=-1;n===rr&&(m=Ts(t,m,e.length),m!==-1&&(f=m+l));for(let v;v=t[m+=1];){if(n===Wt&&v==="\\"){switch(g=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}w=m}if(v===`
|
|
8
|
+
`)n===rr&&(m=Ts(t,m,e.length)),f=m+e.length+l,d=void 0;else{if(v===" "&&h&&h!==" "&&h!==`
|
|
9
|
+
`&&h!==" "){let E=t[m+1];E&&E!==" "&&E!==`
|
|
10
|
+
`&&E!==" "&&(d=m)}if(m>=f)if(d)u.push(d),f=d+l,d=void 0;else if(n===Wt){for(;h===" "||h===" ";)h=v,v=t[m+=1],b=!0;let E=m>w+1?m-2:g-1;if(p[E])return t;u.push(E),p[E]=!0,f=E+l,d=void 0}else b=!0}h=v}if(b&&c&&c(),u.length===0)return t;a&&a();let S=t.slice(0,u[0]);for(let v=0;v<u.length;++v){let E=u[v],A=u[v+1]||t.length;E===0?S=`
|
|
11
|
+
${e}${t.slice(0,A)}`:(n===Wt&&p[E]&&(S+=`${t[E]}\\`),S+=`
|
|
12
|
+
${e}${t.slice(E+1,A)}`)}return S}o(yu,"foldFlowLines");function Ts(t,e,n){let r=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
13
|
+
`);r=e,i=e+1,s=t[i]}return r}o(Ts,"consumeMoreIndentedLines");rt.FOLD_BLOCK=rr;rt.FOLD_FLOW=gu;rt.FOLD_QUOTED=Wt;rt.foldFlowLines=yu});var st=y(Ns=>{"use strict";var U=L(),ie=Os(),Jt=o((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),Gt=o(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function bu(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let s=0,a=0;s<i;++s)if(t[s]===`
|
|
14
|
+
`){if(s-a>r)return!0;if(a=s+1,i-a<=r)return!1}return!0}o(bu,"lineLengthOverLimit");function it(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Gt(t)?" ":""),a="",c=0;for(let l=0,u=n[l];u;u=n[++l])if(u===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(a+=n.slice(c,l)+"\\ ",l+=1,c=l,u="\\"),u==="\\")switch(n[l+1]){case"u":{a+=n.slice(c,l);let p=n.substr(l+2,4);switch(p){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:p.substr(0,2)==="00"?a+="\\x"+p.substr(2):a+=n.substr(l,6)}l+=5,c=l+1}break;case"n":if(r||n[l+2]==='"'||n.length<i)l+=1;else{for(a+=n.slice(c,l)+`
|
|
15
|
+
|
|
16
|
+
`;n[l+2]==="\\"&&n[l+3]==="n"&&n[l+4]!=='"';)a+=`
|
|
17
|
+
`,l+=2;a+=s,n[l+2]===" "&&(a+="\\"),l+=1,c=l+1}break;default:l+=1}return a=c?a+n.slice(c):n,r?a:ie.foldFlowLines(a,s,ie.FOLD_QUOTED,Jt(e,!1))}o(it,"doubleQuotedString");function ir(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return it(t,e);let n=e.indent||(Gt(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${n}`)+"'";return e.implicitKey?r:ie.foldFlowLines(r,n,ie.FOLD_FLOW,Jt(e,!1))}o(ir,"singleQuotedString");function Pe(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=it;else{let i=t.includes('"'),s=t.includes("'");i&&!s?r=ir:s&&!i?r=it:r=n?ir:it}return r(t,e)}o(Pe,"quotedString");var sr;try{sr=new RegExp(`(^|(?<!
|
|
20
|
+
))
|
|
21
|
+
+(?!
|
|
22
|
+
|$)`,"g")}catch{sr=/\n+(?!\n|$)/g}function Yt({comment:t,type:e,value:n},r,i,s){let{blockQuote:a,commentString:c,lineWidth:l}=r.options;if(!a||/\n[\t ]+$/.test(n))return Pe(n,r);let u=r.indent||(r.forceBlockIndent||Gt(n)?" ":""),p=a==="literal"?!0:a==="folded"||e===U.Scalar.BLOCK_FOLDED?!1:e===U.Scalar.BLOCK_LITERAL?!0:!bu(n,l,u.length);if(!n)return p?`|
|
|
23
|
+
`:`>
|
|
24
|
+
`;let f,d;for(d=n.length;d>0;--d){let A=n[d-1];if(A!==`
|
|
25
|
+
`&&A!==" "&&A!==" ")break}let h=n.substring(d),b=h.indexOf(`
|
|
26
|
+
`);b===-1?f="-":n===h||b!==h.length-1?(f="+",s&&s()):f="",h&&(n=n.slice(0,-h.length),h[h.length-1]===`
|
|
27
|
+
`&&(h=h.slice(0,-1)),h=h.replace(sr,`$&${u}`));let m=!1,g,w=-1;for(g=0;g<n.length;++g){let A=n[g];if(A===" ")m=!0;else if(A===`
|
|
28
|
+
`)w=g;else break}let S=n.substring(0,w<g?w+1:g);S&&(n=n.substring(S.length),S=S.replace(/\n+/g,`$&${u}`));let E=(m?u?"2":"1":"")+f;if(t&&(E+=" "+c(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){let A=n.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),C=!1,O=Jt(r,!0);a!=="folded"&&e!==U.Scalar.BLOCK_FOLDED&&(O.onOverflow=()=>{C=!0});let k=ie.foldFlowLines(`${S}${A}${h}`,u,ie.FOLD_BLOCK,O);if(!C)return`>${E}
|
|
30
|
+
${u}${k}`}return n=n.replace(/\n+/g,`$&${u}`),`|${E}
|
|
31
|
+
${u}${S}${n}${h}`}o(Yt,"blockString");function ku(t,e,n,r){let{type:i,value:s}=t,{actualString:a,implicitKey:c,indent:l,indentStep:u,inFlow:p}=e;if(c&&s.includes(`
|
|
32
|
+
`)||p&&/[[\]{},]/.test(s))return Pe(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return c||p||!s.includes(`
|
|
33
|
+
`)?Pe(s,e):Yt(t,e,n,r);if(!c&&!p&&i!==U.Scalar.PLAIN&&s.includes(`
|
|
34
|
+
`))return Yt(t,e,n,r);if(Gt(s)){if(l==="")return e.forceBlockIndent=!0,Yt(t,e,n,r);if(c&&l===u)return Pe(s,e)}let f=s.replace(/\n+/g,`$&
|
|
35
|
+
${l}`);if(a){let d=o(m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),"test"),{compat:h,tags:b}=e.doc.schema;if(b.some(d)||h?.some(d))return Pe(s,e)}return c?f:ie.foldFlowLines(f,l,ie.FOLD_FLOW,Jt(e,!1))}o(ku,"plainString");function wu(t,e,n,r){let{implicitKey:i,inFlow:s}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:c}=t;c!==U.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(c=U.Scalar.QUOTE_DOUBLE);let l=o(p=>{switch(p){case U.Scalar.BLOCK_FOLDED:case U.Scalar.BLOCK_LITERAL:return i||s?Pe(a.value,e):Yt(a,e,n,r);case U.Scalar.QUOTE_DOUBLE:return it(a.value,e);case U.Scalar.QUOTE_SINGLE:return ir(a.value,e);case U.Scalar.PLAIN:return ku(a,e,n,r);default:return null}},"_stringify"),u=l(c);if(u===null){let{defaultKeyType:p,defaultStringType:f}=e.options,d=i&&p||f;if(u=l(d),u===null)throw new Error(`Unsupported default string type ${d}`)}return u}o(wu,"stringifyString");Ns.stringifyString=wu});var ot=y(or=>{"use strict";var Su=Bt(),se=R(),vu=nt(),Eu=st();function Au(t,e){let n=Object.assign({blockQuote:!0,commentString:vu.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,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}o(Au,"createStringifyContext");function Cu(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let n,r;if(se.isScalar(e)){r=e.value;let i=t.filter(s=>s.identify?.(r));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}n=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}o(Cu,"getTagObject");function Ru(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(se.isScalar(t)||se.isCollection(t))&&t.anchor;s&&Su.anchorIsValid(s)&&(n.add(s),i.push(`&${s}`));let a=t.tag??(e.default?null:e.tag);return a&&i.push(r.directives.tagString(a)),i.join(" ")}o(Ru,"stringifyProps");function Tu(t,e,n,r){if(se.isPair(t))return t.toString(e,n,r);if(se.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=se.isNode(t)?t:e.doc.createNode(t,{onTagObj:o(l=>i=l,"onTagObj")});i??(i=Cu(e.doc.schema.tags,s));let a=Ru(s,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let c=typeof i.stringify=="function"?i.stringify(s,e,n,r):se.isScalar(s)?Eu.stringifyString(s,e,n,r):s.toString(e,n,r);return a?se.isScalar(s)||c[0]==="{"||c[0]==="["?`${a} ${c}`:`${a}
|
|
36
|
+
${e.indent}${c}`:c}o(Tu,"stringify");or.createStringifyContext=Au;or.stringify=Tu});var qs=y($s=>{"use strict";var X=R(),Ls=L(),Ps=ot(),at=nt();function Ou({key:t,value:e},n,r,i){let{allNullValues:s,doc:a,indent:c,indentStep:l,options:{commentString:u,indentSeq:p,simpleKeys:f}}=n,d=X.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(X.isCollection(t)||!X.isNode(t)&&typeof t=="object"){let O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let h=!f&&(!t||d&&e==null&&!n.inFlow||X.isCollection(t)||(X.isScalar(t)?t.type===Ls.Scalar.BLOCK_FOLDED||t.type===Ls.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!h&&(f||!s),indent:c+l});let b=!1,m=!1,g=Ps.stringify(t,n,()=>b=!0,()=>m=!0);if(!h&&!n.inFlow&&g.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(n.inFlow){if(s||e==null)return b&&r&&r(),g===""?"?":h?`? ${g}`:g}else if(s&&!f||e==null&&h)return g=`? ${g}`,d&&!b?g+=at.lineComment(g,n.indent,u(d)):m&&i&&i(),g;b&&(d=null),h?(d&&(g+=at.lineComment(g,n.indent,u(d))),g=`? ${g}
|
|
37
|
+
${c}:`):(g=`${g}:`,d&&(g+=at.lineComment(g,n.indent,u(d))));let w,S,v;X.isNode(e)?(w=!!e.spaceBefore,S=e.commentBefore,v=e.comment):(w=!1,S=null,v=null,e&&typeof e=="object"&&(e=a.createNode(e))),n.implicitKey=!1,!h&&!d&&X.isScalar(e)&&(n.indentAtStart=g.length+1),m=!1,!p&&l.length>=2&&!n.inFlow&&!h&&X.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let E=!1,A=Ps.stringify(e,n,()=>E=!0,()=>m=!0),C=" ";if(d||w||S){if(C=w?`
|
|
38
|
+
`:"",S){let O=u(S);C+=`
|
|
39
|
+
${at.indentComment(O,n.indent)}`}A===""&&!n.inFlow?C===`
|
|
40
|
+
`&&v&&(C=`
|
|
41
|
+
|
|
42
|
+
`):C+=`
|
|
43
|
+
${n.indent}`}else if(!h&&X.isCollection(e)){let O=A[0],k=A.indexOf(`
|
|
44
|
+
`),P=k!==-1,te=n.inFlow??e.flow??e.items.length===0;if(P||!te){let Ce=!1;if(P&&(O==="&"||O==="!")){let $=A.indexOf(" ");O==="&"&&$!==-1&&$<k&&A[$+1]==="!"&&($=A.indexOf(" ",$+1)),($===-1||k<$)&&(Ce=!0)}Ce||(C=`
|
|
45
|
+
${n.indent}`)}}else(A===""||A[0]===`
|
|
46
|
+
`)&&(C="");return g+=C+A,n.inFlow?E&&r&&r():v&&!E?g+=at.lineComment(g,n.indent,u(v)):m&&i&&i(),g}o(Ou,"stringifyPair");$s.stringifyPair=Ou});var cr=y(ar=>{"use strict";var Ms=$t("process");function Nu(t,...e){t==="debug"&&console.log(...e)}o(Nu,"debug");function Lu(t,e){(t==="debug"||t==="warn")&&(typeof Ms.emitWarning=="function"?Ms.emitWarning(e):console.warn(e))}o(Lu,"warn");ar.debug=Nu;ar.warn=Lu});var Zt=y(Xt=>{"use strict";var zt=R(),_s=L(),Ht="<<",Qt={identify:o(t=>t===Ht||typeof t=="symbol"&&t.description===Ht,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:o(()=>Object.assign(new _s.Scalar(Symbol(Ht)),{addToJSMap:Ds}),"resolve"),stringify:o(()=>Ht,"stringify")},Pu=o((t,e)=>(Qt.identify(e)||zt.isScalar(e)&&(!e.type||e.type===_s.Scalar.PLAIN)&&Qt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Qt.tag&&n.default),"isMergeKey");function Ds(t,e,n){let r=Is(t,n);if(zt.isSeq(r))for(let i of r.items)lr(t,e,i);else if(Array.isArray(r))for(let i of r)lr(t,e,i);else lr(t,e,r)}o(Ds,"addMergeToJSMap");function lr(t,e,n){let r=Is(t,n);if(!zt.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,t,Map);for(let[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}o(lr,"mergeValue");function Is(t,e){return t&&zt.isAlias(e)?e.resolve(t.doc,t):e}o(Is,"resolveAliasValue");Xt.addMergeToJSMap=Ds;Xt.isMergeKey=Pu;Xt.merge=Qt});var fr=y(Fs=>{"use strict";var $u=cr(),xs=Zt(),qu=ot(),Bs=R(),ur=ne();function Mu(t,e,{key:n,value:r}){if(Bs.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(xs.isMergeKey(t,n))xs.addMergeToJSMap(t,e,r);else{let i=ur.toJS(n,"",t);if(e instanceof Map)e.set(i,ur.toJS(r,i,t));else if(e instanceof Set)e.add(i);else{let s=_u(n,i,t),a=ur.toJS(r,s,t);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}o(Mu,"addPairToJSMap");function _u(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Bs.isNode(t)&&n?.doc){let r=qu.createStringifyContext(n.doc,{});r.anchors=new Set;for(let s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=t.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),$u.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}o(_u,"stringifyKey");Fs.addPairToJSMap=Mu});var oe=y(dr=>{"use strict";var js=tt(),Du=qs(),Iu=fr(),en=R();function xu(t,e,n){let r=js.createNode(t,void 0,n),i=js.createNode(e,void 0,n);return new tn(r,i)}o(xu,"createPair");var tn=class t{static{o(this,"Pair")}constructor(e,n=null){Object.defineProperty(this,en.NODE_TYPE,{value:en.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return en.isNode(n)&&(n=n.clone(e)),en.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return Iu.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?Du.stringifyPair(this,e,n,r):JSON.stringify(this)}};dr.Pair=tn;dr.createPair=xu});var pr=y(Vs=>{"use strict";var be=R(),Ks=ot(),nn=nt();function Bu(t,e,n){return(e.inFlow??t.flow?ju:Fu)(t,e,n)}o(Bu,"stringifyCollection");function Fu({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:a,onComment:c}){let{indent:l,options:{commentString:u}}=n,p=Object.assign({},n,{indent:s,type:null}),f=!1,d=[];for(let b=0;b<e.length;++b){let m=e[b],g=null;if(be.isNode(m))!f&&m.spaceBefore&&d.push(""),rn(n,d,m.commentBefore,f),m.comment&&(g=m.comment);else if(be.isPair(m)){let S=be.isNode(m.key)?m.key:null;S&&(!f&&S.spaceBefore&&d.push(""),rn(n,d,S.commentBefore,f))}f=!1;let w=Ks.stringify(m,p,()=>g=null,()=>f=!0);g&&(w+=nn.lineComment(w,s,u(g))),f&&g&&(f=!1),d.push(r+w)}let h;if(d.length===0)h=i.start+i.end;else{h=d[0];for(let b=1;b<d.length;++b){let m=d[b];h+=m?`
|
|
47
|
+
${l}${m}`:`
|
|
48
|
+
`}}return t?(h+=`
|
|
49
|
+
`+nn.indentComment(u(t),l),c&&c()):f&&a&&a(),h}o(Fu,"stringifyBlockCollection");function ju({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:c}}=e;r+=s;let l=Object.assign({},e,{indent:r,inFlow:!0,type:null}),u=!1,p=0,f=[];for(let b=0;b<t.length;++b){let m=t[b],g=null;if(be.isNode(m))m.spaceBefore&&f.push(""),rn(e,f,m.commentBefore,!1),m.comment&&(g=m.comment);else if(be.isPair(m)){let S=be.isNode(m.key)?m.key:null;S&&(S.spaceBefore&&f.push(""),rn(e,f,S.commentBefore,!1),S.comment&&(u=!0));let v=be.isNode(m.value)?m.value:null;v?(v.comment&&(g=v.comment),v.commentBefore&&(u=!0)):m.value==null&&S?.comment&&(g=S.comment)}g&&(u=!0);let w=Ks.stringify(m,l,()=>g=null);u||(u=f.length>p||w.includes(`
|
|
50
|
+
`)),b<t.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(u||(u=f.reduce((S,v)=>S+v.length+2,2)+(w.length+2)>e.options.lineWidth)),u&&(w+=",")),g&&(w+=nn.lineComment(w,r,c(g))),f.push(w),p=f.length}let{start:d,end:h}=n;if(f.length===0)return d+h;if(!u){let b=f.reduce((m,g)=>m+g.length+2,2);u=e.options.lineWidth>0&&b>e.options.lineWidth}if(u){let b=d;for(let m of f)b+=m?`
|
|
51
|
+
${s}${i}${m}`:`
|
|
52
|
+
`;return`${b}
|
|
53
|
+
${i}${h}`}else return`${d}${a}${f.join(" ")}${a}${h}`}o(ju,"stringifyFlowCollection");function rn({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let s=nn.indentComment(e(r),t);n.push(s.trimStart())}}o(rn,"addCommentBefore");Vs.stringifyCollection=Bu});var ce=y(hr=>{"use strict";var Ku=pr(),Vu=fr(),Uu=Vt(),ae=R(),sn=oe(),Wu=L();function ct(t,e){let n=ae.isScalar(e)?e.value:e;for(let r of t)if(ae.isPair(r)&&(r.key===e||r.key===n||ae.isScalar(r.key)&&r.key.value===n))return r}o(ct,"findPair");var mr=class extends Uu.Collection{static{o(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ae.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:i,replacer:s}=r,a=new this(e),c=o((l,u)=>{if(typeof s=="function")u=s.call(n,l,u);else if(Array.isArray(s)&&!s.includes(l))return;(u!==void 0||i)&&a.items.push(sn.createPair(l,u,r))},"add");if(n instanceof Map)for(let[l,u]of n)c(l,u);else if(n&&typeof n=="object")for(let l of Object.keys(n))c(l,n[l]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,n){let r;ae.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new sn.Pair(e,e?.value):r=new sn.Pair(e.key,e.value);let i=ct(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);ae.isScalar(i.value)&&Wu.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(s){let a=this.items.findIndex(c=>s(r,c)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(e){let n=ct(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let i=ct(this.items,e)?.value;return(!n&&ae.isScalar(i)?i.value:i)??void 0}has(e){return!!ct(this.items,e)}set(e,n){this.add(new sn.Pair(e,n),!0)}toJSON(e,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let s of this.items)Vu.addPairToJSMap(n,i,s);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ae.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ku.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};hr.YAMLMap=mr;hr.findPair=ct});var $e=y(Ws=>{"use strict";var Yu=R(),Us=ce(),Ju={collection:"map",default:!0,nodeClass:Us.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Yu.isMap(t)||e("Expected a mapping for this tag"),t},createNode:o((t,e,n)=>Us.YAMLMap.from(t,e,n),"createNode")};Ws.map=Ju});var le=y(Ys=>{"use strict";var Gu=tt(),Hu=pr(),Qu=Vt(),an=R(),zu=L(),Xu=ne(),gr=class extends Qu.Collection{static{o(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(an.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=on(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=on(e);if(typeof r!="number")return;let i=this.items[r];return!n&&an.isScalar(i)?i.value:i}has(e){let n=on(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=on(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[r];an.isScalar(i)&&zu.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let s of this.items)r.push(Xu.toJS(s,String(i++),n));return r}toString(e,n,r){return e?Hu.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n)){let a=0;for(let c of n){if(typeof i=="function"){let l=n instanceof Set?c:String(a++);c=i.call(n,l,c)}s.items.push(Gu.createNode(c,void 0,r))}}return s}};function on(t){let e=an.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}o(on,"asItemIndex");Ys.YAMLSeq=gr});var qe=y(Gs=>{"use strict";var Zu=R(),Js=le(),ef={collection:"seq",default:!0,nodeClass:Js.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Zu.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:o((t,e,n)=>Js.YAMLSeq.from(t,e,n),"createNode")};Gs.seq=ef});var lt=y(Hs=>{"use strict";var tf=st(),nf={identify:o(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:o(t=>t,"resolve"),stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),tf.stringifyString(t,e,n,r)}};Hs.string=nf});var cn=y(Xs=>{"use strict";var Qs=L(),zs={identify:o(t=>t==null,"identify"),createNode:o(()=>new Qs.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:o(()=>new Qs.Scalar(null),"resolve"),stringify:o(({source:t},e)=>typeof t=="string"&&zs.test.test(t)?t:e.options.nullStr,"stringify")};Xs.nullTag=zs});var yr=y(eo=>{"use strict";var rf=L(),Zs={identify:o(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:o(t=>new rf.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},n){if(t&&Zs.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};eo.boolTag=Zs});var Me=y(to=>{"use strict";function sf({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let c=e-(s.length-a-1);for(;c-- >0;)s+="0"}return s}o(sf,"stringifyNumber");to.stringifyNumber=sf});var kr=y(ln=>{"use strict";var of=L(),br=Me(),af={identify:o(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:br.stringifyNumber},cf={identify:o(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:o(t=>parseFloat(t),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():br.stringifyNumber(t)}},lf={identify:o(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new of.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:br.stringifyNumber};ln.float=lf;ln.floatExp=cf;ln.floatNaN=af});var Sr=y(fn=>{"use strict";var no=Me(),un=o(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),wr=o((t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n),"intResolve");function ro(t,e,n){let{value:r}=t;return un(r)&&r>=0?n+r.toString(e):no.stringifyNumber(t)}o(ro,"intStringify");var uf={identify:o(t=>un(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:o((t,e,n)=>wr(t,2,8,n),"resolve"),stringify:o(t=>ro(t,8,"0o"),"stringify")},ff={identify:un,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:o((t,e,n)=>wr(t,0,10,n),"resolve"),stringify:no.stringifyNumber},df={identify:o(t=>un(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:o((t,e,n)=>wr(t,2,16,n),"resolve"),stringify:o(t=>ro(t,16,"0x"),"stringify")};fn.int=ff;fn.intHex=df;fn.intOct=uf});var so=y(io=>{"use strict";var pf=$e(),mf=cn(),hf=qe(),gf=lt(),yf=yr(),vr=kr(),Er=Sr(),bf=[pf.map,hf.seq,gf.string,mf.nullTag,yf.boolTag,Er.intOct,Er.int,Er.intHex,vr.floatNaN,vr.floatExp,vr.float];io.schema=bf});var co=y(ao=>{"use strict";var kf=L(),wf=$e(),Sf=qe();function oo(t){return typeof t=="bigint"||Number.isInteger(t)}o(oo,"intIdentify");var dn=o(({value:t})=>JSON.stringify(t),"stringifyJSON"),vf=[{identify:o(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:o(t=>t,"resolve"),stringify:dn},{identify:o(t=>t==null,"identify"),createNode:o(()=>new kf.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:o(()=>null,"resolve"),stringify:dn},{identify:o(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:o(t=>t==="true","resolve"),stringify:dn},{identify:oo,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:o((t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),"resolve"),stringify:o(({value:t})=>oo(t)?t.toString():JSON.stringify(t),"stringify")},{identify:o(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:o(t=>parseFloat(t),"resolve"),stringify:dn}],Ef={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Af=[wf.map,Sf.seq].concat(vf,Ef);ao.schema=Af});var Cr=y(lo=>{"use strict";var ut=$t("buffer"),Ar=L(),Cf=st(),Rf={identify:o(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof ut.Buffer=="function")return ut.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,i,s){if(!n)return"";let a=n,c;if(typeof ut.Buffer=="function")c=a instanceof ut.Buffer?a.toString("base64"):ut.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let u=0;u<a.length;++u)l+=String.fromCharCode(a[u]);c=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Ar.Scalar.BLOCK_LITERAL),e!==Ar.Scalar.QUOTE_DOUBLE){let l=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),u=Math.ceil(c.length/l),p=new Array(u);for(let f=0,d=0;f<u;++f,d+=l)p[f]=c.substr(d,l);c=p.join(e===Ar.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return Cf.stringifyString({comment:t,type:e,value:c},r,i,s)}};lo.binary=Rf});var hn=y(mn=>{"use strict";var pn=R(),Rr=oe(),Tf=L(),Of=le();function uo(t,e){if(pn.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!pn.isPair(r)){if(pn.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new Rr.Pair(new Tf.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
55
|
+
${i.key.commentBefore}`:r.commentBefore),r.comment){let s=i.value??i.key;s.comment=s.comment?`${r.comment}
|
|
56
|
+
${s.comment}`:r.comment}r=i}t.items[n]=pn.isPair(r)?r:new Rr.Pair(r)}}else e("Expected a sequence for this tag");return t}o(uo,"resolvePairs");function fo(t,e,n){let{replacer:r}=n,i=new Of.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof r=="function"&&(a=r.call(e,String(s++),a));let c,l;if(Array.isArray(a))if(a.length===2)c=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let u=Object.keys(a);if(u.length===1)c=u[0],l=a[c];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else c=a;i.items.push(Rr.createPair(c,l,n))}return i}o(fo,"createPairs");var Nf={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:uo,createNode:fo};mn.createPairs=fo;mn.pairs=Nf;mn.resolvePairs=uo});var Nr=y(Or=>{"use strict";var po=R(),Tr=ne(),ft=ce(),Lf=le(),mo=hn(),ke=class t extends Lf.YAMLSeq{static{o(this,"YAMLOMap")}constructor(){super(),this.add=ft.YAMLMap.prototype.add.bind(this),this.delete=ft.YAMLMap.prototype.delete.bind(this),this.get=ft.YAMLMap.prototype.get.bind(this),this.has=ft.YAMLMap.prototype.has.bind(this),this.set=ft.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let s,a;if(po.isPair(i)?(s=Tr.toJS(i.key,"",n),a=Tr.toJS(i.value,s,n)):s=Tr.toJS(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,a)}return r}static from(e,n,r){let i=mo.createPairs(e,n,r),s=new this;return s.items=i.items,s}};ke.tag="tag:yaml.org,2002:omap";var Pf={collection:"seq",identify:o(t=>t instanceof Map,"identify"),nodeClass:ke,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=mo.resolvePairs(t,e),r=[];for(let{key:i}of n.items)po.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new ke,n)},createNode:o((t,e,n)=>ke.from(t,e,n),"createNode")};Or.YAMLOMap=ke;Or.omap=Pf});var ko=y(Lr=>{"use strict";var ho=L();function go({value:t,source:e},n){return e&&(t?yo:bo).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}o(go,"boolStringify");var yo={identify:o(t=>t===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:o(()=>new ho.Scalar(!0),"resolve"),stringify:go},bo={identify:o(t=>t===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:o(()=>new ho.Scalar(!1),"resolve"),stringify:go};Lr.falseTag=bo;Lr.trueTag=yo});var wo=y(gn=>{"use strict";var $f=L(),Pr=Me(),qf={identify:o(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Pr.stringifyNumber},Mf={identify:o(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:o(t=>parseFloat(t.replace(/_/g,"")),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Pr.stringifyNumber(t)}},_f={identify:o(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new $f.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Pr.stringifyNumber};gn.float=_f;gn.floatExp=Mf;gn.floatNaN=qf});var vo=y(pt=>{"use strict";var So=Me(),dt=o(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function yn(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return i==="-"?BigInt(-1)*a:a}let s=parseInt(t,n);return i==="-"?-1*s:s}o(yn,"intResolve");function $r(t,e,n){let{value:r}=t;if(dt(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return So.stringifyNumber(t)}o($r,"intStringify");var Df={identify:dt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:o((t,e,n)=>yn(t,2,2,n),"resolve"),stringify:o(t=>$r(t,2,"0b"),"stringify")},If={identify:dt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:o((t,e,n)=>yn(t,1,8,n),"resolve"),stringify:o(t=>$r(t,8,"0"),"stringify")},xf={identify:dt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:o((t,e,n)=>yn(t,0,10,n),"resolve"),stringify:So.stringifyNumber},Bf={identify:dt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:o((t,e,n)=>yn(t,2,16,n),"resolve"),stringify:o(t=>$r(t,16,"0x"),"stringify")};pt.int=xf;pt.intBin=Df;pt.intHex=Bf;pt.intOct=If});var Mr=y(qr=>{"use strict";var wn=R(),bn=oe(),kn=ce(),we=class t extends kn.YAMLMap{static{o(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let n;wn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new bn.Pair(e.key,null):n=new bn.Pair(e,null),kn.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=kn.findPair(this.items,e);return!n&&wn.isPair(r)?wn.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=kn.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new bn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),s.items.push(bn.createPair(a,null,r));return s}};we.tag="tag:yaml.org,2002:set";var Ff={collection:"map",identify:o(t=>t instanceof Set,"identify"),nodeClass:we,default:!1,tag:"tag:yaml.org,2002:set",createNode:o((t,e,n)=>we.from(t,e,n),"createNode"),resolve(t,e){if(wn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new we,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};qr.YAMLSet=we;qr.set=Ff});var Dr=y(Sn=>{"use strict";var jf=Me();function _r(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=o(a=>e?BigInt(a):Number(a),"num"),s=r.replace(/_/g,"").split(":").reduce((a,c)=>a*i(60)+i(c),i(0));return n==="-"?i(-1)*s:s}o(_r,"parseSexagesimal");function Eo(t){let{value:e}=t,n=o(a=>a,"num");if(typeof e=="bigint")n=o(a=>BigInt(a),"num");else if(isNaN(e)||!isFinite(e))return jf.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),r+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}o(Eo,"stringifySexagesimal");var Kf={identify:o(t=>typeof t=="bigint"||Number.isInteger(t),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:o((t,e,{intAsBigInt:n})=>_r(t,n),"resolve"),stringify:Eo},Vf={identify:o(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:o(t=>_r(t,!1),"resolve"),stringify:Eo},Ao={identify:o(t=>t instanceof Date,"identify"),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(t){let e=t.match(Ao.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,a,c]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(n,r-1,i,s||0,a||0,c||0,l),p=e[8];if(p&&p!=="Z"){let f=_r(p,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:o(({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};Sn.floatTime=Vf;Sn.intTime=Kf;Sn.timestamp=Ao});var To=y(Ro=>{"use strict";var Uf=$e(),Wf=cn(),Yf=qe(),Jf=lt(),Gf=Cr(),Co=ko(),Ir=wo(),vn=vo(),Hf=Zt(),Qf=Nr(),zf=hn(),Xf=Mr(),xr=Dr(),Zf=[Uf.map,Yf.seq,Jf.string,Wf.nullTag,Co.trueTag,Co.falseTag,vn.intBin,vn.intOct,vn.int,vn.intHex,Ir.floatNaN,Ir.floatExp,Ir.float,Gf.binary,Hf.merge,Qf.omap,zf.pairs,Xf.set,xr.intTime,xr.floatTime,xr.timestamp];Ro.schema=Zf});var Io=y(jr=>{"use strict";var Po=$e(),ed=cn(),$o=qe(),td=lt(),nd=yr(),Br=kr(),Fr=Sr(),rd=so(),id=co(),qo=Cr(),mt=Zt(),Mo=Nr(),_o=hn(),Oo=To(),Do=Mr(),En=Dr(),No=new Map([["core",rd.schema],["failsafe",[Po.map,$o.seq,td.string]],["json",id.schema],["yaml11",Oo.schema],["yaml-1.1",Oo.schema]]),Lo={binary:qo.binary,bool:nd.boolTag,float:Br.float,floatExp:Br.floatExp,floatNaN:Br.floatNaN,floatTime:En.floatTime,int:Fr.int,intHex:Fr.intHex,intOct:Fr.intOct,intTime:En.intTime,map:Po.map,merge:mt.merge,null:ed.nullTag,omap:Mo.omap,pairs:_o.pairs,seq:$o.seq,set:Do.set,timestamp:En.timestamp},sd={"tag:yaml.org,2002:binary":qo.binary,"tag:yaml.org,2002:merge":mt.merge,"tag:yaml.org,2002:omap":Mo.omap,"tag:yaml.org,2002:pairs":_o.pairs,"tag:yaml.org,2002:set":Do.set,"tag:yaml.org,2002:timestamp":En.timestamp};function od(t,e,n){let r=No.get(e);if(r&&!t)return n&&!r.includes(mt.merge)?r.concat(mt.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(No.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(mt.merge)),i.reduce((s,a)=>{let c=typeof a=="string"?Lo[a]:a;if(!c){let l=JSON.stringify(a),u=Object.keys(Lo).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}return s.includes(c)||s.push(c),s},[])}o(od,"getTags");jr.coreKnownTags=sd;jr.getTags=od});var Ur=y(xo=>{"use strict";var Kr=R(),ad=$e(),cd=qe(),ld=lt(),An=Io(),ud=o((t,e)=>t.key<e.key?-1:t.key>e.key?1:0,"sortMapEntriesByKey"),Vr=class t{static{o(this,"Schema")}constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:c}){this.compat=Array.isArray(e)?An.getTags(e,"compat"):e?An.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?An.coreKnownTags:{},this.tags=An.getTags(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Kr.MAP,{value:ad.map}),Object.defineProperty(this,Kr.SCALAR,{value:ld.string}),Object.defineProperty(this,Kr.SEQ,{value:cd.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?ud:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};xo.Schema=Vr});var Fo=y(Bo=>{"use strict";var fd=R(),Wr=ot(),ht=nt();function dd(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let l=t.directives.toString(t);l?(n.push(l),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=Wr.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let l=s(t.commentBefore);n.unshift(ht.indentComment(l,""))}let a=!1,c=null;if(t.contents){if(fd.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let p=s(t.contents.commentBefore);n.push(ht.indentComment(p,""))}i.forceBlockIndent=!!t.comment,c=t.contents.comment}let l=c?void 0:()=>a=!0,u=Wr.stringify(t.contents,i,()=>c=null,l);c&&(u+=ht.lineComment(u,"",s(c))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}else n.push(Wr.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let l=s(t.comment);l.includes(`
|
|
57
|
+
`)?(n.push("..."),n.push(ht.indentComment(l,""))):n.push(`... ${l}`)}else n.push("...");else{let l=t.comment;l&&a&&(l=l.replace(/^\n+/,"")),l&&((!a||c)&&n[n.length-1]!==""&&n.push(""),n.push(ht.indentComment(s(l),"")))}return n.join(`
|
|
58
|
+
`)+`
|
|
59
|
+
`}o(dd,"stringifyDocument");Bo.stringifyDocument=dd});var gt=y(jo=>{"use strict";var pd=et(),_e=Vt(),K=R(),md=oe(),hd=ne(),gd=Ur(),yd=Fo(),Yr=Bt(),bd=Qn(),kd=tt(),Jr=Hn(),Gr=class t{static{o(this,"Document")}constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,K.NODE_TYPE,{value:K.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:a}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Jr.Directives({version:a}),this.setSchema(a,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(t.prototype,{[K.NODE_TYPE]:{value:K.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=K.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){De(this.contents)&&this.contents.add(e)}addIn(e,n){De(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=Yr.anchorNames(this);e.anchor=!n||r.has(n)?Yr.findNewAnchor(n||"a",r):n}return new pd.Alias(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){let g=o(S=>typeof S=="number"||S instanceof String||S instanceof Number,"keyToStr"),w=n.filter(g).map(String);w.length>0&&(n=n.concat(w)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:c,keepUndefined:l,onTagObj:u,tag:p}=r??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=Yr.createNodeAnchors(this,a||"a"),b={aliasDuplicateObjects:s??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:h},m=kd.createNode(e,p,b);return c&&K.isCollection(m)&&(m.flow=!0),d(),m}createPair(e,n,r={}){let i=this.createNode(e,null,r),s=this.createNode(n,null,r);return new md.Pair(i,s)}delete(e){return De(this.contents)?this.contents.delete(e):!1}deleteIn(e){return _e.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):De(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return K.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return _e.isEmptyPath(e)?!n&&K.isScalar(this.contents)?this.contents.value:this.contents:K.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return K.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return _e.isEmptyPath(e)?this.contents!==void 0:K.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=_e.collectionFromPath(this.schema,[e],n):De(this.contents)&&this.contents.set(e,n)}setIn(e,n){_e.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=_e.collectionFromPath(this.schema,Array.from(e),n):De(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Jr.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Jr.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new gd.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:a}={}){let c={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=hd.toJS(this.contents,n??"",c);if(typeof s=="function")for(let{count:u,res:p}of c.anchors.values())s(p,u);return typeof a=="function"?bd.applyReviver(a,{"":l},"",l):l}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}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)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return yd.stringifyDocument(this,e)}};function De(t){if(K.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}o(De,"assertCollection");jo.Document=Gr});var kt=y(bt=>{"use strict";var yt=class extends Error{static{o(this,"YAMLError")}constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}},Hr=class extends yt{static{o(this,"YAMLParseError")}constructor(e,n,r){super("YAMLParseError",e,n,r)}},Qr=class extends yt{static{o(this,"YAMLWarning")}constructor(e,n,r){super("YAMLWarning",e,n,r)}},wd=o((t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>e.linePos(c));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,a=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let c=Math.min(s-39,a.length-79);a="\u2026"+a.substring(c),s-=c-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),r>1&&/^ *$/.test(a.substring(0,s))){let c=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`\u2026
|
|
60
|
+
`),a=c+a}if(/[^ ]/.test(a)){let c=1,l=n.linePos[1];l?.line===r&&l.col>i&&(c=Math.max(1,Math.min(l.col-i,80-s)));let u=" ".repeat(s)+"^".repeat(c);n.message+=`:
|
|
61
|
+
|
|
62
|
+
${a}
|
|
63
|
+
${u}
|
|
64
|
+
`}},"prettifyError");bt.YAMLError=yt;bt.YAMLParseError=Hr;bt.YAMLWarning=Qr;bt.prettifyError=wd});var wt=y(Ko=>{"use strict";function Sd(t,{flow:e,indicator:n,next:r,offset:i,onError:s,parentIndent:a,startOnNewline:c}){let l=!1,u=c,p=c,f="",d="",h=!1,b=!1,m=null,g=null,w=null,S=null,v=null,E=null,A=null;for(let k of t)switch(b&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&s(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),m&&(u&&k.type!=="comment"&&k.type!=="newline"&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),k.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&k.source.includes(" ")&&(m=k),p=!0;break;case"comment":{p||s(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let P=k.source.substring(1)||" ";f?f+=d+P:f=P,d="",u=!1;break}case"newline":u?f?f+=k.source:(!E||n!=="seq-item-ind")&&(l=!0):d+=k.source,u=!0,h=!0,(g||w)&&(S=k),p=!0;break;case"anchor":g&&s(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&s(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=k,A??(A=k.offset),u=!1,p=!1,b=!0;break;case"tag":{w&&s(k,"MULTIPLE_TAGS","A node can have at most one tag"),w=k,A??(A=k.offset),u=!1,p=!1,b=!0;break}case n:(g||w)&&s(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),E&&s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),E=k,u=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(e){v&&s(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=k,u=!1,p=!1;break}default:s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),u=!1,p=!1}let C=t[t.length-1],O=C?C.offset+C.source.length:i;return b&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(u&&m.indent<=a||r?.type==="block-map"||r?.type==="block-seq")&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:E,spaceBefore:l,comment:f,hasNewline:h,anchor:g,tag:w,newlineAfterProp:S,end:O,start:A??O}}o(Sd,"resolveProps");Ko.resolveProps=Sd});var Cn=y(Vo=>{"use strict";function zr(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
65
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(zr(e.key)||zr(e.value))return!0}return!1;default:return!0}}o(zr,"containsNewline");Vo.containsNewline=zr});var Xr=y(Uo=>{"use strict";var vd=Cn();function Ed(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&vd.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}o(Ed,"flowIndentCheck");Uo.flowIndentCheck=Ed});var Zr=y(Yo=>{"use strict";var Wo=R();function Ad(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let i=typeof r=="function"?r:(s,a)=>s===a||Wo.isScalar(s)&&Wo.isScalar(a)&&s.value===a.value;return e.some(s=>i(s.key,n))}o(Ad,"mapIncludes");Yo.mapIncludes=Ad});var Xo=y(zo=>{"use strict";var Jo=oe(),Cd=ce(),Go=wt(),Rd=Cn(),Ho=Xr(),Td=Zr(),Qo="All mapping items must start at the same column";function Od({composeNode:t,composeEmptyNode:e},n,r,i,s){let a=s?.nodeClass??Cd.YAMLMap,c=new a(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,u=null;for(let p of r.items){let{start:f,key:d,sep:h,value:b}=p,m=Go.resolveProps(f,{indicator:"explicit-key-ind",next:d??h?.[0],offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0}),g=!m.found;if(g){if(d&&(d.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==r.indent&&i(l,"BAD_INDENT",Qo)),!m.anchor&&!m.tag&&!h){u=m.end,m.comment&&(c.comment?c.comment+=`
|
|
66
|
+
`+m.comment:c.comment=m.comment);continue}(m.newlineAfterProp||Rd.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&i(l,"BAD_INDENT",Qo);n.atKey=!0;let w=m.end,S=d?t(n,d,m,i):e(n,w,f,null,m,i);n.schema.compat&&Ho.flowIndentCheck(r.indent,d,i),n.atKey=!1,Td.mapIncludes(n,c.items,S)&&i(w,"DUPLICATE_KEY","Map keys must be unique");let v=Go.resolveProps(h??[],{indicator:"map-value-ind",next:b,offset:S.range[2],onError:i,parentIndent:r.indent,startOnNewline:!d||d.type==="block-scalar"});if(l=v.end,v.found){g&&(b?.type==="block-map"&&!v.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<v.found.offset-1024&&i(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let E=b?t(n,b,v,i):e(n,l,h,null,v,i);n.schema.compat&&Ho.flowIndentCheck(r.indent,b,i),l=E.range[2];let A=new Jo.Pair(S,E);n.options.keepSourceTokens&&(A.srcToken=p),c.items.push(A)}else{g&&i(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(S.comment?S.comment+=`
|
|
67
|
+
`+v.comment:S.comment=v.comment);let E=new Jo.Pair(S);n.options.keepSourceTokens&&(E.srcToken=p),c.items.push(E)}}return u&&u<l&&i(u,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,l,u??l],c}o(Od,"resolveBlockMap");zo.resolveBlockMap=Od});var ea=y(Zo=>{"use strict";var Nd=le(),Ld=wt(),Pd=Xr();function $d({composeNode:t,composeEmptyNode:e},n,r,i,s){let a=s?.nodeClass??Nd.YAMLSeq,c=new a(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let l=r.offset,u=null;for(let{start:p,value:f}of r.items){let d=Ld.resolveProps(p,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{u=d.end,d.comment&&(c.comment=d.comment);continue}let h=f?t(n,f,d,i):e(n,d.end,p,null,d,i);n.schema.compat&&Pd.flowIndentCheck(r.indent,f,i),l=h.range[2],c.items.push(h)}return c.range=[r.offset,l,u??l],c}o($d,"resolveBlockSeq");Zo.resolveBlockSeq=$d});var Ie=y(ta=>{"use strict";function qd(t,e,n,r){let i="";if(t){let s=!1,a="";for(let c of t){let{source:l,type:u}=c;switch(u){case"space":s=!0;break;case"comment":{n&&!s&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=l.substring(1)||" ";i?i+=a+p:i=p,a="";break}case"newline":i&&(a+=l),s=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=l.length}}return{comment:i,offset:e}}o(qd,"resolveEnd");ta.resolveEnd=qd});var sa=y(ia=>{"use strict";var Md=R(),_d=oe(),na=ce(),Dd=le(),Id=Ie(),ra=wt(),xd=Cn(),Bd=Zr(),ei="Block collections are not allowed within flow collections",ti=o(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function Fd({composeNode:t,composeEmptyNode:e},n,r,i,s){let a=r.start.source==="{",c=a?"flow map":"flow sequence",l=s?.nodeClass??(a?na.YAMLMap:Dd.YAMLSeq),u=new l(n.schema);u.flow=!0;let p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let g=0;g<r.items.length;++g){let w=r.items[g],{start:S,key:v,sep:E,value:A}=w,C=ra.resolveProps(S,{flow:c,indicator:"explicit-key-ind",next:v??E?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!E&&!A){g===0&&C.comma?i(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):g<r.items.length-1&&i(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),C.comment&&(u.comment?u.comment+=`
|
|
68
|
+
`+C.comment:u.comment=C.comment),f=C.end;continue}!a&&n.options.strict&&xd.containsNewline(v)&&i(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)C.comma&&i(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(C.comma||i(C.start,"MISSING_CHAR",`Missing , between ${c} items`),C.comment){let O="";e:for(let k of S)switch(k.type){case"comma":case"space":break;case"comment":O=k.source.substring(1);break e;default:break e}if(O){let k=u.items[u.items.length-1];Md.isPair(k)&&(k=k.value??k.key),k.comment?k.comment+=`
|
|
69
|
+
`+O:k.comment=O,C.comment=C.comment.substring(O.length+1)}}if(!a&&!E&&!C.found){let O=A?t(n,A,C,i):e(n,C.end,E,null,C,i);u.items.push(O),f=O.range[2],ti(A)&&i(O.range,"BLOCK_IN_FLOW",ei)}else{n.atKey=!0;let O=C.end,k=v?t(n,v,C,i):e(n,O,S,null,C,i);ti(v)&&i(k.range,"BLOCK_IN_FLOW",ei),n.atKey=!1;let P=ra.resolveProps(E??[],{flow:c,indicator:"map-value-ind",next:A,offset:k.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(P.found){if(!a&&!C.found&&n.options.strict){if(E)for(let $ of E){if($===P.found)break;if($.type==="newline"){i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}C.start<P.found.offset-1024&&i(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source?.[0]===":"?i(A,"MISSING_CHAR",`Missing space after : in ${c}`):i(P.start,"MISSING_CHAR",`Missing , or : between ${c} items`));let te=A?t(n,A,P,i):P.found?e(n,P.end,E,null,P,i):null;te?ti(A)&&i(te.range,"BLOCK_IN_FLOW",ei):P.comment&&(k.comment?k.comment+=`
|
|
70
|
+
`+P.comment:k.comment=P.comment);let Ce=new _d.Pair(k,te);if(n.options.keepSourceTokens&&(Ce.srcToken=w),a){let $=u;Bd.mapIncludes(n,$.items,k)&&i(O,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(Ce)}else{let $=new na.YAMLMap(n.schema);$.flow=!0,$.items.push(Ce);let Ui=(te??k).range;$.range=[k.range[0],Ui[1],Ui[2]],u.items.push($)}f=te?te.range[2]:P.end}}let d=a?"}":"]",[h,...b]=r.end,m=f;if(h?.source===d)m=h.offset+h.source.length;else{let g=c[0].toUpperCase()+c.substring(1),w=p?`${g} must end with a ${d}`:`${g} in block collection must be sufficiently indented and end with a ${d}`;i(f,p?"MISSING_CHAR":"BAD_INDENT",w),h&&h.source.length!==1&&b.unshift(h)}if(b.length>0){let g=Id.resolveEnd(b,m,n.options.strict,i);g.comment&&(u.comment?u.comment+=`
|
|
71
|
+
`+g.comment:u.comment=g.comment),u.range=[r.offset,m,g.offset]}else u.range=[r.offset,m,m];return u}o(Fd,"resolveFlowCollection");ia.resolveFlowCollection=Fd});var aa=y(oa=>{"use strict";var jd=R(),Kd=L(),Vd=ce(),Ud=le(),Wd=Xo(),Yd=ea(),Jd=sa();function ni(t,e,n,r,i,s){let a=n.type==="block-map"?Wd.resolveBlockMap(t,e,n,r,s):n.type==="block-seq"?Yd.resolveBlockSeq(t,e,n,r,s):Jd.resolveFlowCollection(t,e,n,r,s),c=a.constructor;return i==="!"||i===c.tagName?(a.tag=c.tagName,a):(i&&(a.tag=i),a)}o(ni,"resolveCollection");function Gd(t,e,n,r,i){let s=r.tag,a=s?e.directives.tagName(s.source,d=>i(s,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:h}=r,b=d&&s?d.offset>s.offset?d:s:d??s;b&&(!h||h.offset<b.offset)&&i(b,"MISSING_CHAR","Missing newline after block sequence props")}let c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===Vd.YAMLMap.tagName&&c==="map"||a===Ud.YAMLSeq.tagName&&c==="seq")return ni(t,e,n,i,a);let l=e.schema.tags.find(d=>d.tag===a&&d.collection===c);if(!l){let d=e.schema.knownTags[a];if(d?.collection===c)e.schema.tags.push(Object.assign({},d,{default:!1})),l=d;else return d?i(s,"BAD_COLLECTION_TYPE",`${d.tag} used for ${c} collection, but expects ${d.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),ni(t,e,n,i,a)}let u=ni(t,e,n,i,a,l),p=l.resolve?.(u,d=>i(s,"TAG_RESOLVE_FAILED",d),e.options)??u,f=jd.isNode(p)?p:new Kd.Scalar(p);return f.range=u.range,f.tag=a,l?.format&&(f.format=l.format),f}o(Gd,"composeCollection");oa.composeCollection=Gd});var ii=y(ca=>{"use strict";var ri=L();function Hd(t,e,n){let r=e.offset,i=Qd(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=i.mode===">"?ri.Scalar.BLOCK_FOLDED:ri.Scalar.BLOCK_LITERAL,a=e.source?zd(e.source):[],c=a.length;for(let m=a.length-1;m>=0;--m){let g=a[m][1];if(g===""||g==="\r")c=m;else break}if(c===0){let m=i.chomp==="+"&&a.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,a.length-1)):"",g=r+i.length;return e.source&&(g+=e.source.length),{value:m,type:s,comment:i.comment,range:[r,g,g]}}let l=e.indent+i.indent,u=e.offset+i.length,p=0;for(let m=0;m<c;++m){let[g,w]=a[m];if(w===""||w==="\r")i.indent===0&&g.length>l&&(l=g.length);else{g.length<l&&n(u+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=g.length),p=m,l===0&&!t.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=g.length+w.length+1}for(let m=a.length-1;m>=c;--m)a[m][0].length>l&&(c=m+1);let f="",d="",h=!1;for(let m=0;m<p;++m)f+=a[m][0].slice(l)+`
|
|
73
|
+
`;for(let m=p;m<c;++m){let[g,w]=a[m];u+=g.length+w.length+1;let S=w[w.length-1]==="\r";if(S&&(w=w.slice(0,-1)),w&&g.length<l){let E=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(u-w.length-(S?2:1),"BAD_INDENT",E),g=""}s===ri.Scalar.BLOCK_LITERAL?(f+=d+g.slice(l)+w,d=`
|
|
74
|
+
`):g.length>l||w[0]===" "?(d===" "?d=`
|
|
75
|
+
`:!h&&d===`
|
|
76
|
+
`&&(d=`
|
|
77
|
+
|
|
78
|
+
`),f+=d+g.slice(l)+w,d=`
|
|
79
|
+
`,h=!0):w===""?d===`
|
|
80
|
+
`?f+=`
|
|
81
|
+
`:d=`
|
|
82
|
+
`:(f+=d+w,d=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let m=c;m<a.length;++m)f+=`
|
|
83
|
+
`+a[m][0].slice(l);f[f.length-1]!==`
|
|
84
|
+
`&&(f+=`
|
|
85
|
+
`);break;default:f+=`
|
|
86
|
+
`}let b=r+i.length+e.source.length;return{value:f,type:s,comment:i.comment,range:[r,b,b]}}o(Hd,"resolveBlockScalar");function Qd({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],a=0,c="",l=-1;for(let d=1;d<i.length;++d){let h=i[d];if(!c&&(h==="-"||h==="+"))c=h;else{let b=Number(h);!a&&b?a=b:l===-1&&(l=t+d)}}l!==-1&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let u=!1,p="",f=i.length;for(let d=1;d<e.length;++d){let h=e[d];switch(h.type){case"space":u=!0;case"newline":f+=h.source.length;break;case"comment":n&&!u&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,p=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let b=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",b);let m=h.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:s,indent:a,chomp:c,comment:p,length:f}}o(Qd,"parseBlockScalarHeader");function zd(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),s=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}o(zd,"splitLines");ca.resolveBlockScalar=Hd});var oi=y(ua=>{"use strict";var si=L(),Xd=Ie();function Zd(t,e,n){let{offset:r,type:i,source:s,end:a}=t,c,l,u=o((d,h,b)=>n(r+d,h,b),"_onError");switch(i){case"scalar":c=si.Scalar.PLAIN,l=ep(s,u);break;case"single-quoted-scalar":c=si.Scalar.QUOTE_SINGLE,l=tp(s,u);break;case"double-quoted-scalar":c=si.Scalar.QUOTE_DOUBLE,l=np(s,u);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}let p=r+s.length,f=Xd.resolveEnd(a,p,e,n);return{value:l,type:c,comment:f.comment,range:[r,p,f.offset]}}o(Zd,"resolveFlowScalar");function ep(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),la(t)}o(ep,"plainValue");function tp(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),la(t.slice(1,-1)).replace(/''/g,"'")}o(tp,"singleQuotedValue");function la(t){let e=/(.*?)\r?\n/sy,n=e.exec(t);if(!n)return t;let r,i;try{r=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let s=n[1].replace(r,""),a=" ",c=e.lastIndex;for(;n=e.exec(t);){let u=n[1].replace(i,"");u===""?a===`
|
|
87
|
+
`?s+=a:a=`
|
|
88
|
+
`:(s+=a+u,a=" "),c=e.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=c,n=l.exec(t),s+a+(n?.[1]??"")}o(la,"unfoldLines");function np(t,e){let n="";for(let r=1;r<t.length-1;++r){let i=t[r];if(!(i==="\r"&&t[r+1]===`
|
|
89
|
+
`))if(i===`
|
|
90
|
+
`){let{fold:s,offset:a}=rp(t,r);n+=s,r=a}else if(i==="\\"){let s=t[++r],a=ip[s];if(a)n+=a;else if(s===`
|
|
91
|
+
`)for(s=t[r+1];s===" "||s===" ";)s=t[++r+1];else if(s==="\r"&&t[r+1]===`
|
|
92
|
+
`)for(s=t[++r+1];s===" "||s===" ";)s=t[++r+1];else if(s==="x"||s==="u"||s==="U"){let c=s==="x"?2:s==="u"?4:8;n+=sp(t,r+1,c,e),r+=c}else{let c=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(i===" "||i===" "){let s=r,a=t[r+1];for(;a===" "||a===" ";)a=t[++r+1];a!==`
|
|
93
|
+
`&&!(a==="\r"&&t[r+2]===`
|
|
94
|
+
`)&&(n+=r>s?t.slice(s,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}o(np,"doubleQuotedValue");function rp(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
|
|
95
|
+
`||r==="\r")&&!(r==="\r"&&t[e+2]!==`
|
|
96
|
+
`);)r===`
|
|
97
|
+
`&&(n+=`
|
|
98
|
+
`),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}o(rp,"foldNewline");var ip={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
99
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function sp(t,e,n,r){let i=t.substr(e,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let c=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}}o(sp,"parseCharCode");ua.resolveFlowScalar=Zd});var pa=y(da=>{"use strict";var Se=R(),fa=L(),op=ii(),ap=oi();function cp(t,e,n,r){let{value:i,type:s,comment:a,range:c}=e.type==="block-scalar"?op.resolveBlockScalar(t,e,r):ap.resolveFlowScalar(e,t.options.strict,r),l=n?t.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null,u;t.options.stringKeys&&t.atKey?u=t.schema[Se.SCALAR]:l?u=lp(t.schema,i,l,n,r):e.type==="scalar"?u=up(t,i,e,r):u=t.schema[Se.SCALAR];let p;try{let f=u.resolve(i,d=>r(n??e,"TAG_RESOLVE_FAILED",d),t.options);p=Se.isScalar(f)?f:new fa.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);r(n??e,"TAG_RESOLVE_FAILED",d),p=new fa.Scalar(i)}return p.range=c,p.source=i,s&&(p.type=s),l&&(p.tag=l),u.format&&(p.format=u.format),a&&(p.comment=a),p}o(cp,"composeScalar");function lp(t,e,n,r,i){if(n==="!")return t[Se.SCALAR];let s=[];for(let c of t.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)s.push(c);else return c;for(let c of s)if(c.test?.test(e))return c;let a=t.knownTags[n];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Se.SCALAR])}o(lp,"findScalarTagByName");function up({atKey:t,directives:e,schema:n},r,i,s){let a=n.tags.find(c=>(c.default===!0||t&&c.default==="key")&&c.test?.test(r))||n[Se.SCALAR];if(n.compat){let c=n.compat.find(l=>l.default&&l.test?.test(r))??n[Se.SCALAR];if(a.tag!==c.tag){let l=e.tagString(a.tag),u=e.tagString(c.tag),p=`Value may be parsed as either ${l} or ${u}`;s(i,"TAG_RESOLVE_FAILED",p,!0)}}return a}o(up,"findScalarTagByTest");da.composeScalar=cp});var ha=y(ma=>{"use strict";function fp(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];i?.type==="space";)t+=i.source.length,i=e[++r];break}}return t}o(fp,"emptyScalarPosition");ma.emptyScalarPosition=fp});var ba=y(ci=>{"use strict";var dp=et(),pp=R(),mp=aa(),ga=pa(),hp=Ie(),gp=ha(),yp={composeNode:ya,composeEmptyNode:ai};function ya(t,e,n,r){let i=t.atKey,{spaceBefore:s,comment:a,anchor:c,tag:l}=n,u,p=!0;switch(e.type){case"alias":u=bp(t,e,r),(c||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=ga.composeScalar(t,e,l,r),c&&(u.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=mp.composeCollection(yp,t,e,n,r),c&&(u.anchor=c.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);r(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),p=!1}}return u??(u=ai(t,e.offset,void 0,null,n,r)),c&&u.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!pp.isScalar(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(u.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?u.comment=a:u.commentBefore=a),t.options.keepSourceTokens&&p&&(u.srcToken=e),u}o(ya,"composeNode");function ai(t,e,n,r,{spaceBefore:i,comment:s,anchor:a,tag:c,end:l},u){let p={type:"scalar",offset:gp.emptyScalarPosition(e,n,r),indent:-1,source:""},f=ga.composeScalar(t,p,c,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=l),f}o(ai,"composeEmptyNode");function bp({options:t},{offset:e,source:n,end:r},i){let s=new dp.Alias(n.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+n.length,c=hp.resolveEnd(r,a,t.strict,i);return s.range=[e,a,c.offset],c.comment&&(s.comment=c.comment),s}o(bp,"composeAlias");ci.composeEmptyNode=ai;ci.composeNode=ya});var Sa=y(wa=>{"use strict";var kp=gt(),ka=ba(),wp=Ie(),Sp=wt();function vp(t,e,{offset:n,start:r,value:i,end:s},a){let c=Object.assign({_directives:e},t),l=new kp.Document(void 0,c),u={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},p=Sp.resolveProps(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:a,parentIndent:0,startOnNewline:!0});p.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&a(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?ka.composeNode(u,i,p,a):ka.composeEmptyNode(u,p.end,r,null,p,a);let f=l.contents.range[2],d=wp.resolveEnd(s,f,!1,a);return d.comment&&(l.comment=d.comment),l.range=[n,f,d.offset],l}o(vp,"composeDoc");wa.composeDoc=vp});var ui=y(Aa=>{"use strict";var Ep=$t("process"),Ap=Hn(),Cp=gt(),St=kt(),va=R(),Rp=Sa(),Tp=Ie();function vt(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}o(vt,"getErrorPos");function Ea(t){let e="",n=!1,r=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":r?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}o(Ea,"parsePrelude");var li=class{static{o(this,"Composer")}constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{let a=vt(n);s?this.warnings.push(new St.YAMLWarning(a,r,i)):this.errors.push(new St.YAMLParseError(a,r,i))},this.directives=new Ap.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:i}=Ea(this.prelude);if(r){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${r}`:r;else if(i||e.directives.docStart||!s)e.commentBefore=r;else if(va.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];va.isPair(a)&&(a=a.key);let c=a.commentBefore;a.commentBefore=c?`${r}
|
|
104
|
+
${c}`:r}else{let a=s.commentBefore;s.commentBefore=a?`${r}
|
|
105
|
+
${a}`:r}}if(n){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ea(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(Ep.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{let s=vt(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=Rp.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new St.YAMLParseError(vt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new St.YAMLParseError(vt(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=Tp.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
106
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new St.YAMLParseError(vt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new Cp.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};Aa.Composer=li});var Ta=y(Rn=>{"use strict";var Op=ii(),Np=oi(),Lp=kt(),Ca=st();function Pp(t,e=!0,n){if(t){let r=o((i,s,a)=>{let c=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(c,s,a);else throw new Lp.YAMLParseError([c,c+1],s,a)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Np.resolveFlowScalar(t,e,r);case"block-scalar":return Op.resolveBlockScalar({options:{strict:e}},t,r)}}return null}o(Pp,"resolveAsScalar");function $p(t,e){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,c=Ca.stringifyString({type:a,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
107
|
+
`}];switch(c[0]){case"|":case">":{let u=c.indexOf(`
|
|
108
|
+
`),p=c.substring(0,u),f=c.substring(u+1)+`
|
|
109
|
+
`,d=[{type:"block-scalar-header",offset:s,indent:r,source:p}];return Ra(d,l)||d.push({type:"newline",offset:-1,indent:r,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:s,indent:r,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:c,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:c,end:l};default:return{type:"scalar",offset:s,indent:r,source:c,end:l}}}o($p,"createScalarToken");function qp(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=n,c="indent"in t?t.indent:null;if(r&&typeof c=="number"&&(c+=2),!a)switch(t.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let u=t.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let l=Ca.stringifyString({type:a,value:e},{implicitKey:i||c===null,indent:c!==null&&c>0?" ".repeat(c):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":Mp(t,l);break;case'"':fi(t,l,"double-quoted-scalar");break;case"'":fi(t,l,"single-quoted-scalar");break;default:fi(t,l,"scalar")}}o(qp,"setScalarValue");function Mp(t,e){let n=e.indexOf(`
|
|
111
|
+
`),r=e.substring(0,n),i=e.substring(n+1)+`
|
|
112
|
+
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,t.source=i}else{let{offset:s}=t,a="indent"in t?t.indent:-1,c=[{type:"block-scalar-header",offset:s,indent:a,source:r}];Ra(c,"end"in t?t.end:void 0)||c.push({type:"newline",offset:-1,indent:a,source:`
|
|
113
|
+
`});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:a,props:c,source:i})}}o(Mp,"setBlockScalarValue");function Ra(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}o(Ra,"addEndtoBlockProps");function fi(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of r)s.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
114
|
+
`};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{let r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:n,indent:r,source:e,end:i})}}}o(fi,"setFlowScalarValue");Rn.createScalarToken=$p;Rn.resolveAsScalar=Pp;Rn.setScalarValue=qp});var Na=y(Oa=>{"use strict";var _p=o(t=>"type"in t?On(t):Tn(t),"stringify");function On(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=On(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=Tn(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=Tn(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=Tn(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}o(On,"stringifyToken");function Tn({start:t,key:e,sep:n,value:r}){let i="";for(let s of t)i+=s.source;if(e&&(i+=On(e)),n)for(let s of n)i+=s.source;return r&&(i+=On(r)),i}o(Tn,"stringifyItem");Oa.stringify=_p});var qa=y($a=>{"use strict";var di=Symbol("break visit"),Dp=Symbol("skip children"),La=Symbol("remove item");function ve(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Pa(Object.freeze([]),t,e)}o(ve,"visit");ve.BREAK=di;ve.SKIP=Dp;ve.REMOVE=La;ve.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let s=n?.[r];if(s&&"items"in s)n=s.items[i];else return}return n};ve.parentCollection=(t,e)=>{let n=ve.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Pa(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let c=Pa(Object.freeze(t.concat([[i,a]])),s.items[a],n);if(typeof c=="number")a=c-1;else{if(c===di)return di;c===La&&(s.items.splice(a,1),a-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}o(Pa,"_visit");$a.visit=ve});var Nn=y(I=>{"use strict";var pi=Ta(),Ip=Na(),xp=qa(),mi="\uFEFF",hi="",gi="",yi="",Bp=o(t=>!!t&&"items"in t,"isCollection"),Fp=o(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function jp(t){switch(t){case mi:return"<BOM>";case hi:return"<DOC>";case gi:return"<FLOW_END>";case yi:return"<SCALAR>";default:return JSON.stringify(t)}}o(jp,"prettyToken");function Kp(t){switch(t){case mi:return"byte-order-mark";case hi:return"doc-mode";case gi:return"flow-error-end";case yi:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
115
|
+
`:case`\r
|
|
116
|
+
`: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(t[0]){case" ":case" ":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}o(Kp,"tokenType");I.createScalarToken=pi.createScalarToken;I.resolveAsScalar=pi.resolveAsScalar;I.setScalarValue=pi.setScalarValue;I.stringify=Ip.stringify;I.visit=xp.visit;I.BOM=mi;I.DOCUMENT=hi;I.FLOW_END=gi;I.SCALAR=yi;I.isCollection=Bp;I.isScalar=Fp;I.prettyToken=jp;I.tokenType=Kp});var wi=y(_a=>{"use strict";var Et=Nn();function W(t){switch(t){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}o(W,"isEmpty");var Ma=new Set("0123456789ABCDEFabcdef"),Vp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Ln=new Set(",[]{}"),Up=new Set(` ,[]{}
|
|
118
|
+
\r `),bi=o(t=>!t||Up.has(t),"isNotAnchorChar"),ki=class{static{o(this,"Lexer")}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,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
119
|
+
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
120
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let i=this.buffer[r+e+1];if(i===`
|
|
121
|
+
`||!i&&!this.atEnd)return e+r+1}return n===`
|
|
122
|
+
`||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&W(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
123
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(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(e===null)return this.setNext("stream");if(e[0]===Et.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let s=e[r-1];if(s===" "||s===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Et.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let 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");let n=this.peek(3);if((n==="---"||n==="...")&&W(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!W(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&W(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);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(bi),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&W(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Et.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"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(bi),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||W(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),i=r.indexOf(`
|
|
124
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
|
|
125
|
+
`,s)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>W(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case`
|
|
126
|
+
`:e=s,n=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
127
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
128
|
+
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
129
|
+
`;)r=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let c=s;for(;a===" ";)a=this.buffer[--s];if(a===`
|
|
130
|
+
`&&s>=this.pos&&s+1+n>c)e=s;else break}while(!0);return yield Et.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let s=this.buffer[r+1];if(W(s)||e&&Ln.has(s))break;n=r}else if(W(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
|
|
131
|
+
`?(r+=1,i=`
|
|
132
|
+
`,s=this.buffer[r+1]):n=r),s==="#"||e&&Ln.has(s))break;if(i===`
|
|
133
|
+
`){let a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(e&&Ln.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Et.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(bi),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(W(r)||n&&Ln.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!W(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Vp.has(n))n=this.buffer[++e];else if(n==="%"&&Ma.has(this.buffer[e+1])&&Ma.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
134
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
135
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};_a.Lexer=ki});var vi=y(Da=>{"use strict";var Si=class{static{o(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let s=n+r>>1;this.lineStarts[s]<e?n=s+1:r=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let i=this.lineStarts[n-1];return{line:n,col:e-i+1}}}};Da.LineCounter=Si});var Ai=y(ja=>{"use strict";var Wp=$t("process"),Ia=Nn(),Yp=wi();function ue(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}o(ue,"includesToken");function xa(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}o(xa,"findNonEmptyIndex");function Fa(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}o(Fa,"isFlowToken");function Pn(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}o(Pn,"getPrevProps");function xe(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}o(xe,"getFirstKeyStartProps");function $n(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}o($n,"arrayPushArray");function Ba(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!ue(e.start,"explicit-key-ind")&&!ue(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Fa(e.value)?e.value.end?$n(e.value.end,e.sep):e.value.end=e.sep:$n(e.start,e.sep),delete e.sep)}o(Ba,"fixFlowSeqItems");var Ei=class{static{o(this,"Parser")}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 Yp.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,Wp.env.LOG_TOKENS&&console.log("|",Ia.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Ia.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){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{let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,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(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}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()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Ba(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&xa(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}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":{xa(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=Pn(this.peek(2)),r=xe(n),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:i}]};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":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
136
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
137
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){$n(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&n.sep&&!n.value){let a=[];for(let c=0;c<n.sep.length;++c){let l=n.sep[c];switch(l.type){case"newline":a.push(c);break;case"space":break;case"comment":l.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ue(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Fa(n.key)&&!ue(n.sep,"newline")){let a=xe(n.start),c=n.key,l=n.sep;l.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:c,sep:l}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(ue(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let a=xe(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):ue(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||n.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!ue(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){$n(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||ue(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=Pn(r),s=xe(i);Ba(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let c={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
138
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
139
|
+
`,n)+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;let n=Pn(e),r=xe(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Pn(e),r=xe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(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],this.type==="newline"&&(yield*this.pop())}}};ja.Parser=Ei});var Ya=y(Ct=>{"use strict";var Ka=ui(),Jp=gt(),At=kt(),Gp=cr(),Hp=R(),Qp=vi(),Va=Ai();function Ua(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Qp.LineCounter||null,prettyErrors:e}}o(Ua,"parseOptions");function zp(t,e={}){let{lineCounter:n,prettyErrors:r}=Ua(e),i=new Va.Parser(n?.addNewLine),s=new Ka.Composer(e),a=Array.from(s.compose(i.parse(t)));if(r&&n)for(let c of a)c.errors.forEach(At.prettifyError(t,n)),c.warnings.forEach(At.prettifyError(t,n));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}o(zp,"parseAllDocuments");function Wa(t,e={}){let{lineCounter:n,prettyErrors:r}=Ua(e),i=new Va.Parser(n?.addNewLine),s=new Ka.Composer(e),a=null;for(let c of s.compose(i.parse(t),!0,t.length))if(!a)a=c;else if(a.options.logLevel!=="silent"){a.errors.push(new At.YAMLParseError(c.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(At.prettifyError(t,n)),a.warnings.forEach(At.prettifyError(t,n))),a}o(Wa,"parseDocument");function Xp(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=Wa(t,n);if(!i)return null;if(i.warnings.forEach(s=>Gp.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}o(Xp,"parse");function Zp(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return Hp.isDocument(t)&&!r?t.toString(n):new Jp.Document(t,r,n).toString(n)}o(Zp,"stringify");Ct.parse=Xp;Ct.parseAllDocuments=zp;Ct.parseDocument=Wa;Ct.stringify=Zp});var Ee=y(T=>{"use strict";var em=ui(),tm=gt(),nm=Ur(),Ci=kt(),rm=et(),fe=R(),im=oe(),sm=L(),om=ce(),am=le(),cm=Nn(),lm=wi(),um=vi(),fm=Ai(),qn=Ya(),Ja=Qe();T.Composer=em.Composer;T.Document=tm.Document;T.Schema=nm.Schema;T.YAMLError=Ci.YAMLError;T.YAMLParseError=Ci.YAMLParseError;T.YAMLWarning=Ci.YAMLWarning;T.Alias=rm.Alias;T.isAlias=fe.isAlias;T.isCollection=fe.isCollection;T.isDocument=fe.isDocument;T.isMap=fe.isMap;T.isNode=fe.isNode;T.isPair=fe.isPair;T.isScalar=fe.isScalar;T.isSeq=fe.isSeq;T.Pair=im.Pair;T.Scalar=sm.Scalar;T.YAMLMap=om.YAMLMap;T.YAMLSeq=am.YAMLSeq;T.CST=cm;T.Lexer=lm.Lexer;T.LineCounter=um.LineCounter;T.Parser=fm.Parser;T.parse=qn.parse;T.parseAllDocuments=qn.parseAllDocuments;T.parseDocument=qn.parseDocument;T.stringify=qn.stringify;T.visit=Ja.visit;T.visitAsync=Ja.visitAsync});import{realpathSync as Gc}from"node:fs";import{readFile as Pt,writeFile as wh}from"node:fs/promises";import{homedir as Sh}from"node:os";import me from"node:path";import pe from"node:process";import{fileURLToPath as vh}from"node:url";function We(t){let e=[...t];return e.some(n=>n!==Ue)?e.filter(n=>n!==Ue):e}o(We,"dropIncidentalRoot");function Wi(t){return al.has(t)}o(Wi,"isTokenName");function J(t){let e={},n=he(t.scope).join(Yi);n!==""&&(e.scope=n);let r=t.type?.trim(),i=t.breaking===!0;r!==void 0&&r!==""&&(r.endsWith(x)?(e.type=r.slice(0,-x.length),i=!0):e.type=r),i&&(e.breaking=!0);for(let s of["prNumber","ticketRef","title"]){let a=t[s]?.trim();a!==void 0&&a!==""&&(e[s]=a)}return e}o(J,"normalizeChangeRecord");function he(t){if(t===void 0)return[];let e=t.split(Yi).map(n=>n.trim()).filter(n=>n!==""&&n!==Kn);return[...new Set(e)]}o(he,"splitScopes");var x="!",Ue="root",Yi=",",Kn="*",ol=["breaking","pr_number","scope","ticket_ref","title","type"],al=new Set(ol);function Ye(t,e){let{breaking:n,scope:r,type:i,...s}=t,a=e.scope===void 0?t.scope:cl(e.scope),c=e.type??t.type,l=e.breaking??t.breaking===!0;return{...s,...l&&{breaking:l},...a!==void 0&&{scope:a},...c!==void 0&&{type:c}}}o(Ye,"applyOverrides");function cl(t){return t===Kn?void 0:t}o(cl,"readScopeOverride");function B(t){let{index:e,nodes:n}=Ji(t,0,!1);if(e<t.length)throw new Error(`Unmatched "]" in template ${JSON.stringify(t)}.`);return n}o(B,"compileTemplate");function Ji(t,e,n){let r=[],i="",s=e;function a(){i!==""&&(r.push({kind:"literal",text:i}),i="")}for(o(a,"flushLiteral");s<t.length;){let c=t[s]??"",l=c==="\\"?t[s+1]??"":"";if(ll.has(l)){i+=l,s+=2;continue}if(c==="["){a();let p=Ji(t,s+1,!0);if(p.index>=t.length)throw new Error(`Unclosed "[" group in template ${JSON.stringify(t)}.`);r.push({children:p.nodes,kind:"group"}),s=p.index+1;continue}if(c==="]"){if(n)break;return a(),{index:s,nodes:r}}let u=ul(t,s);if(u===void 0){i+=c,s+=1;continue}a(),r.push({kind:"token",name:u.name}),s=u.index}return a(),{index:s,nodes:r}}o(Ji,"compileNodes");var ll=new Set(["[","]","\\"]);function ul(t,e){if(t[e]!=="{")return;let n=t.indexOf("}",e+1);if(n===-1)return;let r=t.slice(e+1,n);return Wi(r)?{index:n+1,name:r}:void 0}o(ul,"readTokenAt");function Je(t,e){let n={},r=t.some(l=>!Gi(l,e)&&he(l.scope).length>0),i=new Set;for(let l of t)if(!(r&&Gi(l,e)))for(let u of he(l.scope))i.add(u);let s=We(i),[a]=s;s.length===1&&a!==void 0&&(n.scope=a);let c;for(let l of t){let u=dl(l,e);u!==void 0&&(c===void 0||fl(u.rank,c.rank))&&(c={breaking:l.breaking===!0,key:u.key,rank:u.rank})}return c!==void 0&&(n.type=c.key,c.breaking&&(n.breaking=!0)),n}o(Je,"consolidate");function Gi(t,e){let n=e.tiers.at(-1);return e.tiers.length<2||n===void 0?!1:e.types.some(r=>r.key===t.type&&r.tier===n)}o(Gi,"isLowestTier");function fl(t,e){return t.breaking!==e.breaking?t.breaking<e.breaking:t.tier!==e.tier?t.tier<e.tier:t.listing<e.listing}o(fl,"outranks");function dl(t,e){let n=e.types.findIndex(s=>s.key===t.type),r=e.types[n];if(r===void 0)return;let i=e.tiers.indexOf(r.tier);return{key:r.key,rank:{breaking:t.breaking===!0?0:1,listing:n,tier:i===-1?e.tiers.length:i}}}o(dl,"rankEntry");function V(t,e,n){let r={delimiters:kl(t),namesBreaking:qt(t,"breaking"),typeAlternation:ml(n)},i=qt(t,"type"),s=qt(t,"ticket_ref")?e:wl(e),a=new RegExp(`^${Qi(t,r)}$`).exec(s);if(a===null)return;let c=a.groups??{},l={};c.breaking===x&&(l.breaking=!0);for(let[u,p]of gl){let f=c[u];f!==void 0&&(l[p]=f)}if(c.type!==void 0){let u=hl(c.type,n);if(u===void 0)return;l.type=u}return i&&l.type===void 0?void 0:J(l)}o(V,"parse");var Hi=[/^##\s+/,/^#\d+([.-]\d+)?\s+/,/^[A-Z]+-\d+\s+/];function Qi(t,e){let n="";for(let r of t)r.kind==="literal"?n+=Mt(r.text):r.kind==="group"?n+=`(?:${Qi(r.children,e)})?`:n+=pl(r,e);return n}o(Qi,"buildPattern");function pl(t,e){switch(t.name){case"breaking":return`(?<breaking>${Mt(x)})?`;case"pr_number":return String.raw`(?<pr_number>\d+)`;case"scope":{let n=e.delimiters.get(t);return n===void 0?"(?<scope>.+?)":`(?<scope>[^${bl(n)}]+)`}case"ticket_ref":return String.raw`(?<ticket_ref>#\d+|[A-Z]{2,}-\d+)`;case"title":return"(?<title>.+?)";case"type":return e.namesBreaking?`(?<type>${e.typeAlternation})`:`(?<type>${e.typeAlternation})(?<breaking>${Mt(x)})?`}}o(pl,"buildTokenPattern");function ml(t){return[...yl(t)].toSorted((e,n)=>n.length-e.length||e.localeCompare(n)).map(Sl).join("|")}o(ml,"buildTypeAlternation");function hl(t,e){let n=t.toLowerCase();for(let r of e.types)if(r.key.toLowerCase()===n||(r.aliases??[]).some(i=>i.toLowerCase()===n))return r.key}o(hl,"canonicalizeType");var gl=[["pr_number","prNumber"],["scope","scope"],["ticket_ref","ticketRef"],["title","title"]];function yl(t){let e=new Set;for(let n of t.types){e.add(n.key);let r=n.aliases??[];for(let i of r)e.add(i)}return e}o(yl,"collectSpellings");function bl(t){return/[\]\\^-]/.test(t)?`\\${t}`:t}o(bl,"escapeForCharacterClass");function Mt(t){return t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}o(Mt,"escapeForPattern");function zi(t,e){for(let n of t)n.kind==="group"?zi(n.children,e):e.push(n)}o(zi,"flatten");function kl(t){let e=[];zi(t,e);let n=new Map;for(let[r,i]of e.entries()){if(i.kind!=="token"||i.name!=="scope")continue;let s=e.slice(r+1).find(a=>a.kind==="literal"&&a.text!=="");s?.kind==="literal"&&n.set(i,s.text.slice(0,1))}return n}o(kl,"mapScopeDelimiters");function qt(t,e){return t.some(n=>n.kind==="token"?n.name===e:n.kind==="group"&&qt(n.children,e))}o(qt,"namesToken");function wl(t){let e=t;for(let n of Hi)e=e.replace(n,"");return e}o(wl,"stripTicketPrefix");function Sl(t){return t.replaceAll(/./gs,e=>{let n=e.toLowerCase(),r=e.toUpperCase();return n===r?Mt(e):`[${n}${r}]`})}o(Sl,"toEitherCaseSource");function Q(t,e){let n=J(e);return Zi(t,n,Xi(t))}o(Q,"render");function vl(t,e,n){return t.some(r=>r.kind==="token"&&r.name!=="breaking"&&es(e,r.name,n)==="")}o(vl,"hasEmptyDirectToken");function Xi(t){return t.some(e=>e.kind==="token"?e.name==="breaking":e.kind==="group"&&Xi(e.children))}o(Xi,"namesBreakingToken");function Zi(t,e,n){let r="";for(let i of t)i.kind==="literal"?r+=i.text:i.kind==="token"?r+=es(e,i.name,n):vl(i.children,e,n)||(r+=Zi(i.children,e,n));return r}o(Zi,"renderNodes");function es(t,e,n){switch(e){case"breaking":return t.breaking===!0?x:"";case"pr_number":return t.prNumber??"";case"scope":return t.scope??"";case"ticket_ref":return t.ticketRef??"";case"title":return t.title??"";case"type":return El(t,n)}}o(es,"resolveToken");function El(t,e){return t.type===void 0?"":!e&&t.breaking===!0?`${t.type}${x}`:t.type}o(El,"resolveTypeToken");var Vn={markers:{breaking:{emoji:"\u{1F6A8}",label:"Breaking"}},tiers:["public","internal","process"],types:[{aliases:["feature"],breakingPolicy:"optional",description:"A change that gives consumers a new capability or extends an existing one.",emoji:"\u{1F389}",key:"feat",label:"Features",tier:"public",trackerLabel:"feature"},{aliases:[],breakingPolicy:"optional",description:"A change that removes a capability or surface on which consumers depend.",emoji:"\u{1FAA6}",key:"drop",label:"Removed",tier:"public",trackerLabel:"removal"},{aliases:[],breakingPolicy:"forbidden",description:"A change that marks a capability or surface for removal while the capability or surface keeps working.",emoji:"\u{1F5D1}\uFE0F",key:"deprecate",label:"Deprecated",tier:"public",trackerLabel:"deprecation"},{aliases:["bugfix"],breakingPolicy:"optional",description:"A change that corrects behavior that consumers meet and that differs from what was intended.",emoji:"\u{1F41B}",key:"fix",label:"Bug fixes",tier:"public",trackerLabel:"fix"},{aliases:["security"],breakingPolicy:"optional",description:"A change that closes a vulnerability or hardens a consumer-facing surface against attack.",emoji:"\u{1F512}",key:"sec",label:"Security",tier:"public",trackerLabel:"security"},{aliases:["performance"],breakingPolicy:"optional",description:"A change that reduces the time, memory, or other resources that consumer-facing work uses, without changing its result.",emoji:"\u26A1",key:"perf",label:"Performance",tier:"public",trackerLabel:"performance"},{aliases:["utility"],breakingPolicy:"forbidden",description:"A change that adds, extends, or repairs a capability that consumers do not use directly, such as a helper or an internal module.",emoji:"\u{1F3D7}\uFE0F",key:"internal",label:"Internal features",tier:"internal",trackerLabel:"internal"},{aliases:[],breakingPolicy:"forbidden",description:"A change that restructures existing code without changing its behavior.",emoji:"\u267B\uFE0F",key:"refactor",label:"Refactoring",tier:"internal",trackerLabel:"refactoring"},{aliases:["test"],breakingPolicy:"forbidden",description:"A change confined to tests, test fixtures, or test helpers, including one that unblocks a build or a type check.",emoji:"\u{1F9EA}",key:"tests",label:"Tests",tier:"internal",trackerLabel:"tests"},{aliases:[],breakingPolicy:"forbidden",description:"A change to the tools used to develop the project: build, lint, formatting, and release configuration, and development scripts.",emoji:"\u2699\uFE0F",key:"tooling",label:"Tooling",tier:"process",trackerLabel:"tooling"},{aliases:[],breakingPolicy:"forbidden",description:"A change to continuous-integration workflows and their configuration.",emoji:"\u{1F477}",key:"ci",label:"CI",tier:"process",trackerLabel:"ci"},{aliases:["dep"],breakingPolicy:"forbidden",description:"A change that adds, removes, or upgrades a dependency, including its lockfile and version-catalog entries.",emoji:"\u{1F4E6}",key:"deps",label:"Dependencies",tier:"process",trackerLabel:"dependencies"},{aliases:[],breakingPolicy:"forbidden",description:"A change to guidance on working in the repository itself, such as its `AGENTS.md` or a repo-local skill, or to the repository's agent configuration.",emoji:"\u{1F916}",key:"ai",label:"Agentic support",tier:"process",trackerLabel:"ai"},{aliases:["doc"],breakingPolicy:"forbidden",description:"A change to documentation for human readers, such as a README, a guide, or a code comment.",emoji:"\u{1F4DA}",key:"docs",label:"Documentation",tier:"process",trackerLabel:"documentation"},{aliases:[],breakingPolicy:"forbidden",description:"A change to formatting alone, such as whitespace or line wrapping, that leaves the content unchanged.",emoji:"\u{1F3A8}",excludedFromChangelog:!0,key:"fmt",label:"Formatting",tier:"process",trackerLabel:"formatting"}],version:"1.3.0"};function Ge(t,e){let n=e.types.find(s=>s.key===t.type);if(n===void 0)return;let r=n.breakingPolicy??"optional",i=t.breaking===!0;if(r==="forbidden"&&i)return{policy:r,type:n.key}}o(Ge,"validate");function Un(t,e){let n;try{n=B(t)}catch{return[]}let r=new Set(He(n).filter(c=>c.kind==="token").map(c=>c.name)),i=[...Al(n)].filter(c=>c!=="breaking"&&c!=="type"),s=r.has("breaking")||r.has("type")?[!1,!0]:[!1],a=[];for(let c of $l(i)){let l=r.difference(new Set(c));for(let u of s){let p=ns(l,u,e),f=Q(n,p),d=V(n,f,e);ge(d)!==ge(p)&&a.push(`Template ${JSON.stringify(t)} renders ${Cl(c,u)} as ${JSON.stringify(f)}, which reads back as ${ge(d)}.`)}}return a}o(Un,"findLossyRenders");function Wn(t,e){let n;try{n=B(t)}catch(s){return[s instanceof Error?s.message:`Template ${JSON.stringify(t)} could not be compiled.`]}let r=He(n),i=[...Rl(t,r),...Nl(t,r),...Ol(t,n),...Tl(t,r)];return i.length>0?i:Ll(t,n,r,e)}o(Wn,"verify");function ts(t,e){return t===void 0?!1:t.kind==="literal"?(e==="end"?t.text.at(-1):t.text.at(0))==="!":Pl.has(t.name)}o(ts,"admitsMarker");function ns(t,e,n){let r={};e&&(r.breaking=!0),t.has("pr_number")&&(r.prNumber=Ml),t.has("scope")&&(r.scope=_l),t.has("ticket_ref")&&(r.ticketRef=Dl),t.has("title")&&(r.title=Il);let i=n.types.at(0)?.key;return t.has("type")&&i!==void 0&&(r.type=i),r}o(ns,"buildSample");function Al(t){let e=new Set;for(let n of t)if(n.kind==="group")for(let r of He(n.children))r.kind==="token"&&e.add(r.name);return e}o(Al,"collectGroupedTokens");function ge(t){return t===void 0?"unmatched":JSON.stringify(Object.entries(t).toSorted(([e],[n])=>e.localeCompare(n)))}o(ge,"describeRecord");function Cl(t,e){let n=e?"a breaking record":"a record";return t.length===0?e?n:`${n} with every token`:`${n} without ${t.map(r=>`{${r}}`).join(" or ")}`}o(Cl,"describeShape");function Rl(t,e){let n=[];for(let[r,i]of e.entries()){let s=e[r+1];i.kind!=="token"||s?.kind!=="token"||i.name==="breaking"||s.name==="breaking"||n.push(`Template ${JSON.stringify(t)} places {${i.name}} and {${s.name}} without a literal between them.`)}return n}o(Rl,"findAdjacentTokenDefects");function Tl(t,e){let n=[];for(let[r,i]of e.entries())i.kind!=="token"||i.name!=="breaking"||(ts(e[r-1],"end")||ts(e[r+1],"start"))&&n.push(`Template ${JSON.stringify(t)} places {${i.name}} where "!" is not distinguishable from its neighbour.`);return n}o(Tl,"findBreakingMarkerDefects");function Ol(t,e){let n=[],r;function i(s){for(let a of s){if(a.kind==="literal"){r=a.text;continue}if(a.kind==="token"){r=void 0;continue}let c=rs(a);r!==void 0&&c!==void 0&&r.at(-1)===c.at(0)&&n.push(`Template ${JSON.stringify(t)} opens an optional group with ${JSON.stringify(c)}, repeating the text before it.`),i(a.children)}}return o(i,"walk"),i(e),n}o(Ol,"findGroupBoundaryDefects");function Nl(t,e){let n=new Map;for(let r of e)r.kind==="token"&&n.set(r.name,(n.get(r.name)??0)+1);return[...n].filter(([,r])=>r>1).map(([r])=>`Template ${JSON.stringify(t)} names {${r}} more than once.`)}o(Nl,"findRepeatedTokenDefects");function Ll(t,e,n,r){let i=new Set(n.filter(u=>u.kind==="token").map(u=>u.name)),a=i.has("breaking")||i.has("type")?[!1,!0]:[!1],c=[i];for(let u of ql(e).values())!u.has("breaking")&&!u.has("type")&&c.push(i.difference(u));let l=[];for(let u of a)for(let p of c){let f=ns(p,u,r),d=Q(e,f),h=V(e,d,r);ge(h)!==ge(f)&&l.push(`Template ${JSON.stringify(t)} does not round-trip: It renders ${ge(f)} as ${JSON.stringify(d)}, which reads back as ${ge(h)}.`)}return l}o(Ll,"findRoundTripDefects");function He(t){let e=[];for(let n of t)n.kind==="group"?e.push(...He(n.children)):e.push(n);return e}o(He,"flattenTemplate");var Pl=new Set(["scope","title"]);function $l(t){let e=[[]];for(let n of t)e=[...e,...e.map(r=>[...r,n])];return e}o($l,"listSubsets");function ql(t){let e=new Map;function n(r){for(let i of r){if(i.kind!=="group")continue;let s=new Set(He(i.children).filter(a=>a.kind==="token").map(a=>a.name));for(let a of i.children)a.kind==="token"&&a.name!=="breaking"&&e.set(a.name,s);n(i.children)}}return o(n,"walk"),n(t),e}o(ql,"mapDroppableTokens");function rs(t){let e=t.children.at(0);return e?.kind==="literal"?e.text:e?.kind==="group"?rs(e):void 0}o(rs,"readLeadingLiteral");var Ml="470",_l="agents,kb",Dl="#466",Il="Add foo";function is(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}o(is,"isError");function Te(t){try{return is(t)&&typeof t.message=="string"&&t.message!==""?t.message:String(t)}catch{return"[unstringifiable value]"}}o(Te,"describeError");function _(t,e){let n=new Error(`${t}: ${Te(e)}`,{cause:e});return typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(n,_),n}o(_,"chainError");var Qc=Re(Ee(),1);function Ga(t,e){let n=[],r=[];for(let i=0;i<t.length;i+=1){let s=t[i];if(s===void 0)continue;if(!s.startsWith("--")){n.push(s);continue}let a=dm(s,e);if(a===null)throw new Error(`unknown flag: ${s}`);let{spec:c,inlineValue:l}=a;if(!c.takesValue){if(l!==null)throw new Error(`--${c.name} does not take a value`);r.push({name:c.name,value:null});continue}if(l!==null){r.push({name:c.name,value:l});continue}let u=t[i+1]??null;if(u===null||u.startsWith("--"))throw new Error(`--${c.name} requires a value`);r.push({name:c.name,value:u}),i+=1}return{positionals:n,flags:r}}o(Ga,"scanFlags");function Y(t){let e={};for(let{name:n,value:r}of t)r!==null&&(e[n]=r);return e}o(Y,"valueFlagMap");function dm(t,e){for(let n of e)for(let r of[n.name,...n.aliases??[]]){let i=`--${r}`;if(t===i)return{spec:n,inlineValue:null};if(t.startsWith(`${i}=`))return{spec:n,inlineValue:t.slice(i.length+1)}}return null}o(dm,"matchFlag");import{readFile as pm}from"node:fs/promises";import mm from"node:path";function Ha(t,e){return Qa(t)&&t.code===e}o(Ha,"isErrorCode");function Z(t){return Ha(t,"ENOENT")||Ha(t,"ENOTDIR")}o(Z,"isMissingFile");function N(t){return Qa(t)&&!Array.isArray(t)}o(N,"isRecord");function Qa(t){return typeof t=="object"&&t!==null}o(Qa,"isObject");function za(t=Vn){return{...t,types:t.types.map(({trackerLabel:e,...n})=>n)}}o(za,"buildWorkTypesDocument");function de(t){return t===void 0?"in the bundle":`under ${t}`}o(de,"describeTaxonomyLocation");async function Be(t){let e=await tc(t);if(e===null)return null;let n=[];for(let i of e.types)!N(i)||typeof i.key!="string"||typeof i.tier!="string"||n.push({aliases:ym(i.aliases),key:i.key,tier:i.tier,...gm(i.breakingPolicy)&&{breakingPolicy:i.breakingPolicy}});return{tiers:Array.isArray(e.tiers)?e.tiers.filter(i=>typeof i=="string"):[],types:n}}o(Be,"loadTaxonomy");async function Za(t){let e=await tc(t);if(e===null)return null;let n=N(e.markers)?Xa(e.markers.breaking):null;if(n===null)return null;let r=new Map;for(let i of e.types){if(!N(i)||typeof i.key!="string"||typeof i.tier!="string")continue;let s=Xa(i);if(s===null)return null;r.set(i.key,`${s.emoji} ${s.label}`)}return{breakingPrefix:`${n.emoji} **${n.label}:** `,headings:r}}o(Za,"loadWorkTypeHeadings");var hm=new Set(["forbidden","optional"]);function gm(t){return typeof t=="string"&&hm.has(t)}o(gm,"isBreakingPolicy");function ec(t){return!N(t)||!Array.isArray(t.types)?null:{markers:t.markers,tiers:t.tiers,types:t.types}}o(ec,"parseTaxonomy");function ym(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}o(ym,"readAliases");function Xa(t){if(!N(t))return null;let{emoji:e,label:n}=t;return typeof e!="string"||typeof n!="string"||e.trim()===""||n.trim()===""?null:{emoji:e,label:n}}o(Xa,"readDisplay");async function tc(t){return t===void 0?ec(za()):await bm(t)}o(tc,"readTaxonomy");async function bm(t){let e;try{e=await pm(mm.join(t,"work-types.json"),"utf8")}catch(r){if(Z(r))return null;throw r}let n;try{n=JSON.parse(e)}catch{return null}return ec(n)}o(bm,"readTaxonomyFile");var ee=Re(Ee(),1);var Fe=Re(Ee(),1);function Mn(t,e){let n=t.flatMap(r=>{let i={...r.breaking&&{breaking:!0},type:r.type};return r.scopes.length===0?[i]:r.scopes.map(s=>({...i,scope:s}))});return Je(n,e)}o(Mn,"consolidateChangeEntries");function _n(t){if((0,Fe.isSeq)(t)){for(let[e,n]of t.items.entries())if((0,Fe.isMap)(n))for(let r of["text","migration"]){let i=n.get(r,!0),s=(0,Fe.isScalar)(i)?i.comment:void 0;if(s!=null&&s.trim()!==""){let a=s.split(`
|
|
140
|
+
`).map(c=>`#${c.trimEnd()}`).join(" ");return{defect:`\`entries[${e}].${r}\` is cut short by a YAML comment (\`${a}\`); quote the value`}}}}}o(_n,"findEntryComment");function Rt(t){if(!Array.isArray(t))return{defect:"the entries are not a list"};let e=[];for(let[n,r]of t.entries()){let i=km(r,n);if("defect"in i)return i;e.push(i.entry)}return{entries:e}}o(Rt,"readChangeEntries");function km(t,e){let n=`entries[${e}]`;if(!N(t))return{defect:`\`${n}\` is not a mapping`};let{breaking:r,migration:i,scopes:s}=t;if(r!=null&&typeof r!="boolean")return{defect:`\`${n}.breaking\` is not a boolean`};if(s!=null&&!Array.isArray(s))return{defect:`\`${n}.scopes\` is not a list`};let a=s??[],c=[];for(let[f,d]of a.entries()){if(typeof d!="string")return{defect:`\`${n}.scopes[${f}]\` is not a string`};c.push(d.trim())}if(i!=null&&typeof i!="string")return{defect:`\`${n}.migration\` is not a string`};let l=i?.trim()??"";if(/[\n\r]/.test(l))return{defect:`\`${n}.migration\` spans more than one line`};let u=nc(t,n,"text");if("defect"in u)return u;let p=nc(t,n,"type");return"defect"in p?p:{entry:{breaking:r===!0,...l!==""&&{migration:l},scopes:c,text:u.value,type:p.value}}}o(km,"readEntry");function nc(t,e,n){let r=t[n];if(r==null)return{defect:`\`${e}.${n}\` is missing`};if(typeof r!="string")return{defect:`\`${e}.${n}\` is not a string`};let i=r.trim();return i===""?{defect:`\`${e}.${n}\` is empty`}:{value:i}}o(nc,"readRequiredField");function Tt(t){let e=cc(t);return"payload"in e?Em(e.payload,e.entriesComment):e}o(Tt,"readChangeRecordBlock");function rc(t){let e=cc(t);return"payload"in e?e.entriesComment===void 0?vm(e.payload):{defect:e.entriesComment,kind:"malformed"}:e}o(rc,"readMergeChangeRecordBlock");function Dn(t){let e=ac(t.overrides??{}),n=t.entriesCommit?.trim(),r=t.entries??[],i={title:t.title.trim(),...Object.keys(e).length>0&&{overrides:e},...r.length>0&&{...n!==void 0&&n!==""&&{entries_commit:n},entries:r.map(fc)}};return`${je}${Ti}
|
|
141
|
+
${uc(i)}${je}`}o(Dn,"renderChangeRecordBlock");function ic(t){let e=t.ticketRef?.trim(),n={...t.prNumber!==void 0&&{pr_number:t.prNumber},...e!==void 0&&e!==""&&{ticket_ref:e},entries:t.entries.map(fc)};return`${je}${Ti}
|
|
142
|
+
${uc(n)}${je}`}o(ic,"renderMergeChangeRecordBlock");function sc(t,e){let n=t.split(/(\r?\n)/),r=n.filter((a,c)=>c%2===0),i=Ri(r).at(-1);if(i?.close===void 0)throw new Error("the body does not contain a closed change-record block to replace");let s=n[i.open*2+1]??`
|
|
143
|
+
`;return[...n.slice(0,i.open*2),e.split(`
|
|
144
|
+
`).join(s),...n.slice(i.close*2+1)].join("")}o(sc,"replaceLastChangeRecordBlock");function oc(t){let e=lc(t),n=Ri(e);return e.filter((r,i)=>n.every(s=>i<s.open||i>(s.close??e.length))).join(`
|
|
145
|
+
`)}o(oc,"stripChangeRecordBlocks");var je="```";function Ri(t){let e=[],n;for(let[r,i]of t.entries())n===void 0?i.trim()===`${je}${Ti}`&&(n=r):i.trim()===je&&(e.push({close:r,open:n}),n=void 0);return n!==void 0&&e.push({open:n}),e}o(Ri,"findFences");var Ti="change-record";function ac(t){let{breaking:e,type:n}=J(t),r=t.scope?.trim();return{...r!==void 0&&r!==""&&{scope:r},...n!==void 0&&{type:n},...e===!0&&{breaking:e}}}o(ac,"normalizeOverrides");function cc(t){let e=lc(t),n=Ri(e).at(-1);if(n===void 0)return{kind:"absent"};if(n.close===void 0)return{defect:"the block opens but never closes",kind:"malformed"};let r=(0,ee.parseDocument)(e.slice(n.open+1,n.close).join(`
|
|
146
|
+
`)),[i]=r.errors;if(i!==void 0)return{defect:`the payload is not valid YAML: ${(i.message.split(`
|
|
147
|
+
`,1)[0]??"").replace(/:$/,"")}`,kind:"malformed"};let s=_n(r.get("entries",!0));return{...s!==void 0&&{entriesComment:s.defect},payload:r.toJS()}}o(cc,"parseLastBlock");function wm(t,e){if(e!==void 0)return{defect:e};let n=t.entries_commit;if(n!=null&&typeof n!="string")return{defect:"`entries_commit` is not a string"};let r=n?.trim(),i=r===void 0||r===""?{}:{entriesCommit:r},s=t.entries;if(s==null)return i;let a=Rt(s);return"defect"in a?a:{...i,...a.entries.length>0&&{entries:a.entries}}}o(wm,"readEntryFields");function Sm(t){let e=t.overrides;if(e==null)return{record:{}};if(!N(e))return{defect:"`overrides` is not a mapping"};let n={},{breaking:r}=e;if(r!=null){if(typeof r!="boolean")return{defect:"`overrides.breaking` is not a boolean"};n.breaking=r}for(let i of Am){let s=e[i];if(s!=null){if(typeof s!="string")return{defect:`\`overrides.${i}\` is not a string`};n[i]=s}}return{record:n}}o(Sm,"readOverrideFields");function vm(t){if(!N(t))return{defect:"the payload is not a mapping",kind:"malformed"};let{entries:e,pr_number:n,ticket_ref:r}=t;if(n!=null&&(typeof n!="number"||!Number.isSafeInteger(n)||n<=0))return{defect:"`pr_number` is not a positive integer",kind:"malformed"};if(r!=null&&typeof r!="string")return{defect:"`ticket_ref` is not a string",kind:"malformed"};let i=e==null?{entries:[]}:Rt(e);if("defect"in i)return{defect:i.defect,kind:"malformed"};let s=r?.trim();return{block:{entries:i.entries,...typeof n=="number"&&{prNumber:n},...s!==void 0&&s!==""&&{ticketRef:s}},kind:"read"}}o(vm,"readMergePayload");function Em(t,e){if(!N(t))return{defect:"the payload is not a mapping",kind:"malformed"};let{title:n}=t;if(n==null)return{defect:"`title` is missing",kind:"malformed"};if(typeof n!="string")return{defect:"`title` is not a string",kind:"malformed"};if(n.trim()==="")return{defect:"`title` is empty",kind:"malformed"};let r=Sm(t);if("defect"in r)return{defect:r.defect,kind:"malformed"};let{breaking:i,scope:s,type:a}=r.record,c=ac({...i===!0&&{breaking:i},...s!==void 0&&{scope:s},...a!==void 0&&{type:a}}),l=wm(t,e),u="defect"in l?{}:l;return{block:{title:n.trim(),...Object.keys(c).length>0&&{overrides:c},...u},..."defect"in l&&{entriesDefect:l.defect},kind:"read"}}o(Em,"readPayload");function lc(t){return t.split(/\r?\n/)}o(lc,"splitLines");var Am=["scope","type"];function uc(t){let e=new ee.Document(t),n=e.get("entries");if((0,ee.isSeq)(n))for(let r of n.items){let i=(0,ee.isMap)(r)?r.get("scopes",!0):void 0;(0,ee.isSeq)(i)&&(i.flow=!0)}return e.toString({flowCollectionPadding:!1})}o(uc,"stringifyPayload");function fc(t){return{type:t.type,scopes:t.scopes,...t.breaking&&{breaking:!0},text:t.text,...t.migration!==void 0&&{migration:t.migration}}}o(fc,"toEntryPayload");function Ke(t,e){if(t.type===void 0)return[{kind:"missing-type"}];let n=pc({breaking:t.breaking===!0,type:t.type},e);return n===void 0?[]:[n]}o(Ke,"findDefects");function dc(t,e){return t.flatMap((n,r)=>{let i=pc(n,e);return i===void 0?[]:[{...i,entry:r}]})}o(dc,"findEntryDefects");function pc(t,e){if(e.types.every(r=>r.key!==t.type))return{kind:"undeclared-type",type:t.type};let n=Ge(t,e);return n===void 0?void 0:{kind:"policy-violation",policy:n.policy,type:n.type}}o(pc,"findTypeDefect");function mc(t){let e=Tt(t.body);if(e.kind==="absent")throw new Error("the body doesn't contain a change-record block");if(e.kind==="malformed")throw new Error(`the body\u2019s change-record block is malformed: ${e.defect}`);if(e.entriesDefect!==void 0)throw new Error(`the block\u2019s change entries are malformed: ${e.entriesDefect}`);let n=e.block.entries??[],r=n[t.index];if(r===void 0)throw new Error(`entry ${t.index} is out of range; the block records ${n.length} change entries`);let{breaking:i,type:s}=t.amendment,a={...r,...i!==void 0&&{breaking:i},...s!==void 0&&{type:s}},[c]=Ke(a,t.taxonomy);if(c!==void 0)throw new Error(`the amendment leaves entries[${t.index}] defective: ${Cm(c)}`);let l=n.with(t.index,a),u=Dn({...e.block,entries:l});return{body:sc(t.body,u),entry:a,entryCount:l.length}}o(mc,"amendEntry");function Cm(t){switch(t.kind){case"missing-type":return"it doesn't name a type";case"policy-violation":return`the type ${t.type} forbids the breaking marker`;case"undeclared-type":return`the taxonomy does not declare the type ${t.type}`}}o(Cm,"describeDefect");function Oi(t,e,n){let r=[],i=[],s=[];for(let c of t){let l=c.trailers.length>0?c.trailers:[c.subject];for(let u of l){let p=V(e,u,n);if(p===void 0){i.push({commit:c.hash,subject:u});continue}r.push({commit:c.hash,record:p});let f=Ge(p,n);f!==void 0&&s.push({commit:c.hash,policy:f.policy,type:f.type})}}let a=r.length>0?Je(r.map(c=>c.record),n):void 0;return{entries:r,unmatched:i,violations:s,...a!==void 0&&{consolidatedRecord:a}}}o(Oi,"consolidateBranch");import{execFile as Tm}from"node:child_process";import{readFile as Om}from"node:fs/promises";import gc from"node:path";import{promisify as Nm}from"node:util";var bc=Re(Ee(),1);function hc(t){return Rm.includes(t)}o(hc,"isSurface");var Ae=["commit","ticket","pr","merge"],Rm=Ae;async function kc(t){let e=[],n=await yc(gc.join(t.projectRoot,".agents","preferences.yaml"),e),r=await yc(gc.join(t.home,".agents","preferences.yaml"),e);return{templates:{commit:n.commit??r.commit??"",ticket:n.ticket??r.ticket??"",pr:n.pr??r.pr??"",merge:n.merge??r.merge??""},warnings:e}}o(kc,"loadPreferences");async function Ot(t){try{let{stdout:e}=await Lm("git",["-C",t,"rev-parse","--show-toplevel"]);return{projectRoot:e.trim()}}catch(e){let n=e instanceof Error?e.message.trim().split(`
|
|
148
|
+
`).at(-1):String(e);return{projectRoot:t,warning:`git could not resolve the repository root (${n}); anchoring at ${t}`}}}o(Ot,"resolveProjectRoot");var Lm=Nm(Tm);async function yc(t,e){let n;try{n=await Om(t,"utf8")}catch(s){if(Z(s))return{};throw s}let r;try{r=(0,bc.parse)(n)}catch(s){throw _(`${t}: malformed YAML`,s)}if(!N(r))return{};let i={};for(let s of Ae){let a=r[s];if(!N(a)||!("title_format"in a))continue;let c=a.title_format;c==null?i[s]="":typeof c=="string"?i[s]=c:e.push(`${t}: ${s}.title_format is not a string; ignoring it`)}return i}o(yc,"readTitleFormats");import{execFile as Pm}from"node:child_process";import{promisify as $m}from"node:util";async function Li(t){let e=t.headRef??"HEAD";if(!await _m(t.cwd,e))throw new Nt(e);let n=`%H${Ni}%s${Ni}%(trailers:key=Change,valueonly,separator=${vc})${wc}`,r=["-C",t.cwd,"log",`${t.baseRef}..${e}`,"--reverse","--no-merges",`--format=${n}`],{stdout:i}=await Sc("git",r,{maxBuffer:qm}),s=[];for(let a of i.split(wc)){let[c,l,u]=a.split(Ni);c===void 0||l===void 0||c.trim()===""||s.push({hash:c.trim(),subject:l,trailers:Dm(u)})}return s}o(Li,"readCommits");var Nt=class extends Error{static{o(this,"MissingCommitError")}name="MissingCommitError";ref;constructor(e){super(`${e} does not name a commit in the local repository`),this.ref=e}},Sc=$m(Pm),Ni="",qm=64*1024*1024,Mm="^{commit}",wc="",vc="";async function _m(t,e){try{return await Sc("git",["-C",t,"rev-parse","--verify","--quiet","--end-of-options",`${e}${Mm}`]),!0}catch(n){if(N(n)&&n.code===1)return!1;throw n}}o(_m,"hasCommit");function Dm(t){return(t??"").split(vc).map(e=>e.trim()).filter(e=>e!=="")}o(Dm,"splitTrailers");import{readFile as Im,stat as xm}from"node:fs/promises";import Ve from"node:path";var Ec=Re(Ee(),1);async function Ac(t){let e=Ve.join(t,".agents","preferences.yaml"),n={scopeDirs:[],warnings:[]},r;try{r=await Im(e,"utf8")}catch(l){if(Z(l))return n;throw l}let i;try{i=(0,Ec.parse)(r)}catch(l){throw _(`${e}: malformed YAML`,l)}if(!N(i)||!N(i.project)||!("scopes"in i.project))return n;let s=i.project.scopes;if(!Array.isArray(s))return{scopeDirs:[],warnings:[`${e}: project.scopes is not a list; ignoring it`]};let a=[],c=[];for(let[l,u]of s.entries()){let p=await Bm(u,t);typeof p=="string"?c.push(`${e}: project.scopes[${l}] ${p}; skipping it`):a.push(p)}return{scopeDirs:a,warnings:c}}o(Ac,"readDeclaredScopes");async function Bm(t,e){if(!N(t))return"is not a mapping";let{name:n,path:r}=t;if(typeof r!="string"||r==="")return"does not have a string `path`";if("name"in t&&(typeof n!="string"||n.trim()===""))return"has a `name` that is not a non-empty string";if(Ve.isAbsolute(r))return`has an absolute path ${r}`;let i=Ve.resolve(e,r),s=Ve.relative(e,i);if(s===".."||s.startsWith(`..${Ve.sep}`))return`has a path ${r} outside the repository`;try{if(!(await xm(i)).isDirectory())return`has a path ${r} that is not a directory`}catch(a){if(Z(a))return`has a path ${r} that does not exist`;throw a}return{dir:i,name:typeof n=="string"?n:Ve.basename(i)}}o(Bm,"readEntry");import{readFile as Fm}from"node:fs/promises";async function Lt(t){let e;try{e=await Fm(t,"utf8")}catch(r){if(Z(r))return{scopes:{},types:{}};throw r}let n;try{n=JSON.parse(e)}catch{return{scopes:{},types:{}}}return N(n)?{scopes:Cc(n.scopes),types:Cc(n.types)}:{scopes:{},types:{}}}o(Lt,"readLabelMap");function Rc(t,e){let n=In(t.scopes,e),r=In(t.types,e),i=e.includes(Pi);return{...(i||r!==void 0)&&{breaking:i},...n!==void 0&&{scope:n},...r!==void 0&&{type:r}}}o(Rc,"resolveLabeledRecord");function In(t,e){let n=new Set;for(let i of e)for(let[s,a]of Object.entries(t))a===i&&n.add(s);let[r]=n;return n.size===1?r:void 0}o(In,"resolveLabelKey");var Pi="breaking";function Cc(t){if(!N(t))return{};let e={};for(let[n,r]of Object.entries(t))typeof r=="string"&&(e[n]=r);return e}o(Cc,"readSection");function Tc(t,e,{breakingPrefix:n,headings:r}){let i=new Map;t.forEach((c,l)=>{if(/[\n\r]/.test(c.text))throw new Error(`\`entries[${l}].text\` spans more than one line`);let u=Km(c.type,e);if(u===void 0)throw new Error(`\`entries[${l}].type\` names ${c.type}, which the taxonomy does not declare`);i.set(u.key,[...i.get(u.key)??[],c])});let s=new Set(t.map(c=>jm(c.scopes))).size>1;return Wm(e).flatMap(c=>{let l=i.get(c.key);if(l===void 0)return[];let u=l.map(p=>Um(p,n,s));return[`### ${r.get(c.key)??c.key}
|
|
149
|
+
|
|
150
|
+
${u.join(`
|
|
151
|
+
`)}`]}).join(`
|
|
152
|
+
|
|
153
|
+
`)}o(Tc,"renderDetails");function jm(t){return JSON.stringify([...new Set(t)].toSorted())}o(jm,"describeScopeSet");function Km(t,e){return e.types.find(n=>n.key===t)??e.types.find(n=>n.aliases?.includes(t)===!0)}o(Km,"findWorkType");function Vm(t,e){let n=e.indexOf(t);return n===-1?e.length:n}o(Vm,"rankTier");function Um(t,e,n){let r=[...new Set(t.scopes)],i=n&&r.length>0?` ${r.map(a=>`#${a}`).join(", ")}`:"",s=`- ${t.breaking?e:""}${t.text}${i}`;return t.migration===void 0?s:`${s}
|
|
154
|
+
- Migration: ${t.migration}`}o(Um,"renderBullet");function Wm(t){return t.types.map((e,n)=>({index:n,tier:Vm(e.tier,t.tiers),workType:e})).toSorted((e,n)=>e.tier-n.tier||e.index-n.index).map(({workType:e})=>e)}o(Wm,"sortByRank");function Nc(t){let{entries:e,labelMap:n,record:r}=t;if(Object.keys(n.types).length===0&&Object.keys(n.scopes).length===0)return[];let i=r.breaking===!0||e.some(a=>a.breaking),s=[...Oc(n.types,[r.type,...e.map(a=>a.type)]),...i?[Pi]:[],...Oc(n.scopes,[r.scope,...We(e.flatMap(a=>a.scopes.flatMap(c=>he(c))))])];return[...new Set(s)]}o(Nc,"resolveLabels");function Oc(t,e){return e.flatMap(n=>{let r=n?.trim(),i=r===void 0||r==="*"||!Object.hasOwn(t,r)?void 0:t[r];return i===void 0?[]:[i]})}o(Oc,"lookUpLabels");function Pc(t){let e=t.text.split(`
|
|
155
|
+
`),n=t.heading.trim().toLowerCase(),r=-1;for(let[i,s]of e.entries()){if(r===-1){s.startsWith("## ")&&s.slice(3).trim().toLowerCase()===n&&(r=i+1);continue}if(s.startsWith("## "))return Lc(e.slice(r,i))}return r===-1?null:Lc(e.slice(r))}o(Pc,"extractSection");function Lc(t){let e=t.join(`
|
|
156
|
+
`).trim();return e.length>0?e:null}o(Lc,"joinSection");function Dc(t){let{block:e,notices:n}=nh(t),r=t.commits.kind==="read"?eh(t.commits.consolidatedRecord):void 0,i=e?.entries??[],s=i.length===0?Jm({commits:r,labels:t.labels}):Zm(i,t.taxonomy),a=e===void 0?s:$c(s,e.overrides??{},"block_overrides"),{record:c,sources:l}=$c(a,t.overrides,"flags"),u=th(t);n.push(...zm(u,c));let p=oh({blockTitle:e?.title,overrides:t.overrides,pr:t.pr,prTitle:u}),f=sh({prTitle:u,ticketRef:t.ticketRef});return{effective_record:{title:p.value,scope:c.scope??null,type:c.type??null,breaking:c.breaking===!0,ticket_ref:f?.value??null,pr_number:t.pr.number},effective_sources:{title:p.source,scope:l.scope,type:l.type,breaking:l.breaking,ticket_ref:f?.source??null},merge_title:ih({effective:c,prNumber:t.pr.number,template:t.templates.merge,ticketRef:f?.value,title:p.value}),body:Hm(t.pr.body),merge_block:rh({entries:i,prNumber:t.pr.number,ticketRef:f?.value}),entry_count:i.length,sources:{block:e===void 0?null:ah(e),commits:r===void 0?null:_c(r),labels:_c(t.labels),pr_title:u===void 0?null:ch(u)},defects:[...dc(i,t.taxonomy),...Ke(c,t.taxonomy)],notices:n}}o(Dc,"resolveMerge");function $c(t,e,n){return{record:Ye(t.record,e),sources:{breaking:e.breaking===void 0?t.sources.breaking:n,scope:e.scope===void 0?t.sources.scope:n,type:e.type===void 0?t.sources.type:n}}}o($c,"applySourcedOverrides");function Ym(t,e){let n=t.entriesCommit;return t.entries===void 0||t.entries.length===0||n===void 0?!1:n!==""&&e.toLowerCase().startsWith(n.toLowerCase())}o(Ym,"areEntriesFresh");function Jm(t){let e=t.commits===void 0?null:"commits",n=t.labels.type===void 0?t.commits??{}:t.labels,r=t.labels.type===void 0?e:"labels",i=t.labels.scope??t.commits?.scope;return{record:{...n.type!==void 0&&n.breaking===!0&&{breaking:!0},...i!==void 0&&{scope:i},...n.type!==void 0&&{type:n.type}},sources:{breaking:r,scope:t.labels.scope===void 0?e:"labels",type:r}}}o(Jm,"chooseFromLabels");var qc=/^(?:close[ds]?|fix(?:e[ds])?|resolve[ds]?):?$/i,Gm=["scope","type","breaking"];function Hm(t){let e=Pc({heading:"What",text:t.replaceAll(`\r
|
|
157
|
+
`,`
|
|
158
|
+
`)})??"",n=oc(e).split(`
|
|
159
|
+
`);for(;n.length>0&&Xm(n.at(-1)??"");)n.pop();return n.join(`
|
|
160
|
+
`).trim()}o(Hm,"composeBody");function Qm(t,e){return Gm.filter(n=>n==="breaking"?t.breaking===!0!=(e.breaking===!0):t[n]!==e[n])}o(Qm,"findDifferingFields");function zm(t,e){if(t===void 0)return[{kind:"pr-title-unparsed"}];let n=t.type===void 0?[]:Qm(t,e);return n.length===0?[]:[{kind:"pr-title-divergence",fields:n}]}o(zm,"findPullRequestTitleNotices");function Xm(t){let e=t.trim().replace(/\.$/,"").split(/[\s,]+/).filter(i=>i!==""),[n,...r]=e;return n===void 0?!0:qc.test(n)&&r.some(i=>Mc.test(i))&&r.every(i=>i.toLowerCase()==="and"||qc.test(i)||Mc.test(i))}o(Xm,"isDroppedTrailingLine");function Zm(t,e){return{record:$i(Mn(t,e)),sources:{breaking:"block",scope:"block",type:"block"}}}o(Zm,"rankEntries");function eh(t){return t===void 0?{}:{...$i(t),breaking:t.breaking===!0}}o(eh,"readCommitsRecord");function th(t){if(t.templates.pr==="")return;let e=V(B(t.templates.pr),t.pr.title,t.taxonomy);if(e?.title===void 0)return;let n=e.ticketRef===void 0?{}:{ticketRef:e.ticketRef},r=e.type===void 0&&t.templates.commit!==""?V(B(t.templates.commit),e.title,t.taxonomy):e;return r?.type===void 0?{...n,title:e.title}:{...$i(r),...n,breaking:r.breaking===!0,title:r.title??e.title}}o(th,"readPullRequestTitle");function nh(t){let e=[];t.block.kind==="absent"?e.push({kind:"absent-block"}):t.block.kind==="malformed"?e.push({kind:"malformed-block",defect:t.block.defect}):t.block.entriesDefect!==void 0&&e.push({kind:"malformed-entries",defect:t.block.entriesDefect}),t.commits.kind==="unavailable"&&e.push({kind:"commits-unavailable",reason:t.commits.reason});let n=t.block.kind==="read"?t.block.block:void 0;return n!==void 0&&(n.entries?.length??0)>0&&!Ym(n,t.pr.headCommit)&&e.push({kind:"stale-entries",entries_commit:n.entriesCommit??null,head_commit:t.pr.headCommit}),{block:n,notices:e}}o(nh,"readSources");function rh(t){if(t.entries.length===0)return null;let e=Number(t.prNumber);return ic({entries:t.entries,...Number.isSafeInteger(e)&&e>0&&{prNumber:e},...t.ticketRef!==void 0&&{ticketRef:t.ticketRef}})}o(rh,"renderMergeBlock");function ih(t){return t.template===""?t.title:Q(B(t.template),{...t.effective,prNumber:t.prNumber,title:t.title,...t.ticketRef!==void 0&&{ticketRef:t.ticketRef}})}o(ih,"renderMergeTitle");function sh(t){return t.prTitle?.ticketRef!==void 0?{source:"pr_title",value:t.prTitle.ticketRef}:t.ticketRef===void 0?void 0:{source:"flags",value:t.ticketRef}}o(sh,"resolveTicketRef");function oh(t){return t.overrides.title!==void 0?{source:"flags",value:t.overrides.title}:t.prTitle!==void 0?{source:"pr_title",value:t.prTitle.title}:t.blockTitle!==void 0?{source:"block",value:t.blockTitle}:{source:"pr_title_verbatim",value:t.pr.title}}o(oh,"resolveTitle");var Mc=/^(?:(?:[\w.-]+\/[\w.-]+)?#\d+|[A-Z][A-Z\d]*-\d+|https?:\/\/\S+)$/;function ah(t){return{title:t.title,overrides:{...t.overrides},entries_commit:t.entriesCommit??null,entries:t.entries??[]}}o(ah,"toBlockOutcome");function $i(t){return{...t.breaking===!0&&{breaking:!0},...t.scope!==void 0&&{scope:t.scope},...t.type!==void 0&&{type:t.type}}}o($i,"toComparedFields");function ch(t){return{title:t.title,ticket_ref:t.ticketRef??null,scope:t.scope??null,type:t.type??null,breaking:t.breaking??null}}o(ch,"toPullRequestTitleOutcome");function _c(t){return{scope:t.scope??null,type:t.type??null,breaking:t.breaking??null}}o(_c,"toSourceRecordOutcome");import Ii from"node:path";import{existsSync as Bc,readFileSync as ph}from"node:fs";import Fc from"node:path";var jc=Re(Ee(),1);import{globSync as lh}from"node:fs";import Ic from"node:path";var uh="package.json",fh=["**/node_modules/**"];function qi(t,e,n){let r={cwd:t,exclude:[...n,...fh],followSymlinks:!0},s=lh([...e],r).map(a=>Ic.dirname(Ic.resolve(t,a)));return[...new Set(s)].toSorted()}o(qi,"matchPackageDirs");function xc(t,e){let{excludedPatterns:n,includedPatterns:r}=Mi(e);return r.length===0?[]:qi(t,r,n)}o(xc,"resolvePackageDirs");function Mi(t){let e=[],n=[];for(let r of t){if(r.trim()==="")continue;let i=r.startsWith("!");(i?n:e).push(dh(i?r.slice(1):r))}return{excludedPatterns:n,includedPatterns:e}}o(Mi,"splitWorkspacePatterns");function dh(t){return`${t.replace(/\/?$/,"")}/${uh}`}o(dh,"buildManifestPattern");var Kc="pnpm-workspace.yaml";function _i(t){return Bc(Fc.join(t,Kc))}o(_i,"isMonorepoRoot");function Di(t){let e=yh(t);if(e.kind==="absent")return{kind:"not-a-workspace"};if(e.kind==="unreadable")return{cause:"unreadable-manifest",kind:"empty",patterns:[]};let n=hh(e.value);if(n.kind!=="patterns")return{cause:n.kind==="absent"?"no-packages-list":"unreadable-packages",kind:"empty",patterns:[]};let{patterns:r}=n,i=xc(t,r);return i.length>0?{kind:"packages",packageDirs:i,patterns:r}:{cause:mh(t,r),kind:"empty",patterns:r}}o(Di,"resolveWorkspace");function mh(t,e){let{excludedPatterns:n,includedPatterns:r}=Mi(e);return r.length===0?"no-pattern":n.length>0&&qi(t,r,[]).length>0?"all-excluded":"no-package"}o(mh,"diagnoseEmptyCause");function hh(t){if(!gh(t))return{kind:"absent"};let e=t.packages;return e==null?{kind:"absent"}:Array.isArray(e)?e.every(n=>typeof n=="string")?e.length===0?{kind:"absent"}:{kind:"patterns",patterns:e}:{kind:"unreadable"}:{kind:"unreadable"}}o(hh,"readDeclaredPackages");function gh(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(gh,"isObject");function yh(t){let e=Fc.join(t,Kc);if(!Bc(e))return{kind:"absent"};try{return{kind:"parsed",value:(0,jc.parse)(ph(e,"utf8"))}}catch{return{kind:"unreadable"}}}o(yh,"readWorkspaceManifest");var xn=class extends Error{static{o(this,"UserError")}constructor(e){super(e),this.name="UserError"}};var bh="pnpm-workspace.yaml";function Vc(t){let e=Di(t);if(e.kind==="not-a-workspace")throw new xn(`Not a monorepo root: no ${bh} in ${t}`);return e.kind==="packages"?e.packageDirs:[]}o(Vc,"getWorkspacePackageDirs");function Uc(t){return _i(t)?Vc(t):[]}o(Uc,"discoverWorkspaceDirs");function Wc(t){let e=new Map;for(let n of t.packageDirs)e.set(n,{dir:n,name:Ii.basename(n)});for(let n of t.declaredDirs)e.set(n.dir,n);return e.values().toArray()}o(Wc,"mergeScopeDirs");function Yc(t){let e={};for(let n of t.paths)e[n]=kh(n,t.projectRoot,t.scopeDirs);return{pathScopes:e,scopes:new Set(Object.values(e)).values().toArray().toSorted()}}o(Yc,"resolveScopes");function kh(t,e,n){let r=Ii.resolve(e,t),i;for(let s of n){let{dir:a}=s;(r===a||r.startsWith(`${a}${Ii.sep}`))&&(i===void 0||a.length>i.dir.length)&&(i=s)}return i?.name??Ue}o(kh,"resolveScope");async function Jc(t){let{types:e}=await Lt(t.labelMapPath);return In(e,t.labels)}o(Jc,"resolveTicketType");var xi=[{name:"override-breaking",takesValue:!1},{name:"override-scope",takesValue:!0},{name:"override-type",takesValue:!0}],Fn="describe-change",Hc=[{name:"breaking",takesValue:!1},{name:"scope",takesValue:!0},{name:"title",takesValue:!0},{name:"type",takesValue:!0}],Bi={"render-titles":{flags:[...Hc,{name:"pr-number",takesValue:!0},{name:"ticket-ref",takesValue:!0}],read:Bh},"parse-title":{flags:[],read:Dh},"consolidate-branch":{flags:[{name:"base",takesValue:!0}],read:Mh},"consolidate-entries":{flags:[{name:"entries-file",takesValue:!0}],read:_h},"resolve-ticket-type":{flags:[{name:"ticket-label",takesValue:!0}],read:Uh},"resolve-effective-record":{flags:[...Hc,...xi],read:Fh},"render-block":{flags:[...xi,{name:"entries-commit",takesValue:!0},{name:"entries-file",takesValue:!0},{name:"title",takesValue:!0}],read:Ih},"render-details":{flags:[{name:"entries-file",takesValue:!0}],read:xh},"resolve-merge":{flags:[{name:"base",takesValue:!0},{name:"head",takesValue:!0},{name:"no-override-breaking",takesValue:!1},...xi,{name:"override-title",takesValue:!0},{name:"pr-body-file",takesValue:!0},{name:"pr-label",takesValue:!0},{name:"pr-number",takesValue:!0},{name:"pr-title",takesValue:!0},{name:"ticket-ref",takesValue:!0}],read:Kh},"check-merge-body":{flags:[{name:"body-file",takesValue:!0},{name:"entry-count",takesValue:!0}],read:qh},"amend-entry":{flags:[{name:"body-file",takesValue:!0},{name:"breaking",takesValue:!1},{name:"entry",takesValue:!0},{name:"no-breaking",takesValue:!1},{name:"type",takesValue:!0}],read:Ph},"resolve-scopes":{flags:[{name:"path",takesValue:!0}],read:Vh},"resolve-labels":{flags:[{name:"body-file",takesValue:!0},{name:"breaking",takesValue:!1},{name:"scope",takesValue:!0},{name:"type",takesValue:!0}],read:jh}};async function Eh(){try{let{output:t,warnings:e}=await Ch({argv:pe.argv.slice(2),cwd:pe.cwd(),home:Sh()});for(let n of e)pe.stderr.write(`${Fn}: ${n}
|
|
161
|
+
`);pe.stdout.write(`${JSON.stringify(t)}
|
|
162
|
+
`)}catch(t){pe.stderr.write(`${Fn}: ${Te(t)}
|
|
163
|
+
`),pe.exit(1)}}o(Eh,"main");Nh()&&await Eh();function Ah(t){let[e,...n]=t;if(e===void 0||!Lh(e))throw new Error(Rh(e));let{flags:r,read:i}=Bi[e];return i(Ga(n,r))}o(Ah,"parseArgs");async function Ch(t){let e=Ah(t.argv);switch(e.subcommand){case"amend-entry":return Jh(e,t);case"check-merge-body":return Gh(e,t);case"consolidate-branch":return Hh(e.baseRef,t);case"consolidate-entries":return Qh(e.entriesFile,t);case"parse-title":return zh(e.surface,e.subject,t);case"render-block":return Xh(e,t);case"render-details":return Zh(e.entriesFile,t);case"render-titles":return eg(e.record,t);case"resolve-effective-record":return tg(e,t);case"resolve-labels":return ng(e,t);case"resolve-merge":return rg(e.merge,t);case"resolve-scopes":return ig(e.paths,t);case"resolve-ticket-type":return sg(e.ticketLabels,t)}}o(Ch,"runDescribe");function Rh(t){let e=`usage: ${Fn} <subcommand> [flags], where <subcommand> is one of ${Object.keys(Bi).join(", ")}`;return t===void 0?`a subcommand is required; ${e}`:`unknown subcommand ${t}; ${e}`}o(Rh,"buildUsageMessage");async function Th(t){if(t.template==="")return{kind:"unavailable",reason:"commit.title_format is empty, so the commits and the title prefix cannot be read through it"};try{let e=await Li({baseRef:t.args.baseRef,cwd:t.cwd,headRef:t.args.headCommit}),{consolidatedRecord:n}=Oi(e,B(t.template),t.taxonomy);return{...n!==void 0&&{consolidatedRecord:n},kind:"read"}}catch(e){if(e instanceof Nt)return{kind:"unavailable",reason:`the head commit ${e.ref} is not in the local repository`};throw e}}o(Th,"consolidatePullRequestCommits");function Oh(t,e){return Ae.filter(n=>t[n]!=="").flatMap(n=>Un(t[n],e).map(r=>`${n}.title_format: ${r}`))}o(Oh,"findLossyTemplates");function Nh(){let t=pe.argv[1];if(t===void 0)return!1;try{return Gc(vh(import.meta.url))===Gc(t)}catch(e){return pe.stderr.write(`${Fn}: warning: could not determine entry point: ${Te(e)}
|
|
164
|
+
`),!1}}o(Nh,"isEntryPoint");function Lh(t){return Object.hasOwn(Bi,t)}o(Lh,"isSubcommand");async function zc(t){let{projectRoot:e,warning:n}=await Ot(t.cwd),{templates:r,warnings:i}=await kc({home:t.home,projectRoot:e});n!==void 0&&i.unshift(n);let s=await Be(t.dataDir);return s!==null&&(Yh(r,s),i.push(...Oh(r,s))),{projectRoot:e,taxonomy:s,templates:r,warnings:i}}o(zc,"loadTemplates");async function Fi(t,e){let n=await zc(t),{taxonomy:r}=n;if(r===null)throw new Error(`${e}; none is readable ${de(t.dataDir)}`);return{...n,taxonomy:r}}o(Fi,"loadTemplatesWithTaxonomy");function Ph({flags:t,positionals:e}){j(e);let n=Y(t),r=F("amend-entry",n,"entry");if(!/^\d+$/.test(r))throw new Error(`--entry takes the entry\u2019s 0-based index; got ${r}`);let i=new Set(t.filter(l=>l.name==="breaking"||l.name==="no-breaking").map(l=>l.name));if(i.size>1)throw new Error("--breaking and --no-breaking set the marker in opposite directions; pass one");let s=n.type?.trim();if(s==="")throw new Error("--type requires a value");if(s?.endsWith(x)===!0)throw new Error("--type takes a bare type; pass --breaking for a breaking change");let[a]=i,c={...a!==void 0&&{breaking:a==="breaking"},...s!==void 0&&{type:s}};if(Object.keys(c).length===0)throw new Error("amend-entry requires --type, --breaking, or --no-breaking");return{amendment:c,bodyFile:F("amend-entry",n,"body-file"),entryIndex:Number(r),subcommand:"amend-entry"}}o(Ph,"readAmendEntryArgs");async function $h(t,e){let n=me.resolve(t,e),r;try{r=await Pt(n,"utf8")}catch(s){throw _(`--body-file ${n} cannot be read`,s)}let i=Tt(r);return i.kind==="malformed"?{entries:[],warnings:[`the body\u2019s change-record block is malformed, so the entries do not add any label: ${i.defect}`]}:i.kind!=="read"?{entries:[],warnings:[]}:i.entriesDefect!==void 0?{entries:[],warnings:[`the body\u2019s change entries are malformed, so the entries do not add any label: ${i.entriesDefect}`]}:{entries:i.block.entries??[],warnings:[]}}o($h,"readBodyEntries");function qh({flags:t,positionals:e}){j(e);let n=Y(t),r=F("check-merge-body",n,"entry-count");if(!/^\d+$/.test(r))throw new Error(`--entry-count takes a non-negative integer; got ${r}`);return{bodyFile:F("check-merge-body",n,"body-file"),entryCount:Number(r),subcommand:"check-merge-body"}}o(qh,"readCheckMergeBodyArgs");function Mh({flags:t,positionals:e}){return j(e),{baseRef:F("consolidate-branch",Y(t),"base"),subcommand:"consolidate-branch"}}o(Mh,"readConsolidateBranchArgs");function _h({flags:t,positionals:e}){return j(e),{entriesFile:F("consolidate-entries",Y(t),"entries-file"),subcommand:"consolidate-entries"}}o(_h,"readConsolidateEntriesArgs");async function ji(t){let e=me.resolve(t.cwd,t.filePath),n;try{n=await Pt(e,"utf8")}catch(c){throw _(`--entries-file ${e} cannot be read`,c)}let r=(0,Qc.parseDocument)(n),[i]=r.errors;if(i!==void 0)throw _(`--entries-file ${e} is not valid YAML`,i);let s=_n(r.contents);if(s!==void 0)throw new Error(`--entries-file ${e} is malformed: ${s.defect}`);let a=Rt(r.toJS());if("defect"in a)throw new Error(`--entries-file ${e} is malformed: ${a.defect}`);return a.entries}o(ji,"readEntriesFile");function Xc(t){let e=Y(t),n=e["override-scope"]?.trim(),r=Zc(e);return{...t.some(i=>i.name==="override-breaking")&&{breaking:!0},...n!==void 0&&n!==""&&{scope:n},...r!==void 0&&r!==""&&{type:r}}}o(Xc,"readOverrideFlags");function Zc(t){let e=t["override-type"]?.trim();if(e?.endsWith(x)===!0)throw new Error("--override-type takes a bare type; pass --override-breaking for a breaking change");return e}o(Zc,"readOverrideType");function Dh({positionals:t}){let[e,n]=t;if(e===void 0||n===void 0)throw new Error("parse-title takes the surface and the subject string to read");if(!hc(e))throw new Error(`parse-title must name one of ${Ae.join(", ")}`);return j(t.slice(2)),{subcommand:"parse-title",subject:n,surface:e}}o(Dh,"readParseTitleArgs");function Ki(t){let e=Y(t);return{...t.some(n=>n.name==="breaking")&&{breaking:!0},...e["pr-number"]!==void 0&&{prNumber:e["pr-number"]},...e.scope!==void 0&&{scope:e.scope},...e["ticket-ref"]!==void 0&&{ticketRef:e["ticket-ref"]},...e.title!==void 0&&{title:e.title},...e.type!==void 0&&{type:e.type}}}o(Ki,"readRecordFlags");function Ih({flags:t,positionals:e}){j(e);let n=Y(t),r=F("render-block",n,"title"),i=Xc(t);for(let c of["entries-commit","entries-file"])if(n[c]?.trim()==="")throw new Error(`--${c} requires a value`);let s=n["entries-commit"]?.trim(),a=n["entries-file"]?.trim();if(s!==void 0&&a===void 0)throw new Error("--entries-commit records the commit at which the entries were derived; pass --entries-file too");return{block:{overrides:i,title:r,...s!==void 0&&{entriesCommit:s}},...a!==void 0&&{entriesFile:a},subcommand:"render-block"}}o(Ih,"readRenderBlockArgs");function xh({flags:t,positionals:e}){return j(e),{entriesFile:F("render-details",Y(t),"entries-file"),subcommand:"render-details"}}o(xh,"readRenderDetailsArgs");function Bh({flags:t,positionals:e}){return j(e),{record:Ki(t),subcommand:"render-titles"}}o(Bh,"readRenderTitlesArgs");function Vi(t,e){return t.flatMap(n=>n.name===e&&n.value!==null?[n.value]:[])}o(Vi,"readRepeatedValues");function F(t,e,n){let r=e[n]?.trim();if(r===void 0||r==="")throw new Error(`${t} requires --${n}`);return r}o(F,"readRequiredValue");function Fh({flags:t,positionals:e}){return j(e),{overrides:Xc(t),record:Ki(t),subcommand:"resolve-effective-record"}}o(Fh,"readResolveEffectiveRecordArgs");function jh({flags:t,positionals:e}){j(e);let n=Y(t)["body-file"]?.trim();if(n==="")throw new Error("--body-file requires a value");return{...n!==void 0&&{bodyFile:n},record:Ki(t),subcommand:"resolve-labels"}}o(jh,"readResolveLabelsArgs");function Kh({flags:t,positionals:e}){j(e);let n=Y(t),r=F("resolve-merge",n,"base"),i=F("resolve-merge",n,"pr-number");if(!/^\d+$/.test(i))throw new Error(`--pr-number takes the pull request\u2019s number; got ${i}`);let s=new Set(t.filter(h=>h.name.endsWith("override-breaking")).map(h=>h.name));if(s.size>1)throw new Error("--override-breaking and --no-override-breaking set the marker in opposite directions; pass one");for(let h of["override-scope","override-title","override-type","ticket-ref"])if(n[h]?.trim()==="")throw new Error(`--${h} requires a value`);let a=Zc(n),[c]=s,l=n["override-scope"]?.trim(),u=n["override-title"]?.trim(),p=n["ticket-ref"]?.trim(),f={...c!==void 0&&{breaking:c==="override-breaking"},...l!==void 0&&{scope:l},...u!==void 0&&{title:u},...a!==void 0&&{type:a}};return{merge:{baseRef:r,headCommit:F("resolve-merge",n,"head"),overrides:f,prBodyFile:F("resolve-merge",n,"pr-body-file"),prLabels:Vi(t,"pr-label"),prNumber:i,prTitle:F("resolve-merge",n,"pr-title"),...p!==void 0&&{ticketRef:p}},subcommand:"resolve-merge"}}o(Kh,"readResolveMergeArgs");function Vh({flags:t,positionals:e}){return j(e),{paths:Vi(t,"path"),subcommand:"resolve-scopes"}}o(Vh,"readResolveScopesArgs");function Uh({flags:t,positionals:e}){return j(e),{subcommand:"resolve-ticket-type",ticketLabels:Vi(t,"ticket-label")}}o(Uh,"readResolveTicketTypeArgs");function Wh(t,e,n,r){if(e==="")throw new Error(`${t}.title_format is empty, so a ${t} subject cannot be read back`);let i=V(B(e),n,r);return i===void 0?{matched:!1}:{breaking:i.breaking===!0,matched:!0,pr_number:i.prNumber??null,scope:i.scope??null,ticket_ref:i.ticketRef??null,title:i.title??null,type:i.type??null}}o(Wh,"readSubject");function j(t){if(t[0]!==void 0)throw new Error(`unexpected argument: ${t[0]}`)}o(j,"refusePositionals");function Yh(t,e){let n=[];for(let r of Ae){let i=t[r];i!==""&&n.push(...Wn(i,e).map(s=>`${r}.title_format: ${s}`))}if(n.length>0)throw new Error(n.join(`
|
|
165
|
+
`))}o(Yh,"refuseUnverifiableTemplates");function Bn(t,e){return t===""?"":Q(B(t),e)}o(Bn,"renderTemplate");async function Jh(t,e){let n=await Be(e.dataDir);if(n===null)throw new Error(`amend-entry checks the amended type against the taxonomy; none is readable ${de(e.dataDir)}`);let r=me.resolve(e.cwd,t.bodyFile),i;try{i=await Pt(r,"utf8")}catch(c){throw _(`--body-file ${r} cannot be read`,c)}let s=mc({amendment:t.amendment,body:i,index:t.entryIndex,taxonomy:n});try{await wh(r,s.body,"utf8")}catch(c){throw _(`--body-file ${r} cannot be written`,c)}return{output:{entry:s.entry,entry_count:s.entryCount},warnings:[]}}o(Jh,"runAmendEntry");async function Gh(t,e){let n=me.resolve(e.cwd,t.bodyFile),r;try{r=await Pt(n,"utf8")}catch(c){throw _(`--body-file ${n} cannot be read`,c)}let i=rc(r);if(i.kind==="malformed")throw new Error(`the merge body's change-record block is malformed: ${i.defect}`);if(i.kind==="read"&&t.entryCount===0)throw new Error("the merge body contains a change-record block, but the expected entry count is 0");let s=i.kind==="absent"?0:i.block.entries.length;if(s!==t.entryCount)throw new Error(`the merge body records ${s} change entries; expected ${t.entryCount}`);return{output:{entry_count:s},warnings:[]}}o(Gh,"runCheckMergeBody");async function Hh(t,e){let{projectRoot:n,taxonomy:r,templates:i,warnings:s}=await Fi(e,"consolidate-branch ranks types against the taxonomy");if(i.commit==="")throw new Error("commit.title_format is empty, so a branch\u2019s commits cannot be read back");let a=await Li({baseRef:t,cwd:n}),c=B(i.commit),l=Oi(a,c,r),{consolidatedRecord:u}=l;return{output:{entries:l.entries.map(f=>({breaking:f.record.breaking===!0,change:Q(c,f.record),commit:f.commit,scope:f.record.scope??null,title:f.record.title??null,type:f.record.type??null})),consolidated_record:u===void 0?{breaking:null,scope:null,type:null}:{breaking:u.breaking===!0,scope:u.scope??null,type:u.type??null},unmatched:l.unmatched,violations:l.violations},warnings:s}}o(Hh,"runConsolidateBranch");async function Qh(t,e){let n=await Be(e.dataDir);if(n===null)throw new Error(`consolidate-entries ranks types against the taxonomy; none is readable ${de(e.dataDir)}`);let r=await ji({cwd:e.cwd,filePath:t}),i=Mn(r,n);return{output:{consolidated_record:r.length===0?{breaking:null,scope:null,type:null}:{breaking:i.breaking===!0,scope:i.scope??null,type:i.type??null}},warnings:[]}}o(Qh,"runConsolidateEntries");async function zh(t,e,n){let{taxonomy:r,templates:i,warnings:s}=await Fi(n,"parse-title resolves the type against the taxonomy");return{output:Wh(t,i[t],e,r),warnings:s}}o(zh,"runParseTitle");async function Xh(t,e){let n=t.entriesFile===void 0?[]:await ji({cwd:e.cwd,filePath:t.entriesFile}),r={...t.block,...n.length>0&&{entries:n}};return{output:{block:Dn(r)},warnings:[]}}o(Xh,"runRenderBlock");async function Zh(t,e){let n=await Be(e.dataDir),r=await Za(e.dataDir);if(n===null)throw new Error(`render-details orders and heads the entries by the taxonomy; none is readable ${de(e.dataDir)}`);if(r===null)throw new Error(`render-details heads the entries by the taxonomy; the one ${de(e.dataDir)} lacks an \`emoji\` or \`label\` for \`markers.breaking\` or a type`);let i=await ji({cwd:e.cwd,filePath:t});return{output:{details:Tc(i,n,r)},warnings:[]}}o(Zh,"runRenderDetails");async function eg(t,e){let{taxonomy:n,templates:r,warnings:i}=await zc(e);return n===null&&i.push(`work-types.json is missing or unreadable ${de(e.dataDir)}; templates are not verified`),{output:{commit_title:Bn(r.commit,t),ticket_title:Bn(r.ticket,t),pr_title:Bn(r.pr,t),merge_title:Bn(r.merge,t)},warnings:i}}o(eg,"runRenderTitles");async function tg(t,e){let n=await Be(e.dataDir);if(n===null)throw new Error(`resolve-effective-record checks types against the taxonomy; none is readable ${de(e.dataDir)}`);let r=Ye(J(t.record),t.overrides);return{output:{effective_record:{title:r.title??null,scope:r.scope??null,type:r.type??null,breaking:r.breaking===!0,ticket_ref:null,pr_number:null},defects:Ke(r,n)},warnings:[]}}o(tg,"runResolveEffectiveRecord");async function ng(t,e){let{projectRoot:n,warning:r}=await Ot(e.cwd),i=t.bodyFile===void 0?{entries:[],warnings:[]}:await $h(e.cwd,t.bodyFile),s=[...r===void 0?[]:[r],...i.warnings],a=await Lt(me.join(n,".meta","label-map.json"));return{output:{labels:Nc({entries:i.entries,labelMap:a,record:J(t.record)})},warnings:s}}o(ng,"runResolveLabels");async function rg(t,e){let{projectRoot:n,taxonomy:r,templates:i,warnings:s}=await Fi(e,"resolve-merge checks types against the taxonomy"),a=me.resolve(e.cwd,t.prBodyFile),c;try{c=await Pt(a,"utf8")}catch(f){throw _(`--pr-body-file ${a} cannot be read`,f)}let l=await Lt(me.join(n,".meta","label-map.json")),u=await Th({args:t,cwd:n,taxonomy:r,template:i.commit});return{output:Dc({block:Tt(c),commits:u,labels:Rc(l,t.prLabels),overrides:t.overrides,pr:{body:c,headCommit:t.headCommit,number:t.prNumber,title:t.prTitle},taxonomy:r,templates:i,...t.ticketRef!==void 0&&{ticketRef:t.ticketRef}}),warnings:s}}o(rg,"runResolveMerge");async function ig(t,e){let{projectRoot:n,warning:r}=await Ot(e.cwd),i=await Ac(n),s=Wc({declaredDirs:i.scopeDirs,packageDirs:Uc(n)}),{pathScopes:a,scopes:c}=Yc({paths:t,projectRoot:n,scopeDirs:s}),l=[...r===void 0?[]:[r],...i.warnings];return{output:{path_scopes:a,scopes:c},warnings:l}}o(ig,"runResolveScopes");async function sg(t,e){let{projectRoot:n,warning:r}=await Ot(e.cwd);return{output:{ticket_type:await Jc({labelMapPath:me.join(n,".meta","label-map.json"),labels:t})??null},warnings:r===void 0?[]:[r]}}o(sg,"runResolveTicketType");export{Bi as SUBCOMMANDS,Ah as parseArgs,Ch as runDescribe};
|