codeassembly-guidance 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.meta/changelog.json +563 -0
- package/CHANGELOG.md +134 -0
- package/LICENSE +7 -0
- package/README.md +165 -1
- package/content/_partials/README.md +192 -0
- package/content/_partials/code-descriptions.md +4 -0
- package/content/_partials/code-style.md +7 -0
- package/content/_partials/comment-discipline.md +89 -0
- package/content/_partials/concision.md +3 -0
- package/content/_partials/diff-audit-checklist.md +9 -0
- package/content/_partials/file-access.md +4 -0
- package/content/_partials/live-repo-writes.md +13 -0
- package/content/_partials/plain-speech-calibration.md +66 -0
- package/content/_partials/plain-speech.md +13 -0
- package/content/_partials/prose-line-breaks.md +3 -0
- package/content/_partials/record-marker.md +1 -0
- package/content/_partials/reduced-object-relative.md +28 -0
- package/content/_partials/shell-commands.md +3 -0
- package/content/_partials/target-file-set-resolution.md +22 -0
- package/content/_partials/technical-recommendations.md +5 -0
- package/content/_partials/test-structure-audit-checklist.md +7 -0
- package/content/_partials/ticket-assessment-baseline.md +12 -0
- package/content/_partials/ticket-assessment.md +202 -0
- package/content/_partials/work-type-choice.md +13 -0
- package/content/codeassembly-content.yaml +49 -0
- package/content/collections/all.md +11 -0
- package/content/collections/atlassian.md +16 -0
- package/content/collections/recommended.md +34 -0
- package/content/collections/triage.md +77 -0
- package/content/collections/williamthorsen.md +25 -0
- package/content/guidance/README.md +22 -0
- package/content/guidance/_harnesses/claude/CLAUDE.md +6 -0
- package/content/guidance/_harnesses/rovo/AGENTS.md +5 -0
- package/content/guidance/_harnesses/rovo/codeassembly-guidance.md +4 -0
- package/content/guidance/rulebooks/accessibility-conventions.md +20 -0
- package/content/guidance/rulebooks/codeassembly-content-specification.md +161 -0
- package/content/guidance/rulebooks/command-output-conventions.md +14 -0
- package/content/guidance/rulebooks/commit-conventions.md +72 -0
- package/content/guidance/rulebooks/generated-content-policy.md +10 -0
- package/content/guidance/rulebooks/live-worktree-policy.md +18 -0
- package/content/guidance/rulebooks/readme-conventions.md +74 -0
- package/content/guidance/rulebooks/shared-data-conventions.md +14 -0
- package/content/guidance/rulebooks/shell-conventions.md +279 -0
- package/content/guidance/rulebooks/williamthorsen-code-layout-preferences.md +102 -0
- package/content/guidance/rulebooks/williamthorsen-collaboration-preferences.md +58 -0
- package/content/guidance/rulebooks/williamthorsen-comment-preferences.md +30 -0
- package/content/guidance/rulebooks/williamthorsen-subagent-model-preferences.md +15 -0
- package/content/guidance/rulebooks/williamthorsen-ticketing-preferences.md +22 -0
- package/content/guidance/rulebooks/williamthorsen-tooling-preferences.md +36 -0
- package/content/guidance/rulebooks/williamthorsen-typescript-preferences.md +90 -0
- package/content/guidance/rulebooks/williamthorsen-workflow-preferences.md +58 -0
- package/content/guidance/rulebooks/williamthorsen-writing-preferences.md +80 -0
- package/content/guidance/shared/AGENTS.md +43 -0
- package/content/scripts/README.md +41 -0
- package/content/scripts/describe-change.mjs +165 -0
- package/content/scripts/get-ticket-id.sh +131 -0
- package/content/scripts/manage-jira-ticket.mjs +209 -0
- package/content/scripts/resolve-frontmatter.sh +540 -0
- package/content/scripts/resolve-review-run.mjs +12 -0
- package/content/scripts/select-lede-exemplars.mjs +208 -0
- package/content/skills/_data/action-items.md +83 -0
- package/content/skills/_data/artifact-conventions.md +969 -0
- package/content/skills/_data/bitbucket-pr-access.md +89 -0
- package/content/skills/_data/branch-format.md +34 -0
- package/content/skills/_data/change-record.md +163 -0
- package/content/skills/_data/complexity-classification.md +58 -0
- package/content/skills/_data/concision.md +23 -0
- package/content/skills/_data/deployed-file-provenance.md +46 -0
- package/content/skills/_data/design-priorities.md +76 -0
- package/content/skills/_data/gh-body-file.md +30 -0
- package/content/skills/_data/git-commands.md +39 -0
- package/content/skills/_data/naming-conventions.md +50 -0
- package/content/skills/_data/pr-resolution.md +25 -0
- package/content/skills/_data/pr-source-resolution.md +36 -0
- package/content/skills/_data/recommendation-gradient.md +90 -0
- package/content/skills/_data/scope-and-deferral.md +83 -0
- package/content/skills/_data/spike-conventions.md +89 -0
- package/content/skills/_data/ticket-evaluation.md +13 -0
- package/content/skills/_data/ticket-id-extraction.md +43 -0
- package/content/skills/_data/ticket-source-resolution.md +147 -0
- package/content/skills/_data/title-templates.md +624 -0
- package/content/skills/_data/title-voice.md +17 -0
- package/content/skills/_data/work-types.json +168 -0
- package/content/skills/_partials/acceptance-criteria-scaffold.md +15 -0
- package/content/skills/_partials/action-items.md +22 -0
- package/content/skills/_partials/bitbucket-delete-both-refusal.md +3 -0
- package/content/skills/_partials/commit-title-rendering.md +14 -0
- package/content/skills/_partials/gh-body-file.md +22 -0
- package/content/skills/_partials/nested-list-indent.md +9 -0
- package/content/skills/_partials/next-steps-after-plan.md +99 -0
- package/content/skills/_partials/next-steps-after-review.md +350 -0
- package/content/skills/_partials/option-format.md +84 -0
- package/content/skills/_partials/plan-template.md +97 -0
- package/content/skills/_partials/split-launch-prompts.md +5 -0
- package/content/skills/_partials/split-ticket-compose.md +5 -0
- package/content/skills/_partials/split-ticket-create.md +3 -0
- package/content/skills/_partials/ticket-and-plan-completeness.md +33 -0
- package/content/skills/_partials/ticket-concision.md +18 -0
- package/content/skills/_partials/ticket-criteria-conventions.md +7 -0
- package/content/skills/_partials/ticket-placement.md +14 -0
- package/content/skills/_partials/ticket-skeleton-tiers.md +6 -0
- package/content/skills/_partials/ticket-skeleton.md +13 -0
- package/content/skills/add-change-record/SKILL.md +136 -0
- package/content/skills/add-test-ids/SKILL.md +51 -0
- package/content/skills/align-ticket-with-implementation/SKILL.md +115 -0
- package/content/skills/anti-patterns/SKILL.md +57 -0
- package/content/skills/assess-ticket/SKILL.md +46 -0
- package/content/skills/assess-ticket/next-steps-after-assessment.md +98 -0
- package/content/skills/brainstorming/SKILL.md +107 -0
- package/content/skills/capture-event/SKILL.md +108 -0
- package/content/skills/capture-event/capture-event.mjs +216 -0
- package/content/skills/capture-feedback/SKILL.md +71 -0
- package/content/skills/capture-lede-decision/SKILL.md +163 -0
- package/content/skills/capture-lede-decision/capture-lede-decision.mjs +231 -0
- package/content/skills/classify-complexity/SKILL.md +92 -0
- package/content/skills/collaborate/SKILL.md +86 -0
- package/content/skills/condense-branch/SKILL.md +83 -0
- package/content/skills/create-bitbucket-pr/SKILL.md +87 -0
- package/content/skills/create-commit/SKILL.md +65 -0
- package/content/skills/create-devlog/SKILL.md +108 -0
- package/content/skills/create-gh-pr/SKILL.md +106 -0
- package/content/skills/create-pr/SKILL.md +150 -0
- package/content/skills/create-ticket/SKILL.md +350 -0
- package/content/skills/derive-session-context/derive-session-context.mjs +148 -0
- package/content/skills/design-and-plan/SKILL.md +194 -0
- package/content/skills/development-workflows/SKILL.md +41 -0
- package/content/skills/get-ticket-id/SKILL.md +67 -0
- package/content/skills/groom-backlog/SKILL.md +245 -0
- package/content/skills/groom-backlog/groom-backlog.mjs +106 -0
- package/content/skills/implement-plan/SKILL.md +164 -0
- package/content/skills/index-prototypes/SKILL.md +145 -0
- package/content/skills/index-prototypes/index-prototypes.mjs +328 -0
- package/content/skills/kb-add/SKILL.md +156 -0
- package/content/skills/kb-add/kb-add.mjs +216 -0
- package/content/skills/kb-curate/SKILL.md +117 -0
- package/content/skills/kb-curate/kb-curate.mjs +213 -0
- package/content/skills/kb-edit/SKILL.md +128 -0
- package/content/skills/kb-edit/kb-edit.mjs +219 -0
- package/content/skills/kb-retrieve/SKILL.md +100 -0
- package/content/skills/kb-retrieve/kb-retrieve.mjs +206 -0
- package/content/skills/kb-retrieve-events/SKILL.md +98 -0
- package/content/skills/kb-retrieve-events/kb-retrieve-events.mjs +206 -0
- package/content/skills/kb-update-events/SKILL.md +77 -0
- package/content/skills/kb-update-events/kb-update-events.mjs +215 -0
- package/content/skills/merge-bb-pr/SKILL.md +136 -0
- package/content/skills/merge-gh-pr/SKILL.md +167 -0
- package/content/skills/merge-gh-pr/merge-gh-pr.mjs +10 -0
- package/content/skills/merge-pr/SKILL.md +368 -0
- package/content/skills/migrate-feedback-memories/SKILL.md +136 -0
- package/content/skills/migrate-feedback-memories/feedback-memories.mjs +161 -0
- package/content/skills/people-report/SKILL.md +208 -0
- package/content/skills/plan/SKILL.md +87 -0
- package/content/skills/prepare-prototype-brief/SKILL.md +126 -0
- package/content/skills/pull-from-backlog/SKILL.md +83 -0
- package/content/skills/pull-from-backlog/pull-from-backlog.mjs +208 -0
- package/content/skills/refine-plan/SKILL.md +259 -0
- package/content/skills/respond-to-review/SKILL.md +292 -0
- package/content/skills/review-bb-pr/SKILL.md +161 -0
- package/content/skills/review-branch/SKILL.md +301 -0
- package/content/skills/review-criteria/SKILL.md +108 -0
- package/content/skills/review-gh-pr/SKILL.md +155 -0
- package/content/skills/review-gh-pr/select-pr-ticket.mjs +8 -0
- package/content/skills/review-permissions/SKILL.md +39 -0
- package/content/skills/review-pr/SKILL.md +123 -0
- package/content/skills/revise-comments/SKILL.md +115 -0
- package/content/skills/revise-prose/SKILL.md +197 -0
- package/content/skills/revise-prose/revise-prose.mjs +229 -0
- package/content/skills/save-artifact/SKILL.md +69 -0
- package/content/skills/save-plan/SKILL.md +55 -0
- package/content/skills/software-engineering/SKILL.md +74 -0
- package/content/skills/streamline-guidance/SKILL.md +174 -0
- package/content/skills/streamline-guidance/streamline-guidance.mjs +211 -0
- package/content/skills/summarize-change/SKILL.md +308 -0
- package/content/skills/summarize-chat/SKILL.md +100 -0
- package/content/skills/systematic-debugging/SKILL.md +308 -0
- package/content/skills/systematic-debugging/condition-based-waiting-example.ts +160 -0
- package/content/skills/systematic-debugging/condition-based-waiting.md +122 -0
- package/content/skills/systematic-debugging/defense-in-depth.md +130 -0
- package/content/skills/systematic-debugging/find-polluter.sh +68 -0
- package/content/skills/systematic-debugging/root-cause-tracing.md +185 -0
- package/content/skills/systematic-debugging/test-academic.md +16 -0
- package/content/skills/systematic-debugging/test-pressure-1.md +67 -0
- package/content/skills/systematic-debugging/test-pressure-2.md +77 -0
- package/content/skills/systematic-debugging/test-pressure-3.md +77 -0
- package/content/skills/testing-conventions/SKILL.md +168 -0
- package/content/skills/testing-conventions/mistakes.md +1 -0
- package/content/skills/typescript-testing-conventions/SKILL.md +129 -0
- package/content/skills/update-jira-ticket/SKILL.md +245 -0
- package/content/skills/update-jira-ticket/update-jira-ticket.mjs +9 -0
- package/content/skills/update-project-guidance/SKILL.md +300 -0
- package/content/skills/upgrade-dependencies/SKILL.md +139 -0
- package/content/skills/wrap-up/SKILL.md +431 -0
- package/content/subagents/_data/claude.yaml +19 -0
- package/content/subagents/_data/rovo.yaml +31 -0
- package/content/subagents/canary.md +11 -0
- package/content/subagents/entry-drafter.md +187 -0
- package/content/subagents/handoff-reviewer.md +75 -0
- package/content/subagents/plan-reviewer.md +184 -0
- package/content/subagents/plan-reviser.md +88 -0
- package/content/subagents/prose-reviser.md +130 -0
- package/content/subagents/ticket-assessor.md +139 -0
- package/package.json +70 -2
- package/schemas/preferences.v1.json +294 -0
- package/schemas/work-types.v1.json +142 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { createRequire as __cjsCreateRequire } from 'node:module';
|
|
2
|
+
const require = __cjsCreateRequire(import.meta.url);
|
|
3
|
+
var ha=Object.create;var rs=Object.defineProperty;var ma=Object.getOwnPropertyDescriptor;var pa=Object.getOwnPropertyNames;var ga=Object.getPrototypeOf,ya=Object.prototype.hasOwnProperty;var a=(s,e)=>rs(s,"name",{value:e,configurable:!0}),ze=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var y=(s,e)=>()=>{try{return e||s((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var ba=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pa(e))!ya.call(s,i)&&i!==t&&rs(s,i,{get:()=>e[i],enumerable:!(n=ma(e,i))||n.enumerable});return s};var Sa=(s,e,t)=>(t=s!=null?ha(ga(s)):{},ba(e||!s||!s.__esModule?rs(t,"default",{value:s,enumerable:!0}):t,s));var O=y(I=>{"use strict";var us=Symbol.for("yaml.alias"),ii=Symbol.for("yaml.document"),et=Symbol.for("yaml.map"),ri=Symbol.for("yaml.pair"),fs=Symbol.for("yaml.scalar"),tt=Symbol.for("yaml.seq"),K=Symbol.for("yaml.node.type"),Ia=a(s=>!!s&&typeof s=="object"&&s[K]===us,"isAlias"),$a=a(s=>!!s&&typeof s=="object"&&s[K]===ii,"isDocument"),_a=a(s=>!!s&&typeof s=="object"&&s[K]===et,"isMap"),Da=a(s=>!!s&&typeof s=="object"&&s[K]===ri,"isPair"),oi=a(s=>!!s&&typeof s=="object"&&s[K]===fs,"isScalar"),ja=a(s=>!!s&&typeof s=="object"&&s[K]===tt,"isSeq");function ai(s){if(s&&typeof s=="object")switch(s[K]){case et:case tt:return!0}return!1}a(ai,"isCollection");function Ra(s){if(s&&typeof s=="object")switch(s[K]){case us:case et:case fs:case tt:return!0}return!1}a(Ra,"isNode");var Ba=a(s=>(oi(s)||ai(s))&&!!s.anchor,"hasAnchor");I.ALIAS=us;I.DOC=ii;I.MAP=et;I.NODE_TYPE=K;I.PAIR=ri;I.SCALAR=fs;I.SEQ=tt;I.hasAnchor=Ba;I.isAlias=Ia;I.isCollection=ai;I.isDocument=$a;I.isMap=_a;I.isNode=Ra;I.isPair=Da;I.isScalar=oi;I.isSeq=ja});var ke=y(ds=>{"use strict";var P=O(),$=Symbol("break visit"),li=Symbol("skip children"),B=Symbol("remove node");function st(s,e){let t=ci(e);P.isDocument(s)?ue(null,s.contents,t,Object.freeze([s]))===B&&(s.contents=null):ue(null,s,t,Object.freeze([]))}a(st,"visit");st.BREAK=$;st.SKIP=li;st.REMOVE=B;function ue(s,e,t,n){let i=ui(s,e,t,n);if(P.isNode(i)||P.isPair(i))return fi(s,n,i),ue(s,i,t,n);if(typeof i!="symbol"){if(P.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=ue(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===$)return $;o===B&&(e.items.splice(r,1),r-=1)}}}else if(P.isPair(e)){n=Object.freeze(n.concat(e));let r=ue("key",e.key,t,n);if(r===$)return $;r===B&&(e.key=null);let o=ue("value",e.value,t,n);if(o===$)return $;o===B&&(e.value=null)}}return i}a(ue,"visit_");async function nt(s,e){let t=ci(e);P.isDocument(s)?await fe(null,s.contents,t,Object.freeze([s]))===B&&(s.contents=null):await fe(null,s,t,Object.freeze([]))}a(nt,"visitAsync");nt.BREAK=$;nt.SKIP=li;nt.REMOVE=B;async function fe(s,e,t,n){let i=await ui(s,e,t,n);if(P.isNode(i)||P.isPair(i))return fi(s,n,i),fe(s,i,t,n);if(typeof i!="symbol"){if(P.isCollection(e)){n=Object.freeze(n.concat(e));for(let r=0;r<e.items.length;++r){let o=await fe(r,e.items[r],t,n);if(typeof o=="number")r=o-1;else{if(o===$)return $;o===B&&(e.items.splice(r,1),r-=1)}}}else if(P.isPair(e)){n=Object.freeze(n.concat(e));let r=await fe("key",e.key,t,n);if(r===$)return $;r===B&&(e.key=null);let o=await fe("value",e.value,t,n);if(o===$)return $;o===B&&(e.value=null)}}return i}a(fe,"visitAsync_");function ci(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}a(ci,"initVisitor");function ui(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(P.isMap(e))return t.Map?.(s,e,n);if(P.isSeq(e))return t.Seq?.(s,e,n);if(P.isPair(e))return t.Pair?.(s,e,n);if(P.isScalar(e))return t.Scalar?.(s,e,n);if(P.isAlias(e))return t.Alias?.(s,e,n)}a(ui,"callVisitor");function fi(s,e,t){let n=e[e.length-1];if(P.isCollection(n))n.items[s]=t;else if(P.isPair(n))s==="key"?n.key=t:n.value=t;else if(P.isDocument(n))n.contents=t;else{let i=P.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}a(fi,"replaceNode");ds.visit=st;ds.visitAsync=nt});var hs=y(hi=>{"use strict";var di=O(),Fa=ke(),Ka={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ua=a(s=>s.replace(/[!,[\]{}]/g,e=>Ka[e]),"escapeTagName"),Ne=class s{static{a(this,"Directives")}constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[r,o]=n;return this.tags[r]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=n;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[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let r=this.tags[n];if(r)try{return r+decodeURIComponent(i)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Ua(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&di.isNode(e.contents)){let r={};Fa.visit(e.contents,(o,l)=>{di.isNode(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(let[r,o]of n)r==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&t.push(`%TAG ${r} ${o}`);return t.join(`
|
|
4
|
+
`)}};Ne.defaultYaml={explicit:!1,version:"1.2"};Ne.defaultTags={"!!":"tag:yaml.org,2002:"};hi.Directives=Ne});var it=y(Ae=>{"use strict";var mi=O(),Ya=ke();function xa(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}a(xa,"anchorIsValid");function pi(s){let e=new Set;return Ya.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}a(pi,"anchorNames");function gi(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}a(gi,"findNewAnchor");function Ja(s,e){let t=[],n=new Map,i=null;return{onAnchor:a(r=>{t.push(r),i??(i=pi(s));let o=gi(e,i);return i.add(o),o},"onAnchor"),setAnchors:a(()=>{for(let r of t){let o=n.get(r);if(typeof o=="object"&&o.anchor&&(mi.isScalar(o.node)||mi.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:n}}a(Ja,"createNodeAnchors");Ae.anchorIsValid=xa;Ae.anchorNames=pi;Ae.createNodeAnchors=Ja;Ae.findNewAnchor=gi});var ms=y(yi=>{"use strict";function Ee(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,r=n.length;i<r;++i){let o=n[i],l=Ee(s,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let r=n.get(i),o=Ee(s,n,i,r);o===void 0?n.delete(i):o!==r&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let r=Ee(s,n,i,i);r===void 0?n.delete(i):r!==i&&(n.delete(i),n.add(r))}else for(let[i,r]of Object.entries(n)){let o=Ee(s,n,i,r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}return s.call(e,t,n)}a(Ee,"applyReviver");yi.applyReviver=Ee});var x=y(Si=>{"use strict";var Va=O();function bi(s,e,t){if(Array.isArray(s))return s.map((n,i)=>bi(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!Va.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=r=>{n.res=r,delete t.onCreate};let i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!t?.keep?Number(s):s}a(bi,"toJS");Si.toJS=bi});var rt=y(vi=>{"use strict";var Wa=ms(),wi=O(),Ga=x(),ps=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,wi.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:n,onAnchor:i,reviver:r}={}){if(!wi.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 n=="number"?n:100},l=Ga.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:u}of o.anchors.values())i(u,c);return typeof r=="function"?Wa.applyReviver(r,{"":l},"",l):l}};vi.NodeBase=ps});var Oe=y(ki=>{"use strict";var Ha=it(),Qa=ke(),de=O(),Xa=rt(),za=x(),gs=class extends Xa.NodeBase{static{a(this,"Alias")}constructor(e){super(de.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 n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Qa.visit(e,{Node:a((r,o)=>{(de.isAlias(o)||de.hasAnchor(o))&&n.push(o)},"Node")}),t&&(t.aliasResolveCache=n));let i;for(let r of n){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||(za.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 n=this.resolve(t.doc,t);if(!n){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(i)}return t.anchors.get(n).res}toString(e,t,n){let i=`*${this.source}`;if(e){if(Ha.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(s,e,t){if(de.isAlias(e)){let n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(de.isCollection(e)){let n=0;for(let i of e.items){let r=ot(s,i,t);r>n&&(n=r)}return n}else if(de.isPair(e)){let n=ot(s,e.key,t),i=ot(s,e.value,t);return Math.max(n,i)}return 1}a(ot,"getAliasCount");ki.Alias=gs});var L=y(ys=>{"use strict";var Za=O(),el=rt(),tl=x(),sl=a(s=>!s||typeof s!="function"&&typeof s!="object","isScalarValue"),J=class extends el.NodeBase{static{a(this,"Scalar")}constructor(e){super(Za.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:tl.toJS(this.value,e,t)}toString(){return String(this.value)}};J.BLOCK_FOLDED="BLOCK_FOLDED";J.BLOCK_LITERAL="BLOCK_LITERAL";J.PLAIN="PLAIN";J.QUOTE_DOUBLE="QUOTE_DOUBLE";J.QUOTE_SINGLE="QUOTE_SINGLE";ys.Scalar=J;ys.isScalarValue=sl});var qe=y(Ai=>{"use strict";var nl=Oe(),te=O(),Ni=L(),il="tag:yaml.org,2002:";function rl(s,e,t){if(e){let n=t.filter(r=>r.tag===e),i=n.find(r=>!r.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>n.identify?.(s)&&!n.format)}a(rl,"findTagObject");function ol(s,e,t){if(te.isDocument(s)&&(s=s.contents),te.isNode(s))return s;if(te.isPair(s)){let f=t.schema[te.MAP].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:r,schema:o,sourceObjects:l}=t,c;if(n&&s&&typeof s=="object"){if(c=l.get(s),c)return c.anchor??(c.anchor=i(s)),new nl.Alias(c.anchor);c={anchor:null,node:null},l.set(s,c)}e?.startsWith("!!")&&(e=il+e.slice(2));let u=rl(s,e,o.tags);if(!u){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new Ni.Scalar(s);return c&&(c.node=f),f}u=s instanceof Map?o[te.MAP]:Symbol.iterator in Object(s)?o[te.SEQ]:o[te.MAP]}r&&(r(u),delete t.onTagObj);let m=u?.createNode?u.createNode(t.schema,s,t):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(t.schema,s,t):new Ni.Scalar(s);return e?m.tag=e:u.default||(m.tag=u.tag),c&&(c.node=m),m}a(ol,"createNode");Ai.createNode=ol});var lt=y(at=>{"use strict";var al=qe(),F=O(),ll=rt();function bs(s,e,t){let n=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]=n,n=o}else n=new Map([[r,n]])}return al.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:s,sourceObjects:new Map})}a(bs,"collectionFromPath");var Ei=a(s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,"isEmptyPath"),Ss=class extends ll.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(n=>F.isNode(n)||F.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ei(e))this.add(t);else{let[n,...i]=e,r=this.get(n,!0);if(F.isCollection(r))r.addIn(i,t);else if(r===void 0&&this.schema)this.set(n,bs(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(F.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,r=this.get(n,!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 n=t.value;return n==null||e&&F.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return F.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let r=this.get(n,!0);if(F.isCollection(r))r.setIn(i,t);else if(r===void 0&&this.schema)this.set(n,bs(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};at.Collection=Ss;at.collectionFromPath=bs;at.isEmptyPath=Ei});var Te=y(ct=>{"use strict";var cl=a(s=>s.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function ws(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}a(ws,"indentComment");var ul=a((s,e,t)=>s.endsWith(`
|
|
5
|
+
`)?ws(t,e):t.includes(`
|
|
6
|
+
`)?`
|
|
7
|
+
`+ws(t,e):(s.endsWith(" ")?"":" ")+t,"lineComment");ct.indentComment=ws;ct.lineComment=ul;ct.stringifyComment=cl});var qi=y(Le=>{"use strict";var fl="flow",vs="block",ut="quoted";function dl(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:r=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return s;i<r&&(r=0);let c=Math.max(1+r,1+i-e.length);if(s.length<=c)return s;let u=[],m={},f=i-e.length;typeof n=="number"&&(n>i-Math.max(2,r)?u.push(0):f=i-n);let d,g,b=!1,h=-1,p=-1,w=-1;t===vs&&(h=Oi(s,h,e.length),h!==-1&&(f=h+c));for(let k;k=s[h+=1];){if(t===ut&&k==="\\"){switch(p=h,s[h+1]){case"x":h+=3;break;case"u":h+=5;break;case"U":h+=9;break;default:h+=1}w=h}if(k===`
|
|
8
|
+
`)t===vs&&(h=Oi(s,h,e.length)),f=h+e.length+c,d=void 0;else{if(k===" "&&g&&g!==" "&&g!==`
|
|
9
|
+
`&&g!==" "){let N=s[h+1];N&&N!==" "&&N!==`
|
|
10
|
+
`&&N!==" "&&(d=h)}if(h>=f)if(d)u.push(d),f=d+c,d=void 0;else if(t===ut){for(;g===" "||g===" ";)g=k,k=s[h+=1],b=!0;let N=h>w+1?h-2:p-1;if(m[N])return s;u.push(N),m[N]=!0,f=N+c,d=void 0}else b=!0}g=k}if(b&&l&&l(),u.length===0)return s;o&&o();let v=s.slice(0,u[0]);for(let k=0;k<u.length;++k){let N=u[k],A=u[k+1]||s.length;N===0?v=`
|
|
11
|
+
${e}${s.slice(0,A)}`:(t===ut&&m[N]&&(v+=`${s[N]}\\`),v+=`
|
|
12
|
+
${e}${s.slice(N+1,A)}`)}return v}a(dl,"foldFlowLines");function Oi(s,e,t){let n=e,i=e+1,r=s[i];for(;r===" "||r===" ";)if(e<i+t)r=s[++e];else{do r=s[++e];while(r&&r!==`
|
|
13
|
+
`);n=e,i=e+1,r=s[i]}return n}a(Oi,"consumeMoreIndentedLines");Le.FOLD_BLOCK=vs;Le.FOLD_FLOW=fl;Le.FOLD_QUOTED=ut;Le.foldFlowLines=dl});var Me=y(Ti=>{"use strict";var j=L(),V=qi(),dt=a((s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),"getFoldOptions"),ht=a(s=>/^(%|---|\.\.\.)/m.test(s),"containsDocumentMarker");function hl(s,e,t){if(!e||e<0)return!1;let n=e-t,i=s.length;if(i<=n)return!1;for(let r=0,o=0;r<i;++r)if(s[r]===`
|
|
14
|
+
`){if(r-o>n)return!0;if(o=r+1,i-o<=n)return!1}return!0}a(hl,"lineLengthOverLimit");function Ce(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,r=e.indent||(ht(s)?" ":""),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 m=t.substr(c+2,4);switch(m){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:m.substr(0,2)==="00"?o+="\\x"+m.substr(2):o+=t.substr(c,6)}c+=5,l=c+1}break;case"n":if(n||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,n?o:V.foldFlowLines(o,r,V.FOLD_QUOTED,dt(e,!1))}a(Ce,"doubleQuotedString");function ks(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return Ce(s,e);let t=e.indent||(ht(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${t}`)+"'";return e.implicitKey?n:V.foldFlowLines(n,t,V.FOLD_FLOW,dt(e,!1))}a(ks,"singleQuotedString");function he(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Ce;else{let i=s.includes('"'),r=s.includes("'");i&&!r?n=ks:r&&!i?n=Ce:n=t?ks:Ce}return n(s,e)}a(he,"quotedString");var Ns;try{Ns=new RegExp(`(^|(?<!
|
|
20
|
+
))
|
|
21
|
+
+(?!
|
|
22
|
+
|$)`,"g")}catch{Ns=/\n+(?!\n|$)/g}function ft({comment:s,type:e,value:t},n,i,r){let{blockQuote:o,commentString:l,lineWidth:c}=n.options;if(!o||/\n[\t ]+$/.test(t))return he(t,n);let u=n.indent||(n.forceBlockIndent||ht(t)?" ":""),m=o==="literal"?!0:o==="folded"||e===j.Scalar.BLOCK_FOLDED?!1:e===j.Scalar.BLOCK_LITERAL?!0:!hl(t,c,u.length);if(!t)return m?`|
|
|
23
|
+
`:`>
|
|
24
|
+
`;let f,d;for(d=t.length;d>0;--d){let A=t[d-1];if(A!==`
|
|
25
|
+
`&&A!==" "&&A!==" ")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(Ns,`$&${u}`));let h=!1,p,w=-1;for(p=0;p<t.length;++p){let A=t[p];if(A===" ")h=!0;else if(A===`
|
|
28
|
+
`)w=p;else break}let v=t.substring(0,w<p?w+1:p);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${u}`));let N=(h?u?"2":"1":"")+f;if(s&&(N+=" "+l(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){let A=t.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),E=!1,T=dt(n,!0);o!=="folded"&&e!==j.Scalar.BLOCK_FOLDED&&(T.onOverflow=()=>{E=!0});let S=V.foldFlowLines(`${v}${A}${g}`,u,V.FOLD_BLOCK,T);if(!E)return`>${N}
|
|
30
|
+
${u}${S}`}return t=t.replace(/\n+/g,`$&${u}`),`|${N}
|
|
31
|
+
${u}${v}${t}${g}`}a(ft,"blockString");function ml(s,e,t,n){let{type:i,value:r}=s,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:m}=e;if(l&&r.includes(`
|
|
32
|
+
`)||m&&/[[\]{},]/.test(r))return he(r,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||m||!r.includes(`
|
|
33
|
+
`)?he(r,e):ft(s,e,t,n);if(!l&&!m&&i!==j.Scalar.PLAIN&&r.includes(`
|
|
34
|
+
`))return ft(s,e,t,n);if(ht(r)){if(c==="")return e.forceBlockIndent=!0,ft(s,e,t,n);if(l&&c===u)return he(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 he(r,e)}return l?f:V.foldFlowLines(f,c,V.FOLD_FLOW,dt(e,!1))}a(ml,"plainString");function pl(s,e,t,n){let{implicitKey:i,inFlow:r}=e,o=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:l}=s;l!==j.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=j.Scalar.QUOTE_DOUBLE);let c=a(m=>{switch(m){case j.Scalar.BLOCK_FOLDED:case j.Scalar.BLOCK_LITERAL:return i||r?he(o.value,e):ft(o,e,t,n);case j.Scalar.QUOTE_DOUBLE:return Ce(o.value,e);case j.Scalar.QUOTE_SINGLE:return ks(o.value,e);case j.Scalar.PLAIN:return ml(o,e,t,n);default:return null}},"_stringify"),u=c(l);if(u===null){let{defaultKeyType:m,defaultStringType:f}=e.options,d=i&&m||f;if(u=c(d),u===null)throw new Error(`Unsupported default string type ${d}`)}return u}a(pl,"stringifyString");Ti.stringifyString=pl});var Pe=y(As=>{"use strict";var gl=it(),W=O(),yl=Te(),bl=Me();function Sl(s,e){let t=Object.assign({blockQuote:!0,commentString:yl.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},s.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}a(Sl,"createStringifyContext");function wl(s,e){if(e.tag){let i=s.filter(r=>r.tag===e.tag);if(i.length>0)return i.find(r=>r.format===e.format)??i[0]}let t,n;if(W.isScalar(e)){n=e.value;let i=s.filter(r=>r.identify?.(n));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 n=e,t=s.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!t){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return t}a(wl,"getTagObject");function vl(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let i=[],r=(W.isScalar(s)||W.isCollection(s))&&s.anchor;r&&gl.anchorIsValid(r)&&(t.add(r),i.push(`&${r}`));let o=s.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}a(vl,"stringifyProps");function kl(s,e,t,n){if(W.isPair(s))return s.toString(e,t,n);if(W.isAlias(s)){if(e.doc.directives)return s.toString(e);if(e.resolvedAliases?.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i,r=W.isNode(s)?s:e.doc.createNode(s,{onTagObj:a(c=>i=c,"onTagObj")});i??(i=wl(e.doc.schema.tags,r));let o=vl(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,n):W.isScalar(r)?bl.stringifyString(r,e,t,n):r.toString(e,t,n);return o?W.isScalar(r)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
36
|
+
${e.indent}${l}`:l}a(kl,"stringify");As.createStringifyContext=Sl;As.stringify=kl});var Pi=y(Mi=>{"use strict";var U=O(),Li=L(),Ci=Pe(),Ie=Te();function Nl({key:s,value:e},t,n,i){let{allNullValues:r,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:m,simpleKeys:f}}=t,d=U.isNode(s)&&s.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(U.isCollection(s)||!U.isNode(s)&&typeof s=="object"){let T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let g=!f&&(!s||d&&e==null&&!t.inFlow||U.isCollection(s)||(U.isScalar(s)?s.type===Li.Scalar.BLOCK_FOLDED||s.type===Li.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(f||!r),indent:l+c});let b=!1,h=!1,p=Ci.stringify(s,t,()=>b=!0,()=>h=!0);if(!g&&!t.inFlow&&p.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&&n&&n(),p===""?"?":g?`? ${p}`:p}else if(r&&!f||e==null&&g)return p=`? ${p}`,d&&!b?p+=Ie.lineComment(p,t.indent,u(d)):h&&i&&i(),p;b&&(d=null),g?(d&&(p+=Ie.lineComment(p,t.indent,u(d))),p=`? ${p}
|
|
37
|
+
${l}:`):(p=`${p}:`,d&&(p+=Ie.lineComment(p,t.indent,u(d))));let w,v,k;U.isNode(e)?(w=!!e.spaceBefore,v=e.commentBefore,k=e.comment):(w=!1,v=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!g&&!d&&U.isScalar(e)&&(t.indentAtStart=p.length+1),h=!1,!m&&c.length>=2&&!t.inFlow&&!g&&U.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let N=!1,A=Ci.stringify(e,t,()=>N=!0,()=>h=!0),E=" ";if(d||w||v){if(E=w?`
|
|
38
|
+
`:"",v){let T=u(v);E+=`
|
|
39
|
+
${Ie.indentComment(T,t.indent)}`}A===""&&!t.inFlow?E===`
|
|
40
|
+
`&&k&&(E=`
|
|
41
|
+
|
|
42
|
+
`):E+=`
|
|
43
|
+
${t.indent}`}else if(!g&&U.isCollection(e)){let T=A[0],S=A.indexOf(`
|
|
44
|
+
`),C=S!==-1,Y=t.inFlow??e.flow??e.items.length===0;if(C||!Y){let ce=!1;if(C&&(T==="&"||T==="!")){let M=A.indexOf(" ");T==="&"&&M!==-1&&M<S&&A[M+1]==="!"&&(M=A.indexOf(" ",M+1)),(M===-1||S<M)&&(ce=!0)}ce||(E=`
|
|
45
|
+
${t.indent}`)}}else(A===""||A[0]===`
|
|
46
|
+
`)&&(E="");return p+=E+A,t.inFlow?N&&n&&n():k&&!N?p+=Ie.lineComment(p,t.indent,u(k)):h&&i&&i(),p}a(Nl,"stringifyPair");Mi.stringifyPair=Nl});var Os=y(Es=>{"use strict";var Ii=ze("process");function Al(s,...e){s==="debug"&&console.log(...e)}a(Al,"debug");function El(s,e){(s==="debug"||s==="warn")&&(typeof Ii.emitWarning=="function"?Ii.emitWarning(e):console.warn(e))}a(El,"warn");Es.debug=Al;Es.warn=El});var bt=y(yt=>{"use strict";var gt=O(),$i=L(),mt="<<",pt={identify:a(s=>s===mt||typeof s=="symbol"&&s.description===mt,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new $i.Scalar(Symbol(mt)),{addToJSMap:_i}),"resolve"),stringify:a(()=>mt,"stringify")},Ol=a((s,e)=>(pt.identify(e)||gt.isScalar(e)&&(!e.type||e.type===$i.Scalar.PLAIN)&&pt.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===pt.tag&&t.default),"isMergeKey");function _i(s,e,t){let n=Di(s,t);if(gt.isSeq(n))for(let i of n.items)qs(s,e,i);else if(Array.isArray(n))for(let i of n)qs(s,e,i);else qs(s,e,n)}a(_i,"addMergeToJSMap");function qs(s,e,t){let n=Di(s,t);if(!gt.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,s,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(qs,"mergeValue");function Di(s,e){return s&>.isAlias(e)?e.resolve(s.doc,s):e}a(Di,"resolveAliasValue");yt.addMergeToJSMap=_i;yt.isMergeKey=Ol;yt.merge=pt});var Ls=y(Bi=>{"use strict";var ql=Os(),ji=bt(),Tl=Pe(),Ri=O(),Ts=x();function Ll(s,e,{key:t,value:n}){if(Ri.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(ji.isMergeKey(s,t))ji.addMergeToJSMap(s,e,n);else{let i=Ts.toJS(t,"",s);if(e instanceof Map)e.set(i,Ts.toJS(n,i,s));else if(e instanceof Set)e.add(i);else{let r=Cl(t,i,s),o=Ts.toJS(n,r,s);r in e?Object.defineProperty(e,r,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[r]=o}}return e}a(Ll,"addPairToJSMap");function Cl(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Ri.isNode(s)&&t?.doc){let n=Tl.createStringifyContext(t.doc,{});n.anchors=new Set;for(let r of t.anchors.keys())n.anchors.add(r.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=s.toString(n);if(!t.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),ql.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(Cl,"stringifyKey");Bi.addPairToJSMap=Ll});var G=y(Cs=>{"use strict";var Fi=qe(),Ml=Pi(),Pl=Ls(),St=O();function Il(s,e,t){let n=Fi.createNode(s,void 0,t),i=Fi.createNode(e,void 0,t);return new wt(n,i)}a(Il,"createPair");var wt=class s{static{a(this,"Pair")}constructor(e,t=null){Object.defineProperty(this,St.NODE_TYPE,{value:St.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return St.isNode(t)&&(t=t.clone(e)),St.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return Pl.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?Ml.stringifyPair(this,e,t,n):JSON.stringify(this)}};Cs.Pair=wt;Cs.createPair=Il});var Ms=y(Ui=>{"use strict";var se=O(),Ki=Pe(),vt=Te();function $l(s,e,t){return(e.inFlow??s.flow?Dl:_l)(s,e,t)}a($l,"stringifyCollection");function _l({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:r,onChompKeep:o,onComment:l}){let{indent:c,options:{commentString:u}}=t,m=Object.assign({},t,{indent:r,type:null}),f=!1,d=[];for(let b=0;b<e.length;++b){let h=e[b],p=null;if(se.isNode(h))!f&&h.spaceBefore&&d.push(""),kt(t,d,h.commentBefore,f),h.comment&&(p=h.comment);else if(se.isPair(h)){let v=se.isNode(h.key)?h.key:null;v&&(!f&&v.spaceBefore&&d.push(""),kt(t,d,v.commentBefore,f))}f=!1;let w=Ki.stringify(h,m,()=>p=null,()=>f=!0);p&&(w+=vt.lineComment(w,r,u(p))),f&&p&&(f=!1),d.push(n+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 s?(g+=`
|
|
49
|
+
`+vt.indentComment(u(s),c),l&&l()):f&&o&&o(),g}a(_l,"stringifyBlockCollection");function Dl({items:s},e,{flowChars:t,itemIndent:n}){let{indent:i,indentStep:r,flowCollectionPadding:o,options:{commentString:l}}=e;n+=r;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),u=!1,m=0,f=[];for(let b=0;b<s.length;++b){let h=s[b],p=null;if(se.isNode(h))h.spaceBefore&&f.push(""),kt(e,f,h.commentBefore,!1),h.comment&&(p=h.comment);else if(se.isPair(h)){let v=se.isNode(h.key)?h.key:null;v&&(v.spaceBefore&&f.push(""),kt(e,f,v.commentBefore,!1),v.comment&&(u=!0));let k=se.isNode(h.value)?h.value:null;k?(k.comment&&(p=k.comment),k.commentBefore&&(u=!0)):h.value==null&&v?.comment&&(p=v.comment)}p&&(u=!0);let w=Ki.stringify(h,c,()=>p=null);u||(u=f.length>m||w.includes(`
|
|
50
|
+
`)),b<s.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(u||(u=f.reduce((v,k)=>v+k.length+2,2)+(w.length+2)>e.options.lineWidth)),u&&(w+=",")),p&&(w+=vt.lineComment(w,n,l(p))),f.push(w),m=f.length}let{start:d,end:g}=t;if(f.length===0)return d+g;if(!u){let b=f.reduce((h,p)=>h+p.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(Dl,"stringifyFlowCollection");function kt({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let r=vt.indentComment(e(n),s);t.push(r.trimStart())}}a(kt,"addCommentBefore");Ui.stringifyCollection=$l});var Q=y(Is=>{"use strict";var jl=Ms(),Rl=Ls(),Bl=lt(),H=O(),Nt=G(),Fl=L();function $e(s,e){let t=H.isScalar(e)?e.value:e;for(let n of s)if(H.isPair(n)&&(n.key===e||n.key===t||H.isScalar(n.key)&&n.key.value===t))return n}a($e,"findPair");var Ps=class extends Bl.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(H.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:i,replacer:r}=n,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(Nt.createPair(c,u,n))},"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 n;H.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Nt.Pair(e,e?.value):n=new Nt.Pair(e.key,e.value);let i=$e(this.items,n.key),r=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);H.isScalar(i.value)&&Fl.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(r){let o=this.items.findIndex(l=>r(n,l)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=$e(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let i=$e(this.items,e)?.value;return(!t&&H.isScalar(i)?i.value:i)??void 0}has(e){return!!$e(this.items,e)}set(e,t){this.add(new Nt.Pair(e,t),!0)}toJSON(e,t,n){let i=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let r of this.items)Rl.addPairToJSMap(t,i,r);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!H.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})),jl.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};Is.YAMLMap=Ps;Is.findPair=$e});var me=y(xi=>{"use strict";var Kl=O(),Yi=Q(),Ul={collection:"map",default:!0,nodeClass:Yi.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return Kl.isMap(s)||e("Expected a mapping for this tag"),s},createNode:a((s,e,t)=>Yi.YAMLMap.from(s,e,t),"createNode")};xi.map=Ul});var X=y(Ji=>{"use strict";var Yl=qe(),xl=Ms(),Jl=lt(),Et=O(),Vl=L(),Wl=x(),$s=class extends Jl.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Et.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=At(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=At(e);if(typeof n!="number")return;let i=this.items[n];return!t&&Et.isScalar(i)?i.value:i}has(e){let t=At(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=At(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Et.isScalar(i)&&Vl.isScalarValue(t)?i.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let i=0;for(let r of this.items)n.push(Wl.toJS(r,String(i++),t));return n}toString(e,t,n){return e?xl.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:i}=n,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(Yl.createNode(l,void 0,n))}}return r}};function At(s){let e=Et.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}a(At,"asItemIndex");Ji.YAMLSeq=$s});var pe=y(Wi=>{"use strict";var Gl=O(),Vi=X(),Hl={collection:"seq",default:!0,nodeClass:Vi.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Gl.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:a((s,e,t)=>Vi.YAMLSeq.from(s,e,t),"createNode")};Wi.seq=Hl});var _e=y(Gi=>{"use strict";var Ql=Me(),Xl={identify:a(s=>typeof s=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(s=>s,"resolve"),stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),Ql.stringifyString(s,e,t,n)}};Gi.string=Xl});var Ot=y(Xi=>{"use strict";var Hi=L(),Qi={identify:a(s=>s==null,"identify"),createNode:a(()=>new Hi.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new Hi.Scalar(null),"resolve"),stringify:a(({source:s},e)=>typeof s=="string"&&Qi.test.test(s)?s:e.options.nullStr,"stringify")};Xi.nullTag=Qi});var _s=y(Zi=>{"use strict";var zl=L(),zi={identify:a(s=>typeof s=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a(s=>new zl.Scalar(s[0]==="t"||s[0]==="T"),"resolve"),stringify({source:s,value:e},t){if(s&&zi.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};Zi.boolTag=zi});var ge=y(er=>{"use strict";function Zl({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&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(Zl,"stringifyNumber");er.stringifyNumber=Zl});var js=y(qt=>{"use strict";var ec=L(),Ds=ge(),tc={identify:a(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Ds.stringifyNumber},sc={identify:a(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a(s=>parseFloat(s),"resolve"),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Ds.stringifyNumber(s)}},nc={identify:a(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){let e=new ec.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:Ds.stringifyNumber};qt.float=nc;qt.floatExp=sc;qt.floatNaN=tc});var Bs=y(Lt=>{"use strict";var tr=ge(),Tt=a(s=>typeof s=="bigint"||Number.isInteger(s),"intIdentify"),Rs=a((s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t),"intResolve");function sr(s,e,t){let{value:n}=s;return Tt(n)&&n>=0?t+n.toString(e):tr.stringifyNumber(s)}a(sr,"intStringify");var ic={identify:a(s=>Tt(s)&&s>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((s,e,t)=>Rs(s,2,8,t),"resolve"),stringify:a(s=>sr(s,8,"0o"),"stringify")},rc={identify:Tt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((s,e,t)=>Rs(s,0,10,t),"resolve"),stringify:tr.stringifyNumber},oc={identify:a(s=>Tt(s)&&s>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:a((s,e,t)=>Rs(s,2,16,t),"resolve"),stringify:a(s=>sr(s,16,"0x"),"stringify")};Lt.int=rc;Lt.intHex=oc;Lt.intOct=ic});var ir=y(nr=>{"use strict";var ac=me(),lc=Ot(),cc=pe(),uc=_e(),fc=_s(),Fs=js(),Ks=Bs(),dc=[ac.map,cc.seq,uc.string,lc.nullTag,fc.boolTag,Ks.intOct,Ks.int,Ks.intHex,Fs.floatNaN,Fs.floatExp,Fs.float];nr.schema=dc});var ar=y(or=>{"use strict";var hc=L(),mc=me(),pc=pe();function rr(s){return typeof s=="bigint"||Number.isInteger(s)}a(rr,"intIdentify");var Ct=a(({value:s})=>JSON.stringify(s),"stringifyJSON"),gc=[{identify:a(s=>typeof s=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(s=>s,"resolve"),stringify:Ct},{identify:a(s=>s==null,"identify"),createNode:a(()=>new hc.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:Ct},{identify:a(s=>typeof s=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a(s=>s==="true","resolve"),stringify:Ct},{identify:rr,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:a((s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),"resolve"),stringify:a(({value:s})=>rr(s)?s.toString():JSON.stringify(s),"stringify")},{identify:a(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a(s=>parseFloat(s),"resolve"),stringify:Ct}],yc={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},bc=[mc.map,pc.seq].concat(gc,yc);or.schema=bc});var Ys=y(lr=>{"use strict";var De=ze("buffer"),Us=L(),Sc=Me(),wc={identify:a(s=>s instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof De.Buffer=="function")return De.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,r){if(!t)return"";let o=t,l;if(typeof De.Buffer=="function")l=o instanceof De.Buffer?o.toString("base64"):De.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=Us.Scalar.BLOCK_LITERAL),e!==Us.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),u=Math.ceil(l.length/c),m=new Array(u);for(let f=0,d=0;f<u;++f,d+=c)m[f]=l.substr(d,c);l=m.join(e===Us.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return Sc.stringifyString({comment:s,type:e,value:l},n,i,r)}};lr.binary=wc});var It=y(Pt=>{"use strict";var Mt=O(),xs=G(),vc=L(),kc=X();function cr(s,e){if(Mt.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!Mt.isPair(n)){if(Mt.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new xs.Pair(new vc.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
55
|
+
${i.key.commentBefore}`:n.commentBefore),n.comment){let r=i.value??i.key;r.comment=r.comment?`${n.comment}
|
|
56
|
+
${r.comment}`:n.comment}n=i}s.items[t]=Mt.isPair(n)?n:new xs.Pair(n)}}else e("Expected a sequence for this tag");return s}a(cr,"resolvePairs");function ur(s,e,t){let{replacer:n}=t,i=new kc.YAMLSeq(s);i.tag="tag:yaml.org,2002:pairs";let r=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.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(xs.createPair(l,c,t))}return i}a(ur,"createPairs");var Nc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:cr,createNode:ur};Pt.createPairs=ur;Pt.pairs=Nc;Pt.resolvePairs=cr});var Ws=y(Vs=>{"use strict";var fr=O(),Js=x(),je=Q(),Ac=X(),dr=It(),ne=class s extends Ac.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=je.YAMLMap.prototype.add.bind(this),this.delete=je.YAMLMap.prototype.delete.bind(this),this.get=je.YAMLMap.prototype.get.bind(this),this.has=je.YAMLMap.prototype.has.bind(this),this.set=je.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let r,o;if(fr.isPair(i)?(r=Js.toJS(i.key,"",t),o=Js.toJS(i.value,r,t)):r=Js.toJS(i,"",t),n.has(r))throw new Error("Ordered maps must not include duplicate keys");n.set(r,o)}return n}static from(e,t,n){let i=dr.createPairs(e,t,n),r=new this;return r.items=i.items,r}};ne.tag="tag:yaml.org,2002:omap";var Ec={collection:"seq",identify:a(s=>s instanceof Map,"identify"),nodeClass:ne,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=dr.resolvePairs(s,e),n=[];for(let{key:i}of t.items)fr.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new ne,t)},createNode:a((s,e,t)=>ne.from(s,e,t),"createNode")};Vs.YAMLOMap=ne;Vs.omap=Ec});var yr=y(Gs=>{"use strict";var hr=L();function mr({value:s,source:e},t){return e&&(s?pr:gr).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}a(mr,"boolStringify");var pr={identify:a(s=>s===!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 hr.Scalar(!0),"resolve"),stringify:mr},gr={identify:a(s=>s===!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 hr.Scalar(!1),"resolve"),stringify:mr};Gs.falseTag=gr;Gs.trueTag=pr});var br=y($t=>{"use strict";var Oc=L(),Hs=ge(),qc={identify:a(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Hs.stringifyNumber},Tc={identify:a(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a(s=>parseFloat(s.replace(/_/g,"")),"resolve"),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Hs.stringifyNumber(s)}},Lc={identify:a(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){let e=new Oc.Scalar(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){let n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Hs.stringifyNumber};$t.float=Lc;$t.floatExp=Tc;$t.floatNaN=qc});var wr=y(Be=>{"use strict";var Sr=ge(),Re=a(s=>typeof s=="bigint"||Number.isInteger(s),"intIdentify");function _t(s,e,t,{intAsBigInt:n}){let i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}let o=BigInt(s);return i==="-"?BigInt(-1)*o:o}let r=parseInt(s,t);return i==="-"?-1*r:r}a(_t,"intResolve");function Qs(s,e,t){let{value:n}=s;if(Re(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return Sr.stringifyNumber(s)}a(Qs,"intStringify");var Cc={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((s,e,t)=>_t(s,2,2,t),"resolve"),stringify:a(s=>Qs(s,2,"0b"),"stringify")},Mc={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((s,e,t)=>_t(s,1,8,t),"resolve"),stringify:a(s=>Qs(s,8,"0"),"stringify")},Pc={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((s,e,t)=>_t(s,0,10,t),"resolve"),stringify:Sr.stringifyNumber},Ic={identify:Re,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((s,e,t)=>_t(s,2,16,t),"resolve"),stringify:a(s=>Qs(s,16,"0x"),"stringify")};Be.int=Pc;Be.intBin=Cc;Be.intHex=Ic;Be.intOct=Mc});var zs=y(Xs=>{"use strict";var Rt=O(),Dt=G(),jt=Q(),ie=class s extends jt.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=s.tag}add(e){let t;Rt.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Dt.Pair(e.key,null):t=new Dt.Pair(e,null),jt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=jt.findPair(this.items,e);return!t&&Rt.isPair(n)?Rt.isScalar(n.key)?n.key.value:n.key:n}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 n=jt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Dt.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,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(Dt.createPair(o,null,n));return r}};ie.tag="tag:yaml.org,2002:set";var $c={collection:"map",identify:a(s=>s instanceof Set,"identify"),nodeClass:ie,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((s,e,t)=>ie.from(s,e,t),"createNode"),resolve(s,e){if(Rt.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new ie,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};Xs.YAMLSet=ie;Xs.set=$c});var en=y(Bt=>{"use strict";var _c=ge();function Zs(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=a(o=>e?BigInt(o):Number(o),"num"),r=n.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return t==="-"?i(-1)*r:r}a(Zs,"parseSexagesimal");function vr(s){let{value:e}=s,t=a(o=>o,"num");if(typeof e=="bigint")t=a(o=>BigInt(o),"num");else if(isNaN(e)||!isFinite(e))return _c.stringifyNumber(s);let n="";e<0&&(n="-",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))),n+r.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}a(vr,"stringifySexagesimal");var Dc={identify:a(s=>typeof s=="bigint"||Number.isInteger(s),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:a((s,e,{intAsBigInt:t})=>Zs(s,t),"resolve"),stringify:vr},jc={identify:a(s=>typeof s=="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(s=>Zs(s,!1),"resolve"),stringify:vr},kr={identify:a(s=>s 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(s){let e=s.match(kr.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,r,o,l]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(t,n-1,i,r||0,o||0,l||0,c),m=e[8];if(m&&m!=="Z"){let f=Zs(m,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:a(({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};Bt.floatTime=jc;Bt.intTime=Dc;Bt.timestamp=kr});var Er=y(Ar=>{"use strict";var Rc=me(),Bc=Ot(),Fc=pe(),Kc=_e(),Uc=Ys(),Nr=yr(),tn=br(),Ft=wr(),Yc=bt(),xc=Ws(),Jc=It(),Vc=zs(),sn=en(),Wc=[Rc.map,Fc.seq,Kc.string,Bc.nullTag,Nr.trueTag,Nr.falseTag,Ft.intBin,Ft.intOct,Ft.int,Ft.intHex,tn.floatNaN,tn.floatExp,tn.float,Uc.binary,Yc.merge,xc.omap,Jc.pairs,Vc.set,sn.intTime,sn.floatTime,sn.timestamp];Ar.schema=Wc});var _r=y(on=>{"use strict";var Lr=me(),Gc=Ot(),Cr=pe(),Hc=_e(),Qc=_s(),nn=js(),rn=Bs(),Xc=ir(),zc=ar(),Mr=Ys(),Fe=bt(),Pr=Ws(),Ir=It(),Or=Er(),$r=zs(),Kt=en(),qr=new Map([["core",Xc.schema],["failsafe",[Lr.map,Cr.seq,Hc.string]],["json",zc.schema],["yaml11",Or.schema],["yaml-1.1",Or.schema]]),Tr={binary:Mr.binary,bool:Qc.boolTag,float:nn.float,floatExp:nn.floatExp,floatNaN:nn.floatNaN,floatTime:Kt.floatTime,int:rn.int,intHex:rn.intHex,intOct:rn.intOct,intTime:Kt.intTime,map:Lr.map,merge:Fe.merge,null:Gc.nullTag,omap:Pr.omap,pairs:Ir.pairs,seq:Cr.seq,set:$r.set,timestamp:Kt.timestamp},Zc={"tag:yaml.org,2002:binary":Mr.binary,"tag:yaml.org,2002:merge":Fe.merge,"tag:yaml.org,2002:omap":Pr.omap,"tag:yaml.org,2002:pairs":Ir.pairs,"tag:yaml.org,2002:set":$r.set,"tag:yaml.org,2002:timestamp":Kt.timestamp};function eu(s,e,t){let n=qr.get(e);if(n&&!s)return t&&!n.includes(Fe.merge)?n.concat(Fe.merge):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{let r=Array.from(qr.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(s))for(let r of s)i=i.concat(r);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(Fe.merge)),i.reduce((r,o)=>{let l=typeof o=="string"?Tr[o]:o;if(!l){let c=JSON.stringify(o),u=Object.keys(Tr).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return r.includes(l)||r.push(l),r},[])}a(eu,"getTags");on.coreKnownTags=Zc;on.getTags=eu});var cn=y(Dr=>{"use strict";var an=O(),tu=me(),su=pe(),nu=_e(),Ut=_r(),iu=a((s,e)=>s.key<e.key?-1:s.key>e.key?1:0,"sortMapEntriesByKey"),ln=class s{static{a(this,"Schema")}constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:r,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Ut.getTags(e,"compat"):e?Ut.getTags(null,e):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?Ut.coreKnownTags:{},this.tags=Ut.getTags(t,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,an.MAP,{value:tu.map}),Object.defineProperty(this,an.SCALAR,{value:nu.string}),Object.defineProperty(this,an.SEQ,{value:su.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?iu:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Dr.Schema=ln});var Rr=y(jr=>{"use strict";var ru=O(),un=Pe(),Ke=Te();function ou(s,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&s.directives){let c=s.directives.toString(s);c?(t.push(c),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");let i=un.createStringifyContext(s,e),{commentString:r}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");let c=r(s.commentBefore);t.unshift(Ke.indentComment(c,""))}let o=!1,l=null;if(s.contents){if(ru.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let m=r(s.contents.commentBefore);t.push(Ke.indentComment(m,""))}i.forceBlockIndent=!!s.comment,l=s.contents.comment}let c=l?void 0:()=>o=!0,u=un.stringify(s.contents,i,()=>l=null,c);l&&(u+=Ke.lineComment(u,"",r(l))),(u[0]==="|"||u[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${u}`:t.push(u)}else t.push(un.stringify(s.contents,i));if(s.directives?.docEnd)if(s.comment){let c=r(s.comment);c.includes(`
|
|
57
|
+
`)?(t.push("..."),t.push(Ke.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=s.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||l)&&t[t.length-1]!==""&&t.push(""),t.push(Ke.indentComment(r(c),"")))}return t.join(`
|
|
58
|
+
`)+`
|
|
59
|
+
`}a(ou,"stringifyDocument");jr.stringifyDocument=ou});var Ue=y(Br=>{"use strict";var au=Oe(),ye=lt(),D=O(),lu=G(),cu=x(),uu=cn(),fu=Rr(),fn=it(),du=ms(),hu=qe(),dn=hs(),hn=class s{static{a(this,"Document")}constructor(e,t,n){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:n===void 0&&t&&(n=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"},n);this.options=r;let{version:o}=r;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new dn.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(s.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){be(this.contents)&&this.contents.add(e)}addIn(e,t){be(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=fn.anchorNames(this);e.anchor=!t||n.has(t)?fn.findNewAnchor(t||"a",n):t}return new au.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){let p=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),w=t.filter(p).map(String);w.length>0&&(t=t.concat(w)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:r,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:m}=n??{},{onAnchor:f,setAnchors:d,sourceObjects:g}=fn.createNodeAnchors(this,o||"a"),b={aliasDuplicateObjects:r??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:g},h=hu.createNode(e,m,b);return l&&D.isCollection(h)&&(h.flow=!0),d(),h}createPair(e,t,n={}){let i=this.createNode(e,null,n),r=this.createNode(t,null,n);return new lu.Pair(i,r)}delete(e){return be(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ye.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):be(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 ye.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 ye.isEmptyPath(e)?this.contents!==void 0:D.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=ye.collectionFromPath(this.schema,[e],t):be(this.contents)&&this.contents.set(e,t)}setIn(e,t){ye.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=ye.collectionFromPath(this.schema,Array.from(e),t):be(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new dn.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new dn.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=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(n)this.schema=new uu.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=cu.toJS(this.contents,t??"",l);if(typeof r=="function")for(let{count:u,res:m}of l.anchors.values())r(m,u);return typeof o=="function"?du.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 fu.stringifyDocument(this,e)}};function be(s){if(D.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}a(be,"assertCollection");Br.Document=hn});var Je=y(xe=>{"use strict";var Ye=class extends Error{static{a(this,"YAMLError")}constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}},mn=class extends Ye{static{a(this,"YAMLParseError")}constructor(e,t,n){super("YAMLParseError",e,t,n)}},pn=class extends Ye{static{a(this,"YAMLWarning")}constructor(e,t,n){super("YAMLWarning",e,t,n)}},mu=a((s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));let{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let r=i-1,o=s.substring(e.lineStarts[n-1],e.lineStarts[n]).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"),n>1&&/^ *$/.test(o.substring(0,r))){let l=s.substring(e.lineStarts[n-2],e.lineStarts[n-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===n&&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");xe.YAMLError=Ye;xe.YAMLParseError=mn;xe.YAMLWarning=pn;xe.prettifyError=mu});var Ve=y(Fr=>{"use strict";function pu(s,{flow:e,indicator:t,next:n,offset:i,onError:r,parentIndent:o,startOnNewline:l}){let c=!1,u=l,m=l,f="",d="",g=!1,b=!1,h=null,p=null,w=null,v=null,k=null,N=null,A=null;for(let S of s)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"||n?.type!=="flow-collection")&&S.source.includes(" ")&&(h=S),m=!0;break;case"comment":{m||r(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let C=S.source.substring(1)||" ";f?f+=d+C:f=C,d="",u=!1;break}case"newline":u?f?f+=S.source:(!N||t!=="seq-item-ind")&&(c=!0):d+=S.source,u=!0,g=!0,(p||w)&&(v=S),m=!0;break;case"anchor":p&&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),p=S,A??(A=S.offset),u=!1,m=!1,b=!0;break;case"tag":{w&&r(S,"MULTIPLE_TAGS","A node can have at most one tag"),w=S,A??(A=S.offset),u=!1,m=!1,b=!0;break}case t:(p||w)&&r(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),N&&r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${e??"collection"}`),N=S,u=t==="seq-item-ind"||t==="explicit-key-ind",m=!1;break;case"comma":if(e){k&&r(S,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=S,u=!1,m=!1;break}default:r(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),u=!1,m=!1}let E=s[s.length-1],T=E?E.offset+E.source.length:i;return b&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&r(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h&&(u&&h.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&r(h,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:N,spaceBefore:c,comment:f,hasNewline:g,anchor:p,tag:w,newlineAfterProp:v,end:T,start:A??T}}a(pu,"resolveProps");Fr.resolveProps=pu});var Yt=y(Kr=>{"use strict";function gn(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
|
|
65
|
+
`))return!0;if(s.end){for(let e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of s.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(gn(e.key)||gn(e.value))return!0}return!1;default:return!0}}a(gn,"containsNewline");Kr.containsNewline=gn});var yn=y(Ur=>{"use strict";var gu=Yt();function yu(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&gu.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(yu,"flowIndentCheck");Ur.flowIndentCheck=yu});var bn=y(xr=>{"use strict";var Yr=O();function bu(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let i=typeof n=="function"?n:(r,o)=>r===o||Yr.isScalar(r)&&Yr.isScalar(o)&&r.value===o.value;return e.some(r=>i(r.key,t))}a(bu,"mapIncludes");xr.mapIncludes=bu});var Qr=y(Hr=>{"use strict";var Jr=G(),Su=Q(),Vr=Ve(),wu=Yt(),Wr=yn(),vu=bn(),Gr="All mapping items must start at the same column";function ku({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Su.YAMLMap,l=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=n.offset,u=null;for(let m of n.items){let{start:f,key:d,sep:g,value:b}=m,h=Vr.resolveProps(f,{indicator:"explicit-key-ind",next:d??g?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),p=!h.found;if(p){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!==n.indent&&i(c,"BAD_INDENT",Gr)),!h.anchor&&!h.tag&&!g){u=h.end,h.comment&&(l.comment?l.comment+=`
|
|
66
|
+
`+h.comment:l.comment=h.comment);continue}(h.newlineAfterProp||wu.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else h.found?.indent!==n.indent&&i(c,"BAD_INDENT",Gr);t.atKey=!0;let w=h.end,v=d?s(t,d,h,i):e(t,w,f,null,h,i);t.schema.compat&&Wr.flowIndentCheck(n.indent,d,i),t.atKey=!1,vu.mapIncludes(t,l.items,v)&&i(w,"DUPLICATE_KEY","Map keys must be unique");let k=Vr.resolveProps(g??[],{indicator:"map-value-ind",next:b,offset:v.range[2],onError:i,parentIndent:n.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=k.end,k.found){p&&(b?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&h.start<k.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 N=b?s(t,b,k,i):e(t,c,g,null,k,i);t.schema.compat&&Wr.flowIndentCheck(n.indent,b,i),c=N.range[2];let A=new Jr.Pair(v,N);t.options.keepSourceTokens&&(A.srcToken=m),l.items.push(A)}else{p&&i(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(v.comment?v.comment+=`
|
|
67
|
+
`+k.comment:v.comment=k.comment);let N=new Jr.Pair(v);t.options.keepSourceTokens&&(N.srcToken=m),l.items.push(N)}}return u&&u<c&&i(u,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,c,u??c],l}a(ku,"resolveBlockMap");Hr.resolveBlockMap=ku});var zr=y(Xr=>{"use strict";var Nu=X(),Au=Ve(),Eu=yn();function Ou({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=r?.nodeClass??Nu.YAMLSeq,l=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=n.offset,u=null;for(let{start:m,value:f}of n.items){let d=Au.resolveProps(m,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:n.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?s(t,f,d,i):e(t,d.end,m,null,d,i);t.schema.compat&&Eu.flowIndentCheck(n.indent,f,i),c=g.range[2],l.items.push(g)}return l.range=[n.offset,c,u??c],l}a(Ou,"resolveBlockSeq");Xr.resolveBlockSeq=Ou});var Se=y(Zr=>{"use strict";function qu(s,e,t,n){let i="";if(s){let r=!1,o="";for(let l of s){let{source:c,type:u}=l;switch(u){case"space":r=!0;break;case"comment":{t&&!r&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let m=c.substring(1)||" ";i?i+=o+m:i=m,o="";break}case"newline":i&&(o+=c),r=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=c.length}}return{comment:i,offset:e}}a(qu,"resolveEnd");Zr.resolveEnd=qu});var no=y(so=>{"use strict";var Tu=O(),Lu=G(),eo=Q(),Cu=X(),Mu=Se(),to=Ve(),Pu=Yt(),Iu=bn(),Sn="Block collections are not allowed within flow collections",wn=a(s=>s&&(s.type==="block-map"||s.type==="block-seq"),"isBlock");function $u({composeNode:s,composeEmptyNode:e},t,n,i,r){let o=n.start.source==="{",l=o?"flow map":"flow sequence",c=r?.nodeClass??(o?eo.YAMLMap:Cu.YAMLSeq),u=new c(t.schema);u.flow=!0;let m=t.atRoot;m&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset+n.start.source.length;for(let p=0;p<n.items.length;++p){let w=n.items[p],{start:v,key:k,sep:N,value:A}=w,E=to.resolveProps(v,{flow:l,indicator:"explicit-key-ind",next:k??N?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!N&&!A){p===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):p<n.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),E.comment&&(u.comment?u.comment+=`
|
|
68
|
+
`+E.comment:u.comment=E.comment),f=E.end;continue}!o&&t.options.strict&&Pu.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(p===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${l} items`),E.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];Tu.isPair(S)&&(S=S.value??S.key),S.comment?S.comment+=`
|
|
69
|
+
`+T:S.comment=T,E.comment=E.comment.substring(T.length+1)}}if(!o&&!N&&!E.found){let T=A?s(t,A,E,i):e(t,E.end,N,null,E,i);u.items.push(T),f=T.range[2],wn(A)&&i(T.range,"BLOCK_IN_FLOW",Sn)}else{t.atKey=!0;let T=E.end,S=k?s(t,k,E,i):e(t,T,v,null,E,i);wn(k)&&i(S.range,"BLOCK_IN_FLOW",Sn),t.atKey=!1;let C=to.resolveProps(N??[],{flow:l,indicator:"map-value-ind",next:A,offset:S.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(C.found){if(!o&&!E.found&&t.options.strict){if(N)for(let M of N){if(M===C.found)break;if(M.type==="newline"){i(M,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<C.found.offset-1024&&i(C.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else A&&("source"in A&&A.source?.[0]===":"?i(A,"MISSING_CHAR",`Missing space after : in ${l}`):i(C.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let Y=A?s(t,A,C,i):C.found?e(t,C.end,N,null,C,i):null;Y?wn(A)&&i(Y.range,"BLOCK_IN_FLOW",Sn):C.comment&&(S.comment?S.comment+=`
|
|
70
|
+
`+C.comment:S.comment=C.comment);let ce=new Lu.Pair(S,Y);if(t.options.keepSourceTokens&&(ce.srcToken=w),o){let M=u;Iu.mapIncludes(t,M.items,S)&&i(T,"DUPLICATE_KEY","Map keys must be unique"),M.items.push(ce)}else{let M=new eo.YAMLMap(t.schema);M.flow=!0,M.items.push(ce);let Qn=(Y??S).range;M.range=[S.range[0],Qn[1],Qn[2]],u.items.push(M)}f=Y?Y.range[2]:C.end}}let d=o?"}":"]",[g,...b]=n.end,h=f;if(g?.source===d)h=g.offset+g.source.length;else{let p=l[0].toUpperCase()+l.substring(1),w=m?`${p} must end with a ${d}`:`${p} in block collection must be sufficiently indented and end with a ${d}`;i(f,m?"MISSING_CHAR":"BAD_INDENT",w),g&&g.source.length!==1&&b.unshift(g)}if(b.length>0){let p=Mu.resolveEnd(b,h,t.options.strict,i);p.comment&&(u.comment?u.comment+=`
|
|
71
|
+
`+p.comment:u.comment=p.comment),u.range=[n.offset,h,p.offset]}else u.range=[n.offset,h,h];return u}a($u,"resolveFlowCollection");so.resolveFlowCollection=$u});var ro=y(io=>{"use strict";var _u=O(),Du=L(),ju=Q(),Ru=X(),Bu=Qr(),Fu=zr(),Ku=no();function vn(s,e,t,n,i,r){let o=t.type==="block-map"?Bu.resolveBlockMap(s,e,t,n,r):t.type==="block-seq"?Fu.resolveBlockSeq(s,e,t,n,r):Ku.resolveFlowCollection(s,e,t,n,r),l=o.constructor;return i==="!"||i===l.tagName?(o.tag=l.tagName,o):(i&&(o.tag=i),o)}a(vn,"resolveCollection");function Uu(s,e,t,n,i){let r=n.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}=n,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===ju.YAMLMap.tagName&&l==="map"||o===Ru.YAMLSeq.tagName&&l==="seq")return vn(s,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),vn(s,e,t,i,o)}let u=vn(s,e,t,i,o,c),m=c.resolve?.(u,d=>i(r,"TAG_RESOLVE_FAILED",d),e.options)??u,f=_u.isNode(m)?m:new Du.Scalar(m);return f.range=u.range,f.tag=o,c?.format&&(f.format=c.format),f}a(Uu,"composeCollection");io.composeCollection=Uu});var Nn=y(oo=>{"use strict";var kn=L();function Yu(s,e,t){let n=e.offset,i=xu(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let r=i.mode===">"?kn.Scalar.BLOCK_FOLDED:kn.Scalar.BLOCK_LITERAL,o=e.source?Ju(e.source):[],l=o.length;for(let h=o.length-1;h>=0;--h){let p=o[h][1];if(p===""||p==="\r")l=h;else break}if(l===0){let h=i.chomp==="+"&&o.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,o.length-1)):"",p=n+i.length;return e.source&&(p+=e.source.length),{value:h,type:r,comment:i.comment,range:[n,p,p]}}let c=e.indent+i.indent,u=e.offset+i.length,m=0;for(let h=0;h<l;++h){let[p,w]=o[h];if(w===""||w==="\r")i.indent===0&&p.length>c&&(c=p.length);else{p.length<c&&t(u+p.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=p.length),m=h,c===0&&!s.atRoot&&t(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=p.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<m;++h)f+=o[h][0].slice(c)+`
|
|
73
|
+
`;for(let h=m;h<l;++h){let[p,w]=o[h];u+=p.length+w.length+1;let v=w[w.length-1]==="\r";if(v&&(w=w.slice(0,-1)),w&&p.length<c){let N=`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",N),p=""}r===kn.Scalar.BLOCK_LITERAL?(f+=d+p.slice(c)+w,d=`
|
|
74
|
+
`):p.length>c||w[0]===" "?(d===" "?d=`
|
|
75
|
+
`:!g&&d===`
|
|
76
|
+
`&&(d=`
|
|
77
|
+
|
|
78
|
+
`),f+=d+p.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=n+i.length+e.source.length;return{value:f,type:r,comment:i.comment,range:[n,b,b]}}a(Yu,"resolveBlockScalar");function xu({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(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=s+d)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let u=!1,m="",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&&n(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=g.source.length,m=g.source.substring(1);break;case"error":n(g,"UNEXPECTED_TOKEN",g.message),f+=g.source.length;break;default:{let b=`Unexpected token in block scalar header: ${g.type}`;n(g,"UNEXPECTED_TOKEN",b);let h=g.source;h&&typeof h=="string"&&(f+=h.length)}}}return{mode:r,indent:o,chomp:l,comment:m,length:f}}a(xu,"parseBlockScalarHeader");function Ju(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),r=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)r.push([e[o],e[o+1]]);return r}a(Ju,"splitLines");oo.resolveBlockScalar=Yu});var En=y(lo=>{"use strict";var An=L(),Vu=Se();function Wu(s,e,t){let{offset:n,type:i,source:r,end:o}=s,l,c,u=a((d,g,b)=>t(n+d,g,b),"_onError");switch(i){case"scalar":l=An.Scalar.PLAIN,c=Gu(r,u);break;case"single-quoted-scalar":l=An.Scalar.QUOTE_SINGLE,c=Hu(r,u);break;case"double-quoted-scalar":l=An.Scalar.QUOTE_DOUBLE,c=Qu(r,u);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+r.length,n+r.length]}}let m=n+r.length,f=Vu.resolveEnd(o,m,e,t);return{value:c,type:l,comment:f.comment,range:[n,m,f.offset]}}a(Wu,"resolveFlowScalar");function Gu(s,e){let t="";switch(s[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 ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),ao(s)}a(Gu,"plainValue");function Hu(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),ao(s.slice(1,-1)).replace(/''/g,"'")}a(Hu,"singleQuotedValue");function ao(s){let e=/(.*?)\r?\n/sy,t=e.exec(s);if(!t)return s;let n,i;try{n=new RegExp("(?<![ ])[ ]+$"),i=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{n=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let r=t[1].replace(n,""),o=" ",l=e.lastIndex;for(;t=e.exec(s);){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(s),r+o+(t?.[1]??"")}a(ao,"unfoldLines");function Qu(s,e){let t="";for(let n=1;n<s.length-1;++n){let i=s[n];if(!(i==="\r"&&s[n+1]===`
|
|
89
|
+
`))if(i===`
|
|
90
|
+
`){let{fold:r,offset:o}=Xu(s,n);t+=r,n=o}else if(i==="\\"){let r=s[++n],o=zu[r];if(o)t+=o;else if(r===`
|
|
91
|
+
`)for(r=s[n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="\r"&&s[n+1]===`
|
|
92
|
+
`)for(r=s[++n+1];r===" "||r===" ";)r=s[++n+1];else if(r==="x"||r==="u"||r==="U"){let l=r==="x"?2:r==="u"?4:8;t+=Zu(s,n+1,l,e),n+=l}else{let l=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),t+=l}}else if(i===" "||i===" "){let r=n,o=s[n+1];for(;o===" "||o===" ";)o=s[++n+1];o!==`
|
|
93
|
+
`&&!(o==="\r"&&s[n+2]===`
|
|
94
|
+
`)&&(t+=n>r?s.slice(r,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}a(Qu,"doubleQuotedValue");function Xu(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
|
|
95
|
+
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
|
|
96
|
+
`);)n===`
|
|
97
|
+
`&&(t+=`
|
|
98
|
+
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}a(Xu,"foldNewline");var zu={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 Zu(s,e,t,n){let i=s.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=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}a(Zu,"parseCharCode");lo.resolveFlowScalar=Wu});var fo=y(uo=>{"use strict";var re=O(),co=L(),ef=Nn(),tf=En();function sf(s,e,t,n){let{value:i,type:r,comment:o,range:l}=e.type==="block-scalar"?ef.resolveBlockScalar(s,e,n):tf.resolveFlowScalar(e,s.options.strict,n),c=t?s.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,u;s.options.stringKeys&&s.atKey?u=s.schema[re.SCALAR]:c?u=nf(s.schema,i,c,t,n):e.type==="scalar"?u=rf(s,i,e,n):u=s.schema[re.SCALAR];let m;try{let f=u.resolve(i,d=>n(t??e,"TAG_RESOLVE_FAILED",d),s.options);m=re.isScalar(f)?f:new co.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",d),m=new co.Scalar(i)}return m.range=l,m.source=i,r&&(m.type=r),c&&(m.tag=c),u.format&&(m.format=u.format),o&&(m.comment=o),m}a(sf,"composeScalar");function nf(s,e,t,n,i){if(t==="!")return s[re.SCALAR];let r=[];for(let l of s.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=s.knownTags[t];return o&&!o.collection?(s.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[re.SCALAR])}a(nf,"findScalarTagByName");function rf({atKey:s,directives:e,schema:t},n,i,r){let o=t.tags.find(l=>(l.default===!0||s&&l.default==="key")&&l.test?.test(n))||t[re.SCALAR];if(t.compat){let l=t.compat.find(c=>c.default&&c.test?.test(n))??t[re.SCALAR];if(o.tag!==l.tag){let c=e.tagString(o.tag),u=e.tagString(l.tag),m=`Value may be parsed as either ${c} or ${u}`;r(i,"TAG_RESOLVE_FAILED",m,!0)}}return o}a(rf,"findScalarTagByTest");uo.composeScalar=sf});var mo=y(ho=>{"use strict";function of(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];i?.type==="space";)s+=i.source.length,i=e[++n];break}}return s}a(of,"emptyScalarPosition");ho.emptyScalarPosition=of});var yo=y(qn=>{"use strict";var af=Oe(),lf=O(),cf=ro(),po=fo(),uf=Se(),ff=mo(),df={composeNode:go,composeEmptyNode:On};function go(s,e,t,n){let i=s.atKey,{spaceBefore:r,comment:o,anchor:l,tag:c}=t,u,m=!0;switch(e.type){case"alias":u=hf(s,e,n),(l||c)&&n(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=po.composeScalar(s,e,c,n),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=cf.composeCollection(df,s,e,t,n),l&&(u.anchor=l.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),m=!1}}return u??(u=On(s,e.offset,void 0,null,t,n)),l&&u.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!lf.isScalar(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&n(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),s.options.keepSourceTokens&&m&&(u.srcToken=e),u}a(go,"composeNode");function On(s,e,t,n,{spaceBefore:i,comment:r,anchor:o,tag:l,end:c},u){let m={type:"scalar",offset:ff.emptyScalarPosition(e,t,n),indent:-1,source:""},f=po.composeScalar(s,m,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(On,"composeEmptyNode");function hf({options:s},{offset:e,source:t,end:n},i){let r=new af.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=uf.resolveEnd(n,o,s.strict,i);return r.range=[e,o,l.offset],l.comment&&(r.comment=l.comment),r}a(hf,"composeAlias");qn.composeEmptyNode=On;qn.composeNode=go});var wo=y(So=>{"use strict";var mf=Ue(),bo=yo(),pf=Se(),gf=Ve();function yf(s,e,{offset:t,start:n,value:i,end:r},o){let l=Object.assign({_directives:e},s),c=new mf.Document(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},m=gf.resolveProps(n,{indicator:"doc-start",next:i??r?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});m.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!m.hasNewline&&o(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?bo.composeNode(u,i,m,o):bo.composeEmptyNode(u,m.end,n,null,m,o);let f=c.contents.range[2],d=pf.resolveEnd(r,f,!1,o);return d.comment&&(c.comment=d.comment),c.range=[t,f,d.offset],c}a(yf,"composeDoc");So.composeDoc=yf});var Ln=y(No=>{"use strict";var bf=ze("process"),Sf=hs(),wf=Ue(),We=Je(),vo=O(),vf=wo(),kf=Se();function Ge(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];let{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}a(Ge,"getErrorPos");function ko(s){let e="",t=!1,n=!1;for(let i=0;i<s.length;++i){let r=s[i];switch(r[0]){case"#":e+=(e===""?"":n?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":s[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}a(ko,"parsePrelude");var Tn=class{static{a(this,"Composer")}constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,r)=>{let o=Ge(t);r?this.warnings.push(new We.YAMLWarning(o,n,i)):this.errors.push(new We.YAMLParseError(o,n,i))},this.directives=new Sf.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:i}=ko(this.prelude);if(n){let r=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${n}`:n;else if(i||e.directives.docStart||!r)e.commentBefore=n;else if(vo.isCollection(r)&&!r.flow&&r.items.length>0){let o=r.items[0];vo.isPair(o)&&(o=o.key);let l=o.commentBefore;o.commentBefore=l?`${n}
|
|
104
|
+
${l}`:n}else{let o=r.commentBefore;r.commentBefore=o?`${n}
|
|
105
|
+
${o}`:n}}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:ko(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(bf.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{let r=Ge(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=vf.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,n=new We.YAMLParseError(Ge(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new We.YAMLParseError(Ge(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=kf.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
106
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new We.YAMLParseError(Ge(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 n=Object.assign({_directives:this.directives},this.options),i=new wf.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}};No.Composer=Tn});var Oo=y(xt=>{"use strict";var Nf=Nn(),Af=En(),Ef=Je(),Ao=Me();function Of(s,e=!0,t){if(s){let n=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 Ef.YAMLParseError([l,l+1],r,o)},"_onError");switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Af.resolveFlowScalar(s,e,n);case"block-scalar":return Nf.resolveBlockScalar({options:{strict:e}},s,n)}}return null}a(Of,"resolveAsScalar");function qf(s,e){let{implicitKey:t=!1,indent:n,inFlow:i=!1,offset:r=-1,type:o="PLAIN"}=e,l=Ao.stringifyString({type:o,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
107
|
+
`}];switch(l[0]){case"|":case">":{let u=l.indexOf(`
|
|
108
|
+
`),m=l.substring(0,u),f=l.substring(u+1)+`
|
|
109
|
+
`,d=[{type:"block-scalar-header",offset:r,indent:n,source:m}];return Eo(d,c)||d.push({type:"newline",offset:-1,indent:n,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:r,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:r,indent:n,source:l,end:c};case"'":return{type:"single-quoted-scalar",offset:r,indent:n,source:l,end:c};default:return{type:"scalar",offset:r,indent:n,source:l,end:c}}}a(qf,"createScalarToken");function Tf(s,e,t={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:r=!1,type:o}=t,l="indent"in s?s.indent:null;if(n&&typeof l=="number"&&(l+=2),!o)switch(s.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let u=s.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=Ao.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">":Lf(s,c);break;case'"':Cn(s,c,"double-quoted-scalar");break;case"'":Cn(s,c,"single-quoted-scalar");break;default:Cn(s,c,"scalar")}}a(Tf,"setScalarValue");function Lf(s,e){let t=e.indexOf(`
|
|
111
|
+
`),n=e.substring(0,t),i=e.substring(t+1)+`
|
|
112
|
+
`;if(s.type==="block-scalar"){let r=s.props[0];if(r.type!=="block-scalar-header")throw new Error("Invalid block scalar header");r.source=n,s.source=i}else{let{offset:r}=s,o="indent"in s?s.indent:-1,l=[{type:"block-scalar-header",offset:r,indent:o,source:n}];Eo(l,"end"in s?s.end:void 0)||l.push({type:"newline",offset:-1,indent:o,source:`
|
|
113
|
+
`});for(let c of Object.keys(s))c!=="type"&&c!=="offset"&&delete s[c];Object.assign(s,{type:"block-scalar",indent:o,props:l,source:i})}}a(Lf,"setBlockScalarValue");function Eo(s,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":s.push(t);break;case"newline":return s.push(t),!0}return!1}a(Eo,"addEndtoBlockProps");function Cn(s,e,t){switch(s.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":s.type=t,s.source=e;break;case"block-scalar":{let n=s.props.slice(1),i=e.length;s.props[0].type==="block-scalar-header"&&(i-=s.props[0].source.length);for(let r of n)r.offset+=i;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
|
|
114
|
+
`};delete s.items,Object.assign(s,{type:t,source:e,end:[i]});break}default:{let n="indent"in s?s.indent:-1,i="end"in s&&Array.isArray(s.end)?s.end.filter(r=>r.type==="space"||r.type==="comment"||r.type==="newline"):[];for(let r of Object.keys(s))r!=="type"&&r!=="offset"&&delete s[r];Object.assign(s,{type:t,indent:n,source:e,end:i})}}}a(Cn,"setFlowScalarValue");xt.createScalarToken=qf;xt.resolveAsScalar=Of;xt.setScalarValue=Tf});var To=y(qo=>{"use strict";var Cf=a(s=>"type"in s?Vt(s):Jt(s),"stringify");function Vt(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=Vt(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=Jt(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=Jt(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=Jt(s);if(s.end)for(let t of s.end)e+=t.source;return e}default:{let e=s.source;if("end"in s&&s.end)for(let t of s.end)e+=t.source;return e}}}a(Vt,"stringifyToken");function Jt({start:s,key:e,sep:t,value:n}){let i="";for(let r of s)i+=r.source;if(e&&(i+=Vt(e)),t)for(let r of t)i+=r.source;return n&&(i+=Vt(n)),i}a(Jt,"stringifyItem");qo.stringify=Cf});var Po=y(Mo=>{"use strict";var Mn=Symbol("break visit"),Mf=Symbol("skip children"),Lo=Symbol("remove item");function oe(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),Co(Object.freeze([]),s,e)}a(oe,"visit");oe.BREAK=Mn;oe.SKIP=Mf;oe.REMOVE=Lo;oe.itemAtPath=(s,e)=>{let t=s;for(let[n,i]of e){let r=t?.[n];if(r&&"items"in r)t=r.items[i];else return}return t};oe.parentCollection=(s,e)=>{let t=oe.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],i=t?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Co(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;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=Co(Object.freeze(s.concat([[i,o]])),r.items[o],t);if(typeof l=="number")o=l-1;else{if(l===Mn)return Mn;l===Lo&&(r.items.splice(o,1),o-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}a(Co,"_visit");Mo.visit=oe});var Wt=y(_=>{"use strict";var Pn=Oo(),Pf=To(),If=Po(),In="\uFEFF",$n="",_n="",Dn="",$f=a(s=>!!s&&"items"in s,"isCollection"),_f=a(s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar"),"isScalar");function Df(s){switch(s){case In:return"<BOM>";case $n:return"<DOC>";case _n:return"<FLOW_END>";case Dn:return"<SCALAR>";default:return JSON.stringify(s)}}a(Df,"prettyToken");function jf(s){switch(s){case In:return"byte-order-mark";case $n:return"doc-mode";case _n:return"flow-error-end";case Dn: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(s[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(jf,"tokenType");_.createScalarToken=Pn.createScalarToken;_.resolveAsScalar=Pn.resolveAsScalar;_.setScalarValue=Pn.setScalarValue;_.stringify=Pf.stringify;_.visit=If.visit;_.BOM=In;_.DOCUMENT=$n;_.FLOW_END=_n;_.SCALAR=Dn;_.isCollection=$f;_.isScalar=_f;_.prettyToken=Df;_.tokenType=jf});var Bn=y($o=>{"use strict";var He=Wt();function R(s){switch(s){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}a(R,"isEmpty");var Io=new Set("0123456789ABCDEFabcdef"),Rf=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Gt=new Set(",[]{}"),Bf=new Set(` ,[]{}
|
|
118
|
+
\r `),jn=a(s=>!s||Bf.has(s),"isNotAnchorChar"),Rn=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 n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=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 n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
121
|
+
`||!i&&!this.atEnd)return e+n+1}return t===`
|
|
122
|
+
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&R(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]===He.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let r=e[n-1];if(r===" "||r===" "){t=n-1;break}else n=e.indexOf("#",n+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 He.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==="...")&&R(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&&!R(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===":")&&R(t)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"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(jn),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&R(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield He.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(jn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||R(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 n=this.buffer.substring(0,t),i=n.indexOf(`
|
|
124
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){let r=this.continueScalar(i+1);if(r===-1)break;i=n.indexOf(`
|
|
125
|
+
`,r)}i!==-1&&(t=i-(n[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=>R(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let r=this.pos;n=this.buffer[r];++r)switch(n){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(!n&&!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(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
129
|
+
`;)n=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 He.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let r=this.buffer[n+1];if(R(r)||e&&Gt.has(r))break;t=n}else if(R(i)){let r=this.buffer[n+1];if(i==="\r"&&(r===`
|
|
131
|
+
`?(n+=1,i=`
|
|
132
|
+
`,r=this.buffer[n+1]):t=n),r==="#"||e&&Gt.has(r))break;if(i===`
|
|
133
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&Gt.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield He.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 n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.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(jn),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(R(n)||t&&Gt.has(n)){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(;!R(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(Rf.has(t))t=this.buffer[++e];else if(t==="%"&&Io.has(this.buffer[e+1])&&Io.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,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");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,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};$o.Lexer=Rn});var Kn=y(_o=>{"use strict";var Fn=class{static{a(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=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}}}};_o.LineCounter=Fn});var Yn=y(Fo=>{"use strict";var Ff=ze("process"),Do=Wt(),Kf=Bn();function z(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}a(z,"includesToken");function jo(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}a(jo,"findNonEmptyIndex");function Bo(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}a(Bo,"isFlowToken");function Ht(s){switch(s.type){case"document":return s.start;case"block-map":{let e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}a(Ht,"getPrevProps");function we(s){if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;s[++e]?.type==="space";);return s.splice(e,s.length)}a(we,"getFirstKeyStartProps");function Qt(s,e){if(e.length<1e5)Array.prototype.push.apply(s,e);else for(let t=0;t<e.length;++t)s.push(e[t])}a(Qt,"arrayPushArray");function Ro(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!z(e.start,"explicit-key-ind")&&!z(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Bo(e.value)?e.value.end?Qt(e.value.end,e.sep):e.value.end=e.sep:Qt(e.start,e.sep),delete e.sep)}a(Ro,"fixFlowSeqItems");var Un=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 Kf.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,Ff.env.LOG_TOKENS&&console.log("|",Do.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Do.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 n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,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 n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Ro(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.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=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.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((n.type==="document"||n.type==="block-map"||n.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&&jo(i.start)===-1&&(t.indent===0||i.start.every(r=>r.type!=="comment"||r.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.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":{jo(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=Ht(this.peek(2)),n=we(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:n,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 n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Qt(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(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(z(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(Bo(t.key)&&!z(t.sep,"newline")){let o=we(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(z(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=we(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]}):z(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&&!z(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 n&&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 n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Qt(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||z(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.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 n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Ht(n),r=we(i);Ro(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=Ht(e),n=we(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Ht(e),n=we(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.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())}}};Fo.Parser=Un});var Jo=y(Xe=>{"use strict";var Ko=Ln(),Uf=Ue(),Qe=Je(),Yf=Os(),xf=O(),Jf=Kn(),Uo=Yn();function Yo(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Jf.LineCounter||null,prettyErrors:e}}a(Yo,"parseOptions");function Vf(s,e={}){let{lineCounter:t,prettyErrors:n}=Yo(e),i=new Uo.Parser(t?.addNewLine),r=new Ko.Composer(e),o=Array.from(r.compose(i.parse(s)));if(n&&t)for(let l of o)l.errors.forEach(Qe.prettifyError(s,t)),l.warnings.forEach(Qe.prettifyError(s,t));return o.length>0?o:Object.assign([],{empty:!0},r.streamInfo())}a(Vf,"parseAllDocuments");function xo(s,e={}){let{lineCounter:t,prettyErrors:n}=Yo(e),i=new Uo.Parser(t?.addNewLine),r=new Ko.Composer(e),o=null;for(let l of r.compose(i.parse(s),!0,s.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Qe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(Qe.prettifyError(s,t)),o.warnings.forEach(Qe.prettifyError(s,t))),o}a(xo,"parseDocument");function Wf(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let i=xo(s,t);if(!i)return null;if(i.warnings.forEach(r=>Yf.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:n},t))}a(Wf,"parse");function Gf(s,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=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(s===void 0){let{keepUndefined:i}=t??e??{};if(!i)return}return xf.isDocument(s)&&!n?s.toString(t):new Uf.Document(s,n,t).toString(t)}a(Gf,"stringify");Xe.parse=Wf;Xe.parseAllDocuments=Vf;Xe.parseDocument=xo;Xe.stringify=Gf});var Wo=y(q=>{"use strict";var Hf=Ln(),Qf=Ue(),Xf=cn(),xn=Je(),zf=Oe(),Z=O(),Zf=G(),ed=L(),td=Q(),sd=X(),nd=Wt(),id=Bn(),rd=Kn(),od=Yn(),Xt=Jo(),Vo=ke();q.Composer=Hf.Composer;q.Document=Qf.Document;q.Schema=Xf.Schema;q.YAMLError=xn.YAMLError;q.YAMLParseError=xn.YAMLParseError;q.YAMLWarning=xn.YAMLWarning;q.Alias=zf.Alias;q.isAlias=Z.isAlias;q.isCollection=Z.isCollection;q.isDocument=Z.isDocument;q.isMap=Z.isMap;q.isNode=Z.isNode;q.isPair=Z.isPair;q.isScalar=Z.isScalar;q.isSeq=Z.isSeq;q.Pair=Zf.Pair;q.Scalar=ed.Scalar;q.YAMLMap=td.YAMLMap;q.YAMLSeq=sd.YAMLSeq;q.CST=nd;q.Lexer=id.Lexer;q.LineCounter=rd.LineCounter;q.Parser=od.Parser;q.parse=Xt.parse;q.parseAllDocuments=Xt.parseAllDocuments;q.parseDocument=Xt.parseDocument;q.stringify=Xt.stringify;q.visit=Vo.visit;q.visitAsync=Vo.visitAsync});import{realpathSync as la}from"node:fs";import ee from"node:process";import{fileURLToPath as _d}from"node:url";function Xn(s){return s instanceof Error||Object.prototype.toString.call(s)==="[object Error]"}a(Xn,"isError");function Ze(s){try{return Xn(s)&&typeof s.message=="string"&&s.message!==""?s.message:String(s)}catch{return"[unstringifiable value]"}}a(Ze,"describeError");import wa from"node:process";var zn=120;function Zn(s=wa.stdout){return s.isTTY!==!0?zn:s.columns??zn}a(Zn,"resolveTerminalWidth");async function ei(s){let e=[];for await(let t of s){if(!Buffer.isBuffer(t))throw new TypeError("readAll: expected Buffer chunks (stream must be in binary mode)");e.push(t)}return Buffer.concat(e).toString("utf8")}a(ei,"readAll");import{readFile as Na,unlink as Aa,writeFile as Ea}from"node:fs/promises";import{basename as Oa,dirname as qa,join as Ta}from"node:path";function os(s,e){return ti(s)&&s.code===e}a(os,"isErrorCode");function as(s){return os(s,"ENOENT")}a(as,"isEnoent");function ls(s){return os(s,"ENOENT")||os(s,"ENOTDIR")}a(ls,"isMissingFile");function cs(s){return ti(s)&&!Array.isArray(s)}a(cs,"isRecord");function ti(s){return typeof s=="object"&&s!==null}a(ti,"isObject");function si(s,e){let t=`](${e})`,n=s.split(`
|
|
140
|
+
`),i=[],r=!1;for(let o of n){if(va(o)&&o.includes(t)){r=!0;continue}i.push(o)}return r?{content:ka(i).join(`
|
|
141
|
+
`),removed:!0}:{content:s,removed:!1}}a(si,"removeMemoryIndexEntry");function va(s){return/^\s*[-*] /.test(s)}a(va,"isListItem");function ka(s){let e=[],t=0;for(;t<s.length;){let n=s[t];if(n===void 0)break;if(!n.startsWith("## ")){e.push(n),t+=1;continue}let i=t+1;for(;i<s.length&&!/^#{1,2} /.test(s[i]??"");)i+=1;let r=s.slice(t+1,i);r.some(o=>o.trim()!=="")&&e.push(n,...r),t=i}return e}a(ka,"dropEmptySections");async function ni(s){let e=await La(s.paths),t=await Ca(s.paths);return{ok:!0,results:s.paths.map(i=>{let r=e.get(i)??!1,o=t.get(i)??!1,l=Pa(r,o);return{path:i,deleted:r,indexUpdated:o,...l!==void 0&&{note:l}}})}}a(ni,"deleteMemories");async function La(s){let e=new Map;for(let t of s)try{await Aa(t),e.set(t,!0)}catch(n){if(as(n)){e.set(t,!1);continue}throw n}return e}a(La,"deleteFiles");async function Ca(s){let e=new Map;for(let[t,n]of Ma(s)){let i;try{i=await Na(t,"utf8")}catch(o){if(as(o)){for(let l of n)e.set(l,!1);continue}throw o}let r=!1;for(let o of n){let l=si(i,Oa(o));i=l.content,e.set(o,l.removed),r||=l.removed}r&&await Ea(t,i,"utf8")}return e}a(Ca,"reconcileIndexes");function Ma(s){let e=new Map;for(let t of s){let n=Ta(qa(t),"MEMORY.md"),i=e.get(n)??[];i.push(t),e.set(n,i)}return e}a(Ma,"groupByIndex");function Pa(s,e){if(!s&&!e)return"file already absent and did not match any MEMORY.md line";if(!s)return"file already absent";if(!e)return"did not match any MEMORY.md line"}a(Pa,"noteFor");import{readdir as Zo,readFile as dd}from"node:fs/promises";import{hostname as hd}from"node:os";import{basename as md,join as Vn}from"node:path";var zt=Sa(Wo(),1);function Go(s){return ad(s)&&!Array.isArray(s)}a(Go,"isRecord");function ad(s){return typeof s=="object"&&s!==null}a(ad,"isObject");function Ho(s){let e=(0,zt.parseDocument)(s,{schema:"core"}),t=e.errors[0]?.message;if(t!==void 0)return{fields:{},error:t};let n=e.toJS();return{fields:Go(n)?n:{}}}a(Ho,"parseFrontmatterFields");var Qo="---";function Jn(s){let e=s.split(`
|
|
142
|
+
`);if(e[0]!==Qo)return{fields:{},body:s,bodyStartLine:1,error:"the note does not contain a frontmatter block"};let t=e.findIndex((c,u)=>u>0&&c===Qo);if(t===-1)return{fields:{},body:s,bodyStartLine:1,error:"the note does not contain a frontmatter block"};let n=e.slice(1,t).join(`
|
|
143
|
+
`),i=e.slice(t+1).join(`
|
|
144
|
+
`),r=t+2,{fields:o,error:l}=Ho(n);return{fields:o,body:i,bodyStartLine:r,...l!==void 0&&{error:l}}}a(Jn,"readNoteContent");import{basename as ld}from"node:path";function Zt(s,e){return s!==null?ld(s):e}a(Zt,"deriveLabel");import{stat as cd}from"node:fs/promises";import{join as ud}from"node:path";async function es(s,e=fd){let t=s.split("-"),n=t[0]===""?1:0;return Xo({isDirectory:e,segments:t,prefix:"/",index:n})}a(es,"resolveRepoPath");async function Xo(s){let{isDirectory:e,segments:t,prefix:n,index:i}=s;if(i===t.length)return n;for(let r=i+1;r<=t.length;r++){let o=ud(n,t.slice(i,r).join("-"));if(await e(o)){let l=await Xo({isDirectory:e,segments:t,prefix:o,index:r});if(l!==null)return l}}return null}a(Xo,"searchSegments");async function fd(s){try{return(await cd(s)).isDirectory()}catch{return!1}}a(fd,"directoryExists");async function zo(s){if(s.memoryStores.includes(s.requested))return{ok:!0,memoryStore:s.requested};let e=s.resolveRepo??es,t=[];for(let i of s.memoryStores)Zt(await e(i),i)===s.requested&&t.push(i);let[n]=t;return n===void 0?{ok:!1,error:"no-such-memory-store",message:`"${s.requested}" does not name a memory store under ${s.projectsRoot}`}:t.length>1?{ok:!1,error:"ambiguous-memory-store",message:`"${s.requested}" names ${t.length} memory stores (${t.join(", ")}); pass one by its directory name`}:{ok:!0,memoryStore:n}}a(zo,"resolveMemoryStore");async function ts(s){let e=s.machine??hd(),t;try{t=(await Zo(s.projectsRoot,{withFileTypes:!0})).filter(o=>o.isDirectory()).map(o=>o.name)}catch(r){if(ls(r))return{ok:!1,error:"no-projects-root",message:`projects root ${s.projectsRoot} does not exist`};throw r}if(t=t.toSorted(),s.memoryStore!==void 0){let r=await zo({requested:s.memoryStore,memoryStores:t,projectsRoot:s.projectsRoot});if(!r.ok)return r;t=[r.memoryStore]}let n=[],i=[];for(let r of t){let o=Vn(s.projectsRoot,r,"memory"),l=await pd(o),c=Vn(o,"MEMORY.md"),u=l.length>0?await es(r):null;for(let m of l){let f=Vn(o,m),d=await gd({path:f,memoryStore:r,repoPath:u,machine:e,memoryIndexPath:c});d.kind==="feedback"?n.push(d.memory):d.kind==="unreadable"&&i.push({path:f,reason:d.reason})}}return{ok:!0,machine:e,projectsRoot:s.projectsRoot,memories:n,skipped:i}}a(ts,"enumerateFeedbackMemories");async function pd(s){let e;try{e=await Zo(s)}catch(t){if(ls(t))return[];throw t}return e.filter(t=>t.endsWith(".md")&&t!=="MEMORY.md").toSorted()}a(pd,"listMemoryFiles");async function gd(s){let e=await dd(s.path,"utf8"),t=Jn(e);return t.error!==void 0?yd(e)?{kind:"unreadable",reason:t.error}:{kind:"other"}:bd(t.fields)!=="feedback"?{kind:"other"}:{kind:"feedback",memory:{path:s.path,memoryStore:s.memoryStore,repoPath:s.repoPath,machine:s.machine,slug:md(s.path,".md"),name:Wn(t.fields,"name"),description:Wn(t.fields,"description"),originSessionId:Sd(t.fields),body:t.body,memoryIndexPath:s.memoryIndexPath}}}a(gd,"readMemory");function yd(s){let e=s.split(`
|
|
145
|
+
`);return e[0]==="---"&&e.slice(1).includes("---")}a(yd,"hasFrontmatterFence");function bd(s){let e=s.metadata;return cs(e)&&typeof e.type=="string"?e.type:typeof s.type=="string"?s.type:null}a(bd,"effectiveType");function Wn(s,e){let t=s[e];return typeof t=="string"?t:null}a(Wn,"stringField");function Sd(s){let e=s.metadata;return cs(e)&&typeof e.originSessionId=="string"?e.originSessionId:Wn(s,"originSessionId")}a(Sd,"originSessionId");var wd=/^[\u{20}-\u{7E}]*$/u,vd=new RegExp("^[\\p{Emoji_Presentation}--\\p{Regional_Indicator}]$","v"),kd=2;function ta(s){let e=Nd(s),t=e.flatMap(([n,i])=>Ad(n,i));if(t.length>0)throw new TypeError(`Glyph set is invalid.
|
|
146
|
+
${t.map(n=>`- ${n}`).join(`
|
|
147
|
+
`)}`);return{plain:ea(e.map(([n,{plain:i}])=>[n,{text:i,width:i.length}])),rich:ea(e.map(([n,{rich:i}])=>[n,{text:i,width:kd}]))}}a(ta,"defineGlyphSet");function Nd(s){return Object.entries(s)}a(Nd,"listVariantEntries");function Ad(s,e){let t=[],n=JSON.stringify(s);if(!vd.test(e.rich)){let i=JSON.stringify(e.rich);t.push(`${n}: rich glyph ${i} is not a single Emoji_Presentation code point outside the regional indicators.`)}if(!wd.test(e.plain)){let i=JSON.stringify(e.plain);t.push(`${n}: plain glyph ${i} is not printable ASCII (U+0020 to U+007E).`)}return t}a(Ad,"listViolations");function ea(s){return Object.fromEntries(s)}a(ea,"toGlyphRecord");var Gn=ta({blocked:{plain:"BLOCK",rich:"\u{1F6AB}"},failed:{plain:"FAIL",rich:"\u274C"},info:{plain:"INFO",rich:"\u{1F535}"},passed:{plain:"PASS",rich:"\u2705"},skipped:{plain:"SKIP",rich:"\u23E9"},warning:{plain:"WARN",rich:"\u{1F7E0}"}});var na="\u{1F4E6}",ve=" ",Hn=" ".repeat(3),Ed=new Intl.Segmenter(void 0,{granularity:"grapheme"});function ia(s,e){let t=e.verbose??!1,n=Td(s.skipped,t);if(s.projects.length===0)return n===""?"No feedback memories found.":`No feedback memories found.
|
|
148
|
+
${n}`;let i=t?qd(s.projects,e.width):Od(s.projects),r=n===""?sa(s):`${sa(s)}
|
|
149
|
+
${n}`;return`${i}
|
|
150
|
+
|
|
151
|
+
${r}`}a(ia,"reportSummary");function Od(s){let e=s.map(o=>({project:`${na} ${o.label}`,count:String(o.count),modified:Ld(o.lastModified)})),t=Math.max(7,...e.map(o=>o.project.length)),n=Math.max(8,...e.map(o=>o.count.length)),i=`${"Project".padEnd(t)}${ve}${"Memories".padEnd(n)}${ve}Last modified`,r=e.map(o=>`${o.project.padEnd(t)}${ve}${o.count.padEnd(n)}${ve}${o.modified}`);return[i,...r].join(`
|
|
152
|
+
`)}a(Od,"tableBody");function qd(s,e){return s.map(t=>{let n=Math.max(0,...t.memories.map(l=>l.slug.length)),i=e-Hn.length-n-ve.length,r=t.memories.map(l=>`${Hn}${l.slug.padEnd(n)}${ve}${Cd(l.description??"",i)}`.trimEnd());return[`${na} ${t.label}: ${t.count} ${ns(t.count,"memory","memories")}`,...r].join(`
|
|
153
|
+
`)}).join(`
|
|
154
|
+
|
|
155
|
+
`)}a(qd,"verboseBody");function sa(s){let e=`${s.total} feedback ${ns(s.total,"memory","memories")}`,t=`${s.projects.length} ${ns(s.projects.length,"project","projects")}`;return`${e} across ${t}`}a(sa,"totalLine");function Td(s,e){if(s.length===0)return"";let t=`${Gn.plain.warning.text} ${s.length} ${ns(s.length,"file","files")} skipped (unreadable)`;return e?[`${t}:`,...s.map(n=>`${Hn}${n.path}`)].join(`
|
|
156
|
+
`):t}a(Td,"skippedFooter");function Ld(s){let e=new Date(s);return`${`${e.getUTCFullYear()}-${ss(e.getUTCMonth()+1)}-${ss(e.getUTCDate())}`} ${ss(e.getUTCHours())}:${ss(e.getUTCMinutes())} UTC`}a(Ld,"formatMtimeUtc");function ss(s){return String(s).padStart(2,"0")}a(ss,"pad2");function Cd(s,e){if(e<=0)return"";let t=Array.from(Ed.segment(s),n=>n.segment);return t.length<=e?s:`${t.slice(0,e-1).join("")}\u2026`}a(Cd,"truncate");function ns(s,e,t){return s===1?e:t}a(ns,"pluralize");import{homedir as Md}from"node:os";import{join as ra}from"node:path";function oa(s){let e=s.env?.CLAUDE_CONFIG_DIR,t=e!==void 0&&e!==""?e:ra(s.home??Md(),".claude");return ra(t,"projects")}a(oa,"resolveProjectsRoot");import{stat as Pd}from"node:fs/promises";async function aa(s){let e=await ts({projectsRoot:s.projectsRoot,...s.memoryStore!==void 0&&{memoryStore:s.memoryStore},...s.machine!==void 0&&{machine:s.machine}});if(!e.ok)return e;let t=[];for(let[n,i]of Id(e.memories))t.push({memoryStore:n,label:Zt(i[0]?.repoPath??null,n),repoPath:i[0]?.repoPath??null,count:i.length,lastModified:await $d(i),memories:i.map(r=>({slug:r.slug,description:r.description}))});return t.sort((n,i)=>n.label.localeCompare(i.label,void 0,{sensitivity:"base"})),{ok:!0,machine:e.machine,projectsRoot:e.projectsRoot,projects:t,total:e.memories.length,skipped:e.skipped}}a(aa,"summarizeFeedbackMemories");function Id(s){let e=new Map;for(let t of s){let n=e.get(t.memoryStore)??[];n.push(t),e.set(t.memoryStore,n)}return e}a(Id,"groupByMemoryStore");async function $d(s){let e=0;for(let t of s){let{mtimeMs:n}=await Pd(t.path);n>e&&(e=n)}return new Date(e).toISOString()}a($d,"newestMtime");var le="--memory-store";async function Dd(){try{let s=await jd({argv:ee.argv.slice(2),stdin:ee.stdin,env:ee.env}),e=s.render==="text"?s.value:JSON.stringify(s.value,null,2);ee.stdout.write(`${e}
|
|
157
|
+
`)}catch(s){let e=Ze(s);ee.stderr.write(`feedback-memories: ${e}
|
|
158
|
+
`),ee.exit(1)}}a(Dd,"main");Ud()&&await Dd();async function jd(s){let[e,...t]=s.argv;if(e&&["--help","-h","help"].includes(e))return ca(Kd());if(e==="list"){let n=Bd(t);if(!n.ok)return ae(is(n.message));let i=await aa({projectsRoot:ua(s),...n.memoryStore!==void 0&&{memoryStore:n.memoryStore},...s.machine!==void 0&&{machine:s.machine}});return i.ok?ca(ia(i,{verbose:n.verbose,width:s.columns??Zn()})):ae(i)}if(e==="enumerate"){let n=Rd(t);return n.ok?ae(await ts({projectsRoot:ua(s),...n.memoryStore!==void 0&&{memoryStore:n.memoryStore},...s.machine!==void 0&&{machine:s.machine}})):ae(is(n.message))}if(e==="delete"){if(t.length>0)return ae(is(`delete takes memory paths on stdin, not arguments; got: ${t.join(" ")}`));let n=Fd(await ei(s.stdin));return ae(await ni({paths:n}))}return ae(is(e===void 0?"a subcommand is required: list, enumerate, or delete (see --help)":`unknown subcommand: ${e}`))}a(jd,"runFeedbackMemories");function ae(s){return{render:"json",value:s}}a(ae,"json");function ca(s){return{render:"text",value:s}}a(ca,"text");function ua(s){return oa({...s.home!==void 0&&{home:s.home},...s.env!==void 0&&{env:s.env}})}a(ua,"projectsRootFor");function fa(s,e){let t=s[e];if(t===le){let i=s[e+1];return i===void 0||i.startsWith("--")?{error:`${le} requires a memory-store name`}:{memoryStore:i,consumed:2}}let n=`${le}=`;if(t!==void 0&&t.startsWith(n)){let i=t.slice(n.length);return i.length===0?{error:`${le} requires a memory-store name`}:{memoryStore:i,consumed:1}}return null}a(fa,"matchMemoryStoreFlag");function Rd(s){let e;for(let t=0;t<s.length;t++){let n=fa(s,t);if(n===null)return{ok:!1,message:da(`enumerate accepts only ${le} <name>`,s[t])};if("error"in n)return{ok:!1,message:n.error};e=n.memoryStore,t+=n.consumed-1}return e===void 0?{ok:!0}:{ok:!0,memoryStore:e}}a(Rd,"parseEnumerateArgs");function Bd(s){let e,t=!1;for(let n=0;n<s.length;n++){if(s[n]==="--verbose"){t=!0;continue}let i=fa(s,n);if(i===null)return{ok:!1,message:da(`list accepts only ${le} <name> and --verbose`,s[n])};if("error"in i)return{ok:!1,message:i.error};e=i.memoryStore,n+=i.consumed-1}return e===void 0?{ok:!0,verbose:t}:{ok:!0,memoryStore:e,verbose:t}}a(Bd,"parseListArgs");function da(s,e){return e==="--store"||e!==void 0&&e.startsWith("--store=")?`--store selects a KB store; this helper takes ${le} <name>`:`${s}; got: ${e}`}a(da,"rejectArg");function Fd(s){return s.split(`
|
|
159
|
+
`).map(e=>e.trim()).filter(e=>e.length>0)}a(Fd,"parsePaths");function is(s){return{ok:!1,error:"invalid-args",message:s}}a(is,"invalidArgs");function Kd(){return["feedback-memories: Inspect this machine's feedback memories","","Usage:"," feedback-memories list [--memory-store <name>] [--verbose]"," feedback-memories enumerate [--memory-store <name>]"," feedback-memories delete < paths-on-stdin"," feedback-memories --help","","Verbs:"," list Show feedback-memory counts per project with the newest memory's modification time."," --verbose additionally lists each memory and its description."," enumerate Print every feedback memory as JSON (consumed by the migrate-feedback-memories skill)."," delete Remove the newline-separated memory paths piped on stdin and reconcile each MEMORY.md.","","Options:"," --memory-store <name> Scope to one memory store. <name> is either the store directory name, as shown"," in enumerate's `memoryStore` field (e.g. -Users-me-repos-app), or the project"," label that list prints (e.g. app)."," --verbose (list) List each memory with its description."," -h, --help Show this help."].join(`
|
|
160
|
+
`)}a(Kd,"usage");function Ud(){let s=ee.argv[1];if(s===void 0)return!1;try{return la(_d(import.meta.url))===la(s)}catch(e){let t=Ze(e);return ee.stderr.write(`feedback-memories: warning: could not determine entry point: ${t}
|
|
161
|
+
`),!1}}a(Ud,"isEntryPoint");export{jd as runFeedbackMemories};
|