feat(ui): build workflows on the canvas: step palette, schema-driven settings forms, references to earlier results, reorder and remove

This commit is contained in:
sam committed 2026-10-05 00:44:22 +11:00
1 parent 3072ba595f
commit e46eeb67dd
9 files changed
+564 -132

No files matched your search

+1 -1
View File
@@ -1 +1 @@
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@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;--twLine truncated
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@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;--twLine truncated
+124 -121
View File
@@ -1,29 +1,138 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HarnessPage.js","assets/HarnessPage.css"])))=>i.map(i=>d[i]);
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>w(e)===`[object Map]`,h=e=>w(e)===`[object Set]`,g=e=>w(e)===`[object Date]`,_=e=>w(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),C=Object.prototype.toString,w=e=>C.call(e),T=e=>w(e).slice(8,-1),E=e=>w(e)===`[object Object]`,D=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,O=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,k=ee(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,re=ee(e=>e.replace(ne,`-$1`).toLowerCase()),ie=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),ae=ee(e=>e?`on${ie(e)}`:``),A=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},le=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},ue,de=()=>ue||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},fe=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function pe(e){if(p(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=y(r)?_e(r):pe(r);if(i)for(let e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}var me=/;(?![^(]*\))/g,he=/:([^]+)/,ge=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function _e(e){let t={};return e.replace(ge,e=>e.startsWith(`/*`)?``:e).split(me).forEach(e=>{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function j(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){let r=j(e[n]);r&&(t+=r+` `)}else if(x(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ve(e){if(!e)return null;let{class:t,style:n}=e;return t&&!y(t)&&(e.class=j(t)),n&&(e.style=pe(n)),e}var ye=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,be=n(ye);ye+``;function xe(e){return!!e||e===``}function Se(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Ee(e[i],t[i],n);return r}function Ce(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Ee(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function we(e,t,n){let r=m(e),i=m(t);if(r||i||(r=h(e),i=h(t),r||i))return r&&i?Ce(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Ee(e[r],t[r],n))return!1}return String(e)===String(t)}function Te(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Ee(e,t,n){if(e===t)return!0;let r=g(e),i=g(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=b(e),i=b(t),r||i?e===t:(r=p(e),i=p(t),r||i?r&&i?Te(e,t,n,Se):!1:(r=x(e),i=x(t),r||i?!r||!i?!1:Te(e,t,n,we):String(e)===String(t))))}function De(e,t){return e.findIndex(e=>Ee(e,t))}var Oe=e=>!!(e&&e.__v_isRef===!0),M=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===C||!v(e.toString))?Oe(e)?M(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>Oe(t)?ke(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:b(t)?Ae(t):x(t)&&!p(t)&&!E(t)?String(t):t,Ae=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof eLine truncated
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>w(e)===`[object Map]`,h=e=>w(e)===`[object Set]`,g=e=>w(e)===`[object Date]`,_=e=>w(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),C=Object.prototype.toString,w=e=>C.call(e),T=e=>w(e).slice(8,-1),E=e=>w(e)===`[object Object]`,D=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,O=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,k=ee(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,re=ee(e=>e.replace(ne,`-$1`).toLowerCase()),ie=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),ae=ee(e=>e?`on${ie(e)}`:``),A=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},le=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},ue,de=()=>ue||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},fe=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function pe(e){if(p(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=y(r)?_e(r):pe(r);if(i)for(let e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}var me=/;(?![^(]*\))/g,he=/:([^]+)/,ge=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function _e(e){let t={};return e.replace(ge,e=>e.startsWith(`/*`)?``:e).split(me).forEach(e=>{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function j(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){let r=j(e[n]);r&&(t+=r+` `)}else if(x(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ve(e){if(!e)return null;let{class:t,style:n}=e;return t&&!y(t)&&(e.class=j(t)),n&&(e.style=pe(n)),e}var ye=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,be=n(ye);ye+``;function xe(e){return!!e||e===``}function Se(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Ee(e[i],t[i],n);return r}function Ce(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Ee(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function we(e,t,n){let r=m(e),i=m(t);if(r||i||(r=h(e),i=h(t),r||i))return r&&i?Ce(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Ee(e[r],t[r],n))return!1}return String(e)===String(t)}function Te(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Ee(e,t,n){if(e===t)return!0;let r=g(e),i=g(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=b(e),i=b(t),r||i?e===t:(r=p(e),i=p(t),r||i?r&&i?Te(e,t,n,Se):!1:(r=x(e),i=x(t),r||i?!r||!i?!1:Te(e,t,n,we):String(e)===String(t))))}function De(e,t){return e.findIndex(e=>Ee(e,t))}var Oe=e=>!!(e&&e.__v_isRef===!0),M=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===C||!v(e.toString))?Oe(e)?M(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>Oe(t)?ke(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:b(t)?Ae(t):x(t)&&!p(t)&&!E(t)?String(t):t,Ae=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof eLine truncated
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(wi(e,0)||mi(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!O(a)||a[0]===`.`||t&&!O(a)||u&&u.includes(a)){if(xi(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&nn(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Es(x,n,t),h&&yr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ns(()=>{x&&Es(x,n,t),l&&g.enter(e),h&&yr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Cs(d[t]),g=h.type===as;e?(g&&!u&&t+1<p&&Cs(d[t+1]).type===as&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,wi(r,1)||mi()),n(null,h,r,null,o,s,_i(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&vi(f)&&f.data===`]`?a(t.anchor=f):(mi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(Ei(e,t)||mi(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,_i(d),s),r&&(r.vnode.el=t.el,go(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&vi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var bi=new Set([`src`,`srcset`,`href`,`poster`]);function xi(e,t,n){return bi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var Si=`data-allow-mismatch`,Ci={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function wi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Si);)e=e.parentElement;return Ti(e&&e.getAttribute(Si),t)}function Ti(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Ci[t])}}function Ei(e,t){return wi(e.parentElement,1)||Di(e)||Oi(t)}function Di(e){return e.nodeType===1&&Ti(e.getAttribute(Si),1)}function Oi({props:e}){let t=e&&e[Si];return typeof t==`string`&&Ti(t,1)}var ki=de().requestIdleCallback||(e=>setTimeout(e,1)),Ai=de().cancelIdleCallback||(e=>clearTimeout(e)),ji=(e=1e4)=>t=>{let n=ki(t,{timeout:e});return()=>Ai(n)};function Mi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Ni=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Mi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Pi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Fi=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Ii(e,t){if(vi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(vi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Li=e=>!!e.type.__asyncLoader;function Ri(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return L({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Ii(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=As;if(si(e),u)return()=>zi(u,e);let t=t=>{l=null,Gn(t,e,13,!r)};if(s&&e.suspense||Ls)return p().then(t=>()=>zi(t,e)).catch(e=>(t(e),()=>r?G(r,{error:e}):null));let a=N(!1),c=N(),d=N(!!i),f,m;return na(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Bi(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return zi(u,e);if(c.value&&r)return G(r,{error:c.value});if(n&&!d Line truncated
`))),e[Ll]=Pl(i);let a=r||i.props&&i.props.type===`number`;nl(e,t?`change`:`input`,t=>{t.target.composing||e[Ll](zl(e.value,n,a))}),(n||a)&&nl(e,`change`,()=>{e.value=zl(e.value,n,a)}),t||(nl(e,`compositionstart`,Fl),nl(e,`compositionend`,Il),nl(e,`change`,Il))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Rl];delete e[Rl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Ll](zl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Ll]=Pl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Vl={deep:!0,created(e,t,n){e[Ll]=Pl(n),nl(e,`change`,()=>{let t=e._modelValue,n=ql(e),r=e.checked,i=e[Ll];if(p(t)){let e=De(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Jl(e,r))})},mounted:Hl,beforeUpdate(e,t,n){e[Ll]=Pl(n),Hl(e,t,n)}};function Hl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=De(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Ee(t,Jl(e,!0))}e.checked!==i&&(e.checked=i)}var Ul={created(e,{value:t},n){e.checked=Ee(t,n.props.value),e[Ll]=Pl(n),nl(e,`change`,()=>{e[Ll](ql(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Ll]=Pl(r),t!==n&&(e.checked=Ee(t,r.props.value))}},Wl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,nl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce(ql(e)):ql(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[Ll](i)}finally{er(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Ll]=Pl(r)},mounted(e,{value:t}){Kl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ll]=Pl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Gl(t,n[1],n[0]))&&Kl(e,t)}};function Gl(e,t,n){if(!n||p(e))return Ee(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Kl(e,t){let n=e.multiple,r=p(t);if(!n||r||h(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=ql(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):De(t,o)>-1}else a.selected=t.has(o)}else if(Ee(ql(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ql(e){return`_value`in e?e._value:e.value}function Jl(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var Yl={created(e,t,n){Zl(e,t,n,null,`created`)},mounted(e,t,n){Zl(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){Zl(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){Zl(e,t,n,r,`updated`)}};function Xl(e,t){switch(e){case`SELECT`:return Wl;case`TEXTAREA`:return Bl;default:switch(t){case`checkbox`:return Vl;case`radio`:return Ul;default:return Bl}}}function Zl(e,t,n,r,i){let a=Xl(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function Ql(){Bl.getSSRProps=({value:e})=>({value:e}),Ul.getSSRProps=({value:e},t)=>{if(t.props&&Ee(t.props.value,e))return{checked:!0}},Vl.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&De(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Yl.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=Xl(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var $l=[`ctrl`,`shift`,`alt`,`meta`],eu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>$l.some(n=>e[`${n}Key`]&&!t.includes(n))},tu=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=eu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},nu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},ru=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=re(n.key);if(t.some(e=>e===r||nu[e]===r))return e(n)}))},iu=l({patchProp:ml},mc),au,ou=!1;function su(){return au||=Io(iu)}function cu(){return au=ou?au:Lo(iu),ou=!0,au}var lu=((...e)=>{su().render(...e)}),uu=((...e)=>{cu().hydrate(...e)}),du=((...e)=>{let t=su().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=mu(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,pu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),fu=(( Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Vp;function Hp(e){Vp=e}var Up=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Wp(e){let t=e instanceof Up?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Gp(e,t){let n=await fetch(e,t);if(Vp?.(n.status===401),!n.ok)throw new Up(await Bp(n),n.status);return n}async function Kp(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Rp,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Gp(e,s);return a?await c.json():void 0}var qp={health:()=>Kp(`/health/detailed`),services:()=>Kp(`/api/services`),policies:()=>Kp(`/api/access/policies`),putPolicy:e=>Kp(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Kp(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),summary:()=>Kp(`/api/summary`),tasks:()=>Kp(`/api/tasks`),taskMeta:()=>Kp(`/api/task-meta`),task:e=>Kp(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Kp(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Kp(`/api/tasks/${encodeURIComponent(e)}/changes`+zp(t)),taskDebug:(e,t)=>Kp(`/api/tasks/${encodeURIComponent(e)}/debug`+zp(t)),taskAction:(e,t,n)=>Kp(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Kp(`/api/setup`),capabilities:()=>Kp(`/api/capabilities`),workflows:()=>Kp(`/api/workflows`),workflowEnabled:(e,t)=>Kp(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>Kp(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Kp(`/api/skills`),channels:()=>Kp(`/api/channels`),curators:()=>Kp(`/api/curators`),channelReload:e=>Kp(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Kp(`/api/config`),logs:e=>Kp(`/api/logs`+zp(e)),taskLogs:(e,t)=>Kp(`/api/tasks/${encodeURIComponent(e)}/logs`+zp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>Kp(`/api/version`),updateSnapshot:()=>Kp(`/api/chat/update`),updateInstall:e=>Kp(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>Kp(`/api/captures`+zp({limit:e})),eventTypes:()=>Kp(`/api/event-types`),eventTypeCreate:e=>Kp(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>Kp(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>Kp(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>Kp(`/api/mappings`),mappingCreate:e=>Kp(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Kp(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Kp(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Kp(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Kp(`/api/bindings`),bindingCreate:e=>Kp(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Kp(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Kp(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Kp(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),harnessBindings:()=>Kp(`/api/harness/bindings`),sources:()=>Kp(`/api/sources`),sourceCreate:e=>Kp(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>Kp(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>Kp(`/api/sources/${encodeURIComponent(e)}/approve-unsigned`,{method:`POST`}),sourceSecret:e=>Kp(`/api/sources/${encodeURIComponent(e)}/secret`,{method:`POST`}),chatSessions:()=>Kp(`/api/chat/sessions`),chatMessages:e=>Kp(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Kp(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Kp(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Kp(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Lp(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Kp(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatDangerous:()=>Kp(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Kp(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Kp(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>Gp(`/api/chat/stream`,{method:`POST`,headers:{Accept:`text/event-stream`,"Content-Type":`application/json`,"X-Archie-CSRF":`1`},body:JSON.stringify(e),signal:t.signal})};function Jp(e,t,n=``,r=!1){let i=new EventSource(Ip(n,r));return i.onopen=()=>t(`lLine truncated
`)&&(Ci(e,0)||pi(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!O(a)||a[0]===`.`||t&&!O(a)||u&&u.includes(a)){if(bi(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&nn(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Ts(x,n,t),h&&vr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ts(()=>{x&&Ts(x,n,t),l&&g.enter(e),h&&vr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Ss(d[t]),g=h.type===is;e?(g&&!u&&t+1<p&&Ss(d[t+1]).type===is&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,Ci(r,1)||pi()),n(null,h,r,null,o,s,gi(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&_i(f)&&f.data===`]`?a(t.anchor=f):(pi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(Ti(e,t)||pi(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,gi(d),s),r&&(r.vnode.el=t.el,ho(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&_i(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var yi=new Set([`src`,`srcset`,`href`,`poster`]);function bi(e,t,n){return yi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var xi=`data-allow-mismatch`,Si={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function Ci(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(xi);)e=e.parentElement;return wi(e&&e.getAttribute(xi),t)}function wi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Si[t])}}function Ti(e,t){return Ci(e.parentElement,1)||Ei(e)||Di(t)}function Ei(e){return e.nodeType===1&&wi(e.getAttribute(xi),1)}function Di({props:e}){let t=e&&e[xi];return typeof t==`string`&&wi(t,1)}var Oi=de().requestIdleCallback||(e=>setTimeout(e,1)),ki=de().cancelIdleCallback||(e=>clearTimeout(e)),Ai=(e=1e4)=>t=>{let n=Oi(t,{timeout:e});return()=>ki(n)};function ji(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Mi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(ji(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ni=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Pi=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Fi(e,t){if(_i(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(_i(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ii=e=>!!e.type.__asyncLoader;function Li(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return L({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Fi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=ks;if(oi(e),u)return()=>Ri(u,e);let t=t=>{l=null,Wn(t,e,13,!r)};if(s&&e.suspense||Is)return p().then(t=>()=>Ri(t,e)).catch(e=>(t(e),()=>r?G(r,{error:e}):null));let a=N(!1),c=N(),d=N(!!i),f,m;return ta(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&zi(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Ri(u,e);if(c.value&&r)return G(r,{error:c.value});if(n&&!d Line truncated
`))),e[Fl]=Nl(i);let a=r||i.props&&i.props.type===`number`;tl(e,t?`change`:`input`,t=>{t.target.composing||e[Fl](Ll(e.value,n,a))}),(n||a)&&tl(e,`change`,()=>{e.value=Ll(e.value,n,a)}),t||(tl(e,`compositionstart`,iee),tl(e,`compositionend`,Pl),tl(e,`change`,Pl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Il];delete e[Il],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Fl](Ll(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Fl]=Nl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},zl={deep:!0,created(e,t,n){e[Fl]=Nl(n),tl(e,`change`,()=>{let t=e._modelValue,n=Gl(e),r=e.checked,i=e[Fl];if(p(t)){let e=De(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Kl(e,r))})},mounted:Bl,beforeUpdate(e,t,n){e[Fl]=Nl(n),Bl(e,t,n)}};function Bl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=De(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Ee(t,Kl(e,!0))}e.checked!==i&&(e.checked=i)}var Vl={created(e,{value:t},n){e.checked=Ee(t,n.props.value),e[Fl]=Nl(n),tl(e,`change`,()=>{e[Fl](Gl(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Fl]=Nl(r),t!==n&&(e.checked=Ee(t,r.props.value))}},Hl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,tl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce(Gl(e)):Gl(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[Fl](i)}finally{$n(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Fl]=Nl(r)},mounted(e,{value:t}){Wl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Fl]=Nl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Ul(t,n[1],n[0]))&&Wl(e,t)}};function Ul(e,t,n){if(!n||p(e))return Ee(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Wl(e,t){let n=e.multiple,r=p(t);if(!n||r||h(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Gl(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):De(t,o)>-1}else a.selected=t.has(o)}else if(Ee(Gl(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Gl(e){return`_value`in e?e._value:e.value}function Kl(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var ql={created(e,t,n){Yl(e,t,n,null,`created`)},mounted(e,t,n){Yl(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){Yl(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){Yl(e,t,n,r,`updated`)}};function Jl(e,t){switch(e){case`SELECT`:return Hl;case`TEXTAREA`:return Rl;default:switch(t){case`checkbox`:return zl;case`radio`:return Vl;default:return Rl}}}function Yl(e,t,n,r,i){let a=Jl(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function Xl(){Rl.getSSRProps=({value:e})=>({value:e}),Vl.getSSRProps=({value:e},t)=>{if(t.props&&Ee(t.props.value,e))return{checked:!0}},zl.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&De(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},ql.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=Jl(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var Zl=[`ctrl`,`shift`,`alt`,`meta`],Ql={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Zl.some(n=>e[`${n}Key`]&&!t.includes(n))},$l=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=Ql[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},eu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},tu=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=re(n.key);if(t.some(e=>e===r||eu[e]===r))return e(n)}))},nu=l({patchProp:pl},pc),ru,iu=!1;function au(){return ru||=Fo(nu)}function ou(){return ru=iu?ru:Io(nu),iu=!0,ru}var su=((...e)=>{au().render(...e)}),cu=((...e)=>{ou().hydrate(...e)}),lu=((...e)=>{let t=au().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=fu(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,du(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),uu=( Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Bp;function Vp(e){Bp=e}var Hp=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Up(e){let t=e instanceof Hp?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Wp(e,t){let n=await fetch(e,t);if(Bp?.(n.status===401),!n.ok)throw new Hp(await zp(n),n.status);return n}async function Gp(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Lp,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Wp(e,s);return a?await c.json():void 0}var Kp={health:()=>Gp(`/health/detailed`),services:()=>Gp(`/api/services`),policies:()=>Gp(`/api/access/policies`),putPolicy:e=>Gp(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Gp(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),summary:()=>Gp(`/api/summary`),tasks:()=>Gp(`/api/tasks`),taskMeta:()=>Gp(`/api/task-meta`),task:e=>Gp(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Gp(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Gp(`/api/tasks/${encodeURIComponent(e)}/changes`+Rp(t)),taskDebug:(e,t)=>Gp(`/api/tasks/${encodeURIComponent(e)}/debug`+Rp(t)),taskAction:(e,t,n)=>Gp(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Gp(`/api/setup`),capabilities:()=>Gp(`/api/capabilities`),workflows:()=>Gp(`/api/workflows`),workflowEnabled:(e,t)=>Gp(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>Gp(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Gp(`/api/skills`),channels:()=>Gp(`/api/channels`),curators:()=>Gp(`/api/curators`),channelReload:e=>Gp(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Gp(`/api/config`),logs:e=>Gp(`/api/logs`+Rp(e)),taskLogs:(e,t)=>Gp(`/api/tasks/${encodeURIComponent(e)}/logs`+Rp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>Gp(`/api/version`),updateSnapshot:()=>Gp(`/api/chat/update`),updateInstall:e=>Gp(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>Gp(`/api/captures`+Rp({limit:e})),eventTypes:()=>Gp(`/api/event-types`),eventTypeCreate:e=>Gp(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>Gp(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>Gp(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>Gp(`/api/mappings`),mappingCreate:e=>Gp(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Gp(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Gp(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Gp(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Gp(`/api/bindings`),bindingCreate:e=>Gp(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Gp(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Gp(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Gp(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),harnessBindings:()=>Gp(`/api/harness/bindings`),sources:()=>Gp(`/api/sources`),sourceCreate:e=>Gp(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>Gp(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>Gp(`/api/sources/${encodeURIComponent(e)}/approve-unsigned`,{method:`POST`}),sourceSecret:e=>Gp(`/api/sources/${encodeURIComponent(e)}/secret`,{method:`POST`}),chatSessions:()=>Gp(`/api/chat/sessions`),chatMessages:e=>Gp(`/api/chat/sessions/${encodeURIComponent(e)}/messages`),chatTurns:e=>Gp(`/api/chat/sessions/${encodeURIComponent(e)}/turns`),chatCancel:e=>Gp(`/api/chat/cancel`,{method:`POST`,body:{session_id:e}}),chatMessage:(e,t)=>Gp(`/api/chat/message`,{method:`POST`,body:{channel_id:e,source_id:Ip(),text:t,page:location.pathname+location.search||`/`}}),chatPersona:(e,t)=>Gp(`/api/chat/persona`,{method:`POST`,body:{session_id:e,name:t}}),chatDangerous:()=>Gp(`/api/chat/dangerous`),chatDangerousRequest:(e,t)=>Gp(`/api/chat/dangerous/${encodeURIComponent(e)}`,{method:`POST`,body:{spec:t}}),chatDangerousDecision:(e,t)=>Gp(`/api/chat/dangerous/${encodeURIComponent(e)}/decision`,{method:`POST`,body:{decision:t}}),chatStream:(e,t={})=>Wp(`/api/chat/stream`,{method:`POST`,headers:{Accept:`text/event-stream`,"Content-Type":`application/json`,"X-Archie-CSRF":`1`},body:JSON.stringify(e),signal:t.signal})};function qp(e,t,n=``,r=!1){let i=new EventSource(Fp(n,r));return i.onopen=()=>t(`lLine truncated
`);u=r.pop()||``;for(let e of r){let t=e.split(`
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(lm.value=n.session_id),n.type===`delta`&&(o+=n.text,mm.value=mm.value?{...mm.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],mm.value=mm.value?{...mm.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);um.value=[...um.value,{from:`assistant`,text:o,tool_calls:a}],mm.value=null,fm.value=`Ready`,await km()}catch(e){let t=e;t.name===`AbortError`&&!c?(mm.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},fm.value=`Stopped`):(mm.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?im(r):void 0,isRetry:i},fm.value=`Error — retry available`)}finally{clearTimeout(l),Dm=null,pm.value=!1}}function Hm(){fm.value=`Stopping…`,lm.value&&qp.chatCancel(lm.value).catch(()=>{}),Om()}function Um(){Qi(()=>{km().catch(e=>{fm.value=e.message||`Chat unavailable`})}),na(()=>{Om()})}var iee=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],aee=L({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return X(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(V(),H(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":P(om),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:j(r(!e.open))},[G(P(Md),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:j(r(e.open))},[G(P(nf),{size:22})],2)],8,iee))}});function Wm(e){return typeof e==`string`?`'${e}'`:new see().serialize(e)}var oee=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Gm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[oee.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Km(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Gm[n]?Gm[n]:n+128,s=a<128&&Gm[a]?Gm[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var see=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Km(e,t):n===`number`&&r===`number`?e-t:Km(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Km),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float6Line truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(cm.value=n.session_id),n.type===`delta`&&(o+=n.text,pm.value=pm.value?{...pm.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],pm.value=pm.value?{...pm.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);lm.value=[...lm.value,{from:`assistant`,text:o,tool_calls:a}],pm.value=null,dm.value=`Ready`,await Om()}catch(e){let t=e;t.name===`AbortError`&&!c?(pm.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},dm.value=`Stopped`):(pm.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?rm(r):void 0,isRetry:i},dm.value=`Error — retry available`)}finally{clearTimeout(l),Em=null,fm.value=!1}}function see(){dm.value=`Stopping…`,cm.value&&Kp.chatCancel(cm.value).catch(()=>{}),Dm()}function cee(){Zi(()=>{Om().catch(e=>{dm.value=e.message||`Chat unavailable`})}),ta(()=>{Dm()})}var lee=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],uee=L({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return X(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(V(),H(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":P(am),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:j(r(!e.open))},[G(P(Md),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:j(r(e.open))},[G(P(nf),{size:22})],2)],8,lee))}});function Vm(e){return typeof e==`string`?`'${e}'`:new fee().serialize(e)}var dee=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Hm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[dee.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Um(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Hm[n]?Hm[n]:n+128,s=a<128&&Hm[a]?Hm[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var fee=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Um(e,t):n===`number`&&r===`number`?e-t:Um(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Um),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`FloaLine truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?Zs(t.default({present:o.value})[0],{ref:e=>{let t=wh(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Hg=L({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=Bh(n.default()),r=e.findIndex(e=>e.type!==os);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?J(t,i.props):t,o=xs({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Ug=[`area`,`img`,`input`],Wg=L({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Ug.includes(r)?()=>Zs(r,t):r===`template`?()=>Zs(Hg,t,{default:n.default}):()=>Zs(e.as,t,{default:n.default})}});function Gg(){let e=N();return{primitiveElement:e,currentElement:Y(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:wh(e))}}var[Kg,qg]=Zm(`CollapsibleRoot`),Jg=L({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=zh(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=xn(r);return qg({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Z(),(e,t)=>(V(),U(P(Wg),{as:e.as,"as-child":r.asChild,"data-state":P(i)?`open`:`closed`,"data-disabled":P(a)?``:void 0},{default:F(()=>[z(e.$slots,`default`,{open:P(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),Yg=L({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=Kg();i.contentId||=jg(void 0,`reka-collapsible-content`);let a=N(),{forwardRef:o,currentElement:s}=Z(),c=N(0),l=N(0),u=Y(()=>i.open.value),d=N(u.value),f=N();I(()=>[u.value,a.value?.present],async()=>{await er();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=Y(()=>d.value&&i.open.value);return Qi(()=>{requestAnimationFrame(()=>{d.value=!1})}),Th(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(V(),U(P(Vg),{ref_key:`presentRef`,ref:a,present:e.forceMount||P(i).open.value,"force-mount":!0},{default:F(({present:t})=>[G(P(Wg),J(e.$attrs,{id:P(i).contentId,ref:P(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:P(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:P(i).open.value?`open`:`closed`,"data-disabled":P(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:F(()=>[!P(i).unmountOnHide.value||t?z(e.$slots,`default`,{key:0}):q(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),Xg=L({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Z();let n=Kg();return(e,r)=>(V(),U(P(Wg),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":P(n).contentId,"aria-expanded":P(n).open.value,"data-state":P(n).open.value?`open`:`closed`,"data-disabled":P(n).disabled?.value?``:void 0,disabled:P(n).disabled?.value,onClick:P(n).onOpenToggle},{default:F(()=>[z(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function Zg({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Qg({type:e,defaultValue:t,modelValue:n}){return e||Zg({type:e,defaultValue:t,modelValue:n})}function $g({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function e_(e,t){let n=Y(()=>Qg(e)),r=zh(e,`modelValue`,t,{defaultValue:$g(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=qm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(th(t,e)){let n=t.findIndex(t=>qm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:Y(()=>n.value===`single`)}}var[t_,n_]=Zm(`AccordionRoot`),r_=L({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:! Line truncated
`))}return()=>i.value||r.value||o.value?Xs(t.default({present:o.value})[0],{ref:e=>{let t=xh(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),zg=L({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=Lh(n.default()),r=e.findIndex(e=>e.type!==as);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?J(t,i.props):t,o=bs({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Bg=[`area`,`img`,`input`],Vg=L({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Bg.includes(r)?()=>Xs(r,t):r===`template`?()=>Xs(zg,t,{default:n.default}):()=>Xs(e.as,t,{default:n.default})}});function Hg(){let e=N();return{primitiveElement:e,currentElement:Y(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:xh(e))}}var[Ug,Wg]=Jm(`CollapsibleRoot`),Gg=L({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=Ih(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=xn(r);return Wg({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Z(),(e,t)=>(V(),U(P(Vg),{as:e.as,"as-child":r.asChild,"data-state":P(i)?`open`:`closed`,"data-disabled":P(a)?``:void 0},{default:F(()=>[z(e.$slots,`default`,{open:P(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),Kg=L({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=Ug();i.contentId||=Og(void 0,`reka-collapsible-content`);let a=N(),{forwardRef:o,currentElement:s}=Z(),c=N(0),l=N(0),u=Y(()=>i.open.value),d=N(u.value),f=N();I(()=>[u.value,a.value?.present],async()=>{await $n();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=Y(()=>d.value&&i.open.value);return Zi(()=>{requestAnimationFrame(()=>{d.value=!1})}),Sh(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(V(),U(P(Rg),{ref_key:`presentRef`,ref:a,present:e.forceMount||P(i).open.value,"force-mount":!0},{default:F(({present:t})=>[G(P(Vg),J(e.$attrs,{id:P(i).contentId,ref:P(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:P(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:P(i).open.value?`open`:`closed`,"data-disabled":P(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:F(()=>[!P(i).unmountOnHide.value||t?z(e.$slots,`default`,{key:0}):q(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),qg=L({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Z();let n=Ug();return(e,r)=>(V(),U(P(Vg),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":P(n).contentId,"aria-expanded":P(n).open.value,"data-state":P(n).open.value?`open`:`closed`,"data-disabled":P(n).disabled?.value?``:void 0,disabled:P(n).disabled?.value,onClick:P(n).onOpenToggle},{default:F(()=>[z(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function Jg({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Yg({type:e,defaultValue:t,modelValue:n}){return e||Jg({type:e,defaultValue:t,modelValue:n})}function Xg({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Zg(e,t){let n=Y(()=>Yg(e)),r=Ih(e,`modelValue`,t,{defaultValue:Xg(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Wm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(Qm(t,e)){let n=t.findIndex(t=>Wm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:Y(()=>n.value===`single`)}}var[Qg,$g]=Jm(`AccordionRoot`),e_=L({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:! Line truncated
- a positive number
- less than the value passed to \`max\` (or ${TS} if no \`max\` prop is set)
- less than the value passed to \`max\` (or ${SS} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`),null)}function AS(e){return OS(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${TS}\`.`),TS)}var jS=L({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:TS},getValueLabel:{type:Function,required:!1,default:(e,t)=>OS(e)?`${Math.round(e/t*TS)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Z();let i=zh(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=zh(n,`max`,r,{passive:n.max===void 0});I(()=>i.value,async e=>{let t=kS(e,n.max);t!==e&&(await er(),i.value=t)},{immediate:!0}),I(()=>n.max,e=>{let t=AS(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=Y(()=>eh(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return DS({modelValue:i,max:a,progressState:o}),(e,t)=>(V(),U(P(Wg),{"as-child":e.asChild,as:e.as,"aria-valuemax":P(a),"aria-valuemin":0,"aria-valuenow":OS(P(i))?P(i):void 0,"aria-valuetext":e.getValueText?.(P(i),P(a)),"aria-label":e.getValueLabel(P(i),P(a)),role:`progressbar`,"data-state":o.value,"data-value":P(i)??void 0,"data-max":P(a)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),MS=L({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=ES();return Z(),(e,r)=>(V(),U(P(Wg),J(t,{"data-state":P(n).progressState.value,"data-value":P(n).modelValue?.value??void 0,"data-max":P(n).max.value}),{default:F(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),NS=`radio.select`;function PS(e,t,n){$m(NS,n,{originalEvent:e,value:t})}var FS=L({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=zh(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=xn(n),{forwardRef:o,currentElement:s}=Z(),c=lg(s),l=fg(),u=Y(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||PS(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(V(),H(B,null,[G(P(Wg),J({id:e.id,ref:P(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":P(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":P(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:P(a),required:e.required,name:e.name},{...P(l),...e.$attrs},{onClick:tu(d,[`stop`])}),{default:F(()=>[z(e.$slots,`default`,{checked:P(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),P(c)&&e.name?(V(),U(P(_v),J({key:0,type:`radio`,tabindex:`-1`,value:P(a),checked:!!P(i),name:e.name,disabled:e.disabled,required:e.required},P(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):q(`v-if`,!0)],64))}}),[IS,LS]=Zm(`RadioGroupRoot`),RS=L({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Z(),o=zh(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=xn(n),p=ig(f),m=lg(a);return LS({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(V(),U(P($b),{"as-child":``,orientation:P(l),dir:P(p),loop:P(c)},{default:F(()=>[G(P(Wg),{ref:P(i),role:`radiogroup`,"data-disabled":P(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":P(l),"aria-required":P(d),dir:P(p)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(o)}),P(m)&&P(u)?(V(),U(P(_v),{key:0,required:P(d),disabled:P(s),value:P(o),name:P(u)},null,8,[`required`,`disabled`,`value`,`name`])):q(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[dee,zS]=Zm(`RadioGroupItem`),BS=L({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nuLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:PE(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>PE(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=IE(c),u=e+1<n.length?IE(n[e+1]):null;if(l&&u&&LE(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=IE(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>PE(e)),rows:r.map(e=>e.map(e=>PE(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:PE(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:PE(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function IE(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 LE(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var RE={class:`[overflow-wrap:anywhere]`},zE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},BE={class:`font-mono text-[0.85em]`},VE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},HE={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},UE={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},WE={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},GE={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},KE={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},qE={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},JE={key:8,class:`mb-2.5 last:mb-0`},YE=L({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>FE(t.text));return(e,t)=>(V(),H(`div`,RE,[(V(!0),H(B,null,R(n.value,(e,t)=>(V(),H(B,{key:t},[e.kind===`pre`?(V(),H(`pre`,zE,[W(`code`,BE,M(e.code),1)])):e.kind===`table`?(V(),H(`table`,VE,[W(`thead`,null,[W(`tr`,null,[(V(!0),H(B,null,R(e.head,(e,t)=>(V(),H(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[G(ME,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(V(!0),H(B,null,R(e.rows,(e,t)=>(V(),H(`tr`,{key:t},[(V(!0),H(B,null,R(e,(e,t)=>(V(),H(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[G(ME,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(V(),H(`blockquote`,HE,[G(ME,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(V(),H(`h1`,UE,[G(ME,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(V(),H(`h2`,WE,[G(ME,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(V(),H(`h3`,GE,[G(ME,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(V(),H(`ul`,KE,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(ME,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(V(),H(`ol`,qE,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(ME,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(V(),H(`p`,JE,[G(ME,{inline:e.inline},null,8,[`inline`])])):q(``,!0)],64))),128))]))}}),XE={class:`truncate`},ZE=L({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=ca(`RouterLink`);return V(),U(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:F(()=>[G(P(dd),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,XE,M(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),QE={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},$E={class:`font-semibold text-foreground`},eD={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},tD=L({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>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?(V(),U(ZE,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(V(),H(`div`,QE,[G(P(tf),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,$E,M(n.value),1),r.value?(V(),H(`code`,eD,M(r.value),1)):q(``,!0),W(`span`,{class:j(P(X)(`text-fg-muted`,i.value&&`text-danger`))},M(a.value),3)]))}}),nD={key:0,class:`mb-2 grid gap-0.5 text-xs`},rD={key:1,class:`mb-2 flex flex-wrap gap-1.5`},iD={key:3,class:`whitespace-pre-wrap`},aD=L({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(V(),H(`div`,{class:j([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:j(P(X)(`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?(V(),H(`div`,nD,[(V(!0),H(B,null,R(e.tools,(t,n)=>(V(),U(tD,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):q(``,!0),e.media.length?(V(),H(`div`,rD,[(V(!0),H(B,null,R(e.media,(e,t)=>(V(),U(TE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):q(``,!0),e.assistant?(V(),U(YE,{key:2,text:e.text},null,8,[`text`])):(V(),H(`div`,iD,M(e.text),1)),z(t.$slots,`default`)],2)],2))}}),oD={class:`w-full self-center justify-self-center py-6 text-center`},sD={class:`grid gap-2`},cD=[`onClick`],lD=L({__name:`ChatEmptyState`,emits:[`proLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>OM?`${n.slice(0,OM).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var AM=[`title`],jM=L({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>tM(n.event)),a=Y(()=>kM(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=Y(()=>n.event.at?lj(n.event.at):`—`);return(e,t)=>(V(),U(P(TM),{class:j(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:[ru(tu(o,[`prevent`]),[`enter`]),ru(tu(o,[`prevent`]),[`space`])]},{default:F(()=>[G(P($),{class:`font-medium`},{default:F(()=>[K(M(n.event.kind||n.event.type||`event`),1)]),_:1}),G(P($),{class:`font-mono`},{default:F(()=>[K(M(i.value>0?`#${i.value}`:`—`),1)]),_:1}),G(P($),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},M(a.value.text),9,AM)]),_:1}),G(P($),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),MM=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function NM(e){return(Number(e?.task_id)||0)>0}function PM(e,t){return t===`tasks`?NM(e):t!==`system`||!NM(e)}function FM(e,t){return e.filter(e=>PM(e,t))}function IM(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function LM(e,t){return`${e}:${t??0}`}function RM(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=LM(kM(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 zM={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},BM={class:`max-h-[28rem] overflow-y-auto`},VM=[`aria-expanded`,`aria-label`,`onClick`],HM=[`title`],UM=L({__name:`LiveActivityCard`,setup(e){let t=MD(),{activity:n,streamKind:r,streamState:i}=Xu(fA()),a=N(`all`),o=Y(()=>FM(n.value,a.value)),s=Y(()=>IM(o.value.length,a.value)),c=Zt(new Set),l=Y(()=>RM(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 kM(e.representative)}function p(e){return e.representative.at?lj(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(V(),U(P(nj),null,{default:F(()=>[G(P(sj),null,{default:F(()=>[G(P(cj),null,{default:F(()=>[...t[1]||=[K(`Live activity`,-1)]]),_:1}),G(P(rj),{class:`flex items-center gap-2`},{default:F(()=>[G(P(xM),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:P(MM)},null,8,[`modelValue`,`options`]),G(P($A),{variant:P(r)},{default:F(()=>[K(M(P(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),G(P(ij),null,{default:F(()=>[W(`div`,zM,[W(`div`,BM,[G(P(CM),null,{default:F(()=>[G(P(DM),{class:`sticky top-0 z-10 bg-card`},{default:F(()=>[G(P(TM),null,{default:F(()=>[G(P(EM),null,{default:F(()=>[...t[2]||=[K(`Event`,-1)]]),_:1}),G(P(EM),null,{default:F(()=>[...t[3]||=[K(`Task`,-1)]]),_:1}),G(P(EM),null,{default:F(()=>[...t[4]||=[K(`Detail`,-1)]]),_:1}),G(P(EM),null,{default:F(()=>[...t[5]||=[K(`When`,-1)]]),_:1})]),_:1})]),_:1}),G(P(wM),null,{default:F(()=>[o.value.length?q(``,!0):(V(),U(P(TM),{key:0},{default:F(()=>[G(P($),{colspan:`4`},{default:F(()=>[G(P(GA),null,{default:F(()=>[G(P(JA),null,{default:F(()=>[G(P(ZA),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(V(!0),H(B,{key:1},R(l.value,e=>(V(),H(B,{key:e.key},[e.count===1?(V(),U(jM,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(V(),H(B,{key:1},[G(P(TM),{class:j(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:[ru(tu(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),ru(tu(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:F(()=>[G(P($),{class:`font-medium`},{default:F(()=>[W(`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:tu(t=>u(e.key),[`stop`])},[d(e)?(V(),U(P(hd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(V(),U(P(gd),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),K(` `+M(e.label)+` `,1),G(P($A),{variant:`idle`},{default:F(()=>[K(`×`+M(e.count),1)]),_:2},1024)],8,VM)]),_:2},1024),G(P($),{class:`font-mono`},{default:F(()=>[K(M(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),G(P($),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},M(f(e).text),9,HM)]),_:2},1024),G(P($),null,{default:F(()=>[K(M(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(V(!0),H(B,{key:0},R(e.events,(t,n)=>(V(),U(jM,{key:`${e.key}:${n}`,event:t,onO 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 oP(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 sP(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 cP(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 lP(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 uP=N([]),dP=N([]),fP=N(!0),pP=N(null),mP=N(null),hP=N(!1),gP=N(null);async function _P(){try{let e=await qp.eventTypes();fP.value=e.enabled!==!1,uP.value=e.event_types||[],dP.value=e.proposals||[],pP.value=null}catch(e){pP.value=e.message||String(e)}}function vP(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function yP(e){gP.value=null,mP.value=e}function bP(e){let t=OP.value.find(t=>String(t.id)===e.sample_id);yP({mode:`proposal`,id:null,source:e.source,name:``,rule:vP(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function xP(e=``){yP({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function SP(e){yP({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:vP(e.rule),headersText:``,body:``,exampleHeaders:{}})}function CP(){mP.value=null}async function wP(){let e=mP.value;if(e){hP.value=!0;try{if(e.mode===`edit`&&e.id)await qp.eventTypeUpdate(e.id,{name:e.name,rule:lP(e.rule)});else{let t=e.mode===`paste`?aP(e.headersText):e.exampleHeaders;await qp.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:lP(e.rule),example:{headers:t,body:e.body}})}mP.value=null,await _P()}catch(e){gP.value=e.message||String(e)}finally{hP.value=!1}}}var TP=N(null);async function EP(){let e=TP.value;if(TP.value=null,e)try{await qp.eventTypeDelete(e.id),await _P()}catch(e){pP.value=e.message||String(e)}}var DP=100,OP=N([]),kP=N(!0),AP=N(null),jP=N(!0),MP=N(null);async function NP(){try{let e=await qp.captures(DP);kP.value=e.enabled!==!1,OP.value=e.captures||[],AP.value=null}catch(e){AP.value=e.message||String(e)}finally{jP.value=!1}}function PP(e){let t=OP.value.find(t=>t.id===e);return t&&(MP.value=t),!!t}function FP(){OP.value.length&&(MP.value=OP.value[0])}function IP(){pA(`captures`,()=>{NP(),_P()})}var LP=`archie.theme`,RP=`archie.density`,zP=`archie.motion`,BP=`archie.tooltips`;function VP(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function HP(e,t){try{localStorage.setItem(e,t)}catch{}}function UP(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var WP=Yu(`appearance`,()=>{let e=N(VP(LP,[`system`,`dark`,`light`],`dark`)),t=N(VP(RP,[`comfortable`,`compact`],`comfortable`)),n=N(VP(zP,[`system`,`reduced`],`system`)),r=N(VP(BP,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=UP(e.value)}function o(t){e.value=t,a(),HP(LP,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,HP(RP,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,HP(zP,e)}function l(e){r.value=e,HP(BP,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}}),GP=L({__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=dg(n,t),{tooltipsEnabled:i}=Xu(WP());return(e,t)=>(V(),U(P(nw),J({"data-slot":`tooltip`},P(r),{disabled:n.disabled||!P(i)}),{default:F(t=>[z(e.$slots,`default`,ve(bs(t)))]),_:3},16,[`disabled`]))}}),KP=L({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=dg(Sw(n,`class`),r);return(e,t)=>(V(),U(P(ow),null,{defau Line truncated
Defaulting to \`null\`.`),null)}function DS(e){return TS(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${SS}\`.`),SS)}var OS=L({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:SS},getValueLabel:{type:Function,required:!1,default:(e,t)=>TS(e)?`${Math.round(e/t*SS)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Z();let i=Ih(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=Ih(n,`max`,r,{passive:n.max===void 0});I(()=>i.value,async e=>{let t=ES(e,n.max);t!==e&&(await $n(),i.value=t)},{immediate:!0}),I(()=>n.max,e=>{let t=DS(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=Y(()=>Zm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return wS({modelValue:i,max:a,progressState:o}),(e,t)=>(V(),U(P(Vg),{"as-child":e.asChild,as:e.as,"aria-valuemax":P(a),"aria-valuemin":0,"aria-valuenow":TS(P(i))?P(i):void 0,"aria-valuetext":e.getValueText?.(P(i),P(a)),"aria-label":e.getValueLabel(P(i),P(a)),role:`progressbar`,"data-state":o.value,"data-value":P(i)??void 0,"data-max":P(a)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),kS=L({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=CS();return Z(),(e,r)=>(V(),U(P(Vg),J(t,{"data-state":P(n).progressState.value,"data-value":P(n).modelValue?.value??void 0,"data-max":P(n).max.value}),{default:F(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),AS=`radio.select`;function jS(e,t,n){Xm(AS,n,{originalEvent:e,value:t})}var MS=L({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=Ih(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=xn(n),{forwardRef:o,currentElement:s}=Z(),c=og(s),l=lg(),u=Y(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||jS(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(V(),H(B,null,[G(P(Vg),J({id:e.id,ref:P(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":P(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":P(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:P(a),required:e.required,name:e.name},{...P(l),...e.$attrs},{onClick:$l(d,[`stop`])}),{default:F(()=>[z(e.$slots,`default`,{checked:P(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),P(c)&&e.name?(V(),U(P(mv),J({key:0,type:`radio`,tabindex:`-1`,value:P(a),checked:!!P(i),name:e.name,disabled:e.disabled,required:e.required},P(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):q(`v-if`,!0)],64))}}),[NS,PS]=Jm(`RadioGroupRoot`),FS=L({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Z(),o=Ih(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=xn(n),p=tg(f),m=og(a);return PS({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(V(),U(P(Xb),{"as-child":``,orientation:P(l),dir:P(p),loop:P(c)},{default:F(()=>[G(P(Vg),{ref:P(i),role:`radiogroup`,"data-disabled":P(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":P(l),"aria-required":P(d),dir:P(p)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(o)}),P(m)&&P(u)?(V(),U(P(mv),{key:0,required:P(d),disabled:P(s),value:P(o),name:P(u)},null,8,[`required`,`disabled`,`value`,`name`])):q(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[gee,IS]=Jm(`RadioGroupItem`),LS=L({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nuLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:jE(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>jE(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=NE(c),u=e+1<n.length?NE(n[e+1]):null;if(l&&u&&PE(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=NE(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>jE(e)),rows:r.map(e=>e.map(e=>jE(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:jE(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:jE(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function NE(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 PE(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var FE={class:`[overflow-wrap:anywhere]`},IE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},LE={class:`font-mono text-[0.85em]`},RE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},zE={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},BE={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},VE={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},HE={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},UE={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},WE={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},GE={key:8,class:`mb-2.5 last:mb-0`},KE=L({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>ME(t.text));return(e,t)=>(V(),H(`div`,FE,[(V(!0),H(B,null,R(n.value,(e,t)=>(V(),H(B,{key:t},[e.kind===`pre`?(V(),H(`pre`,IE,[W(`code`,LE,M(e.code),1)])):e.kind===`table`?(V(),H(`table`,RE,[W(`thead`,null,[W(`tr`,null,[(V(!0),H(B,null,R(e.head,(e,t)=>(V(),H(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[G(kE,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(V(!0),H(B,null,R(e.rows,(e,t)=>(V(),H(`tr`,{key:t},[(V(!0),H(B,null,R(e,(e,t)=>(V(),H(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[G(kE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(V(),H(`blockquote`,zE,[G(kE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(V(),H(`h1`,BE,[G(kE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(V(),H(`h2`,VE,[G(kE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(V(),H(`h3`,HE,[G(kE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(V(),H(`ul`,UE,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(kE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(V(),H(`ol`,WE,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(kE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(V(),H(`p`,GE,[G(kE,{inline:e.inline},null,8,[`inline`])])):q(``,!0)],64))),128))]))}}),qE={class:`truncate`},JE=L({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=sa(`RouterLink`);return V(),U(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:F(()=>[G(P(ld),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,qE,M(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),YE={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},XE={class:`font-semibold text-foreground`},ZE={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},QE=L({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>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?(V(),U(JE,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(V(),H(`div`,YE,[G(P(tf),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,XE,M(n.value),1),r.value?(V(),H(`code`,ZE,M(r.value),1)):q(``,!0),W(`span`,{class:j(P(X)(`text-fg-muted`,i.value&&`text-danger`))},M(a.value),3)]))}}),$E={key:0,class:`mb-2 grid gap-0.5 text-xs`},eD={key:1,class:`mb-2 flex flex-wrap gap-1.5`},tD={key:3,class:`whitespace-pre-wrap`},nD=L({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(V(),H(`div`,{class:j([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:j(P(X)(`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?(V(),H(`div`,$E,[(V(!0),H(B,null,R(e.tools,(t,n)=>(V(),U(QE,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):q(``,!0),e.media.length?(V(),H(`div`,eD,[(V(!0),H(B,null,R(e.media,(e,t)=>(V(),U(SE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):q(``,!0),e.assistant?(V(),U(KE,{key:2,text:e.text},null,8,[`text`])):(V(),H(`div`,tD,M(e.text),1)),z(t.$slots,`default`)],2)],2))}}),rD={class:`w-full self-center justify-self-center py-6 text-center`},iD={class:`grid gap-2`},aD=[`onClick`],oD=L({__name:`ChatEmptyState`,emits:[`proLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>SM?`${n.slice(0,SM).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var wM=[`title`],TM=L({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>Yj(n.event)),a=Y(()=>CM(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=Y(()=>n.event.at?rj(n.event.at):`—`);return(e,t)=>(V(),U(P(yM),{class:j(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:[tu($l(o,[`prevent`]),[`enter`]),tu($l(o,[`prevent`]),[`space`])]},{default:F(()=>[G(P($),{class:`font-medium`},{default:F(()=>[K(M(n.event.kind||n.event.type||`event`),1)]),_:1}),G(P($),{class:`font-mono`},{default:F(()=>[K(M(i.value>0?`#${i.value}`:`—`),1)]),_:1}),G(P($),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},M(a.value.text),9,wM)]),_:1}),G(P($),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),EM=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function DM(e){return(Number(e?.task_id)||0)>0}function OM(e,t){return t===`tasks`?DM(e):t!==`system`||!DM(e)}function kM(e,t){return e.filter(e=>OM(e,t))}function AM(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function jM(e,t){return`${e}:${t??0}`}function MM(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=jM(CM(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 NM={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},PM={class:`max-h-[28rem] overflow-y-auto`},FM=[`aria-expanded`,`aria-label`,`onClick`],IM=[`title`],LM=L({__name:`LiveActivityCard`,setup(e){let t=OD(),{activity:n,streamKind:r,streamState:i}=Ju(oA()),a=N(`all`),o=Y(()=>kM(n.value,a.value)),s=Y(()=>AM(o.value.length,a.value)),c=Zt(new Set),l=Y(()=>MM(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 CM(e.representative)}function p(e){return e.representative.at?rj(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(V(),U(P(XA),null,{default:F(()=>[G(P(tj),null,{default:F(()=>[G(P(nj),null,{default:F(()=>[...t[1]||=[K(`Live activity`,-1)]]),_:1}),G(P(ZA),{class:`flex items-center gap-2`},{default:F(()=>[G(P(hM),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:P(EM)},null,8,[`modelValue`,`options`]),G(P(qA),{variant:P(r)},{default:F(()=>[K(M(P(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),G(P(QA),null,{default:F(()=>[W(`div`,NM,[W(`div`,PM,[G(P(_M),null,{default:F(()=>[G(P(xM),{class:`sticky top-0 z-10 bg-card`},{default:F(()=>[G(P(yM),null,{default:F(()=>[G(P(bM),null,{default:F(()=>[...t[2]||=[K(`Event`,-1)]]),_:1}),G(P(bM),null,{default:F(()=>[...t[3]||=[K(`Task`,-1)]]),_:1}),G(P(bM),null,{default:F(()=>[...t[4]||=[K(`Detail`,-1)]]),_:1}),G(P(bM),null,{default:F(()=>[...t[5]||=[K(`When`,-1)]]),_:1})]),_:1})]),_:1}),G(P(vM),null,{default:F(()=>[o.value.length?q(``,!0):(V(),U(P(yM),{key:0},{default:F(()=>[G(P($),{colspan:`4`},{default:F(()=>[G(P(zA),null,{default:F(()=>[G(P(HA),null,{default:F(()=>[G(P(GA),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(V(!0),H(B,{key:1},R(l.value,e=>(V(),H(B,{key:e.key},[e.count===1?(V(),U(TM,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(V(),H(B,{key:1},[G(P(yM),{class:j(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:[tu($l(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),tu($l(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:F(()=>[G(P($),{class:`font-medium`},{default:F(()=>[W(`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:$l(t=>u(e.key),[`stop`])},[d(e)?(V(),U(P(md),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(V(),U(P(hd),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),K(` `+M(e.label)+` `,1),G(P(qA),{variant:`idle`},{default:F(()=>[K(`×`+M(e.count),1)]),_:2},1024)],8,FM)]),_:2},1024),G(P($),{class:`font-mono`},{default:F(()=>[K(M(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),G(P($),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},M(f(e).text),9,IM)]),_:2},1024),G(P($),null,{default:F(()=>[K(M(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(V(!0),H(B,{key:0},R(e.events,(t,n)=>(V(),U(TM,{key:`${e.key}:${n}`,event:t,onO 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 eP(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 tP(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 nP(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 rP(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 iP=N([]),aP=N([]),oP=N(!0),sP=N(null),cP=N(null),lP=N(!1),uP=N(null);async function dP(){try{let e=await Kp.eventTypes();oP.value=e.enabled!==!1,iP.value=e.event_types||[],aP.value=e.proposals||[],sP.value=null}catch(e){sP.value=e.message||String(e)}}function fP(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function pP(e){uP.value=null,cP.value=e}function mP(e){let t=SP.value.find(t=>String(t.id)===e.sample_id);pP({mode:`proposal`,id:null,source:e.source,name:``,rule:fP(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function hP(e=``){pP({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function gP(e){pP({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:fP(e.rule),headersText:``,body:``,exampleHeaders:{}})}function _P(){cP.value=null}async function vP(){let e=cP.value;if(e){lP.value=!0;try{if(e.mode===`edit`&&e.id)await Kp.eventTypeUpdate(e.id,{name:e.name,rule:rP(e.rule)});else{let t=e.mode===`paste`?$N(e.headersText):e.exampleHeaders;await Kp.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:rP(e.rule),example:{headers:t,body:e.body}})}cP.value=null,await dP()}catch(e){uP.value=e.message||String(e)}finally{lP.value=!1}}}var yP=N(null);async function bP(){let e=yP.value;if(yP.value=null,e)try{await Kp.eventTypeDelete(e.id),await dP()}catch(e){sP.value=e.message||String(e)}}var xP=100,SP=N([]),CP=N(!0),wP=N(null),TP=N(!0),EP=N(null);async function DP(){try{let e=await Kp.captures(xP);CP.value=e.enabled!==!1,SP.value=e.captures||[],wP.value=null}catch(e){wP.value=e.message||String(e)}finally{TP.value=!1}}function OP(e){let t=SP.value.find(t=>t.id===e);return t&&(EP.value=t),!!t}function kP(){SP.value.length&&(EP.value=SP.value[0])}function AP(){sA(`captures`,()=>{DP(),dP()})}var jP=`archie.theme`,MP=`archie.density`,NP=`archie.motion`,PP=`archie.tooltips`;function FP(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function IP(e,t){try{localStorage.setItem(e,t)}catch{}}function LP(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var RP=qu(`appearance`,()=>{let e=N(FP(jP,[`system`,`dark`,`light`],`dark`)),t=N(FP(MP,[`comfortable`,`compact`],`comfortable`)),n=N(FP(NP,[`system`,`reduced`],`system`)),r=N(FP(PP,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=LP(e.value)}function o(t){e.value=t,a(),IP(jP,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,IP(MP,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,IP(NP,e)}function l(e){r.value=e,IP(PP,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}}),zP=L({__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=cg(n,t),{tooltipsEnabled:i}=Ju(RP());return(e,t)=>(V(),U(P($C),J({"data-slot":`tooltip`},P(r),{disabled:n.disabled||!P(i)}),{default:F(t=>[z(e.$slots,`default`,ve(ys(t)))]),_:3},16,[`disabled`]))}}),BP=L({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=cg(yw(n,`class`),r);return(e,t)=>(V(),U(P(rw),null,{defau Line truncated
`)}};Gq.defaultYaml={explicit:!1,version:`1.2`},Gq.defaultTags={"!!":`tag:yaml.org,2002:`};function Kq(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 qq(e){let t=new Set;return Rq(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Jq(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Yq(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=qq(e);let a=Jq(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Aq(t.node)||Mq(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 Xq(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=Xq(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=Xq(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=Xq(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=Xq(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function Zq(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Zq(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Pq(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 Qq=class{constructor(e){Object.defineProperty(this,Tq,{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(!Dq(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=Zq(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Xq(i,{"":o},``,o):o}},$q=class extends Qq{constructor(e){super(yq),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=[],Rq(e,{Node:(e,t)=>{(Eq(t)||Pq(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||=(Zq(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=eJ(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(Kq(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 eJ(e,t,n){if(Eq(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Mq(t)){let r=0;for(let i of t.items){let t=eJ(e,i,n);t>r&&(r=t)}return r}if(kq(t)){let r=eJ(e,t.key,n),i=eJ(e,t.value,n);return Math.max(r,i)}return 1}var tJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,nJ=class extends Qq{constructor(e){super(Cq),this.value=e}toJSON(e,t){return t?.keep?this.value:Zq(this.value,e,t)}toString(){return String(this.value)}};nJ.BLOCK_FOLDED=`BLOCK_FOLDED`,nJ.BLOCK_LITERAL=`BLOCK_LITERAL`,nJ.PLAIN=`PLAIN`,nJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,nJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var rJ=`tag:yaml.org,2002:`;function iJ(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 aJ(e,t,n){if(Dq(e)&&(e=e.contents),Nq(e))return e;if(kq(e)){let t=n.schema[xq].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 $q(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=rJ+t.slice(2));let l=iJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new nJ(e);return c&&(c.node=t),t Line truncated
`)?uJ(n,t):n.includes(`
`)?`
`+uJ(n,t):(e.endsWith(` `)?``:` `)+n,fJ=`flow`,pJ=`block`,mJ=`quoted`;function hJ(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=gJ(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=gJ(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 gJ(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 _J=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),vJ=e=>/^(%|---|\.\.\.)/m.test(e);function yJ(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 bJ(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(vJ(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:hJ(o,a,mJ,_J(t,!1))}function xJ(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return bJ(e,t);let n=t.indent||(vJ(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:hJ(r,n,fJ,_J(t,!1))}function SJ(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=bJ;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?xJ:i&&!t?bJ:n?xJ:bJ}return r(e,t)}var CJ;try{CJ=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{CJ=/\n+(?!\n|$)/g}function wJ({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 SJ(n,r);let l=r.indent||(r.forceBlockIndent||vJ(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===nJ.BLOCK_FOLDED?!1:t===nJ.BLOCK_LITERAL||!yJ(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(CJ,`$&${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=_J(r,!0);o!==`folded`&&t!==nJ.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=hJ(`${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 TJ(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 SJ(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?SJ(a,t):wJ(e,t,n,r);if(!s&&!u&&i!==nJ.PLAIN&&a.includes(`
`))return wJ(e,t,n,r);if(vJ(a)){if(c===``)return t.forceBlockIndent=!0,wJ(e,t,n,r);if(s&&c===l)return SJ(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 SJ(a,t)}return s?d:hJ(d,c,fJ,_J(t,!1))}function EJ(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!==nJ.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=nJ.QUOTE_DOUBLE);let c=e=>{switch(e){case nJ.BLOCK_FOLDED:case nJ.BLOCK_LITERAL:return i||a?SJ(o.value,t):wJ(o,t,n,r);case nJ.QUOTE_DOUBLE:return bJ(o.value,t);case nJ.QUOTE_SINGLE:return xJ(o.value,t);case nJ.PLAIN:return TJ(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 DJ(e,t){let n=Object.assign({blockQuote:!0,commentString:lJ,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 OJ(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(Aq(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 kJ(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Aq(e)||Mq(e))&&e.anchor;a&&Kq(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 AJ(e,t,n,r){if(kq(e))return e.toString(t,n,r);if(Eq(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=Nq(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=OJ(t.doc.schema.tags,a);let o=kJ(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):Aq(a)?EJ(a,t,n,r):a.toString(t,n,r);return o?Aq(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function jJ({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=Nq(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Mq(e)||!Nq(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||Mq(e)||(Aq(e)?e.type===nJ.BLOCK_FOLDED||e.type===nJ.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=AJ(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+=dJ(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=dJ(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=dJ(g,n.indent,l(f))));let _,v,y;Nq(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&&Aq(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&jq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=AJ(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${uJ(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&Mq(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+=dJ(g,n.indent,l(y)):h&&i&&i(),g}function MJ(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var NJ=`<<`,PJ={identify:e=>e===NJ||typeof e==`symbol`&&e.description===NJ,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new nJ(Symbol(NJ)),{addToJSMap:IJ}),stringify:()=>NJ},FJ=(e,t)=>(PJ.identify(t)||Aq(t)&&(!t.type||t.type===nJ.PLAIN)&&PJ.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===PJ.tag&&e.default);function IJ(e,t,n){let r=RJ(e,n);if(jq(r))for(let n of r.items)LJ(e,t,n);else if(Array.isArray(r))for(let n of r)LJ(e,t,n);else LJ(e,t,r)}function LJ(e,t,n){let r=RJ(e,n);if(!Oq(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 RJ(e,t){return e&&Eq(t)?t.resolve(e.doc,e):t}function zJ(e,t,{key:n,value:r}){if(Nq(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(FJ(e,n))IJ(e,t,r);else{let i=Zq(n,``,e);if(t instanceof Map)t.set(i,Zq(r,i,e));else if(t instanceof Set)t.add(i);else{let a=BJ(n,i,e),o=Zq(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function BJ(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Nq(e)&&n?.doc){let t=DJ(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)+`..."`),MJ(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 VJ(e,t,n){return new HJ(aJ(e,void 0,n),aJ(t,void 0,n))}var HJ=class e{constructor(e,t=null){Object.defineProperty(this,Tq,{value:Sq}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Nq(n)&&(n=n.clone(t)),Nq(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return zJ(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?jJ(this,e,t,n):JSON.stringify(this)}};function UJ(e,t,n){return(t.inFlow??e.flow?GJ:WJ)(e,t,n)}function WJ({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(Nq(i))!d&&i.spaceBefore&&f.push(``),KJ(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(kq(i)){let e=Nq(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),KJ(n,f,e.commentBefore,d))}d=!1;let s=AJ(i,u,()=>o=null,()=>d=!0);o&&(s+=dJ(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+=`
`+uJ(l(e),c),s&&s()):d&&o&&o(),p}function GJ({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(Nq(i))i.spaceBefore&&d.push(``),KJ(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(kq(i)){let e=Nq(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),KJ(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Nq(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=AJ(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+=dJ(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 KJ({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=uJ(t(r),e);n.push(i.trimStart())}}function qJ(e,t){let n=Aq(t)?t.value:t;for(let r of e)if(kq(r)&&(r.key===t||r.key===n||Aq(r.key)&&r.key.value===n))return r}var JJ=class extends cJ{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(xq,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(VJ(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=kq(e)?e:!e||typeof e!=`object`||!(`key`in e)?new HJ(e,e?.value):new HJ(e.key,e.value);let r=qJ(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Aq(r.value)&&tJ(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=qJ(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=qJ(this.items,e)?.value;return(!t&&Aq(n)?n.value:n)??void 0}has(e){return!!qJ(this.items,e)}set(e,t){this.add(new HJ(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)zJ(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!kq(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})),UJ(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},YJ={collection:`map`,default:!0,nodeClass:JJ,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Oq(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>JJ.from(e,t,n)},XJ=class extends cJ{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(wq,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=ZJ(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=ZJ(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Aq(r)?r.value:r}has(e){let t=ZJ(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=ZJ(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Aq(r)&&tJ(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(Zq(e,String(r++),t));return n}toString(e,t,n){return e?UJ(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(aJ(a,void 0,n))}}return i}};function ZJ(e){let t=Aq(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var QJ={collection:`seq`,default:!0,nodeClass:XJ,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return jq(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>XJ.from(e,t,n)},$J={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),EJ(e,t,n,r)}},eY={identify:e=>e==null,createNode:()=>new nJ(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new nJ(null),stringify:({source:e},t)=>typeof e==`string`&&eY.test.test(e)?e:t.options.nullStr},tY={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new nJ(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&tY.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function nY({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 rY={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:nY},iY={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 EJ({comment:e,type:t,value:s},r,i,a)}};function vY(e,t){if(jq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!kq(r)){if(Oq(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new HJ(new nJ(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]=kq(r)?r:new HJ(r)}}else t(`Expected a sequence for this tag`);return e}function yY(e,t,n){let{replacer:r}=n,i=new XJ(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(VJ(o,s,n))}return i}var bY={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:vY,createNode:yY},xY=class e extends XJ{constructor(){super(),this.add=JJ.prototype.add.bind(this),this.delete=JJ.prototype.delete.bind(this),this.get=JJ.prototype.get.bind(this),this.has=JJ.prototype.has.bind(this),this.set=JJ.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(kq(e)?(r=Zq(e.key,``,t),i=Zq(e.value,r,t)):r=Zq(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=yY(e,t,n),i=new this;return i.items=r.items,i}};xY.tag=`tag:yaml.org,2002:omap`;var SY={collection:`seq`,identify:e=>e instanceof Map,nodeClass:xY,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=vY(e,t),r=[];for(let{key:e}of n.items)Aq(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new xY,n)},createNode:(e,t,n)=>xY.from(e,t,n)};function CY({value:e,source:t},n){return t&&(e?wY:TY).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var wY={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 nJ(!0),stringify:CY},TY={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 nJ(!1),stringify:CY},EY={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:nY},DY={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():nY(e)}},OY={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 nJ(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:nY},kY=e=>typeof e==`bigint`||Number.isInteger(e);function AY(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 jY(e,t,n){let{value:r}=e;if(kY(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return nY(e)}var MY={identify:kY,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>AY(e,2,2,n),stringify:e=>jY(e,2,`0b`)},NY={identify:kY,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>AY(e,1,8,n),stringify:e=>jY(e,8,`0`)},PY={identify:kY,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>AY(e,0,10,n),stringify:nY},FY={identify:kY,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>AY(e,2,16,n),stringify:e=>jY(e,16,`0x`)},IY=class e extends JJ{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=kq(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new HJ(e.key,null):new HJ(e,null),qJ(this.items,t.key)||this.items.push(t)}get(e,t){let n=qJ(this.items,e);return!t&&kq(n)?Aq(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=qJ(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new HJ(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(uJ(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(uJ(a(t),``)))}return n.join(`
`)+`
`}var ZY=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Tq,{value:bq});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 Gq({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Tq]:{value:bq}});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=Nq(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){QY(this.contents)&&this.contents.add(e)}addIn(e,t){QY(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=qq(this);e.anchor=!t||n.has(t)?Jq(t||`a`,n):t}return new $q(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}=Yq(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=aJ(e,l,p);return o&&Mq(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new HJ(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return QY(this.contents)?this.contents.delete(e):!1}deleteIn(e){return sJ(e)?this.contents!=null&&(this.contents=null,!0):QY(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Mq(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return sJ(e)?!t&&Aq(this.contents)?this.contents.value:this.contents:Mq(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Mq(this.contents)?this.contents.has(e):!1}hasIn(e){return sJ(e)?this.contents!==void 0:Mq(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=oJ(this.schema,[e],t):QY(this.contents)&&this.contents.set(e,t)}setIn(e,t){sJ(e)?this.contents=t:this.contents==null?this.contents=oJ(this.schema,Array.from(e),t):QY(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 Gq({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 Gq({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 YY(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=Zq(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`?Xq(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 XY(this,e)}};function QY(e){if(Mq(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var $Y=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},eX=class extends $Y{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},tX=class extends $Y{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},nX=(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 rX(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 iX(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(iX(t.key)||iX(t.value))return!0}return!1;default:return!0}}function aX(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&iX(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function oX(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Aq(e)&&Aq(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var sX=`All mapping items must start at the same column`;function cX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??JJ)(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=rX(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`,sX)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||iX(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`,sX);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&aX(r.indent,u,i),n.atKey=!1,oX(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=rX(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&&aX(r.indent,f,i),s=c.range[2];let l=new HJ(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 HJ(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 lX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??XJ)(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=rX(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&&aX(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function uX(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 dX=`Block collections are not allowed within flow collections`,fX=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?JJ:XJ))(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=rX(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&&iX(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];kq(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],fX(m)&&i(r.range,`BLOCK_IN_FLOW`,dX)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);fX(f)&&i(g.range,`BLOCK_IN_FLOW`,dX),n.atKey=!1;let _=rX(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?fX(m)&&i(v.range,`BLOCK_IN_FLOW`,dX):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new HJ(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;oX(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new JJ(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=uX(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 mX(e,t,n,r,i,a){let o=n.type===`block-map`?cX(e,t,n,r,a):n.type===`block-seq`?lX(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 hX(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===JJ.tagName&&s===`map`||o===XJ.tagName&&s===`seq`)return mX(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),mX(e,t,n,i,o)}let l=mX(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Nq(u)?u:new nJ(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function gX(e,t,n){let r=t.offset,i=_X(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?nJ.BLOCK_FOLDED:nJ.BLOCK_LITERAL,o=t.source?vX(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===nJ.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
`),d+=f+t.slice(c)+r,f=`
`,p=!0):r===``?f===`
`?d+=`
`:f=`
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
`+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 _X({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 vX(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 yX(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=nJ.PLAIN,c=bX(a,l);break;case`single-quoted-scalar`:s=nJ.QUOTE_SINGLE,c=xX(a,l);break;case`double-quoted-scalar`:s=nJ.QUOTE_DOUBLE,c=CX(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=uX(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function bX(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}`),SX(e)}function xX(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),SX(e.slice(1,-1)).replace(/''/g,`'`)}function SX(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 CX(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}=wX(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=TX[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+=EX(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 wX(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 TX={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function EX(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 DX(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?gX(e,t,r):yX(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[Cq]:c?OX(e.schema,i,c,n,r):t.type===`scalar`?kX(e,i,t,r):e.schema[Cq];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=Aq(a)?a:new nJ(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new nJ(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 OX(e,t,n,r,i){if(n===`!`)return e[Cq];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[Cq])}function kX({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[Cq];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Cq];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 AX(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 jX={composeNode:MX,composeEmptyNode:NX};function MX(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=PX(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=DX(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=hX(jX,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??=NX(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&&(!Aq(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 NX(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=DX(e,{type:`scalar`,offset:AX(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 PX({options:e},{offset:t,source:n,end:r},i){let a=new $q(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=uX(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function FX(e,t,{offset:n,start:r,value:i,end:a},o){let s=new ZY(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=rX(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?MX(c,i,l,o):NX(c,l.end,r,null,l,o);let u=s.contents.range[2],d=uX(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function IX(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 LX(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 RX=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=IX(e);r?this.warnings.push(new tX(i,t,n)):this.errors.push(new eX(i,t,n))},this.directives=new Gq({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=LX(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(Mq(i)&&!i.flow&&i.items.length>0){let e=i.items[0];kq(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:LX(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=IX(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=FX(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 eX(IX(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 eX(IX(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=uX(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 eX(IX(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 ZY(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}}},zX=Symbol(`break visit`),BX=Symbol(`skip children`),VX=Symbol(`remove item`);function HX(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),UX(Object.freeze([]),e,t)}HX.BREAK=zX,HX.SKIP=BX,HX.REMOVE=VX,HX.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},HX.parentCollection=(e,t)=>{let n=HX.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 UX(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=UX(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===zX)return zX;else r===VX&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function WX(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 GX(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var KX=new Set(`0123456789ABCDEFabcdef`),qX=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),JX=new Set(`,[]{}`),YX=new Set(` ,[]{}
\r `),XX=e=>!e||YX.has(e),ZX=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===`...`)&&GX(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===`...`)&&GX(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&&!GX(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===`:`)&&GX(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(XX),`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(`...`))&&GX(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(XX),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||GX(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=>GX(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(GX(r)||e&&JX.has(r))break;t=n}else if(GX(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&JX.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&JX.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(XX),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(GX(n)||t&&JX.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(;!GX(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(qX.has(t))t=this.buffer[++e];else if(t===`%`&&KX.has(this.buffer[e+1])&&KX.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)}},QX=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 $X(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function eZ(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 tZ(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 nZ(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 rZ(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 iZ(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 aZ(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!$X(t.start,`explicit-key-ind`)&&!$X(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,tZ(t.value)?t.value.end?iZ(t.value.end,t.sep):t.value.end=t.sep:iZ(t.start,t.sep),delete t.sep)}var oZ=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 ZX,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=WX(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`&&aZ(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&&eZ(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)){iZ(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($X(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=rZ(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($X(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(tZ(t.key)&&!$X(t.sep,`newline`)){let e=rZ(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]}):$X(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&&!$X(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)){iZ(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||$X(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=rZ(nZ(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=rZ(nZ(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 sZ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new QX||null,prettyErrors:t}}function cZ(e,t={}){let{lineCounter:n,prettyErrors:r}=sZ(t),i=new oZ(n?.addNewLine),a=new RX(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 eX(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(nX(e,n)),o.warnings.forEach(nX(e,n))),o}function lZ(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=cZ(e,n);if(!i)return null;if(i.warnings.forEach(e=>MJ(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function uZ(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return Dq(e)&&!r?e.toString(n):new ZY(e,r,n).toString(n)}function dZ(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}var fZ=120,pZ=280,mZ={"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function hZ(e){return mZ[e]??e}var gZ=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function _Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function vZ(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function yZ(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(gZ)].map(e=>e[1]))]}function bZ(e){let t=cZ(e).toJS(),n=_Z(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Start`,type:``,detail:`an event or a task starts the run`}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=_Z(e)?e:{},f=typeof u.type==`string`?u.type:``,p=_Z(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||hZ(f),type:f,detail:vZ(f,p),when:typeof u.when==`string`?u Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:zZ(e)}))}var LZ=/^(\s*)(-\s+)?/,RZ=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function zZ(e){let{code:t,comment:n}=BZ(e),r=VZ(t);return n&&r.push({text:n,kind:`comment`}),r}function BZ(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 VZ(e){if(!e)return[];let t=[],n=LZ.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=RZ.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,...HZ(i[4]??``)]):[...t,...HZ(r)]}function HZ(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 UZ(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function WZ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function GZ(e){return typeof e==`string`&&e.trim()!==``}var KZ={class:`flex h-[560px] flex-col gap-3 overflow-y-auto rounded-lg border border-border bg-card p-3 text-sm`},qZ={class:`flex items-start gap-2`},JZ={class:`min-w-0`},YZ={class:`truncate font-medium`},XZ={class:`font-mono text-[11px] text-fg-subtle`},ZZ={key:0,class:`rounded bg-danger/10 px-2 py-1 text-xs text-danger`,role:`alert`},QZ={class:`flex flex-col gap-1`},$Z=[`title`],eQ=[`checked`,`onChange`],tQ={key:0,class:`block text-xs text-fg-subtle`},nQ={key:1,class:`flex flex-col gap-1`},rQ={class:`text-xs text-muted-foreground`},iQ=[`value`,`onChange`],aQ=[`value`],oQ={key:0,class:`text-xs text-danger`},sQ={key:6,class:`text-xs text-fg-subtle`},cQ={key:1,class:`space-y-1`},lQ={class:`flex items-center gap-1 text-xs text-muted-foreground`},uQ={class:`flex flex-wrap gap-1`},dQ=[`onClick`],fQ=[`onClick`],pQ={class:`space-y-2`},mQ={class:`mt-2 flex flex-col gap-1`},hQ={class:`flex flex-col gap-1`},gQ=[`value`],_Q={class:`flex flex-col gap-1`},vQ={class:`mt-auto flex flex-wrap gap-1.5 border-t border-border pt-3`},yQ={key:1,class:`text-xs text-fg-subtle`},bQ=[`open`],xQ={class:`cursor-pointer text-xs font-medium`},SQ={class:`text-[11px] tracking-wide text-fg-subtle uppercase`},CQ={class:`flex flex-wrap gap-1`},wQ=[`title`,`onClick`],TQ=L({__name:`StepPanel`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`select`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>n.path?xZ(n.yaml,n.path):void 0),a=Y(()=>typeof i.value?.type==`string`?i.value.type:``),o=Y(()=>n.vocabulary.find(e=>e.name===a.value)),s=Y(()=>typeof i.value?.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],l=Y(()=>Object.entries(o.value?.settings?.properties??{}).sort(([e],[t])=>{let n=e=>c.includes(e)?c.indexOf(e):c.length;return n(e)-n(t)})),u=Y(()=>n.path?EZ(n.yaml,n.path):[]),d=Y(()=>(n.path?.length??0)>2),f=Y(()=>o.value?.settings&&i.value?.settings?PZ(i.value.settings,o.value.settings,`settings`):``),p=N(!0);I(()=>JSON.stringify(n.path),()=>p.value=!n.path,{immediate:!0});let m=Y(()=>{let e=new Map;for(let t of n.vocabulary){let n=t.name.split(`.`)[0];e.set(n,[...e.get(n)??[],t])}return[...e.entries()]});function h(e){let{id:t,type:i,...a}=e;n.path&&r(`update:yaml`,SZ(n.yaml,n.path,{id:t,type:i,...a}))}function g(e,t){h({...i.value,[e]:t})}function _(e,t){h({...i.value,settings:{...s.value,[e]:t}})}function v(e){let t=n.path&&n.path.length===2?Number(n.path[1]):2**53-1,i=CZ(n.yaml,t,e);r(`update:yaml`,i.source),r(`select`,i.path)}function y(e){if(!n.path)return;let t=TZ(n.yaml,n.path,e);r(`update:yaml`,t.source),r(`select`,t.path)}function b(){n.path&&(r(`update:yaml`,wZ(n.yaml,n.path)),r(`select`,null))}let x=N(null);function S(e,t){let n=x.value??l.value.find(([,e])=>e.type===`string`)?.[0];if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=t===`summary`?`{{ steps.${e}.summary }}`:`{{ steps.${e}.result }}`;_(n,r?`${r.trimEnd()} ${i}`:i)}let C=/mission|body|detail|plan|rules/;function w(e,t){return t.type===`string`?t.enum?`select`:C.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let T=N({});function E(e,t){try{_(e,t.trim()?lZ(t):void 0),T.value={...T.value,[e]:``}}catch(t){T.value={...T.value,[e]:String(t.message).split(`
`)[0]}}}function D(e){return e===void 0?``:uZ(e).trimEnd()}function O(e,t){return t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase())}return(t,n)=>(V(),H(`aside`,KZ,[i.value&&e.path?(V(),H(B,{key:0},[W(`div`,qZ,[W(`div`,JZ,[W(`div`,YZ,M(P(hZ)(a.value)),1),W(`div`,XZ,M(a.value),1)]),G(P(Q),{type:`button`,variant:`ghost`,size:`icon`,class:`ml-auto size-7`,"aria-label":`Close`,onClick:n[0]||=e=>r(`select`,null)},{default:F(()=>[G(P(nf))]),_:1})]),f.value?(V(),H(`p`,ZZ,M(f.value),1)):q(``,!0),W(`label`,QZ,[n[8]||=W(`span`,{class:`text-xs text-muted-foreground`},`Step id`,-1),G(P(mk),{"model-value":i.value.id??``,class:`h-8 font-mono`,placeholder:`name it so later steps can use its result`,"onUpdate:modelValue":n[1]||=e=>g(`id`,String(e))},null,8,[`model-value`])]),(V(!0),H(B,null,R(l.value,([e,t])=>(V(),H(B,{key:e},[w(e,t)===`boolean`?(V(),H(`label`,{key:0,class:`flex items-start gap-2`,title:t.description},[W(`input`,{type:`checkbox`,class:`mt-0.5`,checked:s.value[e]===!0,onChange:t=>_(e,t.target.checked||void 0)},null,40,eQ),W(`span`,null,[K(M(O(e,t)),1),t.description?(V(),H(`span`,tQ,M(t.description),1)):q(``,!0)])],8,$Z)):(V(),H(`label`,nQ,[W(`span`,rQ,M(O(e,t)),1),w(e,t)===`select`?(V(),H(`select`,{key:0,class:`h-8 rounded-md border border-input bg-background px-2`,value:s.value[e]??``,onChange:t=>_(e,t.target.value||void 0)},[n[9]||=W(`option`,{value:``},`(default)`,-1),(V(!0),H(B,null,R(t.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,aQ))),128))],40,iQ)):w(e,t)===`text`?(V(),U(P(fT),{key:1,"model-value":s.value[e]??``,class:`min-h-28 font-mono text-xs`,onFocus:t=>x.value=e,"onUpdate:modelValue":t=>_(e,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):w(e,t)===`line`?(V(),U(P(mk),{key:2,"model-value":s.value[e]??``,class:`h-8`,onFocus:t=>x.value=e,"onUpdate:modelValue":t=>_(e,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):w(e,t)===`number`?(V(),U(P(mk),{key:3,type:`number`,"model-value":s.value[e]??``,class:`h-8`,"onUpdate:modelValue":t=>_(e,t===``?void 0:Number(t))},null,8,[`model-value`,`onUpdate:modelValue`])):w(e,t)===`lines`?(V(),U(P(fT),{key:4,"model-value":Array.isArray(s.value[e])?s.value[e].join(`
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`one per line`,"onUpdate:modelValue":t=>_(e,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(V(),H(B,{key:5},[G(P(fT),{"model-value":D(s.value[e]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>E(e,t.target.value)},null,8,[`model-value`,`onChange`]),T.value[e]?(V(),H(`span`,oQ,M(T.value[e]),1)):q(``,!0)],64)),t.description?(V(),H(`span`,sQ,M(t.description),1)):q(``,!0)]))],64))),128)),u.value.length&&l.value.some(([,e])=>e.type===`string`)?(V(),H(`div`,cQ,[W(`span`,lQ,[G(P(Dd),{class:`size-3`,"aria-hidden":`true`}),n[10]||=K(`Use an earlier step's result`,-1)]),W(`div`,uQ,[(V(!0),H(B,null,R(u.value,e=>(V(),H(B,{key:e},[W(`button`,{type:`button`,class:`rounded bg-secondary px-1.5 py-0.5 font-mono text-[11px] hover:bg-secondary/70`,onClick:t=>S(e,`summary`)},M(e)+`.summary`,9,dQ),W(`button`,{type:`button`,class:`rounded bg-secondary px-1.5 py-0.5 font-mono text-[11px] hover:bg-secondary/70`,onClick:t=>S(e,`result`)},M(e)+`.result`,9,fQ)],64))),128))])])):q(``,!0),W(`details`,pQ,[n[15]||=W(`summary`,{class:`cursor-pointer text-xs text-muted-foreground`},`When, failure and retry`,-1),W(`label`,mQ,[n[11]||=W(`span`,{class:`text-xs text-muted-foreground`},`Run only when`,-1),G(P(mk),{"model-value":i.value.when??``,class:`h-8 font-mono`,placeholder:`steps.assess.result.fit`,"onUpdate:modelValue":n[2]||=e=>g(`when`,String(e))},null,8,[`model-value`])]),W(`label`,hQ,[n[13]||=W(`span`,{class:`text-xs text-muted-foreground`},`If it fails`,-1),W(`select`,{class:`h-8 rounded-md border border-input bg-background px-2`,value:i.value.on_failure??``,onChange:n[3]||=e=>g(`on_failure`,e.target.value||void 0)},[...n[12]||=[W(`option`,{value:``},`Park the task`,-1),W(`option`,{value:`continue`},`Continue to the next step`,-1)]],40,gQ)]),W(`label`,_Q,[n[14]||=W(`span`,{class:`text-xs text-muted-foreground`},`Attempts`,-1),G(P(mk),{type:`number`,min:`1`,max:`10`,"model-value":i.value.retry?.attempts??``,class:`h-8`,"onUpdate:modelValue":n[4]||=e=>g(`retry`,e===``?void 0:{...i.value.retry,attempts:Number(e)})},null,8,[`model-value`])])]),W(`div`,vQ,[G(P(Q),{type:`button`,variant:`outline`,size:`sm`,onClick:n[5]||=e=>y(-1)},{default:F(()=>[G(P(ud)),n[16]||=K(` Up`,-1)]),_:1}),G(P(Q),{type:`button`,variant:`outline`,size:`sm`,onClick:n[6]||=e=>y(1)},{default:F(()=>[G(P(od)),n[17]||=K(` Down`,-1)]),_:1}),G(P(Q),{type:`button`,variant:`ghost`,size:`sm`,class:`ml-auto text-danger`,onClick:b},{default:F(()=>[G(P(Xd)),n[18]||=K(` Remove`,-1)]),_:1})])],64)):(V(),H(`div`,yQ,`Select a step to edit it.`)),d.value?q(``,!0):(V(),H(`details`,{key:2,open:p.value,class:`space-y-2 border-t border-border pt-3`,onToggle:n[7]||=e=>p.value=e.target.open},[W(`summary`,xQ,M(i.value?`Add a step after this one`:`Add a step`),1),(V(!0),H(B,null,R(m.value,([e,t])=>(V(),H(`div`,{key:e,class:`space-y-1`},[W(`div`,SQ,M(e),1),W(`div`,CQ,[(V(!0),H(B,null,R(t,e=>(V(),H(`button`,{key:e.name,type:`button`,class:`flex items-center gap-1 rounded border border-border px-1.5 py-0.5 text-xs hover:bg-secondary`,title:e.name,onClick:t=>v(e.name)},[G(P(Rd),{class:`size-3`,"aria-hidden":`true`}),K(M(P(hZ)(e.name)),1)],8,wQ))),128))])]))),128))],40,bQ))]))}});function EQ(e){return Fe()?(Ie(e),!0):!1}function DQ(e){return typeof e==`function`?e():P(e)}var OQ=typeof window<`u`&&typeof document<`u`,kQ=e=>e!==void 0,AQ=Object.prototype.toString,jQ=e=>AQ.call(e)===`[object Object]`,MQ=()=>{};function NQ(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var PQ=e=>e();function FQ(e=PQ){let t=N(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:$t(t),pause:n,resume:r,eventFilter:(...n)=>{t.value&&e(...n)}}}function IQ(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function LQ(e,t,n={}){let{eventFilter:r=PQ,...i}=n;return I(e,NQ(r,t),i)}function RQ(e,t,n={}){let{eventFilter:r,...i}=n,{eventFilter:a,pause:o,resume:s,isActive:c}=FQ(r);return{stop:LQ(e,t,{...i,eventFilter:a}),pause:o,resume:s,isActive:c}}function zQ(e,t={}){if(!dn(e))return xn(e);let n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let r in e.value)n[r]=bn(()=>({get(){return e.value[r]},set(n){if(DQ(t.replaceRef)??!0){if(Array.isArray(e.value)){let t=[...e.value];t[r]=n,e.value=t}else{let t={...e.value,[r]:n};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}}else e.value[r]=n}}));return n}function BQ(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=I(e,e=>{n(e)!==t&&(s?.(),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(IQ(a,o).then(()=>DQ(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!dn(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=I([e,r],([e,r])=>{t!==(e===r)&&(l?.(),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(IQ(s,c).then(()=>DQ(e)).finally(()=>(l?.(),DQ(e)))),Promise. Line truncated
`).replace(`
`,`
+`).split(`
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function J$(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=Y$(n.code,e);return Array.isArray(e)?e.some(e=>q$(n[r],e,t,n.type===`keyup`)):q$(n[r],e,t,n.type===`keyup`)}}function Y$(e,t){return t.includes(e)?`code`:`key`}function X$(e,t){let n=Y(()=>gn(t?.target)??W$),r=fn(gn(e)===!0),i=!1,a=new Set,o=c(gn(e));I(()=>gn(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),Uq([`blur`,`contextmenu`],s),Gq((...e)=>o(...e),e=>{let n=gn(t?.actInsideInputWithModifier)??!0,a=gn(t?.preventDefault)??!1;if(i=K$(e),(!i||i&&!n)&&G$(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),Gq((...e)=>o(...e),e=>{let n=gn(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&G$(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=gn(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?J$(e,a):e}return r}var Z$=`vue-flow__node-desc`,Q$=`vue-flow__edge-desc`,$$=`vue-flow__aria-live`,e1=[`Enter`,` `,`Escape`],t1={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function n1(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function r1(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function i1(e){return{width:e.offsetWidth,height:e.offsetHeight}}function a1(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function o1(e,t){return{x:a1(e.x,t[0][0],t[1][0]),y:a1(e.y,t[0][1],t[1][1])}}function s1(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function c1(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function l1(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!c1(e)}function u1(e){return l1(e)&&`computedPosition`in e}function d1(e){return!Number.isNaN(e)&&Number.isFinite(e)}function f1(e){return d1(e.width)&&d1(e.height)&&d1(e.x)&&d1(e.y)}function p1(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:cn({width:0,height:0}),computedPosition:cn({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:A0(e.data)?e.data:{},events:cn(A0(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function m1(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:A0(e.data)?e.data:{},events:cn(A0(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function h1(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function g1(...e){if(e.length===3){let[t,n,r]=e;return h1(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>c1(e)&&e.source===r).map(e=>n.find(t=>l1(t)&&t.id===e.target))}function _1(...e){if(e.length===3){let[t,n,r]=e;return h1(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>c1(e)&&e.target===r).map(e=>n.find(t=>l1(t)&&t.id===e.source))}function v1({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function y1(e,t){return t.some(t=>c1(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function b1({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function x1({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?p0(s,o):s}function S1(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function C1({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function w1({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function T1(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=S1(t,C1({...r.computedPosition,...r.dimensions}))}return w1(t)}function E1(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...x1(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function X3(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=Z3(n.code,e);return Array.isArray(e)?e.some(e=>Y3(n[r],e,t,n.type===`keyup`)):Y3(n[r],e,t,n.type===`keyup`)}}function Z3(e,t){return t.includes(e)?`code`:`key`}function Q3(e,t){let n=Y(()=>gn(t?.target)??K3),r=fn(gn(e)===!0),i=!1,a=new Set,o=c(gn(e));I(()=>gn(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),WQ([`blur`,`contextmenu`],s),KQ((...e)=>o(...e),e=>{let n=gn(t?.actInsideInputWithModifier)??!0,a=gn(t?.preventDefault)??!1;if(i=J3(e),(!i||i&&!n)&&q3(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),KQ((...e)=>o(...e),e=>{let n=gn(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&q3(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=gn(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?X3(e,a):e}return r}var $3=`vue-flow__node-desc`,e6=`vue-flow__edge-desc`,t6=`vue-flow__aria-live`,n6=[`Enter`,` `,`Escape`],r6={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function i6(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function a6(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function o6(e){return{width:e.offsetWidth,height:e.offsetHeight}}function s6(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function c6(e,t){return{x:s6(e.x,t[0][0],t[1][0]),y:s6(e.y,t[0][1],t[1][1])}}function l6(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function u6(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function d6(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!u6(e)}function f6(e){return d6(e)&&`computedPosition`in e}function p6(e){return!Number.isNaN(e)&&Number.isFinite(e)}function m6(e){return p6(e.width)&&p6(e.height)&&p6(e.x)&&p6(e.y)}function h6(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:cn({width:0,height:0}),computedPosition:cn({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:M8(e.data)?e.data:{},events:cn(M8(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function g6(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:M8(e.data)?e.data:{},events:cn(M8(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function _6(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function v6(...e){if(e.length===3){let[t,n,r]=e;return _6(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>u6(e)&&e.source===r).map(e=>n.find(t=>d6(t)&&t.id===e.target))}function y6(...e){if(e.length===3){let[t,n,r]=e;return _6(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>u6(e)&&e.target===r).map(e=>n.find(t=>d6(t)&&t.id===e.source))}function b6({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function x6(e,t){return t.some(t=>u6(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function S6({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function C6({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?h8(s,o):s}function w6(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function T6({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function E6({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function D6(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=w6(t,T6({...r.computedPosition,...r.dimensions}))}return E6(t)}function O6(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...C6(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
Node: ${e}
@@ -43,110 +152,4 @@ Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},s0=class extends Error{constructor(e,...t){super(o0[e]?.call(o0,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function c0(e){return`clientX`in e}function l0(e){return`sourceEvent`in e}function u0(e,t){let n=c0(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var d0=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function f0(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function p0(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var m0=()=>!0;function h0(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function g0(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())r1(i,n1(e))>0&&r.push(e);return r}var _0=250;function v0(e,t,n,r){let i=[],a=1/0,o=g0(e,n,t+_0);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=t0(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function y0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=m0},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=u0(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=b0(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===z$.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=C0(t,e,a,p,n,!0)}return b}function b0(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function x0(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function S0(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function C0(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===z$.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...t0(o,c,c.position,!0)}:c}var w0={[I$.Left]:I$.Right,[I$.Right]:I$.Left,[I$.Top]:I$.Bottom,[I$.Bottom]:I$.Top},T0=[`production`,`prod`];function E0(e,...t){D0()&&console.warn(`[Vue Flow]: ${e}`,...t)}function D0(){return!T0.includes(`production`)}function O0(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...i1(t)}}):null}function k0(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),er(()=>{o.blur()})):n([e])}function A0(e){return P(e)!==void 0}function j0(e,t,n,r){if(!e||!e.source||!e.target)return n(new s0(a0.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=c1(e)?e:{...e,id:v1(e)},i=m1(i,void 0,r),!y1(i,t)&&i}function M0(e,t,n,r,i){if(!t.source||!t.target)return i(new s0(a0.EDGE_INVALID,e.id)),!1;if(!n)return i(new s0(a0.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?v1(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function N0(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!l1(o)){n(new s0(a0.NODE_INVALID,o?.id));continue}let s=p1(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new s0(a0.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function P0(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function F0(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;P0(`source`,o,`${r}-${a}--Line truncated
`)}};Q3.defaultYaml={explicit:!1,version:`1.2`},Q3.defaultTags={"!!":`tag:yaml.org,2002:`};function $3(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 e6(e){let t=new Set;return G3(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function t6(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function n6(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=e6(e);let a=t6(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(L3(t.node)||z3(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 r6(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=r6(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=r6(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=r6(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=r6(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function i6(e,t,n){if(Array.isArray(e))return e.map((e,t)=>i6(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!V3(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 a6=class{constructor(e){Object.defineProperty(this,M3,{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(!P3(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=i6(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?r6(i,{"":o},``,o):o}},o6=class extends a6{constructor(e){super(E3),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=[],G3(e,{Node:(e,t)=>{(N3(t)||V3(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||=(i6(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=s6(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($3(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 s6(e,t,n){if(N3(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(z3(t)){let r=0;for(let i of t.items){let t=s6(e,i,n);t>r&&(r=t)}return r}if(I3(t)){let r=s6(e,t.key,n),i=s6(e,t.value,n);return Math.max(r,i)}return 1}var c6=e=>!e||typeof e!=`function`&&typeof e!=`object`,l6=class extends a6{constructor(e){super(A3),this.value=e}toJSON(e,t){return t?.keep?this.value:i6(this.value,e,t)}toString(){return String(this.value)}};l6.BLOCK_FOLDED=`BLOCK_FOLDED`,l6.BLOCK_LITERAL=`BLOCK_LITERAL`,l6.PLAIN=`PLAIN`,l6.QUOTE_DOUBLE=`QUOTE_DOUBLE`,l6.QUOTE_SINGLE=`QUOTE_SINGLE`;var u6=`tag:yaml.org,2002:`;function d6(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 f6(e,t,n){if(P3(e)&&(e=e.contents),B3(e))return e;if(I3(e)){let t=n.schema[O3].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 o6(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=u6+t.slice(2));let l=d6(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new l6(e);return c&&(c.node=t),t Line truncated
`)?_6(n,t):n.includes(`
`)?`
`+_6(n,t):(e.endsWith(` `)?``:` `)+n,y6=`flow`,b6=`block`,x6=`quoted`;function S6(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=C6(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=C6(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 C6(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 w6=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),T6=e=>/^(%|---|\.\.\.)/m.test(e);function E6(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 D6(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(T6(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:S6(o,a,x6,w6(t,!1))}function O6(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return D6(e,t);let n=t.indent||(T6(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:S6(r,n,y6,w6(t,!1))}function k6(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=D6;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?O6:i&&!t?D6:n?O6:D6}return r(e,t)}var A6;try{A6=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{A6=/\n+(?!\n|$)/g}function j6({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 k6(n,r);let l=r.indent||(r.forceBlockIndent||T6(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===l6.BLOCK_FOLDED?!1:t===l6.BLOCK_LITERAL||!E6(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(A6,`$&${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=w6(r,!0);o!==`folded`&&t!==l6.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=S6(`${v}${e}${p}`,l,b6,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function M6(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 k6(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?k6(a,t):j6(e,t,n,r);if(!s&&!u&&i!==l6.PLAIN&&a.includes(`
`))return j6(e,t,n,r);if(T6(a)){if(c===``)return t.forceBlockIndent=!0,j6(e,t,n,r);if(s&&c===l)return k6(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 k6(a,t)}return s?d:S6(d,c,y6,w6(t,!1))}function N6(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!==l6.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=l6.QUOTE_DOUBLE);let c=e=>{switch(e){case l6.BLOCK_FOLDED:case l6.BLOCK_LITERAL:return i||a?k6(o.value,t):j6(o,t,n,r);case l6.QUOTE_DOUBLE:return D6(o.value,t);case l6.QUOTE_SINGLE:return O6(o.value,t);case l6.PLAIN:return M6(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 P6(e,t){let n=Object.assign({blockQuote:!0,commentString:g6,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 F6(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(L3(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 I6(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(L3(e)||z3(e))&&e.anchor;a&&$3(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 L6(e,t,n,r){if(I3(e))return e.toString(t,n,r);if(N3(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=B3(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=F6(t.doc.schema.tags,a);let o=I6(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):L3(a)?N6(a,t,n,r):a.toString(t,n,r);return o?L3(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function R6({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=B3(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(z3(e)||!B3(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||z3(e)||(L3(e)?e.type===l6.BLOCK_FOLDED||e.type===l6.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=L6(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+=v6(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=v6(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=v6(g,n.indent,l(f))));let _,v,y;B3(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&&L3(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&R3(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=L6(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${_6(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&z3(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+=v6(g,n.indent,l(y)):h&&i&&i(),g}function z6(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var B6=`<<`,V6={identify:e=>e===B6||typeof e==`symbol`&&e.description===B6,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new l6(Symbol(B6)),{addToJSMap:U6}),stringify:()=>B6},H6=(e,t)=>(V6.identify(t)||L3(t)&&(!t.type||t.type===l6.PLAIN)&&V6.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===V6.tag&&e.default);function U6(e,t,n){let r=G6(e,n);if(R3(r))for(let n of r.items)W6(e,t,n);else if(Array.isArray(r))for(let n of r)W6(e,t,n);else W6(e,t,r)}function W6(e,t,n){let r=G6(e,n);if(!F3(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 G6(e,t){return e&&N3(t)?t.resolve(e.doc,e):t}function K6(e,t,{key:n,value:r}){if(B3(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(H6(e,n))U6(e,t,r);else{let i=i6(n,``,e);if(t instanceof Map)t.set(i,i6(r,i,e));else if(t instanceof Set)t.add(i);else{let a=q6(n,i,e),o=i6(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function q6(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(B3(e)&&n?.doc){let t=P6(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)+`..."`),z6(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 J6(e,t,n){return new Y6(f6(e,void 0,n),f6(t,void 0,n))}var Y6=class e{constructor(e,t=null){Object.defineProperty(this,M3,{value:k3}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return B3(n)&&(n=n.clone(t)),B3(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return K6(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?R6(this,e,t,n):JSON.stringify(this)}};function X6(e,t,n){return(t.inFlow??e.flow?Q6:Z6)(e,t,n)}function Z6({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(B3(i))!d&&i.spaceBefore&&f.push(``),$6(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(I3(i)){let e=B3(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),$6(n,f,e.commentBefore,d))}d=!1;let s=L6(i,u,()=>o=null,()=>d=!0);o&&(s+=v6(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+=`
`+_6(l(e),c),s&&s()):d&&o&&o(),p}function Q6({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(B3(i))i.spaceBefore&&d.push(``),$6(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(I3(i)){let e=B3(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),$6(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=B3(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=L6(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+=v6(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 $6({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=_6(t(r),e);n.push(i.trimStart())}}function e8(e,t){let n=L3(t)?t.value:t;for(let r of e)if(I3(r)&&(r.key===t||r.key===n||L3(r.key)&&r.key.value===n))return r}var t8=class extends h6{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(O3,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(J6(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=I3(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Y6(e,e?.value):new Y6(e.key,e.value);let r=e8(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);L3(r.value)&&c6(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=e8(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=e8(this.items,e)?.value;return(!t&&L3(n)?n.value:n)??void 0}has(e){return!!e8(this.items,e)}set(e,t){this.add(new Y6(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)K6(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!I3(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})),X6(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},n8={collection:`map`,default:!0,nodeClass:t8,tag:`tag:yaml.org,2002:map`,resolve(e,t){return F3(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>t8.from(e,t,n)},r8=class extends h6{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(j3,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=i8(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=i8(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&L3(r)?r.value:r}has(e){let t=i8(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=i8(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];L3(r)&&c6(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(i6(e,String(r++),t));return n}toString(e,t,n){return e?X6(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(f6(a,void 0,n))}}return i}};function i8(e){let t=L3(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var a8={collection:`seq`,default:!0,nodeClass:r8,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return R3(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>r8.from(e,t,n)},o8={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),N6(e,t,n,r)}},s8={identify:e=>e==null,createNode:()=>new l6(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new l6(null),stringify:({source:e},t)=>typeof e==`string`&&s8.test.test(e)?e:t.options.nullStr},c8={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new l6(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&c8.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function l8({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 u8={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:l8},d8={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 N6({comment:e,type:t,value:s},r,i,a)}};function T8(e,t){if(R3(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!I3(r)){if(F3(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Y6(new l6(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]=I3(r)?r:new Y6(r)}}else t(`Expected a sequence for this tag`);return e}function E8(e,t,n){let{replacer:r}=n,i=new r8(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(J6(o,s,n))}return i}var D8={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:T8,createNode:E8},O8=class e extends r8{constructor(){super(),this.add=t8.prototype.add.bind(this),this.delete=t8.prototype.delete.bind(this),this.get=t8.prototype.get.bind(this),this.has=t8.prototype.has.bind(this),this.set=t8.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(I3(e)?(r=i6(e.key,``,t),i=i6(e.value,r,t)):r=i6(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=E8(e,t,n),i=new this;return i.items=r.items,i}};O8.tag=`tag:yaml.org,2002:omap`;var k8={collection:`seq`,identify:e=>e instanceof Map,nodeClass:O8,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=T8(e,t),r=[];for(let{key:e}of n.items)L3(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new O8,n)},createNode:(e,t,n)=>O8.from(e,t,n)};function A8({value:e,source:t},n){return t&&(e?j8:M8).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var j8={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 l6(!0),stringify:A8},M8={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 l6(!1),stringify:A8},N8={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:l8},P8={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():l8(e)}},F8={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 l6(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:l8},I8=e=>typeof e==`bigint`||Number.isInteger(e);function L8(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 R8(e,t,n){let{value:r}=e;if(I8(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return l8(e)}var z8={identify:I8,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>L8(e,2,2,n),stringify:e=>R8(e,2,`0b`)},B8={identify:I8,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>L8(e,1,8,n),stringify:e=>R8(e,8,`0`)},V8={identify:I8,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>L8(e,0,10,n),stringify:l8},H8={identify:I8,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>L8(e,2,16,n),stringify:e=>R8(e,16,`0x`)},U8=class e extends t8{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=I3(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Y6(e.key,null):new Y6(e,null),e8(this.items,t.key)||this.items.push(t)}get(e,t){let n=e8(this.items,e);return!t&&I3(n)?L3(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=e8(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Y6(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(_6(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(_6(a(t),``)))}return n.join(`
`)+`
`}var i5=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,M3,{value:D3});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 Q3({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[M3]:{value:D3}});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=B3(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){a5(this.contents)&&this.contents.add(e)}addIn(e,t){a5(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=e6(this);e.anchor=!t||n.has(t)?t6(t||`a`,n):t}return new o6(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}=n6(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=f6(e,l,p);return o&&z3(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Y6(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return a5(this.contents)?this.contents.delete(e):!1}deleteIn(e){return m6(e)?this.contents!=null&&(this.contents=null,!0):a5(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return z3(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return m6(e)?!t&&L3(this.contents)?this.contents.value:this.contents:z3(this.contents)?this.contents.getIn(e,t):void 0}has(e){return z3(this.contents)?this.contents.has(e):!1}hasIn(e){return m6(e)?this.contents!==void 0:z3(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=p6(this.schema,[e],t):a5(this.contents)&&this.contents.set(e,t)}setIn(e,t){m6(e)?this.contents=t:this.contents==null?this.contents=p6(this.schema,Array.from(e),t):a5(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 Q3({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 Q3({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 n5(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=i6(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`?r6(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 r5(this,e)}};function a5(e){if(z3(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var o5=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},s5=class extends o5{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},c5=class extends o5{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},l5=(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 u5(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 d5(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(d5(t.key)||d5(t.value))return!0}return!1;default:return!0}}function f5(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&d5(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function p5(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||L3(e)&&L3(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var m5=`All mapping items must start at the same column`;function h5({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??t8)(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=u5(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`,m5)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||d5(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`,m5);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&f5(r.indent,u,i),n.atKey=!1,p5(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=u5(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&&f5(r.indent,f,i),s=c.range[2];let l=new Y6(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 Y6(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 g5({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??r8)(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=u5(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&&f5(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function _5(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 v5=`Block collections are not allowed within flow collections`,y5=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function b5({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?t8:r8))(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=u5(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&&d5(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];I3(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],y5(m)&&i(r.range,`BLOCK_IN_FLOW`,v5)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);y5(f)&&i(g.range,`BLOCK_IN_FLOW`,v5),n.atKey=!1;let _=u5(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?y5(m)&&i(v.range,`BLOCK_IN_FLOW`,v5):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new Y6(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;p5(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new t8(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=_5(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 x5(e,t,n,r,i,a){let o=n.type===`block-map`?h5(e,t,n,r,a):n.type===`block-seq`?g5(e,t,n,r,a):b5(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function S5(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===t8.tagName&&s===`map`||o===r8.tagName&&s===`seq`)return x5(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),x5(e,t,n,i,o)}let l=x5(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=B3(u)?u:new l6(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function C5(e,t,n){let r=t.offset,i=w5(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?l6.BLOCK_FOLDED:l6.BLOCK_LITERAL,o=t.source?T5(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===l6.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
`),d+=f+t.slice(c)+r,f=`
`,p=!0):r===``?f===`
`?d+=`
`:f=`
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
`+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 w5({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 T5(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 E5(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=l6.PLAIN,c=D5(a,l);break;case`single-quoted-scalar`:s=l6.QUOTE_SINGLE,c=O5(a,l);break;case`double-quoted-scalar`:s=l6.QUOTE_DOUBLE,c=A5(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=_5(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function D5(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}`),k5(e)}function O5(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),k5(e.slice(1,-1)).replace(/''/g,`'`)}function k5(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 A5(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}=j5(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=M5[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+=N5(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 j5(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 M5={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function N5(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 P5(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?C5(e,t,r):E5(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[A3]:c?F5(e.schema,i,c,n,r):t.type===`scalar`?I5(e,i,t,r):e.schema[A3];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=L3(a)?a:new l6(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new l6(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 F5(e,t,n,r,i){if(n===`!`)return e[A3];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[A3])}function I5({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[A3];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[A3];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 L5(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 R5={composeNode:z5,composeEmptyNode:B5};function z5(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=V5(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=P5(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=S5(R5,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??=B5(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&&(!L3(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 B5(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=P5(e,{type:`scalar`,offset:L5(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 V5({options:e},{offset:t,source:n,end:r},i){let a=new o6(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=_5(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function H5(e,t,{offset:n,start:r,value:i,end:a},o){let s=new i5(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=u5(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?z5(c,i,l,o):B5(c,l.end,r,null,l,o);let u=s.contents.range[2],d=_5(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function U5(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 W5(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 G5=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=U5(e);r?this.warnings.push(new c5(i,t,n)):this.errors.push(new s5(i,t,n))},this.directives=new Q3({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=W5(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(z3(i)&&!i.flow&&i.items.length>0){let e=i.items[0];I3(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:W5(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=U5(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=H5(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 s5(U5(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 s5(U5(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=_5(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 s5(U5(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 i5(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}}},K5=Symbol(`break visit`),q5=Symbol(`skip children`),J5=Symbol(`remove item`);function Y5(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),X5(Object.freeze([]),e,t)}Y5.BREAK=K5,Y5.SKIP=q5,Y5.REMOVE=J5,Y5.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},Y5.parentCollection=(e,t)=>{let n=Y5.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 X5(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=X5(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===K5)return K5;else r===J5&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function Z5(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 Q5(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var $5=new Set(`0123456789ABCDEFabcdef`),e7=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),t7=new Set(`,[]{}`),n7=new Set(` ,[]{}
\r `),r7=e=>!e||n7.has(e),i7=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===`...`)&&Q5(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===`...`)&&Q5(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&&!Q5(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===`:`)&&Q5(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(r7),`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(`...`))&&Q5(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(r7),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||Q5(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=>Q5(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(Q5(r)||e&&t7.has(r))break;t=n}else if(Q5(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&t7.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&t7.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(r7),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(Q5(n)||t&&t7.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(;!Q5(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(e7.has(t))t=this.buffer[++e];else if(t===`%`&&$5.has(this.buffer[e+1])&&$5.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)}},a7=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 o7(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function s7(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 c7(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 l7(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 u7(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 d7(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 f7(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!o7(t.start,`explicit-key-ind`)&&!o7(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,c7(t.value)?t.value.end?d7(t.value.end,t.sep):t.value.end=t.sep:d7(t.start,t.sep),delete t.sep)}var p7=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 i7,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=Z5(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`&&f7(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&&s7(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)){d7(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(o7(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=u7(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(o7(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(c7(t.key)&&!o7(t.sep,`newline`)){let e=u7(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]}):o7(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&&!o7(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)){d7(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||o7(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=u7(l7(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=u7(l7(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 m7(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new a7||null,prettyErrors:t}}function h7(e,t={}){let{lineCounter:n,prettyErrors:r}=m7(t),i=new p7(n?.addNewLine),a=new G5(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 s5(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(l5(e,n)),o.warnings.forEach(l5(e,n))),o}function g7(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}var _7=120,v7=280,y7={"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function b7(e){return y7[e]??e}var x7=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function S7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function C7(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function w7(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(x7)].map(e=>e[1]))]}function T7(e){let t=h7(e).toJS(),n=S7(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Start`,type:``,detail:`an event or a task starts the run`}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c)=>{let l=S7(e)?e:{},u=typeof l.type==`string`?l.type:``,f=S7(l.settings)?l.settings:{},p=typeof l.id==`string`?l.id:``,m=`step-${t}`;r.push({id:m,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:p||t,title:p||b7(u),type:u,detail:C7(u,f),when:typeof l.when==`string`?l.when:void 0,retry:S7(l.retry)&&typeof l.retry.attempts==`number`?l.retry.attempts:void 0,continues:l.on_failure===`continue`,branch:s,...c??{stage:p||u,occurrence:d(p||u)}}}),p&&a.set(p,m);for(let e of w7(l.settings,l.when))o.push({from:e,to:m});return m},p=(e,t)=>{for(let n of e)i.push({id:`flow-${n}-${t}`,source:n,target:t,kind:`flow`})};for(let[e,t]of n.entries()){if(S7(t)&&S7(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i={stage:r,occurrence:d(r)},a=[],o=0;n.forEach(([t,r],s)=>{let u=(s-(n.length-1)/2)*v7,d=c;(Array.isArray(r)?r:[]).forEach((n,r)=>{let a=f(n,`${e+1}-${t}-${Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:z7(e)}))}var L7=/^(\s*)(-\s+)?/,R7=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function z7(e){let{code:t,comment:n}=B7(e),r=V7(t);return n&&r.push({text:n,kind:`comment`}),r}function B7(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 V7(e){if(!e)return[];let t=[],n=L7.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=R7.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,...H7(i[4]??``)]):[...t,...H7(r)]}function H7(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 U7(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function W7(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function G7(e){return typeof e==`string`&&e.trim()!==``}var K7={class:`space-y-1.5`},q7={class:`flex items-center gap-2`},J7={class:`flex items-center gap-2 text-sm`},Y7=[`value`],X7=[`value`],Z7={key:0,class:`text-xs text-fg-subtle`},Q7={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`},$7={"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`},e9={"aria-hidden":`true`,class:`pointer-events-none absolute inset-0 overflow-hidden py-3 pr-3 pl-14 break-words whitespace-pre-wrap`},t9={key:0,class:`text-sm`},n9={class:`cursor-pointer text-fg-subtle`},r9={class:`mt-2 flex flex-wrap gap-1.5`,"aria-label":`Step types`},i9=[`title`],a9={key:0,class:`text-fg-subtle`},o9={key:1,class:`text-sm text-danger`,role:`alert`},s9={class:`flex flex-wrap items-center gap-2 border-t border-border pt-4`},c9={key:0,class:`mr-auto font-mono text-xs text-fg-subtle`},l9=L({__name:`WorkflowEditor`,props:{selected:{required:!0},selectedModifiers:{}},emits:[`update:selected`],setup(e){let t=NA(),n=Y(()=>t.stateFor(`workflow-definitions`)),r=Y(()=>n.value.resource?.value??{definitions:[]}),i=Y(()=>t.shippedWorkflows()),a=no(e,`selected`),o=N(``),s=N(``),c=N(``),{runs:l,watched:u,stages:d,pick:f}=A7(a),p=Y(()=>i.value.definitions.find(e=>e.id===o.value));function m(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=``}I(a,m,{immediate:!0}),I(r,()=>{s.value||m(a.value)});async function h(e){return c.value=``,t.replace(`workflow-definitions`,e)}async function g(){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=jA(n,t)),await h(AA(n,{id:e,yaml:s.value}))&&(a.value=e)}async function _(){a.value&&await h(jA(r.value,a.value))&&(a.value=``,o.value=``,s.value=``)}async function v(){p.value&&await h(AA(r.value,OA(p.value)))}let y=Y(()=>t.stepTypes()),b=Y(()=>M7(s.value,y.value)),x=N(`canvas`),S=Y(()=>I7(s.value)),C=N(0);function w(e){C.value=e.target.scrollTop}return(e,t)=>(V(),H(`form`,{class:`space-y-4`,onSubmit:tu(g,[`prevent`])},[W(`div`,K7,[G(P(iT),{for:`workflow-id`},{default:F(()=>[...t[4]||=[K(`ID`,-1)]]),_:1}),G(P(bk),{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`])]),G(P(sW),{modelValue:x.value,"onUpdate:modelValue":t[3]||=e=>x.value=e,class:`space-y-1.5`},{default:F(()=>[W(`div`,q7,[G(P(lW),null,{default:F(()=>[G(P(uW),{value:`canvas`},{default:F(()=>[...t[5]||=[K(`Canvas`,-1)]]),_:1}),G(P(uW),{value:`yaml`},{default:F(()=>[...t[6]||=[K(`YAML`,-1)]]),_:1})]),_:1}),W(`span`,{class:j([`ml-auto text-xs`,b.value.ok?`text-ok`:`text-danger`]),role:`status`},M(b.value.ok?`✓`:`✕`)+` `+M(P(j7)(b.value)),3)]),G(P(cW),{value:`canvas`,class:`space-y-2`},{default:F(()=>[W(`label`,J7,[t[8]||=W(`span`,{class:`text-muted-foreground`},`Watching`,-1),W(`select`,{value:P(u),class:`h-8 max-w-md min-w-60 rounded-md border border-input bg-background px-2 text-sm`,onChange:t[1]||=e=>P(f)(e.target.value)},[t[7]||=W(`option`,{value:``},`No run, definition only`,-1),(V(!0),H(B,null,R(P(l),e=>(V(),H(`option`,{key:e.id,value:String(e.id)},` #`+M(e.id)+` `+M(e.title||`untitled`)+M(e.status?` · ${e.status}`:``),9,X7))),128))],40,Y7),P(l).length?q(``,!0):(V(),H(`span`,Z7,`This workflow has not run yet.`))]),G(O7,{yaml:s.value,stages:P(d)},null,8,[`yaml`,`stages`])]),_:1}),G(P(cW),{value:`yaml`},{default:F(()=>[W(`div`,Q7,[W(`div`,$7,[W(`div`,{style:pe(`transform:translateY(${-C.value}px)`)},[(V(!0),H(B,null,R(S.value,e=>(V(),H(`div`,{key:e.number,class:`min-h-6 pr-2 text-fg-subtle`},M(e.number),1))),128))],4)]),W(`div`,e9,[W(`div`,{style:pe(`transform:translateY(${-C.value}px)`)},[(V(!0),H(B,null,R(S.value,e=>(V(),H(`div`,{key:e.number,class:`min-h-6`},[(V(!0),H(B,null,R(e.tokens,(e,t)=>(V(),H(`span`,{key:t,class:j(P(F7)(e.kind))},M(e.text),3))),128))]))),128))],4)]),G(P(hT),{id:`workflow-yaml`,"aria-label":`Workflow YAML`,modelValue:s.value,"onUpdate:modelValue":t[2]||=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:w},null,8,[`modelValue`])])]),_:1})]),_:1},8,[`modelValue`]),y.value.length?(V(),H(`details`,t9,[W(`summary`,n9,`Step types (`+M(y.value.length)+`)`,1),W(`ul`,r9,[(V(!0),H(B,null,R(y.value,e=>(V(),H(`li`,{key:e.name,class:`rounded border border-border bg-secondary px-2 py-0.5 font-mono text-xs`,title:e.needs_repository?`Needs a repository`:`Runs without a repositoLine truncated
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},l8=class extends Error{constructor(e,...t){super(c8[e]?.call(c8,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function u8(e){return`clientX`in e}function d8(e){return`sourceEvent`in e}function f8(e,t){let n=u8(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var p8=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function m8(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function h8(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var g8=()=>!0;function _8(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function v8(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())a6(i,i6(e))>0&&r.push(e);return r}var y8=250;function b8(e,t,n,r){let i=[],a=1/0,o=v8(e,n,t+y8);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=r8(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function x8(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=g8},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=f8(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=S8(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===V3.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=T8(t,e,a,p,n,!0)}return b}function S8(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function C8(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function w8(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function T8(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===V3.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...r8(o,c,c.position,!0)}:c}var E8={[R3.Left]:R3.Right,[R3.Right]:R3.Left,[R3.Top]:R3.Bottom,[R3.Bottom]:R3.Top},D8=[`production`,`prod`];function O8(e,...t){k8()&&console.warn(`[Vue Flow]: ${e}`,...t)}function k8(){return!D8.includes(`production`)}function A8(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...o6(t)}}):null}function j8(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),$n(()=>{o.blur()})):n([e])}function M8(e){return P(e)!==void 0}function N8(e,t,n,r){if(!e||!e.source||!e.target)return n(new l8(s8.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=u6(e)?e:{...e,id:b6(e)},i=g6(i,void 0,r),!x6(i,t)&&i}function P8(e,t,n,r,i){if(!t.source||!t.target)return i(new l8(s8.EDGE_INVALID,e.id)),!1;if(!n)return i(new l8(s8.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?b6(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function F8(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!d6(o)){n(new l8(s8.NODE_INVALID,o?.id));continue}let s=h6(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new l8(s8.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function I8(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function L8(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;I8(`source`,o,`${r}-${a}--Line truncated
+1 -1
View File
@@ -37,7 +37,7 @@ function duration(ms?: number): string {
<template>
<div
class="w-60 rounded-lg border bg-card px-3 py-2 text-left shadow-sm"
:class="[stateClass, data.run ? '' : data.kind === 'step' && 'opacity-90']"
:class="[stateClass, data.selected && 'ring-2 ring-ring', data.kind === 'step' && 'cursor-pointer']"
>
<Handle v-if="data.kind !== 'start'" type="target" :position="Position.Top" />
<Handle id="data-in" type="target" :position="Position.Right" class="!opacity-0" />
+276
View File
@@ -0,0 +1,276 @@
<script setup lang="ts">
import { computed, ref, watch } from "vue";
import { ArrowDown, ArrowUp, Link2, Plus, Trash2, X } from "@lucide/vue";
import { parse, stringify } from "yaml";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { stepTitle } from "./workflow-graph";
import {
deleteStep,
earlierStepIDs,
insertStep,
moveStep,
replaceStep,
stepAt,
type StepPath,
type StepRecord,
} from "./workflow-edit";
import { settingsProblem, type SettingsSchema, type StepTypeInfo } from "./workflow-yaml";
const props = defineProps<{ yaml: string; path: StepPath | null; vocabulary: StepTypeInfo[] }>();
const emit = defineEmits<{ "update:yaml": [string]; select: [StepPath | null] }>();
const step = computed(() => (props.path ? stepAt(props.yaml, props.path) : undefined));
const type = computed(() => (typeof step.value?.type === "string" ? step.value.type : ""));
const info = computed(() => props.vocabulary.find((candidate) => candidate.name === type.value));
const settings = computed<Record<string, unknown>>(() =>
typeof step.value?.settings === "object" && step.value.settings !== null
? (step.value.settings as Record<string, unknown>)
: {},
);
// The schema's keys arrive sorted; the setting that says what a step does
// comes first.
const LEAD = ["mission", "workflow", "message", "body", "plan", "then", "status", "detail", "run", "rules"];
const fields = computed(() =>
Object.entries(info.value?.settings?.properties ?? {}).sort(([a], [b]) => {
const rank = (key: string) => (LEAD.includes(key) ? LEAD.indexOf(key) : LEAD.length);
return rank(a) - rank(b);
}),
);
const earlier = computed(() => (props.path ? earlierStepIDs(props.yaml, props.path) : []));
const inBranch = computed(() => (props.path?.length ?? 0) > 2);
const problem = computed(() =>
info.value?.settings && step.value?.settings ? settingsProblem(step.value.settings, info.value.settings, "settings") : "",
);
// The palette is open while nothing is selected; selecting a step, including
// the one just added, folds it away so that step's form is what shows.
const paletteOpen = ref(true);
watch(() => JSON.stringify(props.path), () => (paletteOpen.value = !props.path), { immediate: true });
const groups = computed(() => {
const byGroup = new Map<string, StepTypeInfo[]>();
for (const candidate of props.vocabulary) {
const group = candidate.name.split(".")[0];
byGroup.set(group, [...(byGroup.get(group) ?? []), candidate]);
}
return [...byGroup.entries()];
});
function write(next: StepRecord): void {
// id and type lead, the way a step is read.
const { id, type: stepType, ...rest } = next;
if (props.path) emit("update:yaml", replaceStep(props.yaml, props.path, { id, type: stepType, ...rest }));
}
function setField(key: string, value: unknown): void {
write({ ...step.value, [key]: value });
}
function setSetting(key: string, value: unknown): void {
write({ ...step.value, settings: { ...settings.value, [key]: value } });
}
function add(stepType: string): void {
const after = props.path && props.path.length === 2 ? Number(props.path[1]) : Number.MAX_SAFE_INTEGER;
const inserted = insertStep(props.yaml, after, stepType);
emit("update:yaml", inserted.source);
emit("select", inserted.path);
}
function move(delta: -1 | 1): void {
if (!props.path) return;
const moved = moveStep(props.yaml, props.path, delta);
emit("update:yaml", moved.source);
emit("select", moved.path);
}
function remove(): void {
if (!props.path) return;
emit("update:yaml", deleteStep(props.yaml, props.path));
emit("select", null);
}
// A reference is inserted into the text field last focused, which is how a
// later step is connected to an earlier step's result.
const focused = ref<string | null>(null);
function reference(id: string, field: "summary" | "result"): void {
const key = focused.value ?? fields.value.find(([, schema]) => schema.type === "string")?.[0];
if (!key) return;
const current = typeof settings.value[key] === "string" ? (settings.value[key] as string) : "";
const token = field === "summary" ? `{{ steps.${id}.summary }}` : `{{ steps.${id}.result }}`;
setSetting(key, current ? `${current.trimEnd()} ${token}` : token);
}
const longText = /mission|body|detail|plan|rules/;
function kindOf(key: string, schema: SettingsSchema): "select" | "text" | "line" | "boolean" | "number" | "lines" | "yaml" {
if (schema.type === "string") return schema.enum ? "select" : longText.test(key) ? "text" : "line";
if (schema.type === "boolean") return "boolean";
if (schema.type === "integer" || schema.type === "number") return "number";
if (schema.type === "array" && schema.items?.type === "string") return "lines";
return "yaml";
}
const yamlErrors = ref<Record<string, string>>({});
function setYamlSetting(key: string, text: string): void {
try {
setSetting(key, text.trim() ? parse(text) : undefined);
yamlErrors.value = { ...yamlErrors.value, [key]: "" };
} catch (error) {
yamlErrors.value = { ...yamlErrors.value, [key]: String((error as Error).message).split("\n")[0] };
}
}
function asYaml(value: unknown): string {
return value === undefined ? "" : stringify(value).trimEnd();
}
function label(key: string, schema: SettingsSchema): string {
return schema.title ?? key.replaceAll("_", " ").replace(/^./, (c) => c.toUpperCase());
}
</script>
<template>
<aside class="flex h-[560px] flex-col gap-3 overflow-y-auto rounded-lg border border-border bg-card p-3 text-sm">
<template v-if="step && path">
<div class="flex items-start gap-2">
<div class="min-w-0">
<div class="truncate font-medium">{{ stepTitle(type) }}</div>
<div class="font-mono text-[11px] text-fg-subtle">{{ type }}</div>
</div>
<Button type="button" variant="ghost" size="icon" class="ml-auto size-7" aria-label="Close" @click="emit('select', null)"><X /></Button>
</div>
<p v-if="problem" class="rounded bg-danger/10 px-2 py-1 text-xs text-danger" role="alert">{{ problem }}</p>
<label class="flex flex-col gap-1">
<span class="text-xs text-muted-foreground">Step id</span>
<Input
:model-value="(step.id as string) ?? ''"
class="h-8 font-mono"
placeholder="name it so later steps can use its result"
@update:model-value="setField('id', String($event))"
/>
</label>
<template v-for="[key, schema] in fields" :key="key">
<label v-if="kindOf(key, schema) === 'boolean'" class="flex items-start gap-2" :title="schema.description">
<input type="checkbox" class="mt-0.5" :checked="settings[key] === true" @change="setSetting(key, ($event.target as HTMLInputElement).checked || undefined)" />
<span>{{ label(key, schema) }}<span v-if="schema.description" class="block text-xs text-fg-subtle">{{ schema.description }}</span></span>
</label>
<label v-else class="flex flex-col gap-1">
<span class="text-xs text-muted-foreground">{{ label(key, schema) }}</span>
<select
v-if="kindOf(key, schema) === 'select'"
class="h-8 rounded-md border border-input bg-background px-2"
:value="(settings[key] as string) ?? ''"
@change="setSetting(key, ($event.target as HTMLSelectElement).value || undefined)"
>
<option value="">(default)</option>
<option v-for="option in schema.enum" :key="option" :value="option">{{ option }}</option>
</select>
<Textarea
v-else-if="kindOf(key, schema) === 'text'"
:model-value="(settings[key] as string) ?? ''"
class="min-h-28 font-mono text-xs"
@focus="focused = key"
@update:model-value="setSetting(key, String($event))"
/>
<Input
v-else-if="kindOf(key, schema) === 'line'"
:model-value="(settings[key] as string) ?? ''"
class="h-8"
@focus="focused = key"
@update:model-value="setSetting(key, String($event))"
/>
<Input
v-else-if="kindOf(key, schema) === 'number'"
type="number"
:model-value="(settings[key] as number) ?? ''"
class="h-8"
@update:model-value="setSetting(key, $event === '' ? undefined : Number($event))"
/>
<Textarea
v-else-if="kindOf(key, schema) === 'lines'"
:model-value="Array.isArray(settings[key]) ? (settings[key] as string[]).join('\n') : ''"
class="min-h-16 font-mono text-xs"
placeholder="one per line"
@update:model-value="setSetting(key, String($event).split('\n').filter(Boolean))"
/>
<template v-else>
<Textarea
:model-value="asYaml(settings[key])"
class="min-h-24 font-mono text-xs"
placeholder="YAML"
@change="setYamlSetting(key, ($event.target as HTMLTextAreaElement).value)"
/>
<span v-if="yamlErrors[key]" class="text-xs text-danger">{{ yamlErrors[key] }}</span>
</template>
<span v-if="schema.description" class="text-xs text-fg-subtle">{{ schema.description }}</span>
</label>
</template>
<div v-if="earlier.length && fields.some(([, schema]) => schema.type === 'string')" class="space-y-1">
<span class="flex items-center gap-1 text-xs text-muted-foreground"><Link2 class="size-3" aria-hidden="true" />Use an earlier step's result</span>
<div class="flex flex-wrap gap-1">
<template v-for="id in earlier" :key="id">
<button type="button" class="rounded bg-secondary px-1.5 py-0.5 font-mono text-[11px] hover:bg-secondary/70" @click="reference(id, 'summary')">{{ id }}.summary</button>
<button type="button" class="rounded bg-secondary px-1.5 py-0.5 font-mono text-[11px] hover:bg-secondary/70" @click="reference(id, 'result')">{{ id }}.result</button>
</template>
</div>
</div>
<details class="space-y-2">
<summary class="cursor-pointer text-xs text-muted-foreground">When, failure and retry</summary>
<label class="mt-2 flex flex-col gap-1">
<span class="text-xs text-muted-foreground">Run only when</span>
<Input :model-value="(step.when as string) ?? ''" class="h-8 font-mono" placeholder="steps.assess.result.fit" @update:model-value="setField('when', String($event))" />
</label>
<label class="flex flex-col gap-1">
<span class="text-xs text-muted-foreground">If it fails</span>
<select class="h-8 rounded-md border border-input bg-background px-2" :value="(step.on_failure as string) ?? ''" @change="setField('on_failure', ($event.target as HTMLSelectElement).value || undefined)">
<option value="">Park the task</option>
<option value="continue">Continue to the next step</option>
</select>
</label>
<label class="flex flex-col gap-1">
<span class="text-xs text-muted-foreground">Attempts</span>
<Input
type="number"
min="1"
max="10"
:model-value="((step.retry as { attempts?: number } | undefined)?.attempts) ?? ''"
class="h-8"
@update:model-value="setField('retry', $event === '' ? undefined : { ...(step.retry as object), attempts: Number($event) })"
/>
</label>
</details>
<div class="mt-auto flex flex-wrap gap-1.5 border-t border-border pt-3">
<Button type="button" variant="outline" size="sm" @click="move(-1)"><ArrowUp /> Up</Button>
<Button type="button" variant="outline" size="sm" @click="move(1)"><ArrowDown /> Down</Button>
<Button type="button" variant="ghost" size="sm" class="ml-auto text-danger" @click="remove"><Trash2 /> Remove</Button>
</div>
</template>
<div v-else class="text-xs text-fg-subtle">Select a step to edit it.</div>
<details
v-if="!inBranch"
:open="paletteOpen"
class="space-y-2 border-t border-border pt-3"
@toggle="paletteOpen = ($event.target as HTMLDetailsElement).open"
>
<summary class="cursor-pointer text-xs font-medium">{{ step ? "Add a step after this one" : "Add a step" }}</summary>
<div v-for="[group, members] in groups" :key="group" class="space-y-1">
<div class="text-[11px] tracking-wide text-fg-subtle uppercase">{{ group }}</div>
<div class="flex flex-wrap gap-1">
<button
v-for="candidate in members"
:key="candidate.name"
type="button"
class="flex items-center gap-1 rounded border border-border px-1.5 py-0.5 text-xs hover:bg-secondary"
:title="candidate.name"
@click="add(candidate.name)"
>
<Plus class="size-3" aria-hidden="true" />{{ stepTitle(candidate.name) }}
</button>
</div>
</div>
</details>
</aside>
</template>
+12 -3
View File
@@ -9,13 +9,21 @@ import "@vue-flow/controls/dist/style.css";
import StepNode from "./StepNode.vue";
import { withRuns, workflowGraph, type StageRun } from "./workflow-graph";
const props = defineProps<{ yaml: string; stages?: StageRun[] }>();
const props = defineProps<{ yaml: string; stages?: StageRun[]; selected?: (string | number)[] | null }>();
const emit = defineEmits<{ select: [(string | number)[] | null] }>();
const NODE_WIDTH = 240;
const container = ref<HTMLElement | null>(null);
const graph = computed(() => withRuns(workflowGraph(props.yaml), props.stages ?? []));
const nodes = computed(() => graph.value.nodes);
const selectedKey = computed(() => JSON.stringify(props.selected ?? null));
const nodes = computed(() =>
graph.value.nodes.map((node) =>
JSON.stringify(node.data.path ?? null) === selectedKey.value && props.selected
? { ...node, data: { ...node.data, selected: true } }
: node,
),
);
const edges = computed(() =>
graph.value.edges.map(({ label, offset, ...edge }) => ({
...edge,
@@ -50,7 +58,6 @@ watch(() => nodes.value.filter((node) => node.data.run).length, () => place());
<template>
<div ref="container" class="workflow-canvas h-[560px] overflow-hidden rounded-lg border border-border bg-background">
<VueFlow
:key="yaml"
class="h-full"
:nodes="nodes"
:edges="edges"
@@ -61,6 +68,8 @@ watch(() => nodes.value.filter((node) => node.data.run).length, () => place());
:max-zoom="1.5"
pan-on-scroll
@pane-ready="place"
@node-click="({ node }) => emit('select', node.data.path ?? null)"
@pane-click="emit('select', null)"
>
<template #node-step="nodeProps">
<StepNode v-bind="nodeProps" />
+9 -2
View File
@@ -8,7 +8,9 @@ import { Label } from "@/components/ui/label";
import { Spinner } from "@/components/ui/spinner";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
import StepPanel from "./StepPanel.vue";
import WorkflowCanvas from "./WorkflowCanvas.vue";
import type { StepPath } from "./workflow-edit";
import { useWorkflowRuns } from "./workflow-runs";
import {
cloneControlPlaneValue,
@@ -38,6 +40,7 @@ const shipped = computed<WorkflowDefinitionCollection>(() =>
const selected = defineModel<string>("selected", { required: true });
const id = ref("");
const yaml = ref("");
const selectedStep = ref<StepPath | null>(null);
const localError = ref("");
const { runs, watched, stages, pick } = useWorkflowRuns(selected);
@@ -51,7 +54,8 @@ function load(value: string): void {
(candidate) => candidate.id === value,
);
id.value = entry?.id ?? value;
yaml.value = entry?.yaml ?? `id: ${value}\nsteps:\n - type: `;
yaml.value = entry?.yaml ?? `id: ${value}\nsteps: []\n`;
selectedStep.value = null;
localError.value = "";
}
@@ -157,7 +161,10 @@ function syncScroll(event: Event): void {
</select>
<span v-if="!runs.length" class="text-xs text-fg-subtle">This workflow has not run yet.</span>
</label>
<WorkflowCanvas :yaml="yaml" :stages="stages" />
<div class="grid gap-3 lg:grid-cols-[1fr_20rem]">
<WorkflowCanvas :yaml="yaml" :stages="stages" :selected="selectedStep" @select="selectedStep = $event" />
<StepPanel v-model:yaml="yaml" :path="selectedStep" :vocabulary="vocabulary" @select="selectedStep = $event" />
</div>
</TabsContent>
<TabsContent value="yaml">
<!--
+107
View File
@@ -0,0 +1,107 @@
import { isMap, isSeq, parseDocument } from "yaml";
/**
* Canvas edits as edits to the workflow's YAML document. The text stays the
* one source of truth, so the canvas and the YAML tab cannot disagree, and
* comments and layout the operator wrote survive an edit made on the canvas.
*/
/** Where a step lives in the document: ["steps", 2], or
* ["steps", 1, "parallel", "docs", 0] for a step inside a branch. */
export type StepPath = (string | number)[];
export type StepRecord = Record<string, unknown>;
/** A step as plain data, or undefined when the path names none. */
export function stepAt(source: string, path: StepPath): StepRecord | undefined {
const node = parseDocument(source).getIn(path, true);
if (!isMap(node)) return undefined;
return node.toJSON() as StepRecord;
}
/** Replaces one step with a new value. Unset keys are dropped, so a cleared
* field leaves no empty key behind. */
export function replaceStep(source: string, path: StepPath, step: StepRecord): string {
const document = parseDocument(source);
document.setIn(path, document.createNode(prune(step)));
return document.toString();
}
/** Inserts a new step of the given type after the top-level step at index
* (-1 inserts first; past the end appends). Returns the new source and the
* inserted step's path. */
export function insertStep(source: string, after: number, type: string): { source: string; path: StepPath } {
const document = parseDocument(source);
let steps = document.get("steps", true);
if (!isSeq(steps)) {
document.set("steps", document.createNode([]));
steps = document.get("steps", true);
}
if (!isSeq(steps)) return { source, path: [] };
const index = Math.min(Math.max(after + 1, 0), steps.items.length);
steps.items.splice(index, 0, document.createNode({ type }));
return { source: document.toString(), path: ["steps", index] };
}
/** Removes a step. A branch left empty is removed with it. */
export function deleteStep(source: string, path: StepPath): string {
const document = parseDocument(source);
document.deleteIn(path);
const branch = path.slice(0, -1);
if (branch.length > 2) {
const remaining = document.getIn(branch, true);
if (isSeq(remaining) && remaining.items.length === 0) document.deleteIn(branch);
}
return document.toString();
}
/** Moves a step one place up (-1) or down (+1) within its own list. Returns
* the new source and the step's new path. */
export function moveStep(source: string, path: StepPath, delta: -1 | 1): { source: string; path: StepPath } {
const document = parseDocument(source);
const list = document.getIn(path.slice(0, -1), true);
const index = path.at(-1);
if (!isSeq(list) || typeof index !== "number") return { source, path };
const target = index + delta;
if (target < 0 || target >= list.items.length) return { source, path };
const [item] = list.items.splice(index, 1);
list.items.splice(target, 0, item);
return { source: document.toString(), path: [...path.slice(0, -1), target] };
}
/** The ids every step before the given one declares, which are the steps its
* settings may reference. Inside a branch, sibling branches are not visible. */
export function earlierStepIDs(source: string, path: StepPath): string[] {
const value = parseDocument(source).toJS() as { steps?: unknown[] } | null;
const steps = Array.isArray(value?.steps) ? value.steps : [];
const top = typeof path[1] === "number" ? path[1] : steps.length;
const ids: string[] = [];
const collect = (step: unknown) => {
if (typeof step !== "object" || step === null) return;
const record = step as StepRecord;
if (typeof record.id === "string") ids.push(record.id);
if (typeof record.parallel === "object" && record.parallel !== null)
for (const branch of Object.values(record.parallel as Record<string, unknown[]>))
if (Array.isArray(branch)) branch.forEach(collect);
};
steps.slice(0, top).forEach(collect);
if (path.length === 5) {
const branch = (steps[top] as StepRecord | undefined)?.parallel as Record<string, unknown[]> | undefined;
const own = branch?.[path[3] as string];
if (Array.isArray(own)) own.slice(0, path[4] as number).forEach(collect);
}
return ids;
}
function prune(value: unknown): unknown {
if (Array.isArray(value)) return value.map(prune);
if (typeof value !== "object" || value === null) return value;
const out: Record<string, unknown> = {};
for (const [key, child] of Object.entries(value)) {
if (child === undefined || child === "" || child === null) continue;
const pruned = prune(child);
if (typeof pruned === "object" && pruned !== null && !Array.isArray(pruned) && Object.keys(pruned).length === 0) continue;
out[key] = pruned;
}
return out;
}
+7 -2
View File
@@ -22,6 +22,9 @@ export interface StepNodeData {
stage?: string;
occurrence?: number;
run?: StageRun;
/** Where the step lives in the YAML document, for editing it. */
path?: (string | number)[];
selected?: boolean;
}
/** One recorded run of a step, from the task's attempts view. */
@@ -167,6 +170,7 @@ export function workflowGraph(source: string): WorkflowGraph {
y: number,
branch?: string,
recorded?: { stage: string; occurrence: number },
path?: (string | number)[],
): string => {
const record = isMapping(step) ? step : {};
const type = typeof record.type === "string" ? record.type : "";
@@ -187,6 +191,7 @@ export function workflowGraph(source: string): WorkflowGraph {
retry: isMapping(record.retry) && typeof record.retry.attempts === "number" ? record.retry.attempts : undefined,
continues: record.on_failure === "continue",
branch,
path,
...(recorded ?? { stage: stepID || type, occurrence: occurrenceOf(stepID || type) }),
},
});
@@ -210,7 +215,7 @@ export function workflowGraph(source: string): WorkflowGraph {
const x = (column - (branches.length - 1) / 2) * COLUMN;
let tail = previous;
(Array.isArray(branchSteps) ? branchSteps : []).forEach((branchStep, j) => {
const id = addStep(branchStep, `${i + 1}-${name}-${j + 1}`, x, (row + j) * ROW, name, recorded);
const id = addStep(branchStep, `${i + 1}-${name}-${j + 1}`, x, (row + j) * ROW, name, recorded, ["steps", i, "parallel", name, j]);
link(tail, id);
tail = [id];
depth = Math.max(depth, j + 1);
@@ -221,7 +226,7 @@ export function workflowGraph(source: string): WorkflowGraph {
row += Math.max(depth, 1);
continue;
}
const id = addStep(step, String(i + 1), 0, row * ROW);
const id = addStep(step, String(i + 1), 0, row * ROW, undefined, undefined, ["steps", i]);
link(previous, id);
previous = [id];
row++;
+27 -2
View File
@@ -83,27 +83,52 @@ export function parseWorkflowYaml(
? value.repository.trim()
: "required";
const chips: WorkflowStepChip[] = [];
const declared = new Set<string>();
for (const [i, step] of steps.entries()) {
const where = `workflow ${id} step ${i + 1}`;
if (isMapping(step) && isMapping(step.parallel)) {
for (const [branch, branchSteps] of Object.entries(step.parallel)) {
if (!Array.isArray(branchSteps) || !branchSteps.length)
return { ok: false, message: `${where}: branch ${branch} needs a list of steps` };
const visible = new Set(declared);
for (const [j, branchStep] of branchSteps.entries()) {
const problem = checkStepType(branchStep, `${where} branch ${branch} step ${j + 1}`, known, repository);
const branchWhere = `${where} branch ${branch} step ${j + 1}`;
const problem =
checkStepType(branchStep, branchWhere, known, repository) ||
laterReference(branchStep, branchWhere, visible);
if (problem) return { ok: false, message: problem };
declareID(branchStep, visible);
}
for (const branchStep of branchSteps) declareID(branchStep, declared);
}
declareID(step, declared);
chips.push({ index: i + 1, type: "parallel" });
continue;
}
const problem = checkStepType(step, where, known, repository);
const problem = checkStepType(step, where, known, repository) || laterReference(step, where, declared);
if (problem) return { ok: false, message: problem };
declareID(step, declared);
chips.push({ index: i + 1, type: (step as { type: string }).type.trim() });
}
return { ok: true, id, steps: chips };
}
const STEP_REFERENCE = /steps\.([A-Za-z0-9_-]+)/g;
/** A reference to a step that has not run yet: the server refuses it, so the
* page says so before save. */
function laterReference(step: unknown, where: string, declared: Set<string>): string {
if (!isMapping(step)) return "";
const text = JSON.stringify(step.settings ?? {}) + " " + (typeof step.when === "string" ? step.when : "");
for (const [, ref] of text.matchAll(STEP_REFERENCE))
if (!declared.has(ref)) return `${where}: no earlier step has id "${ref}"`;
return "";
}
function declareID(step: unknown, declared: Set<string>): void {
if (isMapping(step) && typeof step.id === "string") declared.add(step.id);
}
/** What is wrong with one typed step, or "" when nothing the page can see. */
function checkStepType(
step: unknown,