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,209 @@
|
|
|
1
|
+
import { createRequire as __cjsCreateRequire } from 'node:module';
|
|
2
|
+
const require = __cjsCreateRequire(import.meta.url);
|
|
3
|
+
var rl=Object.create;var As=Object.defineProperty;var il=Object.getOwnPropertyDescriptor;var al=Object.getOwnPropertyNames;var ol=Object.getPrototypeOf,ll=Object.prototype.hasOwnProperty;var o=(s,e)=>As(s,"name",{value:e,configurable:!0}),dt=(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 b=(s,e)=>()=>{try{return e||s((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}};var cl=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of al(e))!ll.call(s,r)&&r!==t&&As(s,r,{get:()=>e[r],enumerable:!(n=il(e,r))||n.enumerable});return s};var ul=(s,e,t)=>(t=s!=null?rl(ol(s)):{},cl(e||!s||!s.__esModule?As(t,"default",{value:s,enumerable:!0}):t,s));var N=b(_=>{"use strict";var Ts=Symbol.for("yaml.alias"),Lr=Symbol.for("yaml.document"),mt=Symbol.for("yaml.map"),Pr=Symbol.for("yaml.pair"),xs=Symbol.for("yaml.scalar"),yt=Symbol.for("yaml.seq"),G=Symbol.for("yaml.node.type"),fl=o(s=>!!s&&typeof s=="object"&&s[G]===Ts,"isAlias"),hl=o(s=>!!s&&typeof s=="object"&&s[G]===Lr,"isDocument"),pl=o(s=>!!s&&typeof s=="object"&&s[G]===mt,"isMap"),dl=o(s=>!!s&&typeof s=="object"&&s[G]===Pr,"isPair"),$r=o(s=>!!s&&typeof s=="object"&&s[G]===xs,"isScalar"),gl=o(s=>!!s&&typeof s=="object"&&s[G]===yt,"isSeq");function Cr(s){if(s&&typeof s=="object")switch(s[G]){case mt:case yt:return!0}return!1}o(Cr,"isCollection");function ml(s){if(s&&typeof s=="object")switch(s[G]){case Ts:case mt:case xs:case yt:return!0}return!1}o(ml,"isNode");var yl=o(s=>($r(s)||Cr(s))&&!!s.anchor,"hasAnchor");_.ALIAS=Ts;_.DOC=Lr;_.MAP=mt;_.NODE_TYPE=G;_.PAIR=Pr;_.SCALAR=xs;_.SEQ=yt;_.hasAnchor=yl;_.isAlias=fl;_.isCollection=Cr;_.isDocument=hl;_.isMap=pl;_.isNode=ml;_.isPair=dl;_.isScalar=$r;_.isSeq=gl});var $e=b(Ns=>{"use strict";var I=N(),M=Symbol("break visit"),Ir=Symbol("skip children"),J=Symbol("remove node");function bt(s,e){let t=_r(e);I.isDocument(s)?we(null,s.contents,t,Object.freeze([s]))===J&&(s.contents=null):we(null,s,t,Object.freeze([]))}o(bt,"visit");bt.BREAK=M;bt.SKIP=Ir;bt.REMOVE=J;function we(s,e,t,n){let r=Rr(s,e,t,n);if(I.isNode(r)||I.isPair(r))return Mr(s,n,r),we(s,r,t,n);if(typeof r!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let a=we(i,e.items[i],t,n);if(typeof a=="number")i=a-1;else{if(a===M)return M;a===J&&(e.items.splice(i,1),i-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let i=we("key",e.key,t,n);if(i===M)return M;i===J&&(e.key=null);let a=we("value",e.value,t,n);if(a===M)return M;a===J&&(e.value=null)}}return r}o(we,"visit_");async function kt(s,e){let t=_r(e);I.isDocument(s)?await Se(null,s.contents,t,Object.freeze([s]))===J&&(s.contents=null):await Se(null,s,t,Object.freeze([]))}o(kt,"visitAsync");kt.BREAK=M;kt.SKIP=Ir;kt.REMOVE=J;async function Se(s,e,t,n){let r=await Rr(s,e,t,n);if(I.isNode(r)||I.isPair(r))return Mr(s,n,r),Se(s,r,t,n);if(typeof r!="symbol"){if(I.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let a=await Se(i,e.items[i],t,n);if(typeof a=="number")i=a-1;else{if(a===M)return M;a===J&&(e.items.splice(i,1),i-=1)}}}else if(I.isPair(e)){n=Object.freeze(n.concat(e));let i=await Se("key",e.key,t,n);if(i===M)return M;i===J&&(e.key=null);let a=await Se("value",e.value,t,n);if(a===M)return M;a===J&&(e.value=null)}}return r}o(Se,"visitAsync_");function _r(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}o(_r,"initVisitor");function Rr(s,e,t,n){if(typeof t=="function")return t(s,e,n);if(I.isMap(e))return t.Map?.(s,e,n);if(I.isSeq(e))return t.Seq?.(s,e,n);if(I.isPair(e))return t.Pair?.(s,e,n);if(I.isScalar(e))return t.Scalar?.(s,e,n);if(I.isAlias(e))return t.Alias?.(s,e,n)}o(Rr,"callVisitor");function Mr(s,e,t){let n=e[e.length-1];if(I.isCollection(n))n.items[s]=t;else if(I.isPair(n))s==="key"?n.key=t:n.value=t;else if(I.isDocument(n))n.contents=t;else{let r=I.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}o(Mr,"replaceNode");Ns.visit=bt;Ns.visitAsync=kt});var Es=b(Dr=>{"use strict";var jr=N(),bl=$e(),kl={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},wl=o(s=>s.replace(/[!,[\]{}]/g,e=>kl[e]),"escapeTagName"),Ce=class s{static{o(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]+/),r=n.shift();switch(r){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[i,a]=n;return this.tags[i]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let a=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,a),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(a){return t(String(a)),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+wl(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),r;if(e&&n.length>0&&jr.isNode(e.contents)){let i={};bl.visit(e.contents,(a,l)=>{jr.isNode(l)&&l.tag&&(i[l.tag]=!0)}),r=Object.keys(i)}else r=[];for(let[i,a]of n)i==="!!"&&a==="tag:yaml.org,2002:"||(!e||r.some(l=>l.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
4
|
+
`)}};Ce.defaultYaml={explicit:!1,version:"1.2"};Ce.defaultTags={"!!":"tag:yaml.org,2002:"};Dr.Directives=Ce});var wt=b(Ie=>{"use strict";var Br=N(),Sl=$e();function vl(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}o(vl,"anchorIsValid");function Fr(s){let e=new Set;return Sl.visit(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}o(Fr,"anchorNames");function Kr(s,e){for(let t=1;;++t){let n=`${s}${t}`;if(!e.has(n))return n}}o(Kr,"findNewAnchor");function Al(s,e){let t=[],n=new Map,r=null;return{onAnchor:o(i=>{t.push(i),r??(r=Fr(s));let a=Kr(e,r);return r.add(a),a},"onAnchor"),setAnchors:o(()=>{for(let i of t){let a=n.get(i);if(typeof a=="object"&&a.anchor&&(Br.isScalar(a.node)||Br.isCollection(a.node)))a.node.anchor=a.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},"setAnchors"),sourceObjects:n}}o(Al,"createNodeAnchors");Ie.anchorIsValid=vl;Ie.anchorNames=Fr;Ie.createNodeAnchors=Al;Ie.findNewAnchor=Kr});var Os=b(Ur=>{"use strict";function _e(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let r=0,i=n.length;r<i;++r){let a=n[r],l=_e(s,n,String(r),a);l===void 0?delete n[r]:l!==a&&(n[r]=l)}else if(n instanceof Map)for(let r of Array.from(n.keys())){let i=n.get(r),a=_e(s,n,r,i);a===void 0?n.delete(r):a!==i&&n.set(r,a)}else if(n instanceof Set)for(let r of Array.from(n)){let i=_e(s,n,r,r);i===void 0?n.delete(r):i!==r&&(n.delete(r),n.add(i))}else for(let[r,i]of Object.entries(n)){let a=_e(s,n,r,i);a===void 0?delete n[r]:a!==i&&(n[r]=a)}return s.call(e,t,n)}o(_e,"applyReviver");Ur.applyReviver=_e});var X=b(Jr=>{"use strict";var Tl=N();function Yr(s,e,t){if(Array.isArray(s))return s.map((n,r)=>Yr(n,String(r),t));if(s&&typeof s.toJSON=="function"){if(!t||!Tl.hasAnchor(s))return s.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=i=>{n.res=i,delete t.onCreate};let r=s.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof s=="bigint"&&!t?.keep?Number(s):s}o(Yr,"toJS");Jr.toJS=Yr});var St=b(zr=>{"use strict";var xl=Os(),Vr=N(),Nl=X(),qs=class{static{o(this,"NodeBase")}constructor(e){Object.defineProperty(this,Vr.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:r,reviver:i}={}){if(!Vr.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=Nl.toJS(this,"",a);if(typeof r=="function")for(let{count:c,res:u}of a.anchors.values())r(u,c);return typeof i=="function"?xl.applyReviver(i,{"":l},"",l):l}};zr.NodeBase=qs});var Re=b(Wr=>{"use strict";var El=wt(),Ol=$e(),ve=N(),ql=St(),Ll=X(),Ls=class extends ql.NodeBase{static{o(this,"Alias")}constructor(e){super(ve.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=[],Ol.visit(e,{Node:o((i,a)=>{(ve.isAlias(a)||ve.hasAnchor(a))&&n.push(a)},"Node")}),t&&(t.aliasResolveCache=n));let r;for(let i of n){if(i===this)break;i.anchor===this.source&&(r=i)}if(r&&t){let{anchors:i,doc:a,maxAliasCount:l}=t,c=i.get(r);if(c||(Ll.toJS(r,null,t),c=i.get(r)),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=vt(a,r,i)),c.count*c.aliasCount>l)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(El.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${r} `}return r}};function vt(s,e,t){if(ve.isAlias(e)){let n=e.resolve(s),r=t&&n&&t.get(n);return r?r.count*r.aliasCount:0}else if(ve.isCollection(e)){let n=0;for(let r of e.items){let i=vt(s,r,t);i>n&&(n=i)}return n}else if(ve.isPair(e)){let n=vt(s,e.key,t),r=vt(s,e.value,t);return Math.max(n,r)}return 1}o(vt,"getAliasCount");Wr.Alias=Ls});var P=b(Ps=>{"use strict";var Pl=N(),$l=St(),Cl=X(),Il=o(s=>!s||typeof s!="function"&&typeof s!="object","isScalarValue"),ee=class extends $l.NodeBase{static{o(this,"Scalar")}constructor(e){super(Pl.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:Cl.toJS(this.value,e,t)}toString(){return String(this.value)}};ee.BLOCK_FOLDED="BLOCK_FOLDED";ee.BLOCK_LITERAL="BLOCK_LITERAL";ee.PLAIN="PLAIN";ee.QUOTE_DOUBLE="QUOTE_DOUBLE";ee.QUOTE_SINGLE="QUOTE_SINGLE";Ps.Scalar=ee;Ps.isScalarValue=Il});var Me=b(Qr=>{"use strict";var _l=Re(),ce=N(),Gr=P(),Rl="tag:yaml.org,2002:";function Ml(s,e,t){if(e){let n=t.filter(i=>i.tag===e),r=n.find(i=>!i.format)??n[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(n=>n.identify?.(s)&&!n.format)}o(Ml,"findTagObject");function jl(s,e,t){if(ce.isDocument(s)&&(s=s.contents),ce.isNode(s))return s;if(ce.isPair(s)){let f=t.schema[ce.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:r,onTagObj:i,schema:a,sourceObjects:l}=t,c;if(n&&s&&typeof s=="object"){if(c=l.get(s),c)return c.anchor??(c.anchor=r(s)),new _l.Alias(c.anchor);c={anchor:null,node:null},l.set(s,c)}e?.startsWith("!!")&&(e=Rl+e.slice(2));let u=Ml(s,e,a.tags);if(!u){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new Gr.Scalar(s);return c&&(c.node=f),f}u=s instanceof Map?a[ce.MAP]:Symbol.iterator in Object(s)?a[ce.SEQ]:a[ce.MAP]}i&&(i(u),delete t.onTagObj);let p=u?.createNode?u.createNode(t.schema,s,t):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(t.schema,s,t):new Gr.Scalar(s);return e?p.tag=e:u.default||(p.tag=u.tag),c&&(c.node=p),p}o(jl,"createNode");Qr.createNode=jl});var Tt=b(At=>{"use strict";var Dl=Me(),V=N(),Bl=St();function $s(s,e,t){let n=t;for(let r=e.length-1;r>=0;--r){let i=e[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let a=[];a[i]=n,n=a}else n=new Map([[i,n]])}return Dl.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:o(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:s,sourceObjects:new Map})}o($s,"collectionFromPath");var Hr=o(s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,"isEmptyPath"),Cs=class extends Bl.NodeBase{static{o(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=>V.isNode(n)||V.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Hr(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(V.isCollection(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,$s(this.schema,r,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(V.isCollection(r))return r.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&V.isScalar(i)?i.value:i:V.isCollection(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!V.isPair(t))return!1;let n=t.value;return n==null||e&&V.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 r=this.get(t,!0);return V.isCollection(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let i=this.get(n,!0);if(V.isCollection(i))i.setIn(r,t);else if(i===void 0&&this.schema)this.set(n,$s(this.schema,r,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}};At.Collection=Cs;At.collectionFromPath=$s;At.isEmptyPath=Hr});var je=b(xt=>{"use strict";var Fl=o(s=>s.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function Is(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}o(Is,"indentComment");var Kl=o((s,e,t)=>s.endsWith(`
|
|
5
|
+
`)?Is(t,e):t.includes(`
|
|
6
|
+
`)?`
|
|
7
|
+
`+Is(t,e):(s.endsWith(" ")?"":" ")+t,"lineComment");xt.indentComment=Is;xt.lineComment=Kl;xt.stringifyComment=Fl});var Xr=b(De=>{"use strict";var Ul="flow",_s="block",Nt="quoted";function Yl(s,e,t="flow",{indentAtStart:n,lineWidth:r=80,minContentWidth:i=20,onFold:a,onOverflow:l}={}){if(!r||r<0)return s;r<i&&(i=0);let c=Math.max(1+i,1+r-e.length);if(s.length<=c)return s;let u=[],p={},f=r-e.length;typeof n=="number"&&(n>r-Math.max(2,i)?u.push(0):f=r-n);let h,g,y=!1,d=-1,m=-1,k=-1;t===_s&&(d=Zr(s,d,e.length),d!==-1&&(f=d+c));for(let v;v=s[d+=1];){if(t===Nt&&v==="\\"){switch(m=d,s[d+1]){case"x":d+=3;break;case"u":d+=5;break;case"U":d+=9;break;default:d+=1}k=d}if(v===`
|
|
8
|
+
`)t===_s&&(d=Zr(s,d,e.length)),f=d+e.length+c,h=void 0;else{if(v===" "&&g&&g!==" "&&g!==`
|
|
9
|
+
`&&g!==" "){let A=s[d+1];A&&A!==" "&&A!==`
|
|
10
|
+
`&&A!==" "&&(h=d)}if(d>=f)if(h)u.push(h),f=h+c,h=void 0;else if(t===Nt){for(;g===" "||g===" ";)g=v,v=s[d+=1],y=!0;let A=d>k+1?d-2:m-1;if(p[A])return s;u.push(A),p[A]=!0,f=A+c,h=void 0}else y=!0}g=v}if(y&&l&&l(),u.length===0)return s;a&&a();let w=s.slice(0,u[0]);for(let v=0;v<u.length;++v){let A=u[v],x=u[v+1]||s.length;A===0?w=`
|
|
11
|
+
${e}${s.slice(0,x)}`:(t===Nt&&p[A]&&(w+=`${s[A]}\\`),w+=`
|
|
12
|
+
${e}${s.slice(A+1,x)}`)}return w}o(Yl,"foldFlowLines");function Zr(s,e,t){let n=e,r=e+1,i=s[r];for(;i===" "||i===" ";)if(e<r+t)i=s[++e];else{do i=s[++e];while(i&&i!==`
|
|
13
|
+
`);n=e,r=e+1,i=s[r]}return n}o(Zr,"consumeMoreIndentedLines");De.FOLD_BLOCK=_s;De.FOLD_FLOW=Ul;De.FOLD_QUOTED=Nt;De.foldFlowLines=Yl});var Fe=b(ei=>{"use strict";var F=P(),te=Xr(),Ot=o((s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),"getFoldOptions"),qt=o(s=>/^(%|---|\.\.\.)/m.test(s),"containsDocumentMarker");function Jl(s,e,t){if(!e||e<0)return!1;let n=e-t,r=s.length;if(r<=n)return!1;for(let i=0,a=0;i<r;++i)if(s[i]===`
|
|
14
|
+
`){if(i-a>n)return!0;if(a=i+1,r-a<=n)return!1}return!0}o(Jl,"lineLengthOverLimit");function Be(s,e){let t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,r=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(qt(s)?" ":""),a="",l=0;for(let c=0,u=t[c];u;u=t[++c])if(u===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(a+=t.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(t[c+1]){case"u":{a+=t.slice(l,c);let p=t.substr(c+2,4);switch(p){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:p.substr(0,2)==="00"?a+="\\x"+p.substr(2):a+=t.substr(c,6)}c+=5,l=c+1}break;case"n":if(n||t[c+2]==='"'||t.length<r)c+=1;else{for(a+=t.slice(l,c)+`
|
|
15
|
+
|
|
16
|
+
`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)a+=`
|
|
17
|
+
`,c+=2;a+=i,t[c+2]===" "&&(a+="\\"),c+=1,l=c+1}break;default:c+=1}return a=l?a+t.slice(l):t,n?a:te.foldFlowLines(a,i,te.FOLD_QUOTED,Ot(e,!1))}o(Be,"doubleQuotedString");function Rs(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
|
|
18
|
+
`)||/[ \t]\n|\n[ \t]/.test(s))return Be(s,e);let t=e.indent||(qt(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
+
${t}`)+"'";return e.implicitKey?n:te.foldFlowLines(n,t,te.FOLD_FLOW,Ot(e,!1))}o(Rs,"singleQuotedString");function Ae(s,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Be;else{let r=s.includes('"'),i=s.includes("'");r&&!i?n=Rs:i&&!r?n=Be:n=t?Rs:Be}return n(s,e)}o(Ae,"quotedString");var Ms;try{Ms=new RegExp(`(^|(?<!
|
|
20
|
+
))
|
|
21
|
+
+(?!
|
|
22
|
+
|$)`,"g")}catch{Ms=/\n+(?!\n|$)/g}function Et({comment:s,type:e,value:t},n,r,i){let{blockQuote:a,commentString:l,lineWidth:c}=n.options;if(!a||/\n[\t ]+$/.test(t))return Ae(t,n);let u=n.indent||(n.forceBlockIndent||qt(t)?" ":""),p=a==="literal"?!0:a==="folded"||e===F.Scalar.BLOCK_FOLDED?!1:e===F.Scalar.BLOCK_LITERAL?!0:!Jl(t,c,u.length);if(!t)return p?`|
|
|
23
|
+
`:`>
|
|
24
|
+
`;let f,h;for(h=t.length;h>0;--h){let x=t[h-1];if(x!==`
|
|
25
|
+
`&&x!==" "&&x!==" ")break}let g=t.substring(h),y=g.indexOf(`
|
|
26
|
+
`);y===-1?f="-":t===g||y!==g.length-1?(f="+",i&&i()):f="",g&&(t=t.slice(0,-g.length),g[g.length-1]===`
|
|
27
|
+
`&&(g=g.slice(0,-1)),g=g.replace(Ms,`$&${u}`));let d=!1,m,k=-1;for(m=0;m<t.length;++m){let x=t[m];if(x===" ")d=!0;else if(x===`
|
|
28
|
+
`)k=m;else break}let w=t.substring(0,k<m?k+1:m);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${u}`));let A=(d?u?"2":"1":"")+f;if(s&&(A+=" "+l(s.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){let x=t.replace(/\n+/g,`
|
|
29
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),T=!1,E=Ot(n,!0);a!=="folded"&&e!==F.Scalar.BLOCK_FOLDED&&(E.onOverflow=()=>{T=!0});let S=te.foldFlowLines(`${w}${x}${g}`,u,te.FOLD_BLOCK,E);if(!T)return`>${A}
|
|
30
|
+
${u}${S}`}return t=t.replace(/\n+/g,`$&${u}`),`|${A}
|
|
31
|
+
${u}${w}${t}${g}`}o(Et,"blockString");function Vl(s,e,t,n){let{type:r,value:i}=s,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:p}=e;if(l&&i.includes(`
|
|
32
|
+
`)||p&&/[[\]{},]/.test(i))return Ae(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||p||!i.includes(`
|
|
33
|
+
`)?Ae(i,e):Et(s,e,t,n);if(!l&&!p&&r!==F.Scalar.PLAIN&&i.includes(`
|
|
34
|
+
`))return Et(s,e,t,n);if(qt(i)){if(c==="")return e.forceBlockIndent=!0,Et(s,e,t,n);if(l&&c===u)return Ae(i,e)}let f=i.replace(/\n+/g,`$&
|
|
35
|
+
${c}`);if(a){let h=o(d=>d.default&&d.tag!=="tag:yaml.org,2002:str"&&d.test?.test(f),"test"),{compat:g,tags:y}=e.doc.schema;if(y.some(h)||g?.some(h))return Ae(i,e)}return l?f:te.foldFlowLines(f,c,te.FOLD_FLOW,Ot(e,!1))}o(Vl,"plainString");function zl(s,e,t,n){let{implicitKey:r,inFlow:i}=e,a=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)}),{type:l}=s;l!==F.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=F.Scalar.QUOTE_DOUBLE);let c=o(p=>{switch(p){case F.Scalar.BLOCK_FOLDED:case F.Scalar.BLOCK_LITERAL:return r||i?Ae(a.value,e):Et(a,e,t,n);case F.Scalar.QUOTE_DOUBLE:return Be(a.value,e);case F.Scalar.QUOTE_SINGLE:return Rs(a.value,e);case F.Scalar.PLAIN:return Vl(a,e,t,n);default:return null}},"_stringify"),u=c(l);if(u===null){let{defaultKeyType:p,defaultStringType:f}=e.options,h=r&&p||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}o(zl,"stringifyString");ei.stringifyString=zl});var Ke=b(js=>{"use strict";var Wl=wt(),se=N(),Gl=je(),Ql=Fe();function Hl(s,e){let t=Object.assign({blockQuote:!0,commentString:Gl.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}}o(Hl,"createStringifyContext");function Zl(s,e){if(e.tag){let r=s.filter(i=>i.tag===e.tag);if(r.length>0)return r.find(i=>i.format===e.format)??r[0]}let t,n;if(se.isScalar(e)){n=e.value;let r=s.filter(i=>i.identify?.(n));if(r.length>1){let i=r.filter(a=>a.test);i.length>0&&(r=i)}t=r.find(i=>i.format===e.format)??r.find(i=>!i.format)}else n=e,t=s.find(r=>r.nodeClass&&n instanceof r.nodeClass);if(!t){let r=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${r} value`)}return t}o(Zl,"getTagObject");function Xl(s,e,{anchors:t,doc:n}){if(!n.directives)return"";let r=[],i=(se.isScalar(s)||se.isCollection(s))&&s.anchor;i&&Wl.anchorIsValid(i)&&(t.add(i),r.push(`&${i}`));let a=s.tag??(e.default?null:e.tag);return a&&r.push(n.directives.tagString(a)),r.join(" ")}o(Xl,"stringifyProps");function ec(s,e,t,n){if(se.isPair(s))return s.toString(e,t,n);if(se.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 r,i=se.isNode(s)?s:e.doc.createNode(s,{onTagObj:o(c=>r=c,"onTagObj")});r??(r=Zl(e.doc.schema.tags,i));let a=Xl(i,r,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let l=typeof r.stringify=="function"?r.stringify(i,e,t,n):se.isScalar(i)?Ql.stringifyString(i,e,t,n):i.toString(e,t,n);return a?se.isScalar(i)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
|
|
36
|
+
${e.indent}${l}`:l}o(ec,"stringify");js.createStringifyContext=Hl;js.stringify=ec});var ri=b(ni=>{"use strict";var Q=N(),ti=P(),si=Ke(),Ue=je();function tc({key:s,value:e},t,n,r){let{allNullValues:i,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:p,simpleKeys:f}}=t,h=Q.isNode(s)&&s.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Q.isCollection(s)||!Q.isNode(s)&&typeof s=="object"){let E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let g=!f&&(!s||h&&e==null&&!t.inFlow||Q.isCollection(s)||(Q.isScalar(s)?s.type===ti.Scalar.BLOCK_FOLDED||s.type===ti.Scalar.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(f||!i),indent:l+c});let y=!1,d=!1,m=si.stringify(s,t,()=>y=!0,()=>d=!0);if(!g&&!t.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(t.inFlow){if(i||e==null)return y&&n&&n(),m===""?"?":g?`? ${m}`:m}else if(i&&!f||e==null&&g)return m=`? ${m}`,h&&!y?m+=Ue.lineComment(m,t.indent,u(h)):d&&r&&r(),m;y&&(h=null),g?(h&&(m+=Ue.lineComment(m,t.indent,u(h))),m=`? ${m}
|
|
37
|
+
${l}:`):(m=`${m}:`,h&&(m+=Ue.lineComment(m,t.indent,u(h))));let k,w,v;Q.isNode(e)?(k=!!e.spaceBefore,w=e.commentBefore,v=e.comment):(k=!1,w=null,v=null,e&&typeof e=="object"&&(e=a.createNode(e))),t.implicitKey=!1,!g&&!h&&Q.isScalar(e)&&(t.indentAtStart=m.length+1),d=!1,!p&&c.length>=2&&!t.inFlow&&!g&&Q.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let A=!1,x=si.stringify(e,t,()=>A=!0,()=>d=!0),T=" ";if(h||k||w){if(T=k?`
|
|
38
|
+
`:"",w){let E=u(w);T+=`
|
|
39
|
+
${Ue.indentComment(E,t.indent)}`}x===""&&!t.inFlow?T===`
|
|
40
|
+
`&&v&&(T=`
|
|
41
|
+
|
|
42
|
+
`):T+=`
|
|
43
|
+
${t.indent}`}else if(!g&&Q.isCollection(e)){let E=x[0],S=x.indexOf(`
|
|
44
|
+
`),$=S!==-1,Z=t.inFlow??e.flow??e.items.length===0;if($||!Z){let be=!1;if($&&(E==="&"||E==="!")){let C=x.indexOf(" ");E==="&"&&C!==-1&&C<S&&x[C+1]==="!"&&(C=x.indexOf(" ",C+1)),(C===-1||S<C)&&(be=!0)}be||(T=`
|
|
45
|
+
${t.indent}`)}}else(x===""||x[0]===`
|
|
46
|
+
`)&&(T="");return m+=T+x,t.inFlow?A&&n&&n():v&&!A?m+=Ue.lineComment(m,t.indent,u(v)):d&&r&&r(),m}o(tc,"stringifyPair");ni.stringifyPair=tc});var Bs=b(Ds=>{"use strict";var ii=dt("process");function sc(s,...e){s==="debug"&&console.log(...e)}o(sc,"debug");function nc(s,e){(s==="debug"||s==="warn")&&(typeof ii.emitWarning=="function"?ii.emitWarning(e):console.warn(e))}o(nc,"warn");Ds.debug=sc;Ds.warn=nc});var It=b(Ct=>{"use strict";var $t=N(),ai=P(),Lt="<<",Pt={identify:o(s=>s===Lt||typeof s=="symbol"&&s.description===Lt,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:o(()=>Object.assign(new ai.Scalar(Symbol(Lt)),{addToJSMap:oi}),"resolve"),stringify:o(()=>Lt,"stringify")},rc=o((s,e)=>(Pt.identify(e)||$t.isScalar(e)&&(!e.type||e.type===ai.Scalar.PLAIN)&&Pt.identify(e.value))&&s?.doc.schema.tags.some(t=>t.tag===Pt.tag&&t.default),"isMergeKey");function oi(s,e,t){let n=li(s,t);if($t.isSeq(n))for(let r of n.items)Fs(s,e,r);else if(Array.isArray(n))for(let r of n)Fs(s,e,r);else Fs(s,e,n)}o(oi,"addMergeToJSMap");function Fs(s,e,t){let n=li(s,t);if(!$t.isMap(n))throw new Error("Merge sources must be maps or map aliases");let r=n.toJSON(null,s,Map);for(let[i,a]of r)e instanceof Map?e.has(i)||e.set(i,a):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}o(Fs,"mergeValue");function li(s,e){return s&&$t.isAlias(e)?e.resolve(s.doc,s):e}o(li,"resolveAliasValue");Ct.addMergeToJSMap=oi;Ct.isMergeKey=rc;Ct.merge=Pt});var Us=b(fi=>{"use strict";var ic=Bs(),ci=It(),ac=Ke(),ui=N(),Ks=X();function oc(s,e,{key:t,value:n}){if(ui.isNode(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(ci.isMergeKey(s,t))ci.addMergeToJSMap(s,e,n);else{let r=Ks.toJS(t,"",s);if(e instanceof Map)e.set(r,Ks.toJS(n,r,s));else if(e instanceof Set)e.add(r);else{let i=lc(t,r,s),a=Ks.toJS(n,i,s);i in e?Object.defineProperty(e,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[i]=a}}return e}o(oc,"addPairToJSMap");function lc(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(ui.isNode(s)&&t?.doc){let n=ac.createStringifyContext(t.doc,{});n.anchors=new Set;for(let i of t.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;let r=s.toString(n);if(!t.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),ic.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}o(lc,"stringifyKey");fi.addPairToJSMap=oc});var ne=b(Ys=>{"use strict";var hi=Me(),cc=ri(),uc=Us(),_t=N();function fc(s,e,t){let n=hi.createNode(s,void 0,t),r=hi.createNode(e,void 0,t);return new Rt(n,r)}o(fc,"createPair");var Rt=class s{static{o(this,"Pair")}constructor(e,t=null){Object.defineProperty(this,_t.NODE_TYPE,{value:_t.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return _t.isNode(t)&&(t=t.clone(e)),_t.isNode(n)&&(n=n.clone(e)),new s(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return uc.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?cc.stringifyPair(this,e,t,n):JSON.stringify(this)}};Ys.Pair=Rt;Ys.createPair=fc});var Js=b(di=>{"use strict";var ue=N(),pi=Ke(),Mt=je();function hc(s,e,t){return(e.inFlow??s.flow?dc:pc)(s,e,t)}o(hc,"stringifyCollection");function pc({comment:s,items:e},t,{blockItemPrefix:n,flowChars:r,itemIndent:i,onChompKeep:a,onComment:l}){let{indent:c,options:{commentString:u}}=t,p=Object.assign({},t,{indent:i,type:null}),f=!1,h=[];for(let y=0;y<e.length;++y){let d=e[y],m=null;if(ue.isNode(d))!f&&d.spaceBefore&&h.push(""),jt(t,h,d.commentBefore,f),d.comment&&(m=d.comment);else if(ue.isPair(d)){let w=ue.isNode(d.key)?d.key:null;w&&(!f&&w.spaceBefore&&h.push(""),jt(t,h,w.commentBefore,f))}f=!1;let k=pi.stringify(d,p,()=>m=null,()=>f=!0);m&&(k+=Mt.lineComment(k,i,u(m))),f&&m&&(f=!1),h.push(n+k)}let g;if(h.length===0)g=r.start+r.end;else{g=h[0];for(let y=1;y<h.length;++y){let d=h[y];g+=d?`
|
|
47
|
+
${c}${d}`:`
|
|
48
|
+
`}}return s?(g+=`
|
|
49
|
+
`+Mt.indentComment(u(s),c),l&&l()):f&&a&&a(),g}o(pc,"stringifyBlockCollection");function dc({items:s},e,{flowChars:t,itemIndent:n}){let{indent:r,indentStep:i,flowCollectionPadding:a,options:{commentString:l}}=e;n+=i;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),u=!1,p=0,f=[];for(let y=0;y<s.length;++y){let d=s[y],m=null;if(ue.isNode(d))d.spaceBefore&&f.push(""),jt(e,f,d.commentBefore,!1),d.comment&&(m=d.comment);else if(ue.isPair(d)){let w=ue.isNode(d.key)?d.key:null;w&&(w.spaceBefore&&f.push(""),jt(e,f,w.commentBefore,!1),w.comment&&(u=!0));let v=ue.isNode(d.value)?d.value:null;v?(v.comment&&(m=v.comment),v.commentBefore&&(u=!0)):d.value==null&&w?.comment&&(m=w.comment)}m&&(u=!0);let k=pi.stringify(d,c,()=>m=null);u||(u=f.length>p||k.includes(`
|
|
50
|
+
`)),y<s.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(u||(u=f.reduce((w,v)=>w+v.length+2,2)+(k.length+2)>e.options.lineWidth)),u&&(k+=",")),m&&(k+=Mt.lineComment(k,n,l(m))),f.push(k),p=f.length}let{start:h,end:g}=t;if(f.length===0)return h+g;if(!u){let y=f.reduce((d,m)=>d+m.length+2,2);u=e.options.lineWidth>0&&y>e.options.lineWidth}if(u){let y=h;for(let d of f)y+=d?`
|
|
51
|
+
${i}${r}${d}`:`
|
|
52
|
+
`;return`${y}
|
|
53
|
+
${r}${g}`}else return`${h}${a}${f.join(" ")}${a}${g}`}o(dc,"stringifyFlowCollection");function jt({indent:s,options:{commentString:e}},t,n,r){if(n&&r&&(n=n.replace(/^\n+/,"")),n){let i=Mt.indentComment(e(n),s);t.push(i.trimStart())}}o(jt,"addCommentBefore");di.stringifyCollection=hc});var ie=b(zs=>{"use strict";var gc=Js(),mc=Us(),yc=Tt(),re=N(),Dt=ne(),bc=P();function Ye(s,e){let t=re.isScalar(e)?e.value:e;for(let n of s)if(re.isPair(n)&&(n.key===e||n.key===t||re.isScalar(n.key)&&n.key.value===t))return n}o(Ye,"findPair");var Vs=class extends yc.Collection{static{o(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(re.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),l=o((c,u)=>{if(typeof i=="function")u=i.call(t,c,u);else if(Array.isArray(i)&&!i.includes(c))return;(u!==void 0||r)&&a.items.push(Dt.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"&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;re.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Dt.Pair(e,e?.value):n=new Dt.Pair(e.key,e.value);let r=Ye(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${n.key} already set`);re.isScalar(r.value)&&bc.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let a=this.items.findIndex(l=>i(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let t=Ye(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let r=Ye(this.items,e)?.value;return(!t&&re.isScalar(r)?r.value:r)??void 0}has(e){return!!Ye(this.items,e)}set(e,t){this.add(new Dt.Pair(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let i of this.items)mc.addPairToJSMap(t,r,i);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let r of this.items)if(!re.isPair(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),gc.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};zs.YAMLMap=Vs;zs.findPair=Ye});var Te=b(mi=>{"use strict";var kc=N(),gi=ie(),wc={collection:"map",default:!0,nodeClass:gi.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(s,e){return kc.isMap(s)||e("Expected a mapping for this tag"),s},createNode:o((s,e,t)=>gi.YAMLMap.from(s,e,t),"createNode")};mi.map=wc});var ae=b(yi=>{"use strict";var Sc=Me(),vc=Js(),Ac=Tt(),Ft=N(),Tc=P(),xc=X(),Ws=class extends Ac.Collection{static{o(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ft.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Bt(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=Bt(e);if(typeof n!="number")return;let r=this.items[n];return!t&&Ft.isScalar(r)?r.value:r}has(e){let t=Bt(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=Bt(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Ft.isScalar(r)&&Tc.isScalarValue(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let i of this.items)n.push(xc.toJS(i,String(r++),t));return n}toString(e,t,n){return e?vc.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let l of t){if(typeof r=="function"){let c=t instanceof Set?l:String(a++);l=r.call(t,c,l)}i.items.push(Sc.createNode(l,void 0,n))}}return i}};function Bt(s){let e=Ft.isScalar(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}o(Bt,"asItemIndex");yi.YAMLSeq=Ws});var xe=b(ki=>{"use strict";var Nc=N(),bi=ae(),Ec={collection:"seq",default:!0,nodeClass:bi.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Nc.isSeq(s)||e("Expected a sequence for this tag"),s},createNode:o((s,e,t)=>bi.YAMLSeq.from(s,e,t),"createNode")};ki.seq=Ec});var Je=b(wi=>{"use strict";var Oc=Fe(),qc={identify:o(s=>typeof s=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:o(s=>s,"resolve"),stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),Oc.stringifyString(s,e,t,n)}};wi.string=qc});var Kt=b(Ai=>{"use strict";var Si=P(),vi={identify:o(s=>s==null,"identify"),createNode:o(()=>new Si.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:o(()=>new Si.Scalar(null),"resolve"),stringify:o(({source:s},e)=>typeof s=="string"&&vi.test.test(s)?s:e.options.nullStr,"stringify")};Ai.nullTag=vi});var Gs=b(xi=>{"use strict";var Lc=P(),Ti={identify:o(s=>typeof s=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:o(s=>new Lc.Scalar(s[0]==="t"||s[0]==="T"),"resolve"),stringify({source:s,value:e},t){if(s&&Ti.test.test(s)){let n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};xi.boolTag=Ti});var Ne=b(Ni=>{"use strict";function Pc({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let r=typeof n=="number"?n:Number(n);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let l=e-(i.length-a-1);for(;l-- >0;)i+="0"}return i}o(Pc,"stringifyNumber");Ni.stringifyNumber=Pc});var Hs=b(Ut=>{"use strict";var $c=P(),Qs=Ne(),Cc={identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o(s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Qs.stringifyNumber},Ic={identify:o(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:o(s=>parseFloat(s),"resolve"),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():Qs.stringifyNumber(s)}},_c={identify:o(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 $c.Scalar(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:Qs.stringifyNumber};Ut.float=_c;Ut.floatExp=Ic;Ut.floatNaN=Cc});var Xs=b(Jt=>{"use strict";var Ei=Ne(),Yt=o(s=>typeof s=="bigint"||Number.isInteger(s),"intIdentify"),Zs=o((s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t),"intResolve");function Oi(s,e,t){let{value:n}=s;return Yt(n)&&n>=0?t+n.toString(e):Ei.stringifyNumber(s)}o(Oi,"intStringify");var Rc={identify:o(s=>Yt(s)&&s>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:o((s,e,t)=>Zs(s,2,8,t),"resolve"),stringify:o(s=>Oi(s,8,"0o"),"stringify")},Mc={identify:Yt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:o((s,e,t)=>Zs(s,0,10,t),"resolve"),stringify:Ei.stringifyNumber},jc={identify:o(s=>Yt(s)&&s>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:o((s,e,t)=>Zs(s,2,16,t),"resolve"),stringify:o(s=>Oi(s,16,"0x"),"stringify")};Jt.int=Mc;Jt.intHex=jc;Jt.intOct=Rc});var Li=b(qi=>{"use strict";var Dc=Te(),Bc=Kt(),Fc=xe(),Kc=Je(),Uc=Gs(),en=Hs(),tn=Xs(),Yc=[Dc.map,Fc.seq,Kc.string,Bc.nullTag,Uc.boolTag,tn.intOct,tn.int,tn.intHex,en.floatNaN,en.floatExp,en.float];qi.schema=Yc});var Ci=b($i=>{"use strict";var Jc=P(),Vc=Te(),zc=xe();function Pi(s){return typeof s=="bigint"||Number.isInteger(s)}o(Pi,"intIdentify");var Vt=o(({value:s})=>JSON.stringify(s),"stringifyJSON"),Wc=[{identify:o(s=>typeof s=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:o(s=>s,"resolve"),stringify:Vt},{identify:o(s=>s==null,"identify"),createNode:o(()=>new Jc.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:o(()=>null,"resolve"),stringify:Vt},{identify:o(s=>typeof s=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:o(s=>s==="true","resolve"),stringify:Vt},{identify:Pi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:o((s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),"resolve"),stringify:o(({value:s})=>Pi(s)?s.toString():JSON.stringify(s),"stringify")},{identify:o(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:o(s=>parseFloat(s),"resolve"),stringify:Vt}],Gc={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},Qc=[Vc.map,zc.seq].concat(Wc,Gc);$i.schema=Qc});var nn=b(Ii=>{"use strict";var Ve=dt("buffer"),sn=P(),Hc=Fe(),Zc={identify:o(s=>s instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof Ve.Buffer=="function")return Ve.Buffer.from(s,"base64");if(typeof atob=="function"){let t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let r=0;r<t.length;++r)n[r]=t.charCodeAt(r);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,r,i){if(!t)return"";let a=t,l;if(typeof Ve.Buffer=="function")l=a instanceof Ve.Buffer?a.toString("base64"):Ve.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let u=0;u<a.length;++u)c+=String.fromCharCode(a[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=sn.Scalar.BLOCK_LITERAL),e!==sn.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),u=Math.ceil(l.length/c),p=new Array(u);for(let f=0,h=0;f<u;++f,h+=c)p[f]=l.substr(h,c);l=p.join(e===sn.Scalar.BLOCK_LITERAL?`
|
|
54
|
+
`:" ")}return Hc.stringifyString({comment:s,type:e,value:l},n,r,i)}};Ii.binary=Zc});var Gt=b(Wt=>{"use strict";var zt=N(),rn=ne(),Xc=P(),eu=ae();function _i(s,e){if(zt.isSeq(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!zt.isPair(n)){if(zt.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let r=n.items[0]||new rn.Pair(new Xc.Scalar(null));if(n.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${n.commentBefore}
|
|
55
|
+
${r.key.commentBefore}`:n.commentBefore),n.comment){let i=r.value??r.key;i.comment=i.comment?`${n.comment}
|
|
56
|
+
${i.comment}`:n.comment}n=r}s.items[t]=zt.isPair(n)?n:new rn.Pair(n)}}else e("Expected a sequence for this tag");return s}o(_i,"resolvePairs");function Ri(s,e,t){let{replacer:n}=t,r=new eu.YAMLSeq(s);r.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(i++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;r.items.push(rn.createPair(l,c,t))}return r}o(Ri,"createPairs");var tu={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:_i,createNode:Ri};Wt.createPairs=Ri;Wt.pairs=tu;Wt.resolvePairs=_i});var ln=b(on=>{"use strict";var Mi=N(),an=X(),ze=ie(),su=ae(),ji=Gt(),fe=class s extends su.YAMLSeq{static{o(this,"YAMLOMap")}constructor(){super(),this.add=ze.YAMLMap.prototype.add.bind(this),this.delete=ze.YAMLMap.prototype.delete.bind(this),this.get=ze.YAMLMap.prototype.get.bind(this),this.has=ze.YAMLMap.prototype.has.bind(this),this.set=ze.YAMLMap.prototype.set.bind(this),this.tag=s.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let r of this.items){let i,a;if(Mi.isPair(r)?(i=an.toJS(r.key,"",t),a=an.toJS(r.value,i,t)):i=an.toJS(r,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,a)}return n}static from(e,t,n){let r=ji.createPairs(e,t,n),i=new this;return i.items=r.items,i}};fe.tag="tag:yaml.org,2002:omap";var nu={collection:"seq",identify:o(s=>s instanceof Map,"identify"),nodeClass:fe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){let t=ji.resolvePairs(s,e),n=[];for(let{key:r}of t.items)Mi.isScalar(r)&&(n.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):n.push(r.value));return Object.assign(new fe,t)},createNode:o((s,e,t)=>fe.from(s,e,t),"createNode")};on.YAMLOMap=fe;on.omap=nu});var Ui=b(cn=>{"use strict";var Di=P();function Bi({value:s,source:e},t){return e&&(s?Fi:Ki).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}o(Bi,"boolStringify");var Fi={identify:o(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:o(()=>new Di.Scalar(!0),"resolve"),stringify:Bi},Ki={identify:o(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:o(()=>new Di.Scalar(!1),"resolve"),stringify:Bi};cn.falseTag=Ki;cn.trueTag=Fi});var Yi=b(Qt=>{"use strict";var ru=P(),un=Ne(),iu={identify:o(s=>typeof s=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:o(s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:un.stringifyNumber},au={identify:o(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:o(s=>parseFloat(s.replace(/_/g,"")),"resolve"),stringify(s){let e=Number(s.value);return isFinite(e)?e.toExponential():un.stringifyNumber(s)}},ou={identify:o(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 ru.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:un.stringifyNumber};Qt.float=ou;Qt.floatExp=au;Qt.floatNaN=iu});var Vi=b(Ge=>{"use strict";var Ji=Ne(),We=o(s=>typeof s=="bigint"||Number.isInteger(s),"intIdentify");function Ht(s,e,t,{intAsBigInt:n}){let r=s[0];if((r==="-"||r==="+")&&(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 a=BigInt(s);return r==="-"?BigInt(-1)*a:a}let i=parseInt(s,t);return r==="-"?-1*i:i}o(Ht,"intResolve");function fn(s,e,t){let{value:n}=s;if(We(n)){let r=n.toString(e);return n<0?"-"+t+r.substr(1):t+r}return Ji.stringifyNumber(s)}o(fn,"intStringify");var lu={identify:We,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:o((s,e,t)=>Ht(s,2,2,t),"resolve"),stringify:o(s=>fn(s,2,"0b"),"stringify")},cu={identify:We,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:o((s,e,t)=>Ht(s,1,8,t),"resolve"),stringify:o(s=>fn(s,8,"0"),"stringify")},uu={identify:We,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:o((s,e,t)=>Ht(s,0,10,t),"resolve"),stringify:Ji.stringifyNumber},fu={identify:We,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:o((s,e,t)=>Ht(s,2,16,t),"resolve"),stringify:o(s=>fn(s,16,"0x"),"stringify")};Ge.int=uu;Ge.intBin=lu;Ge.intHex=fu;Ge.intOct=cu});var pn=b(hn=>{"use strict";var es=N(),Zt=ne(),Xt=ie(),he=class s extends Xt.YAMLMap{static{o(this,"YAMLSet")}constructor(e){super(e),this.tag=s.tag}add(e){let t;es.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Zt.Pair(e.key,null):t=new Zt.Pair(e,null),Xt.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Xt.findPair(this.items,e);return!t&&es.isPair(n)?es.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=Xt.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Zt.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:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof r=="function"&&(a=r.call(t,a,a)),i.items.push(Zt.createPair(a,null,n));return i}};he.tag="tag:yaml.org,2002:set";var hu={collection:"map",identify:o(s=>s instanceof Set,"identify"),nodeClass:he,default:!1,tag:"tag:yaml.org,2002:set",createNode:o((s,e,t)=>he.from(s,e,t),"createNode"),resolve(s,e){if(es.isMap(s)){if(s.hasAllNullValues(!0))return Object.assign(new he,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};hn.YAMLSet=he;hn.set=hu});var gn=b(ts=>{"use strict";var pu=Ne();function dn(s,e){let t=s[0],n=t==="-"||t==="+"?s.substring(1):s,r=o(a=>e?BigInt(a):Number(a),"num"),i=n.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return t==="-"?r(-1)*i:i}o(dn,"parseSexagesimal");function zi(s){let{value:e}=s,t=o(a=>a,"num");if(typeof e=="bigint")t=o(a=>BigInt(a),"num");else if(isNaN(e)||!isFinite(e))return pu.stringifyNumber(s);let n="";e<0&&(n="-",e*=t(-1));let r=t(60),i=[e%r];return e<60?i.unshift(0):(e=(e-i[0])/r,i.unshift(e%r),e>=60&&(e=(e-i[0])/r,i.unshift(e))),n+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}o(zi,"stringifySexagesimal");var du={identify:o(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:o((s,e,{intAsBigInt:t})=>dn(s,t),"resolve"),stringify:zi},gu={identify:o(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:o(s=>dn(s,!1),"resolve"),stringify:zi},Wi={identify:o(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(Wi.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,r,i,a,l]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(t,n-1,r,i||0,a||0,l||0,c),p=e[8];if(p&&p!=="Z"){let f=dn(p,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:o(({value:s})=>s?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};ts.floatTime=gu;ts.intTime=du;ts.timestamp=Wi});var Hi=b(Qi=>{"use strict";var mu=Te(),yu=Kt(),bu=xe(),ku=Je(),wu=nn(),Gi=Ui(),mn=Yi(),ss=Vi(),Su=It(),vu=ln(),Au=Gt(),Tu=pn(),yn=gn(),xu=[mu.map,bu.seq,ku.string,yu.nullTag,Gi.trueTag,Gi.falseTag,ss.intBin,ss.intOct,ss.int,ss.intHex,mn.floatNaN,mn.floatExp,mn.float,wu.binary,Su.merge,vu.omap,Au.pairs,Tu.set,yn.intTime,yn.floatTime,yn.timestamp];Qi.schema=xu});var oa=b(wn=>{"use strict";var ta=Te(),Nu=Kt(),sa=xe(),Eu=Je(),Ou=Gs(),bn=Hs(),kn=Xs(),qu=Li(),Lu=Ci(),na=nn(),Qe=It(),ra=ln(),ia=Gt(),Zi=Hi(),aa=pn(),ns=gn(),Xi=new Map([["core",qu.schema],["failsafe",[ta.map,sa.seq,Eu.string]],["json",Lu.schema],["yaml11",Zi.schema],["yaml-1.1",Zi.schema]]),ea={binary:na.binary,bool:Ou.boolTag,float:bn.float,floatExp:bn.floatExp,floatNaN:bn.floatNaN,floatTime:ns.floatTime,int:kn.int,intHex:kn.intHex,intOct:kn.intOct,intTime:ns.intTime,map:ta.map,merge:Qe.merge,null:Nu.nullTag,omap:ra.omap,pairs:ia.pairs,seq:sa.seq,set:aa.set,timestamp:ns.timestamp},Pu={"tag:yaml.org,2002:binary":na.binary,"tag:yaml.org,2002:merge":Qe.merge,"tag:yaml.org,2002:omap":ra.omap,"tag:yaml.org,2002:pairs":ia.pairs,"tag:yaml.org,2002:set":aa.set,"tag:yaml.org,2002:timestamp":ns.timestamp};function $u(s,e,t){let n=Xi.get(e);if(n&&!s)return t&&!n.includes(Qe.merge)?n.concat(Qe.merge):n.slice();let r=n;if(!r)if(Array.isArray(s))r=[];else{let i=Array.from(Xi.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(s))for(let i of s)r=r.concat(i);else typeof s=="function"&&(r=s(r.slice()));return t&&(r=r.concat(Qe.merge)),r.reduce((i,a)=>{let l=typeof a=="string"?ea[a]:a;if(!l){let c=JSON.stringify(a),u=Object.keys(ea).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}o($u,"getTags");wn.coreKnownTags=Pu;wn.getTags=$u});var An=b(la=>{"use strict";var Sn=N(),Cu=Te(),Iu=xe(),_u=Je(),rs=oa(),Ru=o((s,e)=>s.key<e.key?-1:s.key>e.key?1:0,"sortMapEntriesByKey"),vn=class s{static{o(this,"Schema")}constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?rs.getTags(e,"compat"):e?rs.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?rs.coreKnownTags:{},this.tags=rs.getTags(t,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Sn.MAP,{value:Cu.map}),Object.defineProperty(this,Sn.SCALAR,{value:_u.string}),Object.defineProperty(this,Sn.SEQ,{value:Iu.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?Ru:null}clone(){let e=Object.create(s.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};la.Schema=vn});var ua=b(ca=>{"use strict";var Mu=N(),Tn=Ke(),He=je();function ju(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 r=Tn.createStringifyContext(s,e),{commentString:i}=r.options;if(s.commentBefore){t.length!==1&&t.unshift("");let c=i(s.commentBefore);t.unshift(He.indentComment(c,""))}let a=!1,l=null;if(s.contents){if(Mu.isNode(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){let p=i(s.contents.commentBefore);t.push(He.indentComment(p,""))}r.forceBlockIndent=!!s.comment,l=s.contents.comment}let c=l?void 0:()=>a=!0,u=Tn.stringify(s.contents,r,()=>l=null,c);l&&(u+=He.lineComment(u,"",i(l))),(u[0]==="|"||u[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${u}`:t.push(u)}else t.push(Tn.stringify(s.contents,r));if(s.directives?.docEnd)if(s.comment){let c=i(s.comment);c.includes(`
|
|
57
|
+
`)?(t.push("..."),t.push(He.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=s.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||l)&&t[t.length-1]!==""&&t.push(""),t.push(He.indentComment(i(c),"")))}return t.join(`
|
|
58
|
+
`)+`
|
|
59
|
+
`}o(ju,"stringifyDocument");ca.stringifyDocument=ju});var Ze=b(fa=>{"use strict";var Du=Re(),Ee=Tt(),B=N(),Bu=ne(),Fu=X(),Ku=An(),Uu=ua(),xn=wt(),Yu=Os(),Ju=Me(),Nn=Es(),En=class s{static{o(this,"Document")}constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,B.NODE_TYPE,{value:B.DOC});let r=null;typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Nn.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let e=Object.create(s.prototype,{[B.NODE_TYPE]:{value:B.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=B.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Oe(this.contents)&&this.contents.add(e)}addIn(e,t){Oe(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=xn.anchorNames(this);e.anchor=!t||n.has(t)?xn.findNewAnchor(t||"a",n):t}return new Du.Alias(e.anchor)}createNode(e,t,n){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){let m=o(w=>typeof w=="number"||w instanceof String||w instanceof Number,"keyToStr"),k=t.filter(m).map(String);k.length>0&&(t=t.concat(k)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:p}=n??{},{onAnchor:f,setAnchors:h,sourceObjects:g}=xn.createNodeAnchors(this,a||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:g},d=Ju.createNode(e,p,y);return l&&B.isCollection(d)&&(d.flow=!0),h(),d}createPair(e,t,n={}){let r=this.createNode(e,null,n),i=this.createNode(t,null,n);return new Bu.Pair(r,i)}delete(e){return Oe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ee.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Oe(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return B.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ee.isEmptyPath(e)?!t&&B.isScalar(this.contents)?this.contents.value:this.contents:B.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return B.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Ee.isEmptyPath(e)?this.contents!==void 0:B.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ee.collectionFromPath(this.schema,[e],t):Oe(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ee.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Ee.collectionFromPath(this.schema,Array.from(e),t):Oe(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 Nn.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 Nn.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Ku.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:r,onAnchor:i,reviver:a}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Fu.toJS(this.contents,t??"",l);if(typeof i=="function")for(let{count:u,res:p}of l.anchors.values())i(p,u);return typeof a=="function"?Yu.applyReviver(a,{"":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 Uu.stringifyDocument(this,e)}};function Oe(s){if(B.isCollection(s))return!0;throw new Error("Expected a YAML collection as document contents")}o(Oe,"assertCollection");fa.Document=En});var tt=b(et=>{"use strict";var Xe=class extends Error{static{o(this,"YAMLError")}constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},On=class extends Xe{static{o(this,"YAMLParseError")}constructor(e,t,n){super("YAMLParseError",e,t,n)}},qn=class extends Xe{static{o(this,"YAMLWarning")}constructor(e,t,n){super("YAMLWarning",e,t,n)}},Vu=o((s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));let{line:n,col:r}=t.linePos[0];t.message+=` at line ${n}, column ${r}`;let i=r-1,a=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){let l=Math.min(i-39,a.length-79);a="\u2026"+a.substring(l),i-=l-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,i))){let l=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
|
|
60
|
+
`),a=l+a}if(/[^ ]/.test(a)){let l=1,c=t.linePos[1];c?.line===n&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-i)));let u=" ".repeat(i)+"^".repeat(l);t.message+=`:
|
|
61
|
+
|
|
62
|
+
${a}
|
|
63
|
+
${u}
|
|
64
|
+
`}},"prettifyError");et.YAMLError=Xe;et.YAMLParseError=On;et.YAMLWarning=qn;et.prettifyError=Vu});var st=b(ha=>{"use strict";function zu(s,{flow:e,indicator:t,next:n,offset:r,onError:i,parentIndent:a,startOnNewline:l}){let c=!1,u=l,p=l,f="",h="",g=!1,y=!1,d=null,m=null,k=null,w=null,v=null,A=null,x=null;for(let S of s)switch(y&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&i(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),d&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=null),S.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&S.source.includes(" ")&&(d=S),p=!0;break;case"comment":{p||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let $=S.source.substring(1)||" ";f?f+=h+$:f=$,h="",u=!1;break}case"newline":u?f?f+=S.source:(!A||t!=="seq-item-ind")&&(c=!0):h+=S.source,u=!0,g=!0,(m||k)&&(w=S),p=!0;break;case"anchor":m&&i(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&i(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=S,x??(x=S.offset),u=!1,p=!1,y=!0;break;case"tag":{k&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),k=S,x??(x=S.offset),u=!1,p=!1,y=!0;break}case t:(m||k)&&i(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),A&&i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${e??"collection"}`),A=S,u=t==="seq-item-ind"||t==="explicit-key-ind",p=!1;break;case"comma":if(e){v&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=S,u=!1,p=!1;break}default:i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),u=!1,p=!1}let T=s[s.length-1],E=T?T.offset+T.source.length:r;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),d&&(u&&d.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&i(d,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:A,spaceBefore:c,comment:f,hasNewline:g,anchor:m,tag:k,newlineAfterProp:w,end:E,start:x??E}}o(zu,"resolveProps");ha.resolveProps=zu});var is=b(pa=>{"use strict";function Ln(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(Ln(e.key)||Ln(e.value))return!0}return!1;default:return!0}}o(Ln,"containsNewline");pa.containsNewline=Ln});var Pn=b(da=>{"use strict";var Wu=is();function Gu(s,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Wu.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}o(Gu,"flowIndentCheck");da.flowIndentCheck=Gu});var $n=b(ma=>{"use strict";var ga=N();function Qu(s,e,t){let{uniqueKeys:n}=s.options;if(n===!1)return!1;let r=typeof n=="function"?n:(i,a)=>i===a||ga.isScalar(i)&&ga.isScalar(a)&&i.value===a.value;return e.some(i=>r(i.key,t))}o(Qu,"mapIncludes");ma.mapIncludes=Qu});var va=b(Sa=>{"use strict";var ya=ne(),Hu=ie(),ba=st(),Zu=is(),ka=Pn(),Xu=$n(),wa="All mapping items must start at the same column";function ef({composeNode:s,composeEmptyNode:e},t,n,r,i){let a=i?.nodeClass??Hu.YAMLMap,l=new a(t.schema);t.atRoot&&(t.atRoot=!1);let c=n.offset,u=null;for(let p of n.items){let{start:f,key:h,sep:g,value:y}=p,d=ba.resolveProps(f,{indicator:"explicit-key-ind",next:h??g?.[0],offset:c,onError:r,parentIndent:n.indent,startOnNewline:!0}),m=!d.found;if(m){if(h&&(h.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==n.indent&&r(c,"BAD_INDENT",wa)),!d.anchor&&!d.tag&&!g){u=d.end,d.comment&&(l.comment?l.comment+=`
|
|
66
|
+
`+d.comment:l.comment=d.comment);continue}(d.newlineAfterProp||Zu.containsNewline(h))&&r(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else d.found?.indent!==n.indent&&r(c,"BAD_INDENT",wa);t.atKey=!0;let k=d.end,w=h?s(t,h,d,r):e(t,k,f,null,d,r);t.schema.compat&&ka.flowIndentCheck(n.indent,h,r),t.atKey=!1,Xu.mapIncludes(t,l.items,w)&&r(k,"DUPLICATE_KEY","Map keys must be unique");let v=ba.resolveProps(g??[],{indicator:"map-value-ind",next:y,offset:w.range[2],onError:r,parentIndent:n.indent,startOnNewline:!h||h.type==="block-scalar"});if(c=v.end,v.found){m&&(y?.type==="block-map"&&!v.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&d.start<v.found.offset-1024&&r(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let A=y?s(t,y,v,r):e(t,c,g,null,v,r);t.schema.compat&&ka.flowIndentCheck(n.indent,y,r),c=A.range[2];let x=new ya.Pair(w,A);t.options.keepSourceTokens&&(x.srcToken=p),l.items.push(x)}else{m&&r(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(w.comment?w.comment+=`
|
|
67
|
+
`+v.comment:w.comment=v.comment);let A=new ya.Pair(w);t.options.keepSourceTokens&&(A.srcToken=p),l.items.push(A)}}return u&&u<c&&r(u,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,c,u??c],l}o(ef,"resolveBlockMap");Sa.resolveBlockMap=ef});var Ta=b(Aa=>{"use strict";var tf=ae(),sf=st(),nf=Pn();function rf({composeNode:s,composeEmptyNode:e},t,n,r,i){let a=i?.nodeClass??tf.YAMLSeq,l=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=n.offset,u=null;for(let{start:p,value:f}of n.items){let h=sf.resolveProps(p,{indicator:"seq-item-ind",next:f,offset:c,onError:r,parentIndent:n.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?r(h.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{u=h.end,h.comment&&(l.comment=h.comment);continue}let g=f?s(t,f,h,r):e(t,h.end,p,null,h,r);t.schema.compat&&nf.flowIndentCheck(n.indent,f,r),c=g.range[2],l.items.push(g)}return l.range=[n.offset,c,u??c],l}o(rf,"resolveBlockSeq");Aa.resolveBlockSeq=rf});var qe=b(xa=>{"use strict";function af(s,e,t,n){let r="";if(s){let i=!1,a="";for(let l of s){let{source:c,type:u}=l;switch(u){case"space":i=!0;break;case"comment":{t&&!i&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=c.substring(1)||" ";r?r+=a+p:r=p,a="";break}case"newline":r&&(a+=c),i=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}e+=c.length}}return{comment:r,offset:e}}o(af,"resolveEnd");xa.resolveEnd=af});var qa=b(Oa=>{"use strict";var of=N(),lf=ne(),Na=ie(),cf=ae(),uf=qe(),Ea=st(),ff=is(),hf=$n(),Cn="Block collections are not allowed within flow collections",In=o(s=>s&&(s.type==="block-map"||s.type==="block-seq"),"isBlock");function pf({composeNode:s,composeEmptyNode:e},t,n,r,i){let a=n.start.source==="{",l=a?"flow map":"flow sequence",c=i?.nodeClass??(a?Na.YAMLMap:cf.YAMLSeq),u=new c(t.schema);u.flow=!0;let p=t.atRoot;p&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset+n.start.source.length;for(let m=0;m<n.items.length;++m){let k=n.items[m],{start:w,key:v,sep:A,value:x}=k,T=Ea.resolveProps(w,{flow:l,indicator:"explicit-key-ind",next:v??A?.[0],offset:f,onError:r,parentIndent:n.indent,startOnNewline:!1});if(!T.found){if(!T.anchor&&!T.tag&&!A&&!x){m===0&&T.comma?r(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):m<n.items.length-1&&r(T.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),T.comment&&(u.comment?u.comment+=`
|
|
68
|
+
`+T.comment:u.comment=T.comment),f=T.end;continue}!a&&t.options.strict&&ff.containsNewline(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)T.comma&&r(T.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(T.comma||r(T.start,"MISSING_CHAR",`Missing , between ${l} items`),T.comment){let E="";e:for(let S of w)switch(S.type){case"comma":case"space":break;case"comment":E=S.source.substring(1);break e;default:break e}if(E){let S=u.items[u.items.length-1];of.isPair(S)&&(S=S.value??S.key),S.comment?S.comment+=`
|
|
69
|
+
`+E:S.comment=E,T.comment=T.comment.substring(E.length+1)}}if(!a&&!A&&!T.found){let E=x?s(t,x,T,r):e(t,T.end,A,null,T,r);u.items.push(E),f=E.range[2],In(x)&&r(E.range,"BLOCK_IN_FLOW",Cn)}else{t.atKey=!0;let E=T.end,S=v?s(t,v,T,r):e(t,E,w,null,T,r);In(v)&&r(S.range,"BLOCK_IN_FLOW",Cn),t.atKey=!1;let $=Ea.resolveProps(A??[],{flow:l,indicator:"map-value-ind",next:x,offset:S.range[2],onError:r,parentIndent:n.indent,startOnNewline:!1});if($.found){if(!a&&!T.found&&t.options.strict){if(A)for(let C of A){if(C===$.found)break;if(C.type==="newline"){r(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}T.start<$.found.offset-1024&&r($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else x&&("source"in x&&x.source?.[0]===":"?r(x,"MISSING_CHAR",`Missing space after : in ${l}`):r($.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let Z=x?s(t,x,$,r):$.found?e(t,$.end,A,null,$,r):null;Z?In(x)&&r(Z.range,"BLOCK_IN_FLOW",Cn):$.comment&&(S.comment?S.comment+=`
|
|
70
|
+
`+$.comment:S.comment=$.comment);let be=new lf.Pair(S,Z);if(t.options.keepSourceTokens&&(be.srcToken=k),a){let C=u;hf.mapIncludes(t,C.items,S)&&r(E,"DUPLICATE_KEY","Map keys must be unique"),C.items.push(be)}else{let C=new Na.YAMLMap(t.schema);C.flow=!0,C.items.push(be);let Or=(Z??S).range;C.range=[S.range[0],Or[1],Or[2]],u.items.push(C)}f=Z?Z.range[2]:$.end}}let h=a?"}":"]",[g,...y]=n.end,d=f;if(g?.source===h)d=g.offset+g.source.length;else{let m=l[0].toUpperCase()+l.substring(1),k=p?`${m} must end with a ${h}`:`${m} in block collection must be sufficiently indented and end with a ${h}`;r(f,p?"MISSING_CHAR":"BAD_INDENT",k),g&&g.source.length!==1&&y.unshift(g)}if(y.length>0){let m=uf.resolveEnd(y,d,t.options.strict,r);m.comment&&(u.comment?u.comment+=`
|
|
71
|
+
`+m.comment:u.comment=m.comment),u.range=[n.offset,d,m.offset]}else u.range=[n.offset,d,d];return u}o(pf,"resolveFlowCollection");Oa.resolveFlowCollection=pf});var Pa=b(La=>{"use strict";var df=N(),gf=P(),mf=ie(),yf=ae(),bf=va(),kf=Ta(),wf=qa();function _n(s,e,t,n,r,i){let a=t.type==="block-map"?bf.resolveBlockMap(s,e,t,n,i):t.type==="block-seq"?kf.resolveBlockSeq(s,e,t,n,i):wf.resolveFlowCollection(s,e,t,n,i),l=a.constructor;return r==="!"||r===l.tagName?(a.tag=l.tagName,a):(r&&(a.tag=r),a)}o(_n,"resolveCollection");function Sf(s,e,t,n,r){let i=n.tag,a=i?e.directives.tagName(i.source,h=>r(i,"TAG_RESOLVE_FAILED",h)):null;if(t.type==="block-seq"){let{anchor:h,newlineAfterProp:g}=n,y=h&&i?h.offset>i.offset?h:i:h??i;y&&(!g||g.offset<y.offset)&&r(y,"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(!i||!a||a==="!"||a===mf.YAMLMap.tagName&&l==="map"||a===yf.YAMLSeq.tagName&&l==="seq")return _n(s,e,t,r,a);let c=e.schema.tags.find(h=>h.tag===a&&h.collection===l);if(!c){let h=e.schema.knownTags[a];if(h?.collection===l)e.schema.tags.push(Object.assign({},h,{default:!1})),c=h;else return h?r(i,"BAD_COLLECTION_TYPE",`${h.tag} used for ${l} collection, but expects ${h.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),_n(s,e,t,r,a)}let u=_n(s,e,t,r,a,c),p=c.resolve?.(u,h=>r(i,"TAG_RESOLVE_FAILED",h),e.options)??u,f=df.isNode(p)?p:new gf.Scalar(p);return f.range=u.range,f.tag=a,c?.format&&(f.format=c.format),f}o(Sf,"composeCollection");La.composeCollection=Sf});var Mn=b($a=>{"use strict";var Rn=P();function vf(s,e,t){let n=e.offset,r=Af(e,s.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[n,n,n]};let i=r.mode===">"?Rn.Scalar.BLOCK_FOLDED:Rn.Scalar.BLOCK_LITERAL,a=e.source?Tf(e.source):[],l=a.length;for(let d=a.length-1;d>=0;--d){let m=a[d][1];if(m===""||m==="\r")l=d;else break}if(l===0){let d=r.chomp==="+"&&a.length>0?`
|
|
72
|
+
`.repeat(Math.max(1,a.length-1)):"",m=n+r.length;return e.source&&(m+=e.source.length),{value:d,type:i,comment:r.comment,range:[n,m,m]}}let c=e.indent+r.indent,u=e.offset+r.length,p=0;for(let d=0;d<l;++d){let[m,k]=a[d];if(k===""||k==="\r")r.indent===0&&m.length>c&&(c=m.length);else{m.length<c&&t(u+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=m.length),p=d,c===0&&!s.atRoot&&t(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=m.length+k.length+1}for(let d=a.length-1;d>=l;--d)a[d][0].length>c&&(l=d+1);let f="",h="",g=!1;for(let d=0;d<p;++d)f+=a[d][0].slice(c)+`
|
|
73
|
+
`;for(let d=p;d<l;++d){let[m,k]=a[d];u+=m.length+k.length+1;let w=k[k.length-1]==="\r";if(w&&(k=k.slice(0,-1)),k&&m.length<c){let A=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(u-k.length-(w?2:1),"BAD_INDENT",A),m=""}i===Rn.Scalar.BLOCK_LITERAL?(f+=h+m.slice(c)+k,h=`
|
|
74
|
+
`):m.length>c||k[0]===" "?(h===" "?h=`
|
|
75
|
+
`:!g&&h===`
|
|
76
|
+
`&&(h=`
|
|
77
|
+
|
|
78
|
+
`),f+=h+m.slice(c)+k,h=`
|
|
79
|
+
`,g=!0):k===""?h===`
|
|
80
|
+
`?f+=`
|
|
81
|
+
`:h=`
|
|
82
|
+
`:(f+=h+k,h=" ",g=!1)}switch(r.chomp){case"-":break;case"+":for(let d=l;d<a.length;++d)f+=`
|
|
83
|
+
`+a[d][0].slice(c);f[f.length-1]!==`
|
|
84
|
+
`&&(f+=`
|
|
85
|
+
`);break;default:f+=`
|
|
86
|
+
`}let y=n+r.length+e.source.length;return{value:f,type:i,comment:r.comment,range:[n,y,y]}}o(vf,"resolveBlockScalar");function Af({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:r}=e[0],i=r[0],a=0,l="",c=-1;for(let h=1;h<r.length;++h){let g=r[h];if(!l&&(g==="-"||g==="+"))l=g;else{let y=Number(g);!a&&y?a=y:c===-1&&(c=s+h)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let u=!1,p="",f=r.length;for(let h=1;h<e.length;++h){let g=e[h];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,p=g.source.substring(1);break;case"error":n(g,"UNEXPECTED_TOKEN",g.message),f+=g.source.length;break;default:{let y=`Unexpected token in block scalar header: ${g.type}`;n(g,"UNEXPECTED_TOKEN",y);let d=g.source;d&&typeof d=="string"&&(f+=d.length)}}}return{mode:i,indent:a,chomp:l,comment:p,length:f}}o(Af,"parseBlockScalarHeader");function Tf(s){let e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),i=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let a=1;a<e.length;a+=2)i.push([e[a],e[a+1]]);return i}o(Tf,"splitLines");$a.resolveBlockScalar=vf});var Dn=b(Ia=>{"use strict";var jn=P(),xf=qe();function Nf(s,e,t){let{offset:n,type:r,source:i,end:a}=s,l,c,u=o((h,g,y)=>t(n+h,g,y),"_onError");switch(r){case"scalar":l=jn.Scalar.PLAIN,c=Ef(i,u);break;case"single-quoted-scalar":l=jn.Scalar.QUOTE_SINGLE,c=Of(i,u);break;case"double-quoted-scalar":l=jn.Scalar.QUOTE_DOUBLE,c=qf(i,u);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}let p=n+i.length,f=xf.resolveEnd(a,p,e,t);return{value:c,type:l,comment:f.comment,range:[n,p,f.offset]}}o(Nf,"resolveFlowScalar");function Ef(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}`),Ca(s)}o(Ef,"plainValue");function Of(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),Ca(s.slice(1,-1)).replace(/''/g,"'")}o(Of,"singleQuotedValue");function Ca(s){let e=/(.*?)\r?\n/sy,t=e.exec(s);if(!t)return s;let n,r;try{n=new RegExp("(?<![ ])[ ]+$"),r=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{n=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let i=t[1].replace(n,""),a=" ",l=e.lastIndex;for(;t=e.exec(s);){let u=t[1].replace(r,"");u===""?a===`
|
|
87
|
+
`?i+=a:a=`
|
|
88
|
+
`:(i+=a+u,a=" "),l=e.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=l,t=c.exec(s),i+a+(t?.[1]??"")}o(Ca,"unfoldLines");function qf(s,e){let t="";for(let n=1;n<s.length-1;++n){let r=s[n];if(!(r==="\r"&&s[n+1]===`
|
|
89
|
+
`))if(r===`
|
|
90
|
+
`){let{fold:i,offset:a}=Lf(s,n);t+=i,n=a}else if(r==="\\"){let i=s[++n],a=Pf[i];if(a)t+=a;else if(i===`
|
|
91
|
+
`)for(i=s[n+1];i===" "||i===" ";)i=s[++n+1];else if(i==="\r"&&s[n+1]===`
|
|
92
|
+
`)for(i=s[++n+1];i===" "||i===" ";)i=s[++n+1];else if(i==="x"||i==="u"||i==="U"){let l=i==="x"?2:i==="u"?4:8;t+=$f(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(r===" "||r===" "){let i=n,a=s[n+1];for(;a===" "||a===" ";)a=s[++n+1];a!==`
|
|
93
|
+
`&&!(a==="\r"&&s[n+2]===`
|
|
94
|
+
`)&&(t+=n>i?s.slice(i,n+1):r)}else t+=r}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}o(qf,"doubleQuotedValue");function Lf(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}}o(Lf,"foldNewline");var Pf={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 $f(s,e,t,n){let r=s.substr(e,t),a=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(a)}catch{let l=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}o($f,"parseCharCode");Ia.resolveFlowScalar=Nf});var Ma=b(Ra=>{"use strict";var pe=N(),_a=P(),Cf=Mn(),If=Dn();function _f(s,e,t,n){let{value:r,type:i,comment:a,range:l}=e.type==="block-scalar"?Cf.resolveBlockScalar(s,e,n):If.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[pe.SCALAR]:c?u=Rf(s.schema,r,c,t,n):e.type==="scalar"?u=Mf(s,r,e,n):u=s.schema[pe.SCALAR];let p;try{let f=u.resolve(r,h=>n(t??e,"TAG_RESOLVE_FAILED",h),s.options);p=pe.isScalar(f)?f:new _a.Scalar(f)}catch(f){let h=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",h),p=new _a.Scalar(r)}return p.range=l,p.source=r,i&&(p.type=i),c&&(p.tag=c),u.format&&(p.format=u.format),a&&(p.comment=a),p}o(_f,"composeScalar");function Rf(s,e,t,n,r){if(t==="!")return s[pe.SCALAR];let i=[];for(let l of s.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)i.push(l);else return l;for(let l of i)if(l.test?.test(e))return l;let a=s.knownTags[t];return a&&!a.collection?(s.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[pe.SCALAR])}o(Rf,"findScalarTagByName");function Mf({atKey:s,directives:e,schema:t},n,r,i){let a=t.tags.find(l=>(l.default===!0||s&&l.default==="key")&&l.test?.test(n))||t[pe.SCALAR];if(t.compat){let l=t.compat.find(c=>c.default&&c.test?.test(n))??t[pe.SCALAR];if(a.tag!==l.tag){let c=e.tagString(a.tag),u=e.tagString(l.tag),p=`Value may be parsed as either ${c} or ${u}`;i(r,"TAG_RESOLVE_FAILED",p,!0)}}return a}o(Mf,"findScalarTagByTest");Ra.composeScalar=_f});var Da=b(ja=>{"use strict";function jf(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let r=e[n];switch(r.type){case"space":case"comment":case"newline":s-=r.source.length;continue}for(r=e[++n];r?.type==="space";)s+=r.source.length,r=e[++n];break}}return s}o(jf,"emptyScalarPosition");ja.emptyScalarPosition=jf});var Ka=b(Fn=>{"use strict";var Df=Re(),Bf=N(),Ff=Pa(),Ba=Ma(),Kf=qe(),Uf=Da(),Yf={composeNode:Fa,composeEmptyNode:Bn};function Fa(s,e,t,n){let r=s.atKey,{spaceBefore:i,comment:a,anchor:l,tag:c}=t,u,p=!0;switch(e.type){case"alias":u=Jf(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=Ba.composeScalar(s,e,c,n),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Ff.composeCollection(Yf,s,e,t,n),l&&(u.anchor=l.source.substring(1))}catch(f){let h=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",h)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),p=!1}}return u??(u=Bn(s,e.offset,void 0,null,t,n)),l&&u.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&s.options.stringKeys&&(!Bf.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"),i&&(u.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?u.comment=a:u.commentBefore=a),s.options.keepSourceTokens&&p&&(u.srcToken=e),u}o(Fa,"composeNode");function Bn(s,e,t,n,{spaceBefore:r,comment:i,anchor:a,tag:l,end:c},u){let p={type:"scalar",offset:Uf.emptyScalarPosition(e,t,n),indent:-1,source:""},f=Ba.composeScalar(s,p,l,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=c),f}o(Bn,"composeEmptyNode");function Jf({options:s},{offset:e,source:t,end:n},r){let i=new Df.Alias(t.substring(1));i.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+t.length,l=Kf.resolveEnd(n,a,s.strict,r);return i.range=[e,a,l.offset],l.comment&&(i.comment=l.comment),i}o(Jf,"composeAlias");Fn.composeEmptyNode=Bn;Fn.composeNode=Fa});var Ja=b(Ya=>{"use strict";var Vf=Ze(),Ua=Ka(),zf=qe(),Wf=st();function Gf(s,e,{offset:t,start:n,value:r,end:i},a){let l=Object.assign({_directives:e},s),c=new Vf.Document(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=Wf.resolveProps(n,{indicator:"doc-start",next:r??i?.[0],offset:t,onError:a,parentIndent:0,startOnNewline:!0});p.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&a(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?Ua.composeNode(u,r,p,a):Ua.composeEmptyNode(u,p.end,n,null,p,a);let f=c.contents.range[2],h=zf.resolveEnd(i,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[t,f,h.offset],c}o(Gf,"composeDoc");Ya.composeDoc=Gf});var Un=b(Wa=>{"use strict";var Qf=dt("process"),Hf=Es(),Zf=Ze(),nt=tt(),Va=N(),Xf=Ja(),eh=qe();function rt(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)]}o(rt,"getErrorPos");function za(s){let e="",t=!1,n=!1;for(let r=0;r<s.length;++r){let i=s[r];switch(i[0]){case"#":e+=(e===""?"":n?`
|
|
100
|
+
|
|
101
|
+
`:`
|
|
102
|
+
`)+(i.substring(1)||" "),t=!0,n=!1;break;case"%":s[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}o(za,"parsePrelude");var Kn=class{static{o(this,"Composer")}constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,r,i)=>{let a=rt(t);i?this.warnings.push(new nt.YAMLWarning(a,n,r)):this.errors.push(new nt.YAMLParseError(a,n,r))},this.directives=new Hf.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=za(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
103
|
+
${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Va.isCollection(i)&&!i.flow&&i.items.length>0){let a=i.items[0];Va.isPair(a)&&(a=a.key);let l=a.commentBefore;a.commentBefore=l?`${n}
|
|
104
|
+
${l}`:n}else{let a=i.commentBefore;i.commentBefore=a?`${n}
|
|
105
|
+
${a}`:n}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:za(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let r of e)yield*this.next(r);yield*this.end(t,n)}*next(e){switch(Qf.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,r)=>{let i=rt(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Xf.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 nt.YAMLParseError(rt(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 nt.YAMLParseError(rt(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=eh.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 nt.YAMLParseError(rt(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),r=new Zf.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}};Wa.Composer=Kn});var Ha=b(as=>{"use strict";var th=Mn(),sh=Dn(),nh=tt(),Ga=Fe();function rh(s,e=!0,t){if(s){let n=o((r,i,a)=>{let l=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(t)t(l,i,a);else throw new nh.YAMLParseError([l,l+1],i,a)},"_onError");switch(s.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return sh.resolveFlowScalar(s,e,n);case"block-scalar":return th.resolveBlockScalar({options:{strict:e}},s,n)}}return null}o(rh,"resolveAsScalar");function ih(s,e){let{implicitKey:t=!1,indent:n,inFlow:r=!1,offset:i=-1,type:a="PLAIN"}=e,l=Ga.stringifyString({type:a,value:s},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:r,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
|
+
`),p=l.substring(0,u),f=l.substring(u+1)+`
|
|
109
|
+
`,h=[{type:"block-scalar-header",offset:i,indent:n,source:p}];return Qa(h,c)||h.push({type:"newline",offset:-1,indent:n,source:`
|
|
110
|
+
`}),{type:"block-scalar",offset:i,indent:n,props:h,source:f}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:l,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:l,end:c};default:return{type:"scalar",offset:i,indent:n,source:l,end:c}}}o(ih,"createScalarToken");function ah(s,e,t={}){let{afterKey:n=!1,implicitKey:r=!1,inFlow:i=!1,type:a}=t,l="indent"in s?s.indent:null;if(n&&typeof l=="number"&&(l+=2),!a)switch(s.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let u=s.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let c=Ga.stringifyString({type:a,value:e},{implicitKey:r||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":oh(s,c);break;case'"':Yn(s,c,"double-quoted-scalar");break;case"'":Yn(s,c,"single-quoted-scalar");break;default:Yn(s,c,"scalar")}}o(ah,"setScalarValue");function oh(s,e){let t=e.indexOf(`
|
|
111
|
+
`),n=e.substring(0,t),r=e.substring(t+1)+`
|
|
112
|
+
`;if(s.type==="block-scalar"){let i=s.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=n,s.source=r}else{let{offset:i}=s,a="indent"in s?s.indent:-1,l=[{type:"block-scalar-header",offset:i,indent:a,source:n}];Qa(l,"end"in s?s.end:void 0)||l.push({type:"newline",offset:-1,indent:a,source:`
|
|
113
|
+
`});for(let c of Object.keys(s))c!=="type"&&c!=="offset"&&delete s[c];Object.assign(s,{type:"block-scalar",indent:a,props:l,source:r})}}o(oh,"setBlockScalarValue");function Qa(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}o(Qa,"addEndtoBlockProps");function Yn(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),r=e.length;s.props[0].type==="block-scalar-header"&&(r-=s.props[0].source.length);for(let i of n)i.offset+=r;delete s.props,Object.assign(s,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let r={type:"newline",offset:s.offset+e.length,indent:s.indent,source:`
|
|
114
|
+
`};delete s.items,Object.assign(s,{type:t,source:e,end:[r]});break}default:{let n="indent"in s?s.indent:-1,r="end"in s&&Array.isArray(s.end)?s.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(s))i!=="type"&&i!=="offset"&&delete s[i];Object.assign(s,{type:t,indent:n,source:e,end:r})}}}o(Yn,"setFlowScalarValue");as.createScalarToken=ih;as.resolveAsScalar=rh;as.setScalarValue=ah});var Xa=b(Za=>{"use strict";var lh=o(s=>"type"in s?ls(s):os(s),"stringify");function ls(s){switch(s.type){case"block-scalar":{let e="";for(let t of s.props)e+=ls(t);return e+s.source}case"block-map":case"block-seq":{let e="";for(let t of s.items)e+=os(t);return e}case"flow-collection":{let e=s.start.source;for(let t of s.items)e+=os(t);for(let t of s.end)e+=t.source;return e}case"document":{let e=os(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}}}o(ls,"stringifyToken");function os({start:s,key:e,sep:t,value:n}){let r="";for(let i of s)r+=i.source;if(e&&(r+=ls(e)),t)for(let i of t)r+=i.source;return n&&(r+=ls(n)),r}o(os,"stringifyItem");Za.stringify=lh});var no=b(so=>{"use strict";var Jn=Symbol("break visit"),ch=Symbol("skip children"),eo=Symbol("remove item");function de(s,e){"type"in s&&s.type==="document"&&(s={start:s.start,value:s.value}),to(Object.freeze([]),s,e)}o(de,"visit");de.BREAK=Jn;de.SKIP=ch;de.REMOVE=eo;de.itemAtPath=(s,e)=>{let t=s;for(let[n,r]of e){let i=t?.[n];if(i&&"items"in i)t=i.items[r];else return}return t};de.parentCollection=(s,e)=>{let t=de.itemAtPath(s,e.slice(0,-1)),n=e[e.length-1][0],r=t?.[n];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function to(s,e,t){let n=t(e,s);if(typeof n=="symbol")return n;for(let r of["key","value"]){let i=e[r];if(i&&"items"in i){for(let a=0;a<i.items.length;++a){let l=to(Object.freeze(s.concat([[r,a]])),i.items[a],t);if(typeof l=="number")a=l-1;else{if(l===Jn)return Jn;l===eo&&(i.items.splice(a,1),a-=1)}}typeof n=="function"&&r==="key"&&(n=n(e,s))}}return typeof n=="function"?n(e,s):n}o(to,"_visit");so.visit=de});var cs=b(j=>{"use strict";var Vn=Ha(),uh=Xa(),fh=no(),zn="\uFEFF",Wn="",Gn="",Qn="",hh=o(s=>!!s&&"items"in s,"isCollection"),ph=o(s=>!!s&&(s.type==="scalar"||s.type==="single-quoted-scalar"||s.type==="double-quoted-scalar"||s.type==="block-scalar"),"isScalar");function dh(s){switch(s){case zn:return"<BOM>";case Wn:return"<DOC>";case Gn:return"<FLOW_END>";case Qn:return"<SCALAR>";default:return JSON.stringify(s)}}o(dh,"prettyToken");function gh(s){switch(s){case zn:return"byte-order-mark";case Wn:return"doc-mode";case Gn:return"flow-error-end";case Qn: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}o(gh,"tokenType");j.createScalarToken=Vn.createScalarToken;j.resolveAsScalar=Vn.resolveAsScalar;j.setScalarValue=Vn.setScalarValue;j.stringify=uh.stringify;j.visit=fh.visit;j.BOM=zn;j.DOCUMENT=Wn;j.FLOW_END=Gn;j.SCALAR=Qn;j.isCollection=hh;j.isScalar=ph;j.prettyToken=dh;j.tokenType=gh});var Xn=b(io=>{"use strict";var it=cs();function K(s){switch(s){case void 0:case" ":case`
|
|
117
|
+
`:case"\r":case" ":return!0;default:return!1}}o(K,"isEmpty");var ro=new Set("0123456789ABCDEFabcdef"),mh=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),us=new Set(",[]{}"),yh=new Set(` ,[]{}
|
|
118
|
+
\r `),Hn=o(s=>!s||yh.has(s),"isNotAnchorChar"),Zn=class{static{o(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,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 r=this.buffer[n+e+1];if(r===`
|
|
121
|
+
`||!r&&!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==="...")&&K(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]===it.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){let i=e[n-1];if(i===" "||i===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let i=e[t-1];if(i===" "||i===" ")t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),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 it.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==="...")&&K(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&&!K(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===":")&&K(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(Hn),"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 r=this.getLine();if(r===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&r[0]!=="#"||n===0&&(r.startsWith("---")||r.startsWith("..."))&&K(r[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield it.FLOW_END,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"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(Hn),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||K(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),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 i=0;for(;this.buffer[t-1-i]==="\\";)i+=1;if(i%2===0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
124
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){let i=this.continueScalar(r+1);if(i===-1)break;r=n.indexOf(`
|
|
125
|
+
`,i)}r!==-1&&(t=r-(n[r-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=>K(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let i=this.pos;n=this.buffer[i];++i)switch(n){case" ":t+=1;break;case`
|
|
126
|
+
`:e=i,t=0;break;case"\r":{let a=this.buffer[i+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
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 i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
128
|
+
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===" ";)n=this.buffer[++r];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
129
|
+
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let i=e-1,a=this.buffer[i];a==="\r"&&(a=this.buffer[--i]);let l=i;for(;a===" ";)a=this.buffer[--i];if(a===`
|
|
130
|
+
`&&i>=this.pos&&i+1+t>l)e=i;else break}while(!0);return yield it.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===":"){let i=this.buffer[n+1];if(K(i)||e&&us.has(i))break;t=n}else if(K(r)){let i=this.buffer[n+1];if(r==="\r"&&(i===`
|
|
131
|
+
`?(n+=1,r=`
|
|
132
|
+
`,i=this.buffer[n+1]):t=n),i==="#"||e&&us.has(i))break;if(r===`
|
|
133
|
+
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&us.has(r))break;t=n}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield it.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(Hn),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(K(n)||t&&us.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(;!K(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(mh.has(t))t=this.buffer[++e];else if(t==="%"&&ro.has(this.buffer[e+1])&&ro.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 r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};io.Lexer=Zn});var tr=b(ao=>{"use strict";var er=class{static{o(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 i=t+n>>1;this.lineStarts[i]<e?t=i+1:n=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};ao.LineCounter=er});var nr=b(fo=>{"use strict";var bh=dt("process"),oo=cs(),kh=Xn();function oe(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}o(oe,"includesToken");function lo(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}o(lo,"findNonEmptyIndex");function uo(s){switch(s?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}o(uo,"isFlowToken");function fs(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[]}}o(fs,"getPrevProps");function Le(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)}o(Le,"getFirstKeyStartProps");function hs(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])}o(hs,"arrayPushArray");function co(s){if(s.start.type==="flow-seq-start")for(let e of s.items)e.sep&&!e.value&&!oe(e.start,"explicit-key-ind")&&!oe(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,uo(e.value)?e.value.end?hs(e.value.end,e.sep):e.value.end=e.sep:hs(e.start,e.sep),delete e.sep)}o(co,"fixFlowSeqItems");var sr=class{static{o(this,"Parser")}constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new kh.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,bh.env.LOG_TOKENS&&console.log("|",oo.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=oo.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"&&co(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let r=n.items[n.items.length-1];if(r.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=n.items[n.items.length-1];r.value?n.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{let r=n.items[n.items.length-1];!r||r.value?n.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{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 r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&lo(r.start)===-1&&(t.indent===0||r.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(n.type==="document"?n.end=r.start:n.items.push({start:r.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":{lo(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=fs(this.peek(2)),n=Le(t),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){hs(r,t.start),r.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,r=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(r&&t.sep&&!t.value){let a=[];for(let l=0;l<t.sep.length;++l){let c=t.sep[l];switch(c.type){case"newline":a.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(i=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),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(oe(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(uo(t.key)&&!oe(t.sep,"newline")){let a=Le(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:a,key:l,sep:c}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(oe(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let a=Le(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):oe(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 a=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!t.explicitKey&&t.sep&&!oe(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:i});this.stack.push(a);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 r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){hs(r,t.start),r.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||oe(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 r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,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 r=fs(n),i=Le(r);co(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:a}]};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=fs(e),n=Le(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=fs(e),n=Le(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=sr});var yo=b(ot=>{"use strict";var ho=Un(),wh=Ze(),at=tt(),Sh=Bs(),vh=N(),Ah=tr(),po=nr();function go(s){let e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new Ah.LineCounter||null,prettyErrors:e}}o(go,"parseOptions");function Th(s,e={}){let{lineCounter:t,prettyErrors:n}=go(e),r=new po.Parser(t?.addNewLine),i=new ho.Composer(e),a=Array.from(i.compose(r.parse(s)));if(n&&t)for(let l of a)l.errors.forEach(at.prettifyError(s,t)),l.warnings.forEach(at.prettifyError(s,t));return a.length>0?a:Object.assign([],{empty:!0},i.streamInfo())}o(Th,"parseAllDocuments");function mo(s,e={}){let{lineCounter:t,prettyErrors:n}=go(e),r=new po.Parser(t?.addNewLine),i=new ho.Composer(e),a=null;for(let l of i.compose(r.parse(s),!0,s.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new at.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(a.errors.forEach(at.prettifyError(s,t)),a.warnings.forEach(at.prettifyError(s,t))),a}o(mo,"parseDocument");function xh(s,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let r=mo(s,t);if(!r)return null;if(r.warnings.forEach(i=>Sh.warn(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:n},t))}o(xh,"parse");function Nh(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 r=Math.round(t);t=r<1?void 0:r>8?{indent:8}:{indent:r}}if(s===void 0){let{keepUndefined:r}=t??e??{};if(!r)return}return vh.isDocument(s)&&!n?s.toString(t):new wh.Document(s,n,t).toString(t)}o(Nh,"stringify");ot.parse=xh;ot.parseAllDocuments=Th;ot.parseDocument=mo;ot.stringify=Nh});var ko=b(q=>{"use strict";var Eh=Un(),Oh=Ze(),qh=An(),rr=tt(),Lh=Re(),le=N(),Ph=ne(),$h=P(),Ch=ie(),Ih=ae(),_h=cs(),Rh=Xn(),Mh=tr(),jh=nr(),ps=yo(),bo=$e();q.Composer=Eh.Composer;q.Document=Oh.Document;q.Schema=qh.Schema;q.YAMLError=rr.YAMLError;q.YAMLParseError=rr.YAMLParseError;q.YAMLWarning=rr.YAMLWarning;q.Alias=Lh.Alias;q.isAlias=le.isAlias;q.isCollection=le.isCollection;q.isDocument=le.isDocument;q.isMap=le.isMap;q.isNode=le.isNode;q.isPair=le.isPair;q.isScalar=le.isScalar;q.isSeq=le.isSeq;q.Pair=Ph.Pair;q.Scalar=$h.Scalar;q.YAMLMap=Ch.YAMLMap;q.YAMLSeq=Ih.YAMLSeq;q.CST=_h;q.Lexer=Rh.Lexer;q.LineCounter=Mh.LineCounter;q.Parser=jh.Parser;q.parse=ps.parse;q.parseAllDocuments=ps.parseAllDocuments;q.parseDocument=ps.parseDocument;q.stringify=ps.stringify;q.visit=bo.visit;q.visitAsync=bo.visitAsync});import{execFile as Dp}from"node:child_process";import{realpathSync as el}from"node:fs";import{mkdtemp as Bp,readFile as Fp,rm as Kp,stat as Up,writeFile as tl}from"node:fs/promises";import{tmpdir as Yp}from"node:os";import Nr from"node:path";import W from"node:process";import{fileURLToPath as Jp}from"node:url";import{promisify as Vp}from"node:util";function qr(s){return s instanceof Error||Object.prototype.toString.call(s)==="[object Error]"}o(qr,"isError");function ke(s){try{return qr(s)&&typeof s.message=="string"&&s.message!==""?s.message:String(s)}catch{return"[unstringifiable value]"}}o(ke,"describeError");import{readFile as Dh}from"node:fs/promises";import Bh from"node:path";function gt(s,e){let t=new Error(`${s}: ${ke(e)}`,{cause:e});return typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(t,gt),t}o(gt,"chainError");var vo=ul(ko(),1);function ir(s,e){return So(s)&&s.code===e}o(ir,"isErrorCode");function lt(s){return ir(s,"ENOENT")}o(lt,"isEnoent");function wo(s){return ir(s,"ENOENT")||ir(s,"ENOTDIR")}o(wo,"isMissingFile");function D(s){return So(s)&&!Array.isArray(s)}o(D,"isRecord");function So(s){return typeof s=="object"&&s!==null}o(So,"isObject");async function Ao(s){let e=await Fh(Bh.join(s,".agents","preferences.yaml"));return D(e?.value)?e.value:{}}o(Ao,"readProjectPreferences");async function Fh(s){let e;try{e=await Dh(s,"utf8")}catch(n){if(lt(n))return null;throw n}let t;try{t=(0,vo.parse)(e)}catch(n){throw gt(`${s}: malformed YAML`,n)}return{value:t??{}}}o(Fh,"readOptionalYaml");function To(s,e){let t=[],n=[];for(let r=0;r<s.length;r+=1){let i=s[r];if(i===void 0)continue;if(!i.startsWith("--")){t.push(i);continue}let a=Kh(i,e);if(a===null)throw new Error(`unknown flag: ${i}`);let{spec:l,inlineValue:c}=a;if(!l.takesValue){if(c!==null)throw new Error(`--${l.name} does not take a value`);n.push({name:l.name,value:null});continue}if(c!==null){n.push({name:l.name,value:c});continue}let u=s[r+1]??null;if(u===null||u.startsWith("--"))throw new Error(`--${l.name} requires a value`);n.push({name:l.name,value:u}),r+=1}return{positionals:t,flags:n}}o(To,"scanFlags");function xo(s){let e={};for(let{name:t,value:n}of s)n!==null&&(e[t]=n);return e}o(xo,"valueFlagMap");function Kh(s,e){for(let t of e)for(let n of[t.name,...t.aliases??[]]){let r=`--${n}`;if(s===r)return{spec:t,inlineValue:null};if(s.startsWith(`${r}=`))return{spec:t,inlineValue:s.slice(r.length+1)}}return null}o(Kh,"matchFlag");import{readFile as Uh}from"node:fs/promises";import Yh from"node:path";var ar={markers:{breaking:{emoji:"\u{1F6A8}",label:"Breaking"}},tiers:["public","internal","process"],types:[{aliases:["feature"],breakingPolicy:"optional",description:"A change that gives consumers a new capability or extends an existing one.",emoji:"\u{1F389}",key:"feat",label:"Features",tier:"public",trackerLabel:"feature"},{aliases:[],breakingPolicy:"optional",description:"A change that removes a capability or surface on which consumers depend.",emoji:"\u{1FAA6}",key:"drop",label:"Removed",tier:"public",trackerLabel:"removal"},{aliases:[],breakingPolicy:"forbidden",description:"A change that marks a capability or surface for removal while the capability or surface keeps working.",emoji:"\u{1F5D1}\uFE0F",key:"deprecate",label:"Deprecated",tier:"public",trackerLabel:"deprecation"},{aliases:["bugfix"],breakingPolicy:"optional",description:"A change that corrects behavior that consumers meet and that differs from what was intended.",emoji:"\u{1F41B}",key:"fix",label:"Bug fixes",tier:"public",trackerLabel:"fix"},{aliases:["security"],breakingPolicy:"optional",description:"A change that closes a vulnerability or hardens a consumer-facing surface against attack.",emoji:"\u{1F512}",key:"sec",label:"Security",tier:"public",trackerLabel:"security"},{aliases:["performance"],breakingPolicy:"optional",description:"A change that reduces the time, memory, or other resources that consumer-facing work uses, without changing its result.",emoji:"\u26A1",key:"perf",label:"Performance",tier:"public",trackerLabel:"performance"},{aliases:["utility"],breakingPolicy:"forbidden",description:"A change that adds, extends, or repairs a capability that consumers do not use directly, such as a helper or an internal module.",emoji:"\u{1F3D7}\uFE0F",key:"internal",label:"Internal features",tier:"internal",trackerLabel:"internal"},{aliases:[],breakingPolicy:"forbidden",description:"A change that restructures existing code without changing its behavior.",emoji:"\u267B\uFE0F",key:"refactor",label:"Refactoring",tier:"internal",trackerLabel:"refactoring"},{aliases:["test"],breakingPolicy:"forbidden",description:"A change confined to tests, test fixtures, or test helpers, including one that unblocks a build or a type check.",emoji:"\u{1F9EA}",key:"tests",label:"Tests",tier:"internal",trackerLabel:"tests"},{aliases:[],breakingPolicy:"forbidden",description:"A change to the tools used to develop the project: build, lint, formatting, and release configuration, and development scripts.",emoji:"\u2699\uFE0F",key:"tooling",label:"Tooling",tier:"process",trackerLabel:"tooling"},{aliases:[],breakingPolicy:"forbidden",description:"A change to continuous-integration workflows and their configuration.",emoji:"\u{1F477}",key:"ci",label:"CI",tier:"process",trackerLabel:"ci"},{aliases:["dep"],breakingPolicy:"forbidden",description:"A change that adds, removes, or upgrades a dependency, including its lockfile and version-catalog entries.",emoji:"\u{1F4E6}",key:"deps",label:"Dependencies",tier:"process",trackerLabel:"dependencies"},{aliases:[],breakingPolicy:"forbidden",description:"A change to guidance on working in the repository itself, such as its `AGENTS.md` or a repo-local skill, or to the repository's agent configuration.",emoji:"\u{1F916}",key:"ai",label:"Agentic support",tier:"process",trackerLabel:"ai"},{aliases:["doc"],breakingPolicy:"forbidden",description:"A change to documentation for human readers, such as a README, a guide, or a code comment.",emoji:"\u{1F4DA}",key:"docs",label:"Documentation",tier:"process",trackerLabel:"documentation"},{aliases:[],breakingPolicy:"forbidden",description:"A change to formatting alone, such as whitespace or line wrapping, that leaves the content unchanged.",emoji:"\u{1F3A8}",excludedFromChangelog:!0,key:"fmt",label:"Formatting",tier:"process",trackerLabel:"formatting"}],version:"1.3.0"};function No(s=ar){return{...s,types:s.types.map(({trackerLabel:e,...t})=>t)}}o(No,"buildWorkTypesDocument");async function Eo(s){let e=await Vh(s);if(e===null)return null;let t=[];for(let r of e.types)!D(r)||typeof r.key!="string"||typeof r.tier!="string"||t.push({workType:{key:r.key,tier:r.tier},aliases:Jh(r.aliases)});let n=new Map;for(let{workType:r,aliases:i}of t)for(let a of i)n.set(a,r);for(let{workType:r}of t)n.set(r.key,r);return n}o(Eo,"loadWorkTypes");function Oo(s,e){let t=s.endsWith("!"),n=e.get(t?s.slice(0,-1):s);return n===void 0?null:{workType:n,breaking:t}}o(Oo,"resolveWorkType");function qo(s){return!D(s)||!Array.isArray(s.types)?null:{markers:s.markers,tiers:s.tiers,types:s.types}}o(qo,"parseTaxonomy");function Jh(s){return Array.isArray(s)?s.filter(e=>typeof e=="string"):[]}o(Jh,"readAliases");async function Vh(s){return s===void 0?qo(No()):await zh(s)}o(Vh,"readTaxonomy");async function zh(s){let e;try{e=await Uh(Yh.join(s,"work-types.json"),"utf8")}catch(n){if(wo(n))return null;throw n}let t;try{t=JSON.parse(e)}catch{return null}return qo(t)}o(zh,"readTaxonomyFile");import{execFileSync as Wh}from"node:child_process";import Lo from"node:process";function Po(s={}){let{cwd:e}=s;if(e!=null&&e!=="")return e;let t=s.startDir??Lo.cwd(),n=Qh(t);return"root"in n?n.root:(Lo.stderr.write(`resolve-project-root: git could not resolve the repository root (${n.failure}); anchoring at ${t}. Repo-relative paths may be wrong if the working directory changed.
|
|
140
|
+
`),t)}o(Po,"resolveProjectRoot");function Gh(s){let e=D(s)?s.stderr:void 0;return typeof e=="string"&&e.trim()!==""?e.trim():s instanceof Error?s.message:String(s)}o(Gh,"describeGitFailure");function Qh(s){try{let t=Wh("git",["-C",s,"rev-parse","--show-toplevel"],{encoding:"utf8",stdio:["ignore","pipe","pipe"]}).trim();return t===""?{failure:"git returned an empty working-tree root"}:{root:t}}catch(e){return{failure:Gh(e)}}}o(Qh,"tryGitToplevel");function ur(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}o(ur,"L");var me=ur();function jo(s){me=s}o(jo,"G");var ht={exec:o(()=>null,"exec")};function O(s,e=""){let t=typeof s=="string"?s:s.source,n={replace:o((r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(R.caret,"$1"),t=t.replace(r,a),n},"replace"),getRegex:o(()=>new RegExp(t,e),"getRegex")};return n}o(O,"d");var Hh=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),R={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:o(s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),"listItemRegex"),nextBulletRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),"nextBulletRegex"),hrRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),"hrRegex"),fencesBeginRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}(?:\`\`\`|~~~)`),"fencesBeginRegex"),headingBeginRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}#`),"headingBeginRegex"),htmlBeginRegex:o(s=>new RegExp(`^ {0,${Math.min(3,s-1)}}<(?:[a-z].*>|!--)`,"i"),"htmlBeginRegex")},Zh=/^(?:[ \t]*(?:\n|$))+/,Xh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ep=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,pt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,fr=/(?:[*+-]|\d{1,9}[.)])/,Do=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Bo=O(Do).replace(/bull/g,fr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),sp=O(Do).replace(/bull/g,fr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),hr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,np=/^[^\n]+/,pr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,rp=O(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ip=O(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,fr).getRegex(),bs="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",dr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ap=O("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",dr).replace("tag",bs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fo=O(hr).replace("hr",pt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bs).getRegex(),op=O(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Fo).getRegex(),gr={blockquote:op,code:Xh,def:rp,fences:ep,heading:tp,hr:pt,html:ap,lheading:Bo,list:ip,newline:Zh,paragraph:Fo,table:ht,text:np},$o=O("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",pt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bs).getRegex(),lp={...gr,lheading:sp,table:$o,paragraph:O(hr).replace("hr",pt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$o).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bs).getRegex()},cp={...gr,html:O(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",dr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ht,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:O(hr).replace("hr",pt).replace("heading",` *#{1,6} *[^
|
|
141
|
+
]`).replace("lheading",Bo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},up=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fp=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ko=/^( {2,}|\\)\n(?!\s*$)/,hp=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ks=/[\p{P}\p{S}]/u,mr=/[\s\p{P}\p{S}]/u,Uo=/[^\s\p{P}\p{S}]/u,pp=O(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,mr).getRegex(),Yo=/(?!~)[\p{P}\p{S}]/u,dp=/(?!~)[\s\p{P}\p{S}]/u,gp=/(?:[^\s\p{P}\p{S}]|~)/u,mp=O(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Hh?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Jo=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,yp=O(Jo,"u").replace(/punct/g,ks).getRegex(),bp=O(Jo,"u").replace(/punct/g,Yo).getRegex(),Vo="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kp=O(Vo,"gu").replace(/notPunctSpace/g,Uo).replace(/punctSpace/g,mr).replace(/punct/g,ks).getRegex(),wp=O(Vo,"gu").replace(/notPunctSpace/g,gp).replace(/punctSpace/g,dp).replace(/punct/g,Yo).getRegex(),Sp=O("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Uo).replace(/punctSpace/g,mr).replace(/punct/g,ks).getRegex(),vp=O(/\\(punct)/,"gu").replace(/punct/g,ks).getRegex(),Ap=O(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Tp=O(dr).replace("(?:-->|$)","-->").getRegex(),xp=O("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Tp).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),gs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Np=O(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",gs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zo=O(/^!?\[(label)\]\[(ref)\]/).replace("label",gs).replace("ref",pr).getRegex(),Wo=O(/^!?\[(ref)\](?:\[\])?/).replace("ref",pr).getRegex(),Ep=O("reflink|nolink(?!\\()","g").replace("reflink",zo).replace("nolink",Wo).getRegex(),Co=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,yr={_backpedal:ht,anyPunctuation:vp,autolink:Ap,blockSkip:mp,br:Ko,code:fp,del:ht,emStrongLDelim:yp,emStrongRDelimAst:kp,emStrongRDelimUnd:Sp,escape:up,link:Np,nolink:Wo,punctuation:pp,reflink:zo,reflinkSearch:Ep,tag:xp,text:hp,url:ht},Op={...yr,link:O(/^!?\[(label)\]\((.*?)\)/).replace("label",gs).getRegex(),reflink:O(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",gs).getRegex()},or={...yr,emStrongRDelimAst:wp,emStrongLDelim:bp,url:O(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Co).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:O(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Co).getRegex()},qp={...or,br:O(Ko).replace("{2,}","*").getRegex(),text:O(or.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ds={normal:gr,gfm:lp,pedantic:cp},ct={normal:yr,gfm:or,breaks:qp,pedantic:Op},Lp={"&":"&","<":"<",">":">",'"':""","'":"'"},Io=o(s=>Lp[s],"ge");function z(s,e){if(e){if(R.escapeTest.test(s))return s.replace(R.escapeReplace,Io)}else if(R.escapeTestNoEncode.test(s))return s.replace(R.escapeReplaceNoEncode,Io);return s}o(z,"w");function _o(s){try{s=encodeURI(s).replace(R.percentDecode,"%")}catch{return null}return s}o(_o,"J");function Ro(s,e){let t=s.replace(R.findPipe,(i,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(R.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(R.slashPipe,"|");return n}o(Ro,"V");function ut(s,e,t){let n=s.length;if(n===0)return"";let r=0;for(;r<n;){let i=s.charAt(n-r-1);if(i===e&&!t)r++;else if(i!==e&&t)r++;else break}return s.slice(0,n-r)}o(ut,"z");function Pp(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])t++;else if(s[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}o(Pp,"fe");function Mo(s,e,t,n,r){let i=e.href,a=e.title||null,l=s[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let c={type:s[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:a,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,c}o(Mo,"me");function $p(s,e,t){let n=s.match(t.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`
|
|
142
|
+
`).map(i=>{let a=i.match(t.other.beginningSpace);if(a===null)return i;let[l]=a;return l.length>=r.length?i.slice(r.length):i}).join(`
|
|
143
|
+
`)}o($p,"Ye");var ms=class{static{o(this,"y")}options;rules;lexer;constructor(s){this.options=s||me}space(s){let e=this.rules.block.newline.exec(s);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(s){let e=this.rules.block.code.exec(s);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:ut(t,`
|
|
144
|
+
`)}}}fences(s){let e=this.rules.block.fences.exec(s);if(e){let t=e[0],n=$p(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(s){let e=this.rules.block.heading.exec(s);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let n=ut(t,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(t=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(s){let e=this.rules.block.hr.exec(s);if(e)return{type:"hr",raw:ut(e[0],`
|
|
145
|
+
`)}}blockquote(s){let e=this.rules.block.blockquote.exec(s);if(e){let t=ut(e[0],`
|
|
146
|
+
`).split(`
|
|
147
|
+
`),n="",r="",i=[];for(;t.length>0;){let a=!1,l=[],c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))l.push(t[c]),a=!0;else if(!a)l.push(t[c]);else break;t=t.slice(c);let u=l.join(`
|
|
148
|
+
`),p=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
149
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
|
|
150
|
+
${u}`:u,r=r?`${r}
|
|
151
|
+
${p}`:p;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=f,t.length===0)break;let h=i.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let g=h,y=g.raw+`
|
|
152
|
+
`+t.join(`
|
|
153
|
+
`),d=this.blockquote(y);i[i.length-1]=d,n=n.substring(0,n.length-g.raw.length)+d.raw,r=r.substring(0,r.length-g.text.length)+d.text;break}else if(h?.type==="list"){let g=h,y=g.raw+`
|
|
154
|
+
`+t.join(`
|
|
155
|
+
`),d=this.list(y);i[i.length-1]=d,n=n.substring(0,n.length-h.raw.length)+d.raw,r=r.substring(0,r.length-g.raw.length)+d.raw,t=y.substring(i.at(-1).raw.length).split(`
|
|
156
|
+
`);continue}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(s){let e=this.rules.block.list.exec(s);if(e){let t=e[1].trim(),n=t.length>1,r={type:"list",raw:"",ordered:n,start:n?+t.slice(0,-1):"",loose:!1,items:[]};t=n?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=n?t:"[*+-]");let i=this.rules.other.listItemRegex(t),a=!1;for(;s;){let c=!1,u="",p="";if(!(e=i.exec(s))||this.rules.block.hr.test(s))break;u=e[0],s=s.substring(u.length);let f=e[2].split(`
|
|
157
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),h=s.split(`
|
|
158
|
+
`,1)[0],g=!f.trim(),y=0;if(this.options.pedantic?(y=2,p=f.trimStart()):g?y=e[1].length+1:(y=e[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,p=f.slice(y),y+=e[1].length),g&&this.rules.other.blankLine.test(h)&&(u+=h+`
|
|
159
|
+
`,s=s.substring(h.length+1),c=!0),!c){let k=this.rules.other.nextBulletRegex(y),w=this.rules.other.hrRegex(y),v=this.rules.other.fencesBeginRegex(y),A=this.rules.other.headingBeginRegex(y),x=this.rules.other.htmlBeginRegex(y);for(;s;){let T=s.split(`
|
|
160
|
+
`,1)[0],E;if(h=T,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),E=h):E=h.replace(this.rules.other.tabCharGlobal," "),v.test(h)||A.test(h)||x.test(h)||k.test(h)||w.test(h))break;if(E.search(this.rules.other.nonSpaceChar)>=y||!h.trim())p+=`
|
|
161
|
+
`+E.slice(y);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(f)||A.test(f)||w.test(f))break;p+=`
|
|
162
|
+
`+h}!g&&!h.trim()&&(g=!0),u+=T+`
|
|
163
|
+
`,s=s.substring(T.length+1),f=E.slice(y)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let d=null,m;this.options.gfm&&(d=this.rules.other.listIsTask.exec(p),d&&(m=d[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:u,task:!!d,checked:m,loose:!1,text:p,tokens:[]}),r.raw+=u}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){let u=r.items[c].tokens.filter(f=>f.type==="space"),p=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));r.loose=p}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].loose=!0;return r}}html(s){let e=this.rules.block.html.exec(s);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(s){let e=this.rules.block.def.exec(s);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:n,title:r}}}table(s){let e=this.rules.block.table.exec(s);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Ro(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
164
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<t.length;a++)i.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:i.align[a]});for(let a of r)i.rows.push(Ro(a,i.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[c]})));return i}}lheading(s){let e=this.rules.block.lheading.exec(s);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(s){let e=this.rules.block.paragraph.exec(s);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
165
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(s){let e=this.rules.block.text.exec(s);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(s){let e=this.rules.inline.escape.exec(s);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(s){let e=this.rules.inline.tag.exec(s);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(s){let e=this.rules.inline.link.exec(s);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=ut(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=Pp(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let n=e[2],r="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(n);i&&(n=i[1],r=i[3])}else r=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?n=n.slice(1):n=n.slice(1,-1)),Mo(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(s,e){let t;if((t=this.rules.inline.reflink.exec(s))||(t=this.rules.inline.nolink.exec(s))){let n=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[n.toLowerCase()];if(!r){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return Mo(t,r,t[0],this.lexer,this.rules)}}emStrong(s,e,t=""){let n=this.rules.inline.emStrongLDelim.exec(s);if(!(!n||n[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!t||this.rules.inline.punctuation.exec(t))){let r=[...n[0]].length-1,i,a,l=r,c=0,u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*s.length+r);(n=u.exec(e))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){l+=a;continue}else if((n[5]||n[6])&&r%3&&!((r+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let p=[...n[0]][0].length,f=s.slice(0,r+n.index+p+a);if(Math.min(r,a)%2){let g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}let h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(s){let e=this.rules.inline.code.exec(s);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return n&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(s){let e=this.rules.inline.br.exec(s);if(e)return{type:"br",raw:e[0]}}del(s){let e=this.rules.inline.del.exec(s);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(s){let e=this.rules.inline.autolink.exec(s);if(e){let t,n;return e[2]==="@"?(t=e[1],n="mailto:"+t):(t=e[1],n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(s){let e;if(e=this.rules.inline.url.exec(s)){let t,n;if(e[2]==="@")t=e[0],n="mailto:"+t;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);t=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(s){let e=this.rules.inline.text.exec(s);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},U=class lr{static{o(this,"l")}tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||me,this.options.tokenizer=this.options.tokenizer||new ms,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:R,block:ds.normal,inline:ct.normal};this.options.pedantic?(t.block=ds.pedantic,t.inline=ct.pedantic):this.options.gfm&&(t.block=ds.gfm,this.options.breaks?t.inline=ct.breaks:t.inline=ct.gfm),this.tokenizer.rules=t}static get rules(){return{block:ds,inline:ct}}static lex(e,t){return new lr(t).lex(e)}static lexInline(e,t){return new lr(t).inlineTokens(e)}lex(e){e=e.replace(R.carriageReturn,`
|
|
166
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(R.tabCharGlobal," ").replace(R.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=t.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
|
|
167
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
168
|
+
`)?"":`
|
|
169
|
+
`)+r.raw,a.text+=`
|
|
170
|
+
`+r.text,this.inlineQueue.at(-1).src=a.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
171
|
+
`)?"":`
|
|
172
|
+
`)+r.raw,a.text+=`
|
|
173
|
+
`+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
174
|
+
`)?"":`
|
|
175
|
+
`)+r.raw,a.text+=`
|
|
176
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
177
|
+
`)?"":`
|
|
178
|
+
`)+r.raw,a.text+=`
|
|
179
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)c.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,l="";for(;e;){a||(l=""),a=!1;let c;if(this.options.extensions?.inline?.some(p=>(c=p.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);let p=t.at(-1);c.type==="text"&&p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,n,l)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let u=e;if(this.options.extensions?.startInline){let p=1/0,f=e.slice(1),h;this.options.extensions.startInline.forEach(g=>{h=g.call({lexer:this},f),typeof h=="number"&&h>=0&&(p=Math.min(p,h))}),p<1/0&&p>=0&&(u=e.substring(0,p+1))}if(c=this.tokenizer.inlineText(u)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(l=c.raw.slice(-1)),a=!0;let p=t.at(-1);p?.type==="text"?(p.raw+=c.raw,p.text+=c.text):t.push(c);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}},ys=class{static{o(this,"P")}options;parser;constructor(s){this.options=s||me}space(s){return""}code({text:s,lang:e,escaped:t}){let n=(e||"").match(R.notSpaceStart)?.[0],r=s.replace(R.endingNewline,"")+`
|
|
180
|
+
`;return n?'<pre><code class="language-'+z(n)+'">'+(t?r:z(r,!0))+`</code></pre>
|
|
181
|
+
`:"<pre><code>"+(t?r:z(r,!0))+`</code></pre>
|
|
182
|
+
`}blockquote({tokens:s}){return`<blockquote>
|
|
183
|
+
${this.parser.parse(s)}</blockquote>
|
|
184
|
+
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:e}){return`<h${e}>${this.parser.parseInline(s)}</h${e}>
|
|
185
|
+
`}hr(s){return`<hr>
|
|
186
|
+
`}list(s){let e=s.ordered,t=s.start,n="";for(let a=0;a<s.items.length;a++){let l=s.items[a];n+=this.listitem(l)}let r=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+r+i+`>
|
|
187
|
+
`+n+"</"+r+`>
|
|
188
|
+
`}listitem(s){let e="";if(s.task){let t=this.checkbox({checked:!!s.checked});s.loose?s.tokens[0]?.type==="paragraph"?(s.tokens[0].text=t+" "+s.tokens[0].text,s.tokens[0].tokens&&s.tokens[0].tokens.length>0&&s.tokens[0].tokens[0].type==="text"&&(s.tokens[0].tokens[0].text=t+" "+z(s.tokens[0].tokens[0].text),s.tokens[0].tokens[0].escaped=!0)):s.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):e+=t+" "}return e+=this.parser.parse(s.tokens,!!s.loose),`<li>${e}</li>
|
|
189
|
+
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
|
|
190
|
+
`}table(s){let e="",t="";for(let r=0;r<s.header.length;r++)t+=this.tablecell(s.header[r]);e+=this.tablerow({text:t});let n="";for(let r=0;r<s.rows.length;r++){let i=s.rows[r];t="";for(let a=0;a<i.length;a++)t+=this.tablecell(i[a]);n+=this.tablerow({text:t})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
|
|
191
|
+
<thead>
|
|
192
|
+
`+e+`</thead>
|
|
193
|
+
`+n+`</table>
|
|
194
|
+
`}tablerow({text:s}){return`<tr>
|
|
195
|
+
${s}</tr>
|
|
196
|
+
`}tablecell(s){let e=this.parser.parseInline(s.tokens),t=s.header?"th":"td";return(s.align?`<${t} align="${s.align}">`:`<${t}>`)+e+`</${t}>
|
|
197
|
+
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${z(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:e,tokens:t}){let n=this.parser.parseInline(t),r=_o(s);if(r===null)return n;s=r;let i='<a href="'+s+'"';return e&&(i+=' title="'+z(e)+'"'),i+=">"+n+"</a>",i}image({href:s,title:e,text:t,tokens:n}){n&&(t=this.parser.parseInline(n,this.parser.textRenderer));let r=_o(s);if(r===null)return z(t);s=r;let i=`<img src="${s}" alt="${t}"`;return e&&(i+=` title="${z(e)}"`),i+=">",i}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:z(s.text)}},br=class{static{o(this,"$")}strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}},Y=class cr{static{o(this,"l")}options;renderer;textRenderer;constructor(e){this.options=e||me,this.options.renderer=this.options.renderer||new ys,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new br}static parse(e,t){return new cr(t).parse(e)}static parseInline(e,t){return new cr(t).parseInline(e)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let l=i,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=c||"";continue}}let a=i;switch(a.type){case"space":{n+=this.renderer.space(a);continue}case"hr":{n+=this.renderer.hr(a);continue}case"heading":{n+=this.renderer.heading(a);continue}case"code":{n+=this.renderer.code(a);continue}case"table":{n+=this.renderer.table(a);continue}case"blockquote":{n+=this.renderer.blockquote(a);continue}case"list":{n+=this.renderer.list(a);continue}case"html":{n+=this.renderer.html(a);continue}case"def":{n+=this.renderer.def(a);continue}case"paragraph":{n+=this.renderer.paragraph(a);continue}case"text":{let l=a,c=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],c+=`
|
|
198
|
+
`+this.renderer.text(l);t?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=l||"";continue}}let a=i;switch(a.type){case"escape":{n+=t.text(a);break}case"html":{n+=t.html(a);break}case"link":{n+=t.link(a);break}case"image":{n+=t.image(a);break}case"strong":{n+=t.strong(a);break}case"em":{n+=t.em(a);break}case"codespan":{n+=t.codespan(a);break}case"br":{n+=t.br(a);break}case"del":{n+=t.del(a);break}case"text":{n+=t.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}},ft=class{static{o(this,"S")}options;block;constructor(s){this.options=s||me}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(){return this.block?U.lex:U.lexInline}provideParser(){return this.block?Y.parse:Y.parseInline}},Cp=class{static{o(this,"B")}defaults=ur();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=ys;TextRenderer=br;Lexer=U;Tokenizer=ms;Hooks=ft;constructor(...s){this.use(...s)}walkTokens(s,e){let t=[];for(let n of s)switch(t=t.concat(e.call(this,n)),n.type){case"table":{let r=n;for(let i of r.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let a of i)t=t.concat(this.walkTokens(a.tokens,e));break}case"list":{let r=n;t=t.concat(this.walkTokens(r.items,e));break}default:{let r=n;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let a=r[i].flat(1/0);t=t.concat(this.walkTokens(a,e))}):r.tokens&&(t=t.concat(this.walkTokens(r.tokens,e)))}}return t}use(...s){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(t=>{let n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),n.extensions=e),t.renderer){let r=this.defaults.renderer||new ys(this.defaults);for(let i in t.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,l=t.renderer[a],c=r[a];r[a]=(...u)=>{let p=l.apply(r,u);return p===!1&&(p=c.apply(r,u)),p||""}}n.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new ms(this.defaults);for(let i in t.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,l=t.tokenizer[a],c=r[a];r[a]=(...u)=>{let p=l.apply(r,u);return p===!1&&(p=c.apply(r,u)),p}}n.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new ft;for(let i in t.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,l=t.hooks[a],c=r[a];ft.passThroughHooks.has(i)?r[a]=u=>{if(this.defaults.async&&ft.passThroughHooksRespectAsync.has(i))return(async()=>{let f=await l.call(r,u);return c.call(r,f)})();let p=l.call(r,u);return c.call(r,p)}:r[a]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(r,u);return f===!1&&(f=await c.apply(r,u)),f})();let p=l.apply(r,u);return p===!1&&(p=c.apply(r,u)),p}}n.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,i=t.walkTokens;n.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,e){return U.lex(s,e??this.defaults)}parser(s,e){return Y.parse(s,e??this.defaults)}parseMarkdown(s){return(e,t)=>{let n={...t},r={...this.defaults,...n},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&n.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=s),r.async)return(async()=>{let a=r.hooks?await r.hooks.preprocess(e):e,l=await(r.hooks?await r.hooks.provideLexer():s?U.lex:U.lexInline)(a,r),c=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let u=await(r.hooks?await r.hooks.provideParser():s?Y.parse:Y.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(u):u})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let a=(r.hooks?r.hooks.provideLexer():s?U.lex:U.lexInline)(e,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let l=(r.hooks?r.hooks.provideParser():s?Y.parse:Y.parseInline)(a,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(a){return i(a)}}}onError(s,e){return t=>{if(t.message+=`
|
|
199
|
+
Please report this to https://github.com/markedjs/marked.`,s){let n="<p>An error occurred:</p><pre>"+z(t.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},ge=new Cp;function L(s,e){return ge.parse(s,e)}o(L,"k");L.options=L.setOptions=function(s){return ge.setOptions(s),L.defaults=ge.defaults,jo(L.defaults),L};L.getDefaults=ur;L.defaults=me;L.use=function(...s){return ge.use(...s),L.defaults=ge.defaults,jo(L.defaults),L};L.walkTokens=function(s,e){return ge.walkTokens(s,e)};L.parseInline=ge.parseInline;L.Parser=Y;L.parser=Y.parse;L.Renderer=ys;L.TextRenderer=br;L.Lexer=U;L.lexer=U.lex;L.Tokenizer=ms;L.Hooks=ft;L.parse=L;var wy=L.options,Sy=L.setOptions,vy=L.use,Ay=L.walkTokens,Ty=L.parseInline;var xy=Y.parse,Ny=U.lex;var ws=o(()=>globalThis.crypto.randomUUID(),"generateLocalId");function Ip(s){let e=s.trim().match(/^<adf>([\s\S]*?)<\/adf>$/i);if(!e)return null;let t=e[1].trim();if(t.length===0)throw new Error("<adf> tag content is empty \u2014 expected a JSON object or array");let n;try{n=JSON.parse(t)}catch{throw new Error(`Invalid JSON in <adf> tag: ${t}`)}if(Array.isArray(n))return n.map((i,a)=>{if(typeof i!="object"||i===null||Array.isArray(i))throw new Error(`ADF node must be a JSON object or array of objects (item ${a} is not an object)`);let l=i;if(typeof l.type!="string"||l.type.length===0)throw new Error('ADF node must have a "type" string property');return l});if(typeof n!="object"||n===null)throw new Error(`ADF node must be a JSON object or array, got: ${JSON.stringify(n)}`);let r=n;if(typeof r.type!="string"||r.type.length===0)throw new Error('ADF node must have a "type" string property');return r}o(Ip,"parseAdfTag");function Qo(s){let e=L.lexer(s);return{version:1,type:"doc",content:Ss(e)}}o(Qo,"markdownToAdf");function Ss(s){return s?s.map(e=>{switch(e.type){case"paragraph":return kr(e.tokens);case"heading":return{type:"heading",attrs:{level:e.depth},content:H(e.tokens)};case"list":return e.items.every(n=>n.task)&&e.items.some(n=>n.task)?{type:"taskList",attrs:{localId:ws()},content:e.items.map(n=>Sr(n))}:{type:e.ordered?"orderedList":"bulletList",...e.ordered?{attrs:{order:e.start||1}}:{},content:e.items.map(n=>wr(n))};case"code":return{type:"codeBlock",attrs:{language:e.lang||"text"},content:[{type:"text",text:e.text}]};case"blockquote":return{type:"blockquote",content:Ss(e.tokens)};case"hr":return{type:"rule"};case"table":return _p(e);case"html":{let n=Ip(e.raw);return n||null}default:return null}}).filter(Boolean).flat():[]}o(Ss,"tokensToAdf");function Go(s){return{type:"mediaSingle",attrs:{layout:"center"},content:[{type:"media",attrs:{type:"external",url:s.href,alt:s.text||""}}]}}o(Go,"createMediaNode");function _p(s){let e=s.header.map(r=>({type:"tableHeader",content:kr(r.tokens)})),t=s.rows.map(r=>({type:"tableRow",content:r.map(i=>{let a=kr(i.tokens);return a.length===0&&a.push({type:"paragraph",content:[{type:"text",text:" "}]}),{type:"tableCell",content:a}})})),n=[];return e.length&&n.push({type:"tableRow",content:e}),{type:"table",content:n.concat(t)}}o(_p,"processTable");function kr(s){if(!s)return[];if(s.length===1&&s[0]?.type==="image")return[Go(s[0])];let e=[],t=[];for(let n=0;n<s.length;n++){let r=s[n];r?.type==="image"?(t.length&&(e.push({type:"paragraph",content:H(t)}),t=[]),e.push(Go(r))):t.push(r)}return t.length&&e.push({type:"paragraph",content:H(t)}),e}o(kr,"processParagraph");function wr(s){let e=[],t=[];return(s.tokens||[]).forEach(n=>{if(n.type==="text"||n.type==="em"||n.type==="strong"||n.type==="del"||n.type==="link"||n.type==="codespan")t.push(n);else if(t.length&&(e.push({type:"paragraph",content:H(t)}),t=[]),n.type==="list")n.items.every(i=>i.task)&&n.items.some(i=>i.task)?e.push({type:"taskList",attrs:{localId:ws()},content:n.items.map(i=>Sr(i))}):e.push({type:n.ordered?"orderedList":"bulletList",...n.ordered?{attrs:{order:n.start||1}}:{},content:n.items.map(i=>wr(i))});else{let r=Ss([n]);r.length&&e.push(...r)}}),t.length&&e.push({type:"paragraph",content:H(t)}),{type:"listItem",content:e}}o(wr,"processListItem");function Sr(s){let e=[],t=[];return(s.tokens||[]).forEach(n=>{if(n.type==="text"||n.type==="em"||n.type==="strong"||n.type==="del"||n.type==="link"||n.type==="codespan")t.push(n);else if(t.length&&(e.push(...H(t)),t=[]),n.type==="list")n.items.every(i=>i.task)&&n.items.some(i=>i.task)?e.push({type:"taskList",attrs:{localId:ws()},content:n.items.map(i=>Sr(i))}):e.push({type:n.ordered?"orderedList":"bulletList",...n.ordered?{attrs:{order:n.start||1}}:{},content:n.items.map(i=>wr(i))});else{let r=Ss([n]);r.length&&e.push(...r)}}),t.length&&e.push(...H(t)),{type:"taskItem",attrs:{localId:ws(),state:s.checked?"DONE":"TODO"},content:e}}o(Sr,"processTaskItem");function ye(s){return s.tokens?.length===1&&s.tokens[0]&&"text"in s.tokens[0]?ye(s.tokens[0]):"text"in s?s.text.replace(/\n$/,"").replace(/\n/g," ").replace(/\s+/g," "):""}o(ye,"getSafeText");function Pe(s,e={}){s.type==="em"&&!e.em&&(e.em={type:"em"}),s.type==="strong"&&!e.strong&&(e.strong={type:"strong"}),s.type==="del"&&!e.strike&&(e.strike={type:"strike"}),s.type==="link"&&(e.link={type:"link",attrs:{href:s.href}}),s.type==="codespan"&&!e.code&&(e.code={type:"code"});let t=s.tokens?.[0],n=s.tokens?.length??0;if(t&&n===1)return Pe(t,e);let r=Object.values(e);return e.code?r.filter(i=>i.type==="link"||i.type==="code"):r}o(Pe,"getMarks");function H(s){return s?s.flatMap(e=>{switch(e.type){case"text":return e.tokens?H(e.tokens):[{type:"text",text:ye(e),...e.tokens?{content:H(e.tokens)}:{}}];case"em":return(e.tokens??[]).map(t=>({type:"text",text:ye(t),marks:Pe(t,{em:{type:"em"}})}));case"strong":return(e.tokens??[]).map(t=>({type:"text",text:ye(t),marks:Pe(t,{strong:{type:"strong"}})}));case"del":return(e.tokens??[]).map(t=>({type:"text",text:ye(t),marks:Pe(t,{strike:{type:"strike"}})}));case"link":return[{type:"text",text:ye(e),marks:Pe(e)}];case"codespan":return[{type:"text",text:ye(e),marks:Pe(e)}];case"escape":return[{type:"text",text:e.text}];case"br":return[{type:"hardBreak"}];default:return[]}}).filter(e=>!(e.type==="text"&&!e.text)):[]}o(H,"inlineToAdf");function vr(s){return Qo(s)}o(vr,"convertMarkdownToAdf");async function Ho(s,e){let t=[],n=!1;if(s.parent!==void 0){let l=await e(["jira","workitem","view",s.parent]);l.exitCode!==0&&(n=!0,t.push(`parent ${s.parent} rejected by acli (exit ${l.exitCode}); creating without it: ${l.stderr.trim()}`))}let r=["jira","workitem","create","--project",s.projectKey,"--type",s.issueType,"--summary",s.summary,"--description-file",s.adfPath,"--json"];s.parent!==void 0&&!n&&r.push("--parent",s.parent);let i=await e(r);if(i.exitCode!==0)return t.push(`acli jira workitem create exited ${i.exitCode}; check Jira before creating again: ${i.stderr.trim()}`),{diagnostics:t,ok:!1,result:{key:null,parentSkipped:n,rawOutput:i.stdout}};let a=Rp(i.stdout);return a===null&&t.push("could not read a key from the acli create output; read it from rawOutput and do not create again"),{diagnostics:t,ok:a!==null,result:{key:a,parentSkipped:n,rawOutput:i.stdout}}}o(Ho,"createWorkItem");function Rp(s){let e;try{e=JSON.parse(s)}catch{return null}return D(e)&&typeof e.key=="string"&&e.key!==""?e.key:null}o(Rp,"parseKey");function Zo(s){let e=Tr(Tr(s,"integrations"),"jira","integrations."),t=Tr(s,"project"),n={},r=e.issue_types;if(r!=null){if(!D(r))throw new Error("preferences: 'integrations.jira.issue_types' must be an object");for(let[i,a]of Object.entries(r))n[i]=Ar(a,`integrations.jira.issue_types.${i}`)??""}return{issueTypes:n,projectKey:Ar(e.project_key,"integrations.jira.project_key"),ticketRefPrefix:Ar(t.ticket_ref_prefix,"project.ticket_ref_prefix")}}o(Zo,"readJiraPreferences");function Xo(s,e,t){let n=Oo(s,t);if(n===null)throw new Error(`unknown work type '${s}'`);let r=xr(e.projectKey)??Mp(e.ticketRefPrefix);return r===void 0?{fallback:"no-project-key",warning:"Jira work item not created: neither integrations.jira.project_key nor project.ticket_ref_prefix is set."}:{issueType:jp(n.workType.key,e.issueTypes,t),projectKey:r}}o(Xo,"resolveTarget");function Mp(s){return xr(s?.replace(/[^\dA-Za-z]+$/,""))}o(Mp,"deriveKeyFromPrefix");function xr(s){return s===void 0||s===""?void 0:s}o(xr,"nonEmpty");function Ar(s,e){if(s!=null){if(typeof s!="string")throw new TypeError(`preferences: '${e}' must be a string`);return s}}o(Ar,"readString");function Tr(s,e,t=""){let n=s[e];if(n==null)return{};if(!D(n))throw new Error(`preferences: '${t}${e}' must be an object`);return n}o(Tr,"readSection");function jp(s,e,t){for(let[n,r]of Object.entries(e))if(n!=="default"&&t.get(n)?.key===s&&r!=="")return r;return xr(e.default)??"Task"}o(jp,"resolveIssueType");var zp=Vp(Dp),Wp=`usage:
|
|
200
|
+
manage-jira-ticket resolve-target --work-type <type>
|
|
201
|
+
manage-jira-ticket convert-body --body-file <md> --out <path>
|
|
202
|
+
manage-jira-ticket create --summary <text> --body-file <md> --work-type <type> [--parent <key>]`;async function Gp(){try{let[s,...e]=W.argv.slice(2);switch(s){case"convert-body":await Zp(e);break;case"create":await Xp(e);break;case"resolve-target":await ed(e);break;default:throw new Error(s===void 0?"missing subcommand":`unknown subcommand '${s}'`)}}catch(s){W.stderr.write(`manage-jira-ticket: ${ke(s)}
|
|
203
|
+
${Wp}
|
|
204
|
+
`),W.exit(1)}}o(Gp,"main");Qp()&&await Gp();function Qp(){let s=W.argv[1];if(s===void 0)return!1;try{return el(Jp(import.meta.url))===el(s)}catch(e){return W.stderr.write(`manage-jira-ticket: warning: could not determine entry point: ${ke(e)}
|
|
205
|
+
`),!1}}o(Qp,"isEntryPoint");function Er(s,e,t){let{flags:n,positionals:r}=To(s,e);if(r.length>0)throw new Error(`unexpected argument: ${r.join(" ")}`);let i=xo(n);for(let a of t)if(i[a]===void 0||i[a]==="")throw new Error(`--${a} is required`);return i}o(Er,"parseValues");async function sl(s){try{let e=await Up(s);if(e.isFile()&&e.size>0)return await Fp(s,"utf8")}catch(e){if(!lt(e))throw e}throw new Error(`Body file missing or empty: ${s}`)}o(sl,"readBody");async function nl(s){let e=await Ao(Po()),t=await Eo();if(t===null)throw new Error("the work-type taxonomy could not be read");return Xo(s,Zo(e),t)}o(nl,"readTarget");async function Hp(s){try{let{stderr:e,stdout:t}=await zp("acli",s,{maxBuffer:16777216});return{exitCode:0,stderr:e,stdout:t}}catch(e){if(lt(e))throw new Error("acli is not installed or not on PATH",{cause:e});if(D(e)&&typeof e.code=="number"&&typeof e.stderr=="string"&&typeof e.stdout=="string")return{exitCode:e.code,stderr:e.stderr,stdout:e.stdout};throw e}}o(Hp,"runAcli");async function Zp(s){let e=Er(s,[{name:"body-file",takesValue:!0},{name:"out",takesValue:!0}],["body-file","out"]),t=Nr.resolve(e.out??""),n=vr(await sl(e["body-file"]??""));await tl(t,`${JSON.stringify(n)}
|
|
206
|
+
`),vs({adfPath:t})}o(Zp,"runConvertBody");async function Xp(s){let e=Er(s,[{name:"body-file",takesValue:!0},{name:"parent",takesValue:!0},{name:"summary",takesValue:!0},{name:"work-type",takesValue:!0}],["body-file","summary","work-type"]),t=await sl(e["body-file"]??""),n=await nl(e["work-type"]??"");"fallback"in n&&(vs(n),W.stderr.write(`manage-jira-ticket: ${n.warning}
|
|
207
|
+
`),W.exit(1));let r=await Bp(Nr.join(Yp(),"manage-jira-ticket-"));try{let i=Nr.join(r,"description.json");await tl(i,JSON.stringify(vr(t)));let a=e.parent===""?void 0:e.parent,l=await Ho({...n,adfPath:i,parent:a,summary:e.summary??""},Hp);for(let c of l.diagnostics)W.stderr.write(`manage-jira-ticket: ${c}
|
|
208
|
+
`);vs(l.result),l.ok||(W.exitCode=1)}finally{await Kp(r,{force:!0,recursive:!0})}}o(Xp,"runCreate");async function ed(s){let e=Er(s,[{name:"work-type",takesValue:!0}],["work-type"]);vs(await nl(e["work-type"]??""))}o(ed,"runResolveTarget");function vs(s){W.stdout.write(`${JSON.stringify(s,null,2)}
|
|
209
|
+
`)}o(vs,"writeJson");
|