@@ -1,12 +1,12 @@
const _ _vite _ _mapDeps = ( i , m = _ _vite _ _mapDeps , d = ( m . f || ( m . f = [ "assets/css2.js" , "assets/css.js" , "assets/html.js" , "assets/javascript.js" , "assets/javascript2.js" , "assets/AccountPage.js" , "assets/PageHeader.js" , "assets/createLucideIcon.js" , "assets/input.js" , "assets/alert.js" , "assets/AuthenticationPage.js" , "assets/check.js" , "assets/CredentialBindingsPage.js" , "assets/HistoryLink.js" , "assets/badge.js" , "assets/pinia.js" , "assets/nullish.js" , "assets/duration.js" , "assets/SchedulesPage.js" , "assets/schedule.js" , "assets/Collection.js" , "assets/textarea.js" , "assets/table.js" , "assets/ScheduleRunsPage.js" , "assets/PlaybooksPage.js" , "assets/AgentProfilesPage.js" , "assets/HarnessPage.js" , "assets/select.js" , "assets/VisuallyHidden.js" , "assets/chevron-up.js" , "assets/NotFoundPage.js" ] ) ) ) => i . map ( i => d [ i ] ) ;
import { A as e , C as t , D as n , E as r , F as i , I as a , L as o , M as s , N as c , P as l , R as u , S as d , _ as f , a as p , b as m , c as h , d as g , f as _ , h as v , i as y , k as b , l as x , m as S , o as ee , p as C , r as te , s as ne , t as w , u as T , v as re , w as E , x as ie , y as ae } from "./badge.js" ; import { $t as D , A as O , B as oe , Bt as se , C as k , Ct as A , D as ce , Dn as le , Dt as j , En as ue , Gt as M , H as de , It as fe , Jt as pe , Kt as me , Lt as he , M as N , On as ge , Pt as _e , Q as ve , Qt as ye , Rt as be , S as P , Sn as xe , T as Se , Tt as Ce , U as we , Vt as Te , Xt as F , Z as Ee , _t as I , an as De , b as L , bn as Oe , cn as ke , dt as Ae , er as R , gn as je , hn as Me , ht as Ne , ir as z , it as Pe , jn as B , k as V , kn as Fe , l as H , m as Ie , n as Le , nr as Re , nt as ze , o as Be , ot as Ve , p as He , pn as Ue , r as U , rr as We , rt as W , sn as Ge , st as Ke , t as qe , wn as Je , wt as G , x as K , xn as q , y as J , yn as Ye , yt as Xe } from "./PageHeader.js" ; import { A as Y , L as Ze , P as Qe , T as $e , i as et , j as tt , k as nt , n as rt , nt as it , r as X , rt as at , s as ot , t as st , tt as ct , x as lt } from "./createLucideIcon.js" ; import { n as ut , r as dt , t as ft } from "./pinia.js" ; import { A as pt , B as mt , C as ht , D as gt , E as _t , F as vt , G as yt , H as bt , I as xt , K as St , L as Ct , M as wt , N as Tt , O as Et , P as Dt , R as Ot , S as eee , T as kt , U as At , V as jt , W as Mt , _ as Nt , b as Pt , c as Ft , d as It , f as Lt , g as Rt , h as zt , j as Bt , k as Vt , l as Ht , m as Ut , n as Wt , o as Gt , p as Kt , q as qt , r as Jt , s as Yt , u as Xt , v as Zt , w as Qt , x as $t , y as en , z as tn } from "./schedule.js" ; import { n as nn , t as rn } from "./nullish.js" ; import { i as an , n as on , r as sn , t as cn } from "./VisuallyHidden.js" ; import { a as ln , c as un , d as dn , f as fn , g as pn , h as mn , i as hn , l as gn , m as _n , n as vn , o as yn , p as bn , r as xn , s as Sn , t as Cn , u as wn } from "./HistoryLink.js" ; import { i as Tn , n as En , o as Dn } from "./duration.js" ; import { g as On , h as kn , t as An , u as jn } from "./Collection.js" ; import { a as Mn , c as Nn , i as Pn , n as Fn , o as In , r as Ln , s as Rn , t as zn } from "./select.js" ; import { a as Bn , c as Vn , d as Hn , i as Un , l as Wn , n as Gn , o as Kn , r as qn , t as Z , u as Jn } from "./input.js" ; import { t as Yn } from "./check.js" ; import { n as Xn , t as Zn } from "./chevron-up.js" ; import { t as Qn } from "./textarea.js" ; import { a as $n , i as er , n as tr , o as nr , r as rr , s as ir , t as ar } from "./table.js" ; import { n as or , r as sr , t as cr } from "./alert.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 lr = typeof document < ` u ` , ur = /#/g , dr = /&/g , fr = /\//g , pr = /=/g , mr = /\?/g , hr = /\+/g , gr = /%5B/g , _r = /%5D/g , vr = /%5E/g , yr = /%60/g , br = /%7B/g , xr = /%7C/g , Sr = /%7D/g , Cr = /%20/g ; function wr ( e ) { return e == null ? ` ` : encodeURI ( ` ` + e ) . replace ( xr , ` | ` ) . replace ( gr , ` [ ` ) . replace ( _r , ` ] ` ) } function Tr ( e ) { return wr ( e ) . replace ( br , ` { ` ) . replace ( Sr , ` } ` ) . replace ( vr , ` ^ ` ) } function Er ( e ) { return wr ( e ) . replace ( hr , ` %2B ` ) . replace ( Cr , ` + ` ) . replace ( ur , ` %23 ` ) . replace ( dr , ` %26 ` ) . replace ( yr , "`" ) . replace ( br , ` { ` ) . replace ( Sr , ` } ` ) . replace ( vr , ` ^ ` ) } function Dr ( e ) { return Er ( e ) . replace ( pr , ` %3D ` ) } function Or ( e ) { return wr ( e ) . replace ( ur , ` %23 ` ) . replace ( mr , ` %3F ` ) } function kr ( e ) { return Or ( e ) . replace ( fr , ` %2F ` ) } function Ar ( e ) { if ( e == null ) return null ; try { return decodeURIComponent ( ` ` + e ) } catch { } return ` ` + e } var jr = /\/$/ , Mr = e => e . replace ( jr , ` ` ) ; function Nr ( e , t , n = ` / ` ) { let r , i = { } , a = ` ` , o = ` ` , s = t . indexOf ( ` # ` ) , c = t . indexOf ( ` ? ` ) ; return c = s >= 0 && c > s ? - 1 : c , c >= 0 && ( r = t . slice ( 0 , c ) , a = t . slice ( c , s > 0 ? s : t . length ) , i = e ( a . slice ( 1 ) ) ) , s >= 0 && ( r || = t . slice ( 0 , s ) , o = t . slice ( s , t . length ) ) , r = Vr ( r ? ? t , n ) , { fullPath : r + a + o , path : r , query : i , hash : Ar ( o ) } } function Pr ( e , t ) { let n = t . query ? e ( t . query ) : ` ` ; return t . path + ( n && ` ? ` ) + n + ( t . hash || ` ` ) } function Fr ( e , t ) { return ! t || ! e . toLowerCase ( ) . startsWith ( t . toLowerCase ( ) ) ? e : e . slice ( t . length ) || ` / ` } function Ir ( e , t , n ) { let r = t . matched . length - 1 , i = n . matched . length - 1 ; return r > - 1 && r === i && Lr ( t . matched [ r ] , n . matched [ i ] ) && Rr ( t . params , n . params ) && e ( t . query ) === e ( n . query ) && t . hash === n . hash } function Lr ( e , t ) { return ( e . aliasOf || e ) === ( t . aliasOf || t ) } function Rr ( e , t ) { if ( Object . keys ( e ) . length !== Object . keys ( t ) . length ) return ! 1 ; for ( var n in e ) if ( ! zr ( e [ n ] , t [ n ] ) ) return ! 1 ; return ! 0 } function zr ( e , t ) { return Dt ( e ) ? Br ( e , t ) : Dt ( t ) ? Br ( t , e ) : ( e && e . valueOf ( ) ) === ( t && t . valueOf ( ) ) } function Br ( e , t ) { return Dt ( t ) ? e . length === t . length && e . every ( ( e , n ) => e === t [ n ] ) : e . length === 1 && e [ 0 ] === t } function Vr ( e , t ) { if ( Tt ( e ) ) return e ; if ( ! e ) return t ; let n = t . split ( ` / ` ) , r = e . split ( ` / ` ) , i = r [ r . length - 1 ] ; ( i === ` .. ` || i === ` . ` ) && r . push ( ` ` ) ; let a = n . length - 1 , o , s ; for ( o = 0 ; o < r . length ; o ++ ) if ( s = r [ o ] , s !== ` . ` ) { if ( s === ` .. ` ) a > 1 && a -- ; else break } return n . slice ( 0 , a ) . join ( ` / ` ) + ` / ` + r . slice ( o ) . join ( ` / ` ) } var Hr = { path : ` / ` , name : void 0 Line truncated
const _ _vite _ _mapDeps = ( i , m = _ _vite _ _mapDeps , d = ( m . f || ( m . f = [ "assets/css2.js" , "assets/css.js" , "assets/html.js" , "assets/javascript.js" , "assets/javascript2.js" , "assets/AccountPage.js" , "assets/PageHeader.js" , "assets/createLucideIcon.js" , "assets/input.js" , "assets/alert.js" , "assets/AuthenticationPage.js" , "assets/check.js" , "assets/CredentialBindingsPage.js" , "assets/HistoryLink.js" , "assets/badge.js" , "assets/pinia.js" , "assets/nullish.js" , "assets/duration.js" , "assets/SchedulesPage.js" , "assets/schedule.js" , "assets/Collection.js" , "assets/textarea.js" , "assets/table.js" , "assets/ScheduleRunsPage.js" , "assets/PlaybooksPage.js" , "assets/AgentProfilesPage.js" , "assets/HarnessPage.js" , "assets/select.js" , "assets/VisuallyHidden.js" , "assets/chevron-up.js" , "assets/label.js" , "assets/ NotFoundPage.js"] ) ) ) => i . map ( i => d [ i ] ) ;
import { A as e , C as t , D as n , E as r , F as i , I as a , L as o , M as s , N as c , P as l , R as u , S as d , _ as f , a as p , b as m , c as h , d as g , f as _ , h as v , i as y , k as b , l as x , m as S , o as ee , p as C , r as te , s as ne , t as w , u as T , v as E , w as re , x as ie , y as ae } from "./badge.js" ; import { $t as D , A as O , B as oe , Bt as se , C as k , Ct as A , D as ce , Dn as le , Dt as j , Gt as M , H as ue , It as de , Jt as fe , Kt as pe , Lt as me , M as N , On as he , Pt as ge , Q as _e , Qt as ve , Rt as ye , S as P , Sn as be , T as xe , Tt as Se , U as Ce , Vt as we , Xt as F , Z as Te , _t as I , an as Ee , b as L , bn as De , cn as Oe , dt as ke , er as R , gn as Ae , hn as je , ht as Me , ir as z , it as Ne , jn as B , k as V , kn as Pe , l as H , m as Fe , n as Ie , nr as Le , nt as Re , o as ze , ot as Be , p as Ve , pn as He , r as U , rr as Ue , rt as W , sn as We , st as Ge , t as Ke , wn as qe , wt as G , x as K , xn as q , y as J , yn as Je , yt as Ye } from "./PageHeader.js" ; import { A as Y , L as Xe , P as Ze , T as Qe , i as $e , j as et , k as tt , n as nt , nt as rt , r as X , rt as it , s as at , t as ot , tt as st , x as ct } from "./createLucideIcon.js" ; import { n as lt , r as ut , t as dt } from "./pinia.js" ; import { A as ft , B as pt , C as mt , D as ht , E as gt , F as _t , G as vt , H as yt , I as bt , K as xt , L as St , M as Ct , N as wt , O as Tt , P as Et , R as Dt , S as Ot , T as kt , U as At , V as jt , W as Mt , _ as Nt , b as Pt , c as Ft , d as It , f as Lt , g as Rt , h as zt , j as Bt , k as Vt , l as Ht , m as Ut , n as Wt , o as Gt , p as Kt , q as qt , r as Jt , s as Yt , u as Xt , v as Zt , w as Qt , x as $t , y as en , z as tn } from "./schedule.js" ; import { n as nn , t as rn } from "./nullish.js" ; import { i as an , n as on , r as sn , t as cn } from "./VisuallyHidden.js" ; import { _ as ln , a as un , c as dn , d as fn , f as pn , g as mn , h as hn , i as gn , l as _n , m as vn , n as yn , o as bn , p as xn , r as Sn , s as Cn , t as wn , u as Tn } from "./HistoryLink.js" ; import { i as En , n as eee , o as Dn } from "./duration.js" ; import { g as On , h as kn , t as An , u as jn } from "./Collection.js" ; import { a as Mn , c as Nn , i as Pn , n as Fn , o as In , r as Ln , s as Rn , t as zn } from "./select.js" ; import { t as Bn } from "./label.js" ; import { a as Vn , c as Hn , d as Un , i as Wn , l as Gn , n as Kn , o as qn , r as Jn , t as Z , u as Yn } from "./input.js" ; import { t as Xn } from "./check.js" ; import { n as Zn , t as Qn } from "./chevron-up.js" ; import { t as $n } from "./textarea.js" ; import { a as er , i as tr , n as nr , o as rr , r as ir , s as ar , t as or } from "./table.js" ; import { n as sr , r as cr , t as lr } from "./alert.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 ur = typeof document < ` u ` , dr = /#/g , fr = /&/g , pr = /\//g , mr = /=/g , hr = /\?/g , gr = /\+/g , _r = /%5B/g , vr = /%5D/g , yr = /%5E/g , br = /%60/g , xr = /%7B/g , Sr = /%7C/g , Cr = /%7D/g , wr = /%20/g ; function Tr ( e ) { return e == null ? ` ` : encodeURI ( ` ` + e ) . replace ( Sr , ` | ` ) . replace ( _r , ` [ ` ) . replace ( vr , ` ] ` ) } function Er ( e ) { return Tr ( e ) . replace ( xr , ` { ` ) . replace ( Cr , ` } ` ) . replace ( yr , ` ^ ` ) } function Dr ( e ) { return Tr ( e ) . replace ( gr , ` %2B ` ) . replace ( wr , ` + ` ) . replace ( dr , ` %23 ` ) . replace ( fr , ` %26 ` ) . replace ( br , "`" ) . replace ( xr , ` { ` ) . replace ( Cr , ` } ` ) . replace ( yr , ` ^ ` ) } function Or ( e ) { return Dr ( e ) . replace ( mr , ` %3D ` ) } function kr ( e ) { return Tr ( e ) . replace ( dr , ` %23 ` ) . replace ( hr , ` %3F ` ) } function Ar ( e ) { return kr ( e ) . replace ( pr , ` %2F ` ) } function jr ( e ) { if ( e == null ) return null ; try { return decodeURIComponent ( ` ` + e ) } catch { } return ` ` + e } var Mr = /\/$/ , Nr = e => e . replace ( Mr , ` ` ) ; function Pr ( e , t , n = ` / ` ) { let r , i = { } , a = ` ` , o = ` ` , s = t . indexOf ( ` # ` ) , c = t . indexOf ( ` ? ` ) ; return c = s >= 0 && c > s ? - 1 : c , c >= 0 && ( r = t . slice ( 0 , c ) , a = t . slice ( c , s > 0 ? s : t . length ) , i = e ( a . slice ( 1 ) ) ) , s >= 0 && ( r || = t . slice ( 0 , s ) , o = t . slice ( s , t . length ) ) , r = Hr ( r ? ? t , n ) , { fullPath : r + a + o , path : r , query : i , hash : jr ( o ) } } function Fr ( e , t ) { let n = t . query ? e ( t . query ) : ` ` ; return t . path + ( n && ` ? ` ) + n + ( t . hash || ` ` ) } function Ir ( e , t ) { return ! t || ! e . toLowerCase ( ) . startsWith ( t . toLowerCase ( ) ) ? e : e . slice ( t . length ) || ` / ` } function Lr ( e , t , n ) { let r = t . matched . length - 1 , i = n . matched . length - 1 ; return r > - 1 && r === i && Rr ( t . matched [ r ] , n . matched [ i ] ) && zr ( t . params , n . params ) && e ( t . query ) === e ( n . query ) && t . hash === n . hash } function Rr ( e , t ) { return ( e . aliasOf || e ) === ( t . aliasOf || t ) } function zr ( e , t ) { if ( Object . keys ( e ) . length !== Object . keys ( t ) . length ) return ! 1 ; for ( var n in e ) if ( ! Br ( e [ n ] , t [ n ] ) ) return ! 1 ; return ! 0 } function Br ( e , t ) { return Et ( e ) ? Vr ( e , t ) : Et ( t ) ? Vr ( t , e ) : ( e && e . valueOf ( ) ) === ( t && t . valueOf ( ) ) } function Vr ( e , t ) { return Et ( t ) ? e . length === t . length && e . every ( ( e , n ) => e === t [ n ] ) : e . length === 1 && e [ 0 ] === t } function Hr ( e , t ) { if ( wt ( e ) ) return e ; if ( ! e ) return t ; let n = t . split ( ` / ` ) , r = e . split ( ` / ` ) , i = r [ r . length - 1 ] ; ( i === ` .. ` || i === ` . ` ) && r . push ( ` ` ) ; let a = n . length - 1 , o , s ; for ( o = 0 ; o < r . length ; o ++ ) if ( s = r [ o ] , s !== ` . ` ) { if ( s === ` .. ` ) a > 1 && a -- ; else break } return n . slice ( 0 , a ) . join ( ` / ` ) + ` / ` + r . slice ( o ) . join ( ` /
Line truncated
` );p=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&&(Zl.value=n.session_id),n.type=== ` delta ` &&(o+=n.text,ru.value=ru.value?{...ru.value,text:o}:null),(n.type=== ` tool ` ||n.type=== ` navigate ` )&&(a=[...a,n],ru.value=ru.value?{...ru.value,tools:a}:null),n.type=== ` ask ` &&n.ask&&(clearTimeout(l),ru.value=ru.value?{...ru.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 ` );Ql.value=!i&&n.trim()=== ` / new ` ?[]:[...Ql.value,{from: ` assistant ` ,text:o,tool_calls:a}],ru.value=null,eu.value= ` Ready ` ,await hu()}catch(e){let t=e;o&&(Ql.value=[...Ql.value,{from: ` assistant ` ,text:o,tool_calls:a}],a=[]),t.name=== ` AbortError ` &&!c?(ru.value={text: ` Turn stopped . ` ,tools:a,isError:!1,turn:r,isRetry:i},eu.value= ` Stopped ` ):(ru.value={text: ` Unable to complete that turn : $ { t . message || t } ` ,tools:a,isError:!0,turn:r?Gl(r):void 0,isRetry:i},eu.value= ` Error . Retry available . ` )}finally{clearTimeout(l),Jl=null,pu=null,tu.value=!1,Cu.after?.()}}function Pu(){eu.value= ` Stopping … ` ,Zl.value&&X.chatCancel(Zl.value).catch(()=>{}),mu()}function Fu(){Ae(()=>{hu().catch(e=>{eu.value=e.message|| ` Chat unavailable ` })}),Ne(()=>{mu()})}async function Iu(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 Nu({textOverride: ` 🎤 Voice message ` ,voice:{data:btoa(n),mime_type:e.type|| ` audio / webm ` }})}var Lu={class: ` grid gap - 1 p - 1 ` },Ru={key:0,class: ` text - xs text - fg - subtle ` },zu= ` _ _default _ _ ` ,Bu=N({__name: ` ChatSettings ` ,setup(e){let t=J(()=>au.value||zu),n=J(()=>{let e=iu.value.models_by_provider||{},t=Object.entries(e).filter(([,e])=>e.length);return t.length?t:[[ ` ` ,iu.value.models||[]]]});return(e,r)=>(I(),k( ` div ` ,Lu,[B(eu)=== ` Ready ` ?P( ` ` ,!0):(I(),k( ` span ` ,Ru,z(B(eu)),1)),O(B(Rn),{"model-value":t.value,"onUpdate:modelValue":r[0]||=e=>B(Su)(e===zu? ` ` :String(e?? ` ` ))},{default:F(()=>[O(B(Fn),{size: ` sm ` ,class: ` w - full ` ,"aria-label": ` Model ` },{default:F(()=>[O(B(zn))]),_:1}),O(B(In),null,{default:F(()=>[O(B(Pn),{value:zu},{default:F(()=>[...r[1]||=[V( ` Default ` ,-1)]]),_:1}),(I(!0),k(H,null,A(n.value,([e,t])=>(I(),K(B(Mn),{key:e},{default:F(()=>[e?(I(),K(B(Ln),{key:0},{default:F(()=>[V(z(e),1)]),_:2},1024)):P( ` ` ,!0),(I(!0),k(H,null,A(t,e=>(I(),K(B(Pn),{key:e,value:e},{default:F(()=>[V(z(e),1)]),_:2},1032,[ ` value ` ]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[ ` model - value ` ])]))}}),Vu=N({__name: ` ChatSessionActions ` ,setup(e){let t=q(!1);du(t);function n(e){t.value=!1,bu(e)}function r(e,n){t.value=!1,xu(e,n)}return(e,i)=>(I(),K(B(_n),{open:t.value,"onUpdate:open":i[5]||=e=>t.value=e},{default:F(()=>[O(B(fn),{"as-child": ` ` },{default:F(()=>[O(B(Y),{variant: ` ghost ` ,size: ` icon - sm ` ,class: ` flex - none ` ,"aria-label": ` More ` ,title: ` More ` },{default:F(()=>[O(B(Fc))]),_:1})]),_:1}),O(B(bn),{align: ` end ` ,class: ` grid w - 64 gap - 0.5 p - 1 ` },{default:F(()=>[B(Zl)?(I(),k(H,{key:0},[O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[0]||=e=>n( ` / retry ` )},{default:F(()=>[O(B(ml),{"data-icon": ` inline - start ` }),i[6]||=V( ` Retry ` ,-1)]),_:1}),O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[1]||=e=>n( ` / undo ` )},{default:F(()=>[O(B(Ol),{"data-icon": ` inline - start ` }),i[7]||=V( ` Undo ` ,-1)]),_:1}),O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[2]||=e=>r( ` / title ` , ` Session title ` )},{default:F(()=>[O(B(cl),{"data-icon": ` inline - start ` }),i[8]||=V( ` Rename ` ,-1)]),_:1}),O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[3]||=e=>r( ` / branch ` , ` Branch name ( optional ) ` )},{default:F(()=>[O(B(Uc),{"data-icon": ` inline - start ` }),i[9]||=V( ` Branch ` ,-1)]),_:1}),O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[4]||=e=>n( ` / compress -- preview ` )},{default:F(()=>[O(B(bl),{"data-icon": ` inline - start ` }),i[10]||=V( ` Preview compression ` ,-1)]),_:1}),O(B(Fl),{class: ` my - 1 ` })],64)):P( ` ` ,!0),O(Bu)]),_:1})]),_:1},8,[ ` open ` ]))}}),Hu=new Intl.DateTimeFormat(void 0,{month: ` short ` ,day: ` numeric ` ,hour: ` numeric ` ,minute: ` 2 - digit ` });function Uu(e){return e.title||e.branch_name||(e.created_at?Hu.format(new Date(e.created_at)): ` New chat ` )}var Wu={class: ` min - w - 0 flex - 1 ` },Gu=N({__name: ` ChatSessionList ` ,setup(e){return(e,t)=>(I(),k( ` div ` ,Wu,[O(B(Rn),{"model-value":B(Zl),disabled:!B(Xl).length,"onUpdate:modelValue":t[0]||=e=>B(gu)(String(e))},{default:F(()=>[O(B(Fn),{size: ` sm ` ,class: ` w - full ` ,"aria-label": ` Conversation ` },{default:F(()=>[O(B(zn),{placeholder: ` No conversations yet ` })]),_:1}),O(B(In),null,{default:F(()=>[O(B(Mn),null,{default:F(()=>[(I(!0),k(H,null,A(B(Xl),e=>(I(),K(B(Pn),{key:e.session_id,value:e.session_id},{default:F(()=>[V(z(B(Uu)(e)),1)]),_:2},1032,[ ` value ` ]))),128))]),_:1})]),_:1})]),_:1},8,[ ` model - value ` , ` disabled ` ])]))}}),Ku={class: ` flex items - center gap - 1 border - b px - 3 py - 2 ` },qu=N({__name: ` ChatBar ` ,setup(e){return(e,t)=>(I(),k( ` div ` ,Ku,[O(Gu),O(B(Y),{variant: ` ghost ` ,size: ` icon - sm ` ,class: ` flex - none ` ,title: ` New chat ` ,"aria-la
Line truncated
` ))],64)):G(n. $ slots, ` default ` ,{},void 0,void 0,1)])],10,_ f))}}),b f=N({__name: ` CodeBlockContent ` ,props:{wrap:{type:Boolean,default:!1},lineNumbers:{type:Boolean,default:!1},startLine:{default:1},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=se();function r(e){let t= ` ` ;for(let n of e)if(n.type!==B e){if(n.type===I e)t+=n.children;else if(n.type===H&&Array.isArray(n.children)){let e=r(n.children);if(e===null)return null;t+=e}else return null}return t}function i(){if(!t.lineNumbers)return null;let e=r(n.default?.()??[]);return e===null?null:e.replace(/ \n $ /, ` ` ).split( `
` )}return(n,r)=>(I(),K(B(tt),{as: ` pre ` ,"data-slot": ` code - block - content ` ,"data-wrap":e.wrap||void 0,"data-numbered":e.lineNumbers||void 0,dir: ` ltr ` ,tabindex: ` 0 ` ,style:We({counterReset: ` line $ { e . startLine - 1 } ` }),class:R(B(U)( ` px - 3 py - 3 leading - relaxed group - has - data - [ slot = code - block - header ] / code - block : pt - 2 group - has - data - [ slot = code - block - footer ] / code - block : pb - 2 group - data - [ size = sm ] / code - block : px - 2.5 group - data - [ size = sm ] / code - block : py - 2.5 group - data - [ size = sm ] / code - block : group - has - data - [ slot = code - block - header ] / code - block : pt - 1.5 min - h - 0 min - w - 0 scroll - fade - x scrollbar - thin overflow - auto text - start font - mono outline - none data - wrap : scroll - fade - y data - wrap : wrap - break - word data - wrap : whitespace - pre - wrap ` ,t.class))},{default:F(()=>[O(B(tt),{as: ` code ` ,"data-slot": ` code - block - code ` ,class: ` grid min - h - lh min - w - max content - start in - data - numbered : grid - cols - [ auto _1fr ] in - data - wrap : min - w - 0 ` },{default:F(()=>[(I(!0),k(H,null,A([i()],(e,t)=>(I(),k(H,{key:t},[e?(I(!0),k(H,{key:0},A(e,(e,t)=>(I(),K(yf,{key:t},{default:F(()=>[V(z(e),1)]),_:2},1024))),128)):G(n. $ slots, ` default ` ,{},void 0,void 0,1)],64))),128))]),_:3})]),_:3},8,[ ` data - wrap ` , ` data - numbered ` , ` style ` , ` class ` ]))}}),xf={"aria-live": ` polite ` ,class: ` sr - only ` },Sf=N({inheritAttrs:!1,__name: ` CodeBlockCopyButton ` ,props:{asChild:{type:Boolean},as:{default: ` button ` },value:{},variant:{default: ` ghost ` },size:{default: ` icon - xs ` },class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,{copy:n,copied:r}=Bn({copiedDuring:2e3,legacy:!0});return(i,a)=>(I(),k(H,null,[O(B(Y),W(i. $ attrs,{"data-slot": ` code - block - copy - button ` ,"data-copied":B(r)||void 0,as:e.as,"as-child":e.asChild,variant:e.variant,size:e.size,"aria-label":B(r)? ` Copied ` : ` Copy ` ,class:B(U)( ` ` ,t.class),onClick:a[0]||=e=>B(n)(t.value)}),{default:F(()=>[B(r)?(I(),K(B(Yn),{key:0})):(I(),K(B(Mc),{key:1}))]),_:1},16,[ ` data - copied ` , ` as ` , ` as - child ` , ` variant ` , ` size ` , ` aria - label ` , ` class ` ]),L( ` span ` ,xf,z(B(r)? ` Copied ` : ` ` ),1)],64))}}),Cf=N({__name: ` CodeBlockToken ` ,props:{token:{}},setup(e){return(t,n)=>(I(),k( ` span ` ,{style:We(e.token.htmlStyle),class: ` text - ( -- shiki - light ) dark : text - ( -- shiki - dark ) ` },z(e.token.content),5))}}),wf=class extends Error{constructor(e){super(e),this.name= ` ShikiError ` }};function Tf(e){return Ef(e)}function Ef(e){return Array.isArray(e)?Df(e):e instanceof RegExp?e:typeof e== ` object ` ?Of(e):e}function Df(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ef(e[n]);return t}function Of(e){let t={};for(let n in e)t[n]=Ef(e[n]);return t}function kf(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Af(e){let t=~e.lastIndexOf( ` / ` )||~e.lastIndexOf( ` \ \ ` );return t===0?e:~t===e.length-1?Af(e.substring(0,e.length-1)):e.substr(~t+1)}var jf=/ \$ ( \d +)| \$ {( \d +): \/ (downcase|upcase)}/g,Mf=class{static hasCaptures(e){return e!==null&&(jf.lastIndex=0,jf.test(e))}static replaceCaptures(e,t,n){return e.replace(jf,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]=== ` . ` ;)e=e.substring(1);switch(a){case ` downcase ` :return e.toLowerCase();case ` upcase ` :return e.toUpperCase();default:return e}}else return e})}};function Nf(e,t){return e<t?-1:+(e>t)}function Pf(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Nf(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Ff(e){return!!(/^#[0-9a-f]{6} $ /i.test(e)||/^#[0-9a-f]{8} $ /i.test(e)||/^#[0-9a-f]{3} $ /i.test(e)||/^#[0-9a-f]{4} $ /i.test(e))}function If(e){return e.replace(/[ \- \\ \{ \} \* \+ \? \| \^ \$ \. \, \[ \] \( \) \# \s ]/g, ` \ \ $ & ` )}var Lf=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Rf=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Uf(e),t)}static createFromParsedTheme(e,t){return Kf(e,t)}_cachedMatchRoot=new Lf(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Bf(e.parent,t.parentScopes));return n?new Hf(n.fontStyle,n.foreground,n.background):null}},zf=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join( ` ` )}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Bf(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r=== ` > ` ){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Vf(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Vf(
Line truncated
` )}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Pp=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Fp=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Pp(e,8),this._embeddedLanguagesMatcher=new Ip(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Pp(0,0);_getBasicScopeAttributes=new Lf(e=>new Pp(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case ` comment ` :return 1;case ` string ` :return 2;case ` regex ` :return 3;case ` meta . embedded ` :return 0}throw Error( ` Unexpected match for standard token type ! ` )}static STANDARD_TOKEN_TYPE_REGEXP=/ \b (comment|string|regex|meta \. embedded) \b /},Ip=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>If(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp( ` ^ ( ( $ { t . join ( ` )|( ` ) } ) ) ( $ | \ \ . ) ` , ` ` )}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process< ` u ` &&{}.VSCODE_TEXTMATE_DEBUG;var Lp=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Rp(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=zp(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Lp(i,!0);f()}return new Lp(i,!1);function f(){let o=Bp(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===bp){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Gp(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Op){let r=o;Gp(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof kp){let r=o;Gp(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Gp(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function zp(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof kp&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Wp(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==xp){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Gp(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Bp(e,t,n,r,i,a){let o=Vp(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Hp(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Vp(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Up(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Hp(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Up(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Up(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Wp(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Gp(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.
Line truncated
` ;let a=this.createOnigString(e),o=a.content.length,s=new nm(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Rp(this,a,i,0,t,s,!0,r);return rp(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Qp(e,t){return e=Tf(e),e.repository=e.repository||{},e.repository. $ self={ $ vscodeTextmateLocation:e. $ vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository. $ base=t||e.repository. $ self,e}var $ p=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=zf.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new zf(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new zf(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join( ` ` )}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Zf.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf( ` ` )===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},em=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)? $ p.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0), ` [ ` +e.join( ` , ` )+ ` ] ` }_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]= ` ( $ { this . ruleId } , $ { this . nameScopesList ? . toString ( ) } , $ { this . contentNameScopesList ? . toString ( ) } ) ` ,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Cp(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r= $ p.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Sp(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r, $ p.fromExtension(r,n.contentNameScopesList))}},tm=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e=== ` * ` ?(this.allowAny=!0,[]):ep(e,Yp).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>ep(e,Yp).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},nm=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._l
Line truncated
` ).find(e=>e.startsWith( ` data : ` ));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Zl.value=n.session_id),n.type=== ` delta ` &&(o+=n.text,ru.value=ru.value?{...ru.value,text:o}:null),(n.type=== ` tool ` ||n.type=== ` navigate ` )&&(a=[...a,n],ru.value=ru.value?{...ru.value,tools:a}:null),n.type=== ` ask ` &&n.ask&&(clearTimeout(l),ru.value=ru.value?{...ru.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 ` );Ql.value=!i&&n.trim()=== ` / new ` ?[]:[...Ql.value,{from: ` assistant ` ,text:o,tool_calls:a}],ru.value=null,eu.value= ` Ready ` ,await hu()}catch(e){let t=e;o&&(Ql.value=[...Ql.value,{from: ` assistant ` ,text:o,tool_calls:a}],a=[]),t.name=== ` AbortError ` &&!c?(ru.value={text: ` Turn stopped . ` ,tools:a,isError:!1,turn:r,isRetry:i},eu.value= ` Stopped ` ):(ru.value={text: ` Unable to complete that turn : $ { t . message || t } ` ,tools:a,isError:!0,turn:r?Gl(r):void 0,isRetry:i},eu.value= ` Error . Retry available . ` )}finally{clearTimeout(l),Jl=null,pu=null,tu.value=!1,Cu.after?.()}}function Pu(){eu.value= ` Stopping … ` ,Zl.value&&X.chatCancel(Zl.value).catch(()=>{}),mu()}function Fu(){ke(()=>{hu().catch(e=>{eu.value=e.message|| ` Chat unavailable ` })}),Me(()=>{mu()})}async function Iu(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 Nu({textOverride: ` 🎤 Voice message ` ,voice:{data:btoa(n),mime_type:e.type|| ` audio / webm ` }})}var Lu={class: ` grid gap - 1 p - 1 ` },Ru={key:0,class: ` text - xs text - fg - subtle ` },zu= ` _ _default _ _ ` ,Bu=N({__name: ` ChatSettings ` ,setup(e){let t=J(()=>au.value||zu),n=J(()=>{let e=iu.value.models_by_provider||{},t=Object.entries(e).filter(([,e])=>e.length);return t.length?t:[[ ` ` ,iu.value.models||[]]]});return(e,r)=>(I(),k( ` div ` ,Lu,[B(eu)=== ` Ready ` ?P( ` ` ,!0):(I(),k( ` span ` ,Ru,z(B(eu)),1)),O(B(Rn),{"model-value":t.value,"onUpdate:modelValue":r[0]||=e=>B(Su)(e===zu? ` ` :String(e?? ` ` ))},{default:F(()=>[O(B(Fn),{size: ` sm ` ,class: ` w - full ` ,"aria-label": ` Model ` },{default:F(()=>[O(B(zn))]),_:1}),O(B(In),null,{default:F(()=>[O(B(Pn),{value:zu},{default:F(()=>[...r[1]||=[V( ` Default ` ,-1)]]),_:1}),(I(!0),k(H,null,A(n.value,([e,t])=>(I(),K(B(Mn),{key:e},{default:F(()=>[e?(I(),K(B(Ln),{key:0},{default:F(()=>[V(z(e),1)]),_:2},1024)):P( ` ` ,!0),(I(!0),k(H,null,A(t,e=>(I(),K(B(Pn),{key:e,value:e},{default:F(()=>[V(z(e),1)]),_:2},1032,[ ` value ` ]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[ ` model - value ` ])]))}}),Vu=N({__name: ` ChatSessionActions ` ,setup(e){let t=q(!1);du(t);function n(e){t.value=!1,bu(e)}function r(e,n){t.value=!1,xu(e,n)}return(e,i)=>(I(),K(B(hn),{open:t.value,"onUpdate:open":i[5]||=e=>t.value=e},{default:F(()=>[O(B(xn),{"as-child": ` ` },{default:F(()=>[O(B(Y),{variant: ` ghost ` ,size: ` icon - sm ` ,class: ` flex - none ` ,"aria-label": ` More ` ,title: ` More ` },{default:F(()=>[O(B(Fc))]),_:1})]),_:1}),O(B(vn),{align: ` end ` ,class: ` grid w - 64 gap - 0.5 p - 1 ` },{default:F(()=>[B(Zl)?(I(),k(H,{key:0},[O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[0]||=e=>n( ` / retry ` )},{default:F(()=>[O(B(ml),{"data-icon": ` inline - start ` }),i[6]||=V( ` Retry ` ,-1)]),_:1}),O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[1]||=e=>n( ` / undo ` )},{default:F(()=>[O(B(Ol),{"data-icon": ` inline - start ` }),i[7]||=V( ` Undo ` ,-1)]),_:1}),O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[2]||=e=>r( ` / title ` , ` Session title ` )},{default:F(()=>[O(B(cl),{"data-icon": ` inline - start ` }),i[8]||=V( ` Rename ` ,-1)]),_:1}),O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[3]||=e=>r( ` / branch ` , ` Branch name ( optional ) ` )},{default:F(()=>[O(B(Uc),{"data-icon": ` inline - start ` }),i[9]||=V( ` Branch ` ,-1)]),_:1}),O(B(Y),{variant: ` ghost ` ,size: ` sm ` ,class: ` justify - start ` ,onClick:i[4]||=e=>n( ` / compress -- preview ` )},{default:F(()=>[O(B(bl),{"data-icon": ` inline - start ` }),i[10]||=V( ` Preview compression ` ,-1)]),_:1}),O(B(Fl),{class: ` my - 1 ` })],64)):P( ` ` ,!0),O(Bu)]),_:1})]),_:1},8,[ ` open ` ]))}}),Hu=new Intl.DateTimeFormat(void 0,{month: ` short ` ,day: ` numeric ` ,hour: ` numeric ` ,minute: ` 2 - digit ` });function Uu(e){return e.title||e.branch_name||(e.created_at?Hu.format(new Date(e.created_at)): ` New chat ` )}var Wu={class: ` min - w - 0 flex - 1 ` },Gu=N({__name: ` ChatSessionList ` ,setup(e){return(e,t)=>(I(),k( ` div ` ,Wu,[O(B(Rn),{"model-value":B(Zl),disabled:!B(Xl).length,"onUpdate:modelValue":t[0]||=e=>B(gu)(String(e))},{default:F(()=>[O(B(Fn),{size: ` sm ` ,class: ` w - full ` ,"aria-label": ` Conversation ` },{default:F(()=>[O(B(zn),{placeholder: ` No conversations yet ` })]),_:1}),O(B(In),null,{default:F(()=>[O(B(Mn),null,{default:F(()=>[(I(!0),k(H,null,A(B(Xl),e=>(I(),K(B(Pn),{key:e.session_id,value:e.session_id},{default:F(()=>[V(z(B(Uu)(e)),1)]),_:2},1032,[ ` value ` ]))),128))]),_:1})]),_:1})]),_:1},8,[ ` model - value ` , ` disabled ` ])]))}}),Ku={class: ` flex items - center gap - 1 border - b px - 3 py - 2 ` },qu=N({__name: ` ChatBar ` ,setup(e){return(e,t)=>(I(),k( ` div ` ,Ku,[O(Gu),O(B(Y),{variant: ` ghost ` ,size: ` icon - sm ` ,class: ` flex - none ` ,title: ` New chat ` ,"aria-la
Line truncated
` ))],64)):G(n. $ slots, ` default ` ,{},void 0,void 0,1)])],10,S f))}}),T f=N({__name: ` CodeBlockContent ` ,props:{wrap:{type:Boolean,default:!1},lineNumbers:{type:Boolean,default:!1},startLine:{default:1},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=se();function r(e){let t= ` ` ;for(let n of e)if(n.type!==z e){if(n.type===F e)t+=n.children;else if(n.type===H&&Array.isArray(n.children)){let e=r(n.children);if(e===null)return null;t+=e}else return null}return t}function i(){if(!t.lineNumbers)return null;let e=r(n.default?.()??[]);return e===null?null:e.replace(/ \n $ /, ` ` ).split( `
` )}return(n,r)=>(I(),K(B(et),{as: ` pre ` ,"data-slot": ` code - block - content ` ,"data-wrap":e.wrap||void 0,"data-numbered":e.lineNumbers||void 0,dir: ` ltr ` ,tabindex: ` 0 ` ,style:Ue({counterReset: ` line $ { e . startLine - 1 } ` }),class:R(B(U)( ` px - 3 py - 3 leading - relaxed group - has - data - [ slot = code - block - header ] / code - block : pt - 2 group - has - data - [ slot = code - block - footer ] / code - block : pb - 2 group - data - [ size = sm ] / code - block : px - 2.5 group - data - [ size = sm ] / code - block : py - 2.5 group - data - [ size = sm ] / code - block : group - has - data - [ slot = code - block - header ] / code - block : pt - 1.5 min - h - 0 min - w - 0 scroll - fade - x scrollbar - thin overflow - auto text - start font - mono outline - none data - wrap : scroll - fade - y data - wrap : wrap - break - word data - wrap : whitespace - pre - wrap ` ,t.class))},{default:F(()=>[O(B(et),{as: ` code ` ,"data-slot": ` code - block - code ` ,class: ` grid min - h - lh min - w - max content - start in - data - numbered : grid - cols - [ auto _1fr ] in - data - wrap : min - w - 0 ` },{default:F(()=>[(I(!0),k(H,null,A([i()],(e,t)=>(I(),k(H,{key:t},[e?(I(!0),k(H,{key:0},A(e,(e,t)=>(I(),K(wf,{key:t},{default:F(()=>[V(z(e),1)]),_:2},1024))),128)):G(n. $ slots, ` default ` ,{},void 0,void 0,1)],64))),128))]),_:3})]),_:3},8,[ ` data - wrap ` , ` data - numbered ` , ` style ` , ` class ` ]))}}),Ef={"aria-live": ` polite ` ,class: ` sr - only ` },Df=N({inheritAttrs:!1,__name: ` CodeBlockCopyButton ` ,props:{asChild:{type:Boolean},as:{default: ` button ` },value:{},variant:{default: ` ghost ` },size:{default: ` icon - xs ` },class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,{copy:n,copied:r}=Vn({copiedDuring:2e3,legacy:!0});return(i,a)=>(I(),k(H,null,[O(B(Y),W(i. $ attrs,{"data-slot": ` code - block - copy - button ` ,"data-copied":B(r)||void 0,as:e.as,"as-child":e.asChild,variant:e.variant,size:e.size,"aria-label":B(r)? ` Copied ` : ` Copy ` ,class:B(U)( ` ` ,t.class),onClick:a[0]||=e=>B(n)(t.value)}),{default:F(()=>[B(r)?(I(),K(B(Xn),{key:0})):(I(),K(B(Mc),{key:1}))]),_:1},16,[ ` data - copied ` , ` as ` , ` as - child ` , ` variant ` , ` size ` , ` aria - label ` , ` class ` ]),L( ` span ` ,Ef,z(B(r)? ` Copied ` : ` ` ),1)],64))}}),Of=N({__name: ` CodeBlockToken ` ,props:{token:{}},setup(e){return(t,n)=>(I(),k( ` span ` ,{style:Ue(e.token.htmlStyle),class: ` text - ( -- shiki - light ) dark : text - ( -- shiki - dark ) ` },z(e.token.content),5))}}),kf=class extends Error{constructor(e){super(e),this.name= ` ShikiError ` }};function Af(e){return jf(e)}function jf(e){return Array.isArray(e)?Mf(e):e instanceof RegExp?e:typeof e== ` object ` ?Nf(e):e}function Mf(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=jf(e[n]);return t}function Nf(e){let t={};for(let n in e)t[n]=jf(e[n]);return t}function Pf(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ff(e){let t=~e.lastIndexOf( ` / ` )||~e.lastIndexOf( ` \ \ ` );return t===0?e:~t===e.length-1?Ff(e.substring(0,e.length-1)):e.substr(~t+1)}var If=/ \$ ( \d +)| \$ {( \d +): \/ (downcase|upcase)}/g,Lf=class{static hasCaptures(e){return e!==null&&(If.lastIndex=0,If.test(e))}static replaceCaptures(e,t,n){return e.replace(If,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]=== ` . ` ;)e=e.substring(1);switch(a){case ` downcase ` :return e.toLowerCase();case ` upcase ` :return e.toUpperCase();default:return e}}else return e})}};function Rf(e,t){return e<t?-1:+(e>t)}function zf(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Rf(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Bf(e){return!!(/^#[0-9a-f]{6} $ /i.test(e)||/^#[0-9a-f]{8} $ /i.test(e)||/^#[0-9a-f]{3} $ /i.test(e)||/^#[0-9a-f]{4} $ /i.test(e))}function Vf(e){return e.replace(/[ \- \\ \{ \} \* \+ \? \| \^ \$ \. \, \[ \] \( \) \# \s ]/g, ` \ \ $ & ` )}var Hf=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Uf=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Jf(e),t)}static createFromParsedTheme(e,t){return Zf(e,t)}_cachedMatchRoot=new Hf(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Gf(e.parent,t.parentScopes));return n?new qf(n.fontStyle,n.foreground,n.background):null}},Wf=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join( ` ` )}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Gf(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r=== ` > ` ){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Kf(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Kf(
Line truncated
` )}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},zp=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Bp=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new zp(e,8),this._embeddedLanguagesMatcher=new Vp(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new zp(0,0);_getBasicScopeAttributes=new Hf(e=>new zp(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case ` comment ` :return 1;case ` string ` :return 2;case ` regex ` :return 3;case ` meta . embedded ` :return 0}throw Error( ` Unexpected match for standard token type ! ` )}static STANDARD_TOKEN_TYPE_REGEXP=/ \b (comment|string|regex|meta \. embedded) \b /},Vp=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Vf(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp( ` ^ ( ( $ { t . join ( ` )|( ` ) } ) ) ( $ | \ \ . ) ` , ` ` )}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process< ` u ` &&{}.VSCODE_TEXTMATE_DEBUG;var Hp=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Up(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Wp(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Hp(i,!0);f()}return new Hp(i,!1);function f(){let o=Gp(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Tp){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Xp(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Np){let r=o;Xp(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Pp){let r=o;Xp(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Xp(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Wp(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Pp&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Yp(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Ep){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Xp(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Gp(e,t,n,r,i,a){let o=Kp(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=qp(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Kp(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Jp(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function qp(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Jp(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Jp(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Yp(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Xp(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.
Line truncated
` ;let a=this.createOnigString(e),o=a.content.length,s=new sm(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Up(this,a,i,0,t,s,!0,r);return cp(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function rm(e,t){return e=Af(e),e.repository=e.repository||{},e.repository. $ self={ $ vscodeTextmateLocation:e. $ vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository. $ base=t||e.repository. $ self,e}var im=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Wf.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Wf(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Wf(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join( ` ` )}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),np.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf( ` ` )===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},am=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?im.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0), ` [ ` +e.join( ` , ` )+ ` ] ` }_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]= ` ( $ { this . ruleId } , $ { this . nameScopesList ? . toString ( ) } , $ { this . contentNameScopesList ? . toString ( ) } ) ` ,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Op(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=im.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Dp(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,im.fromExtension(r,n.contentNameScopesList))}},om=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e=== ` * ` ?(this.allowAny=!0,[]):ap(e,em).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>ap(e,em).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},sm=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._l
Line truncated
\ f \ r & / = > ` . s p l i t ( ` ` ) , `
\ f \ r " & ' /= > \ ` ` . split ( ` ` ) ] , [ ` \0
\ f \ r " & ' / <= > ` .split( ` ` ), ` \ 0
@@ -14,10 +14,10 @@ import{A as e,C as t,D as n,E as r,F as i,I as a,L as o,M as s,N as c,P as l,R a
\ f \ r & > ` .split( ` ` ), ` \ 0
\ f \ r " & ' <= > \ ` ` . split ( ` ` ) ] , [ ` \0
\ f \ r " & ' <= > \ ` ` . split ( ` ` ) , ` \0
\ f \ r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`" & '\``.split(``)],[`\0&' ` .split( ` ` ), ` \ 0 "&'\``.split(``)]],double:[[`" & ` .split( ` ` ), ` "&'\``.split(``)],[`\0" & ` .split( ` ` ), ` \ 0 "&'\``.split(``)]]};function Lg(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Eh);let l=Rg(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Ag(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`" ` &&c!== ` '`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!mg(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Rg(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=zg(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`' ` &&(n[r]+= ` ` )}return n.join( ` ` )}function zg(e,t,n){let r=Sh(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space=== ` html ` ?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n=== ` ` )?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!= ` string ` ||n===r.attribute||n=== ` ` )&&(n=!!n),n==null||n===!1||typeof n== ` number ` &&Number.isNaN(n))return ` ` ;let c=Xh(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Ig.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?rg:ig)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Xh(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ig.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&ng(n,o)>ng(n,e.alternative)&&(o=e.alternative),s=o+Xh(n,Object.assign({},e.settings.characterReferences,{subset:(o=== ` '`?Ig.single:Ig.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Bg=[`<`,`&`];function Vg(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Xh(e.value,Object.assign({},r.settings.characterReferences,{subset:Bg}))}function Hg(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Vg(e,t,n,r)}function Ug(e,t,n,r){return r.all(e)}var Wg=Oh(`type`,{invalid:Gg,unknown:Kg,handlers:{comment:eg,doctype:tg,element:Lg,raw:Hg,root:Ug,text:Vg}});function Gg(e){throw Error("Expected node, not `"+e+"`")}function Kg(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var qg={},Jg={},Yg=[];function Xg(e,t){let n=t||qg,r=n.quote||`"`,i=r===`"`?`' ` : ` "`;if(r!==`" ` &&r!== ` '`)throw Error("Invalid quote `"+r+"`, expected `' ` or ` \ "`" ) ; return { one : Zg , all : Qg , settings : { omitOptionalTags : n . omitOptionalTags || ! 1 , allowParseErrors : n . allowParseErrors || ! 1 , allowDangerousCharacters : n . allowDangerousCharacters || ! 1 , quoteSmart : n . quoteSmart || ! 1 , preferUnquoted : n . preferUnquoted || ! 1 , tightAttributes : n . tightAttributes || ! 1 , upperDoctype : n . upperDoctype || ! 1 , tightDoctype : n . tightDoctype || ! 1 , bogusComments : n . bogusComments || ! 1 , tightCommaSeparatedLists : n . tightCommaSeparatedLists || ! 1 , tightSelfClosing : n . tightSelfClosing || ! 1 , collapseEmptyAttributes : n . collapseEmptyAttributes || ! 1 , allowDangerousHtml : n . allowDangerousHtml || ! 1 , voids : n . voids || qm , characterReferences : n . characterReferences || Jg , closeSelfClosing : n . closeSelfClosing || ! 1 , closeEmptyElements : n . closeEmptyElements || ! 1 } , schema : n . space === ` svg ` ? Eh : Th , quote : r , alternative : i } . one ( Array . isArray ( e ) ? { type : ` root ` , children : e } : e , void 0 , void 0 ) } function Zg ( e , t , n ) { return Wg ( e , t , n , this ) } function Qg ( e ) { let t = [ ] , n = e && e . children || Yg , r = - 1 ; for ( ; ++ r < n . length ; ) t [ r ] = this . one ( n [ r ] , r , e ) ; return t . join ( ` ` ) } var $g = /\s+/g ; function e _ ( e , t ) { if ( ! t ) return e ; e . properties || = { } , e . properties . class || = [ ] , typeof e . properties . class == ` string ` && ( e . properties . class = e . properties . class . split ( $g ) ) , Array . isArray ( e . properties . class ) || ( e . properties . class = [ ] ) ; let n = Array . isArray ( t ) ? t : t . split ( $g ) ; for ( let t of n ) t && ! e . properties . class . includes ( t ) && e . properties . class . push ( t ) ; return e } function t _ ( e ) { let t = hm ( e , ! 0 ) . map ( ( [ e ] ) => e ) ; function n ( n ) { if ( n === e . length ) return { line : t . length - 1 , character : t . at ( - 1 ) . length } ; let r = n , i = 0 ; for ( let e of t ) { if ( r < e . length ) break ; r -= e . length , i ++ } return { line : i , character : r } } function r ( e , n ) { let r = 0 ; for ( let n = 0 ; n < e ; n ++ ) r += t [ n ] . length ; return r += n , r } return { lines : t , indexToPos : n , posToIndex : r } } var n _ = [ ` color ` , ` background-color ` ] ; function r _ ( e , t ) { let n = 0 , r = [ ] ; for ( let i of t ) i > n && r . push ( { ... e , content : e . content . slice ( n , i ) , offset : e . offset + n } ) , n = i ; return n < e . content . length && r . push ( { ... e , content : e . content . slice ( n ) , offset : e . offset + n } ) , r } function i _ ( e , t ) { let n = 0 , r = e . length ; for ( ; n < r ; ) { let i = n + ( r - n >> 1 ) ; e [ i ] <= t ? n = i + 1 : r = i } return n } function a _ ( e , t ) { let n = [ ... t instanceof Set ? t : new Set ( t ) ] . sort ( ( e , t ) => e - t ) ; return n . length ? e . map ( e => e . flatMap ( e => { let t = e . offset + e . content . length , r = i _ ( n , e . offset ) , i = r ; for ( ; i < n . length && n [ i ] < t ; ) i ++ ; if ( r === i ) return e ; let a = n . slice ( r Line truncated
` }));let n={type: ` element ` ,tagName: ` span ` ,properties:{class: ` line ` },children:[]},r=0;for(let a of e){let e={type: ` element ` ,tagName: ` span ` ,properties:{...a.htmlAttrs},children:[{type: ` text ` ,value:a.content}]},c=c _(a.htmlStyle||s _(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s=== ` inline ` ?o.children.push(e):s=== ` classic ` &&n.children.push(e),r+=a.content.length}if(s=== ` classic ` ){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s=== ` inline ` &&f.push(n)}),s=== ` classic ` ){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s=== ` inline ` ){let e=[],t={type: ` element ` ,tagName: ` span ` ,properties:{class: ` line ` },children:[]};for(let n of o.children)n.type=== ` element ` &&n.tagName=== ` br ` ?(e.push(t),t={type: ` element ` ,tagName: ` span ` ,properties:{class: ` line ` },children:[]}):(n.type=== ` element ` ||n.type=== ` text ` )&&t.children.push(n);e.push(t);let n={type: ` element ` ,tagName: ` code ` ,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type: ` element ` ,tagName: ` br ` ,properties:{},children:[]});let t=n.children[e];t.type=== ` element ` &&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&k m(m,r),m}function F _(e){return e.map(e=>{let t=[],n= ` ` ,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&G f.Underline||i.fontStyle&G f.Strikethrough));o&&j _.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n= ` ` ):t.push(i)}),t})}function I _(e){return e.map(e=>e.flatMap(e=>{if(j _.test(e.content))return e;let t=e.content.match(M _);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function L _(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=c _(e.htmlStyle||s _(e)),i=c _(n.htmlStyle||s _(n)),a=e.fontStyle&&(e.fontStyle&G f.Underline||e.fontStyle&G f.Strikethrough),o=n.fontStyle&&(n.fontStyle&G f.Underline||n.fontStyle&G f.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var R _=Xg ;function z _(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>N _(e,t,n),codeToTokens:(t,n)=>k _(e,t,n)},i=R _(N _(e,t,n,r));for(let e of p _(n))i=e.postprocess?.call(r,i,n)||i;return i}async function B _(e){let t=await D m(e);return{getLastGrammarState:(...e)=>L m(t,...e),codeToTokensBase:(e,n)=>O _(t,e,n),codeToTokensWithThemes:(e,n)=>G m(t,e,n),codeToTokens:(e,n)=>k _(t,e,n),codeToHast:(e,n)=>N _(t,e,n),codeToHtml:(e,n)=>z _(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var V _=4294967295;function H _(e){return!e.sticky&&!e.rawOptions?.strategy}function U _(e,t){return{index:e,captureIndices:t.map(e=>e==null?{start:V _,end:V _,length:0}:{start:e[0],end:e[1],length:e[1]-e[0]})}}var W _=class{patterns;options;regexps;lastSearches;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option ` regexConstructor ` is not provided");this.regexps=e.map(e=>{if(typeof e!= ` string ` )return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}}),this.lastSearches=this.regexps.map(e=>e&&H _(e)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,n){let r=typeof e== ` string ` ?e:e.content,i=typeof e== ` string ` ?0:e.id||0,a=-1,o=0,s=null;for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{let c=i?this.lastSearches[e]:null,l,u;if(c&&c.strId===i&&c.searchedFrom<=t&&(c.matchIndex===-1||c.matchIndex>=t))l=c.matchIndex,u=c.indices;else{n.lastIndex=t;let e=n.exec(r);l=e?e.index:-1,u=e?e.indices:null,c&&(c.strId=i,c.searchedFrom=t,c.matchIndex=l,c.indices=u)}if(l===-1)continue;if(l===t)return U _(e,u);(a===-1||l<o)&&(a=e,o=l,s=u)}catch(e){if(this.options.forgiving)continue;throw e}}return a===-1?null:U _(a,s)}},G _=0;function K _(e){return{content:e,id:++G _}}function q _(e){if([...e].length!==1)throw Error( ` Expected "${e}" to be a single code point ` );return e.codePointAt(0)}function J _(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Y_ =new Set([ ` alnum ` , ` alpha ` , ` ascii ` , ` blank ` , ` cntrl ` , ` digit ` , ` graph ` , ` lower ` , ` print ` , ` punct ` , ` space ` , ` upper ` , ` word ` , ` xdigit ` ]),X_ =String.raw;function Z_ (e,t){if(e==null)throw Error(t?? ` Value expected ` );return e}var Q_=X_ ` \ [ \ ^ ? ` , $ _ =` c . ? | C ( ? : - . ? ) ? | $ { X _ ` [pP] \{ (?: \^ ?[- \x 20_]*[A-Za-z][- \x 20 \w ]* \} )? ` } | $ { X _ ` x[89A-Fa-f] \p {AHex}(?: \\ x[89A-Fa-f] \p {AHex})* ` } | $ { X _ ` u(?: \p {AHex}{4})? | x \{ [^ \} ]* \} ? | x \p {AHex}{0,2} ` } | $ { X _ ` o \{ [^ \} ]* \} ? ` } | $ { X _ ` \d {1,3} ` } ` ,e v=/[?*+][?+]?| \{ (?: \d +(?:, \d *)?|, \d +) \} \? ?/,t v=new RegExp(X_ `
\ f \ r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`" & '\``.split(``)],[`\0&' ` .split( ` ` ), ` \ 0 "&'\``.split(``)]],double:[[`" & ` .split( ` ` ), ` "&'\``.split(``)],[`\0" & ` .split( ` ` ), ` \ 0 "&'\``.split(``)]]};function Hg(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=jh);let l=Ug(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Fg(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`" ` &&c!== ` '`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!yg(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Ug(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Wg(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`' ` &&(n[r]+= ` ` )}return n.join( ` ` )}function Wg(e,t,n){let r=Dh(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space=== ` html ` ?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n=== ` ` )?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!= ` string ` ||n===r.attribute||n=== ` ` )&&(n=!!n),n==null||n===!1||typeof n== ` number ` &&Number.isNaN(n))return ` ` ;let c=tg(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Vg.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?cg:lg)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=tg(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Vg.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&sg(n,o)>sg(n,e.alternative)&&(o=e.alternative),s=o+tg(n,Object.assign({},e.settings.characterReferences,{subset:(o=== ` '`?Vg.single:Vg.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Gg=[`<`,`&`];function Kg(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:tg(e.value,Object.assign({},r.settings.characterReferences,{subset:Gg}))}function qg(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Kg(e,t,n,r)}function Jg(e,t,n,r){return r.all(e)}var Yg=Nh(`type`,{invalid:Xg,unknown:Zg,handlers:{comment:ag,doctype:og,element:Hg,raw:qg,root:Jg,text:Kg}});function Xg(e){throw Error("Expected node, not `"+e+"`")}function Zg(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Qg={},$g={},e_=[];function t_(e,t){let n=t||Qg,r=n.quote||`"`,i=r===`"`?`' ` : ` "`;if(r!==`" ` &&r!== ` '`)throw Error("Invalid quote `"+r+"`, expected `' ` or ` \ "`" ) ; return { one : n _ , all : r _ , settings : { omitOptionalTags : n . omitOptionalTags || ! 1 , allowParseErrors : n . allowParseErrors || ! 1 , allowDangerousCharacters : n . allowDangerousCharacters || ! 1 , quoteSmart : n . quoteSmart || ! 1 , preferUnquoted : n . preferUnquoted || ! 1 , tightAttributes : n . tightAttributes || ! 1 , upperDoctype : n . upperDoctype || ! 1 , tightDoctype : n . tightDoctype || ! 1 , bogusComments : n . bogusComments || ! 1 , tightCommaSeparatedLists : n . tightCommaSeparatedLists || ! 1 , tightSelfClosing : n . tightSelfClosing || ! 1 , collapseEmptyAttributes : n . collapseEmptyAttributes || ! 1 , allowDangerousHtml : n . allowDangerousHtml || ! 1 , voids : n . voids || Qm , characterReferences : n . characterReferences || $g , closeSelfClosing : n . closeSelfClosing || ! 1 , closeEmptyElements : n . closeEmptyElements || ! 1 } , schema : n . space === ` svg ` ? jh : Ah , quote : r , alternative : i } . one ( Array . isArray ( e ) ? { type : ` root ` , children : e } : e , void 0 , void 0 ) } function n _ ( e , t , n ) { return Yg ( e , t , n , this ) } function r _ ( e ) { let t = [ ] , n = e && e . children || e _ , r = - 1 ; for ( ; ++ r < n . length ; ) t [ r ] = this . one ( n [ r ] , r , e ) ; return t . join ( ` ` ) } var i _ = /\s+/g ; function a _ ( e , t ) { if ( ! t ) return e ; e . properties || = { } , e . properties . class || = [ ] , typeof e . properties . class == ` string ` && ( e . properties . class = e . properties . class . split ( i _ ) ) , Array . isArray ( e . properties . class ) || ( e . properties . class = [ ] ) ; let n = Array . isArray ( t ) ? t : t . split ( i _ ) ; for ( let t of n ) t && ! e . properties . class . includes ( t ) && e . properties . class . push ( t ) ; return e } function o _ ( e ) { let t = bm ( e , ! 0 ) . map ( ( [ e ] ) => e ) ; function n ( n ) { if ( n === e . length ) return { line : t . length - 1 , character : t . at ( - 1 ) . length } ; let r = n , i = 0 ; for ( let e of t ) { if ( r < e . length ) break ; r -= e . length , i ++ } return { line : i , character : r } } function r ( e , n ) { let r = 0 ; for ( let n = 0 ; n < e ; n ++ ) r += t [ n ] . length ; return r += n , r } return { lines : t , indexToPos : n , posToIndex : r } } var s _ = [ ` color ` , ` background-color ` ] ; function c _ ( e , t ) { let n = 0 , r = [ ] ; for ( let i of t ) i > n && r . push ( { ... e , content : e . content . slice ( n , i ) , offset : e . offset + n } ) , n = i ; return n < e . content . length && r . push ( { ... e , content : e . content . slice ( n ) , offset : e . offset + n } ) , r } function l _ ( e , t ) { let n = 0 , r = e . length ; for ( ; n < r ; ) { let i = n + ( r - n >> 1 ) ; e [ i ] <= t ? n = i + 1 : r = i } return n } function u _ ( e , t ) { let n = [ ... t instanceof Set ? t : new Set ( t ) ] . sort ( ( e , t ) => e - t ) ; return n . length ? e . map ( e => e . flatMap ( e => { let t = e . offset + e . content . length , r = l _ ( n , e . offset ) , i = r ; for ( ; i < n . length && n [ i ] < t ; ) i ++ ; if ( r === i ) return e ; let a = n . slice ( r Line truncated
` }));let n={type: ` element ` ,tagName: ` span ` ,properties:{class: ` line ` },children:[]},r=0;for(let a of e){let e={type: ` element ` ,tagName: ` span ` ,properties:{...a.htmlAttrs},children:[{type: ` text ` ,value:a.content}]},c=p _(a.htmlStyle||f _(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s=== ` inline ` ?o.children.push(e):s=== ` classic ` &&n.children.push(e),r+=a.content.length}if(s=== ` classic ` ){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s=== ` inline ` &&f.push(n)}),s=== ` classic ` ){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s=== ` inline ` ){let e=[],t={type: ` element ` ,tagName: ` span ` ,properties:{class: ` line ` },children:[]};for(let n of o.children)n.type=== ` element ` &&n.tagName=== ` br ` ?(e.push(t),t={type: ` element ` ,tagName: ` span ` ,properties:{class: ` line ` },children:[]}):(n.type=== ` element ` ||n.type=== ` text ` )&&t.children.push(n);e.push(t);let n={type: ` element ` ,tagName: ` code ` ,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type: ` element ` ,tagName: ` br ` ,properties:{},children:[]});let t=n.children[e];t.type=== ` element ` &&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&P m(m,r),m}function B _(e){return e.map(e=>{let t=[],n= ` ` ,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&X f.Underline||i.fontStyle&X f.Strikethrough));o&&I _.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n= ` ` ):t.push(i)}),t})}function V _(e){return e.map(e=>e.flatMap(e=>{if(I _.test(e.content))return e;let t=e.content.match(L _);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function H _(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=p _(e.htmlStyle||f _(e)),i=p _(n.htmlStyle||f _(n)),a=e.fontStyle&&(e.fontStyle&X f.Underline||e.fontStyle&X f.Strikethrough),o=n.fontStyle&&(n.fontStyle&X f.Underline||n.fontStyle&X f.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var U _=t_ ;function W _(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>R _(e,t,n),codeToTokens:(t,n)=>P _(e,t,n)},i=U _(R _(e,t,n,r));for(let e of v _(n))i=e.postprocess?.call(r,i,n)||i;return i}async function G _(e){let t=await M m(e);return{getLastGrammarState:(...e)=>H m(t,...e),codeToTokensBase:(e,n)=>N _(t,e,n),codeToTokensWithThemes:(e,n)=>X m(t,e,n),codeToTokens:(e,n)=>P _(t,e,n),codeToHast:(e,n)=>R _(t,e,n),codeToHtml:(e,n)=>W _(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var K _=4294967295;function q _(e){return!e.sticky&&!e.rawOptions?.strategy}function J _(e,t){return{index:e,captureIndices:t.map(e=>e==null?{start:K _,end:K _,length:0}:{start:e[0],end:e[1],length:e[1]-e[0]})}}var Y _=class{patterns;options;regexps;lastSearches;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option ` regexConstructor ` is not provided");this.regexps=e.map(e=>{if(typeof e!= ` string ` )return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}}),this.lastSearches=this.regexps.map(e=>e&&q _(e)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,n){let r=typeof e== ` string ` ?e:e.content,i=typeof e== ` string ` ?0:e.id||0,a=-1,o=0,s=null;for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{let c=i?this.lastSearches[e]:null,l,u;if(c&&c.strId===i&&c.searchedFrom<=t&&(c.matchIndex===-1||c.matchIndex>=t))l=c.matchIndex,u=c.indices;else{n.lastIndex=t;let e=n.exec(r);l=e?e.index:-1,u=e?e.indices:null,c&&(c.strId=i,c.searchedFrom=t,c.matchIndex=l,c.indices=u)}if(l===-1)continue;if(l===t)return J _(e,u);(a===-1||l<o)&&(a=e,o=l,s=u)}catch(e){if(this.options.forgiving)continue;throw e}}return a===-1?null:J _(a,s)}},X _=0;function Z _(e){return{content:e,id:++X _}}function Q _(e){if([...e].length!==1)throw Error( ` Expected "${e}" to be a single code point ` );return e.codePointAt(0)}function $ _(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var ev =new Set([ ` alnum ` , ` alpha ` , ` ascii ` , ` blank ` , ` cntrl ` , ` digit ` , ` graph ` , ` lower ` , ` print ` , ` punct ` , ` space ` , ` upper ` , ` word ` , ` xdigit ` ]),tv =String.raw;function nv (e,t){if(e==null)throw Error(t?? ` Value expected ` );return e}var rv=tv ` \ [ \ ^ ? ` ,iv = ` c . ? | C ( ? : - . ? ) ? | $ { tv ` [pP] \{ (?: \^ ?[- \x 20_]*[A-Za-z][- \x 20 \w ]* \} )? ` } | $ { tv ` x[89A-Fa-f] \p {AHex}(?: \\ x[89A-Fa-f] \p {AHex})* ` } | $ { tv ` u(?: \p {AHex}{4})? | x \{ [^ \} ]* \} ? | x \p {AHex}{0,2} ` } | $ { tv ` o \{ [^ \} ]* \} ? ` } | $ { tv ` \d {1,3} ` } ` ,a v=/[?*+][?+]?| \{ (?: \d +(?:, \d *)?|, \d +) \} \? ?/,o v=new RegExp(tv `
\ \ ( ? :
$ { $ _ }
$ { iv }
| [ gk ] < [ ^ > ] * > ?
| [ gk ] '[^' ] * ' ?
| .
@@ -34,20 +34,20 @@ import{A as e,C as t,D as n,E as r,F as i,I as a,L as o,M as s,N as c,P as l,R a
) ?
| \ * [ ^ \ ) ] * \ ) ?
) ?
| ( ? : $ { ev . source } ) +
| $ { Q _ }
| ( ? : $ { av . source } ) +
| $ { rv }
| .
` .replace(/ \s +/g, ` ` ), ` gsu ` ),n v=new RegExp(X_ `
` .replace(/ \s +/g, ` ` ), ` gsu ` ),s v=new RegExp(tv `
\ \ ( ? :
$ { $ _ }
$ { iv }
| .
)
| \ [ : ( ? : \ ^ ? \ p { Alpha } + | \ ^ ) : \ ]
| $ { Q _ }
| $ { rv }
| &&
| .
` .replace(/ \s +/g, ` ` ), ` gsu ` );function r v(e,t={}){let n={flags: ` ` ,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!= ` string ` )throw Error( ` String expected as pattern ` );let r=N v(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(t v.lastIndex=0;s=t v.exec(e);){let t=i v(a,e,s[0],t v.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(t v.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type=== ` GroupOpen ` ).forEach(e=>{e.kind=== ` capturing ` ?e.number=++l:e.raw=== ` ( ` &&c.push(e)}),l||c.forEach((e,t)=>{e.kind= ` capturing ` ,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type=== ` EscapedNumber ` ?F v(e,u):e).flat(),flags:r}}function i v(e,t,n,r){let[i,a]=n;if(n=== ` [ ` ||n=== ` [ ^ ` ){let e=a v(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i=== ` \ \ ` ){if( ` AbBGyYzZ ` .includes(a))return{token:l v(n,n)};if(/^ \\ g[<']/.test(n)){if(!/^ \\ g(?:<[^>]+>|'[^']+') $ /.test(n))throw Error( ` Invalid group name "${n}" ` );return{token:C v(n)}}if(/^ \\ k[<']/.test(n)){if(!/^ \\ k(?:<[^>]+>|'[^']+') $ /.test(n))throw Error( ` Invalid group name "${n}" ` );return{token:u v(n)}}if(a=== ` K ` )return{token:_ v( ` keep ` ,n)};if(a=== ` N ` ||a=== ` R ` )return{token:g v( ` newline ` ,n,{negate:a=== ` N ` })};if(a=== ` O ` )return{token:g v( ` any ` ,n)};if(a=== ` X ` )return{token:g v( ` text _segment ` ,n)};let e=s v(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i=== ` ( ` ){if(a=== ` * ` )return{token:O v(n)};if(n=== ` ( ? { ` )throw Error( ` Unsupported callout "${n}" ` );if(n.startsWith( ` ( ? # ` )){if(t[r]!== ` ) ` )throw Error( ` Unclosed comment group "(?#" ` );return{lastIndex:r+1}}if(/^ \( \? [-imx]+[:)] $ /.test(n))return{token:D v(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n=== ` ( ` &&!e.captureGroup||n=== ` ( ? : ` )return{token:b v( ` group ` ,n)};if(n=== ` ( ? > ` )return{token:b v( ` atomic ` ,n)};if(n=== ` ( ? = ` ||n=== ` ( ? ! ` ||n=== ` ( ? <= ` ||n=== ` ( ? < ! ` )return{token:b v(n[2]=== ` < ` ? ` lookbehind ` : ` lookahead ` ,n,{negate:n.endsWith( ` ! ` )})};if(n=== ` ( ` &&e.captureGroup||n.startsWith( ` ( ? < ` )&&n.endsWith( ` > ` )||n.startsWith( ` ( ? '`)&&n.endsWith(`' ` ))return{token:b v( ` capturing ` ,n,{...n!== ` ( ` &&{name:n.slice(3,-1)}})};if(n.startsWith( ` ( ? ~ ` )){if(n=== ` ( ? ~ | ` )throw Error( ` Unsupported absence function kind "${n}" ` );return{token:b v( ` absence _repeater ` ,n)}}throw Error(n=== ` ( ? ( ` ? ` Unsupported conditional "${n}" ` : ` Invalid or unsupported group option "${n}" ` )}if(n=== ` ) ` ){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error( ` Unmatched ")" ` );return{token:y v(n)}}if(e.getCurrentModX()){if(n=== ` # ` ){let e=t.indexOf( `
` ,r);return{lastIndex:e===-1?t.length:e}}if(/^ \s $ /.test(n)){let e=/ \s +/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n=== ` . ` ?{token:gv( ` dot ` ,n)}:n=== ` ^ ` ||n=== ` $ ` ?{token:lv(e.singleline?{"^":X_ ` \ A ` , $ :X_ ` \ Z ` }[n]:n,n)}:n=== ` | ` ?{token:cv(n)}:ev.test(n)?{tokens:Iv(n)}:{token:dv(q_(n),n)}}function av(e,t,n){let r=[hv(t[1]=== ` ^ ` ,t)],i=1,a;for(nv.lastIndex=n;a=nv.exec(e);){let e=a[0];if(e[0]=== ` [ ` &&e[1]!== ` : ` )i++,r.push(hv(e[1]=== ` ^ ` ,e));else if(e=== ` ] ` ){if(r.at(-1).type=== ` CharacterClassOpen ` )r.push(dv(93,e));else if(i--,r.push(fv(e)),!i)break}else{let t=ov(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:nv.lastIndex||e.length}}function ov(e){if(e[0]=== ` \ \ ` )return sv(e,{inCharClass:!0});if(e[0]=== ` [ ` ){let t=/ \[ :(?<negate> \^ ?)(?<name>[a-z]+): \] /.exec(e);if(!t||!Y_.has(t.groups.name))throw Error( ` Invalid POSIX class "${e}" ` );return gv( ` posix ` ,e,{value:t.groups.name,negate:!!t.groups.negate})}return e=== ` - ` ?pv(e):e=== ` && ` ?mv(e):dv(q_(e),e)}function sv(e,{inCharClass:t}){let n=e[1];if(n=== ` c ` ||n=== ` C ` )return Ev(e);if( ` dDhHsSwW ` .includes(n))return Av(e);if(e.startsWith(X_ ` \ o { ` ))throw Error( ` Incomplete , invalid , or unsupported octal code point "${e}" ` );if(/^ \\ [pP] \{ /.test(e)){if(e.length===3)throw Error( ` Incomplete or invalid Unicode property "${e}" ` );return jv(e)}if(/^ \\ x[89A-Fa-f] \p {AHex}/u.test(e))try{let t=e.split(/ \\ x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder( ` utf - 8 ` ,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=> ` \ \ x$ { e . toString ( 16 ) } ` ).join( ` ` );return dv(q_(e),t)})}catch{throw Error( ` Multibyte code "${e}" incomplete or invalid in Oniguruma ` )}if(n=== ` u ` ||n=== ` x ` )return dv(Pv(e),e);if(Tv.has(n))return dv(Tv.get(n),e);if(/ \d /.test(n))return vv(t,e);if(e=== ` \ \ ` )throw Error(X_ ` Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta " $ { e } "`);if([...e].length===2)return dv(e.codePointAt(1),e);throw Error(`Unexpected escape " $ { e } "`)}function cv(e){return{type:`Alternator`,raw:e}}function lv(e,t){return{type:`Assertion`,kind:e,raw:t}}function uv(e){return{type:`Backreference`,raw:e}}function dv(e,t){return{type:`Character`,value:e,raw:t}}function fv(e){return{type:`CharacterClassClose`,raw:e}}function pv(e){return{type:`CharacterClassHyphen`,raw:e}}function mv(e){return{type:`CharacterClassIntersector`,raw:e}}function hv(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function gv(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function _v(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:Z_(n.flags),raw:t}}function vv(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function yv(e){return{type:`GroupClose`,raw:e}}function bv(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function xv(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Sv(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Cv(e){return{type:`Subroutine`,raw:e}}var wv=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Tv=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Ev(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character " $ { e } "`);return dv(q_(t.toUpperCase())-64,e)}function Dv(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=Mv(n),o=Mv(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),_v(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,bv(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier " $ { e } "`)}function Ov(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout " $ { e } "`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout " $ { e } "`);if(r===``)throw Error(`Named callout tag with empty value not allowed " $ { e } "`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=wv.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed " $ { a } "`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument " $ { a } "`);if(typeof o==`string`)throw Error(`Named callout argument must be a number " $ { o } "`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments " $ { a } "`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number " $ { o } "`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' " $ { s } "`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument " $ { a } " ` )
Line truncated
` .replace(/ \s +/g, ` ` ), ` gsu ` );function c v(e,t={}){let n={flags: ` ` ,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!= ` string ` )throw Error( ` String expected as pattern ` );let r=R v(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(o v.lastIndex=0;s=o v.exec(e);){let t=l v(a,e,s[0],o v.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(o v.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type=== ` GroupOpen ` ).forEach(e=>{e.kind=== ` capturing ` ?e.number=++l:e.raw=== ` ( ` &&c.push(e)}),l||c.forEach((e,t)=>{e.kind= ` capturing ` ,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type=== ` EscapedNumber ` ?B v(e,u):e).flat(),flags:r}}function l v(e,t,n,r){let[i,a]=n;if(n=== ` [ ` ||n=== ` [ ^ ` ){let e=u v(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i=== ` \ \ ` ){if( ` AbBGyYzZ ` .includes(a))return{token:m v(n,n)};if(/^ \\ g[<']/.test(n)){if(!/^ \\ g(?:<[^>]+>|'[^']+') $ /.test(n))throw Error( ` Invalid group name "${n}" ` );return{token:O v(n)}}if(/^ \\ k[<']/.test(n)){if(!/^ \\ k(?:<[^>]+>|'[^']+') $ /.test(n))throw Error( ` Invalid group name "${n}" ` );return{token:h v(n)}}if(a=== ` K ` )return{token:S v( ` keep ` ,n)};if(a=== ` N ` ||a=== ` R ` )return{token:x v( ` newline ` ,n,{negate:a=== ` N ` })};if(a=== ` O ` )return{token:x v( ` any ` ,n)};if(a=== ` X ` )return{token:x v( ` text _segment ` ,n)};let e=f v(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i=== ` ( ` ){if(a=== ` * ` )return{token:N v(n)};if(n=== ` ( ? { ` )throw Error( ` Unsupported callout "${n}" ` );if(n.startsWith( ` ( ? # ` )){if(t[r]!== ` ) ` )throw Error( ` Unclosed comment group "(?#" ` );return{lastIndex:r+1}}if(/^ \( \? [-imx]+[:)] $ /.test(n))return{token:M v(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n=== ` ( ` &&!e.captureGroup||n=== ` ( ? : ` )return{token:T v( ` group ` ,n)};if(n=== ` ( ? > ` )return{token:T v( ` atomic ` ,n)};if(n=== ` ( ? = ` ||n=== ` ( ? ! ` ||n=== ` ( ? <= ` ||n=== ` ( ? < ! ` )return{token:T v(n[2]=== ` < ` ? ` lookbehind ` : ` lookahead ` ,n,{negate:n.endsWith( ` ! ` )})};if(n=== ` ( ` &&e.captureGroup||n.startsWith( ` ( ? < ` )&&n.endsWith( ` > ` )||n.startsWith( ` ( ? '`)&&n.endsWith(`' ` ))return{token:T v( ` capturing ` ,n,{...n!== ` ( ` &&{name:n.slice(3,-1)}})};if(n.startsWith( ` ( ? ~ ` )){if(n=== ` ( ? ~ | ` )throw Error( ` Unsupported absence function kind "${n}" ` );return{token:T v( ` absence _repeater ` ,n)}}throw Error(n=== ` ( ? ( ` ? ` Unsupported conditional "${n}" ` : ` Invalid or unsupported group option "${n}" ` )}if(n=== ` ) ` ){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error( ` Unmatched ")" ` );return{token:w v(n)}}if(e.getCurrentModX()){if(n=== ` # ` ){let e=t.indexOf( `
` ,r);return{lastIndex:e===-1?t.length:e}}if(/^ \s $ /.test(n)){let e=/ \s +/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n=== ` . ` ?{token:xv( ` dot ` ,n)}:n=== ` ^ ` ||n=== ` $ ` ?{token:mv(e.singleline?{"^":tv ` \ A ` , $ :tv ` \ Z ` }[n]:n,n)}:n=== ` | ` ?{token:pv(n)}:av.test(n)?{tokens:Vv(n)}:{token:gv(Q_(n),n)}}function uv(e,t,n){let r=[bv(t[1]=== ` ^ ` ,t)],i=1,a;for(sv.lastIndex=n;a=sv.exec(e);){let e=a[0];if(e[0]=== ` [ ` &&e[1]!== ` : ` )i++,r.push(bv(e[1]=== ` ^ ` ,e));else if(e=== ` ] ` ){if(r.at(-1).type=== ` CharacterClassOpen ` )r.push(gv(93,e));else if(i--,r.push(_v(e)),!i)break}else{let t=dv(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:sv.lastIndex||e.length}}function dv(e){if(e[0]=== ` \ \ ` )return fv(e,{inCharClass:!0});if(e[0]=== ` [ ` ){let t=/ \[ :(?<negate> \^ ?)(?<name>[a-z]+): \] /.exec(e);if(!t||!ev.has(t.groups.name))throw Error( ` Invalid POSIX class "${e}" ` );return xv( ` posix ` ,e,{value:t.groups.name,negate:!!t.groups.negate})}return e=== ` - ` ?vv(e):e=== ` && ` ?yv(e):gv(Q_(e),e)}function fv(e,{inCharClass:t}){let n=e[1];if(n=== ` c ` ||n=== ` C ` )return jv(e);if( ` dDhHsSwW ` .includes(n))return Fv(e);if(e.startsWith(tv ` \ o { ` ))throw Error( ` Incomplete , invalid , or unsupported octal code point "${e}" ` );if(/^ \\ [pP] \{ /.test(e)){if(e.length===3)throw Error( ` Incomplete or invalid Unicode property "${e}" ` );return Iv(e)}if(/^ \\ x[89A-Fa-f] \p {AHex}/u.test(e))try{let t=e.split(/ \\ x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder( ` utf - 8 ` ,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=> ` \ \ x$ { e . toString ( 16 ) } ` ).join( ` ` );return gv(Q_(e),t)})}catch{throw Error( ` Multibyte code "${e}" incomplete or invalid in Oniguruma ` )}if(n=== ` u ` ||n=== ` x ` )return gv(zv(e),e);if(Av.has(n))return gv(Av.get(n),e);if(/ \d /.test(n))return Cv(t,e);if(e=== ` \ \ ` )throw Error(tv ` Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta " $ { e } "`);if([...e].length===2)return gv(e.codePointAt(1),e);throw Error(`Unexpected escape " $ { e } "`)}function pv(e){return{type:`Alternator`,raw:e}}function mv(e,t){return{type:`Assertion`,kind:e,raw:t}}function hv(e){return{type:`Backreference`,raw:e}}function gv(e,t){return{type:`Character`,value:e,raw:t}}function _v(e){return{type:`CharacterClassClose`,raw:e}}function vv(e){return{type:`CharacterClassHyphen`,raw:e}}function yv(e){return{type:`CharacterClassIntersector`,raw:e}}function bv(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function xv(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Sv(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:nv(n.flags),raw:t}}function Cv(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function wv(e){return{type:`GroupClose`,raw:e}}function Tv(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Ev(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Dv(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Ov(e){return{type:`Subroutine`,raw:e}}var kv=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Av=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function jv(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character " $ { e } "`);return gv(Q_(t.toUpperCase())-64,e)}function Mv(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=Lv(n),o=Lv(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Sv(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Tv(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier " $ { e } "`)}function Nv(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout " $ { e } "`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout " $ { e } "`);if(r===``)throw Error(`Named callout tag with empty value not allowed " $ { e } "`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=kv.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed " $ { a } "`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument " $ { a } "`);if(typeof o==`string`)throw Error(`Named callout argument must be a number " $ { o } "`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments " $ { a } "`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number " $ { o } "`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' " $ { s } "`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument " $ { a } " ` )
Line truncated
\ \ ( ? : \ d +
| c [ A - Za - z ]
| [ gk ] < [ ^ > ] + >
@@ -60,9 +60,9 @@ import{A as e,C as t,D as n,E as r,F as i,I as a,L as o,M as s,N as c,P as l,R a
| [ A - Za - z \ - ] + :
| \ ( DEFINE \ )
) ) ?
| ( ? < qBase > $ { Ry } ) ( ? < qMod > [ ? + ] ? ) ( ? < invalidQ > [ ? * + \ { ] ? )
| ( ? < qBase > $ { Uy } ) ( ? < qMod > [ ? + ] ? ) ( ? < invalidQ > [ ? * + \ { ] ? )
| \ \ ? .
` .replace(/ \s +/g, ` ` ), ` gsu ` );function By(e){if(!RegExp( ` $ { Ry } \ \ + ` ).test(e))return{pattern:e};let t=[],n=null,r=null,i= ` ` ,a=0,o;for(zy.lastIndex=0;o=zy.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s=== ` [ ` )a||(r=c),a++;else if(s=== ` ] ` )a?a--:r=null;else if(!a){if(u=== ` + ` &&i&&!i.startsWith( ` ( ` )){if(d)throw Error( ` Invalid quantifier "${s}" ` );let t=-1;if(/^ \{ \d + \} $ /.test(l))e=ky(e,c+l.length,u, ` ` );else{if(i=== ` ) ` ||i=== ` ] ` ){let t=i=== ` ) ` ?n:r;if(t===null)throw Error( ` Invalid unmatched "${i}" ` );e= ` $ { e . slice ( 0 , t ) } ( ? > $ { e . slice ( t , c ) } $ { l } ) $ { e . slice ( c + s . length ) } ` }else e= ` $ { e . slice ( 0 , c - i . length ) } ( ? > $ { i } $ { l } ) $ { e . slice ( c + s . length ) } ` ;t+=4}zy.lastIndex+=t}else s[0]=== ` ( ` ?t.push(c):s=== ` ) ` &&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Vy=String.raw,Hy=Vy ` \ ( \ ? R = ( ? < rDepth > [ ^ \ ) ] + ) \ ) | $ { Vy ` \\ g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)> ` } ` ,Uy=Vy ` \ ( \ ? < ( ? ! [ = ! ] ) ( ? < captureName > [ ^ > ] + ) > ` ,Wy=Vy ` $ { Uy } | ( ? < unnamed > \ ( ) ( ? ! \ ? ) ` ,Gy=new RegExp(Vy ` $ { Uy } | $ { Hy } | \ ( \ ? | \ \ ? . ` , ` gsu ` ),Ky= ` Cannot use multiple overlapping recursions ` ;function qy(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode: ` plugin ` ,...t},i=t?.captureTransfers??new Map;if(!new RegExp(Hy, ` su ` ).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r=== ` plugin ` &&Py(e,Vy ` \ ( \ ? \ ( DEFINE \ ) ` ,Ay.DEFAULT))throw Error( ` DEFINE groups cannot be used with recursion ` );let a=[],o=Py(e,Vy ` \ \ [ 1 - 9 ] ` ,Ay.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Gy.lastIndex=0;f=Gy.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t=== ` [ ` )u++;else if(u)t=== ` ] ` &&u--;else{if(m){if(Jy(m),l)throw Error(Ky);if(o)throw Error( ` $ { r === ` external ` ? ` Backrefs ` : ` Numbered backrefs ` } cannot be used with global recursion ` );let t=e.slice(0,f.index),s=e.slice(Gy.lastIndex);if(Py(s,Hy,Ay.DEFAULT))throw Error(Ky);let c=m-1;e=Yy(t,s,c,!1,n,a,d),i=Qy(i,t,c,a.length,0,d);break}if(h){Jy(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(Ky);break}if(!u)throw Error(Vy ` Recursive \ g cannot be used outside the referenced group "${r===`external`?h:Vy`\g<${h}&R=${g}>`}" ` );let p=s.get(h),m=Fy(e,p);if(o&&Py(m,Vy ` $ { Uy } | \ ( ( ? ! \ ? ) ` ,Ay.DEFAULT))throw Error( ` $ { r === ` external ` ? ` Backrefs ` : ` Numbered backrefs ` } cannot be used with recursion of capturing groups ` );let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=Yy(_,v,b,!0,n,a,d);i=Qy(i,_,b,a.length-y,y,d),e= ` $ { e . slice ( 0 , p ) } $ { x } $ { e . slice ( p + m . length ) } ` ,Gy.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Gy.lastIndex),s.set(p,Gy.lastIndex),c.push({num:d,name:p});else if(t[0]=== ` ( ` ){let e=t=== ` ( ` ;e&&(d++,s.set(String(d),Gy.lastIndex)),c.push(e?{num:d}:{})}else t=== ` ) ` &&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Jy(e){let t= ` Max depth must be integer between 2 and 100 ; used $ { e } ` ;if(!/^[1-9] \d * $ /.test(e)||(e=+e,e<2||e>100))throw Error(t)}function Yy(e,t,n,r,i,a,o){let s=new Set;r&&My(e+t,Uy,({groups:{captureName:e}})=>{s.add(e)},Ay.DEFAULT);let c=[n,r?s:null,i,a,o];return ` $ { e } $ { Xy ( ` (?: ${ e } ` , ` forward ` , ... c ) } ( ? : ) $ { Xy ( ` ${ t } ) ` , ` backward ` , ... c ) } $ { t } ` }function Xy(e,t,n,r,i,a,o){let s=e=>t=== ` forward ` ?e+2:n-e+2-1,c= ` ` ;for(let t=0;t<n;t++){let n=s(t);c+=jy(e,Vy ` $ { Wy } | \ \ k < ( ? < backref > [ ^ > ] + ) > ` ,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l= ` _$$ { n } ` ;if(s||t){let n=o+a.length+1;return a.push(n),Zy(i,n),s?e: ` ( ? < $ { t } $ { l } > ` }return Vy ` \ k < $ { c } $ { l } > ` },Ay.DEFAULT)}return c}function Zy(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Qy(e,t,n,r,i,a){if(e.size&&r){let o=0;My(t,Wy,()=>o++,Ay.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var $ y=String.fromCodePoint,eb=String.raw,tb={},nb=globalThis.RegExp;tb.flagGroups=(()=>{try{new nb( ` ( ? i : ) ` )}catch{return!1}return!0})(),tb.unicodeSets=(()=>{try{new nb( ` [ [ ] ] ` , ` v ` )}catch{return!1}return!0})(),tb.bugFlagVLiteralHyphenIsRange=tb.unicodeSets?(()=>{try{new nb(eb ` [ \ d \ - a ] ` , ` v ` )}catch{return!0}return!1})():!1,tb.bugNestedClassIgnoresNegation=tb.unicodeSets&&new nb( ` [ [ ^ a ] ] ` , ` v ` ).test( ` a ` );function rb(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function ib(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function ab(e,t){return sb[e]>=sb[t]}function ob(e,t){if(e==null)throw Error(t?? ` Value expected ` );return e}var sb={ES2025:2025,ES2024:2024,ES2018:2018},cb={auto: ` auto ` ,ES2025: ` ES2025 ` ,ES2024: ` ES2024 ` ,ES2018: ` ES2018 ` };function lb(e={}){if({}.toString.call(e)!== ` [ object Object ] ` )throw Error( ` Unexpected options ` );if(e.target!==void 0&&!cb[e.target])throw Error( ` Unexpected target "${e.target}" ` );let t={accuracy: ` default ` ,avoidSubclass:!1,flags: ` ` ,global:!1,hasIndices:!1,lazyCompileLength:1/0,target: ` a Line truncated
` .replace(/ \s +/g, ` ` ), ` gsu ` );function Gy(e){if(!RegExp( ` $ { Uy } \ \ + ` ).test(e))return{pattern:e};let t=[],n=null,r=null,i= ` ` ,a=0,o;for(Wy.lastIndex=0;o=Wy.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s=== ` [ ` )a||(r=c),a++;else if(s=== ` ] ` )a?a--:r=null;else if(!a){if(u=== ` + ` &&i&&!i.startsWith( ` ( ` )){if(d)throw Error( ` Invalid quantifier "${s}" ` );let t=-1;if(/^ \{ \d + \} $ /.test(l))e=Py(e,c+l.length,u, ` ` );else{if(i=== ` ) ` ||i=== ` ] ` ){let t=i=== ` ) ` ?n:r;if(t===null)throw Error( ` Invalid unmatched "${i}" ` );e= ` $ { e . slice ( 0 , t ) } ( ? > $ { e . slice ( t , c ) } $ { l } ) $ { e . slice ( c + s . length ) } ` }else e= ` $ { e . slice ( 0 , c - i . length ) } ( ? > $ { i } $ { l } ) $ { e . slice ( c + s . length ) } ` ;t+=4}Wy.lastIndex+=t}else s[0]=== ` ( ` ?t.push(c):s=== ` ) ` &&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Ky=String.raw,qy=Ky ` \ ( \ ? R = ( ? < rDepth > [ ^ \ ) ] + ) \ ) | $ { Ky ` \\ g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)> ` } ` ,Jy=Ky ` \ ( \ ? < ( ? ! [ = ! ] ) ( ? < captureName > [ ^ > ] + ) > ` ,Yy=Ky ` $ { Jy } | ( ? < unnamed > \ ( ) ( ? ! \ ? ) ` ,Xy=new RegExp(Ky ` $ { Jy } | $ { qy } | \ ( \ ? | \ \ ? . ` , ` gsu ` ),Zy= ` Cannot use multiple overlapping recursions ` ;function Qy(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode: ` plugin ` ,...t},i=t?.captureTransfers??new Map;if(!new RegExp(qy, ` su ` ).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r=== ` plugin ` &&zy(e,Ky ` \ ( \ ? \ ( DEFINE \ ) ` ,Fy.DEFAULT))throw Error( ` DEFINE groups cannot be used with recursion ` );let a=[],o=zy(e,Ky ` \ \ [ 1 - 9 ] ` ,Fy.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Xy.lastIndex=0;f=Xy.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t=== ` [ ` )u++;else if(u)t=== ` ] ` &&u--;else{if(m){if( $ y(m),l)throw Error(Zy);if(o)throw Error( ` $ { r === ` external ` ? ` Backrefs ` : ` Numbered backrefs ` } cannot be used with global recursion ` );let t=e.slice(0,f.index),s=e.slice(Xy.lastIndex);if(zy(s,qy,Fy.DEFAULT))throw Error(Zy);let c=m-1;e=eb(t,s,c,!1,n,a,d),i=rb(i,t,c,a.length,0,d);break}if(h){ $ y(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(Zy);break}if(!u)throw Error(Ky ` Recursive \ g cannot be used outside the referenced group "${r===`external`?h:Ky`\g<${h}&R=${g}>`}" ` );let p=s.get(h),m=By(e,p);if(o&&zy(m,Ky ` $ { Jy } | \ ( ( ? ! \ ? ) ` ,Fy.DEFAULT))throw Error( ` $ { r === ` external ` ? ` Backrefs ` : ` Numbered backrefs ` } cannot be used with recursion of capturing groups ` );let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=eb(_,v,b,!0,n,a,d);i=rb(i,_,b,a.length-y,y,d),e= ` $ { e . slice ( 0 , p ) } $ { x } $ { e . slice ( p + m . length ) } ` ,Xy.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Xy.lastIndex),s.set(p,Xy.lastIndex),c.push({num:d,name:p});else if(t[0]=== ` ( ` ){let e=t=== ` ( ` ;e&&(d++,s.set(String(d),Xy.lastIndex)),c.push(e?{num:d}:{})}else t=== ` ) ` &&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function $ y(e){let t= ` Max depth must be integer between 2 and 100 ; used $ { e } ` ;if(!/^[1-9] \d * $ /.test(e)||(e=+e,e<2||e>100))throw Error(t)}function eb(e,t,n,r,i,a,o){let s=new Set;r&&Ly(e+t,Jy,({groups:{captureName:e}})=>{s.add(e)},Fy.DEFAULT);let c=[n,r?s:null,i,a,o];return ` $ { e } $ { tb ( ` (?: ${ e } ` , ` forward ` , ... c ) } ( ? : ) $ { tb ( ` ${ t } ) ` , ` backward ` , ... c ) } $ { t } ` }function tb(e,t,n,r,i,a,o){let s=e=>t=== ` forward ` ?e+2:n-e+2-1,c= ` ` ;for(let t=0;t<n;t++){let n=s(t);c+=Iy(e,Ky ` $ { Yy } | \ \ k < ( ? < backref > [ ^ > ] + ) > ` ,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l= ` _$$ { n } ` ;if(s||t){let n=o+a.length+1;return a.push(n),nb(i,n),s?e: ` ( ? < $ { t } $ { l } > ` }return Ky ` \ k < $ { c } $ { l } > ` },Fy.DEFAULT)}return c}function nb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function rb(e,t,n,r,i,a){if(e.size&&r){let o=0;Ly(t,Yy,()=>o++,Fy.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var ib=String.fromCodePoint,ab=String.raw,ob={},sb=globalThis.RegExp;ob.flagGroups=(()=>{try{new sb( ` ( ? i : ) ` )}catch{return!1}return!0})(),ob.unicodeSets=(()=>{try{new sb( ` [ [ ] ] ` , ` v ` )}catch{return!1}return!0})(),ob.bugFlagVLiteralHyphenIsRange=ob.unicodeSets?(()=>{try{new sb(ab ` [ \ d \ - a ] ` , ` v ` )}catch{return!0}return!1})():!1,ob.bugNestedClassIgnoresNegation=ob.unicodeSets&&new sb( ` [ [ ^ a ] ] ` , ` v ` ).test( ` a ` );function cb(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function lb(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function ub(e,t){return fb[e]>=fb[t]}function db(e,t){if(e==null)throw Error(t?? ` Value expected ` );return e}var fb={ES2025:2025,ES2024:2024,ES2018:2018},pb={auto: ` auto ` ,ES2025: ` ES2025 ` ,ES2024: ` ES2024 ` ,ES2018: ` ES2018 ` };function mb(e={}){if({}.toString.call(e)!== ` [ object Object ] ` )throw Error( ` Unexpected options ` );if(e.target!==void 0&&!pb[e.target])throw Error( ` Unexpected target "${e.target}" ` );let t={accuracy: ` default ` ,avoidSubclass:!1,flags: ` ` ,global:!1,hasIndices:!1,lazyCompileLength:1/0,target: ` a Line truncated
Cc Control cntrl
Cf Format
Cn Unassigned
@@ -152,89 +152,89 @@ Uppercase Upper
Variation _Selector VS
White _Space space
XID _Continue XIDC
XID _Start XIDS ` .split(/ \s /).map(e=>[x y(e),e])),h b=new Map([[ ` s ` , $ y (383)],[$ y (383),` s ` ]]),g b=new Map([[ $ y(223), $ y(7838)],[ $ y(107), $ y(8490)],[ $ y(229), $ y(8491)],[ $ y(969), $ y (8486)]]),_ b=new Map([b b(453),b b(456),b b(459),b b(498),...x b(8072,8079),...x b(8088,8095),...x b(8104,8111),b b(8124),b b(8140),b b(8188)]),v b=new Map([[` alnum ` ,e b ` [ \ p { Alpha } \ p { Nd } ] ` ],[ ` alpha ` ,e b ` \ p { Alpha } ` ],[ ` ascii ` ,e b ` \ p { ASCII } ` ],[ ` blank ` ,e b ` [ \ p { Zs } \ t ] ` ],[ ` cntrl ` ,e b ` \ p { Cc } ` ],[ ` digit ` ,e b ` \ p { Nd } ` ],[ ` graph ` ,e b ` [ \ P { space } && \ P { Cc } && \ P { Cn } && \ P { Cs } ] ` ],[ ` lower ` ,e b ` \ p { Lower } ` ],[ ` print ` ,e b ` [ [ \ P { space } && \ P { Cc } && \ P { Cn } && \ P { Cs } ] \ p { Zs } ] ` ],[ ` punct ` ,e b ` [ \ p { P } \ p { S } ] ` ],[ ` space ` ,e b ` \ p { space } ` ],[ ` upper ` ,e b ` \ p { Upper } ` ],[ ` word ` ,e b ` [ \ p { Alpha } \ p { M } \ p { Nd } \ p { Pc } ] ` ],[ ` xdigit ` ,e b ` \ p { AHex } ` ]]);function y b(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function b b(e){let t= $ y (e);return[t.toLowerCase(),t]}function x b(e,t){return y b(e,t).map(e=>b b(e))}var S b=new Set([` Lower ` , ` Lowercase ` , ` Upper ` , ` Uppercase ` , ` Ll ` , ` Lowercase _Letter ` , ` Lt ` , ` Titlecase _Letter ` , ` Lu ` , ` Uppercase _Letter ` ]);function C b(e,t){let n={accuracy: ` default ` ,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget: ` ES2025 ` ,...t};D b(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:a b(n.bestEffortTarget, ` ES2024 ` ),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};w y(e,w b,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return w y(e,T b,a),w y(e,E b,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var w b={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i=== ` repeater ` ){let e=o y();e.body[0].body.push(s y({negate:!0,body:r}),p y( ` Any ` ));let i=o y();i.body[0].body.push(u y( ` greedy ` ,0,1/0,e)),n(K b(i,t),{traverse:!0})}else throw Error( ` Unsupported absence function "(?~|" ` )},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind=== ` flags ` );for(let e=n+1;e<t.body.length;e++){let n=t.body[e];i b(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=P b(t.get(e));if(n){let t=o y({flags:n});t.body[0].body=e.body,e.body=[K b(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c=== ` text _segment _boundary ` )throw Error( ` Unsupported text segment boundary "\\${l?`Y`:`y`}" ` );if(c=== ` line _end ` )o(K b(s y({body:[Xv ({body:[Zv ( ` string _end ` )]}),Xv ({body:[e y(10)]})]}),t));else if(c=== ` line _start ` )o(K b(U b(e b ` ( ? <= \ A | \ n ( ? ! \ z ) ) ` ,{skipLookbehindValidation:!0}),t));else if(c=== ` search _start ` ){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&B b(e))o(K b(s y({negate:!0}),t));else if(d)throw Error(e b ` Uses "\G" in a way that requires a subclass ` );else o(G b(Zv ( ` string _start ` ),t)),s.strategy= ` clip _search ` }}else if(c!== ` string _end ` &&c!== ` string _start ` ){if(c=== ` string _end _newline ` )o(K b(U b(e b ` ( ? = \ n ? \ z ) ` ),t));else if(c=== ` word _boundary ` ){if(!p&&!u){let e= ` ( ? : ( ? <= $ { fb } ) ( ? ! $ { fb } ) | ( ? < ! $ { fb } ) ( ? = $ { fb } ) ) ` ,n= ` ( ? : ( ? <= $ { fb } ) ( ? = $ { fb } ) | ( ? < ! $ { fb } ) ( ? ! $ { fb } ) ) ` ;o(K b(U b(l?n:e),t))}}else throw Error( ` Unexpected assertion kind "${c}" ` )}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n== ` string ` &&!H b(n)&&(n=N b(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!H b(r)&&(r=N b(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind=== ` intersection ` &&n(K b(t y({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c=== ` digit ` ||u=== ` digit ` ))n(G b(r y( ` digit ` ,{negate:l}),t));else if(o&&(c=== ` space ` ||u=== ` space ` ))n(K b(W b(U b(u b),l),t));else if(s&&(c=== ` word ` ||u=== ` word ` ))n(G b(r y( ` word ` ,{negate:l}),t));else if(c=== ` any ` )n(G b(p y( ` Any ` ),t));else if(c=== ` digit ` )n(G b(p y( ` Nd ` ,{negate:l}),t));else if(c!== ` dot ` ){if(c=== ` text _segment ` ){if(r=== ` strict ` )throw Error(e b ` Use of "\X" requires non - strict accuracy ` );let e= ` \ \ p { Emoji } ( ? : \ \ p { EMod } | \ \uFE0F \ \u20E3 ? | [ \ \ x { E0020 } - \ \ x { E007E } ] + \ \ x { E007F } ) ? ` ,a=e b ` \ p { RI } { 2 } | $ { e } ( ? : \u200D$ { e } ) * ` ;n(K b(U b(e b ` ( ? > \ r \ n | $ { i ? eb ` \p {RGI_Emoji} ` : a } | \ P { M } \ p { M } * ) ` ,{skipPropertyNameValidation:!0}),t))}else if(c=== ` hex ` )n(G b(p y( ` AHex ` ,{negate:l}),t));else if(c=== ` newline ` )n(K b(U b(l? ` [ ^
XID _Start XIDS ` .split(/ \s /).map(e=>[E y(e),e])),b b=new Map([[ ` s ` ,ib (383)],[ib (383), ` s ` ]]),x b=new Map([[ib(223),ib(7838)],[ib(107),ib(8490)],[ib(229),ib(8491)],[ib(969),ib (8486)]]),S b=new Map([T b(453),T b(456),T b(459),T b(498),...E b(8072,8079),...E b(8088,8095),...E b(8104,8111),T b(8124),T b(8140),T b(8188)]),C b=new Map([[ ` alnum ` ,a b ` [ \ p { Alpha } \ p { Nd } ] ` ],[ ` alpha ` ,a b ` \ p { Alpha } ` ],[ ` ascii ` ,a b ` \ p { ASCII } ` ],[ ` blank ` ,a b ` [ \ p { Zs } \ t ] ` ],[ ` cntrl ` ,a b ` \ p { Cc } ` ],[ ` digit ` ,a b ` \ p { Nd } ` ],[ ` graph ` ,a b ` [ \ P { space } && \ P { Cc } && \ P { Cn } && \ P { Cs } ] ` ],[ ` lower ` ,a b ` \ p { Lower } ` ],[ ` print ` ,a b ` [ [ \ P { space } && \ P { Cc } && \ P { Cn } && \ P { Cs } ] \ p { Zs } ] ` ],[ ` punct ` ,a b ` [ \ p { P } \ p { S } ] ` ],[ ` space ` ,a b ` \ p { space } ` ],[ ` upper ` ,a b ` \ p { Upper } ` ],[ ` word ` ,a b ` [ \ p { Alpha } \ p { M } \ p { Nd } \ p { Pc } ] ` ],[ ` xdigit ` ,a b ` \ p { AHex } ` ]]);function w b(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function T b(e){let t=ib (e);return[t.toLowerCase(),t]}function E b(e,t){return w b(e,t).map(e=>T b(e))}var D b=new Set([ ` Lower ` , ` Lowercase ` , ` Upper ` , ` Uppercase ` , ` Ll ` , ` Lowercase _Letter ` , ` Lt ` , ` Titlecase _Letter ` , ` Lu ` , ` Uppercase _Letter ` ]);function O b(e,t){let n={accuracy: ` default ` ,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget: ` ES2025 ` ,...t};M b(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:u b(n.bestEffortTarget, ` ES2024 ` ),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};k y(e,k b,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return k y(e,A b,a),k y(e,j b,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var k b={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i=== ` repeater ` ){let e=d y();e.body[0].body.push(f y({negate:!0,body:r}),v y( ` Any ` ));let i=d y();i.body[0].body.push(h y( ` greedy ` ,0,1/0,e)),n(Z b(i,t),{traverse:!0})}else throw Error( ` Unsupported absence function "(?~|" ` )},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind=== ` flags ` );for(let e=n+1;e<t.body.length;e++){let n=t.body[e];l b(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=z b(t.get(e));if(n){let t=d y({flags:n});t.body[0].body=e.body,e.body=[Z b(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c=== ` text _segment _boundary ` )throw Error( ` Unsupported text segment boundary "\\${l?`Y`:`y`}" ` );if(c=== ` line _end ` )o(Z b(f y({body:[ty ({body:[ny ( ` string _end ` )]}),ty ({body:[a y(10)]})]}),t));else if(c=== ` line _start ` )o(Z b(J b(a b ` ( ? <= \ A | \ n ( ? ! \ z ) ) ` ,{skipLookbehindValidation:!0}),t));else if(c=== ` search _start ` ){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&G b(e))o(Z b(f y({negate:!0}),t));else if(d)throw Error(a b ` Uses "\G" in a way that requires a subclass ` );else o(X b(ny ( ` string _start ` ),t)),s.strategy= ` clip _search ` }}else if(c!== ` string _end ` &&c!== ` string _start ` ){if(c=== ` string _end _newline ` )o(Z b(J b(a b ` ( ? = \ n ? \ z ) ` ),t));else if(c=== ` word _boundary ` ){if(!p&&!u){let e= ` ( ? : ( ? <= $ { _b } ) ( ? ! $ { _b } ) | ( ? < ! $ { _b } ) ( ? = $ { _b } ) ) ` ,n= ` ( ? : ( ? <= $ { _b } ) ( ? = $ { _b } ) | ( ? < ! $ { _b } ) ( ? ! $ { _b } ) ) ` ;o(Z b(J b(l?n:e),t))}}else throw Error( ` Unexpected assertion kind "${c}" ` )}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n== ` string ` &&!q b(n)&&(n=R b(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!q b(r)&&(r=R b(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind=== ` intersection ` &&n(Z b(o y({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c=== ` digit ` ||u=== ` digit ` ))n(X b(c y( ` digit ` ,{negate:l}),t));else if(o&&(c=== ` space ` ||u=== ` space ` ))n(Z b(Y b(J b(h b),l),t));else if(s&&(c=== ` word ` ||u=== ` word ` ))n(X b(c y( ` word ` ,{negate:l}),t));else if(c=== ` any ` )n(X b(v y( ` Any ` ),t));else if(c=== ` digit ` )n(X b(v y( ` Nd ` ,{negate:l}),t));else if(c!== ` dot ` ){if(c=== ` text _segment ` ){if(r=== ` strict ` )throw Error(a b ` Use of "\X" requires non - strict accuracy ` );let e= ` \ \ p { Emoji } ( ? : \ \ p { EMod } | \ \uFE0F \ \u20E3 ? | [ \ \ x { E0020 } - \ \ x { E007E } ] + \ \ x { E007F } ) ? ` ,a=a b ` \ p { RI } { 2 } | $ { e } ( ? : \u200D$ { e } ) * ` ;n(Z b(J b(a b ` ( ? > \ r \ n | $ { i ? ab ` \p {RGI_Emoji} ` : a } | \ P { M } \ p { M } * ) ` ,{skipPropertyNameValidation:!0}),t))}else if(c=== ` hex ` )n(X b(v y( ` AHex ` ,{negate:l}),t));else if(c=== ` newline ` )n(Z b(J b(l? ` [ ^
] ` : ` ( ? > \ r
? | [
\ v \ f
\u2028\u2029 ] ) ` ),t));else if(c=== ` posix ` ){if(!i&&(u=== ` graph ` ||u=== ` print ` )){if(r=== ` strict ` )throw Error( ` POSIX class "${u}" requires min target ES2024 or non - strict accuracy ` );let e={graph: ` ! - ~ ` ,print: ` - ~ ` }[u];l&&(e= ` \ 0 - $ { $y ( e . codePointAt ( 0 ) - 1 ) } $ { $y ( e . codePointAt ( 2 ) + 1 ) } - \ u { 10 FFFF } ` ),n(Kb(Ub( ` [ $ { e } ] ` ),t))}else n(Kb(Wb(Ub(vb.get(u)),l),t))}else if(c=== ` property ` )mb.has(xy(u))||(e.key= ` sc ` );else if(c=== ` space ` )n(Gb(py( ` space ` ,{negate:l}),t));else if(c=== ` word ` )n(Kb(Wb(Ub(fb),l),t));else throw Error( ` Unexpected character set kind "${c}" ` )}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s=== ` flags ` ){if(!c.enable&&!c.disable)r();else{let e=oy({flags:c});e.body[0].body=o(),i(Kb(e,t),{traverse:!0})}}else if(s=== ` keep ` ){let e=n.body[0],r=n.body.length===1&&Lv(e,{type: ` Group ` })&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(eb ` Uses "\K" in a way that ' s unsupported ` );let o=sy({behind:!0});o.body[0].body=a(),i(Kb(o,t))}else throw Error( ` Unexpected directive kind "${s}" ` )},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error( ` Unsupported flag "P" ` );if(e.textSegmentMode=== ` word ` )throw Error( ` Unsupported flag "y{w}" ` );[ ` digitIsAscii ` , ` extended ` , ` posixIsAscii ` , ` spaceIsAscii ` , ` wordIsAscii ` , ` textSegmentMode ` ].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n=== ` lookbehind ` &&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r=== ` fail ` )n(Kb(sy({negate:!0}),t));else throw Error( ` Unsupported named callout "(*${r.toUpperCase()}" ` )},Quantifier({node:e}){if(e.body.type=== ` Quantifier ` ){let t=oy();t.body[0].body.push(e.body),e.body=Kb(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind=== ` search _start ` )t.body.pop();else{let e=Lb(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t=== ` strict ` &&n&&r)throw Error(eb ` Uses "\G" in a way that requires non - strict accuracy ` )}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n== ` string ` &&!Hb(n)&&(n=Nb(n,t),e.ref=n)}},Tb={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=Gb(jb(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&ib(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=ib(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=rb(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!== ` CapturingGroup ` ||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?jb(0):Ab(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Pb(Mb(o,e=>e.type=== ` Group ` &&!!e.flags)),t=e?rb(r.globalFlags,e):r.globalFlags;Ob(t,r.currentFlags)||(l=oy({flags:Fb(t)}),l.body[0].body.push(c))}n(Kb(l,t),{traverse:!s})}},Eb={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>kb(t,e));i.length?i.length>1?n(Kb(oy({atomic:!0,body:i.reverse().map(e=>Xv({body:[Qv(e.number)]}))}),t)):e.ref=i[0].number:n(Kb(sy({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t= $ v();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesByR
Line truncated
` ).flatMap(e=>i(e)):i(e);return{lines:a.map(e=>e.map(e=>({content:e.content,htmlStyle:e.htmlStyle}))),state:n.getLastGrammarState(a)}}}}function k x(e,t){let n=J e(null);M(()=>F e(t),(e,t,r)=>{if(typeof window> ` u ` )return;let i=!1;r(()=>i=!0),n.value=null,O x(e).then(e=>{i||(n.value=e)}).catch(()=>{})},{immediate:!0});let r={highlighter:null,text: ` ` ,lines:[]};return J(()=>{let t=F e(e),i=t.endsWith( `
\ v \ f
\u2028\u2029 ] ) ` ),t));else if(c=== ` posix ` ){if(!i&&(u=== ` graph ` ||u=== ` print ` )){if(r=== ` strict ` )throw Error( ` POSIX class "${u}" requires min target ES2024 or non - strict accuracy ` );let e={graph: ` ! - ~ ` ,print: ` - ~ ` }[u];l&&(e= ` \ 0 - $ { ib ( e . codePointAt ( 0 ) - 1 ) } $ { ib ( e . codePointAt ( 2 ) + 1 ) } - \ u { 10 FFFF } ` ),n(Zb(Jb( ` [ $ { e } ] ` ),t))}else n(Zb(Yb(Jb(Cb.get(u)),l),t))}else if(c=== ` property ` )yb.has(Ey(u))||(e.key= ` sc ` );else if(c=== ` space ` )n(Xb(vy( ` space ` ,{negate:l}),t));else if(c=== ` word ` )n(Zb(Yb(Jb(_b),l),t));else throw Error( ` Unexpected character set kind "${c}" ` )}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s=== ` flags ` ){if(!c.enable&&!c.disable)r();else{let e=dy({flags:c});e.body[0].body=o(),i(Zb(e,t),{traverse:!0})}}else if(s=== ` keep ` ){let e=n.body[0],r=n.body.length===1&&Hv(e,{type: ` Group ` })&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(ab ` Uses "\K" in a way that ' s unsupported ` );let o=fy({behind:!0});o.body[0].body=a(),i(Zb(o,t))}else throw Error( ` Unexpected directive kind "${s}" ` )},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error( ` Unsupported flag "P" ` );if(e.textSegmentMode=== ` word ` )throw Error( ` Unsupported flag "y{w}" ` );[ ` digitIsAscii ` , ` extended ` , ` posixIsAscii ` , ` spaceIsAscii ` , ` wordIsAscii ` , ` textSegmentMode ` ].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n=== ` lookbehind ` &&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r=== ` fail ` )n(Zb(fy({negate:!0}),t));else throw Error( ` Unsupported named callout "(*${r.toUpperCase()}" ` )},Quantifier({node:e}){if(e.body.type=== ` Quantifier ` ){let t=dy();t.body[0].body.push(e.body),e.body=Zb(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind=== ` search _start ` )t.body.pop();else{let e=Hb(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t=== ` strict ` &&n&&r)throw Error(ab ` Uses "\G" in a way that requires non - strict accuracy ` )}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n== ` string ` &&!qb(n)&&(n=Rb(n,t),e.ref=n)}},Ab={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=Xb(Ib(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&lb(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=lb(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=cb(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!== ` CapturingGroup ` ||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Ib(0):Fb(o,r.groupOriginByCopy,null),l=c;if(!s){let e=zb(Lb(o,e=>e.type=== ` Group ` &&!!e.flags)),t=e?cb(r.globalFlags,e):r.globalFlags;Nb(t,r.currentFlags)||(l=dy({flags:Bb(t)}),l.body[0].body.push(c))}n(Zb(l,t),{traverse:!s})}},jb={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Pb(t,e));i.length?i.length>1?n(Zb(dy({atomic:!0,body:i.reverse().map(e=>ty({body:[ry(e.number)]}))}),t)):e.ref=i[0].number:n(Zb(fy({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=iy();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesByR
Line truncated
` ).flatMap(e=>i(e)):i(e);return{lines:a.map(e=>e.map(e=>({content:e.content,htmlStyle:e.htmlStyle}))),state:n.getLastGrammarState(a)}}}}function P x(e,t){let n=q e(null);M(()=>P e(t),(e,t,r)=>{if(typeof window> ` u ` )return;let i=!1;r(()=>i=!0),n.value=null,N x(e).then(e=>{i||(n.value=e)}).catch(()=>{})},{immediate:!0});let r={highlighter:null,text: ` ` ,lines:[]};return J(()=>{let t=P e(e),i=t.endsWith( `
` )?t.slice(0,-1):t,a=n.value;if(!a)return i.split( `
` ).map(e=>e?[{content:e}]:[]);(r.highlighter!==a||!i.startsWith(r.text))&&(r={highlighter:a,text: ` ` ,lines:[]});let o=i.lastIndexOf( `
` )+1;if(o>r.text.length){let e=a.highlight(i.slice(r.text.length,o-1),r.state);r={highlighter:a,text:i.slice(0,o),lines:[...r.lines,...e.lines],state:e.state}}let s=a.highlight(i.slice(o),r.state).lines[0]??[];return[...r.lines,s]})}var Ax=Le( ` rounded - lg text - sm data - [ size = sm ] : text - xs has - [ > [ data - slot = code - block - content ] : focus - visible ] : ring - 3 has - [ > [ data - slot = code - block - content ] : focus - visible ] : ring - ring / 50 group / code - block relative flex w - full min - w - 0 flex - col overflow - hidden ` ,{variants:{variant:{default: ` border border - input text - foreground dark : bg - input / 30 has - [ > [ data - slot = code - block - content ] : focus - visible ] : border - ring ` ,destructive: ` border border - destructive / 30 text - destructive dark : border - destructive / 40 ` }},defaultVariants:{variant: ` default ` }}),jx=Le( ` - mx - 3 px - 3 in - data - numbered : gap - x - 3 before : min - w - 6 before : text - end before : text - muted - foreground after : start - 1 after : text - muted - foreground group - data - [ size = sm ] / code - block : - mx - 2.5 group - data - [ size = sm ] / code - block : px - 2.5 relative block min - h - lh after : absolute after : top - 0 after : select - none in - data - numbered : col - span - 2 in - data - numbered : grid in - data - numbered : grid - cols - subgrid in - data - numbered : [ counter - increment : line ] in - data - numbered : before : content - [ counter ( line ) ] in - data - numbered : before : select - none in - data - numbered : supports - [ content : counter ( line ) _ / _ '' ] : before : content - [ counter ( line ) _ / _ '' ] ` ,{variants:{variant:{default: ` ` ,added: ` bg - muted after : content - [ '+' ] ` ,removed: ` bg - destructive / 10 after : text - destructive after : content - [ '− ' ] ` ,highlighted: ` bg - muted ` }},defaultVariants:{variant: ` default ` }}),Mx=N({__name: ` Message ` ,props:{class:{type:[Boolean,null,String,Object,Array]},align:{default: ` start ` },asChild:{type:Boolean},as:{default: ` div ` }},setup(e){let t=e;return(n,r)=>(I(),K(B(tt),{"data-slot": ` message ` ,"data-align":e.align,as:e.as,"as-child":e.asChild,class:R(B(U)( ` text - sm gap - 2 group / message relative flex w - full min - w - 0 data - [ align = end ] : flex - row - reverse ` ,t.class))},{default:F(()=>[G(n. $ slots, ` default ` )]),_:3},8,[ ` data - align ` , ` as ` , ` as - child ` , ` class ` ]))}}),Nx=N({__name: ` MessageContent ` ,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default: ` div ` }},setup(e){let t=e;return(n,r)=>(I(),K(B(tt),{"data-slot": ` message - content ` ,as:e.as,"as-child":e.asChild,class:R(B(U)( ` gap - 2.5 group - data - [ align = end ] / message : * : data - slot : self - end flex w - full min - w - 0 flex - col wrap - break - word ` ,t.class))},{default:F(()=>[G(n. $ slots, ` default ` )]),_:3},8,[ ` as ` , ` as - child ` , ` class ` ]))}}),Px=N({__name: ` MessageFooter ` ,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default: ` div ` }},setup(e){let t=e;return(n,r)=>(I(),K(B(tt),{"data-slot": ` message - footer ` ,as:e.as,"as-child":e.asChild,class:R(B(U)( ` text - xs font - medium text - muted - foreground px - 3 group - has - data - [ variant = ghost ] / message : px - 0 flex max - w - full min - w - 0 items - center group - data - [ align = end ] / message : justify - end ` ,t.class))},{default:F(()=>[G(n. $ slots, ` default ` )]),_:3},8,[ ` as ` , ` as - child ` , ` class ` ]))}});function Fx(e){switch(e.type){case ` image ` :return ` [ photo ] ` ;case ` video ` :return ` [ video ] ` ;case ` audio ` :return ` [ audio ] ` ;case ` document ` :return e.file_name? ` [ document : $ { e . file _name } ] ` : ` [ document ] ` ;default:return ` [ $ { e . type || ` attachment ` } ] ` }}function Ix(e){let t=[];return e.mime_type&&t.push(e.mime_type),e.file_name&&t.push(e.file_name),e.file_size!==void 0&&t.push( ` $ { e . file _size } bytes ` ),e.width&&e.height&&t.push( ` $ { e . width } × $ { e . height } ` ),e.duration!==void 0&&t.push( ` $ { e . duration } s ` ),t.join( ` · ` )}var Lx={class: ` truncate ` },Rx=N({__name: ` ChatAttachment ` ,props:{attachment:{}},setup(e){return(t,n)=>(I(),K(j(e.attachment.url? ` a ` : ` span ` ),{href:e.attachment.url,target:e.attachment.url? ` _blank ` :void 0,rel:e.attachment.url? ` noopener noreferrer ` :void 0,title:B(Ix)(e.attachment),class: ` inline - flex max - w - full items - center gap - 1.5 rounded - md border border - border bg - muted px - 2.5 py - 1 text - xs font - medium text - fg - muted ` },{default:F(()=>[O(B(ol),{"aria-hidden": ` true ` ,class: ` size - 3.5 shrink - 0 ` }),L( ` span ` ,Lx,z(B(Fx)(e.attachment)),1)]),_:1},8,[ ` href ` , ` target ` , ` rel ` , ` title ` ]))}}),zx=N({__name: ` CodeView ` ,props:{code:{},lang:{},class:{}},setup(e){let t=e,n=kx(()=>t.code,()=>t.lang|| ` text ` );return(r,i)=>(I(),K(B(hf),{class:R(B(U)( ` bg - muted ` ,t.class))},{default:F(()=>[O(B(gf),null,{default:F(()=>[O(B(Sf),{value:e.code},null,8,[ ` value ` ])]),_:1}),O(B(bf),{wrap: ` ` ,class: ` max - h - [ 60 vh ] pe - 10 text - xs ` },{default:F(()=>[(I(!0),k(H,null,A(B(n),(e,t)=>(I(),K(B(yf),{key:t},{default:F(()=>[(I(!0),k(H,null,A(e,(e,t)=>(I(),K(B(Cf),{key:t,token:e},null,8,[ ` token ` ]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[ ` class ` ]))}}),Bx=[ ` src ` , ` alt ` ],Vx={key:1},Hx={key:2},Ux={key:3,class: ` rounded bg - foreground / 10 px - 1 py - 0.5 font - mono text - [ 0.9 em ] ` },Wx=[ ` href ` ],Gx={key:5},Kx=N({__name: ` ChatInline ` ,props:{inline:{}},setup(e){return(t,n)=>(I(!0),k(H,null,A(e.inline,(e,t)=>(I(),k(H,{key:t},[e.kind=== ` image ` ?(I(),k( ` img ` ,{key:0,src:e.src,alt:e.alt,loading: ` lazy ` ,class: ` my - 1 block max - h - 96 max - w - full cursor - pointer rounded - md border border - border bg - c Line truncated
` ),r=[],i=null,a=null,o= ` ` ,s=()=>{r.length&&(t.push({kind: ` p ` ,inline:J x(r.join( ` ` ))}),r=[])},c=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>J x(e))}),null)};for(let e=0;e<n.length;e++){let l=n[e];if(l.startsWith(" ` ` ` " ) ) { s ( ) , c ( ) , a ? ( t . push ( { kind : ` pre ` , code : a . join ( `
` ),lang:o}),a=null):(a=[],o=l.slice(3).trim().split(/ \s /)[0]);continue}if(a){a.push(l);continue}let u=Xx (l),d=e+1<n.length?Xx (n[e+1]):null;if(u&&d&&Zx (d)&&u.length===d.length){s(),c();let r=[];for(e+=2;e<n.length;e++){let t=Xx (n[e]);if(!t||t.length!==u.length){e--;break}r.push(t)}t.push({kind: ` table ` ,head:u.map(e=>J x(e)),rows:r.map(e=>e.map(e=>J x(e)))});continue}if(!l.trim()){s(),c();continue}let f=l.match(/^(#{1,3}) \s +(.+) $ /);if(f){s(),c(),t.push({kind: ` h$ { f [ 1 ] . length } ` ,inline:J x(f[2])});continue}let p=l.match(/^ \s *[-*] \s +(.+) $ /),m=l.match(/^ \s * \d +[.)] \s +(.+) $ /);if(p||m){s();let e=m? ` ol ` : ` ul ` ;(!i||i.tag!==e)&&(c(),i={tag:e,items:[]}),i.items.push((p||m)[1])}else l.startsWith( ` > ` )?(s(),c(),t.push({kind: ` blockquote ` ,inline:J x(l.replace(/^> \s ?/, ` ` ))})):r.push(l)}return s(),c(),a&&t.push({kind: ` pre ` ,code:a.join( `
` ),lang:o}),t}function Xx (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 Zx (e){return e.every(e=>/^:?-{3,}:? $ /.test(e))}var Qx ={class: ` [ overflow - wrap : anywhere ] ` }, $ x ={key:1,class:` my - 3 w - full border - collapse text - [ 0.92 em ] ` },e S={key:2,class: ` my - 2 border - l - [ 3 px ] border - primary pl - 3 text - fg - muted ` },t S={key:3,class: ` mt - 1 mb - 2 text - xl leading - tight font - semibold tracking - [ - 0.02 em ] ` },n S={key:4,class: ` mt - 1 mb - 2 text - lg leading - tight font - semibold tracking - [ - 0.02 em ] ` },r S={key:5,class: ` mt - 1 mb - 2 text - base leading - tight font - semibold tracking - [ - 0.02 em ] ` },i S={key:6,class: ` my - 2.5 flex list - disc flex - col gap - 1 pl - 5 ` },a S={key:7,class: ` my - 2.5 flex list - decimal flex - col gap - 1 pl - 5 ` },o S={key:8,class: ` mb - 2.5 last : mb - 0 ` },s S=N({__name: ` ChatMarkdown ` ,props:{text:{}},setup(e){let t=e,n=J(()=>Yx (t.text));return(e,t)=>(I(),k( ` div ` ,Qx ,[(I(!0),k(H,null,A(n.value,(e,t)=>(I(),k(H,{key:t},[e.kind=== ` pre ` ?(I(),K(z x,{key:0,code:e.code,lang:e.lang,class: ` my - 2 ` },null,8,[ ` code ` , ` lang ` ])):e.kind=== ` table ` ?(I(),k( ` table ` , $ x ,[L(` thead ` ,null,[L( ` tr ` ,null,[(I(!0),k(H,null,A(e.head,(e,t)=>(I(),k( ` th ` ,{key:t,class: ` border border - border bg - muted px - 2 py - 1.5 text - left font - semibold ` },[O(K x,{inline:e},null,8,[ ` inline ` ])]))),128))])]),L( ` tbody ` ,null,[(I(!0),k(H,null,A(e.rows,(e,t)=>(I(),k( ` tr ` ,{key:t},[(I(!0),k(H,null,A(e,(e,t)=>(I(),k( ` td ` ,{key:t,class: ` border border - border px - 2 py - 1.5 text - left ` },[O(K x,{inline:e},null,8,[ ` inline ` ])]))),128))]))),128))])])):e.kind=== ` blockquote ` ?(I(),k( ` blockquote ` ,e S,[O(K x,{inline:e.inline},null,8,[ ` inline ` ])])):e.kind=== ` h1 ` ?(I(),k( ` h1 ` ,t S,[O(K x,{inline:e.inline},null,8,[ ` inline ` ])])):e.kind=== ` h2 ` ?(I(),k( ` h2 ` ,n S,[O(K x,{inline:e.inline},null,8,[ ` inline ` ])])):e.kind=== ` h3 ` ?(I(),k( ` h3 ` ,r S,[O(K x,{inline:e.inline},null,8,[ ` inline ` ])])):e.kind=== ` ul ` ?(I(),k( ` ul ` ,i S,[(I(!0),k(H,null,A(e.items,(e,t)=>(I(),k( ` li ` ,{key:t},[O(K x,{inline:e},null,8,[ ` inline ` ])]))),128))])):e.kind=== ` ol ` ?(I(),k( ` ol ` ,a S,[(I(!0),k(H,null,A(e.items,(e,t)=>(I(),k( ` li ` ,{key:t},[O(K x,{inline:e},null,8,[ ` inline ` ])]))),128))])):e.kind=== ` p ` ?(I(),k( ` p ` ,o S,[O(K x,{inline:e.inline},null,8,[ ` inline ` ])])):P( ` ` ,!0)],64))),128))]))}}),c S={class: ` truncate ` },l S=N({__name: ` ChatNavChip ` ,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=C e( ` RouterLink ` );return I(),K(r,{to:e.path,title: ` Go to $ { e . label || e . path } ` ,class: ` inline - flex max - w - full items - center gap - 1.5 rounded - md border border - primary / 45 bg - primary - soft px - 2.5 py - 1 text - xs font - semibold text - link transition - colors hover : border - primary hover : bg - primary / 15 focus - visible : outline - 2 focus - visible : outline - offset - 2 focus - visible : outline - primary ` },{default:F(()=>[O(B(hc),{"aria-hidden": ` true ` ,class: ` size - 3.5 shrink - 0 ` }),L( ` span ` ,c S,z(e.label||e.path),1)]),_:1},8,[ ` to ` , ` title ` ])}}}),u S={class: ` font - mono text - foreground ` },d S={key:0,class: ` shrink - 0 text - xs tabular - nums ` },f S={class: ` font - mono text - foreground ` },p S={key:0,class: ` shrink - 0 text - xs tabular - nums ` },m S=N({__name: ` ChatToolCall ` ,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=J(()=>t.tool.name||t.tool.Name||t.tool.tool|| ` tool ` ),r=J(()=>t.tool.parameters||t.tool.Parameters|| ` ` ),i=J(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=J(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err|| ` ` ),o=J(()=>!a.value&&!i.value&&!!t.streaming),s=J(()=>{let e=t.tool.duration_ms;return e?e<1e3? ` $ { e } ms ` : ` $ { ( e / 1e3 ) . toFixed ( + ( e < 1e4 ) ) } s ` : ` ` }),c=J(()=>{try{let e=JSON.parse(r.value);if(e&&typeof e== ` object ` &&!Array.isArray(e)){let t=Object.values(e).find(e=>typeof e== ` string ` &&e);return typeof t== ` string ` ?t.split( `
` )+1;if(o>r.text.length){let e=a.highlight(i.slice(r.text.length,o-1),r.state);r={highlighter:a,text:i.slice(0,o),lines:[...r.lines,...e.lines],state:e.state}}let s=a.highlight(i.slice(o),r.state).lines[0]??[];return[...r.lines,s]})}var Fx=Ie( ` rounded - lg text - sm data - [ size = sm ] : text - xs has - [ > [ data - slot = code - block - content ] : focus - visible ] : ring - 3 has - [ > [ data - slot = code - block - content ] : focus - visible ] : ring - ring / 50 group / code - block relative flex w - full min - w - 0 flex - col overflow - hidden ` ,{variants:{variant:{default: ` border border - input text - foreground dark : bg - input / 30 has - [ > [ data - slot = code - block - content ] : focus - visible ] : border - ring ` ,destructive: ` border border - destructive / 30 text - destructive dark : border - destructive / 40 ` }},defaultVariants:{variant: ` default ` }}),Ix=Ie( ` - mx - 3 px - 3 in - data - numbered : gap - x - 3 before : min - w - 6 before : text - end before : text - muted - foreground after : start - 1 after : text - muted - foreground group - data - [ size = sm ] / code - block : - mx - 2.5 group - data - [ size = sm ] / code - block : px - 2.5 relative block min - h - lh after : absolute after : top - 0 after : select - none in - data - numbered : col - span - 2 in - data - numbered : grid in - data - numbered : grid - cols - subgrid in - data - numbered : [ counter - increment : line ] in - data - numbered : before : content - [ counter ( line ) ] in - data - numbered : before : select - none in - data - numbered : supports - [ content : counter ( line ) _ / _ '' ] : before : content - [ counter ( line ) _ / _ '' ] ` ,{variants:{variant:{default: ` ` ,added: ` bg - muted after : content - [ '+' ] ` ,removed: ` bg - destructive / 10 after : text - destructive after : content - [ '− ' ] ` ,highlighted: ` bg - muted ` }},defaultVariants:{variant: ` default ` }}),Lx=N({__name: ` Message ` ,props:{class:{type:[Boolean,null,String,Object,Array]},align:{default: ` start ` },asChild:{type:Boolean},as:{default: ` div ` }},setup(e){let t=e;return(n,r)=>(I(),K(B(et),{"data-slot": ` message ` ,"data-align":e.align,as:e.as,"as-child":e.asChild,class:R(B(U)( ` text - sm gap - 2 group / message relative flex w - full min - w - 0 data - [ align = end ] : flex - row - reverse ` ,t.class))},{default:F(()=>[G(n. $ slots, ` default ` )]),_:3},8,[ ` data - align ` , ` as ` , ` as - child ` , ` class ` ]))}}),Rx=N({__name: ` MessageContent ` ,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default: ` div ` }},setup(e){let t=e;return(n,r)=>(I(),K(B(et),{"data-slot": ` message - content ` ,as:e.as,"as-child":e.asChild,class:R(B(U)( ` gap - 2.5 group - data - [ align = end ] / message : * : data - slot : self - end flex w - full min - w - 0 flex - col wrap - break - word ` ,t.class))},{default:F(()=>[G(n. $ slots, ` default ` )]),_:3},8,[ ` as ` , ` as - child ` , ` class ` ]))}}),zx=N({__name: ` MessageFooter ` ,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default: ` div ` }},setup(e){let t=e;return(n,r)=>(I(),K(B(et),{"data-slot": ` message - footer ` ,as:e.as,"as-child":e.asChild,class:R(B(U)( ` text - xs font - medium text - muted - foreground px - 3 group - has - data - [ variant = ghost ] / message : px - 0 flex max - w - full min - w - 0 items - center group - data - [ align = end ] / message : justify - end ` ,t.class))},{default:F(()=>[G(n. $ slots, ` default ` )]),_:3},8,[ ` as ` , ` as - child ` , ` class ` ]))}});function Bx(e){switch(e.type){case ` image ` :return ` [ photo ] ` ;case ` video ` :return ` [ video ] ` ;case ` audio ` :return ` [ audio ] ` ;case ` document ` :return e.file_name? ` [ document : $ { e . file _name } ] ` : ` [ document ] ` ;default:return ` [ $ { e . type || ` attachment ` } ] ` }}function Vx(e){let t=[];return e.mime_type&&t.push(e.mime_type),e.file_name&&t.push(e.file_name),e.file_size!==void 0&&t.push( ` $ { e . file _size } bytes ` ),e.width&&e.height&&t.push( ` $ { e . width } × $ { e . height } ` ),e.duration!==void 0&&t.push( ` $ { e . duration } s ` ),t.join( ` · ` )}var Hx={class: ` truncate ` },Ux=N({__name: ` ChatAttachment ` ,props:{attachment:{}},setup(e){return(t,n)=>(I(),K(j(e.attachment.url? ` a ` : ` span ` ),{href:e.attachment.url,target:e.attachment.url? ` _blank ` :void 0,rel:e.attachment.url? ` noopener noreferrer ` :void 0,title:B(Vx)(e.attachment),class: ` inline - flex max - w - full items - center gap - 1.5 rounded - md border border - border bg - muted px - 2.5 py - 1 text - xs font - medium text - fg - muted ` },{default:F(()=>[O(B(ol),{"aria-hidden": ` true ` ,class: ` size - 3.5 shrink - 0 ` }),L( ` span ` ,Hx,z(B(Bx)(e.attachment)),1)]),_:1},8,[ ` href ` , ` target ` , ` rel ` , ` title ` ]))}}),Wx=N({__name: ` CodeView ` ,props:{code:{},lang:{},class:{}},setup(e){let t=e,n=Px(()=>t.code,()=>t.lang|| ` text ` );return(r,i)=>(I(),K(B(bf),{class:R(B(U)( ` bg - muted ` ,t.class))},{default:F(()=>[O(B(xf),null,{default:F(()=>[O(B(Df),{value:e.code},null,8,[ ` value ` ])]),_:1}),O(B(Tf),{wrap: ` ` ,class: ` max - h - [ 60 vh ] pe - 10 text - xs ` },{default:F(()=>[(I(!0),k(H,null,A(B(n),(e,t)=>(I(),K(B(wf),{key:t},{default:F(()=>[(I(!0),k(H,null,A(e,(e,t)=>(I(),K(B(Of),{key:t,token:e},null,8,[ ` token ` ]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[ ` class ` ]))}}),Gx=[ ` src ` , ` alt ` ],Kx={key:1},qx={key:2},Jx={key:3,class: ` rounded bg - foreground / 10 px - 1 py - 0.5 font - mono text - [ 0.9 em ] ` },Yx=[ ` href ` ],Xx={key:5},Zx=N({__name: ` ChatInline ` ,props:{inline:{}},setup(e){return(t,n)=>(I(!0),k(H,null,A(e.inline,(e,t)=>(I(),k(H,{key:t},[e.kind=== ` image ` ?(I(),k( ` img ` ,{key:0,src:e.src,alt:e.alt,loading: ` lazy ` ,class: ` my - 1 block max - h - 96 max - w - full cursor - pointer rounded - md border border - border bg - c Line truncated
` ),r=[],i=null,a=null,o= ` ` ,s=()=>{r.length&&(t.push({kind: ` p ` ,inline: $ x(r.join( ` ` ))}),r=[])},c=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=> $ x(e))}),null)};for(let e=0;e<n.length;e++){let l=n[e];if(l.startsWith(" ` ` ` " ) ) { s ( ) , c ( ) , a ? ( t . push ( { kind : ` pre ` , code : a . join ( `
` ),lang:o}),a=null):(a=[],o=l.slice(3).trim().split(/ \s /)[0]);continue}if(a){a.push(l);continue}let u=tS (l),d=e+1<n.length?tS (n[e+1]):null;if(u&&d&&nS (d)&&u.length===d.length){s(),c();let r=[];for(e+=2;e<n.length;e++){let t=tS (n[e]);if(!t||t.length!==u.length){e--;break}r.push(t)}t.push({kind: ` table ` ,head:u.map(e=> $ x(e)),rows:r.map(e=>e.map(e=> $ x(e)))});continue}if(!l.trim()){s(),c();continue}let f=l.match(/^(#{1,3}) \s +(.+) $ /);if(f){s(),c(),t.push({kind: ` h$ { f [ 1 ] . length } ` ,inline: $ x(f[2])});continue}let p=l.match(/^ \s *[-*] \s +(.+) $ /),m=l.match(/^ \s * \d +[.)] \s +(.+) $ /);if(p||m){s();let e=m? ` ol ` : ` ul ` ;(!i||i.tag!==e)&&(c(),i={tag:e,items:[]}),i.items.push((p||m)[1])}else l.startsWith( ` > ` )?(s(),c(),t.push({kind: ` blockquote ` ,inline: $ x(l.replace(/^> \s ?/, ` ` ))})):r.push(l)}return s(),c(),a&&t.push({kind: ` pre ` ,code:a.join( `
` ),lang:o}),t}function tS (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 nS (e){return e.every(e=>/^:?-{3,}:? $ /.test(e))}var rS ={class: ` [ overflow - wrap : anywhere ] ` },iS ={key:1,class: ` my - 3 w - full border - collapse text - [ 0.92 em ] ` },a S={key:2,class: ` my - 2 border - l - [ 3 px ] border - primary pl - 3 text - fg - muted ` },o S={key:3,class: ` mt - 1 mb - 2 text - xl leading - tight font - semibold tracking - [ - 0.02 em ] ` },s S={key:4,class: ` mt - 1 mb - 2 text - lg leading - tight font - semibold tracking - [ - 0.02 em ] ` },c S={key:5,class: ` mt - 1 mb - 2 text - base leading - tight font - semibold tracking - [ - 0.02 em ] ` },l S={key:6,class: ` my - 2.5 flex list - disc flex - col gap - 1 pl - 5 ` },u S={key:7,class: ` my - 2.5 flex list - decimal flex - col gap - 1 pl - 5 ` },d S={key:8,class: ` mb - 2.5 last : mb - 0 ` },f S=N({__name: ` ChatMarkdown ` ,props:{text:{}},setup(e){let t=e,n=J(()=>eS (t.text));return(e,t)=>(I(),k( ` div ` ,rS ,[(I(!0),k(H,null,A(n.value,(e,t)=>(I(),k(H,{key:t},[e.kind=== ` pre ` ?(I(),K(W x,{key:0,code:e.code,lang:e.lang,class: ` my - 2 ` },null,8,[ ` code ` , ` lang ` ])):e.kind=== ` table ` ?(I(),k( ` table ` ,iS ,[L( ` thead ` ,null,[L( ` tr ` ,null,[(I(!0),k(H,null,A(e.head,(e,t)=>(I(),k( ` th ` ,{key:t,class: ` border border - border bg - muted px - 2 py - 1.5 text - left font - semibold ` },[O(Z x,{inline:e},null,8,[ ` inline ` ])]))),128))])]),L( ` tbody ` ,null,[(I(!0),k(H,null,A(e.rows,(e,t)=>(I(),k( ` tr ` ,{key:t},[(I(!0),k(H,null,A(e,(e,t)=>(I(),k( ` td ` ,{key:t,class: ` border border - border px - 2 py - 1.5 text - left ` },[O(Z x,{inline:e},null,8,[ ` inline ` ])]))),128))]))),128))])])):e.kind=== ` blockquote ` ?(I(),k( ` blockquote ` ,a S,[O(Z x,{inline:e.inline},null,8,[ ` inline ` ])])):e.kind=== ` h1 ` ?(I(),k( ` h1 ` ,o S,[O(Z x,{inline:e.inline},null,8,[ ` inline ` ])])):e.kind=== ` h2 ` ?(I(),k( ` h2 ` ,s S,[O(Z x,{inline:e.inline},null,8,[ ` inline ` ])])):e.kind=== ` h3 ` ?(I(),k( ` h3 ` ,c S,[O(Z x,{inline:e.inline},null,8,[ ` inline ` ])])):e.kind=== ` ul ` ?(I(),k( ` ul ` ,l S,[(I(!0),k(H,null,A(e.items,(e,t)=>(I(),k( ` li ` ,{key:t},[O(Z x,{inline:e},null,8,[ ` inline ` ])]))),128))])):e.kind=== ` ol ` ?(I(),k( ` ol ` ,u S,[(I(!0),k(H,null,A(e.items,(e,t)=>(I(),k( ` li ` ,{key:t},[O(Z x,{inline:e},null,8,[ ` inline ` ])]))),128))])):e.kind=== ` p ` ?(I(),k( ` p ` ,d S,[O(Z x,{inline:e.inline},null,8,[ ` inline ` ])])):P( ` ` ,!0)],64))),128))]))}}),p S={class: ` truncate ` },m S=N({__name: ` ChatNavChip ` ,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=S e( ` RouterLink ` );return I(),K(r,{to:e.path,title: ` Go to $ { e . label || e . path } ` ,class: ` inline - flex max - w - full items - center gap - 1.5 rounded - md border border - primary / 45 bg - primary - soft px - 2.5 py - 1 text - xs font - semibold text - link transition - colors hover : border - primary hover : bg - primary / 15 focus - visible : outline - 2 focus - visible : outline - offset - 2 focus - visible : outline - primary ` },{default:F(()=>[O(B(hc),{"aria-hidden": ` true ` ,class: ` size - 3.5 shrink - 0 ` }),L( ` span ` ,p S,z(e.label||e.path),1)]),_:1},8,[ ` to ` , ` title ` ])}}}),h S={class: ` font - mono text - foreground ` },g S={key:0,class: ` shrink - 0 text - xs tabular - nums ` },_ S={class: ` font - mono text - foreground ` },v S={key:0,class: ` shrink - 0 text - xs tabular - nums ` },y S=N({__name: ` ChatToolCall ` ,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=J(()=>t.tool.name||t.tool.Name||t.tool.tool|| ` tool ` ),r=J(()=>t.tool.parameters||t.tool.Parameters|| ` ` ),i=J(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=J(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err|| ` ` ),o=J(()=>!a.value&&!i.value&&!!t.streaming),s=J(()=>{let e=t.tool.duration_ms;return e?e<1e3? ` $ { e } ms ` : ` $ { ( e / 1e3 ) . toFixed ( + ( e < 1e4 ) ) } s ` : ` ` }),c=J(()=>{try{let e=JSON.parse(r.value);if(e&&typeof e== ` object ` &&!Array.isArray(e)){let t=Object.values(e).find(e=>typeof e== ` string ` &&e);return typeof t== ` string ` ?t.split( `
` ,1)[0]:Object.entries(e).map(([e,t])=> ` $ { e } : $ { typeof t == ` object ` ? JSON . stringify ( t ) : t } ` ).join( ` , ` )}}catch{}return r.value.split( `
` ,1)[0]}),l=J(()=>[r.value&& ` > $ { r . value } ` ,a.value].filter(Boolean).join( `
` ));return(t,r)=>e.tool.path?(I(),K(lS,{key:0,path:e.tool.path,label:e.tool.label},null,8,[ ` path ` , ` label ` ])):l.value?(I(),K(B(sf),{key:1,"default-open":i.value},{default:F(()=>[O(B(uf),null,{default:F(()=>[O(B(ff),{status:i.value? ` error ` :o.value? ` running ` :void 0},{default:F(()=>[O(B(lf),null,{default:F(()=>[i.value?(I(),K(B(kc),{key:0})):o.value?(I(),K(B(Xc),{key:1,class: ` animate - spin ` })):(I(),K(B(Tc),{key:2,class: ` text - success ` }))]),_:1}),L( ` span ` ,uS,z(n.value),1),O(B(pf),{class: ` font - mono text - xs ` },{default:F(()=>[V(z(c.value),1)]),_:1}),s.value?(I(),k( ` span ` ,dS,z(s.value),1)):P( ` ` ,!0)]),_:1},8,[ ` status ` ])]),_:1}),O(B(cf),null,{default:F(()=>[O(B(hf),{size: ` sm ` },{default:F(()=>[O(B(bf),{wrap: ` ` ,class: ` max - h - 64 ` },{default:F(()=>[V(z(l.value),1)]),_:1})]),_:1})]),_:1})]),_:1},8,[ ` default - open ` ])):(I(),K(B(ff),{key:2,status:i.value? ` error ` :o.value? ` running ` :void 0},{default:F(()=>[O(B(lf),null,{default:F(()=>[i.value?(I(),K(B(kc),{key:0})):o.value?(I(),K(B(Xc),{key:1,class: ` animate - spin ` })):(I(),K(B(Tc),{key:2,class: ` text - success ` }))]),_:1}),L( ` span ` ,fS,z(n.value),1),O(B(pf),{class: ` font - mono text - xs ` },{default:F(()=>[V(z(c.value),1)]),_:1}),s.value?(I(),k( ` span ` ,pS,z(s.value),1)):P( ` ` ,!0)]),_:1},8,[ ` status ` ]))}}),hS={class: ` flex flex - col gap - 1.5 ` },gS=N({__name: ` ChatToolGroup ` ,props:{tools:{},streaming:{type:Boolean}},setup(e){let t=e,n=e=>!!(e.err||e.Err||e.failed),r=J(()=>t.tools.some(n)),i=J(()=> ` $ { t . tools . length } tool call$ { t . tools . length === 1 ? ` ` : ` s ` } ` );return(t,n)=>(I(),K(B(sf),{"default-open":r.value},{default:F(()=>[O(B(uf),null,{default:F(()=>[O(B(ff),{status:r.value? ` error ` :void 0},{default:F(()=>[O(B(lf),null,{default:F(()=>[O(B(Ml))]),_:1}),O(B(pf),{class: ` truncate ` },{default:F(()=>[V(z(i.value),1)]),_:1})]),_:1},8,[ ` status ` ])]),_:1}),O(B(cf),null,{default:F(()=>[L( ` div ` ,hS,[(I(!0),k(H,null,A(e.tools,(t,n)=>(I(),K(mS,{key:n,tool:t,streaming:e.streaming&&n===e.tools.length-1},null,8,[ ` tool ` , ` streaming ` ]))),128))])]),_:1})]),_:1},8,[ ` default - open ` ]))}}),_S={key:0,class: ` mb - 2 flex flex - wrap gap - 1.5 ` },vS={key:2,class: ` whitespace - pre - wrap ` },yS=N({__name: ` ChatBubble ` ,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){let t=e,n=J(()=>{let e=Array.from(t.text),n=[],r=0,i=!1;for(let a of t.tools){let t=Math.min(Math.max(a.text_offset??0,r),e.length);t>r&&(n.push({text:e.slice(r,t).join( ` ` )}),r=t,i=!1);let o=n[n.length-1];!a.path&&i&&o&& ` tools ` in o?o.tools.push(a):(n.push({tools:[a]}),i=!a.path)}return r<e.length&&n.push({text:e.slice(r).join( ` ` )}),n});return(t,r)=>(I(),K(B(Mx),{align:e.assistant? ` start ` : ` end ` },{default:F(()=>[O(B(Nx),null,{default:F(()=>[O(B( $ d),{variant:e.assistant? ` muted ` : ` tinted ` ,class: ` max - w - [ min ( 78 ch , 92 % ) ] ` },{default:F(()=>[O(B(ef),{class: ` [ overflow - wrap : anywhere ] ` },{default:F(()=>[e.media.length?(I(),k( ` div ` ,_S,[(I(!0),k(H,null,A(e.media,(e,t)=>(I(),K(Rx,{key:t,attachment:e},null,8,[ ` attachment ` ]))),128))])):P( ` ` ,!0),e.assistant?(I(!0),k(H,{key:1},A(n.value,(t,r)=>(I(),k(H,{key:r},[ ` text ` in t?(I(),K(sS,{key:0,text:t.text},null,8,[ ` text ` ])):(I(),K(B(nf),{key:1,class: ` my - 2 ` },{default:F(()=>[t.tools.length>1?(I(),K(gS,{key:0,tools:t.tools,streaming:e.streaming&&r===n.value.length-1},null,8,[ ` tools ` , ` streaming ` ])):(I(),K(mS,{key:1,tool:t.tools[0],streaming:e.streaming&&r===n.value.length-1},null,8,[ ` tool ` , ` streaming ` ]))]),_:2},1024))],64))),128)):(I(),k( ` div ` ,vS,z(e.text),1)),G(t. $ slots, ` default ` )]),_:3})]),_:3},8,[ ` variant ` ]),e.assistant&&!e.streaming&&e.text?(I(),K(B(Px),{key:0,class: ` px - 0 transition - opacity focus - within : opacity - 100 [ @ media ( hover : hover ) ] : opacity - 0 [ @ media ( hover : hover ) ] : group - hover / message : opacity - 100 ` },{default:F(()=>[O(B(Sf),{value:e.text},null,8,[ ` value ` ])]),_:1})):P( ` ` ,!0)]),_:3})]),_:3},8,[ ` align ` ]))}}),bS={class: ` text - sm ` },xS={key:0,class: ` mt - 1 text - fg - muted ` },SS={key:1,class: ` mt - 2 flex flex - wrap gap - 2 ` },CS=N({__name: ` ChatChooseCard ` ,props:{choose:{}},setup(e){let t=J(()=>iu.value.models??[]);return(e,n)=>(I(),k( ` div ` ,bS,[n[0]||=L( ` p ` ,{class: ` font - medium ` }, ` Choose a model ` ,-1),t.value.length?(I(),k( ` div ` ,SS,[(I(!0),k(H,null,A(t.value,e=>(I(),K(B(Y),{key:e,size: ` sm ` ,variant:e===B(iu).active_model? ` default ` : ` outline ` ,class: ` font - mono ` ,onClick:t=>void B(Su)(e)},{default:F(()=>[V(z(e),1)]),_:2},1032,[ ` variant ` , ` onClick ` ]))),128))])):(I(),k( ` p ` ,xS, ` None configured . ` ))]))}}),wS={class: ` text - sm ` },TS={key:0},ES={class: ` mt - 1 space - y - 0.5 ` },DS={class: ` font - mono ` },OS=[ ` href ` ],kS={key:0,class: ` mt - 3 flex gap - 2 ` },AS={key:1,class: ` mt - 2 text - fg - muted ` },jS={key:2,class: ` mt - 2 text - fg - muted ` },MS={key:3,class: ` mt - 2 text - ok ` },NS={key:4,class: ` mt - 2 text - danger ` },PS={key:5,class: ` mt - 2 text - xs text - fg - muted ` },FS=N({__name: ` ChatUpdateCard ` ,props:{update:{}},setup(e){let t=e,n=J(()=>t.update.available??[]),r=q( ` idle ` ),i=q( ` ` );async function a(){r.value= ` installing ` ;try{let e=(await X.updateInstall(t.update.snapshot)).result?.installed;i.value=e?Object.entries(e).map(([e,t])=> ` $ { e } → $ { t } ` ).join( ` ,
Line truncated
` ).map(e=>e.trim()).find(Boolean)|| ` ` ,i=r.length>Zw? ` $ { r . slice ( 0 , Zw ) . trimEnd ( ) } … ` :r;return{text:i,full:n,truncated:i!==n}}function Pte(e){return String(e|| ` event ` ).replaceAll( ` _ ` , ` ` ).replace(/ \b \w /g,e=>e.toUpperCase())}function $ w(e){let t=Number(e);if(!Number.isFinite(t)||t<0)return ` ` ;if(t<1e3)return ` under 1 s ` ;let n=t/1e3;if(n<60)return ` $ { n . toFixed ( + ( n < 10 ) ) } s ` ;let r=Math.round(n),i=Math.floor(r/60),a=r%60;if(i<60)return a===0? ` $ { i } min ` : ` $ { i } min $ { a } s ` ;let o=Math.floor(i/60),s=i-o*60;return s===0? ` $ { o } h ` : ` $ { o } h $ { s } min ` }function eT(e){let t=Number(e);return!Number.isFinite(t)||t<=0? ` ` :t.toLocaleString( ` en - US ` )}function tT(e){return typeof e== ` string ` ?e: ` ` }function nT(e={}){let t=e.data||{},n=e.stage|| ` unknown stage ` ,r=e.workflow? ` $ { e . workflow } workflow ` : ` ` ;if(e.kind=== ` stage _start ` )return{title: ` Started stage : $ { n } ` ,detail:r};if(e.kind=== ` stage _finish ` ){let e=[r, $ w(t.duration_ms)].filter(Boolean).join( ` · ` );return{title:t.interrupted? ` Stage interrupted : $ { n } ` :t.skipped? ` Skipped stage : $ { n } ` :t.error? ` Stage failed : $ { n } ` : ` Finished stage : $ { n } ` ,detail:[e,tT(t.error),tT(t.when)].filter(Boolean).join( ` · ` )}}if(e.kind=== ` task _retried ` ){let n=Number(t.retry_count);return{title:Number.isFinite(n)&&n>0? ` Retry $ { n } ` : ` Retry requested ` ,detail:[tT(t.previous_stage)&& ` after $ { tT ( t . previous _stage ) } ` ,tT(t.previous_reason)].filter(Boolean).join( ` : ` )||e.detail|| ` ` }}if(e.kind=== ` agent _finish ` ){let r=eT(t.iterations),i=eT(t.tokens),a=Number(t.cached_tokens)||0,o=eT((Number(t.prompt_tokens)||0)-a),s=eT(t.completion_tokens),c=eT(t.cached_tokens),l=[r&& ` $ { r } iterations ` ,i&& ` $ { i } tokens ` ,o&& ` $ { o } fresh prompt ` ,s&& ` $ { s } completion ` ,c&& ` $ { c } cached ` ,tT(t.model)].filter(Boolean);return{title: ` Agent $ { tT ( t . status ) || ` finished ` } : $ { n } ` ,detail:l.join( ` · ` )||e.detail|| ` ` }}if(e.kind=== ` remediation _round ` ){let e=Number(t.of),n=tT(t.author);return{title: ` Remediation $ { tT ( t . round ) } $ { e > 0 ? ` of ${ e } ` : ` ` } ` ,detail:[n&& ` answers $ { n } ' s review ` ,t.review_id? ` # $ { tT ( t . review _id ) } ` : ` ` ].filter(Boolean).join( ` ` )}}if(e.kind=== ` review _approved ` ){let e=tT(t.pr_number);return{title: ` Pull request approved ` ,detail:[tT(t.author),e&& ` # $ { e } ` ].filter(Boolean).join( ` · ` )}}if(e.kind=== ` step _retried ` )return{title: ` Attempt $ { tT ( t . attempt ) } of $ { tT ( t . of ) } failed : $ { e . stage || ` step ` } ` ,detail:tT(t.error),tone: ` warn ` };if(e.kind=== ` config _captured ` )return{title: ` Configuration captured ` ,detail: ` The effective task - runtime configuration for this run . ` };if(e.kind=== ` binding _started ` ){let e=tT(t.source),n=tT(t.capture_id),r=[{label: ` binding $ { tT ( t . binding _name ) || tT ( t . binding _id ) } ` ,to: ` / events ? tab = bindings ` },...n?[{label: ` captured event ` ,to: ` / events ? tab = inspector & capture = $ { encodeURIComponent ( n ) } ` }]:[]];return t.unsigned===!0?{title: ` Started by an unsigned event ` ,detail:e? ` source $ { e } ` : ` ` ,tone: ` warn ` ,links:r}:{title: ` Started by an event ` ,detail:e? ` source $ { e } ` : ` ` ,links:r}}if(e.kind=== ` changes _captured ` ){let e=t.totals??{},n=Number(e.files);return{title: ` Change capture recorded ` ,detail:[Number.isFinite(n)&&n>0? ` $ { n } file$ { n === 1 ? ` ` : ` s ` } changed ` : ` ` ,t.captured_after? ` captured after $ { tT ( t . captured _after ) } ` : ` ` ].filter(Boolean).join( ` · ` )}}return{title:Pte(e.kind||e.type),detail:e.detail|| ` ` }}var Fte=[ ` title ` ],rT=N({__name: ` ActivityRow ` ,props:{event:{}},emits:[ ` open ` ],setup(e,{emit:t}){let n=Xw();n.watchIdentities();let r=e,i=t,a=Ww(),o=J(()=>a.taskIDFor(r.event)),s=J(()=>Qw(r.event,n.identityName));function c(){o.value>0&&i( ` open ` ,o.value)}return(t,n)=>(I(),K(B(rr),{class:R(o.value>0? ` cursor - pointer ` : ` ` ),role:o.value>0? ` link ` :void 0,tabindex:o.value>0?0:void 0,title:o.value>0? ` Open task details ` :void 0,onClick:c,onKeydown:[it(at(c,[ ` prevent ` ]),[ ` enter ` ]),it(at(c,[ ` prevent ` ]),[ ` space ` ])]},{default:F(()=>[O(B(er),{class: ` font - medium ` },{default:F(()=>[V(z(B(nT)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),O(B(er),{class: ` font - mono ` },{default:F(()=>[V(z(o.value>0? ` # $ { o . value } ` : ` – ` ),1)]),_:1}),O(B(er),{class: ` w - [ 55 % ] max - w - 0 ` },{default:F(()=>[L( ` span ` ,{class: ` block truncate ` ,title:s.value.truncated?s.value.full:void 0},z(s.value.text),9,Fte)]),_:1}),O(B(er),null,{default:F(()=>[O(B(sC),{at:e.event.at},null,8,[ ` at ` ])]),_:1})]),_:1},8,[ ` class ` , ` role ` , ` tabindex ` , ` title ` , ` onKeydown ` ]))}}),Ite=[{value: ` all ` ,label: ` All ` },{value: ` tasks ` ,label: ` Tasks ` },{value: ` system ` ,label: ` System ` }];function iT(e){return(Number(e?.task_id)||0)>0}function Lte(e,t){return t=== ` tasks ` ?iT(e):t!== ` system ` ||!iT(e)}function Rte(e,t){return e.filter(e=>Lte(e,t))}function zte(e,t){return e>0? ` ` :t=== ` all ` ? ` Waiting for activity ` :t=== ` tasks ` ? ` No task events yet ` : ` No system events yet ` }function Bte(e,t){return ` $ { e } : $ { t ? ? 0 } ` }function Vte(e){let t=[];for(let n of e){let e=n.kind||n.type|| ` event ` ,r=Number(n.task_id)||0,i=Bte(Qw(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 Hte={role: ` region ` ,"aria-label": ` Activity ` ,"aria-live": ` polite ` },Ute={class: ` max - h - [ 28 rem ] overflow - y - auto ` },Wte={clas
Line truncated
` ,1)[0]?? ` ` ;return t.length>80? ` $ { t . slice ( 0 , 79 ) } … ` :t}function NT(e){return(e?.merged||0)+(e?.completed||0)}function PT(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 Sne(e,t){return e.filter(e=>e.required&&!(t[e.name]?? ` ` ).trim()).map(e=>e.name)}function FT(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 Cne(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!== ` ` &&(n[r.name]=FT(e,r.type))}return n}var wne=[ ` onKeydown ` ],Tne={key:0,class: ` text - sm text - danger ` ,role: ` alert ` },Ene={key:1,class: ` grid gap - 1.5 ` },Dne=[ ` for ` ],One={key:0,class: ` font - normal text - fg - subtle ` },kne=[ ` id ` ],Ane=[ ` value ` ],jne={key:0,class: ` text - xs text - fg - subtle ` },Mne={key:2,class: ` grid gap - 1.5 ` },Nne=[ ` id ` ],Pne={class: ` block truncate text - label font - medium ` },Fne={class: ` block text - xs text - fg - subtle ` },Ine={key:0,class: ` text - xs text - fg - subtle ` },Lne={key:3,class: ` grid gap - 3 ` },Rne=[ ` for ` ],zne={class: ` font - mono ` },Bne={key:0,class: ` text - fg - subtle ` },Vne={class: ` grid gap - 1.5 ` },Hne=[ ` for ` ],Une={class: ` grid gap - 1.5 ` },Wne=[ ` for ` ],Gne={key:4,class: ` text - sm text - danger ` ,role: ` alert ` },Kne={class: ` flex items - center gap - 2 border - t border - border pt - 4 ` },qne={class: ` mr - auto text - xs text - fg - subtle ` },IT=N({__name: ` NewTaskForm ` ,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[ ` started ` , ` cancel ` ],setup(e,{emit:t}){let n=e,r=t,i=he(),a=q([]),o=q([]),s=q([]),c=q( ` ` );Ae(async()=>{try{let[e,t]=await Promise.all([X.workflows(),X.repositories()]);a.value=(e?.definitions??[]).filter(e=>e.enabled),o.value=e?.workflows??[],s.value=(t??[]).map(e=> ` $ { e . owner } / $ { e . name } ` )}catch(e){c.value=String(e.message||e)}});let l=q( ` ` ),u=q(n.workflow??n.initialWorkflow?? ` ` ),d=q(n.initialInstructions?? ` ` ),f=q(MT(d.value)),p=q({});me(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=J(()=>a.value.find(e=>e.id===u.value)),h=J(()=>PT(m.value)),g=J(()=>Sne(h.value,p.value)),_=J(()=>m.value?.repository?? ` required ` ),v=J(()=>_.value!== ` optional ` &&_.value!== ` none ` ),y=e=>o.value.find(t=>t.workflow===e),b=q(!1),x=q( ` ` ),S=J(()=>!(!l.value.trim()&&v.value||!u.value||!f.value.trim())&&g.value.length===0);async function ee(){if(S.value&&!b.value){b.value=!0,x.value= ` ` ;try{let e=await X.workRequest({repository:_.value=== ` none ` ? ` ` :l.value.trim(),workflow:u.value,title:f.value.trim(),instructions:d.value,inputs:Cne(h.value,p.value),...n.draft?{draft:n.draft}:{}});r( ` started ` ,e.task_id)}catch(e){x.value=String(e.message||e)}finally{b.value=!1}}}return(e,t)=>(I(),k( ` form ` ,{class: ` grid gap - 5 ` ,onSubmit:at(ee,[ ` prevent ` ]),onKeydown:[it(at(ee,[ ` meta ` , ` prevent ` ]),[ ` enter ` ]),it(at(ee,[ ` ctrl ` , ` prevent ` ]),[ ` enter ` ])]},[c.value?(I(),k( ` p ` ,Tne,z(c.value),1)):P( ` ` ,!0),_.value=== ` none ` ?P( ` ` ,!0):(I(),k( ` div ` ,Ene,[L( ` label ` ,{for: ` $ { B ( i ) } - repo ` ,class: ` text - label font - medium ` },[t[5]||=V( ` Repository ` ,-1),v.value?P( ` ` ,!0):(I(),k( ` span ` ,One, ` ( optional ) ` ))],8,Dne),O(B(Z),{id: ` $ { B ( i ) } - repo ` ,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class: ` font - mono ` ,placeholder: ` owner / repository ` ,list: ` $ { B ( i ) } - repos ` ,required:v.value},null,8,[ ` id ` , ` modelValue ` , ` list ` , ` required ` ]),L( ` datalist ` ,{id: ` $ { B ( i ) } - repos ` },[(I(!0),k(H,null,A(s.value,e=>(I(),k( ` option ` ,{key:e,value:e},null,8,Ane))),128))],8,kne),s.value.length?(I(),k( ` p ` ,jne,[t[6]||=V( ` Configured : ` ,-1),(I(!0),k(H,null,A(s.value,e=>(I(),K(B(Y),{key:e,type: ` button ` ,variant: ` link ` ,size: ` xs ` ,class: ` h - auto px - 1 font - mono text - fg - subtle ` ,onClick:t=>l.value=e},{default:F(()=>[V(z(e),1)]),_:2},1032,[ ` onClick ` ]))),128))])):P( ` ` ,!0)])),n.workflow?P( ` ` ,!0):(I(),k( ` div ` ,Mne,[L( ` span ` ,{id: ` $ { B ( i ) } - wf ` ,class: ` text - label font - medium ` }, ` Workflow ` ,8,Nne),O(B(is),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-labelledby": ` $ { B ( i ) } - wf ` ,class: ` grid grid - cols - 1 gap - 2 sm : grid - cols - 3 ` ,loop: ` ` },{default:F(()=>[(I(!0),k(H,null,A(a.value,e=>(I(),K(B(os),{key:e.id,value:e.id,class: ` rounded - md border border - border bg - card px - 3 py - 2.5 text - left transition - colors hover : bg - secondary focus - visible : outline - 2 focus - visible : outline - ring data - [ state = checked ] : border - primary data - [ state = checked ] : bg - secondary ` },{default:F(()=>[L( ` span ` ,Pne,z(e.name||e.id),1),L( ` span ` ,Fne,[V(z(y(e.id)?.runs||0)+ ` runs ` ,1),y(e.id)?.runs?(I(),k(H,{key:0},[V( ` · ` +z(Math.round(B(NT)(y(e.id))/(y(e.id)?.runs||1)*100))+ ` % delivered ` ,1)],64)):P( ` ` ,!0)])]),_:2},1032,[ ` value ` ]))),128))]),_:1},8,[ ` modelValue ` , ` aria - labelledby ` ]),!a.value.length&&!c.value?(I(),k( ` p ` ,Ine, ` No enabled workflows . ` )):P( ` ` ,!0)])),h.value.length?(I(),k( ` div ` ,Lne,[(I(!0),k(H,null,A(h.value,e=>(I(),k( ` div ` ,{key:e.name,class: ` grid gap - 1.5 ` },[L( ` label ` ,{for: ` $ { B ( i ) } - input - $ { e . name } ` ,class: ` text - label font - medium ` },[L( ` span ` ,zne,z(e.name),1),e.required?(I(),k( ` span ` ,Bne, ` · required ` )):P( ` ` ,!0)],8,Rne),O(B(Z),{id: ` $ { B ( i 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 ore(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 BT(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 VT(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 HT(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 UT=q([]),WT=q([]),GT=q(!0),KT=q(null),qT=q(!0),JT=q(null),YT=q(!1),XT=q(null);async function ZT(){try{let e=await X.eventTypes(zT().workspace);GT.value=e.enabled!==!1,UT.value=e.event_types||[],WT.value=e.proposals||[],KT.value=null}catch(e){KT.value=e.message||String(e)}finally{qT.value=!1}}function QT(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function $ T(e){XT.value=null,JT.value=e}function sre(e){let t=nE.value.find(t=>String(t.id)===e.sample_id); $ T({mode: ` proposal ` ,id:null,source:e.source,name: ` ` ,rule:QT(e.rule),headersText: ` ` ,body:t?.body|| ` ` ,exampleHeaders:e.headers||{}})}function cre(e= ` ` ){ $ T({mode: ` paste ` ,id:null,source:e,name: ` ` ,rule:{headers:[],payload:[]},headersText: ` ` ,body: ` ` ,exampleHeaders:{}})}function lre(e){ $ T({mode: ` edit ` ,id:e.id,source:e.source,name:e.name,rule:QT(e.rule),headersText: ` ` ,body: ` ` ,exampleHeaders:{}})}function eE(){JT.value=null}async function ure(){let e=JT.value;if(e){YT.value=!0;try{if(e.mode=== ` edit ` &&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:HT(e.rule)});else{let t=e.mode=== ` paste ` ?are(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode=== ` paste ` ?void 0:HT(e.rule),example:{headers:t,body:e.body}})}JT.value=null,await ZT()}catch(e){XT.value=e.message||String(e)}finally{YT.value=!1}}}var tE=q(null);async function dre(){let e=tE.value;if(tE.value=null,e)try{await X.eventTypeDelete(e.id),await ZT()}catch(e){KT.value=e.message||String(e)}}var fre=100,nE=q([]),rE=q(!0),iE=q(null),aE=q(!0),oE=q(null);async function sE(){try{let e=await X.captures(fre);rE.value=e.enabled!==!1,nE.value=e.captures||[],iE.value=null}catch(e){iE.value=e.message||String(e)}finally{aE.value=!1}}function cE(e){let t=nE.value.find(t=>t.id===e);return t&&(oE.value=t),!!t}function lE(){nE.value.length&&(oE.value=nE.value[0])}function uE(){wn( ` captures ` ,()=>{sE(),ZT()})}var dE=N({__name: ` Tabs ` ,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[ ` update : modelValue ` ],setup(e,{emit:t}){let n=e,r=t,i=lt(n, ` class ` ),a=C(i,r);return(e,t)=>(I(),K(B(hs),W({"data-slot": ` tabs ` ,"data-orientation":B(a).orientation|| ` horizontal ` },B(a),{class:B(U)( ` gap - 2 group / tabs flex data - horizontal : flex - col ` ,n.class)}),{default:F(t=>[G(e. $ slots, ` default ` ,Re(de(t)))]),_:3},16,[ ` data - orientation ` , ` class ` ]))}}),fE=N({__name: ` TabsContent ` ,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=lt(t, ` class ` );return(e,r)=>(I(),K(B(vs),W({"data-slot": ` tabs - content ` ,class:B(U)( ` text - sm flex - 1 outline - none ` ,t.class)},B(n)),{default:F(()=>[G(e. $ slots, ` default ` )]),_:3},16,[ ` class ` ]))}}),pE=N({__name: ` TabsList ` ,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default: ` default ` }},setup(e){let t=e,n=lt(t, ` class ` , ` variant ` );return(r,i)=>(I(),K(B(ys),W({"data-slot": ` tabs - list ` ,"data-variant":e.variant},B(n),{class:B(U)(B(hE)({variant:e.variant}),t.class)}),{default:F(()=>[G(r. $ slots, ` default ` )]),_:3},16,[ ` data - variant ` , ` class ` ]))}}),mE=N({__name: ` TabsTrigger ` ,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=lt(t, ` class ` ),r=S(n);return(e,n)=>(I(),K(B(bs),W({"data-slot": ` tabs - trigger ` ,class:B(U)( ` gap - 1.5 rounded - md border border - transparent px - 1.5 py - 0.5 text - sm font - medium group - data - [ variant = default ] / tabs - list : data - active : shadow - sm group - data - [ variant = line ] / tabs - list : data - active : shadow - none [ & _svg : not ( [ class *= size - ] ) ] : size - 4 has - data - [ icon = inline - end ] : pr - 1 has - data - [ icon = inline - start ] : pl - 1 relative inline - flex h - [ calc ( 100 % - 1 px ) ] flex - 1 items - center justify - center whitespace - nowrap text - foreground / 60 transition - all group - data - vertical / tabs : w - full group - data - vertical / tabs : justify - start hover : text - foreground focus - visible : border - ring focus - visible : ring - 3 focus - visible : ring - ring / 50 focus - visible : outline - 1 focus - Line truncated
` ));return(t,r)=>e.tool.path?(I(),K(mS,{key:0,path:e.tool.path,label:e.tool.label},null,8,[ ` path ` , ` label ` ])):l.value?(I(),K(B(ff),{key:1,"default-open":i.value},{default:F(()=>[O(B(hf),null,{default:F(()=>[O(B(_f),{status:i.value? ` error ` :o.value? ` running ` :void 0},{default:F(()=>[O(B(mf),null,{default:F(()=>[i.value?(I(),K(B(kc),{key:0})):o.value?(I(),K(B(Xc),{key:1,class: ` animate - spin ` })):(I(),K(B(Tc),{key:2,class: ` text - success ` }))]),_:1}),L( ` span ` ,hS,z(n.value),1),O(B(vf),{class: ` font - mono text - xs ` },{default:F(()=>[V(z(c.value),1)]),_:1}),s.value?(I(),k( ` span ` ,gS,z(s.value),1)):P( ` ` ,!0)]),_:1},8,[ ` status ` ])]),_:1}),O(B(pf),null,{default:F(()=>[O(B(bf),{size: ` sm ` },{default:F(()=>[O(B(Tf),{wrap: ` ` ,class: ` max - h - 64 ` },{default:F(()=>[V(z(l.value),1)]),_:1})]),_:1})]),_:1})]),_:1},8,[ ` default - open ` ])):(I(),K(B(_f),{key:2,status:i.value? ` error ` :o.value? ` running ` :void 0},{default:F(()=>[O(B(mf),null,{default:F(()=>[i.value?(I(),K(B(kc),{key:0})):o.value?(I(),K(B(Xc),{key:1,class: ` animate - spin ` })):(I(),K(B(Tc),{key:2,class: ` text - success ` }))]),_:1}),L( ` span ` ,_S,z(n.value),1),O(B(vf),{class: ` font - mono text - xs ` },{default:F(()=>[V(z(c.value),1)]),_:1}),s.value?(I(),k( ` span ` ,vS,z(s.value),1)):P( ` ` ,!0)]),_:1},8,[ ` status ` ]))}}),bS={class: ` flex flex - col gap - 1.5 ` },xS=N({__name: ` ChatToolGroup ` ,props:{tools:{},streaming:{type:Boolean}},setup(e){let t=e,n=e=>!!(e.err||e.Err||e.failed),r=J(()=>t.tools.some(n)),i=J(()=> ` $ { t . tools . length } tool call$ { t . tools . length === 1 ? ` ` : ` s ` } ` );return(t,n)=>(I(),K(B(ff),{"default-open":r.value},{default:F(()=>[O(B(hf),null,{default:F(()=>[O(B(_f),{status:r.value? ` error ` :void 0},{default:F(()=>[O(B(mf),null,{default:F(()=>[O(B(Ml))]),_:1}),O(B(vf),{class: ` truncate ` },{default:F(()=>[V(z(i.value),1)]),_:1})]),_:1},8,[ ` status ` ])]),_:1}),O(B(pf),null,{default:F(()=>[L( ` div ` ,bS,[(I(!0),k(H,null,A(e.tools,(t,n)=>(I(),K(yS,{key:n,tool:t,streaming:e.streaming&&n===e.tools.length-1},null,8,[ ` tool ` , ` streaming ` ]))),128))])]),_:1})]),_:1},8,[ ` default - open ` ]))}}),SS={key:0,class: ` mb - 2 flex flex - wrap gap - 1.5 ` },CS={key:2,class: ` whitespace - pre - wrap ` },wS=N({__name: ` ChatBubble ` ,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){let t=e,n=J(()=>{let e=Array.from(t.text),n=[],r=0,i=!1;for(let a of t.tools){let t=Math.min(Math.max(a.text_offset??0,r),e.length);t>r&&(n.push({text:e.slice(r,t).join( ` ` )}),r=t,i=!1);let o=n[n.length-1];!a.path&&i&&o&& ` tools ` in o?o.tools.push(a):(n.push({tools:[a]}),i=!a.path)}return r<e.length&&n.push({text:e.slice(r).join( ` ` )}),n});return(t,r)=>(I(),K(B(Lx),{align:e.assistant? ` start ` : ` end ` },{default:F(()=>[O(B(Rx),null,{default:F(()=>[O(B(af),{variant:e.assistant? ` muted ` : ` tinted ` ,class: ` max - w - [ min ( 78 ch , 92 % ) ] ` },{default:F(()=>[O(B(of),{class: ` [ overflow - wrap : anywhere ] ` },{default:F(()=>[e.media.length?(I(),k( ` div ` ,SS,[(I(!0),k(H,null,A(e.media,(e,t)=>(I(),K(Ux,{key:t,attachment:e},null,8,[ ` attachment ` ]))),128))])):P( ` ` ,!0),e.assistant?(I(!0),k(H,{key:1},A(n.value,(t,r)=>(I(),k(H,{key:r},[ ` text ` in t?(I(),K(fS,{key:0,text:t.text},null,8,[ ` text ` ])):(I(),K(B(cf),{key:1,class: ` my - 2 ` },{default:F(()=>[t.tools.length>1?(I(),K(xS,{key:0,tools:t.tools,streaming:e.streaming&&r===n.value.length-1},null,8,[ ` tools ` , ` streaming ` ])):(I(),K(yS,{key:1,tool:t.tools[0],streaming:e.streaming&&r===n.value.length-1},null,8,[ ` tool ` , ` streaming ` ]))]),_:2},1024))],64))),128)):(I(),k( ` div ` ,CS,z(e.text),1)),G(t. $ slots, ` default ` )]),_:3})]),_:3},8,[ ` variant ` ]),e.assistant&&!e.streaming&&e.text?(I(),K(B(zx),{key:0,class: ` px - 0 transition - opacity focus - within : opacity - 100 [ @ media ( hover : hover ) ] : opacity - 0 [ @ media ( hover : hover ) ] : group - hover / message : opacity - 100 ` },{default:F(()=>[O(B(Df),{value:e.text},null,8,[ ` value ` ])]),_:1})):P( ` ` ,!0)]),_:3})]),_:3},8,[ ` align ` ]))}}),TS={class: ` text - sm ` },ES={key:0,class: ` mt - 1 text - fg - muted ` },DS={key:1,class: ` mt - 2 flex flex - wrap gap - 2 ` },OS=N({__name: ` ChatChooseCard ` ,props:{choose:{}},setup(e){let t=J(()=>iu.value.models??[]);return(e,n)=>(I(),k( ` div ` ,TS,[n[0]||=L( ` p ` ,{class: ` font - medium ` }, ` Choose a model ` ,-1),t.value.length?(I(),k( ` div ` ,DS,[(I(!0),k(H,null,A(t.value,e=>(I(),K(B(Y),{key:e,size: ` sm ` ,variant:e===B(iu).active_model? ` default ` : ` outline ` ,class: ` font - mono ` ,onClick:t=>void B(Su)(e)},{default:F(()=>[V(z(e),1)]),_:2},1032,[ ` variant ` , ` onClick ` ]))),128))])):(I(),k( ` p ` ,ES, ` None configured . ` ))]))}}),kS={class: ` text - sm ` },AS={key:0},jS={class: ` mt - 1 space - y - 0.5 ` },MS={class: ` font - mono ` },NS=[ ` href ` ],PS={key:0,class: ` mt - 3 flex gap - 2 ` },FS={key:1,class: ` mt - 2 text - fg - muted ` },IS={key:2,class: ` mt - 2 text - fg - muted ` },LS={key:3,class: ` mt - 2 text - ok ` },RS={key:4,class: ` mt - 2 text - danger ` },zS={key:5,class: ` mt - 2 text - xs text - fg - muted ` },BS=N({__name: ` ChatUpdateCard ` ,props:{update:{}},setup(e){let t=e,n=J(()=>t.update.available??[]),r=q( ` idle ` ),i=q( ` ` );async function a(){r.value= ` installing ` ;try{let e=(await X.updateInstall(t.update.snapshot)).result?.installed;i.value=e?Object.entries(e).map(([e,t])=> ` $ { e } → $ { t } ` ).join( ` ,
Line truncated
` ).map(e=>e.trim()).find(Boolean)|| ` ` ,i=r.length>Kw? ` $ { r . slice ( 0 , Kw ) . trimEnd ( ) } … ` :r;return{text:i,full:n,truncated:i!==n}}function cne(e){return String(e|| ` event ` ).replaceAll( ` _ ` , ` ` ).replace(/ \b \w /g,e=>e.toUpperCase())}function Jw(e){let t=Number(e);if(!Number.isFinite(t)||t<0)return ` ` ;if(t<1e3)return ` under 1 s ` ;let n=t/1e3;if(n<60)return ` $ { n . toFixed ( + ( n < 10 ) ) } s ` ;let r=Math.round(n),i=Math.floor(r/60),a=r%60;if(i<60)return a===0? ` $ { i } min ` : ` $ { i } min $ { a } s ` ;let o=Math.floor(i/60),s=i-o*60;return s===0? ` $ { o } h ` : ` $ { o } h $ { s } min ` }function Yw(e){let t=Number(e);return!Number.isFinite(t)||t<=0? ` ` :t.toLocaleString( ` en - US ` )}function Xw(e){return typeof e== ` string ` ?e: ` ` }function Zw(e={}){let t=e.data||{},n=e.stage|| ` unknown stage ` ,r=e.workflow? ` $ { e . workflow } workflow ` : ` ` ;if(e.kind=== ` stage _start ` )return{title: ` Started stage : $ { n } ` ,detail:r};if(e.kind=== ` stage _finish ` ){let e=[r,Jw(t.duration_ms)].filter(Boolean).join( ` · ` );return{title:t.interrupted? ` Stage interrupted : $ { n } ` :t.skipped? ` Skipped stage : $ { n } ` :t.error? ` Stage failed : $ { n } ` : ` Finished stage : $ { n } ` ,detail:[e,Xw(t.error),Xw(t.when)].filter(Boolean).join( ` · ` )}}if(e.kind=== ` task _retried ` ){let n=Number(t.retry_count);return{title:Number.isFinite(n)&&n>0? ` Retry $ { n } ` : ` Retry requested ` ,detail:[Xw(t.previous_stage)&& ` after $ { Xw ( t . previous _stage ) } ` ,Xw(t.previous_reason)].filter(Boolean).join( ` : ` )||e.detail|| ` ` }}if(e.kind=== ` agent _finish ` ){let r=Yw(t.iterations),i=Yw(t.tokens),a=Number(t.cached_tokens)||0,o=Yw((Number(t.prompt_tokens)||0)-a),s=Yw(t.completion_tokens),c=Yw(t.cached_tokens),l=[r&& ` $ { r } iterations ` ,i&& ` $ { i } tokens ` ,o&& ` $ { o } fresh prompt ` ,s&& ` $ { s } completion ` ,c&& ` $ { c } cached ` ,Xw(t.model)].filter(Boolean);return{title: ` Agent $ { Xw ( t . status ) || ` finished ` } : $ { n } ` ,detail:l.join( ` · ` )||e.detail|| ` ` }}if(e.kind=== ` remediation _round ` ){let e=Number(t.of),n=Xw(t.author);return{title: ` Remediation $ { Xw ( t . round ) } $ { e > 0 ? ` of ${ e } ` : ` ` } ` ,detail:[n&& ` answers $ { n } ' s review ` ,t.review_id? ` # $ { Xw ( t . review _id ) } ` : ` ` ].filter(Boolean).join( ` ` )}}if(e.kind=== ` review _approved ` ){let e=Xw(t.pr_number);return{title: ` Pull request approved ` ,detail:[Xw(t.author),e&& ` # $ { e } ` ].filter(Boolean).join( ` · ` )}}if(e.kind=== ` step _retried ` )return{title: ` Attempt $ { Xw ( t . attempt ) } of $ { Xw ( t . of ) } failed : $ { e . stage || ` step ` } ` ,detail:Xw(t.error),tone: ` warn ` };if(e.kind=== ` config _captured ` )return{title: ` Configuration captured ` ,detail: ` The effective task - runtime configuration for this run . ` };if(e.kind=== ` binding _started ` ){let e=Xw(t.source),n=Xw(t.capture_id),r=[{label: ` binding $ { Xw ( t . binding _name ) || Xw ( t . binding _id ) } ` ,to: ` / events ? tab = bindings ` },...n?[{label: ` captured event ` ,to: ` / events ? tab = inspector & capture = $ { encodeURIComponent ( n ) } ` }]:[]];return t.unsigned===!0?{title: ` Started by an unsigned event ` ,detail:e? ` source $ { e } ` : ` ` ,tone: ` warn ` ,links:r}:{title: ` Started by an event ` ,detail:e? ` source $ { e } ` : ` ` ,links:r}}if(e.kind=== ` changes _captured ` ){let e=t.totals??{},n=Number(e.files);return{title: ` Change capture recorded ` ,detail:[Number.isFinite(n)&&n>0? ` $ { n } file$ { n === 1 ? ` ` : ` s ` } changed ` : ` ` ,t.captured_after? ` captured after $ { Xw ( t . captured _after ) } ` : ` ` ].filter(Boolean).join( ` · ` )}}return{title:cne(e.kind||e.type),detail:e.detail|| ` ` }}var lne=[ ` title ` ],Qw=N({__name: ` ActivityRow ` ,props:{event:{}},emits:[ ` open ` ],setup(e,{emit:t}){let n=Gw();n.watchIdentities();let r=e,i=t,a=zw(),o=J(()=>a.taskIDFor(r.event)),s=J(()=>qw(r.event,n.identityName));function c(){o.value>0&&i( ` open ` ,o.value)}return(t,n)=>(I(),K(B(ir),{class:R(o.value>0? ` cursor - pointer ` : ` ` ),role:o.value>0? ` link ` :void 0,tabindex:o.value>0?0:void 0,title:o.value>0? ` Open task details ` :void 0,onClick:c,onKeydown:[rt(it(c,[ ` prevent ` ]),[ ` enter ` ]),rt(it(c,[ ` prevent ` ]),[ ` space ` ])]},{default:F(()=>[O(B(tr),{class: ` font - medium ` },{default:F(()=>[V(z(B(Zw)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),O(B(tr),{class: ` font - mono ` },{default:F(()=>[V(z(o.value>0? ` # $ { o . value } ` : ` – ` ),1)]),_:1}),O(B(tr),{class: ` w - [ 55 % ] max - w - 0 ` },{default:F(()=>[L( ` span ` ,{class: ` block truncate ` ,title:s.value.truncated?s.value.full:void 0},z(s.value.text),9,lne)]),_:1}),O(B(tr),null,{default:F(()=>[O(B(fC),{at:e.event.at},null,8,[ ` at ` ])]),_:1})]),_:1},8,[ ` class ` , ` role ` , ` tabindex ` , ` title ` , ` onKeydown ` ]))}}),une=[{value: ` all ` ,label: ` All ` },{value: ` tasks ` ,label: ` Tasks ` },{value: ` system ` ,label: ` System ` }];function $ w(e){return(Number(e?.task_id)||0)>0}function dne(e,t){return t=== ` tasks ` ? $ w(e):t!== ` system ` ||! $ w(e)}function fne(e,t){return e.filter(e=>dne(e,t))}function pne(e,t){return e>0? ` ` :t=== ` all ` ? ` Waiting for activity ` :t=== ` tasks ` ? ` No task events yet ` : ` No system events yet ` }function mne(e,t){return ` $ { e } : $ { t ? ? 0 } ` }function hne(e){let t=[];for(let n of e){let e=n.kind||n.type|| ` event ` ,r=Number(n.task_id)||0,i=mne(qw(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 gne={role: ` region ` ,"aria-label": ` Activity ` ,"aria-live": ` polite ` },_ne={class: ` max - h - [ 28 rem ] overflow - y - auto ` },vne={clas
Line truncated
` ,1)[0]?? ` ` ;return t.length>80? ` $ { t . slice ( 0 , 79 ) } … ` :t}function DT(e){return(e?.merged||0)+(e?.completed||0)}function OT(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 Xne(e,t){return e.filter(e=>e.required&&!(t[e.name]?? ` ` ).trim()).map(e=>e.name)}function kT(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 Zne(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!== ` ` &&(n[r.name]=kT(e,r.type))}return n}var Qne=[ ` onKeydown ` ], $ ne={key:0,class: ` text - sm text - danger ` ,role: ` alert ` },ere={key:1,class: ` grid gap - 1.5 ` },tre=[ ` for ` ],nre={key:0,class: ` font - normal text - fg - subtle ` },rre=[ ` id ` ],ire=[ ` value ` ],are={key:0,class: ` text - xs text - fg - subtle ` },ore={key:2,class: ` grid gap - 1.5 ` },sre=[ ` id ` ],cre={class: ` block truncate text - label font - medium ` },lre={class: ` block text - xs text - fg - subtle ` },ure={key:0,class: ` text - xs text - fg - subtle ` },dre={key:3,class: ` grid gap - 3 ` },fre=[ ` for ` ],pre={class: ` font - mono ` },mre={key:0,class: ` text - fg - subtle ` },hre={class: ` grid gap - 1.5 ` },gre=[ ` for ` ],_re={class: ` grid gap - 1.5 ` },vre=[ ` for ` ],yre={key:4,class: ` text - sm text - danger ` ,role: ` alert ` },bre={class: ` flex items - center gap - 2 border - t border - border pt - 4 ` },xre={class: ` mr - auto text - xs text - fg - subtle ` },AT=N({__name: ` NewTaskForm ` ,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[ ` started ` , ` cancel ` ],setup(e,{emit:t}){let n=e,r=t,i=me(),a=q([]),o=q([]),s=q([]),c=q( ` ` );ke(async()=>{try{let[e,t]=await Promise.all([X.workflows(),X.repositories()]);a.value=(e?.definitions??[]).filter(e=>e.enabled),o.value=e?.workflows??[],s.value=(t??[]).map(e=> ` $ { e . owner } / $ { e . name } ` )}catch(e){c.value=String(e.message||e)}});let l=q( ` ` ),u=q(n.workflow??n.initialWorkflow?? ` ` ),d=q(n.initialInstructions?? ` ` ),f=q(ET(d.value)),p=q({});pe(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=J(()=>a.value.find(e=>e.id===u.value)),h=J(()=>OT(m.value)),g=J(()=>Xne(h.value,p.value)),_=J(()=>m.value?.repository?? ` required ` ),v=J(()=>_.value!== ` optional ` &&_.value!== ` none ` ),y=e=>o.value.find(t=>t.workflow===e),b=q(!1),x=q( ` ` ),S=J(()=>!(!l.value.trim()&&v.value||!u.value||!f.value.trim())&&g.value.length===0);async function ee(){if(S.value&&!b.value){b.value=!0,x.value= ` ` ;try{let e=await X.workRequest({repository:_.value=== ` none ` ? ` ` :l.value.trim(),workflow:u.value,title:f.value.trim(),instructions:d.value,inputs:Zne(h.value,p.value),...n.draft?{draft:n.draft}:{}});r( ` started ` ,e.task_id)}catch(e){x.value=String(e.message||e)}finally{b.value=!1}}}return(e,t)=>(I(),k( ` form ` ,{class: ` grid gap - 5 ` ,onSubmit:it(ee,[ ` prevent ` ]),onKeydown:[rt(it(ee,[ ` meta ` , ` prevent ` ]),[ ` enter ` ]),rt(it(ee,[ ` ctrl ` , ` prevent ` ]),[ ` enter ` ])]},[c.value?(I(),k( ` p ` , $ ne,z(c.value),1)):P( ` ` ,!0),_.value=== ` none ` ?P( ` ` ,!0):(I(),k( ` div ` ,ere,[L( ` label ` ,{for: ` $ { B ( i ) } - repo ` ,class: ` text - label font - medium ` },[t[5]||=V( ` Repository ` ,-1),v.value?P( ` ` ,!0):(I(),k( ` span ` ,nre, ` ( optional ) ` ))],8,tre),O(B(Z),{id: ` $ { B ( i ) } - repo ` ,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class: ` font - mono ` ,placeholder: ` owner / repository ` ,list: ` $ { B ( i ) } - repos ` ,required:v.value},null,8,[ ` id ` , ` modelValue ` , ` list ` , ` required ` ]),L( ` datalist ` ,{id: ` $ { B ( i ) } - repos ` },[(I(!0),k(H,null,A(s.value,e=>(I(),k( ` option ` ,{key:e,value:e},null,8,ire))),128))],8,rre),s.value.length?(I(),k( ` p ` ,are,[t[6]||=V( ` Configured : ` ,-1),(I(!0),k(H,null,A(s.value,e=>(I(),K(B(Y),{key:e,type: ` button ` ,variant: ` link ` ,size: ` xs ` ,class: ` h - auto px - 1 font - mono text - fg - subtle ` ,onClick:t=>l.value=e},{default:F(()=>[V(z(e),1)]),_:2},1032,[ ` onClick ` ]))),128))])):P( ` ` ,!0)])),n.workflow?P( ` ` ,!0):(I(),k( ` div ` ,ore,[L( ` span ` ,{id: ` $ { B ( i ) } - wf ` ,class: ` text - label font - medium ` }, ` Workflow ` ,8,sre),O(B(is),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-labelledby": ` $ { B ( i ) } - wf ` ,class: ` grid grid - cols - 1 gap - 2 sm : grid - cols - 3 ` ,loop: ` ` },{default:F(()=>[(I(!0),k(H,null,A(a.value,e=>(I(),K(B(os),{key:e.id,value:e.id,class: ` rounded - md border border - border bg - card px - 3 py - 2.5 text - left transition - colors hover : bg - secondary focus - visible : outline - 2 focus - visible : outline - ring data - [ state = checked ] : border - primary data - [ state = checked ] : bg - secondary ` },{default:F(()=>[L( ` span ` ,cre,z(e.name||e.id),1),L( ` span ` ,lre,[V(z(y(e.id)?.runs||0)+ ` runs ` ,1),y(e.id)?.runs?(I(),k(H,{key:0},[V( ` · ` +z(Math.round(B(DT)(y(e.id))/(y(e.id)?.runs||1)*100))+ ` % delivered ` ,1)],64)):P( ` ` ,!0)])]),_:2},1032,[ ` value ` ]))),128))]),_:1},8,[ ` modelValue ` , ` aria - labelledby ` ]),!a.value.length&&!c.value?(I(),k( ` p ` ,ure, ` No enabled workflows . ` )):P( ` ` ,!0)])),h.value.length?(I(),k( ` div ` ,dre,[(I(!0),k(H,null,A(h.value,e=>(I(),k( ` div ` ,{key:e.name,class: ` grid gap - 1.5 ` },[L( ` label ` ,{for: ` $ { B ( i ) } - input - $ { e . name } ` ,class: ` text - label font - medium ` },[L( ` span ` ,pre,z(e.name),1),e.required?(I(),k( ` span ` ,mre, ` · required ` )):P( ` ` ,!0)],8,fre),O(B(Z),{id: ` $ { B ( i 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 Pre(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 PT(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 FT(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 IT(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 LT=q([]),RT=q([]),zT=q(!0),BT=q(null),VT=q(!0),HT=q(null),UT=q(!1),WT=q(null);async function GT(){try{let e=await X.eventTypes(NT().workspace);zT.value=e.enabled!==!1,LT.value=e.event_types||[],RT.value=e.proposals||[],BT.value=null}catch(e){BT.value=e.message||String(e)}finally{VT.value=!1}}function KT(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function qT(e){WT.value=null,HT.value=e}function JT(e){let t=nE.value.find(t=>String(t.id)===e.sample_id);qT({mode: ` proposal ` ,id:null,source:e.source,name: ` ` ,rule:KT(e.rule),headersText: ` ` ,body:t?.body|| ` ` ,exampleHeaders:e.headers||{}})}function YT(e= ` ` ){qT({mode: ` paste ` ,id:null,source:e,name: ` ` ,rule:{headers:[],payload:[]},headersText: ` ` ,body: ` ` ,exampleHeaders:{}})}function XT(e){qT({mode: ` edit ` ,id:e.id,source:e.source,name:e.name,rule:KT(e.rule),headersText: ` ` ,body: ` ` ,exampleHeaders:{}})}function ZT(){HT.value=null}async function QT(){let e=HT.value;if(e){UT.value=!0;try{if(e.mode=== ` edit ` &&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:IT(e.rule)});else{let t=e.mode=== ` paste ` ?Nre(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode=== ` paste ` ?void 0:IT(e.rule),example:{headers:t,body:e.body}})}HT.value=null,await GT()}catch(e){WT.value=e.message||String(e)}finally{UT.value=!1}}}var $ T=q(null);async function eE(){let e= $ T.value;if( $ T.value=null,e)try{await X.eventTypeDelete(e.id),await GT()}catch(e){BT.value=e.message||String(e)}}var tE=100,nE=q([]),rE=q(!0),iE=q(null),aE=q(!0),oE=q(null);async function sE(){try{let e=await X.captures(tE);rE.value=e.enabled!==!1,nE.value=e.captures||[],iE.value=null}catch(e){iE.value=e.message||String(e)}finally{aE.value=!1}}function cE(e){let t=nE.value.find(t=>t.id===e);return t&&(oE.value=t),!!t}function lE(){nE.value.length&&(oE.value=nE.value[0])}function uE(){fn( ` captures ` ,()=>{sE(),GT()})}var dE=N({__name: ` Tabs ` ,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[ ` update : modelValue ` ],setup(e,{emit:t}){let n=e,r=t,i=ct(n, ` class ` ),a=C(i,r);return(e,t)=>(I(),K(B(hs),W({"data-slot": ` tabs ` ,"data-orientation":B(a).orientation|| ` horizontal ` },B(a),{class:B(U)( ` gap - 2 group / tabs flex data - horizontal : flex - col ` ,n.class)}),{default:F(t=>[G(e. $ slots, ` default ` ,Le(ue(t)))]),_:3},16,[ ` data - orientation ` , ` class ` ]))}}),fE=N({__name: ` TabsContent ` ,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=ct(t, ` class ` );return(e,r)=>(I(),K(B(vs),W({"data-slot": ` tabs - content ` ,class:B(U)( ` text - sm flex - 1 outline - none ` ,t.class)},B(n)),{default:F(()=>[G(e. $ slots, ` default ` )]),_:3},16,[ ` class ` ]))}}),pE=N({__name: ` TabsList ` ,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default: ` default ` }},setup(e){let t=e,n=ct(t, ` class ` , ` variant ` );return(r,i)=>(I(),K(B(ys),W({"data-slot": ` tabs - list ` ,"data-variant":e.variant},B(n),{class:B(U)(B(hE)({variant:e.variant}),t.class)}),{default:F(()=>[G(r. $ slots, ` default ` )]),_:3},16,[ ` data - variant ` , ` class ` ]))}}),mE=N({__name: ` TabsTrigger ` ,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=ct(t, ` class ` ),r=S(n);return(e,n)=>(I(),K(B(bs),W({"data-slot": ` tabs - trigger ` ,class:B(U)( ` gap - 1.5 rounded - md border border - transparent px - 1.5 py - 0.5 text - sm font - medium group - data - [ variant = default ] / tabs - list : data - active : shadow - sm group - data - [ variant = line ] / tabs - list : data - active : shadow - none [ & _svg : not ( [ class *= size - ] ) ] : size - 4 has - data - [ icon = inline - end ] : pr - 1 has - data - [ icon = inline - start ] : pl - 1 relative inline - flex h - [ calc ( 100 % - 1 px ) ] flex - 1 items - center justify - center whitespace - nowrap text - foreground / 60 transition - all group - data - vertical / tabs : w - full group - data - vertical / tabs : justify - start hover : text - foreground focus - visible : border - ring focus - visible : ring - 3 focus - visible : ring - ring / 50 focus - visible : outline - 1 focus - visible Line truncated
WARNING : This link could potentially be dangerous ` )){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn( ` Opening link blocked as opener could not be cleared ` )}}var Xz=I z( ` CharSizeService ` ),Zz=I z( ` CoreBrowserService ` ),Qz=I z( ` MouseService ` ), $ z=I z(` RenderService ` ),e B=I z( ` SelectionService ` ),t B=I z( ` CharacterJoinerService ` ),n B=I z( ` ThemeService ` ),r B=I z( ` LinkProviderService ` ),i B=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?u B.isErrorNoTelemetry(e)?new u B(e.message+ `
WARNING : This link could potentially be dangerous ` )){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn( ` Opening link blocked as opener could not be cleared ` )}}var cB=J z( ` CharSizeService ` ),lB=J z( ` CoreBrowserService ` ),uB=J z( ` MouseService ` ),dB=J z( ` RenderService ` ),f B=J z( ` SelectionService ` ),p B=J z( ` CharacterJoinerService ` ),m B=J z( ` ThemeService ` ),h B=J z( ` LinkProviderService ` ),g B=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?S B.isErrorNoTelemetry(e)?new S B(e.message+ `
` +e.stack):Error(e.message+ `
` +e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function aB(e){sB(e)||iB.onUnexpectedError(e)}var oB= ` Canceled ` ;function sB(e){return e instanceof cB||e instanceof Error&&e.name===oB&&e.message===oB}var cB=class extends Error{constructor(){super(oB),this.name=this.message}};function lB(e){return Error(e? ` Illegal argument : $ { e } ` : ` Illegal argument ` )}var uB=class e extends Error{constructor(e){super(e),this.name= ` CodeExpectedError ` }static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name=== ` CodeExpectedError ` }},dB=class e extends Error{constructor(t){super(t|| ` An unexpected bug occurred . ` ),Object.setPrototypeOf(this,e.prototype)}};function fB(e,t=0){return e[e.length-(1+t)]}var pB;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(pB||={});var mB=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||pB.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};mB.empty=new mB(e=>{});function hB(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var gB;(e=>{function t(e){return e&&typeof e== ` object ` &&typeof e[Symbol.iterator]== ` function ` }e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(gB||={});var _B=null;function vB(e){return _B?.trackDisposable(e),e}function yB(e){_B?.markAsDisposed(e)}function bB(e,t){_B?.setParent(e,t)}function xB(e){return _B?.markAsSingleton(e),e}function SB(e){if(gB.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t, ` Encountered errors while disposing of store ` );return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function CB(...e){return wB(()=>SB(e))}function wB(e){let t=vB({dispose:hB(()=>{yB(t),e()})});return t}var TB=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,vB(this)}dispose(){this._isDisposed||(yB(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{SB(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error( ` Cannot register a disposable on itself ! ` );return bB(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error( ` Trying to add a disposable to a DisposableStore that has already been disposed of . The added object will be leaked ! ` ).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error( ` Cannot dispose a disposable on itself ! ` );this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),bB(e,null))}};TB.DISABLE_DISPOSED_WARNING=!1;var EB=TB,DB=class{constructor(){this._store=new EB,vB(this),bB(this._store,this)}dispose(){yB(thi
Line truncated
` +e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function _B(e){yB(e)||gB.onUnexpectedError(e)}var vB= ` Canceled ` ;function yB(e){return e instanceof bB||e instanceof Error&&e.name===vB&&e.message===vB}var bB=class extends Error{constructor(){super(vB),this.name=this.message}};function xB(e){return Error(e? ` Illegal argument : $ { e } ` : ` Illegal argument ` )}var SB=class e extends Error{constructor(e){super(e),this.name= ` CodeExpectedError ` }static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name=== ` CodeExpectedError ` }},CB=class e extends Error{constructor(t){super(t|| ` An unexpected bug occurred . ` ),Object.setPrototypeOf(this,e.prototype)}};function wB(e,t=0){return e[e.length-(1+t)]}var TB;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(TB||={});var EB=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||TB.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};EB.empty=new EB(e=>{});function DB(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var OB;(e=>{function t(e){return e&&typeof e== ` object ` &&typeof e[Symbol.iterator]== ` function ` }e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(OB||={});var kB=null;function AB(e){return kB?.trackDisposable(e),e}function jB(e){kB?.markAsDisposed(e)}function MB(e,t){kB?.setParent(e,t)}function NB(e){return kB?.markAsSingleton(e),e}function PB(e){if(OB.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t, ` Encountered errors while disposing of store ` );return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function FB(...e){return IB(()=>PB(e))}function IB(e){let t=AB({dispose:DB(()=>{jB(t),e()})});return t}var LB=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,AB(this)}dispose(){this._isDisposed||(jB(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{PB(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error( ` Cannot register a disposable on itself ! ` );return MB(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error( ` Trying to add a disposable to a DisposableStore that has already been disposed of . The added object will be leaked ! ` ).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error( ` Cannot dispose a disposable on itself ! ` );this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),MB(e,null))}};LB.DISABLE_DISPOSED_WARNING=!1;var RB=LB,zB=class{constructor(){this._store=new RB,AB(this),MB(this._store,this)}dispose(){jB(thi
Line truncated
` ).slice(2).join( `
` ))}},HB=class extends Error{constructor(e,t){super(e),this.name= ` ListenerLeakError ` ,this.stack=t}},UB=class extends Error{constructor(e,t){super(e),this.name= ` ListenerRefusalError ` ,this.stack=t}},WB=0,GB=class{constructor(e){this.value=e,this.id=WB++}},KB=2,qB=class{constructor(e){this._size=0,this._options=e,this._leakageMon=RB>0||this._options?.leakWarningThreshold?new BB(e?.onListenerError??aB,this._options?.leakWarningThreshold??RB):void 0,this._perfMon=this._options?._profName?new LB(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e= ` [ $ { this . _leakageMon . name } ] REFUSES to accept new listeners because it exceeded its threshold by far ( $ { this . _size } vs $ { this . _leakageMon . threshold } ) ` ;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[ ` UNKNOWN stack ` ,-1],n=new UB( ` $ { e } . HINT : Stack shows most frequent listener ( $ { t [ 1 ] } - times ) ` ,t[0]);return(this._options?.onListenerError||aB)(n),DB.None}if(this._disposed)return DB.None;t&&(e=e.bind(t));let r=new GB(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=VB.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof GB?(this._deliveryQueue??=new JB,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=wB(()=>{i?.(),this._removeListener(r)});return n instanceof EB?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log( ` disposed ? ` ,this._disposed),console.log( ` size ? ` ,this._size),console.log( ` arr ? ` ,JSON.stringify(this._listeners)),Error( ` Attempted to dispose unknown listener ` );this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*KB<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||aB;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof GB)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},JB=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},YB=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new qB,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new qB,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};YB.INSTANCE=new YB;var XB=YB;function ZB(e,t,n){typeof t== ` string ` &&(t=e.matchMedia(t)),t.addEventListener( ` change ` ,n)}XB.INSTANCE.onDidChangeZoomLevel;function QB(e){return XB.INSTANCE.getZoomFactor(e)}XB.INSTANCE.onDidChangeFullscreen;var $ B=typeof navigator== ` object ` ?navigator.userAgent: ` ` ,eV= $ B.indexOf( ` Firefox ` )>=0,tV= $ B.indexOf( ` AppleWebKit ` )>=0,nV= $ B.indexOf( ` Chrome ` )>=0,rV=!nV&& $ B.indexOf( ` Safari ` )>=0; $ B.indexOf( ` Electron / ` ), $ B.indexOf( ` Android ` );var iV=!1;if(typeof kB.matchMedia== ` function ` ){let e=kB.matchMedia( ` ( display - mode : standalone ) or ( display - mode : window - controls - overlay ) ` ),t=kB.matchMedia( ` ( display - mode : fullscreen ) ` );iV=e.matches,ZB(kB,e,({matches:e})=>{iV&&t.matches||(iV=e)}
Line truncated
` )})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};eU=uz([dz(2,Rz),dz(3,Zz),dz(4,zz),dz(5,nB),dz(6,Wz),dz(7, $ z)],eU);var tU=class extends DB{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement( ` div ` ),this._container.classList.add( ` xterm - decoration - container ` ),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(wB(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement( ` div ` );t.classList.add( ` xterm - decoration ` ),t.classList.toggle( ` xterm - decoration - top - layer ` ,e?.options?.layer=== ` top ` ),t.style.width= ` $ { Math . round ( ( e . options . width || 1 ) * this . _renderService . dimensions . css . cell . width ) } px ` ,t.style.height= ` $ { ( e . options . height || 1 ) * this . _renderService . dimensions . css . cell . height } px ` ,t.style.top= ` $ { ( e . marker . line - this . _bufferService . buffers . active . ydisp ) * this . _renderService . dimensions . css . cell . height } px ` ,t.style.lineHeight= ` $ { this . _renderService . dimensions . css . cell . height } px ` ;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display= ` none ` ),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display= ` none ` ,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive? ` none ` : ` block ` ,this._altBufferIsActive||(n.style.width= ` $ { Math . round ( ( e . options . width || 1 ) * this . _renderService . dimensions . css . cell . width ) } px ` ,n.style.height= ` $ { ( e . options . height || 1 ) * this . _renderService . dimensions . css . cell . height } px ` ,n.style.top= ` $ { t * this . _render Line truncated
` ,e.VT= ` \ v ` ,e.FF= ` \ f ` ,e.CR= ` \ r ` ,e.SO= ` ` ,e.SI= ` ` ,e.DLE= ` ` ,e.DC1= ` ` ,e.DC2= ` ` ,e.DC3= ` ` ,e.DC4= ` ` ,e.NAK= ` ` ,e.SYN= ` ` ,e.ETB= ` ` ,e.CAN= ` ` ,e.EM= ` ` ,e.SUB= ` ` ,e.ESC= ` \ x1B ` ,e.FS= ` ` ,e.GS= ` ` ,e.RS= ` ` ,e.US= ` ` ,e.SP= ` ` ,e.DEL= ` ` ))( $ ||={});var sU;(e=>(e.PAD= ` ` ,e.HOP= ` ` ,e.BPH= ` ` ,e.NBH= ` ` ,e.IND= ` ` ,e.NEL= `
` ,e.SSA= ` ` ,e.ESA= ` ` ,e.HTS= ` ` ,e.HTJ= ` ` ,e.VTS= ` ` ,e.PLD= ` ` ,e.PLU= ` ` ,e.RI= ` ` ,e.SS2= ` ` ,e.SS3= ` ` ,e.DCS= ` ` ,e.PU1= ` ` ,e.PU2= ` ` ,e.STS= ` ` ,e.CCH= ` ` ,e.MW= ` ` ,e.SPA= ` ` ,e.EPA= ` ` ,e.SOS= ` ` ,e.SGCI= ` ` ,e.SCI= ` ` ,e.CSI= ` ` ,e.ST= ` ` ,e.OSC= ` ` ,e.PM= ` ` ,e.APC= ` ` ))(sU||={});var cU;(e=>e.ST= ` $ { $ . ESC } \ \ ` )(cU||={});var lU=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent= ` ` }get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent= ` ` ,this._dataAlreadySent= ` ` ,this._compositionView.classList.add( ` active ` )}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove( ` active ` ),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e, ` ` );this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent( ` $ { $ . DEL } ` ,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+ ` px ` ,this._compositionView.style.top=n+ ` px ` ,this._compositionView.style.height=t+ ` px ` ,this._compositionView.style.lineHeight=t+ ` px ` ,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+ ` px ` ;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+ ` px ` ,this._textarea.style.top=n+ ` px ` ,this._textarea.style.width=Math.max(i.width,1)+ ` px ` ,this._textarea.style.height=Math.max(i.height,1)+ ` px ` ,this._textarea.style.lineHeight=i.height+ ` px ` }e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};lU=uz([dz(2,Rz),dz(3,Wz),dz(4,Bz),dz(5, $ z)],lU);var uU=0,dU=0,fU=0,pU=0,mU={css: ` # 00000000 ` ,rgba:0},hU;(e=>{function t(e,t,n,r){return r===void 0? ` # $ { bU ( e ) } $ { bU ( t ) } $ { bU ( n ) } ` : ` # $ { bU ( e ) } $ { bU ( t ) } $ { bU ( n ) } $ { bU ( r ) } ` }e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(hU||={});var gU;(e=>{function t(e,t){if(pU=(t.rgba&255)/255,pU===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return uU=a+Math.round((n-a)*pU),dU=o+Math.round((r-o)*pU),fU=s+Math.round((i-s)*pU),{css:hU.toCss(uU,dU,fU),rgba:hU.toRgba(uU,dU,fU)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=yU.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return hU.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[uU,dU,fU]=yU.toChannels(t),{css:hU.toCss(uU,dU,fU),rgba:t}}e.opaque=i;function a(e,t){return pU=Math.round(t*255),[uU,dU,fU]=yU.toChannels(e.rgba),{css:hU.toCss(uU,dU,fU,pU),rgba:hU.toRgba(uU,dU,fU,pU)}}e.opacity=a;function o(e,t){return pU=e.rgba&255,a(e,pU*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.r
Line truncated
` ))}},eV=class extends Error{constructor(e,t){super(e),this.name= ` ListenerLeakError ` ,this.stack=t}},tV=class extends Error{constructor(e,t){super(e),this.name= ` ListenerRefusalError ` ,this.stack=t}},nV=0,rV=class{constructor(e){this.value=e,this.id=nV++}},iV=2,aV=class{constructor(e){this._size=0,this._options=e,this._leakageMon=XB>0||this._options?.leakWarningThreshold?new QB(e?.onListenerError??_B,this._options?.leakWarningThreshold??XB):void 0,this._perfMon=this._options?._profName?new YB(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e= ` [ $ { this . _leakageMon . name } ] REFUSES to accept new listeners because it exceeded its threshold by far ( $ { this . _size } vs $ { this . _leakageMon . threshold } ) ` ;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[ ` UNKNOWN stack ` ,-1],n=new tV( ` $ { e } . HINT : Stack shows most frequent listener ( $ { t [ 1 ] } - times ) ` ,t[0]);return(this._options?.onListenerError||_B)(n),zB.None}if(this._disposed)return zB.None;t&&(e=e.bind(t));let r=new rV(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack= $ B.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof rV?(this._deliveryQueue??=new oV,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=IB(()=>{i?.(),this._removeListener(r)});return n instanceof RB?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log( ` disposed ? ` ,this._disposed),console.log( ` size ? ` ,this._size),console.log( ` arr ? ` ,JSON.stringify(this._listeners)),Error( ` Attempted to dispose unknown listener ` );this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*iV<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||_B;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof rV)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},oV=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},sV=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new aV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new aV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};sV.INSTANCE=new sV;var cV=sV;function lV(e,t,n){typeof t== ` string ` &&(t=e.matchMedia(t)),t.addEventListener( ` change ` ,n)}cV.INSTANCE.onDidChangeZoomLevel;function uV(e){return cV.INSTANCE.getZoomFactor(e)}cV.INSTANCE.onDidChangeFullscreen;var dV=typeof navigator== ` object ` ?navigator.userAgent: ` ` ,fV=dV.indexOf( ` Firefox ` )>=0,pV=dV.indexOf( ` AppleWebKit ` )>=0,mV=dV.indexOf( ` Chrome ` )>=0,hV=!mV&&dV.indexOf( ` Safari ` )>=0;dV.indexOf( ` Electron / ` ),dV.indexOf( ` Android ` );var gV=!1;if(typeof VB.matchMedia== ` function ` ){let e=VB.matchMedia( ` ( display - mode : standalone ) or ( display - mode : window - controls - overlay ) ` ),t=VB.matchMedia( ` ( display - mode : fullscreen ) ` );gV=e.matches,lV(VB,e,({matches:e})=>{gV&&t.matches||(gV=e)}
Line truncated
` )})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};fU=Sz([Cz(2,Xz),Cz(3,lB),Cz(4,Zz),Cz(5,mB),Cz(6,nB),Cz(7,dB)],fU);var pU=class extends zB{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement( ` div ` ),this._container.classList.add( ` xterm - decoration - container ` ),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(IB(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement( ` div ` );t.classList.add( ` xterm - decoration ` ),t.classList.toggle( ` xterm - decoration - top - layer ` ,e?.options?.layer=== ` top ` ),t.style.width= ` $ { Math . round ( ( e . options . width || 1 ) * this . _renderService . dimensions . css . cell . width ) } px ` ,t.style.height= ` $ { ( e . options . height || 1 ) * this . _renderService . dimensions . css . cell . height } px ` ,t.style.top= ` $ { ( e . marker . line - this . _bufferService . buffers . active . ydisp ) * this . _renderService . dimensions . css . cell . height } px ` ,t.style.lineHeight= ` $ { this . _renderService . dimensions . css . cell . height } px ` ;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display= ` none ` ),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display= ` none ` ,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive? ` none ` : ` block ` ,this._altBufferIsActive||(n.style.width= ` $ { Math . round ( ( e . options . width || 1 ) * this . _renderService . dimensions . css . cell . width ) } px ` ,n.style.height= ` $ { ( e . options . height || 1 ) * this . _renderService . dimensions . css . cell . height } px ` ,n.style.top= ` $ { t * this . _render Line truncated
` ,e.VT= ` \ v ` ,e.FF= ` \ f ` ,e.CR= ` \ r ` ,e.SO= ` ` ,e.SI= ` ` ,e.DLE= ` ` ,e.DC1= ` ` ,e.DC2= ` ` ,e.DC3= ` ` ,e.DC4= ` ` ,e.NAK= ` ` ,e.SYN= ` ` ,e.ETB= ` ` ,e.CAN= ` ` ,e.EM= ` ` ,e.SUB= ` ` ,e.ESC= ` \ x1B ` ,e.FS= ` ` ,e.GS= ` ` ,e.RS= ` ` ,e.US= ` ` ,e.SP= ` ` ,e.DEL= ` ` ))( $ ||={});var yU;(e=>(e.PAD= ` ` ,e.HOP= ` ` ,e.BPH= ` ` ,e.NBH= ` ` ,e.IND= ` ` ,e.NEL= `
` ,e.SSA= ` ` ,e.ESA= ` ` ,e.HTS= ` ` ,e.HTJ= ` ` ,e.VTS= ` ` ,e.PLD= ` ` ,e.PLU= ` ` ,e.RI= ` ` ,e.SS2= ` ` ,e.SS3= ` ` ,e.DCS= ` ` ,e.PU1= ` ` ,e.PU2= ` ` ,e.STS= ` ` ,e.CCH= ` ` ,e.MW= ` ` ,e.SPA= ` ` ,e.EPA= ` ` ,e.SOS= ` ` ,e.SGCI= ` ` ,e.SCI= ` ` ,e.CSI= ` ` ,e.ST= ` ` ,e.OSC= ` ` ,e.PM= ` ` ,e.APC= ` ` ))(yU||={});var bU;(e=>e.ST= ` $ { $ . ESC } \ \ ` )(bU||={});var xU=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent= ` ` }get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent= ` ` ,this._dataAlreadySent= ` ` ,this._compositionView.classList.add( ` active ` )}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove( ` active ` ),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e, ` ` );this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent( ` $ { $ . DEL } ` ,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+ ` px ` ,this._compositionView.style.top=n+ ` px ` ,this._compositionView.style.height=t+ ` px ` ,this._compositionView.style.lineHeight=t+ ` px ` ,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+ ` px ` ;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+ ` px ` ,this._textarea.style.top=n+ ` px ` ,this._textarea.style.width=Math.max(i.width,1)+ ` px ` ,this._textarea.style.height=Math.max(i.height,1)+ ` px ` ,this._textarea.style.lineHeight=i.height+ ` px ` }e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};xU=Sz([Cz(2,Xz),Cz(3,nB),Cz(4,Qz),Cz(5,dB)],xU);var SU=0,CU=0,wU=0,TU=0,EU={css: ` # 00000000 ` ,rgba:0},DU;(e=>{function t(e,t,n,r){return r===void 0? ` # $ { MU ( e ) } $ { MU ( t ) } $ { MU ( n ) } ` : ` # $ { MU ( e ) } $ { MU ( t ) } $ { MU ( n ) } $ { MU ( r ) } ` }e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(DU||={});var OU;(e=>{function t(e,t){if(TU=(t.rgba&255)/255,TU===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return SU=a+Math.round((n-a)*TU),CU=o+Math.round((r-o)*TU),wU=s+Math.round((i-s)*TU),{css:DU.toCss(SU,CU,wU),rgba:DU.toRgba(SU,CU,wU)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=jU.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return DU.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[SU,CU,wU]=jU.toChannels(t),{css:DU.toCss(SU,CU,wU),rgba:t}}e.opaque=i;function a(e,t){return TU=Math.round(t*255),[SU,CU,wU]=jU.toChannels(e.rgba),{css:DU.toCss(SU,CU,wU,TU),rgba:DU.toRgba(SU,CU,wU,TU)}}e.opacity=a;function o(e,t){return TU=e.rgba&255,a(e,TU*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.r
Line truncated
` : `
` )}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),dW&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=PW(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=YU(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-FW),FW),t/=FW,t/Math.abs(t)+Math.round(t*(IW-1)))}shouldForceSelection(e){return sW?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener( ` mousemove ` ,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener( ` mouseup ` ,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),LW)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener( ` mousemove ` ,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener( ` mouseup ` ,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(sW&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._active
Line truncated
` ))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(u H(i, ` selectionchange ` ,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(w B(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar( ` ` )}_handleChar(e){this._liveRegionLineCount<L K+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e=== `
` &&(this._liveRegionLineCount++,this._liveRegionLineCount===LK+1&&(this._liveRegion.textContent+=hz.get())))}_clearLiveRegion(){this._liveRegion.textContent= ` ` ,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/ \p {Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)|| ` ` ,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent= ` \ xA0 ` ,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute( ` aria - posinset ` ,o),s.setAttribute( ` aria - setsize ` ,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce= ` ` )}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute( ` aria - posinset ` )===(t===0? ` 1 ` : ` $ { this . _terminal . buffer . lines . length } ` )||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener( ` focus ` ,this._topBoundaryFocusListener),a.removeEventListener( ` focus ` ,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement( ` afterbegin ` ,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener( ` focus ` ,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener( ` focus ` ,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error( ` anchorNode and / or focusNode are null ` );return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute( ` aria - posinset ` ),10)-1;if(isNaN(r))return console.warn( ` row is invalid . Race condition ? ` ),null;let i=this._rowColumns.get(n);if(!i)return console.warn( ` columns is null . Race condition ? ` ),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error( ` invalid range ` );this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener( ` focus ` ,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener( ` focus ` ,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement( ` div ` );return e.setAttribute( ` role ` , ` listitem ` ),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width: ` $ { this . _renderService . dimensions . css . canvas . width } px ` ,fontSize: ` $ { this . _terminal . options . fontSize } px ` }),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height= ` $ { this . _renderService . dimensions . css . cell . height } px ` }_alignRowWidth(e){e.style.transform= ` ` ;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let
Line truncated
` ,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return pz.get()},set promptLabel(e){pz.set(e)},get tooMuchOutput(){return hz.get()},set tooMuchOutput(e){hz.set(e)}}}_verifyIntegers(...e){for(XK of e)if(XK===1/0||isNaN(XK)||XK%1!=0)throw Error( ` This API only accepts integers ` )}_verifyPositiveIntegers(...e){for(XK of e)if(XK&&(XK===1/0||isNaN(XK)||XK%1!=0||XK<0))throw Error( ` This API only accepts positive integers ` )}},QK=2, $ K=1,eq=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue( ` height ` )),i=Math.max(0,parseInt(n.getPropertyValue( ` width ` ))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue( ` padding - top ` )),bottom:parseInt(a.getPropertyValue( ` padding - bottom ` )),right:parseInt(a.getPropertyValue( ` padding - right ` )),left:parseInt(a.getPropertyValue( ` padding - left ` ))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(QK,Math.floor(u/e.css.cell.width)),rows:Math.max( $ K,Math.floor(l/e.css.cell.height))}}},tq={class: ` flex h - [ 32 rem ] min - h - 0 flex - col gap - 2 ` },nq={key:0,class: ` text - sm text - fg - muted ` ,role: ` status ` },rq=N({__name: ` SandboxView ` ,props:{taskId:{},attempt:{}},setup(e){let t=e,n=q(null),r=q( ` connecting ` ),i=null,a=null,o=null,s=null;function c(){try{o?.fit()}catch{}}return Ae(()=>{let e=n.value;if(!e)return;i=new ZK({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily: ` 'IBM Plex Mono' , ui - monospace , monospace ` ,fontSize:13,theme:{background: ` # 0b0 f14 ` ,foreground: ` # e6edf3 ` }}),o=new eq,i.loadAddon(o),i.open(e),c();let l=window.location.protocol=== ` https : ` ? ` wss : ` : ` ws : ` ,u=new URLSearchParams({attempt:String(t.attempt)}),d=new WebSocket( ` $ { l } //${window.location.host}/api/tasks/${encodeURIComponent(t.taskId)}/sandbox?${u}`);a=d,d.binaryType=`arraybuffer`,d.onopen=()=>{r.value=`open`},d.onmessage=e=>{i&&(typeof e.data==`string`&&(r.value=`failed`),i.write(typeof e.data==`string`?e.data:new Uint8Array(e.data)))},d.onerror=()=>{r.value=`failed`},d.onclose=()=>{r.value!==`failed`&&(r.value=`closed`)},s=new ResizeObserver(c),s.observe(e)}),Ke(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(I(),k(`div`,tq,[r.value===`open`?P(``,!0):(I(),k(`p`,nq,[r.value===`connecting`?(I(),k(H,{key:0},[V(`Connecting…`)],64)):r.value===`closed`?(I(),k(H,{key:1},[V(`The sandbox ended.`)],64)):(I(),k(H,{key:2},[V(`Sandbox unavailable.`)],64))])),L(`div`,{ref_key:`host`,ref:n,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),iq={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},aq={class:`inline-flex items-center gap-2`},oq={class:`inline-flex items-center gap-2`},sq=`__all__`,cq=N({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>nA.map(e=>({value:e.value||sq,label:e.label}))),a=J(()=>n.filters.level||sq),o=J(()=>n.filters.stage||sq);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===sq?``:String(e)})}function l(e){s({stage:String(e)===sq?``:String(e)})}return(t,n)=>(I(),k(`div`,iq,[L(`div`,aq,[O(B(Rn),{"model-value":a.value,"onUpdate:modelValue":c},{default:F(()=>[O(B(Fn),{size:`sm`,"aria-label":`Filter log entries by level`},{default:F(()=>[O(B(zn))]),_:1}),O(B(In),null,{default:F(()=>[O(B(Mn),null,{default:F(()=>[(I(!0),k(H,null,A(i.value,e=>(I(),K(B(Pn),{key:e.value,value:e.value},{default:F(()=>[V(z(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),L(`div`,oq,[O(B(Rn),{"model-value":o.value,"onUpdate:modelValue":l},{default:F(()=>[O(B(Fn),{size:`sm`,"aria-label":`Filter log entries by stage`},{default:F(()=>[O(B(zn))]),_:1}),O(B(In),null,{default:F(()=>[O(B(Mn),null,{default:F(()=>[O(B(Pn),{value:sq},{default:F(()=>[...n[0]||=[V(`All stages`,-1)]]),_:1}),(I(!0),k(H,null,A(e.stages,e=>(I(),K(B(Pn),{key:e,value:e},{default:F(()=>[V(z(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),lq={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},uq={key:2,class:`flex flex-col items-start gap-2 py-3`},dq={key:0,class:`mt-2 flex flex-wrap items-cent
Line truncated
` )}};wY.defaultYaml={explicit:!1,version: ` 1.2 ` },wY.defaultTags={"!!": ` tag : yaml . org , 2002 : ` };function TY(e){if(/[ \x 00- \x 19 \s ,[ \] {}]/.test(e)){let t= ` Anchor must not contain whitespace or control characters : $ { JSON . stringify ( e ) } ` ;throw Error(t)}return!0}function EY(e){let t=new Set;return _Y(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function DY(e,t){for(let n=1;;++n){let r= ` $ { e } $ { n } ` ;if(!t.has(r))return r}}function OY(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=EY(e);let a=DY(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t== ` object ` &&t.anchor&&(lY(t.node)||dY(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 kY(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=kY(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=kY(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=kY(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=kY(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function AY(e,t,n){if(Array.isArray(e))return e.map((e,t)=>AY(e,String(t),n));if(e&&typeof e.toJSON== ` function ` ){if(!n||!pY(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 jY=class{constructor(e){Object.defineProperty(this,iY,{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(!oY(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=AY(this, ` ` ,a);if(typeof r== ` function ` )for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i== ` function ` ?kY(i,{"":o}, ` ` ,o):o}},MY=class extends jY{constructor(e){super(QJ),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=[],_Y(e,{Node:(e,t)=>{(aY(t)||pY(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||=(AY(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=NY(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(TY(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 NY(e,t,n){if(aY(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(dY(t)){let r=0;for(let i of t.items){let t=NY(e,i,n);t>r&&(r=t)}return r}if(cY(t)){let r=NY(e,t.key,n),i=NY(e,t.value,n);return Math.max(r,i)}return 1}var PY=e=>!e||typeof e!= ` function ` &&typeof e!= ` object ` ,FY=class extends jY{constructor(e){super(nY),this.value=e}toJSON(e,t){return t?.keep?this.value:AY(this.value,e,t)}toString(){return String(this.value)}};FY.BLOCK_FOLDED= ` BLOCK _FOLDED ` ,FY.BLOCK_LITERAL= ` BLOCK _LITERAL ` ,FY.PLAIN= ` PLAIN ` ,FY.QUOTE_DOUBLE= ` QUOTE _DOUBLE ` ,FY.QUOTE_SINGLE= ` QUOTE _SINGLE ` ;var IY= ` tag : yaml . org , 2002 : ` ;function LY(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 RY(e,t,n){if(oY(e)&&(e=e.contents),fY(e))return e;if(cY(e)){let t=n.schema[eY].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 MY(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith( ` ! ! ` )&&(t=IY+t.slice(2));let l=LY(e,t,o.tags);if(!l){if(e&&typeof e.toJSON== ` function ` &&(e=e.toJSON()),!e||typeof e!= ` object ` ){let t=new FY(e);return c&&(c.node=t),t
Line truncated
` )?UY (n,t):n.includes( `
` )}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),CW&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=KW(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=sW(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-qW),qW),t/=qW,t/Math.abs(t)+Math.round(t*(JW-1)))}shouldForceSelection(e){return yW?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener( ` mousemove ` ,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener( ` mouseup ` ,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),YW)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener( ` mousemove ` ,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener( ` mouseup ` ,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(yW&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._active
Line truncated
` ))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(S H(i, ` selectionchange ` ,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(I B(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar( ` ` )}_handleChar(e){this._liveRegionLineCount<Y K+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e=== `
` &&(this._liveRegionLineCount++,this._liveRegionLineCount===YK+1&&(this._liveRegion.textContent+=Dz.get())))}_clearLiveRegion(){this._liveRegion.textContent= ` ` ,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/ \p {Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)|| ` ` ,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent= ` \ xA0 ` ,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute( ` aria - posinset ` ,o),s.setAttribute( ` aria - setsize ` ,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce= ` ` )}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute( ` aria - posinset ` )===(t===0? ` 1 ` : ` $ { this . _terminal . buffer . lines . length } ` )||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener( ` focus ` ,this._topBoundaryFocusListener),a.removeEventListener( ` focus ` ,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement( ` afterbegin ` ,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener( ` focus ` ,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener( ` focus ` ,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error( ` anchorNode and / or focusNode are null ` );return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute( ` aria - posinset ` ),10)-1;if(isNaN(r))return console.warn( ` row is invalid . Race condition ? ` ),null;let i=this._rowColumns.get(n);if(!i)return console.warn( ` columns is null . Race condition ? ` ),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error( ` invalid range ` );this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener( ` focus ` ,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener( ` focus ` ,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement( ` div ` );return e.setAttribute( ` role ` , ` listitem ` ),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width: ` $ { this . _renderService . dimensions . css . canvas . width } px ` ,fontSize: ` $ { this . _terminal . options . fontSize } px ` }),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height= ` $ { this . _renderService . dimensions . css . cell . height } px ` }_alignRowWidth(e){e.style.transform= ` ` ;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let
Line truncated
` ,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Tz.get()},set promptLabel(e){Tz.set(e)},get tooMuchOutput(){return Dz.get()},set tooMuchOutput(e){Dz.set(e)}}}_verifyIntegers(...e){for(cq of e)if(cq===1/0||isNaN(cq)||cq%1!=0)throw Error( ` This API only accepts integers ` )}_verifyPositiveIntegers(...e){for(cq of e)if(cq&&(cq===1/0||isNaN(cq)||cq%1!=0||cq<0))throw Error( ` This API only accepts positive integers ` )}},uq=2,dq=1,fq=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue( ` height ` )),i=Math.max(0,parseInt(n.getPropertyValue( ` width ` ))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue( ` padding - top ` )),bottom:parseInt(a.getPropertyValue( ` padding - bottom ` )),right:parseInt(a.getPropertyValue( ` padding - right ` )),left:parseInt(a.getPropertyValue( ` padding - left ` ))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(uq,Math.floor(u/e.css.cell.width)),rows:Math.max(dq,Math.floor(l/e.css.cell.height))}}},pq={class: ` flex h - [ 32 rem ] min - h - 0 flex - col gap - 2 ` },mq={key:0,class: ` text - sm text - fg - muted ` ,role: ` status ` },hq=N({__name: ` SandboxView ` ,props:{taskId:{},attempt:{}},setup(e){let t=e,n=q(null),r=q( ` connecting ` ),i=null,a=null,o=null,s=null;function c(){try{o?.fit()}catch{}}return ke(()=>{let e=n.value;if(!e)return;i=new lq({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily: ` 'IBM Plex Mono' , ui - monospace , monospace ` ,fontSize:13,theme:{background: ` # 0b0 f14 ` ,foreground: ` # e6edf3 ` }}),o=new fq,i.loadAddon(o),i.open(e),c();let l=window.location.protocol=== ` https : ` ? ` wss : ` : ` ws : ` ,u=new URLSearchParams({attempt:String(t.attempt)}),d=new WebSocket( ` $ { l } //${window.location.host}/api/tasks/${encodeURIComponent(t.taskId)}/sandbox?${u}`);a=d,d.binaryType=`arraybuffer`,d.onopen=()=>{r.value=`open`},d.onmessage=e=>{i&&(typeof e.data==`string`&&(r.value=`failed`),i.write(typeof e.data==`string`?e.data:new Uint8Array(e.data)))},d.onerror=()=>{r.value=`failed`},d.onclose=()=>{r.value!==`failed`&&(r.value=`closed`)},s=new ResizeObserver(c),s.observe(e)}),Ge(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(I(),k(`div`,pq,[r.value===`open`?P(``,!0):(I(),k(`p`,mq,[r.value===`connecting`?(I(),k(H,{key:0},[V(`Connecting…`)],64)):r.value===`closed`?(I(),k(H,{key:1},[V(`The sandbox ended.`)],64)):(I(),k(H,{key:2},[V(`Sandbox unavailable.`)],64))])),L(`div`,{ref_key:`host`,ref:n,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),gq={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},_q={class:`inline-flex items-center gap-2`},vq={class:`inline-flex items-center gap-2`},yq=`__all__`,bq=N({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>Xk.map(e=>({value:e.value||yq,label:e.label}))),a=J(()=>n.filters.level||yq),o=J(()=>n.filters.stage||yq);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===yq?``:String(e)})}function l(e){s({stage:String(e)===yq?``:String(e)})}return(t,n)=>(I(),k(`div`,gq,[L(`div`,_q,[O(B(Rn),{"model-value":a.value,"onUpdate:modelValue":c},{default:F(()=>[O(B(Fn),{size:`sm`,"aria-label":`Filter log entries by level`},{default:F(()=>[O(B(zn))]),_:1}),O(B(In),null,{default:F(()=>[O(B(Mn),null,{default:F(()=>[(I(!0),k(H,null,A(i.value,e=>(I(),K(B(Pn),{key:e.value,value:e.value},{default:F(()=>[V(z(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),L(`div`,vq,[O(B(Rn),{"model-value":o.value,"onUpdate:modelValue":l},{default:F(()=>[O(B(Fn),{size:`sm`,"aria-label":`Filter log entries by stage`},{default:F(()=>[O(B(zn))]),_:1}),O(B(In),null,{default:F(()=>[O(B(Mn),null,{default:F(()=>[O(B(Pn),{value:yq},{default:F(()=>[...n[0]||=[V(`All stages`,-1)]]),_:1}),(I(!0),k(H,null,A(e.stages,e=>(I(),K(B(Pn),{key:e,value:e},{default:F(()=>[V(z(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),xq={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},Sq={key:2,class:`flex flex-col items-start gap-2 py-3`},Cq={key:0,class:`mt-2 flex flex-wrap items-cent
Line truncated
` )}};IY.defaultYaml={explicit:!1,version: ` 1.2 ` },IY.defaultTags={"!!": ` tag : yaml . org , 2002 : ` };function LY(e){if(/[ \x 00- \x 19 \s ,[ \] {}]/.test(e)){let t= ` Anchor must not contain whitespace or control characters : $ { JSON . stringify ( e ) } ` ;throw Error(t)}return!0}function RY(e){let t=new Set;return kY(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function zY(e,t){for(let n=1;;++n){let r= ` $ { e } $ { n } ` ;if(!t.has(r))return r}}function BY(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=RY(e);let a=zY(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t== ` object ` &&t.anchor&&(xY(t.node)||CY(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 VY(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=VY(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=VY(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=VY(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=VY(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function HY(e,t,n){if(Array.isArray(e))return e.map((e,t)=>HY(e,String(t),n));if(e&&typeof e.toJSON== ` function ` ){if(!n||!TY(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 UY=class{constructor(e){Object.defineProperty(this,gY,{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(!vY(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=HY(this, ` ` ,a);if(typeof r== ` function ` )for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i== ` function ` ?VY(i,{"":o}, ` ` ,o):o}},WY=class extends UY{constructor(e){super(uY),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=[],kY(e,{Node:(e,t)=>{(_Y(t)||TY(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||=(HY(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=GY(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(LY(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 GY(e,t,n){if(_Y(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(CY(t)){let r=0;for(let i of t.items){let t=GY(e,i,n);t>r&&(r=t)}return r}if(bY(t)){let r=GY(e,t.key,n),i=GY(e,t.value,n);return Math.max(r,i)}return 1}var KY=e=>!e||typeof e!= ` function ` &&typeof e!= ` object ` ,qY=class extends UY{constructor(e){super(mY),this.value=e}toJSON(e,t){return t?.keep?this.value:HY(this.value,e,t)}toString(){return String(this.value)}};qY.BLOCK_FOLDED= ` BLOCK _FOLDED ` ,qY.BLOCK_LITERAL= ` BLOCK _LITERAL ` ,qY.PLAIN= ` PLAIN ` ,qY.QUOTE_DOUBLE= ` QUOTE _DOUBLE ` ,qY.QUOTE_SINGLE= ` QUOTE _SINGLE ` ;var JY= ` tag : yaml . org , 2002 : ` ;function YY(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 XY(e,t,n){if(vY(e)&&(e=e.contents),wY(e))return e;if(bY(e)){let t=n.schema[fY].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 WY(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith( ` ! ! ` )&&(t=JY+t.slice(2));let l=YY(e,t,o.tags);if(!l){if(e&&typeof e.toJSON== ` function ` &&(e=e.toJSON()),!e||typeof e!= ` object ` ){let t=new qY(e);return c&&(c.node=t),t
Line truncated
` )?tX (n,t):n.includes( `
` )? `
` +UY (n,t):(e.endsWith( ` ` )? ` ` : ` ` )+n,GY = ` flow ` ,KY = ` block ` ,qY = ` quoted ` ;function JY (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=YY (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=YY (e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r=== ` ` &&p&&p!== ` ` &&p!== `
` +tX (n,t):(e.endsWith( ` ` )? ` ` : ` ` )+n,rX = ` flow ` ,iX = ` block ` ,aX = ` quoted ` ;function oX (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=sX (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=sX (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 YY (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 XY =(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ZY =e=>/^(%|---| \. \. \. )/m.test(e);function QY (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 $ Y (e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(ZY (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 ` 000 b ` :o+= ` \ \ v ` ;break;case ` 001 b ` :o+= ` \ \ e ` ;break;case ` 0085 ` :o+= ` \ \ N ` ;break;case ` 00 a0 ` :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 sX (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 c X=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),lX =e=>/^(%|---| \. \. \. )/m.test(e);function uX (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 dX (e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(lX (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 ` 000 b ` :o+= ` \ \ v ` ;break;case ` 001 b ` :o+= ` \ \ e ` ;break;case ` 0085 ` :o+= ` \ \ N ` ;break;case ` 00 a0 ` :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:JY (o,a,qY,XY (t,!1))}function e X(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes( `
` )||/[ \t ] \n | \n [ \t ]/.test(e))return $ Y (e,t);let n=t.indent||(ZY (e)?` ` : ` ` ),r= ` '`+e.replace(/' / g , ` '' ` ) . replace ( /\n+/g , ` $ & \n ${ n } ` ) + ` ' ` ; return t . implicitKey ? r : JY ( r , n , GY , XY ( t , ! 1 ) ) } function tX ( e , t ) { let { singleQuote : n } = t . options , r ; if ( n === ! 1 ) r = $Y ; else { let t = e . includes ( ` " ` ) , i = e . includes ( ` ' ` ) ; r = t && ! i ? eX : i && ! t ? $Y : n ? eX : $Y } return r ( e , t ) } var nX ; try { nX = 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:oX (o,a,aX,cX (t,!1))}function f X(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes( `
` )||/[ \t ] \n | \n [ \t ]/.test(e))return dX (e,t);let n=t.indent||(lX (e)? ` ` : ` ` ),r= ` '`+e.replace(/' / g , ` '' ` ) . replace ( /\n+/g , ` $ & \n ${ n } ` ) + ` ' ` ; return t . implicitKey ? r : oX ( r , n , rX , cX ( t , ! 1 ) ) } function pX ( e , t ) { let { singleQuote : n } = t . options , r ; if ( n === ! 1 ) r = dX ; else { let t = e . includes ( ` " ` ) , i = e . includes ( ` ' ` ) ; r = t && ! i ? fX : i && ! t ? dX : n ? fX : dX } return r ( e , t ) } var mX ; try { mX = RegExp ( ` (^|(?<!
) )
+ ( ? !
| $ ) ` , ` g ` )}catch{n X=/ \n +(?! \n | $ )/g}function r X({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 t X(n,r);let l=r.indent||(r.forceBlockIndent||ZY (n)? ` ` : ` ` ),u=o=== ` literal ` ?!0:o=== ` folded ` ||t===F Y.BLOCK_FOLDED?!1:t===F Y.BLOCK_LITERAL||!QY (n,c,l.length);if(!n)return u? ` |
| $ ) ` , ` g ` )}catch{m X=/ \n +(?! \n | $ )/g}function h X({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 p X(n,r);let l=r.indent||(r.forceBlockIndent||lX (n)? ` ` : ` ` ),u=o=== ` literal ` ?!0:o=== ` folded ` ||t===q Y.BLOCK_FOLDED?!1:t===q Y.BLOCK_LITERAL||!uX (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(n X, ` $ & $ { 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(m X, ` $ & $ { 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=XY (r,!0);o!== ` folded ` &&t!==F Y.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=JY ( ` $ { v } $ { e } $ { p } ` ,l,KY ,a);if(!i)return ` > $ { y } \ n$ { l } $ { s } ` }return n=n.replace(/ \n +/g, ` $ & $ { l } ` ), ` | $ { y } \ n$ { l } $ { v } $ { n } $ { p } ` }function i X(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 t X(a,t);if(/^[ \n \t ,[ \] {}#&*!|>'"%@ ` ] | ^ [ ? - ] $ | ^ [ ? - ] [ \ t ] | [ \ n : ] [ \ t ] | [ \ t ] \ n | [ \ n \ t ] # | [ \ n \ t : ] $ / . test ( a ) ) return s || u || ! a . includes ( `
` )?t X(a,t):r X(e,t,n,r);if(!s&&!u&&i!==F Y.PLAIN&&a.includes( `
` ))return r X(e,t,n,r);if(ZY (a)){if(c=== ` ` )return t.forceBlockIndent=!0,r X(e,t,n,r);if(s&&c===l)return t X(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 t X(a,t)}return s?d:JY (d,c,GY,XY (t,!1))}function a X(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!==F Y.QUOTE_DOUBLE&&/[ \x 00- \x 08 \x 0b- \x 1f \x 7f- \x 9f \u {D800}- \u {DFFF}]/u.test(o.value)&&(s=F Y.QUOTE_DOUBLE);let c=e=>{switch(e){case F Y.BLOCK_FOLDED:case F Y.BLOCK_LITERAL:return i||a?t X(o.value,t):r X(o,t,n,r);case F Y.QUOTE_DOUBLE:return $ Y (o.value,t);case F Y.QUOTE_SINGLE:return e X(o.value,t);case F Y.PLAIN:return i X(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 o X(e,t){let n=Object.assign({blockQuote:!0,commentString:HY ,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 s X(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(l Y(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 c X(e,t,{anchors:n,doc:r}){if(!r.directives)return ` ` ;let i=[],a=(l Y(e)||d Y(e))&&e.anchor;a&&T Y(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 l X(e,t,n,r){if(c Y(e))return e.toString(t,n,r);if(a Y(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=f Y(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=s X(t.doc.schema.tags,a);let o=c X(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):l Y(a)?a X(a,t,n,r):a.toString(t,n,r);return o?l Y(a)||s[0]=== ` { ` ||s[0]=== ` [ ` ? ` $ { o } $ { s } ` : ` $ { o } \ n$ { t . indent } $ { s } ` :s}function u X({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=f Y(e)&&e.comment||null;if(d){if(f)throw Error( ` With simple keys , key nodes cannot have comments ` );if(d Y(e)||!f Y(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||d Y(e)||(l Y(e)?e.type===F Y.BLOCK_FOLDED||e.type===F Y.BLOCK_LITERAL:typeof e== ` object ` ));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=l X(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+=WY (g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=WY (g,n.indent,l(f))),g= ` ? $ { g } \ n$ { s } : ` ):(g= ` $ { g } : ` ,f&&(g+=WY (g,n.indent,l(f))));let _,v,y;f Y(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&&l Y(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&u Y(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=l X(t,n,()=>b=!0,()=>h=!0),S= ` ` ;if(f||_||v){if(S=_? `
` : ` ` ,v){let e=l(v);S+= ` \ n$ { UY ( 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=c X(r,!0);o!== ` folded ` &&t!==q Y.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=oX ( ` $ { v } $ { e } $ { p } ` ,l,iX ,a);if(!i)return ` > $ { y } \ n$ { l } $ { s } ` }return n=n.replace(/ \n +/g, ` $ & $ { l } ` ), ` | $ { y } \ n$ { l } $ { v } $ { n } $ { p } ` }function g X(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 p X(a,t);if(/^[ \n \t ,[ \] {}#&*!|>'"%@ ` ] | ^ [ ? - ] $ | ^ [ ? - ] [ \ t ] | [ \ n : ] [ \ t ] | [ \ t ] \ n | [ \ n \ t ] # | [ \ n \ t : ] $ / . test ( a ) ) return s || u || ! a . includes ( `
` )?p X(a,t):h X(e,t,n,r);if(!s&&!u&&i!==q Y.PLAIN&&a.includes( `
` ))return h X(e,t,n,r);if(lX (a)){if(c=== ` ` )return t.forceBlockIndent=!0,h X(e,t,n,r);if(s&&c===l)return p X(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 p X(a,t)}return s?d:oX (d,c,rX,cX (t,!1))}function _ X(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!==q Y.QUOTE_DOUBLE&&/[ \x 00- \x 08 \x 0b- \x 1f \x 7f- \x 9f \u {D800}- \u {DFFF}]/u.test(o.value)&&(s=q Y.QUOTE_DOUBLE);let c=e=>{switch(e){case q Y.BLOCK_FOLDED:case q Y.BLOCK_LITERAL:return i||a?p X(o.value,t):h X(o,t,n,r);case q Y.QUOTE_DOUBLE:return dX (o.value,t);case q Y.QUOTE_SINGLE:return f X(o.value,t);case q Y.PLAIN:return g X(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 v X(e,t){let n=Object.assign({blockQuote:!0,commentString:eX ,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 y X(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(x Y(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 b X(e,t,{anchors:n,doc:r}){if(!r.directives)return ` ` ;let i=[],a=(x Y(e)||C Y(e))&&e.anchor;a&&L Y(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 x X(e,t,n,r){if(b Y(e))return e.toString(t,n,r);if(_ Y(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=w Y(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=y X(t.doc.schema.tags,a);let o=b X(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):x Y(a)?_ X(a,t,n,r):a.toString(t,n,r);return o?x Y(a)||s[0]=== ` { ` ||s[0]=== ` [ ` ? ` $ { o } $ { s } ` : ` $ { o } \ n$ { t . indent } $ { s } ` :s}function S X({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=w Y(e)&&e.comment||null;if(d){if(f)throw Error( ` With simple keys , key nodes cannot have comments ` );if(C Y(e)||!w Y(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||C Y(e)||(x Y(e)?e.type===q Y.BLOCK_FOLDED||e.type===q Y.BLOCK_LITERAL:typeof e== ` object ` ));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=x X(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+=nX (g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=nX (g,n.indent,l(f))),g= ` ? $ { g } \ n$ { s } : ` ):(g= ` $ { g } : ` ,f&&(g+=nX (g,n.indent,l(f))));let _,v,y;w Y(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&&x Y(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&S Y(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=x X(t,n,()=>b=!0,()=>h=!0),S= ` ` ;if(f||_||v){if(S=_? `
` : ` ` ,v){let e=l(v);S+= ` \ n$ { tX ( e , n . indent ) } ` }x=== ` ` &&!n.inFlow?S=== `
` &&y&&(S= `
` ):S+= ` \ n$ { n . indent } ` }else if(!p&&d Y(t)){let e=x[0],r=x.indexOf( `
` ):S+= ` \ n$ { n . indent } ` }else if(!p&&C Y(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+=WY (g,n.indent,l(y)):h&&i&&i(),g}function d X(e,t){(e=== ` debug ` ||e=== ` warn ` )&&console.warn(t)}var f X= ` << ` ,p X={identify:e=>e===f X||typeof e== ` symbol ` &&e.description===f X,default: ` key ` ,tag: ` tag : yaml . org , 2002 : merge ` ,test:/^<< $ /,resolve:()=>Object.assign(new F Y(Symbol(f X)),{addToJSMap:h X}),stringify:()=>f X},m X=(e,t)=>(p X.identify(t)||l Y(t)&&(!t.type||t.type===F Y.PLAIN)&&p X.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===p X.tag&&e.default);function h X(e,t,n){let r=_ X(e,n);if(u Y(r))for(let n of r.items)g X(e,t,n);else if(Array.isArray(r))for(let n of r)g X(e,t,n);else g X(e,t,r)}function g X(e,t,n){let r=_ X(e,n);if(!s Y(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 _ X(e,t){return e&&a Y(t)?t.resolve(e.doc,e):t}function v X(e,t,{key:n,value:r}){if(f Y(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(m X(e,n))h X(e,t,r);else{let i=A Y(n, ` ` ,e);if(t instanceof Map)t.set(i,A Y(r,i,e));else if(t instanceof Set)t.add(i);else{let a=y X(n,i,e),o=A Y(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function y X(e,t,n){if(t===null)return ` ` ;if(typeof t!= ` object ` )return String(t);if(f Y(e)&&n?.doc){let t=o X(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)+ ` ... " ` ),d X(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 b X(e,t,n){return new x X(R Y(e,void 0,n),R Y(t,void 0,n))}var x X=class e{constructor(e,t=null){Object.defineProperty(this,i Y,{value:t Y}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return f Y(n)&&(n=n.clone(t)),f Y(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return v X(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?u X(this,e,t,n):JSON.stringify(this)}};function S X(e,t,n){return(t.inFlow??e.flow?w X:C X)(e,t,n)}function C X({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(f Y(i))!d&&i.spaceBefore&&f.push( ` ` ),T X(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(c Y(i)){let e=f Y(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push( ` ` ),T X(n,f,e.commentBefore,d))}d=!1;let s=l X(i,u,()=>o=null,()=>d=!0);o&&(s+=WY (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+=nX (g,n.indent,l(y)):h&&i&&i(),g}function C X(e,t){(e=== ` debug ` ||e=== ` warn ` )&&console.warn(t)}var w X= ` << ` ,T X={identify:e=>e===w X||typeof e== ` symbol ` &&e.description===w X,default: ` key ` ,tag: ` tag : yaml . org , 2002 : merge ` ,test:/^<< $ /,resolve:()=>Object.assign(new q Y(Symbol(w X)),{addToJSMap:D X}),stringify:()=>w X},E X=(e,t)=>(T X.identify(t)||x Y(t)&&(!t.type||t.type===q Y.PLAIN)&&T X.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===T X.tag&&e.default);function D X(e,t,n){let r=k X(e,n);if(S Y(r))for(let n of r.items)O X(e,t,n);else if(Array.isArray(r))for(let n of r)O X(e,t,n);else O X(e,t,r)}function O X(e,t,n){let r=k X(e,n);if(!y Y(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 k X(e,t){return e&&_ Y(t)?t.resolve(e.doc,e):t}function A X(e,t,{key:n,value:r}){if(w Y(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(E X(e,n))D X(e,t,r);else{let i=H Y(n, ` ` ,e);if(t instanceof Map)t.set(i,H Y(r,i,e));else if(t instanceof Set)t.add(i);else{let a=j X(n,i,e),o=H Y(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function j X(e,t,n){if(t===null)return ` ` ;if(typeof t!= ` object ` )return String(t);if(w Y(e)&&n?.doc){let t=v X(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)+ ` ... " ` ),C X(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 M X(e,t,n){return new N X(X Y(e,void 0,n),X Y(t,void 0,n))}var N X=class e{constructor(e,t=null){Object.defineProperty(this,g Y,{value:p Y}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return w Y(n)&&(n=n.clone(t)),w Y(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return A X(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?S X(this,e,t,n):JSON.stringify(this)}};function P X(e,t,n){return(t.inFlow??e.flow?I X:F X)(e,t,n)}function F X({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(w Y(i))!d&&i.spaceBefore&&f.push( ` ` ),L X(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(b Y(i)){let e=w Y(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push( ` ` ),L X(n,f,e.commentBefore,d))}d=!1;let s=x X(i,u,()=>o=null,()=>d=!0);o&&(s+=nX (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+= `
` +UY (l(e),c),s&&s()):d&&o&&o(),p}function w X({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(f Y(i))i.spaceBefore&&d.push( ` ` ),T X(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(c Y(i)){let e=f Y(i.key)?i.key:null;e&&(e.spaceBefore&&d.push( ` ` ),T X(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=f Y(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=l X(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+=WY (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 TX({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^ \n +/, ` ` )),r){let i=UY(t(r),e);n.push(i.trimStart())}}function EX(e,t){let n=lY(t)?t.value:t;for(let r of e)if(cY(r)&&(r.key===t||r.key===n||lY(r.key)&&r.key.value===n))return r}var DX=class extends VY{static get tagName(){return ` tag : yaml . org , 2002 : map ` }constructor(e){super(eY,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(bX(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=cY(e)?e:!e||typeof e!= ` object ` ||!( ` key ` in e)?new xX(e,e?.value):new xX(e.key,e.value);let r=EX(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error( ` Key $ { n . key } already set ` );lY(r.value)&&PY(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=EX(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=EX(this.items,e)?.value;return(!t&&lY(n)?n.value:n)??void 0}has(e){return!!EX(this.items,e)}set(e,t){this.add(new xX(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)vX(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!cY(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})),SX(this,e,{blockItemPrefix: ` ` ,flowChars:{start: ` { ` ,end: ` } ` },itemIndent:e.indent|| ` ` ,onChompKeep:n,onComment:t})}},OX={collection: ` map ` ,default:!0,nodeClass:DX,tag: ` tag : yaml . org , 2002 : map ` ,resolve(e,t){return sY(e)||t( ` Expected a mapping for this tag ` ),e},createNode:(e,t,n)=>DX.from(e,t,n)},kX=class extends VY{static get tagName(){return ` tag : yaml . org , 2002 : seq ` }constructor(e){super(rY,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=AX(e);return typeof t== ` number ` &&this.items.splice(t,1).length>0}get(e,t){let n=AX(e);if(typeof n!= ` number ` )return;let r=this.items[n];return!t&&lY(r)?r.value:r}has(e){let t=AX(e);return typeof t== ` number ` &&t<this.items.length}set(e,t){let n=AX(e);if(typeof n!= ` number ` )throw Error( ` Expected a valid index , not $ { e } . ` );let r=this.items[n];lY(r)&&PY(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(AY(e,String(r++),t));return n}toString(e,t,n){return e?SX(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(RY(a,void 0,n))}}return i}};function AX(e){let t=lY(e)?e.value:e;return t&&typeof t== ` string ` &&(t=Number(t)),typeof t== ` number ` &&Number.isInteger(t)&&t>=0?t:null}var jX={collection: ` seq ` ,default:!0,nodeClass:kX,tag: ` tag : yaml . org , 2002 : seq ` ,resolve(e,t){return uY(e)||t( ` Expected a sequence for this tag ` ),e},createNode:(e,t,n)=>kX.from(e,t,n)},MX={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),aX(e,t,n,r)}},NX={identify:e=>e==null,createNode:()=>new FY(null),default:!0,tag: ` tag : yaml . org , 2002 : null ` ,test:/^(?:~|[Nn]ull|NULL)? $ /,resolve:()=>new FY(null),stringify:({source:e},t)=>typeof e== ` string ` &&NX.test.test(e)?e:t.options.nullStr},PX={identify:e=>typeof e== ` boolean ` ,default:!0,tag: ` tag : yaml . org , 2002 : bool ` ,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE) $ /,resolve:e=>new FY(e[0]=== ` t ` ||e[0]=== ` T ` ),stringify({source:e,value:t},n){return e&&PX.test.test(e)&&t===(e[0]=== ` t ` ||e[0]=== ` T ` )?e:t?n.options.trueStr:n.options.falseStr}};function FX({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 IX={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:FX},LX={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 aX({comment:e,type:t,value:s},r,i,a)}};function ZX(e,t){if(uY(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!cY(r)){if(sY(r)){r.items.length>1&&t( ` Each pair must have its own sequence indicator ` );let e=r.items[0]||new xX(new FY(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]=cY(r)?r:new xX(r)}}else t( ` Expected a sequence for this tag ` );return e}function QX(e,t,n){let{replacer:r}=n,i=new kX(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(bX(o,s,n))}return i}var $ X={collection: ` seq ` ,default:!1,tag: ` tag : yaml . org , 2002 : pairs ` ,resolve:ZX,createNode:QX},eZ=class e extends kX{constructor(){super(),this.add=DX.prototype.add.bind(this),this.delete=DX.prototype.delete.bind(this),this.get=DX.prototype.get.bind(this),this.has=DX.prototype.has.bind(this),this.set=DX.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(cY(e)?(r=AY(e.key, ` ` ,t),i=AY(e.value,r,t)):r=AY(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=QX(e,t,n),i=new this;return i.items=r.items,i}};eZ.tag= ` tag : yaml . org , 2002 : omap ` ;var tZ={collection: ` seq ` ,identify:e=>e instanceof Map,nodeClass:eZ,default:!1,tag: ` tag : yaml . org , 2002 : omap ` ,resolve(e,t){let n=ZX(e,t),r=[];for(let{key:e}of n.items)lY(e)&&(r.includes(e.value)?t( ` Ordered maps must not include duplicate keys : $ { e . value } ` ):r.push(e.value));return Object.assign(new eZ,n)},createNode:(e,t,n)=>eZ.from(e,t,n)};function nZ({value:e,source:t},n){return t&&(e?rZ:iZ).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var rZ={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 FY(!0),stringify:nZ},iZ={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 FY(!1),stringify:nZ},aZ={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:FX},oZ={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():FX(e)}},sZ={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 FY(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:FX},cZ=e=>typeof e== ` bigint ` ||Number.isInteger(e);function lZ(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= ` 0 b$ { e } ` ;break;case 8:e= ` 0 o$ { e } ` ;break;case 16:e= ` 0 x$ { e } ` }let t=BigInt(e);return i=== ` - ` ?BigInt(-1)*t:t}let a=parseInt(e,n);return i=== ` - ` ?-1*a:a}function uZ(e,t,n){let{value:r}=e;if(cZ(r)){let e=r.toString(t);return r<0? ` - ` +n+e.substr(1):n+e}return FX(e)}var dZ={identify:cZ,default:!0,tag: ` tag : yaml . org , 2002 : int ` ,format: ` BIN ` ,test:/^[-+]?0b[0-1_]+ $ /,resolve:(e,t,n)=>lZ(e,2,2,n),stringify:e=>uZ(e,2, ` 0 b ` )},fZ={identify:cZ,default:!0,tag: ` tag : yaml . org , 2002 : int ` ,format: ` OCT ` ,test:/^[-+]?0[0-7_]+ $ /,resolve:(e,t,n)=>lZ(e,1,8,n),stringify:e=>uZ(e,8, ` 0 ` )},pZ={identify:cZ,default:!0,tag: ` tag : yaml . org , 2002 : int ` ,test:/^[-+]?[0-9][0-9_]* $ /,resolve:(e,t,n)=>lZ(e,0,10,n),stringify:FX},mZ={identify:cZ,default:!0,tag: ` tag : yaml . org , 2002 : int ` ,format: ` HEX ` ,test:/^[-+]?0x[0-9a-fA-F_]+ $ /,resolve:(e,t,n)=>lZ(e,2,16,n),stringify:e=>uZ(e,16, ` 0 x ` )},hZ=class e extends DX{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=cY(e)?e:e&&typeof e== ` object ` && ` key ` in e&& ` value ` in e&&e.value===null?new xX(e.key,null):new xX(e,null),EX(this.items,t.key)||this.items.push(t)}get(e,t){let n=EX(this.items,e);return!t&&cY(n)?lY(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=EX(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new xX(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(UY (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(UY (a(t), ` ` )))}return n.join( `
` +tX (l(e),c),s&&s()):d&&o&&o(),p}function I X({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(w Y(i))i.spaceBefore&&d.push( ` ` ),L X(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(b Y(i)){let e=w Y(i.key)?i.key:null;e&&(e.spaceBefore&&d.push( ` ` ),L X(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=w Y(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=x X(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+=nX (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 LX({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^ \n +/, ` ` )),r){let i=tX(t(r),e);n.push(i.trimStart())}}function RX(e,t){let n=xY(t)?t.value:t;for(let r of e)if(bY(r)&&(r.key===t||r.key===n||xY(r.key)&&r.key.value===n))return r}var zX=class extends $ Y{static get tagName(){return ` tag : yaml . org , 2002 : map ` }constructor(e){super(fY,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(MX(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=bY(e)?e:!e||typeof e!= ` object ` ||!( ` key ` in e)?new NX(e,e?.value):new NX(e.key,e.value);let r=RX(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error( ` Key $ { n . key } already set ` );xY(r.value)&&KY(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=RX(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=RX(this.items,e)?.value;return(!t&&xY(n)?n.value:n)??void 0}has(e){return!!RX(this.items,e)}set(e,t){this.add(new NX(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)AX(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!bY(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})),PX(this,e,{blockItemPrefix: ` ` ,flowChars:{start: ` { ` ,end: ` } ` },itemIndent:e.indent|| ` ` ,onChompKeep:n,onComment:t})}},BX={collection: ` map ` ,default:!0,nodeClass:zX,tag: ` tag : yaml . org , 2002 : map ` ,resolve(e,t){return yY(e)||t( ` Expected a mapping for this tag ` ),e},createNode:(e,t,n)=>zX.from(e,t,n)},VX=class extends $ Y{static get tagName(){return ` tag : yaml . org , 2002 : seq ` }constructor(e){super(hY,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=HX(e);return typeof t== ` number ` &&this.items.splice(t,1).length>0}get(e,t){let n=HX(e);if(typeof n!= ` number ` )return;let r=this.items[n];return!t&&xY(r)?r.value:r}has(e){let t=HX(e);return typeof t== ` number ` &&t<this.items.length}set(e,t){let n=HX(e);if(typeof n!= ` number ` )throw Error( ` Expected a valid index , not $ { e } . ` );let r=this.items[n];xY(r)&&KY(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(HY(e,String(r++),t));return n}toString(e,t,n){return e?PX(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(XY(a,void 0,n))}}return i}};function HX(e){let t=xY(e)?e.value:e;return t&&typeof t== ` string ` &&(t=Number(t)),typeof t== ` number ` &&Number.isInteger(t)&&t>=0?t:null}var UX={collection: ` seq ` ,default:!0,nodeClass:VX,tag: ` tag : yaml . org , 2002 : seq ` ,resolve(e,t){return SY(e)||t( ` Expected a sequence for this tag ` ),e},createNode:(e,t,n)=>VX.from(e,t,n)},WX={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),_X(e,t,n,r)}},GX={identify:e=>e==null,createNode:()=>new qY(null),default:!0,tag: ` tag : yaml . org , 2002 : null ` ,test:/^(?:~|[Nn]ull|NULL)? $ /,resolve:()=>new qY(null),stringify:({source:e},t)=>typeof e== ` string ` &&GX.test.test(e)?e:t.options.nullStr},KX={identify:e=>typeof e== ` boolean ` ,default:!0,tag: ` tag : yaml . org , 2002 : bool ` ,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE) $ /,resolve:e=>new qY(e[0]=== ` t ` ||e[0]=== ` T ` ),stringify({source:e,value:t},n){return e&&KX.test.test(e)&&t===(e[0]=== ` t ` ||e[0]=== ` T ` )?e:t?n.options.trueStr:n.options.falseStr}};function qX({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 JX={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:qX},YX={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 _X({comment:e,type:t,value:s},r,i,a)}};function lZ(e,t){if(SY(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!bY(r)){if(yY(r)){r.items.length>1&&t( ` Each pair must have its own sequence indicator ` );let e=r.items[0]||new NX(new qY(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]=bY(r)?r:new NX(r)}}else t( ` Expected a sequence for this tag ` );return e}function uZ(e,t,n){let{replacer:r}=n,i=new VX(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(MX(o,s,n))}return i}var dZ={collection: ` seq ` ,default:!1,tag: ` tag : yaml . org , 2002 : pairs ` ,resolve:lZ,createNode:uZ},fZ=class e extends VX{constructor(){super(),this.add=zX.prototype.add.bind(this),this.delete=zX.prototype.delete.bind(this),this.get=zX.prototype.get.bind(this),this.has=zX.prototype.has.bind(this),this.set=zX.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(bY(e)?(r=HY(e.key, ` ` ,t),i=HY(e.value,r,t)):r=HY(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=uZ(e,t,n),i=new this;return i.items=r.items,i}};fZ.tag= ` tag : yaml . org , 2002 : omap ` ;var pZ={collection: ` seq ` ,identify:e=>e instanceof Map,nodeClass:fZ,default:!1,tag: ` tag : yaml . org , 2002 : omap ` ,resolve(e,t){let n=lZ(e,t),r=[];for(let{key:e}of n.items)xY(e)&&(r.includes(e.value)?t( ` Ordered maps must not include duplicate keys : $ { e . value } ` ):r.push(e.value));return Object.assign(new fZ,n)},createNode:(e,t,n)=>fZ.from(e,t,n)};function mZ({value:e,source:t},n){return t&&(e?hZ:gZ).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var hZ={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 qY(!0),stringify:mZ},gZ={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 qY(!1),stringify:mZ},_Z={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:qX},vZ={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():qX(e)}},yZ={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 qY(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:qX},bZ=e=>typeof e== ` bigint ` ||Number.isInteger(e);function xZ(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= ` 0 b$ { e } ` ;break;case 8:e= ` 0 o$ { e } ` ;break;case 16:e= ` 0 x$ { e } ` }let t=BigInt(e);return i=== ` - ` ?BigInt(-1)*t:t}let a=parseInt(e,n);return i=== ` - ` ?-1*a:a}function SZ(e,t,n){let{value:r}=e;if(bZ(r)){let e=r.toString(t);return r<0? ` - ` +n+e.substr(1):n+e}return qX(e)}var CZ={identify:bZ,default:!0,tag: ` tag : yaml . org , 2002 : int ` ,format: ` BIN ` ,test:/^[-+]?0b[0-1_]+ $ /,resolve:(e,t,n)=>xZ(e,2,2,n),stringify:e=>SZ(e,2, ` 0 b ` )},wZ={identify:bZ,default:!0,tag: ` tag : yaml . org , 2002 : int ` ,format: ` OCT ` ,test:/^[-+]?0[0-7_]+ $ /,resolve:(e,t,n)=>xZ(e,1,8,n),stringify:e=>SZ(e,8, ` 0 ` )},TZ={identify:bZ,default:!0,tag: ` tag : yaml . org , 2002 : int ` ,test:/^[-+]?[0-9][0-9_]* $ /,resolve:(e,t,n)=>xZ(e,0,10,n),stringify:qX},EZ={identify:bZ,default:!0,tag: ` tag : yaml . org , 2002 : int ` ,format: ` HEX ` ,test:/^[-+]?0x[0-9a-fA-F_]+ $ /,resolve:(e,t,n)=>xZ(e,2,16,n),stringify:e=>SZ(e,16, ` 0 x ` )},DZ=class e extends zX{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=bY(e)?e:e&&typeof e== ` object ` && ` key ` in e&& ` value ` in e&&e.value===null?new NX(e.key,null):new NX(e,null),RX(this.items,t.key)||this.items.push(t)}get(e,t){let n=RX(this.items,e);return!t&&bY(n)?xY(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=RX(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new NX(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(tX (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(tX (a(t), ` ` )))}return n.join( `
` )+ `
` }var A Z=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,i Y,{value: $ J });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 w Y({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[i Y]:{value: $ J }});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=f Y(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){j Z(this.contents)&&this.contents.add(e)}addIn(e,t){j Z(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=E Y(this);e.anchor=!t||n.has(t)?D Y(t||` a ` ,n):t}return new M Y(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}=O Y(this,a|| ` a ` ),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=R Y(e,l,p);return o&&d Y(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new x X(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return j Z(this.contents)?this.contents.delete(e):!1}deleteIn(e){return B Y(e)?this.contents!=null&&(this.contents=null,!0):j Z(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return d Y(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return B Y(e)?!t&&l Y(this.contents)?this.contents.value:this.contents:d Y(this.contents)?this.contents.getIn(e,t):void 0}has(e){return d Y(this.contents)?this.contents.has(e):!1}hasIn(e){return B Y(e)?this.contents!==void 0:d Y(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=z Y(this.schema,[e],t):j Z(this.contents)&&this.contents.set(e,t)}setIn(e,t){B Y(e)?this.contents=t:this.contents==null?this.contents=z Y(this.schema,Array.from(e),t):j Z(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 w Y({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 w Y({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 O Z(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=A Y(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 ` ?k Y(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 k Z(this,e)}};function j Z(e){if(d Y(e))return!0;throw Error( ` Expected a YAML collection as document contents ` )}var M Z=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},N Z=class extends M Z{constructor(e,t,n){super( ` YAMLParseError ` ,e,t,n)}},P Z=class extends M Z{constructor(e,t,n){super( ` YAMLWarning ` ,e,t,n)}},F Z=(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 I Z(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],ee=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:ee,start:x??ee}}function L Z(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(L Z(t.key)||L Z(t.value))return!0}return!1;default:return!0}}function R Z(e,t,n){if(t?.type=== ` flow - collection ` ){let r=t.end[0];r.indent===e&&(r.source=== ` ] ` ||r.source=== ` } ` )&&L Z(t)&&n(r, ` BAD _INDENT ` , ` Flow end indicator should be more indented than parent ` ,!0)}}function z Z(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r== ` function ` ?r:(e,t)=>e===t||l Y(e)&&l Y(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var B Z= ` All mapping items must start at the same column ` ;function V Z({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??D X)(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=I Z(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 ` ,B Z)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+= `
` +p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||L Z(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 ` ,B Z);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&R Z(r.indent,u,i),n.atKey=!1,z Z(n,o.items,g)&&i(h, ` DUPLICATE _KEY ` , ` Map keys must be unique ` );let _=I Z(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&&R Z(r.indent,f,i),s=c.range[2];let l=new x X(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 x X(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 HZ ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??k X)(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=I Z(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&&R Z(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function UZ (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 WZ = ` Block collections are not allowed within flow collections ` ,GZ =e=>e&&(e.type=== ` block - map ` ||e.type=== ` block - seq ` );function KZ ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source=== ` { ` ,s=o? ` flow map ` : ` flow sequence ` ,c=new((a?.nodeClass)??(o?D X:k X))(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=I Z(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&&L Z(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];c Y(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],GZ (m)&&i(r.range, ` BLOCK _IN _FLOW ` ,WZ )}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);GZ (f)&&i(g.range, ` BLOCK _IN _FLOW ` ,WZ ),n.atKey=!1;let _=I Z(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?GZ (m)&&i(v.range, ` BLOCK _IN _FLOW ` ,WZ ):_.comment&&(g.comment?g.comment+= `
` +_.comment:g.comment=_.comment);let y=new x X(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;z Z(n,e.items,g)&&i(a, ` DUPLICATE _KEY ` , ` Map keys must be unique ` ),e.items.push(y)}else{let e=new D X(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=UZ (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 qZ (e,t,n,r,i,a){let o=n.type=== ` block - map ` ?V Z(e,t,n,r,a):n.type=== ` block - seq ` ?HZ (e,t,n,r,a):KZ (e,t,n,r,a),s=o.constructor;return i=== ` ! ` ||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function JZ (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===D X.tagName&&s=== ` map ` ||o===k X.tagName&&s=== ` seq ` )return qZ (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),qZ (e,t,n,i,o)}let l=qZ (e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a, ` TAG _RESOLVE _FAILED ` ,e),t.options)??l,d=f Y(u)?u:new F Y(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function YZ (e,t,n){let r=t.offset,i=XZ (t,e.options.strict,n);if(!i)return{value: ` ` ,type:null,comment: ` ` ,range:[r,r,r]};let a=i.mode=== ` > ` ?F Y.BLOCK_FOLDED:F Y.BLOCK_LITERAL,o=t.source?ZZ (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 H Z=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,g Y,{value:dY });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 I Y({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[g Y]:{value:dY }});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=w Y(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){U Z(this.contents)&&this.contents.add(e)}addIn(e,t){U Z(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=R Y(this);e.anchor=!t||n.has(t)?z Y(t|| ` a ` ,n):t}return new W Y(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}=B Y(this,a|| ` a ` ),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=X Y(e,l,p);return o&&C Y(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new N X(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return U Z(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Q Y(e)?this.contents!=null&&(this.contents=null,!0):U Z(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return C Y(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Q Y(e)?!t&&x Y(this.contents)?this.contents.value:this.contents:C Y(this.contents)?this.contents.getIn(e,t):void 0}has(e){return C Y(this.contents)?this.contents.has(e):!1}hasIn(e){return Q Y(e)?this.contents!==void 0:C Y(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Z Y(this.schema,[e],t):U Z(this.contents)&&this.contents.set(e,t)}setIn(e,t){Q Y(e)?this.contents=t:this.contents==null?this.contents=Z Y(this.schema,Array.from(e),t):U Z(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 I Y({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 I Y({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 B Z(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=H Y(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 ` ?V Y(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 V Z(this,e)}};function U Z(e){if(C Y(e))return!0;throw Error( ` Expected a YAML collection as document contents ` )}var W Z=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},G Z=class extends W Z{constructor(e,t,n){super( ` YAMLParseError ` ,e,t,n)}},K Z=class extends W Z{constructor(e,t,n){super( ` YAMLWarning ` ,e,t,n)}},q Z=(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 J Z(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],ee=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:ee,start:x??ee}}function Y Z(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(Y Z(t.key)||Y Z(t.value))return!0}return!1;default:return!0}}function X Z(e,t,n){if(t?.type=== ` flow - collection ` ){let r=t.end[0];r.indent===e&&(r.source=== ` ] ` ||r.source=== ` } ` )&&Y Z(t)&&n(r, ` BAD _INDENT ` , ` Flow end indicator should be more indented than parent ` ,!0)}}function Z Z(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r== ` function ` ?r:(e,t)=>e===t||x Y(e)&&x Y(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Q Z= ` All mapping items must start at the same column ` ;function $ Z({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??z X)(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=J Z(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 ` ,Q Z)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+= `
` +p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Y Z(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 ` ,Q Z);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&X Z(r.indent,u,i),n.atKey=!1,Z Z(n,o.items,g)&&i(h, ` DUPLICATE _KEY ` , ` Map keys must be unique ` );let _=J Z(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&&X Z(r.indent,f,i),s=c.range[2];let l=new N X(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 N X(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 eQ ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??V X)(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=J Z(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&&X Z(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function tQ (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 nQ = ` Block collections are not allowed within flow collections ` ,rQ =e=>e&&(e.type=== ` block - map ` ||e.type=== ` block - seq ` );function iQ ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source=== ` { ` ,s=o? ` flow map ` : ` flow sequence ` ,c=new((a?.nodeClass)??(o?z X:V X))(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=J Z(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&&Y Z(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];b Y(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],rQ (m)&&i(r.range, ` BLOCK _IN _FLOW ` ,nQ )}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);rQ (f)&&i(g.range, ` BLOCK _IN _FLOW ` ,nQ ),n.atKey=!1;let _=J Z(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?rQ (m)&&i(v.range, ` BLOCK _IN _FLOW ` ,nQ ):_.comment&&(g.comment?g.comment+= `
` +_.comment:g.comment=_.comment);let y=new N X(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Z Z(n,e.items,g)&&i(a, ` DUPLICATE _KEY ` , ` Map keys must be unique ` ),e.items.push(y)}else{let e=new z X(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=tQ (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 aQ (e,t,n,r,i,a){let o=n.type=== ` block - map ` ? $ Z(e,t,n,r,a):n.type=== ` block - seq ` ?eQ (e,t,n,r,a):iQ (e,t,n,r,a),s=o.constructor;return i=== ` ! ` ||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function oQ (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===z X.tagName&&s=== ` map ` ||o===V X.tagName&&s=== ` seq ` )return aQ (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),aQ (e,t,n,i,o)}let l=aQ (e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a, ` TAG _RESOLVE _FAILED ` ,e),t.options)??l,d=w Y(u)?u:new q Y(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function sQ (e,t,n){let r=t.offset,i=cQ (t,e.options.strict,n);if(!i)return{value: ` ` ,type:null,comment: ` ` ,range:[r,r,r]};let a=i.mode=== ` > ` ?q Y.BLOCK_FOLDED:q Y.BLOCK_LITERAL,o=t.source?lQ (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===F Y.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===q Y.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f= `
` ):t.length>c||r[0]=== ` ` ?(f=== ` ` ?f= `
` :!p&&f=== `
` &&(f= `
@@ -247,59 +247,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 XZ ({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 ZZ (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 QZ (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=F Y.PLAIN,c= $ Z (a,l);break;case` single - quoted - scalar ` :s=F Y.QUOTE_SINGLE,c=e Q(a,l);break;case ` double - quoted - scalar ` :s=F Y.QUOTE_DOUBLE,c=n Q(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=UZ (o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function $ Z (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 } ` ) , tQ ( e ) } function eQ ( e , t ) { return ( e [ e . length - 1 ] !== ` ' ` || e . length === 1 ) && t ( e . length , ` MISSING_CHAR ` , ` Missing closing 'quote ` ) , tQ ( e . slice ( 1 , - 1 ) ) . replace ( /''/g , ` ' ` ) } function tQ ( e ) { let t = / ( . * ? ) \ r ? \ n / s y , n = t . e x e c ( e ) ; i f ( ! n ) r e t u r n e ; l e t r , i ; t r y { r = R e g E x p ( ` ( ? < ! [ ] ) [ ] + $ ` ) , i = R e g E x p ( ` ^ [ ] + | ( ? < ! [ ] ) [ ] + $ ` , ` g ` ) } c a t c h { r = / [ \ t ] + $ / , i = / ^ [ \ t ] + | [ \ t ] + $ / g } l e t a = n [ 1 ] . r e p l a c e ( r , ` ` ) , o = ` ` , s = t . l a s t I n d e x ; f o r ( ; n = t . e x e c ( e ) ; ) { l e t e = n [ 1 ] . r e p l a c e ( i , ` ` ) ; e = = = ` ` ? o = = = `
` }let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function cQ ({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 lQ (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 u Q(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=q Y.PLAIN,c=dQ (a,l);break;case ` single - quoted - scalar ` :s=q Y.QUOTE_SINGLE,c=f Q(a,l);break;case ` double - quoted - scalar ` :s=q Y.QUOTE_DOUBLE,c=m Q(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=tQ (o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function dQ (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 } ` ) , pQ ( e ) } function fQ ( e , t ) { return ( e [ e . length - 1 ] !== ` ' ` || e . length === 1 ) && t ( e . length , ` MISSING_CHAR ` , ` Missing closing 'quote ` ) , pQ ( e . slice ( 1 , - 1 ) ) . replace ( /''/g , ` ' ` ) } function pQ ( e ) { let t = / ( . * ? ) \ r ? \ n / s y , n = t . e x e c ( e ) ; i f ( ! n ) r e t u r n e ; l e t r , i ; t r y { r = R e g E x p ( ` ( ? < ! [ ] ) [ ] + $ ` ) , i = R e g E x p ( ` ^ [ ] + | ( ? < ! [ ] ) [ ] + $ ` , ` g ` ) } c a t c h { r = / [ \ t ] + $ / , i = / ^ [ \ t ] + | [ \ t ] + $ / g } l e t a = n [ 1 ] . r e p l a c e ( r , ` ` ) , o = ` ` , s = t . l a s t I n d e x ; f o r ( ; n = t . e x e c ( e ) ; ) { l e t e = n [ 1 ] . r e p l a c e ( 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 n Q(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 m Q(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}=r Q(e,r);n+=t,r=i}else if(i=== ` \ \ ` ){let i=e[++r],a=i Q[i];if(a)n+=a;else if(i=== `
` ){let{fold:t,offset:i}=h Q(e,r);n+=t,r=i}else if(i=== ` \ \ ` ){let i=e[++r],a=g Q[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+=a Q(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+=_ Q(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 r Q(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 h Q(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 i Q={0: ` \ 0 ` ,a: ` \ x07 ` ,b: ` \ b ` ,e: ` \ x1B ` ,f: ` \ f ` ,n: `
` ,r: ` \ r ` ,t: ` ` ,v: ` \ v ` ,N: `
` ,_: ` \ xA0 ` ,L: ` \u2028 ` ,P: ` \u2029 ` ," ": ` ` ,'"': ` "`," / ":`/`," \ \ ":`\\`," " : ` ` } ; function aQ ( 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 oQ ( e , t , n , r ) { let { value : i , type : a , comment : o , range : s } = t . type === ` block-scalar ` ? YZ ( e , t , r ) : QZ ( 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 [ nY ] : c ? sQ ( e . schema , i , c , n , r ) : t . type === ` scalar ` ? cQ ( e , i , t , r ) : e . schema [ nY ] ; let u ; try { let a = l . resolve ( i , e => r ( n ? ? t , ` TAG_RESOLVE_FAILED ` , e ) , e . options ) ; u = lY ( a ) ? a : new FY ( a ) } catch ( e ) { let a = e instanceof Error ? e . message : String ( e ) ; r ( n ? ? t , ` TAG_RESOLVE_FAILED ` , a ) , u = new FY ( 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 sQ ( e , t , n , r , i ) { if ( n === ` ! ` ) return e [ nY ] ; 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 [ nY ] ) } function cQ ( { 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 [ nY ] ; if ( n . compat ) { let e = n . compat . find ( e => e . default && e . test ? . test ( r ) ) ? ? n [ nY ] ; 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 lQ ( 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 uQ = { composeNode : dQ , composeEmptyNode : fQ } ; function dQ ( 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 = pQ ( 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 = oQ ( e , t , c , r ) , s && ( l . anchor = s . source . substring ( 1 ) ) ; break ; case ` block-map ` : case ` block-seq ` : case ` flow-collection ` : try { l = JZ ( uQ , 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 ? ? = fQ ( 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 && ( ! lY ( 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 fQ ( e , t , n , r , { spaceBefore : i , comment : a , anchor : o , tag : s , end : c } , l ) { let u = oQ ( e , { type : ` scalar ` , offset : lQ ( 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 pQ ( { options : e } , { offset : t , source : n , end : r } , i ) { let a = new MY ( 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 = UZ ( r , o , e . strict , i ) ; return a . range = [ t , o , s . offset ] , s . comment && ( a . comment = s . comment ) , a } function mQ ( e , t , { offset : n , start : r , value : i , end : a } , o ) { let s = new AZ ( void 0 , Object . assign ( { _directives : t } , e ) ) , c = { atKey : ! 1 , atRoot : ! 0 , directives : s . directives , options : s . options , schema : s . schema } , l = IZ ( 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 ? dQ ( c , i , l , o ) : fQ ( c , l . end , r , null , l , o ) ; let u = s . contents . range [ 2 ] , d = UZ ( a , u , ! 1 , o ) ; return d . comment && ( s . comment = d . comment ) , s . range = [ n , u , d . offset ] , s } function hQ ( 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 gQ ( 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 g Q={0: ` \ 0 ` ,a: ` \ x07 ` ,b: ` \ b ` ,e: ` \ x1B ` ,f: ` \ f ` ,n: `
` ,r: ` \ r ` ,t: ` ` ,v: ` \ v ` ,N: `
` ,_: ` \ xA0 ` ,L: ` \u2028 ` ,P: ` \u2029 ` ," ": ` ` ,'"': ` "`," / ":`/`," \ \ ":`\\`," " : ` ` } ; function _Q ( 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 vQ ( e , t , n , r ) { let { value : i , type : a , comment : o , range : s } = t . type === ` block-scalar ` ? sQ ( e , t , r ) : uQ ( 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 [ mY ] : c ? yQ ( e . schema , i , c , n , r ) : t . type === ` scalar ` ? bQ ( e , i , t , r ) : e . schema [ mY ] ; let u ; try { let a = l . resolve ( i , e => r ( n ? ? t , ` TAG_RESOLVE_FAILED ` , e ) , e . options ) ; u = xY ( a ) ? a : new qY ( a ) } catch ( e ) { let a = e instanceof Error ? e . message : String ( e ) ; r ( n ? ? t , ` TAG_RESOLVE_FAILED ` , a ) , u = new qY ( 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 yQ ( e , t , n , r , i ) { if ( n === ` ! ` ) return e [ mY ] ; 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 [ mY ] ) } function bQ ( { 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 [ mY ] ; if ( n . compat ) { let e = n . compat . find ( e => e . default && e . test ? . test ( r ) ) ? ? n [ mY ] ; 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 xQ ( 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 SQ = { composeNode : CQ , composeEmptyNode : wQ } ; function CQ ( 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 = TQ ( 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 = vQ ( e , t , c , r ) , s && ( l . anchor = s . source . substring ( 1 ) ) ; break ; case ` block-map ` : case ` block-seq ` : case ` flow-collection ` : try { l = oQ ( SQ , 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 ? ? = wQ ( 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 && ( ! xY ( 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 wQ ( e , t , n , r , { spaceBefore : i , comment : a , anchor : o , tag : s , end : c } , l ) { let u = vQ ( e , { type : ` scalar ` , offset : xQ ( 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 TQ ( { options : e } , { offset : t , source : n , end : r } , i ) { let a = new WY ( 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 = tQ ( r , o , e . strict , i ) ; return a . range = [ t , o , s . offset ] , s . comment && ( a . comment = s . comment ) , a } function EQ ( e , t , { offset : n , start : r , value : i , end : a } , o ) { let s = new HZ ( void 0 , Object . assign ( { _directives : t } , e ) ) , c = { atKey : ! 1 , atRoot : ! 0 , directives : s . directives , options : s . options , schema : s . schema } , l = JZ ( 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 ? CQ ( c , i , l , o ) : wQ ( c , l . end , r , null , l , o ) ; let u = s . contents . range [ 2 ] , d = tQ ( a , u , ! 1 , o ) ; return d . comment && ( s . comment = d . comment ) , s . range = [ n , u , d . offset ] , s } function DQ ( 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 OQ ( 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 _ Q=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=h Q(e);r?this.warnings.push(new P Z(i,t,n)):this.errors.push(new N Z(i,t,n))},this.directives=new w Y({version:e.version|| ` 1.2 ` }),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=g Q(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(d Y(i)&&!i.flow&&i.items.length>0){let e=i.items[0];c Y(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:g Q(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=h Q(e);i[0]+=t,this.onError(i, ` BAD _DIRECTIVE ` ,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case ` document ` :{let t=m Q(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 N Z(h Q(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 N Z(h Q(e), ` UNEXPECTED _TOKEN ` , ` Unexpected doc - end without preceding document ` ));break}this.doc.directives.docEnd=!0;let t=UZ (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 N Z(h Q(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 A Z(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}}},v Q=Symbol( ` break visit ` ),y Q=Symbol( ` skip children ` ),b Q=Symbol( ` remove item ` );function x Q(e,t){ ` type ` in e&&e.type=== ` document ` &&(e={start:e.start,value:e.value}),S Q(Object.freeze([]),e,t)}x Q.BREAK=v Q,x Q.SKIP=y Q,x Q.REMOVE=b Q,x Q.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},x Q.parentCollection=(e,t)=>{let n=x Q.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 S Q(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=S Q(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r== ` number ` )t=r-1;else if(r===v Q)return v Q;else r===b Q&&(a.items.splice(t,1),--t)}typeof r== ` function ` &&i=== ` key ` &&(r=r(t,e))}}return typeof r== ` function ` ?r(t,e):r}function C Q(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 k Q=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=D Q(e);r?this.warnings.push(new K Z(i,t,n)):this.errors.push(new G Z(i,t,n))},this.directives=new I Y({version:e.version|| ` 1.2 ` }),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=O Q(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(C Y(i)&&!i.flow&&i.items.length>0){let e=i.items[0];b Y(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:O Q(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=D Q(e);i[0]+=t,this.onError(i, ` BAD _DIRECTIVE ` ,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case ` document ` :{let t=E Q(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 G Z(D Q(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 G Z(D Q(e), ` UNEXPECTED _TOKEN ` , ` Unexpected doc - end without preceding document ` ));break}this.doc.directives.docEnd=!0;let t=tQ (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 G Z(D Q(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 H Z(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}}},A Q=Symbol( ` break visit ` ),j Q=Symbol( ` skip children ` ),M Q=Symbol( ` remove item ` );function N Q(e,t){ ` type ` in e&&e.type=== ` document ` &&(e={start:e.start,value:e.value}),P Q(Object.freeze([]),e,t)}N Q.BREAK=A Q,N Q.SKIP=j Q,N Q.REMOVE=M Q,N Q.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},N Q.parentCollection=(e,t)=>{let n=N Q.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 P Q(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=P Q(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r== ` number ` )t=r-1;else if(r===A Q)return A Q;else r===M Q&&(a.items.splice(t,1),--t)}typeof r== ` function ` &&i=== ` key ` &&(r=r(t,e))}}return typeof r== ` function ` ?r(t,e):r}function F Q(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 w Q(e){switch(e){case void 0:case ` ` :case `
` :case ` \ r ` :case ` ` :return!0;default:return!1}}var T Q=new Set( ` 0123456789 ABCDEFabcdef ` ),E Q=new Set( ` 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz - # ; / ? : @ & = + $ _ . ! ~ * ' ( ) ` ) , D Q = n e w S e t ( ` , [ ] { } ` ) , O Q = n e w S e t ( ` , [ ] { }
\ r ` ),k Q=e=>!e||O Q.has(e),A Q=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 I Q(e){switch(e){case void 0:case ` ` :case `
` :case ` \ r ` :case ` ` :return!0;default:return!1}}var L Q=new Set( ` 0123456789 ABCDEFabcdef ` ),R Q=new Set( ` 0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz - # ; / ? : @ & = + $ _ . ! ~ * ' ( ) ` ) , z Q = n e w S e t ( ` , [ ] { } ` ) , B Q = n e w S e t ( ` , [ ] { }
\ r ` ),V Q=e=>!e||B Q.has(e),H Q=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=== ` ... ` )&&w Q(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=== ` ... ` )&&w Q(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&&!w Q(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=== ` : ` )&&w Q(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(k Q), ` 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(`...`))&&w Q(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(k Q),`flow`;case`" ` :case ` '`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||w Q(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=== ` ... ` )&&I Q(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=== ` ... ` )&&I Q(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&&!I Q(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=== ` : ` )&&I Q(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(V Q), ` 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(`...`))&&I Q(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(V Q),`flow`;case`" ` :case ` '`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||I Q(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=>w Q(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=>I Q(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(w Q(r)||e&&D Q.has(r))break;t=n}else if(w Q(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(I Q(r)||e&&z Q.has(r))break;t=n}else if(I Q(r)){let i=this.buffer[n+1];if(r=== ` \ r ` &&(i=== `
` ?(n+=1,r= `
` ,i=this.buffer[n+1]):t=n),i=== ` # ` ||e&&D Q.has(i))break;if(r=== `
` ){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&D Q.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(k Q),e+=yield*this.pushSpaces(!0);continue loop;case ` - ` :case ` ? ` :case ` : ` :{let t=this.flowLevel>0,n=this.charAt(1);if(w Q(n)||t&&D Q.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(;!w Q(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(E Q.has(t))t=this.buffer[++e];else if(t=== ` % ` &&T Q.has(this.buffer[e+1])&&T Q.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&&z Q.has(i))break;if(r=== `
` ){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&z Q.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(V Q),e+=yield*this.pushSpaces(!0);continue loop;case ` - ` :case ` ? ` :case ` : ` :{let t=this.flowLevel>0,n=this.charAt(1);if(I Q(n)||t&&z Q.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(;!I Q(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(R Q.has(t))t=this.buffer[++e];else if(t=== ` % ` &&L Q.has(this.buffer[e+1])&&L Q.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)}},jQ=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 MQ(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function NQ(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 PQ(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 FQ(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 IQ(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 LQ(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 RQ(e){if(e.start.type=== ` flow - seq - start ` )for(let t of e.items)t.sep&&!t.value&&!MQ(t.start, ` explicit - key - ind ` )&&!MQ(t.sep, ` map - value - ind ` )&&(t.key&&(t.value=t.key),delete t.key,PQ(t.value)?t.value.end?LQ(t.value.end,t.sep):t.value.end=t.sep:LQ(t.start,t.sep),delete t.sep)}var zQ=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 AQ,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=CQ(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 ` &&RQ(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&&NQ(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!== ` comment ` ||e.in
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)}},UQ=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 WQ(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function GQ(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 KQ(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 qQ(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 JQ(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 YQ(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 XQ(e){if(e.start.type=== ` flow - seq - start ` )for(let t of e.items)t.sep&&!t.value&&!WQ(t.start, ` explicit - key - ind ` )&&!WQ(t.sep, ` map - value - ind ` )&&(t.key&&(t.value=t.key),delete t.key,KQ(t.value)?t.value.end?YQ(t.value.end,t.sep):t.value.end=t.sep:YQ(t.start,t.sep),delete t.sep)}var ZQ=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 HQ,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=FQ(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 ` &&XQ(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&&GQ(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)){LQ(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(MQ(t.start, ` newline ` ))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=IQ(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(MQ(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(PQ(t.key)&&!MQ(t.sep, ` newline ` )){let e=IQ(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]}):MQ(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&&!MQ(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)){LQ(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||MQ(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)){YQ(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(WQ(t.start, ` newline ` ))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=JQ(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(WQ(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(KQ(t.key)&&!WQ(t.sep, ` newline ` )){let e=JQ(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]}):WQ(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&&!WQ(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)){YQ(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||WQ(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=IQ(FQ(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=IQ(FQ(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 BQ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new jQ||null,prettyErrors:t}}function VQ(e,t={}){let{lineCounter:n,prettyErrors:r}=BQ(t),i=new zQ(n?.addNewLine),a=new _Q(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 NZ(t.range.slice(0,2), ` MULTIPLE _DOCS ` , ` Source contains multiple documents ; please use YAML . parseAllDocuments ( ) ` ));break}return r&&n&&(o.errors.forEach(FZ(e,n)),o.warnings.forEach(FZ(e,n))),o}function HQ(e,t,n){let r;typeof t== ` function ` ?r=t:n===void 0&&t&&typeof t== ` object ` &&(n=t);let i=VQ(e,n);if(!i)return null;if(i.warnings.forEach(e=>dX(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 UQ(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 oY(e)&&!r?e.toString(n):new AZ(e,r,n).toString(n)}var WQ=e=>typeof e== ` object ` &&!!e&&!Array.isArray(e),GQ=e=>WQ(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function KQ(e){if(WQ(e)){if(WQ(e.parallel))return{kind: ` parallel ` ,base:[ ` parallel ` ],branches:GQ(e.parallel)};if(WQ(e.switch))return{kind: ` switch ` ,base:[ ` switch ` , ` cases ` ],on:typeof e.switch.on== ` string ` ?e.switch.on: ` ` ,branches:GQ(e.switch.cases)}}}function qQ(e){return e.slice(2).includes( ` parallel ` )}function JQ(e,t){let n=VQ(e).getIn(t,!0);if(sY(n))return n.toJSON()}function YQ(e,t,n){let r=VQ(e);return r.setIn(t,r.createNode(s $ (n))),r.toString()}function XQ(e,t,n){let r=VQ(e),i=t.slice(0,-1),a=qQ(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(uY(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!uY(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 ZQ(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 QQ(e,t){let n=e.getIn(t,!0),r=KQ(sY(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!sY(i))throw Error( ` This step has no branches . ` );return{kind:r.kind,branches:i}}function $ Q(e,t,n){let r=VQ(e),{kind:i,branches:a}=QQ(r,t);if(ZQ(n,i),a.has(n))throw Error( ` Branch $ { n } already exists . ` );return a.set(n,r.createNode([])),r.toString()}function e $ (e,t,n,r){let i=VQ(e),{kind:a,branches:o}=QQ(i,t);if(ZQ(r,a),n!==r&&o.has(r))throw Error( ` Branch $ { r } already exists . ` );let s=o.items.find(e=>lY(e.key)&&e.key.value===n);if(!s||!lY(s.key))throw Error( ` Branch $ { n } does not exist . ` );return s.key.value=r,i.toString()}function t $ (e,t,n){let r=VQ(e),{kind:i,branches:a}=QQ(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 S $ (e,t){let n=JSON.stringify(e??{})+ ` ` +(typeof t== ` string ` ? ` { { $ { t . replace ( /^!/ , ` ` ) } } } ` : ` ` );return[...new Set([...n.matchAll(v $ )].map(e=>e[1]))]}function C $ (e){let t=VQ(e).toJS(),n=y $ (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=y $ (e)?e:{},p=KQ(d),m=p?.kind??(typeof d.type== ` string ` ?d.type: ` ` ),h=y $ (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,name:g||void 0,title:g||_ $ (m),type:m,step:l?.length===2?String(Number(l[1])+1).padStart(2, ` 0 ` ):void 0,detail:p?.on? ` on $ { p . on . replace ( /^steps\./ , ` ` ) } ` :b $ (m,h),summary:x $ (h),when:typeof d.when== ` string ` ?d.when:void 0,retry:y $ (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 S $ ([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=KQ(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*m $ ,void 0,void 0,[ ` steps ` ,e]);m(l,c,[ ` steps ` ,e-1]),u++;let d=y $ (t)&&typeof t.id== ` string ` ?t.id:i,f=i=== ` switch ` &&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=Math.max(1,...o.map(([,e])=>e.length)),v=e=>(e-(h-1)/2)*h $ ,y=(e,t,n)=>r.push({id:e,type: ` lane ` ,position:{x:t-12,y:u*m $ -40},style:{width: ` 264 px ` ,height: ` $ { ( _ + 1 ) * m$ - 24 } px ` },zIndex:-1,data:{kind: ` step ` ,key:n,title:n,type: ` ` ,detail: ` ` ,lane:i}}),b=(u+_)*m $ ;if(o.forEach(([t,n],o)=>{let s=v(o),l=[c],f=[ ` steps ` ,e,...a,t];n.forEach((n,r)=>{let a=p(n, ` $ { e + 1 } - $ { t } - $ { r + 1 } ` ,s,(u+r)*m $ ,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]});let h= ` add - $ { e } - $ { t } ` ;r.push({id:h,type: ` add ` ,position:{x:s+104,y:b},data:{kind: ` step ` ,key:h,title: ` ` ,type: ` ` ,detail: ` ` ,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,h),g.push(h),y( ` lane - $ { e } - $ { t } ` ,s,t)}),f){let t=v(h-1),n= ` pass - $ { e } ` ;r.push({id:n,type: ` add ` ,position:{x:t+104,y:b},data:{kind: ` step ` ,key:n,title: ` ` ,type: ` ` ,detail: ` ` ,lane:i}}),s.add(c),m([c],n),s.delete(c),g.push(n),y( ` pass - lane - $ { e } ` ,t, ` default ` )}l=g,u+=_+1;continue}let i=p(t,String(e+1),0,u*m $ ,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*m $ -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 w $ ={class: ` truncate ` },T $ = ` \ 0 ` ,E $ =N({inheritAttrs:!1,__name: ` OptionSelect ` ,props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},size:{},class:{}},emits:[ ` update : modelValue ` ],setup(e,{emit:t}){let n=t;return(t,r)=>(I(),K(B(Rn),{"model-value":e.modelValue=== ` ` &&e.options.some(e=>e.value=== ` ` )?T $ :e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n( ` update : modelValue ` ,e===T $ ? ` ` :String(e))},{default:F(()=>[O(B(Fn),W({size:e.size?? ` sm ` ,class:t. $ props.class},t. $ attrs),{default:F(()=>[O(B(zn),{placeholder:e.placeholder},null,8,[ ` placeholder ` ])]),_:1},16,[ ` size ` , ` class ` ]),O(B(In),{position: ` popper ` ,class: ` max - w - [ min ( var ( -- reka - select - content - available - width ) , 20 rem ) ] ` },{default:F(()=>[(I(!0),k(H,null,A(e.options,e=>(I(),K(B(Pn),{key:e.value,value:e.value=== ` ` ?T $ :e.value,disabled:e.disabled,title:e.label,class: ` * : [ span ] : last : min - w - 0 ` },{default:F(()=>[L( ` span ` ,w $ ,z(e.label),1)]),_:2},1032,[ ` value ` , ` disabled ` , ` title ` ]))),128))]),_:1})]),_:1},8,[ ` model - value ` , ` disabled ` ]))}}),D $ =[ ` id ` ],O $ =[ ` value ` ],k $ =N({__name: ` WorkflowPicker ` ,props:{value:{},workflows:{},label:{},class:{},editable:{type:Boolean}},emits:[ ` pick ` ],setup(e,{emit:t}){let n=he(),r=t;return(t,i)=>e.editable?(I(),k(H,{key:0},[O(B(Z),{"model-value":e.value,list:B(n),"aria-label":e.label,class:R(t. $ props.class),placeholder: ` Workflow id or { { reference } } ` ,"onUpdate:modelValue":i[0]||=e=>r( ` pick ` ,String(e))},null,8,[ ` model - value ` , ` list ` , ` aria - label ` , ` class ` ]),L( ` datalist ` ,{id:B(n)},[(I(!0),k(H,null,A(e.workflows,e=>(I(),k( ` option ` ,{key:e.id,value:e.id},null,8,O $ ))),128))],8,D $ )],64)):(I(),K(B(Rn),{key:1,"model-value":e.value||void 0,"onUpdate:modelValue":i[1]||=e=>r( ` pick ` ,String(e))},{default:F(()=>[O(B(Fn),{"aria-label":e.label,class:R(t. $ props.class)},{default:F(()=>[O(B(zn),{placeholder: ` Choose workflow ` })]),_:1},8,[ ` aria - label ` , ` class ` ]),O(B(In),null,{default:F(()=>[e.value&
Line truncated
` ).map((e,t)=>({number:t+1,text:e,tokens:U $ (e)}))}var V $ =/^( \s *)(- \s +)?/,H $ =/^([^:# \s ][^:#]*?)(:)( \s *)(.*) $ /;function U $ (e){let{code:t,comment:n}=W $ (e),r=G $ (t);return n&&r.push({text:n,kind: ` comment ` }),r}function W $ (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 G$ (e){if(!e)return[];let t=[],n=V $.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=H$ .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,...K$ (i[4]??``)]):[...t,...K$ (r)]}function K$ (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 q$ ( e ) { return e . split ( `
` )[0]?.trim()|| ` invalid YAML ` }function J $ (e){return typeof e== ` object ` &&!!e&&!Array.isArray(e)}function Y $ (e){return typeof e== ` string ` &&e.trim()!== ` ` }var X $ ={class: ` space - y - 4 px - 3 py - 3 ` },Z $ ={key:0,class: ` rounded - md bg - danger / 10 px - 2.5 py - 1.5 text - xs text - danger ` ,role: ` alert ` },Q $ ={key:1,class: ` space - y - 3 ` }, $ $ ={key:0,class: ` block space - y - 1.5 ` },e1=[ ` id ` ],t1=[ ` value ` ],n1={class: ` text - xs font - medium text - fg - muted ` },r1={class: ` flex items - center gap - 2 ` },i1={key:1,role: ` alert ` ,class: ` text - xs text - danger ` },a1={key:2,class: ` space - y - 1.5 ` },o1=[ ` title ` ],s1={key:4,class: ` flex flex - wrap items - center gap - 1 pt - 0.5 ` },c1={key:0,class: ` divide - y divide - border rounded - md border border - border ` },l1=[ ` title ` ],u1={key:0,class: ` space - y - 3 ` },d1={class: ` text - label ` },f1={key:0,class: ` text - danger ` },p1={class: ` ml - 2 text - xs text - fg - subtle ` },m1={key:1,class: ` space - y - 3 ` },h1={class: ` text - label ` },g1={class: ` ml - 2 text - xs text - fg - subtle ` },_1=[ ` title ` ],v1={key:0,class: ` text - xs text - danger ` },y1={class: ` space - y - 1.5 ` },b1={key:0,role: ` alert ` ,class: ` text - xs text - danger ` },x1={class: ` divide - y divide - border rounded - md border border - border ` },S1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },C1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },w1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },T1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },E1=[ ` for ` ],D1=N({__name: ` StepEditor ` ,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[ ` update : yaml ` ],setup(e,{emit:t}){let n=he(),r=e,i=t,a=J(()=>JQ(r.yaml,r.path)??{}),o=J(()=>KQ(a.value)),s=J(()=>o.value?.kind??(typeof a.value.type== ` string ` ?a.value.type: ` ` )),c=J(()=>o.value?.branches.map(([e])=>e)??[]),l=J(()=>s.value=== ` parallel ` ?2:1);function u(e){i( ` update : yaml ` ,YQ(r.yaml,r.path,{...a.value,switch:{...a.value.switch,on:e}}))}let d=q( ` ` ),f=q( ` ` );function p(e,t,n= ` ` ){try{let a=e=== ` add ` ? $ Q(r.yaml,r.path,t):e=== ` rename ` ?e $ (r.yaml,r.path,t,n):t $ (r.yaml,r.path,t);i( ` update : yaml ` ,a),d.value= ` ` ,f.value= ` ` }catch(e){f.value=String(e.message)}}let m=J(()=>r.vocabulary.find(e=>e.name===s.value)),h=J(()=>typeof a.value.settings== ` object ` &&a.value.settings!==null?a.value.settings:{}),g=J(()=>o $ (r.yaml,r.path)),_=J(()=>I $ (a.value)),v=J(()=>m.value?.settings&&a.value.settings?R $ (a.value.settings,m.value.settings, ` settings ` ): ` ` ),y=[ ` mission ` , ` workflow ` , ` message ` , ` body ` , ` plan ` , ` then ` , ` status ` , ` detail ` , ` run ` , ` rules ` ],b=/mission|body|detail|plan|rules/;function x(e,t){return[ ` workflow . call ` , ` workflow . handoff ` ].includes(s.value)&&e=== ` workflow ` ||s.value=== ` workflow . approve ` &&e=== ` then ` ? ` workflow ` :s.value=== ` agent . run ` &&e=== ` model ` ? ` select ` :t.type=== ` string ` ?t.enum? ` select ` :b.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 S=J(()=>{let e=Object.entries(m.value?.settings?.properties??{}).filter(([e])=>s.value!== ` workflow . call ` ||![ ` inputs ` , ` outputs ` ].includes(e)).map(([e,t])=>({key:e,schema:t,kind:x(e,t),options:s.value=== ` agent . run ` &&e=== ` model ` ?r.modelAliases:t.enum??[]})),t=e.filter(e=>y.includes(e.key)&&e.kind!== ` boolean ` ).sort((e,t)=>y.indexOf(e.key)-y.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))}}),ee=q(!S.value.lead&&!o.value),C=e=>[{value: ` ` ,label: ` Default ` },...e.map(e=>({value:e,label:e}))];function te(e){let{id:t,type:n,...a}=e;i( ` update : yaml ` ,YQ(r.yaml,r.path,{id:t,type:n,...a}))}function ne(e,t){te({...a.value,[e]:t})}function w(e){let t={...a.value.retry,...e};ne( ` retry ` ,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function T(e,t){let n={...h.value,[e]:t};s.value=== ` workflow . call ` &&e=== ` wait ` &&t!==!0&&delete n.outputs,te({...a.value,settings:n})}function re(e,t){let n={...h.value,[e]:t};s.value=== ` workflow . call ` &&t!==h.value[e]&&(delete n.inputs,delete n.outputs),te({...a.value,settings:n})}let E=J(()=>r.workflows.find(e=>e.id===h.value.workflow)),ie=J(()=>Object.entries(c $ (E.value?.yaml?? ` ` , ` inputs ` )??{})),ae=J(()=>Object.entries(c $ (E.value?.yaml?? ` ` , ` outputs ` )??{})),D=J(()=>Object.entries(c $ (r.yaml, ` inputs ` )??{})),oe=J(()=>Object.entries(c $ (r.yaml, ` outputs ` )??{})),se=J(()=>h.value.inputs??{}),ce=J(()=>h.value.outputs??{}),le=e=>typeof e== ` string ` &&e.startsWith( ` inputs . ` ),j=e=>[ ` object ` , ` array ` ].includes(e.type?? ` ` ),ue=e=>se.value[e]===void 0? ` ` :String(se.value[e]);function M(e,t,n){T( ` inputs ` ,{...se.value,[e]:t=== ` ` ?void 0:le(t)?t:FT(t,n?? ` string ` )})}let de=(e,t,n)=>e.filter(([,e])=>e.type===t.type||e.type=== ` any ` ||t.type=== ` any ` ).map(([e])=>({value: ` $ { n } . $ { e } ` ,label:e})),fe=q(null);function pe(e){let t=fe.value??S.value.lead?.key;if(!t)return;let n=typeof h.value[t]== ` string ` ?h.value[t]: ` ` ,r= ` { { steps . $ { e } . summary } } ` ;T(t,n? ` $ { n . trimEnd ( ) } $ { r } ` :r)}let me=q({});function N(e,t){try{T(e,t.trim()?HQ(t):void 0),me.value={...me.value,[e]: ` ` }}catch(t){me.value={...me.value,[e]:String(t.m
Line truncated
` )[0]}}}let ge=e=>e===void 0? ` ` :UQ(e).trimEnd(),_e=(e,t)=>t.title??e.replaceAll( ` _ ` , ` ` ).replace(/^./,e=>e.toUpperCase()),ve=e=>typeof h.value[e]== ` string ` ?h.value[e]: ` ` ,ye=[{value: ` ` ,label: ` Park the task ` },{value: ` continue ` ,label: ` Continue ` }];return(t,r)=>(I(),k( ` div ` ,X $ ,[v.value?(I(),k( ` p ` ,Z $ ,z(v.value),1)):P( ` ` ,!0),o.value?(I(),k( ` section ` ,Q $ ,[s.value=== ` switch ` ?(I(),k( ` label ` , $ $ ,[r[15]||=L( ` span ` ,{class: ` text - xs font - medium text - fg - muted ` ,title: ` The value whose case runs ; a case named default runs when none matches ` }, ` Switch on ` ,-1),O(B(Z),{"model-value":o.value.on,class: ` font - mono ` ,placeholder: ` steps . assess . result . fit ` ,list: ` $ { B ( n ) } - switch - on ` ,onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[ ` model - value ` , ` list ` ]),L( ` datalist ` ,{id: ` $ { B ( n ) } - switch - on ` },[(I(!0),k(H,null,A(g.value,e=>(I(),k( ` option ` ,{key:e,value: ` steps . $ { e } . result . ` },null,8,t1))),128))],8,e1)])):P( ` ` ,!0),L( ` div ` ,n1,z(s.value=== ` switch ` ? ` Cases ` : ` Branches ` ),1),(I(!0),k(H,null,A(c.value,e=>(I(),k( ` div ` ,{key:e,class: ` flex items - center gap - 2 ` },[O(B(Z),{"model-value":e,class:R(s.value=== ` switch ` && ` font - mono ` ),"aria-label": ` $ { s . value === ` switch ` ? ` Case ` : ` Branch ` } $ { e } ` ,onChange:t=>p( ` rename ` ,e,t.target.value.trim())},null,8,[ ` model - value ` , ` class ` , ` aria - label ` , ` onChange ` ]),O(B(Y),{type: ` button ` ,variant: ` ghost ` ,size: ` icon - sm ` ,"aria-label": ` Remove $ { e } ` ,disabled:c.value.length<=l.value,onClick:t=>p( ` delete ` ,e)},{default:F(()=>[O(B(Tl))]),_:1},8,[ ` aria - label ` , ` disabled ` , ` onClick ` ])]))),128)),L( ` div ` ,r1,[O(B(Z),{modelValue:d.value,"onUpdate:modelValue":r[1]||=e=>d.value=e,"aria-label":s.value=== ` switch ` ? ` New case value ` : ` New branch name ` ,placeholder:s.value=== ` switch ` ? ` Value , or default ` : ` Branch name ` ,onKeydown:r[2]||=it(at(e=>p( ` add ` ,d.value.trim()),[ ` prevent ` ]),[ ` enter ` ])},null,8,[ ` modelValue ` , ` aria - label ` , ` placeholder ` ]),O(B(Y),{type: ` button ` ,size: ` icon - sm ` ,variant: ` outline ` ,"aria-label":s.value=== ` switch ` ? ` Add case ` : ` Add branch ` ,disabled:!d.value.trim(),onClick:r[3]||=e=>p( ` add ` ,d.value.trim())},{default:F(()=>[O(B(ul))]),_:1},8,[ ` aria - label ` , ` disabled ` ])]),f.value?(I(),k( ` p ` ,i1,z(f.value),1)):P( ` ` ,!0)])):P( ` ` ,!0),S.value.lead?(I(),k( ` section ` ,a1,[L( ` div ` ,{class: ` flex items - center gap - 1 text - xs font - medium text - fg - muted ` ,title:S.value.lead.schema.description},[V(z(_e(S.value.lead.key,S.value.lead.schema))+ ` ` ,1),S.value.lead.schema.description?(I(),K(B(Dc),{key:0,class: ` size - 3 text - fg - subtle ` })):P( ` ` ,!0)],8,o1),S.value.lead.kind=== ` workflow ` ?(I(),K(k $ ,{key:0,editable:s.value!== ` workflow . call ` ,value:ve(S.value.lead.key),workflows:e.workflows,label:_e(S.value.lead.key,S.value.lead.schema),onPick:r[4]||=e=>re(S.value.lead.key,e)},null,8,[ ` editable ` , ` value ` , ` workflows ` , ` label ` ])):S.value.lead.kind=== ` select ` ?(I(),K(E $ ,{key:1,class: ` w - full ` ,"model-value":ve(S.value.lead.key),options:C(S.value.lead.options),"aria-label":_e(S.value.lead.key,S.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>T(S.value.lead.key,e||void 0)},null,8,[ ` model - value ` , ` options ` , ` aria - label ` ])):S.value.lead.kind=== ` text ` ?(I(),K(B(Qn),{key:2,"model-value":ve(S.value.lead.key),class: ` min - h - 32 text - label leading - relaxed ` ,onFocus:r[6]||=e=>fe.value=S.value.lead.key,"onUpdate:modelValue":r[7]||=e=>T(S.value.lead.key,String(e))},null,8,[ ` model - value ` ])):(I(),K(B(Z),{key:3,"model-value":ve(S.value.lead.key),onFocus:r[8]||=e=>fe.value=S.value.lead.key,"onUpdate:modelValue":r[9]||=e=>T(S.value.lead.key,String(e))},null,8,[ ` model - value ` ])),g.value.length&&S.value.lead.kind!== ` select ` ?(I(),k( ` div ` ,s1,[r[16]||=L( ` span ` ,{class: ` text - caption text - fg - subtle ` }, ` Insert ` ,-1),(I(!0),k(H,null,A(g.value,e=>(I(),K(B(Y),{key:e,type: ` button ` ,variant: ` outline ` ,size: ` xs ` ,class: ` font - mono ` ,title: ` { { steps . $ { e } . summary } } ` ,onClick:t=>pe(e)},{default:F(()=>[V(z(e),1)]),_:2},1032,[ ` title ` , ` onClick ` ]))),128))])):P( ` ` ,!0)])):P( ` ` ,!0),O(B(Y),{type: ` button ` ,variant: ` ghost ` ,size: ` xs ` ,class: ` - ml - 2 text - fg - muted aria - expanded : bg - transparent ` ,"aria-expanded":ee.value,onClick:r[10]||=e=>ee.value=!ee.value},{default:F(()=>[O(B(Xn),{"data-icon": ` inline - start ` ,class:R([ ` transition - transform ` ,!ee.value&& ` - rotate - 90 ` ])},null,8,[ ` class ` ]),r[17]||=V( ` More ` ,-1)]),_:1},8,[ ` aria - expanded ` ]),ee.value?(I(),k(H,{key:3},[S.value.compact.length?(I(),k( ` section ` ,c1,[(I(!0),k(H,null,A(S.value.compact,t=>(I(),k( ` div ` ,{key:t.key,class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },[L( ` span ` ,{class: ` flex flex - 1 items - center gap - 1 text - label ` ,title:t.schema.description},[V(z(_e(t.key,t.schema))+ ` ` ,1),t.schema.description?(I(),K(B(Dc),{key:0,class: ` size - 3 text - fg - subtle ` })):P( ` ` ,!0)],8,l1),t.kind=== ` workflow ` ?(I(),K(k $ ,{key:0,editable:s.value!== ` workflow . call ` ,class: ` max - w - 48 ` ,value:ve(t.key),workflows:e.workflows,label:_e(t.key,t.schema),onPick:e=>re(t.key,e)},null,8,[ ` editable ` , ` value ` , ` workflows ` , ` label ` , ` onPick ` ])):t.kind=== ` boolean ` ?(I(),K(B(QC),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>T(t.key,e||void 0)},null,8,[ ` model - value ` , ` onUpdate : modelValue ` ])):t.kind=== ` select ` ?(I(),K(E $ ,{key:2,class: ` w - 40 ` ,"mo
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=JQ(qQ(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=JQ(qQ(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 QQ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new UQ||null,prettyErrors:t}}function $ Q(e,t={}){let{lineCounter:n,prettyErrors:r}=QQ(t),i=new ZQ(n?.addNewLine),a=new kQ(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 GZ(t.range.slice(0,2), ` MULTIPLE _DOCS ` , ` Source contains multiple documents ; please use YAML . parseAllDocuments ( ) ` ));break}return r&&n&&(o.errors.forEach(qZ(e,n)),o.warnings.forEach(qZ(e,n))),o}function e $ (e,t,n){let r;typeof t== ` function ` ?r=t:n===void 0&&t&&typeof t== ` object ` &&(n=t);let i= $ Q(e,n);if(!i)return null;if(i.warnings.forEach(e=>CX(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 t $ (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 vY(e)&&!r?e.toString(n):new HZ(e,r,n).toString(n)}var n $ =e=>typeof e== ` object ` &&!!e&&!Array.isArray(e),r $ =e=>n $ (e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function i $ (e){if(n $ (e)){if(n $ (e.parallel))return{kind: ` parallel ` ,base:[ ` parallel ` ],branches:r $ (e.parallel)};if(n $ (e.switch))return{kind: ` switch ` ,base:[ ` switch ` , ` cases ` ],on:typeof e.switch.on== ` string ` ?e.switch.on: ` ` ,branches:r $ (e.switch.cases)}}}function a $ (e){return e.slice(2).includes( ` parallel ` )}function o $ (e,t){let n= $ Q(e).getIn(t,!0);if(yY(n))return n.toJSON()}function s $ (e,t,n){let r= $ Q(e);return r.setIn(t,r.createNode(y $ (n))),r.toString()}function c $ (e,t,n){let r= $ Q(e),i=t.slice(0,-1),a=a $ (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(SY(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!SY(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 l $ (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 u $ (e,t){let n=e.getIn(t,!0),r=i $ (yY(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!yY(i))throw Error( ` This step has no branches . ` );return{kind:r.kind,branches:i}}function d $ (e,t,n){let r= $ Q(e),{kind:i,branches:a}=u $ (r,t);if(l $ (n,i),a.has(n))throw Error( ` Branch $ { n } already exists . ` );return a.set(n,r.createNode([])),r.toString()}function f $ (e,t,n,r){let i= $ Q(e),{kind:a,branches:o}=u $ (i,t);if(l $ (r,a),n!==r&&o.has(r))throw Error( ` Branch $ { r } already exists . ` );let s=o.items.find(e=>xY(e.key)&&e.key.value===n);if(!s||!xY(s.key))throw Error( ` Branch $ { n } does not exist . ` );return s.key.value=r,i.toString()}function p $ (e,t,n){let r= $ Q(e),{kind:i,branches:a}=u $ (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 P $ (e,t){let n=JSON.stringify(e??{})+ ` ` +(typeof t== ` string ` ? ` { { $ { t . replace ( /^!/ , ` ` ) } } } ` : ` ` );return[...new Set([...n.matchAll(A $ )].map(e=>e[1]))]}function F $ (e){let t= $ Q(e).toJS(),n=j $ (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=j $ (e)?e:{},p=i $ (d),m=p?.kind??(typeof d.type== ` string ` ?d.type: ` ` ),h=j $ (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,name:g||void 0,title:g||k $ (m),type:m,step:l?.length===2?String(Number(l[1])+1).padStart(2, ` 0 ` ):void 0,detail:p?.on? ` on $ { p . on . replace ( /^steps\./ , ` ` ) } ` :M $ (m,h),summary:N $ (h),when:typeof d.when== ` string ` ?d.when:void 0,retry:j $ (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 P $ ([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=i $ (t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*E $ ,void 0,void 0,[ ` steps ` ,e]);m(l,c,[ ` steps ` ,e-1]),u++;let d=j $ (t)&&typeof t.id== ` string ` ?t.id:i,f=i=== ` switch ` &&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=Math.max(1,...o.map(([,e])=>e.length)),v=e=>(e-(h-1)/2)*D $ ,y=(e,t,n)=>r.push({id:e,type: ` lane ` ,position:{x:t-12,y:u*E $ -40},style:{width: ` 264 px ` ,height: ` $ { ( _ + 1 ) * E$ - 24 } px ` },zIndex:-1,data:{kind: ` step ` ,key:n,title:n,type: ` ` ,detail: ` ` ,lane:i}}),b=(u+_)*E $ ;if(o.forEach(([t,n],o)=>{let s=v(o),l=[c],f=[ ` steps ` ,e,...a,t];n.forEach((n,r)=>{let a=p(n, ` $ { e + 1 } - $ { t } - $ { r + 1 } ` ,s,(u+r)*E $ ,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]});let h= ` add - $ { e } - $ { t } ` ;r.push({id:h,type: ` add ` ,position:{x:s+104,y:b},data:{kind: ` step ` ,key:h,title: ` ` ,type: ` ` ,detail: ` ` ,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,h),g.push(h),y( ` lane - $ { e } - $ { t } ` ,s,t)}),f){let t=v(h-1),n= ` pass - $ { e } ` ;r.push({id:n,type: ` add ` ,position:{x:t+104,y:b},data:{kind: ` step ` ,key:n,title: ` ` ,type: ` ` ,detail: ` ` ,lane:i}}),s.add(c),m([c],n),s.delete(c),g.push(n),y( ` pass - lane - $ { e } ` ,t, ` default ` )}l=g,u+=_+1;continue}let i=p(t,String(e+1),0,u*E $ ,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*E $ -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 I $ ={class: ` truncate ` },L $ = ` \ 0 ` ,R $ =N({inheritAttrs:!1,__name: ` OptionSelect ` ,props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},size:{},class:{}},emits:[ ` update : modelValue ` ],setup(e,{emit:t}){let n=t;return(t,r)=>(I(),K(B(Rn),{"model-value":e.modelValue=== ` ` &&e.options.some(e=>e.value=== ` ` )?L $ :e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n( ` update : modelValue ` ,e===L $ ? ` ` :String(e))},{default:F(()=>[O(B(Fn),W({size:e.size?? ` sm ` ,class:t. $ props.class},t. $ attrs),{default:F(()=>[O(B(zn),{placeholder:e.placeholder},null,8,[ ` placeholder ` ])]),_:1},16,[ ` size ` , ` class ` ]),O(B(In),{position: ` popper ` ,class: ` max - w - [ min ( var ( -- reka - select - content - available - width ) , 20 rem ) ] ` },{default:F(()=>[(I(!0),k(H,null,A(e.options,e=>(I(),K(B(Pn),{key:e.value,value:e.value=== ` ` ?L $ :e.value,disabled:e.disabled,title:e.label,class: ` * : [ span ] : last : min - w - 0 ` },{default:F(()=>[L( ` span ` ,I $ ,z(e.label),1)]),_:2},1032,[ ` value ` , ` disabled ` , ` title ` ]))),128))]),_:1})]),_:1},8,[ ` model - value ` , ` disabled ` ]))}}),z $ =[ ` id ` ],B $ =[ ` value ` ],V $ =N({__name: ` WorkflowPicker ` ,props:{value:{},workflows:{},label:{},class:{},editable:{type:Boolean}},emits:[ ` pick ` ],setup(e,{emit:t}){let n=me(),r=t;return(t,i)=>e.editable?(I(),k(H,{key:0},[O(B(Z),{"model-value":e.value,list:B(n),"aria-label":e.label,class:R(t. $ props.class),placeholder: ` Workflow id or { { reference } } ` ,"onUpdate:modelValue":i[0]||=e=>r( ` pick ` ,String(e))},null,8,[ ` model - value ` , ` list ` , ` aria - label ` , ` class ` ]),L( ` datalist ` ,{id:B(n)},[(I(!0),k(H,null,A(e.workflows,e=>(I(),k( ` option ` ,{key:e.id,value:e.id},null,8,B $ ))),128))],8,z $ )],64)):(I(),K(B(Rn),{key:1,"model-value":e.value||void 0,"onUpdate:modelValue":i[1]||=e=>r( ` pick ` ,String(e))},{default:F(()=>[O(B(Fn),{"aria-label":e.label,class:R(t. $ props.class)},{default:F(()=>[O(B(zn),{placeholder: ` Choose workflow ` })]),_:1},8,[ ` aria - label ` , ` class ` ]),O(B(In),null,{default:F(()=>[e.value&
Line truncated
` ).map((e,t)=>({number:t+1,text:e,tokens:t1 (e)}))}var $ $ =/^( \s *)(- \s +)?/,e1 =/^([^:# \s ][^:#]*?)(:)( \s *)(.*) $ /;function t1 (e){let{code:t,comment:n}=n1(e),r=r1 (t);return n&&r.push({text:n,kind: ` comment ` }),r}function n1 (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 r1 (e){if(!e)return[];let t=[],n=$ $.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=e1 .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,...i1 (i[4]??``)]):[...t,...i1 (r)]}function i1 (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 a1 ( e ) { return e . split ( `
` )[0]?.trim()|| ` invalid YAML ` }function o1(e){return typeof e== ` object ` &&!!e&&!Array.isArray(e)}function s1(e){return typeof e== ` string ` &&e.trim()!== ` ` }var c1={class: ` space - y - 4 px - 3 py - 3 ` },l1={key:0,class: ` rounded - md bg - danger / 10 px - 2.5 py - 1.5 text - xs text - danger ` ,role: ` alert ` },u1={key:1,class: ` space - y - 3 ` },d1={key:0,class: ` block space - y - 1.5 ` },f1=[ ` id ` ],p1=[ ` value ` ],m1={class: ` text - xs font - medium text - fg - muted ` },h1={class: ` flex items - center gap - 2 ` },g1={key:1,role: ` alert ` ,class: ` text - xs text - danger ` },_1={key:2,class: ` space - y - 1.5 ` },v1=[ ` title ` ],y1={key:4,class: ` flex flex - wrap items - center gap - 1 pt - 0.5 ` },b1={key:0,class: ` divide - y divide - border rounded - md border border - border ` },x1=[ ` title ` ],S1={key:0,class: ` space - y - 3 ` },C1={class: ` text - label ` },w1={key:0,class: ` text - danger ` },T1={class: ` ml - 2 text - xs text - fg - subtle ` },E1={key:1,class: ` space - y - 3 ` },D1={class: ` text - label ` },O1={class: ` ml - 2 text - xs text - fg - subtle ` },k1=[ ` title ` ],A1={key:0,class: ` text - xs text - danger ` },j1={class: ` space - y - 1.5 ` },M1={key:0,role: ` alert ` ,class: ` text - xs text - danger ` },N1={class: ` divide - y divide - border rounded - md border border - border ` },P1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },F1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },I1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },L1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },R1=[ ` for ` ],z1=N({__name: ` StepEditor ` ,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[ ` update : yaml ` ],setup(e,{emit:t}){let n=me(),r=e,i=t,a=J(()=>o $ (r.yaml,r.path)??{}),o=J(()=>i $ (a.value)),s=J(()=>o.value?.kind??(typeof a.value.type== ` string ` ?a.value.type: ` ` )),c=J(()=>o.value?.branches.map(([e])=>e)??[]),l=J(()=>s.value=== ` parallel ` ?2:1);function u(e){i( ` update : yaml ` ,s $ (r.yaml,r.path,{...a.value,switch:{...a.value.switch,on:e}}))}let d=q( ` ` ),f=q( ` ` );function p(e,t,n= ` ` ){try{let a=e=== ` add ` ?d $ (r.yaml,r.path,t):e=== ` rename ` ?f $ (r.yaml,r.path,t,n):p $ (r.yaml,r.path,t);i( ` update : yaml ` ,a),d.value= ` ` ,f.value= ` ` }catch(e){f.value=String(e.message)}}let m=J(()=>r.vocabulary.find(e=>e.name===s.value)),h=J(()=>typeof a.value.settings== ` object ` &&a.value.settings!==null?a.value.settings:{}),g=J(()=>v $ (r.yaml,r.path)),_=J(()=>J $ (a.value)),v=J(()=>m.value?.settings&&a.value.settings?X $ (a.value.settings,m.value.settings, ` settings ` ): ` ` ),y=[ ` mission ` , ` workflow ` , ` message ` , ` body ` , ` plan ` , ` then ` , ` status ` , ` detail ` , ` run ` , ` rules ` ],b=/mission|body|detail|plan|rules/;function x(e,t){return[ ` workflow . call ` , ` workflow . handoff ` ].includes(s.value)&&e=== ` workflow ` ||s.value=== ` workflow . approve ` &&e=== ` then ` ? ` workflow ` :s.value=== ` agent . run ` &&e=== ` model ` ? ` select ` :t.type=== ` string ` ?t.enum? ` select ` :b.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 S=J(()=>{let e=Object.entries(m.value?.settings?.properties??{}).filter(([e])=>s.value!== ` workflow . call ` ||![ ` inputs ` , ` outputs ` ].includes(e)).map(([e,t])=>({key:e,schema:t,kind:x(e,t),options:s.value=== ` agent . run ` &&e=== ` model ` ?r.modelAliases:t.enum??[]})),t=e.filter(e=>y.includes(e.key)&&e.kind!== ` boolean ` ).sort((e,t)=>y.indexOf(e.key)-y.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))}}),ee=q(!S.value.lead&&!o.value),C=e=>[{value: ` ` ,label: ` Default ` },...e.map(e=>({value:e,label:e}))];function te(e){let{id:t,type:n,...a}=e;i( ` update : yaml ` ,s $ (r.yaml,r.path,{id:t,type:n,...a}))}function ne(e,t){te({...a.value,[e]:t})}function w(e){let t={...a.value.retry,...e};ne( ` retry ` ,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function T(e,t){let n={...h.value,[e]:t};s.value=== ` workflow . call ` &&e=== ` wait ` &&t!==!0&&delete n.outputs,te({...a.value,settings:n})}function E(e,t){let n={...h.value,[e]:t};s.value=== ` workflow . call ` &&t!==h.value[e]&&(delete n.inputs,delete n.outputs),te({...a.value,settings:n})}let re=J(()=>r.workflows.find(e=>e.id===h.value.workflow)),ie=J(()=>Object.entries(b $ (re.value?.yaml?? ` ` , ` inputs ` )??{})),ae=J(()=>Object.entries(b $ (re.value?.yaml?? ` ` , ` outputs ` )??{})),D=J(()=>Object.entries(b $ (r.yaml, ` inputs ` )??{})),oe=J(()=>Object.entries(b $ (r.yaml, ` outputs ` )??{})),se=J(()=>h.value.inputs??{}),ce=J(()=>h.value.outputs??{}),le=e=>typeof e== ` string ` &&e.startsWith( ` inputs . ` ),j=e=>[ ` object ` , ` array ` ].includes(e.type?? ` ` ),M=e=>se.value[e]===void 0? ` ` :String(se.value[e]);function ue(e,t,n){T( ` inputs ` ,{...se.value,[e]:t=== ` ` ?void 0:le(t)?t:kT(t,n?? ` string ` )})}let de=(e,t,n)=>e.filter(([,e])=>e.type===t.type||e.type=== ` any ` ||t.type=== ` any ` ).map(([e])=>({value: ` $ { n } . $ { e } ` ,label:e})),fe=q(null);function pe(e){let t=fe.value??S.value.lead?.key;if(!t)return;let n=typeof h.value[t]== ` string ` ?h.value[t]: ` ` ,r= ` { { steps . $ { e } . summary } } ` ;T(t,n? ` $ { n . trimEnd ( ) } $ { r } ` :r)}let N=q({});function he(e,t){try{T(e,t.trim()?e $ (t):void 0),N.value={...N.value,[e]: ` ` }}catch(t){N.value={...N.value,[e]:String(t.mes
Line truncated
` )[0]}}}let ge=e=>e===void 0? ` ` :t $ (e).trimEnd(),_e=(e,t)=>t.title??e.replaceAll( ` _ ` , ` ` ).replace(/^./,e=>e.toUpperCase()),ve=e=>typeof h.value[e]== ` string ` ?h.value[e]: ` ` ,ye=[{value: ` ` ,label: ` Park the task ` },{value: ` continue ` ,label: ` Continue ` }];return(t,r)=>(I(),k( ` div ` ,c1,[v.value?(I(),k( ` p ` ,l1,z(v.value),1)):P( ` ` ,!0),o.value?(I(),k( ` section ` ,u1,[s.value=== ` switch ` ?(I(),k( ` label ` ,d1,[r[15]||=L( ` span ` ,{class: ` text - xs font - medium text - fg - muted ` ,title: ` The value whose case runs ; a case named default runs when none matches ` }, ` Switch on ` ,-1),O(B(Z),{"model-value":o.value.on,class: ` font - mono ` ,placeholder: ` steps . assess . result . fit ` ,list: ` $ { B ( n ) } - switch - on ` ,onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[ ` model - value ` , ` list ` ]),L( ` datalist ` ,{id: ` $ { B ( n ) } - switch - on ` },[(I(!0),k(H,null,A(g.value,e=>(I(),k( ` option ` ,{key:e,value: ` steps . $ { e } . result . ` },null,8,p1))),128))],8,f1)])):P( ` ` ,!0),L( ` div ` ,m1,z(s.value=== ` switch ` ? ` Cases ` : ` Branches ` ),1),(I(!0),k(H,null,A(c.value,e=>(I(),k( ` div ` ,{key:e,class: ` flex items - center gap - 2 ` },[O(B(Z),{"model-value":e,class:R(s.value=== ` switch ` && ` font - mono ` ),"aria-label": ` $ { s . value === ` switch ` ? ` Case ` : ` Branch ` } $ { e } ` ,onChange:t=>p( ` rename ` ,e,t.target.value.trim())},null,8,[ ` model - value ` , ` class ` , ` aria - label ` , ` onChange ` ]),O(B(Y),{type: ` button ` ,variant: ` ghost ` ,size: ` icon - sm ` ,"aria-label": ` Remove $ { e } ` ,disabled:c.value.length<=l.value,onClick:t=>p( ` delete ` ,e)},{default:F(()=>[O(B(Tl))]),_:1},8,[ ` aria - label ` , ` disabled ` , ` onClick ` ])]))),128)),L( ` div ` ,h1,[O(B(Z),{modelValue:d.value,"onUpdate:modelValue":r[1]||=e=>d.value=e,"aria-label":s.value=== ` switch ` ? ` New case value ` : ` New branch name ` ,placeholder:s.value=== ` switch ` ? ` Value , or default ` : ` Branch name ` ,onKeydown:r[2]||=rt(it(e=>p( ` add ` ,d.value.trim()),[ ` prevent ` ]),[ ` enter ` ])},null,8,[ ` modelValue ` , ` aria - label ` , ` placeholder ` ]),O(B(Y),{type: ` button ` ,size: ` icon - sm ` ,variant: ` outline ` ,"aria-label":s.value=== ` switch ` ? ` Add case ` : ` Add branch ` ,disabled:!d.value.trim(),onClick:r[3]||=e=>p( ` add ` ,d.value.trim())},{default:F(()=>[O(B(ul))]),_:1},8,[ ` aria - label ` , ` disabled ` ])]),f.value?(I(),k( ` p ` ,g1,z(f.value),1)):P( ` ` ,!0)])):P( ` ` ,!0),S.value.lead?(I(),k( ` section ` ,_1,[L( ` div ` ,{class: ` flex items - center gap - 1 text - xs font - medium text - fg - muted ` ,title:S.value.lead.schema.description},[V(z(_e(S.value.lead.key,S.value.lead.schema))+ ` ` ,1),S.value.lead.schema.description?(I(),K(B(Dc),{key:0,class: ` size - 3 text - fg - subtle ` })):P( ` ` ,!0)],8,v1),S.value.lead.kind=== ` workflow ` ?(I(),K(V $ ,{key:0,editable:s.value!== ` workflow . call ` ,value:ve(S.value.lead.key),workflows:e.workflows,label:_e(S.value.lead.key,S.value.lead.schema),onPick:r[4]||=e=>E(S.value.lead.key,e)},null,8,[ ` editable ` , ` value ` , ` workflows ` , ` label ` ])):S.value.lead.kind=== ` select ` ?(I(),K(R $ ,{key:1,class: ` w - full ` ,"model-value":ve(S.value.lead.key),options:C(S.value.lead.options),"aria-label":_e(S.value.lead.key,S.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>T(S.value.lead.key,e||void 0)},null,8,[ ` model - value ` , ` options ` , ` aria - label ` ])):S.value.lead.kind=== ` text ` ?(I(),K(B( $ n),{key:2,"model-value":ve(S.value.lead.key),class: ` min - h - 32 text - label leading - relaxed ` ,onFocus:r[6]||=e=>fe.value=S.value.lead.key,"onUpdate:modelValue":r[7]||=e=>T(S.value.lead.key,String(e))},null,8,[ ` model - value ` ])):(I(),K(B(Z),{key:3,"model-value":ve(S.value.lead.key),onFocus:r[8]||=e=>fe.value=S.value.lead.key,"onUpdate:modelValue":r[9]||=e=>T(S.value.lead.key,String(e))},null,8,[ ` model - value ` ])),g.value.length&&S.value.lead.kind!== ` select ` ?(I(),k( ` div ` ,y1,[r[16]||=L( ` span ` ,{class: ` text - caption text - fg - subtle ` }, ` Insert ` ,-1),(I(!0),k(H,null,A(g.value,e=>(I(),K(B(Y),{key:e,type: ` button ` ,variant: ` outline ` ,size: ` xs ` ,class: ` font - mono ` ,title: ` { { steps . $ { e } . summary } } ` ,onClick:t=>pe(e)},{default:F(()=>[V(z(e),1)]),_:2},1032,[ ` title ` , ` onClick ` ]))),128))])):P( ` ` ,!0)])):P( ` ` ,!0),O(B(Y),{type: ` button ` ,variant: ` ghost ` ,size: ` xs ` ,class: ` - ml - 2 text - fg - muted aria - expanded : bg - transparent ` ,"aria-expanded":ee.value,onClick:r[10]||=e=>ee.value=!ee.value},{default:F(()=>[O(B(Zn),{"data-icon": ` inline - start ` ,class:R([ ` transition - transform ` ,!ee.value&& ` - rotate - 90 ` ])},null,8,[ ` class ` ]),r[17]||=V( ` More ` ,-1)]),_:1},8,[ ` aria - expanded ` ]),ee.value?(I(),k(H,{key:3},[S.value.compact.length?(I(),k( ` section ` ,b1,[(I(!0),k(H,null,A(S.value.compact,t=>(I(),k( ` div ` ,{key:t.key,class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },[L( ` span ` ,{class: ` flex flex - 1 items - center gap - 1 text - label ` ,title:t.schema.description},[V(z(_e(t.key,t.schema))+ ` ` ,1),t.schema.description?(I(),K(B(Dc),{key:0,class: ` size - 3 text - fg - subtle ` })):P( ` ` ,!0)],8,x1),t.kind=== ` workflow ` ?(I(),K(V $ ,{key:0,editable:s.value!== ` workflow . call ` ,class: ` max - w - 48 ` ,value:ve(t.key),workflows:e.workflows,label:_e(t.key,t.schema),onPick:e=>E(t.key,e)},null,8,[ ` editable ` , ` value ` , ` workflows ` , ` label ` , ` onPick ` ])):t.kind=== ` boolean ` ?(I(),K(B(sw),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>T(t.key,e||void 0)},null,8,[ ` model - value ` , ` onUpdate : modelValue ` ])):t.kind=== ` select ` ?(I(),K(R $ ,{key:2,class: ` w - 40 ` ,"mode
Line truncated
` ): ` ` ,class: ` min - h - 16 font - mono text - xs ` ,placeholder: ` One per line ` ,"onUpdate:modelValue":t=>T(e.key,String(t).split( `
` ).filter(Boolean))},null,8,[ ` model - value ` , ` onUpdate : modelValue ` ])):(I(),k(H,{key:2},[O(B(Qn),{"model-value":ge(h.value[e.key]),class: ` min - h - 24 font - mono text - xs ` ,placeholder: ` YAML ` ,onChange:t=>N(e.key,t.target.value)},null,8,[ ` model - value ` , ` onChange ` ]),me.value[e.key]?(I(),k( ` span ` ,v1,z(me.value[e.key]),1)):P( ` ` ,!0)],64))]))),128)),L( ` section ` ,y1,[_.value?(I(),k( ` p ` ,b1,z(_.value),1)):P( ` ` ,!0),L( ` div ` ,x1,[L( ` label ` ,S1,[r[20]||=L( ` span ` ,{class: ` flex - 1 text - label ` ,title: ` Empty always runs . A field such as inputs . enabled , ! inputs . skip , or steps . plan . result . ready == true ` }, ` Run only when ` ,-1),O(B(Z),{class: ` h - 8 w - 48 font - mono text - xs ` ,placeholder: ` inputs . enabled ` ,"aria-invalid":_.value&&_.value.startsWith( ` when ` )?!0:void 0,"model-value":a.value.when?? ` ` ,"onUpdate:modelValue":r[11]||=e=>ne( ` when ` ,String(e))},null,8,[ ` aria - invalid ` , ` model - value ` ])]),L( ` label ` ,C1,[r[21]||=L( ` span ` ,{class: ` flex - 1 text - label ` }, ` If it fails ` ,-1),O(E $ ,{class: ` w - 36 ` ,"aria-label": ` If it fails ` ,"model-value":a.value.on_failure?? ` ` ,options:ye,"onUpdate:modelValue":r[12]||=e=>ne( ` on _failure ` ,e||void 0)},null,8,[ ` model - value ` ])]),L( ` label ` ,w1,[r[22]||=L( ` span ` ,{class: ` flex - 1 text - label ` }, ` Attempts ` ,-1),O(B(Z),{type: ` number ` ,min: ` 1 ` ,max: ` 10 ` ,placeholder: ` 1 ` ,class: ` h - 8 w - 20 text - right text - label ` ,"model-value":a.value.retry?.attempts?? ` ` ,"onUpdate:modelValue":r[13]||=e=>w({attempts:String(e)=== ` ` ?void 0:Number(String(e))})},null,8,[ ` model - value ` ])]),L( ` div ` ,T1,[L( ` label ` ,{for: ` $ { B ( n ) } - backoff ` ,class: ` flex - 1 text - label ` }, ` Retry backoff ` ,8,E1),O(B(Rt),{id: ` $ { B ( n ) } - backoff ` ,"model-value":a.value.retry?.backoff?? ` ` ,units:[ ` s ` , ` m ` , ` h ` ],"onUpdate:modelValue":r[14]||=e=>w({backoff:e||void 0})},null,8,[ ` id ` , ` model - value ` ])])])])],64)):P( ` ` ,!0)]))}}),O1={class: ` space - y - 1.5 ` },k1={class: ` flex items - center text - xs font - medium text - fg - muted ` },A1={key:0,class: ` divide - y divide - border rounded - md border border - border ` },j1=N({__name: ` SpecList ` ,props:{yaml:{},field:{}},emits:[ ` update : yaml ` ],setup(e,{emit:t}){let n=e,r=t,i=[ ` string ` , ` number ` , ` bool ` , ` object ` , ` array ` , ` any ` ].map(e=>({value:e,label:e})),a=J(()=>Object.entries(c $ (n.yaml,n.field)??{}));function o(e){r( ` update : yaml ` ,l $ (n.yaml,n.field,Object.fromEntries(e.filter(([e])=>e))))}function s(e,t,n){o(a.value.map((r,i)=>i===e?[t,n]:r))}function c(){let e=n.field.slice(0,-1),t=a.value.length+1;for(;a.value.some(([n])=>n=== ` $ { e } _$ { t } ` );)t++;o([...a.value,[ ` $ { e } _$ { t } ` ,{type: ` string ` }]])}return(t,n)=>(I(),k( ` section ` ,O1,[L( ` div ` ,k1,[V(z(e.field=== ` inputs ` ? ` Inputs ` : ` Outputs ` )+ ` ` ,1),O(B(Y),{type: ` button ` ,variant: ` ghost ` ,size: ` xs ` ,class: ` ml - auto ` ,onClick:c},{default:F(()=>[O(B(ul),{"data-icon": ` inline - start ` }),n[0]||=V( ` Add ` ,-1)]),_:1})]),a.value.length?(I(),k( ` div ` ,A1,[(I(!0),k(H,null,A(a.value,([t,n],r)=>(I(),k( ` div ` ,{key:r,class: ` flex items - center gap - 2 px - 2 py - 1.5 ` },[O(B(Z),{"model-value":t,class: ` h - 8 min - w - 0 flex - 1 font - mono text - xs ` ,"aria-label": ` $ { e . field } name ` ,onChange:e=>s(r,e.target.value.trim(),n)},null,8,[ ` model - value ` , ` aria - label ` , ` onChange ` ]),O(E $ ,{"model-value":n.type?? ` string ` ,options:B(i),class: ` w - 24 ` ,"aria-label": ` $ { t } type ` ,"onUpdate:modelValue":e=>s(r,t,{...n,type:e})},null,8,[ ` model - value ` , ` options ` , ` aria - label ` , ` onUpdate : modelValue ` ]),O(B(QC),{"model-value":n.required===!0,title:n.required? ` Required ` : ` Optional ` ,"aria-label": ` $ { t } required ` ,"onUpdate:modelValue":e=>s(r,t,{...n,required:e||void 0})},null,8,[ ` model - value ` , ` title ` , ` aria - label ` , ` onUpdate : modelValue ` ]),O(B(Y),{type: ` button ` ,variant: ` ghost ` ,size: ` icon - xs ` ,"aria-label": ` Remove $ { t } ` ,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:F(()=>[O(B(Tl))]),_:1},8,[ ` aria - label ` , ` onClick ` ])]))),128))])):P( ` ` ,!0)]))}}),M1={class: ` space - y - 4 px - 3 py - 3 ` },N1={class: ` divide - y divide - border rounded - md border border - border ` },P1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },F1={key:0,role: ` alert ` ,class: ` px - 3 py - 2 text - xs text - danger ` },I1={key:1,class: ` px - 3 py - 2 text - xs text - fg - subtle ` },L1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },R1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },z1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },B1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },V1={class: ` space - y - 1.5 ` },H1= ` 6 f129e29 - 0e26 - 5246 - 99 bd - 74 cb4496203b ` ,U1=N({__name: ` WorkflowSettings ` ,props:{yaml:{}},emits:[ ` update : yaml ` ],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=c $ (n.yaml,e);return typeof t== ` string ` ?t: ` ` };function a(e,t){r( ` update : yaml ` ,l $ (n.yaml,e,t))}let o=Xw(),s=q([]),c=q(!0),l=q( ` ` );async function u(){c.value=!0,l.value= ` ` ,s.value=[];try{await o.loadOrg();let e=await X.orgAgents(o.homeOrg);s.value=e.agents.filter(e=>e.lifecycle=== ` active ` ),!i( ` identity ` )&&s.value.some(e=>e.id===H1)&&a( ` identity ` ,H1)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}Ae(u);let d=J(()=>{let e=i( ` identity ` ),t=s.value.map(e=>({value:e.id,label:e.display_name}));return e&&!c.value&&!s.value.some(t=>t.id===e)?[{value:e,label: ` $ { e } ( unknown ) ` ,disabled:!0},...t]:t}),f=yn(),p=J(()=>{let e=Object.keys(f.stateFor( ` agent - profiles Line truncated
` ).filter(Boolean))},null,8,[ ` model - value ` , ` onUpdate : modelValue ` ])):(I(),k(H,{key:2},[O(B( $ n),{"model-value":ge(h.value[e.key]),class: ` min - h - 24 font - mono text - xs ` ,placeholder: ` YAML ` ,onChange:t=>he(e.key,t.target.value)},null,8,[ ` model - value ` , ` onChange ` ]),N.value[e.key]?(I(),k( ` span ` ,A1,z(N.value[e.key]),1)):P( ` ` ,!0)],64))]))),128)),L( ` section ` ,j1,[_.value?(I(),k( ` p ` ,M1,z(_.value),1)):P( ` ` ,!0),L( ` div ` ,N1,[L( ` label ` ,P1,[r[20]||=L( ` span ` ,{class: ` flex - 1 text - label ` ,title: ` Empty always runs . A field such as inputs . enabled , ! inputs . skip , or steps . plan . result . ready == true ` }, ` Run only when ` ,-1),O(B(Z),{class: ` h - 8 w - 48 font - mono text - xs ` ,placeholder: ` inputs . enabled ` ,"aria-invalid":_.value&&_.value.startsWith( ` when ` )?!0:void 0,"model-value":a.value.when?? ` ` ,"onUpdate:modelValue":r[11]||=e=>ne( ` when ` ,String(e))},null,8,[ ` aria - invalid ` , ` model - value ` ])]),L( ` label ` ,F1,[r[21]||=L( ` span ` ,{class: ` flex - 1 text - label ` }, ` If it fails ` ,-1),O(R $ ,{class: ` w - 36 ` ,"aria-label": ` If it fails ` ,"model-value":a.value.on_failure?? ` ` ,options:ye,"onUpdate:modelValue":r[12]||=e=>ne( ` on _failure ` ,e||void 0)},null,8,[ ` model - value ` ])]),L( ` label ` ,I1,[r[22]||=L( ` span ` ,{class: ` flex - 1 text - label ` }, ` Attempts ` ,-1),O(B(Z),{type: ` number ` ,min: ` 1 ` ,max: ` 10 ` ,placeholder: ` 1 ` ,class: ` h - 8 w - 20 text - right text - label ` ,"model-value":a.value.retry?.attempts?? ` ` ,"onUpdate:modelValue":r[13]||=e=>w({attempts:String(e)=== ` ` ?void 0:Number(String(e))})},null,8,[ ` model - value ` ])]),L( ` div ` ,L1,[L( ` label ` ,{for: ` $ { B ( n ) } - backoff ` ,class: ` flex - 1 text - label ` }, ` Retry backoff ` ,8,R1),O(B(Rt),{id: ` $ { B ( n ) } - backoff ` ,"model-value":a.value.retry?.backoff?? ` ` ,units:[ ` s ` , ` m ` , ` h ` ],"onUpdate:modelValue":r[14]||=e=>w({backoff:e||void 0})},null,8,[ ` id ` , ` model - value ` ])])])])],64)):P( ` ` ,!0)]))}}),B1={class: ` space - y - 1.5 ` },V1={class: ` flex items - center text - xs font - medium text - fg - muted ` },H1={key:0,class: ` divide - y divide - border rounded - md border border - border ` },U1=N({__name: ` SpecList ` ,props:{yaml:{},field:{}},emits:[ ` update : yaml ` ],setup(e,{emit:t}){let n=e,r=t,i=[ ` string ` , ` number ` , ` bool ` , ` object ` , ` array ` , ` any ` ].map(e=>({value:e,label:e})),a=J(()=>Object.entries(b $ (n.yaml,n.field)??{}));function o(e){r( ` update : yaml ` ,x $ (n.yaml,n.field,Object.fromEntries(e.filter(([e])=>e))))}function s(e,t,n){o(a.value.map((r,i)=>i===e?[t,n]:r))}function c(){let e=n.field.slice(0,-1),t=a.value.length+1;for(;a.value.some(([n])=>n=== ` $ { e } _$ { t } ` );)t++;o([...a.value,[ ` $ { e } _$ { t } ` ,{type: ` string ` }]])}return(t,n)=>(I(),k( ` section ` ,B1,[L( ` div ` ,V1,[V(z(e.field=== ` inputs ` ? ` Inputs ` : ` Outputs ` )+ ` ` ,1),O(B(Y),{type: ` button ` ,variant: ` ghost ` ,size: ` xs ` ,class: ` ml - auto ` ,onClick:c},{default:F(()=>[O(B(ul),{"data-icon": ` inline - start ` }),n[0]||=V( ` Add ` ,-1)]),_:1})]),a.value.length?(I(),k( ` div ` ,H1,[(I(!0),k(H,null,A(a.value,([t,n],r)=>(I(),k( ` div ` ,{key:r,class: ` flex items - center gap - 2 px - 2 py - 1.5 ` },[O(B(Z),{"model-value":t,class: ` h - 8 min - w - 0 flex - 1 font - mono text - xs ` ,"aria-label": ` $ { e . field } name ` ,onChange:e=>s(r,e.target.value.trim(),n)},null,8,[ ` model - value ` , ` aria - label ` , ` onChange ` ]),O(R $ ,{"model-value":n.type?? ` string ` ,options:B(i),class: ` w - 24 ` ,"aria-label": ` $ { t } type ` ,"onUpdate:modelValue":e=>s(r,t,{...n,type:e})},null,8,[ ` model - value ` , ` options ` , ` aria - label ` , ` onUpdate : modelValue ` ]),O(B(sw),{"model-value":n.required===!0,title:n.required? ` Required ` : ` Optional ` ,"aria-label": ` $ { t } required ` ,"onUpdate:modelValue":e=>s(r,t,{...n,required:e||void 0})},null,8,[ ` model - value ` , ` title ` , ` aria - label ` , ` onUpdate : modelValue ` ]),O(B(Y),{type: ` button ` ,variant: ` ghost ` ,size: ` icon - xs ` ,"aria-label": ` Remove $ { t } ` ,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:F(()=>[O(B(Tl))]),_:1},8,[ ` aria - label ` , ` onClick ` ])]))),128))])):P( ` ` ,!0)]))}}),W1={class: ` space - y - 4 px - 3 py - 3 ` },G1={class: ` divide - y divide - border rounded - md border border - border ` },K1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },q1={key:0,role: ` alert ` ,class: ` px - 3 py - 2 text - xs text - danger ` },J1={key:1,class: ` px - 3 py - 2 text - xs text - fg - subtle ` },Y1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },X1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },Z1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` },Q1={class: ` flex min - h - 10 items - center gap - 3 px - 3 py - 1.5 ` }, $ 1={class: ` space - y - 1.5 ` },e0= ` 6 f129e29 - 0e26 - 5246 - 99 bd - 74 cb4496203b ` ,t0=N({__name: ` WorkflowSettings ` ,props:{yaml:{}},emits:[ ` update : yaml ` ],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=b $ (n.yaml,e);return typeof t== ` string ` ?t: ` ` };function a(e,t){r( ` update : yaml ` ,x $ (n.yaml,e,t))}let o=Gw(),s=q([]),c=q(!0),l=q( ` ` );async function u(){c.value=!0,l.value= ` ` ,s.value=[];try{await o.loadOrg();let e=await X.orgAgents(o.homeOrg);s.value=e.agents.filter(e=>e.lifecycle=== ` active ` ),!i( ` identity ` )&&s.value.some(e=>e.id===e0)&&a( ` identity ` ,e0)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}ke(u);let d=J(()=>{let e=i( ` identity ` ),t=s.value.map(e=>({value:e.id,label:e.display_name}));return e&&!c.value&&!s.value.some(t=>t.id===e)?[{value:e,label: ` $ { e } ( unknown ) ` ,disabled:!0},...t]:t}),f=bn(),p=J(()=>{let e=Object.keys(f.stateFor( ` agent - profiles ` 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 Vie(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=Hie(n.code,e);return Array.isArray(e)?e.some(e=>E5(n[r],e,t,n.type=== ` keyup ` )):E5(n[r],e,t,n.type=== ` keyup ` )}}function Hie(e,t){return t.includes(e)? ` code ` : ` key ` }function D5(e,t){let n=J(()=>Fe(t?.target)??zie),r=Je(Fe(e)===!0),i=!1,a=new Set,o=c(Fe(e));M(()=>Fe(e),(e,t)=>{typeof t== ` boolean ` &&typeof e!= ` boolean ` &&s(),o=c(e)},{immediate:!0}),H2([ ` blur ` , ` contextmenu ` ],s),W2((...e)=>o(...e),e=>{let n=Fe(t?.actInsideInputWithModifier)??!0,a=Fe(t?.preventDefault)??!1;if(i=Bie(e),(!i||i&&!n)&&T5(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}),W2((...e)=>o(...e),e=>{let n=Fe(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&T5(e))return;i=!1,r.value=!1}},{eventName: ` keyup ` ,target:n});function s(){i=!1,a.clear(),r.value=Fe(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e== ` boolean ` ?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e== ` string ` ?Vie(e,a):e}return r}var O5= ` vue - flow _ _node - desc ` ,k5= ` vue - flow _ _edge - desc ` ,Uie= ` vue - flow _ _aria - live ` ,A5=[ ` Enter ` , ` ` , ` Escape ` ],j5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function M5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function N5(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 P5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function F5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function I5(e,t){return{x:F5(e.x,t[0][0],t[1][0]),y:F5(e.y,t[0][1],t[1][1])}}function L5(e){let t=e.getRootNode();return ` elementFromPoint ` in t?t:window.document}function R5(e){return e&&typeof e== ` object ` && ` id ` in e&& ` source ` in e&& ` target ` in e}function z5(e){return e&&typeof e== ` object ` && ` id ` in e&& ` position ` in e&&!R5(e)}function B5(e){return z5(e)&& ` computedPosition ` in e}function V5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Wie(e){return V5(e.width)&&V5(e.height)&&V5(e.x)&&V5(e.y)}function Gie(e,t,n){let r={id:e.id.toString(),type:e.type?? ` default ` ,dimensions:Me({width:0,height:0}),computedPosition:Me({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:F7(e.data)?e.data:{},events:Me(F7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function H5(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:F7(e.data)?e.data:{},events:Me(F7(e.events)?e.events:{}),label:e.label?? ` ` ,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function U5(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 Kie(...e){if(e.length===3){let[t,n,r]=e;return U5(t,n,r, ` target ` )}let[t,n]=e,r=typeof t== ` string ` ?t:t.id;return n.filter(e=>R5(e)&&e.source===r).map(e=>n.find(t=>z5(t)&&t.id===e.target))}function qie(...e){if(e.length===3){let[t,n,r]=e;return U5(t,n,r, ` source ` )}let[t,n]=e,r=typeof t== ` string ` ?t:t.id;return n.filter(e=>R5(e)&&e.target===r).map(e=>n.find(t=>z5(t)&&t.id===e.source))}function W5({source:e,sourceHandle:t,target:n,targetHandle:r}){return ` vueflow _ _edge - $ { e } $ { t ? ? ` ` } - $ { n } $ { r ? ? ` ` } ` }function Jie(e,t){return t.some(t=>R5(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 G5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function K5({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?T7(s,o):s}function Yie(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 q5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function Xie({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function J5(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=Yie(t,q5({...r.computedPosition,...r.dimensions}))}return Xie(t)}function Y5(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...K5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectabl
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 bae(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=xae(n.code,e);return Array.isArray(e)?e.some(e=>D5(n[r],e,t,n.type=== ` keyup ` )):D5(n[r],e,t,n.type=== ` keyup ` )}}function xae(e,t){return t.includes(e)? ` code ` : ` key ` }function O5(e,t){let n=J(()=>Pe(t?.target)??vae),r=qe(Pe(e)===!0),i=!1,a=new Set,o=c(Pe(e));M(()=>Pe(e),(e,t)=>{typeof t== ` boolean ` &&typeof e!= ` boolean ` &&s(),o=c(e)},{immediate:!0}),e4([ ` blur ` , ` contextmenu ` ],s),n4((...e)=>o(...e),e=>{let n=Pe(t?.actInsideInputWithModifier)??!0,a=Pe(t?.preventDefault)??!1;if(i=yae(e),(!i||i&&!n)&&E5(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}),n4((...e)=>o(...e),e=>{let n=Pe(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&E5(e))return;i=!1,r.value=!1}},{eventName: ` keyup ` ,target:n});function s(){i=!1,a.clear(),r.value=Pe(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e== ` boolean ` ?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e== ` string ` ?bae(e,a):e}return r}var k5= ` vue - flow _ _node - desc ` ,A5= ` vue - flow _ _edge - desc ` ,Sae= ` vue - flow _ _aria - live ` ,j5=[ ` Enter ` , ` ` , ` Escape ` ],M5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function N5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function P5(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 F5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function I5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function L5(e,t){return{x:I5(e.x,t[0][0],t[1][0]),y:I5(e.y,t[0][1],t[1][1])}}function R5(e){let t=e.getRootNode();return ` elementFromPoint ` in t?t:window.document}function z5(e){return e&&typeof e== ` object ` && ` id ` in e&& ` source ` in e&& ` target ` in e}function B5(e){return e&&typeof e== ` object ` && ` id ` in e&& ` position ` in e&&!z5(e)}function V5(e){return B5(e)&& ` computedPosition ` in e}function H5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Cae(e){return H5(e.width)&&H5(e.height)&&H5(e.x)&&H5(e.y)}function wae(e,t,n){let r={id:e.id.toString(),type:e.type?? ` default ` ,dimensions:je({width:0,height:0}),computedPosition:je({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:I7(e.data)?e.data:{},events:je(I7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function U5(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:I7(e.data)?e.data:{},events:je(I7(e.events)?e.events:{}),label:e.label?? ` ` ,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function W5(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 Tae(...e){if(e.length===3){let[t,n,r]=e;return W5(t,n,r, ` target ` )}let[t,n]=e,r=typeof t== ` string ` ?t:t.id;return n.filter(e=>z5(e)&&e.source===r).map(e=>n.find(t=>B5(t)&&t.id===e.target))}function Eae(...e){if(e.length===3){let[t,n,r]=e;return W5(t,n,r, ` source ` )}let[t,n]=e,r=typeof t== ` string ` ?t:t.id;return n.filter(e=>z5(e)&&e.target===r).map(e=>n.find(t=>B5(t)&&t.id===e.source))}function G5({source:e,sourceHandle:t,target:n,targetHandle:r}){return ` vueflow _ _edge - $ { e } $ { t ? ? ` ` } - $ { n } $ { r ? ? ` ` } ` }function Dae(e,t){return t.some(t=>z5(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 K5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function q5({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?E7(s,o):s}function Oae(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 J5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function kae({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function Y5(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=Oae(t,J5({...r.computedPosition,...r.dimensions}))}return kae(t)}function X5(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...q5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectabl
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 }
@@ -319,7 +319,7 @@ 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 ` },x7=class extends Error{constructor(e,...t){super(b7[e]?.call(b7,...t)),this.name= ` VueFlowError ` ,this.code=e,this.args=t}};function S7(e){return ` clientX ` in e}function oae(e){return ` sourceEvent ` in e}function C7(e,t){let n=S7(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 w7=()=>typeof navigator< ` u ` &&(navigator==null?void 0:navigator.userAgent)?.indexOf( ` Mac ` )>=0;function sae(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function T7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var cae=()=>!0;function E7(e){e?.classList.remove( ` valid ` , ` connecting ` , ` vue - flow _ _handle - valid ` , ` vue - flow _ _handle - connecting ` )}function lae(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())N5(i,M5(e))>0&&r.push(e);return r}var uae=250;function dae(e,t,n,r){let i=[],a=1/0,o=lae(e,n,t+uae);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}=_7(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 D7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=cae},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:_}=C7(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=O7(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===S5.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=k7(t,e,a,p,n,!0)}return b}function O7(e,t){return e||(t?.classList.contains( ` target ` )? ` target ` :t?.classList.contains( ` source ` )? ` source ` :null)}function fae(e,t){let n=null;return t?n= ` valid ` :e&&!t&&(n= ` invalid ` ),n}function pae(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function k7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===S5.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,..._7(o,c,c.position,!0)}:c}var A7={[y5.Left]:y5.Right,[y5.Right]:y5.Left,[y5.Top]:y5.Bottom,[y5.Bottom]:y5.Top},mae=[ ` production ` , ` prod ` ];function j7(e,...t){M7()&&console.warn( ` [ Vue Flow ] : $ { e } ` ,...t)}function M7(){return!mae.includes( ` production ` )}function N7(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,...P5(t)}}):null}function P7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),Pe(()=>{o.blur()})):n([e])}function F7(e){return B(e)!==void 0}function hae(e,t,n,r){if(!e||!e.source||!e.target)return n(new x7(y7.EDGE_INVALID,e?.id?? ` [ ID UNKNOWN ] ` )),!1;let i;return i=R5(e)?e:{...e,id:W5(e)},i=H5(i,void 0,r),!Jie(i,t)&&i}function gae(e,t,n,r,i){if(!t.source||!t.target)return i(new x7(y7.EDGE_INVALID,e.id)),!1;if(!n)return i(new x7(y7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?W5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function I7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!z5(o)){n(new x7(y7.NODE_INVALID,o?.id));continue}let s=Gie(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 x7(y7.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 L7(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 R7(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 } ` ;L7( ` sourc Line truncated
` )},z(e.data.summary||e.data.detail),9,rse)):P( ` ` ,!0),e.data.when||e.data.retry||e.data.continues?(I(),k( ` div ` ,ise,[e.data.when?(I(),k( ` span ` ,{key:0,class: ` flex max - w - full min - w - 0 items - center gap - 0.5 rounded bg - secondary px - 1 font - mono ` ,title: ` Runs only when $ { e . data . when } ` },[O(B(Vc),{class: ` size - 3 shrink - 0 ` ,"aria-hidden": ` true ` }),L( ` span ` ,ose,z(e.data.when),1)],8,ase)):P( ` ` ,!0),e.data.retry?(I(),k( ` span ` ,{key:1,class: ` flex items - center gap - 0.5 rounded bg - secondary px - 1 ` ,title: ` Up to $ { e . data . retry } attempts ` },[O(B(fl),{class: ` size - 3 ` ,"aria-hidden": ` true ` }),V( ` × ` +z(e.data.retry),1)],8,sse)):P( ` ` ,!0),e.data.continues?(I(),k( ` span ` ,cse,[O(B(xl),{class: ` size - 3 ` ,"aria-hidden": ` true ` }),r[10]||=V( ` continues ` ,-1)])):P( ` ` ,!0)])):P( ` ` ,!0),e.data.run?.error?(I(),k( ` p ` ,{key:4,class: ` mt - 1 line - clamp - 2 text - caption text - danger ` ,title:e.data.run.error},z(e.data.run.error),9,lse)):P( ` ` ,!0)],64))]),O(Qe,{"enter-from-class": ` opacity - 0 - translate - y - 1 ` ,"enter-active-class": ` transition duration - 200 ` ,"leave-to-class": ` opacity - 0 ` ,"leave-active-class": ` transition duration - 100 ` },{default:F(()=>[e.data.expanded?(I(),k( ` div ` ,{key:0,class: ` nodrag nopan nowheel cursor - auto border - t border - border ` ,onClick:r[6]||=at(()=>{},[ ` stop ` ])},[G(t. $ slots, ` default ` )])):P( ` ` ,!0)]),_:3}),O(B(e9),{type: ` source ` ,position:B(y5).Bottom},null,8,[ ` position ` ]),O(B(e9),{id: ` data - out ` ,type: ` source ` ,position:B(y5).Right,class: ` ! opacity - 0 ` },null,8,[ ` position ` ]),e.data.type=== ` switch ` ?(I(),K(B(e9),{key:1,id: ` otherwise ` ,type: ` source ` ,position:B(y5).Right,class: ` ! opacity - 0 ` },null,8,[ ` position ` ])):P( ` ` ,!0)],2))}}),dse={class: ` pointer - events - none size - full rounded - xl border border - dashed border - border bg - muted / 30 ` },fse={class: ` flex items - center gap - 1 px - 2.5 pt - 1.5 text - caption text - fg - subtle ` },pse={key:0},mse={key:1,class: ` font - mono ` },hse=N({__name: ` LaneNode ` ,props:{data:{}},setup(e){return(t,n)=>(I(),k( ` div ` ,dse,[L( ` div ` ,fse,[e.data.lane=== ` switch ` ?(I(),k(H,{key:0},[O(B(Sl),{class: ` size - 3 ` ,"aria-hidden": ` true ` }),e.data.title==="default"?(I(),k( ` span ` ,pse, ` otherwise ` )):(I(),k( ` span ` ,mse, ` = ` +z(e.data.title),1))],64)):(I(),k(H,{key:1},[O(B(Uc),{class: ` size - 3 ` ,"aria-hidden": ` true ` }),V(z(e.data.title),1)],64))])]))}}),gse={class: ` flex shrink - 0 items - center justify - center gap - 1 border - t border - border bg - card p - 1 ` },T9=240,_se=416,E9=-140,vse=72,yse=.9,D9=N({__name: ` WorkflowCanvas ` ,props:{yaml:{},stages:{},open:{},triggers:{},types:{},readonly:{type:Boolean},restartable:{type:Boolean},marks:{},problems:{},title:{},summary:{}},emits:[ ` toggle ` , ` insert ` , ` duplicate ` , ` move ` , ` remove ` , ` rename ` , ` restart ` ],setup(e,{emit:t}){let n=e,r=t,i=J(()=>!!n.types?.length&&!n.readonly),a=J(()=>[...n.types??[], ` parallel ` , ` switch ` ]),o=J(()=>a.value.filter(e=>[ ` agent . run ` , ` workflow . call ` ].includes(e))),s=e=>e&&qQ(e)?o.value:a.value,c=e=>e.kind=== ` step ` ?JSON.stringify(e.path??null):e.kind,l=q(null),u=q(null),d=Vn( ` ( max - width : 767 px ) ` ),f=J(()=>{let e=f $ (C $ (n.yaml),n.stages??[]);return n.types?.length?{nodes:[{id: ` workflow ` ,type: ` step ` ,position:{x:0,y:E9},data:{kind: ` workflow ` ,key: ` workflow ` ,title:n.title|| ` Workflow ` ,type: ` ` ,detail:n.summary?? ` ` }},...e.nodes],edges:[{id: ` flow - workflow - start ` ,source: ` workflow ` ,target: ` start ` ,kind: ` flow ` },...e.edges]}:e}),p=J(()=>f.value.nodes.filter(e=>e.data.path?.length===2).length),m=q({}),h=q({}),g=J(()=>f.value.nodes.find(e=>e.type=== ` step ` &&c(e.data)===n.open));function _(e,t){m.value={...m.value,[e]:t},g.value?.id!==e&&(h.value={...h.value,[e]:t})}let v=J(()=>{let e=d.value?void 0:g.value?.id;return e&&m.value[e]?Math.max(0,m.value[e]-(h.value[e]??m.value[e])):0}),y=Wn(),b=Hn(v,{duration:J(()=>y.value=== ` reduce ` ?0:200)}),x=J(()=>{let e=new Map;for(let t of f.value.nodes){if(t.type!== ` step ` )continue;let n=(t.id===g.value?.id?h.value[t.id]:void 0)??m.value[t.id];n!==void 0&&e.set(t.position.y,Math.max(e.get(t.position.y)??-72,n-vse))}return[...e]}),S=e=>x.value.reduce((t,[n,r])=>n<e?t+r:t,0);function ee(e){let t=e.data,a=c(t),o=t.path,s={triggers:t.kind=== ` start ` ?n.triggers??[]:t.triggers,expanded:!d.value&&a===n.open,editable:i.value,problem:o?n.problems?.[a]:void 0,onResize:t=>_(e.id,t)};return n.types?.length&&(s.onToggle=()=>r( ` toggle ` ,a)),i.value&&o&&(s.onRename=e=>r( ` rename ` ,o,e),s.onDuplicate=()=>r( ` duplicate ` ,o),s.onRemove=()=>r( ` remove ` ,o)),{...e,data:{...t,...s}}}let C=e=>{let t=g.value;return d.value||!t||!e.style?.width?!1:e.position.x<=t.position.x&&e.position.x+parseFloat(String(e.style.width))>=t.position.x+T9};function te(e){let t=g.value;if(d.value||!t)return 0;if(e.id===t.id||C(e))return-88;let n=t.position.x+T9/2,r=e.style?.width?parseFloat(String(e.style.width)):e.type=== ` step ` ?T9:32,i=e.position.x+r/2;return Math.abs(i-n)<T9/2?0:i<n?-88:88}let ne=J(()=>{let e=g.value;return f.value.nodes.map(t=>{let a=t;t.type=== ` add ` ?t={...t,data:{...t.data,types:s(t.data.insertAfter),editable:i.value,onInsert:e=>r( ` insert ` ,t.data.insertAfter,e)}}:t.type=== ` step ` &&(t=ee(t));let o=n.marks?.[t.id];o&&(t={...t,data:{...t.data,mark:o}});let c=t.position.
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 ` },S7=class extends Error{constructor(e,...t){super(x7[e]?.call(x7,...t)),this.name= ` VueFlowError ` ,this.code=e,this.args=t}};function C7(e){return ` clientX ` in e}function zae(e){return ` sourceEvent ` in e}function w7(e,t){let n=C7(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 T7=()=>typeof navigator< ` u ` &&(navigator==null?void 0:navigator.userAgent)?.indexOf( ` Mac ` )>=0;function Bae(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function E7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var Vae=()=>!0;function D7(e){e?.classList.remove( ` valid ` , ` connecting ` , ` vue - flow _ _handle - valid ` , ` vue - flow _ _handle - connecting ` )}function Hae(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())P5(i,N5(e))>0&&r.push(e);return r}var Uae=250;function Wae(e,t,n,r){let i=[],a=1/0,o=Hae(e,n,t+Uae);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}=v7(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 O7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Vae},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:_}=w7(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=k7(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===C5.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=A7(t,e,a,p,n,!0)}return b}function k7(e,t){return e||(t?.classList.contains( ` target ` )? ` target ` :t?.classList.contains( ` source ` )? ` source ` :null)}function Gae(e,t){let n=null;return t?n= ` valid ` :e&&!t&&(n= ` invalid ` ),n}function Kae(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function A7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===C5.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,...v7(o,c,c.position,!0)}:c}var j7={[b5.Left]:b5.Right,[b5.Right]:b5.Left,[b5.Top]:b5.Bottom,[b5.Bottom]:b5.Top},qae=[ ` production ` , ` prod ` ];function M7(e,...t){N7()&&console.warn( ` [ Vue Flow ] : $ { e } ` ,...t)}function N7(){return!qae.includes( ` production ` )}function P7(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,...F5(t)}}):null}function F7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),Ne(()=>{o.blur()})):n([e])}function I7(e){return B(e)!==void 0}function Jae(e,t,n,r){if(!e||!e.source||!e.target)return n(new S7(b7.EDGE_INVALID,e?.id?? ` [ ID UNKNOWN ] ` )),!1;let i;return i=z5(e)?e:{...e,id:G5(e)},i=U5(i,void 0,r),!Dae(i,t)&&i}function Yae(e,t,n,r,i){if(!t.source||!t.target)return i(new S7(b7.EDGE_INVALID,e.id)),!1;if(!n)return i(new S7(b7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?G5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function L7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!B5(o)){n(new S7(b7.NODE_INVALID,o?.id));continue}let s=wae(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 S7(b7.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 R7(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 z7(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 } ` ;R7( ` sourc Line truncated
` )},z(e.data.summary||e.data.detail),9,Lse)):P( ` ` ,!0),e.data.when||e.data.retry||e.data.continues?(I(),k( ` div ` ,Rse,[e.data.when?(I(),k( ` span ` ,{key:0,class: ` flex max - w - full min - w - 0 items - center gap - 0.5 rounded bg - secondary px - 1 font - mono ` ,title: ` Runs only when $ { e . data . when } ` },[O(B(Vc),{class: ` size - 3 shrink - 0 ` ,"aria-hidden": ` true ` }),L( ` span ` ,Bse,z(e.data.when),1)],8,zse)):P( ` ` ,!0),e.data.retry?(I(),k( ` span ` ,{key:1,class: ` flex items - center gap - 0.5 rounded bg - secondary px - 1 ` ,title: ` Up to $ { e . data . retry } attempts ` },[O(B(fl),{class: ` size - 3 ` ,"aria-hidden": ` true ` }),V( ` × ` +z(e.data.retry),1)],8,Vse)):P( ` ` ,!0),e.data.continues?(I(),k( ` span ` ,Hse,[O(B(xl),{class: ` size - 3 ` ,"aria-hidden": ` true ` }),r[10]||=V( ` continues ` ,-1)])):P( ` ` ,!0)])):P( ` ` ,!0),e.data.run?.error?(I(),k( ` p ` ,{key:4,class: ` mt - 1 line - clamp - 2 text - caption text - danger ` ,title:e.data.run.error},z(e.data.run.error),9,Use)):P( ` ` ,!0)],64))]),O(Ze,{"enter-from-class": ` opacity - 0 - translate - y - 1 ` ,"enter-active-class": ` transition duration - 200 ` ,"leave-to-class": ` opacity - 0 ` ,"leave-active-class": ` transition duration - 100 ` },{default:F(()=>[e.data.expanded?(I(),k( ` div ` ,{key:0,class: ` nodrag nopan nowheel cursor - auto border - t border - border ` ,onClick:r[6]||=it(()=>{},[ ` stop ` ])},[G(t. $ slots, ` default ` )])):P( ` ` ,!0)]),_:3}),O(B(t9),{type: ` source ` ,position:B(b5).Bottom},null,8,[ ` position ` ]),O(B(t9),{id: ` data - out ` ,type: ` source ` ,position:B(b5).Right,class: ` ! opacity - 0 ` },null,8,[ ` position ` ]),e.data.type=== ` switch ` ?(I(),K(B(t9),{key:1,id: ` otherwise ` ,type: ` source ` ,position:B(b5).Right,class: ` ! opacity - 0 ` },null,8,[ ` position ` ])):P( ` ` ,!0)],2))}}),Gse={class: ` pointer - events - none size - full rounded - xl border border - dashed border - border bg - muted / 30 ` },Kse={class: ` flex items - center gap - 1 px - 2.5 pt - 1.5 text - caption text - fg - subtle ` },qse={key:0},Jse={key:1,class: ` font - mono ` },Yse=N({__name: ` LaneNode ` ,props:{data:{}},setup(e){return(t,n)=>(I(),k( ` div ` ,Gse,[L( ` div ` ,Kse,[e.data.lane=== ` switch ` ?(I(),k(H,{key:0},[O(B(Sl),{class: ` size - 3 ` ,"aria-hidden": ` true ` }),e.data.title==="default"?(I(),k( ` span ` ,qse, ` otherwise ` )):(I(),k( ` span ` ,Jse, ` = ` +z(e.data.title),1))],64)):(I(),k(H,{key:1},[O(B(Uc),{class: ` size - 3 ` ,"aria-hidden": ` true ` }),V(z(e.data.title),1)],64))])]))}}),Xse={class: ` flex shrink - 0 items - center justify - center gap - 1 border - t border - border bg - card p - 1 ` },T9=240,Zse=416,E9=-140,Qse=72, $ se=.9,D9=N({__name: ` WorkflowCanvas ` ,props:{yaml:{},stages:{},open:{},triggers:{},types:{},readonly:{type:Boolean},restartable:{type:Boolean},marks:{},problems:{},title:{},summary:{}},emits:[ ` toggle ` , ` insert ` , ` duplicate ` , ` move ` , ` remove ` , ` rename ` , ` restart ` ],setup(e,{emit:t}){let n=e,r=t,i=J(()=>!!n.types?.length&&!n.readonly),a=J(()=>[...n.types??[], ` parallel ` , ` switch ` ]),o=J(()=>a.value.filter(e=>[ ` agent . run ` , ` workflow . call ` ].includes(e))),s=e=>e&&a $ (e)?o.value:a.value,c=e=>e.kind=== ` step ` ?JSON.stringify(e.path??null):e.kind,l=q(null),u=q(null),d=Hn( ` ( max - width : 767 px ) ` ),f=J(()=>{let e=w $ (F $ (n.yaml),n.stages??[]);return n.types?.length?{nodes:[{id: ` workflow ` ,type: ` step ` ,position:{x:0,y:E9},data:{kind: ` workflow ` ,key: ` workflow ` ,title:n.title|| ` Workflow ` ,type: ` ` ,detail:n.summary?? ` ` }},...e.nodes],edges:[{id: ` flow - workflow - start ` ,source: ` workflow ` ,target: ` start ` ,kind: ` flow ` },...e.edges]}:e}),p=J(()=>f.value.nodes.filter(e=>e.data.path?.length===2).length),m=q({}),h=q({}),g=J(()=>f.value.nodes.find(e=>e.type=== ` step ` &&c(e.data)===n.open));function _(e,t){m.value={...m.value,[e]:t},g.value?.id!==e&&(h.value={...h.value,[e]:t})}let v=J(()=>{let e=d.value?void 0:g.value?.id;return e&&m.value[e]?Math.max(0,m.value[e]-(h.value[e]??m.value[e])):0}),y=Gn(),b=Un(v,{duration:J(()=>y.value=== ` reduce ` ?0:200)}),x=J(()=>{let e=new Map;for(let t of f.value.nodes){if(t.type!== ` step ` )continue;let n=(t.id===g.value?.id?h.value[t.id]:void 0)??m.value[t.id];n!==void 0&&e.set(t.position.y,Math.max(e.get(t.position.y)??-72,n-Qse))}return[...e]}),S=e=>x.value.reduce((t,[n,r])=>n<e?t+r:t,0);function ee(e){let t=e.data,a=c(t),o=t.path,s={triggers:t.kind=== ` start ` ?n.triggers??[]:t.triggers,expanded:!d.value&&a===n.open,editable:i.value,problem:o?n.problems?.[a]:void 0,onResize:t=>_(e.id,t)};return n.types?.length&&(s.onToggle=()=>r( ` toggle ` ,a)),i.value&&o&&(s.onRename=e=>r( ` rename ` ,o,e),s.onDuplicate=()=>r( ` duplicate ` ,o),s.onRemove=()=>r( ` remove ` ,o)),{...e,data:{...t,...s}}}let C=e=>{let t=g.value;return d.value||!t||!e.style?.width?!1:e.position.x<=t.position.x&&e.position.x+parseFloat(String(e.style.width))>=t.position.x+T9};function te(e){let t=g.value;if(d.value||!t)return 0;if(e.id===t.id||C(e))return-88;let n=t.position.x+T9/2,r=e.style?.width?parseFloat(String(e.style.width)):e.type=== ` step ` ?T9:32,i=e.position.x+r/2;return Math.abs(i-n)<T9/2?0:i<n?-88:88}let ne=J(()=>{let e=g.value;return f.value.nodes.map(t=>{let a=t;t.type=== ` add ` ?t={...t,data:{...t.data,types:s(t.data.insertAfter),editable:i.value,onInsert:e=>r( ` insert ` ,t.data.insertAfter,e)}}:t.type=== ` step ` &&(t=ee(t));let o=n.marks?.[t.id];o&&(t={...t,data:{...t.data,mark:o}});let c=t.position.
Line truncated
` ),r=t.split( `
` ),i=Array.from({length:n.length+1},()=>Array(r.length+1).fill(0));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?i[e+1][t+1]+1:Math.max(i[e+1][t],i[e][t+1]);let a=[],o=0,s=0;for(;o<n.length&&s<r.length;)n[o]===r[s]?(a.push({kind: ` same ` ,text:n[o++]}),s++):i[o+1][s]>=i[o][s+1]?a.push({kind: ` del ` ,text:n[o++]}):a.push({kind: ` add ` ,text:r[s++]});for(;o<n.length;)a.push({kind: ` del ` ,text:n[o++]});for(;s<r.length;)a.push({kind: ` add ` ,text:r[s++]});return a}function O9(e){let t=VQ(e).toJS(),n=new Map;for(let r of C $ (e).nodes){let{kind:e,path:i,stage:a,occurrence:o}=r.data;if(r.type!== ` step ` ||e!== ` step ` ||!i||a===void 0)continue;let s=t;for(let e of i)s=s?.[e];n.set( ` $ { a } # $ { o ? ? 0 } ` ,{node:r.id,signature:JSON.stringify(s??null)})}return n}function k9(e,t,n){let r=O9(e),i=O9(t),a={};for(let[e,t]of r){let r=i.get(e);r?r.signature!==t.signature&&(a[t.node]= ` changed ` ):a[t.node]=n}return a}var wse={class: ` flex flex - col gap - 3 md : grid md : h - [ calc ( 100 dvh - 17 rem ) ] md : min - h - [ 26 rem ] md : grid - cols - [ 18 rem _1fr ] ` },Tse=[ ` aria - current ` , ` onClick ` ],Ese={class: ` flex items - center gap - 2 text - sm ` },Dse={class: ` font - mono text - xs text - fg - subtle ` },Ose=[ ` title ` ],kse={key:0,class: ` px - 3 py - 2 text - sm text - fg - muted ` },Ase={key:1,class: ` flex min - h - 0 flex - col gap - 2 ` },jse={class: ` flex items - center gap - 2 max - md : flex - wrap ` },Mse={key:0,class: ` rounded - lg border border - border p - 4 text - sm text - fg - muted ` },Nse={key:1,class: ` min - h - 0 flex - 1 overflow - auto rounded - lg border border - border pt - 2 pb - [ calc ( 0.5 rem + var ( -- code - overscroll ) ) ] font - mono text - label leading - 6 ` },Pse={class: ` inline - block w - 4 select - none text - fg - subtle ` },Fse={key:2,class: ` grid min - h - 0 flex - 1 gap - 3 max - md : flex - none md : grid - cols - 2 ` },Ise={class: ` flex min - h - 0 flex - col gap - 1 ` },Lse={class: ` text - caption font - medium uppercase text - fg - muted ` },Rse={class: ` min - h - 0 flex - 1 max - md : h - 72 max - md : flex - none ` },zse={class: ` flex min - h - 0 flex - col gap - 1 ` },Bse={class: ` min - h - 0 flex - 1 max - md : h - 72 max - md : flex - none ` },Vse=N({__name: ` WorkflowHistory ` ,props:ze({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default: ` yaml ` },modeModifiers:{}}),emits:ze([ ` restore ` ],[ ` update : selected ` , ` update : mode ` ]),setup(e,{emit:t}){let n=e,r=t,i=be(e, ` selected ` ),a=be(e, ` mode ` );M(()=>n.revisions,e=>{e.some(e=>e.version===i.value)||(i.value=(e.find(e=>e.yaml!==n.current)??e[0])?.version??0)},{immediate:!0});let o=J(()=>n.revisions.find(e=>e.version===i.value)),s=J(()=>o.value?.yaml??null),c=J(()=>s.value===null?[]:Cse(s.value,n.current)),l=J(()=>s.value!==null&&s.value===n.current),u=J(()=>s.value===null?{}:k9(s.value,n.current, ` removed ` )),d=J(()=>s.value===null?{}:k9(n.current,s.value, ` added ` )),f={added: ` default ` ,edited: ` secondary ` ,removed: ` destructive ` };return(t,n)=>(I(),k( ` div ` ,wse,[L( ` ol ` ,{class:R(B(U)( ` min - h - 0 divide - y divide - border overflow - y - auto rounded - lg border border - border ` ,e.revisions.length&& ` max - md : hidden ` )),"aria-label": ` Revisions ` },[(I(!0),k(H,null,A(e.revisions,e=>(I(),k( ` li ` ,{key:e.version},[L( ` button ` ,{type: ` button ` ,class:R([ ` block w - full px - 3 py - 2 text - left hover : bg - secondary ` ,e.version===i.value&& ` bg - secondary ` ]),"aria-current":e.version===i.value,onClick:t=>i.value=e.version},[L( ` span ` ,Ese,[L( ` span ` ,Dse, ` v ` +z(e.version),1),O(B(w),{variant:f[e.change]},{default:F(()=>[V(z(e.change),1)]),_:2},1032,[ ` variant ` ])]),L( ` span ` ,{class: ` mt - 0.5 block truncate text - xs text - fg - muted ` ,title:e.at},[V(z(e.actor|| ` unknown ` )+ ` · ` +z(e.source|| ` unknown ` )+ ` · ` ,1),O(B(sC),{at:e.at},null,8,[ ` at ` ])],8,Ose)],10,Tse)]))),128)),e.revisions.length?P( ` ` ,!0):(I(),k( ` li ` ,kse,z(e.error|| ` No recorded changes ` ),1))],2),e.revisions.length?(I(),K(B(Rn),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:F(()=>[O(B(Fn),{class: ` w - full md : hidden ` ,"aria-label": ` Revision ` },{default:F(()=>[O(B(zn))]),_:1}),O(B(In),null,{default:F(()=>[(I(!0),k(H,null,A(e.revisions,e=>(I(),K(B(Pn),{key:e.version,value:String(e.version)},{default:F(()=>[V( ` v ` +z(e.version)+ ` · ` +z(e.change)+ ` · ` +z(e.actor|| ` unknown ` )+ ` · ` +z(B(US)(e.at)),1)]),_:2},1032,[ ` value ` ]))),128))]),_:1})]),_:1},8,[ ` model - value ` ])):P( ` ` ,!0),o.value?(I(),k( ` div ` ,Ase,[L( ` div ` ,jse,[O(B(dE),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:F(()=>[O(B(pE),null,{default:F(()=>[O(B(mE),{value: ` yaml ` },{default:F(()=>[...n[3]||=[V( ` YAML ` ,-1)]]),_:1}),O(B(mE),{value: ` canvas ` },{default:F(()=>[...n[4]||=[V( ` Canvas ` ,-1)]]),_:1})]),_:1})]),_:1},8,[ ` modelValue ` ]),O(B(Y),{type: ` button ` ,size: ` sm ` ,variant: ` outline ` ,class: ` ml - auto ` ,disabled:s.value===null||l.value,title:s.value===null? ` Workflow removed ` :void 0,onClick:n[2]||=e=>r( ` restore ` ,s.value)},{default:F(()=>[O(B(pl),{"data-icon": ` inline - start ` }),n[5]||=V( ` Restore this version ` ,-1)]),_:1},8,[ ` disabled ` , ` title ` ])]),s.value===null?(I(),k( ` p ` ,Mse, ` Workflow removed in this revision . ` )):a.value=== ` yaml ` ?(I(),k( ` pre ` ,Nse,[L( ` code ` ,null,[(I(!0),k(H,null,A(c.value,(e,t)=>(I(),k( ` span ` ,{key:t,class:R([ ` block min - h - 6 px - 3 whitespace - pre - wrap ` ,{"bg-o
Line truncated
` ),i=Array.from({length:n.length+1},()=>Array(r.length+1).fill(0));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?i[e+1][t+1]+1:Math.max(i[e+1][t],i[e][t+1]);let a=[],o=0,s=0;for(;o<n.length&&s<r.length;)n[o]===r[s]?(a.push({kind: ` same ` ,text:n[o++]}),s++):i[o+1][s]>=i[o][s+1]?a.push({kind: ` del ` ,text:n[o++]}):a.push({kind: ` add ` ,text:r[s++]});for(;o<n.length;)a.push({kind: ` del ` ,text:n[o++]});for(;s<r.length;)a.push({kind: ` add ` ,text:r[s++]});return a}function O9(e){let t= $ Q(e).toJS(),n=new Map;for(let r of F $ (e).nodes){let{kind:e,path:i,stage:a,occurrence:o}=r.data;if(r.type!== ` step ` ||e!== ` step ` ||!i||a===void 0)continue;let s=t;for(let e of i)s=s?.[e];n.set( ` $ { a } # $ { o ? ? 0 } ` ,{node:r.id,signature:JSON.stringify(s??null)})}return n}function k9(e,t,n){let r=O9(e),i=O9(t),a={};for(let[e,t]of r){let r=i.get(e);r?r.signature!==t.signature&&(a[t.node]= ` changed ` ):a[t.node]=n}return a}var ice={class: ` flex flex - col gap - 3 md : grid md : h - [ calc ( 100 dvh - 17 rem ) ] md : min - h - [ 26 rem ] md : grid - cols - [ 18 rem _1fr ] ` },ace=[ ` aria - current ` , ` onClick ` ],oce={class: ` flex items - center gap - 2 text - sm ` },sce={class: ` font - mono text - xs text - fg - subtle ` },cce=[ ` title ` ],lce={key:0,class: ` px - 3 py - 2 text - sm text - fg - muted ` },uce={key:1,class: ` flex min - h - 0 flex - col gap - 2 ` },dce={class: ` flex items - center gap - 2 max - md : flex - wrap ` },fce={key:0,class: ` rounded - lg border border - border p - 4 text - sm text - fg - muted ` },pce={key:1,class: ` min - h - 0 flex - 1 overflow - auto rounded - lg border border - border pt - 2 pb - [ calc ( 0.5 rem + var ( -- code - overscroll ) ) ] font - mono text - label leading - 6 ` },mce={class: ` inline - block w - 4 select - none text - fg - subtle ` },hce={key:2,class: ` grid min - h - 0 flex - 1 gap - 3 max - md : flex - none md : grid - cols - 2 ` },gce={class: ` flex min - h - 0 flex - col gap - 1 ` },_ce={class: ` text - caption font - medium uppercase text - fg - muted ` },vce={class: ` min - h - 0 flex - 1 max - md : h - 72 max - md : flex - none ` },yce={class: ` flex min - h - 0 flex - col gap - 1 ` },bce={class: ` min - h - 0 flex - 1 max - md : h - 72 max - md : flex - none ` },xce=N({__name: ` WorkflowHistory ` ,props:Re({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default: ` yaml ` },modeModifiers:{}}),emits:Re([ ` restore ` ],[ ` update : selected ` , ` update : mode ` ]),setup(e,{emit:t}){let n=e,r=t,i=ye(e, ` selected ` ),a=ye(e, ` mode ` );M(()=>n.revisions,e=>{e.some(e=>e.version===i.value)||(i.value=(e.find(e=>e.yaml!==n.current)??e[0])?.version??0)},{immediate:!0});let o=J(()=>n.revisions.find(e=>e.version===i.value)),s=J(()=>o.value?.yaml??null),c=J(()=>s.value===null?[]:rce(s.value,n.current)),l=J(()=>s.value!==null&&s.value===n.current),u=J(()=>s.value===null?{}:k9(s.value,n.current, ` removed ` )),d=J(()=>s.value===null?{}:k9(n.current,s.value, ` added ` )),f={added: ` default ` ,edited: ` secondary ` ,removed: ` destructive ` };return(t,n)=>(I(),k( ` div ` ,ice,[L( ` ol ` ,{class:R(B(U)( ` min - h - 0 divide - y divide - border overflow - y - auto rounded - lg border border - border ` ,e.revisions.length&& ` max - md : hidden ` )),"aria-label": ` Revisions ` },[(I(!0),k(H,null,A(e.revisions,e=>(I(),k( ` li ` ,{key:e.version},[L( ` button ` ,{type: ` button ` ,class:R([ ` block w - full px - 3 py - 2 text - left hover : bg - secondary ` ,e.version===i.value&& ` bg - secondary ` ]),"aria-current":e.version===i.value,onClick:t=>i.value=e.version},[L( ` span ` ,oce,[L( ` span ` ,sce, ` v ` +z(e.version),1),O(B(w),{variant:f[e.change]},{default:F(()=>[V(z(e.change),1)]),_:2},1032,[ ` variant ` ])]),L( ` span ` ,{class: ` mt - 0.5 block truncate text - xs text - fg - muted ` ,title:e.at},[V(z(e.actor|| ` unknown ` )+ ` · ` +z(e.source|| ` unknown ` )+ ` · ` ,1),O(B(fC),{at:e.at},null,8,[ ` at ` ])],8,cce)],10,ace)]))),128)),e.revisions.length?P( ` ` ,!0):(I(),k( ` li ` ,lce,z(e.error|| ` No recorded changes ` ),1))],2),e.revisions.length?(I(),K(B(Rn),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:F(()=>[O(B(Fn),{class: ` w - full md : hidden ` ,"aria-label": ` Revision ` },{default:F(()=>[O(B(zn))]),_:1}),O(B(In),null,{default:F(()=>[(I(!0),k(H,null,A(e.revisions,e=>(I(),K(B(Pn),{key:e.version,value:String(e.version)},{default:F(()=>[V( ` v ` +z(e.version)+ ` · ` +z(e.change)+ ` · ` +z(e.actor|| ` unknown ` )+ ` · ` +z(B(JS)(e.at)),1)]),_:2},1032,[ ` value ` ]))),128))]),_:1})]),_:1},8,[ ` model - value ` ])):P( ` ` ,!0),o.value?(I(),k( ` div ` ,uce,[L( ` div ` ,dce,[O(B(dE),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:F(()=>[O(B(pE),null,{default:F(()=>[O(B(mE),{value: ` yaml ` },{default:F(()=>[...n[3]||=[V( ` YAML ` ,-1)]]),_:1}),O(B(mE),{value: ` canvas ` },{default:F(()=>[...n[4]||=[V( ` Canvas ` ,-1)]]),_:1})]),_:1})]),_:1},8,[ ` modelValue ` ]),O(B(Y),{type: ` button ` ,size: ` sm ` ,variant: ` outline ` ,class: ` ml - auto ` ,disabled:s.value===null||l.value,title:s.value===null? ` Workflow removed ` :void 0,onClick:n[2]||=e=>r( ` restore ` ,s.value)},{default:F(()=>[O(B(pl),{"data-icon": ` inline - start ` }),n[5]||=V( ` Restore this version ` ,-1)]),_:1},8,[ ` disabled ` , ` title ` ])]),s.value===null?(I(),k( ` p ` ,fce, ` Workflow removed in this revision . ` )):a.value=== ` yaml ` ?(I(),k( ` pre ` ,pce,[L( ` code ` ,null,[(I(!0),k(H,null,A(c.value,(e,t)=>(I(),k( ` span ` ,{key:t,class:R([ ` block min - h - 6 px - 3 whitespace - pre - wrap ` ,{"bg-o
Line truncated