fix(webui): bind the container runtime document's keys, drop the blank Advanced page

ContainerRuntimePage still bound the Go field names the document carried
before archie-core-qna6 gave container-runtime-policies its own snake_case
shape. Every control read a key the document does not hold, so the fields
rendered empty and DurationInput warned on each mount; the page's Profiles
section wrote to a key the decoder drops. Bind image, max_concurrency,
max_uptime, volume_ttl, pull_policy and network, drop the dead Profiles
section (named profiles live in the agent-profiles resource, filed as
archie-core-x0wk), and pin the key list in a test the migration lacked.

Settings -> Advanced rendered nothing in any deployment: its only card needs
the sandbox dangerous-command authority, which has no implementation
(archie-core-sod1). Drop it from the sidebar, the router and the gateway's
dashboard page index; the page and its components stay in the tree for sod1.

Register CardAction in SetupPanel and EmptyDescription in TaskLogs, which Vue
was resolving to nothing, so the setup percentage and the log empty-state
descriptions render again.
This commit is contained in:
sam committed 2026-10-04 20:51:57 +11:00
1 parent 23636d6120
commit be3e78abc2
9 files changed
+148 -158

No files matched your search

-1
View File
@@ -47,7 +47,6 @@ var dashboardPages = []DashboardPage{
{Path: "/settings/plugins", Label: "Plugins", Description: "Directories Archie loads extensions from at startup."},
{Path: "/settings/container-runtime", Label: "Container runtime", Description: "The containers agents run in."},
{Path: "/settings/harness", Label: "Harness", Description: "OAuth credential bindings and the Kit setup terminal."},
{Path: "/settings/advanced", Label: "Advanced", Description: "Actions that stop or roll back archied."},
}
// DashboardPages returns a copy of the dashboard page registry.
+1 -1
View File
@@ -1,2 +1,2 @@
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scrollbar-thumb:#0000;--tw-scrollbar-track:#0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--scroll-fade-t:0;--scroll-fade-b:0;--scroll-fade-s:0;--scroll-fade-e:0;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-greek-wght-normal.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-ext-400-normal.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-ext-400-normal.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-400-normal.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-400-normal.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-vietnamese-400-normal.woff2)format("woff2"),url(/assets/ibm-plex-mono-vietnamese-400-normal.woff)fLine truncated
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:"";--tw-scrollbar-thumb:#0000;--tw-scrollbar-track:#0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--scroll-fade-t:0;--scroll-fade-b:0;--scroll-fade-s:0;--scroll-fade-e:0;--scroll-fade-mask:initial;--shimmer-image:initial;--shimmer-text-fill:initial}}}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-cyrillic-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-cyrillic-wght-normal.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-greek-wght-normal.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-vietnamese-wght-normal.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-latin-ext-wght-normal.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:IBM Plex Sans Variable;font-style:normal;font-display:swap;font-weight:100 700;src:url(/assets/ibm-plex-sans-latin-wght-normal.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-ext-400-normal.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-ext-400-normal.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-cyrillic-400-normal.woff2)format("woff2"),url(/assets/ibm-plex-mono-cyrillic-400-normal.woff)format("woff");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:IBM Plex Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/ibm-plex-mono-vietnamese-400-normal.woff2)format("woff2"),url(/assets/ibm-plex-mono-vietnamese-400-normal.woff)fLine truncated
+57 -57
View File
@@ -17,58 +17,58 @@ Defaulting to \`null\`.`),null)}function zS(e){return LS(e)&&!Number.isNaN(e)&&e
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:GE(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>GE(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=qE(c),u=e+1<n.length?qE(n[e+1]):null;if(l&&u&&JE(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=qE(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>GE(e)),rows:r.map(e=>e.map(e=>GE(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:GE(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:GE(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function qE(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function JE(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var YE={class:`[overflow-wrap:anywhere]`},XE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},ZE={class:`font-mono text-[0.85em]`},QE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},$E={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},eD={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},tD={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},nD={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},rD={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},iD={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},aD={key:8,class:`mb-2.5 last:mb-0`},oD=M({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=G(()=>KE(t.text));return(e,t)=>(L(),R(`div`,YE,[(L(!0),R(I,null,P(n.value,(e,t)=>(L(),R(I,{key:t},[e.kind===`pre`?(L(),R(`pre`,XE,[B(`code`,ZE,D(e.code),1)])):e.kind===`table`?(L(),R(`table`,QE,[B(`thead`,null,[B(`tr`,null,[(L(!0),R(I,null,P(e.head,(e,t)=>(L(),R(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[V(UE,{inline:e},null,8,[`inline`])]))),128))])]),B(`tbody`,null,[(L(!0),R(I,null,P(e.rows,(e,t)=>(L(),R(`tr`,{key:t},[(L(!0),R(I,null,P(e,(e,t)=>(L(),R(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[V(UE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(L(),R(`blockquote`,$E,[V(UE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(L(),R(`h1`,eD,[V(UE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(L(),R(`h2`,tD,[V(UE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(L(),R(`h3`,nD,[V(UE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(L(),R(`ul`,rD,[(L(!0),R(I,null,P(e.items,(e,t)=>(L(),R(`li`,{key:t},[V(UE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(L(),R(`ol`,iD,[(L(!0),R(I,null,P(e.items,(e,t)=>(L(),R(`li`,{key:t},[V(UE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(L(),R(`p`,aD,[V(UE,{inline:e.inline},null,8,[`inline`])])):U(``,!0)],64))),128))]))}}),sD={class:`truncate`},cD=M({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=pa(`RouterLink`);return L(),z(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:A(()=>[V(k(yd),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),B(`span`,sD,D(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),lD={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},uD={class:`font-semibold text-foreground`},dD={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},fD=M({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=G(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=G(()=>t.tool.parameters||t.tool.Parameters||``),i=G(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=G(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(L(),z(cD,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(L(),R(`div`,lD,[V(k(of),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),B(`span`,uD,D(n.value),1),r.value?(L(),R(`code`,dD,D(r.value),1)):U(``,!0),B(`span`,{class:E(k(K)(`text-fg-muted`,i.value&&`text-danger`))},D(a.value),3)]))}}),pD={key:0,class:`mb-2 grid gap-0.5 text-xs`},mD={key:1,class:`mb-2 flex flex-wrap gap-1.5`},hD={key:3,class:`whitespace-pre-wrap`},gD=M({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(L(),R(`div`,{class:E([`flex`,e.assistant?`justify-start`:`justify-end`])},[B(`div`,{class:E(k(K)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(L(),R(`div`,pD,[(L(!0),R(I,null,P(e.tools,(t,n)=>(L(),z(fD,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):U(``,!0),e.media.length?(L(),R(`div`,mD,[(L(!0),R(I,null,P(e.media,(e,t)=>(L(),z(IE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):U(``,!0),e.assistant?(L(),z(oD,{key:2,text:e.text},null,8,[`text`])):(L(),R(`div`,hD,D(e.text),1)),F(t.$slots,`default`)],2)],2))}}),_D={class:`w-full self-center justify-self-center py-6 text-center`},vD={class:`grid gap-2`},yD=[`onClick`],bD=M({__name:`ChatEmptyState`,emits:[`proLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>HM?`${n.slice(0,HM).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var WM=[`title`],GM=M({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=G(()=>gM(n.event)),a=G(()=>UM(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=G(()=>n.event.at?wj(n.event.at):`—`);return(e,t)=>(L(),z(k(BM),{class:E(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[uu(cu(o,[`prevent`]),[`enter`]),uu(cu(o,[`prevent`]),[`space`])]},{default:A(()=>[V(k(Q),{class:`font-medium`},{default:A(()=>[H(D(n.event.kind||n.event.type||`event`),1)]),_:1}),V(k(Q),{class:`font-mono`},{default:A(()=>[H(D(i.value>0?`#${i.value}`:`—`),1)]),_:1}),V(k(Q),{class:`w-[55%] max-w-0`},{default:A(()=>[B(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},D(a.value.text),9,WM)]),_:1}),V(k(Q),null,{default:A(()=>[H(D(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),KM=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function qM(e){return(Number(e?.task_id)||0)>0}function JM(e,t){return t===`tasks`?qM(e):t!==`system`||!qM(e)}function YM(e,t){return e.filter(e=>JM(e,t))}function XM(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function ZM(e,t){return`${e}:${t??0}`}function QM(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=ZM(UM(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var $M={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},eN={class:`max-h-[28rem] overflow-y-auto`},tN=[`aria-expanded`,`aria-label`,`onClick`],nN=[`title`],rN=M({__name:`LiveActivityCard`,setup(e){let t=UD(),{activity:n,streamKind:r,streamState:i}=id(DA()),a=O(`all`),o=G(()=>YM(n.value,a.value)),s=G(()=>XM(o.value.length,a.value)),c=nn(new Set),l=G(()=>QM(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return UM(e.representative)}function p(e){return e.representative.at?wj(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(L(),z(k(_j),null,{default:A(()=>[V(k(Sj),null,{default:A(()=>[V(k(Cj),null,{default:A(()=>[...t[1]||=[H(`Live activity`,-1)]]),_:1}),V(k(vj),{class:`flex items-center gap-2`},{default:A(()=>[V(k(IM),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:k(KM)},null,8,[`modelValue`,`options`]),V(k(mj),{variant:k(r)},{default:A(()=>[H(D(k(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),V(k(yj),null,{default:A(()=>[B(`div`,$M,[B(`div`,eN,[V(k(RM),null,{default:A(()=>[V(k(VM),{class:`sticky top-0 z-10 bg-card`},{default:A(()=>[V(k(BM),null,{default:A(()=>[V(k($),null,{default:A(()=>[...t[2]||=[H(`Event`,-1)]]),_:1}),V(k($),null,{default:A(()=>[...t[3]||=[H(`Task`,-1)]]),_:1}),V(k($),null,{default:A(()=>[...t[4]||=[H(`Detail`,-1)]]),_:1}),V(k($),null,{default:A(()=>[...t[5]||=[H(`When`,-1)]]),_:1})]),_:1})]),_:1}),V(k(zM),null,{default:A(()=>[o.value.length?U(``,!0):(L(),z(k(BM),{key:0},{default:A(()=>[V(k(Q),{colspan:`4`},{default:A(()=>[V(k(oj),null,{default:A(()=>[V(k(lj),null,{default:A(()=>[V(k(fj),null,{default:A(()=>[H(D(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(L(!0),R(I,{key:1},P(l.value,e=>(L(),R(I,{key:e.key},[e.count===1?(L(),z(GM,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(L(),R(I,{key:1},[V(k(BM),{class:E(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[uu(cu(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),uu(cu(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:A(()=>[V(k(Q),{class:`font-medium`},{default:A(()=>[B(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:cu(t=>u(e.key),[`stop`])},[d(e)?(L(),z(k(Cd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(L(),z(k(wd),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),H(` `+D(e.label)+` `,1),V(k(mj),{variant:`idle`},{default:A(()=>[H(`×`+D(e.count),1)]),_:2},1024)],8,tN)]),_:2},1024),V(k(Q),{class:`font-mono`},{default:A(()=>[H(D(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),V(k(Q),{class:`w-[55%] max-w-0`},{default:A(()=>[B(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},D(f(e).text),9,nN)]),_:2},1024),V(k(Q),null,{default:A(()=>[H(D(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(L(!0),R(I,{key:0},P(e.events,(t,n)=>(L(),z(GM,{key:`${e.key}:${n}`,event:t,onOpen: Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function bP(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function xP(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function SP(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function CP(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var wP=O([]),TP=O([]),EP=O(!0),DP=O(null),OP=O(null),kP=O(!1),AP=O(null);async function jP(){try{let e=await q.eventTypes();EP.value=e.enabled!==!1,wP.value=e.event_types||[],TP.value=e.proposals||[],DP.value=null}catch(e){DP.value=e.message||String(e)}}function MP(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function NP(e){AP.value=null,OP.value=e}function PP(e){let t=HP.value.find(t=>String(t.id)===e.sample_id);NP({mode:`proposal`,id:null,source:e.source,name:``,rule:MP(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function FP(e=``){NP({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function IP(e){NP({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:MP(e.rule),headersText:``,body:``,exampleHeaders:{}})}function LP(){OP.value=null}async function RP(){let e=OP.value;if(e){kP.value=!0;try{if(e.mode===`edit`&&e.id)await q.eventTypeUpdate(e.id,{name:e.name,rule:CP(e.rule)});else{let t=e.mode===`paste`?yP(e.headersText):e.exampleHeaders;await q.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:CP(e.rule),example:{headers:t,body:e.body}})}OP.value=null,await jP()}catch(e){AP.value=e.message||String(e)}finally{kP.value=!1}}}var zP=O(null);async function BP(){let e=zP.value;if(zP.value=null,e)try{await q.eventTypeDelete(e.id),await jP()}catch(e){DP.value=e.message||String(e)}}var VP=100,HP=O([]),UP=O(!0),WP=O(null),GP=O(!0),KP=O(null);async function qP(){try{let e=await q.captures(VP);UP.value=e.enabled!==!1,HP.value=e.captures||[],WP.value=null}catch(e){WP.value=e.message||String(e)}finally{GP.value=!1}}function JP(e){let t=HP.value.find(t=>t.id===e);return t&&(KP.value=t),!!t}function YP(){HP.value.length&&(KP.value=HP.value[0])}function XP(){OA(`captures`,()=>{qP(),jP()})}var ZP=`archie.theme`,QP=`archie.density`,$P=`archie.motion`,eF=`archie.tooltips`;function tF(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function nF(e,t){try{localStorage.setItem(e,t)}catch{}}function rF(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var iF=rd(`appearance`,()=>{let e=O(tF(ZP,[`system`,`dark`,`light`],`dark`)),t=O(tF(QP,[`comfortable`,`compact`],`comfortable`)),n=O(tF($P,[`system`,`reduced`],`system`)),r=O(tF(eF,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=rF(e.value)}function o(t){e.value=t,a(),nF(ZP,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,nF(QP,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,nF($P,e)}function l(e){r.value=e,nF(eF,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),aF=M({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=yg(n,t),{tooltipsEnabled:i}=id(iF());return(e,t)=>(L(),z(k(pw),W({"data-slot":`tooltip`},k(r),{disabled:n.disabled||!k(i)}),{default:A(t=>[F(e.$slots,`default`,Ce(Es(t)))]),_:3},16,[`disabled`]))}}),oF=M({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=yg(Nw(n,`class`),r);return(e,t)=>(L(),z(k(_w),null,{default:A( Line truncated
`)}};FJ.defaultYaml={explicit:!1,version:`1.2`},FJ.defaultTags={"!!":`tag:yaml.org,2002:`};function IJ(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function LJ(e){let t=new Set;return OJ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function RJ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function zJ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=LJ(e);let a=RJ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(bJ(t.node)||SJ(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function BJ(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=BJ(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=BJ(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=BJ(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=BJ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function VJ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>VJ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!wJ(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var HJ=class{constructor(e){Object.defineProperty(this,hJ,{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(!_J(e))throw 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},o=VJ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?BJ(i,{"":o},``,o):o}},UJ=class extends HJ{constructor(e){super(lJ),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],OJ(e,{Node:(e,t)=>{(gJ(t)||wJ(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(VJ(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=WJ(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(IJ(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function WJ(e,t,n){if(gJ(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(SJ(t)){let r=0;for(let i of t.items){let t=WJ(e,i,n);t>r&&(r=t)}return r}if(yJ(t)){let r=WJ(e,t.key,n),i=WJ(e,t.value,n);return Math.max(r,i)}return 1}var GJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,KJ=class extends HJ{constructor(e){super(pJ),this.value=e}toJSON(e,t){return t?.keep?this.value:VJ(this.value,e,t)}toString(){return String(this.value)}};KJ.BLOCK_FOLDED=`BLOCK_FOLDED`,KJ.BLOCK_LITERAL=`BLOCK_LITERAL`,KJ.PLAIN=`PLAIN`,KJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,KJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var qJ=`tag:yaml.org,2002:`;function JJ(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function YJ(e,t,n){if(_J(e)&&(e=e.contents),CJ(e))return e;if(yJ(e)){let t=n.schema[dJ].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new UJ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=qJ+t.slice(2));let l=JJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new KJ(e);return c&&(c.node=t),t Line truncated
`)?eY(n,t):n.includes(`
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>HM?`${n.slice(0,HM).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var WM=[`title`],GM=M({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=G(()=>gM(n.event)),a=G(()=>UM(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=G(()=>n.event.at?wj(n.event.at):`—`);return(e,t)=>(L(),z(k(BM),{class:E(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[uu(cu(o,[`prevent`]),[`enter`]),uu(cu(o,[`prevent`]),[`space`])]},{default:A(()=>[V(k(Q),{class:`font-medium`},{default:A(()=>[H(D(n.event.kind||n.event.type||`event`),1)]),_:1}),V(k(Q),{class:`font-mono`},{default:A(()=>[H(D(i.value>0?`#${i.value}`:`—`),1)]),_:1}),V(k(Q),{class:`w-[55%] max-w-0`},{default:A(()=>[B(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},D(a.value.text),9,WM)]),_:1}),V(k(Q),null,{default:A(()=>[H(D(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),KM=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function qM(e){return(Number(e?.task_id)||0)>0}function JM(e,t){return t===`tasks`?qM(e):t!==`system`||!qM(e)}function YM(e,t){return e.filter(e=>JM(e,t))}function XM(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function ZM(e,t){return`${e}:${t??0}`}function QM(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=ZM(UM(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var $M={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},eN={class:`max-h-[28rem] overflow-y-auto`},tN=[`aria-expanded`,`aria-label`,`onClick`],nN=[`title`],rN=M({__name:`LiveActivityCard`,setup(e){let t=UD(),{activity:n,streamKind:r,streamState:i}=id(DA()),a=O(`all`),o=G(()=>YM(n.value,a.value)),s=G(()=>XM(o.value.length,a.value)),c=nn(new Set),l=G(()=>QM(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return UM(e.representative)}function p(e){return e.representative.at?wj(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(L(),z(k(_j),null,{default:A(()=>[V(k(Sj),null,{default:A(()=>[V(k(Cj),null,{default:A(()=>[...t[1]||=[H(`Live activity`,-1)]]),_:1}),V(k(vj),{class:`flex items-center gap-2`},{default:A(()=>[V(k(IM),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:k(KM)},null,8,[`modelValue`,`options`]),V(k(mj),{variant:k(r)},{default:A(()=>[H(D(k(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),V(k(yj),null,{default:A(()=>[B(`div`,$M,[B(`div`,eN,[V(k(RM),null,{default:A(()=>[V(k(VM),{class:`sticky top-0 z-10 bg-card`},{default:A(()=>[V(k(BM),null,{default:A(()=>[V(k($),null,{default:A(()=>[...t[2]||=[H(`Event`,-1)]]),_:1}),V(k($),null,{default:A(()=>[...t[3]||=[H(`Task`,-1)]]),_:1}),V(k($),null,{default:A(()=>[...t[4]||=[H(`Detail`,-1)]]),_:1}),V(k($),null,{default:A(()=>[...t[5]||=[H(`When`,-1)]]),_:1})]),_:1})]),_:1}),V(k(zM),null,{default:A(()=>[o.value.length?U(``,!0):(L(),z(k(BM),{key:0},{default:A(()=>[V(k(Q),{colspan:`4`},{default:A(()=>[V(k(oj),null,{default:A(()=>[V(k(lj),null,{default:A(()=>[V(k(fj),null,{default:A(()=>[H(D(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(L(!0),R(I,{key:1},P(l.value,e=>(L(),R(I,{key:e.key},[e.count===1?(L(),z(GM,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(L(),R(I,{key:1},[V(k(BM),{class:E(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[uu(cu(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),uu(cu(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:A(()=>[V(k(Q),{class:`font-medium`},{default:A(()=>[B(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:cu(t=>u(e.key),[`stop`])},[d(e)?(L(),z(k(Cd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(L(),z(k(wd),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),H(` `+D(e.label)+` `,1),V(k(mj),{variant:`idle`},{default:A(()=>[H(`×`+D(e.count),1)]),_:2},1024)],8,tN)]),_:2},1024),V(k(Q),{class:`font-mono`},{default:A(()=>[H(D(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),V(k(Q),{class:`w-[55%] max-w-0`},{default:A(()=>[B(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},D(f(e).text),9,nN)]),_:2},1024),V(k(Q),null,{default:A(()=>[H(D(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(L(!0),R(I,{key:0},P(e.events,(t,n)=>(L(),z(GM,{key:`${e.key}:${n}`,event:t,onOpen: Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function bP(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function xP(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function SP(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function CP(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var wP=O([]),TP=O([]),EP=O(!0),DP=O(null),OP=O(null),kP=O(!1),AP=O(null);async function jP(){try{let e=await q.eventTypes();EP.value=e.enabled!==!1,wP.value=e.event_types||[],TP.value=e.proposals||[],DP.value=null}catch(e){DP.value=e.message||String(e)}}function MP(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function NP(e){AP.value=null,OP.value=e}function PP(e){let t=HP.value.find(t=>String(t.id)===e.sample_id);NP({mode:`proposal`,id:null,source:e.source,name:``,rule:MP(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function FP(e=``){NP({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function IP(e){NP({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:MP(e.rule),headersText:``,body:``,exampleHeaders:{}})}function LP(){OP.value=null}async function RP(){let e=OP.value;if(e){kP.value=!0;try{if(e.mode===`edit`&&e.id)await q.eventTypeUpdate(e.id,{name:e.name,rule:CP(e.rule)});else{let t=e.mode===`paste`?yP(e.headersText):e.exampleHeaders;await q.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:CP(e.rule),example:{headers:t,body:e.body}})}OP.value=null,await jP()}catch(e){AP.value=e.message||String(e)}finally{kP.value=!1}}}var zP=O(null);async function BP(){let e=zP.value;if(zP.value=null,e)try{await q.eventTypeDelete(e.id),await jP()}catch(e){DP.value=e.message||String(e)}}var VP=100,HP=O([]),UP=O(!0),WP=O(null),GP=O(!0),KP=O(null);async function qP(){try{let e=await q.captures(VP);UP.value=e.enabled!==!1,HP.value=e.captures||[],WP.value=null}catch(e){WP.value=e.message||String(e)}finally{GP.value=!1}}function JP(e){let t=HP.value.find(t=>t.id===e);return t&&(KP.value=t),!!t}function YP(){HP.value.length&&(KP.value=HP.value[0])}function XP(){OA(`captures`,()=>{qP(),jP()})}var ZP=`archie.theme`,QP=`archie.density`,$P=`archie.motion`,eF=`archie.tooltips`;function tF(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function nF(e,t){try{localStorage.setItem(e,t)}catch{}}function rF(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var iF=rd(`appearance`,()=>{let e=O(tF(ZP,[`system`,`dark`,`light`],`dark`)),t=O(tF(QP,[`comfortable`,`compact`],`comfortable`)),n=O(tF($P,[`system`,`reduced`],`system`)),r=O(tF(eF,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=rF(e.value)}function o(t){e.value=t,a(),nF(ZP,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,nF(QP,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,nF($P,e)}function l(e){r.value=e,nF(eF,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),aF=M({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=yg(n,t),{tooltipsEnabled:i}=id(iF());return(e,t)=>(L(),z(k(pw),W({"data-slot":`tooltip`},k(r),{disabled:n.disabled||!k(i)}),{default:A(t=>[F(e.$slots,`default`,Ce(Es(t)))]),_:3},16,[`disabled`]))}}),oF=M({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=yg(Nw(n,`class`),r);return(e,t)=>(L(),z(k(_w),null,{default:A( Line truncated
`)}};fJ.defaultYaml={explicit:!1,version:`1.2`},fJ.defaultTags={"!!":`tag:yaml.org,2002:`};function pJ(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function mJ(e){let t=new Set;return aJ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function hJ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function gJ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=mJ(e);let a=hJ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Zq(t.node)||$q(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function _J(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=_J(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=_J(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=_J(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=_J(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function vJ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>vJ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!tJ(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var yJ=class{constructor(e){Object.defineProperty(this,Kq,{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(!Jq(e))throw 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},o=vJ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?_J(i,{"":o},``,o):o}},bJ=class extends yJ{constructor(e){super(Bq),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],aJ(e,{Node:(e,t)=>{(qq(t)||tJ(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(vJ(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=xJ(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(pJ(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function xJ(e,t,n){if(qq(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if($q(t)){let r=0;for(let i of t.items){let t=xJ(e,i,n);t>r&&(r=t)}return r}if(Xq(t)){let r=xJ(e,t.key,n),i=xJ(e,t.value,n);return Math.max(r,i)}return 1}var SJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,CJ=class extends yJ{constructor(e){super(Wq),this.value=e}toJSON(e,t){return t?.keep?this.value:vJ(this.value,e,t)}toString(){return String(this.value)}};CJ.BLOCK_FOLDED=`BLOCK_FOLDED`,CJ.BLOCK_LITERAL=`BLOCK_LITERAL`,CJ.PLAIN=`PLAIN`,CJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,CJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var wJ=`tag:yaml.org,2002:`;function TJ(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function EJ(e,t,n){if(Jq(e)&&(e=e.contents),eJ(e))return e;if(Xq(e)){let t=n.schema[Hq].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new bJ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=wJ+t.slice(2));let l=TJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new CJ(e);return c&&(c.node=t),t Line truncated
`)?jJ(n,t):n.includes(`
`)?`
`+eY(n,t):(e.endsWith(` `)?``:` `)+n,nY=`flow`,rY=`block`,iY=`quoted`;function aY(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=oY(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=oY(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+jJ(n,t):(e.endsWith(` `)?``:` `)+n,NJ=`flow`,PJ=`block`,FJ=`quoted`;function IJ(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=LJ(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=LJ(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function oY(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var sY=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),cY=e=>/^(%|---|\.\.\.)/m.test(e);function lY(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function uY(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(cY(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function LJ(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var RJ=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),zJ=e=>/^(%|---|\.\.\.)/m.test(e);function BJ(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function VJ(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(zJ(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:aY(o,a,iY,sY(t,!1))}function dY(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return uY(e,t);let n=t.indent||(cY(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:aY(r,n,nY,sY(t,!1))}function fY(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=uY;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?dY:i&&!t?uY:n?dY:uY}return r(e,t)}var pY;try{pY=RegExp(`(^|(?<!
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:IJ(o,a,FJ,RJ(t,!1))}function HJ(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return VJ(e,t);let n=t.indent||(zJ(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:IJ(r,n,NJ,RJ(t,!1))}function UJ(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=VJ;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?HJ:i&&!t?VJ:n?HJ:VJ}return r(e,t)}var WJ;try{WJ=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{pY=/\n+(?!\n|$)/g}function mY({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return fY(n,r);let l=r.indent||(r.forceBlockIndent||cY(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===KJ.BLOCK_FOLDED?!1:t===KJ.BLOCK_LITERAL||!lY(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{WJ=/\n+(?!\n|$)/g}function GJ({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return UJ(n,r);let l=r.indent||(r.forceBlockIndent||zJ(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===CJ.BLOCK_FOLDED?!1:t===CJ.BLOCK_LITERAL||!BJ(n,c,l.length);if(!n)return u?`|
`:`>
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
`&&(p=p.slice(0,-1)),p.replace(pY,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`&&(p=p.slice(0,-1)),p.replace(WJ,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=sY(r,!0);o!==`folded`&&t!==KJ.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=aY(`${v}${e}${p}`,l,rY,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function hY(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return fY(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?fY(a,t):mY(e,t,n,r);if(!s&&!u&&i!==KJ.PLAIN&&a.includes(`
`))return mY(e,t,n,r);if(cY(a)){if(c===``)return t.forceBlockIndent=!0,mY(e,t,n,r);if(s&&c===l)return fY(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return fY(a,t)}return s?d:aY(d,c,nY,sY(t,!1))}function gY(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==KJ.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=KJ.QUOTE_DOUBLE);let c=e=>{switch(e){case KJ.BLOCK_FOLDED:case KJ.BLOCK_LITERAL:return i||a?fY(o.value,t):mY(o,t,n,r);case KJ.QUOTE_DOUBLE:return uY(o.value,t);case KJ.QUOTE_SINGLE:return dY(o.value,t);case KJ.PLAIN:return hY(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function _Y(e,t){let n=Object.assign({blockQuote:!0,commentString:$J,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},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function vY(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(bJ(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function yY(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(bJ(e)||SJ(e))&&e.anchor;a&&IJ(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function bY(e,t,n,r){if(yJ(e))return e.toString(t,n,r);if(gJ(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=CJ(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=vY(t.doc.schema.tags,a);let o=yY(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):bJ(a)?gY(a,t,n,r):a.toString(t,n,r);return o?bJ(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function xY({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=CJ(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(SJ(e)||!CJ(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||SJ(e)||(bJ(e)?e.type===KJ.BLOCK_FOLDED||e.type===KJ.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=bY(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=tY(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=tY(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=tY(g,n.indent,l(f))));let _,v,y;CJ(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&bJ(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&xJ(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=bY(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${eY(e,n.indent)}`}x===``&&!n.inFlow?S===`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=RJ(r,!0);o!==`folded`&&t!==CJ.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=IJ(`${v}${e}${p}`,l,PJ,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function KJ(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return UJ(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?UJ(a,t):GJ(e,t,n,r);if(!s&&!u&&i!==CJ.PLAIN&&a.includes(`
`))return GJ(e,t,n,r);if(zJ(a)){if(c===``)return t.forceBlockIndent=!0,GJ(e,t,n,r);if(s&&c===l)return UJ(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return UJ(a,t)}return s?d:IJ(d,c,NJ,RJ(t,!1))}function qJ(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==CJ.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=CJ.QUOTE_DOUBLE);let c=e=>{switch(e){case CJ.BLOCK_FOLDED:case CJ.BLOCK_LITERAL:return i||a?UJ(o.value,t):GJ(o,t,n,r);case CJ.QUOTE_DOUBLE:return VJ(o.value,t);case CJ.QUOTE_SINGLE:return HJ(o.value,t);case CJ.PLAIN:return KJ(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function JJ(e,t){let n=Object.assign({blockQuote:!0,commentString:AJ,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},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function YJ(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(Zq(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function XJ(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Zq(e)||$q(e))&&e.anchor;a&&pJ(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function ZJ(e,t,n,r){if(Xq(e))return e.toString(t,n,r);if(qq(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=eJ(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=YJ(t.doc.schema.tags,a);let o=XJ(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):Zq(a)?qJ(a,t,n,r):a.toString(t,n,r);return o?Zq(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function QJ({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=eJ(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if($q(e)||!eJ(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||$q(e)||(Zq(e)?e.type===CJ.BLOCK_FOLDED||e.type===CJ.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=ZJ(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=MJ(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=MJ(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=MJ(g,n.indent,l(f))));let _,v,y;eJ(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&Zq(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Qq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=ZJ(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${jJ(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&SJ(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&$q(t)){let e=x[0],r=x.indexOf(`
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=tY(g,n.indent,l(y)):h&&i&&i(),g}function SY(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var CY=`<<`,wY={identify:e=>e===CY||typeof e==`symbol`&&e.description===CY,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new KJ(Symbol(CY)),{addToJSMap:EY}),stringify:()=>CY},TY=(e,t)=>(wY.identify(t)||bJ(t)&&(!t.type||t.type===KJ.PLAIN)&&wY.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===wY.tag&&e.default);function EY(e,t,n){let r=OY(e,n);if(xJ(r))for(let n of r.items)DY(e,t,n);else if(Array.isArray(r))for(let n of r)DY(e,t,n);else DY(e,t,r)}function DY(e,t,n){let r=OY(e,n);if(!vJ(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function OY(e,t){return e&&gJ(t)?t.resolve(e.doc,e):t}function kY(e,t,{key:n,value:r}){if(CJ(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(TY(e,n))EY(e,t,r);else{let i=VJ(n,``,e);if(t instanceof Map)t.set(i,VJ(r,i,e));else if(t instanceof Set)t.add(i);else{let a=AY(n,i,e),o=VJ(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function AY(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(CJ(e)&&n?.doc){let t=_Y(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),SY(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function jY(e,t,n){return new MY(YJ(e,void 0,n),YJ(t,void 0,n))}var MY=class e{constructor(e,t=null){Object.defineProperty(this,hJ,{value:fJ}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return CJ(n)&&(n=n.clone(t)),CJ(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return kY(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?xY(this,e,t,n):JSON.stringify(this)}};function NY(e,t,n){return(t.inFlow??e.flow?FY:PY)(e,t,n)}function PY({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(CJ(i))!d&&i.spaceBefore&&f.push(``),IY(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(yJ(i)){let e=CJ(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),IY(n,f,e.commentBefore,d))}d=!1;let s=bY(i,u,()=>o=null,()=>d=!0);o&&(s+=tY(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=MJ(g,n.indent,l(y)):h&&i&&i(),g}function $J(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var eY=`<<`,tY={identify:e=>e===eY||typeof e==`symbol`&&e.description===eY,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new CJ(Symbol(eY)),{addToJSMap:rY}),stringify:()=>eY},nY=(e,t)=>(tY.identify(t)||Zq(t)&&(!t.type||t.type===CJ.PLAIN)&&tY.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===tY.tag&&e.default);function rY(e,t,n){let r=aY(e,n);if(Qq(r))for(let n of r.items)iY(e,t,n);else if(Array.isArray(r))for(let n of r)iY(e,t,n);else iY(e,t,r)}function iY(e,t,n){let r=aY(e,n);if(!Yq(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function aY(e,t){return e&&qq(t)?t.resolve(e.doc,e):t}function oY(e,t,{key:n,value:r}){if(eJ(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(nY(e,n))rY(e,t,r);else{let i=vJ(n,``,e);if(t instanceof Map)t.set(i,vJ(r,i,e));else if(t instanceof Set)t.add(i);else{let a=sY(n,i,e),o=vJ(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function sY(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(eJ(e)&&n?.doc){let t=JJ(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),$J(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function cY(e,t,n){return new lY(EJ(e,void 0,n),EJ(t,void 0,n))}var lY=class e{constructor(e,t=null){Object.defineProperty(this,Kq,{value:Uq}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return eJ(n)&&(n=n.clone(t)),eJ(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return oY(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?QJ(this,e,t,n):JSON.stringify(this)}};function uY(e,t,n){return(t.inFlow??e.flow?fY:dY)(e,t,n)}function dY({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(eJ(i))!d&&i.spaceBefore&&f.push(``),pY(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(Xq(i)){let e=eJ(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),pY(n,f,e.commentBefore,d))}d=!1;let s=ZJ(i,u,()=>o=null,()=>d=!0);o&&(s+=MJ(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`}}return e?(p+=`
`+eY(l(e),c),s&&s()):d&&o&&o(),p}function FY({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(CJ(i))i.spaceBefore&&d.push(``),IY(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(yJ(i)){let e=CJ(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),IY(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=CJ(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=bY(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=tY(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function IY({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=eY(t(r),e);n.push(i.trimStart())}}function LY(e,t){let n=bJ(t)?t.value:t;for(let r of e)if(yJ(r)&&(r.key===t||r.key===n||bJ(r.key)&&r.key.value===n))return r}var RY=class extends QJ{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(dJ,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(jY(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=yJ(e)?e:!e||typeof e!=`object`||!(`key`in e)?new MY(e,e?.value):new MY(e.key,e.value);let r=LY(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);bJ(r.value)&&GJ(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=LY(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=LY(this.items,e)?.value;return(!t&&bJ(n)?n.value:n)??void 0}has(e){return!!LY(this.items,e)}set(e,t){this.add(new MY(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)kY(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!yJ(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),NY(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},zY={collection:`map`,default:!0,nodeClass:RY,tag:`tag:yaml.org,2002:map`,resolve(e,t){return vJ(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>RY.from(e,t,n)},BY=class extends QJ{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(mJ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=VY(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=VY(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&bJ(r)?r.value:r}has(e){let t=VY(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=VY(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];bJ(r)&&GJ(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(VJ(e,String(r++),t));return n}toString(e,t,n){return e?NY(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 e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(YJ(a,void 0,n))}}return i}};function VY(e){let t=bJ(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var HY={collection:`seq`,default:!0,nodeClass:BY,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return xJ(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>BY.from(e,t,n)},UY={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),gY(e,t,n,r)}},WY={identify:e=>e==null,createNode:()=>new KJ(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new KJ(null),stringify:({source:e},t)=>typeof e==`string`&&WY.test.test(e)?e:t.options.nullStr},GY={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new KJ(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&GY.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function KY({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var qY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:KY},JY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return gY({comment:e,type:t,value:s},r,i,a)}};function cX(e,t){if(xJ(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!yJ(r)){if(vJ(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new MY(new KJ(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=yJ(r)?r:new MY(r)}}else t(`Expected a sequence for this tag`);return e}function lX(e,t,n){let{replacer:r}=n,i=new BY(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(jY(o,s,n))}return i}var uX={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:cX,createNode:lX},dX=class e extends BY{constructor(){super(),this.add=RY.prototype.add.bind(this),this.delete=RY.prototype.delete.bind(this),this.get=RY.prototype.get.bind(this),this.has=RY.prototype.has.bind(this),this.set=RY.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(yJ(e)?(r=VJ(e.key,``,t),i=VJ(e.value,r,t)):r=VJ(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=lX(e,t,n),i=new this;return i.items=r.items,i}};dX.tag=`tag:yaml.org,2002:omap`;var fX={collection:`seq`,identify:e=>e instanceof Map,nodeClass:dX,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=cX(e,t),r=[];for(let{key:e}of n.items)bJ(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new dX,n)},createNode:(e,t,n)=>dX.from(e,t,n)};function pX({value:e,source:t},n){return t&&(e?mX:hX).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var mX={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new KJ(!0),stringify:pX},hX={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new KJ(!1),stringify:pX},gX={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:KY},_X={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():KY(e)}},vX={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new KJ(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:KY},yX=e=>typeof e==`bigint`||Number.isInteger(e);function bX(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function xX(e,t,n){let{value:r}=e;if(yX(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return KY(e)}var SX={identify:yX,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>bX(e,2,2,n),stringify:e=>xX(e,2,`0b`)},CX={identify:yX,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>bX(e,1,8,n),stringify:e=>xX(e,8,`0`)},wX={identify:yX,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>bX(e,0,10,n),stringify:KY},TX={identify:yX,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>bX(e,2,16,n),stringify:e=>xX(e,16,`0x`)},EX=class e extends RY{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=yJ(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new MY(e.key,null):new MY(e,null),LY(this.items,t.key)||this.items.push(t)}get(e,t){let n=LY(this.items,e);return!t&&yJ(n)?bJ(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=LY(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new MY(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 s Line truncated
`)?(n.push(`...`),n.push(eY(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(eY(a(t),``)))}return n.join(`
`+jJ(l(e),c),s&&s()):d&&o&&o(),p}function fY({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(eJ(i))i.spaceBefore&&d.push(``),pY(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(Xq(i)){let e=eJ(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),pY(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=eJ(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=ZJ(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=MJ(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function pY({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=jJ(t(r),e);n.push(i.trimStart())}}function mY(e,t){let n=Zq(t)?t.value:t;for(let r of e)if(Xq(r)&&(r.key===t||r.key===n||Zq(r.key)&&r.key.value===n))return r}var hY=class extends kJ{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(Hq,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(cY(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=Xq(e)?e:!e||typeof e!=`object`||!(`key`in e)?new lY(e,e?.value):new lY(e.key,e.value);let r=mY(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Zq(r.value)&&SJ(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=mY(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=mY(this.items,e)?.value;return(!t&&Zq(n)?n.value:n)??void 0}has(e){return!!mY(this.items,e)}set(e,t){this.add(new lY(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)oY(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!Xq(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),uY(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},gY={collection:`map`,default:!0,nodeClass:hY,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Yq(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>hY.from(e,t,n)},_Y=class extends kJ{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Gq,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=vY(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=vY(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Zq(r)?r.value:r}has(e){let t=vY(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=vY(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Zq(r)&&SJ(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(vJ(e,String(r++),t));return n}toString(e,t,n){return e?uY(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 e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(EJ(a,void 0,n))}}return i}};function vY(e){let t=Zq(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var yY={collection:`seq`,default:!0,nodeClass:_Y,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Qq(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>_Y.from(e,t,n)},bY={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),qJ(e,t,n,r)}},xY={identify:e=>e==null,createNode:()=>new CJ(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new CJ(null),stringify:({source:e},t)=>typeof e==`string`&&xY.test.test(e)?e:t.options.nullStr},SY={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new CJ(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&SY.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function CY({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var wY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:CY},TY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return qJ({comment:e,type:t,value:s},r,i,a)}};function zY(e,t){if(Qq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Xq(r)){if(Yq(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new lY(new CJ(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=Xq(r)?r:new lY(r)}}else t(`Expected a sequence for this tag`);return e}function BY(e,t,n){let{replacer:r}=n,i=new _Y(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(cY(o,s,n))}return i}var VY={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:zY,createNode:BY},HY=class e extends _Y{constructor(){super(),this.add=hY.prototype.add.bind(this),this.delete=hY.prototype.delete.bind(this),this.get=hY.prototype.get.bind(this),this.has=hY.prototype.has.bind(this),this.set=hY.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(Xq(e)?(r=vJ(e.key,``,t),i=vJ(e.value,r,t)):r=vJ(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=BY(e,t,n),i=new this;return i.items=r.items,i}};HY.tag=`tag:yaml.org,2002:omap`;var UY={collection:`seq`,identify:e=>e instanceof Map,nodeClass:HY,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=zY(e,t),r=[];for(let{key:e}of n.items)Zq(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new HY,n)},createNode:(e,t,n)=>HY.from(e,t,n)};function WY({value:e,source:t},n){return t&&(e?GY:KY).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var GY={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new CJ(!0),stringify:WY},KY={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new CJ(!1),stringify:WY},qY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:CY},JY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():CY(e)}},YY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new CJ(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:CY},XY=e=>typeof e==`bigint`||Number.isInteger(e);function ZY(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function QY(e,t,n){let{value:r}=e;if(XY(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return CY(e)}var $Y={identify:XY,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ZY(e,2,2,n),stringify:e=>QY(e,2,`0b`)},eX={identify:XY,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ZY(e,1,8,n),stringify:e=>QY(e,8,`0`)},tX={identify:XY,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ZY(e,0,10,n),stringify:CY},nX={identify:XY,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ZY(e,2,16,n),stringify:e=>QY(e,16,`0x`)},rX=class e extends hY{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=Xq(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new lY(e.key,null):new lY(e,null),mY(this.items,t.key)||this.items.push(t)}get(e,t){let n=mY(this.items,e);return!t&&Xq(n)?Zq(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=mY(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new lY(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 s Line truncated
`)?(n.push(`...`),n.push(jJ(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(jJ(a(t),``)))}return n.join(`
`)+`
`}var VX=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,hJ,{value:uJ});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 FJ({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[hJ]:{value:uJ}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=CJ(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){HX(this.contents)&&this.contents.add(e)}addIn(e,t){HX(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=LJ(this);e.anchor=!t||n.has(t)?RJ(t||`a`,n):t}return new UJ(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 e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=zJ(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=YJ(e,l,p);return o&&SJ(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new MY(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return HX(this.contents)?this.contents.delete(e):!1}deleteIn(e){return ZJ(e)?this.contents!=null&&(this.contents=null,!0):HX(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return SJ(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ZJ(e)?!t&&bJ(this.contents)?this.contents.value:this.contents:SJ(this.contents)?this.contents.getIn(e,t):void 0}has(e){return SJ(this.contents)?this.contents.has(e):!1}hasIn(e){return ZJ(e)?this.contents!==void 0:SJ(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=XJ(this.schema,[e],t):HX(this.contents)&&this.contents.set(e,t)}setIn(e,t){ZJ(e)?this.contents=t:this.contents==null?this.contents=XJ(this.schema,Array.from(e),t):HX(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 FJ({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 FJ({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new zX(Object.assign(n,t));else throw 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 o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=VJ(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?BJ(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw 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 Error(`"indent" option must be a positive integer, not ${t}`)}return BX(this,e)}};function HX(e){if(SJ(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var UX=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},WX=class extends UX{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},GX=class extends UX{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},KX=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function qX(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function JX(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(JX(t.key)||JX(t.value))return!0}return!1;default:return!0}}function YX(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&JX(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function XX(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||bJ(e)&&bJ(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var ZX=`All mapping items must start at the same column`;function QX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??RY)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=qX(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,ZX)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||JX(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,ZX);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&YX(r.indent,u,i),n.atKey=!1,XX(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=qX(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&YX(r.indent,f,i),s=c.range[2];let l=new MY(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new MY(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function $X({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??BY)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=qX(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&YX(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function eZ(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var tZ=`Block collections are not allowed within flow collections`,nZ=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function rZ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?RY:BY))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=qX(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&JX(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];yJ(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],nZ(m)&&i(r.range,`BLOCK_IN_FLOW`,tZ)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);nZ(f)&&i(g.range,`BLOCK_IN_FLOW`,tZ),n.atKey=!1;let _=qX(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?nZ(m)&&i(v.range,`BLOCK_IN_FLOW`,tZ):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new MY(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;XX(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new RY(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=eZ(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function iZ(e,t,n,r,i,a){let o=n.type===`block-map`?QX(e,t,n,r,a):n.type===`block-seq`?$X(e,t,n,r,a):rZ(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function aZ(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===RY.tagName&&s===`map`||o===BY.tagName&&s===`seq`)return iZ(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),iZ(e,t,n,i,o)}let l=iZ(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=CJ(u)?u:new KJ(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function oZ(e,t,n){let r=t.offset,i=sZ(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?KJ.BLOCK_FOLDED:KJ.BLOCK_LITERAL,o=t.source?cZ(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`}var vX=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Kq,{value:Vq});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 fJ({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Kq]:{value:Vq}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=eJ(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){yX(this.contents)&&this.contents.add(e)}addIn(e,t){yX(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=mJ(this);e.anchor=!t||n.has(t)?hJ(t||`a`,n):t}return new bJ(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 e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=gJ(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=EJ(e,l,p);return o&&$q(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new lY(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return yX(this.contents)?this.contents.delete(e):!1}deleteIn(e){return OJ(e)?this.contents!=null&&(this.contents=null,!0):yX(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return $q(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return OJ(e)?!t&&Zq(this.contents)?this.contents.value:this.contents:$q(this.contents)?this.contents.getIn(e,t):void 0}has(e){return $q(this.contents)?this.contents.has(e):!1}hasIn(e){return OJ(e)?this.contents!==void 0:$q(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=DJ(this.schema,[e],t):yX(this.contents)&&this.contents.set(e,t)}setIn(e,t){OJ(e)?this.contents=t:this.contents==null?this.contents=DJ(this.schema,Array.from(e),t):yX(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 fJ({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 fJ({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new gX(Object.assign(n,t));else throw 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 o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=vJ(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?_J(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw 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 Error(`"indent" option must be a positive integer, not ${t}`)}return _X(this,e)}};function yX(e){if($q(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var bX=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},xX=class extends bX{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},SX=class extends bX{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},CX=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function wX(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function TX(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(TX(t.key)||TX(t.value))return!0}return!1;default:return!0}}function EX(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&TX(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function DX(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Zq(e)&&Zq(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var OX=`All mapping items must start at the same column`;function kX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??hY)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=wX(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,OX)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||TX(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,OX);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&EX(r.indent,u,i),n.atKey=!1,DX(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=wX(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&EX(r.indent,f,i),s=c.range[2];let l=new lY(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new lY(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function AX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??_Y)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=wX(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&EX(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function jX(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var MX=`Block collections are not allowed within flow collections`,NX=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function PX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?hY:_Y))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=wX(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&TX(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];Xq(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],NX(m)&&i(r.range,`BLOCK_IN_FLOW`,MX)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);NX(f)&&i(g.range,`BLOCK_IN_FLOW`,MX),n.atKey=!1;let _=wX(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?NX(m)&&i(v.range,`BLOCK_IN_FLOW`,MX):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new lY(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;DX(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new hY(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=jX(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function FX(e,t,n,r,i,a){let o=n.type===`block-map`?kX(e,t,n,r,a):n.type===`block-seq`?AX(e,t,n,r,a):PX(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function IX(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===hY.tagName&&s===`map`||o===_Y.tagName&&s===`seq`)return FX(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),FX(e,t,n,i,o)}let l=FX(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=eJ(u)?u:new CJ(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function LX(e,t,n){let r=t.offset,i=RX(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?CJ.BLOCK_FOLDED:CJ.BLOCK_LITERAL,o=t.source?zX(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===KJ.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===CJ.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
@@ -81,47 +81,47 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function sZ({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function cZ(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function lZ(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=KJ.PLAIN,c=uZ(a,l);break;case`single-quoted-scalar`:s=KJ.QUOTE_SINGLE,c=dZ(a,l);break;case`double-quoted-scalar`:s=KJ.QUOTE_DOUBLE,c=pZ(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=eZ(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function uZ(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),fZ(e)}function dZ(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),fZ(e.slice(1,-1)).replace(/''/g,`'`)}function fZ(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function RX({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function zX(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function BX(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=CJ.PLAIN,c=VX(a,l);break;case`single-quoted-scalar`:s=CJ.QUOTE_SINGLE,c=HX(a,l);break;case`double-quoted-scalar`:s=CJ.QUOTE_DOUBLE,c=WX(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=jX(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function VX(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),UX(e)}function HX(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),UX(e.slice(1,-1)).replace(/''/g,`'`)}function UX(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`?a+=o:o=`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function pZ(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function WX(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`){if(i===`
`){let{fold:t,offset:i}=mZ(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=hZ[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=GX(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=KX[i];if(a)n+=a;else if(i===`
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=gZ(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=qX(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`&&(a!==`\r`||e[r+2]!==`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function mZ(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function GX(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
`);)r===`
`&&(n+=`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var hZ={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function gZ(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function _Z(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?oZ(e,t,r):lZ(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[pJ]:c?vZ(e.schema,i,c,n,r):t.type===`scalar`?yZ(e,i,t,r):e.schema[pJ];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=bJ(a)?a:new KJ(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new KJ(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function vZ(e,t,n,r,i){if(n===`!`)return e[pJ];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[pJ])}function yZ({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[pJ];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[pJ];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function bZ(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var xZ={composeNode:SZ,composeEmptyNode:CZ};function SZ(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=wZ(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=_Z(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=aZ(xZ,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=CZ(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!bJ(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function CZ(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=_Z(e,{type:`scalar`,offset:bZ(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function wZ({options:e},{offset:t,source:n,end:r},i){let a=new UJ(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=eZ(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function TZ(e,t,{offset:n,start:r,value:i,end:a},o){let s=new VX(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=qX(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?SZ(c,i,l,o):CZ(c,l.end,r,null,l,o);let u=s.contents.range[2],d=eZ(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function EZ(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function DZ(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var KX={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function qX(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function JX(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?LX(e,t,r):BX(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[Wq]:c?YX(e.schema,i,c,n,r):t.type===`scalar`?XX(e,i,t,r):e.schema[Wq];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=Zq(a)?a:new CJ(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new CJ(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function YX(e,t,n,r,i){if(n===`!`)return e[Wq];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[Wq])}function XX({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[Wq];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Wq];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function ZX(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var QX={composeNode:$X,composeEmptyNode:eZ};function $X(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=tZ(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=JX(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=IX(QX,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=eZ(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!Zq(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function eZ(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=JX(e,{type:`scalar`,offset:ZX(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function tZ({options:e},{offset:t,source:n,end:r},i){let a=new bJ(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=jX(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function nZ(e,t,{offset:n,start:r,value:i,end:a},o){let s=new vX(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=wX(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?$X(c,i,l,o):eZ(c,l.end,r,null,l,o);let u=s.contents.range[2],d=jX(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function rZ(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function iZ(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`:`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var OZ=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=EZ(e);r?this.warnings.push(new GX(i,t,n)):this.errors.push(new WX(i,t,n))},this.directives=new FJ({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=DZ(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(SJ(i)&&!i.flow&&i.items.length>0){let e=i.items[0];yJ(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:DZ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=EZ(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=TZ(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 WX(EZ(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new WX(EZ(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=eZ(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new WX(EZ(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 e=new VX(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},kZ=Symbol(`break visit`),AZ=Symbol(`skip children`),jZ=Symbol(`remove item`);function MZ(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),NZ(Object.freeze([]),e,t)}MZ.BREAK=kZ,MZ.SKIP=AZ,MZ.REMOVE=jZ,MZ.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},MZ.parentCollection=(e,t)=>{let n=MZ.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function NZ(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=NZ(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===kZ)return kZ;else r===jZ&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function PZ(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var aZ=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=rZ(e);r?this.warnings.push(new SX(i,t,n)):this.errors.push(new xX(i,t,n))},this.directives=new fJ({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=iZ(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if($q(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Xq(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:iZ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=rZ(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=nZ(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 xX(rZ(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new xX(rZ(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=jX(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new xX(rZ(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 e=new vX(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},oZ=Symbol(`break visit`),sZ=Symbol(`skip children`),cZ=Symbol(`remove item`);function lZ(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),uZ(Object.freeze([]),e,t)}lZ.BREAK=oZ,lZ.SKIP=sZ,lZ.REMOVE=cZ,lZ.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},lZ.parentCollection=(e,t)=>{let n=lZ.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function uZ(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=uZ(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===oZ)return oZ;else r===cZ&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function dZ(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`:case`\r
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `: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}function FZ(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var IZ=new Set(`0123456789ABCDEFabcdef`),LZ=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),RZ=new Set(`,[]{}`),zZ=new Set(` ,[]{}
\r `),BZ=e=>!e||zZ.has(e),VZ=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(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===`
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `: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}function fZ(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var pZ=new Set(`0123456789ABCDEFabcdef`),mZ=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),hZ=new Set(`,[]{}`),gZ=new Set(` ,[]{}
\r `),_Z=e=>!e||gZ.has(e),vZ=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(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===`
`||t===`\r`&&this.buffer[e+1]===`
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
`||!t&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&FZ(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(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,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]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;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``,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 e=this.peek(3);if((e===`---`||e===`...`)&&FZ(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!FZ(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===`:`)&&FZ(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`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(BZ),`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(`...`))&&FZ(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,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,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(BZ),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||FZ(e)||e===`,`)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 e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&fZ(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(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,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]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;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``,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 e=this.peek(3);if((e===`---`||e===`...`)&&fZ(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!fZ(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===`:`)&&fZ(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`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(_Z),`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(`...`))&&fZ(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,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,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(_Z),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||fZ(e)||e===`,`)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 e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
`,e)}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(e=>FZ(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`,e)}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(e=>fZ(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
`,t)}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===`
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,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 r=this.buffer[n+1];if(FZ(r)||e&&RZ.has(r))break;t=n}else if(FZ(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,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 r=this.buffer[n+1];if(fZ(r)||e&&hZ.has(r))break;t=n}else if(fZ(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&RZ.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&RZ.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,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;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(BZ),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(FZ(n)||t&&RZ.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!FZ(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(LZ.has(t))t=this.buffer[++e];else if(t===`%`&&IZ.has(this.buffer[e+1])&&IZ.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===`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&hZ.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&hZ.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,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;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(_Z),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(fZ(n)||t&&hZ.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!fZ(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(mZ.has(t))t=this.buffer[++e];else if(t===`%`&&pZ.has(this.buffer[e+1])&&pZ.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===`
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
`?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)}},HZ=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function UZ(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function WZ(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function GZ(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function KZ(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function qZ(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function JZ(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function YZ(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!UZ(t.start,`explicit-key-ind`)&&!UZ(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,GZ(t.value)?t.value.end?JZ(t.value.end,t.sep):t.value.end=t.sep:JZ(t.start,t.sep),delete t.sep)}var XZ=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new VZ,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,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=PZ(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else 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}}*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 e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&YZ(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&WZ(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.i Line truncated
`?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)}},yZ=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function bZ(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function xZ(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function SZ(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function CZ(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function wZ(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function TZ(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function EZ(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!bZ(t.start,`explicit-key-ind`)&&!bZ(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,SZ(t.value)?t.value.end?TZ(t.value.end,t.sep):t.value.end=t.sep:TZ(t.start,t.sep),delete t.sep)}var DZ=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new vZ,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,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=dZ(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else 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}}*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 e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&EZ(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&xZ(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.i Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){JZ(n,t.start),n.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 n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`: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(UZ(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=qZ(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(UZ(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(GZ(t.key)&&!UZ(t.sep,`newline`)){let e=qZ(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):UZ(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 n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!UZ(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(r);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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){JZ(n,t.start),n.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||UZ(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.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.ite Line truncated
`,e)+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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){TZ(n,t.start),n.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 n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`: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(bZ(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=wZ(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(bZ(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(SZ(t.key)&&!bZ(t.sep,`newline`)){let e=wZ(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):bZ(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 n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!bZ(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(r);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 n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){TZ(n,t.start),n.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||bZ(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.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.ite Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=qZ(KZ(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=qZ(KZ(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.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())}}};function ZZ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new HZ||null,prettyErrors:t}}function QZ(e,t={}){let{lineCounter:n,prettyErrors:r}=ZZ(t),i=new XZ(n?.addNewLine),a=new OZ(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new WX(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(KX(e,n)),o.warnings.forEach(KX(e,n))),o}function $Z(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function eQ(e){let t=QZ(e),n=t.errors[0];if(n)return{ok:!1,message:lQ(n.message),line:n.linePos?.[0]?.line};let r=t.toJS();if(!uQ(r))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let i=typeof r.id==`string`?r.id.trim():``;if(!i)return{ok:!1,message:`workflow id is required`};let a=r.steps;if(a==null||a===``)return{ok:!1,message:`workflow ${i} has no steps`};if(!Array.isArray(a))return{ok:!1,message:`workflow ${i}: steps must be a list`};if(!a.length)return{ok:!1,message:`workflow ${i} has no steps`};let o=[];for(let[e,t]of a.entries()){if(!uQ(t)||!dQ(t.type))return{ok:!1,message:`workflow ${i} step ${e+1} needs a type`};o.push({index:e+1,type:t.type.trim()})}return{ok:!0,id:i,steps:o}}function tQ(e){switch(e){case`key`:return`text-fg-muted`;case`string`:return`text-ok`;case`comment`:case`punct`:return`text-fg-subtle`;default:return`text-foreground`}}function nQ(e){return e.split(`
`).map((e,t)=>({number:t+1,text:e,tokens:aQ(e)}))}var rQ=/^(\s*)(-\s+)?/,iQ=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function aQ(e){let{code:t,comment:n}=oQ(e),r=sQ(t);return n&&r.push({text:n,kind:`comment`}),r}function oQ(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t){r===t&&(t=``);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function sQ(e){if(!e)return[];let t=[],n=rQ.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=iQ.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...cQ(i[4]??``)]):[...t,...cQ(r)]}function cQ(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function lQ(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function uQ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function dQ(e){return typeof e==`string`&&e.trim()!==``}var fQ={class:`space-y-1.5`},pQ={class:`space-y-1.5`},mQ={class:`flex h-9 flex-nowrap items-center gap-1.5 overflow-hidden`,role:`list`,"aria-label":`Steps`},hQ=[`title`],gQ={key:1,class:`text-xs text-fg-subtle`},_Q={class:`space-y-1.5`},vQ={class:`flex items-baseline gap-2`},yQ={class:`relative overflow-hidden rounded-lg border border-input font-mono text-[13px] leading-6 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`},bQ={"aria-hidden":`true`,class:`pointer-events-none absolute inset-y-0 left-0 w-11 select-none overflow-hidden border-r border-border bg-secondary/40 py-3 text-right`},xQ={"aria-hidden":`true`,class:`pointer-events-none absolute inset-0 overflow-hidden py-3 pr-3 pl-14 break-words whitespace-pre-wrap`},SQ={key:0,class:`text-sm text-danger`,role:`alert`},CQ={class:`flex flex-wrap items-center gap-2 border-t border-border pt-4`},wQ={key:0,class:`mr-auto font-mono text-xs text-fg-subtle`},TQ=M({__name:`WorkflowEditor`,props:{selected:{required:!0},selectedModifiers:{}},emits:[`update:selected`],setup(e){let t=JA(),n=G(()=>t.stateFor(`workflow-definitions`)),r=G(()=>n.value.resource?.value??{definitions:[]}),i=G(()=>t.shippedWorkflows()),a=so(e,`selected`),o=O(``),s=O(``),c=O(``),l=G(()=>i.value.definitions.find(e=>e.id===o.value));function u(e){let t=r.value.definitions.find(t=>t.id===e);o.value=t?.id??e,s.value=t?.yaml??`id: ${e}\nsteps:\n - type: `,c.value=``}j(a,u,{immediate:!0}),j(r,()=>{s.value||u(a.value)});async function d(e){return c.value=``,t.replace(`workflow-definitions`,e)}async function f(){let e=o.value.trim();if(!e){c.value=`Workflow ID is required.`;return}let t=a.value,n=r.value;t&&t!==e&&(n=KA(n,t)),await d(GA(n,{id:e,yaml:s.value}))&&(a.value=e)}async function p(){a.value&&await d(KA(r.value,a.value))&&(a.value=``,o.value=``,s.value=``)}async function m(){l.value&&await d(GA(r.value,UA(l.value)))}let h=G(()=>eQ(s.value)),g=G(()=>h.value.ok?h.value.steps:[]),_=G(()=>nQ(s.value)),v=O(0);function y(e){v.value=e.target.scrollTop}return(e,t)=>(L(),R(`form`,{class:`space-y-4`,onSubmit:cu(f,[`prevent`])},[B(`div`,fQ,[V(k(hT),{for:`workflow-id`},{default:A(()=>[...t[2]||=[H(`ID`,-1)]]),_:1}),V(k(Z),{id:`workflow-id`,modelValue:o.value,"onUpdate:modelValue":t[0]||=e=>o.value=e,name:`workflow-id`,required:``,autocomplete:`off`,class:`max-w-sm font-mono`},null,8,[`modelValue`])]),B(`div`,pQ,[t[3]||=B(`span`,{class:`text-sm leading-none font-medium`},`Steps`,-1),B(`div`,mQ,[g.value.length?(L(!0),R(I,{key:0},P(g.value,(e,t)=>(L(),R(I,{key:e.index},[B(`span`,{role:`listitem`,class:`shrink-0 rounded border border-border bg-secondary px-2 py-0.5 font-mono text-xs`,title:e.type},D(e.type),9,hQ),t<g.value.length-1?(L(),z(k(vd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":`true`})):U(``,!0)],64))),128)):(L(),R(`span`,gQ,`No steps yet`))])]),B(`div`,_Q,[B(`div`,vQ,[V(k(hT),{for:`workflow-yaml`},{default:A(()=>[...t[4]||=[H(`YAML`,-1)]]),_:1}),B(`span`,{class:E([`ml-auto text-xs`,h.value.ok?`text-ok`:`text-danger`]),role:`status`},D(h.value.ok?`✓`:`✕`)+` `+D(k($Z)(h.value)),3)]),B(`div`,yQ,[B(`div`,bQ,[B(`div`,{style:ve(`transform:translateY(${-v.value}px)`)},[(L(!0),R(I,null,P(_.value,e=>(L(),R(`div`,{key:e.number,class:`min-h-6 pr-2 text-fg-subtle`},D(e.number),1))),128))],4)]),B(`div`,xQ,[B(`div`,{style:ve(`transform:translateY(${-v.value}px)`)},[(L(!0),R(I,null,P(_.value,e=>(L(),R(`div`,{key:e.number,class:`min-h-6`},[(L(!0),R(I,null,P(e.tokens,(e,t)=>(L(),R(`span`,{key:t,class:E(k(tQ)(e.kind))},D(e.text),3))),128))]))),128))],4)]),V(k(ET),{id:`workflow-yaml`,modelValue:s.value,"onUpdate:modelValue":t[1]||=e=>s.value=e,name:`workflow-yaml`,required:``,class:`relative min-h-96 resize-y rounded-none border-0 bg-transparent py-3 pr-3 pl-14 text-[13px] leading-6 text-transparent caret-foreground shadow-none md:text-[13px] focus-visible:ring-0`,spellcheck:`false`,onScroll:y},null,8,[`modelValue`])])]),c.value||n.value.error?(L(),R(`p`,SQ,D(c.value||n.value.error),1)):U(``,!0),B(`div`,CQ,[n.value.resource?(L(),R(`span`,wQ,`Version `+D(n.value.resource.version),1)):U(``,!0),a.value?(L(),z(k(X),{key:1,type:`button`,variant:`ghost`,class:`text-danger`,onClick:p},{default:A(()=>[V(k(ef)),t[5]||=H(` Remove`,-1)]),_:1})):U(``,!0),l.value?(L(),z(k(X),{key:2,type:`button`,variant:`outline`,onClick:m},{default:A(()=>[V(k(qd)),t[6]||=H(` Restore this workflow`,-1)]),_:1})):U(``,!0),V(k(X),{type:`submit`,disabled:n.value.saving||!h.value.ok},{default:A(()=>[n.value.saving?(L(),z(k(xF),{key:0,"data-icon":`inline-start`})):U(``,!0),t[7]||=H(` Validate & save`,-1)]),_:1},8,[`disabled`])])],32))}});function EQ(e,t){let n=new Map((e||[]).map(e=>[e.workflow,e])),r=[],i=new Set;for(let e of t||[])i.add(e.id),r.push({...e,...n.get(e.id)||{workflow:e.id,runs:0,merged:0,completed:0}});for(let t of e||[])i.has(t.workflow)||r Line truncated
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=wZ(CZ(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=wZ(CZ(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.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())}}};function OZ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new yZ||null,prettyErrors:t}}function kZ(e,t={}){let{lineCounter:n,prettyErrors:r}=OZ(t),i=new DZ(n?.addNewLine),a=new aZ(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new xX(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(CX(e,n)),o.warnings.forEach(CX(e,n))),o}function AZ(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function jZ(e){let t=kZ(e),n=t.errors[0];if(n)return{ok:!1,message:BZ(n.message),line:n.linePos?.[0]?.line};let r=t.toJS();if(!VZ(r))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let i=typeof r.id==`string`?r.id.trim():``;if(!i)return{ok:!1,message:`workflow id is required`};let a=r.steps;if(a==null||a===``)return{ok:!1,message:`workflow ${i} has no steps`};if(!Array.isArray(a))return{ok:!1,message:`workflow ${i}: steps must be a list`};if(!a.length)return{ok:!1,message:`workflow ${i} has no steps`};let o=[];for(let[e,t]of a.entries()){if(!VZ(t)||!HZ(t.type))return{ok:!1,message:`workflow ${i} step ${e+1} needs a type`};o.push({index:e+1,type:t.type.trim()})}return{ok:!0,id:i,steps:o}}function MZ(e){switch(e){case`key`:return`text-fg-muted`;case`string`:return`text-ok`;case`comment`:case`punct`:return`text-fg-subtle`;default:return`text-foreground`}}function NZ(e){return e.split(`
`).map((e,t)=>({number:t+1,text:e,tokens:IZ(e)}))}var PZ=/^(\s*)(-\s+)?/,FZ=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function IZ(e){let{code:t,comment:n}=LZ(e),r=RZ(t);return n&&r.push({text:n,kind:`comment`}),r}function LZ(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t){r===t&&(t=``);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function RZ(e){if(!e)return[];let t=[],n=PZ.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=FZ.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...zZ(i[4]??``)]):[...t,...zZ(r)]}function zZ(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function BZ(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function VZ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function HZ(e){return typeof e==`string`&&e.trim()!==``}var UZ={class:`space-y-1.5`},WZ={class:`space-y-1.5`},GZ={class:`flex h-9 flex-nowrap items-center gap-1.5 overflow-hidden`,role:`list`,"aria-label":`Steps`},KZ=[`title`],qZ={key:1,class:`text-xs text-fg-subtle`},JZ={class:`space-y-1.5`},YZ={class:`flex items-baseline gap-2`},XZ={class:`relative overflow-hidden rounded-lg border border-input font-mono text-[13px] leading-6 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`},ZZ={"aria-hidden":`true`,class:`pointer-events-none absolute inset-y-0 left-0 w-11 select-none overflow-hidden border-r border-border bg-secondary/40 py-3 text-right`},QZ={"aria-hidden":`true`,class:`pointer-events-none absolute inset-0 overflow-hidden py-3 pr-3 pl-14 break-words whitespace-pre-wrap`},$Z={key:0,class:`text-sm text-danger`,role:`alert`},eQ={class:`flex flex-wrap items-center gap-2 border-t border-border pt-4`},tQ={key:0,class:`mr-auto font-mono text-xs text-fg-subtle`},nQ=M({__name:`WorkflowEditor`,props:{selected:{required:!0},selectedModifiers:{}},emits:[`update:selected`],setup(e){let t=JA(),n=G(()=>t.stateFor(`workflow-definitions`)),r=G(()=>n.value.resource?.value??{definitions:[]}),i=G(()=>t.shippedWorkflows()),a=so(e,`selected`),o=O(``),s=O(``),c=O(``),l=G(()=>i.value.definitions.find(e=>e.id===o.value));function u(e){let t=r.value.definitions.find(t=>t.id===e);o.value=t?.id??e,s.value=t?.yaml??`id: ${e}\nsteps:\n - type: `,c.value=``}j(a,u,{immediate:!0}),j(r,()=>{s.value||u(a.value)});async function d(e){return c.value=``,t.replace(`workflow-definitions`,e)}async function f(){let e=o.value.trim();if(!e){c.value=`Workflow ID is required.`;return}let t=a.value,n=r.value;t&&t!==e&&(n=KA(n,t)),await d(GA(n,{id:e,yaml:s.value}))&&(a.value=e)}async function p(){a.value&&await d(KA(r.value,a.value))&&(a.value=``,o.value=``,s.value=``)}async function m(){l.value&&await d(GA(r.value,UA(l.value)))}let h=G(()=>jZ(s.value)),g=G(()=>h.value.ok?h.value.steps:[]),_=G(()=>NZ(s.value)),v=O(0);function y(e){v.value=e.target.scrollTop}return(e,t)=>(L(),R(`form`,{class:`space-y-4`,onSubmit:cu(f,[`prevent`])},[B(`div`,UZ,[V(k(hT),{for:`workflow-id`},{default:A(()=>[...t[2]||=[H(`ID`,-1)]]),_:1}),V(k(Z),{id:`workflow-id`,modelValue:o.value,"onUpdate:modelValue":t[0]||=e=>o.value=e,name:`workflow-id`,required:``,autocomplete:`off`,class:`max-w-sm font-mono`},null,8,[`modelValue`])]),B(`div`,WZ,[t[3]||=B(`span`,{class:`text-sm leading-none font-medium`},`Steps`,-1),B(`div`,GZ,[g.value.length?(L(!0),R(I,{key:0},P(g.value,(e,t)=>(L(),R(I,{key:e.index},[B(`span`,{role:`listitem`,class:`shrink-0 rounded border border-border bg-secondary px-2 py-0.5 font-mono text-xs`,title:e.type},D(e.type),9,KZ),t<g.value.length-1?(L(),z(k(vd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":`true`})):U(``,!0)],64))),128)):(L(),R(`span`,qZ,`No steps yet`))])]),B(`div`,JZ,[B(`div`,YZ,[V(k(hT),{for:`workflow-yaml`},{default:A(()=>[...t[4]||=[H(`YAML`,-1)]]),_:1}),B(`span`,{class:E([`ml-auto text-xs`,h.value.ok?`text-ok`:`text-danger`]),role:`status`},D(h.value.ok?`✓`:`✕`)+` `+D(k(AZ)(h.value)),3)]),B(`div`,XZ,[B(`div`,ZZ,[B(`div`,{style:ve(`transform:translateY(${-v.value}px)`)},[(L(!0),R(I,null,P(_.value,e=>(L(),R(`div`,{key:e.number,class:`min-h-6 pr-2 text-fg-subtle`},D(e.number),1))),128))],4)]),B(`div`,QZ,[B(`div`,{style:ve(`transform:translateY(${-v.value}px)`)},[(L(!0),R(I,null,P(_.value,e=>(L(),R(`div`,{key:e.number,class:`min-h-6`},[(L(!0),R(I,null,P(e.tokens,(e,t)=>(L(),R(`span`,{key:t,class:E(k(MZ)(e.kind))},D(e.text),3))),128))]))),128))],4)]),V(k(ET),{id:`workflow-yaml`,modelValue:s.value,"onUpdate:modelValue":t[1]||=e=>s.value=e,name:`workflow-yaml`,required:``,class:`relative min-h-96 resize-y rounded-none border-0 bg-transparent py-3 pr-3 pl-14 text-[13px] leading-6 text-transparent caret-foreground shadow-none md:text-[13px] focus-visible:ring-0`,spellcheck:`false`,onScroll:y},null,8,[`modelValue`])])]),c.value||n.value.error?(L(),R(`p`,$Z,D(c.value||n.value.error),1)):U(``,!0),B(`div`,eQ,[n.value.resource?(L(),R(`span`,tQ,`Version `+D(n.value.resource.version),1)):U(``,!0),a.value?(L(),z(k(X),{key:1,type:`button`,variant:`ghost`,class:`text-danger`,onClick:p},{default:A(()=>[V(k(ef)),t[5]||=H(` Remove`,-1)]),_:1})):U(``,!0),l.value?(L(),z(k(X),{key:2,type:`button`,variant:`outline`,onClick:m},{default:A(()=>[V(k(qd)),t[6]||=H(` Restore this workflow`,-1)]),_:1})):U(``,!0),V(k(X),{type:`submit`,disabled:n.value.saving||!h.value.ok},{default:A(()=>[n.value.saving?(L(),z(k(xF),{key:0,"data-icon":`inline-start`})):U(``,!0),t[7]||=H(` Validate & save`,-1)]),_:1},8,[`disabled`])])],32))}});function rQ(e,t){let n=new Map((e||[]).map(e=>[e.workflow,e])),r=[],i=new Set;for(let e of t||[])i.add(e.id),r.push({...e,...n.get(e.id)||{workflow:e.id,runs:0,merged:0,completed:0}});for(let t of e||[])i.has(t.workflow)||r Line truncated
+7 -1
View File
@@ -2,7 +2,13 @@
import { Check } from "@lucide/vue";
import { computed, ref, watch } from "vue";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import {
Card,
CardAction,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Progress } from "@/components/ui/progress";
import { setupPanelState, type SetupPanelState } from "./setup-preference";
import { setup } from "./state";
-1
View File
@@ -56,7 +56,6 @@ const settings: NavSpec = {
"/settings/container-runtime",
"/settings/harness",
"/settings/status",
"/settings/advanced",
],
},
{ paths: ["/settings/history"] },
-14
View File
@@ -14,7 +14,6 @@ import SchedulesPage from "@/settings/SchedulesPage.vue";
import ExtensionsPage from "@/settings/ExtensionsPage.vue";
import PluginsPage from "@/settings/PluginsPage.vue";
import ContainerRuntimePage from "@/settings/ContainerRuntimePage.vue";
import SystemAdvancedPage from "@/settings/SystemAdvancedPage.vue";
import SystemIdentitiesPage from "@/settings/SystemIdentitiesPage.vue";
import AccessPoliciesPage from "@/settings/AccessPoliciesPage.vue";
import SystemAppearancePage from "@/settings/SystemAppearancePage.vue";
@@ -322,18 +321,6 @@ const routes = [
section: "settings",
},
},
{
path: "/settings/advanced",
name: "system-advanced",
component: SystemAdvancedPage,
meta: {
navPath: "/settings",
settings: true,
label: "Advanced",
description: "Actions that stop or roll back archied.",
section: "settings",
},
},
{
path: "/settings/history",
name: "settings-history",
@@ -363,7 +350,6 @@ const routes = [
"/system/models": "/settings/models",
"/system/repos": "/settings/repositories",
"/system/identities": "/settings/identities",
"/system/advanced": "/settings/advanced",
"/channels": "/settings/channels",
"/skills": "/settings/skills",
"/curators": "/settings/curators",
+23 -82
View File
@@ -1,10 +1,8 @@
<script setup lang="ts">
import { computed, onMounted, ref } from "vue";
import { computed, onMounted } from "vue";
import { storeToRefs } from "pinia";
import { Plus, Trash2 } from "@lucide/vue";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { DurationInput } from "@/components/ui/duration-input";
import { Input } from "@/components/ui/input";
import {
@@ -16,29 +14,22 @@ import {
} from "@/components/ui/number-field";
import { SegmentedControl } from "@/components/ui/segmented-control";
import { SettingRow } from "@/components/ui/setting-row";
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from "@/components/ui/tags-input";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
const KIND = "container-runtime-policies";
// The document is config.ContainerConfig on the wire, so its keys are Go
// field names until archie-core-qna6 gives it a snake_case contract.
// The stored document is containerRuntimePolicies on the wire, with snake_case
// keys and durations as Go duration strings (archie-core-qna6). Named agent
// profiles are no longer part of it: they moved to the agent-profiles resource.
interface ContainerRuntime {
Image: string;
MaxConcurrency: number;
MaxUptime: string;
VolumeTTL: string;
PullPolicy: string;
Network: string;
Profiles: Record<string, { Image: string; Tools: string[] | null }> | null;
image: string;
max_concurrency: number;
max_uptime: string;
volume_ttl: string;
pull_policy: string;
network: string;
}
const store = useControlPlaneStore();
@@ -54,21 +45,11 @@ const pullPolicies = [
{ value: "always", label: "Always" },
];
const pullPolicy = computed({
get: () => runtime.value?.PullPolicy || "missing",
get: () => runtime.value?.pull_policy || "missing",
set: (value: string) => {
if (runtime.value) runtime.value.PullPolicy = value;
if (runtime.value) runtime.value.pull_policy = value;
},
});
const newProfile = ref("");
function addProfile() {
const name = newProfile.value.trim();
if (!runtime.value || !name) return;
runtime.value.Profiles ??= {};
if (runtime.value.Profiles[name]) return;
runtime.value.Profiles[name] = { Image: "", Tools: [] };
newProfile.value = "";
}
</script>
<template>
@@ -82,86 +63,46 @@ function addProfile() {
<template v-if="runtime">
<SettingRow label="Image" for="cr-image">
<div class="flex flex-wrap items-center gap-3">
<Input id="cr-image" v-model="runtime.Image" class="font-mono" />
<DraftHint :kind="KIND" path="Image" />
<Input id="cr-image" v-model="runtime.image" class="font-mono" />
<DraftHint :kind="KIND" path="image" />
</div>
</SettingRow>
<SettingRow label="Pull policy">
<div class="flex flex-wrap items-center gap-3">
<SegmentedControl v-model="pullPolicy" label="Pull policy" :options="pullPolicies" />
<DraftHint :kind="KIND" path="PullPolicy" />
<DraftHint :kind="KIND" path="pull_policy" />
</div>
</SettingRow>
<SettingRow label="Max concurrency" hint="0 = no limit.">
<div class="flex flex-wrap items-center gap-3">
<NumberField v-model="runtime.MaxConcurrency" :min="0" class="w-32">
<NumberField v-model="runtime.max_concurrency" :min="0" class="w-32">
<NumberFieldContent>
<NumberFieldDecrement />
<NumberFieldInput class="font-mono" aria-label="Max concurrency" />
<NumberFieldIncrement />
</NumberFieldContent>
</NumberField>
<DraftHint :kind="KIND" path="MaxConcurrency" />
<DraftHint :kind="KIND" path="max_concurrency" />
</div>
</SettingRow>
<SettingRow label="Max uptime" for="cr-uptime">
<div class="flex flex-wrap items-center gap-3">
<DurationInput id="cr-uptime" v-model="runtime.MaxUptime" :units="['m', 'h']" />
<DraftHint :kind="KIND" path="MaxUptime" />
<DurationInput id="cr-uptime" v-model="runtime.max_uptime" :units="['m', 'h']" />
<DraftHint :kind="KIND" path="max_uptime" />
</div>
</SettingRow>
<SettingRow label="Volume retention" for="cr-ttl">
<div class="flex flex-wrap items-center gap-3">
<DurationInput id="cr-ttl" v-model="runtime.VolumeTTL" :units="['h']" />
<DraftHint :kind="KIND" path="VolumeTTL" />
<DurationInput id="cr-ttl" v-model="runtime.volume_ttl" :units="['h']" />
<DraftHint :kind="KIND" path="volume_ttl" />
</div>
</SettingRow>
<SettingRow label="Network" for="cr-network" hint="Empty: auto-detect.">
<div class="flex flex-wrap items-center gap-3">
<Input id="cr-network" v-model="runtime.Network" class="max-w-sm font-mono" />
<DraftHint :kind="KIND" path="Network" />
<Input id="cr-network" v-model="runtime.network" class="max-w-sm font-mono" />
<DraftHint :kind="KIND" path="network" />
</div>
</SettingRow>
<h2 class="mt-10 mb-1 text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase">Profiles</h2>
<section
v-for="(profile, name) in runtime.Profiles ?? {}"
:key="name"
class="mb-3 rounded-lg border border-border bg-card px-5 pt-3 pb-2"
:aria-label="`Profile ${name}`"
>
<header class="flex items-center">
<h3 class="flex-1 font-mono text-sm font-medium">{{ name }}</h3>
<Button variant="ghost" size="icon" :aria-label="`Remove profile ${name}`" @click="delete runtime.Profiles![name]"><Trash2 /></Button>
</header>
<SettingRow label="Image" :for="`prof-${name}-image`" hint="Empty: default image.">
<div class="flex flex-wrap items-center gap-3">
<Input :id="`prof-${name}-image`" v-model="profile.Image" class="font-mono" />
<DraftHint :kind="KIND" :path="`Profiles.${name}.Image`" />
</div>
</SettingRow>
<SettingRow label="Tools" hint="Empty allows all.">
<div class="flex flex-wrap items-center gap-3">
<TagsInput
:model-value="profile.Tools ?? []"
class="font-mono"
:aria-label="`Tools for ${name}`"
@update:model-value="(v) => (profile.Tools = v as string[])"
>
<TagsInputItem v-for="tool in profile.Tools ?? []" :key="tool" :value="tool">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="tool name" />
</TagsInput>
<DraftHint :kind="KIND" :path="`Profiles.${name}.Tools`" />
</div>
</SettingRow>
</section>
<div class="flex gap-2">
<Input v-model="newProfile" class="max-w-56 font-mono" placeholder="profile name" aria-label="New profile" @keydown.enter="addProfile" />
<Button variant="outline" size="sm" :disabled="!newProfile.trim()" @click="addProfile"><Plus data-icon="inline-start" /> Add profile</Button>
</div>
</template>
</div>
</template>
+6 -1
View File
@@ -3,7 +3,12 @@ import { computed } from "vue";
import LogRow from "@/base/LogRow.vue";
import { Button } from "@/components/ui/button";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import {
Empty,
EmptyDescription,
EmptyHeader,
EmptyTitle,
} from "@/components/ui/empty";
import { api } from "@/lib/api";
import { attemptFooter } from "@/lib/log";
+54
View File
@@ -0,0 +1,54 @@
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import test from "node:test";
/**
* The keys of the container-runtime-policies document.
*
* internal/app/controlplane/containerRuntimePolicies owns this shape and
* normalises every stored document to it (archie-core-qna6). These are the keys
* the control plane serves, so they are the keys the page must bind.
*/
const documentKeys = [
"image",
"max_concurrency",
"max_uptime",
"volume_ttl",
"pull_policy",
"network",
];
/** The Go-cased spellings the wire carried before archie-core-qna6. */
const retiredKeys = ["Image", "MaxConcurrency", "MaxUptime", "VolumeTTL", "PullPolicy", "Network"];
test("the container runtime page binds the document's own keys", async () => {
const page = await readFile(
new URL("../src/settings/ContainerRuntimePage.vue", import.meta.url),
"utf8",
);
// Only the template binds fields; the script's own reads go through the
// `runtime` ref, whose `.value` is not a document key.
const template = page.slice(page.indexOf("<template>"));
const bound = [...template.matchAll(/runtime\.([A-Za-z_]+)/g)].map((m) => m[1]);
assert.ok(bound.length > 0, "the page binds no fields at all");
for (const key of new Set(bound)) {
assert.ok(
documentKeys.includes(key),
`runtime.${key} is not a container-runtime-policies key`,
);
}
});
test("the container runtime page does not bind a retired Go-cased key", async () => {
const page = await readFile(
new URL("../src/settings/ContainerRuntimePage.vue", import.meta.url),
"utf8",
);
for (const key of retiredKeys) {
assert.doesNotMatch(
page,
new RegExp(`\\.${key}\\b`),
`the document no longer carries ${key}`,
);
}
});