codeassembly-guidance 0.0.0 → 0.2.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 +1320 -0
- package/CHANGELOG.md +315 -0
- package/LICENSE +7 -0
- package/README.md +195 -1
- package/bin/codeassembly-validate-preferences.js +18 -0
- 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 +70 -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 +6 -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 +59 -0
- package/content/collections/all.md +11 -0
- package/content/collections/atlassian.md +17 -0
- package/content/collections/recommended.md +41 -0
- package/content/collections/triage.md +13 -0
- package/content/collections/williamthorsen.md +26 -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 +38 -0
- package/content/guidance/rulebooks/cli-conventions.md +192 -0
- package/content/guidance/rulebooks/codeassembly-content-specification.md +184 -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 +19 -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 +273 -0
- package/content/guidance/rulebooks/ui-copy-conventions.md +34 -0
- package/content/guidance/rulebooks/williamthorsen-code-layout-preferences.md +102 -0
- package/content/guidance/rulebooks/williamthorsen-collaboration-preferences.md +60 -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 +51 -0
- package/content/scripts/README.md +44 -0
- package/content/scripts/check-branch-currency.mjs +11 -0
- package/content/scripts/check-prose.mjs +171 -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 +214 -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/scripts/validate-preferences.mjs +146 -0
- package/content/skills/_data/action-items.md +83 -0
- package/content/skills/_data/artifact-conventions.md +1001 -0
- package/content/skills/_data/bitbucket-pr-access.md +89 -0
- package/content/skills/_data/branch-currency.md +36 -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/project-stage.md +32 -0
- package/content/skills/_data/recommendation-gradient.md +92 -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 +180 -0
- package/content/skills/_data/title-templates.md +632 -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/jira-task-list-flattening.md +1 -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 +85 -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/assess-usability/SKILL.md +96 -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 +121 -0
- package/content/skills/create-pr/SKILL.md +150 -0
- package/content/skills/create-ticket/SKILL.md +395 -0
- package/content/skills/create-ticket/resolve-ticket-target.mjs +143 -0
- package/content/skills/derive-session-context/derive-session-context.mjs +149 -0
- package/content/skills/design-and-plan/SKILL.md +197 -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 +247 -0
- package/content/skills/groom-backlog/groom-backlog.mjs +108 -0
- package/content/skills/implement-plan/SKILL.md +168 -0
- package/content/skills/index-prototypes/SKILL.md +200 -0
- package/content/skills/index-prototypes/index-prototypes.mjs +388 -0
- package/content/skills/kb-add/SKILL.md +157 -0
- package/content/skills/kb-add/kb-add.mjs +216 -0
- package/content/skills/kb-curate/SKILL.md +119 -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 +207 -0
- package/content/skills/kb-retrieve-events/SKILL.md +98 -0
- package/content/skills/kb-retrieve-events/kb-retrieve-events.mjs +207 -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 +137 -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 +178 -0
- package/content/skills/pull-from-backlog/SKILL.md +83 -0
- package/content/skills/pull-from-backlog/pull-from-backlog.mjs +209 -0
- package/content/skills/refine-plan/SKILL.md +263 -0
- package/content/skills/refine-prototype/SKILL.md +113 -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 +303 -0
- package/content/skills/review-criteria/SKILL.md +141 -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 +148 -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 +71 -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 +317 -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 +235 -0
- package/content/skills/triage-spike-findings/SKILL.md +113 -0
- package/content/skills/triage-spike-findings/triage-spike-findings.mjs +71 -0
- package/content/skills/typescript-testing-conventions/SKILL.md +178 -0
- package/content/skills/update-jira-ticket/SKILL.md +257 -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 +25 -0
- package/content/subagents/_data/rovo.yaml +41 -0
- package/content/subagents/canary.md +12 -0
- package/content/subagents/disposition-challenger.md +78 -0
- package/content/subagents/entry-drafter.md +191 -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 +132 -0
- package/content/subagents/ticket-assessor.md +142 -0
- package/content/subagents/usability-assessor.md +157 -0
- package/package.json +74 -2
- package/schemas/preferences.v1.json +321 -0
- package/schemas/work-types.v1.json +142 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { createRequire as __cjsCreateRequire } from 'node:module';
|
|
2
|
+
const require = __cjsCreateRequire(import.meta.url);
|
|
3
|
+
var vl=Object.create;var Cn=Object.defineProperty;var El=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var kl=Object.getPrototypeOf,Nl=Object.prototype.hasOwnProperty;var a=(n,e)=>Cn(n,"name",{value:e,configurable:!0}),yt=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var y=(n,e)=>()=>{try{return e||n((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var Ol=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Al(e))!Nl.call(n,i)&&i!==t&&Cn(n,i,{get:()=>e[i],enumerable:!(s=El(e,i))||s.enumerable});return n};var Cl=(n,e,t)=>(t=n!=null?vl(kl(n)):{},Ol(e||!n||!n.__esModule?Cn(t,"default",{value:n,enumerable:!0}):t,n));var O=y(q=>{"use strict";var Tn=Symbol.for("yaml.alias"),Mi=Symbol.for("yaml.document"),wt=Symbol.for("yaml.map"),Di=Symbol.for("yaml.pair"),In=Symbol.for("yaml.scalar"),vt=Symbol.for("yaml.seq"),W=Symbol.for("yaml.node.type"),Kl=a(n=>!!n&&typeof n=="object"&&n[W]===Tn,"isAlias"),Fl=a(n=>!!n&&typeof n=="object"&&n[W]===Mi,"isDocument"),Ul=a(n=>!!n&&typeof n=="object"&&n[W]===wt,"isMap"),Vl=a(n=>!!n&&typeof n=="object"&&n[W]===Di,"isPair"),xi=a(n=>!!n&&typeof n=="object"&&n[W]===In,"isScalar"),Wl=a(n=>!!n&&typeof n=="object"&&n[W]===vt,"isSeq");function $i(n){if(n&&typeof n=="object")switch(n[W]){case wt:case vt:return!0}return!1}a($i,"isCollection");function Yl(n){if(n&&typeof n=="object")switch(n[W]){case Tn:case wt:case In:case vt:return!0}return!1}a(Yl,"isNode");var Jl=a(n=>(xi(n)||$i(n))&&!!n.anchor,"hasAnchor");q.ALIAS=Tn;q.DOC=Mi;q.MAP=wt;q.NODE_TYPE=W;q.PAIR=Di;q.SCALAR=In;q.SEQ=vt;q.hasAnchor=Jl;q.isAlias=Kl;q.isCollection=$i;q.isDocument=Fl;q.isMap=Ul;q.isNode=Yl;q.isPair=Vl;q.isScalar=xi;q.isSeq=Wl});var xe=y(Pn=>{"use strict";var R=O(),_=Symbol("break visit"),Bi=Symbol("skip children"),K=Symbol("remove node");function Et(n,e){let t=ji(e);R.isDocument(n)?we(null,n.contents,t,Object.freeze([n]))===K&&(n.contents=null):we(null,n,t,Object.freeze([]))}a(Et,"visit");Et.BREAK=_;Et.SKIP=Bi;Et.REMOVE=K;function we(n,e,t,s){let i=Ki(n,e,t,s);if(R.isNode(i)||R.isPair(i))return Fi(n,s,i),we(n,i,t,s);if(typeof i!="symbol"){if(R.isCollection(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=we(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===_)return _;o===K&&(e.items.splice(r,1),r-=1)}}}else if(R.isPair(e)){s=Object.freeze(s.concat(e));let r=we("key",e.key,t,s);if(r===_)return _;r===K&&(e.key=null);let o=we("value",e.value,t,s);if(o===_)return _;o===K&&(e.value=null)}}return i}a(we,"visit_");async function At(n,e){let t=ji(e);R.isDocument(n)?await ve(null,n.contents,t,Object.freeze([n]))===K&&(n.contents=null):await ve(null,n,t,Object.freeze([]))}a(At,"visitAsync");At.BREAK=_;At.SKIP=Bi;At.REMOVE=K;async function ve(n,e,t,s){let i=await Ki(n,e,t,s);if(R.isNode(i)||R.isPair(i))return Fi(n,s,i),ve(n,i,t,s);if(typeof i!="symbol"){if(R.isCollection(e)){s=Object.freeze(s.concat(e));for(let r=0;r<e.items.length;++r){let o=await ve(r,e.items[r],t,s);if(typeof o=="number")r=o-1;else{if(o===_)return _;o===K&&(e.items.splice(r,1),r-=1)}}}else if(R.isPair(e)){s=Object.freeze(s.concat(e));let r=await ve("key",e.key,t,s);if(r===_)return _;r===K&&(e.key=null);let o=await ve("value",e.value,t,s);if(o===_)return _;o===K&&(e.value=null)}}return i}a(ve,"visitAsync_");function ji(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}a(ji,"initVisitor");function Ki(n,e,t,s){if(typeof t=="function")return t(n,e,s);if(R.isMap(e))return t.Map?.(n,e,s);if(R.isSeq(e))return t.Seq?.(n,e,s);if(R.isPair(e))return t.Pair?.(n,e,s);if(R.isScalar(e))return t.Scalar?.(n,e,s);if(R.isAlias(e))return t.Alias?.(n,e,s)}a(Ki,"callVisitor");function Fi(n,e,t){let s=e[e.length-1];if(R.isCollection(s))s.items[n]=t;else if(R.isPair(s))n==="key"?s.key=t:s.value=t;else if(R.isDocument(s))s.contents=t;else{let i=R.isAlias(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}a(Fi,"replaceNode");Pn.visit=Et;Pn.visitAsync=At});var Ln=y(Vi=>{"use strict";var Ui=O(),Hl=xe(),Gl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ql=a(n=>n.replace(/[!,[\]{}]/g,e=>Gl[e]),"escapeTagName"),$e=class n{static{a(this,"Directives")}constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},n.defaultYaml,e),this.tags=Object.assign({},n.defaultTags,t)}clone(){let e=new n(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new n(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:n.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},n.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:n.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},n.defaultTags),this.atNextDocument=!1);let s=e.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;let[r,o]=s;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let o=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,s,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return s==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,s]of Object.entries(this.tags))if(e.startsWith(s))return t+Ql(e.substring(s.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags),i;if(e&&s.length>0&&Ui.isNode(e.contents)){let r={};Hl.visit(e.contents,(o,l)=>{Ui.isNode(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of s)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
4
|
+
`)}};$e.defaultYaml={explicit:!1,version:"1.2"};$e.defaultTags={"!!":"tag:yaml.org,2002:"};Vi.Directives=$e});var kt=y(Be=>{"use strict";var Wi=O(),Xl=xe();function zl(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}a(zl,"anchorIsValid");function Yi(n){let e=new Set;return Xl.visit(n,{Value(t,s){s.anchor&&e.add(s.anchor)}}),e}a(Yi,"anchorNames");function Ji(n,e){for(let t=1;;++t){let s=`${n}${t}`;if(!e.has(s))return s}}a(Ji,"findNewAnchor");function Zl(n,e){let t=[],s=new Map,i=null;return{onAnchor:a(r=>{t.push(r),i??(i=Yi(n));let o=Ji(e,i);return i.add(o),o},"onAnchor"),setAnchors:a(()=>{for(let r of t){let o=s.get(r);if(typeof o=="object"&&o.anchor&&(Wi.isScalar(o.node)||Wi.isCollection(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},"setAnchors"),sourceObjects:s}}a(Zl,"createNodeAnchors");Be.anchorIsValid=zl;Be.anchorNames=Yi;Be.createNodeAnchors=Zl;Be.findNewAnchor=Ji});var Rn=y(Hi=>{"use strict";function je(n,e,t,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;i<r;++i){let o=s[i],l=je(n,s,String(i),o);l===void 0?delete s[i]:l!==o&&(s[i]=l)}else if(s instanceof Map)for(let i of Array.from(s.keys())){let r=s.get(i),o=je(n,s,i,r);o===void 0?s.delete(i):o!==r&&s.set(i,o)}else if(s instanceof Set)for(let i of Array.from(s)){let r=je(n,s,i,i);r===void 0?s.delete(i):r!==i&&(s.delete(i),s.add(r))}else for(let[i,r]of Object.entries(s)){let o=je(n,s,i,r);o===void 0?delete s[i]:o!==r&&(s[i]=o)}return n.call(e,t,s)}a(je,"applyReviver");Hi.applyReviver=je});var Q=y(Qi=>{"use strict";var ec=O();function Gi(n,e,t){if(Array.isArray(n))return n.map((s,i)=>Gi(s,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!ec.hasAnchor(n))return n.toJSON(e,t);let s={aliasCount:0,count:1,res:void 0};t.anchors.set(n,s),t.onCreate=r=>{s.res=r,delete t.onCreate};let i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}a(Gi,"toJS");Qi.toJS=Gi});var Nt=y(zi=>{"use strict";var tc=Rn(),Xi=O(),nc=Q(),qn=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,Xi.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:t,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!Xi.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=nc.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:u}of o.anchors.values())i(u,c);return typeof r=="function"?tc.applyReviver(r,{"":l},"",l):l}};zi.NodeBase=qn});var Ke=y(Zi=>{"use strict";var sc=kt(),ic=xe(),Ee=O(),rc=Nt(),oc=Q(),_n=class extends rc.NodeBase{static{a(this,"Alias")}constructor(e){super(Ee.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let s;t?.aliasResolveCache?s=t.aliasResolveCache:(s=[],ic.visit(e,{Node:a((r,o)=>{(Ee.isAlias(o)||Ee.hasAnchor(o))&&s.push(o)},"Node")}),t&&(t.aliasResolveCache=s));let i;for(let r of s){if(r===this)break;r.anchor===this.source&&(i=r)}if(i&&t){let{anchors:r,doc:o,maxAliasCount:l}=t,c=r.get(i);if(c||(oc.toJS(i,null,t),c=r.get(i)),c?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(l>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Ot(o,i,r)),c.count*c.aliasCount>l)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}}return i}toJSON(e,t){if(!t)return{source:this.source};let s=this.resolve(t.doc,t);if(!s){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return t.anchors.get(s).res}toString(e,t,s){let i=`*${this.source}`;if(e){if(sc.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${i} `}return i}};function Ot(n,e,t){if(Ee.isAlias(e)){let s=e.resolve(n),i=t&&s&&t.get(s);return i?i.count*i.aliasCount:0}else if(Ee.isCollection(e)){let s=0;for(let i of e.items){let r=Ot(n,i,t);r>s&&(s=r)}return s}else if(Ee.isPair(e)){let s=Ot(n,e.key,t),i=Ot(n,e.value,t);return Math.max(s,i)}return 1}a(Ot,"getAliasCount");Zi.Alias=_n});var I=y(Mn=>{"use strict";var ac=O(),lc=Nt(),cc=Q(),uc=a(n=>!n||typeof n!="function"&&typeof n!="object","isScalarValue"),X=class extends lc.NodeBase{static{a(this,"Scalar")}constructor(e){super(ac.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:cc.toJS(this.value,e,t)}toString(){return String(this.value)}};X.BLOCK_FOLDED="BLOCK_FOLDED";X.BLOCK_LITERAL="BLOCK_LITERAL";X.PLAIN="PLAIN";X.QUOTE_DOUBLE="QUOTE_DOUBLE";X.QUOTE_SINGLE="QUOTE_SINGLE";Mn.Scalar=X;Mn.isScalarValue=uc});var Fe=y(tr=>{"use strict";var fc=Ke(),ce=O(),er=I(),dc="tag:yaml.org,2002:";function hc(n,e,t){if(e){let s=t.filter(r=>r.tag===e),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(s=>s.identify?.(n)&&!s.format)}a(hc,"findTagObject");function pc(n,e,t){if(ce.isDocument(n)&&(n=n.contents),ce.isNode(n))return n;if(ce.isPair(n)){let f=t.schema[ce.MAP].createNode?.(t.schema,null,t);return f.items.push(n),f}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());let{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t,c;if(s&&n&&typeof n=="object"){if(c=l.get(n),c)return c.anchor??(c.anchor=i(n)),new fc.Alias(c.anchor);c={anchor:null,node:null},l.set(n,c)}e?.startsWith("!!")&&(e=dc+e.slice(2));let u=hc(n,e,o.tags);if(!u){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){let f=new er.Scalar(n);return c&&(c.node=f),f}u=n instanceof Map?o[ce.MAP]:Symbol.iterator in Object(n)?o[ce.SEQ]:o[ce.MAP]}r&&(r(u),delete t.onTagObj);let p=u?.createNode?u.createNode(t.schema,n,t):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(t.schema,n,t):new er.Scalar(n);return e?p.tag=e:u.default||(p.tag=u.tag),c&&(c.node=p),p}a(pc,"createNode");tr.createNode=pc});var Tt=y(Ct=>{"use strict";var mc=Fe(),F=O(),gc=Nt();function Dn(n,e,t){let s=t;for(let i=e.length-1;i>=0;--i){let r=e[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let o=[];o[r]=s,s=o}else s=new Map([[r,s]])}return mc.createNode(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:n,sourceObjects:new Map})}a(Dn,"collectionFromPath");var nr=a(n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done,"isEmptyPath"),xn=class extends gc.NodeBase{static{a(this,"Collection")}constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(s=>F.isNode(s)||F.isPair(s)?s.clone(e):s),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(nr(e))this.add(t);else{let[s,...i]=e,r=this.get(s,!0);if(F.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(s,Dn(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(e){let[t,...s]=e;if(s.length===0)return this.delete(t);let i=this.get(t,!0);if(F.isCollection(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${s}`)}getIn(e,t){let[s,...i]=e,r=this.get(s,!0);return i.length===0?!t&&F.isScalar(r)?r.value:r:F.isCollection(r)?r.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!F.isPair(t))return!1;let s=t.value;return s==null||e&&F.isScalar(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(e){let[t,...s]=e;if(s.length===0)return this.has(t);let i=this.get(t,!0);return F.isCollection(i)?i.hasIn(s):!1}setIn(e,t){let[s,...i]=e;if(i.length===0)this.set(s,t);else{let r=this.get(s,!0);if(F.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(s,Dn(this.schema,i,t));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};Ct.Collection=xn;Ct.collectionFromPath=Dn;Ct.isEmptyPath=nr});var Ue=y(It=>{"use strict";var yc=a(n=>n.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function $n(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}a($n,"indentComment");var bc=a((n,e,t)=>n.endsWith(`
|
|
5
|
+
`)?$n(t,e):t.includes(`
|
|
6
|
+
`)?`
|
|
7
|
+
`+$n(t,e):(n.endsWith(" ")?"":" ")+t,"lineComment");It.indentComment=$n;It.lineComment=bc;It.stringifyComment=yc});var ir=y(Ve=>{"use strict";var Sc="flow",Bn="block",Pt="quoted";function wc(n,e,t="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return n;i<r&&(r=0);let c=Math.max(1+r,1+i-e.length);if(n.length<=c)return n;let u=[],p={},f=i-e.length;typeof s=="number"&&(s>i-Math.max(2,r)?u.push(0):f=i-s);let d,g,b=!1,h=-1,m=-1,w=-1;t===Bn&&(h=sr(n,h,e.length),h!==-1&&(f=h+c));for(let E;E=n[h+=1];){if(t===Pt&&E==="\\"){switch(m=h,n[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}w=h}if(E===`
|
|
8
|
+
`)t===Bn&&(h=sr(n,h,e.length)),f=h+e.length+c,d=void 0;else{if(E===" "&&g&&g!==" "&&g!==`
|
|
9
|
+
`&&g!==" "){let A=n[h+1];A&&A!==" "&&A!==`
|
|
10
|
+
`&&A!==" "&&(d=h)}if(h>=f)if(d)u.push(d),f=d+c,d=void 0;else if(t===Pt){for(;g===" "||g===" ";)g=E,E=n[h+=1],b=!0;let A=h>w+1?h-2:m-1;if(p[A])return n;u.push(A),p[A]=!0,f=A+c,d=void 0}else b=!0}g=E}if(b&&l&&l(),u.length===0)return n;o&&o();let v=n.slice(0,u[0]);for(let E=0;E<u.length;++E){let A=u[E],k=u[E+1]||n.length;A===0?v=`
|
|
11
|
+
${e}${n.slice(0,k)}`:(t===Pt&&p[A]&&(v+=`${n[A]}\\`),v+=`
|
|
12
|
+
${e}${n.slice(A+1,k)}`)}return v}a(wc,"foldFlowLines");function sr(n,e,t){let s=e,i=e+1,r=n[i];for(;r===" "||r===" ";)if(e<i+t)r=n[++e];else{do r=n[++e];while(r&&r!==`
|
|
13
|
+
`);s=e,i=e+1,r=n[i]}return s}a(sr,"consumeMoreIndentedLines");Ve.FOLD_BLOCK=Bn;Ve.FOLD_FLOW=Sc;Ve.FOLD_QUOTED=Pt;Ve.foldFlowLines=wc});var Ye=y(rr=>{"use strict";var $=I(),z=ir(),Rt=a((n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),"getFoldOptions"),qt=a(n=>/^(%|---|\.\.\.)/m.test(n),"containsDocumentMarker");function vc(n,e,t){if(!e||e<0)return!1;let s=e-t,i=n.length;if(i<=s)return!1;for(let r=0,o=0;r<i;++r)if(n[r]===`
|
|
14
|
+
`){if(r-o>s)return!0;if(o=r+1,i-o<=s)return!1}return!0}a(vc,"lineLengthOverLimit");function We(n,e){let t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:s}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(qt(n)?" ":""),o="",l=0;for(let c=0,u=t[c];u;u=t[++c])if(u===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(t[c+1]){case"u":{o+=t.slice(l,c);let p=t.substr(c+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=t.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||t[c+2]==='"'||t.length<i)c+=1;else{for(o+=t.slice(l,c)+`
|
|
15
|
+
|
|
16
|
+
`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)o+=`
|
|
17
|
+
`,c+=2;o+=r,t[c+2]===" "&&(o+="\\"),c+=1,l=c+1}break;default:c+=1}return o=l?o+t.slice(l):t,s?o:z.foldFlowLines(o,r,z.FOLD_QUOTED,Rt(e,!1))}a(We,"doubleQuotedString");function jn(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return We(n,e);let t=e.indent||(qt(n)?" ":""),s="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${t}`)+"'";return e.implicitKey?s:z.foldFlowLines(s,t,z.FOLD_FLOW,Rt(e,!1))}a(jn,"singleQuotedString");function Ae(n,e){let{singleQuote:t}=e.options,s;if(t===!1)s=We;else{let i=n.includes('"'),r=n.includes("'");i&&!r?s=jn:r&&!i?s=We:s=t?jn:We}return s(n,e)}a(Ae,"quotedString");var Kn;try{Kn=new RegExp(`(^|(?<!
|
|
20
|
+
))
|
|
21
|
+
+(?!
|
|
22
|
+
|$)`,"g")}catch{Kn=/\n+(?!\n|$)/g}function Lt({comment:n,type:e,value:t},s,i,r){let{blockQuote:o,commentString:l,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(t))return Ae(t,s);let u=s.indent||(s.forceBlockIndent||qt(t)?" ":""),p=o==="literal"?!0:o==="folded"||e===$.Scalar.BLOCK_FOLDED?!1:e===$.Scalar.BLOCK_LITERAL?!0:!vc(t,c,u.length);if(!t)return p?`|
|
|
23
|
+
`:`>
|
|
24
|
+
`;let f,d;for(d=t.length;d>0;--d){let k=t[d-1];if(k!==`
|
|
25
|
+
`&&k!==" "&&k!==" ")break}let g=t.substring(d),b=g.indexOf(`
|
|
26
|
+
`);b===-1?f="-":t===g||b!==g.length-1?(f="+",r&&r()):f="",g&&(t=t.slice(0,-g.length),g[g.length-1]===`
|
|
27
|
+
`&&(g=g.slice(0,-1)),g=g.replace(Kn,`$&${u}`));let h=!1,m,w=-1;for(m=0;m<t.length;++m){let k=t[m];if(k===" ")h=!0;else if(k===`
|
|
28
|
+
`)w=m;else break}let v=t.substring(0,w<m?w+1:m);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${u}`));let A=(h?u?"2":"1":"")+f;if(n&&(A+=" "+l(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){let k=t.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),N=!1,T=Rt(s,!0);o!=="folded"&&e!==$.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{N=!0});let S=z.foldFlowLines(`${v}${k}${g}`,u,z.FOLD_BLOCK,T);if(!N)return`>${A}
|
|
30
|
+
${u}${S}`}return t=t.replace(/\n+/g,`$&${u}`),`|${A}
|
|
31
|
+
${u}${v}${t}${g}`}a(Lt,"blockString");function Ec(n,e,t,s){let{type:i,value:r}=n,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:p}=e;if(l&&r.includes(`
|
|
32
|
+
`)||p&&/[[\]{},]/.test(r))return Ae(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||p||!r.includes(`
|
|
33
|
+
`)?Ae(r,e):Lt(n,e,t,s);if(!l&&!p&&i!==$.Scalar.PLAIN&&r.includes(`
|
|
34
|
+
`))return Lt(n,e,t,s);if(qt(r)){if(c==="")return e.forceBlockIndent=!0,Lt(n,e,t,s);if(l&&c===u)return Ae(r,e)}let f=r.replace(/\n+/g,`$&
|
|
35
|
+
${c}`);if(o){let d=a(h=>h.default&&h.tag!=="tag:yaml.org,2002:str"&&h.test?.test(f),"test"),{compat:g,tags:b}=e.doc.schema;if(b.some(d)||g?.some(d))return Ae(r,e)}return l?f:z.foldFlowLines(f,c,z.FOLD_FLOW,Rt(e,!1))}a(Ec,"plainString");function Ac(n,e,t,s){let{implicitKey:i,inFlow:r}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)}),{type:l}=n;l!==$.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=$.Scalar.QUOTE_DOUBLE);let c=a(p=>{switch(p){case $.Scalar.BLOCK_FOLDED:case $.Scalar.BLOCK_LITERAL:return i||r?Ae(o.value,e):Lt(o,e,t,s);case $.Scalar.QUOTE_DOUBLE:return We(o.value,e);case $.Scalar.QUOTE_SINGLE:return jn(o.value,e);case $.Scalar.PLAIN:return Ec(o,e,t,s);default:return null}},"_stringify"),u=c(l);if(u===null){let{defaultKeyType:p,defaultStringType:f}=e.options,d=i&&p||f;if(u=c(d),u===null)throw new Error(`Unsupported default string type ${d}`)}return u}a(Ac,"stringifyString");rr.stringifyString=Ac});var Je=y(Fn=>{"use strict";var kc=kt(),Z=O(),Nc=Ue(),Oc=Ye();function Cc(n,e){let t=Object.assign({blockQuote:!0,commentString:Nc.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},n.schema.toStringOptions,e),s;switch(t.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:s,options:t}}a(Cc,"createStringifyContext");function Tc(n,e){if(e.tag){let i=n.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,s;if(Z.isScalar(e)){s=e.value;let i=n.filter(r=>r.identify?.(s));if(i.length>1){let r=i.filter(o=>o.test);r.length>0&&(i=r)}t=i.find(r=>r.format===e.format)??i.find(r=>!r.format)}else s=e,t=n.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!t){let i=s?.constructor?.name??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return t}a(Tc,"getTagObject");function Ic(n,e,{anchors:t,doc:s}){if(!s.directives)return"";let i=[],r=(Z.isScalar(n)||Z.isCollection(n))&&n.anchor;r&&kc.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=n.tag??(e.default?null:e.tag);return o&&i.push(s.directives.tagString(o)),i.join(" ")}a(Ic,"stringifyProps");function Pc(n,e,t,s){if(Z.isPair(n))return n.toString(e,t,s);if(Z.isAlias(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i,r=Z.isNode(n)?n:e.doc.createNode(n,{onTagObj:a(c=>i=c,"onTagObj")});i??(i=Tc(e.doc.schema.tags,r));let o=Ic(r,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let l=typeof i.stringify=="function"?i.stringify(r,e,t,s):Z.isScalar(r)?Oc.stringifyString(r,e,t,s):r.toString(e,t,s);return o?Z.isScalar(r)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
36
|
+
${e.indent}${l}`:l}a(Pc,"stringify");Fn.createStringifyContext=Cc;Fn.stringify=Pc});var cr=y(lr=>{"use strict";var Y=O(),or=I(),ar=Je(),He=Ue();function Lc({key:n,value:e},t,s,i){let{allNullValues:r,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:p,simpleKeys:f}}=t,d=Y.isNode(n)&&n.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(Y.isCollection(n)||!Y.isNode(n)&&typeof n=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let g=!f&&(!n||d&&e==null&&!t.inFlow||Y.isCollection(n)||(Y.isScalar(n)?n.type===or.Scalar.BLOCK_FOLDED||n.type===or.Scalar.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(f||!r),indent:l+c});let b=!1,h=!1,m=ar.stringify(n,t,()=>b=!0,()=>h=!0);if(!g&&!t.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(t.inFlow){if(r||e==null)return b&&s&&s(),m===""?"?":g?`? ${m}`:m}else if(r&&!f||e==null&&g)return m=`? ${m}`,d&&!b?m+=He.lineComment(m,t.indent,u(d)):h&&i&&i(),m;b&&(d=null),g?(d&&(m+=He.lineComment(m,t.indent,u(d))),m=`? ${m}
|
|
37
|
+
${l}:`):(m=`${m}:`,d&&(m+=He.lineComment(m,t.indent,u(d))));let w,v,E;Y.isNode(e)?(w=!!e.spaceBefore,v=e.commentBefore,E=e.comment):(w=!1,v=null,E=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!g&&!d&&Y.isScalar(e)&&(t.indentAtStart=m.length+1),h=!1,!p&&c.length>=2&&!t.inFlow&&!g&&Y.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let A=!1,k=ar.stringify(e,t,()=>A=!0,()=>h=!0),N=" ";if(d||w||v){if(N=w?`
|
|
38
|
+
`:"",v){let T=u(v);N+=`
|
|
39
|
+
${He.indentComment(T,t.indent)}`}k===""&&!t.inFlow?N===`
|
|
40
|
+
`&&E&&(N=`
|
|
41
|
+
|
|
42
|
+
`):N+=`
|
|
43
|
+
${t.indent}`}else if(!g&&Y.isCollection(e)){let T=k[0],S=k.indexOf(`
|
|
44
|
+
`),P=S!==-1,H=t.inFlow??e.flow??e.items.length===0;if(P||!H){let be=!1;if(P&&(T==="&"||T==="!")){let L=k.indexOf(" ");T==="&"&&L!==-1&&L<S&&k[L+1]==="!"&&(L=k.indexOf(" ",L+1)),(L===-1||S<L)&&(be=!0)}be||(N=`
|
|
45
|
+
${t.indent}`)}}else(k===""||k[0]===`
|
|
46
|
+
`)&&(N="");return m+=N+k,t.inFlow?A&&s&&s():E&&!A?m+=He.lineComment(m,t.indent,u(E)):h&&i&&i(),m}a(Lc,"stringifyPair");lr.stringifyPair=Lc});var Vn=y(Un=>{"use strict";var ur=yt("process");function Rc(n,...e){n==="debug"&&console.log(...e)}a(Rc,"debug");function qc(n,e){(n==="debug"||n==="warn")&&(typeof ur.emitWarning=="function"?ur.emitWarning(e):console.warn(e))}a(qc,"warn");Un.debug=Rc;Un.warn=qc});var $t=y(xt=>{"use strict";var Dt=O(),fr=I(),_t="<<",Mt={identify:a(n=>n===_t||typeof n=="symbol"&&n.description===_t,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new fr.Scalar(Symbol(_t)),{addToJSMap:dr}),"resolve"),stringify:a(()=>_t,"stringify")},_c=a((n,e)=>(Mt.identify(e)||Dt.isScalar(e)&&(!e.type||e.type===fr.Scalar.PLAIN)&&Mt.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===Mt.tag&&t.default),"isMergeKey");function dr(n,e,t){let s=hr(n,t);if(Dt.isSeq(s))for(let i of s.items)Wn(n,e,i);else if(Array.isArray(s))for(let i of s)Wn(n,e,i);else Wn(n,e,s)}a(dr,"addMergeToJSMap");function Wn(n,e,t){let s=hr(n,t);if(!Dt.isMap(s))throw new Error("Merge sources must be maps or map aliases");let i=s.toJSON(null,n,Map);for(let[r,o]of i)e instanceof Map?e.has(r)||e.set(r,o):e instanceof Set?e.add(r):Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}a(Wn,"mergeValue");function hr(n,e){return n&&Dt.isAlias(e)?e.resolve(n.doc,n):e}a(hr,"resolveAliasValue");xt.addMergeToJSMap=dr;xt.isMergeKey=_c;xt.merge=Mt});var Jn=y(gr=>{"use strict";var Mc=Vn(),pr=$t(),Dc=Je(),mr=O(),Yn=Q();function xc(n,e,{key:t,value:s}){if(mr.isNode(t)&&t.addToJSMap)t.addToJSMap(n,e,s);else if(pr.isMergeKey(n,t))pr.addMergeToJSMap(n,e,s);else{let i=Yn.toJS(t,"",n);if(e instanceof Map)e.set(i,Yn.toJS(s,i,n));else if(e instanceof Set)e.add(i);else{let r=$c(t,i,n),o=Yn.toJS(s,r,n);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}a(xc,"addPairToJSMap");function $c(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(mr.isNode(n)&&t?.doc){let s=Dc.createStringifyContext(t.doc,{});s.anchors=new Set;for(let r of t.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;let i=n.toString(s);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),Mc.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}a($c,"stringifyKey");gr.addPairToJSMap=xc});var ee=y(Hn=>{"use strict";var yr=Fe(),Bc=cr(),jc=Jn(),Bt=O();function Kc(n,e,t){let s=yr.createNode(n,void 0,t),i=yr.createNode(e,void 0,t);return new jt(s,i)}a(Kc,"createPair");var jt=class n{static{a(this,"Pair")}constructor(e,t=null){Object.defineProperty(this,Bt.NODE_TYPE,{value:Bt.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:s}=this;return Bt.isNode(t)&&(t=t.clone(e)),Bt.isNode(s)&&(s=s.clone(e)),new n(t,s)}toJSON(e,t){let s=t?.mapAsMap?new Map:{};return jc.addPairToJSMap(t,s,this)}toString(e,t,s){return e?.doc?Bc.stringifyPair(this,e,t,s):JSON.stringify(this)}};Hn.Pair=jt;Hn.createPair=Kc});var Gn=y(Sr=>{"use strict";var ue=O(),br=Je(),Kt=Ue();function Fc(n,e,t){return(e.inFlow??n.flow?Vc:Uc)(n,e,t)}a(Fc,"stringifyCollection");function Uc({comment:n,items:e},t,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){let{indent:c,options:{commentString:u}}=t,p=Object.assign({},t,{indent:r,type:null}),f=!1,d=[];for(let b=0;b<e.length;++b){let h=e[b],m=null;if(ue.isNode(h))!f&&h.spaceBefore&&d.push(""),Ft(t,d,h.commentBefore,f),h.comment&&(m=h.comment);else if(ue.isPair(h)){let v=ue.isNode(h.key)?h.key:null;v&&(!f&&v.spaceBefore&&d.push(""),Ft(t,d,v.commentBefore,f))}f=!1;let w=br.stringify(h,p,()=>m=null,()=>f=!0);m&&(w+=Kt.lineComment(w,r,u(m))),f&&m&&(f=!1),d.push(s+w)}let g;if(d.length===0)g=i.start+i.end;else{g=d[0];for(let b=1;b<d.length;++b){let h=d[b];g+=h?`
|
|
47
|
+
${c}${h}`:`
|
|
48
|
+
`}}return n?(g+=`
|
|
49
|
+
`+Kt.indentComment(u(n),c),l&&l()):f&&o&&o(),g}a(Uc,"stringifyBlockCollection");function Vc({items:n},e,{flowChars:t,itemIndent:s}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:l}}=e;s+=r;let c=Object.assign({},e,{indent:s,inFlow:!0,type:null}),u=!1,p=0,f=[];for(let b=0;b<n.length;++b){let h=n[b],m=null;if(ue.isNode(h))h.spaceBefore&&f.push(""),Ft(e,f,h.commentBefore,!1),h.comment&&(m=h.comment);else if(ue.isPair(h)){let v=ue.isNode(h.key)?h.key:null;v&&(v.spaceBefore&&f.push(""),Ft(e,f,v.commentBefore,!1),v.comment&&(u=!0));let E=ue.isNode(h.value)?h.value:null;E?(E.comment&&(m=E.comment),E.commentBefore&&(u=!0)):h.value==null&&v?.comment&&(m=v.comment)}m&&(u=!0);let w=br.stringify(h,c,()=>m=null);u||(u=f.length>p||w.includes(`
|
|
50
|
+
`)),b<n.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(u||(u=f.reduce((v,E)=>v+E.length+2,2)+(w.length+2)>e.options.lineWidth)),u&&(w+=",")),m&&(w+=Kt.lineComment(w,s,l(m))),f.push(w),p=f.length}let{start:d,end:g}=t;if(f.length===0)return d+g;if(!u){let b=f.reduce((h,m)=>h+m.length+2,2);u=e.options.lineWidth>0&&b>e.options.lineWidth}if(u){let b=d;for(let h of f)b+=h?`
|
|
51
|
+
${r}${i}${h}`:`
|
|
52
|
+
`;return`${b}
|
|
53
|
+
${i}${g}`}else return`${d}${o}${f.join(" ")}${o}${g}`}a(Vc,"stringifyFlowCollection");function Ft({indent:n,options:{commentString:e}},t,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){let r=Kt.indentComment(e(s),n);t.push(r.trimStart())}}a(Ft,"addCommentBefore");Sr.stringifyCollection=Fc});var ne=y(Xn=>{"use strict";var Wc=Gn(),Yc=Jn(),Jc=Tt(),te=O(),Ut=ee(),Hc=I();function Ge(n,e){let t=te.isScalar(e)?e.value:e;for(let s of n)if(te.isPair(s)&&(s.key===e||s.key===t||te.isScalar(s.key)&&s.key.value===t))return s}a(Ge,"findPair");var Qn=class extends Jc.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(te.MAP,e),this.items=[]}static from(e,t,s){let{keepUndefined:i,replacer:r}=s,o=new this(e),l=a((c,u)=>{if(typeof r=="function")u=r.call(t,c,u);else if(Array.isArray(r)&&!r.includes(c))return;(u!==void 0||i)&&o.items.push(Ut.createPair(c,u,s))},"add");if(t instanceof Map)for(let[c,u]of t)l(c,u);else if(t&&typeof t=="object")for(let c of Object.keys(t))l(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let s;te.isPair(e)?s=e:!e||typeof e!="object"||!("key"in e)?s=new Ut.Pair(e,e?.value):s=new Ut.Pair(e.key,e.value);let i=Ge(this.items,s.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${s.key} already set`);te.isScalar(i.value)&&Hc.isScalarValue(s.value)?i.value.value=s.value:i.value=s.value}else if(r){let o=this.items.findIndex(l=>r(s,l)<0);o===-1?this.items.push(s):this.items.splice(o,0,s)}else this.items.push(s)}delete(e){let t=Ge(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=Ge(this.items,e)?.value;return(!t&&te.isScalar(i)?i.value:i)??void 0}has(e){return!!Ge(this.items,e)}set(e,t){this.add(new Ut.Pair(e,t),!0)}toJSON(e,t,s){let i=s?new s:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)Yc.addPairToJSMap(t,i,r);return i}toString(e,t,s){if(!e)return JSON.stringify(this);for(let i of this.items)if(!te.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})),Wc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:s,onComment:t})}};Xn.YAMLMap=Qn;Xn.findPair=Ge});var ke=y(vr=>{"use strict";var Gc=O(),wr=ne(),Qc={collection:"map",default:!0,nodeClass:wr.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(n,e){return Gc.isMap(n)||e("Expected a mapping for this tag"),n},createNode:a((n,e,t)=>wr.YAMLMap.from(n,e,t),"createNode")};vr.map=Qc});var se=y(Er=>{"use strict";var Xc=Fe(),zc=Gn(),Zc=Tt(),Wt=O(),eu=I(),tu=Q(),zn=class extends Zc.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Wt.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Vt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let s=Vt(e);if(typeof s!="number")return;let i=this.items[s];return!t&&Wt.isScalar(i)?i.value:i}has(e){let t=Vt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let s=Vt(e);if(typeof s!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[s];Wt.isScalar(i)&&eu.isScalarValue(t)?i.value=t:this.items[s]=t}toJSON(e,t){let s=[];t?.onCreate&&t.onCreate(s);let i=0;for(let r of this.items)s.push(tu.toJS(r,String(i++),t));return s}toString(e,t,s){return e?zc.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:s,onComment:t}):JSON.stringify(this)}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let l of t){if(typeof i=="function"){let c=t instanceof Set?l:String(o++);l=i.call(t,c,l)}r.items.push(Xc.createNode(l,void 0,s))}}return r}};function Vt(n){let e=Wt.isScalar(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}a(Vt,"asItemIndex");Er.YAMLSeq=zn});var Ne=y(kr=>{"use strict";var nu=O(),Ar=se(),su={collection:"seq",default:!0,nodeClass:Ar.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(n,e){return nu.isSeq(n)||e("Expected a sequence for this tag"),n},createNode:a((n,e,t)=>Ar.YAMLSeq.from(n,e,t),"createNode")};kr.seq=su});var Qe=y(Nr=>{"use strict";var iu=Ye(),ru={identify:a(n=>typeof n=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(n=>n,"resolve"),stringify(n,e,t,s){return e=Object.assign({actualString:!0},e),iu.stringifyString(n,e,t,s)}};Nr.string=ru});var Yt=y(Tr=>{"use strict";var Or=I(),Cr={identify:a(n=>n==null,"identify"),createNode:a(()=>new Or.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new Or.Scalar(null),"resolve"),stringify:a(({source:n},e)=>typeof n=="string"&&Cr.test.test(n)?n:e.options.nullStr,"stringify")};Tr.nullTag=Cr});var Zn=y(Pr=>{"use strict";var ou=I(),Ir={identify:a(n=>typeof n=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a(n=>new ou.Scalar(n[0]==="t"||n[0]==="T"),"resolve"),stringify({source:n,value:e},t){if(n&&Ir.test.test(n)){let s=n[0]==="t"||n[0]==="T";if(e===s)return n}return e?t.options.trueStr:t.options.falseStr}};Pr.boolTag=Ir});var Oe=y(Lr=>{"use strict";function au({format:n,minFractionDigits:e,tag:t,value:s}){if(typeof s=="bigint")return String(s);let i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let o=r.indexOf(".");o<0&&(o=r.length,r+=".");let l=e-(r.length-o-1);for(;l-- >0;)r+="0"}return r}a(au,"stringifyNumber");Lr.stringifyNumber=au});var ts=y(Jt=>{"use strict";var lu=I(),es=Oe(),cu={identify:a(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:es.stringifyNumber},uu={identify:a(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a(n=>parseFloat(n),"resolve"),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():es.stringifyNumber(n)}},fu={identify:a(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){let e=new lu.Scalar(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:es.stringifyNumber};Jt.float=fu;Jt.floatExp=uu;Jt.floatNaN=cu});var ss=y(Gt=>{"use strict";var Rr=Oe(),Ht=a(n=>typeof n=="bigint"||Number.isInteger(n),"intIdentify"),ns=a((n,e,t,{intAsBigInt:s})=>s?BigInt(n):parseInt(n.substring(e),t),"intResolve");function qr(n,e,t){let{value:s}=n;return Ht(s)&&s>=0?t+s.toString(e):Rr.stringifyNumber(n)}a(qr,"intStringify");var du={identify:a(n=>Ht(n)&&n>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((n,e,t)=>ns(n,2,8,t),"resolve"),stringify:a(n=>qr(n,8,"0o"),"stringify")},hu={identify:Ht,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((n,e,t)=>ns(n,0,10,t),"resolve"),stringify:Rr.stringifyNumber},pu={identify:a(n=>Ht(n)&&n>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:a((n,e,t)=>ns(n,2,16,t),"resolve"),stringify:a(n=>qr(n,16,"0x"),"stringify")};Gt.int=hu;Gt.intHex=pu;Gt.intOct=du});var Mr=y(_r=>{"use strict";var mu=ke(),gu=Yt(),yu=Ne(),bu=Qe(),Su=Zn(),is=ts(),rs=ss(),wu=[mu.map,yu.seq,bu.string,gu.nullTag,Su.boolTag,rs.intOct,rs.int,rs.intHex,is.floatNaN,is.floatExp,is.float];_r.schema=wu});var $r=y(xr=>{"use strict";var vu=I(),Eu=ke(),Au=Ne();function Dr(n){return typeof n=="bigint"||Number.isInteger(n)}a(Dr,"intIdentify");var Qt=a(({value:n})=>JSON.stringify(n),"stringifyJSON"),ku=[{identify:a(n=>typeof n=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(n=>n,"resolve"),stringify:Qt},{identify:a(n=>n==null,"identify"),createNode:a(()=>new vu.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:Qt},{identify:a(n=>typeof n=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a(n=>n==="true","resolve"),stringify:Qt},{identify:Dr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:a((n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),"resolve"),stringify:a(({value:n})=>Dr(n)?n.toString():JSON.stringify(n),"stringify")},{identify:a(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a(n=>parseFloat(n),"resolve"),stringify:Qt}],Nu={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},Ou=[Eu.map,Au.seq].concat(ku,Nu);xr.schema=Ou});var as=y(Br=>{"use strict";var Xe=yt("buffer"),os=I(),Cu=Ye(),Tu={identify:a(n=>n instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof Xe.Buffer=="function")return Xe.Buffer.from(n,"base64");if(typeof atob=="function"){let t=atob(n.replace(/[\n\r]/g,"")),s=new Uint8Array(t.length);for(let i=0;i<t.length;++i)s[i]=t.charCodeAt(i);return s}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},s,i,r){if(!t)return"";let o=t,l;if(typeof Xe.Buffer=="function")l=o instanceof Xe.Buffer?o.toString("base64"):Xe.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);l=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=os.Scalar.BLOCK_LITERAL),e!==os.Scalar.QUOTE_DOUBLE){let c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(l.length/c),p=new Array(u);for(let f=0,d=0;f<u;++f,d+=c)p[f]=l.substr(d,c);l=p.join(e===os.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return Cu.stringifyString({comment:n,type:e,value:l},s,i,r)}};Br.binary=Tu});var Zt=y(zt=>{"use strict";var Xt=O(),ls=ee(),Iu=I(),Pu=se();function jr(n,e){if(Xt.isSeq(n))for(let t=0;t<n.items.length;++t){let s=n.items[t];if(!Xt.isPair(s)){if(Xt.isMap(s)){s.items.length>1&&e("Each pair must have its own sequence indicator");let i=s.items[0]||new ls.Pair(new Iu.Scalar(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore}
|
|
55
|
+
${i.key.commentBefore}`:s.commentBefore),s.comment){let r=i.value??i.key;r.comment=r.comment?`${s.comment}
|
|
56
|
+
${r.comment}`:s.comment}s=i}n.items[t]=Xt.isPair(s)?s:new ls.Pair(s)}}else e("Expected a sequence for this tag");return n}a(jr,"resolvePairs");function Kr(n,e,t){let{replacer:s}=t,i=new Pu.YAMLSeq(n);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof s=="function"&&(o=s.call(e,String(r++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;i.items.push(ls.createPair(l,c,t))}return i}a(Kr,"createPairs");var Lu={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:jr,createNode:Kr};zt.createPairs=Kr;zt.pairs=Lu;zt.resolvePairs=jr});var fs=y(us=>{"use strict";var Fr=O(),cs=Q(),ze=ne(),Ru=se(),Ur=Zt(),fe=class n extends Ru.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=ze.YAMLMap.prototype.add.bind(this),this.delete=ze.YAMLMap.prototype.delete.bind(this),this.get=ze.YAMLMap.prototype.get.bind(this),this.has=ze.YAMLMap.prototype.has.bind(this),this.set=ze.YAMLMap.prototype.set.bind(this),this.tag=n.tag}toJSON(e,t){if(!t)return super.toJSON(e);let s=new Map;t?.onCreate&&t.onCreate(s);for(let i of this.items){let r,o;if(Fr.isPair(i)?(r=cs.toJS(i.key,"",t),o=cs.toJS(i.value,r,t)):r=cs.toJS(i,"",t),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,o)}return s}static from(e,t,s){let i=Ur.createPairs(e,t,s),r=new this;return r.items=i.items,r}};fe.tag="tag:yaml.org,2002:omap";var qu={collection:"seq",identify:a(n=>n instanceof Map,"identify"),nodeClass:fe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){let t=Ur.resolvePairs(n,e),s=[];for(let{key:i}of t.items)Fr.isScalar(i)&&(s.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new fe,t)},createNode:a((n,e,t)=>fe.from(n,e,t),"createNode")};us.YAMLOMap=fe;us.omap=qu});var Hr=y(ds=>{"use strict";var Vr=I();function Wr({value:n,source:e},t){return e&&(n?Yr:Jr).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}a(Wr,"boolStringify");var Yr={identify:a(n=>n===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:a(()=>new Vr.Scalar(!0),"resolve"),stringify:Wr},Jr={identify:a(n=>n===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:a(()=>new Vr.Scalar(!1),"resolve"),stringify:Wr};ds.falseTag=Jr;ds.trueTag=Yr});var Gr=y(en=>{"use strict";var _u=I(),hs=Oe(),Mu={identify:a(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:hs.stringifyNumber},Du={identify:a(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a(n=>parseFloat(n.replace(/_/g,"")),"resolve"),stringify(n){let e=Number(n.value);return isFinite(e)?e.toExponential():hs.stringifyNumber(n)}},xu={identify:a(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){let e=new _u.Scalar(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){let s=n.substring(t+1).replace(/_/g,"");s[s.length-1]==="0"&&(e.minFractionDigits=s.length)}return e},stringify:hs.stringifyNumber};en.float=xu;en.floatExp=Du;en.floatNaN=Mu});var Xr=y(et=>{"use strict";var Qr=Oe(),Ze=a(n=>typeof n=="bigint"||Number.isInteger(n),"intIdentify");function tn(n,e,t,{intAsBigInt:s}){let i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),s){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}let o=BigInt(n);return i==="-"?BigInt(-1)*o:o}let r=parseInt(n,t);return i==="-"?-1*r:r}a(tn,"intResolve");function ps(n,e,t){let{value:s}=n;if(Ze(s)){let i=s.toString(e);return s<0?"-"+t+i.substr(1):t+i}return Qr.stringifyNumber(n)}a(ps,"intStringify");var $u={identify:Ze,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((n,e,t)=>tn(n,2,2,t),"resolve"),stringify:a(n=>ps(n,2,"0b"),"stringify")},Bu={identify:Ze,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((n,e,t)=>tn(n,1,8,t),"resolve"),stringify:a(n=>ps(n,8,"0"),"stringify")},ju={identify:Ze,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((n,e,t)=>tn(n,0,10,t),"resolve"),stringify:Qr.stringifyNumber},Ku={identify:Ze,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((n,e,t)=>tn(n,2,16,t),"resolve"),stringify:a(n=>ps(n,16,"0x"),"stringify")};et.int=ju;et.intBin=$u;et.intHex=Ku;et.intOct=Bu});var gs=y(ms=>{"use strict";var rn=O(),nn=ee(),sn=ne(),de=class n extends sn.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=n.tag}add(e){let t;rn.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new nn.Pair(e.key,null):t=new nn.Pair(e,null),sn.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let s=sn.findPair(this.items,e);return!t&&rn.isPair(s)?rn.isScalar(s.key)?s.key.value:s.key:s}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let s=sn.findPair(this.items,e);s&&!t?this.items.splice(this.items.indexOf(s),1):!s&&t&&this.items.push(new nn.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,s){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,s);throw new Error("Set items must all have null values")}static from(e,t,s){let{replacer:i}=s,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),r.items.push(nn.createPair(o,null,s));return r}};de.tag="tag:yaml.org,2002:set";var Fu={collection:"map",identify:a(n=>n instanceof Set,"identify"),nodeClass:de,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((n,e,t)=>de.from(n,e,t),"createNode"),resolve(n,e){if(rn.isMap(n)){if(n.hasAllNullValues(!0))return Object.assign(new de,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};ms.YAMLSet=de;ms.set=Fu});var bs=y(on=>{"use strict";var Uu=Oe();function ys(n,e){let t=n[0],s=t==="-"||t==="+"?n.substring(1):n,i=a(o=>e?BigInt(o):Number(o),"num"),r=s.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return t==="-"?i(-1)*r:r}a(ys,"parseSexagesimal");function zr(n){let{value:e}=n,t=a(o=>o,"num");if(typeof e=="bigint")t=a(o=>BigInt(o),"num");else if(isNaN(e)||!isFinite(e))return Uu.stringifyNumber(n);let s="";e<0&&(s="-",e*=t(-1));let i=t(60),r=[e%i];return e<60?r.unshift(0):(e=(e-r[0])/i,r.unshift(e%i),e>=60&&(e=(e-r[0])/i,r.unshift(e))),s+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}a(zr,"stringifySexagesimal");var Vu={identify:a(n=>typeof n=="bigint"||Number.isInteger(n),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:a((n,e,{intAsBigInt:t})=>ys(n,t),"resolve"),stringify:zr},Wu={identify:a(n=>typeof n=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a(n=>ys(n,!1),"resolve"),stringify:zr},Zr={identify:a(n=>n 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(n){let e=n.match(Zr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,s,i,r,o,l]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(t,s-1,i,r||0,o||0,l||0,c),p=e[8];if(p&&p!=="Z"){let f=ys(p,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:a(({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};on.floatTime=Wu;on.intTime=Vu;on.timestamp=Zr});var no=y(to=>{"use strict";var Yu=ke(),Ju=Yt(),Hu=Ne(),Gu=Qe(),Qu=as(),eo=Hr(),Ss=Gr(),an=Xr(),Xu=$t(),zu=fs(),Zu=Zt(),ef=gs(),ws=bs(),tf=[Yu.map,Hu.seq,Gu.string,Ju.nullTag,eo.trueTag,eo.falseTag,an.intBin,an.intOct,an.int,an.intHex,Ss.floatNaN,Ss.floatExp,Ss.float,Qu.binary,Xu.merge,zu.omap,Zu.pairs,ef.set,ws.intTime,ws.floatTime,ws.timestamp];to.schema=tf});var ho=y(As=>{"use strict";var oo=ke(),nf=Yt(),ao=Ne(),sf=Qe(),rf=Zn(),vs=ts(),Es=ss(),of=Mr(),af=$r(),lo=as(),tt=$t(),co=fs(),uo=Zt(),so=no(),fo=gs(),ln=bs(),io=new Map([["core",of.schema],["failsafe",[oo.map,ao.seq,sf.string]],["json",af.schema],["yaml11",so.schema],["yaml-1.1",so.schema]]),ro={binary:lo.binary,bool:rf.boolTag,float:vs.float,floatExp:vs.floatExp,floatNaN:vs.floatNaN,floatTime:ln.floatTime,int:Es.int,intHex:Es.intHex,intOct:Es.intOct,intTime:ln.intTime,map:oo.map,merge:tt.merge,null:nf.nullTag,omap:co.omap,pairs:uo.pairs,seq:ao.seq,set:fo.set,timestamp:ln.timestamp},lf={"tag:yaml.org,2002:binary":lo.binary,"tag:yaml.org,2002:merge":tt.merge,"tag:yaml.org,2002:omap":co.omap,"tag:yaml.org,2002:pairs":uo.pairs,"tag:yaml.org,2002:set":fo.set,"tag:yaml.org,2002:timestamp":ln.timestamp};function cf(n,e,t){let s=io.get(e);if(s&&!n)return t&&!s.includes(tt.merge)?s.concat(tt.merge):s.slice();let i=s;if(!i)if(Array.isArray(n))i=[];else{let r=Array.from(io.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${r} or define customTags array`)}if(Array.isArray(n))for(let r of n)i=i.concat(r);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(tt.merge)),i.reduce((r,o)=>{let l=typeof o=="string"?ro[o]:o;if(!l){let c=JSON.stringify(o),u=Object.keys(ro).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return r.includes(l)||r.push(l),r},[])}a(cf,"getTags");As.coreKnownTags=lf;As.getTags=cf});var Os=y(po=>{"use strict";var ks=O(),uf=ke(),ff=Ne(),df=Qe(),cn=ho(),hf=a((n,e)=>n.key<e.key?-1:n.key>e.key?1:0,"sortMapEntriesByKey"),Ns=class n{static{a(this,"Schema")}constructor({compat:e,customTags:t,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?cn.getTags(e,"compat"):e?cn.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?cn.coreKnownTags:{},this.tags=cn.getTags(t,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,ks.MAP,{value:uf.map}),Object.defineProperty(this,ks.SCALAR,{value:df.string}),Object.defineProperty(this,ks.SEQ,{value:ff.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?hf:null}clone(){let e=Object.create(n.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};po.Schema=Ns});var go=y(mo=>{"use strict";var pf=O(),Cs=Je(),nt=Ue();function mf(n,e){let t=[],s=e.directives===!0;if(e.directives!==!1&&n.directives){let c=n.directives.toString(n);c?(t.push(c),s=!0):n.directives.docStart&&(s=!0)}s&&t.push("---");let i=Cs.createStringifyContext(n,e),{commentString:r}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");let c=r(n.commentBefore);t.unshift(nt.indentComment(c,""))}let o=!1,l=null;if(n.contents){if(pf.isNode(n.contents)){if(n.contents.spaceBefore&&s&&t.push(""),n.contents.commentBefore){let p=r(n.contents.commentBefore);t.push(nt.indentComment(p,""))}i.forceBlockIndent=!!n.comment,l=n.contents.comment}let c=l?void 0:()=>o=!0,u=Cs.stringify(n.contents,i,()=>l=null,c);l&&(u+=nt.lineComment(u,"",r(l))),(u[0]==="|"||u[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${u}`:t.push(u)}else t.push(Cs.stringify(n.contents,i));if(n.directives?.docEnd)if(n.comment){let c=r(n.comment);c.includes(`
|
|
57
|
+
`)?(t.push("..."),t.push(nt.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=n.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||l)&&t[t.length-1]!==""&&t.push(""),t.push(nt.indentComment(r(c),"")))}return t.join(`
|
|
58
|
+
`)+`
|
|
59
|
+
`}a(mf,"stringifyDocument");mo.stringifyDocument=mf});var st=y(yo=>{"use strict";var gf=Ke(),Ce=Tt(),D=O(),yf=ee(),bf=Q(),Sf=Os(),wf=go(),Ts=kt(),vf=Rn(),Ef=Fe(),Is=Ln(),Ps=class n{static{a(this,"Document")}constructor(e,t,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,D.NODE_TYPE,{value:D.DOC});let i=null;typeof t=="function"||Array.isArray(t)?i=t:s===void 0&&t&&(s=t,t=void 0);let r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:o}=r;s?._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Is.Directives({version:o}),this.setSchema(o,s),this.contents=e===void 0?null:this.createNode(e,i,s)}clone(){let e=Object.create(n.prototype,{[D.NODE_TYPE]:{value:D.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=D.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Te(this.contents)&&this.contents.add(e)}addIn(e,t){Te(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let s=Ts.anchorNames(this);e.anchor=!t||s.has(t)?Ts.findNewAnchor(t||"a",s):t}return new gf.Alias(e.anchor)}createNode(e,t,s){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let m=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),w=t.filter(m).map(String);w.length>0&&(t=t.concat(w)),i=t}else s===void 0&&t&&(s=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:p}=s??{},{onAnchor:f,setAnchors:d,sourceObjects:g}=Ts.createNodeAnchors(this,o||"a"),b={aliasDuplicateObjects:r??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:g},h=Ef.createNode(e,p,b);return l&&D.isCollection(h)&&(h.flow=!0),d(),h}createPair(e,t,s={}){let i=this.createNode(e,null,s),r=this.createNode(t,null,s);return new yf.Pair(i,r)}delete(e){return Te(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ce.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Te(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return D.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ce.isEmptyPath(e)?!t&&D.isScalar(this.contents)?this.contents.value:this.contents:D.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return D.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ce.isEmptyPath(e)?this.contents!==void 0:D.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ce.collectionFromPath(this.schema,[e],t):Te(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ce.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Ce.collectionFromPath(this.schema,Array.from(e),t):Te(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let s;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Is.Directives({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Is.Directives({version:e}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=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(t.schema instanceof Object)this.schema=t.schema;else if(s)this.schema=new Sf.Schema(Object.assign(s,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=bf.toJS(this.contents,t??"",l);if(typeof r=="function")for(let{count:u,res:p}of l.anchors.values())r(p,u);return typeof o=="function"?vf.applyReviver(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return wf.stringifyDocument(this,e)}};function Te(n){if(D.isCollection(n))return!0;throw new Error("Expected a YAML collection as document contents")}a(Te,"assertCollection");yo.Document=Ps});var ot=y(rt=>{"use strict";var it=class extends Error{static{a(this,"YAMLError")}constructor(e,t,s,i){super(),this.name=e,this.code=s,this.message=i,this.pos=t}},Ls=class extends it{static{a(this,"YAMLParseError")}constructor(e,t,s){super("YAMLParseError",e,t,s)}},Rs=class extends it{static{a(this,"YAMLWarning")}constructor(e,t,s){super("YAMLWarning",e,t,s)}},Af=a((n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));let{line:s,col:i}=t.linePos[0];t.message+=` at line ${s}, column ${i}`;let r=i-1,o=n.substring(e.lineStarts[s-1],e.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&o.length>80){let l=Math.min(r-39,o.length-79);o="\u2026"+o.substring(l),r-=l-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),s>1&&/^ *$/.test(o.substring(0,r))){let l=n.substring(e.lineStarts[s-2],e.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
|
|
60
|
+
`),o=l+o}if(/[^ ]/.test(o)){let l=1,c=t.linePos[1];c?.line===s&&c.col>i&&(l=Math.max(1,Math.min(c.col-i,80-r)));let u=" ".repeat(r)+"^".repeat(l);t.message+=`:
|
|
61
|
+
|
|
62
|
+
${o}
|
|
63
|
+
${u}
|
|
64
|
+
`}},"prettifyError");rt.YAMLError=it;rt.YAMLParseError=Ls;rt.YAMLWarning=Rs;rt.prettifyError=Af});var at=y(bo=>{"use strict";function kf(n,{flow:e,indicator:t,next:s,offset:i,onError:r,parentIndent:o,startOnNewline:l}){let c=!1,u=l,p=l,f="",d="",g=!1,b=!1,h=null,m=null,w=null,v=null,E=null,A=null,k=null;for(let S of n)switch(b&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&r(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),h&&(u&&S.type!=="comment"&&S.type!=="newline"&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),h=null),S.type){case"space":!e&&(t!=="doc-start"||s?.type!=="flow-collection")&&S.source.includes(" ")&&(h=S),p=!0;break;case"comment":{p||r(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let P=S.source.substring(1)||" ";f?f+=d+P:f=P,d="",u=!1;break}case"newline":u?f?f+=S.source:(!A||t!=="seq-item-ind")&&(c=!0):d+=S.source,u=!0,g=!0,(m||w)&&(v=S),p=!0;break;case"anchor":m&&r(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&r(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=S,k??(k=S.offset),u=!1,p=!1,b=!0;break;case"tag":{w&&r(S,"MULTIPLE_TAGS","A node can have at most one tag"),w=S,k??(k=S.offset),u=!1,p=!1,b=!0;break}case t:(m||w)&&r(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),A&&r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${e??"collection"}`),A=S,u=t==="seq-item-ind"||t==="explicit-key-ind",p=!1;break;case"comma":if(e){E&&r(S,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),E=S,u=!1,p=!1;break}default:r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),u=!1,p=!1}let N=n[n.length-1],T=N?N.offset+N.source.length:i;return b&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(u&&h.indent<=o||s?.type==="block-map"||s?.type==="block-seq")&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:A,spaceBefore:c,comment:f,hasNewline:g,anchor:m,tag:w,newlineAfterProp:v,end:T,start:k??T}}a(kf,"resolveProps");bo.resolveProps=kf});var un=y(So=>{"use strict";function qs(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
65
|
+
`))return!0;if(n.end){for(let e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of n.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(qs(e.key)||qs(e.value))return!0}return!1;default:return!0}}a(qs,"containsNewline");So.containsNewline=qs});var _s=y(wo=>{"use strict";var Nf=un();function Of(n,e,t){if(e?.type==="flow-collection"){let s=e.end[0];s.indent===n&&(s.source==="]"||s.source==="}")&&Nf.containsNewline(e)&&t(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Of,"flowIndentCheck");wo.flowIndentCheck=Of});var Ms=y(Eo=>{"use strict";var vo=O();function Cf(n,e,t){let{uniqueKeys:s}=n.options;if(s===!1)return!1;let i=typeof s=="function"?s:(r,o)=>r===o||vo.isScalar(r)&&vo.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}a(Cf,"mapIncludes");Eo.mapIncludes=Cf});var To=y(Co=>{"use strict";var Ao=ee(),Tf=ne(),ko=at(),If=un(),No=_s(),Pf=Ms(),Oo="All mapping items must start at the same column";function Lf({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??Tf.YAMLMap,l=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=s.offset,u=null;for(let p of s.items){let{start:f,key:d,sep:g,value:b}=p,h=ko.resolveProps(f,{indicator:"explicit-key-ind",next:d??g?.[0],offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0}),m=!h.found;if(m){if(d&&(d.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==s.indent&&i(c,"BAD_INDENT",Oo)),!h.anchor&&!h.tag&&!g){u=h.end,h.comment&&(l.comment?l.comment+=`
|
|
66
|
+
`+h.comment:l.comment=h.comment);continue}(h.newlineAfterProp||If.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==s.indent&&i(c,"BAD_INDENT",Oo);t.atKey=!0;let w=h.end,v=d?n(t,d,h,i):e(t,w,f,null,h,i);t.schema.compat&&No.flowIndentCheck(s.indent,d,i),t.atKey=!1,Pf.mapIncludes(t,l.items,v)&&i(w,"DUPLICATE_KEY","Map keys must be unique");let E=ko.resolveProps(g??[],{indicator:"map-value-ind",next:b,offset:v.range[2],onError:i,parentIndent:s.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=E.end,E.found){m&&(b?.type==="block-map"&&!E.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&h.start<E.found.offset-1024&&i(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let A=b?n(t,b,E,i):e(t,c,g,null,E,i);t.schema.compat&&No.flowIndentCheck(s.indent,b,i),c=A.range[2];let k=new Ao.Pair(v,A);t.options.keepSourceTokens&&(k.srcToken=p),l.items.push(k)}else{m&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),E.comment&&(v.comment?v.comment+=`
|
|
67
|
+
`+E.comment:v.comment=E.comment);let A=new Ao.Pair(v);t.options.keepSourceTokens&&(A.srcToken=p),l.items.push(A)}}return u&&u<c&&i(u,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,c,u??c],l}a(Lf,"resolveBlockMap");Co.resolveBlockMap=Lf});var Po=y(Io=>{"use strict";var Rf=se(),qf=at(),_f=_s();function Mf({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=r?.nodeClass??Rf.YAMLSeq,l=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=s.offset,u=null;for(let{start:p,value:f}of s.items){let d=qf.resolveProps(p,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:s.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(c,"MISSING_CHAR","Sequence item without - indicator");else{u=d.end,d.comment&&(l.comment=d.comment);continue}let g=f?n(t,f,d,i):e(t,d.end,p,null,d,i);t.schema.compat&&_f.flowIndentCheck(s.indent,f,i),c=g.range[2],l.items.push(g)}return l.range=[s.offset,c,u??c],l}a(Mf,"resolveBlockSeq");Io.resolveBlockSeq=Mf});var Ie=y(Lo=>{"use strict";function Df(n,e,t,s){let i="";if(n){let r=!1,o="";for(let l of n){let{source:c,type:u}=l;switch(u){case"space":r=!0;break;case"comment":{t&&!r&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=c.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=c),r=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=c.length}}return{comment:i,offset:e}}a(Df,"resolveEnd");Lo.resolveEnd=Df});var Mo=y(_o=>{"use strict";var xf=O(),$f=ee(),Ro=ne(),Bf=se(),jf=Ie(),qo=at(),Kf=un(),Ff=Ms(),Ds="Block collections are not allowed within flow collections",xs=a(n=>n&&(n.type==="block-map"||n.type==="block-seq"),"isBlock");function Uf({composeNode:n,composeEmptyNode:e},t,s,i,r){let o=s.start.source==="{",l=o?"flow map":"flow sequence",c=r?.nodeClass??(o?Ro.YAMLMap:Bf.YAMLSeq),u=new c(t.schema);u.flow=!0;let p=t.atRoot;p&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=s.offset+s.start.source.length;for(let m=0;m<s.items.length;++m){let w=s.items[m],{start:v,key:E,sep:A,value:k}=w,N=qo.resolveProps(v,{flow:l,indicator:"explicit-key-ind",next:E??A?.[0],offset:f,onError:i,parentIndent:s.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!A&&!k){m===0&&N.comma?i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):m<s.items.length-1&&i(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),N.comment&&(u.comment?u.comment+=`
|
|
68
|
+
`+N.comment:u.comment=N.comment),f=N.end;continue}!o&&t.options.strict&&Kf.containsNewline(E)&&i(E,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)N.comma&&i(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(N.comma||i(N.start,"MISSING_CHAR",`Missing , between ${l} items`),N.comment){let T="";e:for(let S of v)switch(S.type){case"comma":case"space":break;case"comment":T=S.source.substring(1);break e;default:break e}if(T){let S=u.items[u.items.length-1];xf.isPair(S)&&(S=S.value??S.key),S.comment?S.comment+=`
|
|
69
|
+
`+T:S.comment=T,N.comment=N.comment.substring(T.length+1)}}if(!o&&!A&&!N.found){let T=k?n(t,k,N,i):e(t,N.end,A,null,N,i);u.items.push(T),f=T.range[2],xs(k)&&i(T.range,"BLOCK_IN_FLOW",Ds)}else{t.atKey=!0;let T=N.end,S=E?n(t,E,N,i):e(t,T,v,null,N,i);xs(E)&&i(S.range,"BLOCK_IN_FLOW",Ds),t.atKey=!1;let P=qo.resolveProps(A??[],{flow:l,indicator:"map-value-ind",next:k,offset:S.range[2],onError:i,parentIndent:s.indent,startOnNewline:!1});if(P.found){if(!o&&!N.found&&t.options.strict){if(A)for(let L of A){if(L===P.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}N.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 k&&("source"in k&&k.source?.[0]===":"?i(k,"MISSING_CHAR",`Missing space after : in ${l}`):i(P.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let H=k?n(t,k,P,i):P.found?e(t,P.end,A,null,P,i):null;H?xs(k)&&i(H.range,"BLOCK_IN_FLOW",Ds):P.comment&&(S.comment?S.comment+=`
|
|
70
|
+
`+P.comment:S.comment=P.comment);let be=new $f.Pair(S,H);if(t.options.keepSourceTokens&&(be.srcToken=w),o){let L=u;Ff.mapIncludes(t,L.items,S)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(be)}else{let L=new Ro.YAMLMap(t.schema);L.flow=!0,L.items.push(be);let vi=(H??S).range;L.range=[S.range[0],vi[1],vi[2]],u.items.push(L)}f=H?H.range[2]:P.end}}let d=o?"}":"]",[g,...b]=s.end,h=f;if(g?.source===d)h=g.offset+g.source.length;else{let m=l[0].toUpperCase()+l.substring(1),w=p?`${m} must end with a ${d}`:`${m} in block collection must be sufficiently indented and end with a ${d}`;i(f,p?"MISSING_CHAR":"BAD_INDENT",w),g&&g.source.length!==1&&b.unshift(g)}if(b.length>0){let m=jf.resolveEnd(b,h,t.options.strict,i);m.comment&&(u.comment?u.comment+=`
|
|
71
|
+
`+m.comment:u.comment=m.comment),u.range=[s.offset,h,m.offset]}else u.range=[s.offset,h,h];return u}a(Uf,"resolveFlowCollection");_o.resolveFlowCollection=Uf});var xo=y(Do=>{"use strict";var Vf=O(),Wf=I(),Yf=ne(),Jf=se(),Hf=To(),Gf=Po(),Qf=Mo();function $s(n,e,t,s,i,r){let o=t.type==="block-map"?Hf.resolveBlockMap(n,e,t,s,r):t.type==="block-seq"?Gf.resolveBlockSeq(n,e,t,s,r):Qf.resolveFlowCollection(n,e,t,s,r),l=o.constructor;return i==="!"||i===l.tagName?(o.tag=l.tagName,o):(i&&(o.tag=i),o)}a($s,"resolveCollection");function Xf(n,e,t,s,i){let r=s.tag,o=r?e.directives.tagName(r.source,d=>i(r,"TAG_RESOLVE_FAILED",d)):null;if(t.type==="block-seq"){let{anchor:d,newlineAfterProp:g}=s,b=d&&r?d.offset>r.offset?d:r:d??r;b&&(!g||g.offset<b.offset)&&i(b,"MISSING_CHAR","Missing newline after block sequence props")}let l=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!r||!o||o==="!"||o===Yf.YAMLMap.tagName&&l==="map"||o===Jf.YAMLSeq.tagName&&l==="seq")return $s(n,e,t,i,o);let c=e.schema.tags.find(d=>d.tag===o&&d.collection===l);if(!c){let d=e.schema.knownTags[o];if(d?.collection===l)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?i(r,"BAD_COLLECTION_TYPE",`${d.tag} used for ${l} collection, but expects ${d.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),$s(n,e,t,i,o)}let u=$s(n,e,t,i,o,c),p=c.resolve?.(u,d=>i(r,"TAG_RESOLVE_FAILED",d),e.options)??u,f=Vf.isNode(p)?p:new Wf.Scalar(p);return f.range=u.range,f.tag=o,c?.format&&(f.format=c.format),f}a(Xf,"composeCollection");Do.composeCollection=Xf});var js=y($o=>{"use strict";var Bs=I();function zf(n,e,t){let s=e.offset,i=Zf(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};let r=i.mode===">"?Bs.Scalar.BLOCK_FOLDED:Bs.Scalar.BLOCK_LITERAL,o=e.source?ed(e.source):[],l=o.length;for(let h=o.length-1;h>=0;--h){let m=o[h][1];if(m===""||m==="\r")l=h;else break}if(l===0){let h=i.chomp==="+"&&o.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,o.length-1)):"",m=s+i.length;return e.source&&(m+=e.source.length),{value:h,type:r,comment:i.comment,range:[s,m,m]}}let c=e.indent+i.indent,u=e.offset+i.length,p=0;for(let h=0;h<l;++h){let[m,w]=o[h];if(w===""||w==="\r")i.indent===0&&m.length>c&&(c=m.length);else{m.length<c&&t(u+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=m.length),p=h,c===0&&!n.atRoot&&t(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=m.length+w.length+1}for(let h=o.length-1;h>=l;--h)o[h][0].length>c&&(l=h+1);let f="",d="",g=!1;for(let h=0;h<p;++h)f+=o[h][0].slice(c)+`
|
|
73
|
+
`;for(let h=p;h<l;++h){let[m,w]=o[h];u+=m.length+w.length+1;let v=w[w.length-1]==="\r";if(v&&(w=w.slice(0,-1)),w&&m.length<c){let A=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(u-w.length-(v?2:1),"BAD_INDENT",A),m=""}r===Bs.Scalar.BLOCK_LITERAL?(f+=d+m.slice(c)+w,d=`
|
|
74
|
+
`):m.length>c||w[0]===" "?(d===" "?d=`
|
|
75
|
+
`:!g&&d===`
|
|
76
|
+
`&&(d=`
|
|
77
|
+
|
|
78
|
+
`),f+=d+m.slice(c)+w,d=`
|
|
79
|
+
`,g=!0):w===""?d===`
|
|
80
|
+
`?f+=`
|
|
81
|
+
`:d=`
|
|
82
|
+
`:(f+=d+w,d=" ",g=!1)}switch(i.chomp){case"-":break;case"+":for(let h=l;h<o.length;++h)f+=`
|
|
83
|
+
`+o[h][0].slice(c);f[f.length-1]!==`
|
|
84
|
+
`&&(f+=`
|
|
85
|
+
`);break;default:f+=`
|
|
86
|
+
`}let b=s+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[s,b,b]}}a(zf,"resolveBlockScalar");function Zf({offset:n,props:e},t,s){if(e[0].type!=="block-scalar-header")return s(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],r=i[0],o=0,l="",c=-1;for(let d=1;d<i.length;++d){let g=i[d];if(!l&&(g==="-"||g==="+"))l=g;else{let b=Number(g);!o&&b?o=b:c===-1&&(c=n+d)}}c!==-1&&s(c,"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 g=e[d];switch(g.type){case"space":u=!0;case"newline":f+=g.source.length;break;case"comment":t&&!u&&s(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=g.source.length,p=g.source.substring(1);break;case"error":s(g,"UNEXPECTED_TOKEN",g.message),f+=g.source.length;break;default:{let b=`Unexpected token in block scalar header: ${g.type}`;s(g,"UNEXPECTED_TOKEN",b);let h=g.source;h&&typeof h=="string"&&(f+=h.length)}}}return{mode:r,indent:o,chomp:l,comment:p,length:f}}a(Zf,"parseBlockScalarHeader");function ed(n){let e=n.split(/\n( *)/),t=e[0],s=t.match(/^( *)/),r=[s?.[1]?[s[1],t.slice(s[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}a(ed,"splitLines");$o.resolveBlockScalar=zf});var Fs=y(jo=>{"use strict";var Ks=I(),td=Ie();function nd(n,e,t){let{offset:s,type:i,source:r,end:o}=n,l,c,u=a((d,g,b)=>t(s+d,g,b),"_onError");switch(i){case"scalar":l=Ks.Scalar.PLAIN,c=sd(r,u);break;case"single-quoted-scalar":l=Ks.Scalar.QUOTE_SINGLE,c=id(r,u);break;case"double-quoted-scalar":l=Ks.Scalar.QUOTE_DOUBLE,c=rd(r,u);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}let p=s+r.length,f=td.resolveEnd(o,p,e,t);return{value:c,type:l,comment:f.comment,range:[s,p,f.offset]}}a(nd,"resolveFlowScalar");function sd(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Bo(n)}a(sd,"plainValue");function id(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),Bo(n.slice(1,-1)).replace(/''/g,"'")}a(id,"singleQuotedValue");function Bo(n){let e=/(.*?)\r?\n/sy,t=e.exec(n);if(!t)return n;let s,i;try{s=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{s=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let r=t[1].replace(s,""),o=" ",l=e.lastIndex;for(;t=e.exec(n);){let u=t[1].replace(i,"");u===""?o===`
|
|
87
|
+
`?r+=o:o=`
|
|
88
|
+
`:(r+=o+u,o=" "),l=e.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=l,t=c.exec(n),r+o+(t?.[1]??"")}a(Bo,"unfoldLines");function rd(n,e){let t="";for(let s=1;s<n.length-1;++s){let i=n[s];if(!(i==="\r"&&n[s+1]===`
|
|
89
|
+
`))if(i===`
|
|
90
|
+
`){let{fold:r,offset:o}=od(n,s);t+=r,s=o}else if(i==="\\"){let r=n[++s],o=ad[r];if(o)t+=o;else if(r===`
|
|
91
|
+
`)for(r=n[s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="\r"&&n[s+1]===`
|
|
92
|
+
`)for(r=n[++s+1];r===" "||r===" ";)r=n[++s+1];else if(r==="x"||r==="u"||r==="U"){let l=r==="x"?2:r==="u"?4:8;t+=ld(n,s+1,l,e),s+=l}else{let l=n.substr(s-1,2);e(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),t+=l}}else if(i===" "||i===" "){let r=s,o=n[s+1];for(;o===" "||o===" ";)o=n[++s+1];o!==`
|
|
93
|
+
`&&!(o==="\r"&&n[s+2]===`
|
|
94
|
+
`)&&(t+=s>r?n.slice(r,s+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}a(rd,"doubleQuotedValue");function od(n,e){let t="",s=n[e+1];for(;(s===" "||s===" "||s===`
|
|
95
|
+
`||s==="\r")&&!(s==="\r"&&n[e+2]!==`
|
|
96
|
+
`);)s===`
|
|
97
|
+
`&&(t+=`
|
|
98
|
+
`),e+=1,s=n[e+1];return t||(t=" "),{fold:t,offset:e}}a(od,"foldNewline");var ad={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 ld(n,e,t,s){let i=n.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let l=n.substr(e-2,t+2);return s(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}a(ld,"parseCharCode");jo.resolveFlowScalar=nd});var Uo=y(Fo=>{"use strict";var he=O(),Ko=I(),cd=js(),ud=Fs();function fd(n,e,t,s){let{value:i,type:r,comment:o,range:l}=e.type==="block-scalar"?cd.resolveBlockScalar(n,e,s):ud.resolveFlowScalar(e,n.options.strict,s),c=t?n.directives.tagName(t.source,f=>s(t,"TAG_RESOLVE_FAILED",f)):null,u;n.options.stringKeys&&n.atKey?u=n.schema[he.SCALAR]:c?u=dd(n.schema,i,c,t,s):e.type==="scalar"?u=hd(n,i,e,s):u=n.schema[he.SCALAR];let p;try{let f=u.resolve(i,d=>s(t??e,"TAG_RESOLVE_FAILED",d),n.options);p=he.isScalar(f)?f:new Ko.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);s(t??e,"TAG_RESOLVE_FAILED",d),p=new Ko.Scalar(i)}return p.range=l,p.source=i,r&&(p.type=r),c&&(p.tag=c),u.format&&(p.format=u.format),o&&(p.comment=o),p}a(fd,"composeScalar");function dd(n,e,t,s,i){if(t==="!")return n[he.SCALAR];let r=[];for(let l of n.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)r.push(l);else return l;for(let l of r)if(l.test?.test(e))return l;let o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[he.SCALAR])}a(dd,"findScalarTagByName");function hd({atKey:n,directives:e,schema:t},s,i,r){let o=t.tags.find(l=>(l.default===!0||n&&l.default==="key")&&l.test?.test(s))||t[he.SCALAR];if(t.compat){let l=t.compat.find(c=>c.default&&c.test?.test(s))??t[he.SCALAR];if(o.tag!==l.tag){let c=e.tagString(o.tag),u=e.tagString(l.tag),p=`Value may be parsed as either ${c} or ${u}`;r(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}a(hd,"findScalarTagByTest");Fo.composeScalar=fd});var Wo=y(Vo=>{"use strict";function pd(n,e,t){if(e){t??(t=e.length);for(let s=t-1;s>=0;--s){let i=e[s];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++s];i?.type==="space";)n+=i.source.length,i=e[++s];break}}return n}a(pd,"emptyScalarPosition");Vo.emptyScalarPosition=pd});var Ho=y(Vs=>{"use strict";var md=Ke(),gd=O(),yd=xo(),Yo=Uo(),bd=Ie(),Sd=Wo(),wd={composeNode:Jo,composeEmptyNode:Us};function Jo(n,e,t,s){let i=n.atKey,{spaceBefore:r,comment:o,anchor:l,tag:c}=t,u,p=!0;switch(e.type){case"alias":u=vd(n,e,s),(l||c)&&s(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=Yo.composeScalar(n,e,c,s),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=yd.composeCollection(wd,n,e,t,s),l&&(u.anchor=l.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);s(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;s(e,"UNEXPECTED_TOKEN",f),p=!1}}return u??(u=Us(n,e.offset,void 0,null,t,s)),l&&u.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!gd.isScalar(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&s(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(u.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?u.comment=o:u.commentBefore=o),n.options.keepSourceTokens&&p&&(u.srcToken=e),u}a(Jo,"composeNode");function Us(n,e,t,s,{spaceBefore:i,comment:r,anchor:o,tag:l,end:c},u){let p={type:"scalar",offset:Sd.emptyScalarPosition(e,t,s),indent:-1,source:""},f=Yo.composeScalar(n,p,l,u);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=c),f}a(Us,"composeEmptyNode");function vd({options:n},{offset:e,source:t,end:s},i){let r=new md.Alias(t.substring(1));r.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,l=bd.resolveEnd(s,o,n.strict,i);return r.range=[e,o,l.offset],l.comment&&(r.comment=l.comment),r}a(vd,"composeAlias");Vs.composeEmptyNode=Us;Vs.composeNode=Jo});var Xo=y(Qo=>{"use strict";var Ed=st(),Go=Ho(),Ad=Ie(),kd=at();function Nd(n,e,{offset:t,start:s,value:i,end:r},o){let l=Object.assign({_directives:e},n),c=new Ed.Document(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=kd.resolveProps(s,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Go.composeNode(u,i,p,o):Go.composeEmptyNode(u,p.end,s,null,p,o);let f=c.contents.range[2],d=Ad.resolveEnd(r,f,!1,o);return d.comment&&(c.comment=d.comment),c.range=[t,f,d.offset],c}a(Nd,"composeDoc");Qo.composeDoc=Nd});var Ys=y(ea=>{"use strict";var Od=yt("process"),Cd=Ln(),Td=st(),lt=ot(),zo=O(),Id=Xo(),Pd=Ie();function ct(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];let{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}a(ct,"getErrorPos");function Zo(n){let e="",t=!1,s=!1;for(let i=0;i<n.length;++i){let r=n[i];switch(r[0]){case"#":e+=(e===""?"":s?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(r.substring(1)||" "),t=!0,s=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(s=!0),t=!1}}return{comment:e,afterEmptyLine:s}}a(Zo,"parsePrelude");var Ws=class{static{a(this,"Composer")}constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,s,i,r)=>{let o=ct(t);r?this.warnings.push(new lt.YAMLWarning(o,s,i)):this.errors.push(new lt.YAMLParseError(o,s,i))},this.directives=new Cd.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:s,afterEmptyLine:i}=Zo(this.prelude);if(s){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${s}`:s;else if(i||e.directives.docStart||!r)e.commentBefore=s;else if(zo.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];zo.isPair(o)&&(o=o.key);let l=o.commentBefore;o.commentBefore=l?`${s}
|
|
104
|
+
${l}`:s}else{let o=r.commentBefore;r.commentBefore=o?`${s}
|
|
105
|
+
${o}`:s}}if(t){for(let r=0;r<this.errors.length;++r)e.errors.push(this.errors[r]);for(let r=0;r<this.warnings.length;++r)e.warnings.push(this.warnings[r])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Zo(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,s=-1){for(let i of e)yield*this.next(i);yield*this.end(t,s)}*next(e){switch(Od.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,s,i)=>{let r=ct(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Id.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,s=new lt.YAMLParseError(ct(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){let s="Unexpected doc-end without preceding document";this.errors.push(new lt.YAMLParseError(ct(e),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;let t=Pd.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let s=this.doc.comment;this.doc.comment=s?`${s}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new lt.YAMLParseError(ct(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let s=Object.assign({_directives:this.directives},this.options),i=new Td.Document(void 0,s);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};ea.Composer=Ws});var sa=y(fn=>{"use strict";var Ld=js(),Rd=Fs(),qd=ot(),ta=Ye();function _d(n,e=!0,t){if(n){let s=a((i,r,o)=>{let l=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(l,r,o);else throw new qd.YAMLParseError([l,l+1],r,o)},"_onError");switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Rd.resolveFlowScalar(n,e,s);case"block-scalar":return Ld.resolveBlockScalar({options:{strict:e}},n,s)}}return null}a(_d,"resolveAsScalar");function Md(n,e){let{implicitKey:t=!1,indent:s,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,l=ta.stringifyString({type:o,value:n},{implicitKey:t,indent:s>0?" ".repeat(s):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:s,source:`
|
|
107
|
+
`}];switch(l[0]){case"|":case">":{let u=l.indexOf(`
|
|
108
|
+
`),p=l.substring(0,u),f=l.substring(u+1)+`
|
|
109
|
+
`,d=[{type:"block-scalar-header",offset:r,indent:s,source:p}];return na(d,c)||d.push({type:"newline",offset:-1,indent:s,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:r,indent:s,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:s,source:l,end:c};case"'":return{type:"single-quoted-scalar",offset:r,indent:s,source:l,end:c};default:return{type:"scalar",offset:r,indent:s,source:l,end:c}}}a(Md,"createScalarToken");function Dd(n,e,t={}){let{afterKey:s=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,l="indent"in n?n.indent:null;if(s&&typeof l=="number"&&(l+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let u=n.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=ta.stringifyString({type:o,value:e},{implicitKey:i||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":xd(n,c);break;case'"':Js(n,c,"double-quoted-scalar");break;case"'":Js(n,c,"single-quoted-scalar");break;default:Js(n,c,"scalar")}}a(Dd,"setScalarValue");function xd(n,e){let t=e.indexOf(`
|
|
111
|
+
`),s=e.substring(0,t),i=e.substring(t+1)+`
|
|
112
|
+
`;if(n.type==="block-scalar"){let r=n.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=s,n.source=i}else{let{offset:r}=n,o="indent"in n?n.indent:-1,l=[{type:"block-scalar-header",offset:r,indent:o,source:s}];na(l,"end"in n?n.end:void 0)||l.push({type:"newline",offset:-1,indent:o,source:`
|
|
113
|
+
`});for(let c of Object.keys(n))c!=="type"&&c!=="offset"&&delete n[c];Object.assign(n,{type:"block-scalar",indent:o,props:l,source:i})}}a(xd,"setBlockScalarValue");function na(n,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}a(na,"addEndtoBlockProps");function Js(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{let s=n.props.slice(1),i=e.length;n.props[0].type==="block-scalar-header"&&(i-=n.props[0].source.length);for(let r of s)r.offset+=i;delete n.props,Object.assign(n,{type:t,source:e,end:s});break}case"block-map":case"block-seq":{let i={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
114
|
+
`};delete n.items,Object.assign(n,{type:t,source:e,end:[i]});break}default:{let s="indent"in n?n.indent:-1,i="end"in n&&Array.isArray(n.end)?n.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(n))r!=="type"&&r!=="offset"&&delete n[r];Object.assign(n,{type:t,indent:s,source:e,end:i})}}}a(Js,"setFlowScalarValue");fn.createScalarToken=Md;fn.resolveAsScalar=_d;fn.setScalarValue=Dd});var ra=y(ia=>{"use strict";var $d=a(n=>"type"in n?hn(n):dn(n),"stringify");function hn(n){switch(n.type){case"block-scalar":{let e="";for(let t of n.props)e+=hn(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(let t of n.items)e+=dn(t);return e}case"flow-collection":{let e=n.start.source;for(let t of n.items)e+=dn(t);for(let t of n.end)e+=t.source;return e}case"document":{let e=dn(n);if(n.end)for(let t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(let t of n.end)e+=t.source;return e}}}a(hn,"stringifyToken");function dn({start:n,key:e,sep:t,value:s}){let i="";for(let r of n)i+=r.source;if(e&&(i+=hn(e)),t)for(let r of t)i+=r.source;return s&&(i+=hn(s)),i}a(dn,"stringifyItem");ia.stringify=$d});var ca=y(la=>{"use strict";var Hs=Symbol("break visit"),Bd=Symbol("skip children"),oa=Symbol("remove item");function pe(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),aa(Object.freeze([]),n,e)}a(pe,"visit");pe.BREAK=Hs;pe.SKIP=Bd;pe.REMOVE=oa;pe.itemAtPath=(n,e)=>{let t=n;for(let[s,i]of e){let r=t?.[s];if(r&&"items"in r)t=r.items[i];else return}return t};pe.parentCollection=(n,e)=>{let t=pe.itemAtPath(n,e.slice(0,-1)),s=e[e.length-1][0],i=t?.[s];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function aa(n,e,t){let s=t(e,n);if(typeof s=="symbol")return s;for(let i of["key","value"]){let r=e[i];if(r&&"items"in r){for(let o=0;o<r.items.length;++o){let l=aa(Object.freeze(n.concat([[i,o]])),r.items[o],t);if(typeof l=="number")o=l-1;else{if(l===Hs)return Hs;l===oa&&(r.items.splice(o,1),o-=1)}}typeof s=="function"&&i==="key"&&(s=s(e,n))}}return typeof s=="function"?s(e,n):s}a(aa,"_visit");la.visit=pe});var pn=y(M=>{"use strict";var Gs=sa(),jd=ra(),Kd=ca(),Qs="\uFEFF",Xs="",zs="",Zs="",Fd=a(n=>!!n&&"items"in n,"isCollection"),Ud=a(n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar"),"isScalar");function Vd(n){switch(n){case Qs:return"<BOM>";case Xs:return"<DOC>";case zs:return"<FLOW_END>";case Zs:return"<SCALAR>";default:return JSON.stringify(n)}}a(Vd,"prettyToken");function Wd(n){switch(n){case Qs:return"byte-order-mark";case Xs:return"doc-mode";case zs:return"flow-error-end";case Zs: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(n[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}a(Wd,"tokenType");M.createScalarToken=Gs.createScalarToken;M.resolveAsScalar=Gs.resolveAsScalar;M.setScalarValue=Gs.setScalarValue;M.stringify=jd.stringify;M.visit=Kd.visit;M.BOM=Qs;M.DOCUMENT=Xs;M.FLOW_END=zs;M.SCALAR=Zs;M.isCollection=Fd;M.isScalar=Ud;M.prettyToken=Vd;M.tokenType=Wd});var ni=y(fa=>{"use strict";var ut=pn();function B(n){switch(n){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}a(B,"isEmpty");var ua=new Set("0123456789ABCDEFabcdef"),Yd=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),mn=new Set(",[]{}"),Jd=new Set(` ,[]{}
|
|
118
|
+
\r `),ei=a(n=>!n||Jd.has(n),"isNotAnchorChar"),ti=class{static{a(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,t=!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=!t;let s=this.next??"stream";for(;s&&(t||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
119
|
+
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
120
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let s=0;for(;t===" ";)t=this.buffer[++s+e];if(t==="\r"){let i=this.buffer[s+e+1];if(i===`
|
|
121
|
+
`||!i&&!this.atEnd)return e+s+1}return t===`
|
|
122
|
+
`||s>=this.indentNext||!t&&!this.atEnd?e+s:-1}if(t==="-"||t==="."){let s=this.buffer.substr(e,3);if((s==="---"||s==="...")&&B(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]===ut.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,s=e.indexOf("#");for(;s!==-1;){let r=e[s-1];if(r===" "||r===" "){t=s-1;break}else s=e.indexOf("#",s+1)}for(;;){let r=e[t-1];if(r===" "||r===" ")t-=1;else break}let i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield ut.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 t=this.peek(3);if((t==="---"||t==="...")&&B(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!B(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&B(t)){let s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ei),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,s=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=s=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&i[0]!=="#"||s===0&&(i.startsWith("---")||i.startsWith("..."))&&B(i[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield ut.FLOW_END,yield*this.parseLineStart();let r=0;for(;i[r]===",";)r+=yield*this.pushCount(1),r+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r+=yield*this.pushIndicators(),i[r]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-r),"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(ei),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||B(o)||o===",")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),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let r=0;for(;this.buffer[t-1-r]==="\\";)r+=1;if(r%2===0)break;t=this.buffer.indexOf('"',t+1)}let s=this.buffer.substring(0,t),i=s.indexOf(`
|
|
124
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=s.indexOf(`
|
|
125
|
+
`,r)}i!==-1&&(t=i-(s[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>B(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":t+=1;break;case`
|
|
126
|
+
`:e=r,t=0;break;case"\r":{let o=this.buffer[r+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
127
|
+
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let r=this.continueScalar(e+1);if(r===-1)break;e=this.buffer.indexOf(`
|
|
128
|
+
`,r)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
|
|
129
|
+
`;)s=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let r=e-1,o=this.buffer[r];o==="\r"&&(o=this.buffer[--r]);let l=r;for(;o===" ";)o=this.buffer[--r];if(o===`
|
|
130
|
+
`&&r>=this.pos&&r+1+t>l)e=r;else break}while(!0);return yield ut.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){let r=this.buffer[s+1];if(B(r)||e&&mn.has(r))break;t=s}else if(B(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===`
|
|
131
|
+
`?(s+=1,i=`
|
|
132
|
+
`,r=this.buffer[s+1]):t=s),r==="#"||e&&mn.has(r))break;if(i===`
|
|
133
|
+
`){let o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(e&&mn.has(i))break;t=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield ut.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let s=this.buffer.slice(this.pos,e);return s?(yield s,this.pos+=s.length,s.length):(t&&(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(ei),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,s=this.charAt(1);if(B(s)||t&&mn.has(s)){t?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,t=this.buffer[e];for(;!B(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Yd.has(t))t=this.buffer[++e];else if(t==="%"&&ua.has(this.buffer[e+1])&&ua.has(this.buffer[e+2]))t=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 t=this.pos-1,s;do s=this.buffer[++t];while(s===" "||e&&s===" ");let i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,s=this.buffer[t];for(;!e(s);)s=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};fa.Lexer=ti});var ii=y(da=>{"use strict";var si=class{static{a(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,s=this.lineStarts.length;for(;t<s;){let r=t+s>>1;this.lineStarts[r]<e?t=r+1:s=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}};da.LineCounter=si});var oi=y(ya=>{"use strict";var Hd=yt("process"),ha=pn(),Gd=ni();function ie(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}a(ie,"includesToken");function pa(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}a(pa,"findNonEmptyIndex");function ga(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}a(ga,"isFlowToken");function gn(n){switch(n.type){case"document":return n.start;case"block-map":{let e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}a(gn,"getPrevProps");function Pe(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}a(Pe,"getFirstKeyStartProps");function yn(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}a(yn,"arrayPushArray");function ma(n){if(n.start.type==="flow-seq-start")for(let e of n.items)e.sep&&!e.value&&!ie(e.start,"explicit-key-ind")&&!ie(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ga(e.value)?e.value.end?yn(e.value.end,e.sep):e.value.end=e.sep:yn(e.start,e.sep),delete e.sep)}a(ma,"fixFlowSeqItems");var ri=class{static{a(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 Gd.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let s of this.lexer.lex(e,t))yield*this.next(s);t||(yield*this.end())}*next(e){if(this.source=e,Hd.env.LOG_TOKENS&&console.log("|",ha.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=ha.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let s=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:s,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 t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let s=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in s?s.indent:0:t.type==="flow-collection"&&s.type==="document"&&(t.indent=0),t.type==="flow-collection"&&ma(t),s.type){case"document":s.value=t;break;case"block-scalar":s.props.push(t);break;case"block-map":{let i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&pa(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(s.type==="document"?s.end=i.start:s.items.push({start:i.start}),t.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":{pa(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 t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=gn(this.peek(2)),s=Pe(t),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}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 t=this.source.indexOf(`
|
|
136
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
137
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){yn(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let s=!this.onKeyLine&&this.indent===e.indent,i=s&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",r=[];if(i&&t.sep&&!t.value){let o=[];for(let l=0;l<t.sep.length;++l){let c=t.sep[l];switch(c.type){case"newline":o.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(r.push(this.sourceToken),e.items.push({start:r,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(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ie(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(ga(t.key)&&!ie(t.sep,"newline")){let o=Pe(t.start),l=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ie(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Pe(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ie(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ie(t.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 s&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let s="end"in t.value?t.value.end:void 0;(Array.isArray(s)?s[s.length-1]:void 0)?.type==="comment"?s?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){yn(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ie(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let s=this.startBlockValue(e);if(s){this.stack.push(s);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while(s?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let s=this.startBlockValue(e);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{let s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===e.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){let i=gn(s),r=Pe(i);ma(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
138
|
+
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
139
|
+
`,t)+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 t=gn(e),s=Pe(t);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=gn(e),s=Pe(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(s=>s.type==="newline"||s.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())}}};ya.Parser=ri});var Ea=y(dt=>{"use strict";var ba=Ys(),Qd=st(),ft=ot(),Xd=Vn(),zd=O(),Zd=ii(),Sa=oi();function wa(n){let e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Zd.LineCounter||null,prettyErrors:e}}a(wa,"parseOptions");function eh(n,e={}){let{lineCounter:t,prettyErrors:s}=wa(e),i=new Sa.Parser(t?.addNewLine),r=new ba.Composer(e),o=Array.from(r.compose(i.parse(n)));if(s&&t)for(let l of o)l.errors.forEach(ft.prettifyError(n,t)),l.warnings.forEach(ft.prettifyError(n,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}a(eh,"parseAllDocuments");function va(n,e={}){let{lineCounter:t,prettyErrors:s}=wa(e),i=new Sa.Parser(t?.addNewLine),r=new ba.Composer(e),o=null;for(let l of r.compose(i.parse(n),!0,n.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new ft.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&t&&(o.errors.forEach(ft.prettifyError(n,t)),o.warnings.forEach(ft.prettifyError(n,t))),o}a(va,"parseDocument");function th(n,e,t){let s;typeof e=="function"?s=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=va(n,t);if(!i)return null;if(i.warnings.forEach(r=>Xd.warn(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},t))}a(th,"parse");function nh(n,e,t){let s=null;if(typeof e=="function"||Array.isArray(e)?s=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(n===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return zd.isDocument(n)&&!s?n.toString(t):new Qd.Document(n,s,t).toString(t)}a(nh,"stringify");dt.parse=th;dt.parseAllDocuments=eh;dt.parseDocument=va;dt.stringify=nh});var ka=y(C=>{"use strict";var sh=Ys(),ih=st(),rh=Os(),ai=ot(),oh=Ke(),re=O(),ah=ee(),lh=I(),ch=ne(),uh=se(),fh=pn(),dh=ni(),hh=ii(),ph=oi(),bn=Ea(),Aa=xe();C.Composer=sh.Composer;C.Document=ih.Document;C.Schema=rh.Schema;C.YAMLError=ai.YAMLError;C.YAMLParseError=ai.YAMLParseError;C.YAMLWarning=ai.YAMLWarning;C.Alias=oh.Alias;C.isAlias=re.isAlias;C.isCollection=re.isCollection;C.isDocument=re.isDocument;C.isMap=re.isMap;C.isNode=re.isNode;C.isPair=re.isPair;C.isScalar=re.isScalar;C.isSeq=re.isSeq;C.Pair=ah.Pair;C.Scalar=lh.Scalar;C.YAMLMap=ch.YAMLMap;C.YAMLSeq=uh.YAMLSeq;C.CST=fh;C.Lexer=dh.Lexer;C.LineCounter=hh.LineCounter;C.Parser=ph.Parser;C.parse=bn.parse;C.parseAllDocuments=bn.parseAllDocuments;C.parseDocument=bn.parseDocument;C.stringify=bn.stringify;C.visit=Aa.visit;C.visitAsync=Aa.visitAsync});import{readFile as qp}from"node:fs/promises";import wi from"node:path";import x from"node:process";import{parseArgs as _p}from"node:util";function Ei(n){return n instanceof Error||Object.prototype.toString.call(n)==="[object Error]"}a(Ei,"isError");function ae(n){try{return Ei(n)&&typeof n.message=="string"&&n.message!==""?n.message:String(n)}catch{return"[unstringifiable value]"}}a(ae,"describeError");var Ai={name:"codeassembly-guidance",version:"0.2.0",description:"The CodeAssembly library of agent guidance: rulebooks, skills, and subagents that the codeassembly CLI deploys",keywords:["agents","ai","claude-code","rulebooks","skills"],homepage:"https://github.com/williamthorsen/codeassembly/tree/main/packages/guidance#readme",bugs:{url:"https://github.com/williamthorsen/codeassembly/issues"},repository:{type:"git",url:"https://github.com/williamthorsen/codeassembly.git",directory:"packages/guidance"},license:"ISC",author:"William Thorsen <william@thorsen.dev> (https://github.com/williamthorsen)",sideEffects:!1,type:"module",exports:{"./package.json":"./package.json","./schemas/*.json":"./schemas/*.json"},bin:{"codeassembly-validate-preferences":"bin/codeassembly-validate-preferences.js"},files:["bin","!bin/__tests__","content","!content/**/__tests__","!content/test-utils","CHANGELOG.md",".meta/changelog.json","schemas"],scripts:{build:"codeassembly bundle-helpers && node scripts/generate-work-types.ts","check:content":"codeassembly validate && codeassembly bundle-helpers --check && node scripts/generate-work-types.ts --check","check:post":"pnpm run check:content","check:strict:post":"pnpm run check:content",prepack:"node scripts/generate-schemas.ts","test:post":"pnpm run test:sh && pnpm run test:smoke","test:sh":"bash scripts/test-sh.sh","test:smoke":"node scripts/__tests__/smoke-test-skill-helpers.ts"},devDependencies:{"@hyperjump/json-schema":"1.18.0","@types/node":"catalog:","@williamthorsen/change-grammar":"catalog:","@williamthorsen/kb":"workspace:*","@williamthorsen/nmr":"catalog:","@williamthorsen/toolbelt.errors":"catalog:","@williamthorsen/toolbelt.terminal":"catalog:","@williamthorsen/toolbelt.testing":"catalog:",codeassembly:"workspace:*",esbuild:"catalog:",eslint:"catalog:","happy-dom":"catalog:",marklassian:"1.2.1",ulid:"3.0.2",vitest:"catalog:",yaml:"catalog:",zod:"catalog:"},engines:{node:">=24"},codeassembly:{content:"content"}};import{realpathSync as ki}from"node:fs";import Ni from"node:process";import{fileURLToPath as Il}from"node:url";function Oi(n,e){let t=Ni.argv[1];if(t===void 0)return!1;try{return ki(Il(n))===ki(t)}catch(s){return Ni.stderr.write(`${e}: warning: could not determine entry point: ${ae(s)}
|
|
140
|
+
`),!0}}a(Oi,"isEntryPoint");function Ci(n,e){let t=Math.max(1,Math.floor(n.length/3)),s;for(let i of e.toSorted()){let r=Pl(n.toLowerCase(),i.toLowerCase());r<=t&&(s===void 0||r<s.distance)&&(s={key:i,distance:r})}return s?.key}a(Ci,"findNearestKey");function Pl(n,e){let t=Array.from({length:e.length+1},(s,i)=>i);for(let s=1;s<=n.length;s++){let i=[s];for(let r=1;r<=e.length;r++){let o=(t[r-1]??0)+(n[s-1]===e[r-1]?0:1);i[r]=Math.min((t[r]??0)+1,(i[r-1]??0)+1,o)}t=i}return t[e.length]??0}a(Pl,"measureEditDistance");function bt(n){let e;for(let t=0;t<n.length;t+=1){let s=n[t];if(s==="\\"&&e!=="'"){t+=1;continue}if(e!==void 0){s===e&&(e=void 0);continue}if(s==='"'||s==="'"){e=s;continue}if(s==="#"&&(t===0||/\s/.test(n[t-1]??"")))return t}return-1}a(bt,"findHashCommentStart");function De(n){let e=0;for(let t of n)t===`
|
|
141
|
+
`&&(e+=1);return e}a(De,"countNewlines");function V(n,e){let t=0;for(let s=0;s<e&&s<n.length;s+=1)n[s]===`
|
|
142
|
+
`&&(t+=1);return t}a(V,"countNewlinesBefore");function le(n){let e=[],t=/`+/g,s=t.exec(n);for(;s!==null;){let i=ql(n,t,s[0].length);if(i===null){t.lastIndex=s.index+s[0].length,s=t.exec(n);continue}e.push({start:s.index,end:i.index+i[0].length}),s=t.exec(n)}return e}a(le,"findCodeSpans");function G(n,e){let t=le(n.text),s=[],i=-1;for(let r of n.text.matchAll(e)){let o=r.index;if(t.some(c=>o>=c.start&&o<c.end))continue;let l=Se(n.text,o,o+r[0].length);l.start!==i&&(i=l.start,s.push({line:n.line+V(n.text,l.start),sentence:j(n.text.slice(l.start,l.end))}))}return s}a(G,"findMatchingSentences");function Ti(n,e,t){let s=Se(n,e,t);return j(n.slice(s.start,s.end))}a(Ti,"findSentence");function Se(n,e,t){let s=new RegExp(Pi),i=0,r=s.exec(n);for(;r!==null;){let l=r.index+1;if(l>=t)break;l<=e&&(i=l),r=s.exec(n)}let o=r===null?n.length:Math.max(r.index+1,t);return{start:Li(n,i,o),end:o}}a(Se,"findSentenceBounds");function j(n){return n.replaceAll(/\s+/g," ").trim()}a(j,"flattenWhitespace");function St(n){return Rl(n)>=Ll}a(St,"isProseLiteral");function Ii(n){let e=n.matchAll(Pi).map(i=>i.index+1).toArray();e.at(-1)!==n.length&&e.push(n.length);let t=[],s=0;for(let i of e){let r=Li(n,s,i);r<i&&t.push({start:r,end:i}),s=i}return t}a(Ii,"listSentenceBounds");var Ll=3,Pi=/[.!?](?=\s|$)/g;function Rl(n){return n.split(/\s+/).filter(e=>/[a-z]{2}/i.test(e)).length}a(Rl,"countWords");function ql(n,e,t){let s=e.exec(n);for(;s!==null&&s[0].length!==t;)s=e.exec(n);return s}a(ql,"findClosingRun");function Li(n,e,t){let s=e;for(;s<t&&/\s/.test(n[s]??"");)s+=1;return s}a(Li,"skipWhitespace");var _l=new Set([" "," ","\r"]),Ml=new Set(['"',"'","`"]),Dl=new Set(["(",",","=",":","[","!","&","|","?","{",";","+","-","*","%","<",">"]);function Ri(n,e){let t=[],s;function i(){s!==void 0&&t.push({file:n,line:s.line,text:s.texts.join(`
|
|
143
|
+
`)}),s=void 0}a(i,"flushLineComment");let r=1,o="";for(let l=0;l<e.length;l+=1){let c=e[l]??"";if(c===`
|
|
144
|
+
`){r+=1;continue}if(!_l.has(c)){if(c==="/"&&e[l+1]==="/"){let u=$l(e,l),p=_i(e.slice(l+2,u));s!==void 0&&s.line+s.texts.length===r?s.texts.push(p):(i(),s={line:r,texts:[p]}),l=u-1;continue}if(i(),c==="/"&&e[l+1]==="*"){let u=e.indexOf("*/",l+2),p=u===-1?e.length:u,f=e.slice(l+2,p),d=xl(n,r,f);d!==void 0&&t.push(d),r+=De(f),l=p+1,o="/";continue}if(c==="/"&&Dl.has(o)){l=jl(e,l)-1;continue}if(Ml.has(c)){let u=Bl(e,l,c),p=e.slice(l+1,Math.min(u,e.length));St(p)&&t.push({file:n,line:r,text:p}),r+=De(p),l=u,o=c;continue}o=c}}return i(),t}a(Ri,"extractScriptProse");function qi(n,e){let t=[],s;function i(){s!==void 0&&t.push({file:n,line:s.line,text:s.texts.join(`
|
|
145
|
+
`)}),s=void 0}a(i,"flush");for(let[r,o]of e.split(`
|
|
146
|
+
`).entries()){let l=r===0&&o.startsWith("#!")?-1:bt(o);if(l===-1){i();continue}let c=o.slice(l).replace(/^#+/,"").trim();s!==void 0&&s.line+s.texts.length===r+1?s.texts.push(c):(i(),s={line:r+1,texts:[c]})}return i(),t}a(qi,"extractShellProse");function xl(n,e,t){let s=t.split(`
|
|
147
|
+
`).map(_i),i=0;for(;i<s.length&&s[i]==="";)i+=1;let r=s.length;for(;r>i&&s[r-1]==="";)r-=1;if(i!==r)return{file:n,line:e+i,text:s.slice(i,r).join(`
|
|
148
|
+
`)}}a(xl,"buildBlockCommentSpan");function $l(n,e){let t=n.indexOf(`
|
|
149
|
+
`,e);return t===-1?n.length:t}a($l,"findLineEnd");function Bl(n,e,t){for(let s=e+1;s<n.length;s+=1){let i=n[s];if(i==="\\"){s+=1;continue}if(i===t||i===`
|
|
150
|
+
`&&t!=="`")return s}return n.length}a(Bl,"findStringEnd");function jl(n,e){let t=!1;for(let s=e+1;s<n.length;s+=1){let i=n[s];if(i==="\\"){s+=1;continue}if(i===`
|
|
151
|
+
`)return s;if(i==="[")t=!0;else if(i==="]")t=!1;else if(i==="/"&&!t)return s+1}return n.length}a(jl,"skipRegexLiteral");function _i(n){return n.replace(/^\s*\*+\s?/,"").trim()}a(_i,"stripCommentMarkers");var J=Cl(ka(),1);var ht=class extends Error{static{a(this,"UnparsableYamlError")}};function li(n){let e=new J.LineCounter,t=(0,J.parseAllDocuments)(n.content,{lineCounter:e,uniqueKeys:!1}),s=t.flatMap(o=>o.errors)[0];if(s!==void 0)throw new ht(s.message);let i=[],r=new Set;for(let o of t)(0,J.visit)(o,{Scalar(l,c){if(l==="key")return;let u=mh({file:n.file,content:n.content,node:c,lineCounter:e,continued:r});u!==void 0&&i.push(u)}});return i.push(...gh(n,r)),i.toSorted((o,l)=>o.line-l.line)}a(li,"extractYamlProse");function mh(n){let{node:e}=n,t=e.range?.[0],s=e.range?.[1];if(typeof e.value!="string"||t===void 0||s===void 0)return;let i=n.content.slice(t,s).trimEnd(),r=n.lineCounter.linePos(t).line,o=n.lineCounter.linePos(t+i.length).line;for(let l=r+1;l<=o;l+=1)n.continued.add(l);if(St(e.value)){if(r===o)return{file:n.file,line:r,text:e.value.replaceAll(`
|
|
152
|
+
`," ")};if(e.type===J.Scalar.BLOCK_LITERAL||e.type===J.Scalar.BLOCK_FOLDED){let l=i.slice(i.indexOf(`
|
|
153
|
+
`)+1);return{file:n.file,line:r+1,text:yh(l)}}return{file:n.file,line:r,text:bh(Sh(i))}}}a(mh,"buildScalarSpan");function gh(n,e){let t=[],s;function i(){s!==void 0&&t.push({file:n.file,line:s.line,text:s.texts.join(`
|
|
154
|
+
`)}),s=void 0}a(i,"flush");for(let[r,o]of n.content.split(`
|
|
155
|
+
`).entries()){let l=r+1,c=e.has(l)?-1:bt(o);if(c===-1){i();continue}let u=o.slice(c).replace(/^#+/,"").trim();s!==void 0&&s.line+s.texts.length===l?s.texts.push(u):(i(),s={line:l,texts:[u]})}return i(),t}a(gh,"extractComments");function yh(n){let e=n.split(`
|
|
156
|
+
`),t=e.filter(i=>i.trim()!=="").map(i=>/^[ \t]*/.exec(i)?.[0].length??0),s=t.length===0?0:Math.min(...t);return e.map(i=>i.slice(s)).join(`
|
|
157
|
+
`)}a(yh,"stripCommonIndent");function bh(n){return n.split(`
|
|
158
|
+
`).map((e,t)=>t===0?e:e.replace(/^[ \t]+/,"")).join(`
|
|
159
|
+
`)}a(bh,"stripContinuationIndent");function Sh(n){let e=n[0];return e==='"'||e==="'"?n.slice(1,-1):n}a(Sh,"stripQuotes");var Sn="\xABcodespan\xBB",Le=Sn.replace(/^[^\p{L}\p{N}]+/u,"").replace(/[^\p{L}\p{N}]+$/u,"").toLowerCase();function Na(n){let e=le(n);if(e.length===0)return n;let t=[],s=0;for(let i of e){let r=n.slice(i.start,i.end);t.push(n.slice(s,i.start),` ${Sn} `,`
|
|
160
|
+
`.repeat(De(r))),s=i.end}return t.push(n.slice(s)),t.join("")}a(Na,"maskCodeSpans");function Ca(n){return wh(n).map(e=>({...e,text:Na(e.text)}))}a(Ca,"extractProse");function wh(n){switch(n.kind){case"markdown":return Eh(n.file,n.content);case"script":return Ri(n.file,n.content);case"shell":return qi(n.file,n.content);case"yaml":return li(n)}}a(wh,"extractByKind");function vh(n,e,t){if(t===0)return[];try{return li({file:n,content:e.slice(1,t-1).join(`
|
|
161
|
+
`)}).map(s=>({...s,line:s.line+1}))}catch(s){if(s instanceof ht)return[];throw s}}a(vh,"extractFrontmatterProse");function Eh(n,e){let t=e.split(`
|
|
162
|
+
`),s=Th(t),i=vh(n,t,s),r;function o(){r!==void 0&&r.texts.some(l=>l.trim()!=="")&&i.push({file:n,line:r.line,text:r.texts.join(`
|
|
163
|
+
`)}),r=void 0}for(a(o,"flush");s<t.length;){let l=t[s]??"",c=l.trim(),u=/^(?:`{3,}|~{3,})/.exec(c)?.[0];if(u!==void 0){o(),s=Ch(t,s,u);continue}if(c.startsWith("<!--")){o(),s=Ih(t,s);continue}if(c===""||kh(c)){o(),s+=1;continue}if(Oh(c)){if(o(),!Nh(c))for(let p of Ph(c))p.trim()!==""&&i.push({file:n,line:s+1,text:Oa(p)});s+=1;continue}(r===void 0||Ah(l))&&(o(),r={line:s+1,texts:[]}),r.texts.push(Oa(l)),s+=1}return o(),i}a(Eh,"extractMarkdownProse");function Ah(n){return/^\s*(?:#{1,6}\s|[-*+]\s|\d+[.)]\s)/.test(n)}a(Ah,"isBlockStart");function kh(n){return/^\[[^\]]+]:\s/.test(n)}a(kh,"isLinkDefinition");function Nh(n){return/^\|[\s:|-]+\|?$/.test(n)}a(Nh,"isTableDelimiterRow");function Oh(n){return n.startsWith("|")}a(Oh,"isTableRow");function Oa(n){return n.replace(/^\s*(?:#{1,6}\s+|[-*+]\s+|\d+[.)]\s+|>\s?)/,"").replace(/!\[([^\]]*)]\([^)]*\)/g,"$1").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/\[([^\]]+)]\[[^\]]*]/g,"$1").replace(/<https?:\/\/[^>]*>/g,"").replace(/\bhttps?:\/\/\S+/g,"")}a(Oa,"normalizeMarkdownLine");function Ch(n,e,t){let s=t.startsWith("`")?"`":"~",i=new RegExp(String.raw`^\s*${s}{${t.length},}\s*$`);for(let r=e+1;r<n.length;r+=1)if(i.test(n[r]??""))return r+1;return n.length}a(Ch,"skipFencedBlock");function Th(n){if(n[0]?.trim()!=="---")return 0;for(let e=1;e<n.length;e+=1)if(n[e]?.trim()==="---")return e+1;return 0}a(Th,"skipFrontmatter");function Ih(n,e){for(let t=e;t<n.length;t+=1)if((n[t]??"").includes("-->"))return t+1;return n.length}a(Ih,"skipHtmlComment");function Ph(n){return n.replace(/^\|/,"").replace(/\|$/,"").split("|")}a(Ph,"splitTableCells");function Ta(n){return n.flatMap(e=>G(e,Dh).map(({line:t,sentence:s})=>({rule:"apostrophes",file:e.file,line:t,phrase:s,sentence:s})))}a(Ta,"detectDroppedApostrophes");var Lh=["arent","cant","couldnt","couldve","didnt","doesnt","dont","hadnt","hasnt","havent","hed","heres","isnt","itll","ive","mustnt","neednt","shouldnt","shouldve","thatll","thats","theres","theyd","theyll","theyre","theyve","wasnt","werent","weve","whats","wheres","whos","wont","wouldnt","wouldve","youd","youll","youre","youve"],Rh=["also","and","can","could","did","do","does","for","her","his","i","its","jointly","may","might","must","my","not","of","on","or","our","shall","should","still","that","their","they","to","we","which","who","whose","will","would","you","your"],qh=["a","all","an","any","each","every","her","his","it","its","my","our","some","that","the","their","them","these","this","those","your"],pt=String.raw`[\p{L}\p{N}'\u{2019}]`,_h=String.raw`(?<!${pt})(?!(?:${Rh.join("|")})\s)[\p{L}\p{N}]+\s+own(?!${pt})(?!\s+(?:${qh.join("|")})(?!${pt}))`,Mh=`(?<!${pt})(?:${Lh.join("|")})(?!${pt})`,Dh=new RegExp(`${_h}|${Mh}`,"giu");function Ia(n){return n.flatMap(e=>G(e,xh).map(({line:t,sentence:s})=>({rule:"em-dash",file:e.file,line:t,phrase:s,sentence:s})))}a(Ia,"detectEmDashes");var xh=/\u{2014}/gu;var U=new Set(["am","are","be","been","being","can","could","did","do","does","had","has","have","is","may","might","must","shall","should","was","were","will","would"]);function wn(n){let e=[],t=!1,s=/\S+/g,i=s.exec(n);for(;i!==null;){let r=i[0],o=r.length-r.replace(/^[^\p{L}\p{N}]+/u,"").length,l=r.replace(/^[^\p{L}\p{N}]+/u,"").replace(/[^\p{L}\p{N}]+$/u,""),c=r.slice(o+l.length);if(l==="")t=!0;else{t||=Pa.test(r.slice(0,o));let u=i.index+o;e.push({raw:l,word:l.toLowerCase(),start:u,end:u+l.length,afterBreak:t}),t=!1,t||=Pa.test(c)}i=s.exec(n)}return e}a(wn,"tokenize");var Pa=/[,;:.!?()[\]{}"\u{2013}\u{2014}]/u;function qa(n){return n.flatMap(Yh)}a(qa,"detectNegativeQuantifiers");var ci=new Set(["a","an","any","each","every","her","his","its","my","our","some","the","their","these","this","those","your"]),$h=new Set(["are","be","been","being","is","was","were"]),Bh=new Set(["there\u2019re","there\u2019s","there're","there's"]),jh=3,Kh=new Set(["doubt","longer","matter","one","sooner"]),Fh=2,Uh=3,_a=new Set(["about","after","and","as","at","before","but","by","for","from","if","in","into","nor","on","or","so","than","that","to","when","where","which","who","whom","with","without"]),Vh=new Set(["that","which","who","whom"]);function Wh(n,e){if(Xh(n,e))return"existential";let t=n[e];return t!==void 0&&!t.afterBreak&&Jh(n,e)!==void 0&&Hh(n,e)!==void 0?"relative":"other"}a(Wh,"classifyPosition");function Yh(n){let e=wn(n.text),t=[],s=-1;for(let[i,r]of e.entries()){if(r.word!=="no"||!Qh(e,i))continue;let o=Wh(e,i),l=Se(n.text,r.start,r.end),c=t.at(-1);if(c!==void 0&&l.start===s){c.positions.push(o);continue}s=l.start;let u=j(n.text.slice(l.start,l.end));t.push({rule:"negative-quantifier",file:n.file,line:n.line+V(n.text,l.start),phrase:u,sentence:u,positions:[o]})}return t}a(Yh,"detectInSpan");function Jh(n,e){let t=n[e-1];if(t===void 0)return;if(Vh.has(t.word)){let i=e-2,r=La(n[i]?.word??"")?0:Fh;return Ra(n,i,r)||Gh(n,i)?i:void 0}if(La(t.word))return;let s=e-1;return Ra(n,s,0)?s:void 0}a(Jh,"findHeadIndex");function Hh(n,e){for(let t=e+2;t<=e+1+Uh;t+=1){let s=n[t];if(s===void 0||s.afterBreak||_a.has(s.word))return;if(zh(s.word))return t}}a(Hh,"findVerbIndex");function La(n){return/(?:ing|ed)$/.test(n)||n.endsWith("s")&&!/(?:ss|us|is)$/.test(n)}a(La,"hasVerbEnding");function Gh(n,e){let t=n[e];if(t===void 0||!t.word.endsWith("s")||/(?:ss|us|is)$/.test(t.word)||Re(t.word)||ci.has(t.word))return!1;let s=n[e-1];return s===void 0||t.afterBreak||Re(s.word)||s.word.endsWith("ing")}a(Gh,"isBarePluralHead");function Ra(n,e,t){let s=n[e];if(s===void 0||s.afterBreak||Re(s.word)||ci.has(s.word))return!1;for(let i=e-1;i>=Math.max(0,e-1-t);i-=1){let r=n[i];if(r===void 0||Re(r.word))return!1;if(ci.has(r.word))return!0;if(r.afterBreak)return!1}return!1}a(Ra,"isDeterminedHead");function Qh(n,e){let t=n[e+1];return t===void 0||t.afterBreak||Re(t.word)||Kh.has(t.word)?!1:n[e+2]?.word!=="than"}a(Qh,"isDeterminer");function Xh(n,e){let t=n[e-1];return t===void 0?!1:Bh.has(t.word)?!0:$h.has(t.word)?n.slice(Math.max(0,e-jh),e-1).some(s=>s.word==="there"):!1}a(Xh,"isExistential");function zh(n){return U.has(n)?!0:n.length>2&&n.endsWith("s")&&!/(?:ss|us|is)$/.test(n)&&!Re(n)}a(zh,"isFiniteVerb");function Re(n){return _a.has(n)||U.has(n)}a(Re,"isPhraseBreaker");var ui=new Set(["accept","acknowledge","allow","apply","assume","avoid","begin","believe","bring","choose","compare","comprise","consider","contain","convey","create","decide","declare","define","deliver","describe","determine","discard","distinguish","emit","enable","encode","enforce","ensure","exclude","expect","explain","extend","extract","follow","forbid","govern","hide","ignore","imply","include","inherit","invoke","know","leave","lose","maintain","mean","mention","obtain","omit","perform","permit","prefer","prevent","produce","provide","receive","recognize","reduce","reject","remove","render","repeat","replace","require","resolve","retain","reveal","satisfy","seek","select","send","solve","suppose","surround","sustain","teach","tolerate","treat","understand","verify","want","withhold"]),vn=new Set(["am","are","be","been","being","is","was","were"]),Ma=new Set(["assigned","awarded","given","granted","handed","issued","offered","passed","sent","shown","taught","told"]),fi=new Set(["appear","arise","become","belong","come","consist","depend","differ","emerge","exist","go","happen","matter","occur","persist","remain","stay","vary"]),di=new Set(["began","bought","broke","brought","built","caught","chose","dealt","drew","drove","found","gave","grew","held","kept","knew","laid","led","left","lent","lost","made","meant","met","paid","read","said","sent","sold","sought","spent","struck","swept","taught","thought","threw","told","took","understood","withheld","won","wrote"]),Da=new Set(["did","do","does","had","has","have"]),En=new Set(["always","hers","ours","perhaps","plus","sometimes","theirs","thus","versus","yes","yours"]);var xa=new Set(["place","places","reason","reasons","time","times","way","ways"]),$a=3,Ba=new Set(["better","bigger","broader","earlier","larger","later","longer","narrower","newer","older","shorter","smaller","wider","worse"]),An=new Set(["and","but","nor","or"]),ja=new Set(["more reliably","most notably","most often","most plausibly","most recently","no longer"]),Ka=new Set(["these","this","those"]),qe=new Set(["a","an","her","his","its","my","our","the","their","these","this","those","your"]),Fa=12,_e=new Set(["almost","also","barely","even","hardly","just","merely","nearly","only","simply"]),Ua=new Set(["all","anybody","anyone","anything","enough","everybody","everyone","everything","less","more","much","nobody","none","nothing","somebody","someone","something","what","whatever","whoever"]),Va=new Set(["any","every","no","some"]),Wa=new Set(["anomaly","assembly","comply","family","monopoly","multiply","reply","supply"]),me=new Set(["never","not"]),Ya=new Set(["other","own","same","single"]),ge=new Set(["eight","eleven","five","four","nine","one","seven","six","ten","three","twelve","two"]),hi=new Set(["her","him","me","them","us"]),Ja=new Set(["both","few","fewer","many","several","these","those"]),mt=new Set(["about","above","across","after","against","along","among","around","as","at","before","behind","below","beneath","beside","besides","between","beyond","by","despite","down","during","except","for","from","in","inside","into","like","near","of","off","on","onto","out","outside","over","past","per","since","through","throughout","to","toward","towards","under","underneath","unlike","until","up","upon","via","with","within","without"]),pi=new Set(["one","ones"]),Ha=new Set(["anybody","anyone","anything","everybody","everyone","everything","nobody","none","nothing","somebody","someone","something"]),ye=new Set(["all","another","any","both","each","either","enough","every","few","fewer","many","most","neither","no","nobody","none","nothing","several","some","such"]),kn=new Set(["that","when","where","which","who","whom","whose","why"]),Ga={bare:"bare",determiner:"definite",numeral:"quantified",pronoun:"pronoun",quantifier:"quantified","quantifier-pronoun":"quantified"},gt=new Set(["he","i","it","one","she","they","we","you"]),Qa={bare:{min:1,max:1},demonstrative:{min:1,max:4},determiner:{min:2,max:4},numeral:{min:2,max:4},pronoun:{min:1,max:1},quantifier:{min:2,max:4},"quantifier-pronoun":{min:1,max:1}},Xa=new Set(["although","because","else","if","once","so","than","then","though","unless","until","whether","while","yet"]),mi=new Set(["how","however","whose"]);function za(n,e){let{carriedIndex:t,isPassive:s}=e;if(t!==void 0&&!(s&&!ep(n,t)))return Zh(n,t)?t:void 0}a(za,"closeOnCarriedVerb");function Za(n,e){if(gi(n,e))return!0;let t=n[e+1];return t!==void 0&&!t.afterBreak&&me.has(t.word)&&gi(n,e+1)}a(Za,"closesOnCopula");function el(n,e,t){return t==="bare"&&tp(n,e)?!1:yi(n[e]?.word??"")||np(n,e)}a(el,"closesScannedClause");function yi(n){return oe(n)||En.has(n)||fi.has(n)?!1:ui.has(n)||di.has(n)||/(?:ize|ise|ify)$/.test(n)||n.length>3&&n.endsWith("ed")?!0:n.length>2&&n.endsWith("s")&&!/(?:ss|us|is)$/.test(n)}a(yi,"isFiniteVerb");function oe(n){return U.has(n)||An.has(n)||qe.has(n)||_e.has(n)||ge.has(n)||hi.has(n)||mt.has(n)||ye.has(n)||kn.has(n)||gt.has(n)||Xa.has(n)}a(oe,"isFunctionWord");function bi(n){return n.length<=4||!n.endsWith("ly")?!1:!ui.has(n)&&!di.has(n)&&!Wa.has(n)}a(bi,"isMannerAdverb");function Me(n){return n.length>3&&n.endsWith("s")&&!/(?:ss|us|is)$/.test(n)&&!oe(n)&&!En.has(n)}a(Me,"isPluralNoun");function tl(n,e){let t=Math.min(e+$a,n.length-1),s=e;for(let i=e+1;i<=t;i+=1){let r=n[i];if(r===void 0||r.afterBreak)break;if(U.has(r.word)){s=i;continue}if(me.has(r.word)||bi(r.word))continue;if(oe(r.word))break;let o=n[s]?.word??"",l=vn.has(o)&&!r.word.endsWith("ing");return{carriedIndex:i,isPassive:l,lastAuxiliaryIndex:s}}return{carriedIndex:void 0,isPassive:!1,lastAuxiliaryIndex:s}}a(tl,"resolveAuxiliaryChain");function Nn(n,e){return On(n,e)&&gi(n,e+1)}a(Nn,"strandsClauseFinalPreposition");function Zh(n,e){return!fi.has(n[e]?.word??"")||On(n,e)}a(Zh,"closesCarriedClause");function On(n,e){let t=n[e+1];if(t===void 0||t.afterBreak||!mt.has(t.word))return!1;let s=n[e+2];return s===void 0||s.afterBreak?!0:qe.has(s.word)||ge.has(s.word)||ye.has(s.word)?!1:!gt.has(s.word)&&!hi.has(s.word)&&oe(s.word)}a(On,"hasStrandedPreposition");function ep(n,e){if(On(n,e)||Ma.has(n[e]?.word??""))return!0;let t=n[e+1];if(t===void 0||t.afterBreak||t.word!=="to")return!1;let s=n[e+2];return s!==void 0&&!s.afterBreak&&!oe(s.word)}a(ep,"hostsGap");function tp(n,e){let t=n[e]?.word??"";if(t.length<=3||!t.endsWith("ed"))return!1;let s=n[e+1];return s!==void 0&&!s.afterBreak&&s.word==="by"}a(tp,"isAgentiveParticiple");function gi(n,e){let t=n[e+1];return t===void 0||t.afterBreak}a(gi,"isClauseFinal");function np(n,e){let t=n[e]?.word??"";return t===""||oe(t)||En.has(t)?!1:On(n,e)}a(np,"isStrandedVerb");function nl(n,e){let t=n[e];if(t===void 0)return;let{word:s}=t;if(s!==Le)return gt.has(s)?ip(n,e)?void 0:"pronoun":rl(s)?"numeral":Ha.has(s)?"quantifier-pronoun":ye.has(s)?sp(n,e)?void 0:"quantifier":Ka.has(s)?"demonstrative":qe.has(s)?"determiner":Me(s)?"bare":void 0}a(nl,"classifySubject");function sl(n,e){let t=e;for(;t>0;){let s=n[t];if(s===void 0||s.afterBreak)return;t-=1;let i=n[t];if(i===void 0||i.word===Le)return;if(!_e.has(i.word))return pi.has(i.word)?op(n,t)?void 0:t:lp(n,t)||oe(i.word)||Ua.has(i.word)||xa.has(i.word)||mi.has(i.word)||Ya.has(i.word)||ap(n,t)?void 0:rp(n,t)?t:void 0}}a(sl,"findHeadIndex");function il(n,e){for(let t=e-1;t>=0&&t>=e-2;t-=1){let s=n[t];if(s===void 0)return!1;if(ol(s.word,n[e]?.word??""))return!0;if(n[t+1]?.afterBreak===!0)return!1}return!1}a(il,"isDeterminedPhrase");function sp(n,e){let t=n[e+1];return t===void 0||t.afterBreak?!1:ja.has(`${n[e]?.word??""} ${t.word}`)}a(sp,"opensDegreeAdverbial");function ip(n,e){let t=n[e];return t===void 0||t.afterBreak||!pi.has(t.word)?!1:Ba.has(n[e-1]?.word??"")}a(ip,"closesComparativePhrase");function rp(n,e){let t=n[e];return t===void 0?!1:!yi(t.word)&&!t.word.endsWith("ing")?!0:t.afterBreak||e===0?!1:ol(n[e-1]?.word??"",t.word)}a(rp,"isDeterminedHead");function op(n,e){return e===0||n[e]?.afterBreak===!0?!1:Va.has(n[e-1]?.word??"")}a(op,"isFusedProForm");function rl(n){return ge.has(n)||/^\d+$/.test(n)}a(rl,"isNumeral");function ol(n,e){return ge.has(n)&&n!=="one"||Ja.has(n)||/^\d+$/.test(n)?n!=="1"&&Me(e):qe.has(n)||ye.has(n)||ge.has(n)}a(ol,"isSpecifier");function ap(n,e){let t=n[e];if(t===void 0)return!0;if(e===0||t.afterBreak)return!Me(t.word);let s=n[e-1]?.word??"",i=me.has(s)?n[e-2]?.word??"":s;return i==="to"||U.has(i)}a(ap,"isVerbPosition");function lp(n,e){for(let t=e-1;t>=0;t-=1){let s=n[t+1];if(s===void 0||s.afterBreak)return!1;let i=n[t]?.word??"";if(mi.has(i))return!0;if(!ye.has(i)&&!rl(i))return!1}return!1}a(lp,"isWhMarkedHead");function al(n){let e=[];for(let t of n)e.push(...up(t));return e}a(al,"detectObjectRelatives");function ll(n){return!n.endsWith("s")}a(ll,"agreesWithPluralSubject");function cp(n){let{span:e,tokens:t,headIndex:s,subjectIndex:i,verbIndex:r,shape:o}=n,l=t[s],c=t[r];if(l===void 0||c===void 0)throw new Error("candidate resolved outside its token run");let u=t.slice(i,r).map(p=>p.word===Le?Sn:p.raw).join(" ");return{rule:"reduced-object-relative",file:e.file,line:e.line+V(e.text,l.start),shape:o,head:l.raw,subject:u,verb:c.raw,phrase:j(e.text.slice(l.start,c.end)),sentence:Ti(e.text,l.start,c.end)}}a(cp,"buildCandidate");function up(n){let e=wn(n.text),t=[],s=-1;for(let i=1;i<e.length;i+=1){let r=sl(e,i);if(r===void 0)continue;let o=r<=s,l=nl(e,i);if(l===void 0||l==="bare"&&!il(e,r))continue;let c=fp(e,i,l);if(c===void 0||o&&c!==s)continue;s=c;let u=dp({tokens:e,kind:l,subjectIndex:i,verbIndex:c}),p=cp({span:n,tokens:e,headIndex:r,subjectIndex:i,verbIndex:c,shape:u});o?t[t.length-1]=p:t.push(p)}return t}a(up,"detectInSpan");function fp(n,e,t){let s=Qa[t],i=e+s.min,r=Math.min(e+s.max,n.length-1),o=!1;for(let l=e+1;l<=r;l+=1){let c=n[l];if(c===void 0||c.afterBreak||An.has(c.word)||kn.has(c.word))return;if(mt.has(c.word)&&c.word!=="of"){o=!0,r=Math.min(e+Fa,n.length-1);continue}if(cl(c.word)){r=Math.min(r+1,n.length-1);continue}if(c.word===Le)continue;let u=U.has(c.word)&&l>=i?pp({tokens:n,index:l,kind:t,crossedPreposition:o}):mp({tokens:n,index:l,subjectIndex:e,first:i,kind:t,crossedPreposition:o});if(u.outcome==="close")return u.verbIndex;if(u.outcome==="stop")return}}a(fp,"findVerbIndex");function dp(n){let{tokens:e,kind:t,subjectIndex:s,verbIndex:i}=n;return t!=="demonstrative"?Ga[t]:hp(e,s,i)?"pronoun":"definite"}a(dp,"resolveShape");function hp(n,e,t){for(let s=e+1;s<t;s+=1)if(!cl(n[s]?.word??""))return!1;return!0}a(hp,"standsAlone");function cl(n){return me.has(n)||_e.has(n)||bi(n)}a(cl,"skipsAsModifier");function pp(n){let{tokens:e,index:t,kind:s,crossedPreposition:i}=n,r=tl(e,t);if(r.carriedIndex!==void 0){let l=za(e,r);return l===void 0?{outcome:"stop"}:i&&!Nn(e,l)?{outcome:"stop"}:{outcome:"close",verbIndex:l}}let o=e[r.lastAuxiliaryIndex]?.word??"";return vn.has(o)&&Za(e,r.lastAuxiliaryIndex)?{outcome:"close",verbIndex:r.lastAuxiliaryIndex}:Da.has(o)?i&&!Nn(e,r.lastAuxiliaryIndex)?{outcome:"continue"}:s==="bare"&&!ll(e[t]?.word??"")?{outcome:"stop"}:{outcome:"close",verbIndex:r.lastAuxiliaryIndex}:{outcome:"continue"}}a(pp,"resolveAuxiliaryStep");function mp(n){let{tokens:e,index:t,subjectIndex:s,first:i,kind:r,crossedPreposition:o}=n,l=e[t]?.word??"";return t<i||!el(e,t,r)?{outcome:"continue"}:r==="demonstrative"&&t===s+1&&Me(l)?{outcome:"continue"}:o&&!Nn(e,t)?{outcome:"continue"}:r==="bare"&&!ll(l)?{outcome:"stop"}:{outcome:"close",verbIndex:t}}a(mp,"resolveScannedStep");var gp=new Map([["carry",["carries","carried","carrying"]],["cost",["costs","costing"]],["hold",["holds","held","holding"]],["land",["lands","landed","landing"]],["reach",["reaches","reached","reaching"]],["route",["routes","routed","routing"]],["ship",["ships","shipped","shipping"]],["sit",["sits","sat","sitting"]],["stand",["stands","stood","standing"]],["surface",["surfaces","surfaced","surfacing"]]]);function ul(n){return n.flatMap(Sp)}a(ul,"detectOverusedWords");var fl=new Map([...gp].flatMap(([n,e])=>[n,...e].map(t=>[t,n]))),yp=new RegExp(String.raw`\b(?:${fl.keys().toArray().join("|")})\b`,"giu"),bp=/^\s+in\s+for\b/iu;function Sp(n){let e=le(n.text),t=new Map;for(let s of n.text.matchAll(yp)){let i=s.index,r=i+s[0].length;if(e.some(u=>i>=u.start&&i<u.end))continue;let o=fl.get(s[0].toLowerCase());if(o===void 0||o==="stand"&&bp.test(n.text.slice(r)))continue;let l=Se(n.text,i,r),c=t.get(l.start)??{end:l.end,words:[]};c.words.includes(o)||c.words.push(o),t.set(l.start,c)}return[...t].map(([s,{end:i,words:r}])=>{let o=j(n.text.slice(s,i));return{rule:"overused-word",file:n.file,line:n.line+V(n.text,s),phrase:o,sentence:o,words:r}})}a(Sp,"detectInSpan");function dl(n){return n.filter(e=>!Ep(e.file)).flatMap(e=>G(e,vp).map(({line:t,sentence:s})=>({rule:"second-person",file:e.file,line:t,phrase:s,sentence:s})))}a(dl,"detectSecondPersonPronouns");var wp=/\.(?:markdown|md)$/i,vp=/\byou(?:rs?|rself|rselves)?\b/giu;function Ep(n){let e=n.split("/"),t=e.at(-1)??"";if(t==="SKILL.md")return!0;if(!wp.test(t))return!1;let s=e.at(-2),i=e.at(-3);return s==="_partials"?i==="skills"||i==="subagents":s==="subagents"||s==="agents"&&i===".claude"}a(Ep,"isAgentInstructionBody");function hl(n){return Map.groupBy(n,e=>e.file).values().flatMap(Tp).toArray()}a(hl,"detectSoUses");var Ap=["far","few","little","many","much","on"],kp=["did","do","does","doing","done","if","said","say","saying","says"],Np=/(?:[,;–—]|--|\band)\s*$/iu,Op=3,Cp=new RegExp(String.raw`(?<!\b(?:${kp.join("|")})\s+)`+String.raw`(?:(?<=(?:^|[,;.!?])\s*)\bso\b|\bso\b(?!\s+(?:${Ap.join("|")})\b))`+String.raw`(?!-|\s+that\b)`,"giu");function Tp(n){let e=n.toSorted((s,i)=>s.line-i.line).flatMap(Pp),t=[];for(let[s,i]of e.entries()){if(i.siteCount===0)continue;let r=e.slice(Math.max(0,s-Op),s),o=i.siteCount>1||r.some(l=>l.siteCount>0);!i.hasBareSite&&!o||t.push({rule:"so",file:i.file,line:i.line,phrase:i.text,sentence:i.text,trigger:i.hasBareSite?"bare":"repeat"})}return t}a(Tp,"detectInFile");function Ip(n){return/[\p{L}\p{N}]/u.test(n)&&!Np.test(n)}a(Ip,"isBareSite");function Pp(n){let e=le(n.text),t=n.text.matchAll(Cp).map(s=>s.index).filter(s=>e.every(i=>s<i.start||s>=i.end)).toArray();return Ii(n.text).map(({start:s,end:i})=>{let r=t.filter(o=>o>=s&&o<i);return{file:n.file,hasBareSite:r.some(o=>Ip(n.text.slice(s,o))),line:n.line+V(n.text,s),siteCount:r.length,text:j(n.text.slice(s,i))}})}a(Pp,"listSiteSentences");function pl(n){return n.flatMap(e=>G(e,Lp).map(({line:t,sentence:s})=>({rule:"where",file:e.file,line:t,phrase:s,sentence:s})))}a(pl,"detectWhereUses");var Lp=/\bwhere\b/giu;var Rp={apostrophes:Ta,"em-dash":Ia,"negative-quantifier":qa,"overused-word":ul,"reduced-object-relative":al,"second-person":dl,so:hl,where:pl},Si=["apostrophes","em-dash","negative-quantifier","overused-word","reduced-object-relative","second-person","so","where"];function ml(n,e){let t=new Map;for(let i of n)t.has(i.file)||t.set(i.file,t.size);return e.flatMap(i=>Rp[i](n)).toSorted((i,r)=>(t.get(i.file)??0)-(t.get(r.file)??0)||i.line-r.line)}a(ml,"detectRules");function gl(n){let e=Ca({...n,kind:"markdown"});return{file:n.file,rules:Si,candidates:ml(e,Si)}}a(gl,"checkProse");function yl(n){return`${JSON.stringify(n)}
|
|
164
|
+
`}a(yl,"renderCheckJson");function bl(n){let e=n.candidates.map(t=>`${t.file}:${t.line}: ${t.rule}: ${t.sentence.replaceAll(/\s+/g," ").trim()}`);return e.push(`${n.file}: ${n.candidates.length} candidate(s)`),`${e.join(`
|
|
165
|
+
`)}
|
|
166
|
+
`}a(bl,"renderCheckText");var Sl=["--file","--help","--json","--version"];async function Mp(n,e,t=wl(x.argv[1])){if(n.includes("--help")||n.includes("-h"))return x.stdout.write(Dp(t)),0;if(n.includes("--version")||n.includes("-V"))return x.stdout.write(`${Ai.version}
|
|
167
|
+
`),0;let s;try{s=xp(n)}catch(o){return x.stderr.write(`${t}: ${ae(o)}; run ${t} --help for usage
|
|
168
|
+
`),2}let i;try{i=await qp(wi.resolve(e,s.file),"utf8")}catch(o){return x.stderr.write(`${t}: cannot read ${s.file}: ${ae(o)}; pass a readable file to --file
|
|
169
|
+
`),2}let r=gl({file:s.file,content:i});return x.stdout.write(s.json?yl(r):bl(r)),r.candidates.length===0?0:1}a(Mp,"runCheckProse");if(Oi(import.meta.url,"check-prose")){let n=wl(x.argv[1]);try{x.exit(await Mp(x.argv.slice(2),x.cwd(),n))}catch(e){x.stderr.write(`${n}: ${ae(e)}
|
|
170
|
+
`),x.exit(1)}}function Dp(n){return[`${n}: run every revise-prose detector over one Markdown file at any path, without the sweep record`,"",`Usage: ${n} --file <path> [--json]`,"","Options:"," --file <path> The file to check, read as Markdown whatever its extension"," --json Print one JSON document: { file, rules, candidates }"," -h, --help Print this help"," -V, --version Print the version","","Exits 0 without candidates, 1 with candidates, and 2 on a usage error or an unreadable file.","","Example:",` ${n} --file /tmp/prose-check.md --json`,""].join(`
|
|
171
|
+
`)}a(Dp,"buildHelp");function wl(n){return n===void 0?"check-prose":wi.basename(n,wi.extname(n))}a(wl,"deriveProgramName");function xp(n){let e=n.find(i=>i.startsWith("-")&&!Sl.includes(i.split("=",1)[0]??i));if(e!==void 0){let i=Ci(e,Sl);throw new Error(`unknown option ${e}${i===void 0?"":`; did you mean ${i}?`}`)}let{values:t,positionals:s}=_p({args:[...n],allowPositionals:!0,options:{file:{type:"string"},json:{type:"boolean",default:!1}},strict:!0});if(s.length>0)throw new Error(`unexpected argument ${s[0]}; name the file with --file <path>`);if(t.file===void 0||t.file==="")throw new Error("--file <path> is required");return{file:t.file,json:t.json}}a(xp,"parseOptions");export{Mp as runCheckProse};
|