refactor(ui): raw buttons, details and hr use Button, Collapsible and Separator
This commit is contained in:
1 parent
7c050eef14
commit
3ff6867e84
32 files changed
+138
-152
No files matched your search
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,Ct as n,D as r,M as i,S as a,Tt as o,Xt as s,_t as c,b as l,dt as u,ir as d,jn as f,k as p,l as m,t as h,x as g,xn as _,y as v}from"./PageHeader.js";import{A as y,F as b,I as x,ot as S,r as C}from"./createLucideIcon.js";import{t as w}from"./input.js";import{G as T,I as E,K as D,W as O,a as k,w as A,z as j}from"./index.js";var M={key:0,class:`text-fg-subtle`},N={key:1,role:`alert`,class:`mb-3 text-danger`},P={key:2,class:`mb-3 rounded-lg border border-border p-3`},F={key:3,class:`text-fg-subtle`},I={key:4,class:`divide-y divide-border`,"aria-label":`API tokens`},L={class:`flex-1 truncate text-xs`},R={class:`text-xs text-fg-subtle`},z=i({__name:`PersonalTokensCard`,setup(i){let o=_(!1),h=_([]),v=_(``),b=_(``),x=_(!1);async function S(e){x.value=!0;try{await e(),b.value=``}catch(e){b.value=String(e.message||e)}finally{x.value=!1}}let T=()=>S(async()=>{let e=await C.tokens();o.value=e?.available??!1,h.value=e?.tokens??[]}),D=()=>S(async()=>{v.value=(await C.createToken())?.token??``,await T()}),O=e=>S(async()=>{await C.revokeToken(e),await T()});return u(T),(i,u)=>(c(),g(f(A),{title:`API tokens`,description:o.value?`Send it as Authorization: Bearer <token>.`:void 0},r({default:s(()=>[!o.value&&!x.value&&!b.value?(c(),t(`p`,M,`Personal tokens need a signed-in person.`)):a(``,!0),b.value?(c(),t(`p`,N,d(b.value),1)):a(``,!0),v.value?(c(),t(`div`,P,[u[2]||=l(`p`,{class:`mb-2 text-xs`},`Not shown again.`,-1),e(f(w),{"model-value":v.value,readonly:``,"aria-label":`New token`,onFocus:u[0]||=e=>e.target.select()},null,8,[`model-value`])])):a(``,!0),o.value&&!h.value.length&&!x.value&&!b.value?(c(),t(`p`,F,`No tokens yet.`)):a(``,!0),h.value.length?(c(),t(`ul`,I,[(c(!0),t(m,null,n(h.value,n=>(c(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2`},[l(`code`,L,d(n.id.slice(0,12)),1),l(`span`,R,[e(f(E),{at:n.created_at},null,8,[`at`])]),e(f(y),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:x.value,onClick:e=>O(n.id)},{default:s(()=>[...u[3]||=[p(`Revoke`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):a(``,!0)]),_:2},[o.value?{name:`action`,fn:s(()=>[e(f(y),{size:`sm`,disabled:x.value,onClick:D},{default:s(()=>[e(f(j),{"data-icon":`inline-start`}),u[1]||=p(`New token`,-1)]),_:1},8,[`disabled`])]),key:`0`}:void 0]),1032,[`description`]))}}),B={class:`mx-auto max-w-[80ch]`},V={class:`text-sm text-fg-muted`},H={key:0,class:`mb-3 divide-y divide-border`},U={class:`min-w-0 flex-1 truncate`},W={key:2,class:`text-fg-muted`},G={key:0,class:`break-all rounded-md border border-border p-3 font-mono`,role:`status`},K={class:`flex justify-end border-t border-border pt-3`},q=i({__name:`AccountPage`,setup(r){let i=_(``),E=()=>J(async()=>{i.value=(await C.recoveryCode()).code}),j=T(),M=_([]),N=_(``),P=_(!1),F=_(``),I=_(``),L=_(``),R=v(()=>O(j.status?.public_url??``));async function q(){try{M.value=(await C.passkeys()).passkeys}catch(e){N.value=String(e.message||e)}}u(q);async function J(e){P.value=!0,N.value=``;try{await e()}catch(e){N.value=String(e.message||e)}finally{P.value=!1}}let Y=()=>J(async()=>{await D(!0,F.value),F.value=``,await q()}),X=e=>J(async()=>{await C.deletePasskey(e),await q()}),Z=()=>J(async()=>{await C.changePassword(I.value,L.value),I.value=L.value=``,window.location.assign(`/`)});return(r,u)=>{let _=o(`RouterLink`);return c(),t(`div`,B,[e(h,{title:`Your account`},{default:s(()=>[l(`span`,V,d(f(j).status?.user?.display_name),1)]),_:1}),r.$route.query.welcome?(c(),g(f(x),{key:0,class:`mb-4`},{default:s(()=>[u[5]||=p(`Your organisation and admin account are ready. Add a passkey below, `,-1),e(_,{class:`underline`,to:`/org/members`},{default:s(()=>[...u[3]||=[p(`add members`,-1)]]),_:1}),u[6]||=p(`, or `,-1),e(_,{class:`underline`,to:`/settings/authentication`},{default:s(()=>[...u[4]||=[p(`configure OIDC`,-1)]]),_:1}),u[7]||=p(`.`,-1)]),_:1})):a(``,!0),N.value?(c(),g(f(x),{key:1,variant:`destructive`,class:`mb-4`},{default:s(()=>[e(f(b),null,{default:s(()=>[p(d(N.value)+` `,1),u[8]||=l(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)]),_:1})]),_:1})):a(``,!0),e(f(A),{title:`Passkeys`},{default:s(()=>[M.value.length?(c(),t(`ul`,H,[(c(!0),t(m,null,n(M.value,n=>(c(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2`},[l(`span`,U,d(n.name),1),e(f(y),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:P.value,onClick:e=>X(n.id)},{default:s(()=>[...u[9]||=[p(`Remove`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):a(``,!0),R.value?(c(),t(`form`,{key:1,class:`flex flex-wrap gap-2`,onSubmit:S(Y,[`prevent`])},[e(f(w),{modelValue:F.value,"onUpdate:modelValue":u[0]||=e=>F.value=e,"aria-label":`Passkey name`,placeholder:`Passkey name (optional)`,maxlength:`200`,class:`min-w-40 flex-1`},null,8,[`modelValue`]),e(f(y),{type:`submit`,disabled:P.value},{default:s(()=>[...u[10]||=[p(`Add passkey`,-1)]]),_:1},8,[`disabled`])],32)):(c(),t(`p`,W,[u[12]||=p(`Passkeys need an HTTPS domain or localhost. Set the instance URL in `,-1),e(_,{class:`underline`,to:`/settings/authenticati
Line truncated
|
||||
import{A as e,C as t,Ct as n,D as r,M as i,S as a,Tt as o,Xt as s,_t as c,b as l,dt as u,ir as d,jn as f,k as p,l as m,t as h,x as g,xn as _,y as v}from"./PageHeader.js";import{A as y,N as b,j as x,ot as S,r as C}from"./createLucideIcon.js";import{t as w}from"./input.js";import{I as T,_t as E,c as D,dt as O,et as k,vt as A,yt as j}from"./index.js";var M={key:0,class:`text-fg-subtle`},N={key:1,role:`alert`,class:`mb-3 text-danger`},P={key:2,class:`mb-3 rounded-lg border border-border p-3`},F={key:3,class:`text-fg-subtle`},I={key:4,class:`divide-y divide-border`,"aria-label":`API tokens`},L={class:`flex-1 truncate text-xs`},R={class:`text-xs text-fg-subtle`},z=i({__name:`PersonalTokensCard`,setup(i){let o=_(!1),h=_([]),v=_(``),y=_(``),x=_(!1);async function S(e){x.value=!0;try{await e(),y.value=``}catch(e){y.value=String(e.message||e)}finally{x.value=!1}}let E=()=>S(async()=>{let e=await C.tokens();o.value=e?.available??!1,h.value=e?.tokens??[]}),D=()=>S(async()=>{v.value=(await C.createToken())?.token??``,await E()}),A=e=>S(async()=>{await C.revokeToken(e),await E()});return u(E),(i,u)=>(c(),g(f(T),{title:`API tokens`,description:o.value?`Send it as Authorization: Bearer <token>.`:void 0},r({default:s(()=>[!o.value&&!x.value&&!y.value?(c(),t(`p`,M,`Personal tokens need a signed-in person.`)):a(``,!0),y.value?(c(),t(`p`,N,d(y.value),1)):a(``,!0),v.value?(c(),t(`div`,P,[u[2]||=l(`p`,{class:`mb-2 text-xs`},`Not shown again.`,-1),e(f(w),{"model-value":v.value,readonly:``,"aria-label":`New token`,onFocus:u[0]||=e=>e.target.select()},null,8,[`model-value`])])):a(``,!0),o.value&&!h.value.length&&!x.value&&!y.value?(c(),t(`p`,F,`No tokens yet.`)):a(``,!0),h.value.length?(c(),t(`ul`,I,[(c(!0),t(m,null,n(h.value,n=>(c(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2`},[l(`code`,L,d(n.id.slice(0,12)),1),l(`span`,R,[e(f(k),{at:n.created_at},null,8,[`at`])]),e(f(b),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:x.value,onClick:e=>A(n.id)},{default:s(()=>[...u[3]||=[p(`Revoke`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):a(``,!0)]),_:2},[o.value?{name:`action`,fn:s(()=>[e(f(b),{size:`sm`,disabled:x.value,onClick:D},{default:s(()=>[e(f(O),{"data-icon":`inline-start`}),u[1]||=p(`New token`,-1)]),_:1},8,[`disabled`])]),key:`0`}:void 0]),1032,[`description`]))}}),B={class:`mx-auto max-w-[80ch]`},V={class:`text-sm text-fg-muted`},H={key:0,class:`mb-3 divide-y divide-border`},U={class:`min-w-0 flex-1 truncate`},W={key:2,class:`text-fg-muted`},G={key:0,class:`break-all rounded-md border border-border p-3 font-mono`,role:`status`},K={class:`flex justify-end border-t border-border pt-3`},q=i({__name:`AccountPage`,setup(r){let i=_(``),O=()=>J(async()=>{i.value=(await C.recoveryCode()).code}),k=A(),M=_([]),N=_(``),P=_(!1),F=_(``),I=_(``),L=_(``),R=v(()=>E(k.status?.public_url??``));async function q(){try{M.value=(await C.passkeys()).passkeys}catch(e){N.value=String(e.message||e)}}u(q);async function J(e){P.value=!0,N.value=``;try{await e()}catch(e){N.value=String(e.message||e)}finally{P.value=!1}}let Y=()=>J(async()=>{await j(!0,F.value),F.value=``,await q()}),X=e=>J(async()=>{await C.deletePasskey(e),await q()}),Z=()=>J(async()=>{await C.changePassword(I.value,L.value),I.value=L.value=``,window.location.assign(`/`)});return(r,u)=>{let _=o(`RouterLink`);return c(),t(`div`,B,[e(h,{title:`Your account`},{default:s(()=>[l(`span`,V,d(f(k).status?.user?.display_name),1)]),_:1}),r.$route.query.welcome?(c(),g(f(x),{key:0,class:`mb-4`},{default:s(()=>[u[5]||=p(`Your organisation and admin account are ready. Add a passkey below, `,-1),e(_,{class:`underline`,to:`/org/members`},{default:s(()=>[...u[3]||=[p(`add members`,-1)]]),_:1}),u[6]||=p(`, or `,-1),e(_,{class:`underline`,to:`/settings/authentication`},{default:s(()=>[...u[4]||=[p(`configure OIDC`,-1)]]),_:1}),u[7]||=p(`.`,-1)]),_:1})):a(``,!0),N.value?(c(),g(f(x),{key:1,variant:`destructive`,class:`mb-4`},{default:s(()=>[e(f(y),null,{default:s(()=>[p(d(N.value)+` `,1),u[8]||=l(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)]),_:1})]),_:1})):a(``,!0),e(f(T),{title:`Passkeys`},{default:s(()=>[M.value.length?(c(),t(`ul`,H,[(c(!0),t(m,null,n(M.value,n=>(c(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2`},[l(`span`,U,d(n.name),1),e(f(b),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:P.value,onClick:e=>X(n.id)},{default:s(()=>[...u[9]||=[p(`Remove`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):a(``,!0),R.value?(c(),t(`form`,{key:1,class:`flex flex-wrap gap-2`,onSubmit:S(Y,[`prevent`])},[e(f(w),{modelValue:F.value,"onUpdate:modelValue":u[0]||=e=>F.value=e,"aria-label":`Passkey name`,placeholder:`Passkey name (optional)`,maxlength:`200`,class:`min-w-40 flex-1`},null,8,[`modelValue`]),e(f(b),{type:`submit`,disabled:P.value},{default:s(()=>[...u[10]||=[p(`Add passkey`,-1)]]),_:1},8,[`disabled`])],32)):(c(),t(`p`,W,[u[12]||=p(`Passkeys need an HTTPS domain or localhost. Set the instance URL in `,-1),e(_,{class:`underline`,to:`/settings/authent
Line truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{A as h,F as g,I as _,ot as v}from"./createLucideIcon.js";import{n as y,o as b,t as x}from"./HistoryLink.js";import{t as S}from"./input.js";import{F as C,M as w,N as T,P as E,S as D,_ as O,j as k,o as A,y as j}from"./index.js";var M={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},N={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},P={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},F={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},I=`agent-profiles`,L=n({__name:`AgentProfilesPage`,setup(n){let L=b();s(L.load);let R=m(()=>L.draftValue(I)),z=p(``),B=p(``),V=m(()=>L.changesFor(I).length>0),H=m(()=>Object.entries(R.value??{}));function U(){if(V.value||!L.formFor(I))return;let e=z.value.trim();e&&!R.value?.[e]&&(L.setDraftEntry(I,e,{image:``,kit:``,adapter:``,tools:[]}),B.value=String(H.value.findIndex(([t])=>t===e)),z.value=``)}function W(e){let t=H.value[e]?.[0];t&&L.setDraftEntry(I,t,void 0)}function G(e,t){L.setDraftEntry(I,e,{...R.value?.[e],...t})}function K(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Agent profiles`},{default:i(()=>[e(x,{kinds:[I]},null,8,[`kinds`])]),_:1}),e(y,{kind:I,class:`mb-4`}),l(L).catalogError||l(L).pageErrorFor(I)?(a(),f(l(_),{key:0,variant:`destructive`,class:`mb-4`},{default:i(()=>[e(l(g),null,{default:i(()=>[u(c(l(L).catalogError||l(L).pageErrorFor(I)),1)]),_:1})]),_:1})):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:v(U,[`prevent`])},[e(l(S),{modelValue:z.value,"onUpdate:modelValue":s[0]||=e=>z.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`,disabled:V.value},null,8,[`modelValue`,`disabled`]),e(l(h),{type:`submit`,disabled:V.value||!z.value.trim()||!!R.value?.[z.value.trim()]},{default:i(()=>[...s[2]||=[u(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(R.value??{}).length?r(``,!0):(a(),f(l(D),{key:1},{default:i(()=>[e(l(j),null,{default:i(()=>[e(l(O),null,{default:i(()=>[...s[3]||=[u(`No agent profiles`,-1)]]),_:1})]),_:1})]),_:1})),e(A,{open:B.value,"onUpdate:open":s[1]||=e=>B.value=e,items:H.value,title:([e])=>e,"remove-label":`Remove`,mono:``,onRemove:W},{default:i(({item:[t,n]})=>[e(l(w),{class:`@container/field-group`},{default:i(()=>[e(l(C),{orientation:`responsive`},{default:i(()=>[e(l(E),null,{default:i(()=>[e(l(k),{for:`${t}-image`},{default:i(()=>[...s[4]||=[u(`Image`,-1)]]),_:1},8,[`for`])]),_:2},1024),o(`div`,M,[e(l(S),{id:`${t}-image`,"model-value":n.image,placeholder:`Container image`,"onUpdate:modelValue":e=>G(t,{image:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(C),{orientation:`responsive`},{default:i(()=>[e(l(E),null,{default:i(()=>[e(l(k),{for:`${t}-kit`},{default:i(()=>[...s[5]||=[u(`Kit`,-1)]]),_:1},8,[`for`]),e(l(T),null,{default:i(()=>[...s[6]||=[u(`Pinned digest. Used only when Image is empty.`,-1)]]),_:1})]),_:2},1024),o(`div`,N,[e(l(S),{id:`${t}-kit`,"model-value":n.kit,placeholder:`registry/kit@sha256:…`,"onUpdate:modelValue":e=>G(t,{kit:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(C),{orientation:`responsive`},{default:i(()=>[e(l(E),null,{default:i(()=>[e(l(k),{for:`${t}-adapter`},{default:i(()=>[...s[7]||=[u(`Adapter`,-1)]]),_:1},8,[`for`])]),_:2},1024),o(`div`,P,[e(l(S),{id:`${t}-adapter`,"model-value":n.adapter,"onUpdate:modelValue":e=>G(t,{adapter:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(C),{orientation:`responsive`},{default:i(()=>[e(l(E),null,{default:i(()=>[e(l(k),{for:`${t}-tools`},{default:i(()=>[...s[8]||=[u(`Tools`,-1)]]),_:1},8,[`for`]),e(l(T),null,{default:i(()=>[...s[9]||=[u(`Comma-separated tool names.`,-1)]]),_:1})]),_:2},1024),o(`div`,F,[e(l(S),{id:`${t}-tools`,"model-value":(n.tools??[]).join(`, `),onChange:e=>G(t,{tools:K(e.target.value)})},null,8,[`id`,`model-value`,`onChange`])])]),_:2},1024)]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{L as default};
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{A as h,N as g,j as _,ot as v}from"./createLucideIcon.js";import{t as y}from"./input.js";import{$ as b,G as x,J as S,K as C,P as w,U as T,X as E,Z as D,j as O,k,l as A,q as j}from"./index.js";var M={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},N={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},P={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},F={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},I=`agent-profiles`,L=n({__name:`AgentProfilesPage`,setup(n){let L=b();s(L.load);let R=m(()=>L.draftValue(I)),z=p(``),B=p(``),V=m(()=>L.changesFor(I).length>0),H=m(()=>Object.entries(R.value??{}));function U(){if(V.value||!L.formFor(I))return;let e=z.value.trim();e&&!R.value?.[e]&&(L.setDraftEntry(I,e,{image:``,kit:``,adapter:``,tools:[]}),B.value=String(H.value.findIndex(([t])=>t===e)),z.value=``)}function W(e){let t=H.value[e]?.[0];t&&L.setDraftEntry(I,t,void 0)}function G(e,t){L.setDraftEntry(I,e,{...R.value?.[e],...t})}function K(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Agent profiles`},{default:i(()=>[e(E,{kinds:[I]},null,8,[`kinds`])]),_:1}),e(D,{kind:I,class:`mb-4`}),l(L).catalogError||l(L).pageErrorFor(I)?(a(),f(l(_),{key:0,variant:`destructive`,class:`mb-4`},{default:i(()=>[e(l(h),null,{default:i(()=>[u(c(l(L).catalogError||l(L).pageErrorFor(I)),1)]),_:1})]),_:1})):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:v(U,[`prevent`])},[e(l(y),{modelValue:z.value,"onUpdate:modelValue":s[0]||=e=>z.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`,disabled:V.value},null,8,[`modelValue`,`disabled`]),e(l(g),{type:`submit`,disabled:V.value||!z.value.trim()||!!R.value?.[z.value.trim()]},{default:i(()=>[...s[2]||=[u(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(R.value??{}).length?r(``,!0):(a(),f(l(w),{key:1},{default:i(()=>[e(l(O),null,{default:i(()=>[e(l(k),null,{default:i(()=>[...s[3]||=[u(`No agent profiles`,-1)]]),_:1})]),_:1})]),_:1})),e(A,{open:B.value,"onUpdate:open":s[1]||=e=>B.value=e,items:H.value,title:([e])=>e,"remove-label":`Remove`,mono:``,onRemove:W},{default:i(({item:[t,n]})=>[e(l(x),{class:`@container/field-group`},{default:i(()=>[e(l(S),{orientation:`responsive`},{default:i(()=>[e(l(j),null,{default:i(()=>[e(l(T),{for:`${t}-image`},{default:i(()=>[...s[4]||=[u(`Image`,-1)]]),_:1},8,[`for`])]),_:2},1024),o(`div`,M,[e(l(y),{id:`${t}-image`,"model-value":n.image,placeholder:`Container image`,"onUpdate:modelValue":e=>G(t,{image:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(S),{orientation:`responsive`},{default:i(()=>[e(l(j),null,{default:i(()=>[e(l(T),{for:`${t}-kit`},{default:i(()=>[...s[5]||=[u(`Kit`,-1)]]),_:1},8,[`for`]),e(l(C),null,{default:i(()=>[...s[6]||=[u(`Pinned digest. Used only when Image is empty.`,-1)]]),_:1})]),_:2},1024),o(`div`,N,[e(l(y),{id:`${t}-kit`,"model-value":n.kit,placeholder:`registry/kit@sha256:…`,"onUpdate:modelValue":e=>G(t,{kit:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(S),{orientation:`responsive`},{default:i(()=>[e(l(j),null,{default:i(()=>[e(l(T),{for:`${t}-adapter`},{default:i(()=>[...s[7]||=[u(`Adapter`,-1)]]),_:1},8,[`for`])]),_:2},1024),o(`div`,P,[e(l(y),{id:`${t}-adapter`,"model-value":n.adapter,"onUpdate:modelValue":e=>G(t,{adapter:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(S),{orientation:`responsive`},{default:i(()=>[e(l(j),null,{default:i(()=>[e(l(T),{for:`${t}-tools`},{default:i(()=>[...s[8]||=[u(`Tools`,-1)]]),_:1},8,[`for`]),e(l(C),null,{default:i(()=>[...s[9]||=[u(`Comma-separated tool names.`,-1)]]),_:1})]),_:2},1024),o(`div`,F,[e(l(y),{id:`${t}-tools`,"model-value":(n.tools??[]).join(`, `),onChange:e=>G(t,{tools:K(e.target.value)})},null,8,[`id`,`model-value`,`onChange`])])]),_:2},1024)]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{L as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{A as h,F as g,I as _,ot as v,r as y}from"./createLucideIcon.js";import{t as b}from"./input.js";import{t as x}from"./check.js";import{V as S,a as C,w}from"./index.js";var T={class:`flex items-center gap-2`},E={class:`min-w-0 flex-1 select-all break-all rounded-md border border-border bg-muted px-2 py-1.5 font-mono text-xs`},D={class:`flex items-center justify-end gap-2 border-t border-border pt-3`},O=n({__name:`AuthenticationPage`,setup(n){let O=p({public_url:``,oidc_issuer:``,oidc_audience:``,oidc_client_id:``}),k=p(!1),A=p(``),j=p(!1),M=p(!1);s(async()=>{try{O.value=await y.authentication(),k.value=!0}catch(e){A.value=String(e.message||e)}});let N=m(()=>`${O.value.public_url.replace(/\/$/,``)}/oauth2/callback`),P=p(!1);async function F(){await navigator.clipboard.writeText(N.value),P.value=!0,setTimeout(()=>P.value=!1,1500)}async function I(){j.value=!0,A.value=``,M.value=!1;try{await y.saveAuthentication(O.value),M.value=!0}catch(e){A.value=String(e.message||e)}finally{j.value=!1}}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Authentication`}),A.value?(a(),f(l(_),{key:0,variant:`destructive`,class:`mb-4`},{default:i(()=>[e(l(g),null,{default:i(()=>[u(c(A.value)+` `,1),s[4]||=o(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)]),_:1})]),_:1})):r(``,!0),k.value?(a(),t(`form`,{key:1,onSubmit:v(I,[`prevent`])},[e(l(w),{title:`Instance URL`},{default:i(()=>[e(l(C),{label:`Public address`,for:`instance-url`,hint:`Passkeys require HTTPS and a domain name, or localhost. Once passkeys are enrolled, their domain is fixed.`},{default:i(()=>[e(l(b),{id:`instance-url`,modelValue:O.value.public_url,"onUpdate:modelValue":s[0]||=e=>O.value.public_url=e,type:`url`,required:``},null,8,[`modelValue`])]),_:1})]),_:1}),e(l(w),{title:`OpenID Connect`},{default:i(()=>[e(l(C),{label:`Issuer URL`,for:`oidc-issuer`},{default:i(()=>[e(l(b),{id:`oidc-issuer`,modelValue:O.value.oidc_issuer,"onUpdate:modelValue":s[1]||=e=>O.value.oidc_issuer=e,type:`url`,placeholder:`https://identity.example.com`},null,8,[`modelValue`])]),_:1}),e(l(C),{label:`Client ID`,for:`oidc-client`},{default:i(()=>[e(l(b),{id:`oidc-client`,modelValue:O.value.oidc_client_id,"onUpdate:modelValue":s[2]||=e=>O.value.oidc_client_id=e},null,8,[`modelValue`])]),_:1}),e(l(C),{label:`Access token audience`,for:`oidc-audience`},{default:i(()=>[e(l(b),{id:`oidc-audience`,modelValue:O.value.oidc_audience,"onUpdate:modelValue":s[3]||=e=>O.value.oidc_audience=e},null,8,[`modelValue`])]),_:1}),e(l(C),{label:`Redirect URI`,hint:`Add permitted people in Organisation → Members.`},{default:i(()=>[o(`div`,T,[o(`code`,E,c(N.value),1),e(l(h),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy redirect URI`,title:`Copy redirect URI`,onClick:F},{default:i(()=>[P.value?(a(),f(l(x),{key:0})):(a(),f(l(S),{key:1}))]),_:1})])]),_:1}),o(`div`,D,[M.value?(a(),f(l(x),{key:0,role:`status`,"aria-label":`Saved`,class:`size-4 text-fg-muted`})):r(``,!0),e(l(h),{type:`submit`,disabled:j.value},{default:i(()=>[...s[5]||=[u(`Save`,-1)]]),_:1},8,[`disabled`])])]),_:1})],32)):r(``,!0)]))}});export{O as default};
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{A as h,N as g,j as _,ot as v,r as y}from"./createLucideIcon.js";import{t as b}from"./input.js";import{I as x,c as S,mt as C,pt as w}from"./index.js";var T={class:`flex items-center gap-2`},E={class:`min-w-0 flex-1 select-all break-all rounded-md border border-border bg-muted px-2 py-1.5 font-mono text-xs`},D={class:`flex items-center justify-end gap-2 border-t border-border pt-3`},O=n({__name:`AuthenticationPage`,setup(n){let O=p({public_url:``,oidc_issuer:``,oidc_audience:``,oidc_client_id:``}),k=p(!1),A=p(``),j=p(!1),M=p(!1);s(async()=>{try{O.value=await y.authentication(),k.value=!0}catch(e){A.value=String(e.message||e)}});let N=m(()=>`${O.value.public_url.replace(/\/$/,``)}/oauth2/callback`),P=p(!1);async function F(){await navigator.clipboard.writeText(N.value),P.value=!0,setTimeout(()=>P.value=!1,1500)}async function I(){j.value=!0,A.value=``,M.value=!1;try{await y.saveAuthentication(O.value),M.value=!0}catch(e){A.value=String(e.message||e)}finally{j.value=!1}}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Authentication`}),A.value?(a(),f(l(_),{key:0,variant:`destructive`,class:`mb-4`},{default:i(()=>[e(l(h),null,{default:i(()=>[u(c(A.value)+` `,1),s[4]||=o(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)]),_:1})]),_:1})):r(``,!0),k.value?(a(),t(`form`,{key:1,onSubmit:v(I,[`prevent`])},[e(l(x),{title:`Instance URL`},{default:i(()=>[e(l(S),{label:`Public address`,for:`instance-url`,hint:`Passkeys require HTTPS and a domain name, or localhost. Once passkeys are enrolled, their domain is fixed.`},{default:i(()=>[e(l(b),{id:`instance-url`,modelValue:O.value.public_url,"onUpdate:modelValue":s[0]||=e=>O.value.public_url=e,type:`url`,required:``},null,8,[`modelValue`])]),_:1})]),_:1}),e(l(x),{title:`OpenID Connect`},{default:i(()=>[e(l(S),{label:`Issuer URL`,for:`oidc-issuer`},{default:i(()=>[e(l(b),{id:`oidc-issuer`,modelValue:O.value.oidc_issuer,"onUpdate:modelValue":s[1]||=e=>O.value.oidc_issuer=e,type:`url`,placeholder:`https://identity.example.com`},null,8,[`modelValue`])]),_:1}),e(l(S),{label:`Client ID`,for:`oidc-client`},{default:i(()=>[e(l(b),{id:`oidc-client`,modelValue:O.value.oidc_client_id,"onUpdate:modelValue":s[2]||=e=>O.value.oidc_client_id=e},null,8,[`modelValue`])]),_:1}),e(l(S),{label:`Access token audience`,for:`oidc-audience`},{default:i(()=>[e(l(b),{id:`oidc-audience`,modelValue:O.value.oidc_audience,"onUpdate:modelValue":s[3]||=e=>O.value.oidc_audience=e},null,8,[`modelValue`])]),_:1}),e(l(S),{label:`Redirect URI`,hint:`Add permitted people in Organisation → Members.`},{default:i(()=>[o(`div`,T,[o(`code`,E,c(N.value),1),e(l(g),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy redirect URI`,title:`Copy redirect URI`,onClick:F},{default:i(()=>[P.value?(a(),f(l(C),{key:0})):(a(),f(l(w),{key:1}))]),_:1})])]),_:1}),o(`div`,D,[M.value?(a(),f(l(C),{key:0,role:`status`,"aria-label":`Saved`,class:`size-4 text-fg-muted`})):r(``,!0),e(l(g),{type:`submit`,disabled:j.value},{default:i(()=>[...s[5]||=[u(`Save`,-1)]]),_:1},8,[`disabled`])])]),_:1})],32)):r(``,!0)]))}});export{O as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{I as e,M as t,S as n}from"./badge.js";import{Gt as r,Kt as i,M as a,U as o,Z as s,hn as c,xn as l,y as u,yt as d}from"./PageHeader.js";import{M as f}from"./createLucideIcon.js";function p(n){let r=t(``,1e3);return{search:r,handleTypeaheadSearch:(t,i)=>{if(r.value+=t,n)n(t);else{let t=e(),n=i.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),a=n.find(e=>e.ref===t),o=h(n.map(e=>e.textValue),r.value,a?.textValue),s=n.find(e=>e.textValue===o);return s&&s.ref.focus(),s?.ref}},resetTypeahead:()=>{r.value=``}}}function m(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function h(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=m(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function g(){let e=l();return{primitiveElement:e,currentElement:u(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:n(e))}}var _=`menu.itemSelect`,v=[`Enter`,` `],y=[`ArrowDown`,`PageUp`,`Home`],b=[`ArrowUp`,`PageDown`,`End`],x=[...y,...b],S={ltr:[...v,`ArrowRight`],rtl:[...v,`ArrowLeft`]},C={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]};function w(e){return e?`open`:`closed`}function T(e){return e===`indeterminate`}function E(e){return T(e)?`indeterminate`:e?`checked`:`unchecked`}function D(e){let{onEntryFocus:t,onEntryFocusOnce:n,...r}=e;return r}function O(t){let n=e();for(let r of t)if(r===n||(r.focus(),e()!==n))return}function k(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function A(e,t){return t?k({x:e.clientX,y:e.clientY},t):!1}function j(e){return e.pointerType===`mouse`}var M=`data-reka-collection-item`;function N(e={}){let{key:t=``,isProvider:n=!1}=e,p=`${t}CollectionProvider`,m;if(n){let e=l(new Map);m={collectionRef:l(),itemMap:e},d(p,m)}else m=s(p);let h=(e,t=!1)=>{if(!m.collectionRef.value)return;let n=m.itemMap.value.get(e);return n&&(t||n.ref.dataset.disabled!==``)?n:void 0},_=(e=!1)=>{let t=m.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${M}]`)),r=new Map(n.map((e,t)=>[e,t])),i=Array.from(m.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?i:i.filter(e=>e.ref.dataset.disabled!==``)},v=a({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:i,currentElement:a}=g();return r(a,()=>{m.collectionRef.value=a.value}),()=>o(f,{ref:i,...n},t)}}),y=a({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=g();return i(t=>{if(a.value){let n=c(a.value);m.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>m.itemMap.value.delete(n))}}),()=>o(f,{...n,[M]:``,ref:r},t)}});return{getItems:_,getItem:h,reactiveItems:u(()=>Array.from(m.itemMap.value.values())),itemMapSize:u(()=>m.itemMap.value.size),CollectionSlot:v,CollectionItem:y}}export{m as _,v as a,O as c,T as d,j as f,p as g,g as h,b as i,E as l,D as m,x as n,C as o,A as p,_ as r,S as s,N as t,w as u};
|
||||
import{I as e,M as t,S as n}from"./badge.js";import{Gt as r,Kt as i,M as a,U as o,Z as s,hn as c,xn as l,y as u,yt as d}from"./PageHeader.js";import{F as f}from"./createLucideIcon.js";function p(n){let r=t(``,1e3);return{search:r,handleTypeaheadSearch:(t,i)=>{if(r.value+=t,n)n(t);else{let t=e(),n=i.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),a=n.find(e=>e.ref===t),o=h(n.map(e=>e.textValue),r.value,a?.textValue),s=n.find(e=>e.textValue===o);return s&&s.ref.focus(),s?.ref}},resetTypeahead:()=>{r.value=``}}}function m(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function h(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=m(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function g(){let e=l();return{primitiveElement:e,currentElement:u(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:n(e))}}var _=`menu.itemSelect`,v=[`Enter`,` `],y=[`ArrowDown`,`PageUp`,`Home`],b=[`ArrowUp`,`PageDown`,`End`],x=[...y,...b],S={ltr:[...v,`ArrowRight`],rtl:[...v,`ArrowLeft`]},C={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]};function w(e){return e?`open`:`closed`}function T(e){return e===`indeterminate`}function E(e){return T(e)?`indeterminate`:e?`checked`:`unchecked`}function D(e){let{onEntryFocus:t,onEntryFocusOnce:n,...r}=e;return r}function O(t){let n=e();for(let r of t)if(r===n||(r.focus(),e()!==n))return}function k(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function A(e,t){return t?k({x:e.clientX,y:e.clientY},t):!1}function j(e){return e.pointerType===`mouse`}var M=`data-reka-collection-item`;function N(e={}){let{key:t=``,isProvider:n=!1}=e,p=`${t}CollectionProvider`,m;if(n){let e=l(new Map);m={collectionRef:l(),itemMap:e},d(p,m)}else m=s(p);let h=(e,t=!1)=>{if(!m.collectionRef.value)return;let n=m.itemMap.value.get(e);return n&&(t||n.ref.dataset.disabled!==``)?n:void 0},_=(e=!1)=>{let t=m.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${M}]`)),r=new Map(n.map((e,t)=>[e,t])),i=Array.from(m.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?i:i.filter(e=>e.ref.dataset.disabled!==``)},v=a({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:i,currentElement:a}=g();return r(a,()=>{m.collectionRef.value=a.value}),()=>o(f,{ref:i,...n},t)}}),y=a({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=g();return i(t=>{if(a.value){let n=c(a.value);m.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>m.itemMap.value.delete(n))}}),()=>o(f,{...n,[M]:``,ref:r},t)}});return{getItems:_,getItem:h,reactiveItems:u(()=>Array.from(m.itemMap.value.values())),itemMapSize:u(()=>m.itemMap.value.size),CollectionSlot:v,CollectionItem:y}}export{m as _,v as a,O as c,T as d,j as f,p as g,g as h,b as i,E as l,D as m,x as n,C as o,A as p,_ as r,S as s,N as t,w as u};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{A as h,F as g,I as _}from"./createLucideIcon.js";import{n as v,o as y,t as b}from"./HistoryLink.js";import{t as x}from"./input.js";import{C as S,F as C,M as w,N as T,P as E,S as D,_ as O,j as k,o as A,y as j}from"./index.js";var M={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},N={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},P={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},F=`credential-bindings`,I=n({__name:`CredentialBindingsPage`,setup(n){let I=y();s(I.load);let L=m(()=>I.draftValue(F)),R=p(``),z=m(()=>I.changesFor(F).length>0);function B(){if(z.value||!I.formFor(F))return;let e=L.value??[];I.setDraftValue(F,[...e,{service:``,org:``,secret:{engine:``,key:``}}]),R.value=String(e.length)}function V(e){I.setDraftValue(F,(L.value??[]).filter((t,n)=>n!==e))}function H(e,t){I.setDraftValue(F,(L.value??[]).map((n,r)=>r===e?{...n,...t}:n))}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Credential bindings`},{default:i(()=>[e(b,{kinds:[F]},null,8,[`kinds`]),e(l(h),{disabled:z.value,onClick:B},{default:i(()=>[...s[1]||=[u(`Add binding`,-1)]]),_:1},8,[`disabled`])]),_:1}),e(v,{kind:F,class:`mb-4`}),l(I).catalogError||l(I).pageErrorFor(F)?(a(),f(l(_),{key:0,variant:`destructive`,class:`mb-4`},{default:i(()=>[e(l(g),null,{default:i(()=>[u(c(l(I).catalogError||l(I).pageErrorFor(F)),1)]),_:1})]),_:1})):r(``,!0),L.value?.length?r(``,!0):(a(),f(l(D),{key:1},{default:i(()=>[e(l(j),null,{default:i(()=>[e(l(O),null,{default:i(()=>[...s[2]||=[u(`No credential bindings`,-1)]]),_:1})]),_:1})]),_:1})),e(A,{open:R.value,"onUpdate:open":s[0]||=e=>R.value=e,items:L.value??[],title:e=>e.service||`New binding`,"remove-label":`Remove`,mono:``,onRemove:V},{default:i(({item:t,index:n})=>[e(l(w),{class:`@container/field-group`},{default:i(()=>[e(l(C),{orientation:`responsive`},{default:i(()=>[e(l(E),null,{default:i(()=>[e(l(k),{for:`binding-${n}-service`},{default:i(()=>[...s[3]||=[u(`Service`,-1)]]),_:1},8,[`for`])]),_:2},1024),o(`div`,M,[e(l(x),{id:`binding-${n}-service`,"model-value":t.service,"onUpdate:modelValue":e=>H(n,{service:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(C),{orientation:`responsive`},{default:i(()=>[e(l(E),null,{default:i(()=>[e(l(k),{for:`binding-${n}-org`},{default:i(()=>[...s[4]||=[u(`Organisation`,-1)]]),_:1},8,[`for`]),e(l(T),null,{default:i(()=>[...s[5]||=[u(`Empty uses the default organisation.`,-1)]]),_:1})]),_:2},1024),o(`div`,N,[e(l(x),{id:`binding-${n}-org`,"model-value":t.org,"onUpdate:modelValue":e=>H(n,{org:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(C),{orientation:`responsive`},{default:i(()=>[e(l(E),null,{default:i(()=>[e(l(k),null,{default:i(()=>[...s[6]||=[u(`Secret`,-1)]]),_:1})]),_:1}),o(`div`,P,[e(S,{"model-value":t.secret,"id-prefix":`binding-${n}-secret`,"onUpdate:modelValue":e=>H(n,{secret:e})},null,8,[`model-value`,`id-prefix`,`onUpdate:modelValue`])])]),_:2},1024)]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{I as default};
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{A as h,N as g,j as _}from"./createLucideIcon.js";import{t as v}from"./input.js";import{$ as y,F as b,G as x,J as S,K as C,P as w,U as T,X as E,Z as D,j as O,k,l as A,q as j}from"./index.js";var M={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},N={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},P={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},F=`credential-bindings`,I=n({__name:`CredentialBindingsPage`,setup(n){let I=y();s(I.load);let L=m(()=>I.draftValue(F)),R=p(``),z=m(()=>I.changesFor(F).length>0);function B(){if(z.value||!I.formFor(F))return;let e=L.value??[];I.setDraftValue(F,[...e,{service:``,org:``,secret:{engine:``,key:``}}]),R.value=String(e.length)}function V(e){I.setDraftValue(F,(L.value??[]).filter((t,n)=>n!==e))}function H(e,t){I.setDraftValue(F,(L.value??[]).map((n,r)=>r===e?{...n,...t}:n))}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Credential bindings`},{default:i(()=>[e(E,{kinds:[F]},null,8,[`kinds`]),e(l(g),{disabled:z.value,onClick:B},{default:i(()=>[...s[1]||=[u(`Add binding`,-1)]]),_:1},8,[`disabled`])]),_:1}),e(D,{kind:F,class:`mb-4`}),l(I).catalogError||l(I).pageErrorFor(F)?(a(),f(l(_),{key:0,variant:`destructive`,class:`mb-4`},{default:i(()=>[e(l(h),null,{default:i(()=>[u(c(l(I).catalogError||l(I).pageErrorFor(F)),1)]),_:1})]),_:1})):r(``,!0),L.value?.length?r(``,!0):(a(),f(l(w),{key:1},{default:i(()=>[e(l(O),null,{default:i(()=>[e(l(k),null,{default:i(()=>[...s[2]||=[u(`No credential bindings`,-1)]]),_:1})]),_:1})]),_:1})),e(A,{open:R.value,"onUpdate:open":s[0]||=e=>R.value=e,items:L.value??[],title:e=>e.service||`New binding`,"remove-label":`Remove`,mono:``,onRemove:V},{default:i(({item:t,index:n})=>[e(l(x),{class:`@container/field-group`},{default:i(()=>[e(l(S),{orientation:`responsive`},{default:i(()=>[e(l(j),null,{default:i(()=>[e(l(T),{for:`binding-${n}-service`},{default:i(()=>[...s[3]||=[u(`Service`,-1)]]),_:1},8,[`for`])]),_:2},1024),o(`div`,M,[e(l(v),{id:`binding-${n}-service`,"model-value":t.service,"onUpdate:modelValue":e=>H(n,{service:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(S),{orientation:`responsive`},{default:i(()=>[e(l(j),null,{default:i(()=>[e(l(T),{for:`binding-${n}-org`},{default:i(()=>[...s[4]||=[u(`Organisation`,-1)]]),_:1},8,[`for`]),e(l(C),null,{default:i(()=>[...s[5]||=[u(`Empty uses the default organisation.`,-1)]]),_:1})]),_:2},1024),o(`div`,N,[e(l(v),{id:`binding-${n}-org`,"model-value":t.org,"onUpdate:modelValue":e=>H(n,{org:String(e)})},null,8,[`id`,`model-value`,`onUpdate:modelValue`])])]),_:2},1024),e(l(S),{orientation:`responsive`},{default:i(()=>[e(l(j),null,{default:i(()=>[e(l(T),null,{default:i(()=>[...s[6]||=[u(`Secret`,-1)]]),_:1})]),_:1}),o(`div`,P,[e(b,{"model-value":t.secret,"id-prefix":`binding-${n}-secret`,"onUpdate:modelValue":e=>H(n,{secret:e})},null,8,[`model-value`,`id-prefix`,`onUpdate:modelValue`])])]),_:2},1024)]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{I as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{t as e}from"./badge.js";import{A as t,C as n,Ct as r,M as i,S as a,Xt as o,_t as s,b as c,dt as l,ir as u,jn as d,k as f,l as p,st as m,t as h,x as g,xn as _}from"./PageHeader.js";import{A as v,F as y,I as b,P as x,n as S,r as C}from"./createLucideIcon.js";import{a as w,i as T,n as E,o as D,s as O,t as k}from"./select.js";import{t as A}from"./label.js";import{a as j,i as M,n as N,o as ee,r as P,s as F,t as I}from"./table.js";import{I as L,S as R,_ as z,n as B,r as V,w as H,y as U}from"./index.js";function W(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function G(e,t,n=80,r=24){let i=t.protocol===`https:`?`wss:`:`ws:`,a=new URLSearchParams({profile:e,cols:String(n),rows:String(r)}).toString();return`${i}//${t.host}/api/harness/terminal?${a}`}var K={class:`flex h-full min-h-0 flex-col gap-2`},q={key:0,class:`text-sm text-fg-muted`,role:`status`},J=i({__name:`SetupTerminal`,props:{profile:{}},setup(e){let t=e,r=_(null),i=_(`connecting`),o=null,u=null,d=null,h=null;function g(){try{d?.fit()}catch{}}return l(()=>{let e=r.value;if(!e)return;o=new V({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),d=new B,o.loadAddon(d),o.open(e),g(),o.focus();let n=new WebSocket(G(t.profile,window.location,o?.cols??80,o?.rows??24));u=n,n.binaryType=`arraybuffer`,n.onopen=()=>{i.value=`open`},n.onmessage=e=>{o&&(typeof e.data==`string`?o.write(e.data):o.write(new Uint8Array(e.data)))},n.onerror=()=>{i.value=`failed`},n.onclose=()=>{i.value=`closed`},o.onData(e=>{n.readyState===WebSocket.OPEN&&n.send(e)}),h=new ResizeObserver(g),h.observe(e)}),m(()=>{h?.disconnect(),h=null,u?.close(),u=null,o?.dispose(),o=null,d=null}),(e,t)=>(s(),n(`div`,K,[i.value===`open`?a(``,!0):(s(),n(`p`,q,[i.value===`connecting`?(s(),n(p,{key:0},[f(`Connecting…`)],64)):i.value===`closed`?(s(),n(p,{key:1},[f(`The terminal session ended.`)],64)):(s(),n(p,{key:2},[f(`Could not open the setup terminal.`)],64))])),c(`div`,{ref_key:`host`,ref:r,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Y={key:1,class:`flex flex-col gap-2`},X={class:`flex flex-wrap items-end gap-3`},Z={class:`flex flex-col gap-1 text-sm`},Q={class:`h-96`},$=i({__name:`HarnessPage`,setup(i){let m=_(null),B=_(!0),V=_(null),G=_(!1),K=_(``),q=_(!1),$={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};l(te);async function te(){B.value=!0,V.value=null,G.value=!1;try{let e=await C.harnessBindings();m.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},K.value=m.value.profiles[0]??``}catch(e){let t=e instanceof S?e.status:void 0;t===501||t===503?G.value=!0:V.value=e instanceof Error?e.message:String(e),m.value=null}finally{B.value=!1}}function ne(){m.value?.terminal&&K.value&&(q.value=!0)}function re(e){return e.scopes?.length?e.scopes.join(`, `):`–`}return(i,l)=>(s(),n(`div`,null,[t(h,{title:`Harness`}),V.value?(s(),g(d(b),{key:0,variant:`destructive`,class:`mb-4`},{default:o(()=>[t(d(x),null,{default:o(()=>[...l[1]||=[f(`Could not load the harness`,-1)]]),_:1}),t(d(y),null,{default:o(()=>[f(u(V.value),1)]),_:1})]),_:1})):a(``,!0),B.value?(s(),n(`div`,Y,[t(d(F),{class:`h-24 w-full`}),t(d(F),{class:`h-40 w-full`})])):G.value?(s(),g(d(R),{key:2},{default:o(()=>[t(d(U),null,{default:o(()=>[t(d(z),null,{default:o(()=>[...l[2]||=[f(`Harness bindings are not configured`,-1)]]),_:1})]),_:1})]),_:1})):m.value?(s(),n(p,{key:3},[m.value.terminal?(s(),g(d(H),{key:1},{default:o(()=>[c(`div`,X,[c(`div`,Z,[t(d(A),{for:`harness-profile`,class:`text-fg-muted`},{default:o(()=>[...l[5]||=[f(`Profile`,-1)]]),_:1}),t(d(O),{modelValue:K.value,"onUpdate:modelValue":l[0]||=e=>K.value=e,disabled:!m.value.profiles.length},{default:o(()=>[t(d(E),{id:`harness-profile`,size:`sm`,class:`min-w-48`},{default:o(()=>[t(d(k),{placeholder:`No profiles configured`})]),_:1}),t(d(D),null,{default:o(()=>[t(d(w),null,{default:o(()=>[(s(!0),n(p,null,r(m.value.profiles,e=>(s(),g(d(T),{key:e,value:e},{default:o(()=>[f(u(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`modelValue`,`disabled`])]),t(d(v),{disabled:!K.value,onClick:ne},{default:o(()=>[...l[6]||=[f(`Open setup terminal`,-1)]]),_:1},8,[`disabled`])])]),_:1})):(s(),g(d(b),{key:0,class:`mb-4`},{default:o(()=>[t(d(x),null,{default:o(()=>[...l[3]||=[f(`Setup terminal unavailable`,-1)]]),_:1}),t(d(y),null,{default:o(()=>[...l[4]||=[f(`Start the daemon with a container runtime and a harness token to log in to a CLI from here.`,-1)]]),_:1})]),_:1})),q.value&&K.value?(s(),g(d(H),{key:2},{default:o(()=>[c(`div`,Q,[t(J,{profile:K.value},null,8,[`profile`])])]),_:1})):a(``,!0)Line truncated
|
||||
import{t as e}from"./badge.js";import{A as t,C as n,Ct as r,M as i,S as a,Xt as o,_t as s,b as c,dt as l,ir as u,jn as d,k as f,l as p,st as m,t as h,x as g,xn as _}from"./PageHeader.js";import{A as v,N as y,j as b,k as x,n as S,r as C}from"./createLucideIcon.js";import{C as w,D as T,E,I as D,O,P as k,T as A,W as j,a as M,at as N,ct as ee,et as P,j as F,k as I,lt as L,o as R,ot as z,rt as B,st as V,ut as H,w as U}from"./index.js";function W(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function G(e,t,n=80,r=24){let i=t.protocol===`https:`?`wss:`:`ws:`,a=new URLSearchParams({profile:e,cols:String(n),rows:String(r)}).toString();return`${i}//${t.host}/api/harness/terminal?${a}`}var K={class:`flex h-full min-h-0 flex-col gap-2`},q={key:0,class:`text-sm text-fg-muted`,role:`status`},J=i({__name:`SetupTerminal`,props:{profile:{}},setup(e){let t=e,r=_(null),i=_(`connecting`),o=null,u=null,d=null,h=null;function g(){try{d?.fit()}catch{}}return l(()=>{let e=r.value;if(!e)return;o=new R({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),d=new M,o.loadAddon(d),o.open(e),g(),o.focus();let n=new WebSocket(G(t.profile,window.location,o?.cols??80,o?.rows??24));u=n,n.binaryType=`arraybuffer`,n.onopen=()=>{i.value=`open`},n.onmessage=e=>{o&&(typeof e.data==`string`?o.write(e.data):o.write(new Uint8Array(e.data)))},n.onerror=()=>{i.value=`failed`},n.onclose=()=>{i.value=`closed`},o.onData(e=>{n.readyState===WebSocket.OPEN&&n.send(e)}),h=new ResizeObserver(g),h.observe(e)}),m(()=>{h?.disconnect(),h=null,u?.close(),u=null,o?.dispose(),o=null,d=null}),(e,t)=>(s(),n(`div`,K,[i.value===`open`?a(``,!0):(s(),n(`p`,q,[i.value===`connecting`?(s(),n(p,{key:0},[f(`Connecting…`)],64)):i.value===`closed`?(s(),n(p,{key:1},[f(`The terminal session ended.`)],64)):(s(),n(p,{key:2},[f(`Could not open the setup terminal.`)],64))])),c(`div`,{ref_key:`host`,ref:r,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Y={key:1,class:`flex flex-col gap-2`},X={class:`flex flex-wrap items-end gap-3`},Z={class:`flex flex-col gap-1 text-sm`},Q={class:`h-96`},$=i({__name:`HarnessPage`,setup(i){let m=_(null),M=_(!0),R=_(null),G=_(!1),K=_(``),q=_(!1),$={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};l(te);async function te(){M.value=!0,R.value=null,G.value=!1;try{let e=await C.harnessBindings();m.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},K.value=m.value.profiles[0]??``}catch(e){let t=e instanceof S?e.status:void 0;t===501||t===503?G.value=!0:R.value=e instanceof Error?e.message:String(e),m.value=null}finally{M.value=!1}}function ne(){m.value?.terminal&&K.value&&(q.value=!0)}function re(e){return e.scopes?.length?e.scopes.join(`, `):`–`}return(i,l)=>(s(),n(`div`,null,[t(h,{title:`Harness`}),R.value?(s(),g(d(b),{key:0,variant:`destructive`,class:`mb-4`},{default:o(()=>[t(d(x),null,{default:o(()=>[...l[1]||=[f(`Could not load the harness`,-1)]]),_:1}),t(d(v),null,{default:o(()=>[f(u(R.value),1)]),_:1})]),_:1})):a(``,!0),M.value?(s(),n(`div`,Y,[t(d(B),{class:`h-24 w-full`}),t(d(B),{class:`h-40 w-full`})])):G.value?(s(),g(d(k),{key:2},{default:o(()=>[t(d(F),null,{default:o(()=>[t(d(I),null,{default:o(()=>[...l[2]||=[f(`Harness bindings are not configured`,-1)]]),_:1})]),_:1})]),_:1})):m.value?(s(),n(p,{key:3},[m.value.terminal?(s(),g(d(D),{key:1},{default:o(()=>[c(`div`,X,[c(`div`,Z,[t(d(j),{for:`harness-profile`,class:`text-fg-muted`},{default:o(()=>[...l[5]||=[f(`Profile`,-1)]]),_:1}),t(d(H),{modelValue:K.value,"onUpdate:modelValue":l[0]||=e=>K.value=e,disabled:!m.value.profiles.length},{default:o(()=>[t(d(z),{id:`harness-profile`,size:`sm`,class:`min-w-48`},{default:o(()=>[t(d(N),{placeholder:`No profiles configured`})]),_:1}),t(d(L),null,{default:o(()=>[t(d(ee),null,{default:o(()=>[(s(!0),n(p,null,r(m.value.profiles,e=>(s(),g(d(V),{key:e,value:e},{default:o(()=>[f(u(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`modelValue`,`disabled`])]),t(d(y),{disabled:!K.value,onClick:ne},{default:o(()=>[...l[6]||=[f(`Open setup terminal`,-1)]]),_:1},8,[`disabled`])])]),_:1})):(s(),g(d(b),{key:0,class:`mb-4`},{default:o(()=>[t(d(x),null,{default:o(()=>[...l[3]||=[f(`Setup terminal unavailable`,-1)]]),_:1}),t(d(v),null,{default:o(()=>[...l[4]||=[f(`Start the daemon with a container runtime and a harness token to log in to a CLI from here.`,-1)]]),_:1})]),_:1})),q.value&&K.value?(s(),g(d(D),{key:2},{default:o(()=>[c(`div`,Q,[t(J,{profile:K.value},null,8,[`profile`])])]),_:1})):a(``,!0),t(d(D),null,{default:o(()=>[t(d(O),null,{default:o(()=>[t(d(w),null,{defaLine truncated
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{E as e,L as t,a as n,c as r,d as i,f as a,g as o,h as s,j as c,l,m as u,o as d,p as f,r as p,s as m,t as h,u as g,y as _}from"./badge.js";import{A as v,C as y,Ct as b,Dt as x,En as S,Gt as ee,H as C,M as w,On as T,S as E,Sn as te,Tt as ne,U as re,Xt as D,_t as O,b as ie,bn as ae,dt as oe,gn as se,ht as ce,ir as k,jn as A,k as j,l as le,n as ue,nr as de,rt as M,wn as fe,wt as N,x as P,xn as F,y as I,yn as pe}from"./PageHeader.js";import{A as me,F as he,I as ge,P as _e,a as ve,c as ye,j as be,o as xe,ot as Se,r as Ce,t as we,x as Te}from"./createLucideIcon.js";import{n as Ee}from"./pinia.js";import{n as De,t as Oe}from"./nullish.js";import{i as ke}from"./duration.js";function Ae(e,t){return Oe(e)?!1:Array.isArray(e)?e.some(e=>De(e,t)):De(e,t)}function je({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Me({type:e,defaultValue:t,modelValue:n}){return e||je({type:e,defaultValue:t,modelValue:n})}function Ne({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Pe(t,n){let r=I(()=>Me(t)),i=e(t,`modelValue`,n,{defaultValue:Ne(t),passive:t.modelValue===void 0,deep:!0});function a(e){if(r.value===`single`)i.value=De(e,i.value)?void 0:e;else{let t=Array.isArray(i.value)?[...i.value||[]]:[i.value].filter(Boolean);if(Ae(t,e)){let n=t.findIndex(t=>De(t,e));t.splice(n,1)}else t.push(e);i.value=t}}return{modelValue:i,changeModelValue:a,isSingle:I(()=>r.value===`single`)}}var[L,Fe]=t(`PopoverRoot`),Ie=w({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(t,{emit:n}){let r=t,i=n,{modal:a}=T(r),o=e(r,`open`,i,{defaultValue:r.defaultOpen,passive:r.open===void 0});return Fe({contentId:``,triggerId:``,modal:a,open:o,onOpenChange:e=>{o.value=e},onOpenToggle:()=>{o.value=!o.value},triggerElement:F(),hasCustomAnchor:F(!1)}),(e,t)=>(O(),P(A(d),null,{default:D(()=>[N(e.$slots,`default`,{open:A(o),close:()=>o.value=!1})]),_:3}))}}),Le=w({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,i=t,a=u(c(n,`trapFocus`,`disableOutsidePointerEvents`)),{forwardRef:d}=s(),f=L();return o(),(t,n)=>(O(),P(A(r),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:n[5]||=e=>i(`openAutoFocus`,e),onUnmountAutoFocus:n[6]||=e=>i(`closeAutoFocus`,e)},{default:D(()=>[v(A(l),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:n[0]||=e=>i(`pointerDownOutside`,e),onInteractOutside:n[1]||=e=>i(`interactOutside`,e),onEscapeKeyDown:n[2]||=e=>i(`escapeKeyDown`,e),onFocusOutside:n[3]||=e=>i(`focusOutside`,e),onDismiss:n[4]||=e=>A(f).onOpenChange(!1)},{default:D(()=>[v(A(p),M(A(a),{id:A(f).contentId,ref:A(d),"data-state":A(f).open.value?`open`:`closed`,"aria-labelledby":A(f).triggerId,style:{"--reka-popover-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-popover-content-available-width":`var(--reka-popper-available-width)`,"--reka-popover-content-available-height":`var(--reka-popper-available-height)`,"--reka-popover-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-popover-trigger-height":`var(--reka-popper-anchor-height)`},role:`dialog`}),{default:D(()=>[N(t.$slots,`default`)]),_:3},16,[`id`,`data-state`,`aria-labelledby`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),Re=w({__name:`PopoverContentModal`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftLine truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,M as n,Tt as r,Xt as i,_t as a,jn as o,k as s,t as c}from"./PageHeader.js";import{S as l,_ as u,b as d,y as f}from"./index.js";var p=n({__name:`NotFoundPage`,setup(n){return(n,p)=>{let m=r(`RouterLink`);return a(),t(`div`,null,[e(c,{title:`Page not found`}),e(o(l),null,{default:i(()=>[e(o(f),null,{default:i(()=>[e(o(u),null,{default:i(()=>[...p[0]||=[s(`No page at this address`,-1)]]),_:1}),e(o(d),null,{default:i(()=>[e(m,{to:`/`},{default:i(()=>[...p[1]||=[s(`Return to dashboard`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})])}}});export{p as default};
|
||||
import{A as e,C as t,M as n,Tt as r,Xt as i,_t as a,jn as o,k as s,t as c}from"./PageHeader.js";import{M as l,P as u,j as d,k as f}from"./index.js";var p=n({__name:`NotFoundPage`,setup(n){return(n,p)=>{let m=r(`RouterLink`);return a(),t(`div`,null,[e(c,{title:`Page not found`}),e(o(u),null,{default:i(()=>[e(o(d),null,{default:i(()=>[e(o(f),null,{default:i(()=>[...p[0]||=[s(`No page at this address`,-1)]]),_:1}),e(o(l),null,{default:i(()=>[e(m,{to:`/`},{default:i(()=>[...p[1]||=[s(`Return to dashboard`,-1)]]),_:1})]),_:1})]),_:1})]),_:1})])}}});export{p as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{A as h,F as g,I as _,ot as v}from"./createLucideIcon.js";import{n as y,o as b,t as x}from"./HistoryLink.js";import{t as S}from"./input.js";import{t as C}from"./textarea.js";import{S as w,_ as T,o as E,y as D}from"./index.js";var O=`eda-playbooks`,k=n({__name:`PlaybooksPage`,setup(n){let k=b();s(k.load);let A=m(()=>k.formFor(O)),j=m(()=>k.draftValue(O)),M=p(``),N=p(``),P=m(()=>k.changesFor(O).length>0);function F(){if(P.value)return;let e=M.value.trim();if(!e||j.value?.playbooks.some(t=>t.id===e)||!A.value)return;let t=j.value?.playbooks??[];k.setDraftValue(O,{playbooks:[...t,{id:e,yaml:``}]}),M.value=``,N.value=String(t.length)}function I(e){let t=j.value?.playbooks??[];k.setDraftValue(O,{playbooks:t.filter((t,n)=>n!==e)})}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Playbooks`},{default:i(()=>[e(x,{kinds:[O]},null,8,[`kinds`])]),_:1}),e(y,{kind:O,class:`mb-4`}),l(k).catalogError||l(k).pageErrorFor(O)?(a(),f(l(_),{key:0,variant:`destructive`,class:`mb-4`},{default:i(()=>[e(l(g),null,{default:i(()=>[u(c(l(k).catalogError||l(k).pageErrorFor(O)),1)]),_:1})]),_:1})):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:v(F,[`prevent`])},[e(l(S),{modelValue:M.value,"onUpdate:modelValue":s[0]||=e=>M.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`,disabled:P.value},null,8,[`modelValue`,`disabled`]),e(l(h),{type:`submit`,disabled:P.value||!M.value.trim()||j.value?.playbooks.some(e=>e.id===M.value.trim())},{default:i(()=>[...s[2]||=[u(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),j.value?.playbooks.length?r(``,!0):(a(),f(l(w),{key:1},{default:i(()=>[e(l(D),null,{default:i(()=>[e(l(T),null,{default:i(()=>[...s[3]||=[u(`No playbooks installed`,-1)]]),_:1})]),_:1})]),_:1})),e(E,{open:N.value,"onUpdate:open":s[1]||=e=>N.value=e,items:j.value?.playbooks??[],title:e=>e.id,"remove-label":`Remove`,mono:``,onRemove:I},{default:i(({item:t,index:n})=>[A.value?(a(),f(l(A).Field,{key:0,name:`playbooks[${n}].yaml`},{default:i(({field:r})=>[e(l(C),{id:`playbook-${n}`,"model-value":r.state.value,"aria-label":`${t.id} YAML`,class:`mb-3 min-h-64 font-mono`,spellcheck:`false`,onBlur:r.handleBlur,"onUpdate:modelValue":r.handleChange},null,8,[`id`,`model-value`,`aria-label`,`onBlur`,`onUpdate:modelValue`])]),_:2},1032,[`name`])):r(``,!0)]),_:1},8,[`open`,`items`,`title`])]))}});export{k as default};
|
||||
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{A as h,N as g,j as _,ot as v}from"./createLucideIcon.js";import{t as y}from"./input.js";import{$ as b,P as x,X as S,Z as C,it as w,j as T,k as E,l as D}from"./index.js";var O=`eda-playbooks`,k=n({__name:`PlaybooksPage`,setup(n){let k=b();s(k.load);let A=m(()=>k.formFor(O)),j=m(()=>k.draftValue(O)),M=p(``),N=p(``),P=m(()=>k.changesFor(O).length>0);function F(){if(P.value)return;let e=M.value.trim();if(!e||j.value?.playbooks.some(t=>t.id===e)||!A.value)return;let t=j.value?.playbooks??[];k.setDraftValue(O,{playbooks:[...t,{id:e,yaml:``}]}),M.value=``,N.value=String(t.length)}function I(e){let t=j.value?.playbooks??[];k.setDraftValue(O,{playbooks:t.filter((t,n)=>n!==e)})}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Playbooks`},{default:i(()=>[e(S,{kinds:[O]},null,8,[`kinds`])]),_:1}),e(C,{kind:O,class:`mb-4`}),l(k).catalogError||l(k).pageErrorFor(O)?(a(),f(l(_),{key:0,variant:`destructive`,class:`mb-4`},{default:i(()=>[e(l(h),null,{default:i(()=>[u(c(l(k).catalogError||l(k).pageErrorFor(O)),1)]),_:1})]),_:1})):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:v(F,[`prevent`])},[e(l(y),{modelValue:M.value,"onUpdate:modelValue":s[0]||=e=>M.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`,disabled:P.value},null,8,[`modelValue`,`disabled`]),e(l(g),{type:`submit`,disabled:P.value||!M.value.trim()||j.value?.playbooks.some(e=>e.id===M.value.trim())},{default:i(()=>[...s[2]||=[u(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),j.value?.playbooks.length?r(``,!0):(a(),f(l(x),{key:1},{default:i(()=>[e(l(T),null,{default:i(()=>[e(l(E),null,{default:i(()=>[...s[3]||=[u(`No playbooks installed`,-1)]]),_:1})]),_:1})]),_:1})),e(D,{open:N.value,"onUpdate:open":s[1]||=e=>N.value=e,items:j.value?.playbooks??[],title:e=>e.id,"remove-label":`Remove`,mono:``,onRemove:I},{default:i(({item:t,index:n})=>[A.value?(a(),f(l(A).Field,{key:0,name:`playbooks[${n}].yaml`},{default:i(({field:r})=>[e(l(w),{id:`playbook-${n}`,"model-value":r.state.value,"aria-label":`${t.id} YAML`,class:`mb-3 min-h-64 font-mono`,spellcheck:`false`,onBlur:r.handleBlur,"onUpdate:modelValue":r.handleChange},null,8,[`id`,`model-value`,`aria-label`,`onBlur`,`onUpdate:modelValue`])]),_:2},1032,[`name`])):r(``,!0)]),_:1},8,[`open`,`items`,`title`])]))}});export{k as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{t as e}from"./badge.js";import{A as t,C as n,Ct as r,Gt as i,M as a,S as o,Tt as s,Xt as c,_t as l,b as u,ht as d,ir as f,jn as p,k as m,l as h,t as g,x as _,xn as v,y}from"./PageHeader.js";import{A as b,F as x,I as S,r as C}from"./createLucideIcon.js";import{G as w,i as T,s as E,t as D}from"./schedule.js";import{s as O}from"./table.js";import{B as k,I as A,U as j,w as M}from"./index.js";var N={key:0,class:`space-y-2`},P={class:`tabular-nums text-fg-muted`},F={class:`block max-w-md break-words whitespace-normal text-danger`},I={class:`flex flex-wrap gap-2`},L=a({__name:`ScheduleRunsPage`,setup(a){let L=w(),R=y(()=>String(L.params.id??``)),z=v(null),B=v(null),V=v(``);async function H(){let e=R.value;try{let[t,n]=await Promise.all([C.schedules(),C.scheduleRuns(e)]);if(e!==R.value)return;z.value=t.schedules?.find(t=>t.id===e)??null,B.value=n.runs??[],V.value=``}catch(t){e===R.value&&(V.value=t instanceof Error?t.message:String(t))}}i(R,()=>{B.value=null,H()},{immediate:!0});let U=setInterval(()=>void H(),15e3);d(()=>clearInterval(U));async function W(){V.value=``;try{await C.scheduleRunNow(R.value),await H()}catch(e){V.value=e instanceof Error?e.message:String(e)}}let G=[{id:`scheduled`,label:`Scheduled`,fixed:!0,sort:e=>e.scheduled_for},{id:`started`,label:`Started`},{id:`duration`,label:`Duration`},{id:`result`,label:`Result`,sort:e=>e.result},{id:`error`,label:`Error`},{id:`tasks`,label:`Tasks`}];return(i,a)=>{let d=s(`RouterLink`);return l(),n(`div`,null,[t(g,{title:z.value?.name||`Schedule runs`},{default:c(()=>[t(p(b),{variant:`ghost`,size:`sm`,"as-child":``},{default:c(()=>[t(d,{to:`/org/schedules`},{default:c(()=>[t(p(j),{"data-icon":`inline-start`}),a[0]||=m(`Schedules`,-1)]),_:1})]),_:1}),t(p(b),{size:`sm`,disabled:!z.value,onClick:W},{default:c(()=>[t(p(k),{"data-icon":`inline-start`}),a[1]||=m(`Run now`,-1)]),_:1},8,[`disabled`])]),_:1},8,[`title`]),V.value?(l(),_(p(S),{key:0,variant:`destructive`,class:`mb-4`},{default:c(()=>[t(p(x),null,{default:c(()=>[m(f(V.value),1)]),_:1})]),_:1})):o(``,!0),t(p(M),null,{default:c(()=>[!B.value&&!V.value?(l(),n(`div`,N,[t(p(O),{class:`h-8 w-full`}),t(p(O),{class:`h-8 w-full`})])):B.value?(l(),_(p(E),{key:1,columns:G,rows:B.value,"row-key":e=>String(e.id),"storage-key":`schedule-runs`,"initial-sort":{id:`scheduled`,desc:!0}},{empty:c(()=>[...a[2]||=[u(`p`,{class:`py-4 text-center text-sm text-fg-subtle`},`No runs yet.`,-1)]]),"cell-scheduled":c(({row:e})=>[t(p(A),{at:e.scheduled_for,absolute:``},null,8,[`at`])]),"cell-started":c(({row:e})=>[t(p(A),{at:e.started,absolute:``},null,8,[`at`])]),"cell-duration":c(({row:e})=>[u(`span`,P,f(p(T)(e)||`–`),1)]),"cell-result":c(({row:n})=>[t(p(e),{variant:p(D)[n.result]??`idle`},{default:c(()=>[m(f(n.result),1)]),_:2},1032,[`variant`])]),"cell-error":c(({row:e})=>[u(`span`,F,f(e.error),1)]),"cell-tasks":c(({row:e})=>[u(`span`,I,[(l(!0),n(h,null,r(e.task_ids??[],e=>(l(),_(d,{key:e,to:`/tasks/${e}`,class:`font-mono hover:underline`},{default:c(()=>[m(`#`+f(e),1)]),_:2},1032,[`to`]))),128))])]),_:1},8,[`rows`,`row-key`])):o(``,!0)]),_:1})])}}});export{L as default};
|
||||
import{t as e}from"./badge.js";import{A as t,C as n,Ct as r,Gt as i,M as a,S as o,Tt as s,Xt as c,_t as l,b as u,ht as d,ir as f,jn as p,k as m,l as h,t as g,x as _,xn as v,y}from"./PageHeader.js";import{A as b,N as x,j as S,r as C}from"./createLucideIcon.js";import{I as w,bt as T,d as E,et as D,ft as O,gt as k,n as A,r as j,rt as M}from"./index.js";var N={key:0,class:`space-y-2`},P={class:`tabular-nums text-fg-muted`},F={class:`block max-w-md break-words whitespace-normal text-danger`},I={class:`flex flex-wrap gap-2`},L=a({__name:`ScheduleRunsPage`,setup(a){let L=T(),R=y(()=>String(L.params.id??``)),z=v(null),B=v(null),V=v(``);async function H(){let e=R.value;try{let[t,n]=await Promise.all([C.schedules(),C.scheduleRuns(e)]);if(e!==R.value)return;z.value=t.schedules?.find(t=>t.id===e)??null,B.value=n.runs??[],V.value=``}catch(t){e===R.value&&(V.value=t instanceof Error?t.message:String(t))}}i(R,()=>{B.value=null,H()},{immediate:!0});let U=setInterval(()=>void H(),15e3);d(()=>clearInterval(U));async function W(){V.value=``;try{await C.scheduleRunNow(R.value),await H()}catch(e){V.value=e instanceof Error?e.message:String(e)}}let G=[{id:`scheduled`,label:`Scheduled`,fixed:!0,sort:e=>e.scheduled_for},{id:`started`,label:`Started`},{id:`duration`,label:`Duration`},{id:`result`,label:`Result`,sort:e=>e.result},{id:`error`,label:`Error`},{id:`tasks`,label:`Tasks`}];return(i,a)=>{let d=s(`RouterLink`);return l(),n(`div`,null,[t(g,{title:z.value?.name||`Schedule runs`},{default:c(()=>[t(p(x),{variant:`ghost`,size:`sm`,"as-child":``},{default:c(()=>[t(d,{to:`/org/schedules`},{default:c(()=>[t(p(k),{"data-icon":`inline-start`}),a[0]||=m(`Schedules`,-1)]),_:1})]),_:1}),t(p(x),{size:`sm`,disabled:!z.value,onClick:W},{default:c(()=>[t(p(O),{"data-icon":`inline-start`}),a[1]||=m(`Run now`,-1)]),_:1},8,[`disabled`])]),_:1},8,[`title`]),V.value?(l(),_(p(S),{key:0,variant:`destructive`,class:`mb-4`},{default:c(()=>[t(p(b),null,{default:c(()=>[m(f(V.value),1)]),_:1})]),_:1})):o(``,!0),t(p(w),null,{default:c(()=>[!B.value&&!V.value?(l(),n(`div`,N,[t(p(M),{class:`h-8 w-full`}),t(p(M),{class:`h-8 w-full`})])):B.value?(l(),_(p(E),{key:1,columns:G,rows:B.value,"row-key":e=>String(e.id),"storage-key":`schedule-runs`,"initial-sort":{id:`scheduled`,desc:!0}},{empty:c(()=>[...a[2]||=[u(`p`,{class:`py-4 text-center text-sm text-fg-subtle`},`No runs yet.`,-1)]]),"cell-scheduled":c(({row:e})=>[t(p(D),{at:e.scheduled_for,absolute:``},null,8,[`at`])]),"cell-started":c(({row:e})=>[t(p(D),{at:e.started,absolute:``},null,8,[`at`])]),"cell-duration":c(({row:e})=>[u(`span`,P,f(p(j)(e)||`–`),1)]),"cell-result":c(({row:n})=>[t(p(e),{variant:p(A)[n.result]??`idle`},{default:c(()=>[m(f(n.result),1)]),_:2},1032,[`variant`])]),"cell-error":c(({row:e})=>[u(`span`,F,f(e.error),1)]),"cell-tasks":c(({row:e})=>[u(`span`,I,[(l(!0),n(h,null,r(e.task_ids??[],e=>(l(),_(d,{key:e,to:`/tasks/${e}`,class:`font-mono hover:underline`},{default:c(()=>[m(`#`+f(e),1)]),_:2},1032,[`to`]))),128))])]),_:1},8,[`rows`,`row-key`])):o(``,!0)]),_:1})])}}});export{L as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{t as e}from"./badge.js";import{A as t,C as n,Ct as r,M as ee,S as i,Tt as te,Xt as a,_t as o,b as s,dt as c,ht as l,ir as u,jn as d,k as f,l as p,t as ne,x as m,xn as h,y as g}from"./PageHeader.js";import{A as _,F as v,I as y,r as b}from"./createLucideIcon.js";import{r as re}from"./pinia.js";import{a as ie,d as ae,g as oe,i as se,p as x,s as ce}from"./schedule.js";import{a as le,n as ue,o as de,t as fe}from"./HistoryLink.js";import{s as S}from"./table.js";import{A as pe,D as me,E as he,F as C,H as ge,I as w,L as _e,M as ve,O as ye,P as T,R as be,S as xe,T as Se,_ as Ce,c as we,d as Te,f as Ee,g as E,h as D,i as De,j as O,k as Oe,l as ke,m as Ae,p as je,s as k,t as Me,u as Ne,v as Pe,w as A,x as Fe,y as Ie,z as j}from"./index.js";var Le={key:1,class:`space-y-2`},Re={class:`flex items-center gap-2`},ze={class:`truncate`},Be={class:`text-fg-muted`},Ve=[`title`],He={key:1,class:`text-fg-subtle`},Ue={class:`tabular-nums text-fg-muted`},M={key:1,class:`text-fg-subtle`},We={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},Ge={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},Ke={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},N=`schedule-settings`,P=ee({__name:`SchedulesPage`,setup(ee){let P=h(null),F=h(``),I=h(``),L;async function R(){try{let e=await b.schedules();P.value=e.schedules??[],F.value=``}catch(e){F.value=e instanceof Error?e.message:String(e)}}c(()=>{R(),L=setInterval(()=>void R(),3e4)}),l(()=>clearInterval(L));let z=de(),{catalog:qe}=re(z);c(z.load);let B=g(()=>le(qe.value,`schedules`)),V=g(()=>z.formFor(N)),H=g(()=>z.draftValue(N)),U=g(()=>z.pageErrorFor(N)),Je=g(()=>H.value?.time_zone||`UTC`),Ye=_e(),Xe=e=>be(new Date(e),Ye.timeZone),Ze=e=>ie(e.timing,Je.value,Xe),W=e=>e.owner.name||e.owner.id||e.owner.kind,Qe=[{id:`enabled`,label:`Enabled`,fixed:!0,class:`w-0`},{id:`name`,label:`Name`,fixed:!0,sort:e=>e.name.toLowerCase()},{id:`owner`,label:`Owner`,sort:W},{id:`interval`,label:`Interval`},{id:`last`,label:`Last Run`,sort:e=>e.last_run?.scheduled_for??``},{id:`duration`,label:`Last Duration`},{id:`next`,label:`Next Run`,sort:e=>e.next_run??``}];function G(e){if(!P.value)return;let t=P.value.findIndex(t=>t.id===e.id);t<0?P.value.push(e):P.value[t]=e}async function K(e){I.value=``;try{await e()}catch(e){I.value=e instanceof Error?e.message:String(e)}}let $e=(e,t)=>K(async()=>G(await b.scheduleSave(e.id,{...e,enabled:t}))),et=e=>K(async()=>{await b.scheduleRunNow(e.id),await R()}),q=h(null),J=h(``),Y=h(!1);function X(e,t){q.value=e,J.value=t,Y.value=!0}function Z(){return{id:crypto.randomUUID(),name:``,owner:{kind:`instance`},enabled:!0,built_in:!1,timing:{kind:`interval`,interval:`24h0m0s`}}}let Q=()=>X(Z(),`New schedule`),tt=e=>X({...Z(),name:`${e.name} copy`,timing:{...e.timing},enabled:!1},`Duplicate schedule`),$=h(null),nt=()=>K(async()=>{let e=$.value;$.value=null,e&&(await b.scheduleDelete(e.id),P.value=P.value?.filter(t=>t.id!==e.id)??null)});return(ee,c)=>{let l=te(`RouterLink`);return o(),n(`div`,null,[t(ne,{title:`Schedules`},{default:a(()=>[t(fe,{kinds:B.value.map(e=>e.kind)},null,8,[`kinds`]),t(d(_),{size:`sm`,disabled:!P.value,onClick:Q},{default:a(()=>[t(d(j),{"data-icon":`inline-start`}),c[2]||=f(`Add schedule`,-1)]),_:1},8,[`disabled`])]),_:1}),(o(!0),n(p,null,r(B.value,e=>(o(),m(ue,{key:e.kind,kind:e.kind,class:`mb-4`},null,8,[`kind`]))),128)),I.value?(o(),m(d(y),{key:0,variant:`destructive`,class:`mb-4`},{default:a(()=>[t(d(v),null,{default:a(()=>[f(u(I.value),1)]),_:1})]),_:1})):i(``,!0),t(d(A),null,{default:a(()=>[F.value?(o(),m(d(y),{key:0,variant:`destructive`},{default:a(()=>[t(d(v),null,{default:a(()=>[f(u(F.value),1)]),_:1})]),_:1})):P.value?(o(),m(d(ce),{key:2,columns:Qe,rows:P.value,"row-key":e=>e.id,"storage-key":`schedules`,"initial-sort":{id:`name`,desc:!1}},{empty:a(()=>[t(d(xe),null,{default:a(()=>[t(d(Pe),{variant:`icon`},{default:a(()=>[t(d(ge))]),_:1}),t(d(Ie),null,{default:a(()=>[t(d(Ce),null,{default:a(()=>[...c[3]||=[f(`No schedules yet`,-1)]]),_:1})]),_:1}),t(d(Fe),null,{default:a(()=>[t(d(_),{size:`sm`,onClick:Q},{default:a(()=>[t(d(j),{"data-icon":`inline-start`}),c[4]||=f(`Add schedule`,-1)]),_:1})]),_:1})]),_:1})]),"cell-enabled":a(({row:e})=>[t(d(Se),{"model-value":e.enabled,"aria-label":`${e.name} enabled`,"onUpdate:modelValue":t=>$e(e,t)},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`])]),"cell-name":a(({row:t})=>[s(`span`,Re,[s(`span`,ze,u(t.name),1),t.built_in?(o(),m(d(e),{key:0,variant:`outline`},{default:a(()=>[...c[5]||=[f(`Built-in`,-1)]]),_:1})):i(``,!0)])]),"cell-owner":a(({row:e})=>[s(`span`,Be,u(W(e)),1)]),"cell-interval":a(({row:e})=>[s(`span`,{title:e.timing.kind===`cron`?e.timing.cron:void 0},u(Ze(e)),9,Ve)]),"cell-last":a(({row:r})=>[r.last_run?(o(),m(l,{key:0,to:`/org/schedules/${encodeURIComponent(r.id)}/runs`,class:`inline-flex items-center gap-2 hover:underline`},{default:a(()=>[t(d(w),{at:r.last_run.started||r.last_run.scheduled_for},null,8,[`at`Line truncated
|
||||
import{t as e}from"./badge.js";import{A as t,C as n,Ct as r,M as ee,S as i,Tt as te,Xt as a,_t as o,b as s,dt as c,ht as l,ir as u,jn as d,k as f,l as p,t as ne,x as m,xn as h,y as g}from"./PageHeader.js";import{A as _,N as v,j as y,r as b}from"./createLucideIcon.js";import{r as re}from"./pinia.js";import{$ as ie,A as ae,B as oe,G as se,H as ce,I as x,J as S,L as le,N as ue,P as de,Q as fe,R as pe,S as me,U as C,V as he,X as ge,Y as _e,Z as ve,_ as ye,b as be,d as xe,dt as w,et as T,f as Se,g as Ce,h as we,ht as Te,i as Ee,j as E,k as D,m as O,nt as De,p as Oe,q as k,r as ke,rt as A,s as Ae,t as je,tt as Me,u as j,v as Ne,x as Pe,y as Fe,z as Ie}from"./index.js";var Le={key:1,class:`space-y-2`},Re={class:`flex items-center gap-2`},ze={class:`truncate`},Be={class:`text-fg-muted`},Ve=[`title`],He={key:1,class:`text-fg-subtle`},Ue={class:`tabular-nums text-fg-muted`},M={key:1,class:`text-fg-subtle`},We={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},Ge={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},Ke={class:`flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1`},N=`schedule-settings`,P=ee({__name:`SchedulesPage`,setup(ee){let P=h(null),F=h(``),I=h(``),L;async function R(){try{let e=await b.schedules();P.value=e.schedules??[],F.value=``}catch(e){F.value=e instanceof Error?e.message:String(e)}}c(()=>{R(),L=setInterval(()=>void R(),3e4)}),l(()=>clearInterval(L));let z=ie(),{catalog:qe}=re(z);c(z.load);let B=g(()=>fe(qe.value,`schedules`)),V=g(()=>z.formFor(N)),H=g(()=>z.draftValue(N)),U=g(()=>z.pageErrorFor(N)),Je=g(()=>H.value?.time_zone||`UTC`),Ye=Me(),Xe=e=>De(new Date(e),Ye.timeZone),Ze=e=>Ee(e.timing,Je.value,Xe),W=e=>e.owner.name||e.owner.id||e.owner.kind,Qe=[{id:`enabled`,label:`Enabled`,fixed:!0,class:`w-0`},{id:`name`,label:`Name`,fixed:!0,sort:e=>e.name.toLowerCase()},{id:`owner`,label:`Owner`,sort:W},{id:`interval`,label:`Interval`},{id:`last`,label:`Last Run`,sort:e=>e.last_run?.scheduled_for??``},{id:`duration`,label:`Last Duration`},{id:`next`,label:`Next Run`,sort:e=>e.next_run??``}];function G(e){if(!P.value)return;let t=P.value.findIndex(t=>t.id===e.id);t<0?P.value.push(e):P.value[t]=e}async function K(e){I.value=``;try{await e()}catch(e){I.value=e instanceof Error?e.message:String(e)}}let $e=(e,t)=>K(async()=>G(await b.scheduleSave(e.id,{...e,enabled:t}))),et=e=>K(async()=>{await b.scheduleRunNow(e.id),await R()}),q=h(null),J=h(``),Y=h(!1);function X(e,t){q.value=e,J.value=t,Y.value=!0}function Z(){return{id:crypto.randomUUID(),name:``,owner:{kind:`instance`},enabled:!0,built_in:!1,timing:{kind:`interval`,interval:`24h0m0s`}}}let Q=()=>X(Z(),`New schedule`),tt=e=>X({...Z(),name:`${e.name} copy`,timing:{...e.timing},enabled:!1},`Duplicate schedule`),$=h(null),nt=()=>K(async()=>{let e=$.value;$.value=null,e&&(await b.scheduleDelete(e.id),P.value=P.value?.filter(t=>t.id!==e.id)??null)});return(ee,c)=>{let l=te(`RouterLink`);return o(),n(`div`,null,[t(ne,{title:`Schedules`},{default:a(()=>[t(ge,{kinds:B.value.map(e=>e.kind)},null,8,[`kinds`]),t(d(v),{size:`sm`,disabled:!P.value,onClick:Q},{default:a(()=>[t(d(w),{"data-icon":`inline-start`}),c[2]||=f(`Add schedule`,-1)]),_:1},8,[`disabled`])]),_:1}),(o(!0),n(p,null,r(B.value,e=>(o(),m(ve,{key:e.kind,kind:e.kind,class:`mb-4`},null,8,[`kind`]))),128)),I.value?(o(),m(d(y),{key:0,variant:`destructive`,class:`mb-4`},{default:a(()=>[t(d(_),null,{default:a(()=>[f(u(I.value),1)]),_:1})]),_:1})):i(``,!0),t(d(x),null,{default:a(()=>[F.value?(o(),m(d(y),{key:0,variant:`destructive`},{default:a(()=>[t(d(_),null,{default:a(()=>[f(u(F.value),1)]),_:1})]),_:1})):P.value?(o(),m(d(xe),{key:2,columns:Qe,rows:P.value,"row-key":e=>e.id,"storage-key":`schedules`,"initial-sort":{id:`name`,desc:!1}},{empty:a(()=>[t(d(de),null,{default:a(()=>[t(d(ae),{variant:`icon`},{default:a(()=>[t(d(Te))]),_:1}),t(d(E),null,{default:a(()=>[t(d(D),null,{default:a(()=>[...c[3]||=[f(`No schedules yet`,-1)]]),_:1})]),_:1}),t(d(ue),null,{default:a(()=>[t(d(v),{size:`sm`,onClick:Q},{default:a(()=>[t(d(w),{"data-icon":`inline-start`}),c[4]||=f(`Add schedule`,-1)]),_:1})]),_:1})]),_:1})]),"cell-enabled":a(({row:e})=>[t(d(le),{"model-value":e.enabled,"aria-label":`${e.name} enabled`,"onUpdate:modelValue":t=>$e(e,t)},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`])]),"cell-name":a(({row:t})=>[s(`span`,Re,[s(`span`,ze,u(t.name),1),t.built_in?(o(),m(d(e),{key:0,variant:`outline`},{default:a(()=>[...c[5]||=[f(`Built-in`,-1)]]),_:1})):i(``,!0)])]),"cell-owner":a(({row:e})=>[s(`span`,Be,u(W(e)),1)]),"cell-interval":a(({row:e})=>[s(`span`,{title:e.timing.kind===`cron`?e.timing.cron:void 0},u(Ze(e)),9,Ve)]),"cell-last":a(({row:r})=>[r.last_run?(o(),m(l,{key:0,to:`/org/schedules/${encodeURIComponent(r.id)}/runs`,class:`inline-flex items-center gap-2 hover:underline`},{default:a(()=>[t(d(T),{at:r.last_run.started||r.last_run.scheduled_for},null,8,[`at`]),r.last_run.result===`failed`?(o(),m(d(e),{key:0,variant:`danger`,title:r.lLine truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{S as e}from"./badge.js";import{M as t,Xt as n,_t as r,jn as i,kn as a,wt as o,x as s,y as c}from"./PageHeader.js";import{j as l}from"./createLucideIcon.js";function u(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function d(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function f(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=d(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return Number.isNaN(t)?!Number.isNaN(n)&&a>n&&(a=Math.floor(d(n/r,r))*r):a<t?a=t:!Number.isNaN(n)&&a>n&&(a=t+Math.floor(d((n-t)/r,r))*r),a=d(a,r),a}function p(t){return c(()=>!a(t)||!!e(t)?.closest(`form`))}var m=t({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(t,a)=>(r(),s(i(l),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:n(()=>[o(t.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}});export{f as i,p as n,u as r,m as t};
|
||||
import{S as e}from"./badge.js";import{M as t,Xt as n,_t as r,jn as i,kn as a,wt as o,x as s,y as c}from"./PageHeader.js";import{P as l}from"./createLucideIcon.js";function u(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function d(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function f(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=d(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return Number.isNaN(t)?!Number.isNaN(n)&&a>n&&(a=Math.floor(d(n/r,r))*r):a<t?a=t:!Number.isNaN(n)&&a>n&&(a=t+Math.floor(d((n-t)/r,r))*r),a=d(a,r),a}function p(t){return c(()=>!a(t)||!!e(t)?.closest(`form`))}var m=t({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(t,a)=>(r(),s(i(l),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:n(()=>[o(t.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}});export{f as i,p as n,u as r,m as t};
|
||||
Vendored
+2
-2
@@ -1,3 +1,3 @@
|
||||
import{$ as e,$t as t,A as n,An as r,At as i,B as a,Bt as o,C as s,Cn as c,Ct as l,D as u,Dn as d,Dt as f,E as p,En as m,Et as h,F as g,Fn as _,Ft as v,G as y,Gt as b,H as x,Ht as S,I as C,It as w,J as T,Jt as E,K as ee,Kt as D,L as O,Lt as te,M as k,Mt as ne,N as re,Nt as ie,O as ae,On as oe,Ot as se,P as ce,Pn as le,Pt as ue,Q as de,Qt as fe,R as pe,Rt as me,S as he,Sn as ge,St as _e,T as ve,Tn as ye,Tt as be,U as xe,Ut as Se,V as Ce,Vt as we,W as Te,Wt as Ee,X as De,Xt as Oe,Y as ke,Yt as Ae,Z as je,Zt as Me,_ as Ne,_n as Pe,_t as A,a as Fe,an as Ie,ar as Le,at as Re,b as ze,bn as Be,bt as Ve,c as He,cn as Ue,ct as We,d as Ge,dn as Ke,dt as qe,en as Je,er as Ye,et as Xe,f as Ze,fn as Qe,ft as $e,g as et,gn as tt,gt as nt,h as rt,hn as it,ht as at,i as ot,in as st,ir as ct,it as j,j as lt,jn as M,jt as ut,k as dt,kn as N,kt as ft,l as pt,ln as mt,lt as ht,m as gt,mn as _t,mt as vt,n as yt,nn as bt,nr as xt,nt as St,o as Ct,on as wt,ot as Tt,p as Et,pn as Dt,pt as Ot,q as kt,qt as At,r as jt,rn as Mt,rr as Nt,rt as Pt,s as Ft,sn as It,st as Lt,tn as Rt,tt as zt,u as Bt,un as Vt,ut as Ht,v as Ut,vn as Wt,vt as Gt,w as Kt,wn as qt,wt as P,x as F,xn as I,xt as Jt,y as L,yn as Yt,yt as Xt,z as Zt,zt as Qt}from"./PageHeader.js";import{$ as $t,B as en,G as tn,H as nn,J as rn,K as an,L as on,N as sn,Q as cn,R as ln,U as un,V as dn,W as fn,X as pn,Y as mn,Z as hn,at as gn,et as _n,it as vn,j as yn,nt as bn,ot as xn,q as Sn,rt as Cn,tt as wn,x as Tn,z as En}from"./createLucideIcon.js";var Dn=Object.defineProperty,On=(e,t)=>{let n={};for(var r in e)Dn(n,r,{get:e[r],enumerable:!0});return t||Dn(n,Symbol.toStringTag,{value:`Module`}),n},kn=On({BaseTransition:()=>ot,BaseTransitionPropsValidators:()=>Fe,Comment:()=>Ct,DeprecationTypes:()=>null,EffectScope:()=>Rt,ErrorCodes:()=>Ft,ErrorTypeStrings:()=>He,Fragment:()=>pt,KeepAlive:()=>Bt,ReactiveEffect:()=>bt,Static:()=>Ge,Suspense:()=>Ze,Teleport:()=>Et,Text:()=>gt,TrackOpTypes:()=>Mt,Transition:()=>on,TransitionGroup:()=>ln,TriggerOpTypes:()=>st,VueElement:()=>En,assertNumber:()=>rt,callWithAsyncErrorHandling:()=>et,callWithErrorHandling:()=>Ne,camelize:()=>le,capitalize:()=>_,cloneVNode:()=>Ut,compatUtils:()=>null,compile:()=>An,computed:()=>L,createApp:()=>en,createBlock:()=>F,createCommentVNode:()=>he,createElementBlock:()=>s,createElementVNode:()=>ze,createHydrationRenderer:()=>Kt,createPropsRestProxy:()=>ve,createRenderer:()=>p,createSSRApp:()=>dn,createSlots:()=>u,createStaticVNode:()=>ae,createTextVNode:()=>dt,createVNode:()=>n,customRef:()=>Ie,defineAsyncComponent:()=>lt,defineComponent:()=>k,defineCustomElement:()=>nn,defineEmits:()=>re,defineExpose:()=>ce,defineModel:()=>g,defineOptions:()=>C,defineProps:()=>O,defineSSRCustomElement:()=>un,defineSlots:()=>pe,devtools:()=>Zt,effect:()=>wt,effectScope:()=>It,getCurrentInstance:()=>a,getCurrentScope:()=>Ue,getCurrentWatcher:()=>mt,getTransitionRawChildren:()=>Ce,guardReactiveProps:()=>x,h:()=>xe,handleError:()=>Te,hasInjectionContext:()=>y,hydrate:()=>fn,hydrateOnIdle:()=>ee,hydrateOnInteraction:()=>kt,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>ke,initCustomFormatter:()=>De,initDirectivesForSSR:()=>tn,inject:()=>je,isMemoSame:()=>de,isProxy:()=>Vt,isReactive:()=>Ke,isReadonly:()=>Qe,isRef:()=>Dt,isRuntimeOnly:()=>e,isShallow:()=>_t,isVNode:()=>Xe,markRaw:()=>it,mergeDefaults:()=>zt,mergeModels:()=>St,mergeProps:()=>Pt,nextTick:()=>j,nodeOps:()=>an,normalizeClass:()=>Ye,normalizeProps:()=>xt,normalizeStyle:()=>Nt,onActivated:()=>Re,onBeforeMount:()=>Tt,onBeforeUnmount:()=>Lt,onBeforeUpdate:()=>We,onDeactivated:()=>ht,onErrorCaptured:()=>Ht,onMounted:()=>qe,onRenderTracked:()=>$e,onRenderTriggered:()=>Ot,onScopeDispose:()=>tt,onServerPrefetch:()=>vt,onUnmounted:()=>at,onUpdated:()=>nt,onWatcherCleanup:()=>Pe,openBlock:()=>A,patchProp:()=>Sn,popScopeId:()=>Gt,provide:()=>Xt,proxyRefs:()=>Wt,pushScopeId:()=>Ve,queuePostFlushCb:()=>Jt,reactive:()=>Yt,readonly:()=>Be,ref:()=>I,registerRuntimeCompiler:()=>_e,render:()=>rn,renderList:()=>l,renderSlot:()=>P,resolveComponent:()=>be,resolveDirective:()=>h,resolveDynamicComponent:()=>f,resolveFilter:()=>null,resolveTransitionHooks:()=>se,setBlockTracking:()=>ft,setDevtoolsHook:()=>i,setTransitionHooks:()=>ut,shallowReactive:()=>ge,shallowReadonly:()=>c,shallowRef:()=>qt,ssrContextKey:()=>ne,ssrUtils:()=>ie,stop:()=>ye,toDisplayString:()=>ct,toHandlerKey:()=>Le,toHandlers:()=>ue,toRaw:()=>m,toRef:()=>d,toRefs:()=>oe,toValue:()=>N,transformVNodeArgs:()=>v,triggerRef:()=>r,unref:()=>M,useAttrs:()=>w,useCssModule:()=>mn,useCssVars:()=>pn,useHost:()=>hn,useId:()=>te,useModel:()=>me,useSSRContext:()=>Qt,useShadowRoot:()=>cn,useSlots:()=>o,useTemplateRef:()=>we,useTransitionState:()=>S,vModelCheckbox:()=>$t,vModelDynamic:()=>_n,vModelRadio:()=>wn,vModelSelect:()=>bn,vModelText:()=>Cn,vShow:()=>vn,version:()=>Se,warn:()=>Ee,watch:()=>b,watchEffect:()=>D,watchPostEffect:()=>At,watchSyncEffect:()=>E,withAsyncContext:()=>Ae,withCtx:()=>Oe,withDefaults:()=>Me,withDirectives:()=>fe,Line truncated
|
||||
import{$ as e,$t as t,A as n,An as r,At as i,B as a,Bt as o,C as s,Cn as c,Ct as l,D as u,Dn as d,Dt as f,E as p,En as m,Et as h,F as g,Fn as _,Ft as v,G as y,Gt as b,H as x,Ht as S,I as C,It as w,J as T,Jt as E,K as ee,Kt as D,L as O,Lt as te,M as k,Mt as ne,N as re,Nt as ie,O as ae,On as oe,Ot as se,P as ce,Pn as le,Pt as ue,Q as de,Qt as fe,R as pe,Rt as me,S as he,Sn as ge,St as _e,T as ve,Tn as ye,Tt as be,U as xe,Ut as Se,V as Ce,Vt as we,W as Te,Wt as Ee,X as De,Xt as Oe,Y as ke,Yt as Ae,Z as je,Zt as Me,_ as Ne,_n as Pe,_t as A,a as Fe,an as Ie,ar as Le,at as Re,b as ze,bn as Be,bt as Ve,c as He,cn as Ue,ct as We,d as Ge,dn as Ke,dt as qe,en as Je,er as Ye,et as Xe,f as Ze,fn as Qe,ft as $e,g as et,gn as tt,gt as nt,h as rt,hn as it,ht as at,i as ot,in as st,ir as ct,it as j,j as lt,jn as M,jt as ut,k as dt,kn as N,kt as ft,l as pt,ln as mt,lt as ht,m as gt,mn as _t,mt as vt,n as yt,nn as bt,nr as xt,nt as St,o as Ct,on as wt,ot as Tt,p as Et,pn as Dt,pt as Ot,q as kt,qt as At,r as jt,rn as Mt,rr as Nt,rt as Pt,s as Ft,sn as It,st as Lt,tn as Rt,tt as zt,u as Bt,un as Vt,ut as Ht,v as Ut,vn as Wt,vt as Gt,w as Kt,wn as qt,wt as P,x as F,xn as I,xt as Jt,y as L,yn as Yt,yt as Xt,z as Zt,zt as Qt}from"./PageHeader.js";import{$ as $t,B as en,G as tn,H as nn,I as rn,J as an,K as on,L as sn,P as cn,Q as ln,R as un,U as dn,V as fn,W as pn,X as mn,Y as hn,Z as gn,at as _n,et as vn,it as yn,nt as bn,ot as xn,q as Sn,rt as Cn,tt as wn,x as Tn,z as En}from"./createLucideIcon.js";var Dn=Object.defineProperty,On=(e,t)=>{let n={};for(var r in e)Dn(n,r,{get:e[r],enumerable:!0});return t||Dn(n,Symbol.toStringTag,{value:`Module`}),n},kn=On({BaseTransition:()=>ot,BaseTransitionPropsValidators:()=>Fe,Comment:()=>Ct,DeprecationTypes:()=>null,EffectScope:()=>Rt,ErrorCodes:()=>Ft,ErrorTypeStrings:()=>He,Fragment:()=>pt,KeepAlive:()=>Bt,ReactiveEffect:()=>bt,Static:()=>Ge,Suspense:()=>Ze,Teleport:()=>Et,Text:()=>gt,TrackOpTypes:()=>Mt,Transition:()=>sn,TransitionGroup:()=>un,TriggerOpTypes:()=>st,VueElement:()=>En,assertNumber:()=>rt,callWithAsyncErrorHandling:()=>et,callWithErrorHandling:()=>Ne,camelize:()=>le,capitalize:()=>_,cloneVNode:()=>Ut,compatUtils:()=>null,compile:()=>An,computed:()=>L,createApp:()=>en,createBlock:()=>F,createCommentVNode:()=>he,createElementBlock:()=>s,createElementVNode:()=>ze,createHydrationRenderer:()=>Kt,createPropsRestProxy:()=>ve,createRenderer:()=>p,createSSRApp:()=>fn,createSlots:()=>u,createStaticVNode:()=>ae,createTextVNode:()=>dt,createVNode:()=>n,customRef:()=>Ie,defineAsyncComponent:()=>lt,defineComponent:()=>k,defineCustomElement:()=>nn,defineEmits:()=>re,defineExpose:()=>ce,defineModel:()=>g,defineOptions:()=>C,defineProps:()=>O,defineSSRCustomElement:()=>dn,defineSlots:()=>pe,devtools:()=>Zt,effect:()=>wt,effectScope:()=>It,getCurrentInstance:()=>a,getCurrentScope:()=>Ue,getCurrentWatcher:()=>mt,getTransitionRawChildren:()=>Ce,guardReactiveProps:()=>x,h:()=>xe,handleError:()=>Te,hasInjectionContext:()=>y,hydrate:()=>pn,hydrateOnIdle:()=>ee,hydrateOnInteraction:()=>kt,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>ke,initCustomFormatter:()=>De,initDirectivesForSSR:()=>tn,inject:()=>je,isMemoSame:()=>de,isProxy:()=>Vt,isReactive:()=>Ke,isReadonly:()=>Qe,isRef:()=>Dt,isRuntimeOnly:()=>e,isShallow:()=>_t,isVNode:()=>Xe,markRaw:()=>it,mergeDefaults:()=>zt,mergeModels:()=>St,mergeProps:()=>Pt,nextTick:()=>j,nodeOps:()=>on,normalizeClass:()=>Ye,normalizeProps:()=>xt,normalizeStyle:()=>Nt,onActivated:()=>Re,onBeforeMount:()=>Tt,onBeforeUnmount:()=>Lt,onBeforeUpdate:()=>We,onDeactivated:()=>ht,onErrorCaptured:()=>Ht,onMounted:()=>qe,onRenderTracked:()=>$e,onRenderTriggered:()=>Ot,onScopeDispose:()=>tt,onServerPrefetch:()=>vt,onUnmounted:()=>at,onUpdated:()=>nt,onWatcherCleanup:()=>Pe,openBlock:()=>A,patchProp:()=>Sn,popScopeId:()=>Gt,provide:()=>Xt,proxyRefs:()=>Wt,pushScopeId:()=>Ve,queuePostFlushCb:()=>Jt,reactive:()=>Yt,readonly:()=>Be,ref:()=>I,registerRuntimeCompiler:()=>_e,render:()=>an,renderList:()=>l,renderSlot:()=>P,resolveComponent:()=>be,resolveDirective:()=>h,resolveDynamicComponent:()=>f,resolveFilter:()=>null,resolveTransitionHooks:()=>se,setBlockTracking:()=>ft,setDevtoolsHook:()=>i,setTransitionHooks:()=>ut,shallowReactive:()=>ge,shallowReadonly:()=>c,shallowRef:()=>qt,ssrContextKey:()=>ne,ssrUtils:()=>ie,stop:()=>ye,toDisplayString:()=>ct,toHandlerKey:()=>Le,toHandlers:()=>ue,toRaw:()=>m,toRef:()=>d,toRefs:()=>oe,toValue:()=>N,transformVNodeArgs:()=>v,triggerRef:()=>r,unref:()=>M,useAttrs:()=>w,useCssModule:()=>hn,useCssVars:()=>mn,useHost:()=>gn,useId:()=>te,useModel:()=>me,useSSRContext:()=>Qt,useShadowRoot:()=>ln,useSlots:()=>o,useTemplateRef:()=>we,useTransitionState:()=>S,vModelCheckbox:()=>$t,vModelDynamic:()=>vn,vModelRadio:()=>wn,vModelSelect:()=>bn,vModelText:()=>Cn,vShow:()=>yn,version:()=>Se,warn:()=>Ee,watch:()=>b,watchEffect:()=>D,watchPostEffect:()=>At,watchSyncEffect:()=>E,withAsyncContext:()=>Ae,withCtx:()=>Oe,withDefaults:()=>Me,withDirectives:()=>fe,Line truncated
|
||||
`)].join(`
|
||||
`))}return()=>i.value||r.value||s.value?xe(t.default({present:s.value})[0],{ref:e=>{let t=V(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?o.value=t.firstElementChild:o.value=t),t}}):null}}),$r=`dismissableLayer.pointerDownOutside`,ei=`dismissableLayer.focusOutside`;function ti(e){if(typeof e!=`object`||!e)return!1;let t=e.ownerDocument?.defaultView;return typeof Element<`u`&&e instanceof Element||!!t&&e instanceof t.Element}function ni(e,t){if(!ti(t))return!1;if(e.contains(t))return!0;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function ri(e,t,n=!0){let r=I(!1),i=I(()=>{});return D(a=>{if(!B||!N(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(ni(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){Mn($r,e,t)}n.pointerType===`touch`?(o.removeEventListener(`click`,i.value),i.value=r,o.addEventListener(`click`,i.value,{once:!0})):r()}else o.removeEventListener(`click`,i.value);r.value=!1}}},c=window.setTimeout(()=>{o.addEventListener(`pointerdown`,s)},0);a(()=>{window.clearTimeout(c),o.removeEventListener(`pointerdown`,s),o.removeEventListener(`click`,i.value)})}),{onPointerDownCapture:()=>{N(n)&&(r.value=!0)}}}function ii(e,t,n=!0){let r=I(!1);return D(i=>{if(!B||!N(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await j(),await j();let i=n.target;t.value&&i&&!ni(t.value,i)&&n.target&&!r.value&&Mn(ei,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{N(n)&&(r.value=!0)},onBlurCapture:()=>{N(n)&&(r.value=!1)}}}var H=Yt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ai=k({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Nr(),o=L(()=>a.value?.ownerDocument??globalThis.document),s=L(()=>H.layersRoot),c=L(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=L(()=>H.layersWithOutsidePointerEventsDisabled.size>0),u=L(()=>{let e=Array.from(s.value),[t]=[...H.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=ri(async e=>{let t=[...H.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await j(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=ii(e=>{let t=[...H.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ar(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),b([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;_r(t,e),H.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{H.layersWithOutsidePointerEventsDisabled.delete(e),vr(t,e)})}},{immediate:!0}),b([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),D(e=>{e(()=>{a.value&&(s.value.delete(a.value),H.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(A(),F(M(yn),{ref:M(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:Nt({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:M(f).onFocusCapture,onBlurCapture:M(f).onBlurCapture,onPointerdownCapture:M(d).onPointerDownCapture},{default:Oe(()=>[P(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),oi=Pn(()=>I([]));function si(){let e=oi();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=ci(e.value,t),e.value.unshift(t)},remove(t){e.value=ci(e.value,t),e.value[0]?.resume()}}}function ci(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var li=`focusScope.autoFocusOnMount`,ui=`focusScope.autoFocusOnUnmount`,di={bubbles:!1,cancelable:!0};function fi(e,t){let n=t;for(;n;){if(e.contains(n))return!0;n=n.getRootNode().host??null}return!1}function pi(e,{select:t=!1}={}){let n=R();for(let r of e)if(U(r,{select:t}),R()!==n)return!0}function mi(e){let t=hi(e);return[gi(t,e),gi(t.reverse(),e)]}function hi(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n
Line truncated
|
||||
`))}return()=>i.value||r.value||s.value?xe(t.default({present:s.value})[0],{ref:e=>{let t=V(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?o.value=t.firstElementChild:o.value=t),t}}):null}}),$r=`dismissableLayer.pointerDownOutside`,ei=`dismissableLayer.focusOutside`;function ti(e){if(typeof e!=`object`||!e)return!1;let t=e.ownerDocument?.defaultView;return typeof Element<`u`&&e instanceof Element||!!t&&e instanceof t.Element}function ni(e,t){if(!ti(t))return!1;if(e.contains(t))return!0;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function ri(e,t,n=!0){let r=I(!1),i=I(()=>{});return D(a=>{if(!B||!N(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(ni(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){Mn($r,e,t)}n.pointerType===`touch`?(o.removeEventListener(`click`,i.value),i.value=r,o.addEventListener(`click`,i.value,{once:!0})):r()}else o.removeEventListener(`click`,i.value);r.value=!1}}},c=window.setTimeout(()=>{o.addEventListener(`pointerdown`,s)},0);a(()=>{window.clearTimeout(c),o.removeEventListener(`pointerdown`,s),o.removeEventListener(`click`,i.value)})}),{onPointerDownCapture:()=>{N(n)&&(r.value=!0)}}}function ii(e,t,n=!0){let r=I(!1);return D(i=>{if(!B||!N(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await j(),await j();let i=n.target;t.value&&i&&!ni(t.value,i)&&n.target&&!r.value&&Mn(ei,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{N(n)&&(r.value=!0)},onBlurCapture:()=>{N(n)&&(r.value=!1)}}}var H=Yt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ai=k({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Nr(),o=L(()=>a.value?.ownerDocument??globalThis.document),s=L(()=>H.layersRoot),c=L(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=L(()=>H.layersWithOutsidePointerEventsDisabled.size>0),u=L(()=>{let e=Array.from(s.value),[t]=[...H.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=ri(async e=>{let t=[...H.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await j(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=ii(e=>{let t=[...H.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ar(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),b([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;_r(t,e),H.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{H.layersWithOutsidePointerEventsDisabled.delete(e),vr(t,e)})}},{immediate:!0}),b([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),D(e=>{e(()=>{a.value&&(s.value.delete(a.value),H.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(A(),F(M(cn),{ref:M(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:Nt({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:M(f).onFocusCapture,onBlurCapture:M(f).onBlurCapture,onPointerdownCapture:M(d).onPointerDownCapture},{default:Oe(()=>[P(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),oi=Pn(()=>I([]));function si(){let e=oi();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=ci(e.value,t),e.value.unshift(t)},remove(t){e.value=ci(e.value,t),e.value[0]?.resume()}}}function ci(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var li=`focusScope.autoFocusOnMount`,ui=`focusScope.autoFocusOnUnmount`,di={bubbles:!1,cancelable:!0};function fi(e,t){let n=t;for(;n;){if(e.contains(n))return!0;n=n.getRootNode().host??null}return!1}function pi(e,{select:t=!1}={}){let n=R();for(let r of e)if(U(r,{select:t}),R()!==n)return!0}function mi(e){let t=hi(e);return[gi(t,e),gi(t.reverse(),e)]}function hi(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n
Line truncated
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{t as e}from"./createLucideIcon.js";var t=e({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]});export{t};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{t as e}from"./createLucideIcon.js";var t=e({name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}),n=e({name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]});export{t as n,n as t};
|
||||
Vendored
+2
-2
@@ -1,3 +1,3 @@
|
||||
import{$n as e,A as t,B as n,Bn as r,C as i,Cn as a,Dn as o,E as s,En as c,Fn as l,G as u,Gn as d,Gt as f,Hn as p,Ht as m,In as h,Jn as ee,Kn as g,Ln as _,M as v,Mn as y,Nn as b,On as x,Ot as te,Pn as S,Qn as C,Rn as w,U as T,Un as ne,V as re,Vn as E,Wn as ie,Xn as ae,Xt as oe,Yn as D,Z as se,Zn as O,_t as ce,a as le,an as ue,bn as de,cn as fe,ct as pe,d as me,dt as he,er as k,g as ge,gn as _e,gt as ve,ht as ye,i as be,it as xe,jn as A,jt as Se,kn as Ce,l as we,n as Te,o as Ee,or as De,pn as Oe,qn as j,r as ke,rt as Ae,tr as je,v as Me,w as Ne,wn as Pe,wt as Fe,x as Ie,xn as Le,xt as Re,y as ze,yn as Be,zn as Ve}from"./PageHeader.js";var He=void 0,Ue=typeof window<`u`&&window.trustedTypes;if(Ue)try{He=Ue.createPolicy(`vue`,{createHTML:e=>e})}catch{}var We=He?e=>He.createHTML(e):e=>e,Ge=`http://www.w3.org/2000/svg`,Ke=`http://www.w3.org/1998/Math/MathML`,M=typeof document<`u`?document:null,qe=M&&M.createElement(`template`),Je={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?M.createElementNS(Ge,e):t===`mathml`?M.createElementNS(Ke,e):n?M.createElement(e,{is:n}):M.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>M.createTextNode(e),createComment:e=>M.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>M.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{qe.innerHTML=We(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=qe.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},N=`transition`,P=`animation`,F=Symbol(`_vtc`),Ye={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Xe=h({},le,Ye),Ze=(e=>(e.displayName=`Transition`,e.props=Xe,e))((e,{slots:t})=>T(be,$e(e),t)),I=(e,t=[])=>{E(e)?e.forEach(e=>e(...t)):e&&e(...t)},Qe=e=>e?E(e)?e.some(e=>e.length>1):e.length>1:!1;function $e(e){let t={};for(let n in e)n in Ye||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=et(i),ee=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:y,onLeave:b,onLeaveCancelled:x,onBeforeAppear:te=_,onAppear:S=v,onAppearCancelled:C=y}=t,w=(e,t,n,r)=>{e._enterCancelled=r,R(e,t?u:s),R(e,t?l:o),n&&n()},T=(e,t)=>{e._isLeaving=!1,R(e,d),R(e,p),R(e,f),t&&t()},ne=e=>(t,n)=>{let i=e?S:v,o=()=>w(t,e,n);I(i,[t,o]),nt(()=>{R(t,e?c:a),L(t,e?u:s),Qe(i)||it(t,r,ee,o)})};return h(t,{onBeforeEnter(e){I(_,[e]),L(e,a),L(e,o)},onBeforeAppear(e){I(te,[e]),L(e,c),L(e,l)},onEnter:ne(!1),onAppear:ne(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>T(e,t);L(e,d),e._enterCancelled?(L(e,f),ct(e)):(ct(e),L(e,f)),nt(()=>{e._isLeaving&&(R(e,d),L(e,p),Qe(b)||it(e,r,g,n))}),I(b,[e,n])},onEnterCancelled(e){w(e,!1,void 0,!0),I(y,[e])},onAppearCancelled(e){w(e,!0,void 0,!0),I(C,[e])},onLeaveCancelled(e){T(e),I(x,[e])}})}function et(e){if(e==null)return null;if(ie(e))return[tt(e.enter),tt(e.leave)];{let t=tt(e);return[t,t]}}function tt(e){return De(e)}function L(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[F]||(e[F]=new Set)).add(t)}function R(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[F];n&&(n.delete(t),n.size||(e[F]=void 0))}function nt(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var rt=0;function it(e,t,n,r){let i=e._endId=++rt,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=at(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function at(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${N}Delay`),a=r(`${N}Duration`),o=ot(i,a),s=r(`${P}Delay`),c=r(`${P}Duration`),l=ot(s,c),u=null,d=0,f=0;t===N?o>0&&(u=N,d=o,f=a.length):t===P?l>0&&(u=P,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?N:P:null,f=u?u===N?a.length:c.length:0);let p=u===N&&/\b(?:transform|all)(?:,|$)/.test(r(`${N}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function ot(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(.Line truncated
|
||||
`))),e[q]=K(i);let a=r||i.props&&i.props.type===`number`;W(e,t?`change`:`input`,t=>{t.target.composing||e[q](an(e.value,n,a))}),(n||a)&&W(e,`change`,()=>{e.value=an(e.value,n,a)}),t||(W(e,`compositionstart`,nn),W(e,`compositionend`,rn),W(e,`change`,rn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[J];delete e[J],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[q](an(e.value,n,r)):e.value=i},beforeUpdate(t,{value:n,oldValue:r,modifiers:{lazy:i,trim:a,number:o}},s){if(t[q]=K(s),t.composing)return;let c=(o||t.type===`number`)&&!/^0\d/.test(t.value)?e(t.value):t.value,l=n??``;if(c===l)return;let u=t.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===t&&t.type!==`range`&&(i&&n===r||a&&t.value.trim()===l)||(t.value=l)}},on={deep:!0,created(e,t,n){e[q]=K(n),W(e,`change`,()=>{let t=e._modelValue,n=X(e),r=e.checked,i=e[q];if(E(t)){let e=C(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(j(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(fn(e,r))})},mounted:sn,beforeUpdate(e,t,n){e[q]=K(n),sn(e,t,n)}};function sn(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(E(t))i=C(t,r.props.value)>-1;else if(j(t))i=t.has(r.props.value);else{if(t===n)return;i=O(t,fn(e,!0))}e.checked!==i&&(e.checked=i)}var cn={created(e,{value:t},n){e.checked=O(t,n.props.value),e[q]=K(n),W(e,`change`,()=>{e[q](X(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[q]=K(r),t!==n&&(e.checked=O(t,r.props.value))}},ln={deep:!0,created(t,{value:n,modifiers:{number:r}},i){t._modelValue=n,W(t,`change`,()=>{let n=Array.prototype.filter.call(t.options,e=>e.selected).map(t=>r?e(X(t)):X(t)),i=t.multiple,a=i?j(t._modelValue)?new Set(n):n:n[0],o=t._pendingValue=[i,i?E(a)?n.slice():n:a];try{t[q](a)}finally{xe(()=>{t._pendingValue===o&&(t._pendingValue=void 0)})}}),t[q]=K(i)},mounted(e,{value:t}){dn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[q]=K(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!un(t,n[1],n[0]))&&dn(e,t)}};function un(e,t,n){if(!n||E(e))return O(e,t);if(j(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function dn(e,t){let n=e.multiple,r=E(t);if(!n||r||j(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=X(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):C(t,o)>-1}else a.selected=t.has(o)}else if(O(X(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function X(e){return`_value`in e?e._value:e.value}function fn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var pn={created(e,t,n){hn(e,t,n,null,`created`)},mounted(e,t,n){hn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){hn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){hn(e,t,n,r,`updated`)}};function mn(e,t){switch(e){case`SELECT`:return ln;case`TEXTAREA`:return Y;default:switch(t){case`checkbox`:return on;case`radio`:return cn;default:return Y}}}function hn(e,t,n,r,i){let a=mn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function gn(){Y.getSSRProps=({value:e})=>({value:e}),cn.getSSRProps=({value:e},t)=>{if(t.props&&O(t.props.value,e))return{checked:!0}},on.getSSRProps=({value:e},t)=>{if(E(e)){if(t.props&&C(e,t.props.value)>-1)return{checked:!0}}else if(j(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},pn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=mn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var _n=[`ctrl`,`shift`,`alt`,`meta`],vn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>_n.some(n=>e[`${n}Key`]&&!t.includes(n))},yn=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=vn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},bn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},xn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=w(n.key);if(t.some(e=>e===r||bn[e]===r))return e(n)}))},Sn=h({patchProp:It},Je),Cn,wn=!1;function Tn(){return Cn||=s(Sn)}function En(){return Cn=wn?Cn:Ne(Sn),wn=!0,Cn}var Dn=((...e)=>{Tn().render(...e)}),On=((...e)=>{En().hydrate(...e)}),kn=((...e)=>{let t=Tn().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Mn(e);if(!r)return;let i=t._component;!p(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,jn(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),An=((...e)=>{let t=En().createApp(...e),{mount:n}=t;return t
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ar;function jr(e){Ar=e}var Mr=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Nr(e){let t=e instanceof Mr?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Pr(e,t){let n=await fetch(e,t);if(Ar?.(n.status===401),!n.ok)throw new Mr(await kr(n),n.status);return n}async function Q(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Or,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Pr(e,s);return a?await c.json():void 0}var Fr={recoveryCode:()=>Q(`/api/account/recovery`,{method:`POST`,body:{}}),recoverAccount:(e,t,n)=>Q(`/api/auth/recover`,{method:`POST`,body:{email:e,code:t,password:n},parse:!1}),authStatus:()=>Q(`/api/auth/status`),setupAccount:e=>Q(`/api/auth/setup`,{method:`POST`,body:e}),signIn:(e,t)=>Q(`/api/auth/login`,{method:`POST`,body:{email:e,password:t}}),signOut:()=>Q(`/api/auth/logout`,{method:`POST`,body:{},parse:!1}),createAccount:e=>Q(`/api/accounts`,{method:`POST`,body:e}),changePassword:(e,t)=>Q(`/api/account/password`,{method:`POST`,body:{current_password:e,new_password:t},parse:!1}),authentication:()=>Q(`/api/authentication`),saveAuthentication:e=>Q(`/api/authentication`,{method:`PUT`,body:e,parse:!1}),tokens:()=>Q(`/api/tokens`),createToken:()=>Q(`/api/tokens`,{method:`POST`,body:{}}),revokeToken:e=>Q(`/api/tokens/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),passkeys:()=>Q(`/api/account/passkeys`),deletePasskey:e=>Q(`/api/account/passkeys/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),beginPasskey:e=>Q(e?`/api/account/passkeys/begin`:`/api/auth/passkey/begin`,{method:`POST`,body:{}}),finishPasskey:(e,t,n)=>Q(e?`/api/account/passkeys/finish`:`/api/auth/passkey/finish`,{method:`POST`,body:{credential:t,name:n}}),secretEngines:()=>Q(`/api/secret-engines`),checkSecret:e=>Q(`/api/secret-references/check`,{method:`POST`,body:e}),health:()=>Q(`/health/detailed`),services:()=>Q(`/api/services`),policies:()=>Q(`/api/access/policies`),putPolicy:e=>Q(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Q(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),schedules:()=>Q(`/api/schedules`),scheduleSave:(e,t)=>Q(`/api/schedules/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),scheduleDelete:e=>Q(`/api/schedules/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),scheduleRunNow:e=>Q(`/api/schedules/${encodeURIComponent(e)}/runs`,{method:`POST`,body:{}}),scheduleRuns:e=>Q(`/api/schedules/${encodeURIComponent(e)}/runs`),orgs:()=>Q(`/api/orgs`),orgCreate:e=>Q(`/api/orgs`,{method:`POST`,body:e}),org:e=>Q(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>Q(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>Q(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgAgents:e=>Q(`/api/orgs/${encodeURIComponent(e)}/agents`),orgMembers:e=>Q(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>Q(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>Q(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>Q(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Z({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>Q(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>Q(`/api/alerts`),dismissAlert:e=>Q(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>Q(`/api/identities`),identityCreate:e=>Q(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>Q(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>Q(`/api/summary`),tasks:()=>Q(`/api/tasks`),taskPage:async e=>{let t=await Pr(`/api/tasks`+Z(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Or)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>Q(`/api/task-meta`),task:e=>Q(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Q(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Q(`/api/tasks/${encodeURIComponent(e)}/changes`+Z(t)),taskDebug:(e,t)=>Q(`/api/tasks/${encodeURIComponent(e)}/debug`+Z(t)),taskAction:(e,t,n)=>Q(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Q(`/api/setup`),capabilities:()=>Q(`/api/capabilities`),workflows:()=>Q(`/api/workflows`),workflowEnabled:(e,t)=>Q(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),checkRepository:e=>Q(`/api/control-plane/resources/repository-policies/check`,{method:`POSLine truncated
|
||||
`))),e[q]=K(i);let a=r||i.props&&i.props.type===`number`;W(e,t?`change`:`input`,t=>{t.target.composing||e[q](an(e.value,n,a))}),(n||a)&&W(e,`change`,()=>{e.value=an(e.value,n,a)}),t||(W(e,`compositionstart`,nn),W(e,`compositionend`,rn),W(e,`change`,rn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[J];delete e[J],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[q](an(e.value,n,r)):e.value=i},beforeUpdate(t,{value:n,oldValue:r,modifiers:{lazy:i,trim:a,number:o}},s){if(t[q]=K(s),t.composing)return;let c=(o||t.type===`number`)&&!/^0\d/.test(t.value)?e(t.value):t.value,l=n??``;if(c===l)return;let u=t.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===t&&t.type!==`range`&&(i&&n===r||a&&t.value.trim()===l)||(t.value=l)}},on={deep:!0,created(e,t,n){e[q]=K(n),W(e,`change`,()=>{let t=e._modelValue,n=X(e),r=e.checked,i=e[q];if(E(t)){let e=C(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(j(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(fn(e,r))})},mounted:sn,beforeUpdate(e,t,n){e[q]=K(n),sn(e,t,n)}};function sn(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(E(t))i=C(t,r.props.value)>-1;else if(j(t))i=t.has(r.props.value);else{if(t===n)return;i=O(t,fn(e,!0))}e.checked!==i&&(e.checked=i)}var cn={created(e,{value:t},n){e.checked=O(t,n.props.value),e[q]=K(n),W(e,`change`,()=>{e[q](X(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[q]=K(r),t!==n&&(e.checked=O(t,r.props.value))}},ln={deep:!0,created(t,{value:n,modifiers:{number:r}},i){t._modelValue=n,W(t,`change`,()=>{let n=Array.prototype.filter.call(t.options,e=>e.selected).map(t=>r?e(X(t)):X(t)),i=t.multiple,a=i?j(t._modelValue)?new Set(n):n:n[0],o=t._pendingValue=[i,i?E(a)?n.slice():n:a];try{t[q](a)}finally{xe(()=>{t._pendingValue===o&&(t._pendingValue=void 0)})}}),t[q]=K(i)},mounted(e,{value:t}){dn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[q]=K(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!un(t,n[1],n[0]))&&dn(e,t)}};function un(e,t,n){if(!n||E(e))return O(e,t);if(j(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function dn(e,t){let n=e.multiple,r=E(t);if(!n||r||j(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=X(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):C(t,o)>-1}else a.selected=t.has(o)}else if(O(X(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function X(e){return`_value`in e?e._value:e.value}function fn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var pn={created(e,t,n){hn(e,t,n,null,`created`)},mounted(e,t,n){hn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){hn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){hn(e,t,n,r,`updated`)}};function mn(e,t){switch(e){case`SELECT`:return ln;case`TEXTAREA`:return Y;default:switch(t){case`checkbox`:return on;case`radio`:return cn;default:return Y}}}function hn(e,t,n,r,i){let a=mn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function gn(){Y.getSSRProps=({value:e})=>({value:e}),cn.getSSRProps=({value:e},t)=>{if(t.props&&O(t.props.value,e))return{checked:!0}},on.getSSRProps=({value:e},t)=>{if(E(e)){if(t.props&&C(e,t.props.value)>-1)return{checked:!0}}else if(j(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},pn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=mn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var _n=[`ctrl`,`shift`,`alt`,`meta`],vn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>_n.some(n=>e[`${n}Key`]&&!t.includes(n))},yn=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=vn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},bn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},xn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=w(n.key);if(t.some(e=>e===r||bn[e]===r))return e(n)}))},Sn=h({patchProp:It},Je),Cn,wn=!1;function Tn(){return Cn||=s(Sn)}function En(){return Cn=wn?Cn:Ne(Sn),wn=!0,Cn}var Dn=((...e)=>{Tn().render(...e)}),On=((...e)=>{En().hydrate(...e)}),kn=((...e)=>{let t=Tn().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Mn(e);if(!r)return;let i=t._component;!p(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,jn(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),An=((...e)=>{let t=En().createApp(...e),{mount:n}=t;return t
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ar;function jr(e){Ar=e}var Mr=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Nr(e){let t=e instanceof Mr?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Pr(e,t){let n=await fetch(e,t);if(Ar?.(n.status===401),!n.ok)throw new Mr(await kr(n),n.status);return n}async function Q(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Or,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Pr(e,s);return a?await c.json():void 0}var Fr={recoveryCode:()=>Q(`/api/account/recovery`,{method:`POST`,body:{}}),recoverAccount:(e,t,n)=>Q(`/api/auth/recover`,{method:`POST`,body:{email:e,code:t,password:n},parse:!1}),authStatus:()=>Q(`/api/auth/status`),setupAccount:e=>Q(`/api/auth/setup`,{method:`POST`,body:e}),signIn:(e,t)=>Q(`/api/auth/login`,{method:`POST`,body:{email:e,password:t}}),signOut:()=>Q(`/api/auth/logout`,{method:`POST`,body:{},parse:!1}),createAccount:e=>Q(`/api/accounts`,{method:`POST`,body:e}),changePassword:(e,t)=>Q(`/api/account/password`,{method:`POST`,body:{current_password:e,new_password:t},parse:!1}),authentication:()=>Q(`/api/authentication`),saveAuthentication:e=>Q(`/api/authentication`,{method:`PUT`,body:e,parse:!1}),tokens:()=>Q(`/api/tokens`),createToken:()=>Q(`/api/tokens`,{method:`POST`,body:{}}),revokeToken:e=>Q(`/api/tokens/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),passkeys:()=>Q(`/api/account/passkeys`),deletePasskey:e=>Q(`/api/account/passkeys/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),beginPasskey:e=>Q(e?`/api/account/passkeys/begin`:`/api/auth/passkey/begin`,{method:`POST`,body:{}}),finishPasskey:(e,t,n)=>Q(e?`/api/account/passkeys/finish`:`/api/auth/passkey/finish`,{method:`POST`,body:{credential:t,name:n}}),secretEngines:()=>Q(`/api/secret-engines`),checkSecret:e=>Q(`/api/secret-references/check`,{method:`POST`,body:e}),health:()=>Q(`/health/detailed`),services:()=>Q(`/api/services`),policies:()=>Q(`/api/access/policies`),putPolicy:e=>Q(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Q(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),schedules:()=>Q(`/api/schedules`),scheduleSave:(e,t)=>Q(`/api/schedules/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),scheduleDelete:e=>Q(`/api/schedules/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),scheduleRunNow:e=>Q(`/api/schedules/${encodeURIComponent(e)}/runs`,{method:`POST`,body:{}}),scheduleRuns:e=>Q(`/api/schedules/${encodeURIComponent(e)}/runs`),orgs:()=>Q(`/api/orgs`),orgCreate:e=>Q(`/api/orgs`,{method:`POST`,body:e}),org:e=>Q(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>Q(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>Q(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgAgents:e=>Q(`/api/orgs/${encodeURIComponent(e)}/agents`),orgMembers:e=>Q(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>Q(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>Q(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>Q(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Z({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>Q(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>Q(`/api/alerts`),dismissAlert:e=>Q(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>Q(`/api/identities`),identityCreate:e=>Q(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>Q(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>Q(`/api/summary`),tasks:()=>Q(`/api/tasks`),taskPage:async e=>{let t=await Pr(`/api/tasks`+Z(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Or)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>Q(`/api/task-meta`),task:e=>Q(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Q(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Q(`/api/tasks/${encodeURIComponent(e)}/changes`+Z(t)),taskDebug:(e,t)=>Q(`/api/tasks/${encodeURIComponent(e)}/debug`+Z(t)),taskAction:(e,t,n)=>Q(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Q(`/api/setup`),capabilities:()=>Q(`/api/capabilities`),workflows:()=>Q(`/api/workflows`),workflowEnabled:(e,t)=>Q(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),checkRepository:e=>Q(`/api/control-plane/resources/repository-policies/check`,{method:`POSLine truncated
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
var e=[`INPUT`,`TEXTAREA`];function t(t,r,i,a={}){if(!r||a.enableIgnoredElement&&e.includes(r.nodeName))return null;let{arrowKeyOptions:o=`both`,attributeName:s=`[data-reka-collection-item]`,itemsArray:c=[],loop:l=!0,dir:u=`ltr`,preventScroll:d=!0,focus:f=!1}=a,[p,m,h,g,_,v]=[t.key===`ArrowRight`,t.key===`ArrowLeft`,t.key===`ArrowUp`,t.key===`ArrowDown`,t.key===`Home`,t.key===`End`],y=h||g,b=p||m;if(!_&&!v&&(!y&&!b||o===`vertical`&&b||o===`horizontal`&&y))return null;let x=i?Array.from(i.querySelectorAll(s)):c;if(!x.length)return null;d&&t.preventDefault();let S=null;return b||y?S=n(x,r,{goForward:y?g:u===`ltr`?p:m,loop:l}):_?S=x.at(0)||null:v&&(S=x.at(-1)||null),f&&S?.focus(),S}function n(e,t,r,i=e.includes(t)?e.length:e.length+1){if(--i===0)return null;let a=e.indexOf(t),o;if(o=a===-1?r.goForward?0:e.length-1:r.goForward?a+1:a-1,!r.loop&&(o<0||o>=e.length))return null;let s=e[(o+e.length)%e.length];return s?s.hasAttribute(`disabled`)&&s.getAttribute(`disabled`)!==`false`?n(e,s,r,i):s:null}var r={ns:1e-6,us:.001,µs:.001,ms:1,s:1e3,m:6e4,h:36e5},i=[`ms`,`s`,`m`,`h`];function a(e){let t=e.trim();if(t===`0`)return 0;let n=t.startsWith(`-`)?-1:1,i=t.replace(/^[-+]/,``);if(i===``)return null;let a=/(\d+(?:\.\d*)?|\.\d+)(ns|us|µs|ms|s|m|h)/gy,o=0,s=0,c;for(;(c=a.exec(i))!==null;)o+=Number(c[1])*r[c[2]],s=a.lastIndex;return s===i.length?n*o:null}function o(e){return Number(e.toFixed(9)).toString()}function s(e){if(e===0)return`0s`;let t=e<0?`-`:``,n=Math.abs(e);if(n<1e3)return`${t}${o(n)}ms`;let r=Math.floor(n/36e5);n-=r*36e5;let i=Math.floor(n/6e4);n-=i*6e4;let a=`${o(n/1e3)}s`;return r>0?`${t}${r}h${i}m${a}`:i>0?`${t}${i}m${a}`:`${t}${a}`}function c(e){for(let t of[`h`,`m`,`s`]){let n=r[t];if(e!==0&&e%n===0)return{value:e/n,unit:t}}return e===0?{value:0,unit:`s`}:{value:e,unit:`ms`}}function l(e,t){return e*r[t]}export{c as a,a as i,s as n,t as o,l as r,i as t};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharLine truncated
|
||||
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharLine truncated
|
||||
Vendored
+102
-102
@@ -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/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 _,g as v,h as y,i as b,k as x,l as S,m as C,o as w,p as T,r as ee,s as E,t as D,u as O,v as te,w as ne,x as re,y as ie}from"./badge.js";import{$t as ae,A as k,B as oe,Bt as se,C as A,Ct as j,D as ce,Dn as M,Dt as le,Gt as N,H as ue,It as de,Jt as fe,Kt as pe,Lt as me,M as P,On as he,Pt as ge,Q as _e,Qt as ve,Rt as ye,S as F,Sn as be,T as xe,Tt as Se,U as Ce,Vt as we,Xt as I,Z as Te,_t as L,an as Ee,b as R,bn as De,cn as Oe,dt as ke,er as z,gn as Ae,hn as je,ht as Me,ir as B,it as Ne,jn as V,k as H,kn as Pe,l as U,m as Fe,n as W,nr as Ie,nt as Le,o as Re,ot as ze,p as Be,pn as Ve,r as He,rr as Ue,rt as G,sn as We,st as Ge,t as Ke,wn as qe,wt as K,x as q,xn as J,y as Y,yn as Je,yt as Ye}from"./PageHeader.js";import{A as X,B as Xe,F as Ze,I as Qe,L as $e,P as et,T as tt,at as nt,i as rt,it,j as at,k as ot,n as st,ot as ct,r as Z,s as lt,t as ut,x as dt}from"./createLucideIcon.js";import{n as ft,r as pt,t as mt}from"./pinia.js";import{A as ht,B as gt,C as _t,D as vt,E as yt,F as bt,G as xt,H as St,I as Ct,K as wt,L as Tt,M as Et,N as Dt,O as Ot,P as kt,R as At,S as jt,T as Mt,U as Nt,V as Pt,W as Ft,_ as It,b as Lt,c as Rt,d as zt,f as Bt,g as Vt,h as Ht,j as Ut,k as Wt,l as Gt,m as Kt,n as qt,o as Jt,p as Yt,q as Xt,r as eee,s as Zt,u as Qt,v as $t,w as en,x as tn,y as nn,z as rn}from"./schedule.js";import{n as an,t as on}from"./nullish.js";import{i as sn,n as cn,r as ln,t as un}from"./VisuallyHidden.js";import{_ as dn,a as fn,c as pn,d as mn,f as hn,g as gn,h as _n,i as vn,l as yn,m as bn,n as xn,o as Sn,p as Cn,r as tee,s as wn,t as Tn,u as En}from"./HistoryLink.js";import{i as Dn,n as On,o as kn}from"./duration.js";import{g as An,h as jn,t as Mn,u as Nn}from"./Collection.js";import{a as Pn,c as Fn,i as In,l as Ln,n as Rn,o as zn,r as Bn,s as Vn,t as Hn}from"./select.js";import{t as Un}from"./label.js";import{a as Wn,d as Gn,f as Kn,i as qn,l as Jn,n as Yn,o as Xn,r as Zn,s as nee,t as Q,u as Qn}from"./input.js";import{t as $n}from"./check.js";import{n as er,t as tr}from"./chevron-up.js";import{t as nr}from"./textarea.js";import{a as rr,i as ir,n as ar,o as or,r as sr,s as cr,t as lr}from"./table.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 kt(e)?Vr(e,t):kt(t)?Vr(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function Vr(e,t){return kt(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function Hr(e,t){if(Dt(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(`/`)}vaLine 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/AuthenticationPage.js","assets/CredentialBindingsPage.js","assets/SchedulesPage.js","assets/badge.js","assets/pinia.js","assets/ScheduleRunsPage.js","assets/PlaybooksPage.js","assets/AgentProfilesPage.js","assets/HarnessPage.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,O as l,P as u,R as d,S as f,T as p,_ as m,a as h,b as g,c as _,d as v,f as y,g as b,h as x,i as S,j as ee,k as C,l as te,m as w,n as T,o as E,p as D,r as ne,s as re,t as O,u as k,v as ie,w as ae,x as oe,y as se}from"./badge.js";import{$t as ce,A,B as le,Bt as ue,C as j,Ct as M,D as de,Dn as fe,Dt as pe,En as me,Gt as N,H as he,It as ge,Jt as _e,Kt as ve,Lt as ye,M as P,On as be,Pt as xe,Q as Se,Qt as Ce,Rt as we,S as F,Sn as Te,T as Ee,Tt as De,U as Oe,Vt as ke,Xt as I,Z as Ae,_t as L,an as je,b as R,bn as Me,cn as Ne,dt as Pe,er as z,gn as Fe,hn as Ie,ht as Le,ir as B,it as Re,jn as V,k as H,kn as ze,l as U,m as Be,n as W,nr as Ve,nt as He,o as Ue,ot as We,p as Ge,pn as Ke,r as qe,rr as Je,rt as G,sn as Ye,st as Xe,t as Ze,tt as Qe,wn as $e,wt as K,x as q,xn as J,y as Y,yn as et,yt as tt}from"./PageHeader.js";import{A as nt,B as rt,L as it,M as at,N as X,P as ot,T as st,a as ct,at as lt,c as ut,i as dt,it as ft,j as pt,k as mt,n as ht,nt as eee,o as gt,ot as _t,r as Z,rt as vt,s as yt,t as bt,x as xt}from"./createLucideIcon.js";import{n as St,r as Ct,t as wt}from"./pinia.js";import{n as Tt,t as Et}from"./nullish.js";import{i as Dt,n as Ot,r as kt,t as At}from"./VisuallyHidden.js";import{_ as tee,a as jt,c as Mt,d as Nt,f as Pt,g as Ft,h as It,i as Lt,l as Rt,m as zt,n as Bt,o as Vt,p as Ht,r as Ut,s as Wt,t as Gt,u as Kt}from"./Collection.js";import{a as qt,c as Jt,d as Yt,f as nee,i as ree,l as iee,n as aee,o as oee,p as see,r as Xt,s as cee,t as Q,u as lee}from"./input.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)}})();function uee(e,t,n){let r=e.findIndex(e=>Tt(e,t)),i=e.findIndex(e=>Tt(e,n));if(r===-1||i===-1)return[];let[a,o]=[r,i].sort((e,t)=>e-t);return e.slice(a,o+1)}function Zt(e,t){return Et(e)?!1:Array.isArray(e)?e.some(e=>Tt(e,t)):Tt(e,t)}var Qt=[`INPUT`,`TEXTAREA`];function $t(e,t,n,r={}){if(!t||r.enableIgnoredElement&&Qt.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=en(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function en(e,t,n,r=e.includes(t)?e.length:e.length+1){if(--r===0)return null;let i=e.indexOf(t),a;if(a=i===-1?n.goForward?0:e.length-1:n.goForward?i+1:i-1,!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?en(e,o,n,r):o:null}var tn=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}]/u,nn=/android/i;function rn(){return typeof navigator<`u`&&nn.test(navigator.userAgent)}function an(e){let t=J(!1),n=J(!0),r=J(!1),i=Y(()=>t.value&&n.value);function a(){t.value=!0,n.value=!0,r.value=!1}function o(e){e.data&&(tn.test(e.data)?(n.value=!0,r.value=!0):rn()&&!r.value&&(n.value=!1))}function s(n){Re(()=>{t.value=!1,e?.(n)})}return{isComposing:t,shouldDeferInput:i,handleCompositionStart:a,handleCompositionUpdate:o,handleCompositionEnd:s}}function on(e){let t=Y(()=>V(e)),n=Y(()=>new Intl.Collator(`en`,{usage:`search`,...t.value}));return{startsWith:(e,t)=>t.length===0||(e=e.normalize(`NFC`),t=t.normalize(`NFC`),n.value.compare(e.slice(0,t.length),t)===0),endsWith:(e,t)=>t.length===0||(e=e.normalize(`NFC`),t=t.normalize(`NFC`),n.value.compare(e.slice(-t.length),t)===0),contains:(e,t)=>{if(t.length===0)return!0;if(e=e.normalize(`NFC`),t=t.normalize(`NFC`),t.length>e.length)return!1;let r=n.value.compare;if(e.includes(t))return!0;let i=t.length;for(let n=0;n+i<=e.length;n++)if(r(t,e.slice(n,n+i))===0)return!0;return!1}}}function sn(){let e=le()?.vnode?.scopeId;return e?{[e]:``}:{}}function cn(e,t){let r=s(!1,300);c(()=>{r.value=!1});let i=J(null),a=n();function o(){i.value=null,r.value=!1}function l(e,t){if(!t)return;let n=e.currentTarget,a={x:e.clientX,y:e.clientY},o=un(a,ln(a,n.getBoundingClientRect()),1),s=dn(t.getBoundingClientRect()),c=pn([...o,...s]);i.value=c,r.value=!0}returnLine 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&&(du.value=n.session_id),n.type===`delta`&&(o+=n.text,_u.value=_u.value?{..._u.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],_u.value=_u.value?{..._u.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),_u.value=_u.value?{..._u.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`);fu.value=!i&&n.trim()===`/new`?[]:[...fu.value,{from:`assistant`,text:o,tool_calls:a}],_u.value=null,mu.value=`Ready`,await ku()}catch(e){let t=e;o&&(fu.value=[...fu.value,{from:`assistant`,text:o,tool_calls:a}],a=[]),t.name===`AbortError`&&!c?(_u.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},mu.value=`Stopped`):(_u.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?au(r):void 0,isRetry:i},mu.value=`Error. Retry available.`)}finally{clearTimeout(l),cu=null,Du=null,hu.value=!1,Lu.after?.()}}function Ju(){mu.value=`Stopping…`,du.value&&Z.chatCancel(du.value).catch(()=>{}),Ou()}function Yu(){ke(()=>{ku().catch(e=>{mu.value=e.message||`Chat unavailable`})}),Me(()=>{Ou()})}async function Xu(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 qu({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var Zu={class:`grid gap-1 p-1`},Qu={key:0,class:`text-xs text-fg-subtle`},$u=`__default__`,ed=P({__name:`ChatSettings`,setup(e){let t=Y(()=>yu.value||$u),n=Y(()=>{let e=vu.value.models_by_provider||{},t=Object.entries(e).filter(([,e])=>e.length);return t.length?t:[[``,vu.value.models||[]]]});return(e,r)=>(L(),A(`div`,Zu,[V(mu)===`Ready`?F(``,!0):(L(),A(`span`,Qu,B(V(mu)),1)),k(V(Vn),{"model-value":t.value,"onUpdate:modelValue":r[0]||=e=>V(Iu)(e===$u?``:String(e??``))},{default:I(()=>[k(V(Rn),{size:`sm`,class:`w-full`,"aria-label":`Model`},{default:I(()=>[k(V(Hn))]),_:1}),k(V(zn),null,{default:I(()=>[k(V(In),{value:$u},{default:I(()=>[...r[1]||=[H(`Default`,-1)]]),_:1}),(L(!0),A(U,null,j(n.value,([e,t])=>(L(),q(V(Pn),{key:e},{default:I(()=>[e?(L(),q(V(Bn),{key:0},{default:I(()=>[H(B(e),1)]),_:2},1024)):F(``,!0),(L(!0),A(U,null,j(t,e=>(L(),q(V(In),{key:e,value:e},{default:I(()=>[H(B(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[`model-value`])]))}}),td=P({__name:`ChatSessionActions`,setup(e){let t=J(!1);Tu(t);function n(e){t.value=!1,Pu(e)}function r(e,n){t.value=!1,Fu(e,n)}return(e,i)=>(L(),q(V(_n),{open:t.value,"onUpdate:open":i[5]||=e=>t.value=e},{default:I(()=>[k(V(Cn),{"as-child":``},{default:I(()=>[k(V(X),{variant:`ghost`,size:`icon-sm`,class:`flex-none`,"aria-label":`More`,title:`More`},{default:I(()=>[k(V(Yc))]),_:1})]),_:1}),k(V(bn),{align:`end`,class:`grid w-64 gap-0.5 p-1`},{default:I(()=>[V(du)?(L(),A(U,{key:0},[k(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[0]||=e=>n(`/retry`)},{default:I(()=>[k(V(Ol),{"data-icon":`inline-start`}),i[6]||=H(`Retry`,-1)]),_:1}),k(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[1]||=e=>n(`/undo`)},{default:I(()=>[k(V(Hl),{"data-icon":`inline-start`}),i[7]||=H(`Undo`,-1)]),_:1}),k(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[2]||=e=>r(`/title`,`Session title`)},{default:I(()=>[k(V(Sl),{"data-icon":`inline-start`}),i[8]||=H(`Rename`,-1)]),_:1}),k(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[3]||=e=>r(`/branch`,`Branch name (optional)`)},{default:I(()=>[k(V(rl),{"data-icon":`inline-start`}),i[9]||=H(`Branch`,-1)]),_:1}),k(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[4]||=e=>n(`/compress --preview`)},{default:I(()=>[k(V(Pl),{"data-icon":`inline-start`}),i[10]||=H(`Preview compression`,-1)]),_:1}),k(V(Yl),{class:`my-1`})],64)):F(``,!0),k(ed)]),_:1})]),_:1},8,[`open`]))}}),nd=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`});function rd(e){return e.title||e.branch_name||(e.created_at?nd.format(new Date(e.created_at)):`New chat`)}var id={class:`min-w-0 flex-1`},ad=P({__name:`ChatSessionList`,setup(e){return(e,t)=>(L(),A(`div`,id,[k(V(Vn),{"model-value":V(du),disabled:!V(uu).length,"onUpdate:modelValue":t[0]||=e=>V(Au)(String(e))},{default:I(()=>[k(V(Rn),{size:`sm`,class:`w-full`,"aria-label":`Conversation`},{default:I(()=>[k(V(Hn),{placeholder:`No conversations yet`})]),_:1}),k(V(zn),null,{default:I(()=>[k(V(Pn),null,{default:I(()=>[(L(!0),A(U,null,j(V(uu),e=>(L(),q(V(In),{key:e.session_id,value:e.session_id},{default:I(()=>[H(B(V(rd)(e)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`,`disabled`])]))}}),od={class:`flex items-center gap-1 border-b px-3 py-2`},sd=P({__name:`ChatBar`,setup(e){return(e,t)=>(L(),A(`div`,od,[k(ad),k(V(X),{variant:`ghost`,size:`icon-sm`,class:`flex-none`,title:`New chat`,"aria-la
Line truncated
|
||||
`))],64)):K(n.$slots,`default`,{},void 0,void 0,1)])],10,zf))}}),Hf=P({__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!==Re){if(n.type===Fe)t+=n.children;else if(n.type===U&&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)=>(L(),q(V(at),{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:z(V(W)(`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:I(()=>[k(V(at),{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:I(()=>[(L(!0),A(U,null,j([i()],(e,t)=>(L(),A(U,{key:t},[e?(L(!0),A(U,{key:0},j(e,(e,t)=>(L(),q(Vf,{key:t},{default:I(()=>[H(B(e),1)]),_:2},1024))),128)):K(n.$slots,`default`,{},void 0,void 0,1)],64))),128))]),_:3})]),_:3},8,[`data-wrap`,`data-numbered`,`style`,`class`]))}}),Uf={"aria-live":`polite`,class:`sr-only`},Wf=P({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}=Xn({copiedDuring:2e3,legacy:!0});return(i,a)=>(L(),A(U,null,[k(V(X),G(i.$attrs,{"data-slot":`code-block-copy-button`,"data-copied":V(r)||void 0,as:e.as,"as-child":e.asChild,variant:e.variant,size:e.size,"aria-label":V(r)?`Copied`:`Copy`,class:V(W)(``,t.class),onClick:a[0]||=e=>V(n)(t.value)}),{default:I(()=>[V(r)?(L(),q(V($n),{key:0})):(L(),q(V(Kc),{key:1}))]),_:1},16,[`data-copied`,`as`,`as-child`,`variant`,`size`,`aria-label`,`class`]),R(`span`,Uf,B(V(r)?`Copied`:``),1)],64))}}),Gf=P({__name:`CodeBlockToken`,props:{token:{}},setup(e){return(t,n)=>(L(),A(`span`,{style:Ue(e.token.htmlStyle),class:`text-(--shiki-light) dark:text-(--shiki-dark)`},B(e.token.content),5))}}),Kf=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function qf(e){return Jf(e)}function Jf(e){return Array.isArray(e)?Yf(e):e instanceof RegExp?e:typeof e==`object`?Xf(e):e}function Yf(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Jf(e[n]);return t}function Xf(e){let t={};for(let n in e)t[n]=Jf(e[n]);return t}function Zf(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Qf(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Qf(e.substring(0,e.length-1)):e.substr(~t+1)}var $f=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ep=class{static hasCaptures(e){return e!==null&&($f.lastIndex=0,$f.test(e))}static replaceCaptures(e,t,n){return e.replace($f,(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 tp(e,t){return e<t?-1:+(e>t)}function np(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=tp(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function rp(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 ip(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var ap=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}},op=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(dp(e),t)}static createFromParsedTheme(e,t){return mp(e,t)}_cachedMatchRoot=new ap(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=>cp(e.parent,t.parentScopes));return n?new up(n.fontStyle,n.foreground,n.background):null}},sp=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 cp(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&&!lp(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function lp(
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}},nm=class{constructor(e,t){this.languageId=e,this.tokenType=t}},rm=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new nm(e,8),this._embeddedLanguagesMatcher=new im(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 nm(0,0);_getBasicScopeAttributes=new ap(e=>new nm(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/},im=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])=>ip(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 am=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function om(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=sm(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 am(i,!0);f()}return new am(i,!1);function f(){let o=cm(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===Hp){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),pm(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 Xp){let r=o;pm(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 Zp){let r=o;pm(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(pm(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 sm(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 Zp&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=fm(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Up){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),pm(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 cm(e,t,n,r,i,a){let o=lm(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=um(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 lm(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=dm(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 um(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}=dm(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 dm(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function fm(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function pm(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 wm(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=om(this,a,i,0,t,s,!0,r);return Tp(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function bm(e,t){return e=qf(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 xm=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=sp.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new sp(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new sp(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),yp.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}},Sm=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)?xm.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:Gp(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=xm.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Wp(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,xm.fromExtension(r,n.contentNameScopesList))}},Cm=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Sp(e,_m).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Sp(e,_m).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}},wm=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&&(Ru.value=n.session_id),n.type===`delta`&&(o+=n.text,Wu.value=Wu.value?{...Wu.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Wu.value=Wu.value?{...Wu.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Wu.value=Wu.value?{...Wu.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`);zu.value=!i&&n.trim()===`/new`?[]:[...zu.value,{from:`assistant`,text:o,tool_calls:a}],Wu.value=null,Vu.value=`Ready`,await ed()}catch(e){let t=e;o&&(zu.value=[...zu.value,{from:`assistant`,text:o,tool_calls:a}],a=[]),t.name===`AbortError`&&!c?(Wu.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Vu.value=`Stopped`):(Wu.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Pu(r):void 0,isRetry:i},Vu.value=`Error. Retry available.`)}finally{clearTimeout(l),Fu=null,Qu=null,Hu.value=!1,od.after?.()}}function Gte(){Vu.value=`Stopping…`,Ru.value&&Z.chatCancel(Ru.value).catch(()=>{}),$u()}function Kte(){Pe(()=>{ed().catch(e=>{Vu.value=e.message||`Chat unavailable`})}),Le(()=>{$u()})}async function qte(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 fd({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var Jte={class:`grid gap-1 p-1`},Yte={key:0,class:`text-xs text-fg-subtle`},pd=`__default__`,Xte=P({__name:`ChatSettings`,setup(e){let t=Y(()=>Ku.value||pd),n=Y(()=>{let e=Gu.value.models_by_provider||{},t=Object.entries(e).filter(([,e])=>e.length);return t.length?t:[[``,Gu.value.models||[]]]});return(e,r)=>(L(),j(`div`,Jte,[V(Vu)===`Ready`?F(``,!0):(L(),j(`span`,Yte,B(V(Vu)),1)),A(V(Eu),{"model-value":t.value,"onUpdate:modelValue":r[0]||=e=>V(ad)(e===pd?``:String(e??``))},{default:I(()=>[A(V(Au),{size:`sm`,class:`w-full`,"aria-label":`Model`},{default:I(()=>[A(V(ju))]),_:1}),A(V(Du),null,{default:I(()=>[A(V(ku),{value:pd},{default:I(()=>[...r[1]||=[H(`Default`,-1)]]),_:1}),(L(!0),j(U,null,M(n.value,([e,t])=>(L(),q(V(Ou),{key:e},{default:I(()=>[e?(L(),q(V(Tte),{key:0},{default:I(()=>[H(B(e),1)]),_:2},1024)):F(``,!0),(L(!0),j(U,null,M(t,e=>(L(),q(V(ku),{key:e,value:e},{default:I(()=>[H(B(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[`model-value`])]))}}),Zte=P({__name:`ChatSessionActions`,setup(e){let t=J(!1);Lte(t);function n(e){t.value=!1,id(e)}function r(e,n){t.value=!1,Bte(e,n)}return(e,i)=>(L(),q(V(Cu),{open:t.value,"onUpdate:open":i[5]||=e=>t.value=e},{default:I(()=>[A(V(Tu),{"as-child":``},{default:I(()=>[A(V(X),{variant:`ghost`,size:`icon-sm`,class:`flex-none`,"aria-label":`More`,title:`More`},{default:I(()=>[A(V(El))]),_:1})]),_:1}),A(V(wu),{align:`end`,class:`grid w-64 gap-0.5 p-1`},{default:I(()=>[V(Ru)?(L(),j(U,{key:0},[A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[0]||=e=>n(`/retry`)},{default:I(()=>[A(V(ou),{"data-icon":`inline-start`}),i[6]||=H(`Retry`,-1)]),_:1}),A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[1]||=e=>n(`/undo`)},{default:I(()=>[A(V(vu),{"data-icon":`inline-start`}),i[7]||=H(`Undo`,-1)]),_:1}),A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[2]||=e=>r(`/title`,`Session title`)},{default:I(()=>[A(V($l),{"data-icon":`inline-start`}),i[8]||=H(`Rename`,-1)]),_:1}),A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[3]||=e=>r(`/branch`,`Branch name (optional)`)},{default:I(()=>[A(V(Pl),{"data-icon":`inline-start`}),i[9]||=H(`Branch`,-1)]),_:1}),A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[4]||=e=>n(`/compress --preview`)},{default:I(()=>[A(V(fu),{"data-icon":`inline-start`}),i[10]||=H(`Preview compression`,-1)]),_:1}),A(V(Su),{class:`my-1`})],64)):F(``,!0),A(Xte)]),_:1})]),_:1},8,[`open`]))}}),Qte=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`});function $te(e){return e.title||e.branch_name||(e.created_at?Qte.format(new Date(e.created_at)):`New chat`)}var ene={class:`min-w-0 flex-1`},tne=P({__name:`ChatSessionList`,setup(e){return(e,t)=>(L(),j(`div`,ene,[A(V(Eu),{"model-value":V(Ru),disabled:!V(Lu).length,"onUpdate:modelValue":t[0]||=e=>V(td)(String(e))},{default:I(()=>[A(V(Au),{size:`sm`,class:`w-full`,"aria-label":`Conversation`},{default:I(()=>[A(V(ju),{placeholder:`No conversations yet`})]),_:1}),A(V(Du),null,{default:I(()=>[A(V(Ou),null,{default:I(()=>[(L(!0),j(U,null,M(V(Lu),e=>(L(),q(V(ku),{key:e.session_id,value:e.session_id},{default:I(()=>[H(B(V($te)(e)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`,`disabled`])]))}}),nne={class:`flex items-center gap-1 border-b px-3 py-2`},rne=P({__name:`ChatBar`,setup(e){return(e,t)=>(L(),j(`div`,nne,[A(tne),A(V(X),{variant:`ghost`,size:`icon-sm`,class:`flex-none`,t
Line truncated
|
||||
`))],64)):K(n.$slots,`default`,{},void 0,void 0,1)])],10,sp))}}),up=P({__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=ue();function r(e){let t=``;for(let n of e)if(n.type!==Ue){if(n.type===Be)t+=n.children;else if(n.type===U&&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)=>(L(),q(V(ot),{as:`pre`,"data-slot":`code-block-content`,"data-wrap":e.wrap||void 0,"data-numbered":e.lineNumbers||void 0,dir:`ltr`,tabindex:`0`,style:Je({counterReset:`line ${e.startLine-1}`}),class:z(V(W)(`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:I(()=>[A(V(ot),{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:I(()=>[(L(!0),j(U,null,M([i()],(e,t)=>(L(),j(U,{key:t},[e?(L(!0),j(U,{key:0},M(e,(e,t)=>(L(),q(lp,{key:t},{default:I(()=>[H(B(e),1)]),_:2},1024))),128)):K(n.$slots,`default`,{},void 0,void 0,1)],64))),128))]),_:3})]),_:3},8,[`data-wrap`,`data-numbered`,`style`,`class`]))}}),dp={"aria-live":`polite`,class:`sr-only`},fp=P({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}=oee({copiedDuring:2e3,legacy:!0});return(i,a)=>(L(),j(U,null,[A(V(X),G(i.$attrs,{"data-slot":`code-block-copy-button`,"data-copied":V(r)||void 0,as:e.as,"as-child":e.asChild,variant:e.variant,size:e.size,"aria-label":V(r)?`Copied`:`Copy`,class:V(W)(``,t.class),onClick:a[0]||=e=>V(n)(t.value)}),{default:I(()=>[V(r)?(L(),q(V(ll),{key:0})):(L(),q(V(Cl),{key:1}))]),_:1},16,[`data-copied`,`as`,`as-child`,`variant`,`size`,`aria-label`,`class`]),R(`span`,dp,B(V(r)?`Copied`:``),1)],64))}}),pp=P({__name:`CodeBlockToken`,props:{token:{}},setup(e){return(t,n)=>(L(),j(`span`,{style:Je(e.token.htmlStyle),class:`text-(--shiki-light) dark:text-(--shiki-dark)`},B(e.token.content),5))}}),mp=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function hp(e){return gp(e)}function gp(e){return Array.isArray(e)?_p(e):e instanceof RegExp?e:typeof e==`object`?vp(e):e}function _p(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=gp(e[n]);return t}function vp(e){let t={};for(let n in e)t[n]=gp(e[n]);return t}function yp(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function bp(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?bp(e.substring(0,e.length-1)):e.substr(~t+1)}var xp=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Sp=class{static hasCaptures(e){return e!==null&&(xp.lastIndex=0,xp.test(e))}static replaceCaptures(e,t,n){return e.replace(xp,(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 Cp(e,t){return e<t?-1:+(e>t)}function wp(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=Cp(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Tp(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 Ep(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Dp=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}},Op=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Np(e),t)}static createFromParsedTheme(e,t){return Ip(e,t)}_cachedMatchRoot=new Dp(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=>Ap(e.parent,t.parentScopes));return n?new Mp(n.fontStyle,n.foreground,n.background):null}},kp=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 Ap(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&&!jp(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function jp
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}},wm=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Tm=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new wm(e,8),this._embeddedLanguagesMatcher=new Em(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 wm(0,0);_getBasicScopeAttributes=new Dp(e=>new wm(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/},Em=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])=>Ep(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 Dm=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Om(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=km(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 Dm(i,!0);f()}return new Dm(i,!1);function f(){let o=Am(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===um){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Fm(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 vm){let r=o;Fm(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 ym){let r=o;Fm(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(Fm(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 km(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 ym&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Pm(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==dm){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Fm(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 Am(e,t,n,r,i,a){let o=jm(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Mm(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 jm(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Nm(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 Mm(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}=Nm(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 Nm(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Pm(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Fm(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 Km(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Om(this,a,i,0,t,s,!0,r);return qp(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Hm(e,t){return e=hp(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 Um=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=kp.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new kp(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new kp(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),Vp.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}},Wm=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)?Um.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:pm(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=Um.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,fm(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Um.fromExtension(r,n.contentNameScopesList))}},Gm=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Wp(e,zm).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Wp(e,zm).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}},Km=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._l
Line truncated
|
||||
\f\r &/=>`.split(``),`
|
||||
\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 o_(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=Yh);let l=s_(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!$g(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||!Lg(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function s_(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=c_(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 c_(e,t,n){let r=Gh(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=yg(r.attribute,Object.assign({},e.settings.characterReferences,{subset:a_.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Eg:Dg)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=yg(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:a_.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Tg(n,o)>Tg(n,e.alternative)&&(o=e.alternative),s=o+yg(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?a_.single:a_.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var l_=[`<`,`&`];function u_(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:yg(e.value,Object.assign({},r.settings.characterReferences,{subset:l_}))}function d_(e,t,n,r){return r.settings.allowDangerousHtml?e.value:u_(e,t,n,r)}function f_(e,t,n,r){return r.all(e)}var p_=Zh(`type`,{invalid:m_,unknown:h_,handlers:{comment:Cg,doctype:wg,element:o_,raw:d_,root:f_,text:u_}});function m_(e){throw Error("Expected node, not `"+e+"`")}function h_(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var g_={},__={},v_=[];function y_(e,t){let n=t||g_,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:b_,all:x_,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||hh,characterReferences:n.characterReferences||__,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Yh:Jh,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function b_(e,t,n){return p_(e,t,n,this)}function x_(e){let t=[],n=e&&e.children||v_,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var S_=/\s+/g;function C_(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(S_)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(S_);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function w_(e){let t=Lm(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 T_=[`color`,`background-color`];function E_(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 D_(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 O_(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=D_(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(rLine 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=j_(a.htmlStyle||A_(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&&Zm(m,r),m}function iv(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&pp.Underline||i.fontStyle&pp.Strikethrough));o&&ev.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 av(e){return e.map(e=>e.flatMap(e=>{if(ev.test(e.content))return e;let t=e.content.match(tv);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 ov(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=j_(e.htmlStyle||A_(e)),i=j_(n.htmlStyle||A_(n)),a=e.fontStyle&&(e.fontStyle&pp.Underline||e.fontStyle&pp.Strikethrough),o=n.fontStyle&&(n.fontStyle&pp.Underline||n.fontStyle&pp.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var sv=y_;function cv(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>nv(e,t,n),codeToTokens:(t,n)=>Q_(e,t,n)},i=sv(nv(e,t,n,r));for(let e of I_(n))i=e.postprocess?.call(r,i,n)||i;return i}async function lv(e){let t=await Ym(e);return{getLastGrammarState:(...e)=>ah(t,...e),codeToTokensBase:(e,n)=>Z_(t,e,n),codeToTokensWithThemes:(e,n)=>ph(t,e,n),codeToTokens:(e,n)=>Q_(t,e,n),codeToHast:(e,n)=>nv(t,e,n),codeToHtml:(e,n)=>cv(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var uv=4294967295;function dv(e){return!e.sticky&&!e.rawOptions?.strategy}function fv(e,t){return{index:e,captureIndices:t.map(e=>e==null?{start:uv,end:uv,length:0}:{start:e[0],end:e[1],length:e[1]-e[0]})}}var pv=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&&dv(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 fv(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:fv(a,s)}},mv=0;function hv(e){return{content:e,id:++mv}}function gv(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function _v(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var vv=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),yv=String.raw;function bv(e,t){if(e==null)throw Error(t??`Value expected`);return e}var xv=yv`\[\^?`,Sv=`c.? | C(?:-.?)?|${yv`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${yv`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${yv`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${yv`o\{[^\}]*\}?`}|${yv`\d{1,3}`}`,Cv=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,wv=new RegExp(yv`
|
||||
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function O_(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=_g);let l=k_(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!x_(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||!a_(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function k_(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=A_(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 A_(e,t,n){let r=pg(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=Vg(r.attribute,Object.assign({},e.settings.characterReferences,{subset:D_.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Jg:Yg)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Vg(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:D_.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&qg(n,o)>qg(n,e.alternative)&&(o=e.alternative),s=o+Vg(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?D_.single:D_.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var j_=[`<`,`&`];function M_(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Vg(e.value,Object.assign({},r.settings.characterReferences,{subset:j_}))}function N_(e,t,n,r){return r.settings.allowDangerousHtml?e.value:M_(e,t,n,r)}function P_(e,t,n,r){return r.all(e)}var F_=yg(`type`,{invalid:I_,unknown:L_,handlers:{comment:Gg,doctype:Kg,element:O_,raw:N_,root:P_,text:M_}});function I_(e){throw Error("Expected node, not `"+e+"`")}function L_(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var R_={},z_={},B_=[];function V_(e,t){let n=t||R_,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:H_,all:U_,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||Lh,characterReferences:n.characterReferences||z_,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?_g:gg,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function H_(e,t,n){return F_(e,t,n,this)}function U_(e){let t=[],n=e&&e.children||B_,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var W_=/\s+/g;function G_(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(W_)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(W_);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function K_(e){let t=ah(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 q_=[`color`,`background-color`];function J_(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 Y_(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 X_(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=Y_(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(rLine 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=$_(a.htmlStyle||Q_(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&&yh(m,r),m}function Ev(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&Fp.Underline||i.fontStyle&Fp.Strikethrough));o&&Sv.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 Dv(e){return e.map(e=>e.flatMap(e=>{if(Sv.test(e.content))return e;let t=e.content.match(Cv);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 Ov(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=$_(e.htmlStyle||Q_(e)),i=$_(n.htmlStyle||Q_(n)),a=e.fontStyle&&(e.fontStyle&Fp.Underline||e.fontStyle&Fp.Strikethrough),o=n.fontStyle&&(n.fontStyle&Fp.Underline||n.fontStyle&Fp.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var kv=V_;function Av(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>wv(e,t,n),codeToTokens:(t,n)=>bv(e,t,n)},i=kv(wv(e,t,n,r));for(let e of iv(n))i=e.postprocess?.call(r,i,n)||i;return i}async function jv(e){let t=await _h(e);return{getLastGrammarState:(...e)=>Dh(t,...e),codeToTokensBase:(e,n)=>yv(t,e,n),codeToTokensWithThemes:(e,n)=>Fh(t,e,n),codeToTokens:(e,n)=>bv(t,e,n),codeToHast:(e,n)=>wv(t,e,n),codeToHtml:(e,n)=>Av(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var Mv=4294967295;function Nv(e){return!e.sticky&&!e.rawOptions?.strategy}function Pv(e,t){return{index:e,captureIndices:t.map(e=>e==null?{start:Mv,end:Mv,length:0}:{start:e[0],end:e[1],length:e[1]-e[0]})}}var Fv=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&&Nv(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 Pv(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:Pv(a,s)}},Iv=0;function Lv(e){return{content:e,id:++Iv}}function Rv(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function zv(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Bv=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),Vv=String.raw;function Hv(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Uv=Vv`\[\^?`,Wv=`c.? | C(?:-.?)?|${Vv`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Vv`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Vv`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Vv`o\{[^\}]*\}?`}|${Vv`\d{1,3}`}`,Gv=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Kv=new RegExp(Vv`
|
||||
\\ (?:
|
||||
${Sv}
|
||||
${Wv}
|
||||
| [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
|
||||
)?
|
||||
| \*[^\)]*\)?
|
||||
)?
|
||||
| (?:${Cv.source})+
|
||||
| ${xv}
|
||||
| (?:${Gv.source})+
|
||||
| ${Uv}
|
||||
| .
|
||||
`.replace(/\s+/g,``),`gsu`),Tv=new RegExp(yv`
|
||||
`.replace(/\s+/g,``),`gsu`),qv=new RegExp(Vv`
|
||||
\\ (?:
|
||||
${Sv}
|
||||
${Wv}
|
||||
| .
|
||||
)
|
||||
| \[:(?:\^?\p{Alpha}+|\^):\]
|
||||
| ${xv}
|
||||
| ${Uv}
|
||||
| &&
|
||||
| .
|
||||
`.replace(/\s+/g,``),`gsu`);function Ev(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=ny(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(wv.lastIndex=0;s=wv.exec(e);){let t=Dv(a,e,s[0],wv.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(wv.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`?iy(e,u):e).flat(),flags:r}}function Dv(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Ov(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:Mv(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Kv(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Nv(n)}}if(a===`K`)return{token:Bv(`keep`,n)};if(a===`N`||a===`R`)return{token:zv(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:zv(`any`,n)};if(a===`X`)return{token:zv(`text_segment`,n)};let e=Av(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Zv(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:Xv(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Uv(`group`,n)};if(n===`(?>`)return{token:Uv(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Uv(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Uv(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Uv(`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:Hv(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:zv(`dot`,n)}:n===`^`||n===`$`?{token:Mv(e.singleline?{"^":yv`\A`,$:yv`\Z`}[n]:n,n)}:n===`|`?{token:jv(n)}:Cv.test(n)?{tokens:ay(n)}:{token:Pv(gv(n),n)}}function Ov(e,t,n){let r=[Rv(t[1]===`^`,t)],i=1,a;for(Tv.lastIndex=n;a=Tv.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Rv(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Pv(93,e));else if(i--,r.push(Fv(e)),!i)break}else{let t=kv(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:Tv.lastIndex||e.length}}function kv(e){if(e[0]===`\\`)return Av(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!vv.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return zv(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Iv(e):e===`&&`?Lv(e):Pv(gv(e),e)}function Av(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return Yv(e);if(`dDhHsSwW`.includes(n))return $v(e);if(e.startsWith(yv`\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 ey(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 Pv(gv(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Pv(ry(e),e);if(Jv.has(n))return Pv(Jv.get(n),e);if(/\d/.test(n))return Vv(t,e);if(e===`\\`)throw Error(yv`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Pv(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function jv(e){return{type:`Alternator`,raw:e}}function Mv(e,t){return{type:`Assertion`,kind:e,raw:t}}function Nv(e){return{type:`Backreference`,raw:e}}function Pv(e,t){return{type:`Character`,value:e,raw:t}}function Fv(e){return{type:`CharacterClassClose`,raw:e}}function Iv(e){return{type:`CharacterClassHyphen`,raw:e}}function Lv(e){return{type:`CharacterClassIntersector`,raw:e}}function Rv(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function zv(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Bv(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:bv(n.flags),raw:t}}function Vv(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Hv(e){return{type:`GroupClose`,raw:e}}function Uv(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Wv(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Gv(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Kv(e){return{type:`Subroutine`,raw:e}}var qv=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Jv=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Yv(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Pv(gv(t.toUpperCase())-64,e)}function Xv(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=ty(n),o=ty(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Bv(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Uv(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Zv(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=qv.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 Jv(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=wy(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(Kv.lastIndex=0;s=Kv.exec(e);){let t=Yv(a,e,s[0],Kv.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Kv.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`?Ey(e,u):e).flat(),flags:r}}function Yv(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Xv(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:ey(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:my(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:ty(n)}}if(a===`K`)return{token:cy(`keep`,n)};if(a===`N`||a===`R`)return{token:sy(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:sy(`any`,n)};if(a===`X`)return{token:sy(`text_segment`,n)};let e=Qv(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:yy(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:vy(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:dy(`group`,n)};if(n===`(?>`)return{token:dy(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:dy(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:dy(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:dy(`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:uy(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:sy(`dot`,n)}:n===`^`||n===`$`?{token:ey(e.singleline?{"^":Vv`\A`,$:Vv`\Z`}[n]:n,n)}:n===`|`?{token:$v(n)}:Gv.test(n)?{tokens:Dy(n)}:{token:ny(Rv(n),n)}}function Xv(e,t,n){let r=[oy(t[1]===`^`,t)],i=1,a;for(qv.lastIndex=n;a=qv.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(oy(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(ny(93,e));else if(i--,r.push(ry(e)),!i)break}else{let t=Zv(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:qv.lastIndex||e.length}}function Zv(e){if(e[0]===`\\`)return Qv(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Bv.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return sy(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?iy(e):e===`&&`?ay(e):ny(Rv(e),e)}function Qv(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return _y(e);if(`dDhHsSwW`.includes(n))return xy(e);if(e.startsWith(Vv`\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 Sy(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 ny(Rv(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return ny(Ty(e),e);if(gy.has(n))return ny(gy.get(n),e);if(/\d/.test(n))return ly(t,e);if(e===`\\`)throw Error(Vv`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return ny(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function $v(e){return{type:`Alternator`,raw:e}}function ey(e,t){return{type:`Assertion`,kind:e,raw:t}}function ty(e){return{type:`Backreference`,raw:e}}function ny(e,t){return{type:`Character`,value:e,raw:t}}function ry(e){return{type:`CharacterClassClose`,raw:e}}function iy(e){return{type:`CharacterClassHyphen`,raw:e}}function ay(e){return{type:`CharacterClassIntersector`,raw:e}}function oy(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function sy(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function cy(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:Hv(n.flags),raw:t}}function ly(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function uy(e){return{type:`GroupClose`,raw:e}}function dy(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function fy(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function py(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function my(e){return{type:`Subroutine`,raw:e}}var hy=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),gy=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function _y(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return ny(Rv(t.toUpperCase())-64,e)}function vy(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=Cy(n),o=Cy(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),cy(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,dy(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function yy(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=hy.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>${sb})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
||||
| (?<qBase>${kb})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
||||
| \\?.
|
||||
`.replace(/\s+/g,``),`gsu`);function lb(e){if(!RegExp(`${sb}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(cb.lastIndex=0;o=cb.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=Qy(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}cb.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var ub=String.raw,db=ub`\(\?R=(?<rDepth>[^\)]+)\)|${ub`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,fb=ub`\(\?<(?![=!])(?<captureName>[^>]+)>`,pb=ub`${fb}|(?<unnamed>\()(?!\?)`,mb=new RegExp(ub`${fb}|${db}|\(\?|\\?.`,`gsu`),hb=`Cannot use multiple overlapping recursions`;function gb(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(db,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&rb(e,ub`\(\?\(DEFINE\)`,$y.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=rb(e,ub`\\[1-9]`,$y.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(mb.lastIndex=0;f=mb.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(_b(m),l)throw Error(hb);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(mb.lastIndex);if(rb(s,db,$y.DEFAULT))throw Error(hb);let c=m-1;e=vb(t,s,c,!1,n,a,d),i=xb(i,t,c,a.length,0,d);break}if(h){_b(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(hb);break}if(!u)throw Error(ub`Recursive \g cannot be used outside the referenced group "${r===`external`?h:ub`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=ib(e,p);if(o&&rb(m,ub`${fb}|\((?!\?)`,$y.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=vb(_,v,b,!0,n,a,d);i=xb(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,mb.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),mb.lastIndex),s.set(p,mb.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),mb.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function _b(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 vb(e,t,n,r,i,a,o){let s=new Set;r&&tb(e+t,fb,({groups:{captureName:e}})=>{s.add(e)},$y.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${yb(`(?:${e}`,`forward`,...c)}(?:)${yb(`${t})`,`backward`,...c)}${t}`}function yb(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+=eb(e,ub`${pb}|\\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),bb(i,n),s?e:`(?<${t}${l}>`}return ub`\k<${c}${l}>`},$y.DEFAULT)}return c}function bb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function xb(e,t,n,r,i,a){if(e.size&&r){let o=0;tb(t,pb,()=>o++,$y.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 Sb=String.fromCodePoint,Cb=String.raw,wb={},Tb=globalThis.RegExp;wb.flagGroups=(()=>{try{new Tb(`(?i:)`)}catch{return!1}return!0})(),wb.unicodeSets=(()=>{try{new Tb(`[[]]`,`v`)}catch{return!1}return!0})(),wb.bugFlagVLiteralHyphenIsRange=wb.unicodeSets?(()=>{try{new Tb(Cb`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,wb.bugNestedClassIgnoresNegation=wb.unicodeSets&&new Tb(`[[^a]]`,`v`).test(`a`);function Eb(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Db(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Ob(e,t){return Ab[e]>=Ab[t]}function kb(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Ab={ES2025:2025,ES2024:2024,ES2018:2018},jb={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&&!jb[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`aLine truncated
|
||||
`.replace(/\s+/g,``),`gsu`);function jb(e){if(!RegExp(`${kb}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(Ab.lastIndex=0;o=Ab.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=bb(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}Ab.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Mb=String.raw,Nb=Mb`\(\?R=(?<rDepth>[^\)]+)\)|${Mb`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,Pb=Mb`\(\?<(?![=!])(?<captureName>[^>]+)>`,Fb=Mb`${Pb}|(?<unnamed>\()(?!\?)`,Ib=new RegExp(Mb`${Pb}|${Nb}|\(\?|\\?.`,`gsu`),Lb=`Cannot use multiple overlapping recursions`;function Rb(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(Nb,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&Tb(e,Mb`\(\?\(DEFINE\)`,xb.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=Tb(e,Mb`\\[1-9]`,xb.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Ib.lastIndex=0;f=Ib.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(zb(m),l)throw Error(Lb);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(Ib.lastIndex);if(Tb(s,Nb,xb.DEFAULT))throw Error(Lb);let c=m-1;e=Bb(t,s,c,!1,n,a,d),i=Ub(i,t,c,a.length,0,d);break}if(h){zb(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(Lb);break}if(!u)throw Error(Mb`Recursive \g cannot be used outside the referenced group "${r===`external`?h:Mb`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=Eb(e,p);if(o&&Tb(m,Mb`${Pb}|\((?!\?)`,xb.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=Bb(_,v,b,!0,n,a,d);i=Ub(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,Ib.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Ib.lastIndex),s.set(p,Ib.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),Ib.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function zb(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 Bb(e,t,n,r,i,a,o){let s=new Set;r&&Cb(e+t,Pb,({groups:{captureName:e}})=>{s.add(e)},xb.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${Vb(`(?:${e}`,`forward`,...c)}(?:)${Vb(`${t})`,`backward`,...c)}${t}`}function Vb(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+=Sb(e,Mb`${Fb}|\\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),Hb(i,n),s?e:`(?<${t}${l}>`}return Mb`\k<${c}${l}>`},xb.DEFAULT)}return c}function Hb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Ub(e,t,n,r,i,a){if(e.size&&r){let o=0;Cb(t,Fb,()=>o++,xb.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 Wb=String.fromCodePoint,Gb=String.raw,Kb={},qb=globalThis.RegExp;Kb.flagGroups=(()=>{try{new qb(`(?i:)`)}catch{return!1}return!0})(),Kb.unicodeSets=(()=>{try{new qb(`[[]]`,`v`)}catch{return!1}return!0})(),Kb.bugFlagVLiteralHyphenIsRange=Kb.unicodeSets?(()=>{try{new qb(Gb`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,Kb.bugNestedClassIgnoresNegation=Kb.unicodeSets&&new qb(`[[^a]]`,`v`).test(`a`);function Jb(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Yb(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Xb(e,t){return Qb[e]>=Qb[t]}function Zb(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Qb={ES2025:2025,ES2024:2024,ES2018:2018},$b={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function ex(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!$b[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`aLine 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=>[Wy(e),e])),Rb=new Map([[`s`,Sb(383)],[Sb(383),`s`]]),zb=new Map([[Sb(223),Sb(7838)],[Sb(107),Sb(8490)],[Sb(229),Sb(8491)],[Sb(969),Sb(8486)]]),Bb=new Map([Ub(453),Ub(456),Ub(459),Ub(498),...Wb(8072,8079),...Wb(8088,8095),...Wb(8104,8111),Ub(8124),Ub(8140),Ub(8188)]),Vb=new Map([[`alnum`,Cb`[\p{Alpha}\p{Nd}]`],[`alpha`,Cb`\p{Alpha}`],[`ascii`,Cb`\p{ASCII}`],[`blank`,Cb`[\p{Zs}\t]`],[`cntrl`,Cb`\p{Cc}`],[`digit`,Cb`\p{Nd}`],[`graph`,Cb`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Cb`\p{Lower}`],[`print`,Cb`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Cb`[\p{P}\p{S}]`],[`space`,Cb`\p{space}`],[`upper`,Cb`\p{Upper}`],[`word`,Cb`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Cb`\p{AHex}`]]);function Hb(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Ub(e){let t=Sb(e);return[t.toLowerCase(),t]}function Wb(e,t){return Hb(e,t).map(e=>Ub(e))}var Gb=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Kb(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Xb(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Ob(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};qy(e,qb,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 qy(e,Jb,a),qy(e,Yb,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var qb={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=ky();e.body[0].body.push(Ay({negate:!0,body:r}),Iy(`Any`));let i=ky();i.body[0].body.push(Ny(`greedy`,0,1/0,e)),n(hx(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];Db(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=rx(t.get(e));if(n){let t=ky({flags:n});t.body[0].body=e.body,e.body=[hx(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(hx(Ay({body:[yy({body:[by(`string_end`)]}),yy({body:[Cy(10)]})]}),t));else if(c===`line_start`)o(hx(fx(Cb`(?<=\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&&lx(e))o(hx(Ay({negate:!0}),t));else if(d)throw Error(Cb`Uses "\G" in a way that requires a subclass`);else o(mx(by(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(hx(fx(Cb`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Fb})(?!${Fb})|(?<!${Fb})(?=${Fb}))`,n=`(?:(?<=${Fb})(?=${Fb})|(?<!${Fb})(?!${Fb}))`;o(hx(fx(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!dx(n)&&(n=nx(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!dx(r)&&(r=nx(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(hx(wy({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(mx(Ey(`digit`,{negate:l}),t));else if(o&&(c===`space`||u===`space`))n(hx(px(fx(Nb),l),t));else if(s&&(c===`word`||u===`word`))n(mx(Ey(`word`,{negate:l}),t));else if(c===`any`)n(mx(Iy(`Any`),t));else if(c===`digit`)n(mx(Iy(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Cb`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Cb`\p{RI}{2}|${e}(?:\u200D${e})*`;n(hx(fx(Cb`(?>\r\n|${i?Cb`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(mx(Iy(`AHex`,{negate:l}),t));else if(c===`newline`)n(hx(fx(l?`[^
|
||||
XID_Start XIDS`.split(/\s/).map(e=>[fb(e),e])),ox=new Map([[`s`,Wb(383)],[Wb(383),`s`]]),sx=new Map([[Wb(223),Wb(7838)],[Wb(107),Wb(8490)],[Wb(229),Wb(8491)],[Wb(969),Wb(8486)]]),cx=new Map([dx(453),dx(456),dx(459),dx(498),...fx(8072,8079),...fx(8088,8095),...fx(8104,8111),dx(8124),dx(8140),dx(8188)]),lx=new Map([[`alnum`,Gb`[\p{Alpha}\p{Nd}]`],[`alpha`,Gb`\p{Alpha}`],[`ascii`,Gb`\p{ASCII}`],[`blank`,Gb`[\p{Zs}\t]`],[`cntrl`,Gb`\p{Cc}`],[`digit`,Gb`\p{Nd}`],[`graph`,Gb`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Gb`\p{Lower}`],[`print`,Gb`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Gb`[\p{P}\p{S}]`],[`space`,Gb`\p{space}`],[`upper`,Gb`\p{Upper}`],[`word`,Gb`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Gb`\p{AHex}`]]);function ux(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function dx(e){let t=Wb(e);return[t.toLowerCase(),t]}function fx(e,t){return ux(e,t).map(e=>dx(e))}var px=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function mx(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};vx(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Xb(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};hb(e,hx,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 hb(e,gx,a),hb(e,_x,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var hx={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=Zy();e.body[0].body.push(Qy({negate:!0,body:r}),ib(`Any`));let i=Zy();i.body[0].body.push(tb(`greedy`,0,1/0,e)),n(Ix(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];Yb(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=wx(t.get(e));if(n){let t=Zy({flags:n});t.body[0].body=e.body,e.body=[Ix(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(Ix(Qy({body:[Vy({body:[Hy(`string_end`)]}),Vy({body:[Gy(10)]})]}),t));else if(c===`line_start`)o(Ix(Nx(Gb`(?<=\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&&Ax(e))o(Ix(Qy({negate:!0}),t));else if(d)throw Error(Gb`Uses "\G" in a way that requires a subclass`);else o(Fx(Hy(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(Ix(Nx(Gb`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${rx})(?!${rx})|(?<!${rx})(?=${rx}))`,n=`(?:(?<=${rx})(?=${rx})|(?<!${rx})(?!${rx}))`;o(Ix(Nx(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Mx(n)&&(n=Cx(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Mx(r)&&(r=Cx(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(Ix(Ky({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(Fx(Jy(`digit`,{negate:l}),t));else if(o&&(c===`space`||u===`space`))n(Ix(Px(Nx(tx),l),t));else if(s&&(c===`word`||u===`word`))n(Fx(Jy(`word`,{negate:l}),t));else if(c===`any`)n(Fx(ib(`Any`),t));else if(c===`digit`)n(Fx(ib(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Gb`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Gb`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Ix(Nx(Gb`(?>\r\n|${i?Gb`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(Fx(ib(`AHex`,{negate:l}),t));else if(c===`newline`)n(Ix(Nx(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-${Sb(e.codePointAt(0)-1)}${Sb(e.codePointAt(2)+1)}-\u{10FFFF}`),n(hx(fx(`[${e}]`),t))}else n(hx(px(fx(Vb.get(u)),l),t))}else if(c===`property`)Lb.has(Wy(u))||(e.key=`sc`);else if(c===`space`)n(mx(Iy(`space`,{negate:l}),t));else if(c===`word`)n(hx(px(fx(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=ky({flags:c});e.body[0].body=o(),i(hx(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&oy(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Cb`Uses "\K" in a way that's unsupported`);let o=Ay({behind:!0});o.body[0].body=a(),i(hx(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(hx(Ay({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=ky();t.body[0].body.push(e.body),e.body=hx(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=ox(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(Cb`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!dx(n)&&(n=nx(n,t),e.ref=n)}},Jb={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=mx(ex(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Db(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=Db(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=Eb(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?ex(0):$b(o,r.groupOriginByCopy,null),l=c;if(!s){let e=rx(tx(o,e=>e.type===`Group`&&!!e.flags)),t=e?Eb(r.globalFlags,e):r.globalFlags;Zb(t,r.currentFlags)||(l=ky({flags:ix(t)}),l.body[0].body.push(c))}n(hx(l,t),{traverse:!s})}},Yb={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=>Qb(t,e));i.length?i.length>1?n(hx(ky({atomic:!0,body:i.reverse().map(e=>yy({body:[xy(e.number)]}))}),t)):e.ref=i[0].number:n(hx(Ay({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=Sy();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 Qx(e,t){let n=qe(null);N(()=>Pe(t),(e,t,r)=>{if(typeof window>`u`)return;let i=!1;r(()=>i=!0),n.value=null,Zx(e).then(e=>{i||(n.value=e)}).catch(()=>{})},{immediate:!0});let r={highlighter:null,text:``,lines:[]};return Y(()=>{let t=Pe(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-${Wb(e.codePointAt(0)-1)}${Wb(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Ix(Nx(`[${e}]`),t))}else n(Ix(Px(Nx(lx.get(u)),l),t))}else if(c===`property`)ax.has(fb(u))||(e.key=`sc`);else if(c===`space`)n(Fx(ib(`space`,{negate:l}),t));else if(c===`word`)n(Ix(Px(Nx(rx),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=Zy({flags:c});e.body[0].body=o(),i(Ix(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Oy(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Gb`Uses "\K" in a way that's unsupported`);let o=Qy({behind:!0});o.body[0].body=a(),i(Ix(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(Ix(Qy({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Zy();t.body[0].body.push(e.body),e.body=Ix(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=Dx(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(Gb`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Mx(n)&&(n=Cx(n,t),e.ref=n)}},gx={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=Fx(Sx(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Yb(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=Yb(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=Jb(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?Sx(0):xx(o,r.groupOriginByCopy,null),l=c;if(!s){let e=wx(zne(o,e=>e.type===`Group`&&!!e.flags)),t=e?Jb(r.globalFlags,e):r.globalFlags;yx(t,r.currentFlags)||(l=Zy({flags:Tx(t)}),l.body[0].body.push(c))}n(Ix(l,t),{traverse:!s})}},_x={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=>bx(t,e));i.length?i.length>1?n(Ix(Zy({atomic:!0,body:i.reverse().map(e=>Vy({body:[Uy(e.number)]}))}),t)):e.ref=i[0].number:n(Ix(Qy({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=Wy();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesBy
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 bS(e,t){let n=$e(null);N(()=>ze(t),(e,t,r)=>{if(typeof window>`u`)return;let i=!1;r(()=>i=!0),n.value=null,yS(e).then(e=>{i||(n.value=e)}).catch(()=>{})},{immediate:!0});let r={highlighter:null,text:``,lines:[]};return Y(()=>{let t=ze(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 $x=He(`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`}}),eS=He(`-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`}}),tS=P({__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)=>(L(),q(V(at),{"data-slot":`message`,"data-align":e.align,as:e.as,"as-child":e.asChild,class:z(V(W)(`text-sm gap-2 group/message relative flex w-full min-w-0 data-[align=end]:flex-row-reverse`,t.class))},{default:I(()=>[K(n.$slots,`default`)]),_:3},8,[`data-align`,`as`,`as-child`,`class`]))}}),nS=P({__name:`MessageContent`,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(L(),q(V(at),{"data-slot":`message-content`,as:e.as,"as-child":e.asChild,class:z(V(W)(`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:I(()=>[K(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}}),rS=P({__name:`MessageFooter`,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(L(),q(V(at),{"data-slot":`message-footer`,as:e.as,"as-child":e.asChild,class:z(V(W)(`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:I(()=>[K(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}});function iS(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 aS(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 oS={class:`truncate`},sS=P({__name:`ChatAttachment`,props:{attachment:{}},setup(e){return(t,n)=>(L(),q(le(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:V(aS)(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:I(()=>[k(V(bl),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),R(`span`,oS,B(V(iS)(e.attachment)),1)]),_:1},8,[`href`,`target`,`rel`,`title`]))}}),cS=P({__name:`CodeView`,props:{code:{},lang:{},class:{}},setup(e){let t=e,n=Qx(()=>t.code,()=>t.lang||`text`);return(r,i)=>(L(),q(V(Lf),{class:z(V(W)(`bg-muted`,t.class))},{default:I(()=>[k(V(Rf),null,{default:I(()=>[k(V(Wf),{value:e.code},null,8,[`value`])]),_:1}),k(V(Hf),{wrap:``,class:`max-h-[60vh] pe-10 text-xs`},{default:I(()=>[(L(!0),A(U,null,j(V(n),(e,t)=>(L(),q(V(Vf),{key:t},{default:I(()=>[(L(!0),A(U,null,j(e,(e,t)=>(L(),q(V(Gf),{key:t,token:e},null,8,[`token`]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[`class`]))}}),lS=[`src`,`alt`],uS={key:1},dS={key:2},fS={key:3,class:`rounded bg-foreground/10 px-1 py-0.5 font-mono text-[0.9em]`},pS=[`href`],mS={key:5},hS=P({__name:`ChatInline`,props:{inline:{}},setup(e){return(t,n)=>(L(!0),A(U,null,j(e.inline,(e,t)=>(L(),A(U,{key:t},[e.kind===`image`?(L(),A(`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-Line truncated
|
||||
`),r=[],i=null,a=null,o=``,s=()=>{r.length&&(t.push({kind:`p`,inline:_S(r.join(` `))}),r=[])},c=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>_S(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=yS(l),d=e+1<n.length?yS(n[e+1]):null;if(u&&d&&bS(d)&&u.length===d.length){s(),c();let r=[];for(e+=2;e<n.length;e++){let t=yS(n[e]);if(!t||t.length!==u.length){e--;break}r.push(t)}t.push({kind:`table`,head:u.map(e=>_S(e)),rows:r.map(e=>e.map(e=>_S(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:_S(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:_S(l.replace(/^>\s?/,``))})):r.push(l)}return s(),c(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`),lang:o}),t}function yS(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 bS(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var xS={class:`[overflow-wrap:anywhere]`},SS={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},CS={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},wS={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},TS={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},ES={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},DS={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},OS={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},kS={key:8,class:`mb-2.5 last:mb-0`},AS=P({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>vS(t.text));return(e,t)=>(L(),A(`div`,xS,[(L(!0),A(U,null,j(n.value,(e,t)=>(L(),A(U,{key:t},[e.kind===`pre`?(L(),q(cS,{key:0,code:e.code,lang:e.lang,class:`my-2`},null,8,[`code`,`lang`])):e.kind===`table`?(L(),A(`table`,SS,[R(`thead`,null,[R(`tr`,null,[(L(!0),A(U,null,j(e.head,(e,t)=>(L(),A(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[k(hS,{inline:e},null,8,[`inline`])]))),128))])]),R(`tbody`,null,[(L(!0),A(U,null,j(e.rows,(e,t)=>(L(),A(`tr`,{key:t},[(L(!0),A(U,null,j(e,(e,t)=>(L(),A(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[k(hS,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(L(),A(`blockquote`,CS,[k(hS,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(L(),A(`h1`,wS,[k(hS,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(L(),A(`h2`,TS,[k(hS,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(L(),A(`h3`,ES,[k(hS,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(L(),A(`ul`,DS,[(L(!0),A(U,null,j(e.items,(e,t)=>(L(),A(`li`,{key:t},[k(hS,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(L(),A(`ol`,OS,[(L(!0),A(U,null,j(e.items,(e,t)=>(L(),A(`li`,{key:t},[k(hS,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(L(),A(`p`,kS,[k(hS,{inline:e.inline},null,8,[`inline`])])):F(``,!0)],64))),128))]))}}),jS={class:`truncate`},MS=P({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Se(`RouterLink`);return L(),q(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:I(()=>[k(V(kc),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),R(`span`,jS,B(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),NS={class:`font-mono text-foreground`},PS={key:0,class:`shrink-0 text-xs tabular-nums`},FS={class:`font-mono text-foreground`},IS={key:0,class:`shrink-0 text-xs tabular-nums`},LS=P({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||``),o=Y(()=>!a.value&&!i.value&&!!t.streaming),s=Y(()=>{let e=t.tool.duration_ms;return e?e<1e3?`${e}ms`:`${(e/1e3).toFixed(+(e<1e4))}s`:``}),c=Y(()=>{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 xS=qe(`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`}}),SS=qe(`-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`}}),CS=P({__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)=>(L(),q(V(ot),{"data-slot":`message`,"data-align":e.align,as:e.as,"as-child":e.asChild,class:z(V(W)(`text-sm gap-2 group/message relative flex w-full min-w-0 data-[align=end]:flex-row-reverse`,t.class))},{default:I(()=>[K(n.$slots,`default`)]),_:3},8,[`data-align`,`as`,`as-child`,`class`]))}}),wS=P({__name:`MessageContent`,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(L(),q(V(ot),{"data-slot":`message-content`,as:e.as,"as-child":e.asChild,class:z(V(W)(`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:I(()=>[K(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}}),TS=P({__name:`MessageFooter`,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(L(),q(V(ot),{"data-slot":`message-footer`,as:e.as,"as-child":e.asChild,class:z(V(W)(`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:I(()=>[K(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}});function ES(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 DS(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 OS={class:`truncate`},kS=P({__name:`ChatAttachment`,props:{attachment:{}},setup(e){return(t,n)=>(L(),q(pe(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:V(DS)(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:I(()=>[A(V(Zl),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),R(`span`,OS,B(V(ES)(e.attachment)),1)]),_:1},8,[`href`,`target`,`rel`,`title`]))}}),AS=P({__name:`CodeView`,props:{code:{},lang:{},class:{}},setup(e){let t=e,n=bS(()=>t.code,()=>t.lang||`text`);return(r,i)=>(L(),q(V(ap),{class:z(V(W)(`bg-muted`,t.class))},{default:I(()=>[A(V(op),null,{default:I(()=>[A(V(fp),{value:e.code},null,8,[`value`])]),_:1}),A(V(up),{wrap:``,class:`max-h-[60vh] pe-10 text-xs`},{default:I(()=>[(L(!0),j(U,null,M(V(n),(e,t)=>(L(),q(V(lp),{key:t},{default:I(()=>[(L(!0),j(U,null,M(e,(e,t)=>(L(),q(V(pp),{key:t,token:e},null,8,[`token`]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[`class`]))}}),jS=[`src`,`alt`],MS={key:1},NS={key:2},PS={key:3,class:`rounded bg-foreground/10 px-1 py-0.5 font-mono text-[0.9em]`},FS=[`href`],IS={key:5},LS=P({__name:`ChatInline`,props:{inline:{}},setup(e){return(t,n)=>(L(!0),j(U,null,M(e.inline,(e,t)=>(L(),j(U,{key:t},[e.kind===`image`?(L(),j(`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-Line truncated
|
||||
`),r=[],i=null,a=null,o=``,s=()=>{r.length&&(t.push({kind:`p`,inline:zS(r.join(` `))}),r=[])},c=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>zS(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=VS(l),d=e+1<n.length?VS(n[e+1]):null;if(u&&d&&HS(d)&&u.length===d.length){s(),c();let r=[];for(e+=2;e<n.length;e++){let t=VS(n[e]);if(!t||t.length!==u.length){e--;break}r.push(t)}t.push({kind:`table`,head:u.map(e=>zS(e)),rows:r.map(e=>e.map(e=>zS(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:zS(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:zS(l.replace(/^>\s?/,``))})):r.push(l)}return s(),c(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`),lang:o}),t}function VS(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 HS(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var US={class:`[overflow-wrap:anywhere]`},WS={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},GS={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},KS={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},qS={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},JS={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},YS={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},XS={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},ZS={key:8,class:`mb-2.5 last:mb-0`},QS=P({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>BS(t.text));return(e,t)=>(L(),j(`div`,US,[(L(!0),j(U,null,M(n.value,(e,t)=>(L(),j(U,{key:t},[e.kind===`pre`?(L(),q(AS,{key:0,code:e.code,lang:e.lang,class:`my-2`},null,8,[`code`,`lang`])):e.kind===`table`?(L(),j(`table`,WS,[R(`thead`,null,[R(`tr`,null,[(L(!0),j(U,null,M(e.head,(e,t)=>(L(),j(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[A(LS,{inline:e},null,8,[`inline`])]))),128))])]),R(`tbody`,null,[(L(!0),j(U,null,M(e.rows,(e,t)=>(L(),j(`tr`,{key:t},[(L(!0),j(U,null,M(e,(e,t)=>(L(),j(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[A(LS,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(L(),j(`blockquote`,GS,[A(LS,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(L(),j(`h1`,KS,[A(LS,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(L(),j(`h2`,qS,[A(LS,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(L(),j(`h3`,JS,[A(LS,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(L(),j(`ul`,YS,[(L(!0),j(U,null,M(e.items,(e,t)=>(L(),j(`li`,{key:t},[A(LS,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(L(),j(`ol`,XS,[(L(!0),j(U,null,M(e.items,(e,t)=>(L(),j(`li`,{key:t},[A(LS,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(L(),j(`p`,ZS,[A(LS,{inline:e.inline},null,8,[`inline`])])):F(``,!0)],64))),128))]))}}),$S={class:`truncate`},eC=P({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=De(`RouterLink`);return L(),q(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:I(()=>[A(V(el),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),R(`span`,$S,B(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),tC={class:`font-mono text-foreground`},nC={key:0,class:`shrink-0 text-xs tabular-nums`},rC={class:`font-mono text-foreground`},iC={key:0,class:`shrink-0 text-xs tabular-nums`},aC=P({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||``),o=Y(()=>!a.value&&!i.value&&!!t.streaming),s=Y(()=>{let e=t.tool.duration_ms;return e?e<1e3?`${e}ms`:`${(e/1e3).toFixed(+(e<1e4))}s`:``}),c=Y(()=>{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=Y(()=>[r.value&&`> ${r.value}`,a.value].filter(Boolean).join(`
|
||||
|
||||
`));return(t,r)=>e.tool.path?(L(),q(MS,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):l.value?(L(),q(V(kf),{key:1,"default-open":i.value},{default:I(()=>[k(V(Mf),null,{default:I(()=>[k(V(Pf),{status:i.value?`error`:o.value?`running`:void 0},{default:I(()=>[k(V(jf),null,{default:I(()=>[i.value?(L(),q(V(Hc),{key:0})):o.value?(L(),q(V(ul),{key:1,class:`animate-spin`})):(L(),q(V(zc),{key:2,class:`text-success`}))]),_:1}),R(`span`,NS,B(n.value),1),k(V(Ff),{class:`font-mono text-xs`},{default:I(()=>[H(B(c.value),1)]),_:1}),s.value?(L(),A(`span`,PS,B(s.value),1)):F(``,!0)]),_:1},8,[`status`])]),_:1}),k(V(Af),null,{default:I(()=>[k(V(Lf),{size:`sm`},{default:I(()=>[k(V(Hf),{wrap:``,class:`max-h-64`},{default:I(()=>[H(B(l.value),1)]),_:1})]),_:1})]),_:1})]),_:1},8,[`default-open`])):(L(),q(V(Pf),{key:2,status:i.value?`error`:o.value?`running`:void 0},{default:I(()=>[k(V(jf),null,{default:I(()=>[i.value?(L(),q(V(Hc),{key:0})):o.value?(L(),q(V(ul),{key:1,class:`animate-spin`})):(L(),q(V(zc),{key:2,class:`text-success`}))]),_:1}),R(`span`,FS,B(n.value),1),k(V(Ff),{class:`font-mono text-xs`},{default:I(()=>[H(B(c.value),1)]),_:1}),s.value?(L(),A(`span`,IS,B(s.value),1)):F(``,!0)]),_:1},8,[`status`]))}}),RS={class:`flex flex-col gap-1.5`},zS=P({__name:`ChatToolGroup`,props:{tools:{},streaming:{type:Boolean}},setup(e){let t=e,n=e=>!!(e.err||e.Err||e.failed),r=Y(()=>t.tools.some(n)),i=Y(()=>`${t.tools.length} tool call${t.tools.length===1?``:`s`}`);return(t,n)=>(L(),q(V(kf),{"default-open":r.value},{default:I(()=>[k(V(Mf),null,{default:I(()=>[k(V(Pf),{status:r.value?`error`:void 0},{default:I(()=>[k(V(jf),null,{default:I(()=>[k(V(Kl))]),_:1}),k(V(Ff),{class:`truncate`},{default:I(()=>[H(B(i.value),1)]),_:1})]),_:1},8,[`status`])]),_:1}),k(V(Af),null,{default:I(()=>[R(`div`,RS,[(L(!0),A(U,null,j(e.tools,(t,n)=>(L(),q(LS,{key:n,tool:t,streaming:e.streaming&&n===e.tools.length-1},null,8,[`tool`,`streaming`]))),128))])]),_:1})]),_:1},8,[`default-open`]))}}),BS={key:0,class:`mb-2 flex flex-wrap gap-1.5`},VS={key:2,class:`whitespace-pre-wrap`},HS=P({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){let t=e,n=Y(()=>{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)=>(L(),q(V(tS),{align:e.assistant?`start`:`end`},{default:I(()=>[k(V(nS),null,{default:I(()=>[k(V(Sf),{variant:e.assistant?`muted`:`tinted`,class:`max-w-[min(78ch,92%)]`},{default:I(()=>[k(V(Cf),{class:`[overflow-wrap:anywhere]`},{default:I(()=>[e.media.length?(L(),A(`div`,BS,[(L(!0),A(U,null,j(e.media,(e,t)=>(L(),q(sS,{key:t,attachment:e},null,8,[`attachment`]))),128))])):F(``,!0),e.assistant?(L(!0),A(U,{key:1},j(n.value,(t,r)=>(L(),A(U,{key:r},[`text`in t?(L(),q(AS,{key:0,text:t.text},null,8,[`text`])):(L(),q(V(Tf),{key:1,class:`my-2`},{default:I(()=>[t.tools.length>1?(L(),q(zS,{key:0,tools:t.tools,streaming:e.streaming&&r===n.value.length-1},null,8,[`tools`,`streaming`])):(L(),q(LS,{key:1,tool:t.tools[0],streaming:e.streaming&&r===n.value.length-1},null,8,[`tool`,`streaming`]))]),_:2},1024))],64))),128)):(L(),A(`div`,VS,B(e.text),1)),K(t.$slots,`default`)]),_:3})]),_:3},8,[`variant`]),e.assistant&&!e.streaming&&e.text?(L(),q(V(rS),{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:I(()=>[k(V(Wf),{value:e.text},null,8,[`value`])]),_:1})):F(``,!0)]),_:3})]),_:3},8,[`align`]))}}),US={class:`text-sm`},WS={key:0,class:`mt-1 text-fg-muted`},GS={key:1,class:`mt-2 flex flex-wrap gap-2`},KS=P({__name:`ChatChooseCard`,props:{choose:{}},setup(e){let t=Y(()=>vu.value.models??[]);return(e,n)=>(L(),A(`div`,US,[n[0]||=R(`p`,{class:`font-medium`},`Choose a model`,-1),t.value.length?(L(),A(`div`,GS,[(L(!0),A(U,null,j(t.value,e=>(L(),q(V(X),{key:e,size:`sm`,variant:e===V(vu).active_model?`default`:`outline`,class:`font-mono`,onClick:t=>void V(Iu)(e)},{default:I(()=>[H(B(e),1)]),_:2},1032,[`variant`,`onClick`]))),128))])):(L(),A(`p`,WS,`None configured.`))]))}}),qS={class:`text-sm`},JS={key:0},YS={class:`mt-1 space-y-0.5`},XS={class:`font-mono`},ZS=[`href`],QS={key:0,class:`mt-3 flex gap-2`},$S={key:1,class:`mt-2 text-fg-muted`},eC={key:2,class:`mt-2 text-fg-muted`},tC={key:3,class:`mt-2 text-ok`},nC={key:4,class:`mt-2 text-danger`},rC={key:5,class:`mt-2 text-xs text-fg-muted`},iC=P({__name:`ChatUpdateCard`,props:{update:{}},setup(e){let t=e,n=Y(()=>t.update.available??[]),r=J(`idle`),i=J(``);async function a(){r.value=`installing`;try{let e=(await Z.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>gT?`${r.slice(0,gT).trimEnd()}…`:r;return{text:i,full:n,truncated:i!==n}}function $te(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function vT(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 yT(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function bT(e){return typeof e==`string`?e:``}function xT(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,vT(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,bT(t.error),bT(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:[bT(t.previous_stage)&&`after ${bT(t.previous_stage)}`,bT(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=yT(t.iterations),i=yT(t.tokens),a=Number(t.cached_tokens)||0,o=yT((Number(t.prompt_tokens)||0)-a),s=yT(t.completion_tokens),c=yT(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,bT(t.model)].filter(Boolean);return{title:`Agent ${bT(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=bT(t.author);return{title:`Remediation ${bT(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${bT(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=bT(t.pr_number);return{title:`Pull request approved`,detail:[bT(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${bT(t.attempt)} of ${bT(t.of)} failed: ${e.stage||`step`}`,detail:bT(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=bT(t.source),n=bT(t.capture_id),r=[{label:`binding ${bT(t.binding_name)||bT(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 ${bT(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:$te(e.kind||e.type),detail:e.detail||``}}var ene=[`title`],ST=P({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=hT();n.watchIdentities();let r=e,i=t,a=lT(),o=Y(()=>a.taskIDFor(r.event)),s=Y(()=>_T(r.event,n.identityName));function c(){o.value>0&&i(`open`,o.value)}return(t,n)=>(L(),q(V(sr),{class:z(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:[nt(ct(c,[`prevent`]),[`enter`]),nt(ct(c,[`prevent`]),[`space`])]},{default:I(()=>[k(V(ir),{class:`font-medium`},{default:I(()=>[H(B(V(xT)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),k(V(ir),{class:`font-mono`},{default:I(()=>[H(B(o.value>0?`#${o.value}`:`–`),1)]),_:1}),k(V(ir),{class:`w-[55%] max-w-0`},{default:I(()=>[R(`span`,{class:`block truncate`,title:s.value.truncated?s.value.full:void 0},B(s.value.text),9,ene)]),_:1}),k(V(ir),null,{default:I(()=>[k(V(AC),{at:e.event.at},null,8,[`at`])]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),tne=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function CT(e){return(Number(e?.task_id)||0)>0}function nne(e,t){return t===`tasks`?CT(e):t!==`system`||!CT(e)}function rne(e,t){return e.filter(e=>nne(e,t))}function ine(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function ane(e,t){return`${e}:${t??0}`}function one(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=ane(_T(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 sne={role:`region`,"aria-label":`Activity`,"aria-live":`polite`},cne={class:`max-h-[28rem] overflow-y-auto`},lne={clas
Line truncated
|
||||
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}var $T=P({inheritAttrs:!1,__name:`SuggestInput`,props:Le({options:{},class:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=ye(e,`modelValue`),r=J(!1),i=Y(()=>{let e=r.value?n.value.toLowerCase():``;return t.options.filter(t=>t.toLowerCase().includes(e)).slice(0,50)});function a(e){r.value=!0,n.value=e}return(e,o)=>(L(),q(V(po),{modelValue:n.value,"onUpdate:modelValue":o[0]||=e=>n.value=e,"ignore-filter":``,"open-on-focus":``,"display-value":e=>e,"onUpdate:open":o[1]||=e=>r.value=!1},{default:I(()=>[k(V(mo),{"as-child":``},{default:I(()=>[k(V(yo),{"as-child":``,"model-value":n.value,"onUpdate:modelValue":a},{default:I(()=>[R(`input`,G(e.$attrs,{"data-slot":`input`,autocomplete:`off`,class:V(W)(V(Yn),t.class)}),null,16)]),_:1},8,[`model-value`])]),_:1}),k(V(xo),null,{default:I(()=>[i.value.length?(L(),q(V(_o),{key:0,position:`popper`,"side-offset":4,class:`z-50 max-h-60 w-(--reka-combobox-trigger-width) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10`},{default:I(()=>[k(V(So),{class:`max-h-60 overflow-y-auto p-1`},{default:I(()=>[(L(!0),A(U,null,j(i.value,e=>(L(),q(V(bo),{key:e,value:e,class:`relative flex w-full cursor-default items-center rounded-md px-1.5 py-1 font-mono text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground`},{default:I(()=>[H(B(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})):F(``,!0)]),_:1})]),_:1},8,[`modelValue`,`display-value`]))}});function eE(e){return(e?.merged||0)+(e?.completed||0)}function tE(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 Vne(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function nE(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 Hne(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=nE(e,r.type))}return n}var Une=[`onKeydown`],Wne={key:1,class:`grid gap-1.5`},Gne=[`for`],Kne={key:0,class:`font-normal text-fg-subtle`},qne={key:2,class:`grid gap-1.5`},Jne=[`id`],Yne={class:`min-w-0`},Xne={class:`block truncate text-label font-medium`},Zne={class:`block text-xs text-fg-subtle`},Qne={key:0,class:`text-xs text-fg-subtle`},$ne={key:3,class:`grid gap-3`},ere=[`for`],tre={class:`font-mono`},nre={key:0,class:`text-fg-subtle`},rre={class:`grid gap-1.5`},ire=[`for`],are={class:`grid gap-1.5`},ore=[`for`],sre={class:`flex items-center gap-2 border-t border-border pt-4`},cre={class:`mr-auto text-xs text-fg-subtle`},rE=P({__name:`NewTaskForm`,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[`started`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=me(),a=J([]),o=J([]),s=J([]),c=J(``);ke(async()=>{try{let[e,t]=await Promise.all([Z.workflows(),Z.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=J(``),u=J(n.workflow??n.initialWorkflow??``),d=J(n.initialInstructions??``),f=J(QT(d.value)),p=J({});pe(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=Y(()=>a.value.find(e=>e.id===u.value)),h=Y(()=>tE(m.value)),g=Y(()=>Vne(h.value,p.value)),_=Y(()=>m.value?.repository??`required`),v=Y(()=>_.value!==`optional`&&_.value!==`none`),y=e=>o.value.find(t=>t.workflow===e),b=J(!1),x=J(``),S=Y(()=>!(!l.value.trim()&&v.value||!u.value||!f.value.trim())&&g.value.length===0);async function C(){if(S.value&&!b.value){b.value=!0,x.value=``;try{let e=await Z.workRequest({repository:_.value===`none`?``:l.value.trim(),workflow:u.value,title:f.value.trim(),instructions:d.value,inputs:Hne(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)=>(L(),A(`form`,{class:`grid gap-5`,onSubmit:ct(C,[`prevent`]),onKeydown:[nt(ct(C,[`meta`,`prevent`]),[`enter`]),nt(ct(C,[`ctrl`,`prevent`]),[`enter`])]},[c.value?(L(),q(V(Qe),{key:0,variant:`destructive`},{default:I(()=>[k(V(Ze),null,{default:I(()=>[H(B(c.value),1)]),_:1})]),_:1})):F(``,!0),_.value===`none`?F(``,!0):(L(),A(`div`,Wne,[R(`label`,{for:`${V(i)}-repo`,class:`text-label font-medium`},[t[5]||=H(`Repository`,-1),v.value?F(``,!0):(L(),A(`span`,Kne,` (optional)`))],8,Gne),k(V($T),{id:`${V(i)}-repo`,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class:`font-mono`,placeholder:`owner/repository`,options:s.value,required:v.value},null,8,[`id`,`modelValue`,`options`,`required`])])),n.workflow?F(``,!0):(L(),A(`div`,qne,[R(`span`,{id:`${V(i)}-wf`,class:`text-label font-medium`},`Workflow`,8,Jne),k(V(IT),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-
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 yre(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 sE(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 cE(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 lE(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 uE=J([]),dE=J([]),fE=J(!0),pE=J(null),mE=J(!0),hE=J(null),gE=J(!1),_E=J(null);async function vE(){try{let e=await Z.eventTypes(oE().workspace);fE.value=e.enabled!==!1,uE.value=e.event_types||[],dE.value=e.proposals||[],pE.value=null}catch(e){pE.value=e.message||String(e)}finally{mE.value=!1}}function yE(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function bE(e){_E.value=null,hE.value=e}function xE(e){let t=kE.value.find(t=>String(t.id)===e.sample_id);bE({mode:`proposal`,id:null,source:e.source,name:``,rule:yE(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function SE(e=``){bE({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function CE(e){bE({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:yE(e.rule),headersText:``,body:``,exampleHeaders:{}})}function wE(){hE.value=null}async function TE(){let e=hE.value;if(e){gE.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:lE(e.rule)});else{let t=e.mode===`paste`?vre(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:lE(e.rule),example:{headers:t,body:e.body}})}hE.value=null,await vE()}catch(e){_E.value=e.message||String(e)}finally{gE.value=!1}}}var EE=J(null);async function DE(){let e=EE.value;if(EE.value=null,e)try{await Z.eventTypeDelete(e.id),await vE()}catch(e){pE.value=e.message||String(e)}}var OE=100,kE=J([]),AE=J(!0),jE=J(null),ME=J(!0),NE=J(null);async function PE(){try{let e=await Z.captures(OE);AE.value=e.enabled!==!1,kE.value=e.captures||[],jE.value=null}catch(e){jE.value=e.message||String(e)}finally{ME.value=!1}}function FE(e){let t=kE.value.find(t=>t.id===e);return t&&(NE.value=t),!!t}function IE(){kE.value.length&&(NE.value=kE.value[0])}function LE(){mn(`captures`,()=>{PE(),vE()})}var RE=P({__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=dt(n,`class`),a=T(i,r);return(e,t)=>(L(),q(V(As),G({"data-slot":`tabs`,"data-orientation":V(a).orientation||`horizontal`},V(a),{class:V(W)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:I(t=>[K(e.$slots,`default`,Ie(ue(t)))]),_:3},16,[`data-orientation`,`class`]))}}),zE=P({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=dt(t,`class`);return(e,r)=>(L(),q(V(Ns),G({"data-slot":`tabs-content`,class:V(W)(`text-sm flex-1 outline-none`,t.class)},V(n)),{default:I(()=>[K(e.$slots,`default`)]),_:3},16,[`class`]))}}),BE=P({__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=dt(t,`class`,`variant`);return(r,i)=>(L(),q(V(Ps),G({"data-slot":`tabs-list`,"data-variant":e.variant},V(n),{class:V(W)(V(HE)({variant:e.variant}),t.class)}),{default:I(()=>[K(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),VE=P({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=dt(t,`class`),r=C(n);return(e,n)=>(L(),q(V(Fs),G({"data-slot":`tabs-trigger`,class:V(W)(`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%-1px)] 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-visibleLine truncated
|
||||
`));return(t,r)=>e.tool.path?(L(),q(eC,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):l.value?(L(),q(V(Zf),{key:1,"default-open":i.value},{default:I(()=>[A(V(ep),null,{default:I(()=>[A(V(np),{status:i.value?`error`:o.value?`running`:void 0},{default:I(()=>[A(V($f),null,{default:I(()=>[i.value?(L(),q(V(vl),{key:0})):o.value?(L(),q(V(Vl),{key:1,class:`animate-spin`})):(L(),q(V(hl),{key:2,class:`text-success`}))]),_:1}),R(`span`,tC,B(n.value),1),A(V(rp),{class:`font-mono text-xs`},{default:I(()=>[H(B(c.value),1)]),_:1}),s.value?(L(),j(`span`,nC,B(s.value),1)):F(``,!0)]),_:1},8,[`status`])]),_:1}),A(V(Qf),null,{default:I(()=>[A(V(ap),{size:`sm`},{default:I(()=>[A(V(up),{wrap:``,class:`max-h-64`},{default:I(()=>[H(B(l.value),1)]),_:1})]),_:1})]),_:1})]),_:1},8,[`default-open`])):(L(),q(V(np),{key:2,status:i.value?`error`:o.value?`running`:void 0},{default:I(()=>[A(V($f),null,{default:I(()=>[i.value?(L(),q(V(vl),{key:0})):o.value?(L(),q(V(Vl),{key:1,class:`animate-spin`})):(L(),q(V(hl),{key:2,class:`text-success`}))]),_:1}),R(`span`,rC,B(n.value),1),A(V(rp),{class:`font-mono text-xs`},{default:I(()=>[H(B(c.value),1)]),_:1}),s.value?(L(),j(`span`,iC,B(s.value),1)):F(``,!0)]),_:1},8,[`status`]))}}),oC={class:`flex flex-col gap-1.5`},sC=P({__name:`ChatToolGroup`,props:{tools:{},streaming:{type:Boolean}},setup(e){let t=e,n=e=>!!(e.err||e.Err||e.failed),r=Y(()=>t.tools.some(n)),i=Y(()=>`${t.tools.length} tool call${t.tools.length===1?``:`s`}`);return(t,n)=>(L(),q(V(Zf),{"default-open":r.value},{default:I(()=>[A(V(ep),null,{default:I(()=>[A(V(np),{status:r.value?`error`:void 0},{default:I(()=>[A(V($f),null,{default:I(()=>[A(V(Cte))]),_:1}),A(V(rp),{class:`truncate`},{default:I(()=>[H(B(i.value),1)]),_:1})]),_:1},8,[`status`])]),_:1}),A(V(Qf),null,{default:I(()=>[R(`div`,oC,[(L(!0),j(U,null,M(e.tools,(t,n)=>(L(),q(aC,{key:n,tool:t,streaming:e.streaming&&n===e.tools.length-1},null,8,[`tool`,`streaming`]))),128))])]),_:1})]),_:1},8,[`default-open`]))}}),cC={key:0,class:`mb-2 flex flex-wrap gap-1.5`},lC={key:2,class:`whitespace-pre-wrap`},uC=P({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){let t=e,n=Y(()=>{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)=>(L(),q(V(CS),{align:e.assistant?`start`:`end`},{default:I(()=>[A(V(wS),null,{default:I(()=>[A(V(Wf),{variant:e.assistant?`muted`:`tinted`,class:`max-w-[min(78ch,92%)]`},{default:I(()=>[A(V(Gf),{class:`[overflow-wrap:anywhere]`},{default:I(()=>[e.media.length?(L(),j(`div`,cC,[(L(!0),j(U,null,M(e.media,(e,t)=>(L(),q(kS,{key:t,attachment:e},null,8,[`attachment`]))),128))])):F(``,!0),e.assistant?(L(!0),j(U,{key:1},M(n.value,(t,r)=>(L(),j(U,{key:r},[`text`in t?(L(),q(QS,{key:0,text:t.text},null,8,[`text`])):(L(),q(V(qf),{key:1,class:`my-2`},{default:I(()=>[t.tools.length>1?(L(),q(sC,{key:0,tools:t.tools,streaming:e.streaming&&r===n.value.length-1},null,8,[`tools`,`streaming`])):(L(),q(aC,{key:1,tool:t.tools[0],streaming:e.streaming&&r===n.value.length-1},null,8,[`tool`,`streaming`]))]),_:2},1024))],64))),128)):(L(),j(`div`,lC,B(e.text),1)),K(t.$slots,`default`)]),_:3})]),_:3},8,[`variant`]),e.assistant&&!e.streaming&&e.text?(L(),q(V(TS),{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:I(()=>[A(V(fp),{value:e.text},null,8,[`value`])]),_:1})):F(``,!0)]),_:3})]),_:3},8,[`align`]))}}),dC={class:`text-sm`},fC={key:0,class:`mt-1 text-fg-muted`},pC={key:1,class:`mt-2 flex flex-wrap gap-2`},mC=P({__name:`ChatChooseCard`,props:{choose:{}},setup(e){let t=Y(()=>Gu.value.models??[]);return(e,n)=>(L(),j(`div`,dC,[n[0]||=R(`p`,{class:`font-medium`},`Choose a model`,-1),t.value.length?(L(),j(`div`,pC,[(L(!0),j(U,null,M(t.value,e=>(L(),q(V(X),{key:e,size:`sm`,variant:e===V(Gu).active_model?`default`:`outline`,class:`font-mono`,onClick:t=>void V(ad)(e)},{default:I(()=>[H(B(e),1)]),_:2},1032,[`variant`,`onClick`]))),128))])):(L(),j(`p`,fC,`None configured.`))]))}}),hC={class:`text-sm`},gC={key:0},_C={class:`mt-1 space-y-0.5`},vC={class:`font-mono`},yC=[`href`],bC={key:0,class:`mt-3 flex gap-2`},xC={key:1,class:`mt-2 text-fg-muted`},SC={key:2,class:`mt-2 text-fg-muted`},CC={key:3,class:`mt-2 text-ok`},wC={key:4,class:`mt-2 text-danger`},TC={key:5,class:`mt-2 text-xs text-fg-muted`},EC=P({__name:`ChatUpdateCard`,props:{update:{}},setup(e){let t=e,n=Y(()=>t.update.available??[]),r=J(`idle`),i=J(``);async function a(){r.value=`installing`;try{let e=(await Z.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>bE?`${r.slice(0,bE).trimEnd()}…`:r;return{text:i,full:n,truncated:i!==n}}function aae(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function SE(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 CE(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function wE(e){return typeof e==`string`?e:``}function TE(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,SE(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,wE(t.error),wE(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:[wE(t.previous_stage)&&`after ${wE(t.previous_stage)}`,wE(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=CE(t.iterations),i=CE(t.tokens),a=Number(t.cached_tokens)||0,o=CE((Number(t.prompt_tokens)||0)-a),s=CE(t.completion_tokens),c=CE(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,wE(t.model)].filter(Boolean);return{title:`Agent ${wE(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=wE(t.author);return{title:`Remediation ${wE(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${wE(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=wE(t.pr_number);return{title:`Pull request approved`,detail:[wE(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${wE(t.attempt)} of ${wE(t.of)} failed: ${e.stage||`step`}`,detail:wE(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=wE(t.source),n=wE(t.capture_id),r=[{label:`binding ${wE(t.binding_name)||wE(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 ${wE(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:aae(e.kind||e.type),detail:e.detail||``}}var oae=[`title`],EE=P({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=yE();n.watchIdentities();let r=e,i=t,a=sE(),o=Y(()=>a.taskIDFor(r.event)),s=Y(()=>xE(r.event,n.identityName));function c(){o.value>0&&i(`open`,o.value)}return(t,n)=>(L(),q(V(hE),{class:z(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:[lt(_t(c,[`prevent`]),[`enter`]),lt(_t(c,[`prevent`]),[`space`])]},{default:I(()=>[A(V(mE),{class:`font-medium`},{default:I(()=>[H(B(V(TE)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),A(V(mE),{class:`font-mono`},{default:I(()=>[H(B(o.value>0?`#${o.value}`:`–`),1)]),_:1}),A(V(mE),{class:`w-[55%] max-w-0`},{default:I(()=>[R(`span`,{class:`block truncate`,title:s.value.truncated?s.value.full:void 0},B(s.value.text),9,oae)]),_:1}),A(V(mE),null,{default:I(()=>[A(V(YC),{at:e.event.at},null,8,[`at`])]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),DE=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function OE(e){return(Number(e?.task_id)||0)>0}function kE(e,t){return t===`tasks`?OE(e):t!==`system`||!OE(e)}function AE(e,t){return e.filter(e=>kE(e,t))}function jE(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function ME(e,t){return`${e}:${t??0}`}function NE(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=ME(xE(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 PE={role:`region`,"aria-label":`Activity`,"aria-live":`polite`},FE={class:`max-h-[28rem] overflow-y-auto`},IE={class:`inline-fLine truncated
|
||||
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}var $D=P({inheritAttrs:!1,__name:`SuggestInput`,props:He({options:{},class:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=we(e,`modelValue`),r=J(!1),i=Y(()=>{let e=r.value?n.value.toLowerCase():``;return t.options.filter(t=>t.toLowerCase().includes(e)).slice(0,50)});function a(e){r.value=!0,n.value=e}return(e,o)=>(L(),q(V(Ar),{modelValue:n.value,"onUpdate:modelValue":o[0]||=e=>n.value=e,"ignore-filter":``,"open-on-focus":``,"display-value":e=>e,"onUpdate:open":o[1]||=e=>r.value=!1},{default:I(()=>[A(V(jr),{"as-child":``},{default:I(()=>[A(V(Ir),{"as-child":``,"model-value":n.value,"onUpdate:modelValue":a},{default:I(()=>[R(`input`,G(e.$attrs,{"data-slot":`input`,autocomplete:`off`,class:V(W)(V(aee),t.class)}),null,16)]),_:1},8,[`model-value`])]),_:1}),A(V(Rr),null,{default:I(()=>[i.value.length?(L(),q(V(Pr),{key:0,position:`popper`,"side-offset":4,class:`z-50 max-h-60 w-(--reka-combobox-trigger-width) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10`},{default:I(()=>[A(V(Br),{class:`max-h-60 overflow-y-auto p-1`},{default:I(()=>[(L(!0),j(U,null,M(i.value,e=>(L(),q(V(Lr),{key:e,value:e,class:`relative flex w-full cursor-default items-center rounded-md px-1.5 py-1 font-mono text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground`},{default:I(()=>[H(B(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})):F(``,!0)]),_:1})]),_:1},8,[`modelValue`,`display-value`]))}});function eO(e){return(e?.merged||0)+(e?.completed||0)}function tO(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 nO(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function rO(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 iO(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=rO(e,r.type))}return n}var aO=[`onKeydown`],oO={key:1,class:`grid gap-1.5`},sO=[`for`],cO={key:0,class:`font-normal text-fg-subtle`},lO={key:2,class:`grid gap-1.5`},uO=[`id`],dO={class:`min-w-0`},fO={class:`block truncate text-label font-medium`},pO={class:`block text-xs text-fg-subtle`},mO={key:0,class:`text-xs text-fg-subtle`},hO={key:3,class:`grid gap-3`},gO=[`for`],_O={class:`font-mono`},vO={key:0,class:`text-fg-subtle`},yO={class:`grid gap-1.5`},bO=[`for`],xO={class:`grid gap-1.5`},SO=[`for`],CO={class:`flex items-center gap-2 border-t border-border pt-4`},wO={class:`mr-auto text-xs text-fg-subtle`},TO=P({__name:`NewTaskForm`,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[`started`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=ye(),a=J([]),o=J([]),s=J([]),c=J(``);Pe(async()=>{try{let[e,t]=await Promise.all([Z.workflows(),Z.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=J(``),u=J(n.workflow??n.initialWorkflow??``),d=J(n.initialInstructions??``),f=J(QD(d.value)),p=J({});ve(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=Y(()=>a.value.find(e=>e.id===u.value)),h=Y(()=>tO(m.value)),g=Y(()=>nO(h.value,p.value)),_=Y(()=>m.value?.repository??`required`),v=Y(()=>_.value!==`optional`&&_.value!==`none`),y=e=>o.value.find(t=>t.workflow===e),b=J(!1),x=J(``),S=Y(()=>!(!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 Z.workRequest({repository:_.value===`none`?``:l.value.trim(),workflow:u.value,title:f.value.trim(),instructions:d.value,inputs:iO(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)=>(L(),j(`form`,{class:`grid gap-5`,onSubmit:_t(ee,[`prevent`]),onKeydown:[lt(_t(ee,[`meta`,`prevent`]),[`enter`]),lt(_t(ee,[`ctrl`,`prevent`]),[`enter`])]},[c.value?(L(),q(V(pt),{key:0,variant:`destructive`},{default:I(()=>[A(V(nt),null,{default:I(()=>[H(B(c.value),1)]),_:1})]),_:1})):F(``,!0),_.value===`none`?F(``,!0):(L(),j(`div`,oO,[R(`label`,{for:`${V(i)}-repo`,class:`text-label font-medium`},[t[5]||=H(`Repository`,-1),v.value?F(``,!0):(L(),j(`span`,cO,` (optional)`))],8,sO),A(V($D),{id:`${V(i)}-repo`,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class:`font-mono`,placeholder:`owner/repository`,options:s.value,required:v.value},null,8,[`id`,`modelValue`,`options`,`required`])])),n.workflow?F(``,!0):(L(),j(`div`,lO,[R(`span`,{id:`${V(i)}-wf`,class:`text-label font-medium`},`Workflow`,8,uO),A(V(dD),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-labelledby":`${V(i)}-wf`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 zO(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 BO(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 VO(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 HO(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 UO=J([]),WO=J([]),GO=J(!0),KO=J(null),qO=J(!0),JO=J(null),YO=J(!1),XO=J(null);async function ZO(){try{let e=await Z.eventTypes(LO().workspace);GO.value=e.enabled!==!1,UO.value=e.event_types||[],WO.value=e.proposals||[],KO.value=null}catch(e){KO.value=e.message||String(e)}finally{qO.value=!1}}function QO(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function $O(e){XO.value=null,JO.value=e}function ek(e){let t=ck.value.find(t=>String(t.id)===e.sample_id);$O({mode:`proposal`,id:null,source:e.source,name:``,rule:QO(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function tk(e=``){$O({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function nk(e){$O({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:QO(e.rule),headersText:``,body:``,exampleHeaders:{}})}function rk(){JO.value=null}async function ik(){let e=JO.value;if(e){YO.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:HO(e.rule)});else{let t=e.mode===`paste`?RO(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:HO(e.rule),example:{headers:t,body:e.body}})}JO.value=null,await ZO()}catch(e){XO.value=e.message||String(e)}finally{YO.value=!1}}}var ak=J(null);async function ok(){let e=ak.value;if(ak.value=null,e)try{await Z.eventTypeDelete(e.id),await ZO()}catch(e){KO.value=e.message||String(e)}}var sk=100,ck=J([]),lk=J(!0),uk=J(null),dk=J(!0),fk=J(null);async function pk(){try{let e=await Z.captures(sk);lk.value=e.enabled!==!1,ck.value=e.captures||[],uk.value=null}catch(e){uk.value=e.message||String(e)}finally{dk.value=!1}}function mk(e){let t=ck.value.find(t=>t.id===e);return t&&(fk.value=t),!!t}function hk(){ck.value.length&&(fk.value=ck.value[0])}function gk(){zd(`captures`,()=>{pk(),ZO()})}var _k=P({__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=xt(n,`class`),a=D(i,r);return(e,t)=>(L(),q(V(Ha),G({"data-slot":`tabs`,"data-orientation":V(a).orientation||`horizontal`},V(a),{class:V(W)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:I(t=>[K(e.$slots,`default`,Ve(he(t)))]),_:3},16,[`data-orientation`,`class`]))}}),vk=P({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=xt(t,`class`);return(e,r)=>(L(),q(V(Ga),G({"data-slot":`tabs-content`,class:V(W)(`text-sm flex-1 outline-none`,t.class)},V(n)),{default:I(()=>[K(e.$slots,`default`)]),_:3},16,[`class`]))}}),yk=P({__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=xt(t,`class`,`variant`);return(r,i)=>(L(),q(V(Ka),G({"data-slot":`tabs-list`,"data-variant":e.variant},V(n),{class:V(W)(V(xk)({variant:e.variant}),t.class)}),{default:I(()=>[K(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),bk=P({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=xt(t,`class`),r=w(n);return(e,n)=>(L(),q(V(qa),G({"data-slot":`tabs-trigger`,class:V(W)(`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%-1px)] 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:oLine 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 oB=Kz(`CharSizeService`),sB=Kz(`CoreBrowserService`),cB=Kz(`MouseService`),lB=Kz(`RenderService`),uB=Kz(`SelectionService`),dB=Kz(`CharacterJoinerService`),fB=Kz(`ThemeService`),pB=Kz(`LinkProviderService`),mB=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?bB.isErrorNoTelemetry(e)?new bB(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 zH=TH(`CharSizeService`),BH=TH(`CoreBrowserService`),VH=TH(`MouseService`),HH=TH(`RenderService`),UH=TH(`SelectionService`),WH=TH(`CharacterJoinerService`),GH=TH(`ThemeService`),KH=TH(`LinkProviderService`),qH=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?$H.isErrorNoTelemetry(e)?new $H(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 hB(e){_B(e)||mB.onUnexpectedError(e)}var gB=`Canceled`;function _B(e){return e instanceof vB||e instanceof Error&&e.name===gB&&e.message===gB}var vB=class extends Error{constructor(){super(gB),this.name=this.message}};function yB(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var bB=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`}},xB=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function SB(e,t=0){return e[e.length-(1+t)]}var CB;(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})(CB||={});var wB=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||CB.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};wB.empty=new wB(e=>{});function TB(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 EB;(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})(EB||={});var DB=null;function OB(e){return DB?.trackDisposable(e),e}function kB(e){DB?.markAsDisposed(e)}function AB(e,t){DB?.setParent(e,t)}function jB(e){return DB?.markAsSingleton(e),e}function MB(e){if(EB.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 NB(...e){return PB(()=>MB(e))}function PB(e){let t=OB({dispose:TB(()=>{kB(t),e()})});return t}var FB=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,OB(this)}dispose(){this._isDisposed||(kB(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{MB(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return AB(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),AB(e,null))}};FB.DISABLE_DISPOSED_WARNING=!1;var IB=FB,LB=class{constructor(){this._store=new IB,OB(this),AB(this._store,this)}dispose(){kB(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 JH(e){XH(e)||qH.onUnexpectedError(e)}var YH=`Canceled`;function XH(e){return e instanceof ZH||e instanceof Error&&e.name===YH&&e.message===YH}var ZH=class extends Error{constructor(){super(YH),this.name=this.message}};function QH(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var $H=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`}},eU=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function tU(e,t=0){return e[e.length-(1+t)]}var nU;(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})(nU||={});var rU=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||nU.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};rU.empty=new rU(e=>{});function iU(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 aU;(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})(aU||={});var oU=null;function sU(e){return oU?.trackDisposable(e),e}function cU(e){oU?.markAsDisposed(e)}function lU(e,t){oU?.setParent(e,t)}function uU(e){return oU?.markAsSingleton(e),e}function dU(e){if(aU.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 fU(...e){return pU(()=>dU(e))}function pU(e){let t=sU({dispose:iU(()=>{cU(t),e()})});return t}var mU=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,sU(this)}dispose(){this._isDisposed||(cU(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{dU(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return lU(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),lU(e,null))}};mU.DISABLE_DISPOSED_WARNING=!1;var hU=mU,gU=class{constructor(){this._store=new hU,sU(this),lU(this._store,this)}dispose(){cU(thi
Line truncated
|
||||
`).slice(2).join(`
|
||||
`))}},QB=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},$B=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},eV=0,tV=class{constructor(e){this.value=e,this.id=eV++}},nV=2,rV=class{constructor(e){this._size=0,this._options=e,this._leakageMon=JB>0||this._options?.leakWarningThreshold?new XB(e?.onListenerError??hB,this._options?.leakWarningThreshold??JB):void 0,this._perfMon=this._options?._profName?new qB(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 $B(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||hB)(n),LB.None}if(this._disposed)return LB.None;t&&(e=e.bind(t));let r=new tV(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=ZB.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof tV?(this._deliveryQueue??=new iV,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=PB(()=>{i?.(),this._removeListener(r)});return n instanceof IB?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*nV<=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||hB;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 tV)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}},iV=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}},aV=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new rV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new rV,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}};aV.INSTANCE=new aV;var oV=aV;function sV(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}oV.INSTANCE.onDidChangeZoomLevel;function cV(e){return oV.INSTANCE.getZoomFactor(e)}oV.INSTANCE.onDidChangeFullscreen;var lV=typeof navigator==`object`?navigator.userAgent:``,uV=lV.indexOf(`Firefox`)>=0,dV=lV.indexOf(`AppleWebKit`)>=0,fV=lV.indexOf(`Chrome`)>=0,pV=!fV&&lV.indexOf(`Safari`)>=0;lV.indexOf(`Electron/`),lV.indexOf(`Android`);var mV=!1;if(typeof zB.matchMedia==`function`){let e=zB.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=zB.matchMedia(`(display-mode: fullscreen)`);mV=e.matches,sV(zB,e,({matches:e})=>{mV&&t.matches||(mV=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}};uU=bz([xz(2,Jz),xz(3,sB),xz(4,Yz),xz(5,fB),xz(6,eB),xz(7,lB)],uU);var dU=class extends LB{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(PB(()=>{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._renderLine 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 _U;(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=``))(_U||={});var vU;(e=>e.ST=`${$.ESC}\\`)(vU||={});var yU=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)}}};yU=bz([xz(2,Jz),xz(3,eB),xz(4,Xz),xz(5,lB)],yU);var bU=0,xU=0,SU=0,CU=0,wU={css:`#00000000`,rgba:0},TU;(e=>{function t(e,t,n,r){return r===void 0?`#${AU(e)}${AU(t)}${AU(n)}`:`#${AU(e)}${AU(t)}${AU(n)}${AU(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})(TU||={});var EU;(e=>{function t(e,t){if(CU=(t.rgba&255)/255,CU===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 bU=a+Math.round((n-a)*CU),xU=o+Math.round((r-o)*CU),SU=s+Math.round((i-s)*CU),{css:TU.toCss(bU,xU,SU),rgba:TU.toRgba(bU,xU,SU)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=kU.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return TU.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[bU,xU,SU]=kU.toChannels(t),{css:TU.toCss(bU,xU,SU),rgba:t}}e.opaque=i;function a(e,t){return CU=Math.round(t*255),[bU,xU,SU]=kU.toChannels(e.rgba),{css:TU.toCss(bU,xU,SU,CU),rgba:TU.toRgba(bU,xU,SU,CU)}}e.opacity=a;function o(e,t){return CU=e.rgba&255,a(e,CU*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.r
Line truncated
|
||||
`))}},jU=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},MU=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},NU=0,PU=class{constructor(e){this.value=e,this.id=NU++}},FU=2,IU=class{constructor(e){this._size=0,this._options=e,this._leakageMon=DU>0||this._options?.leakWarningThreshold?new kU(e?.onListenerError??JH,this._options?.leakWarningThreshold??DU):void 0,this._perfMon=this._options?._profName?new EU(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 MU(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||JH)(n),gU.None}if(this._disposed)return gU.None;t&&(e=e.bind(t));let r=new PU(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=AU.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof PU?(this._deliveryQueue??=new LU,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=pU(()=>{i?.(),this._removeListener(r)});return n instanceof hU?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*FU<=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||JH;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 PU)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}},LU=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}},RU=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new IU,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new IU,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}};RU.INSTANCE=new RU;var zU=RU;function BU(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}zU.INSTANCE.onDidChangeZoomLevel;function VU(e){return zU.INSTANCE.getZoomFactor(e)}zU.INSTANCE.onDidChangeFullscreen;var HU=typeof navigator==`object`?navigator.userAgent:``,UU=HU.indexOf(`Firefox`)>=0,WU=HU.indexOf(`AppleWebKit`)>=0,GU=HU.indexOf(`Chrome`)>=0,KU=!GU&&HU.indexOf(`Safari`)>=0;HU.indexOf(`Electron/`),HU.indexOf(`Android`);var qU=!1;if(typeof vU.matchMedia==`function`){let e=vU.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=vU.matchMedia(`(display-mode: fullscreen)`);qU=e.matches,BU(vU,e,({matches:e})=>{qU&&t.matches||(qU=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}};UG=$V([eH(2,DH),eH(3,BH),eH(4,OH),eH(5,GH),eH(6,NH),eH(7,HH)],UG);var WG=class extends gU{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(pU(()=>{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._renderLine 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 XG;(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=``))(XG||={});var ZG;(e=>e.ST=`${$.ESC}\\`)(ZG||={});var QG=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)}}};QG=$V([eH(2,DH),eH(3,NH),eH(4,kH),eH(5,HH)],QG);var $G=0,eK=0,tK=0,nK=0,rK={css:`#00000000`,rgba:0},iK;(e=>{function t(e,t,n,r){return r===void 0?`#${lK(e)}${lK(t)}${lK(n)}`:`#${lK(e)}${lK(t)}${lK(n)}${lK(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})(iK||={});var aK;(e=>{function t(e,t){if(nK=(t.rgba&255)/255,nK===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 $G=a+Math.round((n-a)*nK),eK=o+Math.round((r-o)*nK),tK=s+Math.round((i-s)*nK),{css:iK.toCss($G,eK,tK),rgba:iK.toRgba($G,eK,tK)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=cK.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return iK.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[$G,eK,tK]=cK.toChannels(t),{css:iK.toCss($G,eK,tK),rgba:t}}e.opaque=i;function a(e,t){return nK=Math.round(t*255),[$G,eK,tK]=cK.toChannels(e.rgba),{css:iK.toCss($G,eK,tK,nK),rgba:iK.toRgba($G,eK,tK,nK)}}e.opacity=a;function o(e,t){return nK=e.rgba&255,a(e,nK*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()),xW&&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=WW(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=aW(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,-GW),GW),t/=GW,t/Math.abs(t)+Math.round(t*(KW-1)))}shouldForceSelection(e){return _W?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(),qW)}_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&&!(_W&&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(bH(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(PB(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<qK+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
||||
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===qK+1&&(this._liveRegion.textContent+=Tz.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 Cz.get()},set promptLabel(e){Cz.set(e)},get tooMuchOutput(){return Tz.get()},set tooMuchOutput(e){Tz.set(e)}}}_verifyIntegers(...e){for(oq of e)if(oq===1/0||isNaN(oq)||oq%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(oq of e)if(oq&&(oq===1/0||isNaN(oq)||oq%1!=0||oq<0))throw Error(`This API only accepts positive integers`)}},cq=2,lq=1,uq=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(cq,Math.floor(u/e.css.cell.width)),rows:Math.max(lq,Math.floor(l/e.css.cell.height))}}},dq={class:`flex h-[32rem] min-h-0 flex-col gap-2`},fq={key:0,class:`text-sm text-fg-muted`,role:`status`},pq=P({__name:`SandboxView`,props:{taskId:{},attempt:{}},setup(e){let t=e,n=J(null),r=J(`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 sq({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`}}),o=new uq,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)=>(L(),A(`div`,dq,[r.value===`open`?F(``,!0):(L(),A(`p`,fq,[r.value===`connecting`?(L(),A(U,{key:0},[H(`Connecting…`)],64)):r.value===`closed`?(L(),A(U,{key:1},[H(`The sandbox ended.`)],64)):(L(),A(U,{key:2},[H(`Sandbox unavailable.`)],64))])),R(`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)]))}}),mq={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},hq={class:`inline-flex items-center gap-2`},gq={class:`inline-flex items-center gap-2`},_q=`__all__`,vq=P({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>CA.map(e=>({value:e.value||_q,label:e.label}))),a=Y(()=>n.filters.level||_q),o=Y(()=>n.filters.stage||_q);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===_q?``:String(e)})}function l(e){s({stage:String(e)===_q?``:String(e)})}return(t,n)=>(L(),A(`div`,mq,[R(`div`,hq,[k(V(Vn),{"model-value":a.value,"onUpdate:modelValue":c},{default:I(()=>[k(V(Rn),{size:`sm`,"aria-label":`Filter log entries by level`},{default:I(()=>[k(V(Hn))]),_:1}),k(V(zn),null,{default:I(()=>[k(V(Pn),null,{default:I(()=>[(L(!0),A(U,null,j(i.value,e=>(L(),q(V(In),{key:e.value,value:e.value},{default:I(()=>[H(B(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),R(`div`,gq,[k(V(Vn),{"model-value":o.value,"onUpdate:modelValue":l},{default:I(()=>[k(V(Rn),{size:`sm`,"aria-label":`Filter log entries by stage`},{default:I(()=>[k(V(Hn))]),_:1}),k(V(zn),null,{default:I(()=>[k(V(Pn),null,{default:I(()=>[k(V(In),{value:_q},{default:I(()=>[...n[0]||=[H(`All stages`,-1)]]),_:1}),(L(!0),A(U,null,j(e.stages,e=>(L(),q(V(In),{key:e,value:e},{default:I(()=>[H(B(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),yq={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},bq={key:2,class:`flex flex-col items-start gap-2 py-3`},xq={key:0,class:`mt-2 flex flex-wrap items-cent
Line truncated
|
||||
`)}};NY.defaultYaml={explicit:!1,version:`1.2`},NY.defaultTags={"!!":`tag:yaml.org,2002:`};function PY(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function FY(e){let t=new Set;return EY(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function IY(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function LY(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=FY(e);let a=IY(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(vY(t.node)||bY(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 RY(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=RY(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=RY(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=RY(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=RY(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function zY(e,t,n){if(Array.isArray(e))return e.map((e,t)=>zY(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!SY(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 BY=class{constructor(e){Object.defineProperty(this,pY,{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(!hY(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=zY(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?RY(i,{"":o},``,o):o}},VY=class extends BY{constructor(e){super(sY),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=[],EY(e,{Node:(e,t)=>{(mY(t)||SY(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||=(zY(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=HY(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(PY(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 HY(e,t,n){if(mY(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(bY(t)){let r=0;for(let i of t.items){let t=HY(e,i,n);t>r&&(r=t)}return r}if(_Y(t)){let r=HY(e,t.key,n),i=HY(e,t.value,n);return Math.max(r,i)}return 1}var UY=e=>!e||typeof e!=`function`&&typeof e!=`object`,WY=class extends BY{constructor(e){super(dY),this.value=e}toJSON(e,t){return t?.keep?this.value:zY(this.value,e,t)}toString(){return String(this.value)}};WY.BLOCK_FOLDED=`BLOCK_FOLDED`,WY.BLOCK_LITERAL=`BLOCK_LITERAL`,WY.PLAIN=`PLAIN`,WY.QUOTE_DOUBLE=`QUOTE_DOUBLE`,WY.QUOTE_SINGLE=`QUOTE_SINGLE`;var GY=`tag:yaml.org,2002:`;function KY(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 qY(e,t,n){if(hY(e)&&(e=e.contents),xY(e))return e;if(_Y(e)){let t=n.schema[lY].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 VY(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=GY+t.slice(2));let l=KY(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new WY(e);return c&&(c.node=t),t
Line truncated
|
||||
`)?QY(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()),eq&&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=Cq(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=RK(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,-wq),wq),t/=wq,t/Math.abs(t)+Math.round(t*(Tq-1)))}shouldForceSelection(e){return XK?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(),Eq)}_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&&!(XK&&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($W(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(pU(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<EY+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
||||
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===EY+1&&(this._liveRegion.textContent+=iH.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 nH.get()},set promptLabel(e){nH.set(e)},get tooMuchOutput(){return iH.get()},set tooMuchOutput(e){iH.set(e)}}}_verifyIntegers(...e){for(zY of e)if(zY===1/0||isNaN(zY)||zY%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(zY of e)if(zY&&(zY===1/0||isNaN(zY)||zY%1!=0||zY<0))throw Error(`This API only accepts positive integers`)}},VY=2,HY=1,UY=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(VY,Math.floor(u/e.css.cell.width)),rows:Math.max(HY,Math.floor(l/e.css.cell.height))}}},WY={class:`flex h-[32rem] min-h-0 flex-col gap-2`},GY={key:0,class:`text-sm text-fg-muted`,role:`status`},KY=P({__name:`SandboxView`,props:{taskId:{},attempt:{}},setup(e){let t=e,n=J(null),r=J(`connecting`),i=null,a=null,o=null,s=null;function c(){try{o?.fit()}catch{}}return Pe(()=>{let e=n.value;if(!e)return;i=new BY({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`}}),o=new UY,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)}),Xe(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(L(),j(`div`,WY,[r.value===`open`?F(``,!0):(L(),j(`p`,GY,[r.value===`connecting`?(L(),j(U,{key:0},[H(`Connecting…`)],64)):r.value===`closed`?(L(),j(U,{key:1},[H(`The sandbox ended.`)],64)):(L(),j(U,{key:2},[H(`Sandbox unavailable.`)],64))])),R(`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)]))}}),qY={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},JY={class:`inline-flex items-center gap-2`},YY={class:`inline-flex items-center gap-2`},XY=`__all__`,ZY=P({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>nN.map(e=>({value:e.value||XY,label:e.label}))),a=Y(()=>n.filters.level||XY),o=Y(()=>n.filters.stage||XY);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===XY?``:String(e)})}function l(e){s({stage:String(e)===XY?``:String(e)})}return(t,n)=>(L(),j(`div`,qY,[R(`div`,JY,[A(V(Eu),{"model-value":a.value,"onUpdate:modelValue":c},{default:I(()=>[A(V(Au),{size:`sm`,"aria-label":`Filter log entries by level`},{default:I(()=>[A(V(ju))]),_:1}),A(V(Du),null,{default:I(()=>[A(V(Ou),null,{default:I(()=>[(L(!0),j(U,null,M(i.value,e=>(L(),q(V(ku),{key:e.value,value:e.value},{default:I(()=>[H(B(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),R(`div`,YY,[A(V(Eu),{"model-value":o.value,"onUpdate:modelValue":l},{default:I(()=>[A(V(Au),{size:`sm`,"aria-label":`Filter log entries by stage`},{default:I(()=>[A(V(ju))]),_:1}),A(V(Du),null,{default:I(()=>[A(V(Ou),null,{default:I(()=>[A(V(ku),{value:XY},{default:I(()=>[...n[0]||=[H(`All stages`,-1)]]),_:1}),(L(!0),j(U,null,M(e.stages,e=>(L(),q(V(ku),{key:e,value:e},{default:I(()=>[H(B(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),QY={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},$Y={key:2,class:`flex flex-col items-start gap-2 py-3`},eX={key:0,class:`mt-2 flex flex-wrap items-cent
Line truncated
|
||||
`)}};fQ.defaultYaml={explicit:!1,version:`1.2`},fQ.defaultTags={"!!":`tag:yaml.org,2002:`};function pQ(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function mQ(e){let t=new Set;return aQ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function hQ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function gQ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=mQ(e);let a=hQ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(ZZ(t.node)||$Z(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 _Q(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=_Q(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=_Q(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=_Q(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=_Q(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function vQ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>vQ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!tQ(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 yQ=class{constructor(e){Object.defineProperty(this,KZ,{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(!JZ(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=vQ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?_Q(i,{"":o},``,o):o}},bQ=class extends yQ{constructor(e){super(BZ),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=[],aQ(e,{Node:(e,t)=>{(qZ(t)||tQ(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||=(vQ(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=xQ(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(pQ(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 xQ(e,t,n){if(qZ(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if($Z(t)){let r=0;for(let i of t.items){let t=xQ(e,i,n);t>r&&(r=t)}return r}if(XZ(t)){let r=xQ(e,t.key,n),i=xQ(e,t.value,n);return Math.max(r,i)}return 1}var SQ=e=>!e||typeof e!=`function`&&typeof e!=`object`,CQ=class extends yQ{constructor(e){super(WZ),this.value=e}toJSON(e,t){return t?.keep?this.value:vQ(this.value,e,t)}toString(){return String(this.value)}};CQ.BLOCK_FOLDED=`BLOCK_FOLDED`,CQ.BLOCK_LITERAL=`BLOCK_LITERAL`,CQ.PLAIN=`PLAIN`,CQ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,CQ.QUOTE_SINGLE=`QUOTE_SINGLE`;var wQ=`tag:yaml.org,2002:`;function TQ(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 EQ(e,t,n){if(JZ(e)&&(e=e.contents),eQ(e))return e;if(XZ(e)){let t=n.schema[HZ].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 bQ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=wQ+t.slice(2));let l=TQ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new CQ(e);return c&&(c.node=t),t
Line truncated
|
||||
`)?jQ(n,t):n.includes(`
|
||||
`)?`
|
||||
`+QY(n,t):(e.endsWith(` `)?``:` `)+n,eX=`flow`,tX=`block`,nX=`quoted`;function rX(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=iX(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=iX(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
||||
`+jQ(n,t):(e.endsWith(` `)?``:` `)+n,NQ=`flow`,PQ=`block`,FQ=`quoted`;function IQ(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=LQ(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=LQ(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 iX(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 aX=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),oX=e=>/^(%|---|\.\.\.)/m.test(e);function sX(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 cX(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(oX(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
||||
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function LQ(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 RQ=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),zQ=e=>/^(%|---|\.\.\.)/m.test(e);function BQ(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 VQ(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(zQ(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
||||
|
||||
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
||||
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:rX(o,a,nX,aX(t,!1))}function lX(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||||
`)||/[ \t]\n|\n[ \t]/.test(e))return cX(e,t);let n=t.indent||(oX(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:rX(r,n,eX,aX(t,!1))}function uX(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=cX;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?lX:i&&!t?cX:n?lX:cX}return r(e,t)}var dX;try{dX=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:IQ(o,a,FQ,RQ(t,!1))}function HQ(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||||
`)||/[ \t]\n|\n[ \t]/.test(e))return VQ(e,t);let n=t.indent||(zQ(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:IQ(r,n,NQ,RQ(t,!1))}function UQ(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=VQ;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?HQ:i&&!t?VQ:n?HQ:VQ}return r(e,t)}var WQ;try{WQ=RegExp(`(^|(?<!
|
||||
))
|
||||
+(?!
|
||||
|$)`,`g`)}catch{dX=/\n+(?!\n|$)/g}function fX({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 uX(n,r);let l=r.indent||(r.forceBlockIndent||oX(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===WY.BLOCK_FOLDED?!1:t===WY.BLOCK_LITERAL||!sX(n,c,l.length);if(!n)return u?`|
|
||||
|$)`,`g`)}catch{WQ=/\n+(?!\n|$)/g}function GQ({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 UQ(n,r);let l=r.indent||(r.forceBlockIndent||zQ(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===CQ.BLOCK_FOLDED?!1:t===CQ.BLOCK_LITERAL||!BQ(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(dX,`$&${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(WQ,`$&${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=aX(r,!0);o!==`folded`&&t!==WY.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=rX(`${v}${e}${p}`,l,tX,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function pX(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 uX(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||||
`)?uX(a,t):fX(e,t,n,r);if(!s&&!u&&i!==WY.PLAIN&&a.includes(`
|
||||
`))return fX(e,t,n,r);if(oX(a)){if(c===``)return t.forceBlockIndent=!0,fX(e,t,n,r);if(s&&c===l)return uX(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 uX(a,t)}return s?d:rX(d,c,eX,aX(t,!1))}function mX(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!==WY.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=WY.QUOTE_DOUBLE);let c=e=>{switch(e){case WY.BLOCK_FOLDED:case WY.BLOCK_LITERAL:return i||a?uX(o.value,t):fX(o,t,n,r);case WY.QUOTE_DOUBLE:return cX(o.value,t);case WY.QUOTE_SINGLE:return lX(o.value,t);case WY.PLAIN:return pX(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 hX(e,t){let n=Object.assign({blockQuote:!0,commentString:ZY,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 gX(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(vY(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 _X(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(vY(e)||bY(e))&&e.anchor;a&&PY(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 vX(e,t,n,r){if(_Y(e))return e.toString(t,n,r);if(mY(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=xY(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=gX(t.doc.schema.tags,a);let o=_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):vY(a)?mX(a,t,n,r):a.toString(t,n,r);return o?vY(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function yX({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=xY(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(bY(e)||!xY(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||bY(e)||(vY(e)?e.type===WY.BLOCK_FOLDED||e.type===WY.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=vX(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+=$Y(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=$Y(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=$Y(g,n.indent,l(f))));let _,v,y;xY(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&&vY(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&yY(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=vX(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||||
`:``,v){let e=l(v);S+=`\n${QY(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=RQ(r,!0);o!==`folded`&&t!==CQ.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=IQ(`${v}${e}${p}`,l,PQ,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function KQ(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 UQ(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||||
`)?UQ(a,t):GQ(e,t,n,r);if(!s&&!u&&i!==CQ.PLAIN&&a.includes(`
|
||||
`))return GQ(e,t,n,r);if(zQ(a)){if(c===``)return t.forceBlockIndent=!0,GQ(e,t,n,r);if(s&&c===l)return UQ(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 UQ(a,t)}return s?d:IQ(d,c,NQ,RQ(t,!1))}function qQ(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!==CQ.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=CQ.QUOTE_DOUBLE);let c=e=>{switch(e){case CQ.BLOCK_FOLDED:case CQ.BLOCK_LITERAL:return i||a?UQ(o.value,t):GQ(o,t,n,r);case CQ.QUOTE_DOUBLE:return VQ(o.value,t);case CQ.QUOTE_SINGLE:return HQ(o.value,t);case CQ.PLAIN:return KQ(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 JQ(e,t){let n=Object.assign({blockQuote:!0,commentString:AQ,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 YQ(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(ZZ(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 XQ(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(ZZ(e)||$Z(e))&&e.anchor;a&&pQ(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 ZQ(e,t,n,r){if(XZ(e))return e.toString(t,n,r);if(qZ(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=eQ(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=YQ(t.doc.schema.tags,a);let o=XQ(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):ZZ(a)?qQ(a,t,n,r):a.toString(t,n,r);return o?ZZ(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function QQ({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=eQ(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if($Z(e)||!eQ(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||$Z(e)||(ZZ(e)?e.type===CQ.BLOCK_FOLDED||e.type===CQ.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=ZQ(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+=MQ(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=MQ(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=MQ(g,n.indent,l(f))));let _,v,y;eQ(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&&ZZ(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&QZ(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=ZQ(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||||
`:``,v){let e=l(v);S+=`\n${jQ(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
||||
`&&y&&(S=`
|
||||
|
||||
`):S+=`\n${n.indent}`}else if(!p&&bY(t)){let e=x[0],r=x.indexOf(`
|
||||
`):S+=`\n${n.indent}`}else if(!p&&$Z(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+=$Y(g,n.indent,l(y)):h&&i&&i(),g}function bX(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var xX=`<<`,SX={identify:e=>e===xX||typeof e==`symbol`&&e.description===xX,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new WY(Symbol(xX)),{addToJSMap:wX}),stringify:()=>xX},CX=(e,t)=>(SX.identify(t)||vY(t)&&(!t.type||t.type===WY.PLAIN)&&SX.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===SX.tag&&e.default);function wX(e,t,n){let r=EX(e,n);if(yY(r))for(let n of r.items)TX(e,t,n);else if(Array.isArray(r))for(let n of r)TX(e,t,n);else TX(e,t,r)}function TX(e,t,n){let r=EX(e,n);if(!gY(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 EX(e,t){return e&&mY(t)?t.resolve(e.doc,e):t}function DX(e,t,{key:n,value:r}){if(xY(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(CX(e,n))wX(e,t,r);else{let i=zY(n,``,e);if(t instanceof Map)t.set(i,zY(r,i,e));else if(t instanceof Set)t.add(i);else{let a=OX(n,i,e),o=zY(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function OX(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(xY(e)&&n?.doc){let t=hX(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)+`..."`),bX(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 kX(e,t,n){return new AX(qY(e,void 0,n),qY(t,void 0,n))}var AX=class e{constructor(e,t=null){Object.defineProperty(this,pY,{value:uY}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return xY(n)&&(n=n.clone(t)),xY(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return DX(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?yX(this,e,t,n):JSON.stringify(this)}};function jX(e,t,n){return(t.inFlow??e.flow?NX:MX)(e,t,n)}function MX({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(xY(i))!d&&i.spaceBefore&&f.push(``),PX(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(_Y(i)){let e=xY(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),PX(n,f,e.commentBefore,d))}d=!1;let s=vX(i,u,()=>o=null,()=>d=!0);o&&(s+=$Y(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+=MQ(g,n.indent,l(y)):h&&i&&i(),g}function $Q(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var e$=`<<`,t$={identify:e=>e===e$||typeof e==`symbol`&&e.description===e$,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new CQ(Symbol(e$)),{addToJSMap:r$}),stringify:()=>e$},n$=(e,t)=>(t$.identify(t)||ZZ(t)&&(!t.type||t.type===CQ.PLAIN)&&t$.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===t$.tag&&e.default);function r$(e,t,n){let r=a$(e,n);if(QZ(r))for(let n of r.items)i$(e,t,n);else if(Array.isArray(r))for(let n of r)i$(e,t,n);else i$(e,t,r)}function i$(e,t,n){let r=a$(e,n);if(!YZ(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 a$(e,t){return e&&qZ(t)?t.resolve(e.doc,e):t}function o$(e,t,{key:n,value:r}){if(eQ(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(n$(e,n))r$(e,t,r);else{let i=vQ(n,``,e);if(t instanceof Map)t.set(i,vQ(r,i,e));else if(t instanceof Set)t.add(i);else{let a=s$(n,i,e),o=vQ(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function s$(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(eQ(e)&&n?.doc){let t=JQ(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)+`..."`),$Q(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 c$(e,t,n){return new l$(EQ(e,void 0,n),EQ(t,void 0,n))}var l$=class e{constructor(e,t=null){Object.defineProperty(this,KZ,{value:UZ}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return eQ(n)&&(n=n.clone(t)),eQ(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return o$(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?QQ(this,e,t,n):JSON.stringify(this)}};function u$(e,t,n){return(t.inFlow??e.flow?f$:d$)(e,t,n)}function d$({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(eQ(i))!d&&i.spaceBefore&&f.push(``),p$(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(XZ(i)){let e=eQ(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),p$(n,f,e.commentBefore,d))}d=!1;let s=ZQ(i,u,()=>o=null,()=>d=!0);o&&(s+=MQ(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+=`
|
||||
`+QY(l(e),c),s&&s()):d&&o&&o(),p}function NX({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(xY(i))i.spaceBefore&&d.push(``),PX(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(_Y(i)){let e=xY(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),PX(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=xY(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=vX(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+=$Y(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 PX({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=QY(t(r),e);n.push(i.trimStart())}}function FX(e,t){let n=vY(t)?t.value:t;for(let r of e)if(_Y(r)&&(r.key===t||r.key===n||vY(r.key)&&r.key.value===n))return r}var IX=class extends XY{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(lY,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(kX(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=_Y(e)?e:!e||typeof e!=`object`||!(`key`in e)?new AX(e,e?.value):new AX(e.key,e.value);let r=FX(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);vY(r.value)&&UY(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=FX(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=FX(this.items,e)?.value;return(!t&&vY(n)?n.value:n)??void 0}has(e){return!!FX(this.items,e)}set(e,t){this.add(new AX(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)DX(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!_Y(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})),jX(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},LX={collection:`map`,default:!0,nodeClass:IX,tag:`tag:yaml.org,2002:map`,resolve(e,t){return gY(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>IX.from(e,t,n)},RX=class extends XY{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(fY,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=zX(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=zX(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&vY(r)?r.value:r}has(e){let t=zX(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=zX(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];vY(r)&&UY(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(zY(e,String(r++),t));return n}toString(e,t,n){return e?jX(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(qY(a,void 0,n))}}return i}};function zX(e){let t=vY(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var BX={collection:`seq`,default:!0,nodeClass:RX,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return yY(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>RX.from(e,t,n)},VX={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),mX(e,t,n,r)}},HX={identify:e=>e==null,createNode:()=>new WY(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new WY(null),stringify:({source:e},t)=>typeof e==`string`&&HX.test.test(e)?e:t.options.nullStr},UX={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new WY(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&UX.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function WX({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 GX={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:WX},KX={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 mX({comment:e,type:t,value:s},r,i,a)}};function oZ(e,t){if(yY(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!_Y(r)){if(gY(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new AX(new WY(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]=_Y(r)?r:new AX(r)}}else t(`Expected a sequence for this tag`);return e}function sZ(e,t,n){let{replacer:r}=n,i=new RX(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(kX(o,s,n))}return i}var cZ={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:oZ,createNode:sZ},lZ=class e extends RX{constructor(){super(),this.add=IX.prototype.add.bind(this),this.delete=IX.prototype.delete.bind(this),this.get=IX.prototype.get.bind(this),this.has=IX.prototype.has.bind(this),this.set=IX.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(_Y(e)?(r=zY(e.key,``,t),i=zY(e.value,r,t)):r=zY(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=sZ(e,t,n),i=new this;return i.items=r.items,i}};lZ.tag=`tag:yaml.org,2002:omap`;var uZ={collection:`seq`,identify:e=>e instanceof Map,nodeClass:lZ,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=oZ(e,t),r=[];for(let{key:e}of n.items)vY(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new lZ,n)},createNode:(e,t,n)=>lZ.from(e,t,n)};function dZ({value:e,source:t},n){return t&&(e?fZ:pZ).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var fZ={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 WY(!0),stringify:dZ},pZ={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 WY(!1),stringify:dZ},mZ={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:WX},hZ={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():WX(e)}},gZ={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 WY(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:WX},_Z=e=>typeof e==`bigint`||Number.isInteger(e);function vZ(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function yZ(e,t,n){let{value:r}=e;if(_Z(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return WX(e)}var bZ={identify:_Z,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>vZ(e,2,2,n),stringify:e=>yZ(e,2,`0b`)},xZ={identify:_Z,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>vZ(e,1,8,n),stringify:e=>yZ(e,8,`0`)},SZ={identify:_Z,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>vZ(e,0,10,n),stringify:WX},CZ={identify:_Z,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>vZ(e,2,16,n),stringify:e=>yZ(e,16,`0x`)},wZ=class e extends IX{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=_Y(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new AX(e.key,null):new AX(e,null),FX(this.items,t.key)||this.items.push(t)}get(e,t){let n=FX(this.items,e);return!t&&_Y(n)?vY(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=FX(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new AX(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(QY(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(QY(a(t),``)))}return n.join(`
|
||||
`+jQ(l(e),c),s&&s()):d&&o&&o(),p}function f$({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(eQ(i))i.spaceBefore&&d.push(``),p$(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(XZ(i)){let e=eQ(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),p$(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=eQ(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=ZQ(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+=MQ(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 p$({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=jQ(t(r),e);n.push(i.trimStart())}}function m$(e,t){let n=ZZ(t)?t.value:t;for(let r of e)if(XZ(r)&&(r.key===t||r.key===n||ZZ(r.key)&&r.key.value===n))return r}var h$=class extends kQ{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(HZ,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(c$(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=XZ(e)?e:!e||typeof e!=`object`||!(`key`in e)?new l$(e,e?.value):new l$(e.key,e.value);let r=m$(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);ZZ(r.value)&&SQ(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=m$(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=m$(this.items,e)?.value;return(!t&&ZZ(n)?n.value:n)??void 0}has(e){return!!m$(this.items,e)}set(e,t){this.add(new l$(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)o$(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!XZ(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})),u$(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},g$={collection:`map`,default:!0,nodeClass:h$,tag:`tag:yaml.org,2002:map`,resolve(e,t){return YZ(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>h$.from(e,t,n)},_$=class extends kQ{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(GZ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=v$(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=v$(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&ZZ(r)?r.value:r}has(e){let t=v$(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=v$(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];ZZ(r)&&SQ(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(vQ(e,String(r++),t));return n}toString(e,t,n){return e?u$(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(EQ(a,void 0,n))}}return i}};function v$(e){let t=ZZ(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var y$={collection:`seq`,default:!0,nodeClass:_$,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return QZ(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>_$.from(e,t,n)},b$={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),qQ(e,t,n,r)}},x$={identify:e=>e==null,createNode:()=>new CQ(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new CQ(null),stringify:({source:e},t)=>typeof e==`string`&&x$.test.test(e)?e:t.options.nullStr},S$={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new CQ(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&S$.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function C$({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 w$={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:C$},T$={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 qQ({comment:e,type:t,value:s},r,i,a)}};function z$(e,t){if(QZ(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!XZ(r)){if(YZ(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new l$(new CQ(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]=XZ(r)?r:new l$(r)}}else t(`Expected a sequence for this tag`);return e}function B$(e,t,n){let{replacer:r}=n,i=new _$(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(c$(o,s,n))}return i}var V$={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:z$,createNode:B$},H$=class e extends _${constructor(){super(),this.add=h$.prototype.add.bind(this),this.delete=h$.prototype.delete.bind(this),this.get=h$.prototype.get.bind(this),this.has=h$.prototype.has.bind(this),this.set=h$.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(XZ(e)?(r=vQ(e.key,``,t),i=vQ(e.value,r,t)):r=vQ(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=B$(e,t,n),i=new this;return i.items=r.items,i}};H$.tag=`tag:yaml.org,2002:omap`;var U$={collection:`seq`,identify:e=>e instanceof Map,nodeClass:H$,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=z$(e,t),r=[];for(let{key:e}of n.items)ZZ(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new H$,n)},createNode:(e,t,n)=>H$.from(e,t,n)};function W$({value:e,source:t},n){return t&&(e?G$:K$).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var G$={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 CQ(!0),stringify:W$},K$={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 CQ(!1),stringify:W$},q$={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:C$},J$={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():C$(e)}},Y$={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 CQ(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:C$},X$=e=>typeof e==`bigint`||Number.isInteger(e);function Z$(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function Q$(e,t,n){let{value:r}=e;if(X$(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return C$(e)}var $$={identify:X$,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Z$(e,2,2,n),stringify:e=>Q$(e,2,`0b`)},e1={identify:X$,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Z$(e,1,8,n),stringify:e=>Q$(e,8,`0`)},t1={identify:X$,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Z$(e,0,10,n),stringify:C$},n1={identify:X$,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Z$(e,2,16,n),stringify:e=>Q$(e,16,`0x`)},r1=class e extends h${constructor(t){super(t),this.tag=e.tag}add(e){let t;t=XZ(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new l$(e.key,null):new l$(e,null),m$(this.items,t.key)||this.items.push(t)}get(e,t){let n=m$(this.items,e);return!t&&XZ(n)?ZZ(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=m$(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new l$(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(jQ(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(jQ(a(t),``)))}return n.join(`
|
||||
`)+`
|
||||
`}var zZ=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,pY,{value:cY});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 NY({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[pY]:{value:cY}});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=xY(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){BZ(this.contents)&&this.contents.add(e)}addIn(e,t){BZ(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=FY(this);e.anchor=!t||n.has(t)?IY(t||`a`,n):t}return new VY(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}=LY(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=qY(e,l,p);return o&&bY(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new AX(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return BZ(this.contents)?this.contents.delete(e):!1}deleteIn(e){return YY(e)?this.contents!=null&&(this.contents=null,!0):BZ(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return bY(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return YY(e)?!t&&vY(this.contents)?this.contents.value:this.contents:bY(this.contents)?this.contents.getIn(e,t):void 0}has(e){return bY(this.contents)?this.contents.has(e):!1}hasIn(e){return YY(e)?this.contents!==void 0:bY(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=JY(this.schema,[e],t):BZ(this.contents)&&this.contents.set(e,t)}setIn(e,t){YY(e)?this.contents=t:this.contents==null?this.contents=JY(this.schema,Array.from(e),t):BZ(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 NY({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 NY({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 LZ(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=zY(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`?RY(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 RZ(this,e)}};function BZ(e){if(bY(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var VZ=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},HZ=class extends VZ{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},UZ=class extends VZ{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},WZ=(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 GZ(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function KZ(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(KZ(t.key)||KZ(t.value))return!0}return!1;default:return!0}}function qZ(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&KZ(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function JZ(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||vY(e)&&vY(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var YZ=`All mapping items must start at the same column`;function XZ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??IX)(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=GZ(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`,YZ)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||KZ(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`,YZ);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&qZ(r.indent,u,i),n.atKey=!1,JZ(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=GZ(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&&qZ(r.indent,f,i),s=c.range[2];let l=new AX(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 AX(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 ZZ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??RX)(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=GZ(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&&qZ(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function QZ(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 $Z=`Block collections are not allowed within flow collections`,eQ=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function tQ({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?IX:RX))(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=GZ(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&&KZ(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];_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],eQ(m)&&i(r.range,`BLOCK_IN_FLOW`,$Z)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);eQ(f)&&i(g.range,`BLOCK_IN_FLOW`,$Z),n.atKey=!1;let _=GZ(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?eQ(m)&&i(v.range,`BLOCK_IN_FLOW`,$Z):_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let y=new AX(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;JZ(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new IX(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=QZ(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 nQ(e,t,n,r,i,a){let o=n.type===`block-map`?XZ(e,t,n,r,a):n.type===`block-seq`?ZZ(e,t,n,r,a):tQ(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function rQ(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===IX.tagName&&s===`map`||o===RX.tagName&&s===`seq`)return nQ(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),nQ(e,t,n,i,o)}let l=nQ(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=xY(u)?u:new WY(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function iQ(e,t,n){let r=t.offset,i=aQ(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?WY.BLOCK_FOLDED:WY.BLOCK_LITERAL,o=t.source?oQ(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 v1=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,KZ,{value:VZ});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 fQ({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[KZ]:{value:VZ}});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=eQ(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){y1(this.contents)&&this.contents.add(e)}addIn(e,t){y1(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=mQ(this);e.anchor=!t||n.has(t)?hQ(t||`a`,n):t}return new bQ(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}=gQ(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=EQ(e,l,p);return o&&$Z(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new l$(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return y1(this.contents)?this.contents.delete(e):!1}deleteIn(e){return OQ(e)?this.contents!=null&&(this.contents=null,!0):y1(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return $Z(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return OQ(e)?!t&&ZZ(this.contents)?this.contents.value:this.contents:$Z(this.contents)?this.contents.getIn(e,t):void 0}has(e){return $Z(this.contents)?this.contents.has(e):!1}hasIn(e){return OQ(e)?this.contents!==void 0:$Z(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=DQ(this.schema,[e],t):y1(this.contents)&&this.contents.set(e,t)}setIn(e,t){OQ(e)?this.contents=t:this.contents==null?this.contents=DQ(this.schema,Array.from(e),t):y1(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 fQ({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 fQ({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 g1(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=vQ(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`?_Q(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 _1(this,e)}};function y1(e){if($Z(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var b1=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},x1=class extends b1{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},S1=class extends b1{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},C1=(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 w1(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 T1(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(T1(t.key)||T1(t.value))return!0}return!1;default:return!0}}function E1(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&T1(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function D1(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||ZZ(e)&&ZZ(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var O1=`All mapping items must start at the same column`;function k1({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??h$)(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=w1(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`,O1)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||T1(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`,O1);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&E1(r.indent,u,i),n.atKey=!1,D1(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=w1(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&&E1(r.indent,f,i),s=c.range[2];let l=new l$(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 l$(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 A1({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??_$)(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=w1(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&&E1(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function j1(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 M1=`Block collections are not allowed within flow collections`,N1=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function P1({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?h$:_$))(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=w1(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&&T1(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];XZ(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],N1(m)&&i(r.range,`BLOCK_IN_FLOW`,M1)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);N1(f)&&i(g.range,`BLOCK_IN_FLOW`,M1),n.atKey=!1;let _=w1(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?N1(m)&&i(v.range,`BLOCK_IN_FLOW`,M1):_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let y=new l$(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;D1(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new h$(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=j1(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 F1(e,t,n,r,i,a){let o=n.type===`block-map`?k1(e,t,n,r,a):n.type===`block-seq`?A1(e,t,n,r,a):P1(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function I1(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===h$.tagName&&s===`map`||o===_$.tagName&&s===`seq`)return F1(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),F1(e,t,n,i,o)}let l=F1(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=eQ(u)?u:new CQ(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function L1(e,t,n){let r=t.offset,i=R1(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?CQ.BLOCK_FOLDED:CQ.BLOCK_LITERAL,o=t.source?z1(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===WY.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===CQ.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 aQ({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 oQ(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 sQ(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=WY.PLAIN,c=cQ(a,l);break;case`single-quoted-scalar`:s=WY.QUOTE_SINGLE,c=lQ(a,l);break;case`double-quoted-scalar`:s=WY.QUOTE_DOUBLE,c=dQ(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=QZ(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function cQ(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}`),uQ(e)}function lQ(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),uQ(e.slice(1,-1)).replace(/''/g,`'`)}function uQ(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
||||
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function R1({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 z1(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 B1(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=CQ.PLAIN,c=V1(a,l);break;case`single-quoted-scalar`:s=CQ.QUOTE_SINGLE,c=H1(a,l);break;case`double-quoted-scalar`:s=CQ.QUOTE_DOUBLE,c=W1(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=j1(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function V1(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}`),U1(e)}function H1(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),U1(e.slice(1,-1)).replace(/''/g,`'`)}function U1(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
||||
`?a+=o:o=`
|
||||
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function dQ(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 W1(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}=fQ(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=pQ[i];if(a)n+=a;else if(i===`
|
||||
`){let{fold:t,offset:i}=G1(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=K1[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+=mQ(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+=q1(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 fQ(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 G1(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 pQ={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function mQ(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 hQ(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?iQ(e,t,r):sQ(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[dY]:c?gQ(e.schema,i,c,n,r):t.type===`scalar`?_Q(e,i,t,r):e.schema[dY];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=vY(a)?a:new WY(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new WY(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 gQ(e,t,n,r,i){if(n===`!`)return e[dY];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[dY])}function _Q({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[dY];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[dY];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 vQ(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 yQ={composeNode:bQ,composeEmptyNode:xQ};function bQ(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=SQ(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=hQ(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=rQ(yQ,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??=xQ(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&&(!vY(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 xQ(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=hQ(e,{type:`scalar`,offset:vQ(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 SQ({options:e},{offset:t,source:n,end:r},i){let a=new VY(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=QZ(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function CQ(e,t,{offset:n,start:r,value:i,end:a},o){let s=new zZ(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=GZ(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?bQ(c,i,l,o):xQ(c,l.end,r,null,l,o);let u=s.contents.range[2],d=QZ(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function wQ(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 TQ(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 K1={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function q1(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 J1(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?L1(e,t,r):B1(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[WZ]:c?Y1(e.schema,i,c,n,r):t.type===`scalar`?X1(e,i,t,r):e.schema[WZ];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=ZZ(a)?a:new CQ(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new CQ(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 Y1(e,t,n,r,i){if(n===`!`)return e[WZ];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[WZ])}function X1({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[WZ];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[WZ];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 Z1(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 Q1={composeNode:$1,composeEmptyNode:e0};function $1(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=t0(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=J1(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=I1(Q1,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??=e0(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&&(!ZZ(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 e0(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=J1(e,{type:`scalar`,offset:Z1(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 t0({options:e},{offset:t,source:n,end:r},i){let a=new bQ(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=j1(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function n0(e,t,{offset:n,start:r,value:i,end:a},o){let s=new v1(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=w1(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?$1(c,i,l,o):e0(c,l.end,r,null,l,o);let u=s.contents.range[2],d=j1(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function r0(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 i0(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 EQ=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=wQ(e);r?this.warnings.push(new UZ(i,t,n)):this.errors.push(new HZ(i,t,n))},this.directives=new NY({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=TQ(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(bY(i)&&!i.flow&&i.items.length>0){let e=i.items[0];_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:TQ(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=wQ(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=CQ(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 HZ(wQ(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 HZ(wQ(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=QZ(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 HZ(wQ(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 zZ(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}}},DQ=Symbol(`break visit`),OQ=Symbol(`skip children`),kQ=Symbol(`remove item`);function AQ(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),jQ(Object.freeze([]),e,t)}AQ.BREAK=DQ,AQ.SKIP=OQ,AQ.REMOVE=kQ,AQ.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},AQ.parentCollection=(e,t)=>{let n=AQ.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 jQ(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=jQ(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===DQ)return DQ;else r===kQ&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function MQ(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 a0=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=r0(e);r?this.warnings.push(new S1(i,t,n)):this.errors.push(new x1(i,t,n))},this.directives=new fQ({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=i0(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($Z(i)&&!i.flow&&i.items.length>0){let e=i.items[0];XZ(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:i0(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=r0(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=n0(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 x1(r0(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 x1(r0(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=j1(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 x1(r0(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 v1(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}}},o0=Symbol(`break visit`),s0=Symbol(`skip children`),c0=Symbol(`remove item`);function l0(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),u0(Object.freeze([]),e,t)}l0.BREAK=o0,l0.SKIP=s0,l0.REMOVE=c0,l0.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},l0.parentCollection=(e,t)=>{let n=l0.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 u0(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=u0(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===o0)return o0;else r===c0&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function d0(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 NQ(e){switch(e){case void 0:case` `:case`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var PQ=new Set(`0123456789ABCDEFabcdef`),FQ=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),IQ=new Set(`,[]{}`),LQ=new Set(` ,[]{}
|
||||
\r `),RQ=e=>!e||LQ.has(e),zQ=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 f0(e){switch(e){case void 0:case` `:case`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var p0=new Set(`0123456789ABCDEFabcdef`),m0=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),h0=new Set(`,[]{}`),g0=new Set(` ,[]{}
|
||||
\r `),_0=e=>!e||g0.has(e),v0=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===`...`)&&NQ(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===`...`)&&NQ(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&&!NQ(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===`:`)&&NQ(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(RQ),`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(`...`))&&NQ(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(RQ),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||NQ(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===`...`)&&f0(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===`...`)&&f0(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&&!f0(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===`:`)&&f0(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(_0),`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(`...`))&&f0(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(_0),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||f0(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=>NQ(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=>f0(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(NQ(r)||e&&IQ.has(r))break;t=n}else if(NQ(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(f0(r)||e&&h0.has(r))break;t=n}else if(f0(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
||||
`?(n+=1,r=`
|
||||
`,i=this.buffer[n+1]):t=n),i===`#`||e&&IQ.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&IQ.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(RQ),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(NQ(n)||t&&IQ.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(;!NQ(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(FQ.has(t))t=this.buffer[++e];else if(t===`%`&&PQ.has(this.buffer[e+1])&&PQ.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&&h0.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&h0.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(_0),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(f0(n)||t&&h0.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(;!f0(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(m0.has(t))t=this.buffer[++e];else if(t===`%`&&p0.has(this.buffer[e+1])&&p0.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)}},BQ=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 VQ(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function HQ(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 UQ(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 WQ(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 GQ(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 KQ(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 qQ(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!VQ(t.start,`explicit-key-ind`)&&!VQ(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,UQ(t.value)?t.value.end?KQ(t.value.end,t.sep):t.value.end=t.sep:KQ(t.start,t.sep),delete t.sep)}var JQ=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 zQ,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=MQ(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`&&qQ(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&&HQ(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)}},y0=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 b0(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function x0(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 S0(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 C0(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 w0(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 T0(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 E0(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!b0(t.start,`explicit-key-ind`)&&!b0(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,S0(t.value)?t.value.end?T0(t.value.end,t.sep):t.value.end=t.sep:T0(t.start,t.sep),delete t.sep)}var D0=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 v0,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=d0(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`&&E0(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&&x0(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)){KQ(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(VQ(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=GQ(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(VQ(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(UQ(t.key)&&!VQ(t.sep,`newline`)){let e=GQ(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]}):VQ(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&&!VQ(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)){KQ(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||VQ(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)){T0(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(b0(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=w0(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(b0(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(S0(t.key)&&!b0(t.sep,`newline`)){let e=w0(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]}):b0(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&&!b0(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)){T0(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||b0(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=GQ(WQ(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=GQ(WQ(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 YQ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new BQ||null,prettyErrors:t}}function XQ(e,t={}){let{lineCounter:n,prettyErrors:r}=YQ(t),i=new JQ(n?.addNewLine),a=new EQ(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 HZ(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(WZ(e,n)),o.warnings.forEach(WZ(e,n))),o}function ZQ(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=XQ(e,n);if(!i)return null;if(i.warnings.forEach(e=>bX(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 QQ(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 hY(e)&&!r?e.toString(n):new zZ(e,r,n).toString(n)}var $Q=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e$=e=>$Q(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function t$(e){if($Q(e)){if($Q(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:e$(e.parallel)};if($Q(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:e$(e.switch.cases)}}}function n$(e){return e.slice(2).includes(`parallel`)}function r$(e,t){let n=XQ(e).getIn(t,!0);if(gY(n))return n.toJSON()}function i$(e,t,n){let r=XQ(e);return r.setIn(t,r.createNode(g$(n))),r.toString()}function a$(e,t,n){let r=XQ(e),i=t.slice(0,-1),a=n$(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(yY(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!yY(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 o$(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 s$(e,t){let n=e.getIn(t,!0),r=t$(gY(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!gY(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function c$(e,t,n){let r=XQ(e),{kind:i,branches:a}=s$(r,t);if(o$(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function l$(e,t,n,r){let i=XQ(e),{kind:a,branches:o}=s$(i,t);if(o$(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>vY(e.key)&&e.key.value===n);if(!s||!vY(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function u$(e,t,n){let r=XQ(e),{kind:i,branches:a}=s$(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 j$(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(D$)].map(e=>e[1]))]}function M$(e){let t=XQ(e).toJS(),n=O$(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=O$(e)?e:{},p=t$(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=O$(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||E$(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\./,``)}`:k$(m,h),summary:A$(h),when:typeof d.when==`string`?d.when:void 0,retry:O$(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 j$([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=t$(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*C$,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=O$(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)*w$,y=(e,t,n)=>r.push({id:e,type:`lane`,position:{x:t-12,y:u*C$-40},style:{width:`264px`,height:`${(_+1)*C$-24}px`},zIndex:-1,data:{kind:`step`,key:n,title:n,type:``,detail:``,lane:i}}),b=(u+_)*C$;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)*C$,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*C$,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*C$-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 N$={class:`truncate`},P$=`\0`,F$=P({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)=>(L(),q(V(Vn),{"model-value":e.modelValue===``&&e.options.some(e=>e.value===``)?P$:e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e===P$?``:String(e))},{default:I(()=>[k(V(Rn),G({size:e.size??`sm`,class:t.$props.class},t.$attrs),{default:I(()=>[k(V(Hn),{placeholder:e.placeholder},null,8,[`placeholder`])]),_:1},16,[`size`,`class`]),k(V(zn),{position:`popper`,class:`max-w-[min(var(--reka-select-content-available-width),20rem)]`},{default:I(()=>[(L(!0),A(U,null,j(e.options,e=>(L(),q(V(In),{key:e.value,value:e.value===``?P$:e.value,disabled:e.disabled,title:e.label,class:`*:[span]:last:min-w-0`},{default:I(()=>[R(`span`,N$,B(e.label),1)]),_:2},1032,[`value`,`disabled`,`title`]))),128))]),_:1})]),_:1},8,[`model-value`,`disabled`]))}}),I$=P({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{},class:{},editable:{type:Boolean}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>e.editable?(L(),q(V($T),{key:0,"model-value":e.value,options:e.workflows.map(e=>e.id),"aria-label":e.label,class:z(t.$props.class),placeholder:`Workflow id or {{ reference }}`,"onUpdate:modelValue":r[0]||=e=>n(`pick`,e)},null,8,[`model-value`,`options`,`aria-label`,`class`])):(L(),q(V(Vn),{key:1,"model-value":e.value||void 0,"onUpdate:modelValue":r[1]||=e=>n(`pick`,String(e))},{default:I(()=>[k(V(Rn),{"aria-label":e.label,class:z(t.$props.class)},{default:I(()=>[k(V(Hn),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`,`class`]),k(V(zn),null,{default:I(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(L(),q(V(In),{key:0,value:e.value,disabled:``},{default:I(()=>[H(B(e.value)+` (unavailable)`,1)]),_:1},8,[
Line truncated
|
||||
`).map((e,t)=>({number:t+1,text:e,tokens:X$(e)}))}var J$=/^(\s*)(-\s+)?/,Y$=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function X$(e){let{code:t,comment:n}=Z$(e),r=Q$(t);return n&&r.push({text:n,kind:`comment`}),r}function Z$(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 Q$(e){if(!e)return[];let t=[],n=J$.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=Y$.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,...$$(i[4]??``)]):[...t,...$$(r)]}function $$(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 e1(e){return e.split(`
|
||||
`)[0]?.trim()||`invalid YAML`}function t1(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function n1(e){return typeof e==`string`&&e.trim()!==``}var r1={class:`space-y-4 px-3 py-3`},i1={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},a1={key:1,class:`space-y-3`},o1={key:0,class:`block space-y-1.5`},s1={class:`text-xs font-medium text-fg-muted`},c1={class:`flex items-center gap-2`},l1={key:1,role:`alert`,class:`text-xs text-danger`},u1={key:2,class:`space-y-1.5`},d1=[`title`],f1={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},p1={key:0,class:`divide-y divide-border rounded-md border border-border`},m1=[`title`],h1={key:0,class:`space-y-3`},g1={class:`text-label`},_1={key:0,class:`text-danger`},v1={class:`ml-2 text-xs text-fg-subtle`},y1={key:1,class:`space-y-3`},b1={class:`text-label`},x1={class:`ml-2 text-xs text-fg-subtle`},S1=[`title`],C1={key:0,class:`text-xs text-danger`},w1={class:`space-y-1.5`},T1={key:0,role:`alert`,class:`text-xs text-danger`},E1={class:`divide-y divide-border rounded-md border border-border`},D1={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},O1={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},k1={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},A1={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},j1=[`for`],M1=P({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=me(),r=e,i=t,a=Y(()=>r$(r.yaml,r.path)??{}),o=Y(()=>t$(a.value)),s=Y(()=>o.value?.kind??(typeof a.value.type==`string`?a.value.type:``)),c=Y(()=>o.value?.branches.map(([e])=>e)??[]),l=Y(()=>s.value===`parallel`?2:1);function u(e){i(`update:yaml`,i$(r.yaml,r.path,{...a.value,switch:{...a.value.switch,on:e}}))}let d=J(``),f=J(``);function p(e,t,n=``){try{let a=e===`add`?c$(r.yaml,r.path,t):e===`rename`?l$(r.yaml,r.path,t,n):u$(r.yaml,r.path,t);i(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=Y(()=>r.vocabulary.find(e=>e.name===s.value)),h=Y(()=>typeof a.value.settings==`object`&&a.value.settings!==null?a.value.settings:{}),g=Y(()=>h$(r.yaml,r.path)),_=Y(()=>U$(a.value)),v=Y(()=>m.value?.settings&&a.value.settings?G$(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=Y(()=>{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))}}),C=J(!S.value.lead&&!o.value),w=e=>[{value:``,label:`Default`},...e.map(e=>({value:e,label:e}))];function T(e){let{id:t,type:n,...a}=e;i(`update:yaml`,i$(r.yaml,r.path,{id:t,type:n,...a}))}function ee(e,t){T({...a.value,[e]:t})}function E(e){let t={...a.value.retry,...e};ee(`retry`,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function D(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,T({...a.value,settings:n})}function O(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&t!==h.value[e]&&(delete n.inputs,delete n.outputs),T({...a.value,settings:n})}let te=Y(()=>r.workflows.find(e=>e.id===h.value.workflow)),ne=Y(()=>Object.entries(_$(te.value?.yaml??``,`inputs`)??{})),re=Y(()=>Object.entries(_$(te.value?.yaml??``,`outputs`)??{})),ie=Y(()=>Object.entries(_$(r.yaml,`inputs`)??{})),ae=Y(()=>Object.entries(_$(r.yaml,`outputs`)??{})),oe=Y(()=>h.value.inputs??{}),se=Y(()=>h.value.outputs??{}),ce=e=>typeof e==`string`&&e.startsWith(`inputs.`),M=e=>[`object`,`array`].includes(e.type??``),le=e=>oe.value[e]===void 0?``:String(oe.value[e]);function N(e,t,n){D(`inputs`,{...oe.value,[e]:t===``?void 0:ce(t)?t:nE(t,n??`string`)})}let ue=(e,t,n)=>e.filter(([,e])=>e.type===t.type||e.type===`any`||t.type===`any`).map(([e])=>({value:`${n}.${e}`,label:e})),de=J(null);function fe(e){let t=de.value??S.value.lead?.key;if(!t)return;let n=typeof h.value[t]==`string`?h.value[t]:``,r=`{{ steps.${e}.summary }}`;D(t,n?`${n.trimEnd()} ${r}`:r)}let pe=J({});function P(e,t){try{D(e,t.trim()?ZQ(t):void 0),pe.value={...pe.value,[e]:``}}catch(t){pe.value={...pe.value,[e]:String(t.message).split(`
|
||||
`)[0]}}}let he=e=>e===void 0?``:QQ(e).trimEnd(),ge=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),_e=e=>typeof h.value[e]==`string`?h.value[e]:``,ve=[{value:``,label:`Park the task`},{value:`continue`,label:`Continue`}];return(t,r)=>(L(),A(`div`,r1,[v.value?(L(),A(`p`,i1,B(v.value),1)):F(``,!0),o.value?(L(),A(`section`,a1,[s.value===`switch`?(L(),A(`label`,o1,[r[15]||=R(`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),k(V($T),{"model-value":o.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,options:g.value.map(e=>`steps.${e}.result.`),onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[`model-value`,`options`])])):F(``,!0),R(`div`,s1,B(s.value===`switch`?`Cases`:`Branches`),1),(L(!0),A(U,null,j(c.value,e=>(L(),A(`div`,{key:e,class:`flex items-center gap-2`},[k(V(Q),{"model-value":e,class:z(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`]),k(V(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:c.value.length<=l.value,onClick:t=>p(`delete`,e)},{default:I(()=>[k(V(zl))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),R(`div`,c1,[k(V(Q),{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]||=nt(ct(e=>p(`add`,d.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),k(V(X),{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:I(()=>[k(V(wl))]),_:1},8,[`aria-label`,`disabled`])]),f.value?(L(),A(`p`,l1,B(f.value),1)):F(``,!0)])):F(``,!0),S.value.lead?(L(),A(`section`,u1,[R(`div`,{class:`flex items-center gap-1 text-xs font-medium text-fg-muted`,title:S.value.lead.schema.description},[H(B(ge(S.value.lead.key,S.value.lead.schema))+` `,1),S.value.lead.schema.description?(L(),q(V(Vc),{key:0,class:`size-3 text-fg-subtle`})):F(``,!0)],8,d1),S.value.lead.kind===`workflow`?(L(),q(I$,{key:0,editable:s.value!==`workflow.call`,value:_e(S.value.lead.key),workflows:e.workflows,label:ge(S.value.lead.key,S.value.lead.schema),onPick:r[4]||=e=>O(S.value.lead.key,e)},null,8,[`editable`,`value`,`workflows`,`label`])):S.value.lead.kind===`select`?(L(),q(F$,{key:1,class:`w-full`,"model-value":_e(S.value.lead.key),options:w(S.value.lead.options),"aria-label":ge(S.value.lead.key,S.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>D(S.value.lead.key,e||void 0)},null,8,[`model-value`,`options`,`aria-label`])):S.value.lead.kind===`text`?(L(),q(V(nr),{key:2,"model-value":_e(S.value.lead.key),class:`min-h-32 text-label leading-relaxed`,onFocus:r[6]||=e=>de.value=S.value.lead.key,"onUpdate:modelValue":r[7]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])):(L(),q(V(Q),{key:3,"model-value":_e(S.value.lead.key),onFocus:r[8]||=e=>de.value=S.value.lead.key,"onUpdate:modelValue":r[9]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])),g.value.length&&S.value.lead.kind!==`select`?(L(),A(`div`,f1,[r[16]||=R(`span`,{class:`text-caption text-fg-subtle`},`Insert`,-1),(L(!0),A(U,null,j(g.value,e=>(L(),q(V(X),{key:e,type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,title:`{{ steps.${e}.summary }}`,onClick:t=>fe(e)},{default:I(()=>[H(B(e),1)]),_:2},1032,[`title`,`onClick`]))),128))])):F(``,!0)])):F(``,!0),k(V(X),{type:`button`,variant:`ghost`,size:`xs`,class:`-ml-2 text-fg-muted aria-expanded:bg-transparent`,"aria-expanded":C.value,onClick:r[10]||=e=>C.value=!C.value},{default:I(()=>[k(V(er),{"data-icon":`inline-start`,class:z([`transition-transform`,!C.value&&`-rotate-90`])},null,8,[`class`]),r[17]||=H(`More `,-1)]),_:1},8,[`aria-expanded`]),C.value?(L(),A(U,{key:3},[S.value.compact.length?(L(),A(`section`,p1,[(L(!0),A(U,null,j(S.value.compact,t=>(L(),A(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[R(`span`,{class:`flex flex-1 items-center gap-1 text-label`,title:t.schema.description},[H(B(ge(t.key,t.schema))+` `,1),t.schema.description?(L(),q(V(Vc),{key:0,class:`size-3 text-fg-subtle`})):F(``,!0)],8,m1),t.kind===`workflow`?(L(),q(I$,{key:0,editable:s.value!==`workflow.call`,class:`max-w-48`,value:_e(t.key),workflows:e.workflows,label:ge(t.key,t.schema),onPick:e=>O(t.key,e)},null,8,[`editable`,`value`,`workflows`,`label`,`onPick`])):t.kind===`boolean`?(L(),q(V(ww),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>D(t.key,e||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):t.kind===`select`?(L(),q(F$,{key:2,class:`w-40`,"model-value":_e(t.key),options:w(t.options),"aria-label":ge(t.key,t.schema),"onUpdate:modelValue":e=>D(t.key,e||void 0)},null,8,[`Line truncated
|
||||
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>D(e.key,String(t).split(`
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(L(),A(U,{key:2},[k(V(nr),{"model-value":he(h.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>P(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),pe.value[e.key]?(L(),A(`span`,C1,B(pe.value[e.key]),1)):F(``,!0)],64))]))),128)),R(`section`,w1,[_.value?(L(),A(`p`,T1,B(_.value),1)):F(``,!0),R(`div`,E1,[R(`label`,D1,[r[20]||=R(`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),k(V(Q),{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=>ee(`when`,String(e))},null,8,[`aria-invalid`,`model-value`])]),R(`label`,O1,[r[21]||=R(`span`,{class:`flex-1 text-label`},`If it fails`,-1),k(F$,{class:`w-36`,"aria-label":`If it fails`,"model-value":a.value.on_failure??``,options:ve,"onUpdate:modelValue":r[12]||=e=>ee(`on_failure`,e||void 0)},null,8,[`model-value`])]),R(`label`,k1,[r[22]||=R(`span`,{class:`flex-1 text-label`},`Attempts`,-1),k(V(Q),{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=>E({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),R(`div`,A1,[R(`label`,{for:`${V(n)}-backoff`,class:`flex-1 text-label`},`Retry backoff`,8,j1),k(V(Vt),{id:`${V(n)}-backoff`,"model-value":a.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":r[14]||=e=>E({backoff:e||void 0})},null,8,[`id`,`model-value`])])])])],64)):F(``,!0)]))}}),N1={class:`space-y-1.5`},P1={class:`flex items-center text-xs font-medium text-fg-muted`},F1={key:0,class:`divide-y divide-border rounded-md border border-border`},I1=P({__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=Y(()=>Object.entries(_$(n.yaml,n.field)??{}));function o(e){r(`update:yaml`,v$(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)=>(L(),A(`section`,N1,[R(`div`,P1,[H(B(e.field===`inputs`?`Inputs`:`Outputs`)+` `,1),k(V(X),{type:`button`,variant:`ghost`,size:`xs`,class:`ml-auto`,onClick:c},{default:I(()=>[k(V(wl),{"data-icon":`inline-start`}),n[0]||=H(`Add`,-1)]),_:1})]),a.value.length?(L(),A(`div`,F1,[(L(!0),A(U,null,j(a.value,([t,n],r)=>(L(),A(`div`,{key:r,class:`flex items-center gap-2 px-2 py-1.5`},[k(V(Q),{"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`]),k(F$,{"model-value":n.type??`string`,options:V(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`]),k(V(ww),{"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`]),k(V(X),{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${t}`,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:I(()=>[k(V(zl))]),_:1},8,[`aria-label`,`onClick`])]))),128))])):F(``,!0)]))}}),L1={class:`space-y-4 px-3 py-3`},R1={class:`divide-y divide-border rounded-md border border-border`},z1={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},B1={key:0,role:`alert`,class:`px-3 py-2 text-xs text-danger`},V1={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},H1={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},U1={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`},G1={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},K1={class:`space-y-1.5`},q1=`6f129e29-0e26-5246-99bd-74cb4496203b`,J1=P({__name:`WorkflowSettings`,props:{yaml:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=_$(n.yaml,e);return typeof t==`string`?t:``};function a(e,t){r(`update:yaml`,v$(n.yaml,e,t))}let o=hT(),s=J([]),c=J(!0),l=J(``);async function u(){c.value=!0,l.value=``,s.value=[];try{await o.loadOrg();let e=await Z.orgAgents(o.homeOrg);s.value=e.agents.filter(e=>e.lifecycle===`active`),!i(`identity`)&&s.value.some(e=>e.id===q1)&&a(`identity`,q1)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}ke(u);let d=Y(()=>{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=Sn(),p=Y(()=>{let e=Object.keys(f.stateFor(`agent-profilesLine 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=w0(C0(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=w0(C0(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 O0(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new y0||null,prettyErrors:t}}function k0(e,t={}){let{lineCounter:n,prettyErrors:r}=O0(t),i=new D0(n?.addNewLine),a=new a0(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 x1(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(C1(e,n)),o.warnings.forEach(C1(e,n))),o}function A0(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=k0(e,n);if(!i)return null;if(i.warnings.forEach(e=>$Q(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 j0(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 JZ(e)&&!r?e.toString(n):new v1(e,r,n).toString(n)}var M0=e=>typeof e==`object`&&!!e&&!Array.isArray(e),N0=e=>M0(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function P0(e){if(M0(e)){if(M0(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:N0(e.parallel)};if(M0(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:N0(e.switch.cases)}}}function F0(e){return e.slice(2).includes(`parallel`)}function I0(e,t){let n=k0(e).getIn(t,!0);if(YZ(n))return n.toJSON()}function L0(e,t,n){let r=k0(e);return r.setIn(t,r.createNode(Y0(n))),r.toString()}function R0(e,t,n){let r=k0(e),i=t.slice(0,-1),a=F0(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(QZ(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!QZ(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 z0(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 B0(e,t){let n=e.getIn(t,!0),r=P0(YZ(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!YZ(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function V0(e,t,n){let r=k0(e),{kind:i,branches:a}=B0(r,t);if(z0(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function H0(e,t,n,r){let i=k0(e),{kind:a,branches:o}=B0(i,t);if(z0(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>ZZ(e.key)&&e.key.value===n);if(!s||!ZZ(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function U0(e,t,n){let r=k0(e),{kind:i,branches:a}=B0(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 u2(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(o2)].map(e=>e[1]))]}function d2(e){let t=k0(e).toJS(),n=s2(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=s2(e)?e:{},p=P0(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=s2(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||a2(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\./,``)}`:c2(m,h),summary:l2(h),when:typeof d.when==`string`?d.when:void 0,retry:s2(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 u2([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=P0(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*n2,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=s2(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)*r2,y=(e,t,n)=>r.push({id:e,type:`lane`,position:{x:t-12,y:u*n2-40},style:{width:`264px`,height:`${(_+1)*n2-24}px`},zIndex:-1,data:{kind:`step`,key:n,title:n,type:``,detail:``,lane:i}}),b=(u+_)*n2;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)*n2,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*n2,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*n2-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 f2={class:`truncate`},p2=`\0`,m2=P({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)=>(L(),q(V(Eu),{"model-value":e.modelValue===``&&e.options.some(e=>e.value===``)?p2:e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e===p2?``:String(e))},{default:I(()=>[A(V(Au),G({size:e.size??`sm`,class:t.$props.class},t.$attrs),{default:I(()=>[A(V(ju),{placeholder:e.placeholder},null,8,[`placeholder`])]),_:1},16,[`size`,`class`]),A(V(Du),{position:`popper`,class:`max-w-[min(var(--reka-select-content-available-width),20rem)]`},{default:I(()=>[(L(!0),j(U,null,M(e.options,e=>(L(),q(V(ku),{key:e.value,value:e.value===``?p2:e.value,disabled:e.disabled,title:e.label,class:`*:[span]:last:min-w-0`},{default:I(()=>[R(`span`,f2,B(e.label),1)]),_:2},1032,[`value`,`disabled`,`title`]))),128))]),_:1})]),_:1},8,[`model-value`,`disabled`]))}}),h2=P({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{},class:{},editable:{type:Boolean}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>e.editable?(L(),q(V($D),{key:0,"model-value":e.value,options:e.workflows.map(e=>e.id),"aria-label":e.label,class:z(t.$props.class),placeholder:`Workflow id or {{ reference }}`,"onUpdate:modelValue":r[0]||=e=>n(`pick`,e)},null,8,[`model-value`,`options`,`aria-label`,`class`])):(L(),q(V(Eu),{key:1,"model-value":e.value||void 0,"onUpdate:modelValue":r[1]||=e=>n(`pick`,String(e))},{default:I(()=>[A(V(Au),{"aria-label":e.label,class:z(t.$props.class)},{default:I(()=>[A(V(ju),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`,`class`]),A(V(Du),null,{default:I(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(L(),q(V(ku),{key:0,value:e.value,disabled:``},{default:I(()=>[H(B(e.value)+` (unavailable)`,1)]),_:1},8,[
Line truncated
|
||||
`).map((e,t)=>({number:t+1,text:e,tokens:k2(e)}))}var D2=/^(\s*)(-\s+)?/,O2=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function k2(e){let{code:t,comment:n}=A2(e),r=j2(t);return n&&r.push({text:n,kind:`comment`}),r}function A2(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 j2(e){if(!e)return[];let t=[],n=D2.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=O2.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,...M2(i[4]??``)]):[...t,...M2(r)]}function M2(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 N2(e){return e.split(`
|
||||
`)[0]?.trim()||`invalid YAML`}function P2(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function F2(e){return typeof e==`string`&&e.trim()!==``}var I2={class:`space-y-4 px-3 py-3`},L2={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},R2={key:1,class:`space-y-3`},z2={key:0,class:`block space-y-1.5`},B2={class:`text-xs font-medium text-fg-muted`},V2={class:`flex items-center gap-2`},H2={key:1,role:`alert`,class:`text-xs text-danger`},U2={key:2,class:`space-y-1.5`},W2=[`title`],G2={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},K2={key:0,class:`divide-y divide-border rounded-md border border-border`},q2=[`title`],J2={key:0,class:`space-y-3`},Y2={class:`text-label`},X2={key:0,class:`text-danger`},Z2={class:`ml-2 text-xs text-fg-subtle`},Q2={key:1,class:`space-y-3`},$2={class:`text-label`},e4={class:`ml-2 text-xs text-fg-subtle`},t4=[`title`],n4={key:0,class:`text-xs text-danger`},r4={class:`space-y-1.5`},i4={key:0,role:`alert`,class:`text-xs text-danger`},a4={class:`divide-y divide-border rounded-md border border-border`},o4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},s4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},c4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},l4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},u4=[`for`],d4=P({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=ye(),r=e,i=t,a=Y(()=>I0(r.yaml,r.path)??{}),o=Y(()=>P0(a.value)),s=Y(()=>o.value?.kind??(typeof a.value.type==`string`?a.value.type:``)),c=Y(()=>o.value?.branches.map(([e])=>e)??[]),l=Y(()=>s.value===`parallel`?2:1);function u(e){i(`update:yaml`,L0(r.yaml,r.path,{...a.value,switch:{...a.value.switch,on:e}}))}let d=J(``),f=J(``);function p(e,t,n=``){try{let a=e===`add`?V0(r.yaml,r.path,t):e===`rename`?H0(r.yaml,r.path,t,n):U0(r.yaml,r.path,t);i(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=Y(()=>r.vocabulary.find(e=>e.name===s.value)),h=Y(()=>typeof a.value.settings==`object`&&a.value.settings!==null?a.value.settings:{}),g=Y(()=>J0(r.yaml,r.path)),_=Y(()=>S2(a.value)),v=Y(()=>m.value?.settings&&a.value.settings?w2(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=Y(()=>{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=J(!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`,L0(r.yaml,r.path,{id:t,type:n,...a}))}function w(e,t){te({...a.value,[e]:t})}function T(e){let t={...a.value.retry,...e};w(`retry`,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function E(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 D(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 ne=Y(()=>r.workflows.find(e=>e.id===h.value.workflow)),re=Y(()=>Object.entries(X0(ne.value?.yaml??``,`inputs`)??{})),O=Y(()=>Object.entries(X0(ne.value?.yaml??``,`outputs`)??{})),k=Y(()=>Object.entries(X0(r.yaml,`inputs`)??{})),ie=Y(()=>Object.entries(X0(r.yaml,`outputs`)??{})),ae=Y(()=>h.value.inputs??{}),oe=Y(()=>h.value.outputs??{}),se=e=>typeof e==`string`&&e.startsWith(`inputs.`),ce=e=>[`object`,`array`].includes(e.type??``),le=e=>ae.value[e]===void 0?``:String(ae.value[e]);function ue(e,t,n){E(`inputs`,{...ae.value,[e]:t===``?void 0:se(t)?t:rO(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=J(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 }}`;E(t,n?`${n.trimEnd()} ${r}`:r)}let me=J({});function N(e,t){try{E(e,t.trim()?A0(t):void 0),me.value={...me.value,[e]:``}}catch(t){me.value={...me.value,[e]:String(t.message).split(`
|
||||
`)[0]}}}let he=e=>e===void 0?``:j0(e).trimEnd(),ge=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),_e=e=>typeof h.value[e]==`string`?h.value[e]:``,ve=[{value:``,label:`Park the task`},{value:`continue`,label:`Continue`}];return(t,r)=>(L(),j(`div`,I2,[v.value?(L(),j(`p`,L2,B(v.value),1)):F(``,!0),o.value?(L(),j(`section`,R2,[s.value===`switch`?(L(),j(`label`,z2,[r[15]||=R(`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),A(V($D),{"model-value":o.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,options:g.value.map(e=>`steps.${e}.result.`),onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[`model-value`,`options`])])):F(``,!0),R(`div`,B2,B(s.value===`switch`?`Cases`:`Branches`),1),(L(!0),j(U,null,M(c.value,e=>(L(),j(`div`,{key:e,class:`flex items-center gap-2`},[A(V(Q),{"model-value":e,class:z(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`]),A(V(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:c.value.length<=l.value,onClick:t=>p(`delete`,e)},{default:I(()=>[A(V(gu))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),R(`div`,V2,[A(V(Q),{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]||=lt(_t(e=>p(`add`,d.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),A(V(X),{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:I(()=>[A(V(tu))]),_:1},8,[`aria-label`,`disabled`])]),f.value?(L(),j(`p`,H2,B(f.value),1)):F(``,!0)])):F(``,!0),S.value.lead?(L(),j(`section`,U2,[R(`div`,{class:`flex items-center gap-1 text-xs font-medium text-fg-muted`,title:S.value.lead.schema.description},[H(B(ge(S.value.lead.key,S.value.lead.schema))+` `,1),S.value.lead.schema.description?(L(),q(V(_l),{key:0,class:`size-3 text-fg-subtle`})):F(``,!0)],8,W2),S.value.lead.kind===`workflow`?(L(),q(h2,{key:0,editable:s.value!==`workflow.call`,value:_e(S.value.lead.key),workflows:e.workflows,label:ge(S.value.lead.key,S.value.lead.schema),onPick:r[4]||=e=>D(S.value.lead.key,e)},null,8,[`editable`,`value`,`workflows`,`label`])):S.value.lead.kind===`select`?(L(),q(m2,{key:1,class:`w-full`,"model-value":_e(S.value.lead.key),options:C(S.value.lead.options),"aria-label":ge(S.value.lead.key,S.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>E(S.value.lead.key,e||void 0)},null,8,[`model-value`,`options`,`aria-label`])):S.value.lead.kind===`text`?(L(),q(V(md),{key:2,"model-value":_e(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=>E(S.value.lead.key,String(e))},null,8,[`model-value`])):(L(),q(V(Q),{key:3,"model-value":_e(S.value.lead.key),onFocus:r[8]||=e=>fe.value=S.value.lead.key,"onUpdate:modelValue":r[9]||=e=>E(S.value.lead.key,String(e))},null,8,[`model-value`])),g.value.length&&S.value.lead.kind!==`select`?(L(),j(`div`,G2,[r[16]||=R(`span`,{class:`text-caption text-fg-subtle`},`Insert`,-1),(L(!0),j(U,null,M(g.value,e=>(L(),q(V(X),{key:e,type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,title:`{{ steps.${e}.summary }}`,onClick:t=>pe(e)},{default:I(()=>[H(B(e),1)]),_:2},1032,[`title`,`onClick`]))),128))])):F(``,!0)])):F(``,!0),A(V(X),{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:I(()=>[A(V(ul),{"data-icon":`inline-start`,class:z([`transition-transform`,!ee.value&&`-rotate-90`])},null,8,[`class`]),r[17]||=H(`More `,-1)]),_:1},8,[`aria-expanded`]),ee.value?(L(),j(U,{key:3},[S.value.compact.length?(L(),j(`section`,K2,[(L(!0),j(U,null,M(S.value.compact,t=>(L(),j(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[R(`span`,{class:`flex flex-1 items-center gap-1 text-label`,title:t.schema.description},[H(B(ge(t.key,t.schema))+` `,1),t.schema.description?(L(),q(V(_l),{key:0,class:`size-3 text-fg-subtle`})):F(``,!0)],8,q2),t.kind===`workflow`?(L(),q(h2,{key:0,editable:s.value!==`workflow.call`,class:`max-w-48`,value:_e(t.key),workflows:e.workflows,label:ge(t.key,t.schema),onPick:e=>D(t.key,e)},null,8,[`editable`,`value`,`workflows`,`label`,`onPick`])):t.kind===`boolean`?(L(),q(V(WT),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>E(t.key,e||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):t.kind===`select`?(L(),q(m2,{key:2,class:`w-40`,"model-value":_e(t.key),options:C(t.options),"aria-label":ge(t.key,t.schema),"onUpdate:modelValue":e=>E(t.key,e||void 0)},null
Line truncated
|
||||
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>E(e.key,String(t).split(`
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(L(),j(U,{key:2},[A(V(md),{"model-value":he(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]?(L(),j(`span`,n4,B(me.value[e.key]),1)):F(``,!0)],64))]))),128)),R(`section`,r4,[_.value?(L(),j(`p`,i4,B(_.value),1)):F(``,!0),R(`div`,a4,[R(`label`,o4,[r[20]||=R(`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),A(V(Q),{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=>w(`when`,String(e))},null,8,[`aria-invalid`,`model-value`])]),R(`label`,s4,[r[21]||=R(`span`,{class:`flex-1 text-label`},`If it fails`,-1),A(m2,{class:`w-36`,"aria-label":`If it fails`,"model-value":a.value.on_failure??``,options:ve,"onUpdate:modelValue":r[12]||=e=>w(`on_failure`,e||void 0)},null,8,[`model-value`])]),R(`label`,c4,[r[22]||=R(`span`,{class:`flex-1 text-label`},`Attempts`,-1),A(V(Q),{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=>T({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),R(`div`,l4,[R(`label`,{for:`${V(n)}-backoff`,class:`flex-1 text-label`},`Retry backoff`,8,u4),A(V(jT),{id:`${V(n)}-backoff`,"model-value":a.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":r[14]||=e=>T({backoff:e||void 0})},null,8,[`id`,`model-value`])])])])],64)):F(``,!0)]))}}),f4={class:`space-y-1.5`},p4={class:`flex items-center text-xs font-medium text-fg-muted`},m4={key:0,class:`divide-y divide-border rounded-md border border-border`},h4=P({__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=Y(()=>Object.entries(X0(n.yaml,n.field)??{}));function o(e){r(`update:yaml`,Z0(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)=>(L(),j(`section`,f4,[R(`div`,p4,[H(B(e.field===`inputs`?`Inputs`:`Outputs`)+` `,1),A(V(X),{type:`button`,variant:`ghost`,size:`xs`,class:`ml-auto`,onClick:c},{default:I(()=>[A(V(tu),{"data-icon":`inline-start`}),n[0]||=H(`Add`,-1)]),_:1})]),a.value.length?(L(),j(`div`,m4,[(L(!0),j(U,null,M(a.value,([t,n],r)=>(L(),j(`div`,{key:r,class:`flex items-center gap-2 px-2 py-1.5`},[A(V(Q),{"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`]),A(m2,{"model-value":n.type??`string`,options:V(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`]),A(V(WT),{"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`]),A(V(X),{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${t}`,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:I(()=>[A(V(gu))]),_:1},8,[`aria-label`,`onClick`])]))),128))])):F(``,!0)]))}}),g4={class:`space-y-4 px-3 py-3`},_4={class:`divide-y divide-border rounded-md border border-border`},v4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},y4={key:0,role:`alert`,class:`px-3 py-2 text-xs text-danger`},b4={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},x4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},S4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},C4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},w4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},T4={class:`space-y-1.5`},E4=`6f129e29-0e26-5246-99bd-74cb4496203b`,D4=P({__name:`WorkflowSettings`,props:{yaml:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=X0(n.yaml,e);return typeof t==`string`?t:``};function a(e,t){r(`update:yaml`,Z0(n.yaml,e,t))}let o=yE(),s=J([]),c=J(!0),l=J(``);async function u(){c.value=!0,l.value=``,s.value=[];try{await o.loadOrg();let e=await Z.orgAgents(o.homeOrg);s.value=e.agents.filter(e=>e.lifecycle===`active`),!i(`identity`)&&s.value.some(e=>e.id===E4)&&a(`identity`,E4)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}Pe(u);let d=Y(()=>{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=DT(),p=Y(()=>{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 Yie(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=Xie(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 Xie(e,t){return t.includes(e)?`code`:`key`}function O5(e,t){let n=Y(()=>Pe(t?.target)??qie),r=qe(Pe(e)===!0),i=!1,a=new Set,o=c(Pe(e));N(()=>Pe(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),W2([`blur`,`contextmenu`],s),K2((...e)=>o(...e),e=>{let n=Pe(t?.actInsideInputWithModifier)??!0,a=Pe(t?.preventDefault)??!1;if(i=Jie(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}),K2((...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`?Yie(e,a):e}return r}var k5=`vue-flow__node-desc`,A5=`vue-flow__edge-desc`,Zie=`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 Qie(e){return H5(e.width)&&H5(e.height)&&H5(e.x)&&H5(e.y)}function $ie(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 eae(...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 tae(...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 nae(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 rae(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 iae({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=rae(t,J5({...r.computedPosition,...r.dimensions}))}return iae(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
|
||||
`).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 Ele(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=Dle(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 Dle(e,t){return t.includes(e)?`code`:`key`}function O5(e,t){let n=Y(()=>ze(t?.target)??wle),r=$e(ze(e)===!0),i=!1,a=new Set,o=c(ze(e));N(()=>ze(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),l6([`blur`,`contextmenu`],s),u6((...e)=>o(...e),e=>{let n=ze(t?.actInsideInputWithModifier)??!0,a=ze(t?.preventDefault)??!1;if(i=Tle(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}),u6((...e)=>o(...e),e=>{let n=ze(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=ze(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?Ele(e,a):e}return r}var k5=`vue-flow__node-desc`,A5=`vue-flow__edge-desc`,Ole=`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 kle(e){return H5(e.width)&&H5(e.height)&&H5(e.x)&&H5(e.y)}function Ale(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:Ie({width:0,height:0}),computedPosition:Ie({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:Ie(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:Ie(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 jle(...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 Mle(...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 Nle(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 Ple(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 Fle({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=Ple(t,J5({...r.computedPosition,...r.dimensions}))}return Fle(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`},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 mae(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 hae(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 gae=()=>!0;function D7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function _ae(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 vae=250;function yae(e,t,n,r){let i=[],a=1/0,o=_ae(e,n,t+vae);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=gae},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 bae(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function xae(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},Sae=[`production`,`prod`];function M7(e,...t){N7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function N7(){return!Sae.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 V(e)!==void 0}function Cae(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),!nae(i,t)&&i}function wae(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=$ie(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(`sourcLine truncated
|
||||
`)},B(e.data.summary||e.data.detail),9,fse)):F(``,!0),e.data.when||e.data.retry||e.data.continues?(L(),A(`div`,pse,[e.data.when?(L(),A(`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}`},[k(V(tl),{class:`size-3 shrink-0`,"aria-hidden":`true`}),R(`span`,hse,B(e.data.when),1)],8,mse)):F(``,!0),e.data.retry?(L(),A(`span`,{key:1,class:`flex items-center gap-0.5 rounded bg-secondary px-1`,title:`Up to ${e.data.retry} attempts`},[k(V(El),{class:`size-3`,"aria-hidden":`true`}),H(`×`+B(e.data.retry),1)],8,gse)):F(``,!0),e.data.continues?(L(),A(`span`,_se,[k(V(Fl),{class:`size-3`,"aria-hidden":`true`}),r[10]||=H(`continues`,-1)])):F(``,!0)])):F(``,!0),e.data.run?.error?(L(),A(`p`,{key:4,class:`mt-1 line-clamp-2 text-caption text-danger`,title:e.data.run.error},B(e.data.run.error),9,vse)):F(``,!0)],64))]),k($e,{"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:I(()=>[e.data.expanded?(L(),A(`div`,{key:0,class:`nodrag nopan nowheel cursor-auto border-t border-border`,onClick:r[6]||=ct(()=>{},[`stop`])},[K(t.$slots,`default`)])):F(``,!0)]),_:3}),k(V(t9),{type:`source`,position:V(b5).Bottom},null,8,[`position`]),k(V(t9),{id:`data-out`,type:`source`,position:V(b5).Right,class:`!opacity-0`},null,8,[`position`]),e.data.type===`switch`?(L(),q(V(t9),{key:1,id:`otherwise`,type:`source`,position:V(b5).Right,class:`!opacity-0`},null,8,[`position`])):F(``,!0)],2))}}),bse={class:`pointer-events-none size-full rounded-xl border border-dashed border-border bg-muted/30`},xse={class:`flex items-center gap-1 px-2.5 pt-1.5 text-caption text-fg-subtle`},Sse={key:0},Cse={key:1,class:`font-mono`},wse=P({__name:`LaneNode`,props:{data:{}},setup(e){return(t,n)=>(L(),A(`div`,bse,[R(`div`,xse,[e.data.lane===`switch`?(L(),A(U,{key:0},[k(V(Il),{class:`size-3`,"aria-hidden":`true`}),e.data.title==="default"?(L(),A(`span`,Sse,`otherwise`)):(L(),A(`span`,Cse,`= `+B(e.data.title),1))],64)):(L(),A(U,{key:1},[k(V(rl),{class:`size-3`,"aria-hidden":`true`}),H(B(e.data.title),1)],64))])]))}}),Tse={class:`flex shrink-0 items-center justify-center gap-1 border-t border-border bg-card p-1`},T9=240,Ese=416,E9=-140,Dse=72,Ose=.9,D9=P({__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=Y(()=>!!n.types?.length&&!n.readonly),a=Y(()=>[...n.types??[],`parallel`,`switch`]),o=Y(()=>a.value.filter(e=>[`agent.run`,`workflow.call`].includes(e))),s=e=>e&&n$(e)?o.value:a.value,c=e=>e.kind===`step`?JSON.stringify(e.path??null):e.kind,l=J(null),u=J(null),d=Jn(`(max-width: 767px)`),f=Y(()=>{let e=x$(M$(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=Y(()=>f.value.nodes.filter(e=>e.data.path?.length===2).length),m=J({}),h=J({}),g=Y(()=>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=Y(()=>{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=Qn(),b=Kn(v,{duration:Y(()=>y.value===`reduce`?0:200)}),x=Y(()=>{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-Dse))}return[...e]}),S=e=>x.value.reduce((t,[n,r])=>n<e?t+r:t,0);function C(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 w=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 T(e){let t=g.value;if(d.value||!t)return 0;if(e.id===t.id||w(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 ee=Y(()=>{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=C(t));let o=n.marks?.[t.id];o&&(t={...t,data:{...t.data,mark:o}});let c=t.position.x+T
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 Gle(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 Kle(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 qle=()=>!0;function D7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Jle(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 Yle=250;function Xle(e,t,n,r){let i=[],a=1/0,o=Jle(e,n,t+Yle);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=qle},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 Zle(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function Qle(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},$le=[`production`,`prod`];function M7(e,...t){N7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function N7(){return!$le.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]),Re(()=>{o.blur()})):n([e])}function I7(e){return V(e)!==void 0}function eue(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),!Nle(i,t)&&i}function tue(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=Ale(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(`sourcLine truncated
|
||||
`)},B(e.data.summary||e.data.detail),9,Ude)):F(``,!0),e.data.when||e.data.retry||e.data.continues?(L(),j(`div`,Wde,[e.data.when?(L(),j(`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}`},[A(V(Ml),{class:`size-3 shrink-0`,"aria-hidden":`true`}),R(`span`,Kde,B(e.data.when),1)],8,Gde)):F(``,!0),e.data.retry?(L(),j(`span`,{key:1,class:`flex items-center gap-0.5 rounded bg-secondary px-1`,title:`Up to ${e.data.retry} attempts`},[A(V(ru),{class:`size-3`,"aria-hidden":`true`}),H(`×`+B(e.data.retry),1)],8,qde)):F(``,!0),e.data.continues?(L(),j(`span`,Jde,[A(V(pu),{class:`size-3`,"aria-hidden":`true`}),r[10]||=H(`continues`,-1)])):F(``,!0)])):F(``,!0),e.data.run?.error?(L(),j(`p`,{key:4,class:`mt-1 line-clamp-2 text-caption text-danger`,title:e.data.run.error},B(e.data.run.error),9,Yde)):F(``,!0)],64))]),A(it,{"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:I(()=>[e.data.expanded?(L(),j(`div`,{key:0,class:`nodrag nopan nowheel cursor-auto border-t border-border`,onClick:r[6]||=_t(()=>{},[`stop`])},[K(t.$slots,`default`)])):F(``,!0)]),_:3}),A(V(t9),{type:`source`,position:V(b5).Bottom},null,8,[`position`]),A(V(t9),{id:`data-out`,type:`source`,position:V(b5).Right,class:`!opacity-0`},null,8,[`position`]),e.data.type===`switch`?(L(),q(V(t9),{key:1,id:`otherwise`,type:`source`,position:V(b5).Right,class:`!opacity-0`},null,8,[`position`])):F(``,!0)],2))}}),Zde={class:`pointer-events-none size-full rounded-xl border border-dashed border-border bg-muted/30`},Qde={class:`flex items-center gap-1 px-2.5 pt-1.5 text-caption text-fg-subtle`},$de={key:0},efe={key:1,class:`font-mono`},tfe=P({__name:`LaneNode`,props:{data:{}},setup(e){return(t,n)=>(L(),j(`div`,Zde,[R(`div`,Qde,[e.data.lane===`switch`?(L(),j(U,{key:0},[A(V(mu),{class:`size-3`,"aria-hidden":`true`}),e.data.title==="default"?(L(),j(`span`,$de,`otherwise`)):(L(),j(`span`,efe,`= `+B(e.data.title),1))],64)):(L(),j(U,{key:1},[A(V(Pl),{class:`size-3`,"aria-hidden":`true`}),H(B(e.data.title),1)],64))])]))}}),nfe={class:`flex shrink-0 items-center justify-center gap-1 border-t border-border bg-card p-1`},T9=240,rfe=416,E9=-140,ife=72,afe=.9,D9=P({__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=Y(()=>!!n.types?.length&&!n.readonly),a=Y(()=>[...n.types??[],`parallel`,`switch`]),o=Y(()=>a.value.filter(e=>[`agent.run`,`workflow.call`].includes(e))),s=e=>e&&F0(e)?o.value:a.value,c=e=>e.kind===`step`?JSON.stringify(e.path??null):e.kind,l=J(null),u=J(null),d=iee(`(max-width: 767px)`),f=Y(()=>{let e=e2(d2(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=Y(()=>f.value.nodes.filter(e=>e.data.path?.length===2).length),m=J({}),h=J({}),g=Y(()=>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=Y(()=>{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=lee(),b=nee(v,{duration:Y(()=>y.value===`reduce`?0:200)}),x=Y(()=>{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-ife))}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 w=Y(()=>{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.positio
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=XQ(e).toJS(),n=new Map;for(let r of M$(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 Nse={class:`flex flex-col gap-3 md:grid md:h-[calc(100dvh-17rem)] md:min-h-[26rem] md:grid-cols-[18rem_1fr]`},Pse=[`aria-current`,`onClick`],Fse={class:`flex items-center gap-2 text-sm`},Ise={class:`font-mono text-xs text-fg-subtle`},Lse=[`title`],Rse={key:0,class:`px-3 py-2 text-sm text-fg-muted`},zse={key:1,class:`flex min-h-0 flex-col gap-2`},Bse={class:`flex items-center gap-2 max-md:flex-wrap`},Vse={key:0,class:`rounded-lg border border-border p-4 text-sm text-fg-muted`},Hse={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border pt-2 pb-[calc(0.5rem+var(--code-overscroll))] font-mono text-label leading-6`},Use={class:`inline-block w-4 select-none text-fg-subtle`},Wse={key:2,class:`grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2`},Gse={class:`flex min-h-0 flex-col gap-1`},Kse={class:`text-caption font-medium uppercase text-fg-muted`},qse={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Jse={class:`flex min-h-0 flex-col gap-1`},Yse={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Xse=P({__name:`WorkflowHistory`,props:Le({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:Le([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=ye(e,`selected`),a=ye(e,`mode`);N(()=>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=Y(()=>n.revisions.find(e=>e.version===i.value)),s=Y(()=>o.value?.yaml??null),c=Y(()=>s.value===null?[]:Mse(s.value,n.current)),l=Y(()=>s.value!==null&&s.value===n.current),u=Y(()=>s.value===null?{}:k9(s.value,n.current,`removed`)),d=Y(()=>s.value===null?{}:k9(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(L(),A(`div`,Nse,[R(`ol`,{class:z(V(W)(`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,e.revisions.length&&`max-md:hidden`)),"aria-label":`Revisions`},[(L(!0),A(U,null,j(e.revisions,e=>(L(),A(`li`,{key:e.version},[R(`button`,{type:`button`,class:z([`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},[R(`span`,Fse,[R(`span`,Ise,`v`+B(e.version),1),k(V(D),{variant:f[e.change]},{default:I(()=>[H(B(e.change),1)]),_:2},1032,[`variant`])]),R(`span`,{class:`mt-0.5 block truncate text-xs text-fg-muted`,title:e.at},[H(B(e.actor||`unknown`)+` · `+B(e.source||`unknown`)+` · `,1),k(V(AC),{at:e.at},null,8,[`at`])],8,Lse)],10,Pse)]))),128)),e.revisions.length?F(``,!0):(L(),A(`li`,Rse,B(e.error||`No recorded changes`),1))],2),e.revisions.length?(L(),q(V(Vn),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:I(()=>[k(V(Rn),{class:`w-full md:hidden`,"aria-label":`Revision`},{default:I(()=>[k(V(Hn))]),_:1}),k(V(zn),null,{default:I(()=>[(L(!0),A(U,null,j(e.revisions,e=>(L(),q(V(In),{key:e.version,value:String(e.version)},{default:I(()=>[H(`v`+B(e.version)+` · `+B(e.change)+` · `+B(e.actor||`unknown`)+` · `+B(V(fC)(e.at)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])):F(``,!0),o.value?(L(),A(`div`,zse,[R(`div`,Bse,[k(V(RE),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:I(()=>[k(V(BE),null,{default:I(()=>[k(V(VE),{value:`yaml`},{default:I(()=>[...n[3]||=[H(`YAML`,-1)]]),_:1}),k(V(VE),{value:`canvas`},{default:I(()=>[...n[4]||=[H(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),k(V(X),{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:I(()=>[k(V(Dl),{"data-icon":`inline-start`}),n[5]||=H(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(L(),A(`p`,Vse,`Workflow removed in this revision.`)):a.value===`yaml`?(L(),A(`pre`,Hse,[R(`code`,null,[(L(!0),A(U,null,j(c.value,(e,t)=>(L(),A(`span`,{key:t,class:z([`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=k0(e).toJS(),n=new Map;for(let r of d2(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 ufe={class:`flex flex-col gap-3 md:grid md:h-[calc(100dvh-17rem)] md:min-h-[26rem] md:grid-cols-[18rem_1fr]`},dfe=[`aria-current`,`onClick`],ffe={class:`flex items-center gap-2 text-sm`},pfe={class:`font-mono text-xs text-fg-subtle`},mfe=[`title`],hfe={key:0,class:`px-3 py-2 text-sm text-fg-muted`},gfe={key:1,class:`flex min-h-0 flex-col gap-2`},_fe={class:`flex items-center gap-2 max-md:flex-wrap`},vfe={key:0,class:`rounded-lg border border-border p-4 text-sm text-fg-muted`},yfe={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border pt-2 pb-[calc(0.5rem+var(--code-overscroll))] font-mono text-label leading-6`},bfe={class:`inline-block w-4 select-none text-fg-subtle`},xfe={key:2,class:`grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2`},Sfe={class:`flex min-h-0 flex-col gap-1`},Cfe={class:`text-caption font-medium uppercase text-fg-muted`},wfe={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Tfe={class:`flex min-h-0 flex-col gap-1`},Efe={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Dfe=P({__name:`WorkflowHistory`,props:He({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:He([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=we(e,`selected`),a=we(e,`mode`);N(()=>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=Y(()=>n.revisions.find(e=>e.version===i.value)),s=Y(()=>o.value?.yaml??null),c=Y(()=>s.value===null?[]:lfe(s.value,n.current)),l=Y(()=>s.value!==null&&s.value===n.current),u=Y(()=>s.value===null?{}:k9(s.value,n.current,`removed`)),d=Y(()=>s.value===null?{}:k9(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(L(),j(`div`,ufe,[R(`ol`,{class:z(V(W)(`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,e.revisions.length&&`max-md:hidden`)),"aria-label":`Revisions`},[(L(!0),j(U,null,M(e.revisions,e=>(L(),j(`li`,{key:e.version},[R(`button`,{type:`button`,class:z([`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},[R(`span`,ffe,[R(`span`,pfe,`v`+B(e.version),1),A(V(O),{variant:f[e.change]},{default:I(()=>[H(B(e.change),1)]),_:2},1032,[`variant`])]),R(`span`,{class:`mt-0.5 block truncate text-xs text-fg-muted`,title:e.at},[H(B(e.actor||`unknown`)+` · `+B(e.source||`unknown`)+` · `,1),A(V(YC),{at:e.at},null,8,[`at`])],8,mfe)],10,dfe)]))),128)),e.revisions.length?F(``,!0):(L(),j(`li`,hfe,B(e.error||`No recorded changes`),1))],2),e.revisions.length?(L(),q(V(Eu),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:I(()=>[A(V(Au),{class:`w-full md:hidden`,"aria-label":`Revision`},{default:I(()=>[A(V(ju))]),_:1}),A(V(Du),null,{default:I(()=>[(L(!0),j(U,null,M(e.revisions,e=>(L(),q(V(ku),{key:e.version,value:String(e.version)},{default:I(()=>[H(`v`+B(e.version)+` · `+B(e.change)+` · `+B(e.actor||`unknown`)+` · `+B(V(FC)(e.at)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])):F(``,!0),o.value?(L(),j(`div`,gfe,[R(`div`,_fe,[A(V(_k),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:I(()=>[A(V(yk),null,{default:I(()=>[A(V(bk),{value:`yaml`},{default:I(()=>[...n[3]||=[H(`YAML`,-1)]]),_:1}),A(V(bk),{value:`canvas`},{default:I(()=>[...n[4]||=[H(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),A(V(X),{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:I(()=>[A(V(au),{"data-icon":`inline-start`}),n[5]||=H(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(L(),j(`p`,vfe,`Workflow removed in this revision.`)):a.value===`yaml`?(L(),j(`pre`,yfe,[R(`code`,null,[(L(!0),j(U,null,M(c.value,(e,t)=>(L(),j(`span`,{key:t,class:z([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-o
Line truncated
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{h as e}from"./badge.js";import{M as t,Xt as n,_t as r,jn as i,n as a,rt as o,wt as s,x as c}from"./PageHeader.js";import{j as l,x as u}from"./createLucideIcon.js";var d=t({__name:`Label`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`label`}},setup(t){let a=t;return e(),(e,t)=>(r(),c(i(l),o(a,{onMousedown:t[0]||=e=>{!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}),{default:n(()=>[s(e.$slots,`default`)]),_:3},16))}}),f=t({__name:`Label`,props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,l=u(t,`class`);return(e,u)=>(r(),c(i(d),o({"data-slot":`label`},i(l),{class:i(a)(`gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed`,t.class)}),{default:n(()=>[s(e.$slots,`default`)]),_:3},16,[`class`]))}});export{f as t};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{C as e,E as t,I as n,L as r,O as i,_ as a,a as o,c as s,d as c,f as l,g as u,h as d,j as f,l as p,m,n as h,o as g,p as _,r as ee,s as te,u as v,v as y,y as ne}from"./badge.js";import{A as b,Bt as re,C as x,Ct as S,Dt as ie,Gt as C,H as w,Kt as ae,M as T,On as oe,Qt as E,Rt as D,S as O,Xt as k,Z as se,_t as A,b as ce,dt as le,er as j,ht as ue,ir as M,it as N,jn as P,k as de,l as F,n as I,nr as L,nt as fe,pn as pe,r as me,rt as R,tt as he,wt as z,x as B,xn as V,y as H}from"./PageHeader.js";import{A as ge,at as _e,j as U,nt as ve,ot as W,t as G,x as K}from"./createLucideIcon.js";import{a as ye,i as be,n as xe,o as Se,r as Ce,t as we}from"./duration.js";import{a as Te,c as Ee,d as De,f as q,g as Oe,i as ke,l as Ae,m as je,n as Me,o as Ne,p as Pe,r as Fe,s as Ie,t as Le,u as Re}from"./Collection.js";import{c as ze,t as Be}from"./input.js";import{t as Ve}from"./check.js";import"./textarea.js";import{a as He,i as J,n as Ue,o as We,r as Y,t as Ge}from"./table.js";var Ke=e=>e.startsWith(`/`);function qe(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function Je(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&qe(e.default)}var Ye=Object.assign;function Xe(e,t){let n={};for(let r in t){let i=t[r];n[r]=Qe(i)?i.map(e):e(i)}return n}var Ze=()=>{},Qe=Array.isArray;function $e(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var et=Symbol(``);function tt(e,t){return Ye(Error(),{type:e,[et]:!0},t)}function nt(e,t){return e instanceof Error&&et in e&&(t==null||!!(e.type&t))}var rt=Symbol(``),it=Symbol(``),at=Symbol(``),ot=Symbol(``),st=Symbol(``),ct=Symbol(``);function lt(){return se(at)}function ut(e){return se(ot)}var dt=`rovingFocusGroup.onEntryFocus`,ft={bubbles:!1,cancelable:!0},pt={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function mt(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function ht(e,t,n){let r=mt(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return pt[r]}function gt(e,t=!1){let r=n();for(let i of e)if(i===r||(i.focus({preventScroll:t}),n()!==r))return}function _t(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[vt,yt]=r(`RovingFocusGroup`),bt=T({__name:`RovingFocusGroup`,props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`entryFocus`,`update:currentTabStopId`],setup(e,{expose:n,emit:r}){let i=e,a=r,{loop:o,orientation:s,dir:c}=oe(i),l=y(c),u=t(i,`currentTabStopId`,a,{defaultValue:i.defaultCurrentTabStopId,passive:i.currentTabStopId===void 0}),d=V(!1),f=V(!1),p=V(0),{getItems:m,CollectionSlot:h}=Le({isProvider:!0});function g(e){let t=!f.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!d.value){let t=new CustomEvent(dt,ft);if(e.currentTarget.dispatchEvent(t),a(`entryFocus`,t),!t.defaultPrevented){let e=m().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);gt([e.find(e=>e.getAttribute(`data-active`)===``),e.find(e=>e.getAttribute(`data-highlighted`)===``),e.find(e=>e.id===u.value),...e].filter(Boolean),i.preventScrollOnEntryFocus)}}f.value=!1}function _(){setTimeout(()=>{f.value=!1},1)}return n({getItems:m}),yt({loop:o,dir:l,orientation:s,currentTabStopId:u,onItemFocus:e=>{u.value=e},onItemShiftTab:()=>{d.value=!0},onFocusableItemAdd:()=>{p.value++},onFocusableItemRemove:()=>{p.value--}}),(t,n)=>(A(),B(P(h),null,{default:k(()=>[b(P(U),{tabindex:d.value||p.value===0?-1:0,"data-orientation":P(s),as:e.as,"as-child":e.asChild,dir:P(l),style:{outline:`none`},onMousedown:n[0]||=e=>f.value=!0,onMouseup:_,onFocus:g,onBlur:n[1]||=e=>d.value=!1},{default:k(()=>[z(t.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`as`,`as-child`,`dir`])]),_:3}))}}),xt=T({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(A(),B(P(o),L(w(t)),{default:k(()=>[z(e.$slots,`default`)]),_:3},16))}});function St(){let t=V(!1);return le(()=>{e(`keydown`,()=>{t.value=!0},{capture:!0,passive:!0}),e([`pointerdown`,`pointermove`],()=>{t.value=!1},{capture:!0,passive:!0})}),t}var Ct=i(St),[X,wt]=r([`MenuRoot`,`MenuSub`],`MenuContext`),[Z,Tt]=r(`MenuRoot`),Et=T({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:n}){let r=e,i=n,{modal:a,dir:o}=oe(r),s=y(o),c=t(r,`open`,i),l=V(),u=Ct();return wt({open:c,onOpenChange:e=>{c.value=e},content:l,onContentChange:e=>{l.value=e}}),Tt({onClose:()=>{c.value=!1},isUsingKeyboardRef:u,dir:s,modalLine truncated
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{E as e,F as t,I as n,L as r,S as i,T as a,a as o,c as s,d as c,f as l,g as u,h as d,j as f,l as p,m,o as h,p as g,r as _,s as v,u as y,v as b,x,y as S}from"./badge.js";import{A as C,C as w,Ct as T,Dt as E,Gt as D,H as O,It as k,Kt as A,M as j,On as M,S as N,Xt as P,_t as F,b as ee,dt as I,er as te,ht as ne,ir as re,it as L,jn as R,k as ie,l as ae,n as z,nr as B,p as oe,rr as se,rt as V,st as ce,wt as H,x as U,xn as W,y as G}from"./PageHeader.js";import{j as K,ot as q,x as J}from"./createLucideIcon.js";import{n as le,t as ue}from"./nullish.js";import{n as de,r as fe,t as pe}from"./VisuallyHidden.js";import{_ as me,c as he,g as ge,t as Y}from"./Collection.js";import{t as _e}from"./check.js";import{n as ve,t as ye}from"./chevron-up.js";function be(e){let t=x({nonce:W()});return G(()=>e?.value||t.nonce?.value)}var[X,xe]=r(`FieldRoot`),Se=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Ce=[` `,`Enter`];function Z(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>we(e,t,n)):we(e,t,n)}function we(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:le(e,t)}function Te(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var Ee=[`value`],[Q,De]=r(`SelectRoot`),Oe=j({inheritAttrs:!1,__name:`SelectRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},nullableValue:{type:String,required:!1,default:``},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:open`],setup(t,{emit:n}){let r=t,i=n,{multiple:a,dir:o}=M(r),s=X(null),c=G(()=>r.name??s?.name.value),l=G(()=>s?r.required||s.required.value:r.required),u=G(()=>!!(r.disabled||s?.disabled.value)),d=e(r,`modelValue`,i,{defaultValue:r.defaultValue??(a.value?[]:void 0),passive:r.modelValue===void 0,deep:!0}),f=e(r,`open`,i,{defaultValue:r.defaultOpen,passive:r.open===void 0}),p=W(),m=W(),g=W({x:0,y:0}),_=G(()=>a.value&&Array.isArray(d.value)?d.value?.length===0:ue(d.value));D(d,()=>{s?.reportControlState({filled:!_.value})}),Y({isProvider:!0});let v=b(o),y=de(p),x=W(new Set),S=G(()=>Array.from(x.value).map(e=>e.value).join(`;`));function C(e){let t;if(a.value){let n=Array.isArray(d.value)?[...d.value]:[],i=n.findIndex(t=>we(t,e,r.by));i===-1?n.push(e):n.splice(i,1),t=[...n]}else t=e;d.value=t,s?.handleControlInput({value:t})}function E(e){return Array.from(x.value).find(t=>Z(e,t.value,r.by))}return De({triggerElement:p,onTriggerChange:e=>{p.value=e},valueElement:m,onValueElementChange:e=>{m.value=e},contentId:``,modelValue:d,onValueChange:C,by:r.by,open:f,multiple:a,required:l,onOpenChange:e=>{f.value=e},dir:v,triggerPointerDownPosRef:g,disabled:u,isEmptyModelValue:_,optionsSet:x,onOptionAdd:e=>{let t=E(e.value);t&&x.value.delete(t),x.value.add(e)},onOptionRemove:e=>{let t=E(e.value);t&&x.value.delete(t)}}),(e,n)=>(F(),U(R(h),null,{default:P(()=>[H(e.$slots,`default`,{modelValue:R(d),open:R(f)}),R(y)&&c.value?(F(),U(ke,{key:S.value,"aria-hidden":`true`,tabindex:`-1`,multiple:R(a),required:l.value,name:c.value,autocomplete:t.autocomplete,disabled:u.value,value:R(d)},{default:P(()=>[R(ue)(R(d))?(F(),w(`option`,{key:0,value:t.nullableValue},null,8,Ee)):N(`v-if`,!0),(F(!0),w(ae,null,T(Array.from(x.value),e=>(F(),w(`option`,V({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):N(`v-if`,!0)]),_:3}))}}),ke=j({__name:`BubbleSelect`,props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){let t=e,n=W(),r=Q();D(()=>t.value,(e,t)=>{let r=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,`value`).set;if(e!==t&&i&&n.value){let t=new Event(`change`,{bubbles:!0});i.call(n.value,e),n.value.dispatchEvent(t)}});function i(e){r.onValueChange(e.target.value)}return(e,r)=>(F(),U(R(pe),{"as-child":``},{default:P(()=>[ee(`select`,V({ref_key:`selectElement`,ref:n},t,{onInput:i}),[H(e.$slots,`default`)],16)]),_:3}))}}),Ae=j({__name:`SelectPopperPosition`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:10},arrowPadding:{type:Number,required:!1},Line truncated
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{C as e,M as t,_t as n,b as r,er as i,jn as a,n as o,wt as s}from"./PageHeader.js";var c=t({__name:`Skeleton`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){let r=t;return(t,s)=>(n(),e(`div`,{"data-slot":`skeleton`,class:i(a(o)(`bg-muted rounded-md animate-pulse`,r.class))},null,2))}}),l=t({__name:`Table`,props:{class:{type:[Boolean,null,String,Object,Array]},containerClass:{type:[Boolean,null,String,Object,Array]}},setup(t){let c=t;return(t,l)=>(n(),e(`div`,{"data-slot":`table-container`,class:i(a(o)(`relative w-full overflow-x-auto`,c.containerClass))},[r(`table`,{"data-slot":`table`,class:i(a(o)(`w-full caption-bottom text-sm`,c.class))},[s(t.$slots,`default`)],2)],2))}}),u=t({__name:`TableBody`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){let r=t;return(t,c)=>(n(),e(`tbody`,{"data-slot":`table-body`,class:i(a(o)(`[&_tr:last-child]:border-0`,r.class))},[s(t.$slots,`default`)],2))}}),d=t({__name:`TableCell`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){let r=t;return(t,c)=>(n(),e(`td`,{"data-slot":`table-cell`,class:i(a(o)(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,r.class))},[s(t.$slots,`default`)],2))}}),f=t({__name:`TableRow`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){let r=t;return(t,c)=>(n(),e(`tr`,{"data-slot":`table-row`,class:i(a(o)(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors has-aria-expanded:bg-muted/50`,r.class))},[s(t.$slots,`default`)],2))}}),p=t({__name:`TableHead`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){let r=t;return(t,c)=>(n(),e(`th`,{"data-slot":`table-head`,class:i(a(o)(`text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0`,r.class))},[s(t.$slots,`default`)],2))}}),m=t({__name:`TableHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){let r=t;return(t,c)=>(n(),e(`thead`,{"data-slot":`table-header`,class:i(a(o)(`[&_tr]:border-b`,r.class))},[s(t.$slots,`default`)],2))}});export{u as a,d as i,p as n,l as o,f as r,c as s,m as t};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
import{C as e,M as t,Qt as n,_t as r,er as i,jn as a,n as o,pn as s}from"./PageHeader.js";import{rt as c}from"./createLucideIcon.js";import{p as l}from"./input.js";var u=t({__name:`Textarea`,props:{class:{type:[Boolean,null,String,Object,Array]},defaultValue:{},modelValue:{}},emits:[`update:modelValue`],setup(t,{emit:u}){let d=t,f=l(d,`modelValue`,u,{passive:!0,defaultValue:d.defaultValue});return(t,l)=>n((r(),e(`textarea`,{"onUpdate:modelValue":l[0]||=e=>s(f)?f.value=e:null,"data-slot":`textarea`,class:i(a(o)(`border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-card px-2.5 py-2 text-sm transition-colors pointer-coarse:text-base focus-visible:ring-3 aria-invalid:ring-3 flex field-sizing-content min-h-16 w-full outline-none placeholder:text-fg-muted disabled:cursor-not-allowed disabled:opacity-50`,d.class))},null,2)),[[c,a(f)]])}});export{u as t};
|
||||
Vendored
+2
-11
@@ -37,19 +37,10 @@
|
||||
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/badge.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/pinia.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/duration.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/Collection.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/input.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/check.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/textarea.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/table.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/schedule.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/nullish.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/VisuallyHidden.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/HistoryLink.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/chevron-up.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/select.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/label.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/Collection.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/input.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
@@ -49,7 +50,7 @@ watch(() => accounts.status?.user, (user) => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="!accounts.status" class="mx-auto max-w-md p-8" role="status"><p>{{accounts.error||'Connecting to Archie…'}}</p><button v-if="accounts.error" class="mt-3 underline" @click="accounts.load">Retry</button></div>
|
||||
<div v-if="!accounts.status" class="mx-auto max-w-md p-8" role="status"><p>{{accounts.error||'Connecting to Archie…'}}</p><Button v-if="accounts.error" variant="link" class="mt-3 px-0" @click="accounts.load">Retry</Button></div>
|
||||
<AccountEntry v-else-if="!accounts.status.user || accounts.status.setup_required || reauthenticate" />
|
||||
<TooltipProvider v-else :delay-duration="350">
|
||||
<div
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { computed } from "vue";
|
||||
|
||||
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
@@ -27,9 +28,9 @@ const title = computed(() => store.catalog.find((item) => item.kind === props.ki
|
||||
<template>
|
||||
<Popover v-if="problems.length && compact">
|
||||
<PopoverTrigger as-child>
|
||||
<button type="button" class="rounded-sm" :aria-label="`Apply status: ${applyStateLabel(problems[0]!.state, mode)}`">
|
||||
<Button type="button" variant="ghost" class="h-auto rounded-sm p-0" :aria-label="`Apply status: ${applyStateLabel(problems[0]!.state, mode)}`">
|
||||
<Badge :variant="applyStateTone(problems[0]!.state, mode)">{{ applyStateLabel(problems[0]!.state, mode) }}</Badge>
|
||||
</button>
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent align="end" class="w-80">
|
||||
<ApplyStatusRows :kind="kind" />
|
||||
|
||||
@@ -178,15 +178,15 @@ const tones = {
|
||||
<TabsContent value="marketplace">
|
||||
<p v-if="store.catalogueError" class="text-sm text-fg-muted">{{ store.catalogueError }}</p>
|
||||
<ExtensionsMarketplace v-else :updates="updates" />
|
||||
<details class="mt-3">
|
||||
<summary class="cursor-pointer text-xs text-fg-muted">Install by reference</summary>
|
||||
<form class="mt-2 flex flex-wrap gap-2" @submit.prevent="install">
|
||||
<Collapsible class="mt-3">
|
||||
<CollapsibleTrigger class="cursor-pointer text-xs text-fg-muted">Install by reference</CollapsibleTrigger>
|
||||
<CollapsibleContent><form class="mt-2 flex flex-wrap gap-2" @submit.prevent="install">
|
||||
<Input v-model="name" class="max-w-40" placeholder="Name" aria-label="Name" required />
|
||||
<Input v-model="reference" class="max-w-80 font-mono" placeholder="registry/repo:tag" aria-label="Reference" required />
|
||||
<Input v-model="digest" class="max-w-96 font-mono" placeholder="sha256:…" aria-label="Digest" required />
|
||||
<Button type="submit" size="sm" :disabled="!!store.busy"><Plus data-icon="inline-start" />Install</Button>
|
||||
</form>
|
||||
</details>
|
||||
</form></CollapsibleContent>
|
||||
</Collapsible>
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { computed, onMounted, onUnmounted, ref } from "vue";
|
||||
import { ChevronDown } from "@lucide/vue";
|
||||
|
||||
@@ -122,9 +123,9 @@ onUnmounted(() => clearInterval(timer));
|
||||
<template v-if="row.state !== 'up'">
|
||||
<Popover v-if="reasons(row).length">
|
||||
<PopoverTrigger as-child>
|
||||
<button type="button" class="rounded-sm" :aria-label="`Why ${row.service} is ${row.state}`">
|
||||
<Button type="button" variant="ghost" class="h-auto rounded-sm p-0" :aria-label="`Why ${row.service} is ${row.state}`">
|
||||
<Badge :variant="tone[row.state]">{{ stateLabel(row, table.agent) }}<ChevronDown data-icon="inline-end" /></Badge>
|
||||
</button>
|
||||
</Button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent align="start" class="w-96 max-w-[calc(100vw-2rem)] space-y-1 text-sm">
|
||||
<p v-for="reason in reasons(row)" :key="reason" class="break-words">{{ reason }}</p>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import { computed } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
@@ -33,7 +34,7 @@ const items = computed(() =>
|
||||
>
|
||||
<ul class="flex flex-col gap-0.5 lg:sticky lg:top-20 max-lg:flex-row max-lg:gap-1">
|
||||
<li v-for="(item, index) in items" :key="item.path" class="contents">
|
||||
<hr v-if="item.dividerBefore === ''" class="my-4 border-border max-lg:hidden" />
|
||||
<Separator v-if="item.dividerBefore === ''" class="my-4 max-lg:hidden" />
|
||||
<p
|
||||
v-else-if="item.dividerBefore"
|
||||
:class="cn('mb-1 px-3 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase max-lg:hidden', index > 0 && 'mt-4')"
|
||||
|
||||
@@ -38,11 +38,11 @@ function open(trigger: WorkflowTrigger): void {
|
||||
</div>
|
||||
<ul v-if="triggers.length" class="divide-y divide-border rounded-md border border-border">
|
||||
<li v-for="trigger in triggers" :key="trigger.kind + trigger.label" class="text-label">
|
||||
<button v-if="trigger.binding" type="button" class="flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-secondary" @click="open(trigger)">
|
||||
<Button v-if="trigger.binding" type="button" variant="ghost" class="h-auto w-full justify-start gap-2 rounded-none px-3 py-2 text-label font-normal" @click="open(trigger)">
|
||||
<span class="truncate">{{ trigger.label }}</span>
|
||||
<Badge v-if="trigger.binding.status !== 'armed'" :variant="statusKind(trigger.binding.status)">{{ statusLabel(trigger.binding.status) }}</Badge>
|
||||
<span v-if="trigger.detail" class="ml-auto truncate text-xs text-fg-subtle">{{ trigger.detail }}</span>
|
||||
</button>
|
||||
</Button>
|
||||
<RouterLink v-else-if="trigger.kind === 'workflow' || trigger.kind === 'playbook'" :to="trigger.kind === 'workflow' ? { path: '/workflows', query: { workflow: trigger.label } } : { path: '/org/playbooks' }" class="flex items-center gap-2 px-3 py-2 hover:bg-secondary">
|
||||
<span class="truncate">{{ trigger.label }}</span><span class="ml-auto truncate text-xs text-fg-subtle">{{ trigger.detail }}</span>
|
||||
</RouterLink>
|
||||
|
||||
@@ -425,7 +425,7 @@ onBeforeUnmount(() => yamlObserver?.disconnect());
|
||||
<PopoverContent align="end" class="max-h-96 w-80 overflow-y-auto p-1">
|
||||
<ul class="text-xs text-danger">
|
||||
<li v-for="(error, i) in errors" :key="i">
|
||||
<button v-if="error.path" type="button" class="w-full rounded px-2 py-1.5 text-left hover:bg-muted hover:underline" @click="showError(error.path)">{{ error.text }}</button>
|
||||
<Button v-if="error.path" type="button" variant="ghost" class="h-auto w-full justify-start whitespace-normal px-2 py-1.5 text-left text-xs font-normal text-danger hover:underline" @click="showError(error.path)">{{ error.text }}</Button>
|
||||
<p v-else class="px-2 py-1.5">{{ error.text }}</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Reference in new issue
Block a user