feat(ui): quieter workflows page: hover data edges, apply chip, restore behind confirm
This commit is contained in:
1 parent
5c9ac19882
commit
709ddbf019
13 files changed
+158
-96
No files matched your search
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,D as t,Jt as n,O as r,_ as i,b as a,ht as o,kn as s,lt as c,nr as l,s as u,t as d,v as f,x as p,xt as m,yn as h}from"./PageHeader.js";import{X as g,r as _}from"./badge.js";import{l as v,n as y,t as b,v as x}from"./HistoryLink.js";import{v as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`flex items-center justify-between`},E={class:`font-mono text-sm`},D=`agent-profiles`,O=e({__name:`AgentProfilesPage`,setup(e){let O=v();c(O.load);let k=i(()=>O.drafts[D]?.value),A=h(``);function j(){let e=A.value.trim();if(!e||k.value?.[e])return;let t=O.drafts[D];t&&(t.value||={},t.value[e]={image:``,kit:``,adapter:``,tools:[]},A.value=``)}function M(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(e,i)=>(o(),p(`div`,null,[r(d,{title:`Agent profiles`},{default:n(()=>[r(b,{kinds:[D]},null,8,[`kinds`])]),_:1}),r(y,{kind:D,class:`mb-4`}),s(O).catalogError||s(O).pageErrorFor(D)?(o(),p(`p`,C,l(s(O).catalogError||s(O).pageErrorFor(D)),1)):a(``,!0),f(`form`,{class:`mb-4 flex gap-2`,onSubmit:g(j,[`prevent`])},[r(s(x),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`},null,8,[`modelValue`]),r(s(_),{type:`submit`,disabled:!A.value.trim()||!!k.value?.[A.value.trim()]},{default:n(()=>[...i[1]||=[t(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?a(``,!0):(o(),p(`p`,w,`No agent profiles.`)),(o(!0),p(u,null,m(k.value,(e,a)=>(o(),p(`section`,{key:a,class:`mb-6 border-t pt-4`},[f(`div`,T,[f(`h2`,E,l(a),1),r(s(_),{variant:`ghost`,size:`sm`,onClick:e=>delete k.value[a]},{default:n(()=>[...i[2]||=[t(`Remove profile`,-1)]]),_:1},8,[`onClick`])]),r(s(S),{label:`Image`,for:`${a}-image`},{default:n(()=>[r(s(x),{id:`${a}-image`,modelValue:e.image,"onUpdate:modelValue":t=>e.image=t,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(S),{label:`Kit`,for:`${a}-kit`,hint:`Pinned digest; leave Image empty when using a Kit.`},{default:n(()=>[r(s(x),{id:`${a}-kit`,modelValue:e.kit,"onUpdate:modelValue":t=>e.kit=t,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(S),{label:`Adapter`,for:`${a}-adapter`},{default:n(()=>[r(s(x),{id:`${a}-adapter`,modelValue:e.adapter,"onUpdate:modelValue":t=>e.adapter=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(S),{label:`Tools`,for:`${a}-tools`,hint:`Comma-separated tool names.`},{default:n(()=>[r(s(x),{id:`${a}-tools`,"model-value":(e.tools??[]).join(`, `),"onUpdate:modelValue":t=>M(e,t)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]))),128))]))}});export{O as default};
|
||||
import{l as e,n as t,t as n,v as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v,yn as y}from"./PageHeader.js";import{X as b,r as x}from"./badge.js";import{v as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`flex items-center justify-between`},E={class:`font-mono text-sm`},D=`agent-profiles`,O=i({__name:`AgentProfilesPage`,setup(i){let O=e();f(O.load);let k=c(()=>O.drafts[D]?.value),A=y(``);function j(){let e=A.value.trim();if(!e||k.value?.[e])return;let t=O.drafts[D];t&&(t.value||={},t.value[e]={image:``,kit:``,adapter:``,tools:[]},A.value=``)}function M(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(e,i)=>(u(),_(`div`,null,[s(h,{title:`Agent profiles`},{default:o(()=>[s(n,{kinds:[D]},null,8,[`kinds`])]),_:1}),s(t,{kind:D,class:`mb-4`}),d(O).catalogError||d(O).pageErrorFor(D)?(u(),_(`p`,C,p(d(O).catalogError||d(O).pageErrorFor(D)),1)):l(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:b(j,[`prevent`])},[s(d(r),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`},null,8,[`modelValue`]),s(d(x),{type:`submit`,disabled:!A.value.trim()||!!k.value?.[A.value.trim()]},{default:o(()=>[...i[1]||=[a(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?l(``,!0):(u(),_(`p`,w,`No agent profiles.`)),(u(!0),_(m,null,v(k.value,(e,t)=>(u(),_(`section`,{key:t,class:`mb-6 border-t pt-4`},[g(`div`,T,[g(`h2`,E,p(t),1),s(d(x),{variant:`ghost`,size:`sm`,onClick:e=>delete k.value[t]},{default:o(()=>[...i[2]||=[a(`Remove profile`,-1)]]),_:1},8,[`onClick`])]),s(d(S),{label:`Image`,for:`${t}-image`},{default:o(()=>[s(d(r),{id:`${t}-image`,modelValue:e.image,"onUpdate:modelValue":t=>e.image=t,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Kit`,for:`${t}-kit`,hint:`Pinned digest; leave Image empty when using a Kit.`},{default:o(()=>[s(d(r),{id:`${t}-kit`,modelValue:e.kit,"onUpdate:modelValue":t=>e.kit=t,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Adapter`,for:`${t}-adapter`},{default:o(()=>[s(d(r),{id:`${t}-adapter`,modelValue:e.adapter,"onUpdate:modelValue":t=>e.adapter=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Tools`,for:`${t}-tools`,hint:`Comma-separated tool names.`},{default:o(()=>[s(d(r),{id:`${t}-tools`,"model-value":(e.tools??[]).join(`, `),"onUpdate:modelValue":t=>M(e,t)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]))),128))]))}});export{O as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,D as t,Jt as n,O as r,_ as i,b as a,ht as o,kn as s,lt as c,nr as l,s as u,t as d,v as f,x as p,xt as m}from"./PageHeader.js";import{r as h}from"./badge.js";import{l as g,n as _,t as v,v as y}from"./HistoryLink.js";import{_ as b,v as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w={class:`flex justify-end`},T=`credential-bindings`,E=e({__name:`CredentialBindingsPage`,setup(e){let E=g();c(E.load);let D=i(()=>E.drafts[T]?.value);function O(){let e=E.drafts[T];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}))}return(e,i)=>(o(),p(`div`,null,[r(d,{title:`Credential bindings`},{default:n(()=>[r(v,{kinds:[T]},null,8,[`kinds`]),r(s(h),{onClick:O},{default:n(()=>[...i[0]||=[t(`Add binding`,-1)]]),_:1})]),_:1}),r(_,{kind:T,class:`mb-4`}),s(E).catalogError||s(E).pageErrorFor(T)?(o(),p(`p`,S,l(s(E).catalogError||s(E).pageErrorFor(T)),1)):a(``,!0),D.value?.length?a(``,!0):(o(),p(`p`,C,`No credential bindings.`)),(o(!0),p(u,null,m(D.value,(e,a)=>(o(),p(`section`,{key:a,class:`mb-6 border-t pt-4`},[f(`div`,w,[r(s(h),{variant:`ghost`,size:`sm`,onClick:e=>D.value.splice(a,1)},{default:n(()=>[...i[1]||=[t(`Remove binding`,-1)]]),_:1},8,[`onClick`])]),r(s(x),{label:`Service`,for:`binding-${a}-service`},{default:n(()=>[r(s(y),{id:`binding-${a}-service`,modelValue:e.service,"onUpdate:modelValue":t=>e.service=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(x),{label:`Organisation`,for:`binding-${a}-org`,hint:`Empty uses the default organisation.`},{default:n(()=>[r(s(y),{id:`binding-${a}-org`,modelValue:e.org,"onUpdate:modelValue":t=>e.org=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),r(s(x),{label:`Secret`},{default:n(()=>[r(b,{modelValue:e.secret,"onUpdate:modelValue":t=>e.secret=t,"id-prefix":`binding-${a}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]))),128))]))}});export{E as default};
|
||||
import{l as e,n as t,t as n,v as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v}from"./PageHeader.js";import{r as y}from"./badge.js";import{_ as b,v as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w={class:`flex justify-end`},T=`credential-bindings`,E=i({__name:`CredentialBindingsPage`,setup(i){let E=e();f(E.load);let D=c(()=>E.drafts[T]?.value);function O(){let e=E.drafts[T];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}))}return(e,i)=>(u(),_(`div`,null,[s(h,{title:`Credential bindings`},{default:o(()=>[s(n,{kinds:[T]},null,8,[`kinds`]),s(d(y),{onClick:O},{default:o(()=>[...i[0]||=[a(`Add binding`,-1)]]),_:1})]),_:1}),s(t,{kind:T,class:`mb-4`}),d(E).catalogError||d(E).pageErrorFor(T)?(u(),_(`p`,S,p(d(E).catalogError||d(E).pageErrorFor(T)),1)):l(``,!0),D.value?.length?l(``,!0):(u(),_(`p`,C,`No credential bindings.`)),(u(!0),_(m,null,v(D.value,(e,t)=>(u(),_(`section`,{key:t,class:`mb-6 border-t pt-4`},[g(`div`,w,[s(d(y),{variant:`ghost`,size:`sm`,onClick:e=>D.value.splice(t,1)},{default:o(()=>[...i[1]||=[a(`Remove binding`,-1)]]),_:1},8,[`onClick`])]),s(d(x),{label:`Service`,for:`binding-${t}-service`},{default:o(()=>[s(d(r),{id:`binding-${t}-service`,modelValue:e.service,"onUpdate:modelValue":t=>e.service=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(x),{label:`Organisation`,for:`binding-${t}-org`,hint:`Empty uses the default organisation.`},{default:o(()=>[s(d(r),{id:`binding-${t}-org`,modelValue:e.org,"onUpdate:modelValue":t=>e.org=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(x),{label:`Secret`},{default:o(()=>[s(b,{modelValue:e.secret,"onUpdate:modelValue":t=>e.secret=t,"id-prefix":`binding-${t}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]))),128))]))}});export{E as default};
|
||||
Vendored
+3
-1
@@ -1 +1,3 @@
|
||||
import{A as e,Ct as t,D as n,Dn as r,En as i,Jt as a,O as o,Qn as s,R as c,Sn as l,Tn as u,U as d,Ut as f,V as p,Wt as m,Xt as h,Y as g,_,_n as v,an as y,b,dn as x,ht as S,kn as C,ln as w,lt as T,mn as E,nr as D,nt as O,on as ee,pn as k,pt as A,s as te,v as j,wn as M,x as N,xt as ne,y as re,yn as P}from"./PageHeader.js";import{C as ie,E as ae,S as oe,T as se,a as ce,c as le,f as F,h as ue,l as de,o as fe,p as pe,q as me,r as he,s as I,t as ge,u as L}from"./badge.js";var _e=typeof window<`u`,ve,R=e=>ve=e,ye=Symbol();function be(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var xe=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function Se(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function Ce(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Ee(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function we(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function z(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var B=typeof navigator==`object`?navigator:{userAgent:``},Te=/Macintosh/.test(B.userAgent)&&/AppleWebKit/.test(B.userAgent)&&!/Safari/.test(B.userAgent),Ee=_e?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Te?De:`msSaveOrOpenBlob`in B?Oe:ke:()=>{};function De(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?z(r):we(r.href)?Ce(e,t,n):(r.target=`_blank`,z(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){z(r)},0))}function Oe(e,t=`download`,n){if(typeof e==`string`){if(we(e))Ce(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){z(t)})}}else navigator.msSaveOrOpenBlob(Se(e,n),t)}function ke(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return Ce(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(xe.HTMLElement))||`safari`in xe,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Te)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:Ae}=Object;function je(){let e=y(!0),t=e.run(()=>P({})),n=[],r=[],i=k({install(e){R(i),i._a=e,e.provide(ye,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var V=()=>{};function Me(e,t,n,r=V){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&ee()&&E(i),i}function H(e,...t){e.forEach(e=>{e(...t)})}var Ne=e=>e(),Pe=Symbol(),U=Symbol();function W(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!Object.hasOwn(t,n))continue;let r=t[n],i=e[n];e[n]=be(i)&&be(r)&&Object.hasOwn(e,n)&&!x(r)&&!w(r)?W(i,r):r}return e}var Fe=Symbol();function Ie(e){return!e||typeof e!=`object`||!Object.hasOwn(e,Fe)}var{assign:G}=Object;function Le(e){return!!(x(e)&&e.effect)}function Re(e,t,n,r){let{state:a,actions:o,getters:s}=t,c=n.state.value[e],l;function u(){return c||(n.state.value[e]=a?a():{}),G(i(n.state.value[e]),o,Object.keys(s||{}).reduce((t,r)=>(t[r]=k(_(()=>{R(n);let t=n._s.get(e);return s[r].call(t,t)})),t),{}))}return l=ze(e,u,t,n,r,!0),l}function ze(e,t,n={},r,i,a){let o,s=G({actions:{}},n),c={deep:!0},l,u,d=new Set,p=new Set,m,h=r.state.value[e];!a&&!h&&(r.state.value[e]={});let g;function _(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:`patch function`,storeId:e,events:m}):(W(r.state.value[e],t),n={type:`patch object`,payload:t,storeId:e,events:m});let i=g=Symbol();O().then(()=>{g===i&&(l=!0)}),u=!0,H(d,n,r.state.value[e])}let b=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{G(e,t)})}:V;function S(){o.stop(),d.clear(),p.clear(),r._s.delete(e)}let C=(t,n=``)=>{if(Pe in t)return t[U]=n,t;let i=function(){R(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(Line truncated
|
||||
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as C,Jt as w,K as T,Kt as E,L as ee,Lt as te,M as D,Mn as ne,Mt as re,N as ie,Nn as ae,Nt as oe,O,On as se,Ot as ce,P as le,Pt as ue,Q as de,Qn as fe,Qt as pe,R as k,Rt as me,S as he,Sn as A,St as j,T as ge,Tn as _e,Tt as ve,U as ye,Ut as M,V as be,Vt as xe,W as Se,Wt as N,X as Ce,Xt as we,Y as Te,Yt as Ee,Z as De,Zt as Oe,_ as P,_n as F,_t as ke,a as Ae,an as je,at as Me,b as Ne,bn as Pe,bt as Fe,c as Ie,cn as Le,ct as Re,d as ze,dn as I,dt as Be,en as Ve,er as He,et as Ue,f as We,fn as Ge,ft as Ke,g as qe,gn as Je,gt as Ye,h as Xe,hn as Ze,ht as L,i as Qe,in as $e,it as et,j as tt,jt as nt,k as rt,kn as R,kt as it,l as at,ln as ot,lt as st,m as ct,mn as lt,mt as ut,n as dt,nn as ft,nr as z,nt as B,o as pt,on as mt,ot as ht,p as gt,pn as _t,pt as vt,q as yt,qt as bt,r as xt,rn as St,rr as Ct,rt as wt,s as Tt,sn as Et,st as Dt,tn as Ot,tr as kt,tt as V,u as At,un as jt,ut as Mt,v as Nt,vn as Pt,vt as Ft,w as It,wn as Lt,wt as Rt,x as H,xn as zt,xt as Bt,y as U,yn as W,yt as Vt,z as Ht,zt as Ut}from"./PageHeader.js";import{A as Wt,B as Gt,C as Kt,D as qt,E as Jt,F as Yt,G as Xt,H as Zt,I as Qt,J as $t,K as en,L as tn,M as nn,N as rn,O as an,P as on,R as sn,S as cn,T as ln,U as un,V as dn,W as fn,X as pn,Y as mn,a as hn,c as gn,d as _n,f as vn,g as yn,h as bn,j as xn,k as Sn,l as Cn,o as wn,p as Tn,q as En,r as Dn,s as On,t as kn,u as An,v as jn,z as Mn}from"./badge.js";var Nn=Object.defineProperty,Pn=((e,t)=>{let n={};for(var r in e)Nn(n,r,{get:e[r],enumerable:!0});return t||Nn(n,Symbol.toStringTag,{value:`Module`}),n})({BaseTransition:()=>dt,BaseTransitionPropsValidators:()=>xt,Comment:()=>Qe,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>Ae,ErrorTypeStrings:()=>pt,Fragment:()=>Tt,KeepAlive:()=>Ie,ReactiveEffect:()=>Ve,Static:()=>at,Suspense:()=>At,Teleport:()=>ze,Text:()=>We,TrackOpTypes:()=>Ot,Transition:()=>qt,TransitionGroup:()=>an,TriggerOpTypes:()=>ft,VueElement:()=>Sn,assertNumber:()=>gt,callWithAsyncErrorHandling:()=>ct,callWithErrorHandling:()=>Xe,camelize:()=>ne,capitalize:()=>ae,cloneVNode:()=>qe,compatUtils:()=>null,compile:()=>Fn,computed:()=>P,createApp:()=>Wt,createBlock:()=>U,createCommentVNode:()=>Ne,createElementBlock:()=>H,createElementVNode:()=>Nt,createHydrationRenderer:()=>he,createPropsRestProxy:()=>o,createRenderer:()=>It,createSSRApp:()=>xn,createSlots:()=>ge,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>O,customRef:()=>St,defineAsyncComponent:()=>rt,defineComponent:()=>n,defineCustomElement:()=>nn,defineEmits:()=>tt,defineExpose:()=>D,defineModel:()=>ie,defineOptions:()=>le,defineProps:()=>h,defineSSRCustomElement:()=>rn,defineSlots:()=>x,devtools:()=>ee,effect:()=>$e,effectScope:()=>je,getCurrentInstance:()=>k,getCurrentScope:()=>mt,getCurrentWatcher:()=>Et,getTransitionRawChildren:()=>Ht,guardReactiveProps:()=>i,h:()=>be,handleError:()=>y,hasInjectionContext:()=>ye,hydrate:()=>on,hydrateOnIdle:()=>Se,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>yt,initCustomFormatter:()=>C,initDirectivesForSSR:()=>Yt,inject:()=>Te,isMemoSame:()=>Ce,isProxy:()=>Le,isReactive:()=>ot,isReadonly:()=>jt,isRef:()=>I,isRuntimeOnly:()=>De,isShallow:()=>Ge,isVNode:()=>de,markRaw:()=>_t,mergeDefaults:()=>e,mergeModels:()=>Ue,mergeProps:()=>V,nextTick:()=>B,nodeOps:()=>Qt,normalizeClass:()=>fe,normalizeProps:()=>He,normalizeStyle:()=>kt,onActivated:()=>wt,onBeforeMount:()=>et,onBeforeUnmount:()=>Me,onBeforeUpdate:()=>ht,onDeactivated:()=>Dt,onErrorCaptured:()=>Re,onMounted:()=>st,onRenderTracked:()=>Mt,onRenderTriggered:()=>Be,onScopeDispose:()=>lt,onServerPrefetch:()=>Ke,onUnmounted:()=>vt,onUpdated:()=>ut,onWatcherCleanup:()=>Ze,openBlock:()=>L,patchProp:()=>tn,popScopeId:()=>Ye,provide:()=>ke,proxyRefs:()=>Je,pushScopeId:()=>Ft,queuePostFlushCb:()=>Vt,reactive:()=>F,readonly:()=>Pt,ref:()=>W,registerRuntimeCompiler:()=>Fe,render:()=>sn,renderList:()=>Bt,renderSlot:()=>j,resolveComponent:()=>c,resolveDirective:()=>Rt,resolveDynamicComponent:()=>ve,resolveFilter:()=>null,resolveTransitionHooks:()=>m,setBlockTracking:()=>d,setDevtoolsHook:()=>ce,setTransitionHooks:()=>it,shallowReactive:()=>Pe,shallowReadonly:()=>zt,shallowRef:()=>A,ssrContextKey:()=>r,ssrUtils:()=>nt,stop:()=>s,toDisplayString:()=>z,toHandlerKey:()=>Ct,toHandlers:()=>re,toRaw:()=>Lt,toRef:()=>_e,toRefs:()=>p,toValue:()=>u,transformVNodeArgs:()=>oe,triggerRef:()=>se,unref:()=>R,useAttrs:()=>ue,useCssModule:()=>Mn,useCssVars:()=>Gt,useHost:()=>dn,useId:()=>g,useModel:()=>S,useSSRContext:()=>te,useShadowRoot:()=>Zt,useSlots:()=>me,useTemplateRef:()=>Ut,useTransitionState:()=>a,vModelCheckbox:()=>un,vModelDynamic:()=>fn,vModelRadio:()=>Xt,vModelSelect:()=>en,vModelText:()=>En,vShow:()=>$t,version:()=>xe,warn:()=>b,watch:()=>M,watchEffect:()=>N,watchPostEffect:()=>v,watchSyncEffect:()=>E,withAsyncContext:()=Line truncated
|
||||
`)].join(`
|
||||
`))}return()=>i.value||r.value||o.value?be(t.default({present:o.value})[0],{ref:e=>{let t=q(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Yi=`dismissableLayer.pointerDownOutside`,Xi=`dismissableLayer.focusOutside`;function Zi(e){if(typeof e!=`object`||!e)return!1;let t=e.ownerDocument?.defaultView;return typeof Element<`u`&&e instanceof Element||!!t&&e instanceof t.Element}function Qi(e,t){if(!Zi(t))return!1;if(e.contains(t))return!0;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function $i(e,t,n=!0){let r=W(!1),i=W(()=>{});return N(a=>{if(!K||!u(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(Qi(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){Or(Yi,e,t)}n.pointerType===`touch`?(o.removeEventListener(`click`,i.value),i.value=r,o.addEventListener(`click`,i.value,{once:!0})):r()}else o.removeEventListener(`click`,i.value);r.value=!1}}},c=window.setTimeout(()=>{o.addEventListener(`pointerdown`,s)},0);a(()=>{window.clearTimeout(c),o.removeEventListener(`pointerdown`,s),o.removeEventListener(`click`,i.value)})}),{onPointerDownCapture:()=>{u(n)&&(r.value=!0)}}}function ea(e,t,n=!0){let r=W(!1);return N(i=>{if(!K||!u(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await B(),await B();let i=n.target;t.value&&i&&!Qi(t.value,i)&&n.target&&!r.value&&Or(Xi,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{u(n)&&(r.value=!0)},onBlurCapture:()=>{u(n)&&(r.value=!1)}}}var ta=F({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),na=n({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=J(),o=P(()=>a.value?.ownerDocument??globalThis.document),s=P(()=>ta.layersRoot),c=P(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=P(()=>ta.layersWithOutsidePointerEventsDisabled.size>0),u=P(()=>{let e=Array.from(s.value),[t]=[...ta.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=$i(async e=>{let t=[...ta.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await B(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=ea(e=>{let t=[...ta.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ni(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),M([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;mi(t,e),ta.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{ta.layersWithOutsidePointerEventsDisabled.delete(e),hi(t,e)})}},{immediate:!0}),M([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),N(e=>{e(()=>{a.value&&(s.value.delete(a.value),ta.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(L(),U(R(yn),{ref:R(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:kt({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:R(f).onFocusCapture,onBlurCapture:R(f).onBlurCapture,onPointerdownCapture:R(d).onPointerDownCapture},{default:w(()=>[j(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),ra=jr(()=>W([]));function ia(){let e=ra();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=aa(e.value,t),e.value.unshift(t)},remove(t){e.value=aa(e.value,t),e.value[0]?.resume()}}}function aa(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var oa=`focusScope.autoFocusOnMount`,sa=`focusScope.autoFocusOnUnmount`,ca={bubbles:!1,cancelable:!0};function la(e,t){let n=t;for(;n;){if(e.contains(n))return!0;n=n.getRootNode().host??null}return!1}function ua(e,{select:t=!1}={}){let n=G();for(let r of e)if(Y(r,{select:t}),G()!==n)return!0}function da(e){let t=fa(e);return[pa(t,e),pa(t.reverse(),e)]}function fa(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.
Line truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,D as t,Jt as n,O as r,_ as i,b as a,ht as o,kn as s,lt as c,nr as l,s as u,t as d,v as f,x as p,xt as m,yn as h}from"./PageHeader.js";import{X as g,r as _}from"./badge.js";import{l as v,n as y,t as b,v as x}from"./HistoryLink.js";import{y as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`mb-3 flex items-center justify-between`},E=[`for`],D=`eda-playbooks`,O=e({__name:`PlaybooksPage`,setup(e){let O=v();c(O.load);let k=i(()=>O.drafts[D]?.value),A=h(``);function j(){let e=A.value.trim();if(!e||k.value?.playbooks.some(t=>t.id===e))return;let t=O.drafts[D];t&&(t.value||={playbooks:[]},t.value.playbooks.push({id:e,yaml:``}),A.value=``)}return(e,i)=>(o(),p(`div`,null,[r(d,{title:`Playbooks`},{default:n(()=>[r(b,{kinds:[D]},null,8,[`kinds`])]),_:1}),r(y,{kind:D,class:`mb-4`}),s(O).catalogError||s(O).pageErrorFor(D)?(o(),p(`p`,C,l(s(O).catalogError||s(O).pageErrorFor(D)),1)):a(``,!0),f(`form`,{class:`mb-4 flex gap-2`,onSubmit:g(j,[`prevent`])},[r(s(x),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`},null,8,[`modelValue`]),r(s(_),{type:`submit`,disabled:!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:n(()=>[...i[1]||=[t(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?a(``,!0):(o(),p(`p`,w,`No playbooks installed.`)),(o(!0),p(u,null,m(k.value?.playbooks,(e,a)=>(o(),p(`section`,{key:a,class:`mb-6 border-t pt-4`},[f(`div`,T,[f(`label`,{for:`playbook-${a}`,class:`font-mono text-sm`},l(e.id),9,E),r(s(_),{variant:`ghost`,size:`sm`,onClick:e=>k.value.playbooks.splice(a,1)},{default:n(()=>[...i[2]||=[t(`Remove playbook`,-1)]]),_:1},8,[`onClick`])]),r(s(S),{id:`playbook-${a}`,modelValue:e.yaml,"onUpdate:modelValue":t=>e.yaml=t,"aria-label":`${e.id} YAML`,class:`min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]))),128))]))}});export{O as default};
|
||||
import{l as e,n as t,t as n,v as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v,yn as y}from"./PageHeader.js";import{X as b,r as x}from"./badge.js";import{y as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`mb-3 flex items-center justify-between`},E=[`for`],D=`eda-playbooks`,O=i({__name:`PlaybooksPage`,setup(i){let O=e();f(O.load);let k=c(()=>O.drafts[D]?.value),A=y(``);function j(){let e=A.value.trim();if(!e||k.value?.playbooks.some(t=>t.id===e))return;let t=O.drafts[D];t&&(t.value||={playbooks:[]},t.value.playbooks.push({id:e,yaml:``}),A.value=``)}return(e,i)=>(u(),_(`div`,null,[s(h,{title:`Playbooks`},{default:o(()=>[s(n,{kinds:[D]},null,8,[`kinds`])]),_:1}),s(t,{kind:D,class:`mb-4`}),d(O).catalogError||d(O).pageErrorFor(D)?(u(),_(`p`,C,p(d(O).catalogError||d(O).pageErrorFor(D)),1)):l(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:b(j,[`prevent`])},[s(d(r),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`},null,8,[`modelValue`]),s(d(x),{type:`submit`,disabled:!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:o(()=>[...i[1]||=[a(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?l(``,!0):(u(),_(`p`,w,`No playbooks installed.`)),(u(!0),_(m,null,v(k.value?.playbooks,(e,t)=>(u(),_(`section`,{key:t,class:`mb-6 border-t pt-4`},[g(`div`,T,[g(`label`,{for:`playbook-${t}`,class:`font-mono text-sm`},p(e.id),9,E),s(d(x),{variant:`ghost`,size:`sm`,onClick:e=>k.value.playbooks.splice(t,1)},{default:o(()=>[...i[2]||=[a(`Remove playbook`,-1)]]),_:1},8,[`onClick`])]),s(d(S),{id:`playbook-${t}`,modelValue:e.yaml,"onUpdate:modelValue":t=>e.yaml=t,"aria-label":`${e.id} YAML`,class:`min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]))),128))]))}});export{O as default};
|
||||
Vendored
+1
-1
@@ -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-flow-edge.trace-ok path{stroke:var(--color-ok)}.workflow-flow-edge.trace-failed path{stroke:var(--color-danger)}.workflow-flow-edge.trace-interrupted path{stroke:var(--color-warn)}.workflow-flow-edge.trace-running path{stroke:var(--color-info);stroke-dasharray:6 4;animation:.8s linear infinite edge-trace}@keyframes edge-trace{to{stroke-dashoffset:-10px}}@media (prefers-reduced-motion:reduce){.workflow-flow-edge.trace-running path,.step-running{animation:none}}.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)))){*,: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-reLine 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-flow-edge.trace-ok path{stroke:var(--color-ok)}.workflow-flow-edge.trace-failed path{stroke:var(--color-danger)}.workflow-flow-edge.trace-interrupted path{stroke:var(--color-warn)}.workflow-flow-edge.trace-running path{stroke:var(--color-info);stroke-dasharray:6 4;animation:.8s linear infinite edge-trace}@keyframes edge-trace{to{stroke-dashoffset:-10px}}@media (prefers-reduced-motion:reduce){.workflow-flow-edge.trace-running path,.step-running{animation:none}}.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)))){*,: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-reLine truncated
|
||||
Vendored
+71
-73
@@ -1,70 +1,68 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage.js","assets/PageHeader.js","assets/badge.js","assets/HistoryLink.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/HarnessPage.js","assets/HarnessPage.css","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
|
||||
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as C,Jt as w,K as T,Kt as E,L as ee,Lt as D,M as O,Mn as te,Mt as ne,N as re,Nn as ie,Nt as ae,O as k,On as oe,Ot as se,P as ce,Pt as le,Q as ue,Qn as A,Qt as de,R as fe,Rt as pe,S as me,Sn as he,St as j,T as ge,Tn as _e,Tt as ve,U as ye,Ut as M,V as be,Vt as xe,W as Se,Wt as Ce,X as we,Xt as Te,Y as Ee,Yt as De,Z as Oe,Zt as ke,_ as N,_n as Ae,_t as je,a as Me,an as Ne,at as Pe,b as P,bn as Fe,bt as Ie,c as Le,cn as Re,ct as ze,d as Be,dn as Ve,dt as He,en as Ue,er as We,et as Ge,f as Ke,fn as qe,ft as Je,g as Ye,gn as Xe,gt as Ze,h as Qe,hn as $e,ht as F,i as et,in as tt,it as nt,j as rt,jt as it,k as at,kn as I,kt as ot,l as eee,ln as st,lt as L,m as ct,mn as lt,mt as ut,n as dt,nn as ft,nr as R,nt as pt,o as mt,on as ht,ot as gt,p as _t,pn as vt,pt as yt,q as bt,qt as xt,r as St,rn as Ct,rr as wt,rt as Tt,s as z,sn as Et,st as Dt,t as Ot,tn as kt,tr as At,tt as B,u as jt,un as Mt,ut as Nt,v as V,vn as Pt,vt as Ft,w as It,wn as Lt,wt as Rt,x as H,xn as zt,xt as U,y as W,yn as G,yt as Bt,z as Vt,zt as Ht}from"./PageHeader.js";import{A as Ut,B as Wt,D as Gt,E as K,F as Kt,G as qt,H as Jt,I as Yt,J as Xt,K as Zt,L as Qt,M as $t,N as en,O as tn,P as nn,R as rn,U as an,V as on,W as sn,X as cn,Y as ln,_ as un,b as q,d as dn,g as fn,i as pn,j as mn,k as hn,m as gn,n as _n,q as vn,r as J,t as yn,v as bn,w as xn,x as Sn,y as Cn,z as wn}from"./badge.js";import{C as Tn,S as En,T as Dn,_ as On,a as kn,b as An,c as jn,d as Mn,f as Nn,g as Pn,h as Fn,i as In,l as Ln,m as Rn,n as zn,o as Bn,p as Vn,r as Hn,s as Un,t as Wn,u as Gn,v as Y,w as Kn,x as qn,y as Jn}from"./HistoryLink.js";var Yn=Object.defineProperty,Xn=(e,t)=>{let n={};for(var r in e)Yn(n,r,{get:e[r],enumerable:!0});return t||Yn(n,Symbol.toStringTag,{value:`Module`}),n};(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)}})();var Zn=Xn({BaseTransition:()=>dt,BaseTransitionPropsValidators:()=>St,Comment:()=>et,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>Me,ErrorTypeStrings:()=>mt,Fragment:()=>z,KeepAlive:()=>Le,ReactiveEffect:()=>Ue,Static:()=>eee,Suspense:()=>jt,Teleport:()=>Be,Text:()=>Ke,TrackOpTypes:()=>kt,Transition:()=>Gt,TransitionGroup:()=>tn,TriggerOpTypes:()=>ft,VueElement:()=>hn,assertNumber:()=>_t,callWithAsyncErrorHandling:()=>ct,callWithErrorHandling:()=>Qe,camelize:()=>te,capitalize:()=>ie,cloneVNode:()=>Ye,compatUtils:()=>null,compile:()=>Qn,computed:()=>N,createApp:()=>Ut,createBlock:()=>W,createCommentVNode:()=>P,createElementBlock:()=>H,createElementVNode:()=>V,createHydrationRenderer:()=>me,createPropsRestProxy:()=>o,createRenderer:()=>It,createSSRApp:()=>mn,createSlots:()=>ge,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>k,customRef:()=>Ct,defineAsyncComponent:()=>at,defineComponent:()=>n,defineCustomElement:()=>$t,defineEmits:()=>rt,defineExpose:()=>O,defineModel:()=>re,defineOptions:()=>ce,defineProps:()=>h,defineSSRCustomElement:()=>en,defineSlots:()=>x,devtools:()=>ee,effect:()=>tt,effectScope:()=>Ne,getCurrentInstance:()=>fe,getCurrentScope:()=>ht,getCurrentWatcher:()=>Et,getTransitionRawChildren:()=>Vt,guardReactiveProps:()=>i,h:()=>be,handleError:()=>y,hasInjectionContext:()=>ye,hydrate:()=>nn,hydrateOnIdle:()=>Se,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>bt,initCustomFormatter:()=>C,initDirectivesForSSR:()=>Kt,inject:()=>Ee,isMemoSame:()=>we,isProxy:()=>Re,isReactive:()=>st,isReadonly:()=>Mt,isRef:()=>Ve,isRuntimeOnly:()=>Oe,isShallow:()=>qe,isVNode:()=>ue,markRaw:()=>vt,mergeDefaults:()=>e,mergeModels:()=>Ge,mergeProps:()=>B,nextTick:()=>pt,nodeOps:()=>Yt,normalizeClass:()=>A,normalizeProps:()=>We,normalizeStyle:()=>At,onActivated:()=>Tt,onBeforeMount:()=>nt,onBeforeUnmount:()=>Pe,onBeforeUpdate:()=>gt,onDeactivated:()=>Dt,onErrorCaptured:()=>ze,onMounted:()=>L,onRenderTracked:()=>Nt,onRenderTriggered:()=>He,onScopeDispose:()=>lt,onServerPrefetch:()=>Je,onUnmounted:()=>yt,onUpdated:()=>ut,onWatcherCleanup:()=>$e,openBlock:()=>F,patchProp:()=>Qt,popScopeId:()=>Ze,provide:()=>je,proxyRefs:()=>Xe,pushScopeId:()=>Ft,queuePostFlushCb:()=>Bt,reactive:()=>Ae,readonly:()=>Pt,ref:()=>G,registerRuntimeCompiler:()=>Ie,render:()=>rn,renderList:()=>U,renderSlot:()=>j,resolveComponent:()=>c,resolveDLine truncated
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage.js","assets/HistoryLink.js","assets/PageHeader.js","assets/badge.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/HarnessPage.js","assets/HarnessPage.css","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
|
||||
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as ee,a as D,at as te,b as ne,c as re,ct as ie,d as ae,et as oe,f as se,g as ce,h as le,i as ue,it as de,j as fe,k as pe,l as me,lt as he,m as ge,n as _e,nt as ve,o as ye,ot as be,p as xe,q as Se,r as Ce,rt as we,s as Te,st as Ee,t as De,tt as Oe,u as ke,ut as Ae,v as O,w as je,x as Me,y as Ne,z as Pe}from"./HistoryLink.js";import{$ as Fe,A as k,B as Ie,C as Le,Ct as Re,D as A,Dn as ze,En as Be,Ft as Ve,It as He,Jt as j,Mt as Ue,O as M,Pt as We,Qn as N,R as Ge,Rt as Ke,Sn as qe,St as P,Tn as Je,Tt as Ye,Ut as F,V as Xe,Wt as Ze,X as Qe,Xt as $e,Y as et,_ as I,_n as tt,_t as nt,an as rt,at as it,b as L,bn as at,d as ot,dn as st,er as ct,et as lt,ht as R,it as ut,kn as z,lt as B,mn as dt,nr as V,nt as ft,on as pt,pn as mt,pt as ht,rn as gt,s as H,t as _t,tr as vt,tt as U,v as W,vn as yt,wn as bt,x as G,xt as K,y as q,yn as J,zt as xt}from"./PageHeader.js";import{A as St,D as Ct,E as Y,J as wt,K as Tt,U as Et,X as Dt,Y as Ot,_ as kt,b as X,d as At,g as jt,i as Mt,m as Nt,n as Pt,q as Ft,r as Z,t as It,w as Lt,x as Rt,y as zt}from"./badge.js";(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)}})();var Bt=Ee({name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]}),Vt=Ee({name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]}),Ht=Ee({name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]}),Ut=Ee({name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]}),Wt=Ee({name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]}),Gt=Ee({name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]}),Kt=Ee({name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]}),qt=Ee({name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]}),Jt=Ee({name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]}),Yt=Ee({name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]}),Xt=Ee({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),Zt=Ee({name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}),Qt=Ee({name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}),$t=Ee({name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}),en=Ee({name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]}),tn=Ee({name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]}),nn=Ee({name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),rn=Ee({name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]}),an=Ee({name:Line truncated
|
||||
|
||||
`);d=n.pop()||``;for(let e of n){let t=e.split(`
|
||||
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Ci.value=n.session_id),n.type===`delta`&&(o+=n.text,Oi.value=Oi.value?{...Oi.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Oi.value=Oi.value?{...Oi.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Oi.value=Oi.value?{...Oi.value,ask:n.ask}: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`);wi.value=[...wi.value,{from:`assistant`,text:o,tool_calls:a}],Oi.value=null,Ei.value=`Ready`,await Ui()}catch(e){let t=e;t.name===`AbortError`&&!c?(Oi.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Ei.value=`Stopped`):(Oi.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?gi(r):void 0,isRetry:i},Ei.value=`Error — retry available`)}finally{clearTimeout(l),bi=null,Vi=null,Di.value=!1}}function na(){Ei.value=`Stopping…`,Ci.value&&q.chatCancel(Ci.value).catch(()=>{}),Hi()}function ra(){L(()=>{Ui().catch(e=>{Ei.value=e.message||`Chat unavailable`})}),yt(()=>{Hi()})}async function ia(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));await ta({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var aa=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],oa=n({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return K(`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)=>(F(),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":I(vi),onClick:i[0]||=e=>n(`toggle`)},[V(`span`,{"aria-hidden":`true`,class:A(r(!e.open))},[k(I(kr),{size:22})],2),V(`span`,{"aria-hidden":`true`,class:A(r(e.open))},[k(I(oi),{size:22})],2)],8,aa))}});function sa(e){return typeof e==`string`?`'${e}'`:new tee().serialize(e)}var ca=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,la=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[ca.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function ua(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&&la[n]?la[n]:n+128,s=a<128&&la[a]?la[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 tee=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?ua(e,t):n===`number`&&r===`number`?e-t:ua(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(ua),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.$ALine truncated
|
||||
`)].join(`
|
||||
`))}return()=>i.value||r.value||o.value?be(t.default({present:o.value})[0],{ref:e=>{let t=Ha(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}});function ls(){let e=G();return{primitiveElement:e,currentElement:N(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Ha(e))}}var[us,ds]=ha(`CollapsibleRoot`),fs=n({__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=ro(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=p(r);return ds({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),X(),(t,n)=>(F(),W(I(fn),{as:e.as,"as-child":r.asChild,"data-state":I(i)?`open`:`closed`,"data-disabled":I(a)?``:void 0},{default:w(()=>[j(t.$slots,`default`,{open:I(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),ps=n({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=us();i.contentId||=Qo(void 0,`reka-collapsible-content`);let a=G(),{forwardRef:o,currentElement:s}=X(),c=G(0),l=G(0),u=N(()=>i.open.value),d=G(u.value),f=G();M(()=>[u.value,a.value?.present],async()=>{await pt();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=N(()=>d.value&&i.open.value);return L(()=>{requestAnimationFrame(()=>{d.value=!1})}),Ua(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(t,r)=>(F(),W(I(cs),{ref_key:`presentRef`,ref:a,present:e.forceMount||I(i).open.value,"force-mount":!0},{default:w(({present:r})=>[k(I(fn),B(t.$attrs,{id:I(i).contentId,ref:I(o),"as-child":n.asChild,as:e.as,hidden:r?void 0:I(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:I(i).open.value?`open`:`closed`,"data-disabled":I(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:w(()=>[!I(i).unmountOnHide.value||r?j(t.$slots,`default`,{},void 0,void 0,0):P(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),ms=n({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;X();let n=us();return(r,i)=>(F(),W(I(fn),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":I(n).contentId,"aria-expanded":I(n).open.value,"data-state":I(n).open.value?`open`:`closed`,"data-disabled":I(n).disabled?.value?``:void 0,disabled:I(n).disabled?.value,onClick:I(n).onOpenToggle},{default:w(()=>[j(r.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function hs({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 gs({type:e,defaultValue:t,modelValue:n}){return e||hs({type:e,defaultValue:t,modelValue:n})}function _s({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function vs(e,t){let n=N(()=>gs(e)),r=ro(e,`modelValue`,t,{defaultValue:_s(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=da(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(ya(t,e)){let n=t.findIndex(t=>da(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:N(()=>n.value===`single`)}}var[ys,bs]=ha(`AccordionRoot`),xs=n({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:`vertical`},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{dir:i,disabled:a,unmountOnHide:o}=p(n),s=To(i),{modelValue:c,changeModelValue:l,isSingle:u}=vs(n,r),{forwardRef:d,currentElement:f}=X();return bs({disabled:a,direction:s,orientation:n.orientation,parentElement:f
Line truncated
|
||||
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(dr.value=n.session_id),n.type===`delta`&&(o+=n.text,gr.value=gr.value?{...gr.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],gr.value=gr.value?{...gr.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),gr.value=gr.value?{...gr.value,ask:n.ask}: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`);fr.value=[...fr.value,{from:`assistant`,text:o,tool_calls:a}],gr.value=null,mr.value=`Ready`,await jr()}catch(e){let t=e;t.name===`AbortError`&&!c?(gr.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},mr.value=`Stopped`):(gr.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?ir(r):void 0,isRetry:i},mr.value=`Error — retry available`)}finally{clearTimeout(l),cr=null,kr=null,hr.value=!1}}function Wr(){mr.value=`Stopping…`,dr.value&&X.chatCancel(dr.value).catch(()=>{}),Ar()}function Gr(){B(()=>{jr().catch(e=>{mr.value=e.message||`Chat unavailable`})}),ht(()=>{Ar()})}async function Kr(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));await Ur({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var qr=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Jr=k({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return Y(`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)=>(R(),G(`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":z(or),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:N(r(!e.open))},[M(z(_n),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:N(r(e.open))},[M(z(Jn),{size:22})],2)],8,qr))}});function Yr(e){return typeof e==`string`?`'${e}'`:new $r().serialize(e)}var Xr=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Zr=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Xr.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Qr(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&&Zr[n]?Zr[n]:n+128,s=a<128&&Zr[a]?Zr[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 $r=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Qr(e,t):n===`number`&&r===`number`?e-t:Qr(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(Qr),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.$ArrLine truncated
|
||||
- a positive number
|
||||
- less than the value passed to \`max\` (or ${Xf} if no \`max\` prop is set)
|
||||
- less than the value passed to \`max\` (or ${ks} if no \`max\` prop is set)
|
||||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||||
|
||||
Defaulting to \`null\`.`),null)}function tp(e){return $f(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 \`${Xf}\`.`),Xf)}var np=n({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:Xf},getValueLabel:{type:Function,required:!1,default:(e,t)=>$f(e)?`${Math.round(e/t*Xf)}%`: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;X();let i=ro(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=ro(n,`max`,r,{passive:n.max===void 0});M(()=>i.value,async e=>{let t=ep(e,n.max);t!==e&&(await pt(),i.value=t)},{immediate:!0}),M(()=>n.max,e=>{let t=tp(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=N(()=>va(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Qf({modelValue:i,max:a,progressState:o}),(t,n)=>(F(),W(I(fn),{"as-child":e.asChild,as:e.as,"aria-valuemax":I(a),"aria-valuemin":0,"aria-valuenow":$f(I(i))?I(i):void 0,"aria-valuetext":e.getValueText?.(I(i),I(a)),"aria-label":e.getValueLabel(I(i),I(a)),role:`progressbar`,"data-state":o.value,"data-value":I(i)??void 0,"data-max":I(a)},{default:w(()=>[j(t.$slots,`default`,{modelValue:I(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),rp=n({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Zf();return X(),(e,r)=>(F(),W(I(fn),B(t,{"data-state":I(n).progressState.value,"data-value":I(n).modelValue?.value??void 0,"data-max":I(n).max.value}),{default:w(()=>[j(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),ip=`radio.select`;function ap(e,t,n){_a(ip,n,{originalEvent:e,value:t})}var op=n({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=ro(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=p(n),{forwardRef:o,currentElement:s}=X(),c=Ao(s),l=No(),u=N(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||ap(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(t,n)=>(F(),H(z,null,[k(I(fn),B({id:e.id,ref:I(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":I(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":I(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:I(a),required:e.required,name:e.name},{...I(l),...t.$attrs},{onClick:cn(d,[`stop`])}),{default:w(()=>[j(t.$slots,`default`,{checked:I(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),I(c)&&e.name?(F(),W(I(Vc),B({key:0,type:`radio`,tabindex:`-1`,value:I(a),checked:!!I(i),name:e.name,disabled:e.disabled,required:e.required},I(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):P(`v-if`,!0)],64))}}),[sp,cp]=ha(`RadioGroupRoot`),lp=n({__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}=X(),o=ro(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=p(n),m=To(f),h=Ao(a);return cp({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(t,n)=>(F(),W(I(gd),{"as-child":``,orientation:I(l),dir:I(m),loop:I(c)},{default:w(()=>[k(I(fn),{ref:I(i),role:`radiogroup`,"data-disabled":I(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":I(l),"aria-required":I(d),dir:I(m)},{default:w(()=>[j(t.$slots,`default`,{modelValue:I(o)}),I(h)&&I(u)?(F(),W(I(Vc),{key:0,required:I(d),disabled:I(s),value:I(o),name:I(u)},null,8,[`required`,`disabled`,`value`,`name`])):P(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[fee,up]=ha(`RadioGroupItem`),dp=n({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nullLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Fg(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Fg(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=Lg(c),u=e+1<n.length?Lg(n[e+1]):null;if(l&&u&&Rg(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Lg(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Fg(e)),rows:r.map(e=>e.map(e=>Fg(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:Fg(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])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:Fg(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function Lg(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 Rg(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var zg={class:`[overflow-wrap:anywhere]`},Bg={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Vg={class:`font-mono text-[0.85em]`},Hg={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Ug={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Wg={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Gg={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Kg={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},qg={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Jg={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Yg={key:8,class:`mb-2.5 last:mb-0`},Xg=n({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=N(()=>Ig(t.text));return(e,t)=>(F(),H(`div`,zg,[(F(!0),H(z,null,U(n.value,(e,t)=>(F(),H(z,{key:t},[e.kind===`pre`?(F(),H(`pre`,Bg,[V(`code`,Vg,R(e.code),1)])):e.kind===`table`?(F(),H(`table`,Hg,[V(`thead`,null,[V(`tr`,null,[(F(!0),H(z,null,U(e.head,(e,t)=>(F(),H(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[k(Ng,{inline:e},null,8,[`inline`])]))),128))])]),V(`tbody`,null,[(F(!0),H(z,null,U(e.rows,(e,t)=>(F(),H(`tr`,{key:t},[(F(!0),H(z,null,U(e,(e,t)=>(F(),H(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[k(Ng,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(F(),H(`blockquote`,Ug,[k(Ng,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(F(),H(`h1`,Wg,[k(Ng,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(F(),H(`h2`,Gg,[k(Ng,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(F(),H(`h3`,Kg,[k(Ng,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(F(),H(`ul`,qg,[(F(!0),H(z,null,U(e.items,(e,t)=>(F(),H(`li`,{key:t},[k(Ng,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(F(),H(`ol`,Jg,[(F(!0),H(z,null,U(e.items,(e,t)=>(F(),H(`li`,{key:t},[k(Ng,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(F(),H(`p`,Yg,[k(Ng,{inline:e.inline},null,8,[`inline`])])):P(``,!0)],64))),128))]))}}),Zg={class:`truncate`},Qg=n({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=c(`RouterLink`);return F(),W(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:w(()=>[k(I(rr),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),V(`span`,Zg,R(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),$g={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},e_={class:`font-semibold text-foreground`},t_={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},n_=n({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=N(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=N(()=>t.tool.parameters||t.tool.Parameters||``),i=N(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=N(()=>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?(F(),W(Qg,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(F(),H(`div`,$g,[k(I(ai),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),V(`span`,e_,R(n.value),1),r.value?(F(),H(`code`,t_,R(r.value),1)):P(``,!0),V(`span`,{class:A(I(K)(`text-fg-muted`,i.value&&`text-danger`))},R(a.value),3)]))}}),r_={key:0,class:`mb-2 grid gap-0.5 text-xs`},i_={key:1,class:`mb-2 flex flex-wrap gap-1.5`},a_={key:3,class:`whitespace-pre-wrap`},o_=n({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(F(),H(`div`,{class:A([`flex`,e.assistant?`justify-start`:`justify-end`])},[V(`div`,{class:A(I(K)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(F(),H(`div`,r_,[(F(!0),H(z,null,U(e.tools,(t,n)=>(F(),W(n_,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):P(``,!0),e.media.length?(F(),H(`div`,i_,[(F(!0),H(z,null,U(e.media,(e,t)=>(F(),W(Eg,{key:t,attachment:e},null,8,[`attachment`]))),128))])):P(``,!0),e.assistant?(F(),W(Xg,{key:2,text:e.text},null,8,[`text`])):(F(),H(`div`,a_,R(e.text),1)),j(t.$slots,`default`)],2)],2))}}),s_={class:`text-sm`},c_={class:`font-medium`},l_={key:0,class:`mt-1 text-fg-muted`},u_={key:1,class:`mt-2 flex flex-wrap gap-2`},d_=n({__name:`ChatChoLine truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>_S?`${n.slice(0,_S).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var yS=[`title`],bS=n({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=N(()=>Kx(n.event)),a=N(()=>vS(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=N(()=>n.event.at?Jb(n.event.at):`—`);return(e,t)=>(F(),W(I(hS),{class:A(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:[ln(cn(o,[`prevent`]),[`enter`]),ln(cn(o,[`prevent`]),[`space`])]},{default:w(()=>[k(I(Q),{class:`font-medium`},{default:w(()=>[l(R(n.event.kind||n.event.type||`event`),1)]),_:1}),k(I(Q),{class:`font-mono`},{default:w(()=>[l(R(i.value>0?`#${i.value}`:`—`),1)]),_:1}),k(I(Q),{class:`w-[55%] max-w-0`},{default:w(()=>[V(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},R(a.value.text),9,yS)]),_:1}),k(I(Q),null,{default:w(()=>[l(R(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),xS=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function SS(e){return(Number(e?.task_id)||0)>0}function CS(e,t){return t===`tasks`?SS(e):t!==`system`||!SS(e)}function wS(e,t){return e.filter(e=>CS(e,t))}function TS(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function ES(e,t){return`${e}:${t??0}`}function DS(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=ES(vS(n).text,r),a=t[t.length-1];a&&a.key===i?(a.count+=1,a.events.push(n)):t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var OS={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},kS={class:`max-h-[28rem] overflow-y-auto`},AS=[`aria-expanded`,`aria-label`,`onClick`],jS=[`title`],MS=n({__name:`LiveActivityCard`,setup(e){let t=Z_(),{activity:n,streamKind:r,streamState:i}=Dn(On()),a=G(`all`),o=N(()=>wS(n.value,a.value)),s=N(()=>TS(o.value.length,a.value)),c=Ae(new Set),u=N(()=>DS(o.value));function d(e){c.has(e)?c.delete(e):c.add(e)}function f(e){return c.has(e.key)}function p(e){return vS(e.representative)}function m(e){return e.representative.at?Jb(e.representative.at):`—`}function h(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(F(),W(I(Vb),null,{default:w(()=>[k(I(Kb),null,{default:w(()=>[k(I(qb),null,{default:w(()=>[...t[1]||=[l(`Live activity`,-1)]]),_:1}),k(I(Hb),{class:`flex items-center gap-2`},{default:w(()=>[k(I(fS),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:I(xS)},null,8,[`modelValue`,`options`]),k(I(yn),{variant:I(r)},{default:w(()=>[l(R(I(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),k(I(Ub),null,{default:w(()=>[V(`div`,OS,[V(`div`,kS,[k(I(pS),null,{default:w(()=>[k(I(gS),{class:`sticky top-0 z-10 bg-card`},{default:w(()=>[k(I(hS),null,{default:w(()=>[k(I($),null,{default:w(()=>[...t[2]||=[l(`Event`,-1)]]),_:1}),k(I($),null,{default:w(()=>[...t[3]||=[l(`Task`,-1)]]),_:1}),k(I($),null,{default:w(()=>[...t[4]||=[l(`Detail`,-1)]]),_:1}),k(I($),null,{default:w(()=>[...t[5]||=[l(`When`,-1)]]),_:1})]),_:1})]),_:1}),k(I(mS),null,{default:w(()=>[o.value.length?P(``,!0):(F(),W(I(hS),{key:0},{default:w(()=>[k(I(Q),{colspan:`4`},{default:w(()=>[k(I(Mb),null,{default:w(()=>[k(I(Fb),null,{default:w(()=>[k(I(Rb),null,{default:w(()=>[l(R(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(F(!0),H(z,{key:1},U(u.value,e=>(F(),H(z,{key:e.key},[e.count===1?(F(),W(bS,{key:0,event:e.representative,onOpen:h},null,8,[`event`])):(F(),H(z,{key:1},[k(I(hS),{class:A(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&&h(e.taskID),onKeydown:[ln(cn(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`enter`]),ln(cn(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`space`])]},{default:w(()=>[k(I(Q),{class:`font-medium`},{default:w(()=>[V(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":f(e),"aria-label":`${f(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:cn(t=>d(e.key),[`stop`])},[f(e)?(F(),W(I(ur),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(F(),W(I(dr),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),l(` `+R(e.label)+` `,1),k(I(yn),{variant:`idle`},{default:w(()=>[l(`×`+R(e.count),1)]),_:2},1024)],8,AS)]),_:2},1024),k(I(Q),{class:`font-mono`},{default:w(()=>[l(R(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),k(I(Q),{class:`w-[55%] max-w-0`},{default:w(()=>[V(`span`,{class:`block truncate`,title:p(e).truncated?p(e).full:void 0},R(p(e).text),9,jS)]),_:2},1024),k(I(Q),null,{default:w(()=>[l(R(m(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),f(e)?(F(!0),H(z,{key:0},U(e.events,(t,n)=>(F(),W(bS,{key:`${e.key}:${n}`,event:t,onOpen:h},null,8,[
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 QC(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 $C(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 ew(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 tw(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 nw=G([]),rw=G([]),iw=G(!0),aw=G(null),ow=G(null),sw=G(!1),cw=G(null);async function lw(){try{let e=await q.eventTypes();iw.value=e.enabled!==!1,nw.value=e.event_types||[],rw.value=e.proposals||[],aw.value=null}catch(e){aw.value=e.message||String(e)}}function uw(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function dw(e){cw.value=null,ow.value=e}function fw(e){let t=bw.value.find(t=>String(t.id)===e.sample_id);dw({mode:`proposal`,id:null,source:e.source,name:``,rule:uw(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function pw(e=``){dw({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function mw(e){dw({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:uw(e.rule),headersText:``,body:``,exampleHeaders:{}})}function hw(){ow.value=null}async function gw(){let e=ow.value;if(e){sw.value=!0;try{if(e.mode===`edit`&&e.id)await q.eventTypeUpdate(e.id,{name:e.name,rule:tw(e.rule)});else{let t=e.mode===`paste`?ZC(e.headersText):e.exampleHeaders;await q.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:tw(e.rule),example:{headers:t,body:e.body}})}ow.value=null,await lw()}catch(e){cw.value=e.message||String(e)}finally{sw.value=!1}}}var _w=G(null);async function vw(){let e=_w.value;if(_w.value=null,e)try{await q.eventTypeDelete(e.id),await lw()}catch(e){aw.value=e.message||String(e)}}var yw=100,bw=G([]),xw=G(!0),Sw=G(null),Cw=G(!0),ww=G(null);async function Tw(){try{let e=await q.captures(yw);xw.value=e.enabled!==!1,bw.value=e.captures||[],Sw.value=null}catch(e){Sw.value=e.message||String(e)}finally{Cw.value=!1}}function Ew(e){let t=bw.value.find(t=>t.id===e);return t&&(ww.value=t),!!t}function Dw(){bw.value.length&&(ww.value=bw.value[0])}function Ow(){Pn(`captures`,()=>{Tw(),lw()})}var kw={key:0,class:`text-xs text-fg-muted`},Aw={key:1,class:`flex flex-col gap-1 text-xs`},jw={key:1},Mw={key:2,class:`text-xs text-fg-muted`},Nw=n({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=G([]),r=G(!1);M(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await q.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=c(`RouterLink`);return r.value?(F(),H(`p`,kw,`Dispatches unavailable.`)):n.value.length?(F(),H(`ul`,Aw,[(F(!0),H(z,null,U(n.value,e=>(F(),H(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?P(``,!0):(F(),W(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:w(()=>[l(`binding `+R(e.binding_id.slice(0,8))+` v`+R(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?P(``,!0):(F(),W(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:w(()=>[l(`capture `+R(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?P(``,!0):(F(),H(z,{key:2},[e.task_id?(F(),W(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:w(()=>[l(`task #`+R(e.task_id),1)]),_:2},1032,[`to`])):(F(),H(`span`,jw,R(e.reason||`claimed, no task recorded`),1))],64)),V(`span`,null,R(I(Jb)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?P(``,!0):(F(),H(`p`,Mw,` No dispatches yet. `))}}}),Pw=n({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(F(),W(I(Tr),{role:`status`,"aria-label":`Loading`,class:A(I(K)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function Fw(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function Iw(e){return(e?.repository??`required`)!==`none`}function Lw(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function Rw(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var zw={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},Bw={pending_approval:`warn`,armed:`ok`,paused:`idle`};function Vw(e){
Line truncated
|
||||
`)}};$H.defaultYaml={explicit:!1,version:`1.2`},$H.defaultTags={"!!":`tag:yaml.org,2002:`};function eU(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 tU(e){let t=new Set;return KH(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function nU(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function rU(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=tU(e);let a=nU(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(RH(t.node)||BH(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 iU(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=iU(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=iU(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=iU(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=iU(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function aU(e,t,n){if(Array.isArray(e))return e.map((e,t)=>aU(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!HH(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 oU=class{constructor(e){Object.defineProperty(this,NH,{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(!FH(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=aU(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?iU(i,{"":o},``,o):o}},sU=class extends oU{constructor(e){super(DH),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=[],KH(e,{Node:(e,t)=>{(PH(t)||HH(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||=(aU(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=cU(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(eU(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 cU(e,t,n){if(PH(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(BH(t)){let r=0;for(let i of t.items){let t=cU(e,i,n);t>r&&(r=t)}return r}if(LH(t)){let r=cU(e,t.key,n),i=cU(e,t.value,n);return Math.max(r,i)}return 1}var lU=e=>!e||typeof e!=`function`&&typeof e!=`object`,uU=class extends oU{constructor(e){super(jH),this.value=e}toJSON(e,t){return t?.keep?this.value:aU(this.value,e,t)}toString(){return String(this.value)}};uU.BLOCK_FOLDED=`BLOCK_FOLDED`,uU.BLOCK_LITERAL=`BLOCK_LITERAL`,uU.PLAIN=`PLAIN`,uU.QUOTE_DOUBLE=`QUOTE_DOUBLE`,uU.QUOTE_SINGLE=`QUOTE_SINGLE`;var dU=`tag:yaml.org,2002:`;function fU(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 pU(e,t,n){if(FH(e)&&(e=e.contents),VH(e))return e;if(LH(e)){let t=n.schema[kH].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 sU(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=dU+t.slice(2));let l=fU(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new uU(e);return c&&(c.node=t),t
Line truncated
|
||||
`)?vU(n,t):n.includes(`
|
||||
Defaulting to \`null\`.`),null)}function Ps(e){return Ms(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 \`${ks}\`.`),ks)}var Fs=k({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:ks},getValueLabel:{type:Function,required:!1,default:(e,t)=>Ms(e)?`${Math.round(e/t*ks)}%`: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;v();let i=T(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=T(n,`max`,r,{passive:n.max===void 0});F(()=>i.value,async e=>{let t=Ns(e,n.max);t!==e&&(await ft(),i.value=t)},{immediate:!0}),F(()=>n.max,e=>{let t=Ps(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=I(()=>ii(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return js({modelValue:i,max:a,progressState:o}),(t,n)=>(R(),q(z(jt),{"as-child":e.asChild,as:e.as,"aria-valuemax":z(a),"aria-valuemin":0,"aria-valuenow":Ms(z(i))?z(i):void 0,"aria-valuetext":e.getValueText?.(z(i),z(a)),"aria-label":e.getValueLabel(z(i),z(a)),role:`progressbar`,"data-state":o.value,"data-value":z(i)??void 0,"data-max":z(a)},{default:j(()=>[P(t.$slots,`default`,{modelValue:z(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),Is=k({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=As();return v(),(e,r)=>(R(),q(z(jt),U(t,{"data-state":z(n).progressState.value,"data-value":z(n).modelValue?.value??void 0,"data-max":z(n).max.value}),{default:j(()=>[P(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),Ls=`radio.select`;function Rs(e,t,n){de(Ls,n,{originalEvent:e,value:t})}var zs=k({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=T(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=Be(n),{forwardRef:o,currentElement:s}=v(),c=pi(s),l=mi(),u=I(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||Rs(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(t,n)=>(R(),G(H,null,[M(z(jt),U({id:e.id,ref:z(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":z(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":z(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:z(a),required:e.required,name:e.name},{...z(l),...t.$attrs},{onClick:Dt(d,[`stop`])}),{default:j(()=>[P(t.$slots,`default`,{checked:z(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),z(c)&&e.name?(R(),q(z(Fa),U({key:0,type:`radio`,tabindex:`-1`,value:z(a),checked:!!z(i),name:e.name,disabled:e.disabled,required:e.required},z(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):L(`v-if`,!0)],64))}}),[Bs,Vs]=be(`RadioGroupRoot`),Hs=k({__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}=v(),o=T(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=Be(n),p=S(f),m=pi(a);return Vs({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(t,n)=>(R(),q(z(to),{"as-child":``,orientation:z(l),dir:z(p),loop:z(c)},{default:j(()=>[M(z(jt),{ref:z(i),role:`radiogroup`,"data-disabled":z(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":z(l),"aria-required":z(d),dir:z(p)},{default:j(()=>[P(t.$slots,`default`,{modelValue:z(o)}),z(m)&&z(u)?(R(),q(z(Fa),{key:0,required:z(d),disabled:z(s),value:z(o),name:z(u)},null,8,[`required`,`disabled`,`value`,`name`])):L(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Us,Ws]=be(`RadioGroupItem`),Gs=k({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,reqLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:pd(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>pd(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=hd(c),u=e+1<n.length?hd(n[e+1]):null;if(l&&u&&gd(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=hd(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>pd(e)),rows:r.map(e=>e.map(e=>pd(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:pd(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])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:pd(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function hd(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 gd(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var _d={class:`[overflow-wrap:anywhere]`},vd={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},yd={class:`font-mono text-[0.85em]`},bd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},xd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Sd={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Cd={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},wd={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Td={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Ed={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Dd={key:8,class:`mb-2.5 last:mb-0`},Od=k({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=I(()=>md(t.text));return(e,t)=>(R(),G(`div`,_d,[(R(!0),G(H,null,K(n.value,(e,t)=>(R(),G(H,{key:t},[e.kind===`pre`?(R(),G(`pre`,vd,[W(`code`,yd,V(e.code),1)])):e.kind===`table`?(R(),G(`table`,bd,[W(`thead`,null,[W(`tr`,null,[(R(!0),G(H,null,K(e.head,(e,t)=>(R(),G(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[M(dd,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(R(!0),G(H,null,K(e.rows,(e,t)=>(R(),G(`tr`,{key:t},[(R(!0),G(H,null,K(e,(e,t)=>(R(),G(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[M(dd,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(R(),G(`blockquote`,xd,[M(dd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(R(),G(`h1`,Sd,[M(dd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(R(),G(`h2`,Cd,[M(dd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(R(),G(`h3`,wd,[M(dd,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(R(),G(`ul`,Td,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(dd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(R(),G(`ol`,Ed,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(dd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(R(),G(`p`,Dd,[M(dd,{inline:e.inline},null,8,[`inline`])])):L(``,!0)],64))),128))]))}}),kd={class:`truncate`},Ad=k({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Re(`RouterLink`);return R(),q(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:j(()=>[M(z(Wt),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,kd,V(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),jd={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Md={class:`font-semibold text-foreground`},Nd={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Pd=k({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=I(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=I(()=>t.tool.parameters||t.tool.Parameters||``),i=I(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=I(()=>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?(R(),q(Ad,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(R(),G(`div`,jd,[M(z(qn),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Md,V(n.value),1),r.value?(R(),G(`code`,Nd,V(r.value),1)):L(``,!0),W(`span`,{class:N(z(Y)(`text-fg-muted`,i.value&&`text-danger`))},V(a.value),3)]))}}),Fd={key:0,class:`mb-2 grid gap-0.5 text-xs`},Id={key:1,class:`mb-2 flex flex-wrap gap-1.5`},Ld={key:3,class:`whitespace-pre-wrap`},Rd=k({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(R(),G(`div`,{class:N([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:N(z(Y)(`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?(R(),G(`div`,Fd,[(R(!0),G(H,null,K(e.tools,(t,n)=>(R(),q(Pd,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):L(``,!0),e.media.length?(R(),G(`div`,Id,[(R(!0),G(H,null,K(e.media,(e,t)=>(R(),q(id,{key:t,attachment:e},null,8,[`attachment`]))),128))])):L(``,!0),e.assistant?(R(),q(Od,{key:2,text:e.text},null,8,[`text`])):(R(),G(`div`,Ld,V(e.text),1)),P(t.$slots,`default`)],2)],2))}}),zd={class:`text-sm`},Bd={class:`font-medium`},Vd={key:0,class:`mt-1 text-fg-muted`},Hd={key:1,class:`mt-2 flex flex-wrap gap-2`},Ud=k({__name:`ChatChLine truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Qg?`${n.slice(0,Qg).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var e_=[`title`],t_=k({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>Tg(n.event)),a=I(()=>$g(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=I(()=>n.event.at?Dh(n.event.at):`—`);return(e,t)=>(R(),q(z(Yg),{class:N(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:[Ot(Dt(o,[`prevent`]),[`enter`]),Ot(Dt(o,[`prevent`]),[`space`])]},{default:j(()=>[M(z($),{class:`font-medium`},{default:j(()=>[A(V(n.event.kind||n.event.type||`event`),1)]),_:1}),M(z($),{class:`font-mono`},{default:j(()=>[A(V(i.value>0?`#${i.value}`:`—`),1)]),_:1}),M(z($),{class:`w-[55%] max-w-0`},{default:j(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},V(a.value.text),9,e_)]),_:1}),M(z($),null,{default:j(()=>[A(V(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),n_=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function r_(e){return(Number(e?.task_id)||0)>0}function i_(e,t){return t===`tasks`?r_(e):t!==`system`||!r_(e)}function a_(e,t){return e.filter(e=>i_(e,t))}function o_(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function s_(e,t){return`${e}:${t??0}`}function c_(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=s_($g(n).text,r),a=t[t.length-1];a&&a.key===i?(a.count+=1,a.events.push(n)):t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var l_={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},u_={class:`max-h-[28rem] overflow-y-auto`},d_=[`aria-expanded`,`aria-label`,`onClick`],f_=[`title`],p_=k({__name:`LiveActivityCard`,setup(e){let t=Af(),{activity:n,streamKind:r,streamState:i}=Ae(ee()),a=J(`all`),o=I(()=>a_(n.value,a.value)),s=I(()=>o_(o.value.length,a.value)),c=tt(new Set),l=I(()=>c_(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 $g(e.representative)}function p(e){return e.representative.at?Dh(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(R(),q(z(bh),null,{default:j(()=>[M(z(Th),null,{default:j(()=>[M(z(Eh),null,{default:j(()=>[...t[1]||=[A(`Live activity`,-1)]]),_:1}),M(z(xh),{class:`flex items-center gap-2`},{default:j(()=>[M(z(Gg),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:z(n_)},null,8,[`modelValue`,`options`]),M(z(It),{variant:z(r)},{default:j(()=>[A(V(z(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),M(z(Sh),null,{default:j(()=>[W(`div`,l_,[W(`div`,u_,[M(z(qg),null,{default:j(()=>[M(z(Zg),{class:`sticky top-0 z-10 bg-card`},{default:j(()=>[M(z(Yg),null,{default:j(()=>[M(z(Xg),null,{default:j(()=>[...t[2]||=[A(`Event`,-1)]]),_:1}),M(z(Xg),null,{default:j(()=>[...t[3]||=[A(`Task`,-1)]]),_:1}),M(z(Xg),null,{default:j(()=>[...t[4]||=[A(`Detail`,-1)]]),_:1}),M(z(Xg),null,{default:j(()=>[...t[5]||=[A(`When`,-1)]]),_:1})]),_:1})]),_:1}),M(z(Jg),null,{default:j(()=>[o.value.length?L(``,!0):(R(),q(z(Yg),{key:0},{default:j(()=>[M(z($),{colspan:`4`},{default:j(()=>[M(z(dh),null,{default:j(()=>[M(z(mh),null,{default:j(()=>[M(z(_h),null,{default:j(()=>[A(V(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(R(!0),G(H,{key:1},K(l.value,e=>(R(),G(H,{key:e.key},[e.count===1?(R(),q(t_,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(R(),G(H,{key:1},[M(z(Yg),{class:N(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:[Ot(Dt(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Ot(Dt(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:j(()=>[M(z($),{class:`font-medium`},{default:j(()=>[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:Dt(t=>u(e.key),[`stop`])},[d(e)?(R(),q(z(Zt),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(R(),q(z(Qt),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),A(` `+V(e.label)+` `,1),M(z(It),{variant:`idle`},{default:j(()=>[A(`×`+V(e.count),1)]),_:2},1024)],8,d_)]),_:2},1024),M(z($),{class:`font-mono`},{default:j(()=>[A(V(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),M(z($),{class:`w-[55%] max-w-0`},{default:j(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},V(f(e).text),9,f_)]),_:2},1024),M(z($),null,{default:j(()=>[A(V(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(R(!0),G(H,{key:0},K(e.events,(t,n)=>(R(),q(t_,{key:`${e.key}:${n}`,event:t,onOpen:m},null
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 Nv(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 Pv(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 Fv(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 Iv(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 Lv=J([]),Rv=J([]),zv=J(!0),Bv=J(null),Vv=J(null),Hv=J(!1),Uv=J(null);async function Wv(){try{let e=await X.eventTypes();zv.value=e.enabled!==!1,Lv.value=e.event_types||[],Rv.value=e.proposals||[],Bv.value=null}catch(e){Bv.value=e.message||String(e)}}function Gv(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Kv(e){Uv.value=null,Vv.value=e}function qv(e){let t=ty.value.find(t=>String(t.id)===e.sample_id);Kv({mode:`proposal`,id:null,source:e.source,name:``,rule:Gv(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function Jv(e=``){Kv({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function Yv(e){Kv({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:Gv(e.rule),headersText:``,body:``,exampleHeaders:{}})}function Xv(){Vv.value=null}async function Zv(){let e=Vv.value;if(e){Hv.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:Iv(e.rule)});else{let t=e.mode===`paste`?Mv(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:Iv(e.rule),example:{headers:t,body:e.body}})}Vv.value=null,await Wv()}catch(e){Uv.value=e.message||String(e)}finally{Hv.value=!1}}}var Qv=J(null);async function $v(){let e=Qv.value;if(Qv.value=null,e)try{await X.eventTypeDelete(e.id),await Wv()}catch(e){Bv.value=e.message||String(e)}}var ey=100,ty=J([]),ny=J(!0),ry=J(null),iy=J(!0),ay=J(null);async function oy(){try{let e=await X.captures(ey);ny.value=e.enabled!==!1,ty.value=e.captures||[],ry.value=null}catch(e){ry.value=e.message||String(e)}finally{iy.value=!1}}function sy(e){let t=ty.value.find(t=>t.id===e);return t&&(ay.value=t),!!t}function cy(){ty.value.length&&(ay.value=ty.value[0])}function ly(){ce(`captures`,()=>{oy(),Wv()})}var uy={key:0,class:`text-xs text-fg-muted`},dy={key:1,class:`flex flex-col gap-1 text-xs`},fy={key:1},py={key:2,class:`text-xs text-fg-muted`},my=k({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=J([]),r=J(!1);F(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await X.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=Re(`RouterLink`);return r.value?(R(),G(`p`,uy,`Dispatches unavailable.`)):n.value.length?(R(),G(`ul`,dy,[(R(!0),G(H,null,K(n.value,e=>(R(),G(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?L(``,!0):(R(),q(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:j(()=>[A(`binding `+V(e.binding_id.slice(0,8))+` v`+V(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?L(``,!0):(R(),q(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:j(()=>[A(`capture `+V(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?L(``,!0):(R(),G(H,{key:2},[e.task_id?(R(),q(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:j(()=>[A(`task #`+V(e.task_id),1)]),_:2},1032,[`to`])):(R(),G(`span`,fy,V(e.reason||`claimed, no task recorded`),1))],64)),W(`span`,null,V(z(Dh)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?L(``,!0):(R(),G(`p`,py,` No dispatches yet. `))}}}),hy=k({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(R(),q(z(pn),{role:`status`,"aria-label":`Loading`,class:N(z(Y)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function gy(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function _y(e){return(e?.repository??`required`)!==`none`}function vy(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function yy(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var by={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},xy={pending_approval:`warn`,armed:`ok`,paused:`idle`};function Sy(e)
Line truncated
|
||||
`)}};PL.defaultYaml={explicit:!1,version:`1.2`},PL.defaultTags={"!!":`tag:yaml.org,2002:`};function FL(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 IL(e){let t=new Set;return DL(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function LL(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function RL(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=IL(e);let a=LL(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(yL(t.node)||xL(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 zL(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=zL(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=zL(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=zL(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=zL(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function BL(e,t,n){if(Array.isArray(e))return e.map((e,t)=>BL(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!CL(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 VL=class{constructor(e){Object.defineProperty(this,mL,{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(!gL(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=BL(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?zL(i,{"":o},``,o):o}},HL=class extends VL{constructor(e){super(cL),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=[],DL(e,{Node:(e,t)=>{(hL(t)||CL(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||=(BL(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=UL(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(FL(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 UL(e,t,n){if(hL(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(xL(t)){let r=0;for(let i of t.items){let t=UL(e,i,n);t>r&&(r=t)}return r}if(vL(t)){let r=UL(e,t.key,n),i=UL(e,t.value,n);return Math.max(r,i)}return 1}var WL=e=>!e||typeof e!=`function`&&typeof e!=`object`,GL=class extends VL{constructor(e){super(fL),this.value=e}toJSON(e,t){return t?.keep?this.value:BL(this.value,e,t)}toString(){return String(this.value)}};GL.BLOCK_FOLDED=`BLOCK_FOLDED`,GL.BLOCK_LITERAL=`BLOCK_LITERAL`,GL.PLAIN=`PLAIN`,GL.QUOTE_DOUBLE=`QUOTE_DOUBLE`,GL.QUOTE_SINGLE=`QUOTE_SINGLE`;var KL=`tag:yaml.org,2002:`;function qL(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 JL(e,t,n){if(gL(e)&&(e=e.contents),SL(e))return e;if(vL(e)){let t=n.schema[uL].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 HL(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=KL+t.slice(2));let l=qL(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new GL(e);return c&&(c.node=t),t
Line truncated
|
||||
`)?$L(n,t):n.includes(`
|
||||
`)?`
|
||||
`+vU(n,t):(e.endsWith(` `)?``:` `)+n,bU=`flow`,xU=`block`,SU=`quoted`;function CU(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=wU(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=wU(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
||||
`+$L(n,t):(e.endsWith(` `)?``:` `)+n,tR=`flow`,nR=`block`,rR=`quoted`;function iR(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=aR(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=aR(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 wU(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 TU=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),EU=e=>/^(%|---|\.\.\.)/m.test(e);function DU(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 OU(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(EU(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
||||
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function aR(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 oR=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),sR=e=>/^(%|---|\.\.\.)/m.test(e);function cR(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 lR(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(sR(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:CU(o,a,SU,TU(t,!1))}function kU(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||||
`)||/[ \t]\n|\n[ \t]/.test(e))return OU(e,t);let n=t.indent||(EU(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:CU(r,n,bU,TU(t,!1))}function AU(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=OU;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?kU:i&&!t?OU:n?kU:OU}return r(e,t)}var jU;try{jU=RegExp(`(^|(?<!
|
||||
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:iR(o,a,rR,oR(t,!1))}function uR(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||||
`)||/[ \t]\n|\n[ \t]/.test(e))return lR(e,t);let n=t.indent||(sR(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:iR(r,n,tR,oR(t,!1))}function dR(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=lR;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?uR:i&&!t?lR:n?uR:lR}return r(e,t)}var fR;try{fR=RegExp(`(^|(?<!
|
||||
))
|
||||
+(?!
|
||||
|$)`,`g`)}catch{jU=/\n+(?!\n|$)/g}function MU({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 AU(n,r);let l=r.indent||(r.forceBlockIndent||EU(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===uU.BLOCK_FOLDED?!1:t===uU.BLOCK_LITERAL||!DU(n,c,l.length);if(!n)return u?`|
|
||||
|$)`,`g`)}catch{fR=/\n+(?!\n|$)/g}function pR({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 dR(n,r);let l=r.indent||(r.forceBlockIndent||sR(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===GL.BLOCK_FOLDED?!1:t===GL.BLOCK_LITERAL||!cR(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(jU,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
||||
`&&(p=p.slice(0,-1)),p.replace(fR,`$&${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=TU(r,!0);o!==`folded`&&t!==uU.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=CU(`${v}${e}${p}`,l,xU,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function NU(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 AU(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||||
`)?AU(a,t):MU(e,t,n,r);if(!s&&!u&&i!==uU.PLAIN&&a.includes(`
|
||||
`))return MU(e,t,n,r);if(EU(a)){if(c===``)return t.forceBlockIndent=!0,MU(e,t,n,r);if(s&&c===l)return AU(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 AU(a,t)}return s?d:CU(d,c,bU,TU(t,!1))}function PU(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!==uU.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=uU.QUOTE_DOUBLE);let c=e=>{switch(e){case uU.BLOCK_FOLDED:case uU.BLOCK_LITERAL:return i||a?AU(o.value,t):MU(o,t,n,r);case uU.QUOTE_DOUBLE:return OU(o.value,t);case uU.QUOTE_SINGLE:return kU(o.value,t);case uU.PLAIN:return NU(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 FU(e,t){let n=Object.assign({blockQuote:!0,commentString:_U,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 IU(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(RH(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 LU(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(RH(e)||BH(e))&&e.anchor;a&&eU(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 RU(e,t,n,r){if(LH(e))return e.toString(t,n,r);if(PH(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=VH(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=IU(t.doc.schema.tags,a);let o=LU(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):RH(a)?PU(a,t,n,r):a.toString(t,n,r);return o?RH(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function zU({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=VH(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(BH(e)||!VH(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||BH(e)||(RH(e)?e.type===uU.BLOCK_FOLDED||e.type===uU.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=RU(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+=yU(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=yU(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=yU(g,n.indent,l(f))));let _,v,y;VH(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&&RH(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&zH(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=RU(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||||
`:``,v){let e=l(v);S+=`\n${vU(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
||||
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=oR(r,!0);o!==`folded`&&t!==GL.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=iR(`${v}${e}${p}`,l,nR,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function mR(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 dR(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||||
`)?dR(a,t):pR(e,t,n,r);if(!s&&!u&&i!==GL.PLAIN&&a.includes(`
|
||||
`))return pR(e,t,n,r);if(sR(a)){if(c===``)return t.forceBlockIndent=!0,pR(e,t,n,r);if(s&&c===l)return dR(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 dR(a,t)}return s?d:iR(d,c,tR,oR(t,!1))}function hR(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!==GL.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=GL.QUOTE_DOUBLE);let c=e=>{switch(e){case GL.BLOCK_FOLDED:case GL.BLOCK_LITERAL:return i||a?dR(o.value,t):pR(o,t,n,r);case GL.QUOTE_DOUBLE:return lR(o.value,t);case GL.QUOTE_SINGLE:return uR(o.value,t);case GL.PLAIN:return mR(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 gR(e,t){let n=Object.assign({blockQuote:!0,commentString:QL,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 _R(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(yL(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 vR(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(yL(e)||xL(e))&&e.anchor;a&&FL(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 yR(e,t,n,r){if(vL(e))return e.toString(t,n,r);if(hL(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=SL(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=_R(t.doc.schema.tags,a);let o=vR(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):yL(a)?hR(a,t,n,r):a.toString(t,n,r);return o?yL(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function bR({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=SL(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(xL(e)||!SL(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||xL(e)||(yL(e)?e.type===GL.BLOCK_FOLDED||e.type===GL.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=yR(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+=eR(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=eR(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=eR(g,n.indent,l(f))));let _,v,y;SL(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&&yL(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&bL(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=yR(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||||
`:``,v){let e=l(v);S+=`\n${$L(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
||||
`&&y&&(S=`
|
||||
|
||||
`):S+=`\n${n.indent}`}else if(!p&&BH(t)){let e=x[0],r=x.indexOf(`
|
||||
`):S+=`\n${n.indent}`}else if(!p&&xL(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+=yU(g,n.indent,l(y)):h&&i&&i(),g}function BU(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var VU=`<<`,HU={identify:e=>e===VU||typeof e==`symbol`&&e.description===VU,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new uU(Symbol(VU)),{addToJSMap:WU}),stringify:()=>VU},UU=(e,t)=>(HU.identify(t)||RH(t)&&(!t.type||t.type===uU.PLAIN)&&HU.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===HU.tag&&e.default);function WU(e,t,n){let r=KU(e,n);if(zH(r))for(let n of r.items)GU(e,t,n);else if(Array.isArray(r))for(let n of r)GU(e,t,n);else GU(e,t,r)}function GU(e,t,n){let r=KU(e,n);if(!IH(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 KU(e,t){return e&&PH(t)?t.resolve(e.doc,e):t}function qU(e,t,{key:n,value:r}){if(VH(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(UU(e,n))WU(e,t,r);else{let i=aU(n,``,e);if(t instanceof Map)t.set(i,aU(r,i,e));else if(t instanceof Set)t.add(i);else{let a=JU(n,i,e),o=aU(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function JU(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(VH(e)&&n?.doc){let t=FU(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)+`..."`),BU(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 YU(e,t,n){return new XU(pU(e,void 0,n),pU(t,void 0,n))}var XU=class e{constructor(e,t=null){Object.defineProperty(this,NH,{value:AH}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return VH(n)&&(n=n.clone(t)),VH(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return qU(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?zU(this,e,t,n):JSON.stringify(this)}};function ZU(e,t,n){return(t.inFlow??e.flow?$U:QU)(e,t,n)}function QU({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(VH(i))!d&&i.spaceBefore&&f.push(``),eW(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(LH(i)){let e=VH(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),eW(n,f,e.commentBefore,d))}d=!1;let s=RU(i,u,()=>o=null,()=>d=!0);o&&(s+=yU(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
||||
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=eR(g,n.indent,l(y)):h&&i&&i(),g}function xR(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var SR=`<<`,CR={identify:e=>e===SR||typeof e==`symbol`&&e.description===SR,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new GL(Symbol(SR)),{addToJSMap:TR}),stringify:()=>SR},wR=(e,t)=>(CR.identify(t)||yL(t)&&(!t.type||t.type===GL.PLAIN)&&CR.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===CR.tag&&e.default);function TR(e,t,n){let r=DR(e,n);if(bL(r))for(let n of r.items)ER(e,t,n);else if(Array.isArray(r))for(let n of r)ER(e,t,n);else ER(e,t,r)}function ER(e,t,n){let r=DR(e,n);if(!_L(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 DR(e,t){return e&&hL(t)?t.resolve(e.doc,e):t}function OR(e,t,{key:n,value:r}){if(SL(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(wR(e,n))TR(e,t,r);else{let i=BL(n,``,e);if(t instanceof Map)t.set(i,BL(r,i,e));else if(t instanceof Set)t.add(i);else{let a=kR(n,i,e),o=BL(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function kR(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(SL(e)&&n?.doc){let t=gR(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)+`..."`),xR(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 AR(e,t,n){return new jR(JL(e,void 0,n),JL(t,void 0,n))}var jR=class e{constructor(e,t=null){Object.defineProperty(this,mL,{value:dL}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return SL(n)&&(n=n.clone(t)),SL(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return OR(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?bR(this,e,t,n):JSON.stringify(this)}};function MR(e,t,n){return(t.inFlow??e.flow?PR:NR)(e,t,n)}function NR({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(SL(i))!d&&i.spaceBefore&&f.push(``),FR(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(vL(i)){let e=SL(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),FR(n,f,e.commentBefore,d))}d=!1;let s=yR(i,u,()=>o=null,()=>d=!0);o&&(s+=eR(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+=`
|
||||
`+vU(l(e),c),s&&s()):d&&o&&o(),p}function $U({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(VH(i))i.spaceBefore&&d.push(``),eW(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(LH(i)){let e=VH(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),eW(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=VH(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=RU(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+=yU(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 eW({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=vU(t(r),e);n.push(i.trimStart())}}function tW(e,t){let n=RH(t)?t.value:t;for(let r of e)if(LH(r)&&(r.key===t||r.key===n||RH(r.key)&&r.key.value===n))return r}var nW=class extends gU{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(kH,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(YU(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=LH(e)?e:!e||typeof e!=`object`||!(`key`in e)?new XU(e,e?.value):new XU(e.key,e.value);let r=tW(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);RH(r.value)&&lU(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=tW(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=tW(this.items,e)?.value;return(!t&&RH(n)?n.value:n)??void 0}has(e){return!!tW(this.items,e)}set(e,t){this.add(new XU(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)qU(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!LH(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})),ZU(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},rW={collection:`map`,default:!0,nodeClass:nW,tag:`tag:yaml.org,2002:map`,resolve(e,t){return IH(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>nW.from(e,t,n)},iW=class extends gU{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(MH,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=aW(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=aW(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&RH(r)?r.value:r}has(e){let t=aW(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=aW(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];RH(r)&&lU(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(aU(e,String(r++),t));return n}toString(e,t,n){return e?ZU(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(pU(a,void 0,n))}}return i}};function aW(e){let t=RH(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var oW={collection:`seq`,default:!0,nodeClass:iW,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return zH(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>iW.from(e,t,n)},sW={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),PU(e,t,n,r)}},cW={identify:e=>e==null,createNode:()=>new uU(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new uU(null),stringify:({source:e},t)=>typeof e==`string`&&cW.test.test(e)?e:t.options.nullStr},lW={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new uU(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&lW.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function uW({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 dW={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:uW},fW={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 PU({comment:e,type:t,value:s},r,i,a)}};function EW(e,t){if(zH(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!LH(r)){if(IH(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new XU(new uU(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]=LH(r)?r:new XU(r)}}else t(`Expected a sequence for this tag`);return e}function DW(e,t,n){let{replacer:r}=n,i=new iW(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(YU(o,s,n))}return i}var OW={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:EW,createNode:DW},kW=class e extends iW{constructor(){super(),this.add=nW.prototype.add.bind(this),this.delete=nW.prototype.delete.bind(this),this.get=nW.prototype.get.bind(this),this.has=nW.prototype.has.bind(this),this.set=nW.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(LH(e)?(r=aU(e.key,``,t),i=aU(e.value,r,t)):r=aU(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=DW(e,t,n),i=new this;return i.items=r.items,i}};kW.tag=`tag:yaml.org,2002:omap`;var AW={collection:`seq`,identify:e=>e instanceof Map,nodeClass:kW,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=EW(e,t),r=[];for(let{key:e}of n.items)RH(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new kW,n)},createNode:(e,t,n)=>kW.from(e,t,n)};function jW({value:e,source:t},n){return t&&(e?MW:NW).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var MW={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 uU(!0),stringify:jW},NW={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 uU(!1),stringify:jW},PW={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:uW},FW={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():uW(e)}},IW={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 uU(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:uW},LW=e=>typeof e==`bigint`||Number.isInteger(e);function RW(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 zW(e,t,n){let{value:r}=e;if(LW(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return uW(e)}var BW={identify:LW,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>RW(e,2,2,n),stringify:e=>zW(e,2,`0b`)},VW={identify:LW,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>RW(e,1,8,n),stringify:e=>zW(e,8,`0`)},HW={identify:LW,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>RW(e,0,10,n),stringify:uW},UW={identify:LW,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>RW(e,2,16,n),stringify:e=>zW(e,16,`0x`)},WW=class e extends nW{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=LH(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new XU(e.key,null):new XU(e,null),tW(this.items,t.key)||this.items.push(t)}get(e,t){let n=tW(this.items,e);return!t&&LH(n)?RH(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=tW(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new XU(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(vU(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(vU(a(t),``)))}return n.join(`
|
||||
`+$L(l(e),c),s&&s()):d&&o&&o(),p}function PR({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(SL(i))i.spaceBefore&&d.push(``),FR(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(vL(i)){let e=SL(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),FR(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=SL(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=yR(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+=eR(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 FR({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=$L(t(r),e);n.push(i.trimStart())}}function IR(e,t){let n=yL(t)?t.value:t;for(let r of e)if(vL(r)&&(r.key===t||r.key===n||yL(r.key)&&r.key.value===n))return r}var LR=class extends ZL{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(uL,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(AR(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=vL(e)?e:!e||typeof e!=`object`||!(`key`in e)?new jR(e,e?.value):new jR(e.key,e.value);let r=IR(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);yL(r.value)&&WL(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=IR(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=IR(this.items,e)?.value;return(!t&&yL(n)?n.value:n)??void 0}has(e){return!!IR(this.items,e)}set(e,t){this.add(new jR(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)OR(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!vL(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})),MR(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},RR={collection:`map`,default:!0,nodeClass:LR,tag:`tag:yaml.org,2002:map`,resolve(e,t){return _L(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>LR.from(e,t,n)},zR=class extends ZL{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(pL,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=BR(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=BR(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&yL(r)?r.value:r}has(e){let t=BR(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=BR(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];yL(r)&&WL(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(BL(e,String(r++),t));return n}toString(e,t,n){return e?MR(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(JL(a,void 0,n))}}return i}};function BR(e){let t=yL(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var VR={collection:`seq`,default:!0,nodeClass:zR,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return bL(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>zR.from(e,t,n)},HR={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),hR(e,t,n,r)}},UR={identify:e=>e==null,createNode:()=>new GL(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new GL(null),stringify:({source:e},t)=>typeof e==`string`&&UR.test.test(e)?e:t.options.nullStr},WR={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new GL(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&WR.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function GR({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 KR={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:GR},qR={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 hR({comment:e,type:t,value:s},r,i,a)}};function sz(e,t){if(bL(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!vL(r)){if(_L(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new jR(new GL(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]=vL(r)?r:new jR(r)}}else t(`Expected a sequence for this tag`);return e}function cz(e,t,n){let{replacer:r}=n,i=new zR(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(AR(o,s,n))}return i}var lz={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:sz,createNode:cz},uz=class e extends zR{constructor(){super(),this.add=LR.prototype.add.bind(this),this.delete=LR.prototype.delete.bind(this),this.get=LR.prototype.get.bind(this),this.has=LR.prototype.has.bind(this),this.set=LR.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(vL(e)?(r=BL(e.key,``,t),i=BL(e.value,r,t)):r=BL(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=cz(e,t,n),i=new this;return i.items=r.items,i}};uz.tag=`tag:yaml.org,2002:omap`;var dz={collection:`seq`,identify:e=>e instanceof Map,nodeClass:uz,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=sz(e,t),r=[];for(let{key:e}of n.items)yL(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new uz,n)},createNode:(e,t,n)=>uz.from(e,t,n)};function fz({value:e,source:t},n){return t&&(e?pz:mz).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var pz={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 GL(!0),stringify:fz},mz={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 GL(!1),stringify:fz},hz={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:GR},gz={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():GR(e)}},_z={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 GL(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:GR},vz=e=>typeof e==`bigint`||Number.isInteger(e);function yz(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 bz(e,t,n){let{value:r}=e;if(vz(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return GR(e)}var xz={identify:vz,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>yz(e,2,2,n),stringify:e=>bz(e,2,`0b`)},Sz={identify:vz,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>yz(e,1,8,n),stringify:e=>bz(e,8,`0`)},Cz={identify:vz,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>yz(e,0,10,n),stringify:GR},wz={identify:vz,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>yz(e,2,16,n),stringify:e=>bz(e,16,`0x`)},Tz=class e extends LR{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=vL(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new jR(e.key,null):new jR(e,null),IR(this.items,t.key)||this.items.push(t)}get(e,t){let n=IR(this.items,e);return!t&&vL(n)?yL(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=IR(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new jR(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($L(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($L(a(t),``)))}return n.join(`
|
||||
`)+`
|
||||
`}var aG=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,NH,{value:OH});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 $H({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[NH]:{value:OH}});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=VH(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){oG(this.contents)&&this.contents.add(e)}addIn(e,t){oG(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=tU(this);e.anchor=!t||n.has(t)?nU(t||`a`,n):t}return new sU(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}=rU(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=pU(e,l,p);return o&&BH(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new XU(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return oG(this.contents)?this.contents.delete(e):!1}deleteIn(e){return hU(e)?this.contents!=null&&(this.contents=null,!0):oG(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return BH(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return hU(e)?!t&&RH(this.contents)?this.contents.value:this.contents:BH(this.contents)?this.contents.getIn(e,t):void 0}has(e){return BH(this.contents)?this.contents.has(e):!1}hasIn(e){return hU(e)?this.contents!==void 0:BH(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=mU(this.schema,[e],t):oG(this.contents)&&this.contents.set(e,t)}setIn(e,t){hU(e)?this.contents=t:this.contents==null?this.contents=mU(this.schema,Array.from(e),t):oG(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 $H({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 $H({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 rG(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=aU(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`?iU(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 iG(this,e)}};function oG(e){if(BH(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var sG=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},cG=class extends sG{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},lG=class extends sG{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},uG=(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 dG(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 fG(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(fG(t.key)||fG(t.value))return!0}return!1;default:return!0}}function pG(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&fG(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function mG(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||RH(e)&&RH(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var hG=`All mapping items must start at the same column`;function gG({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??nW)(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=dG(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`,hG)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||fG(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`,hG);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&pG(r.indent,u,i),n.atKey=!1,mG(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=dG(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&&pG(r.indent,f,i),s=c.range[2];let l=new XU(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 XU(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 _G({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??iW)(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=dG(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&&pG(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function vG(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 yG=`Block collections are not allowed within flow collections`,bG=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function xG({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?nW:iW))(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=dG(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&&fG(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];LH(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],bG(m)&&i(r.range,`BLOCK_IN_FLOW`,yG)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);bG(f)&&i(g.range,`BLOCK_IN_FLOW`,yG),n.atKey=!1;let _=dG(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?bG(m)&&i(v.range,`BLOCK_IN_FLOW`,yG):_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let y=new XU(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;mG(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new nW(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=vG(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 SG(e,t,n,r,i,a){let o=n.type===`block-map`?gG(e,t,n,r,a):n.type===`block-seq`?_G(e,t,n,r,a):xG(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function CG(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===nW.tagName&&s===`map`||o===iW.tagName&&s===`seq`)return SG(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),SG(e,t,n,i,o)}let l=SG(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=VH(u)?u:new uU(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function wG(e,t,n){let r=t.offset,i=TG(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?uU.BLOCK_FOLDED:uU.BLOCK_LITERAL,o=t.source?EG(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
||||
`}var Bz=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,mL,{value:lL});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 PL({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[mL]:{value:lL}});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=SL(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Vz(this.contents)&&this.contents.add(e)}addIn(e,t){Vz(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=IL(this);e.anchor=!t||n.has(t)?LL(t||`a`,n):t}return new HL(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}=RL(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=JL(e,l,p);return o&&xL(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new jR(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Vz(this.contents)?this.contents.delete(e):!1}deleteIn(e){return XL(e)?this.contents!=null&&(this.contents=null,!0):Vz(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return xL(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return XL(e)?!t&&yL(this.contents)?this.contents.value:this.contents:xL(this.contents)?this.contents.getIn(e,t):void 0}has(e){return xL(this.contents)?this.contents.has(e):!1}hasIn(e){return XL(e)?this.contents!==void 0:xL(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=YL(this.schema,[e],t):Vz(this.contents)&&this.contents.set(e,t)}setIn(e,t){XL(e)?this.contents=t:this.contents==null?this.contents=YL(this.schema,Array.from(e),t):Vz(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 PL({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 PL({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 Rz(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=BL(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`?zL(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 zz(this,e)}};function Vz(e){if(xL(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Hz=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Uz=class extends Hz{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Wz=class extends Hz{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Gz=(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 Kz(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 qz(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(qz(t.key)||qz(t.value))return!0}return!1;default:return!0}}function Jz(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&qz(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Yz(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||yL(e)&&yL(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Xz=`All mapping items must start at the same column`;function Zz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??LR)(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=Kz(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`,Xz)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||qz(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`,Xz);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Jz(r.indent,u,i),n.atKey=!1,Yz(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Kz(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&&Jz(r.indent,f,i),s=c.range[2];let l=new jR(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 jR(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 Qz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??zR)(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=Kz(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&&Jz(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function $z(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 eB=`Block collections are not allowed within flow collections`,tB=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function nB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?LR:zR))(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=Kz(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&&qz(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];vL(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],tB(m)&&i(r.range,`BLOCK_IN_FLOW`,eB)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);tB(f)&&i(g.range,`BLOCK_IN_FLOW`,eB),n.atKey=!1;let _=Kz(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?tB(m)&&i(v.range,`BLOCK_IN_FLOW`,eB):_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let y=new jR(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Yz(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new LR(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=$z(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 rB(e,t,n,r,i,a){let o=n.type===`block-map`?Zz(e,t,n,r,a):n.type===`block-seq`?Qz(e,t,n,r,a):nB(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function iB(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===LR.tagName&&s===`map`||o===zR.tagName&&s===`seq`)return rB(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),rB(e,t,n,i,o)}let l=rB(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=SL(u)?u:new GL(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function aB(e,t,n){let r=t.offset,i=oB(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?GL.BLOCK_FOLDED:GL.BLOCK_LITERAL,o=t.source?sB(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===uU.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
||||
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===GL.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
||||
`):t.length>c||r[0]===` `?(f===` `?f=`
|
||||
`:!p&&f===`
|
||||
`&&(f=`
|
||||
@@ -77,59 +75,59 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
||||
`+o[e][0].slice(c);d[d.length-1]!==`
|
||||
`&&(d+=`
|
||||
`);break;default:d+=`
|
||||
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function TG({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 EG(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 DG(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=uU.PLAIN,c=OG(a,l);break;case`single-quoted-scalar`:s=uU.QUOTE_SINGLE,c=kG(a,l);break;case`double-quoted-scalar`:s=uU.QUOTE_DOUBLE,c=jG(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=vG(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function OG(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}`),AG(e)}function kG(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),AG(e.slice(1,-1)).replace(/''/g,`'`)}function AG(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
||||
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function oB({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 sB(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 cB(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=GL.PLAIN,c=lB(a,l);break;case`single-quoted-scalar`:s=GL.QUOTE_SINGLE,c=uB(a,l);break;case`double-quoted-scalar`:s=GL.QUOTE_DOUBLE,c=fB(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=$z(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function lB(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}`),dB(e)}function uB(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),dB(e.slice(1,-1)).replace(/''/g,`'`)}function dB(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 jG(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
||||
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function fB(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}=MG(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=NG[i];if(a)n+=a;else if(i===`
|
||||
`){let{fold:t,offset:i}=pB(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=mB[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+=PG(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
||||
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=hB(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 MG(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
||||
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function pB(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 NG={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function PG(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 FG(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?wG(e,t,r):DG(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[jH]:c?IG(e.schema,i,c,n,r):t.type===`scalar`?LG(e,i,t,r):e.schema[jH];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=RH(a)?a:new uU(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new uU(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 IG(e,t,n,r,i){if(n===`!`)return e[jH];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[jH])}function LG({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[jH];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[jH];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 RG(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 zG={composeNode:BG,composeEmptyNode:VG};function BG(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=HG(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=FG(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=CG(zG,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??=VG(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&&(!RH(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 VG(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=FG(e,{type:`scalar`,offset:RG(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 HG({options:e},{offset:t,source:n,end:r},i){let a=new sU(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=vG(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function UG(e,t,{offset:n,start:r,value:i,end:a},o){let s=new aG(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=dG(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?BG(c,i,l,o):VG(c,l.end,r,null,l,o);let u=s.contents.range[2],d=vG(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function WG(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 GG(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
||||
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var mB={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function hB(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 gB(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?aB(e,t,r):cB(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[fL]:c?_B(e.schema,i,c,n,r):t.type===`scalar`?vB(e,i,t,r):e.schema[fL];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=yL(a)?a:new GL(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new GL(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 _B(e,t,n,r,i){if(n===`!`)return e[fL];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[fL])}function vB({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[fL];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[fL];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 yB(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 bB={composeNode:xB,composeEmptyNode:SB};function xB(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=CB(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=gB(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=iB(bB,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??=SB(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&&(!yL(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 SB(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=gB(e,{type:`scalar`,offset:yB(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 CB({options:e},{offset:t,source:n,end:r},i){let a=new HL(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=$z(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function wB(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Bz(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Kz(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?xB(c,i,l,o):SB(c,l.end,r,null,l,o);let u=s.contents.range[2],d=$z(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function TB(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 EB(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 KG=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=WG(e);r?this.warnings.push(new lG(i,t,n)):this.errors.push(new cG(i,t,n))},this.directives=new $H({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=GG(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(BH(i)&&!i.flow&&i.items.length>0){let e=i.items[0];LH(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:GG(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=WG(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=UG(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 cG(WG(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 cG(WG(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=vG(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 cG(WG(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 aG(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}}},qG=Symbol(`break visit`),JG=Symbol(`skip children`),YG=Symbol(`remove item`);function XG(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),ZG(Object.freeze([]),e,t)}XG.BREAK=qG,XG.SKIP=JG,XG.REMOVE=YG,XG.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},XG.parentCollection=(e,t)=>{let n=XG.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 ZG(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=ZG(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===qG)return qG;else r===YG&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function QG(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
||||
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var DB=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=TB(e);r?this.warnings.push(new Wz(i,t,n)):this.errors.push(new Uz(i,t,n))},this.directives=new PL({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=EB(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(xL(i)&&!i.flow&&i.items.length>0){let e=i.items[0];vL(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:EB(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=TB(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=wB(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 Uz(TB(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 Uz(TB(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=$z(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 Uz(TB(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 Bz(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}}},OB=Symbol(`break visit`),kB=Symbol(`skip children`),AB=Symbol(`remove item`);function jB(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),MB(Object.freeze([]),e,t)}jB.BREAK=OB,jB.SKIP=kB,jB.REMOVE=AB,jB.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},jB.parentCollection=(e,t)=>{let n=jB.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 MB(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=MB(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===OB)return OB;else r===AB&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function NB(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 $G(e){switch(e){case void 0:case` `:case`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var eK=new Set(`0123456789ABCDEFabcdef`),tK=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),nK=new Set(`,[]{}`),rK=new Set(` ,[]{}
|
||||
\r `),iK=e=>!e||rK.has(e),aK=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
||||
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function PB(e){switch(e){case void 0:case` `:case`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var FB=new Set(`0123456789ABCDEFabcdef`),IB=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),LB=new Set(`,[]{}`),RB=new Set(` ,[]{}
|
||||
\r `),zB=e=>!e||RB.has(e),BB=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===`...`)&&$G(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===`...`)&&$G(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&&!$G(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===`:`)&&$G(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(iK),`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(`...`))&&$G(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(iK),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||$G(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
||||
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&PB(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===`...`)&&PB(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&&!PB(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===`:`)&&PB(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(zB),`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(`...`))&&PB(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(zB),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||PB(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=>$G(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
||||
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>PB(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($G(r)||e&&nK.has(r))break;t=n}else if($G(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
||||
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(PB(r)||e&&LB.has(r))break;t=n}else if(PB(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
||||
`?(n+=1,r=`
|
||||
`,i=this.buffer[n+1]):t=n),i===`#`||e&&nK.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&nK.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(iK),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if($G(n)||t&&nK.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(;!$G(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(tK.has(t))t=this.buffer[++e];else if(t===`%`&&eK.has(this.buffer[e+1])&&eK.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
||||
`,i=this.buffer[n+1]):t=n),i===`#`||e&&LB.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&LB.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(zB),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(PB(n)||t&&LB.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(;!PB(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(IB.has(t))t=this.buffer[++e];else if(t===`%`&&FB.has(this.buffer[e+1])&&FB.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)}},oK=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 sK(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function cK(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 lK(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 uK(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 dK(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 fK(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 pK(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!sK(t.start,`explicit-key-ind`)&&!sK(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,lK(t.value)?t.value.end?fK(t.value.end,t.sep):t.value.end=t.sep:fK(t.start,t.sep),delete t.sep)}var hee=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 aK,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=QG(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})}else{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`&&pK(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&&cK(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.i
Line truncated
|
||||
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},VB=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 HB(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function UB(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 WB(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 GB(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 KB(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 qB(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 JB(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!HB(t.start,`explicit-key-ind`)&&!HB(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,WB(t.value)?t.value.end?qB(t.value.end,t.sep):t.value.end=t.sep:qB(t.start,t.sep),delete t.sep)}var YB=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 BB,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=NB(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})}else{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`&&JB(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&&UB(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.in
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)){fK(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(sK(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=dK(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(sK(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(lK(t.key)&&!sK(t.sep,`newline`)){let e=dK(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]}):sK(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&&!sK(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)){fK(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||sK(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite
Line truncated
|
||||
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){qB(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(HB(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=KB(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(HB(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(WB(t.key)&&!HB(t.sep,`newline`)){let e=KB(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]}):HB(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&&!HB(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)){qB(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||HB(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=dK(uK(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=dK(uK(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 mK(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new oK||null,prettyErrors:t}}function hK(e,t={}){let{lineCounter:n,prettyErrors:r}=mK(t),i=new hee(n?.addNewLine),a=new KG(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 cG(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(uG(e,n)),o.warnings.forEach(uG(e,n))),o}function gK(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=hK(e,n);if(!i)return null;if(i.warnings.forEach(e=>BU(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 _K(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 FH(e)&&!r?e.toString(n):new aG(e,r,n).toString(n)}var vK=e=>typeof e==`object`&&!!e&&!Array.isArray(e),yK=e=>vK(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function bK(e){if(vK(e)){if(vK(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:yK(e.parallel)};if(vK(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:yK(e.switch.cases)}}}function xK(e){return e.slice(2).includes(`parallel`)}function SK(e,t){let n=hK(e).getIn(t,!0);if(IH(n))return n.toJSON()}function CK(e,t,n){let r=hK(e);return r.setIn(t,r.createNode(PK(n))),r.toString()}function wK(e,t,n){let r=hK(e),i=t.slice(0,-1),a=xK(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(zH(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!zH(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function TK(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function EK(e,t){let n=e.getIn(t,!0),r=bK(IH(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!IH(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function DK(e,t,n){let r=hK(e),{kind:i,branches:a}=EK(r,t);if(TK(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function OK(e,t,n,r){let i=hK(e),{kind:a,branches:o}=EK(i,t);if(TK(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>RH(e.key)&&e.key.value===n);if(!s||!RH(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function kK(e,t,n){let r=hK(e),{kind:i,branches:a}=EK(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);retur
Line truncated
|
||||
`).find(e=>e.trim())?.trim()}}function JK(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(WK)].map(e=>e[1]))]}function YK(e){let t=hK(e).toJS(),n=GK(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=new Set,c=`start`;r.push({id:c,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let l=[c],u=1,d=new Map,f=e=>{let t=d.get(e)??0;return d.set(e,t+1),t},p=(e,t,n,i,s,c,l,u)=>{let d=GK(e)?e:{},p=bK(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=GK(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,title:g||UK(m),type:m,role:LK(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:KK(m,h),summary:qK(h),when:typeof d.when==`string`?d.when:void 0,retry:GK(d.retry)&&typeof d.retry.attempts==`number`?d.retry.attempts:void 0,continues:d.on_failure===`continue`,branch:s,lane:u,path:l,stage:v,occurrence:f(v),...c?{resume:c}:{}}}),g&&a.set(g,_);let y=p?.on?`{{ ${p.on} }}`:``;for(let e of JK([d.settings,y],d.when))o.push({from:e,to:_});return _},m=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,...s.has(r)?{otherwise:!0}:{},insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){let n=bK(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*BK,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=GK(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*VK,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*BK,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*BK},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*BK-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*VK;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*BK-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*BK,void 0,void 0,[`steps`,e]);m(l,i,[`steps`,e-1]),l=[i],u++}r.push({id:`add-end`,type:`add`,position:{x:104,y:u*BK-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``,insertAfter:[`steps`,n.length-1]}}),m(l,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var XK={agent:or,command:Jr,repo:Sr,gate:Wr,forge:Ar,human:ti,review:br,workflow:ii},ZK={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function QK(e){return e===`parallel`?Sr:e===`switch`?Kr:XK[e.split(`.`)[0]]??ii}function $K(e){return Object.keys(ZK).map(t=>({title:ZK[t],icon:XK[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function eq(e){return Object.entries(e?.inputs??{}).map(([e,t])=>({name:e,type:t.type,required:t.required===!0})).sort((e,t)=>e.name.localeCompare(t.name))}function tq(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function nq(e,t){switch(t){case`number`:{let t=e.trim();return t!==``&&!Number.isNaN(Number(t))?Number(t):e}case`bool`:return e===`true`||e!==`false`&&e;case`string`:return e;default:try{return JSON.parse(e)}catch{return e}}}function rq(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=nq(e,r.type))}return n}var iq=n({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(F(),W(I(Nm),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:w(()=>[k(I(Bm),{"aria-label":e.label},{default:w(()=>[k(I(Vm),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),k(I(Pm),null,{default:w(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(F(),W(I(Lm),{key:0,value:e.value,disabled:``},{default:w(()=>[l(R(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):P(``,!0),(F(!0),H(z,null,U(e.workflows,e=>(F(),W(I(Lm),{key:e.id,value:e.id},{default:w(()=>[l(R(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function aq(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function oq(e,t=[]){let n=hK(e),r=n.errors[0];if(r)return{ok:!1,message:bq(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!xq(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`stLine truncated
|
||||
`).map((e,t)=>({number:t+1,text:e,tokens:gq(e)}))}var mq=/^(\s*)(-\s+)?/,hq=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function gq(e){let{code:t,comment:n}=_q(e),r=vq(t);return n&&r.push({text:n,kind:`comment`}),r}function _q(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t)r===t&&(t=``);else if(r===`"`||r===`'`)t=r;else if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function vq(e){if(!e)return[];let t=[],n=mq.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=hq.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,...yq(i[4]??``)]):[...t,...yq(r)]}function yq(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 bq(e){return e.split(`
|
||||
`)[0]?.trim()||`invalid YAML`}function xq(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Sq(e){return typeof e==`string`&&e.trim()!==``}var Cq={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},wq={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},Tq={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},Eq={class:`min-w-0 flex-1`},Dq=[`value`,`placeholder`],Oq={class:`truncate font-mono text-[11px] text-fg-subtle`},kq={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},Aq={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},jq={key:1,class:`space-y-3`},Mq={key:0,class:`block space-y-1.5`},Nq={id:`switch-on`},Pq=[`value`],Fq={class:`text-xs font-medium text-muted-foreground`},Iq={class:`flex items-center gap-2`},Lq={key:1,role:`alert`,class:`text-xs text-danger`},Rq={key:2,class:`space-y-1.5`},zq=[`title`],Bq=[`value`],Vq=[`value`],Hq={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},Uq=[`onClick`],Wq=[`onClick`],Gq={key:3,class:`divide-y divide-border rounded-md border border-border`},Kq=[`title`],qq=[`value`,`onChange`],Jq=[`value`],Yq=[`value`,`onInput`],Xq=[`value`,`onFocus`,`onInput`],Zq={key:0,class:`space-y-3`},Qq={class:`text-[13px]`},$q={key:0,class:`text-danger`},eJ={class:`ml-2 text-xs text-fg-subtle`},tJ=[`aria-label`,`value`,`onChange`],nJ={key:0,value:`value`},rJ=[`aria-label`,`value`,`onChange`],iJ=[`value`],aJ=[`aria-label`,`value`,`onChange`],oJ={key:1,class:`space-y-3`},sJ={class:`text-[13px]`},cJ={class:`ml-2 text-xs text-fg-subtle`},lJ=[`aria-label`,`disabled`,`value`,`onChange`],uJ=[`value`],dJ=[`title`],fJ={key:0,class:`text-xs text-danger`},pJ={class:`space-y-2`},mJ={class:`divide-y divide-border rounded-md border border-border`},hJ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},gJ=[`value`],_J={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},vJ=[`value`],yJ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},bJ=[`value`],xJ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},SJ={class:`flex items-center border-t border-border px-4 py-2.5`},CJ=n({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=N(()=>SK(n.yaml,n.path)??{}),a=N(()=>bK(i.value)),o=N(()=>a.value?.kind??(typeof i.value.type==`string`?i.value.type:``)),s=N(()=>a.value?.branches.map(([e])=>e)??[]),c=N(()=>o.value===`parallel`?2:1);function u(e){r(`update:yaml`,CK(n.yaml,n.path,{...i.value,switch:{...i.value.switch,on:e}}))}let d=G(``),f=G(``);function p(e,t,i=``){try{let a=e===`add`?DK(n.yaml,n.path,t):e===`rename`?OK(n.yaml,n.path,t,i):kK(n.yaml,n.path,t);r(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=N(()=>n.vocabulary.find(e=>e.name===o.value)),h=N(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),g=N(()=>NK(n.yaml,n.path)),_=N(()=>m.value?.settings&&i.value.settings?dq(i.value.settings,m.value.settings,`settings`):``),v=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],y=/mission|body|detail|plan|rules/;function b(e,t){return[`workflow.call`,`workflow.handoff`].includes(o.value)&&e===`workflow`||o.value===`human.approve`&&e===`then`?`workflow`:t.type===`string`?t.enum?`select`:y.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 x=N(()=>{let e=Object.entries(m.value?.settings?.properties??{}).filter(([e])=>o.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:b(e,t)})),t=e.filter(e=>v.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>v.indexOf(e.key)-v.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function S(e){let{id:t,type:i,...a}=e;r(`update:yaml`,CK(n.yaml,n.path,{id:t,type:i,...a}))}function C(e,t){S({...i.value,[e]:t})}function T(e){C(`retry`,{...i.value.retry,...e})}function E(e,t){let n={...h.value,[e]:t};o.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,S({...i.value,settings:n})}function ee(e,t){let n={...h.value,[e]:t};o.value===`workflow.call`&&t!==h.value[e]&&(delete n.inputs,delete n.outputs),S({...i.value,settings:n})}let D=N(()=>n.workflows.find(e=>e.id===h.value.workflow)),O=N(()=>Object.entries(FK(D.value?.yaml??``,`inputs`)??{})),te=N(()=>Object.entries(FK(D.value?.yaml??``,`outputs`)??{})),ne=N(()=>Object.entries(FK(n.yaml,`inputs`)??{})),re=N(()=>Object.entries(FK(n.yaml,`outputs`)??{})),ie=N(()=>h.value.inputs??{}),ae=N(()=>h.value.outputs??{}),oe=e=>typeof e==`string`&&e.startsWith(`inputs.`),se=e=>ie.value[e]===void 0?``:String(ie.value[e]);function ce(e,t,n){E(`inputs`,{...ie.value,[e]:t===``?void 0:oe(t)?t:nq(t,n??`striLine truncated
|
||||
`)[0]}}}let pe=e=>e===void 0?``:_K(e).trimEnd(),me=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),he=e=>typeof h.value[e]==`string`?h.value[e]:``;return(t,n)=>(F(),H(`aside`,Cq,[V(`header`,wq,[V(`span`,Tq,[(F(),W(ve(I(QK)(o.value)),{class:`size-4`}))]),V(`div`,Eq,[V(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:I(UK)(o.value),"aria-label":`Step id`,onInput:n[0]||=e=>C(`id`,e.target.value)},null,40,Dq),V(`div`,Oq,R(o.value),1)]),k(I(J),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:n[1]||=e=>r(`close`)},{default:w(()=>[k(I(oi))]),_:1})]),V(`div`,kq,[_.value?(F(),H(`p`,Aq,R(_.value),1)):P(``,!0),a.value?(F(),H(`section`,jq,[o.value===`switch`?(F(),H(`label`,Mq,[n[18]||=V(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),k(I(Y),{"model-value":a.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`switch-on`,onChange:n[2]||=e=>u(e.target.value.trim())},null,8,[`model-value`]),V(`datalist`,Nq,[(F(!0),H(z,null,U(g.value,e=>(F(),H(`option`,{key:e,value:`steps.${e}.result.`},null,8,Pq))),128))])])):P(``,!0),V(`div`,Fq,R(o.value===`switch`?`Cases`:`Branches`),1),(F(!0),H(z,null,U(s.value,e=>(F(),H(`div`,{key:e,class:`flex items-center gap-2`},[k(I(Y),{"model-value":e,class:A(o.value===`switch`&&`font-mono`),"aria-label":`${o.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>p(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),k(I(J),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:s.value.length<=c.value,onClick:t=>p(`delete`,e)},{default:w(()=>[k(I(Xr))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),V(`div`,Iq,[k(I(Y),{modelValue:d.value,"onUpdate:modelValue":n[3]||=e=>d.value=e,"aria-label":o.value===`switch`?`New case value`:`New branch name`,placeholder:o.value===`switch`?`Value, or default`:`Branch name`,onKeydown:n[4]||=ln(cn(e=>p(`add`,d.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),k(I(J),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":o.value===`switch`?`Add case`:`Add branch`,disabled:!d.value.trim(),onClick:n[5]||=e=>p(`add`,d.value.trim())},{default:w(()=>[k(I(Lr))]),_:1},8,[`aria-label`,`disabled`])]),f.value?(F(),H(`p`,Lq,R(f.value),1)):P(``,!0)])):P(``,!0),x.value.lead?(F(),H(`section`,Rq,[V(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:x.value.lead.schema.description},[l(R(me(x.value.lead.key,x.value.lead.schema))+` `,1),x.value.lead.schema.description?(F(),W(I(gr),{key:0,class:`size-3 text-fg-subtle`})):P(``,!0)],8,zq),x.value.lead.kind===`workflow`?(F(),W(iq,{key:0,value:he(x.value.lead.key),workflows:e.workflows,label:me(x.value.lead.key,x.value.lead.schema),onPick:n[6]||=e=>ee(x.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):x.value.lead.kind===`select`?(F(),H(`select`,{key:1,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:he(x.value.lead.key),onChange:n[7]||=e=>E(x.value.lead.key,e.target.value||void 0)},[n[19]||=V(`option`,{value:``},`Default`,-1),(F(!0),H(z,null,U(x.value.lead.schema.enum,e=>(F(),H(`option`,{key:e,value:e},R(e),9,Vq))),128))],40,Bq)):x.value.lead.kind===`text`?(F(),W(I(sh),{key:2,"model-value":he(x.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:n[8]||=e=>le.value=x.value.lead.key,"onUpdate:modelValue":n[9]||=e=>E(x.value.lead.key,String(e))},null,8,[`model-value`])):(F(),W(I(Y),{key:3,"model-value":he(x.value.lead.key),onFocus:n[10]||=e=>le.value=x.value.lead.key,"onUpdate:modelValue":n[11]||=e=>E(x.value.lead.key,String(e))},null,8,[`model-value`])),g.value.length&&x.value.lead.kind!==`select`?(F(),H(`div`,Hq,[n[20]||=V(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(F(!0),H(z,null,U(g.value,e=>(F(),H(z,{key:e},[V(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>ue(e,`summary`)},R(e),9,Uq),V(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>ue(e,`result`)},R(e)+`.result`,9,Wq)],64))),128))])):P(``,!0)])):P(``,!0),x.value.compact.length?(F(),H(`section`,Gq,[(F(!0),H(z,null,U(x.value.compact,t=>(F(),H(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[V(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[l(R(me(t.key,t.schema))+` `,1),t.schema.description?(F(),W(I(gr),{key:0,class:`size-3 text-fg-subtle`})):P(``,!0)],8,Kq),t.kind===`workflow`?(F(),W(iq,{key:0,class:`max-w-48`,value:he(t.key),workflows:e.workflows,label:me(t.key,t.schema),onPick:e=>ee(t.key,e)},null,8,[`value`,`workflows`,`label`,
Line truncated
|
||||
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>E(e.key,String(t).split(`
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(F(),H(z,{key:2},[k(I(sh),{"model-value":pe(h.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>fe(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),de.value[e.key]?(F(),H(`span`,fJ,R(de.value[e.key]),1)):P(``,!0)],64))]))),128)),V(`section`,pJ,[n[33]||=V(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),V(`div`,mJ,[V(`label`,hJ,[n[28]||=V(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),V(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:n[12]||=e=>C(`when`,e.target.value)},null,40,gJ)]),V(`label`,_J,[n[30]||=V(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),V(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:n[13]||=e=>C(`on_failure`,e.target.value||void 0)},[...n[29]||=[V(`option`,{value:``},`Park the task`,-1),V(`option`,{value:`continue`},`Continue`,-1)]],40,vJ)]),V(`label`,yJ,[n[31]||=V(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),V(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:n[14]||=e=>T({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,bJ)]),V(`label`,xJ,[n[32]||=V(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),k(I(Gy),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>T({backoff:e||void 0})},null,8,[`model-value`])])])])]),V(`footer`,SJ,[k(I(J),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:w(()=>[k(I(Xr)),n[34]||=l(`Delete step`,-1)]),_:1}),k(I(J),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:w(()=>[...n[35]||=[l(`Done`,-1)]]),_:1})])]))}}),wJ=`repository_path`;function TJ(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:wJ,path:n.trim(),type:`string`,required:!0}),r}function EJ(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function DJ(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=EJ(Rw(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function OJ(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:Rw(e.value,i.type??`string`)})}return n}function kJ(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function AJ(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...AJ(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...AJ(n,r)]}):[]}function jJ(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function MJ(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function NJ(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var PJ={class:`flex h-full flex-col`},FJ={class:`flex items-center gap-2 border-b border-border px-4 py-3`},IJ={class:`min-w-0 flex-1 truncate text-sm font-medium`},LJ={key:0,class:`flex flex-1 items-center justify-center`},RJ={class:`space-y-1.5`},zJ=[`disabled`],BJ=[`value`],VJ={key:1,class:`space-y-1.5`},HJ=[`value`],UJ=[`title`],WJ={class:`space-y-1.5`},GJ={id:`bind-paths`},KJ=[`value`],qJ={class:`divide-y divide-border rounded-md border border-border`},JJ={class:`flex items-center gap-1.5 text-xs`},YJ={class:`font-mono`},XJ={class:`text-fg-subtle`},ZJ={key:0,class:`text-danger`,title:`Required`},QJ=[`title`,`aria-label`,`onClick`],$J=[`onUpdate:modelValue`,`aria-label`],eY=[`onUpdate:modelValue`,`aria-label`],tY={key:2,class:`text-xs text-danger`},nY=[`title`],rY={key:0,class:`space-y-1 px-3 py-2`},iY={key:0,class:`text-xs text-danger`},aY={key:1,class:`truncate font-mono text-xs text-success`},oY={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},sY={class:`space-y-2`},cY={key:0,role:`alert`,class:`text-xs text-danger`},lY={key:1,clas
Line truncated
|
||||
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=KB(GB(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=KB(GB(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 XB(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new VB||null,prettyErrors:t}}function ZB(e,t={}){let{lineCounter:n,prettyErrors:r}=XB(t),i=new YB(n?.addNewLine),a=new DB(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 Uz(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Gz(e,n)),o.warnings.forEach(Gz(e,n))),o}function QB(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=ZB(e,n);if(!i)return null;if(i.warnings.forEach(e=>xR(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 $B(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 gL(e)&&!r?e.toString(n):new Bz(e,r,n).toString(n)}var eV=e=>typeof e==`object`&&!!e&&!Array.isArray(e),tV=e=>eV(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function nV(e){if(eV(e)){if(eV(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:tV(e.parallel)};if(eV(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:tV(e.switch.cases)}}}function rV(e){return e.slice(2).includes(`parallel`)}function iV(e,t){let n=ZB(e).getIn(t,!0);if(_L(n))return n.toJSON()}function aV(e,t,n){let r=ZB(e);return r.setIn(t,r.createNode(gV(n))),r.toString()}function oV(e,t,n){let r=ZB(e),i=t.slice(0,-1),a=rV(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(bL(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!bL(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function sV(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function cV(e,t){let n=e.getIn(t,!0),r=nV(_L(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!_L(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function lV(e,t,n){let r=ZB(e),{kind:i,branches:a}=cV(r,t);if(sV(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function uV(e,t,n,r){let i=ZB(e),{kind:a,branches:o}=cV(i,t);if(sV(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>yL(e.key)&&e.key.value===n);if(!s||!yL(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function dV(e,t,n){let r=ZB(e),{kind:i,branches:a}=cV(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);return
Line truncated
|
||||
`).find(e=>e.trim())?.trim()}}function AV(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(EV)].map(e=>e[1]))]}function jV(e){let t=ZB(e).toJS(),n=DV(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=new Set,c=`start`;r.push({id:c,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let l=[c],u=1,d=new Map,f=e=>{let t=d.get(e)??0;return d.set(e,t+1),t},p=(e,t,n,i,s,c,l,u)=>{let d=DV(e)?e:{},p=nV(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=DV(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,title:g||TV(m),type:m,role:yV(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:OV(m,h),summary:kV(h),when:typeof d.when==`string`?d.when:void 0,retry:DV(d.retry)&&typeof d.retry.attempts==`number`?d.retry.attempts:void 0,continues:d.on_failure===`continue`,branch:s,lane:u,path:l,stage:v,occurrence:f(v),...c?{resume:c}:{}}}),g&&a.set(g,_);let y=p?.on?`{{ ${p.on} }}`:``;for(let e of AV([d.settings,y],d.when))o.push({from:e,to:_});return _},m=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,...s.has(r)?{otherwise:!0}:{},insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){let n=nV(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*SV,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=DV(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*CV,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*SV,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*SV},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*SV-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*CV;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*SV-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*SV,void 0,void 0,[`steps`,e]);m(l,i,[`steps`,e-1]),l=[i],u++}r.push({id:`add-end`,type:`add`,position:{x:104,y:u*SV-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``,insertAfter:[`steps`,n.length-1]}}),m(l,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var MV={agent:qt,command:In,repo:un,gate:Mn,forge:vn,human:Un,review:cn,workflow:Kn},NV={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function PV(e){return e===`parallel`?un:e===`switch`?Pn:MV[e.split(`.`)[0]]??Kn}function FV(e){return Object.keys(NV).map(t=>({title:NV[t],icon:MV[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function IV(e){return Object.entries(e?.inputs??{}).map(([e,t])=>({name:e,type:t.type,required:t.required===!0})).sort((e,t)=>e.name.localeCompare(t.name))}function LV(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function RV(e,t){switch(t){case`number`:{let t=e.trim();return t!==``&&!Number.isNaN(Number(t))?Number(t):e}case`bool`:return e===`true`||e!==`false`&&e;case`string`:return e;default:try{return JSON.parse(e)}catch{return e}}}function zV(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=RV(e,r.type))}return n}var BV=k({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),q(z(ml),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:j(()=>[M(z(xl),{"aria-label":e.label},{default:j(()=>[M(z(Sl),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),M(z(hl),null,{default:j(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(R(),q(z(vl),{key:0,value:e.value,disabled:``},{default:j(()=>[A(V(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):L(``,!0),(R(!0),G(H,null,K(e.workflows,e=>(R(),q(z(vl),{key:e.id,value:e.id},{default:j(()=>[A(V(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function VV(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function HV(e,t=[]){let n=ZB(e),r=n.errors[0];if(r)return{ok:!1,message:nH(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!rH(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`stLine truncated
|
||||
`).map((e,t)=>({number:t+1,text:e,tokens:QV(e)}))}var XV=/^(\s*)(-\s+)?/,ZV=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function QV(e){let{code:t,comment:n}=$V(e),r=eH(t);return n&&r.push({text:n,kind:`comment`}),r}function $V(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t)r===t&&(t=``);else if(r===`"`||r===`'`)t=r;else if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function eH(e){if(!e)return[];let t=[],n=XV.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=ZV.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,...tH(i[4]??``)]):[...t,...tH(r)]}function tH(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 nH(e){return e.split(`
|
||||
`)[0]?.trim()||`invalid YAML`}function rH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function iH(e){return typeof e==`string`&&e.trim()!==``}var aH={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},oH={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},sH={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},cH={class:`min-w-0 flex-1`},lH=[`value`,`placeholder`],uH={class:`truncate font-mono text-[11px] text-fg-subtle`},dH={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},fH={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},pH={key:1,class:`space-y-3`},mH={key:0,class:`block space-y-1.5`},hH={id:`switch-on`},gH=[`value`],_H={class:`text-xs font-medium text-muted-foreground`},vH={class:`flex items-center gap-2`},yH={key:1,role:`alert`,class:`text-xs text-danger`},bH={key:2,class:`space-y-1.5`},xH=[`title`],SH=[`value`],CH=[`value`],wH={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},TH=[`onClick`],EH=[`onClick`],DH={key:3,class:`divide-y divide-border rounded-md border border-border`},OH=[`title`],kH=[`value`,`onChange`],AH=[`value`],jH=[`value`,`onInput`],MH=[`value`,`onFocus`,`onInput`],NH={key:0,class:`space-y-3`},PH={class:`text-[13px]`},FH={key:0,class:`text-danger`},IH={class:`ml-2 text-xs text-fg-subtle`},LH=[`aria-label`,`value`,`onChange`],RH={key:0,value:`value`},zH=[`aria-label`,`value`,`onChange`],BH=[`value`],VH=[`aria-label`,`value`,`onChange`],HH={key:1,class:`space-y-3`},UH={class:`text-[13px]`},WH={class:`ml-2 text-xs text-fg-subtle`},GH=[`aria-label`,`disabled`,`value`,`onChange`],KH=[`value`],qH=[`title`],JH={key:0,class:`text-xs text-danger`},YH={class:`space-y-2`},XH={class:`divide-y divide-border rounded-md border border-border`},ZH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},QH=[`value`],$H={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},eU=[`value`],tU={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},nU=[`value`],rU={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},iU={class:`flex items-center border-t border-border px-4 py-2.5`},aU=k({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>iV(n.yaml,n.path)??{}),a=I(()=>nV(i.value)),o=I(()=>a.value?.kind??(typeof i.value.type==`string`?i.value.type:``)),s=I(()=>a.value?.branches.map(([e])=>e)??[]),c=I(()=>o.value===`parallel`?2:1);function l(e){r(`update:yaml`,aV(n.yaml,n.path,{...i.value,switch:{...i.value.switch,on:e}}))}let u=J(``),d=J(``);function f(e,t,i=``){try{let a=e===`add`?lV(n.yaml,n.path,t):e===`rename`?uV(n.yaml,n.path,t,i):dV(n.yaml,n.path,t);r(`update:yaml`,a),u.value=``,d.value=``}catch(e){d.value=String(e.message)}}let p=I(()=>n.vocabulary.find(e=>e.name===o.value)),m=I(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),h=I(()=>hV(n.yaml,n.path)),g=I(()=>p.value?.settings&&i.value.settings?qV(i.value.settings,p.value.settings,`settings`):``),_=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],v=/mission|body|detail|plan|rules/;function y(e,t){return[`workflow.call`,`workflow.handoff`].includes(o.value)&&e===`workflow`||o.value===`human.approve`&&e===`then`?`workflow`:t.type===`string`?t.enum?`select`:v.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 b=I(()=>{let e=Object.entries(p.value?.settings?.properties??{}).filter(([e])=>o.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:y(e,t)})),t=e.filter(e=>_.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>_.indexOf(e.key)-_.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function x(e){let{id:t,type:i,...a}=e;r(`update:yaml`,aV(n.yaml,n.path,{id:t,type:i,...a}))}function S(e,t){x({...i.value,[e]:t})}function C(e){S(`retry`,{...i.value.retry,...e})}function w(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,x({...i.value,settings:n})}function T(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&t!==m.value[e]&&(delete n.inputs,delete n.outputs),x({...i.value,settings:n})}let E=I(()=>n.workflows.find(e=>e.id===m.value.workflow)),ee=I(()=>Object.entries(_V(E.value?.yaml??``,`inputs`)??{})),D=I(()=>Object.entries(_V(E.value?.yaml??``,`outputs`)??{})),te=I(()=>Object.entries(_V(n.yaml,`inputs`)??{})),ne=I(()=>Object.entries(_V(n.yaml,`outputs`)??{})),re=I(()=>m.value.inputs??{}),ie=I(()=>m.value.outputs??{}),ae=e=>typeof e==`string`&&e.startsWith(`inputs.`),oe=e=>re.value[e]===void 0?``:String(re.value[e]);function se(e,t,n){w(`inputs`,{...re.value,[e]:t===``?void 0:ae(t)?t:RV(t,n??`strinLine truncated
|
||||
`)[0]}}}let fe=e=>e===void 0?``:$B(e).trimEnd(),pe=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),me=e=>typeof m.value[e]==`string`?m.value[e]:``;return(t,n)=>(R(),G(`aside`,aH,[W(`header`,oH,[W(`span`,sH,[(R(),q(Ye(z(PV)(o.value)),{class:`size-4`}))]),W(`div`,cH,[W(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:z(TV)(o.value),"aria-label":`Step id`,onInput:n[0]||=e=>S(`id`,e.target.value)},null,40,lH),W(`div`,uH,V(o.value),1)]),M(z(Z),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:n[1]||=e=>r(`close`)},{default:j(()=>[M(z(Jn))]),_:1})]),W(`div`,dH,[g.value?(R(),G(`p`,fH,V(g.value),1)):L(``,!0),a.value?(R(),G(`section`,pH,[o.value===`switch`?(R(),G(`label`,mH,[n[18]||=W(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),M(z(O),{"model-value":a.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`switch-on`,onChange:n[2]||=e=>l(e.target.value.trim())},null,8,[`model-value`]),W(`datalist`,hH,[(R(!0),G(H,null,K(h.value,e=>(R(),G(`option`,{key:e,value:`steps.${e}.result.`},null,8,gH))),128))])])):L(``,!0),W(`div`,_H,V(o.value===`switch`?`Cases`:`Branches`),1),(R(!0),G(H,null,K(s.value,e=>(R(),G(`div`,{key:e,class:`flex items-center gap-2`},[M(z(O),{"model-value":e,class:N(o.value===`switch`&&`font-mono`),"aria-label":`${o.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>f(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),M(z(Z),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:s.value.length<=c.value,onClick:t=>f(`delete`,e)},{default:j(()=>[M(z(Rn))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),W(`div`,vH,[M(z(O),{modelValue:u.value,"onUpdate:modelValue":n[3]||=e=>u.value=e,"aria-label":o.value===`switch`?`New case value`:`New branch name`,placeholder:o.value===`switch`?`Value, or default`:`Branch name`,onKeydown:n[4]||=Ot(Dt(e=>f(`add`,u.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),M(z(Z),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":o.value===`switch`?`Add case`:`Add branch`,disabled:!u.value.trim(),onClick:n[5]||=e=>f(`add`,u.value.trim())},{default:j(()=>[M(z(Tn))]),_:1},8,[`aria-label`,`disabled`])]),d.value?(R(),G(`p`,yH,V(d.value),1)):L(``,!0)])):L(``,!0),b.value.lead?(R(),G(`section`,bH,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:b.value.lead.schema.description},[A(V(pe(b.value.lead.key,b.value.lead.schema))+` `,1),b.value.lead.schema.description?(R(),q(z(rn),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,xH),b.value.lead.kind===`workflow`?(R(),q(BV,{key:0,value:me(b.value.lead.key),workflows:e.workflows,label:pe(b.value.lead.key,b.value.lead.schema),onPick:n[6]||=e=>T(b.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):b.value.lead.kind===`select`?(R(),G(`select`,{key:1,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:me(b.value.lead.key),onChange:n[7]||=e=>w(b.value.lead.key,e.target.value||void 0)},[n[19]||=W(`option`,{value:``},`Default`,-1),(R(!0),G(H,null,K(b.value.lead.schema.enum,e=>(R(),G(`option`,{key:e,value:e},V(e),9,CH))),128))],40,SH)):b.value.lead.kind===`text`?(R(),q(z(zl),{key:2,"model-value":me(b.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:n[8]||=e=>ce.value=b.value.lead.key,"onUpdate:modelValue":n[9]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])):(R(),q(z(O),{key:3,"model-value":me(b.value.lead.key),onFocus:n[10]||=e=>ce.value=b.value.lead.key,"onUpdate:modelValue":n[11]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])),h.value.length&&b.value.lead.kind!==`select`?(R(),G(`div`,wH,[n[20]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(R(!0),G(H,null,K(h.value,e=>(R(),G(H,{key:e},[W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>le(e,`summary`)},V(e),9,TH),W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>le(e,`result`)},V(e)+`.result`,9,EH)],64))),128))])):L(``,!0)])):L(``,!0),b.value.compact.length?(R(),G(`section`,DH,[(R(!0),G(H,null,K(b.value.compact,t=>(R(),G(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[A(V(pe(t.key,t.schema))+` `,1),t.schema.description?(R(),q(z(rn),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,OH),t.kind===`workflow`?(R(),q(BV,{key:0,class:`max-w-48`,value:me(t.key),workflows:e.workflows,label:pe(t.key,t.schema),onPick:e=>T(t.key,e)},null,8,[`value`,`workflows`,`label`,`oLine truncated
|
||||
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>w(e.key,String(t).split(`
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(R(),G(H,{key:2},[M(z(zl),{"model-value":fe(m.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>de(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),ue.value[e.key]?(R(),G(`span`,JH,V(ue.value[e.key]),1)):L(``,!0)],64))]))),128)),W(`section`,YH,[n[33]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,XH,[W(`label`,ZH,[n[28]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),W(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:n[12]||=e=>S(`when`,e.target.value)},null,40,QH)]),W(`label`,$H,[n[30]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),W(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:n[13]||=e=>S(`on_failure`,e.target.value||void 0)},[...n[29]||=[W(`option`,{value:``},`Park the task`,-1),W(`option`,{value:`continue`},`Continue`,-1)]],40,eU)]),W(`label`,tU,[n[31]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),W(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:n[14]||=e=>C({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,nU)]),W(`label`,rU,[n[32]||=W(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),M(z(wm),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>C({backoff:e||void 0})},null,8,[`model-value`])])])])]),W(`footer`,iU,[M(z(Z),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:j(()=>[M(z(Rn)),n[34]||=A(`Delete step`,-1)]),_:1}),M(z(Z),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:j(()=>[...n[35]||=[A(`Done`,-1)]]),_:1})])]))}}),oU=`repository_path`;function sU(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:oU,path:n.trim(),type:`string`,required:!0}),r}function cU(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function lU(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=cU(yy(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function uU(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:yy(e.value,i.type??`string`)})}return n}function dU(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function fU(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...fU(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...fU(n,r)]}):[]}function pU(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function mU(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function hU(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var gU={class:`flex h-full flex-col`},_U={class:`flex items-center gap-2 border-b border-border px-4 py-3`},vU={class:`min-w-0 flex-1 truncate text-sm font-medium`},yU={key:0,class:`flex flex-1 items-center justify-center`},bU={class:`space-y-1.5`},xU=[`disabled`],SU=[`value`],CU={key:1,class:`space-y-1.5`},wU=[`value`],TU=[`title`],EU={class:`space-y-1.5`},DU={id:`bind-paths`},OU=[`value`],kU={class:`divide-y divide-border rounded-md border border-border`},AU={class:`flex items-center gap-1.5 text-xs`},jU={class:`font-mono`},MU={class:`text-fg-subtle`},NU={key:0,class:`text-danger`,title:`Required`},PU=[`title`,`aria-label`,`onClick`],FU=[`onUpdate:modelValue`,`aria-label`],IU=[`onUpdate:modelValue`,`aria-label`],LU={key:2,class:`text-xs text-danger`},RU=[`title`],zU={key:0,class:`space-y-1 px-3 py-2`},BU={key:0,class:`text-xs text-danger`},VU={key:1,class:`truncate font-mono text-xs text-success`},HU={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},UU={class:`space-y-2`},WU={key:0,role:`alert`,class:`text-xs text-danger`},GU={key:1,clas
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 Q2(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=$2(n.code,e);return Array.isArray(e)?e.some(e=>Z2(n[r],e,t,n.type===`keyup`)):Z2(n[r],e,t,n.type===`keyup`)}}function $2(e,t){return t.includes(e)?`code`:`key`}function e4(e,t){let n=N(()=>u(t?.target)??J2),r=he(u(e)===!0),i=!1,a=new Set,o=c(u(e));M(()=>u(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),KX([`blur`,`contextmenu`],s),JX((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0,a=u(t?.preventDefault)??!1;if(i=X2(e),(!i||i&&!n)&&Y2(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}),JX((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&Y2(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=u(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?Q2(e,a):e}return r}var t4=`vue-flow__node-desc`,n4=`vue-flow__edge-desc`,r4=`vue-flow__aria-live`,i4=[`Enter`,` `,`Escape`],a4={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function o4(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function s4(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 c4(e){return{width:e.offsetWidth,height:e.offsetHeight}}function l4(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function u4(e,t){return{x:l4(e.x,t[0][0],t[1][0]),y:l4(e.y,t[0][1],t[1][1])}}function d4(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function f4(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function p4(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!f4(e)}function m4(e){return p4(e)&&`computedPosition`in e}function h4(e){return!Number.isNaN(e)&&Number.isFinite(e)}function g4(e){return h4(e.width)&&h4(e.height)&&h4(e.x)&&h4(e.y)}function _4(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:vt({width:0,height:0}),computedPosition:vt({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:P3(e.data)?e.data:{},events:vt(P3(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function v4(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:P3(e.data)?e.data:{},events:vt(P3(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function y4(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 b4(...e){if(e.length===3){let[t,n,r]=e;return y4(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>f4(e)&&e.source===r).map(e=>n.find(t=>p4(t)&&t.id===e.target))}function x4(...e){if(e.length===3){let[t,n,r]=e;return y4(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>f4(e)&&e.target===r).map(e=>n.find(t=>p4(t)&&t.id===e.source))}function S4({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function C4(e,t){return t.some(t=>f4(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 w4({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function T4({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?_3(s,o):s}function E4(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 D4({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function O4({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function k4(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=E4(t,D4({...r.computedPosition,...r.dimensions}))}return O4(t)}function A4(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...T4(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=!1}=t,c=
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 PZ(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=FZ(n.code,e);return Array.isArray(e)?e.some(e=>NZ(n[r],e,t,n.type===`keyup`)):NZ(n[r],e,t,n.type===`keyup`)}}function FZ(e,t){return t.includes(e)?`code`:`key`}function IZ(e,t){let n=I(()=>ze(t?.target)??AZ),r=qe(ze(e)===!0),i=!1,a=new Set,o=c(ze(e));F(()=>ze(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),OG([`blur`,`contextmenu`],s),AG((...e)=>o(...e),e=>{let n=ze(t?.actInsideInputWithModifier)??!0,a=ze(t?.preventDefault)??!1;if(i=MZ(e),(!i||i&&!n)&&jZ(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}),AG((...e)=>o(...e),e=>{let n=ze(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&jZ(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=ze(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?PZ(e,a):e}return r}var LZ=`vue-flow__node-desc`,RZ=`vue-flow__edge-desc`,zZ=`vue-flow__aria-live`,BZ=[`Enter`,` `,`Escape`],VZ={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function HZ(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function UZ(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 WZ(e){return{width:e.offsetWidth,height:e.offsetHeight}}function GZ(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function KZ(e,t){return{x:GZ(e.x,t[0][0],t[1][0]),y:GZ(e.y,t[0][1],t[1][1])}}function qZ(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function JZ(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function YZ(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!JZ(e)}function XZ(e){return YZ(e)&&`computedPosition`in e}function ZZ(e){return!Number.isNaN(e)&&Number.isFinite(e)}function QZ(e){return ZZ(e.width)&&ZZ(e.height)&&ZZ(e.x)&&ZZ(e.y)}function $Z(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:mt({width:0,height:0}),computedPosition:mt({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:g$(e.data)?e.data:{},events:mt(g$(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function eQ(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:g$(e.data)?e.data:{},events:mt(g$(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function tQ(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 nQ(...e){if(e.length===3){let[t,n,r]=e;return tQ(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>JZ(e)&&e.source===r).map(e=>n.find(t=>YZ(t)&&t.id===e.target))}function rQ(...e){if(e.length===3){let[t,n,r]=e;return tQ(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>JZ(e)&&e.target===r).map(e=>n.find(t=>YZ(t)&&t.id===e.source))}function iQ({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function aQ(e,t){return t.some(t=>JZ(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 oQ({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function sQ({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?$Q(s,o):s}function cQ(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 lQ({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function uQ({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function dQ(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=cQ(t,lQ({...r.computedPosition,...r.dimensions}))}return uQ(t)}function fQ(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...sQ(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}
|
||||
@@ -149,4 +147,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`},d3=class extends Error{constructor(e,...t){super(u3[e]?.call(u3,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function f3(e){return`clientX`in e}function p3(e){return`sourceEvent`in e}function m3(e,t){let n=f3(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 h3=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function g3(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function _3(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var v3=()=>!0;function y3(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function b3(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())s4(i,o4(e))>0&&r.push(e);return r}var x3=250;function S3(e,t,n,r){let i=[],a=1/0,o=b3(e,n,t+x3);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}=a3(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 C3(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=v3},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:_}=m3(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=w3(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===U2.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=D3(t,e,a,p,n,!0)}return b}function w3(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function T3(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function E3(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function D3(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===U2.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,...a3(o,c,c.position,!0)}:c}var O3={[B2.Left]:B2.Right,[B2.Right]:B2.Left,[B2.Top]:B2.Bottom,[B2.Bottom]:B2.Top},k3=[`production`,`prod`];function A3(e,...t){j3()&&console.warn(`[Vue Flow]: ${e}`,...t)}function j3(){return!k3.includes(`production`)}function M3(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,...c4(t)}}):null}function N3(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),pt(()=>{o.blur()})):n([e])}function P3(e){return I(e)!==void 0}function F3(e,t,n,r){if(!e||!e.source||!e.target)return n(new d3(l3.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=f4(e)?e:{...e,id:S4(e)},i=v4(i,void 0,r),!C4(i,t)&&i}function I3(e,t,n,r,i){if(!t.source||!t.target)return i(new d3(l3.EDGE_INVALID,e.id)),!1;if(!n)return i(new d3(l3.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?S4(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function L3(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!p4(o)){n(new d3(l3.NODE_INVALID,o?.id));continue}let s=_4(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 d3(l3.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 R3(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 z3(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}`;R3(`source`,o,`${r}-${a}--Line 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`},qQ=class extends Error{constructor(e,...t){super(KQ[e]?.call(KQ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function JQ(e){return`clientX`in e}function YQ(e){return`sourceEvent`in e}function XQ(e,t){let n=JQ(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 ZQ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function QQ(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function $Q(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var e$=()=>!0;function t$(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function n$(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())UZ(i,HZ(e))>0&&r.push(e);return r}var r$=250;function i$(e,t,n,r){let i=[],a=1/0,o=n$(e,n,t+r$);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}=VQ(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 a$(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=e$},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:_}=XQ(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=o$(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===TZ.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=l$(t,e,a,p,n,!0)}return b}function o$(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function s$(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function c$(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function l$(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===TZ.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,...VQ(o,c,c.position,!0)}:c}var u$={[SZ.Left]:SZ.Right,[SZ.Right]:SZ.Left,[SZ.Top]:SZ.Bottom,[SZ.Bottom]:SZ.Top},d$=[`production`,`prod`];function f$(e,...t){p$()&&console.warn(`[Vue Flow]: ${e}`,...t)}function p$(){return!d$.includes(`production`)}function m$(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,...WZ(t)}}):null}function h$(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ft(()=>{o.blur()})):n([e])}function g$(e){return z(e)!==void 0}function _$(e,t,n,r){if(!e||!e.source||!e.target)return n(new qQ(GQ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=JZ(e)?e:{...e,id:iQ(e)},i=eQ(i,void 0,r),!aQ(i,t)&&i}function v$(e,t,n,r,i){if(!t.source||!t.target)return i(new qQ(GQ.EDGE_INVALID,e.id)),!1;if(!n)return i(new qQ(GQ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?iQ(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function y$(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!YZ(o)){n(new qQ(GQ.NODE_INVALID,o?.id));continue}let s=$Z(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 qQ(GQ.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 b$(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 x$(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}`;b$(`source`,o,`${r}-${a}--Line truncated
|
||||
@@ -2,6 +2,7 @@
|
||||
import { computed, onMounted, onUnmounted, ref } from "vue";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import { useControlPlaneStore } from "@/stores/control-plane";
|
||||
import { applyStateLabel, applyStateTone } from "./apply-status";
|
||||
|
||||
@@ -13,16 +14,33 @@ function reportAge(at: string): string {
|
||||
const seconds = Math.max(0, Math.floor((now.value - Date.parse(at)) / 1000));
|
||||
return seconds < 60 ? `${seconds}s ago` : `${Math.floor(seconds / 60)}m ago`;
|
||||
}
|
||||
const props = defineProps<{ kind: string }>();
|
||||
const props = defineProps<{ kind: string; compact?: boolean }>();
|
||||
const store = useControlPlaneStore();
|
||||
const rows = computed(() => store.applyStatusFor(props.kind));
|
||||
const mode = computed(
|
||||
() => store.catalog.find((item) => item.kind === props.kind)?.apply_mode,
|
||||
);
|
||||
|
||||
// The chip stands for the row that most needs attention; processes the
|
||||
// resource does not apply to are not worth a chip.
|
||||
const URGENCY = ["failed", "unknown", "pending-restart", "not-reporting", "running"];
|
||||
const headline = computed(() =>
|
||||
rows.value
|
||||
.filter((row) => row.state !== "not-applicable")
|
||||
.sort((a, b) => URGENCY.indexOf(a.state) - URGENCY.indexOf(b.state))[0],
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="rows.length" class="flex flex-col gap-2">
|
||||
<Popover v-if="compact">
|
||||
<PopoverTrigger v-if="headline" as-child>
|
||||
<button type="button" class="rounded-full" :aria-label="`Apply status: ${applyStateLabel(headline.state, mode)}`">
|
||||
<Badge :variant="applyStateTone(headline.state, mode)">{{ applyStateLabel(headline.state, mode) }}</Badge>
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent align="end" class="w-80"><ApplyStatusRows :kind="kind" /></PopoverContent>
|
||||
</Popover>
|
||||
<div v-else-if="rows.length" class="flex flex-col gap-2">
|
||||
<p class="text-xs font-medium text-muted-foreground">{{ store.catalog.find(item => item.kind === kind)?.title ?? kind }} · apply status</p>
|
||||
<div v-for="row in rows" :key="row.process" class="flex flex-col gap-1">
|
||||
<div class="flex items-center gap-2 text-xs">
|
||||
|
||||
@@ -27,7 +27,7 @@ const path = computed(() =>
|
||||
</EdgeLabelRenderer>
|
||||
<EdgeLabelRenderer v-if="data?.editable && data.insertAfter !== undefined">
|
||||
<div
|
||||
class="workflow-insert absolute"
|
||||
class="workflow-insert absolute p-3 opacity-0 transition-opacity focus-within:opacity-100 hover:opacity-100 has-[[data-state=open]]:opacity-100"
|
||||
:style="{ transform: `translate(-50%, -50%) translate(${path[1]}px, ${path[2]}px)`, pointerEvents: 'all' }"
|
||||
>
|
||||
<AddStepMenu :types="data.types" :label="data.insertAfter.length > 2 ? `Add a step in ${data.insertAfter[3]}` : undefined" @pick="data.onInsert(data.insertAfter!, $event)" />
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Handle, Position } from "@vue-flow/core";
|
||||
import { Flag, Play, Repeat, SkipForward, Webhook, CircleDot, BookOpen, Workflow } from "@lucide/vue";
|
||||
|
||||
import { stepIcon } from "./step-icons";
|
||||
import type { StepNodeData } from "./workflow-graph";
|
||||
import { stepTitle, type StepNodeData } from "./workflow-graph";
|
||||
|
||||
const props = defineProps<{ data: StepNodeData }>();
|
||||
|
||||
@@ -58,7 +58,7 @@ function duration(ms?: number): string {
|
||||
<span v-if="data.step" class="font-mono text-[11px] text-fg-subtle">{{ data.step }}</span>
|
||||
<span class="truncate text-sm font-medium" :title="data.title">{{ data.title }}</span>
|
||||
</div>
|
||||
<div v-if="data.type && data.type !== data.title" class="truncate font-mono text-[11px] text-fg-subtle">{{ data.type }}</div>
|
||||
<div v-if="data.type && data.title !== stepTitle(data.type)" class="truncate font-mono text-[11px] text-fg-subtle">{{ data.type }}</div>
|
||||
<ul v-if="data.kind === 'start' && data.triggers?.length" class="mt-1 space-y-0.5">
|
||||
<li v-for="trigger in data.triggers" :key="trigger.kind + trigger.label" class="flex items-center gap-1.5 text-xs" :title="trigger.detail">
|
||||
<component :is="TRIGGER_ICONS[trigger.kind]" class="size-3 shrink-0 text-primary" aria-hidden="true" />
|
||||
|
||||
@@ -74,8 +74,15 @@ const nodes = computed(() =>
|
||||
// The run's trace: an edge lights once the run has reached its target, in the
|
||||
// colour of how that step went, and moves while the step is running.
|
||||
const runs = computed(() => new Map(graph.value.nodes.map((node) => [node.id, node.data.run?.status])));
|
||||
// Data edges bundle into noise, so only the hovered or selected step's show.
|
||||
const hovered = ref<string | null>(null);
|
||||
const focusId = computed(
|
||||
() => hovered.value ?? graph.value.nodes.find((node) => props.selected && JSON.stringify(node.data.path ?? null) === selectedKey.value)?.id,
|
||||
);
|
||||
const edges = computed(() =>
|
||||
graph.value.edges.map(({ label, offset, insertAfter, otherwise, ...edge }) =>
|
||||
graph.value.edges
|
||||
.filter((edge) => edge.kind === "flow" || edge.source === focusId.value || edge.target === focusId.value)
|
||||
.map(({ label, offset, insertAfter, otherwise, ...edge }) =>
|
||||
edge.kind === "flow"
|
||||
? {
|
||||
...edge,
|
||||
@@ -152,6 +159,8 @@ const beforePath = computed(() => menuPath.value ? [...menuPath.value.slice(0, -
|
||||
pan-on-scroll
|
||||
@pane-ready="place"
|
||||
@node-click="onNodeClick"
|
||||
@node-mouse-enter="hovered = $event.node.id"
|
||||
@node-mouse-leave="hovered = null"
|
||||
@node-context-menu="onNodeMenu"
|
||||
@pane-context-menu="openMenu($event as MouseEvent)"
|
||||
>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import ApplyStatusRows from "@/settings/ApplyStatusRows.vue";
|
||||
import { computed, ref, watch } from "vue";
|
||||
import { Ellipsis, RotateCcw, Trash2, X } from "@lucide/vue";
|
||||
|
||||
@@ -198,7 +197,6 @@ function syncScroll(event: Event): void {
|
||||
|
||||
<template>
|
||||
<form class="space-y-4" @submit.prevent="saveDraft">
|
||||
<ApplyStatusRows kind="workflow-definitions" />
|
||||
<Tabs v-model="view" class="space-y-1.5">
|
||||
<div class="flex items-center gap-2">
|
||||
<TabsList>
|
||||
@@ -250,7 +248,7 @@ function syncScroll(event: Event): void {
|
||||
<TabsContent value="canvas" class="space-y-2">
|
||||
<!-- The canvas takes the height the viewport has left, so the page
|
||||
itself does not scroll; the canvas pans. -->
|
||||
<div class="relative h-[calc(100dvh-20.5rem)] min-h-[26rem]">
|
||||
<div class="relative h-[calc(100dvh-17rem)] min-h-[26rem]">
|
||||
<p v-if="restartError" role="alert" class="absolute bottom-3 left-14 z-10 max-w-xl rounded-md border border-danger/40 bg-card px-3 py-2 text-sm text-danger shadow-lg">{{ restartError }}</p>
|
||||
<WorkflowCanvas
|
||||
:yaml="yaml"
|
||||
|
||||
@@ -1,6 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watchEffect } from "vue";
|
||||
import { Plus, RotateCcw } from "@lucide/vue";
|
||||
import { Ellipsis, Plus, RotateCcw } from "@lucide/vue";
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -18,6 +30,7 @@ import { cn } from "@/lib/utils";
|
||||
import { statusLabel } from "@/lib/task-meta";
|
||||
import { cloneControlPlaneValue, restoreShippedDefinitions, useControlPlaneStore, type WorkflowDefinitionCollection } from "@/stores/control-plane";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import ApplyStatusRows from "@/settings/ApplyStatusRows.vue";
|
||||
import SlowestStagesCard from "./SlowestStagesCard.vue";
|
||||
import StageFailuresCard from "./StageFailuresCard.vue";
|
||||
import type { StageStats } from "./stages";
|
||||
@@ -105,6 +118,7 @@ function create() {
|
||||
while (stored.value.some((d) => d.id === `workflow-${n}`)) n++;
|
||||
selected.value = `workflow-${n}`;
|
||||
}
|
||||
const confirmRestore = ref(false);
|
||||
async function restoreShipped() {
|
||||
const shipped = store.shippedWorkflows();
|
||||
const restored = restoreShippedDefinitions({ definitions: stored.value }, shipped);
|
||||
@@ -119,12 +133,32 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Workflows">
|
||||
<Button variant="ghost" size="sm" :disabled="!store.shippedWorkflows().definitions.length" @click="restoreShipped">
|
||||
<RotateCcw data-icon="inline-start" /> Restore shipped
|
||||
</Button>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger as-child>
|
||||
<Button variant="ghost" size="icon-sm" aria-label="More"><Ellipsis /></Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuItem :disabled="!store.shippedWorkflows().definitions.length" @select="confirmRestore = true">
|
||||
<RotateCcw />Restore shipped workflows
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<Button size="sm" @click="create"><Plus data-icon="inline-start" />New workflow</Button>
|
||||
</PageHeader>
|
||||
|
||||
<AlertDialog v-model:open="confirmRestore">
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Restore shipped workflows?</AlertDialogTitle>
|
||||
<AlertDialogDescription>Every shipped workflow is reset to its default, discarding edits to it. Your own workflows are kept.</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction @click="restoreShipped">Restore</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
||||
<p v-if="error" class="mb-4 text-sm text-danger" role="alert">Cannot reach archied: {{ error }}</p>
|
||||
|
||||
<div class="grid items-start gap-6 lg:grid-cols-[24rem_minmax(0,1fr)]">
|
||||
@@ -162,10 +196,13 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
|
||||
<header class="mb-2 flex flex-wrap items-center gap-2">
|
||||
<h2 class="font-mono text-[15px] font-medium">{{ selected }}</h2>
|
||||
<StatusPill v-if="provenance">{{ provenance }}</StatusPill>
|
||||
<label v-if="enabled !== undefined" class="ml-auto flex items-center gap-2 text-xs text-fg-muted">
|
||||
Enabled
|
||||
<Switch :model-value="enabled" aria-label="Workflow enabled" @update:model-value="setEnabled" />
|
||||
</label>
|
||||
<div class="ml-auto flex items-center gap-3">
|
||||
<ApplyStatusRows kind="workflow-definitions" compact />
|
||||
<label v-if="enabled !== undefined" class="flex items-center gap-2 text-xs text-fg-muted">
|
||||
Enabled
|
||||
<Switch :model-value="enabled" aria-label="Workflow enabled" @update:model-value="setEnabled" />
|
||||
</label>
|
||||
</div>
|
||||
</header>
|
||||
<WorkflowEditor v-model:selected="selected" :runs-count="workflowRuns.length">
|
||||
<template #performance>
|
||||
|
||||
@@ -219,7 +219,7 @@ function stepSummary(settings: Mapping): string | undefined {
|
||||
const value = settings[key];
|
||||
if (typeof value !== "string" || !value.trim()) continue;
|
||||
return value
|
||||
.replace(/\{\{\s*([^}]+?)\s*\}\}/g, "‹$1›")
|
||||
.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (_, ref: string) => `‹${ref.replace(/^steps\./, "").replace(/\.result\b/, "")}›`)
|
||||
.split("\n")
|
||||
.find((line) => line.trim())
|
||||
?.trim();
|
||||
|
||||
Reference in new issue
Block a user