fix(ui/topbar): replace Jump to with a command palette, drop filler chrome (#1650)

* fix(ui/topbar): replace Jump to with a command palette, drop filler chrome

Jump to opens a shadcn-vue Command dialog that finds pages, tasks and
workflows by name. The connection indicator shows only when the stream is
lost, the dead documentation link is gone, and the profile menu label has
no stray whitespace.

* fix(ui): trim stray whitespace from template text and drop em dashes from copy

Element text that started or ended with a line break rendered with leading
and trailing spaces. Also removes the unused 'soon' nav state and the nav
group components no route reaches.

* fix(ui): drop the space a hidden spinner left before button text

* fix(ui/status): one dense Status page, full-width settings, problems-only apply status

Status drops its tabs and the duplicate health card; services list only
what is wrong. Settings pages use the full width, the resizable sidebar
handle is gone, and apply status shows only processes that have not
applied a change. PageHeader puts the title and actions on one line.

* refactor(ui): use shadcn ToggleGroup and Badge, drop SegmentedControl and StatusPill

Status badges show only when a state needs attention: no Running, Enabled,
Active, Listening or live pills next to healthy rows. Removes the unused
pagination, radio-group and scroll-area components.

* fix(ui/history): use the shadcn Table with fixed columns so nothing is clipped

* fix(ui/workflows): apply ?workflow= only once the workflow is listed

Selecting it before the definitions loaded opened an empty canvas.

* refactor(ui/workflows): use shadcn Input, NativeSelect, Checkbox and Button in editors

Replaces hand-rolled inputs, selects, the repository mode switch and icon
buttons in the workflow editor, bind dialog, harness page, sources panel
and review gate. Adds the upstream shadcn-vue NativeSelect.

* style(ui): rounded-rectangle controls instead of pills

Halves the radius scale so inputs, selects and buttons stop reading as
pills, and badges and chips lose their full rounding.

* fix(ui/alerts): centre the bell's failed state and stop it contradicting Needs you

* fix(ui/tasks): one header line, aligned columns, no placeholder issue numbers

Tasks puts its filters beside the title and drops the stat tiles the
dashboard already shows. Sort headers align with their cells, chat tasks
no longer show their synthetic issue number, and Logs and the task
not-found page use the shared header.

* fix(ui/dashboard): shared header and cards, empty cards stay silent

Needs you uses the shadcn Card and drops its duplicate Open button; quality
gates and token outlook render only when there is something to show; the
throughput strip moves into the dashboard, its only user.

* refactor(ui/stores): one Pinia store per feature

Splits the site-wide control-plane store and the module-level refs into
settings, workflows, tasks, events, org and session stores. Identity
requests move into lib/api. Drops store fields nothing read: per-resource
stream state, the states map and loadApplyStatus.

* fix(ui/org): one header for the org area, sections drop their repeated titles

The org name is the page title with the admin's org switcher and New org
beside it; Members and Workspaces tables sit in cards like other pages.

* fix(ui/events): shadcn Tabs for the capture, map and bind steps

Replaces the numbered step strip with line tabs that carry each step's
count; the Listening pill is gone and Capture off shows only when it is.

* fix(ui/workflows): confirm a workflow delete in an AlertDialog, not window.confirm

* style(ui/settings): denser setting rows
This commit is contained in:
sam authored and GitHub committed 2026-10-12 04:40:21 +11:00
1 parent c57f1b86f1
commit 2237b38b3a
209 files changed
+2158 -3175

No files matched your search

+1 -1
View File
@@ -1 +1 @@
import{l as e,n as t,t as n,v as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v,yn as y}from"./PageHeader.js";import{X as b,r as x}from"./badge.js";import{v as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`flex items-center justify-between`},E={class:`font-mono text-sm`},D=`agent-profiles`,O=i({__name:`AgentProfilesPage`,setup(i){let O=e();f(O.load);let k=c(()=>O.drafts[D]?.value),A=y(``);function j(){let e=A.value.trim();if(!e||k.value?.[e])return;let t=O.drafts[D];t&&(t.value||={},t.value[e]={image:``,kit:``,adapter:``,tools:[]},A.value=``)}function M(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(e,i)=>(u(),_(`div`,null,[s(h,{title:`Agent profiles`},{default:o(()=>[s(n,{kinds:[D]},null,8,[`kinds`])]),_:1}),s(t,{kind:D,class:`mb-4`}),d(O).catalogError||d(O).pageErrorFor(D)?(u(),_(`p`,C,p(d(O).catalogError||d(O).pageErrorFor(D)),1)):l(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:b(j,[`prevent`])},[s(d(r),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`},null,8,[`modelValue`]),s(d(x),{type:`submit`,disabled:!A.value.trim()||!!k.value?.[A.value.trim()]},{default:o(()=>[...i[1]||=[a(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?l(``,!0):(u(),_(`p`,w,`No agent profiles.`)),(u(!0),_(m,null,v(k.value,(e,t)=>(u(),_(`section`,{key:t,class:`mb-6 border-t pt-4`},[g(`div`,T,[g(`h2`,E,p(t),1),s(d(x),{variant:`ghost`,size:`sm`,onClick:e=>delete k.value[t]},{default:o(()=>[...i[2]||=[a(`Remove profile`,-1)]]),_:1},8,[`onClick`])]),s(d(S),{label:`Image`,for:`${t}-image`},{default:o(()=>[s(d(r),{id:`${t}-image`,modelValue:e.image,"onUpdate:modelValue":t=>e.image=t,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Kit`,for:`${t}-kit`,hint:`Pinned digest; leave Image empty when using a Kit.`},{default:o(()=>[s(d(r),{id:`${t}-kit`,modelValue:e.kit,"onUpdate:modelValue":t=>e.kit=t,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Adapter`,for:`${t}-adapter`},{default:o(()=>[s(d(r),{id:`${t}-adapter`,modelValue:e.adapter,"onUpdate:modelValue":t=>e.adapter=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Tools`,for:`${t}-tools`,hint:`Comma-separated tool names.`},{default:o(()=>[s(d(r),{id:`${t}-tools`,"model-value":(e.tools??[]).join(`, `),"onUpdate:modelValue":t=>M(e,t)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]))),128))]))}});export{O as default};
import{h as e,n as t,o as n,t as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v,yn as y}from"./PageHeader.js";import{Y as b,o as x}from"./alert.js";import{_ as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`flex items-center justify-between`},E={class:`font-mono text-sm`},D=`agent-profiles`,O=i({__name:`AgentProfilesPage`,setup(i){let O=n();f(O.load);let k=c(()=>O.drafts[D]?.value),A=y(``);function j(){let e=A.value.trim();if(!e||k.value?.[e])return;let t=O.drafts[D];t&&(t.value||={},t.value[e]={image:``,kit:``,adapter:``,tools:[]},A.value=``)}function M(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(n,i)=>(u(),_(`div`,null,[s(h,{title:`Agent profiles`},{default:o(()=>[s(r,{kinds:[D]},null,8,[`kinds`])]),_:1}),s(t,{kind:D,class:`mb-4`}),d(O).catalogError||d(O).pageErrorFor(D)?(u(),_(`p`,C,p(d(O).catalogError||d(O).pageErrorFor(D)),1)):l(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:b(j,[`prevent`])},[s(d(e),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`},null,8,[`modelValue`]),s(d(x),{type:`submit`,disabled:!A.value.trim()||!!k.value?.[A.value.trim()]},{default:o(()=>[...i[1]||=[a(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?l(``,!0):(u(),_(`p`,w,`No agent profiles.`)),(u(!0),_(m,null,v(k.value,(t,n)=>(u(),_(`section`,{key:n,class:`mb-6 border-t pt-4`},[g(`div`,T,[g(`h2`,E,p(n),1),s(d(x),{variant:`ghost`,size:`sm`,onClick:e=>delete k.value[n]},{default:o(()=>[...i[2]||=[a(`Remove profile`,-1)]]),_:1},8,[`onClick`])]),s(d(S),{label:`Image`,for:`${n}-image`},{default:o(()=>[s(d(e),{id:`${n}-image`,modelValue:t.image,"onUpdate:modelValue":e=>t.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Kit`,for:`${n}-kit`,hint:`Pinned digest; leave Image empty when using a Kit.`},{default:o(()=>[s(d(e),{id:`${n}-kit`,modelValue:t.kit,"onUpdate:modelValue":e=>t.kit=e,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Adapter`,for:`${n}-adapter`},{default:o(()=>[s(d(e),{id:`${n}-adapter`,modelValue:t.adapter,"onUpdate:modelValue":e=>t.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Tools`,for:`${n}-tools`,hint:`Comma-separated tool names.`},{default:o(()=>[s(d(e),{id:`${n}-tools`,"model-value":(t.tools??[]).join(`, `),"onUpdate:modelValue":e=>M(t,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]))),128))]))}});export{O as default};
+1 -1
View File
@@ -1 +1 @@
import{l as e,n as t,t as n,v as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v}from"./PageHeader.js";import{r as y}from"./badge.js";import{_ as b,v as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w={class:`flex justify-end`},T=`credential-bindings`,E=i({__name:`CredentialBindingsPage`,setup(i){let E=e();f(E.load);let D=c(()=>E.drafts[T]?.value);function O(){let e=E.drafts[T];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}))}return(e,i)=>(u(),_(`div`,null,[s(h,{title:`Credential bindings`},{default:o(()=>[s(n,{kinds:[T]},null,8,[`kinds`]),s(d(y),{onClick:O},{default:o(()=>[...i[0]||=[a(`Add binding`,-1)]]),_:1})]),_:1}),s(t,{kind:T,class:`mb-4`}),d(E).catalogError||d(E).pageErrorFor(T)?(u(),_(`p`,S,p(d(E).catalogError||d(E).pageErrorFor(T)),1)):l(``,!0),D.value?.length?l(``,!0):(u(),_(`p`,C,`No credential bindings.`)),(u(!0),_(m,null,v(D.value,(e,t)=>(u(),_(`section`,{key:t,class:`mb-6 border-t pt-4`},[g(`div`,w,[s(d(y),{variant:`ghost`,size:`sm`,onClick:e=>D.value.splice(t,1)},{default:o(()=>[...i[1]||=[a(`Remove binding`,-1)]]),_:1},8,[`onClick`])]),s(d(x),{label:`Service`,for:`binding-${t}-service`},{default:o(()=>[s(d(r),{id:`binding-${t}-service`,modelValue:e.service,"onUpdate:modelValue":t=>e.service=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(x),{label:`Organisation`,for:`binding-${t}-org`,hint:`Empty uses the default organisation.`},{default:o(()=>[s(d(r),{id:`binding-${t}-org`,modelValue:e.org,"onUpdate:modelValue":t=>e.org=t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(x),{label:`Secret`},{default:o(()=>[s(b,{modelValue:e.secret,"onUpdate:modelValue":t=>e.secret=t,"id-prefix":`binding-${t}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]))),128))]))}});export{E as default};
import{h as e,n as t,o as n,t as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v}from"./PageHeader.js";import{o as y}from"./alert.js";import{_ as b,g as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w={class:`flex justify-end`},T=`credential-bindings`,E=i({__name:`CredentialBindingsPage`,setup(i){let E=n();f(E.load);let D=c(()=>E.drafts[T]?.value);function O(){let e=E.drafts[T];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}))}return(n,i)=>(u(),_(`div`,null,[s(h,{title:`Credential bindings`},{default:o(()=>[s(r,{kinds:[T]},null,8,[`kinds`]),s(d(y),{onClick:O},{default:o(()=>[...i[0]||=[a(`Add binding`,-1)]]),_:1})]),_:1}),s(t,{kind:T,class:`mb-4`}),d(E).catalogError||d(E).pageErrorFor(T)?(u(),_(`p`,S,p(d(E).catalogError||d(E).pageErrorFor(T)),1)):l(``,!0),D.value?.length?l(``,!0):(u(),_(`p`,C,`No credential bindings.`)),(u(!0),_(m,null,v(D.value,(t,n)=>(u(),_(`section`,{key:n,class:`mb-6 border-t pt-4`},[g(`div`,w,[s(d(y),{variant:`ghost`,size:`sm`,onClick:e=>D.value.splice(n,1)},{default:o(()=>[...i[1]||=[a(`Remove binding`,-1)]]),_:1},8,[`onClick`])]),s(d(b),{label:`Service`,for:`binding-${n}-service`},{default:o(()=>[s(d(e),{id:`binding-${n}-service`,modelValue:t.service,"onUpdate:modelValue":e=>t.service=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(b),{label:`Organisation`,for:`binding-${n}-org`,hint:`Empty uses the default organisation.`},{default:o(()=>[s(d(e),{id:`binding-${n}-org`,modelValue:t.org,"onUpdate:modelValue":e=>t.org=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(b),{label:`Secret`},{default:o(()=>[s(x,{modelValue:t.secret,"onUpdate:modelValue":e=>t.secret=e,"id-prefix":`binding-${n}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]))),128))]))}});export{E as default};
+9 -9
View File
@@ -1,16 +1,16 @@
import{A as e,D as t,Jt as n,O as r,Xt as i,at as a,b as o,ht as s,kn as c,lt as l,nr as u,s as d,t as f,v as p,x as m,xt as h,y as g,yn as _}from"./PageHeader.js";import{K as ee,b as te,r as ne,t as re,y as ie}from"./badge.js";import{a as ae,c as oe,d as se,f as ce,g as v,h as le,i as y,l as ue,m as de,n as fe,o as b,p as pe,r as me,s as he,t as ge,u as _e}from"./index.js";var x=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,S=(e,t)=>{for(var n in t)x(e,n,{get:t[n],enumerable:!0})},C=(e,t,n,r)=>{for(var i=r>1?void 0:r?ve(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&x(t,n,i),i},w=(e,t)=>(n,r)=>t(n,r,e),ye=`Terminal input`,be={get:()=>ye,set:e=>ye=e},xe=`Too much output to announce, navigate to rows manually to read`,T={get:()=>xe,set:e=>xe=e};function Se(e){return e.replace(/\r?\n/g,`\r`)}function Ce(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function we(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Te(e,t,n,r){e.stopPropagation(),e.clipboardData&&Ee(e.clipboardData.getData(`text/plain`),t,n,r)}function Ee(e,t,n,r){e=Se(e),e=Ce(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function De(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function Oe(e,t,n,r,i){De(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function ke(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Ae(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var je=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},Me=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128||(c=(i&31)<<6|a&63,c<128)){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Ne=``,Pe=` `,Fe=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ie}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&5033164Line truncated
import{A as e,D as t,Jt as n,O as r,at as i,b as a,ht as o,kn as s,lt as c,nr as l,s as u,t as d,v as f,x as p,xt as m,y as h,yn as g}from"./PageHeader.js";import{_,i as ee,n as te,o as ne,r as re,t as ie,v as ae}from"./alert.js";import{a as oe,c as se,d as ce,f as v,h as le,i as y,l as ue,m as de,n as fe,o as b,p as pe,r as me,s as he,t as ge,u as _e}from"./index.js";var x=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,S=(e,t)=>{for(var n in t)x(e,n,{get:t[n],enumerable:!0})},C=(e,t,n,r)=>{for(var i=r>1?void 0:r?ve(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&x(t,n,i),i},w=(e,t)=>(n,r)=>t(n,r,e),ye=`Terminal input`,be={get:()=>ye,set:e=>ye=e},xe=`Too much output to announce, navigate to rows manually to read`,Se={get:()=>xe,set:e=>xe=e};function Ce(e){return e.replace(/\r?\n/g,`\r`)}function we(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function Te(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Ee(e,t,n,r){e.stopPropagation(),e.clipboardData&&De(e.clipboardData.getData(`text/plain`),t,n,r)}function De(e,t,n,r){e=Ce(e),e=we(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function Oe(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function ke(e,t,n,r,i){Oe(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Ae(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function je(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var Me=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},Ne=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128||(c=(i&31)<<6|a&63,c<128)){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Pe=``,Fe=` `,Ie=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Le}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==1Line 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 $e=E(`CharSizeService`),et=E(`CoreBrowserService`),tt=E(`MouseService`),nt=E(`RenderService`),rt=E(`SelectionService`),it=E(`CharacterJoinerService`),at=E(`ThemeService`),ot=E(`LinkProviderService`),st=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?pt.isErrorNoTelemetry(e)?new pt(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 et=T(`CharSizeService`),tt=T(`CoreBrowserService`),nt=T(`MouseService`),rt=T(`RenderService`),it=T(`SelectionService`),at=T(`CharacterJoinerService`),ot=T(`ThemeService`),st=T(`LinkProviderService`),ct=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?mt.isErrorNoTelemetry(e)?new mt(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 ct(e){ut(e)||st.onUnexpectedError(e)}var lt=`Canceled`;function ut(e){return e instanceof dt||e instanceof Error&&e.name===lt&&e.message===lt}var dt=class extends Error{constructor(){super(lt),this.name=this.message}};function ft(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var pt=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`}},mt=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function ht(e,t=0){return e[e.length-(1+t)]}var gt;(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})(gt||={});var _t=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||gt.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};_t.empty=new _t(e=>{});function vt(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 yt;(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 ee(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=ee;async function te(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=te})(yt||={});var bt=null;function xt(e){return bt?.trackDisposable(e),e}function St(e){bt?.markAsDisposed(e)}function Ct(e,t){bt?.setParent(e,t)}function wt(e){return bt?.markAsSingleton(e),e}function Tt(e){if(yt.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 Et(...e){return k(()=>Tt(e))}function k(e){let t=xt({dispose:vt(()=>{St(t),e()})});return t}var Dt=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,xt(this)}dispose(){this._isDisposed||(St(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Tt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return Ct(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),Ct(e,null))}};Dt.DISABLE_DISPOSED_WARNING=!1;var Ot=Dt,A=class{constructor(){this._store=new Ot,xt(this),Ct(this._store,this)}dispose(){St(th 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 lt(e){dt(e)||ct.onUnexpectedError(e)}var ut=`Canceled`;function dt(e){return e instanceof ft||e instanceof Error&&e.name===ut&&e.message===ut}var ft=class extends Error{constructor(){super(ut),this.name=this.message}};function pt(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var mt=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`}},ht=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function O(e,t=0){return e[e.length-(1+t)]}var gt;(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})(gt||={});var _t=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||gt.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};_t.empty=new _t(e=>{});function vt(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 yt;(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 ee(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=ee;async function te(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=te})(yt||={});var bt=null;function xt(e){return bt?.trackDisposable(e),e}function St(e){bt?.markAsDisposed(e)}function Ct(e,t){bt?.setParent(e,t)}function wt(e){return bt?.markAsSingleton(e),e}function Tt(e){if(yt.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 Et(...e){return k(()=>Tt(e))}function k(e){let t=xt({dispose:vt(()=>{St(t),e()})});return t}var Dt=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,xt(this)}dispose(){this._isDisposed||(St(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Tt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return Ct(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),Ct(e,null))}};Dt.DISABLE_DISPOSED_WARNING=!1;var Ot=Dt,A=class{constructor(){this._store=new Ot,xt(this),Ct(this._store,this)}dispose(){St(thi Line truncated
`).slice(2).join(`
`))}},Vt=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},Ht=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},Ut=0,Wt=class{constructor(e){this.value=e,this.id=Ut++}},Gt=2,N=class{constructor(e){this._size=0,this._options=e,this._leakageMon=Lt>0||this._options?.leakWarningThreshold?new zt(e?.onListenerError??ct,this._options?.leakWarningThreshold??Lt):void 0,this._perfMon=this._options?._profName?new It(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 Ht(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||ct)(n),A.None}if(this._disposed)return A.None;t&&(e=e.bind(t));let r=new Wt(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Bt.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Wt?(this._deliveryQueue??=new Kt,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=k(()=>{i?.(),this._removeListener(r)});return n instanceof Ot?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*Gt<=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||ct;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 Wt)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}},Kt=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}},qt=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new N,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new N,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}};qt.INSTANCE=new qt;var Jt=qt;function Yt(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Jt.INSTANCE.onDidChangeZoomLevel;function Xt(e){return Jt.INSTANCE.getZoomFactor(e)}Jt.INSTANCE.onDidChangeFullscreen;var Zt=typeof navigator==`object`?navigator.userAgent:``,Qt=Zt.indexOf(`Firefox`)>=0,$t=Zt.indexOf(`AppleWebKit`)>=0,en=Zt.indexOf(`Chrome`)>=0,tn=!en&&Zt.indexOf(`Safari`)>=0;Zt.indexOf(`Electron/`),Zt.indexOf(`Android`);var nn=!1;if(typeof At.matchMedia==`function`){let e=At.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=At.matchMedia(`(display-mode: fullscreen)`);nn=e.matches,Yt(At,e,({matches:e})=>{nn&&t.matches||(nn=e)})}func 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}};ri=C([w(2,D),w(3,et),w(4,Ue),w(5,at),w(6,O),w(7,nt)],ri);var ii=class extends A{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(k(()=>{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._renderService.dimLine 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=``))(R||={});var ui;(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=`Ÿ`))(ui||={});var di;(e=>e.ST=`${R.ESC}\\`)(di||={});var fi=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(`${R.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)}}};fi=C([w(2,D),w(3,O),w(4,We),w(5,nt)],fi);var z=0,B=0,V=0,H=0,pi={css:`#00000000`,rgba:0},U;(e=>{function t(e,t,n,r){return r===void 0?`#${hi(e)}${hi(t)}${hi(n)}`:`#${hi(e)}${hi(t)}${hi(n)}${hi(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})(U||={});var W;(e=>{function t(e,t){if(H=(t.rgba&255)/255,H===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 z=a+Math.round((n-a)*H),B=o+Math.round((r-o)*H),V=s+Math.round((i-s)*H),{css:U.toCss(z,B,V),rgba:U.toRgba(z,B,V)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=mi.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return U.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[z,B,V]=mi.toChannels(t),{css:U.toCss(z,B,V),rgba:t}}e.opaque=i;function a(e,t){return H=Math.round(t*255),[z,B,V]=mi.toChannels(e.rgba),{css:U.toCss(z,B,V,H),rgba:U.toRgba(z,B,V,H)}}e.opacity=a;function o(e,t){return H=e.rgba&255,a(e,H*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(W||={});va Line truncated
`))}},Vt=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},Ht=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},Ut=0,Wt=class{constructor(e){this.value=e,this.id=Ut++}},Gt=2,N=class{constructor(e){this._size=0,this._options=e,this._leakageMon=Lt>0||this._options?.leakWarningThreshold?new zt(e?.onListenerError??lt,this._options?.leakWarningThreshold??Lt):void 0,this._perfMon=this._options?._profName?new It(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 Ht(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||lt)(n),A.None}if(this._disposed)return A.None;t&&(e=e.bind(t));let r=new Wt(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Bt.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Wt?(this._deliveryQueue??=new Kt,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=k(()=>{i?.(),this._removeListener(r)});return n instanceof Ot?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*Gt<=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||lt;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 Wt)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}},Kt=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}},qt=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new N,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new N,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}};qt.INSTANCE=new qt;var Jt=qt;function Yt(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Jt.INSTANCE.onDidChangeZoomLevel;function Xt(e){return Jt.INSTANCE.getZoomFactor(e)}Jt.INSTANCE.onDidChangeFullscreen;var Zt=typeof navigator==`object`?navigator.userAgent:``,Qt=Zt.indexOf(`Firefox`)>=0,$t=Zt.indexOf(`AppleWebKit`)>=0,en=Zt.indexOf(`Chrome`)>=0,tn=!en&&Zt.indexOf(`Safari`)>=0;Zt.indexOf(`Electron/`),Zt.indexOf(`Android`);var nn=!1;if(typeof At.matchMedia==`function`){let e=At.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=At.matchMedia(`(display-mode: fullscreen)`);nn=e.matches,Yt(At,e,({matches:e})=>{nn&&t.matches||(nn=e)})}func 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}};ri=C([w(2,E),w(3,tt),w(4,We),w(5,ot),w(6,D),w(7,rt)],ri);var ii=class extends A{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(k(()=>{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._renderService.dimLine 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=``))(R||={});var ui;(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=`Ÿ`))(ui||={});var di;(e=>e.ST=`${R.ESC}\\`)(di||={});var fi=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(`${R.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)}}};fi=C([w(2,E),w(3,D),w(4,Ge),w(5,rt)],fi);var z=0,B=0,V=0,H=0,pi={css:`#00000000`,rgba:0},U;(e=>{function t(e,t,n,r){return r===void 0?`#${hi(e)}${hi(t)}${hi(n)}`:`#${hi(e)}${hi(t)}${hi(n)}${hi(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})(U||={});var W;(e=>{function t(e,t){if(H=(t.rgba&255)/255,H===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 z=a+Math.round((n-a)*H),B=o+Math.round((r-o)*H),V=s+Math.round((i-s)*H),{css:U.toCss(z,B,V),rgba:U.toRgba(z,B,V)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=mi.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return U.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[z,B,V]=mi.toChannels(t),{css:U.toCss(z,B,V),rgba:t}}e.opaque=i;function a(e,t){return H=Math.round(t*255),[z,B,V]=mi.toChannels(e.rgba),{css:U.toCss(z,B,V,H),rgba:U.toRgba(z,B,V,H)}}e.opacity=a;function o(e,t){return H=e.rgba&255,a(e,H*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(W||={});va Line truncated
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),oa&&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=ka(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=Wi(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,-Aa),Aa),t/=Aa,t/Math.abs(t)+Math.round(t*(ja-1)))}shouldForceSelection(e){return na?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(),Ma)}_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&&!(na&&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
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),oa&&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=ka(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=Wi(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,-Aa),Aa),t/=Aa,t/Math.abs(t)+Math.round(t*(ja-1)))}shouldForceSelection(e){return na?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(),Ma)}_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&&!(na&&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(F(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(k(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<Es+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Es+1&&(this._liveRegion.textContent+=T.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 r 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 be.get()},set promptLabel(e){be.set(e)},get tooMuchOutput(){return T.get()},set tooMuchOutput(e){T.set(e)}}}_verifyIntegers(...e){for(zs of e)if(zs===1/0||isNaN(zs)||zs%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(zs of e)if(zs&&(zs===1/0||isNaN(zs)||zs%1!=0||zs<0))throw Error(`This API only accepts positive integers`)}},Vs=2,Hs=1,Us=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(Vs,Math.floor(u/e.css.cell.width)),rows:Math.max(Hs,Math.floor(l/e.css.cell.height))}}};function Ws(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 Gs(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 Ks={class:`flex h-full min-h-0 flex-col gap-2`},qs={key:0,class:`text-sm text-muted-foreground`,role:`status`},Js=e({__name:`SetupTerminal`,props:{profile:{}},setup(e){let n=e,r=_(null),i=_(`connecting`),c=null,u=null,f=null,h=null;function g(){try{f?.fit()}catch{}}return l(()=>{let e=r.value;if(!e)return;c=new Bs({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),f=new Us,c.loadAddon(f),c.open(e),g(),c.focus();let t=new WebSocket(Gs(n.profile,window.location,c?.cols??80,c?.rows??24));u=t,t.binaryType=`arraybuffer`,t.onopen=()=>{i.value=`open`},t.onmessage=e=>{c&&(typeof e.data==`string`?c.write(e.data):c.write(new Uint8Array(e.data)))},t.onerror=()=>{i.value=`failed`},t.onclose=()=>{i.value=`closed`},c.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),h=new ResizeObserver(g),h.observe(e)}),a(()=>{h?.disconnect(),h=null,u?.close(),u=null,c?.dispose(),c=null,f=null}),(e,n)=>(s(),m(`div`,Ks,[i.value===`open`?o(``,!0):(s(),m(`p`,qs,[i.value===`connecting`?(s(),m(d,{key:0},[t(`Connecting…`)],64)):i.value===`closed`?(s(),m(d,{key:1},[t(`The terminal session ended.`)],64)):(s(),m(d,{key:2},[t(`Could not open the setup terminal.`)],64))])),p(`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)]))}}),Ys={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},Xs={key:1,class:`space-y-2`},Zs={class:`flex flex-col gap-1 text-sm`},Qs=[`disabled`],$s={key:0,value:``},ec=[`value`],tc=e({__name:`HarnessPage`,setup(e){let a=_(null),x=_(!0),ve=_(null),S=_(!1),C=_(``),w=_(!1),ye={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};l(be);async function be(){x.value=!0,ve.value=null,S.value=!1;try{let e=await te.harnessBindings();a.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},C.value=a.value.profiles[0]??``}catch(e){let t=e instanceof ie?e.status:void 0;t===501||t===503?S.value=!0:ve.value=e instanceof Error?e.message:String(e),a.value=null}finally{x.value=!1}}function xe(){a.value?.terminal&&C.value&&(w.value=!0)}function T(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Se(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(e,l)=>(s(),m(`div`,null,[r(f,{title:`Harness`}),ve.value?(s(),m(`p`,Ys,u(ve.value),1)):o(``,!0),x.value?(s(),m(`div`,Xs,[r(c(ge),{class:`h-24 w-full`}),r(c(ge),{class:`h-40 w-full`})])):S.value?(s(),g(c(v),{key:2},{default:n(()=>[r(c(de),null,{default:n(()=>[r(c(pe),null,{default:n(()= Line truncated
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Es+1&&(this._liveRegion.textContent+=Se.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 be.get()},set promptLabel(e){be.set(e)},get tooMuchOutput(){return Se.get()},set tooMuchOutput(e){Se.set(e)}}}_verifyIntegers(...e){for(zs of e)if(zs===1/0||isNaN(zs)||zs%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(zs of e)if(zs&&(zs===1/0||isNaN(zs)||zs%1!=0||zs<0))throw Error(`This API only accepts positive integers`)}},Vs=2,Hs=1,Us=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(Vs,Math.floor(u/e.css.cell.width)),rows:Math.max(Hs,Math.floor(l/e.css.cell.height))}}};function Ws(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 Gs(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 Ks={class:`flex h-full min-h-0 flex-col gap-2`},qs={key:0,class:`text-sm text-muted-foreground`,role:`status`},Js=e({__name:`SetupTerminal`,props:{profile:{}},setup(e){let n=e,r=g(null),s=g(`connecting`),l=null,d=null,m=null,h=null;function _(){try{m?.fit()}catch{}}return c(()=>{let e=r.value;if(!e)return;l=new Bs({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),m=new Us,l.loadAddon(m),l.open(e),_(),l.focus();let t=new WebSocket(Gs(n.profile,window.location,l?.cols??80,l?.rows??24));d=t,t.binaryType=`arraybuffer`,t.onopen=()=>{s.value=`open`},t.onmessage=e=>{l&&(typeof e.data==`string`?l.write(e.data):l.write(new Uint8Array(e.data)))},t.onerror=()=>{s.value=`failed`},t.onclose=()=>{s.value=`closed`},l.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),h=new ResizeObserver(_),h.observe(e)}),i(()=>{h?.disconnect(),h=null,d?.close(),d=null,l?.dispose(),l=null,m=null}),(e,n)=>(o(),p(`div`,Ks,[s.value===`open`?a(``,!0):(o(),p(`p`,qs,[s.value===`connecting`?(o(),p(u,{key:0},[t(`Connecting…`)],64)):s.value===`closed`?(o(),p(u,{key:1},[t(`The terminal session ended.`)],64)):(o(),p(u,{key:2},[t(`Could not open the setup terminal.`)],64))])),f(`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)]))}}),Ys={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},Xs={key:1,class:`space-y-2`},Zs={class:`flex flex-col gap-1 text-sm`},Qs=e({__name:`HarnessPage`,setup(e){let i=g(null),x=g(!0),ve=g(null),S=g(!1),C=g(``),w=g(!1),ye={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};c(be);async function be(){x.value=!0,ve.value=null,S.value=!1;try{let e=await ae.harnessBindings();i.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},C.value=i.value.profiles[0]??``}catch(e){let t=e instanceof _?e.status:void 0;t===501||t===503?S.value=!0:ve.value=e instanceof Error?e.message:String(e),i.value=null}finally{x.value=!1}}function xe(){i.value?.terminal&&C.value&&(w.value=!0)}function Se(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Ce(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(e,c)=>(o(),p(`div`,null,[r(d,{title:`Harness`}),ve.value?(o(),p(`p`,Ys,l(ve.value),1)):a(``,!0),x.value?(o(),p(`div`,Xs,[r(s(me),{class:`h-24 w-full`}),r(s(me),{class:`h-40 w-full`})])):S.value?(o(),h(s(le),{key:2},{default:n(()=>[r(s(pe),null,{default:n(()=>[r(s(v),null,{default:n(()=>[...c[1]||=[t(`Harness bindings are not config Line truncated
+2 -2
View File
@@ -1,3 +1,3 @@
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as C,Jt as w,K as T,Kt as E,L as ee,Lt as te,M as D,Mn as ne,Mt as re,N as ie,Nn as ae,Nt as oe,O,On as se,Ot as ce,P as le,Pt as ue,Q as de,Qn as fe,Qt as pe,R as k,Rt as me,S as he,Sn as A,St as j,T as ge,Tn as _e,Tt as ve,U as ye,Ut as M,V as be,Vt as xe,W as Se,Wt as N,X as Ce,Xt as we,Y as Te,Yt as Ee,Z as De,Zt as Oe,_ as P,_n as ke,_t as Ae,a as je,an as Me,at as Ne,b as Pe,bn as Fe,bt as Ie,c as Le,cn as Re,ct as ze,d as Be,dn as F,dt as Ve,en as He,er as Ue,et as We,f as Ge,fn as Ke,ft as qe,g as Je,gn as Ye,gt as Xe,h as Ze,hn as Qe,ht as I,i as $e,in as et,it as tt,j as nt,jt as rt,k as it,kn as L,kt as at,l as ot,ln as st,lt as ct,m as lt,mn as ut,mt as dt,n as ft,nn as pt,nr as R,nt as z,o as mt,on as ht,ot as gt,p as _t,pn as vt,pt as yt,q as bt,qt as xt,r as St,rn as Ct,rr as wt,rt as Tt,s as Et,sn as Dt,st as Ot,tn as kt,tr as At,tt as B,u as jt,un as Mt,ut as Nt,v as Pt,vn as Ft,vt as It,w as Lt,wn as Rt,wt as zt,x as V,xn as Bt,xt as Vt,y as H,yn as U,yt as Ht,z as Ut,zt as Wt}from"./PageHeader.js";import{A as Gt,B as Kt,C as qt,D as Jt,E as Yt,F as Xt,G as Zt,H as Qt,I as $t,J as en,K as tn,L as nn,M as rn,N as an,O as on,P as sn,R as cn,S as ln,T as un,U as dn,V as fn,W as pn,X as mn,Y as hn,a as gn,c as _n,d as vn,f as yn,g as bn,h as xn,j as Sn,k as Cn,l as wn,o as Tn,p as En,q as Dn,r as On,s as kn,t as An,u as jn,v as Mn,z as Nn}from"./badge.js";var Pn=Object.defineProperty,Fn=((e,t)=>{let n={};for(var r in e)Pn(n,r,{get:e[r],enumerable:!0});return t||Pn(n,Symbol.toStringTag,{value:`Module`}),n})({BaseTransition:()=>ft,BaseTransitionPropsValidators:()=>St,Comment:()=>$e,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>je,ErrorTypeStrings:()=>mt,Fragment:()=>Et,KeepAlive:()=>Le,ReactiveEffect:()=>He,Static:()=>ot,Suspense:()=>jt,Teleport:()=>Be,Text:()=>Ge,TrackOpTypes:()=>kt,Transition:()=>Jt,TransitionGroup:()=>on,TriggerOpTypes:()=>pt,VueElement:()=>Cn,assertNumber:()=>_t,callWithAsyncErrorHandling:()=>lt,callWithErrorHandling:()=>Ze,camelize:()=>ne,capitalize:()=>ae,cloneVNode:()=>Je,compatUtils:()=>null,compile:()=>In,computed:()=>P,createApp:()=>Gt,createBlock:()=>H,createCommentVNode:()=>Pe,createElementBlock:()=>V,createElementVNode:()=>Pt,createHydrationRenderer:()=>he,createPropsRestProxy:()=>o,createRenderer:()=>Lt,createSSRApp:()=>Sn,createSlots:()=>ge,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>O,customRef:()=>Ct,defineAsyncComponent:()=>it,defineComponent:()=>n,defineCustomElement:()=>rn,defineEmits:()=>nt,defineExpose:()=>D,defineModel:()=>ie,defineOptions:()=>le,defineProps:()=>h,defineSSRCustomElement:()=>an,defineSlots:()=>x,devtools:()=>ee,effect:()=>et,effectScope:()=>Me,getCurrentInstance:()=>k,getCurrentScope:()=>ht,getCurrentWatcher:()=>Dt,getTransitionRawChildren:()=>Ut,guardReactiveProps:()=>i,h:()=>be,handleError:()=>y,hasInjectionContext:()=>ye,hydrate:()=>sn,hydrateOnIdle:()=>Se,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>bt,initCustomFormatter:()=>C,initDirectivesForSSR:()=>Xt,inject:()=>Te,isMemoSame:()=>Ce,isProxy:()=>Re,isReactive:()=>st,isReadonly:()=>Mt,isRef:()=>F,isRuntimeOnly:()=>De,isShallow:()=>Ke,isVNode:()=>de,markRaw:()=>vt,mergeDefaults:()=>e,mergeModels:()=>We,mergeProps:()=>B,nextTick:()=>z,nodeOps:()=>$t,normalizeClass:()=>fe,normalizeProps:()=>Ue,normalizeStyle:()=>At,onActivated:()=>Tt,onBeforeMount:()=>tt,onBeforeUnmount:()=>Ne,onBeforeUpdate:()=>gt,onDeactivated:()=>Ot,onErrorCaptured:()=>ze,onMounted:()=>ct,onRenderTracked:()=>Nt,onRenderTriggered:()=>Ve,onScopeDispose:()=>ut,onServerPrefetch:()=>qe,onUnmounted:()=>yt,onUpdated:()=>dt,onWatcherCleanup:()=>Qe,openBlock:()=>I,patchProp:()=>nn,popScopeId:()=>Xe,provide:()=>Ae,proxyRefs:()=>Ye,pushScopeId:()=>It,queuePostFlushCb:()=>Ht,reactive:()=>ke,readonly:()=>Ft,ref:()=>U,registerRuntimeCompiler:()=>Ie,render:()=>cn,renderList:()=>Vt,renderSlot:()=>j,resolveComponent:()=>c,resolveDirective:()=>zt,resolveDynamicComponent:()=>ve,resolveFilter:()=>null,resolveTransitionHooks:()=>m,setBlockTracking:()=>d,setDevtoolsHook:()=>ce,setTransitionHooks:()=>at,shallowReactive:()=>Fe,shallowReadonly:()=>Bt,shallowRef:()=>A,ssrContextKey:()=>r,ssrUtils:()=>rt,stop:()=>s,toDisplayString:()=>R,toHandlerKey:()=>wt,toHandlers:()=>re,toRaw:()=>Rt,toRef:()=>_e,toRefs:()=>p,toValue:()=>u,transformVNodeArgs:()=>oe,triggerRef:()=>se,unref:()=>L,useAttrs:()=>ue,useCssModule:()=>Nn,useCssVars:()=>Kt,useHost:()=>fn,useId:()=>g,useModel:()=>S,useSSRContext:()=>te,useShadowRoot:()=>Qt,useSlots:()=>me,useTemplateRef:()=>Wt,useTransitionState:()=>a,vModelCheckbox:()=>dn,vModelDynamic:()=>pn,vModelRadio:()=>Zt,vModelSelect:()=>tn,vModelText:()=>Dn,vShow:()=>en,version:()=>xe,warn:()=>b,watch:()=>M,watchEffect:()=>N,watchPostEffect:()=>v,watchSyncEffect:()=>E,withAsyncContext:(Line truncated
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as C,Jt as w,K as T,Kt as E,L as ee,Lt as te,M as D,Mn as ne,Mt as re,N as ie,Nn as ae,Nt as oe,O,On as se,Ot as ce,P as le,Pt as ue,Q as de,Qn as fe,Qt as pe,R as me,Rt as he,S as ge,Sn as _e,St as k,T as ve,Tn as ye,Tt as be,U as xe,Ut as A,V as Se,Vt as Ce,W as we,Wt as j,X as Te,Xt as Ee,Y as De,Yt as Oe,Z as ke,Zt as Ae,_ as M,_n as N,_t as je,a as Me,an as Ne,at as Pe,b as Fe,bn as Ie,bt as Le,c as Re,cn as ze,ct as Be,d as Ve,dn as P,dt as He,en as Ue,er as We,et as Ge,f as Ke,fn as qe,ft as Je,g as Ye,gn as Xe,gt as Ze,h as Qe,hn as $e,ht as F,i as et,in as tt,it as nt,j as rt,jt as it,k as at,kn as I,kt as ot,l as st,ln as ct,lt,m as ut,mn as dt,mt as ft,n as pt,nn as mt,nr as ht,nt as L,o as gt,on as _t,ot as vt,p as yt,pn as bt,pt as xt,q as St,qt as Ct,r as wt,rn as Tt,rr as Et,rt as Dt,s as Ot,sn as kt,st as At,tn as jt,tr as Mt,tt as R,u as Nt,un as Pt,ut as Ft,v as It,vn as Lt,vt as Rt,w as zt,wn as Bt,wt as Vt,x as Ht,xn as Ut,xt as Wt,y as z,yn as B,yt as Gt,z as Kt,zt as qt}from"./PageHeader.js";import{A as Jt,B as Yt,C as Xt,D as Zt,E as Qt,F as $t,G as en,H as tn,I as nn,J as rn,K as an,L as on,M as sn,N as cn,O as ln,P as un,R as dn,T as fn,U as pn,V as mn,W as hn,Y as gn,b as _n,d as vn,f as yn,g as bn,i as xn,j as Sn,k as Cn,m as wn,n as Tn,o as En,q as Dn,r as On,t as kn,v as An,w as jn,x as Mn,z as Nn}from"./alert.js";var Pn=Object.defineProperty,Fn=((e,t)=>{let n={};for(var r in e)Pn(n,r,{get:e[r],enumerable:!0});return t||Pn(n,Symbol.toStringTag,{value:`Module`}),n})({BaseTransition:()=>pt,BaseTransitionPropsValidators:()=>wt,Comment:()=>et,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>Me,ErrorTypeStrings:()=>gt,Fragment:()=>Ot,KeepAlive:()=>Re,ReactiveEffect:()=>Ue,Static:()=>st,Suspense:()=>Nt,Teleport:()=>Ve,Text:()=>Ke,TrackOpTypes:()=>jt,Transition:()=>Qt,TransitionGroup:()=>Zt,TriggerOpTypes:()=>mt,VueElement:()=>ln,assertNumber:()=>yt,callWithAsyncErrorHandling:()=>ut,callWithErrorHandling:()=>Qe,camelize:()=>ne,capitalize:()=>ae,cloneVNode:()=>Ye,compatUtils:()=>null,compile:()=>In,computed:()=>M,createApp:()=>Cn,createBlock:()=>z,createCommentVNode:()=>Fe,createElementBlock:()=>Ht,createElementVNode:()=>It,createHydrationRenderer:()=>ge,createPropsRestProxy:()=>o,createRenderer:()=>zt,createSSRApp:()=>Jt,createSlots:()=>ve,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>O,customRef:()=>Tt,defineAsyncComponent:()=>at,defineComponent:()=>n,defineCustomElement:()=>Sn,defineEmits:()=>rt,defineExpose:()=>D,defineModel:()=>ie,defineOptions:()=>le,defineProps:()=>h,defineSSRCustomElement:()=>sn,defineSlots:()=>x,devtools:()=>ee,effect:()=>tt,effectScope:()=>Ne,getCurrentInstance:()=>me,getCurrentScope:()=>_t,getCurrentWatcher:()=>kt,getTransitionRawChildren:()=>Kt,guardReactiveProps:()=>i,h:()=>Se,handleError:()=>y,hasInjectionContext:()=>xe,hydrate:()=>cn,hydrateOnIdle:()=>we,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>St,initCustomFormatter:()=>C,initDirectivesForSSR:()=>un,inject:()=>De,isMemoSame:()=>Te,isProxy:()=>ze,isReactive:()=>ct,isReadonly:()=>Pt,isRef:()=>P,isRuntimeOnly:()=>ke,isShallow:()=>qe,isVNode:()=>de,markRaw:()=>bt,mergeDefaults:()=>e,mergeModels:()=>Ge,mergeProps:()=>R,nextTick:()=>L,nodeOps:()=>$t,normalizeClass:()=>fe,normalizeProps:()=>We,normalizeStyle:()=>Mt,onActivated:()=>Dt,onBeforeMount:()=>nt,onBeforeUnmount:()=>Pe,onBeforeUpdate:()=>vt,onDeactivated:()=>At,onErrorCaptured:()=>Be,onMounted:()=>lt,onRenderTracked:()=>Ft,onRenderTriggered:()=>He,onScopeDispose:()=>dt,onServerPrefetch:()=>Je,onUnmounted:()=>xt,onUpdated:()=>ft,onWatcherCleanup:()=>$e,openBlock:()=>F,patchProp:()=>nn,popScopeId:()=>Ze,provide:()=>je,proxyRefs:()=>Xe,pushScopeId:()=>Rt,queuePostFlushCb:()=>Gt,reactive:()=>N,readonly:()=>Lt,ref:()=>B,registerRuntimeCompiler:()=>Le,render:()=>on,renderList:()=>Wt,renderSlot:()=>k,resolveComponent:()=>c,resolveDirective:()=>Vt,resolveDynamicComponent:()=>be,resolveFilter:()=>null,resolveTransitionHooks:()=>m,setBlockTracking:()=>d,setDevtoolsHook:()=>ce,setTransitionHooks:()=>ot,shallowReactive:()=>Ie,shallowReadonly:()=>Ut,shallowRef:()=>_e,ssrContextKey:()=>r,ssrUtils:()=>it,stop:()=>s,toDisplayString:()=>ht,toHandlerKey:()=>Et,toHandlers:()=>re,toRaw:()=>Bt,toRef:()=>ye,toRefs:()=>p,toValue:()=>u,transformVNodeArgs:()=>oe,triggerRef:()=>se,unref:()=>I,useAttrs:()=>ue,useCssModule:()=>dn,useCssVars:()=>Nn,useHost:()=>Yt,useId:()=>g,useModel:()=>S,useSSRContext:()=>te,useShadowRoot:()=>mn,useSlots:()=>he,useTemplateRef:()=>qt,useTransitionState:()=>a,vModelCheckbox:()=>tn,vModelDynamic:()=>pn,vModelRadio:()=>hn,vModelSelect:()=>en,vModelText:()=>an,vShow:()=>Dn,version:()=>Ce,warn:()=>b,watch:()=>A,watchEffect:()=>j,watchPostEffect:()=>v,watchSyncEffect:()=>E,withAsyncContext:()=>Ct,withCtx:()=>w,withLine truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?be(t.default({present:o.value})[0],{ref:e=>{let t=K(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Xi=`dismissableLayer.pointerDownOutside`,Zi=`dismissableLayer.focusOutside`;function Qi(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 $i(e,t){if(!Qi(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 ea(e,t,n=!0){let r=U(!1),i=U(()=>{});return N(a=>{if(!G||!u(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if($i(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){kr(Xi,e,t)}n.pointerType===`touch`?(o.removeEventListener(`click`,i.value),i.value=r,o.addEventListener(`click`,i.value,{once:!0})):r()}else o.removeEventListener(`click`,i.value);r.value=!1}}},c=window.setTimeout(()=>{o.addEventListener(`pointerdown`,s)},0);a(()=>{window.clearTimeout(c),o.removeEventListener(`pointerdown`,s),o.removeEventListener(`click`,i.value)})}),{onPointerDownCapture:()=>{u(n)&&(r.value=!0)}}}function ta(e,t,n=!0){let r=U(!1);return N(i=>{if(!G||!u(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await z(),await z();let i=n.target;t.value&&i&&!$i(t.value,i)&&n.target&&!r.value&&kr(Zi,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{u(n)&&(r.value=!0)},onBlurCapture:()=>{u(n)&&(r.value=!1)}}}var na=ke({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ra=n({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=q(),o=P(()=>a.value?.ownerDocument??globalThis.document),s=P(()=>na.layersRoot),c=P(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=P(()=>na.layersWithOutsidePointerEventsDisabled.size>0),u=P(()=>{let e=Array.from(s.value),[t]=[...na.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=ea(async e=>{let t=[...na.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await z(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=ta(e=>{let t=[...na.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return ri(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),M([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;hi(t,e),na.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{na.layersWithOutsidePointerEventsDisabled.delete(e),gi(t,e)})}},{immediate:!0}),M([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),N(e=>{e(()=>{a.value&&(s.value.delete(a.value),na.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(I(),H(L(bn),{ref:L(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:At({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:L(f).onFocusCapture,onBlurCapture:L(f).onBlurCapture,onPointerdownCapture:L(d).onPointerDownCapture},{default:w(()=>[j(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),ia=Mr(()=>U([]));function aa(){let e=ia();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=oa(e.value,t),e.value.unshift(t)},remove(t){e.value=oa(e.value,t),e.value[0]?.resume()}}}function oa(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var sa=`focusScope.autoFocusOnMount`,ca=`focusScope.autoFocusOnUnmount`,la={bubbles:!1,cancelable:!0};function ua(e,t){let n=t;for(;n;){if(e.contains(n))return!0;n=n.getRootNode().host??null}return!1}function da(e,{select:t=!1}={}){let n=W();for(let r of e)if(J(r,{select:t}),W()!==n)return!0}function fa(e){let t=pa(e);return[ma(t,e),ma(t.reverse(),e)]}function pa(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t Line truncated
`))}return()=>i.value||r.value||o.value?Se(t.default({present:o.value})[0],{ref:e=>{let t=U(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),zi=`dismissableLayer.pointerDownOutside`,Bi=`dismissableLayer.focusOutside`;function Vi(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 Hi(e,t){if(!Vi(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 Ui(e,t,n=!0){let r=B(!1),i=B(()=>{});return j(a=>{if(!H||!u(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(Hi(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){vr(zi,e,t)}n.pointerType===`touch`?(o.removeEventListener(`click`,i.value),i.value=r,o.addEventListener(`click`,i.value,{once:!0})):r()}else o.removeEventListener(`click`,i.value);r.value=!1}}},c=window.setTimeout(()=>{o.addEventListener(`pointerdown`,s)},0);a(()=>{window.clearTimeout(c),o.removeEventListener(`pointerdown`,s),o.removeEventListener(`click`,i.value)})}),{onPointerDownCapture:()=>{u(n)&&(r.value=!0)}}}function Wi(e,t,n=!0){let r=B(!1);return j(i=>{if(!H||!u(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await L(),await L();let i=n.target;t.value&&i&&!Hi(t.value,i)&&n.target&&!r.value&&vr(Bi,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{u(n)&&(r.value=!0)},onBlurCapture:()=>{u(n)&&(r.value=!1)}}}var Gi=N({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ki=n({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=W(),o=M(()=>a.value?.ownerDocument??globalThis.document),s=M(()=>Gi.layersRoot),c=M(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=M(()=>Gi.layersWithOutsidePointerEventsDisabled.size>0),u=M(()=>{let e=Array.from(s.value),[t]=[...Gi.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Ui(async e=>{let t=[...Gi.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await L(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=Wi(e=>{let t=[...Gi.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return Kr(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),A([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;ii(t,e),Gi.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{Gi.layersWithOutsidePointerEventsDisabled.delete(e),ai(t,e)})}},{immediate:!0}),A([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),j(e=>{e(()=>{a.value&&(s.value.delete(a.value),Gi.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(F(),z(I(wn),{ref:I(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:Mt({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:I(f).onFocusCapture,onBlurCapture:I(f).onBlurCapture,onPointerdownCapture:I(d).onPointerDownCapture},{default:w(()=>[k(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),qi=xr(()=>B([]));function Ji(){let e=qi();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=Yi(e.value,t),e.value.unshift(t)},remove(t){e.value=Yi(e.value,t),e.value[0]?.resume()}}}function Yi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var Xi=`focusScope.autoFocusOnMount`,Zi=`focusScope.autoFocusOnUnmount`,Qi={bubbles:!1,cancelable:!0};function $i(e,t){let n=t;for(;n;){if(e.contains(n))return!0;n=n.getRootNode().host??null}return!1}function ea(e,{select:t=!1}={}){let n=V();for(let r of e)if(G(r,{select:t}),V()!==n)return!0}function ta(e){let t=na(e);return[ra(t,e),ra(t.reverse(),e)]}function na(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t. Line truncated
+2 -2
View File
@@ -1,3 +1,3 @@
function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>S(e)===`[object Map]`,p=e=>S(e)===`[object Set]`,m=e=>S(e)===`[object Date]`,h=e=>S(e)===`[object RegExp]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,b=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),x=Object.prototype.toString,S=e=>x.call(e),C=e=>S(e).slice(8,-1),w=e=>S(e)===`[object Object]`,ee=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,T=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),E=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,D=E(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,O=E(e=>e.replace(ne,`-$1`).toLowerCase()),re=E(e=>e.charAt(0).toUpperCase()+e.slice(1)),ie=E(e=>e?`on${re(e)}`:``),k=(e,t)=>!Object.is(e,t),A=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ae=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},oe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},se=e=>{let t=_(e)?Number(e):NaN;return isNaN(t)?e:t},ce,le=()=>ce||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ue=e(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function de(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_(r)?he(r):de(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_(e)||y(e))return e}var fe=/;(?![^(]*\))/g,pe=/:([^]+)/,me=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function he(e){let t={};return e.replace(me,e=>e.startsWith(`/*`)?``:e).split(fe).forEach(e=>{if(e){let n=e.split(pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ge(e){let t=``;if(_(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=ge(e[n]);r&&(t+=r+` `)}else if(y(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function _e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!_(t)&&(e.class=ge(t)),n&&(e.style=de(n)),e}var ve=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ye=e(ve);ve+``;function be(e){return!!e||e===``}function xe(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Te(e[i],t[i],n);return r}function Se(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Te(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ce(e,t,n){let r=f(e),i=f(t);if(r||i||(r=p(e),i=p(t),r||i))return r&&i?Se(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Te(e[r],t[r],n))return!1}return String(e)===String(t)}function we(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Te(e,t,n){if(e===t)return!0;let r=m(e),i=m(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=v(e),i=v(t),r||i?e===t:(r=d(e),i=d(t),r||i?r&&i?we(e,t,n,xe):!1:(r=y(e),i=y(t),r||i?!r||!i?!1:we(e,t,n,Ce):String(e)===String(t))))}function Ee(e,t){return e.findIndex(e=>Te(e,t))}var De=e=>!!(e&&e.__v_isRef===!0),Oe=e=>_(e)?e:e==null?``:d(e)||y(e)&&(e.toString===x||!g(e.toString))?De(e)?Oe(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>De(t)?ke(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:v(t)?Ae(t):y(t)&&!d(t)&&!w(t)?String(t):t,Ae=(e,t=``)=>v(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var j,Me=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&j&&(j.active?(this.parent=j,this.index=(j.scopes||(j.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=j;try{return j=this,e(Line truncated
function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>S(e)===`[object Map]`,p=e=>S(e)===`[object Set]`,m=e=>S(e)===`[object Date]`,h=e=>S(e)===`[object RegExp]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,b=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),x=Object.prototype.toString,S=e=>x.call(e),C=e=>S(e).slice(8,-1),w=e=>S(e)===`[object Object]`,ee=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,T=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),E=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,D=E(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,O=E(e=>e.replace(ne,`-$1`).toLowerCase()),re=E(e=>e.charAt(0).toUpperCase()+e.slice(1)),ie=E(e=>e?`on${re(e)}`:``),k=(e,t)=>!Object.is(e,t),A=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ae=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},oe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},se=e=>{let t=_(e)?Number(e):NaN;return isNaN(t)?e:t},ce,le=()=>ce||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ue=e(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function de(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_(r)?he(r):de(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_(e)||y(e))return e}var fe=/;(?![^(]*\))/g,pe=/:([^]+)/,me=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function he(e){let t={};return e.replace(me,e=>e.startsWith(`/*`)?``:e).split(fe).forEach(e=>{if(e){let n=e.split(pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ge(e){let t=``;if(_(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=ge(e[n]);r&&(t+=r+` `)}else if(y(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function _e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!_(t)&&(e.class=ge(t)),n&&(e.style=de(n)),e}var ve=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ye=e(ve);ve+``;function be(e){return!!e||e===``}function xe(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Te(e[i],t[i],n);return r}function Se(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Te(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ce(e,t,n){let r=f(e),i=f(t);if(r||i||(r=p(e),i=p(t),r||i))return r&&i?Se(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Te(e[r],t[r],n))return!1}return String(e)===String(t)}function we(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Te(e,t,n){if(e===t)return!0;let r=m(e),i=m(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=v(e),i=v(t),r||i?e===t:(r=d(e),i=d(t),r||i?r&&i?we(e,t,n,xe):!1:(r=y(e),i=y(t),r||i?!r||!i?!1:we(e,t,n,Ce):String(e)===String(t))))}function Ee(e,t){return e.findIndex(e=>Te(e,t))}var De=e=>!!(e&&e.__v_isRef===!0),Oe=e=>_(e)?e:e==null?``:d(e)||y(e)&&(e.toString===x||!g(e.toString))?De(e)?Oe(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>De(t)?ke(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:v(t)?Ae(t):y(t)&&!d(t)&&!w(t)?String(t):t,Ae=(e,t=``)=>v(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var j,Me=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&j&&(j.active?(this.parent=j,this.index=(j.scopes||(j.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=j;try{return j=this,e(Line truncated
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(hi(e,0)||ai(),e.textContent=t.children)}if(d){if(_||b||!s||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let o in d)if(_&&(o.endsWith(`value`)||o===`indeterminate`)||a(o)&&!T(o)||o[0]===`.`||t&&!T(o)||u&&u.includes(o)){if(fi(e,o,d[o]))continue;r(e,o,null,d[o],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Qt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Q(x,n,t),h&&ur(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Yo(()=>{x&&Q(x,n,t),l&&g.enter(e),h&&ur(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,a,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Z(d[t]),g=h.type===Qo;e?(g&&!u&&t+1<p&&Z(d[t+1]).type===Qo&&(l(i(e.data.slice(h.children.length)),r,o(e)),e.data=h.children),e=f(e,h,a,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,hi(r,1)||ai()),n(null,h,r,null,a,s,ci(r),c))}return e},h=(e,t,n,r,i,a)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=s(e),f=m(o(e),t,d,n,r,i,a);return f&&li(f)&&f.data===`]`?o(t.anchor=f):(ai(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,a,l)=>{if(_i(e,t)||ai(),t.el=null,l){let t=_(e);for(;;){let n=o(e);if(n&&n!==t)c(n);else break}}let u=o(e),d=s(e);return c(e),n(null,t,d,u,r,i,ci(d),a),r&&(r.vnode.el=t.el,co(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=o(e),e&&li(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return o(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var di=new Set([`src`,`srcset`,`href`,`poster`]);function fi(e,t,n){return di.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var pi=`data-allow-mismatch`,mi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function hi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(pi);)e=e.parentElement;return gi(e&&e.getAttribute(pi),t)}function gi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(mi[t])}}function _i(e,t){return hi(e.parentElement,1)||vi(e)||yi(t)}function vi(e){return e.nodeType===1&&gi(e.getAttribute(pi),1)}function yi({props:e}){let t=e&&e[pi];return typeof t==`string`&&gi(t,1)}var bi=le().requestIdleCallback||(e=>setTimeout(e,1)),xi=le().cancelIdleCallback||(e=>clearTimeout(e)),Si=(e=1e4)=>t=>{let n=bi(t,{timeout:e});return()=>xi(n)};function Ci(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var wi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ci(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ti=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ei=(e=[])=>(t,n)=>{_(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Di(e,t){if(li(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(li(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Oi=e=>!!e.type.__asyncLoader;function ki(e){g(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Xr({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Di(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=$;if(Qr(e),u)return()=>Ai(u,e);let t=t=>{l=null,Ln(t,e,13,!r)};if(s&&e.suspense||Ms)return p().then(t=>()=>Ai(t,e)).catch(e=>(t(e),()=>r?X(r,{error:e}):null));let a=nn(!1),c=nn(),d=nn(!!i),f,m;return qi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&ji(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?l=null:(t(n),c.value=n)}),()=>{if(a.value&&u)return Ai(u,e);if(c.value&&r)return X(r,{error:c.value});if(n&&!d.value)ret Line truncated
`)&&(gi(e,0)||oi(),e.textContent=t.children)}if(d){if(_||b||!s||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let o in d)if(_&&(o.endsWith(`value`)||o===`indeterminate`)||a(o)&&!T(o)||o[0]===`.`||t&&!T(o)||u&&u.includes(o)){if(pi(e,o,d[o]))continue;r(e,o,null,d[o],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&$t(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Q(x,n,t),h&&dr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Xo(()=>{x&&Q(x,n,t),l&&g.enter(e),h&&dr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,a,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Z(d[t]),g=h.type===$o;e?(g&&!u&&t+1<p&&Z(d[t+1]).type===$o&&(l(i(e.data.slice(h.children.length)),r,o(e)),e.data=h.children),e=f(e,h,a,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,gi(r,1)||oi()),n(null,h,r,null,a,s,li(r),c))}return e},h=(e,t,n,r,i,a)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=s(e),f=m(o(e),t,d,n,r,i,a);return f&&ui(f)&&f.data===`]`?o(t.anchor=f):(oi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,a,l)=>{if(vi(e,t)||oi(),t.el=null,l){let t=_(e);for(;;){let n=o(e);if(n&&n!==t)c(n);else break}}let u=o(e),d=s(e);return c(e),n(null,t,d,u,r,i,li(d),a),r&&(r.vnode.el=t.el,lo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=o(e),e&&ui(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return o(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var fi=new Set([`src`,`srcset`,`href`,`poster`]);function pi(e,t,n){return fi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var mi=`data-allow-mismatch`,hi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function gi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(mi);)e=e.parentElement;return _i(e&&e.getAttribute(mi),t)}function _i(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(hi[t])}}function vi(e,t){return gi(e.parentElement,1)||yi(e)||bi(t)}function yi(e){return e.nodeType===1&&_i(e.getAttribute(mi),1)}function bi({props:e}){let t=e&&e[mi];return typeof t==`string`&&_i(t,1)}var xi=le().requestIdleCallback||(e=>setTimeout(e,1)),Si=le().cancelIdleCallback||(e=>clearTimeout(e)),Ci=(e=1e4)=>t=>{let n=xi(t,{timeout:e});return()=>Si(n)};function wi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Ti=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(wi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ei=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Di=(e=[])=>(t,n)=>{_(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Oi(e,t){if(ui(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(ui(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var ki=e=>!!e.type.__asyncLoader;function Ai(e){g(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Zr({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Oi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=$;if($r(e),u)return()=>ji(u,e);let t=t=>{l=null,Rn(t,e,13,!r)};if(s&&e.suspense||Ms)return p().then(t=>()=>ji(t,e)).catch(e=>(t(e),()=>r?X(r,{error:e}):null));let a=rn(!1),c=rn(),d=rn(!!i),f,m;return Ji(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Mi(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?l=null:(t(n),c.value=n)}),()=>{if(a.value&&u)return ji(u,e);if(c.value&&r)return X(r,{error:c.value});if(n&&!d.value)ret Line truncated
+1 -1
View File
@@ -1 +1 @@
import{l as e,n as t,t as n,v as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v,yn as y}from"./PageHeader.js";import{X as b,r as x}from"./badge.js";import{y as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`mb-3 flex items-center justify-between`},E=[`for`],D=`eda-playbooks`,O=i({__name:`PlaybooksPage`,setup(i){let O=e();f(O.load);let k=c(()=>O.drafts[D]?.value),A=y(``);function j(){let e=A.value.trim();if(!e||k.value?.playbooks.some(t=>t.id===e))return;let t=O.drafts[D];t&&(t.value||={playbooks:[]},t.value.playbooks.push({id:e,yaml:``}),A.value=``)}return(e,i)=>(u(),_(`div`,null,[s(h,{title:`Playbooks`},{default:o(()=>[s(n,{kinds:[D]},null,8,[`kinds`])]),_:1}),s(t,{kind:D,class:`mb-4`}),d(O).catalogError||d(O).pageErrorFor(D)?(u(),_(`p`,C,p(d(O).catalogError||d(O).pageErrorFor(D)),1)):l(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:b(j,[`prevent`])},[s(d(r),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`},null,8,[`modelValue`]),s(d(x),{type:`submit`,disabled:!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:o(()=>[...i[1]||=[a(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?l(``,!0):(u(),_(`p`,w,`No playbooks installed.`)),(u(!0),_(m,null,v(k.value?.playbooks,(e,t)=>(u(),_(`section`,{key:t,class:`mb-6 border-t pt-4`},[g(`div`,T,[g(`label`,{for:`playbook-${t}`,class:`font-mono text-sm`},p(e.id),9,E),s(d(x),{variant:`ghost`,size:`sm`,onClick:e=>k.value.playbooks.splice(t,1)},{default:o(()=>[...i[2]||=[a(`Remove playbook`,-1)]]),_:1},8,[`onClick`])]),s(d(S),{id:`playbook-${t}`,modelValue:e.yaml,"onUpdate:modelValue":t=>e.yaml=t,"aria-label":`${e.id} YAML`,class:`min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]))),128))]))}});export{O as default};
import{h as e,n as t,o as n,t as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v,yn as y}from"./PageHeader.js";import{Y as b,o as x}from"./alert.js";import{v as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`mb-3 flex items-center justify-between`},E=[`for`],D=`eda-playbooks`,O=i({__name:`PlaybooksPage`,setup(i){let O=n();f(O.load);let k=c(()=>O.drafts[D]?.value),A=y(``);function j(){let e=A.value.trim();if(!e||k.value?.playbooks.some(t=>t.id===e))return;let t=O.drafts[D];t&&(t.value||={playbooks:[]},t.value.playbooks.push({id:e,yaml:``}),A.value=``)}return(n,i)=>(u(),_(`div`,null,[s(h,{title:`Playbooks`},{default:o(()=>[s(r,{kinds:[D]},null,8,[`kinds`])]),_:1}),s(t,{kind:D,class:`mb-4`}),d(O).catalogError||d(O).pageErrorFor(D)?(u(),_(`p`,C,p(d(O).catalogError||d(O).pageErrorFor(D)),1)):l(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:b(j,[`prevent`])},[s(d(e),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`},null,8,[`modelValue`]),s(d(x),{type:`submit`,disabled:!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:o(()=>[...i[1]||=[a(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?l(``,!0):(u(),_(`p`,w,`No playbooks installed.`)),(u(!0),_(m,null,v(k.value?.playbooks,(e,t)=>(u(),_(`section`,{key:t,class:`mb-6 border-t pt-4`},[g(`div`,T,[g(`label`,{for:`playbook-${t}`,class:`font-mono text-sm`},p(e.id),9,E),s(d(x),{variant:`ghost`,size:`sm`,onClick:e=>k.value.playbooks.splice(t,1)},{default:o(()=>[...i[2]||=[a(`Remove playbook`,-1)]]),_:1},8,[`onClick`])]),s(d(S),{id:`playbook-${t}`,modelValue:e.yaml,"onUpdate:modelValue":t=>e.yaml=t,"aria-label":`${e.id} YAML`,class:`min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]))),128))]))}});export{O as default};
+3
View File
@@ -0,0 +1,3 @@
import{$n as e,A as t,An as n,Bn as r,Bt as i,Dn as a,En as o,Et as s,Fn as c,Gn as l,Hn as u,In as d,Jn as f,Jt as p,Kn as m,Ln as h,Mn as g,Nn as _,O as v,Pn as y,Qn as b,R as x,Rn as ee,S as te,Sn as S,St as C,U as w,Un as ne,Ut as T,V as E,Vn as re,Wn as D,Wt as O,Xn as k,Y as ie,Yn as A,Zn as j,_ as M,_n as ae,dn as oe,g as se,ht as N,i as P,ir as ce,jn as le,kn as F,kt as ue,l as de,lt as I,m as fe,mn as pe,mt as me,n as he,nt as ge,on as _e,ot as ve,pt as ye,qn as be,r as xe,rn as Se,s as Ce,tt as we,w as Te,wn as Ee,x as De,xn as Oe,y as ke,yn as Ae,yt as je,z as Me,zn as L}from"./PageHeader.js";var Ne=void 0,Pe=typeof window<`u`&&window.trustedTypes;if(Pe)try{Ne=Pe.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Fe=Ne?e=>Ne.createHTML(e):e=>e,Ie=`http://www.w3.org/2000/svg`,Le=`http://www.w3.org/1998/Math/MathML`,R=typeof document<`u`?document:null,Re=R&&R.createElement(`template`),ze={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`?R.createElementNS(Ie,e):t===`mathml`?R.createElementNS(Le,e):n?R.createElement(e,{is:n}):R.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>R.createTextNode(e),createComment:e=>R.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>R.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{Re.innerHTML=Fe(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Re.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]}},z=`transition`,Be=`animation`,Ve=Symbol(`_vtc`),He={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},Ue=y({},xe,He),We=(e=>(e.displayName=`Transition`,e.props=Ue,e))((e,{slots:t})=>E(he,qe(e),t)),Ge=(e,t=[])=>{L(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ke=e=>e?L(e)?e.some(e=>e.length>1):e.length>1:!1;function qe(e){let t={};for(let n in e)n in He||(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=Je(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:b,onLeave:x,onLeaveCancelled:ee,onBeforeAppear:te=_,onAppear:S=v,onAppearCancelled:C=b}=t,w=(e,t,n,r)=>{e._enterCancelled=r,V(e,t?u:s),V(e,t?l:o),n&&n()},ne=(e,t)=>{e._isLeaving=!1,V(e,d),V(e,p),V(e,f),t&&t()},T=e=>(t,n)=>{let i=e?S:v,o=()=>w(t,e,n);Ge(i,[t,o]),Xe(()=>{V(t,e?c:a),B(t,e?u:s),Ke(i)||Qe(t,r,h,o)})};return y(t,{onBeforeEnter(e){Ge(_,[e]),B(e,a),B(e,o)},onBeforeAppear(e){Ge(te,[e]),B(e,c),B(e,l)},onEnter:T(!1),onAppear:T(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ne(e,t);B(e,d),e._enterCancelled?(B(e,f),nt(e)):(nt(e),B(e,f)),Xe(()=>{e._isLeaving&&(V(e,d),B(e,p),Ke(x)||Qe(e,r,g,n))}),Ge(x,[e,n])},onEnterCancelled(e){w(e,!1,void 0,!0),Ge(b,[e])},onAppearCancelled(e){w(e,!0,void 0,!0),Ge(C,[e])},onLeaveCancelled(e){ne(e),Ge(ee,[e])}})}function Je(e){if(e==null)return null;if(u(e))return[Ye(e.enter),Ye(e.leave)];{let t=Ye(e);return[t,t]}}function Ye(e){return ce(e)}function B(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Ve]||(e[Ve]=new Set)).add(t)}function V(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Ve];n&&(n.delete(t),n.size||(e[Ve]=void 0))}function Xe(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ze=0;function Qe(e,t,n,r){let i=e._endId=++Ze,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=$e(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 $e(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${z}Delay`),a=r(`${z}Duration`),o=et(i,a),s=r(`${Be}Delay`),c=r(`${Be}Duration`),l=et(s,c),u=null,d=0,f=0;t===z?o>0&&(u=z,d=o,f=a.length):t===Be?l>0&&(u=Be,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?z:Be:null,f=u?u===z?a.length:c.length:0);let p=u===z&&/\b(?:transform|all)(?:,|$)/.test(r(`${z}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function et(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)Line truncated
`))),e[W]=U(i);let a=r||i.props&&i.props.type===`number`;H(e,t?`change`:`input`,t=>{t.target.composing||e[W](on(e.value,n,a))}),(n||a)&&H(e,`change`,()=>{e.value=on(e.value,n,a)}),t||(H(e,`compositionstart`,nn),H(e,`compositionend`,rn),H(e,`change`,rn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[an];delete e[an],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[W](on(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[W]=U(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?j(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},cn={deep:!0,created(e,t,n){e[W]=U(n),H(e,`change`,()=>{let t=e._modelValue,n=mn(e),r=e.checked,i=e[W];if(L(t)){let e=k(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(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(hn(e,r))})},mounted:ln,beforeUpdate(e,t,n){e[W]=U(n),ln(e,t,n)}};function ln(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(L(t))i=k(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=A(t,hn(e,!0))}e.checked!==i&&(e.checked=i)}var un={created(e,{value:t},n){e.checked=A(t,n.props.value),e[W]=U(n),H(e,`change`,()=>{e[W](mn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[W]=U(r),t!==n&&(e.checked=A(t,r.props.value))}},dn={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,H(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?j(mn(e)):mn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?L(i)?t.slice():t:i];try{e[W](i)}finally{ge(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[W]=U(r)},mounted(e,{value:t}){pn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[W]=U(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!fn(t,n[1],n[0]))&&pn(e,t)}};function fn(e,t,n){if(!n||L(e))return A(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function pn(e,t){let n=e.multiple,r=L(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=mn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):k(t,o)>-1}else a.selected=t.has(o)}else if(A(mn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function mn(e){return`_value`in e?e._value:e.value}function hn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var gn={created(e,t,n){vn(e,t,n,null,`created`)},mounted(e,t,n){vn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){vn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){vn(e,t,n,r,`updated`)}};function _n(e,t){switch(e){case`SELECT`:return dn;case`TEXTAREA`:return sn;default:switch(t){case`checkbox`:return cn;case`radio`:return un;default:return sn}}}function vn(e,t,n,r,i){let a=_n(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function yn(){sn.getSSRProps=({value:e})=>({value:e}),un.getSSRProps=({value:e},t)=>{if(t.props&&A(t.props.value,e))return{checked:!0}},cn.getSSRProps=({value:e},t)=>{if(L(e)){if(t.props&&k(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},gn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=_n(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var bn=[`ctrl`,`shift`,`alt`,`meta`],xn={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)=>bn.some(n=>e[`${n}Key`]&&!t.includes(n))},Sn=(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=xn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Cn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},wn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||Cn[e]===r))return e(n)}))},Tn=y({patchProp:Ft},ze),En,Dn=!1;function On(){return En||=Te(Tn)}function kn(){return En=Dn?En:te(Tn),Dn=!0,En}var An=((...e)=>{On().render(...e)}),jn=((...e)=>{kn().hydrate(...e)}),Mn=((...e)=>{let t=On().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=Fn(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Pn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),Nn=((...e)=>{let t=kn().createApp(...e),{mount: Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ti;function Ei(e){Ti=e}var Di=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Oi(e){let t=e instanceof Di?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 ki(e,t){let n=await fetch(e,t);if(Ti?.(n.status===401),!n.ok)throw new Di(await wi(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Ci,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 ki(e,s);return a?await c.json():void 0}var Ai={health:()=>$(`/health/detailed`),services:()=>$(`/api/services`),policies:()=>$(`/api/access/policies`),putPolicy:e=>$(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>$(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>$(`/api/orgs`),orgCreate:e=>$(`/api/orgs`,{method:`POST`,body:e}),org:e=>$(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Q({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>$(`/api/alerts`),dismissAlert:e=>$(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>$(`/api/identities`),identityCreate:e=>$(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>$(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await ki(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Ci)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+Q(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Q(t)),taskAction:(e,t,n)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workflowEnabled:(e,t)=>$(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Q(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>$(`/api/version`),updateSnapshot:()=>$(`/api/chat/update`),updateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),updateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>$(`/api/captures`+Q({limit:e})),eventTypes:e=>$(`/api/event-types`+Q({workspace:e})),eventTypeCreate:e=>$(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:e=>$(`/api/mappings`+Q({workspace:e})),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:e=>$(`/api/bindings`+Q({workspace:e})),dispatches:(e,t)=>$(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>$(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),bindingPause: Line truncated
-3
View File
@@ -1,3 +0,0 @@
import{$n as e,A as t,An as n,Bn as r,Bt as i,Dn as a,En as o,Et as s,Fn as c,Gn as l,Hn as u,In as d,Jn as f,Jt as p,Kn as m,Ln as h,Mn as g,Nn as ee,O as te,Pn as _,Qn as v,R as y,Rn as ne,S as re,Sn as b,St as x,U as ie,Un as ae,Ut as S,V as oe,Vn as se,Wn as C,Xn as w,Y as T,Yn as E,Zn as ce,_ as D,_n as le,dn as ue,g as de,ht as fe,i as O,ir as k,jn as pe,kn as A,kt as j,l as me,lt as he,m as ge,mn as _e,mt as ve,n as ye,nt as be,on as xe,ot as Se,pt as Ce,qn as M,r as we,s as Te,tt as Ee,w as De,wn as Oe,xn as ke,y as Ae,yt as je,z as Me,zn as N}from"./PageHeader.js";var Ne=void 0,Pe=typeof window<`u`&&window.trustedTypes;if(Pe)try{Ne=Pe.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Fe=Ne?e=>Ne.createHTML(e):e=>e,Ie=`http://www.w3.org/2000/svg`,Le=`http://www.w3.org/1998/Math/MathML`,P=typeof document<`u`?document:null,Re=P&&P.createElement(`template`),ze={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`?P.createElementNS(Ie,e):t===`mathml`?P.createElementNS(Le,e):n?P.createElement(e,{is:n}):P.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>P.createTextNode(e),createComment:e=>P.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>P.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{Re.innerHTML=Fe(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Re.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]}},F=`transition`,Be=`animation`,Ve=Symbol(`_vtc`),He={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},Ue=_({},we,He),We=(e=>(e.displayName=`Transition`,e.props=Ue,e))((e,{slots:t})=>oe(ye,Ke(e),t)),I=(e,t=[])=>{N(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ge=e=>e?N(e)?e.some(e=>e.length>1):e.length>1:!1;function Ke(e){let t={};for(let n in e)n in He||(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=qe(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:ee,onEnter:te,onEnterCancelled:v,onLeave:y,onLeaveCancelled:ne,onBeforeAppear:re=ee,onAppear:b=te,onAppearCancelled:x=v}=t,ie=(e,t,n,r)=>{e._enterCancelled=r,R(e,t?u:s),R(e,t?l:o),n&&n()},ae=(e,t)=>{e._isLeaving=!1,R(e,d),R(e,p),R(e,f),t&&t()},S=e=>(t,n)=>{let i=e?b:te,o=()=>ie(t,e,n);I(i,[t,o]),Ye(()=>{R(t,e?c:a),L(t,e?u:s),Ge(i)||Ze(t,r,h,o)})};return _(t,{onBeforeEnter(e){I(ee,[e]),L(e,a),L(e,o)},onBeforeAppear(e){I(re,[e]),L(e,c),L(e,l)},onEnter:S(!1),onAppear:S(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ae(e,t);L(e,d),e._enterCancelled?(L(e,f),tt(e)):(tt(e),L(e,f)),Ye(()=>{e._isLeaving&&(R(e,d),L(e,p),Ge(y)||Ze(e,r,g,n))}),I(y,[e,n])},onEnterCancelled(e){ie(e,!1,void 0,!0),I(v,[e])},onAppearCancelled(e){ie(e,!0,void 0,!0),I(x,[e])},onLeaveCancelled(e){ae(e),I(ne,[e])}})}function qe(e){if(e==null)return null;if(u(e))return[Je(e.enter),Je(e.leave)];{let t=Je(e);return[t,t]}}function Je(e){return k(e)}function L(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Ve]||(e[Ve]=new Set)).add(t)}function R(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Ve];n&&(n.delete(t),n.size||(e[Ve]=void 0))}function Ye(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Xe=0;function Ze(e,t,n,r){let i=e._endId=++Xe,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Qe(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 Qe(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${F}Delay`),a=r(`${F}Duration`),o=$e(i,a),s=r(`${Be}Delay`),c=r(`${Be}Duration`),l=$e(s,c),u=null,d=0,f=0;t===F?o>0&&(u=F,d=o,f=a.length):t===Be?l>0&&(u=Be,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?F:Be:null,f=u?u===F?a.length:c.length:0);let p=u===F&&/\b(?:transform|all)(?:,|$)/.test(r(`${F}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function $e(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>et(t)+et(e[n])))}function eLine truncated
`))),e[V]=B(i);let a=r||i.props&&i.props.type===`number`;z(e,t?`change`:`input`,t=>{t.target.composing||e[V](an(e.value,n,a))}),(n||a)&&z(e,`change`,()=>{e.value=an(e.value,n,a)}),t||(z(e,`compositionstart`,tn),z(e,`compositionend`,nn),z(e,`change`,nn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[rn];delete e[rn],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[V](an(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[V]=B(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},sn={deep:!0,created(e,t,n){e[V]=B(n),z(e,`change`,()=>{let t=e._modelValue,n=pn(e),r=e.checked,i=e[V];if(N(t)){let e=w(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(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(mn(e,r))})},mounted:cn,beforeUpdate(e,t,n){e[V]=B(n),cn(e,t,n)}};function cn(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(N(t))i=w(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=E(t,mn(e,!0))}e.checked!==i&&(e.checked=i)}var ln={created(e,{value:t},n){e.checked=E(t,n.props.value),e[V]=B(n),z(e,`change`,()=>{e[V](pn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[V]=B(r),t!==n&&(e.checked=E(t,r.props.value))}},un={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,z(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce(pn(e)):pn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?N(i)?t.slice():t:i];try{e[V](i)}finally{be(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[V]=B(r)},mounted(e,{value:t}){fn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[V]=B(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!dn(t,n[1],n[0]))&&fn(e,t)}};function dn(e,t,n){if(!n||N(e))return E(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function fn(e,t){let n=e.multiple,r=N(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=pn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):w(t,o)>-1}else a.selected=t.has(o)}else if(E(pn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function pn(e){return`_value`in e?e._value:e.value}function mn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var hn={created(e,t,n){_n(e,t,n,null,`created`)},mounted(e,t,n){_n(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){_n(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){_n(e,t,n,r,`updated`)}};function gn(e,t){switch(e){case`SELECT`:return un;case`TEXTAREA`:return on;default:switch(t){case`checkbox`:return sn;case`radio`:return ln;default:return on}}}function _n(e,t,n,r,i){let a=gn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function vn(){on.getSSRProps=({value:e})=>({value:e}),ln.getSSRProps=({value:e},t)=>{if(t.props&&E(t.props.value,e))return{checked:!0}},sn.getSSRProps=({value:e},t)=>{if(N(e)){if(t.props&&w(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},hn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=gn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var yn=[`ctrl`,`shift`,`alt`,`meta`],bn={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)=>yn.some(n=>e[`${n}Key`]&&!t.includes(n))},xn=(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=bn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Sn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Cn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||Sn[e]===r))return e(n)}))},wn=_({patchProp:Pt},ze),Tn,En=!1;function Dn(){return Tn||=De(wn)}function On(){return Tn=En?Tn:re(wn),En=!0,Tn}var kn=((...e)=>{Dn().render(...e)}),An=((...e)=>{On().hydrate(...e)}),jn=((...e)=>{let t=Dn().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=Pn(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Nn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),Mn=((...e)=>{let t=On().createApp(...e),{moun Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var ui;function di(e){ui=e}var fi=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function pi(e){let t=e instanceof fi?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 mi(e,t){let n=await fetch(e,t);if(ui?.(n.status===401),!n.ok)throw new fi(await li(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=ci,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 mi(e,s);return a?await c.json():void 0}var hi={health:()=>$(`/health/detailed`),services:()=>$(`/api/services`),policies:()=>$(`/api/access/policies`),putPolicy:e=>$(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>$(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>$(`/api/orgs`),orgCreate:e=>$(`/api/orgs`,{method:`POST`,body:e}),org:e=>$(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Q({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>$(`/api/alerts`),dismissAlert:e=>$(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await mi(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(ci)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+Q(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Q(t)),taskAction:(e,t,n)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workflowEnabled:(e,t)=>$(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Q(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>$(`/api/version`),updateSnapshot:()=>$(`/api/chat/update`),updateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),updateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>$(`/api/captures`+Q({limit:e})),eventTypes:e=>$(`/api/event-types`+Q({workspace:e})),eventTypeCreate:e=>$(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:e=>$(`/api/mappings`+Q({workspace:e})),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:e=>$(`/api/bindings`+Q({workspace:e})),dispatches:(e,t)=>$(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>$(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),bindingPause:e=>$(`/api/bindings/${encodeURIComponent(e)}/pause`,{method:`POST`}),bindingResume:e=>$(`/api/bindings/${encodeURIComponent(e)}/resume`,{method:`POST`}),harnessBindings:()=>$(`/api/harness/bindings`),sources:e=>$(`/apLine truncated
+1 -1
View File
@@ -1 +1 @@
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-flow-edge.trace-ok path{stroke:var(--color-ok)}.workflow-flow-edge.trace-failed path{stroke:var(--color-danger)}.workflow-flow-edge.trace-interrupted path{stroke:var(--color-warn)}.workflow-flow-edge.trace-running path{stroke:var(--color-info);stroke-dasharray:6 4;animation:.8s linear infinite edge-trace}@keyframes edge-trace{to{stroke-dashoffset:-10px}}@media (prefers-reduced-motion:reduce){.workflow-flow-edge.trace-running path,.step-running{animation:none}}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reLine truncated
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-flow-edge.trace-ok path{stroke:var(--color-ok)}.workflow-flow-edge.trace-failed path{stroke:var(--color-danger)}.workflow-flow-edge.trace-interrupted path{stroke:var(--color-warn)}.workflow-flow-edge.trace-running path{stroke:var(--color-info);stroke-dasharray:6 4;animation:.8s linear infinite edge-trace}@keyframes edge-trace{to{stroke-dashoffset:-10px}}@media (prefers-reduced-motion:reduce){.workflow-flow-edge.trace-running path,.step-running{animation:none}}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reLine truncated
+70 -70
View File
@@ -1,68 +1,68 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage.js","assets/HistoryLink.js","assets/PageHeader.js","assets/badge.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/HarnessPage.js","assets/HarnessPage.css","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as ee,a as D,at as te,b as ne,c as re,ct as ie,d as ae,et as oe,f as se,g as ce,h as le,i as ue,it as de,j as fe,k as pe,l as me,lt as he,m as ge,n as _e,nt as ve,o as ye,ot as be,p as xe,q as Se,r as Ce,rt as we,s as Te,st as Ee,t as De,tt as Oe,u as ke,ut as Ae,v as O,w as je,x as Me,y as Ne,z as Pe}from"./HistoryLink.js";import{$ as Fe,A as k,B as Ie,C as Le,Ct as Re,D as A,Dn as ze,En as Be,Ft as Ve,It as He,Jt as j,Mt as Ue,O as M,Pt as We,Qn as N,R as Ge,Rt as Ke,Sn as qe,St as P,Tn as Je,Tt as Ye,Ut as F,V as Xe,Wt as Ze,X as Qe,Xt as $e,Y as et,_ as I,_n as tt,_t as nt,an as rt,at as it,b as L,bn as at,d as ot,dn as st,er as ct,et as lt,ht as R,it as ut,kn as z,lt as B,mn as dt,nr as V,nt as ft,on as pt,pn as mt,pt as ht,rn as gt,s as H,t as _t,tr as vt,tt as U,v as W,vn as yt,wn as bt,x as G,xt as K,y as q,yn as J,zt as xt}from"./PageHeader.js";import{A as St,D as Ct,E as Y,J as wt,K as Tt,U as Et,X as Dt,Y as Ot,_ as kt,b as X,d as At,g as jt,i as Mt,m as Nt,n as Pt,q as Ft,r as Z,t as It,w as Lt,x as Rt,y as zt}from"./badge.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Bt=Ee({name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]}),Vt=Ee({name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]}),Ht=Ee({name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]}),Ut=Ee({name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]}),Wt=Ee({name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]}),Gt=Ee({name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]}),Kt=Ee({name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]}),qt=Ee({name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]}),Jt=Ee({name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]}),Yt=Ee({name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]}),Xt=Ee({name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]}),Zt=Ee({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),Qt=Ee({name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}),$t=Ee({name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}),en=Ee({name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}),tn=Ee({name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]}),nn=Ee({name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]}),rn=Ee({name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),an=Ee({nLine truncated
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage.js","assets/HistoryLink.js","assets/PageHeader.js","assets/alert.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/HarnessPage.js","assets/HarnessPage.css","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as ee,Z as T,_ as te,a as E,b as ne,c as D,d as re,et as O,f as ie,g as ae,h as k,i as oe,j as se,k as ce,l as le,m as ue,n as de,nt as fe,o as pe,p as me,q as he,r as ge,rt as _e,s as ve,t as ye,tt as be,u as xe,v as Se,w as Ce,x as we,y as Te,z as Ee}from"./HistoryLink.js";import{$ as De,A,B as Oe,C as ke,Ct as Ae,D as j,Dn as je,En as Me,Ft as Ne,It as Pe,Jt as M,Kt as Fe,Mt as Ie,O as N,Pt as Le,Qn as P,R as Re,Rt as ze,Sn as Be,St as F,Tn as Ve,Tt as He,Ut as I,V as Ue,Wt as We,X as Ge,Xt as Ke,Y as qe,Zt as Je,_ as L,_n as Ye,_t as Xe,an as Ze,at as Qe,b as R,bn as $e,d as et,dn as tt,er as nt,et as rt,ht as z,it,kn as B,lt as V,mn as at,nr as H,nt as ot,on as st,pn as ct,pt as lt,rn as ut,s as U,t as dt,tr as ft,tt as W,v as G,vn as pt,wn as mt,x as K,xt as q,y as J,yn as Y,zt as ht}from"./PageHeader.js";import{E as gt,G as _t,J as vt,K as yt,S as bt,T as xt,Y as St,_ as Ct,a as wt,c as Tt,d as Et,f as Dt,h as Ot,i as kt,k as At,l as jt,m as Mt,n as Nt,o as X,p as Pt,q as Ft,r as It,s as Lt,t as Rt,u as zt,v as Z,w as Q,y as Bt}from"./alert.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Vt=xt({name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]}),Ht=xt({name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]}),Ut=xt({name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]}),Wt=xt({name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]}),Gt=xt({name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]}),Kt=xt({name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]}),qt=xt({name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]}),Jt=xt({name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]}),Yt=xt({name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]}),Xt=xt({name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]}),Zt=xt({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),Qt=xt({name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}),$t=xt({name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}),en=xt({name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}),tn=xt({name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]}),nn=xt({name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]}),rn=xt({name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),an=xt({name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.8 Line truncated
`);d=n.pop()||``;for(let e of n){let t=e.split(`
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(fr.value=n.session_id),n.type===`delta`&&(o+=n.text,_r.value=_r.value?{..._r.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],_r.value=_r.value?{..._r.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),_r.value=_r.value?{..._r.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`);pr.value=[...pr.value,{from:`assistant`,text:o,tool_calls:a}],_r.value=null,hr.value=`Ready`,await Mr()}catch(e){let t=e;t.name===`AbortError`&&!c?(_r.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},hr.value=`Stopped`):(_r.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?ar(r):void 0,isRetry:i},hr.value=`Error — retry available`)}finally{clearTimeout(l),lr=null,Ar=null,gr.value=!1}}function Gr(){hr.value=`Stopping…`,fr.value&&X.chatCancel(fr.value).catch(()=>{}),jr()}function Kr(){B(()=>{Mr().catch(e=>{hr.value=e.message||`Chat unavailable`})}),ht(()=>{jr()})}async function qr(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 Wr({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var Jr=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Yr=k({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return Y(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(R(),G(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":z(sr),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:N(r(!e.open))},[M(z(vn),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:N(r(e.open))},[M(z(Yn),{size:22})],2)],8,Jr))}});function Xr(e){return typeof e==`string`?`'${e}'`:new ei().serialize(e)}var Zr=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Qr=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Zr.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function $r(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Qr[n]?Qr[n]:n+128,s=a<128&&Qr[a]?Qr[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var ei=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?$r(e,t):n===`number`&&r===`number`?e-t:$r(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort($r),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$ArrLine truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(ur.value=n.session_id),n.type===`delta`&&(o+=n.text,hr.value=hr.value?{...hr.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],hr.value=hr.value?{...hr.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),hr.value=hr.value?{...hr.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`);dr.value=[...dr.value,{from:`assistant`,text:o,tool_calls:a}],hr.value=null,pr.value=`Ready`,await Ar()}catch(e){let t=e;t.name===`AbortError`&&!c?(hr.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},pr.value=`Stopped`):(hr.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?rr(r):void 0,isRetry:i},pr.value=`Error. Retry available.`)}finally{clearTimeout(l),sr=null,Or=null,mr.value=!1}}function Ur(){pr.value=`Stopping…`,ur.value&&Z.chatCancel(ur.value).catch(()=>{}),kr()}function Wr(){V(()=>{Ar().catch(e=>{pr.value=e.message||`Chat unavailable`})}),lt(()=>{kr()})}async function Gr(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 Hr({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var Kr=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],qr=A({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return Q(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(z(),K(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":B(ar),onClick:i[0]||=e=>n(`toggle`)},[G(`span`,{"aria-hidden":`true`,class:P(r(!e.open))},[N(B(vn),{size:22})],2),G(`span`,{"aria-hidden":`true`,class:P(r(e.open))},[N(B(qn),{size:22})],2)],8,Kr))}});function Jr(e){return typeof e==`string`?`'${e}'`:new Qr().serialize(e)}var Yr=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Xr=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Yr.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Zr(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Xr[n]?Xr[n]:n+128,s=a<128&&Xr[a]?Xr[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var Qr=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Zr(e,t):n===`number`&&r===`number`?e-t:Zr(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Zr),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$ArrayLine truncated
- a positive number
- less than the value passed to \`max\` (or ${As} if no \`max\` prop is set)
- less than the value passed to \`max\` (or ${qs} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`),null)}function Fs(e){return Ns(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${As}\`.`),As)}var Is=k({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:As},getValueLabel:{type:Function,required:!1,default:(e,t)=>Ns(e)?`${Math.round(e/t*As)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;v();let i=T(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=T(n,`max`,r,{passive:n.max===void 0});F(()=>i.value,async e=>{let t=Ps(e,n.max);t!==e&&(await ft(),i.value=t)},{immediate:!0}),F(()=>n.max,e=>{let t=Fs(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=I(()=>ai(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Ms({modelValue:i,max:a,progressState:o}),(t,n)=>(R(),q(z(jt),{"as-child":e.asChild,as:e.as,"aria-valuemax":z(a),"aria-valuemin":0,"aria-valuenow":Ns(z(i))?z(i):void 0,"aria-valuetext":e.getValueText?.(z(i),z(a)),"aria-label":e.getValueLabel(z(i),z(a)),role:`progressbar`,"data-state":o.value,"data-value":z(i)??void 0,"data-max":z(a)},{default:j(()=>[P(t.$slots,`default`,{modelValue:z(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),Ls=k({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=js();return v(),(e,r)=>(R(),q(z(jt),U(t,{"data-state":z(n).progressState.value,"data-value":z(n).modelValue?.value??void 0,"data-max":z(n).max.value}),{default:j(()=>[P(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),Rs=`radio.select`;function zs(e,t,n){de(Rs,n,{originalEvent:e,value:t})}var Bs=k({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=T(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=Be(n),{forwardRef:o,currentElement:s}=v(),c=mi(s),l=hi(),u=I(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||zs(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(t,n)=>(R(),G(H,null,[M(z(jt),U({id:e.id,ref:z(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":z(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":z(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:z(a),required:e.required,name:e.name},{...z(l),...t.$attrs},{onClick:Dt(d,[`stop`])}),{default:j(()=>[P(t.$slots,`default`,{checked:z(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),z(c)&&e.name?(R(),q(z(Ia),U({key:0,type:`radio`,tabindex:`-1`,value:z(a),checked:!!z(i),name:e.name,disabled:e.disabled,required:e.required},z(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):L(`v-if`,!0)],64))}}),[Vs,Hs]=be(`RadioGroupRoot`),Us=k({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=v(),o=T(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=Be(n),p=S(f),m=mi(a);return Hs({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(t,n)=>(R(),q(z(no),{"as-child":``,orientation:z(l),dir:z(p),loop:z(c)},{default:j(()=>[M(z(jt),{ref:z(i),role:`radiogroup`,"data-disabled":z(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":z(l),"aria-required":z(d),dir:z(p)},{default:j(()=>[P(t.$slots,`default`,{modelValue:z(o)}),z(m)&&z(u)?(R(),q(z(Ia),{key:0,required:z(d),disabled:z(s),value:z(o),name:z(u)},null,8,[`required`,`disabled`,`value`,`name`])):L(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Ws,Gs]=be(`RadioGroupItem`),Ks=k({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,reqLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:md(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>md(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=gd(c),u=e+1<n.length?gd(n[e+1]):null;if(l&&u&&_d(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=gd(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>md(e)),rows:r.map(e=>e.map(e=>md(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:md(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:md(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function gd(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 _d(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var vd={class:`[overflow-wrap:anywhere]`},yd={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},bd={class:`font-mono text-[0.85em]`},xd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Sd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Cd={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},wd={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Td={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Ed={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Dd={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Od={key:8,class:`mb-2.5 last:mb-0`},kd=k({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=I(()=>hd(t.text));return(e,t)=>(R(),G(`div`,vd,[(R(!0),G(H,null,K(n.value,(e,t)=>(R(),G(H,{key:t},[e.kind===`pre`?(R(),G(`pre`,yd,[W(`code`,bd,V(e.code),1)])):e.kind===`table`?(R(),G(`table`,xd,[W(`thead`,null,[W(`tr`,null,[(R(!0),G(H,null,K(e.head,(e,t)=>(R(),G(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[M(fd,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(R(!0),G(H,null,K(e.rows,(e,t)=>(R(),G(`tr`,{key:t},[(R(!0),G(H,null,K(e,(e,t)=>(R(),G(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[M(fd,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(R(),G(`blockquote`,Sd,[M(fd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(R(),G(`h1`,Cd,[M(fd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(R(),G(`h2`,wd,[M(fd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(R(),G(`h3`,Td,[M(fd,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(R(),G(`ul`,Ed,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(fd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(R(),G(`ol`,Dd,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(fd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(R(),G(`p`,Od,[M(fd,{inline:e.inline},null,8,[`inline`])])):L(``,!0)],64))),128))]))}}),Ad={class:`truncate`},jd=k({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Re(`RouterLink`);return R(),q(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:j(()=>[M(z(Wt),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,Ad,V(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Md={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Nd={class:`font-semibold text-foreground`},Pd={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Fd=k({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=I(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=I(()=>t.tool.parameters||t.tool.Parameters||``),i=I(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=I(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(R(),q(jd,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(R(),G(`div`,Md,[M(z(Jn),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Nd,V(n.value),1),r.value?(R(),G(`code`,Pd,V(r.value),1)):L(``,!0),W(`span`,{class:N(z(Y)(`text-fg-muted`,i.value&&`text-danger`))},V(a.value),3)]))}}),Id={key:0,class:`mb-2 grid gap-0.5 text-xs`},Ld={key:1,class:`mb-2 flex flex-wrap gap-1.5`},Rd={key:3,class:`whitespace-pre-wrap`},zd=k({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(R(),G(`div`,{class:N([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:N(z(Y)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(R(),G(`div`,Id,[(R(!0),G(H,null,K(e.tools,(t,n)=>(R(),q(Fd,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):L(``,!0),e.media.length?(R(),G(`div`,Ld,[(R(!0),G(H,null,K(e.media,(e,t)=>(R(),q(ad,{key:t,attachment:e},null,8,[`attachment`]))),128))])):L(``,!0),e.assistant?(R(),q(kd,{key:2,text:e.text},null,8,[`text`])):(R(),G(`div`,Rd,V(e.text),1)),P(t.$slots,`default`)],2)],2))}}),Bd={class:`text-sm`},Vd={class:`font-medium`},Hd={key:0,class:`mt-1 text-fg-muted`},Ud={key:1,class:`mt-2 flex flex-wrap gap-2`},Wd=k({__name:`ChatChLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>$g?`${n.slice(0,$g).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var t_=[`title`],n_=k({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>Eg(n.event)),a=I(()=>e_(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=I(()=>n.event.at?Oh(n.event.at):`—`);return(e,t)=>(R(),q(z(Xg),{class:N(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[Ot(Dt(o,[`prevent`]),[`enter`]),Ot(Dt(o,[`prevent`]),[`space`])]},{default:j(()=>[M(z($),{class:`font-medium`},{default:j(()=>[A(V(n.event.kind||n.event.type||`event`),1)]),_:1}),M(z($),{class:`font-mono`},{default:j(()=>[A(V(i.value>0?`#${i.value}`:`—`),1)]),_:1}),M(z($),{class:`w-[55%] max-w-0`},{default:j(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},V(a.value.text),9,t_)]),_:1}),M(z($),null,{default:j(()=>[A(V(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),r_=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function i_(e){return(Number(e?.task_id)||0)>0}function a_(e,t){return t===`tasks`?i_(e):t!==`system`||!i_(e)}function o_(e,t){return e.filter(e=>a_(e,t))}function s_(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function c_(e,t){return`${e}:${t??0}`}function l_(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=c_(e_(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 u_={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},d_={class:`max-h-[28rem] overflow-y-auto`},f_=[`aria-expanded`,`aria-label`,`onClick`],p_=[`title`],m_=k({__name:`LiveActivityCard`,setup(e){let t=jf(),{activity:n,streamKind:r,streamState:i}=Ae(ee()),a=J(`all`),o=I(()=>o_(n.value,a.value)),s=I(()=>s_(o.value.length,a.value)),c=tt(new Set),l=I(()=>l_(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return e_(e.representative)}function p(e){return e.representative.at?Oh(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(R(),q(z(xh),null,{default:j(()=>[M(z(Eh),null,{default:j(()=>[M(z(Dh),null,{default:j(()=>[...t[1]||=[A(`Live activity`,-1)]]),_:1}),M(z(Sh),{class:`flex items-center gap-2`},{default:j(()=>[M(z(Kg),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:z(r_)},null,8,[`modelValue`,`options`]),M(z(It),{variant:z(r)},{default:j(()=>[A(V(z(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),M(z(Ch),null,{default:j(()=>[W(`div`,u_,[W(`div`,d_,[M(z(Jg),null,{default:j(()=>[M(z(Qg),{class:`sticky top-0 z-10 bg-card`},{default:j(()=>[M(z(Xg),null,{default:j(()=>[M(z(Zg),null,{default:j(()=>[...t[2]||=[A(`Event`,-1)]]),_:1}),M(z(Zg),null,{default:j(()=>[...t[3]||=[A(`Task`,-1)]]),_:1}),M(z(Zg),null,{default:j(()=>[...t[4]||=[A(`Detail`,-1)]]),_:1}),M(z(Zg),null,{default:j(()=>[...t[5]||=[A(`When`,-1)]]),_:1})]),_:1})]),_:1}),M(z(Yg),null,{default:j(()=>[o.value.length?L(``,!0):(R(),q(z(Xg),{key:0},{default:j(()=>[M(z($),{colspan:`4`},{default:j(()=>[M(z(fh),null,{default:j(()=>[M(z(hh),null,{default:j(()=>[M(z(vh),null,{default:j(()=>[A(V(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(R(!0),G(H,{key:1},K(l.value,e=>(R(),G(H,{key:e.key},[e.count===1?(R(),q(n_,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(R(),G(H,{key:1},[M(z(Xg),{class:N(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[Ot(Dt(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Ot(Dt(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:j(()=>[M(z($),{class:`font-medium`},{default:j(()=>[W(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:Dt(t=>u(e.key),[`stop`])},[d(e)?(R(),q(z(Qt),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(R(),q(z($t),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),A(` `+V(e.label)+` `,1),M(z(It),{variant:`idle`},{default:j(()=>[A(`×`+V(e.count),1)]),_:2},1024)],8,f_)]),_:2},1024),M(z($),{class:`font-mono`},{default:j(()=>[A(V(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),M(z($),{class:`w-[55%] max-w-0`},{default:j(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},V(f(e).text),9,p_)]),_:2},1024),M(z($),null,{default:j(()=>[A(V(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(R(!0),G(H,{key:0},K(e.events,(t,n)=>(R(),q(n_,{key:`${e.key}:${n}`,event:t,onOpen:m},null Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function Fv(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 Iv(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 Lv(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 Rv(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 zv=J([]),Bv=J([]),Vv=J(!0),Hv=J(null),Uv=J(null),Wv=J(!1),Gv=J(null);async function Kv(){try{let e=await X.eventTypes(Nv.value);Vv.value=e.enabled!==!1,zv.value=e.event_types||[],Bv.value=e.proposals||[],Hv.value=null}catch(e){Hv.value=e.message||String(e)}}function qv(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Jv(e){Gv.value=null,Uv.value=e}function Yv(e){let t=ry.value.find(t=>String(t.id)===e.sample_id);Jv({mode:`proposal`,id:null,source:e.source,name:``,rule:qv(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function Xv(e=``){Jv({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function Zv(e){Jv({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:qv(e.rule),headersText:``,body:``,exampleHeaders:{}})}function Qv(){Uv.value=null}async function $v(){let e=Uv.value;if(e){Wv.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:Rv(e.rule)});else{let t=e.mode===`paste`?Pv(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:Rv(e.rule),example:{headers:t,body:e.body}})}Uv.value=null,await Kv()}catch(e){Gv.value=e.message||String(e)}finally{Wv.value=!1}}}var ey=J(null);async function ty(){let e=ey.value;if(ey.value=null,e)try{await X.eventTypeDelete(e.id),await Kv()}catch(e){Hv.value=e.message||String(e)}}var ny=100,ry=J([]),iy=J(!0),ay=J(null),oy=J(!0),sy=J(null);async function cy(){try{let e=await X.captures(ny);iy.value=e.enabled!==!1,ry.value=e.captures||[],ay.value=null}catch(e){ay.value=e.message||String(e)}finally{oy.value=!1}}function ly(e){let t=ry.value.find(t=>t.id===e);return t&&(sy.value=t),!!t}function uy(){ry.value.length&&(sy.value=ry.value[0])}function dy(){ce(`captures`,()=>{cy(),Kv()})}var fy=[`owner`,`admin`,`developer`,`viewer`],py=J([]),my=J(!1),hy=J(``),gy=J(null),_y=null;function vy(e=!1){return gy.value&&!e?Promise.resolve():_y||(_y=X.orgs().then(e=>{py.value=e.orgs,my.value=e.instance_admin,hy.value=e.current;let t=gy.value?.id??e.current;gy.value=e.orgs.find(e=>e.id===t)??e.orgs[0]??null}).finally(()=>{_y=null}),_y)}function yy(e){gy.value=py.value.find(t=>t.id===e)??gy.value}var by=gy,xy={key:0,class:`text-xs text-fg-muted`},Sy={key:1,class:`flex flex-col gap-1 text-xs`},Cy={key:1},wy={key:2,class:`text-xs text-fg-muted`},Ty=k({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=J([]),r=J(!1);F(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await X.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=Re(`RouterLink`);return r.value?(R(),G(`p`,xy,`Dispatches unavailable.`)):n.value.length?(R(),G(`ul`,Sy,[(R(!0),G(H,null,K(n.value,e=>(R(),G(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?L(``,!0):(R(),q(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:j(()=>[A(`binding `+V(e.binding_id.slice(0,8))+` v`+V(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?L(``,!0):(R(),q(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:j(()=>[A(`capture `+V(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?L(``,!0):(R(),G(H,{key:2},[e.task_id?(R(),q(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:j(()=>[A(`task #`+V(e.task_id),1)]),_:2},1032,[`to`])):(R(),G(`span`,Cy,V(e.reason||`claimed, no task recorded`),1))],64)),W(`span`,null,V(z(Oh)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?L(``,!0):(R(),G(`p`,wy,` No dispatches yet. `))}}}),Ey=k({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(R(),q(z(mn),{role:`status`,"aria-label":`Loading`,class:N(z(Y)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function Dy(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function Oy(e){return(e?.repository??`required`)!==`none`}function ky(e, Line truncated
`)}};sR.defaultYaml={explicit:!1,version:`1.2`},sR.defaultTags={"!!":`tag:yaml.org,2002:`};function cR(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 lR(e){let t=new Set;return eR(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function uR(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function dR(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=lR(e);let a=uR(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(KL(t.node)||JL(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 fR(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=fR(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=fR(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=fR(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=fR(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function pR(e,t,n){if(Array.isArray(e))return e.map((e,t)=>pR(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!XL(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 mR=class{constructor(e){Object.defineProperty(this,VL,{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(!UL(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=pR(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?fR(i,{"":o},``,o):o}},hR=class extends mR{constructor(e){super(FL),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=[],eR(e,{Node:(e,t)=>{(HL(t)||XL(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||=(pR(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=gR(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(cR(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 gR(e,t,n){if(HL(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(JL(t)){let r=0;for(let i of t.items){let t=gR(e,i,n);t>r&&(r=t)}return r}if(GL(t)){let r=gR(e,t.key,n),i=gR(e,t.value,n);return Math.max(r,i)}return 1}var _R=e=>!e||typeof e!=`function`&&typeof e!=`object`,vR=class extends mR{constructor(e){super(zL),this.value=e}toJSON(e,t){return t?.keep?this.value:pR(this.value,e,t)}toString(){return String(this.value)}};vR.BLOCK_FOLDED=`BLOCK_FOLDED`,vR.BLOCK_LITERAL=`BLOCK_LITERAL`,vR.PLAIN=`PLAIN`,vR.QUOTE_DOUBLE=`QUOTE_DOUBLE`,vR.QUOTE_SINGLE=`QUOTE_SINGLE`;var yR=`tag:yaml.org,2002:`;function bR(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 xR(e,t,n){if(UL(e)&&(e=e.contents),YL(e))return e;if(GL(e)){let t=n.schema[LL].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 hR(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=yR+t.slice(2));let l=bR(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new vR(e);return c&&(c.node=t),t Line truncated
`)?ER(n,t):n.includes(`
Defaulting to \`null\`.`),null)}function Qs(e){return Xs(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${qs}\`.`),qs)}var $s=A({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:qs},getValueLabel:{type:Function,required:!1,default:(e,t)=>Xs(e)?`${Math.round(e/t*qs)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;p();let i=x(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=x(n,`max`,r,{passive:n.max===void 0});I(()=>i.value,async e=>{let t=Zs(e,n.max);t!==e&&(await ot(),i.value=t)},{immediate:!0}),I(()=>n.max,e=>{let t=Qs(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=L(()=>ii(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Ys({modelValue:i,max:a,progressState:o}),(t,n)=>(z(),J(B(Mt),{"as-child":e.asChild,as:e.as,"aria-valuemax":B(a),"aria-valuemin":0,"aria-valuenow":Xs(B(i))?B(i):void 0,"aria-valuetext":e.getValueText?.(B(i),B(a)),"aria-label":e.getValueLabel(B(i),B(a)),role:`progressbar`,"data-state":o.value,"data-value":B(i)??void 0,"data-max":B(a)},{default:M(()=>[F(t.$slots,`default`,{modelValue:B(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),ec=A({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Js();return p(),(e,r)=>(z(),J(B(Mt),W(t,{"data-state":B(n).progressState.value,"data-value":B(n).modelValue?.value??void 0,"data-max":B(n).max.value}),{default:M(()=>[F(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),tc=`radio.select`;function nc(e,t,n){_(tc,n,{originalEvent:e,value:t})}var rc=A({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=x(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=Me(n),{forwardRef:o,currentElement:s}=p(),c=mi(s),l=hi(),u=L(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||nc(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(t,n)=>(z(),K(U,null,[N(B(Mt),W({id:e.id,ref:B(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":B(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":B(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:B(a),required:e.required,name:e.name},{...B(l),...t.$attrs},{onClick:St(d,[`stop`])}),{default:M(()=>[F(t.$slots,`default`,{checked:B(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),B(c)&&e.name?(z(),J(B(Ia),W({key:0,type:`radio`,tabindex:`-1`,value:B(a),checked:!!B(i),name:e.name,disabled:e.disabled,required:e.required},B(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):R(`v-if`,!0)],64))}}),[ic,ac]=O(`RadioGroupRoot`),oc=A({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=p(),s=x(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:c,loop:l,orientation:u,name:d,required:f,dir:m}=Me(n),h=o(m),g=mi(a);return ac({modelValue:s,changeModelValue:e=>{s.value=e},disabled:c,loop:l,orientation:u,name:d?.value,required:f}),(t,n)=>(z(),J(B(bo),{"as-child":``,orientation:B(u),dir:B(h),loop:B(l)},{default:M(()=>[N(B(Mt),{ref:B(i),role:`radiogroup`,"data-disabled":B(c)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":B(u),"aria-required":B(f),dir:B(h)},{default:M(()=>[F(t.$slots,`default`,{modelValue:B(s)}),B(g)&&B(d)?(z(),J(B(Ia),{key:0,required:B(f),disabled:B(c),value:B(s),name:B(d)},null,8,[`required`,`disabled`,`value`,`name`])):R(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[sc,cc]=O(`RadioGroupItem`),lc=A({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,requirLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:jd(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>jd(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=Nd(c),u=e+1<n.length?Nd(n[e+1]):null;if(l&&u&&Pd(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Nd(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>jd(e)),rows:r.map(e=>e.map(e=>jd(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:jd(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:jd(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function Nd(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 Pd(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Fd={class:`[overflow-wrap:anywhere]`},Id={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Ld={class:`font-mono text-[0.85em]`},Rd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},zd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Bd={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Vd={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Hd={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Ud={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Wd={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Gd={key:8,class:`mb-2.5 last:mb-0`},Kd=A({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=L(()=>Md(t.text));return(e,t)=>(z(),K(`div`,Fd,[(z(!0),K(U,null,q(n.value,(e,t)=>(z(),K(U,{key:t},[e.kind===`pre`?(z(),K(`pre`,Id,[G(`code`,Ld,H(e.code),1)])):e.kind===`table`?(z(),K(`table`,Rd,[G(`thead`,null,[G(`tr`,null,[(z(!0),K(U,null,q(e.head,(e,t)=>(z(),K(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[N(kd,{inline:e},null,8,[`inline`])]))),128))])]),G(`tbody`,null,[(z(!0),K(U,null,q(e.rows,(e,t)=>(z(),K(`tr`,{key:t},[(z(!0),K(U,null,q(e,(e,t)=>(z(),K(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[N(kd,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(z(),K(`blockquote`,zd,[N(kd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(z(),K(`h1`,Bd,[N(kd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(z(),K(`h2`,Vd,[N(kd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(z(),K(`h3`,Hd,[N(kd,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(z(),K(`ul`,Ud,[(z(!0),K(U,null,q(e.items,(e,t)=>(z(),K(`li`,{key:t},[N(kd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(z(),K(`ol`,Wd,[(z(!0),K(U,null,q(e.items,(e,t)=>(z(),K(`li`,{key:t},[N(kd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(z(),K(`p`,Gd,[N(kd,{inline:e.inline},null,8,[`inline`])])):R(``,!0)],64))),128))]))}}),qd={class:`truncate`},Jd=A({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Ae(`RouterLink`);return z(),J(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:M(()=>[N(B(Wt),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),G(`span`,qd,H(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Yd={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Xd={class:`font-semibold text-foreground`},Zd={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Qd=A({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=L(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=L(()=>t.tool.parameters||t.tool.Parameters||``),i=L(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=L(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(z(),J(Jd,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(z(),K(`div`,Yd,[N(B(Kn),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),G(`span`,Xd,H(n.value),1),r.value?(z(),K(`code`,Zd,H(r.value),1)):R(``,!0),G(`span`,{class:P(B(Q)(`text-fg-muted`,i.value&&`text-danger`))},H(a.value),3)]))}}),$d={key:0,class:`mb-2 grid gap-0.5 text-xs`},ef={key:1,class:`mb-2 flex flex-wrap gap-1.5`},tf={key:3,class:`whitespace-pre-wrap`},nf=A({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(z(),K(`div`,{class:P([`flex`,e.assistant?`justify-start`:`justify-end`])},[G(`div`,{class:P(B(Q)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(z(),K(`div`,$d,[(z(!0),K(U,null,q(e.tools,(t,n)=>(z(),J(Qd,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):R(``,!0),e.media.length?(z(),K(`div`,ef,[(z(!0),K(U,null,q(e.media,(e,t)=>(z(),J(Sd,{key:t,attachment:e},null,8,[`attachment`]))),128))])):R(``,!0),e.assistant?(z(),J(Kd,{key:2,text:e.text},null,8,[`text`])):(z(),K(`div`,tf,H(e.text),1)),F(t.$slots,`default`)],2)],2))}}),rf={class:`text-sm`},af={class:`font-medium`},of={key:0,class:`mt-1 text-fg-muted`},sf={key:1,class:`mt-2 flex flex-wrap gap-2`},cf=A({__name:`ChatChooLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>G_?`${n.slice(0,G_).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var q_=[`title`],J_=A({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=qg(),a=L(()=>i.taskIDFor(n.event)),o=L(()=>K_(n.event));function s(){a.value>0&&r(`open`,a.value)}let c=L(()=>n.event.at?Eg(n.event.at):`—`);return(e,t)=>(z(),J(B(H_),{class:P(a.value>0?`cursor-pointer`:``),role:a.value>0?`link`:void 0,tabindex:a.value>0?0:void 0,title:a.value>0?`Open task details`:void 0,onClick:s,onKeydown:[vt(St(s,[`prevent`]),[`enter`]),vt(St(s,[`prevent`]),[`space`])]},{default:M(()=>[N(B($),{class:`font-medium`},{default:M(()=>[j(H(n.event.kind||n.event.type||`event`),1)]),_:1}),N(B($),{class:`font-mono`},{default:M(()=>[j(H(a.value>0?`#${a.value}`:`—`),1)]),_:1}),N(B($),{class:`w-[55%] max-w-0`},{default:M(()=>[G(`span`,{class:`block truncate`,title:o.value.truncated?o.value.full:void 0},H(o.value.text),9,q_)]),_:1}),N(B($),null,{default:M(()=>[j(H(c.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Y_=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function X_(e){return(Number(e?.task_id)||0)>0}function Z_(e,t){return t===`tasks`?X_(e):t!==`system`||!X_(e)}function Q_(e,t){return e.filter(e=>Z_(e,t))}function $_(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function ev(e,t){return`${e}:${t??0}`}function tv(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=ev(K_(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 nv={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},rv={class:`max-h-[28rem] overflow-y-auto`},iv=[`aria-expanded`,`aria-label`,`onClick`],av=[`title`],ov=A({__name:`LiveActivityCard`,setup(e){let t=sp(),{activity:n}=_e(ue()),r=Y(`all`),i=L(()=>Q_(n.value,r.value)),a=L(()=>$_(i.value.length,r.value)),o=Ye(new Set),s=L(()=>tv(i.value));function c(e){o.has(e)?o.delete(e):o.add(e)}function l(e){return o.has(e.key)}function u(e){return K_(e.representative)}function d(e){return e.representative.at?Eg(e.representative.at):`—`}function f(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(z(),J(B(yg),null,{default:M(()=>[N(B(wg),null,{default:M(()=>[N(B(Tg),null,{default:M(()=>[...t[1]||=[j(`Live activity`,-1)]]),_:1}),N(B(bg),{class:`flex items-center gap-2`},{default:M(()=>[N(B(I_),{type:`single`,variant:`outline`,size:`sm`,"model-value":r.value,"aria-label":`Filter activity`,"onUpdate:modelValue":t[0]||=e=>{e&&(r.value=e)}},{default:M(()=>[(z(!0),K(U,null,q(B(Y_),e=>(z(),J(B(R_),{key:e.value,value:e.value},{default:M(()=>[j(H(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])]),_:1})]),_:1}),N(B(xg),null,{default:M(()=>[G(`div`,nv,[G(`div`,rv,[N(B(B_),null,{default:M(()=>[N(B(W_),{class:`sticky top-0 z-10 bg-card`},{default:M(()=>[N(B(H_),null,{default:M(()=>[N(B(U_),null,{default:M(()=>[...t[2]||=[j(`Event`,-1)]]),_:1}),N(B(U_),null,{default:M(()=>[...t[3]||=[j(`Task`,-1)]]),_:1}),N(B(U_),null,{default:M(()=>[...t[4]||=[j(`Detail`,-1)]]),_:1}),N(B(U_),null,{default:M(()=>[...t[5]||=[j(`When`,-1)]]),_:1})]),_:1})]),_:1}),N(B(V_),null,{default:M(()=>[i.value.length?R(``,!0):(z(),J(B(H_),{key:0},{default:M(()=>[N(B($),{colspan:`4`},{default:M(()=>[N(B(ug),null,{default:M(()=>[N(B(pg),null,{default:M(()=>[N(B(gg),null,{default:M(()=>[j(H(a.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),i.value.length?(z(!0),K(U,{key:1},q(s.value,e=>(z(),K(U,{key:e.key},[e.count===1?(z(),J(J_,{key:0,event:e.representative,onOpen:f},null,8,[`event`])):(z(),K(U,{key:1},[N(B(H_),{class:P(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&f(e.taskID),onKeydown:[vt(St(t=>e.taskID>0&&f(e.taskID),[`prevent`]),[`enter`]),vt(St(t=>e.taskID>0&&f(e.taskID),[`prevent`]),[`space`])]},{default:M(()=>[N(B($),{class:`font-medium`},{default:M(()=>[G(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":l(e),"aria-label":`${l(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:St(t=>c(e.key),[`stop`])},[l(e)?(z(),J(B(Qt),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(z(),J(B($t),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),j(` `+H(e.label)+` `,1),N(B(kt),{variant:`idle`},{default:M(()=>[j(`×`+H(e.count),1)]),_:2},1024)],8,iv)]),_:2},1024),N(B($),{class:`font-mono`},{default:M(()=>[j(H(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),N(B($),{class:`w-[55%] max-w-0`},{default:M(()=>[G(`span`,{class:`block truncate`,title:u(e).truncated?u(e).full:void 0},H(u(e).text),9,av)]),_:2},1024),N(B($),null,{default:M(()=>[j(H(d(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydowLine 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 fy(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 py(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 my(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 hy(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 gy=Y([]),_y=Y([]),vy=Y(!0),yy=Y(null),by=Y(null),xy=Y(!1),Sy=Y(null);async function Cy(){try{let e=await Z.eventTypes(uy().workspace);vy.value=e.enabled!==!1,gy.value=e.event_types||[],_y.value=e.proposals||[],yy.value=null}catch(e){yy.value=e.message||String(e)}}function wy(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Ty(e){Sy.value=null,by.value=e}function Ey(e){let t=Py.value.find(t=>String(t.id)===e.sample_id);Ty({mode:`proposal`,id:null,source:e.source,name:``,rule:wy(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function Dy(e=``){Ty({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function Oy(e){Ty({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:wy(e.rule),headersText:``,body:``,exampleHeaders:{}})}function ky(){by.value=null}async function Ay(){let e=by.value;if(e){xy.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:hy(e.rule)});else{let t=e.mode===`paste`?dy(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:hy(e.rule),example:{headers:t,body:e.body}})}by.value=null,await Cy()}catch(e){Sy.value=e.message||String(e)}finally{xy.value=!1}}}var jy=Y(null);async function My(){let e=jy.value;if(jy.value=null,e)try{await Z.eventTypeDelete(e.id),await Cy()}catch(e){yy.value=e.message||String(e)}}var Ny=100,Py=Y([]),Fy=Y(!0),Iy=Y(null),Ly=Y(!0),Ry=Y(null);async function zy(){try{let e=await Z.captures(Ny);Fy.value=e.enabled!==!1,Py.value=e.captures||[],Iy.value=null}catch(e){Iy.value=e.message||String(e)}finally{Ly.value=!1}}function By(e){let t=Py.value.find(t=>t.id===e);return t&&(Ry.value=t),!!t}function Vy(){Py.value.length&&(Ry.value=Py.value[0])}function Hy(){me(`captures`,()=>{zy(),Cy()})}var Uy=A({__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:n}){let r=e,i=n,a=Dt(r,`class`),o=t(a,i);return(e,t)=>(z(),J(B($c),W({"data-slot":`tabs`,"data-orientation":B(o).orientation||`horizontal`},B(o),{class:B(Q)(`gap-2 group/tabs flex data-horizontal:flex-col`,r.class)}),{default:M(t=>[F(e.$slots,`default`,nt(Oe(t)))]),_:3},16,[`data-orientation`,`class`]))}}),Wy=A({__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)=>(z(),J(B(nl),W({"data-slot":`tabs-content`,class:B(Q)(`text-sm flex-1 outline-none`,t.class)},B(n)),{default:M(()=>[F(e.$slots,`default`)]),_:3},16,[`class`]))}}),Gy=A({__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)=>(z(),J(B(rl),W({"data-slot":`tabs-list`,"data-variant":e.variant},B(n),{class:B(Q)(B(qy)({variant:e.variant}),t.class)}),{default:M(()=>[F(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),Ky=A({__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=se(n);return(e,n)=>(z(),J(B(il),W({"data-slot":`tabs-trigger`,class:B(Q)(`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:outline-ring disabled:pointerLine truncated
`)}};jL.defaultYaml={explicit:!1,version:`1.2`},jL.defaultTags={"!!":`tag:yaml.org,2002:`};function ML(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 NL(e){let t=new Set;return wL(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function PL(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function FL(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=NL(e);let a=PL(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(gL(t.node)||vL(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 IL(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=IL(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=IL(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=IL(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=IL(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function LL(e,t,n){if(Array.isArray(e))return e.map((e,t)=>LL(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!bL(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 RL=class{constructor(e){Object.defineProperty(this,dL,{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(!pL(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=LL(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?IL(i,{"":o},``,o):o}},zL=class extends RL{constructor(e){super(aL),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=[],wL(e,{Node:(e,t)=>{(fL(t)||bL(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||=(LL(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=BL(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(ML(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 BL(e,t,n){if(fL(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(vL(t)){let r=0;for(let i of t.items){let t=BL(e,i,n);t>r&&(r=t)}return r}if(hL(t)){let r=BL(e,t.key,n),i=BL(e,t.value,n);return Math.max(r,i)}return 1}var VL=e=>!e||typeof e!=`function`&&typeof e!=`object`,HL=class extends RL{constructor(e){super(lL),this.value=e}toJSON(e,t){return t?.keep?this.value:LL(this.value,e,t)}toString(){return String(this.value)}};HL.BLOCK_FOLDED=`BLOCK_FOLDED`,HL.BLOCK_LITERAL=`BLOCK_LITERAL`,HL.PLAIN=`PLAIN`,HL.QUOTE_DOUBLE=`QUOTE_DOUBLE`,HL.QUOTE_SINGLE=`QUOTE_SINGLE`;var UL=`tag:yaml.org,2002:`;function WL(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 GL(e,t,n){if(pL(e)&&(e=e.contents),yL(e))return e;if(hL(e)){let t=n.schema[sL].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 zL(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=UL+t.slice(2));let l=WL(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new HL(e);return c&&(c.node=t),t Line truncated
`)?XL(n,t):n.includes(`
`)?`
`+ER(n,t):(e.endsWith(` `)?``:` `)+n,OR=`flow`,kR=`block`,AR=`quoted`;function jR(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=MR(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=MR(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+XL(n,t):(e.endsWith(` `)?``:` `)+n,QL=`flow`,$L=`block`,eR=`quoted`;function tR(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=nR(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=nR(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 MR(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 NR=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),PR=e=>/^(%|---|\.\.\.)/m.test(e);function FR(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 IR(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(PR(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 nR(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 rR=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),iR=e=>/^(%|---|\.\.\.)/m.test(e);function aR(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 oR(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(iR(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:jR(o,a,AR,NR(t,!1))}function LR(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return IR(e,t);let n=t.indent||(PR(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:jR(r,n,OR,NR(t,!1))}function RR(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=IR;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?LR:i&&!t?IR:n?LR:IR}return r(e,t)}var zR;try{zR=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:tR(o,a,eR,rR(t,!1))}function sR(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return oR(e,t);let n=t.indent||(iR(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:tR(r,n,QL,rR(t,!1))}function cR(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=oR;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?sR:i&&!t?oR:n?sR:oR}return r(e,t)}var lR;try{lR=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{zR=/\n+(?!\n|$)/g}function BR({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 RR(n,r);let l=r.indent||(r.forceBlockIndent||PR(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===vR.BLOCK_FOLDED?!1:t===vR.BLOCK_LITERAL||!FR(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{lR=/\n+(?!\n|$)/g}function uR({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 cR(n,r);let l=r.indent||(r.forceBlockIndent||iR(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===HL.BLOCK_FOLDED?!1:t===HL.BLOCK_LITERAL||!aR(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(zR,`$&${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(lR,`$&${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=NR(r,!0);o!==`folded`&&t!==vR.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=jR(`${v}${e}${p}`,l,kR,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function VR(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 RR(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?RR(a,t):BR(e,t,n,r);if(!s&&!u&&i!==vR.PLAIN&&a.includes(`
`))return BR(e,t,n,r);if(PR(a)){if(c===``)return t.forceBlockIndent=!0,BR(e,t,n,r);if(s&&c===l)return RR(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 RR(a,t)}return s?d:jR(d,c,OR,NR(t,!1))}function HR(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==vR.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=vR.QUOTE_DOUBLE);let c=e=>{switch(e){case vR.BLOCK_FOLDED:case vR.BLOCK_LITERAL:return i||a?RR(o.value,t):BR(o,t,n,r);case vR.QUOTE_DOUBLE:return IR(o.value,t);case vR.QUOTE_SINGLE:return LR(o.value,t);case vR.PLAIN:return VR(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 UR(e,t){let n=Object.assign({blockQuote:!0,commentString:TR,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 WR(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(KL(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 GR(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(KL(e)||JL(e))&&e.anchor;a&&cR(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 KR(e,t,n,r){if(GL(e))return e.toString(t,n,r);if(HL(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=YL(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=WR(t.doc.schema.tags,a);let o=GR(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):KL(a)?HR(a,t,n,r):a.toString(t,n,r);return o?KL(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function qR({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=YL(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(JL(e)||!YL(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||JL(e)||(KL(e)?e.type===vR.BLOCK_FOLDED||e.type===vR.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=KR(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+=DR(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=DR(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=DR(g,n.indent,l(f))));let _,v,y;YL(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&&KL(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&qL(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=KR(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${ER(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=rR(r,!0);o!==`folded`&&t!==HL.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=tR(`${v}${e}${p}`,l,$L,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function dR(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 cR(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?cR(a,t):uR(e,t,n,r);if(!s&&!u&&i!==HL.PLAIN&&a.includes(`
`))return uR(e,t,n,r);if(iR(a)){if(c===``)return t.forceBlockIndent=!0,uR(e,t,n,r);if(s&&c===l)return cR(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 cR(a,t)}return s?d:tR(d,c,QL,rR(t,!1))}function fR(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!==HL.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=HL.QUOTE_DOUBLE);let c=e=>{switch(e){case HL.BLOCK_FOLDED:case HL.BLOCK_LITERAL:return i||a?cR(o.value,t):uR(o,t,n,r);case HL.QUOTE_DOUBLE:return oR(o.value,t);case HL.QUOTE_SINGLE:return sR(o.value,t);case HL.PLAIN:return dR(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 pR(e,t){let n=Object.assign({blockQuote:!0,commentString:YL,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 mR(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(gL(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 hR(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(gL(e)||vL(e))&&e.anchor;a&&ML(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 gR(e,t,n,r){if(hL(e))return e.toString(t,n,r);if(fL(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=yL(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=mR(t.doc.schema.tags,a);let o=hR(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):gL(a)?fR(a,t,n,r):a.toString(t,n,r);return o?gL(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function _R({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=yL(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(vL(e)||!yL(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||vL(e)||(gL(e)?e.type===HL.BLOCK_FOLDED||e.type===HL.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=gR(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+=ZL(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=ZL(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=ZL(g,n.indent,l(f))));let _,v,y;yL(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&&gL(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&_L(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=gR(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${XL(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&JL(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&vL(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+=DR(g,n.indent,l(y)):h&&i&&i(),g}function JR(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var YR=`<<`,XR={identify:e=>e===YR||typeof e==`symbol`&&e.description===YR,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new vR(Symbol(YR)),{addToJSMap:QR}),stringify:()=>YR},ZR=(e,t)=>(XR.identify(t)||KL(t)&&(!t.type||t.type===vR.PLAIN)&&XR.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===XR.tag&&e.default);function QR(e,t,n){let r=ez(e,n);if(qL(r))for(let n of r.items)$R(e,t,n);else if(Array.isArray(r))for(let n of r)$R(e,t,n);else $R(e,t,r)}function $R(e,t,n){let r=ez(e,n);if(!WL(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 ez(e,t){return e&&HL(t)?t.resolve(e.doc,e):t}function tz(e,t,{key:n,value:r}){if(YL(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(ZR(e,n))QR(e,t,r);else{let i=pR(n,``,e);if(t instanceof Map)t.set(i,pR(r,i,e));else if(t instanceof Set)t.add(i);else{let a=nz(n,i,e),o=pR(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function nz(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(YL(e)&&n?.doc){let t=UR(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)+`..."`),JR(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 rz(e,t,n){return new iz(xR(e,void 0,n),xR(t,void 0,n))}var iz=class e{constructor(e,t=null){Object.defineProperty(this,VL,{value:RL}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return YL(n)&&(n=n.clone(t)),YL(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return tz(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?qR(this,e,t,n):JSON.stringify(this)}};function az(e,t,n){return(t.inFlow??e.flow?sz:oz)(e,t,n)}function oz({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(YL(i))!d&&i.spaceBefore&&f.push(``),cz(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(GL(i)){let e=YL(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),cz(n,f,e.commentBefore,d))}d=!1;let s=KR(i,u,()=>o=null,()=>d=!0);o&&(s+=DR(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+=ZL(g,n.indent,l(y)):h&&i&&i(),g}function vR(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var yR=`<<`,bR={identify:e=>e===yR||typeof e==`symbol`&&e.description===yR,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new HL(Symbol(yR)),{addToJSMap:SR}),stringify:()=>yR},xR=(e,t)=>(bR.identify(t)||gL(t)&&(!t.type||t.type===HL.PLAIN)&&bR.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===bR.tag&&e.default);function SR(e,t,n){let r=wR(e,n);if(_L(r))for(let n of r.items)CR(e,t,n);else if(Array.isArray(r))for(let n of r)CR(e,t,n);else CR(e,t,r)}function CR(e,t,n){let r=wR(e,n);if(!mL(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 wR(e,t){return e&&fL(t)?t.resolve(e.doc,e):t}function TR(e,t,{key:n,value:r}){if(yL(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(xR(e,n))SR(e,t,r);else{let i=LL(n,``,e);if(t instanceof Map)t.set(i,LL(r,i,e));else if(t instanceof Set)t.add(i);else{let a=ER(n,i,e),o=LL(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function ER(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(yL(e)&&n?.doc){let t=pR(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)+`..."`),vR(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 DR(e,t,n){return new OR(GL(e,void 0,n),GL(t,void 0,n))}var OR=class e{constructor(e,t=null){Object.defineProperty(this,dL,{value:cL}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return yL(n)&&(n=n.clone(t)),yL(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return TR(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?_R(this,e,t,n):JSON.stringify(this)}};function kR(e,t,n){return(t.inFlow??e.flow?jR:AR)(e,t,n)}function AR({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(yL(i))!d&&i.spaceBefore&&f.push(``),MR(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(hL(i)){let e=yL(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),MR(n,f,e.commentBefore,d))}d=!1;let s=gR(i,u,()=>o=null,()=>d=!0);o&&(s+=ZL(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+=`
`+ER(l(e),c),s&&s()):d&&o&&o(),p}function sz({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(YL(i))i.spaceBefore&&d.push(``),cz(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(GL(i)){let e=YL(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),cz(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=YL(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=KR(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+=DR(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 cz({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=ER(t(r),e);n.push(i.trimStart())}}function lz(e,t){let n=KL(t)?t.value:t;for(let r of e)if(GL(r)&&(r.key===t||r.key===n||KL(r.key)&&r.key.value===n))return r}var uz=class extends wR{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(LL,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(rz(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=GL(e)?e:!e||typeof e!=`object`||!(`key`in e)?new iz(e,e?.value):new iz(e.key,e.value);let r=lz(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);KL(r.value)&&_R(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=lz(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=lz(this.items,e)?.value;return(!t&&KL(n)?n.value:n)??void 0}has(e){return!!lz(this.items,e)}set(e,t){this.add(new iz(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)tz(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!GL(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})),az(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},dz={collection:`map`,default:!0,nodeClass:uz,tag:`tag:yaml.org,2002:map`,resolve(e,t){return WL(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>uz.from(e,t,n)},fz=class extends wR{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(BL,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=pz(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=pz(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&KL(r)?r.value:r}has(e){let t=pz(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=pz(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];KL(r)&&_R(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(pR(e,String(r++),t));return n}toString(e,t,n){return e?az(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(xR(a,void 0,n))}}return i}};function pz(e){let t=KL(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var mz={collection:`seq`,default:!0,nodeClass:fz,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return qL(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>fz.from(e,t,n)},hz={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),HR(e,t,n,r)}},gz={identify:e=>e==null,createNode:()=>new vR(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new vR(null),stringify:({source:e},t)=>typeof e==`string`&&gz.test.test(e)?e:t.options.nullStr},_z={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new vR(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&_z.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function vz({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 yz={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:vz},bz={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return HR({comment:e,type:t,value:s},r,i,a)}};function Pz(e,t){if(qL(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!GL(r)){if(WL(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new iz(new vR(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]=GL(r)?r:new iz(r)}}else t(`Expected a sequence for this tag`);return e}function Fz(e,t,n){let{replacer:r}=n,i=new fz(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(rz(o,s,n))}return i}var Iz={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Pz,createNode:Fz},Lz=class e extends fz{constructor(){super(),this.add=uz.prototype.add.bind(this),this.delete=uz.prototype.delete.bind(this),this.get=uz.prototype.get.bind(this),this.has=uz.prototype.has.bind(this),this.set=uz.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(GL(e)?(r=pR(e.key,``,t),i=pR(e.value,r,t)):r=pR(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=Fz(e,t,n),i=new this;return i.items=r.items,i}};Lz.tag=`tag:yaml.org,2002:omap`;var Rz={collection:`seq`,identify:e=>e instanceof Map,nodeClass:Lz,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Pz(e,t),r=[];for(let{key:e}of n.items)KL(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 zz({value:e,source:t},n){return t&&(e?Bz:Vz).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Bz={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 vR(!0),stringify:zz},Vz={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 vR(!1),stringify:zz},Hz={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:vz},Uz={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():vz(e)}},Wz={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 vR(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:vz},Gz=e=>typeof e==`bigint`||Number.isInteger(e);function Kz(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 qz(e,t,n){let{value:r}=e;if(Gz(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return vz(e)}var Jz={identify:Gz,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Kz(e,2,2,n),stringify:e=>qz(e,2,`0b`)},Yz={identify:Gz,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Kz(e,1,8,n),stringify:e=>qz(e,8,`0`)},Xz={identify:Gz,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Kz(e,0,10,n),stringify:vz},Zz={identify:Gz,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Kz(e,2,16,n),stringify:e=>qz(e,16,`0x`)},Qz=class e extends uz{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=GL(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new iz(e.key,null):new iz(e,null),lz(this.items,t.key)||this.items.push(t)}get(e,t){let n=lz(this.items,e);return!t&&GL(n)?KL(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=lz(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new iz(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(ER(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(ER(a(t),``)))}return n.join(`
`+XL(l(e),c),s&&s()):d&&o&&o(),p}function jR({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(yL(i))i.spaceBefore&&d.push(``),MR(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(hL(i)){let e=yL(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),MR(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=yL(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=gR(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+=ZL(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 MR({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=XL(t(r),e);n.push(i.trimStart())}}function NR(e,t){let n=gL(t)?t.value:t;for(let r of e)if(hL(r)&&(r.key===t||r.key===n||gL(r.key)&&r.key.value===n))return r}var PR=class extends JL{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(sL,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(DR(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=hL(e)?e:!e||typeof e!=`object`||!(`key`in e)?new OR(e,e?.value):new OR(e.key,e.value);let r=NR(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);gL(r.value)&&VL(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=NR(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=NR(this.items,e)?.value;return(!t&&gL(n)?n.value:n)??void 0}has(e){return!!NR(this.items,e)}set(e,t){this.add(new OR(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)TR(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!hL(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})),kR(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},FR={collection:`map`,default:!0,nodeClass:PR,tag:`tag:yaml.org,2002:map`,resolve(e,t){return mL(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>PR.from(e,t,n)},IR=class extends JL{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(uL,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=LR(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=LR(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&gL(r)?r.value:r}has(e){let t=LR(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=LR(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];gL(r)&&VL(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(LL(e,String(r++),t));return n}toString(e,t,n){return e?kR(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(GL(a,void 0,n))}}return i}};function LR(e){let t=gL(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var RR={collection:`seq`,default:!0,nodeClass:IR,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return _L(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>IR.from(e,t,n)},zR={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),fR(e,t,n,r)}},BR={identify:e=>e==null,createNode:()=>new HL(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new HL(null),stringify:({source:e},t)=>typeof e==`string`&&BR.test.test(e)?e:t.options.nullStr},VR={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new HL(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&VR.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function HR({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 UR={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:HR},WR={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 fR({comment:e,type:t,value:s},r,i,a)}};function iz(e,t){if(_L(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!hL(r)){if(mL(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new OR(new HL(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]=hL(r)?r:new OR(r)}}else t(`Expected a sequence for this tag`);return e}function az(e,t,n){let{replacer:r}=n,i=new IR(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(DR(o,s,n))}return i}var oz={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:iz,createNode:az},sz=class e extends IR{constructor(){super(),this.add=PR.prototype.add.bind(this),this.delete=PR.prototype.delete.bind(this),this.get=PR.prototype.get.bind(this),this.has=PR.prototype.has.bind(this),this.set=PR.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(hL(e)?(r=LL(e.key,``,t),i=LL(e.value,r,t)):r=LL(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=az(e,t,n),i=new this;return i.items=r.items,i}};sz.tag=`tag:yaml.org,2002:omap`;var cz={collection:`seq`,identify:e=>e instanceof Map,nodeClass:sz,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=iz(e,t),r=[];for(let{key:e}of n.items)gL(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new sz,n)},createNode:(e,t,n)=>sz.from(e,t,n)};function lz({value:e,source:t},n){return t&&(e?uz:dz).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var uz={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 HL(!0),stringify:lz},dz={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 HL(!1),stringify:lz},fz={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:HR},pz={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():HR(e)}},mz={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 HL(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:HR},hz=e=>typeof e==`bigint`||Number.isInteger(e);function gz(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 _z(e,t,n){let{value:r}=e;if(hz(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return HR(e)}var vz={identify:hz,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>gz(e,2,2,n),stringify:e=>_z(e,2,`0b`)},yz={identify:hz,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>gz(e,1,8,n),stringify:e=>_z(e,8,`0`)},bz={identify:hz,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>gz(e,0,10,n),stringify:HR},xz={identify:hz,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>gz(e,2,16,n),stringify:e=>_z(e,16,`0x`)},Sz=class e extends PR{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=hL(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new OR(e.key,null):new OR(e,null),NR(this.items,t.key)||this.items.push(t)}get(e,t){let n=NR(this.items,e);return!t&&hL(n)?gL(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=NR(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new OR(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(XL(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(XL(a(t),``)))}return n.join(`
`)+`
`}var pB=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,VL,{value:IL});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 sR({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[VL]:{value:IL}});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=YL(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){mB(this.contents)&&this.contents.add(e)}addIn(e,t){mB(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=lR(this);e.anchor=!t||n.has(t)?uR(t||`a`,n):t}return new hR(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}=dR(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=xR(e,l,p);return o&&JL(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new iz(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return mB(this.contents)?this.contents.delete(e):!1}deleteIn(e){return CR(e)?this.contents!=null&&(this.contents=null,!0):mB(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return JL(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return CR(e)?!t&&KL(this.contents)?this.contents.value:this.contents:JL(this.contents)?this.contents.getIn(e,t):void 0}has(e){return JL(this.contents)?this.contents.has(e):!1}hasIn(e){return CR(e)?this.contents!==void 0:JL(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=SR(this.schema,[e],t):mB(this.contents)&&this.contents.set(e,t)}setIn(e,t){CR(e)?this.contents=t:this.contents==null?this.contents=SR(this.schema,Array.from(e),t):mB(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 sR({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 sR({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 dB(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=pR(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`?fR(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 fB(this,e)}};function mB(e){if(JL(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var hB=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},gB=class extends hB{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},_B=class extends hB{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},vB=(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 yB(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 bB(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(bB(t.key)||bB(t.value))return!0}return!1;default:return!0}}function xB(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&bB(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function SB(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||KL(e)&&KL(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var CB=`All mapping items must start at the same column`;function wB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??uz)(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=yB(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`,CB)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||bB(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`,CB);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&xB(r.indent,u,i),n.atKey=!1,SB(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=yB(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&&xB(r.indent,f,i),s=c.range[2];let l=new iz(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 iz(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 TB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??fz)(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=yB(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&&xB(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function EB(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 DB=`Block collections are not allowed within flow collections`,OB=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function kB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?uz:fz))(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=yB(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&&bB(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];GL(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],OB(m)&&i(r.range,`BLOCK_IN_FLOW`,DB)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);OB(f)&&i(g.range,`BLOCK_IN_FLOW`,DB),n.atKey=!1;let _=yB(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?OB(m)&&i(v.range,`BLOCK_IN_FLOW`,DB):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new iz(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;SB(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new uz(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=EB(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 AB(e,t,n,r,i,a){let o=n.type===`block-map`?wB(e,t,n,r,a):n.type===`block-seq`?TB(e,t,n,r,a):kB(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function jB(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===uz.tagName&&s===`map`||o===fz.tagName&&s===`seq`)return AB(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),AB(e,t,n,i,o)}let l=AB(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=YL(u)?u:new vR(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function MB(e,t,n){let r=t.offset,i=NB(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?vR.BLOCK_FOLDED:vR.BLOCK_LITERAL,o=t.source?PB(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 Lz=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,dL,{value:oL});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 jL({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[dL]:{value:oL}});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=yL(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Rz(this.contents)&&this.contents.add(e)}addIn(e,t){Rz(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=NL(this);e.anchor=!t||n.has(t)?PL(t||`a`,n):t}return new zL(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}=FL(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=GL(e,l,p);return o&&vL(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new OR(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Rz(this.contents)?this.contents.delete(e):!1}deleteIn(e){return qL(e)?this.contents!=null&&(this.contents=null,!0):Rz(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return vL(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return qL(e)?!t&&gL(this.contents)?this.contents.value:this.contents:vL(this.contents)?this.contents.getIn(e,t):void 0}has(e){return vL(this.contents)?this.contents.has(e):!1}hasIn(e){return qL(e)?this.contents!==void 0:vL(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=KL(this.schema,[e],t):Rz(this.contents)&&this.contents.set(e,t)}setIn(e,t){qL(e)?this.contents=t:this.contents==null?this.contents=KL(this.schema,Array.from(e),t):Rz(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 jL({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 jL({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 Fz(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=LL(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`?IL(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 Iz(this,e)}};function Rz(e){if(vL(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var zz=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Bz=class extends zz{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Vz=class extends zz{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Hz=(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 Uz(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 Wz(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(Wz(t.key)||Wz(t.value))return!0}return!1;default:return!0}}function Gz(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Wz(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Kz(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||gL(e)&&gL(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var qz=`All mapping items must start at the same column`;function Jz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??PR)(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=Uz(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`,qz)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Wz(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`,qz);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Gz(r.indent,u,i),n.atKey=!1,Kz(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Uz(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&&Gz(r.indent,f,i),s=c.range[2];let l=new OR(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 OR(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 Yz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??IR)(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=Uz(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&&Gz(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Xz(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 Zz=`Block collections are not allowed within flow collections`,Qz=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function $z({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?PR:IR))(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=Uz(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&&Wz(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];hL(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],Qz(m)&&i(r.range,`BLOCK_IN_FLOW`,Zz)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);Qz(f)&&i(g.range,`BLOCK_IN_FLOW`,Zz),n.atKey=!1;let _=Uz(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?Qz(m)&&i(v.range,`BLOCK_IN_FLOW`,Zz):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new OR(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Kz(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new PR(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=Xz(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 eB(e,t,n,r,i,a){let o=n.type===`block-map`?Jz(e,t,n,r,a):n.type===`block-seq`?Yz(e,t,n,r,a):$z(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function tB(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===PR.tagName&&s===`map`||o===IR.tagName&&s===`seq`)return eB(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),eB(e,t,n,i,o)}let l=eB(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=yL(u)?u:new HL(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function nB(e,t,n){let r=t.offset,i=rB(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?HL.BLOCK_FOLDED:HL.BLOCK_LITERAL,o=t.source?iB(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===vR.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===HL.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
@@ -75,59 +75,59 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function NB({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 PB(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 FB(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=vR.PLAIN,c=IB(a,l);break;case`single-quoted-scalar`:s=vR.QUOTE_SINGLE,c=LB(a,l);break;case`double-quoted-scalar`:s=vR.QUOTE_DOUBLE,c=zB(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=EB(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function IB(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}`),RB(e)}function LB(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),RB(e.slice(1,-1)).replace(/''/g,`'`)}function RB(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 rB({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 iB(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 aB(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=HL.PLAIN,c=oB(a,l);break;case`single-quoted-scalar`:s=HL.QUOTE_SINGLE,c=sB(a,l);break;case`double-quoted-scalar`:s=HL.QUOTE_DOUBLE,c=lB(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=Xz(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function oB(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}`),cB(e)}function sB(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),cB(e.slice(1,-1)).replace(/''/g,`'`)}function cB(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 zB(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 lB(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}=BB(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=VB[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=uB(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=dB[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+=HB(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`)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+=fB(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 BB(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 uB(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 VB={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function HB(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function UB(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?MB(e,t,r):FB(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[zL]:c?WB(e.schema,i,c,n,r):t.type===`scalar`?GB(e,i,t,r):e.schema[zL];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=KL(a)?a:new vR(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new vR(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 WB(e,t,n,r,i){if(n===`!`)return e[zL];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[zL])}function GB({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[zL];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[zL];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 KB(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 qB={composeNode:JB,composeEmptyNode:YB};function JB(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=XB(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=UB(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=jB(qB,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??=YB(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&&(!KL(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 YB(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=UB(e,{type:`scalar`,offset:KB(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 XB({options:e},{offset:t,source:n,end:r},i){let a=new hR(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=EB(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function ZB(e,t,{offset:n,start:r,value:i,end:a},o){let s=new pB(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=yB(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?JB(c,i,l,o):YB(c,l.end,r,null,l,o);let u=s.contents.range[2],d=EB(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function QB(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 $B(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 dB={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function fB(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 pB(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?nB(e,t,r):aB(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[lL]:c?mB(e.schema,i,c,n,r):t.type===`scalar`?hB(e,i,t,r):e.schema[lL];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=gL(a)?a:new HL(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new HL(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 mB(e,t,n,r,i){if(n===`!`)return e[lL];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[lL])}function hB({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[lL];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[lL];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 gB(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 _B={composeNode:vB,composeEmptyNode:yB};function vB(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=bB(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=pB(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=tB(_B,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??=yB(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&&(!gL(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 yB(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=pB(e,{type:`scalar`,offset:gB(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 bB({options:e},{offset:t,source:n,end:r},i){let a=new zL(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=Xz(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function xB(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Lz(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Uz(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?vB(c,i,l,o):yB(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Xz(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function SB(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 CB(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 eV=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=QB(e);r?this.warnings.push(new _B(i,t,n)):this.errors.push(new gB(i,t,n))},this.directives=new sR({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=$B(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(JL(i)&&!i.flow&&i.items.length>0){let e=i.items[0];GL(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:$B(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=QB(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=ZB(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 gB(QB(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 gB(QB(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=EB(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 gB(QB(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 pB(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}}},tV=Symbol(`break visit`),nV=Symbol(`skip children`),rV=Symbol(`remove item`);function iV(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),aV(Object.freeze([]),e,t)}iV.BREAK=tV,iV.SKIP=nV,iV.REMOVE=rV,iV.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},iV.parentCollection=(e,t)=>{let n=iV.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 aV(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=aV(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===tV)return tV;else r===rV&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function oV(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 wB=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=SB(e);r?this.warnings.push(new Vz(i,t,n)):this.errors.push(new Bz(i,t,n))},this.directives=new jL({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=CB(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(vL(i)&&!i.flow&&i.items.length>0){let e=i.items[0];hL(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:CB(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=SB(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=xB(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 Bz(SB(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 Bz(SB(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Xz(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 Bz(SB(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 Lz(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}}},TB=Symbol(`break visit`),EB=Symbol(`skip children`),DB=Symbol(`remove item`);function OB(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),kB(Object.freeze([]),e,t)}OB.BREAK=TB,OB.SKIP=EB,OB.REMOVE=DB,OB.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},OB.parentCollection=(e,t)=>{let n=OB.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 kB(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=kB(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===TB)return TB;else r===DB&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function AB(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 sV(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var cV=new Set(`0123456789ABCDEFabcdef`),lV=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),uV=new Set(`,[]{}`),dV=new Set(` ,[]{}
\r `),fV=e=>!e||dV.has(e),pV=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 jB(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var MB=new Set(`0123456789ABCDEFabcdef`),NB=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),PB=new Set(`,[]{}`),FB=new Set(` ,[]{}
\r `),IB=e=>!e||FB.has(e),LB=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===`...`)&&sV(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===`...`)&&sV(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&&!sV(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===`:`)&&sV(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(fV),`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(`...`))&&sV(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(fV),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||sV(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===`...`)&&jB(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===`...`)&&jB(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&&!jB(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===`:`)&&jB(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(IB),`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(`...`))&&jB(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(IB),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||jB(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=>sV(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=>jB(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(sV(r)||e&&uV.has(r))break;t=n}else if(sV(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(jB(r)||e&&PB.has(r))break;t=n}else if(jB(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&uV.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&uV.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(fV),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(sV(n)||t&&uV.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(;!sV(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(lV.has(t))t=this.buffer[++e];else if(t===`%`&&cV.has(this.buffer[e+1])&&cV.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&&PB.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&PB.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(IB),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(jB(n)||t&&PB.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(;!jB(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(NB.has(t))t=this.buffer[++e];else if(t===`%`&&MB.has(this.buffer[e+1])&&MB.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)}},mV=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 hV(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function gV(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 _V(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 vV(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 yV(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 bV(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 xV(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!hV(t.start,`explicit-key-ind`)&&!hV(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,_V(t.value)?t.value.end?bV(t.value.end,t.sep):t.value.end=t.sep:bV(t.start,t.sep),delete t.sep)}var SV=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 pV,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=oV(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`&&xV(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&&gV(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)}},RB=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 zB(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function BB(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 VB(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 HB(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 UB(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 WB(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 GB(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!zB(t.start,`explicit-key-ind`)&&!zB(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,VB(t.value)?t.value.end?WB(t.value.end,t.sep):t.value.end=t.sep:WB(t.start,t.sep),delete t.sep)}var KB=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 LB,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=AB(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`&&GB(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&&BB(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)){bV(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(hV(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=yV(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(hV(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(_V(t.key)&&!hV(t.sep,`newline`)){let e=yV(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]}):hV(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&&!hV(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)){bV(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||hV(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)){WB(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(zB(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=UB(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(zB(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(VB(t.key)&&!zB(t.sep,`newline`)){let e=UB(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]}):zB(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&&!zB(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)){WB(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||zB(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=yV(vV(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=yV(vV(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 CV(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new mV||null,prettyErrors:t}}function wV(e,t={}){let{lineCounter:n,prettyErrors:r}=CV(t),i=new SV(n?.addNewLine),a=new eV(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 gB(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(vB(e,n)),o.warnings.forEach(vB(e,n))),o}function TV(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=wV(e,n);if(!i)return null;if(i.warnings.forEach(e=>JR(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 EV(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 UL(e)&&!r?e.toString(n):new pB(e,r,n).toString(n)}var DV=e=>typeof e==`object`&&!!e&&!Array.isArray(e),OV=e=>DV(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function kV(e){if(DV(e)){if(DV(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:OV(e.parallel)};if(DV(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:OV(e.switch.cases)}}}function AV(e){return e.slice(2).includes(`parallel`)}function jV(e,t){let n=wV(e).getIn(t,!0);if(WL(n))return n.toJSON()}function MV(e,t,n){let r=wV(e);return r.setIn(t,r.createNode(UV(n))),r.toString()}function NV(e,t,n){let r=wV(e),i=t.slice(0,-1),a=AV(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(qL(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!qL(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 PV(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 FV(e,t){let n=e.getIn(t,!0),r=kV(WL(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!WL(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function IV(e,t,n){let r=wV(e),{kind:i,branches:a}=FV(r,t);if(PV(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function LV(e,t,n,r){let i=wV(e),{kind:a,branches:o}=FV(i,t);if(PV(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>KL(e.key)&&e.key.value===n);if(!s||!KL(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function RV(e,t,n){let r=wV(e),{kind:i,branches:a}=FV(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 rH(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll($V)].map(e=>e[1]))]}function iH(e){let t=wV(e).toJS(),n=eH(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=eH(e)?e:{},p=kV(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=eH(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,title:g||QV(m),type:m,role:KV(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:tH(m,h),summary:nH(h),when:typeof d.when==`string`?d.when:void 0,retry:eH(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 rH([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=kV(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*YV,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=eH(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*XV,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*YV,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*YV},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*YV-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*XV;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*YV-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*YV,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*YV-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 aH={agent:Jt,command:Ln,repo:dn,gate:Nn,forge:yn,human:Wn,review:ln,workflow:qn},oH={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function sH(e){return e===`parallel`?dn:e===`switch`?Fn:aH[e.split(`.`)[0]]??qn}function cH(e){return Object.keys(oH).map(t=>({title:oH[t],icon:aH[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function lH(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 uH(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function dH(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 fH(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=dH(e,r.type))}return n}var pH=k({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),q(z(hl),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:j(()=>[M(z(Sl),{"aria-label":e.label},{default:j(()=>[M(z(Cl),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),M(z(gl),null,{default:j(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(R(),q(z(yl),{key:0,value:e.value,disabled:``},{default:j(()=>[A(V(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):L(``,!0),(R(!0),G(H,null,K(e.workflows,e=>(R(),q(z(yl),{key:e.id,value:e.id},{default:j(()=>[A(V(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function mH(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function hH(e,t=[]){let n=wV(e),r=n.errors[0];if(r)return{ok:!1,message:kH(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!AH(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`stLine truncated
`).map((e,t)=>({number:t+1,text:e,tokens:TH(e)}))}var CH=/^(\s*)(-\s+)?/,wH=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function TH(e){let{code:t,comment:n}=EH(e),r=DH(t);return n&&r.push({text:n,kind:`comment`}),r}function EH(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 DH(e){if(!e)return[];let t=[],n=CH.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=wH.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,...OH(i[4]??``)]):[...t,...OH(r)]}function OH(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 kH(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function AH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function jH(e){return typeof e==`string`&&e.trim()!==``}var MH={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},NH={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},PH={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},FH={class:`min-w-0 flex-1`},IH=[`value`,`placeholder`],LH={class:`truncate font-mono text-[11px] text-fg-subtle`},RH={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},zH={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},BH={key:1,class:`space-y-3`},VH={key:0,class:`block space-y-1.5`},HH={id:`switch-on`},UH=[`value`],WH={class:`text-xs font-medium text-muted-foreground`},GH={class:`flex items-center gap-2`},KH={key:1,role:`alert`,class:`text-xs text-danger`},qH={key:2,class:`space-y-1.5`},JH=[`title`],YH=[`value`],XH=[`value`],ZH={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},QH=[`onClick`],$H=[`onClick`],eU={key:3,class:`divide-y divide-border rounded-md border border-border`},tU=[`title`],nU=[`value`,`onChange`],rU=[`value`],iU=[`value`,`onInput`],aU=[`value`,`onFocus`,`onInput`],oU={key:0,class:`space-y-3`},sU={class:`text-[13px]`},cU={key:0,class:`text-danger`},lU={class:`ml-2 text-xs text-fg-subtle`},uU=[`aria-label`,`value`,`onChange`],dU={key:0,value:`value`},fU=[`aria-label`,`value`,`onChange`],pU=[`value`],mU=[`aria-label`,`value`,`onChange`],hU={key:1,class:`space-y-3`},gU={class:`text-[13px]`},_U={class:`ml-2 text-xs text-fg-subtle`},vU=[`aria-label`,`disabled`,`value`,`onChange`],yU=[`value`],bU=[`title`],xU={key:0,class:`text-xs text-danger`},SU={class:`space-y-2`},CU={class:`divide-y divide-border rounded-md border border-border`},wU={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},TU=[`value`],EU={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},DU=[`value`],OU={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},kU=[`value`],AU={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},jU={class:`flex items-center border-t border-border px-4 py-2.5`},MU=k({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>jV(n.yaml,n.path)??{}),a=I(()=>kV(i.value)),o=I(()=>a.value?.kind??(typeof i.value.type==`string`?i.value.type:``)),s=I(()=>a.value?.branches.map(([e])=>e)??[]),c=I(()=>o.value===`parallel`?2:1);function l(e){r(`update:yaml`,MV(n.yaml,n.path,{...i.value,switch:{...i.value.switch,on:e}}))}let u=J(``),d=J(``);function f(e,t,i=``){try{let a=e===`add`?IV(n.yaml,n.path,t):e===`rename`?LV(n.yaml,n.path,t,i):RV(n.yaml,n.path,t);r(`update:yaml`,a),u.value=``,d.value=``}catch(e){d.value=String(e.message)}}let p=I(()=>n.vocabulary.find(e=>e.name===o.value)),m=I(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),h=I(()=>HV(n.yaml,n.path)),g=I(()=>p.value?.settings&&i.value.settings?bH(i.value.settings,p.value.settings,`settings`):``),_=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],v=/mission|body|detail|plan|rules/;function y(e,t){return[`workflow.call`,`workflow.handoff`].includes(o.value)&&e===`workflow`||o.value===`human.approve`&&e===`then`?`workflow`:o.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:v.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let b=I(()=>{let e=Object.entries(p.value?.settings?.properties??{}).filter(([e])=>o.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:y(e,t),options:o.value===`agent.run`&&e===`model`?n.modelAliases:t.enum??[]})),t=e.filter(e=>_.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>_.indexOf(e.key)-_.indexOf(t.key))[0],r=e.filter(e=>e!==t);return{lead:t,compact:r.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:r.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function x(e){let{id:t,type:i,...a}=e;r(`update:yaml`,MV(n.yaml,n.path,{id:t,type:i,...a}))}function S(e,t){x({...i.value,[e]:t})}function C(e){S(`retry`,{...i.value.retry,...e})}function w(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,x({...i.value,settings:n})}function T(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&t!==m.value[e]&&(delete n.inputs,delete n.outputs),x({...i.value,settings:n})}let E=I(()=>n.workflows.find(e=>e.id===m.value.workflow)),ee=I(()=>Object.entries(WV(E.value?.yaml??``,`inputs`)??{})),D=I(()=>Object.entries(WV(E.value?.yaml??``,`outputs`)??{})),te=I(()=>Object.entries(WV(n.yaml,`inputs`)??{})),ne=I(()=>Object.entries(WV(n.yaml,`outputs`)??{})),re=I(()=>m.value.inputs??{}),ie=I(()=>m.value.outputs??{}),ae=e=>typeof e==`string`&&e.startsWith(`inputs.`),oe=e Line truncated
`)[0]}}}let fe=e=>e===void 0?``:EV(e).trimEnd(),pe=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),me=e=>typeof m.value[e]==`string`?m.value[e]:``;return(t,n)=>(R(),G(`aside`,MH,[W(`header`,NH,[W(`span`,PH,[(R(),q(Ye(z(sH)(o.value)),{class:`size-4`}))]),W(`div`,FH,[W(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:z(QV)(o.value),"aria-label":`Step id`,onInput:n[0]||=e=>S(`id`,e.target.value)},null,40,IH),W(`div`,LH,V(o.value),1)]),M(z(Z),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:n[1]||=e=>r(`close`)},{default:j(()=>[M(z(Yn))]),_:1})]),W(`div`,RH,[g.value?(R(),G(`p`,zH,V(g.value),1)):L(``,!0),a.value?(R(),G(`section`,BH,[o.value===`switch`?(R(),G(`label`,VH,[n[18]||=W(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),M(z(O),{"model-value":a.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`switch-on`,onChange:n[2]||=e=>l(e.target.value.trim())},null,8,[`model-value`]),W(`datalist`,HH,[(R(!0),G(H,null,K(h.value,e=>(R(),G(`option`,{key:e,value:`steps.${e}.result.`},null,8,UH))),128))])])):L(``,!0),W(`div`,WH,V(o.value===`switch`?`Cases`:`Branches`),1),(R(!0),G(H,null,K(s.value,e=>(R(),G(`div`,{key:e,class:`flex items-center gap-2`},[M(z(O),{"model-value":e,class:N(o.value===`switch`&&`font-mono`),"aria-label":`${o.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>f(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),M(z(Z),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:s.value.length<=c.value,onClick:t=>f(`delete`,e)},{default:j(()=>[M(z(zn))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),W(`div`,GH,[M(z(O),{modelValue:u.value,"onUpdate:modelValue":n[3]||=e=>u.value=e,"aria-label":o.value===`switch`?`New case value`:`New branch name`,placeholder:o.value===`switch`?`Value, or default`:`Branch name`,onKeydown:n[4]||=Ot(Dt(e=>f(`add`,u.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),M(z(Z),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":o.value===`switch`?`Add case`:`Add branch`,disabled:!u.value.trim(),onClick:n[5]||=e=>f(`add`,u.value.trim())},{default:j(()=>[M(z(En))]),_:1},8,[`aria-label`,`disabled`])]),d.value?(R(),G(`p`,KH,V(d.value),1)):L(``,!0)])):L(``,!0),b.value.lead?(R(),G(`section`,qH,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:b.value.lead.schema.description},[A(V(pe(b.value.lead.key,b.value.lead.schema))+` `,1),b.value.lead.schema.description?(R(),q(z(an),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,JH),b.value.lead.kind===`workflow`?(R(),q(pH,{key:0,value:me(b.value.lead.key),workflows:e.workflows,label:pe(b.value.lead.key,b.value.lead.schema),onPick:n[6]||=e=>T(b.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):b.value.lead.kind===`select`?(R(),G(`select`,{key:1,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:me(b.value.lead.key),onChange:n[7]||=e=>w(b.value.lead.key,e.target.value||void 0)},[n[19]||=W(`option`,{value:``},`Default`,-1),(R(!0),G(H,null,K(b.value.lead.options,e=>(R(),G(`option`,{key:e,value:e},V(e),9,XH))),128))],40,YH)):b.value.lead.kind===`text`?(R(),q(z(Bl),{key:2,"model-value":me(b.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:n[8]||=e=>ce.value=b.value.lead.key,"onUpdate:modelValue":n[9]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])):(R(),q(z(O),{key:3,"model-value":me(b.value.lead.key),onFocus:n[10]||=e=>ce.value=b.value.lead.key,"onUpdate:modelValue":n[11]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])),h.value.length&&b.value.lead.kind!==`select`?(R(),G(`div`,ZH,[n[20]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(R(!0),G(H,null,K(h.value,e=>(R(),G(H,{key:e},[W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>le(e,`summary`)},V(e),9,QH),W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>le(e,`result`)},V(e)+`.result`,9,$H)],64))),128))])):L(``,!0)])):L(``,!0),b.value.compact.length?(R(),G(`section`,eU,[(R(!0),G(H,null,K(b.value.compact,t=>(R(),G(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[A(V(pe(t.key,t.schema))+` `,1),t.schema.description?(R(),q(z(an),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,tU),t.kind===`workflow`?(R(),q(pH,{key:0,class:`max-w-48`,value:me(t.key),workflows:e.workflows,label:pe(t.key,t.schema),onPick:e=>T(t.key,e)},null,8,[`value`,`workflows`,`label`,`onPicLine 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=UB(HB(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=UB(HB(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 qB(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new RB||null,prettyErrors:t}}function JB(e,t={}){let{lineCounter:n,prettyErrors:r}=qB(t),i=new KB(n?.addNewLine),a=new wB(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 Bz(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Hz(e,n)),o.warnings.forEach(Hz(e,n))),o}function YB(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=JB(e,n);if(!i)return null;if(i.warnings.forEach(e=>vR(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 XB(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 pL(e)&&!r?e.toString(n):new Lz(e,r,n).toString(n)}var ZB=e=>typeof e==`object`&&!!e&&!Array.isArray(e),QB=e=>ZB(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function $B(e){if(ZB(e)){if(ZB(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:QB(e.parallel)};if(ZB(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:QB(e.switch.cases)}}}function eV(e){return e.slice(2).includes(`parallel`)}function tV(e,t){let n=JB(e).getIn(t,!0);if(mL(n))return n.toJSON()}function nV(e,t,n){let r=JB(e);return r.setIn(t,r.createNode(pV(n))),r.toString()}function rV(e,t,n){let r=JB(e),i=t.slice(0,-1),a=eV(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(_L(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!_L(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 iV(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 aV(e,t){let n=e.getIn(t,!0),r=$B(mL(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!mL(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function oV(e,t,n){let r=JB(e),{kind:i,branches:a}=aV(r,t);if(iV(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function sV(e,t,n,r){let i=JB(e),{kind:a,branches:o}=aV(i,t);if(iV(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>gL(e.key)&&e.key.value===n);if(!s||!gL(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function cV(e,t,n){let r=JB(e),{kind:i,branches:a}=aV(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 DV(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(CV)].map(e=>e[1]))]}function OV(e){let t=JB(e).toJS(),n=wV(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=wV(e)?e:{},p=$B(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=wV(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,title:g||SV(m),type:m,role:gV(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:TV(m,h),summary:EV(h),when:typeof d.when==`string`?d.when:void 0,retry:wV(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 DV([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=$B(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*yV,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=wV(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*bV,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*yV,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*yV},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*yV-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*bV;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*yV-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*yV,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*yV-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 kV={agent:Jt,command:Ln,repo:dn,gate:Nn,forge:yn,human:Hn,review:ln,workflow:Gn},AV={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function jV(e){return e===`parallel`?dn:e===`switch`?Fn:kV[e.split(`.`)[0]]??Gn}function MV(e){return Object.keys(AV).map(t=>({title:AV[t],icon:kV[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function NV(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 PV(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function FV(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 IV(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=FV(e,r.type))}return n}var LV=A({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(z(),J(B(Ml),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:M(()=>[N(B(zl),{"aria-label":e.label},{default:M(()=>[N(B(Bl),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),N(B(Nl),null,{default:M(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(z(),J(B(Il),{key:0,value:e.value,disabled:``},{default:M(()=>[j(H(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):R(``,!0),(z(!0),K(U,null,q(e.workflows,e=>(z(),J(B(Il),{key:e.id,value:e.id},{default:M(()=>[j(H(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function RV(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function zV(e,t=[]){let n=JB(e),r=n.errors[0];if(r)return{ok:!1,message:$V(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!eH(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`stLine truncated
`).map((e,t)=>({number:t+1,text:e,tokens:YV(e)}))}var qV=/^(\s*)(-\s+)?/,JV=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function YV(e){let{code:t,comment:n}=XV(e),r=ZV(t);return n&&r.push({text:n,kind:`comment`}),r}function XV(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 ZV(e){if(!e)return[];let t=[],n=qV.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=JV.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,...QV(i[4]??``)]):[...t,...QV(r)]}function QV(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 $V(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function eH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function tH(e){return typeof e==`string`&&e.trim()!==``}var nH={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},rH={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},iH={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},aH={class:`min-w-0 flex-1`},oH={class:`truncate font-mono text-[11px] text-fg-subtle`},sH={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},cH={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},lH={key:1,class:`space-y-3`},uH={key:0,class:`block space-y-1.5`},dH={id:`switch-on`},fH=[`value`],pH={class:`text-xs font-medium text-muted-foreground`},mH={class:`flex items-center gap-2`},hH={key:1,role:`alert`,class:`text-xs text-danger`},gH={key:2,class:`space-y-1.5`},_H=[`title`],vH={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},yH={key:3,class:`divide-y divide-border rounded-md border border-border`},bH=[`title`],xH={key:0,class:`space-y-3`},SH={class:`text-[13px]`},CH={key:0,class:`text-danger`},wH={class:`ml-2 text-xs text-fg-subtle`},TH={key:1,class:`space-y-3`},EH={class:`text-[13px]`},DH={class:`ml-2 text-xs text-fg-subtle`},OH=[`title`],kH={key:0,class:`text-xs text-danger`},AH={class:`space-y-2`},jH={class:`divide-y divide-border rounded-md border border-border`},MH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},NH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},PH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},FH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},IH={class:`flex items-center border-t border-border px-4 py-2.5`},LH=A({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=L(()=>tV(n.yaml,n.path)??{}),a=L(()=>$B(i.value)),o=L(()=>a.value?.kind??(typeof i.value.type==`string`?i.value.type:``)),s=L(()=>a.value?.branches.map(([e])=>e)??[]),c=L(()=>o.value===`parallel`?2:1);function l(e){r(`update:yaml`,nV(n.yaml,n.path,{...i.value,switch:{...i.value.switch,on:e}}))}let u=Y(``),d=Y(``);function f(e,t,i=``){try{let a=e===`add`?oV(n.yaml,n.path,t):e===`rename`?sV(n.yaml,n.path,t,i):cV(n.yaml,n.path,t);r(`update:yaml`,a),u.value=``,d.value=``}catch(e){d.value=String(e.message)}}let p=L(()=>n.vocabulary.find(e=>e.name===o.value)),m=L(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),h=L(()=>fV(n.yaml,n.path)),g=L(()=>p.value?.settings&&i.value.settings?WV(i.value.settings,p.value.settings,`settings`):``),_=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],v=/mission|body|detail|plan|rules/;function y(e,t){return[`workflow.call`,`workflow.handoff`].includes(o.value)&&e===`workflow`||o.value===`human.approve`&&e===`then`?`workflow`:o.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:v.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let b=L(()=>{let e=Object.entries(p.value?.settings?.properties??{}).filter(([e])=>o.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:y(e,t),options:o.value===`agent.run`&&e===`model`?n.modelAliases:t.enum??[]})),t=e.filter(e=>_.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>_.indexOf(e.key)-_.indexOf(t.key))[0],r=e.filter(e=>e!==t);return{lead:t,compact:r.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:r.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function x(e){let{id:t,type:i,...a}=e;r(`update:yaml`,nV(n.yaml,n.path,{id:t,type:i,...a}))}function S(e,t){x({...i.value,[e]:t})}function C(e){S(`retry`,{...i.value.retry,...e})}function w(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,x({...i.value,settings:n})}function ee(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&t!==m.value[e]&&(delete n.inputs,delete n.outputs),x({...i.value,settings:n})}let T=L(()=>n.workflows.find(e=>e.id===m.value.workflow)),te=L(()=>Object.entries(mV(T.value?.yaml??``,`inputs`)??{})),E=L(()=>Object.entries(mV(T.value?.yaml??``,`outputs`)??{})),ne=L(()=>Object.entries(mV(n.yaml,`inputs`)??{})),D=L(()=>Object.entries(mV(n.yaml,`outputs`)??{})),re=L(()=>m.value.inputs??{}),O=L(()=>m.value.outputs??{}),ie=e=>typeof e==`string`&&e.startsWith(`inputs.`),ae=e=>re.value[e]===void 0?``:String(re.value[e]);function oe(e,t,n){w(`inputs`,{...re.value,[e]:t===``?void 0:ie(t)?t:FV(t,n??`string`)})}let se=Y(null);function ce(e,t){let n=se.value??b.value.lead?.key;if(!n)return;let r=typeof m.value[n]==`string`?m.value[n]:``,i=`{{ steps.${e}.${t} }}`;w(n,r?`${r.trimEnd()} ${i}`:i)}let le=Y({});function ue(e,t){try{w(e,t.trim()?YB(t):void 0),le.value={...le.value,[e]:``}}catch(t){le.valu Line truncated
`)[0]}}}let de=e=>e===void 0?``:XB(e).trimEnd(),fe=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),pe=e=>typeof m.value[e]==`string`?m.value[e]:``;return(t,n)=>(z(),K(`aside`,nH,[G(`header`,rH,[G(`span`,iH,[(z(),J(He(B(jV)(o.value)),{class:`size-4`}))]),G(`div`,aH,[N(B(k),{"model-value":i.value.id??``,class:`h-7 truncate border-transparent px-1 font-medium shadow-none hover:border-input dark:bg-transparent`,placeholder:B(SV)(o.value),"aria-label":`Step id`,"onUpdate:modelValue":n[0]||=e=>S(`id`,String(e))},null,8,[`model-value`,`placeholder`]),G(`div`,oH,H(o.value),1)]),N(B(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:n[1]||=e=>r(`close`)},{default:M(()=>[N(B(qn))]),_:1})]),G(`div`,sH,[g.value?(z(),K(`p`,cH,H(g.value),1)):R(``,!0),a.value?(z(),K(`section`,lH,[o.value===`switch`?(z(),K(`label`,uH,[n[18]||=G(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),N(B(k),{"model-value":a.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`switch-on`,onChange:n[2]||=e=>l(e.target.value.trim())},null,8,[`model-value`]),G(`datalist`,dH,[(z(!0),K(U,null,q(h.value,e=>(z(),K(`option`,{key:e,value:`steps.${e}.result.`},null,8,fH))),128))])])):R(``,!0),G(`div`,pH,H(o.value===`switch`?`Cases`:`Branches`),1),(z(!0),K(U,null,q(s.value,e=>(z(),K(`div`,{key:e,class:`flex items-center gap-2`},[N(B(k),{"model-value":e,class:P(o.value===`switch`&&`font-mono`),"aria-label":`${o.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>f(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),N(B(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:s.value.length<=c.value,onClick:t=>f(`delete`,e)},{default:M(()=>[N(B(zn))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),G(`div`,mH,[N(B(k),{modelValue:u.value,"onUpdate:modelValue":n[3]||=e=>u.value=e,"aria-label":o.value===`switch`?`New case value`:`New branch name`,placeholder:o.value===`switch`?`Value, or default`:`Branch name`,onKeydown:n[4]||=vt(St(e=>f(`add`,u.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),N(B(X),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":o.value===`switch`?`Add case`:`Add branch`,disabled:!u.value.trim(),onClick:n[5]||=e=>f(`add`,u.value.trim())},{default:M(()=>[N(B(En))]),_:1},8,[`aria-label`,`disabled`])]),d.value?(z(),K(`p`,hH,H(d.value),1)):R(``,!0)])):R(``,!0),b.value.lead?(z(),K(`section`,gH,[G(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:b.value.lead.schema.description},[j(H(fe(b.value.lead.key,b.value.lead.schema))+` `,1),b.value.lead.schema.description?(z(),J(B(an),{key:0,class:`size-3 text-fg-subtle`})):R(``,!0)],8,_H),b.value.lead.kind===`workflow`?(z(),J(LV,{key:0,value:pe(b.value.lead.key),workflows:e.workflows,label:fe(b.value.lead.key,b.value.lead.schema),onPick:n[6]||=e=>ee(b.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):b.value.lead.kind===`select`?(z(),J(B(jI),{key:1,size:`sm`,class:`w-full`,"model-value":pe(b.value.lead.key),"onUpdate:modelValue":n[7]||=e=>w(b.value.lead.key,String(e)||void 0)},{default:M(()=>[N(B(MI),{value:``},{default:M(()=>[...n[19]||=[j(`Default`,-1)]]),_:1}),(z(!0),K(U,null,q(b.value.lead.options,e=>(z(),J(B(MI),{key:e,value:e},{default:M(()=>[j(H(e),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])):b.value.lead.kind===`text`?(z(),J(B(ru),{key:2,"model-value":pe(b.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:n[8]||=e=>se.value=b.value.lead.key,"onUpdate:modelValue":n[9]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])):(z(),J(B(k),{key:3,"model-value":pe(b.value.lead.key),onFocus:n[10]||=e=>se.value=b.value.lead.key,"onUpdate:modelValue":n[11]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])),h.value.length&&b.value.lead.kind!==`select`?(z(),K(`div`,vH,[n[20]||=G(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(z(!0),K(U,null,q(h.value,e=>(z(),K(U,{key:e},[N(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>ce(e,`summary`)},{default:M(()=>[j(H(e),1)]),_:2},1032,[`onClick`]),N(B(X),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>ce(e,`result`)},{default:M(()=>[j(H(e)+`.result`,1)]),_:2},1032,[`onClick`])],64))),128))])):R(``,!0)])):R(``,!0),b.value.compact.length?(z(),K(`section`,yH,[(z(!0),K(U,null,q(b.value.compact,t=>(z(),K(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[G(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[j(H(fe(t.key,t.schema))+` `,1),t.schema.description?(z(),J(B(an),{key:0,class:`size-3 text-fg-subtle`})):R(``,!0)],8,bH),t.kind===`workflow`?(z(),J(LV,{key:0,class:`max-w-48`,value:pe(t.key),workflows:e.workflows,label:fe(t.key,t.schema),onPick:e=>ee(t.key,e)},null,8,[`vLine truncated
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>w(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(R(),G(H,{key:2},[M(z(Bl),{"model-value":fe(m.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>de(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),ue.value[e.key]?(R(),G(`span`,xU,V(ue.value[e.key]),1)):L(``,!0)],64))]))),128)),W(`section`,SU,[n[33]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,CU,[W(`label`,wU,[n[28]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),W(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:n[12]||=e=>S(`when`,e.target.value)},null,40,TU)]),W(`label`,EU,[n[30]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),W(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:n[13]||=e=>S(`on_failure`,e.target.value||void 0)},[...n[29]||=[W(`option`,{value:``},`Park the task`,-1),W(`option`,{value:`continue`},`Continue`,-1)]],40,DU)]),W(`label`,OU,[n[31]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),W(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:n[14]||=e=>C({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,kU)]),W(`label`,AU,[n[32]||=W(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),M(z(Tm),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>C({backoff:e||void 0})},null,8,[`model-value`])])])])]),W(`footer`,jU,[M(z(Z),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:j(()=>[M(z(zn)),n[34]||=A(`Delete step`,-1)]),_:1}),M(z(Z),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:j(()=>[...n[35]||=[A(`Done`,-1)]]),_:1})])]))}}),NU=`repository_path`;function PU(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:NU,path:n.trim(),type:`string`,required:!0}),r}function FU(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function IU(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=FU(Ay(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function LU(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:Ay(e.value,i.type??`string`)})}return n}function RU(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function zU(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...zU(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...zU(n,r)]}):[]}function BU(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function VU(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function HU(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var UU={class:`flex h-full flex-col`},WU={class:`flex items-center gap-2 border-b border-border px-4 py-3`},GU={class:`min-w-0 flex-1 truncate text-sm font-medium`},KU={key:0,class:`flex flex-1 items-center justify-center`},qU={class:`space-y-1.5`},JU=[`disabled`],YU=[`value`],XU={key:1,class:`space-y-1.5`},ZU=[`value`],QU=[`title`],$U={class:`space-y-1.5`},eW={id:`bind-paths`},tW=[`value`],nW={class:`divide-y divide-border rounded-md border border-border`},rW={class:`flex items-center gap-1.5 text-xs`},iW={class:`font-mono`},aW={class:`text-fg-subtle`},oW={key:0,class:`text-danger`,title:`Required`},sW=[`title`,`aria-label`,`onClick`],cW=[`onUpdate:modelValue`,`aria-label`],lW=[`onUpdate:modelValue`,`aria-label`],uW={key:2,class:`text-xs text-danger`},dW=[`title`],fW={key:0,class:`space-y-1 px-3 py-2`},pW={key:0,class:`text-xs text-danger`},mW={key:1,class:`truncate font-mono text-xs text-success`},hW={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},gW={class:`space-y-2`},_W={key:0,role:`alert`,class:`text-xs text-danger`},vW={key:1,clas Line truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(z(),K(U,{key:2},[N(B(ru),{"model-value":de(m.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>ue(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),le.value[e.key]?(z(),K(`span`,kH,H(le.value[e.key]),1)):R(``,!0)],64))]))),128)),G(`section`,AH,[n[37]||=G(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),G(`div`,jH,[G(`label`,MH,[n[31]||=G(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),N(B(k),{class:`h-7 w-48 font-mono text-xs`,placeholder:`always`,"model-value":i.value.when??``,"onUpdate:modelValue":n[12]||=e=>S(`when`,String(e))},null,8,[`model-value`])]),G(`label`,NH,[n[34]||=G(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),N(B(jI),{size:`sm`,"model-value":i.value.on_failure??``,"onUpdate:modelValue":n[13]||=e=>S(`on_failure`,String(e)||void 0)},{default:M(()=>[N(B(MI),{value:``},{default:M(()=>[...n[32]||=[j(`Park the task`,-1)]]),_:1}),N(B(MI),{value:`continue`},{default:M(()=>[...n[33]||=[j(`Continue`,-1)]]),_:1})]),_:1},8,[`model-value`])]),G(`label`,PH,[n[35]||=G(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),N(B(k),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 text-right text-[13px]`,"model-value":i.value.retry?.attempts??``,"onUpdate:modelValue":n[14]||=e=>C({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),G(`label`,FH,[n[36]||=G(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),N(B(Ch),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>C({backoff:e||void 0})},null,8,[`model-value`])])])])]),G(`footer`,IH,[N(B(X),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:M(()=>[N(B(zn)),n[38]||=j(`Delete step`,-1)]),_:1}),N(B(X),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:M(()=>[...n[39]||=[j(`Done`,-1)]]),_:1})])]))}}),RH=`repository_path`;function zH(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:RH,path:n.trim(),type:`string`,required:!0}),r}function BH(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function VH(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=BH(ab(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function HH(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:ab(e.value,i.type??`string`)})}return n}function UH(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function WH(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...WH(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...WH(n,r)]}):[]}function GH(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function KH(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function qH(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var JH={class:`flex h-full flex-col`},YH={class:`flex items-center gap-2 border-b border-border px-4 py-3`},XH={class:`min-w-0 flex-1 truncate text-sm font-medium`},ZH={key:0,class:`flex flex-1 items-center justify-center`},QH={class:`space-y-1.5`},$H={key:1,class:`space-y-1.5`},eU=[`title`],tU={class:`space-y-1.5`},nU={id:`bind-paths`},rU=[`value`],iU={class:`divide-y divide-border rounded-md border border-border`},aU={class:`flex items-center gap-1.5 text-xs`},oU={class:`font-mono`},sU={class:`text-fg-subtle`},cU={key:0,class:`text-danger`,title:`Required`},lU={key:2,class:`text-xs text-danger`},uU=[`title`],dU={key:0,class:`space-y-1 px-3 py-2`},fU={key:0,class:`text-xs text-danger`},pU={key:1,class:`truncate font-mono text-xs text-success`},mU={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},hU={class:`space-y-2`},gU={key:0,role:`alert`,class:`text-xs text-danger`},_U={key:1,class:`text-xs text-fg-subtle`},vU={class:`flex gap-2`},yU=`__new__`,bU=A({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i= 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 lQ(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=uQ(n.code,e);return Array.isArray(e)?e.some(e=>cQ(n[r],e,t,n.type===`keyup`)):cQ(n[r],e,t,n.type===`keyup`)}}function uQ(e,t){return t.includes(e)?`code`:`key`}function dQ(e,t){let n=I(()=>ze(t?.target)??aQ),r=qe(ze(e)===!0),i=!1,a=new Set,o=c(ze(e));F(()=>ze(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),rK([`blur`,`contextmenu`],s),aK((...e)=>o(...e),e=>{let n=ze(t?.actInsideInputWithModifier)??!0,a=ze(t?.preventDefault)??!1;if(i=sQ(e),(!i||i&&!n)&&oQ(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}),aK((...e)=>o(...e),e=>{let n=ze(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&oQ(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`?lQ(e,a):e}return r}var fQ=`vue-flow__node-desc`,pQ=`vue-flow__edge-desc`,mQ=`vue-flow__aria-live`,hQ=[`Enter`,` `,`Escape`],gQ={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function _Q(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function vQ(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 yQ(e){return{width:e.offsetWidth,height:e.offsetHeight}}function bQ(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function xQ(e,t){return{x:bQ(e.x,t[0][0],t[1][0]),y:bQ(e.y,t[0][1],t[1][1])}}function SQ(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function CQ(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function wQ(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!CQ(e)}function TQ(e){return wQ(e)&&`computedPosition`in e}function EQ(e){return!Number.isNaN(e)&&Number.isFinite(e)}function DQ(e){return EQ(e.width)&&EQ(e.height)&&EQ(e.x)&&EQ(e.y)}function OQ(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:mt({width:0,height:0}),computedPosition:mt({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:G$(e.data)?e.data:{},events:mt(G$(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function kQ(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:G$(e.data)?e.data:{},events:mt(G$(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function AQ(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 jQ(...e){if(e.length===3){let[t,n,r]=e;return AQ(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>CQ(e)&&e.source===r).map(e=>n.find(t=>wQ(t)&&t.id===e.target))}function MQ(...e){if(e.length===3){let[t,n,r]=e;return AQ(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>CQ(e)&&e.target===r).map(e=>n.find(t=>wQ(t)&&t.id===e.source))}function NQ({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function PQ(e,t){return t.some(t=>CQ(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 FQ({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function IQ({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?O$(s,o):s}function LQ(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 RQ({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function zQ({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function BQ(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=LQ(t,RQ({...r.computedPosition,...r.dimensions}))}return zQ(t)}function VQ(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...IQ(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function XX(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=ZX(n.code,e);return Array.isArray(e)?e.some(e=>YX(n[r],e,t,n.type===`keyup`)):YX(n[r],e,t,n.type===`keyup`)}}function ZX(e,t){return t.includes(e)?`code`:`key`}function QX(e,t){let n=L(()=>je(t?.target)??KX),r=Be(je(e)===!0),i=!1,a=new Set,o=c(je(e));I(()=>je(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),WW([`blur`,`contextmenu`],s),KW((...e)=>o(...e),e=>{let n=je(t?.actInsideInputWithModifier)??!0,a=je(t?.preventDefault)??!1;if(i=JX(e),(!i||i&&!n)&&qX(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}),KW((...e)=>o(...e),e=>{let n=je(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&qX(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=je(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?XX(e,a):e}return r}var $X=`vue-flow__node-desc`,eZ=`vue-flow__edge-desc`,tZ=`vue-flow__aria-live`,nZ=[`Enter`,` `,`Escape`],rZ={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function iZ(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function aZ(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 oZ(e){return{width:e.offsetWidth,height:e.offsetHeight}}function sZ(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function cZ(e,t){return{x:sZ(e.x,t[0][0],t[1][0]),y:sZ(e.y,t[0][1],t[1][1])}}function lZ(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function uZ(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function dZ(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!uZ(e)}function fZ(e){return dZ(e)&&`computedPosition`in e}function pZ(e){return!Number.isNaN(e)&&Number.isFinite(e)}function mZ(e){return pZ(e.width)&&pZ(e.height)&&pZ(e.x)&&pZ(e.y)}function hZ(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:ct({width:0,height:0}),computedPosition:ct({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:MQ(e.data)?e.data:{},events:ct(MQ(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function gZ(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:MQ(e.data)?e.data:{},events:ct(MQ(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function _Z(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 vZ(...e){if(e.length===3){let[t,n,r]=e;return _Z(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>uZ(e)&&e.source===r).map(e=>n.find(t=>dZ(t)&&t.id===e.target))}function yZ(...e){if(e.length===3){let[t,n,r]=e;return _Z(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>uZ(e)&&e.target===r).map(e=>n.find(t=>dZ(t)&&t.id===e.source))}function bZ({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function xZ(e,t){return t.some(t=>uZ(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 SZ({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function CZ({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?hQ(s,o):s}function wZ(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 TZ({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function EZ({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function DZ(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=wZ(t,TZ({...r.computedPosition,...r.dimensions}))}return EZ(t)}function OZ(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...CZ(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= Line truncated
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
Node: ${e}
@@ -147,4 +147,4 @@ Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},S$=class extends Error{constructor(e,...t){super(x$[e]?.call(x$,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function C$(e){return`clientX`in e}function w$(e){return`sourceEvent`in e}function T$(e,t){let n=C$(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 E$=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function D$(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function O$(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var k$=()=>!0;function A$(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function j$(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())vQ(i,_Q(e))>0&&r.push(e);return r}var M$=250;function N$(e,t,n,r){let i=[],a=1/0,o=j$(e,n,t+M$);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}=g$(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 P$(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=k$},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:_}=T$(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=F$(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===eQ.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=R$(t,e,a,p,n,!0)}return b}function F$(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function I$(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function L$(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function R$(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===eQ.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,...g$(o,c,c.position,!0)}:c}var z$={[ZZ.Left]:ZZ.Right,[ZZ.Right]:ZZ.Left,[ZZ.Top]:ZZ.Bottom,[ZZ.Bottom]:ZZ.Top},B$=[`production`,`prod`];function V$(e,...t){H$()&&console.warn(`[Vue Flow]: ${e}`,...t)}function H$(){return!B$.includes(`production`)}function U$(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,...yQ(t)}}):null}function W$(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ft(()=>{o.blur()})):n([e])}function G$(e){return z(e)!==void 0}function K$(e,t,n,r){if(!e||!e.source||!e.target)return n(new S$(b$.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=CQ(e)?e:{...e,id:NQ(e)},i=kQ(i,void 0,r),!PQ(i,t)&&i}function q$(e,t,n,r,i){if(!t.source||!t.target)return i(new S$(b$.EDGE_INVALID,e.id)),!1;if(!n)return i(new S$(b$.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?NQ(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function J$(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!wQ(o)){n(new S$(b$.NODE_INVALID,o?.id));continue}let s=OQ(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 S$(b$.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 Y$(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function X$(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;Y$(`source`,o,`${r}-${a}--Line truncated
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},lQ=class extends Error{constructor(e,...t){super(cQ[e]?.call(cQ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function uQ(e){return`clientX`in e}function dQ(e){return`sourceEvent`in e}function fQ(e,t){let n=uQ(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 pQ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function mQ(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function hQ(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var gQ=()=>!0;function _Q(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function vQ(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())aZ(i,iZ(e))>0&&r.push(e);return r}var yQ=250;function bQ(e,t,n,r){let i=[],a=1/0,o=vQ(e,n,t+yQ);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}=rQ(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 xQ(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=gQ},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:_}=fQ(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=SQ(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===VX.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=TQ(t,e,a,p,n,!0)}return b}function SQ(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function CQ(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function wQ(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function TQ(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===VX.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,...rQ(o,c,c.position,!0)}:c}var EQ={[RX.Left]:RX.Right,[RX.Right]:RX.Left,[RX.Top]:RX.Bottom,[RX.Bottom]:RX.Top},DQ=[`production`,`prod`];function OQ(e,...t){kQ()&&console.warn(`[Vue Flow]: ${e}`,...t)}function kQ(){return!DQ.includes(`production`)}function AQ(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,...oZ(t)}}):null}function jQ(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ot(()=>{o.blur()})):n([e])}function MQ(e){return B(e)!==void 0}function NQ(e,t,n,r){if(!e||!e.source||!e.target)return n(new lQ(sQ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=uZ(e)?e:{...e,id:bZ(e)},i=gZ(i,void 0,r),!xZ(i,t)&&i}function PQ(e,t,n,r,i){if(!t.source||!t.target)return i(new lQ(sQ.EDGE_INVALID,e.id)),!1;if(!n)return i(new lQ(sQ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?bZ(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function FQ(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!dZ(o)){n(new lQ(sQ.NODE_INVALID,o?.id));continue}let s=hZ(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 lQ(sQ.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 IQ(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 LQ(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}`;IQ(`source`,o,`${r}-${a}--Line truncated
+1 -1
View File
@@ -34,7 +34,7 @@
</script>
<script type="module" crossorigin src="/assets/index.js"></script>
<link rel="modulepreload" crossorigin href="/assets/PageHeader.js">
<link rel="modulepreload" crossorigin href="/assets/badge.js">
<link rel="modulepreload" crossorigin href="/assets/alert.js">
<link rel="modulepreload" crossorigin href="/assets/HistoryLink.js">
<link rel="stylesheet" crossorigin href="/assets/index.css">
</head>
+8 -13
View File
@@ -1,19 +1,22 @@
<script setup lang="ts">
import { onMounted } from "vue";
import { computed, onMounted } from "vue";
import ChatLauncher from "@/chat/ChatLauncher.vue";
import CommandPalette from "@/components/command-palette/CommandPalette.vue";
import Topbar from "@/components/topbar/Topbar.vue";
import SettingsShell from "@/settings/SettingsShell.vue";
import { TooltipProvider } from "@/components/ui/tooltip";
import { hidden, loadCapabilities } from "@/lib/capabilities";
import { hiddenPaths } from "@/lib/nav";
import { loadTaskMeta } from "@/lib/task-meta";
import { useSessionStore } from "@/stores/session";
const session = useSessionStore();
const hidden = computed(() => hiddenPaths(session.sections));
onMounted(() => {
// Asked for once, after the shell is up: the nav paints immediately and
// loses the entries this process cannot back a moment later, rather than
// holding the page behind a request. A failed read hides nothing.
void loadCapabilities();
void session.loadCapabilities();
// The lifecycle vocabulary -- status labels, pill severity, "needs you"
// grouping, and the operator actions -- is served by /api/task-meta. Asked
@@ -41,7 +44,7 @@ onMounted(() => {
class="flex min-h-[calc(100vh-2rem)] flex-col overflow-clip rounded-xl border border-[var(--hairline)] bg-[var(--workspace)] shadow-[var(--shadow-workspace)] backdrop-blur-[28px] backdrop-saturate-[1.2] max-lg:min-h-screen max-lg:rounded-none max-lg:border-0 max-lg:shadow-none"
>
<Topbar :hidden="hidden" />
<main class="w-full flex-1 overflow-x-clip p-8 max-lg:p-4">
<main class="w-full flex-1 overflow-x-clip px-6 py-5 max-lg:p-4">
<!--
Keyed on the path and its parameters but not the query: a query-only
change is an entry state, so the page keeps the operator's filters,
@@ -65,13 +68,5 @@ onMounted(() => {
ride off the bottom of a long page.
-->
<ChatLauncher />
<!--
Outside the shell for the same reason as the launcher above: the frame's
backdrop-filter would otherwise become the containing block for the
palette's fixed overlay. One instance for the whole app -- its global
shortcut listener lives and dies with this mount.
-->
<CommandPalette :hidden="hidden" />
</TooltipProvider>
</template>
+5 -7
View File
@@ -7,7 +7,7 @@ import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { api } from "@/lib/api";
import { useLiveUpdatesStore } from "@/stores/live-updates";
import { useSessionStore } from "@/stores/session";
import { groupBySeverity, type AlertSeverity, type OperatorAlert } from "./alerts";
const alerts = ref<OperatorAlert[]>([]);
@@ -35,7 +35,7 @@ async function dismiss(alert: OperatorAlert) {
// The bell follows the event stream: the store records every alert change as
// an event, so the newest alert event's id moving means the list moved. A
// reconnect re-reads, since events may have been missed while it was down.
const live = useLiveUpdatesStore();
const live = useSessionStore();
const { activity, connectionRevision } = storeToRefs(live);
watch(() => activity.value.find((event) => event.kind === "alert")?.id, load);
watch(connectionRevision, load);
@@ -67,8 +67,8 @@ function failedDeliveries(alert: OperatorAlert): number {
</Button>
</PopoverTrigger>
<PopoverContent align="end" class="w-96 max-w-[calc(100vw-1.5rem)] p-0">
<p v-if="failed" class="px-3 pt-3 text-xs text-danger" role="alert">Alerts could not be loaded.</p>
<p v-else-if="!groups.length" class="px-3 py-6 text-center text-sm text-fg-subtle">Nothing needs you.</p>
<p v-if="failed" class="px-3 py-6 text-center text-sm text-danger" role="alert">Alerts could not be loaded.</p>
<p v-else-if="!groups.length" class="px-3 py-6 text-center text-sm text-fg-subtle">No alerts.</p>
<div v-else class="max-h-96 overflow-y-auto">
<section v-for="group in groups" :key="group.severity" class="border-b p-3 last:border-b-0">
<h3 class="mb-2 text-xs font-medium text-fg-subtle">{{ group.label }}</h3>
@@ -79,9 +79,7 @@ function failedDeliveries(alert: OperatorAlert): number {
{{ alert.title }}
</RouterLink>
<span v-else class="text-sm font-medium">{{ alert.title }}</span>
<Button variant="ghost" size="sm" class="h-6 shrink-0 px-2 text-xs" @click="dismiss(alert)">
Dismiss
</Button>
<Button variant="ghost" size="xs" class="shrink-0" @click="dismiss(alert)">Dismiss</Button>
</div>
<p v-if="alert.body" class="text-xs text-fg-subtle">{{ alert.body }}</p>
<p class="text-xs text-fg-subtle">
+5 -8
View File
@@ -1,16 +1,13 @@
<script setup lang="ts">
/**
* The shared page title and its actions. A component rather than per-page
* markup because hand-built copies drift.
*/
/** Every page's title, with its actions on the same line. */
defineProps<{ title: string }>();
</script>
<template>
<div class="mb-6 flex flex-wrap items-start justify-between gap-5">
<h1 class="text-2xl font-semibold tracking-[-0.02em]">{{ title }}</h1>
<div class="flex flex-wrap items-center gap-2">
<header class="mb-4 flex min-h-9 flex-wrap items-center justify-between gap-x-4 gap-y-2">
<h1 class="text-xl font-semibold tracking-tight">{{ title }}</h1>
<div v-if="$slots.default" class="flex flex-wrap items-center gap-2">
<slot />
</div>
</div>
</header>
</template>
-53
View File
@@ -1,53 +0,0 @@
<script setup lang="ts">
import { computed } from "vue";
/**
* Inline SVG sparkline. Shows shape, not exact values: the tile's headline
* number carries the precision.
*/
const props = withDefaults(
defineProps<{
series: number[];
stroke?: string;
width?: number;
height?: number;
}>(),
{ stroke: "var(--ok)", width: 220, height: 34 },
);
const points = computed(() => {
const max = Math.max(...props.series, 1);
const min = Math.min(...props.series, 0);
const span = max - min || 1;
const step =
props.series.length > 1
? props.width / (props.series.length - 1)
: props.width;
return props.series
.map(
(v, i) =>
`${(i * step).toFixed(1)},${(props.height - ((v - min) / span) * props.height).toFixed(1)}`,
)
.join(" ");
});
</script>
<template>
<svg
class="mt-3 block h-[34px] w-full"
:viewBox="`0 0 ${props.width} ${props.height}`"
preserveAspectRatio="none"
aria-hidden="true"
>
<polyline
:points="points"
fill="none"
:stroke="props.stroke"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
vector-effect="non-scaling-stroke"
/>
</svg>
</template>
-81
View File
@@ -1,81 +0,0 @@
<script setup lang="ts">
import { TrendingDown, TrendingUp } from "@lucide/vue";
import { computed } from "vue";
import { Badge } from "@/components/ui/badge";
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import Sparkline from "./Sparkline.vue";
/**
* A KPI tile: label, big value, trend against a stated comparison window, and
* a sparkline. The comparison line is not decoration -- a number without a
* baseline cannot be acted on, so `compare` is required.
*
* trend > 0 renders as an increase. `goodDirection` says whether that is good,
* because rising latency and rising success rate are not the same news.
*
* The headline value is rendered whatever its type, including 0 and "": a tile
* that showed a label and a comparison line with no number above them read as
* a broken dashboard on every fresh install.
*/
const props = withDefaults(
defineProps<{
label: string;
value: string | number;
unit?: string;
trend?: number | null;
compare: string;
series?: number[];
goodDirection?: "up" | "down";
}>(),
{ series: () => [], goodDirection: "up" },
);
const dir = computed(() =>
props.trend == null ? null : props.trend >= 0 ? "up" : "down",
);
const good = computed(() =>
dir.value == null ? null : dir.value === props.goodDirection,
);
const trendIcon = computed(() =>
dir.value === "up" ? TrendingUp : TrendingDown,
);
const trendLabel = computed(() => `${Math.abs(props.trend ?? 0).toFixed(1)}%`);
</script>
<template>
<Card>
<CardHeader>
<CardTitle>{{ props.label }}</CardTitle>
<CardDescription v-if="props.compare">{{
props.compare
}}</CardDescription>
<CardAction v-if="dir">
<Badge :variant="good ? 'ok' : 'danger'">
<component :is="trendIcon" />
{{ trendLabel }}
</Badge>
</CardAction>
</CardHeader>
<CardContent>
<div class="text-3xl font-semibold tracking-[-0.03em]">
{{ props.value
}}<span v-if="props.unit" class="ml-1 text-lg text-fg-muted">{{
props.unit
}}</span>
</div>
<Sparkline
v-if="props.series.length > 1"
:series="props.series"
:stroke="good === false ? 'var(--danger)' : 'var(--ok)'"
/>
</CardContent>
</Card>
</template>
+5 -12
View File
@@ -140,9 +140,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
<DialogContent class="max-h-[85vh] overflow-y-auto sm:max-w-lg">
<DialogHeader>
<DialogTitle>{{ title }}</DialogTitle>
<DialogDescription>
Editing returns this binding to pending approval.
</DialogDescription>
<DialogDescription>Editing returns this binding to pending approval.</DialogDescription>
</DialogHeader>
<form @submit.prevent="emit('save', draft)">
@@ -232,8 +230,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
</Field>
<Field v-for="[name, spec] in declaredInputs" :key="name">
<FieldLabel :for="`binding-input-${name}`">
Input <span class="font-mono">{{ name }}</span>
<FieldLabel :for="`binding-input-${name}`">Input <span class="font-mono">{{ name }}</span>
<span class="text-fg-muted"
>({{ spec.type }}{{ spec.required ? ", required" : "" }})</span
>
@@ -283,8 +280,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
v-for="field in stringParams"
:key="field.name"
:value="field.name"
>
Parameter {{ field.name }}
>Parameter {{ field.name }}
</SelectItem>
</SelectGroup>
</SelectContent>
@@ -306,9 +302,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
<Input id="binding-repo" v-model="draft.repo" />
</Field>
</div>
<FieldDescription>
Both or neither; blank uses the configured repo.
</FieldDescription>
<FieldDescription>Both or neither; blank uses the configured repo.</FieldDescription>
</Field>
</FieldGroup>
@@ -329,8 +323,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
>Cancel</Button
>
<Button type="submit" :disabled="props.saving">
<Spinner v-if="props.saving" data-icon="inline-start" />
{{ props.saving ? "Saving" : "Save" }}
<Spinner v-if="props.saving" data-icon="inline-start" />{{ props.saving ? "Saving" : "Save" }}
</Button>
</DialogFooter>
</form>
+5 -10
View File
@@ -79,8 +79,7 @@ const emit = defineEmits<{
@click="emit('edit', props.binding)"
>
<Pencil data-icon="inline-start" />
Edit
</Button>
Edit</Button>
<!-- Only a pending binding can be approved. An armed binding is
already firing, so the button would be a no-op -- or worse, a
misleading one. -->
@@ -90,8 +89,7 @@ const emit = defineEmits<{
@click="emit('approve', props.binding)"
>
<Check data-icon="inline-start" />
Approve
</Button>
Approve</Button>
<Button
v-if="props.binding.status === 'armed'"
variant="outline"
@@ -99,8 +97,7 @@ const emit = defineEmits<{
@click="emit('pause', props.binding)"
>
<Pause data-icon="inline-start" />
Pause
</Button>
Pause</Button>
<!-- Resuming returns the binding to pending approval, so it is
approved again before it fires. -->
<Button
@@ -110,16 +107,14 @@ const emit = defineEmits<{
@click="emit('resume', props.binding)"
>
<Play data-icon="inline-start" />
Resume
</Button>
Resume</Button>
<Button
variant="outline"
size="sm"
@click="emit('delete', props.binding)"
>
<Trash2 data-icon="inline-start" />
Delete
</Button>
Delete</Button>
</div>
</TableCell>
</TableRow>
+2 -3
View File
@@ -4,7 +4,7 @@ import { onMounted, ref } from "vue";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { useLiveResource } from "@/stores/live-updates";
import { useLiveResource } from "@/stores/session";
import BindingEditor from "./BindingEditor.vue";
import BindingsTable from "./BindingsTable.vue";
import DeleteBindingDialog from "./DeleteBindingDialog.vue";
@@ -77,8 +77,7 @@ async function handleDelete(binding: Binding): Promise<void> {
<div class="mb-4 flex flex-wrap items-center justify-end gap-2">
<Button v-if="!failure" @click="startCreate">
<Plus data-icon="inline-start" />
New binding
</Button>
New binding</Button>
</div>
<!-- A mutation that failed leaves the list on screen accurate, so its
+1 -3
View File
@@ -62,9 +62,7 @@ const failureTitle = computed(() =>
<Empty v-else-if="!loading && !rows.length">
<EmptyHeader>
<EmptyTitle>No bindings yet</EmptyTitle>
<EmptyDescription>
None yet. A mapping + a workflow make a binding.
</EmptyDescription>
<EmptyDescription>None yet. A mapping + a workflow make a binding.</EmptyDescription>
</EmptyHeader>
</Empty>
+1 -3
View File
@@ -35,9 +35,7 @@ function onOpenChange(open: boolean): void {
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Delete "{{ props.binding?.name }}"?</AlertDialogTitle>
<AlertDialogDescription>
It stops dispatching immediately and cannot be recovered.
</AlertDialogDescription>
<AlertDialogDescription>It stops dispatching immediately and cannot be recovered.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
+1 -3
View File
@@ -79,7 +79,5 @@ const captureLink = (id: string) => ({
<span>{{ ago(d.dispatched_at) }}</span>
</li>
</ul>
<p v-else-if="props.kind !== 'tasks'" class="text-xs text-fg-muted">
No dispatches yet.
</p>
<p v-else-if="props.kind !== 'tasks'" class="text-xs text-fg-muted">No dispatches yet.</p>
</template>
+2 -2
View File
@@ -1,6 +1,6 @@
import { ref } from "vue";
import { eventsWorkspace } from "@/events/workspace";
import { useEventsStore } from "@/stores/events";
import { api, ApiError } from "@/lib/api";
import type { EventType } from "@/captures/event-types";
import {
@@ -56,7 +56,7 @@ export function useBindings() {
failure.value = null;
try {
const [b, m, w, t] = await Promise.all([
api.bindings<{ bindings?: Binding[] }>(eventsWorkspace.value),
api.bindings<{ bindings?: Binding[] }>(useEventsStore().workspace),
api.mappings<{ mappings?: MappingOption[] }>(),
api.workflows<{ definitions?: WorkflowOption[] }>(),
api.eventTypes<{ event_types?: EventType[] }>(),
+1 -3
View File
@@ -111,9 +111,7 @@ function onOpenChange(open: boolean) {
:disabled="saving || !draft.name.trim() || !draft.source.trim()"
@click="saveDraft"
>
<Spinner v-if="saving" />
Save
</Button>
<Spinner v-if="saving" />Save</Button>
</DialogFooter>
</DialogContent>
</Dialog>
+3 -7
View File
@@ -163,9 +163,7 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
<Empty v-if="!proposals.length && !eventTypes.length">
<EmptyHeader>
<EmptyTitle>No event types yet</EmptyTitle>
<EmptyDescription>
Nothing is dispatched until a type matches.
</EmptyDescription>
<EmptyDescription>Nothing is dispatched until a type matches.</EmptyDescription>
</EmptyHeader>
</Empty>
</CardContent>
@@ -182,10 +180,8 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Delete this event type?</AlertDialogTitle>
<AlertDialogDescription>
Events matching "{{ pendingDelete?.name }}" will arrive unidentified
and will not dispatch.
</AlertDialogDescription>
<AlertDialogDescription>Events matching "{{ pendingDelete?.name }}" will arrive unidentified
and will not dispatch.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
+2 -4
View File
@@ -65,8 +65,7 @@ function asOp(value: unknown): PayloadCondition["op"] {
class="w-fit"
@click="headers().push({ name: '', value: '' })"
>
<Plus /> Header
</Button>
<Plus /> Header</Button>
</div>
<div class="flex flex-col gap-2">
@@ -118,8 +117,7 @@ function asOp(value: unknown): PayloadCondition["op"] {
class="w-fit"
@click="payload().push({ path: '', op: 'equals', value: '' })"
>
<Plus /> Payload condition
</Button>
<Plus /> Payload condition</Button>
</div>
</div>
</template>
+2 -2
View File
@@ -1,6 +1,6 @@
import { ref } from "vue";
import { eventsWorkspace } from "@/events/workspace";
import { useEventsStore } from "@/stores/events";
import { api } from "@/lib/api";
import { captures } from "./state";
import {
@@ -48,7 +48,7 @@ export const saveError = ref<string | null>(null);
export async function loadEventTypes(): Promise<void> {
try {
const res = await api.eventTypes<EventTypesResponse>(eventsWorkspace.value);
const res = await api.eventTypes<EventTypesResponse>(useEventsStore().workspace);
eventTypesEnabled.value = res.enabled !== false;
eventTypes.value = res.event_types || [];
proposals.value = res.proposals || [];
+1 -1
View File
@@ -1,7 +1,7 @@
import { ref } from "vue";
import { api } from "@/lib/api";
import { useLiveResource } from "@/stores/live-updates";
import { useLiveResource } from "@/stores/session";
import { loadEventTypes } from "./event-type-state";
/**
+13 -18
View File
@@ -17,7 +17,7 @@ import {
NumberFieldInput,
} from "@/components/ui/number-field";
import { SettingRow } from "@/components/ui/setting-row";
import { StatusPill } from "@/components/ui/status-pill";
import { Badge } from "@/components/ui/badge";
import { Switch } from "@/components/ui/switch";
import {
TagsInput,
@@ -28,8 +28,8 @@ import {
} from "@/components/ui/tags-input";
import { api } from "@/lib/api";
import SecretRefField from "@/settings/SecretRefField.vue";
import { resourcesForPage, useControlPlaneStore } from "@/stores/control-plane";
import { useLiveResource } from "@/stores/live-updates";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import { useLiveResource } from "@/stores/session";
const KIND = "channel-settings";
@@ -55,7 +55,7 @@ interface ChannelStatus {
detail?: string;
}
const store = useControlPlaneStore();
const store = useSettingsStore();
const { catalog, catalogError } = storeToRefs(store);
const resources = computed(() => resourcesForPage(catalog.value, "channels"));
const chat = computed(() => store.drafts[KIND]?.value as ChannelSettings | undefined);
@@ -77,10 +77,10 @@ onMounted(() => Promise.all([loadStatus(), store.load()]));
function statusOf(id: string) {
const state = statuses.value.find((s) => s.id === id)?.state;
if (!state) return undefined;
if (state === "running") return { label: "Running", tone: "neutral", dot: "live" } as const;
if (state === "failed") return { label: "Failed", tone: "danger", dot: "danger" } as const;
if (state === "degraded") return { label: "Degraded", tone: "warn", dot: "warn" } as const;
return { label: state[0]!.toUpperCase() + state.slice(1), tone: "neutral", dot: "idle" } as const;
if (state === "running") return undefined;
if (state === "failed") return { label: "Failed", tone: "danger" } as const;
if (state === "degraded") return { label: "Degraded", tone: "warn" } as const;
return { label: state[0]!.toUpperCase() + state.slice(1), tone: "idle" } as const;
}
// A channel is set up once its enabling field is filled in, the rule the
@@ -135,14 +135,11 @@ const models = computed({
<div class="min-w-0 flex-1">
<h2 :id="`ch-${channel.id}`" class="text-[15px] font-medium">{{ channel.title }}</h2>
</div>
<StatusPill v-if="statusOf(channel.id)" :tone="statusOf(channel.id)!.tone" :dot="statusOf(channel.id)!.dot">
{{ statusOf(channel.id)!.label }}
</StatusPill>
<Badge v-if="configured[channel.id] && statusOf(channel.id)" :variant="statusOf(channel.id)!.tone">{{
statusOf(channel.id)!.label
}}</Badge>
<template v-if="!configured[channel.id]">
<StatusPill>Not set up</StatusPill>
<Button v-if="!opened[channel.id]" variant="outline" size="sm" @click="opened[channel.id] = true">
Set up
</Button>
<Button v-if="!opened[channel.id]" variant="outline" size="sm" @click="opened[channel.id] = true">Set up</Button>
</template>
</header>
@@ -168,9 +165,7 @@ const models = computed({
</section>
<section class="mt-8 rounded-lg border border-border bg-card px-5 pt-4 pb-2" aria-labelledby="ch-defaults">
<h2 id="ch-defaults" class="text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase">
Chat session defaults
</h2>
<h2 id="ch-defaults" class="text-[11px] font-medium tracking-[0.06em] text-fg-subtle uppercase">Chat session defaults</h2>
<SettingRow label="Workspace" for="cs-workspace" hint="Empty disables file tools.">
<Input id="cs-workspace" v-model="chat.workspace" class="max-w-md font-mono" />
</SettingRow>
+1 -1
View File
@@ -23,7 +23,7 @@ defineProps<{ attachment: ChatMedia }>();
:target="attachment.url ? '_blank' : undefined"
:rel="attachment.url ? 'noopener noreferrer' : undefined"
:title="mediaDetail(attachment)"
class="inline-flex max-w-full items-center gap-1.5 rounded-full border border-border bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground"
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-muted-foreground"
>
<Paperclip aria-hidden="true" class="size-3.5 shrink-0" />
<span class="truncate">{{ mediaLabel(attachment) }}</span>
+3 -7
View File
@@ -22,18 +22,14 @@ const PROMPTS = [
class="mx-auto mb-3 grid size-9 place-items-center rounded-xl border border-border-strong font-bold text-link"
>A</span
>
<h2 class="text-lg font-semibold tracking-[-0.02em]">
What are we working on?
</h2>
<p class="mt-2 mb-4 text-sm text-fg-muted">
Ask Archie anything, or start with one of these prompts.
</p>
<h2 class="text-lg font-semibold tracking-[-0.02em]">What are we working on?</h2>
<p class="mt-2 mb-4 text-sm text-fg-muted">Ask Archie anything, or start with one of these prompts.</p>
<div class="grid gap-2">
<button
v-for="prompt in PROMPTS"
:key="prompt"
type="button"
class="rounded-full border border-border bg-muted px-3 py-2 text-left text-sm text-fg-muted transition-colors hover:border-border-strong hover:text-foreground"
class="rounded-md border border-border bg-muted px-3 py-2 text-left text-sm text-fg-muted transition-colors hover:border-border-strong hover:text-foreground"
@click="emit('prompt', prompt)"
>
{{ prompt }}
+1 -1
View File
@@ -18,7 +18,7 @@ defineProps<{ path: string; label?: string }>();
<RouterLink
:to="path"
:title="`Go to ${label || path}`"
class="inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
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"
>
<ArrowUpRight aria-hidden="true" class="size-3.5 shrink-0" />
<span class="truncate">{{ label || path }}</span>
+1 -3
View File
@@ -99,9 +99,7 @@ const bubbles = computed(() => messages.value.map(parts));
size="sm"
class="mt-2"
@click="sendMessage({ turn: streamingTurn.turn })"
>
Retry
</Button>
>Retry</Button>
<ChatAskCard v-if="streamingTurn.ask" :ask="streamingTurn.ask" />
</ChatBubble>
</MessageScrollerItem>
+1 -3
View File
@@ -64,9 +64,7 @@ async function later() {
<p v-else-if="state === 'deferred'" class="mt-2 text-fg-muted">Skipped until a newer release.</p>
<p v-else-if="state === 'done'" class="mt-2 text-ok">{{ result }}</p>
<p v-else class="mt-2 text-danger">{{ result }}</p>
<p v-if="state === 'idle' && !update.can_install" class="mt-2 text-xs text-fg-muted">
This host has no install script, so the update can't be installed from here.
</p>
<p v-if="state === 'idle' && !update.can_install" class="mt-2 text-xs text-fg-muted">This host has no install script, so the update can't be installed from here.</p>
</template>
</div>
</template>
+1 -1
View File
@@ -566,7 +566,7 @@ export async function sendMessage(retryOpts?: RetryOptions): Promise<void> {
turn: turn ? retryChatTurn(turn) : undefined,
isRetry,
};
statusText.value = "Error — retry available";
statusText.value = "Error. Retry available.";
}
} finally {
clearTimeout(timeoutId);
@@ -1,226 +1,139 @@
<script setup lang="ts">
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
import { computed, onMounted, onUnmounted, ref, watch } from "vue";
import { useRouter } from "vue-router";
import { Search } from "@lucide/vue";
import { navEntries, type NavEntry } from "@/lib/nav";
import { Button } from "@/components/ui/button";
import {
CommandDialog,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from "@/components/ui/command";
import { Kbd } from "@/components/ui/kbd";
import { api } from "@/lib/api";
import { navEntries } from "@/lib/nav";
import { statusLabel } from "@/lib/task-meta";
/**
* The command palette: every section the nav can reach, opened with Cmd/Ctrl+K
* or '/' from anywhere. It is a jump list, not a data search -- the topbar's
* SearchBar owns the same list with prefix matching from a visible field; this
* one adds substring matching and arrow-key selection from a shortcut.
*
* Styling and keyboard handling mirror ChatSlashPalette, the in-app palette
* precedent: a bordered popover surface, mousedown prevented on the options so
* choosing with the pointer never steals focus from the filter, and the list
* scrolled so the highlighted row stays visible. Nothing here animates, so the
* shell's prefers-reduced-motion rule has nothing to quiet.
* Jump to a page, a task or a workflow by name. Opened from the top bar, with
* Cmd/Ctrl+K, or with '/' when no field has focus. Tasks and workflows are
* read when the palette opens, so it never shows a stale list for long.
*/
const props = defineProps<{ hidden: string[] }>();
const router = useRouter();
const open = ref(false);
const query = ref("");
const selection = ref(0);
const field = ref<HTMLInputElement | null>(null);
const list = ref<HTMLElement | null>(null);
// The same list the topbar's SearchBar and Nav read: navEntries flattens the
// nav tree and drops what this composition cannot back, so the palette can
// never offer a destination the server cannot serve.
const allEntries = computed(() =>
navEntries(props.hidden).filter((entry) => !entry.soon),
);
// Substring, not prefix: an operator who remembers "where do channels live"
// types a word from the description, not the start of the label.
const matches = computed(() => {
const needle = query.value.trim().toLowerCase();
if (!needle) return allEntries.value;
return allEntries.value.filter((entry) =>
`${entry.label} ${entry.description} ${entry.path}`
.toLowerCase()
.includes(needle),
);
});
watch(query, () => {
selection.value = 0;
});
// Capabilities can land while the palette is open and shrink the list; the
// highlight must not point past the last row.
watch(matches, () => {
if (selection.value >= matches.value.length) selection.value = 0;
});
function optionId(index: number): string {
return `command-palette-option-${index}`;
interface TaskEntry {
id: number | string;
title?: string;
status?: string;
}
async function show(): Promise<void> {
query.value = "";
selection.value = 0;
open.value = true;
await nextTick();
field.value?.focus();
const pages = computed(() => navEntries(props.hidden));
const tasks = ref<TaskEntry[]>([]);
const workflows = ref<string[]>([]);
const shortcut = navigator.platform.startsWith("Mac") ? "⌘K" : "Ctrl K";
const showWorkflows = computed(() => !props.hidden.includes("/workflows"));
// A failed read leaves that group empty: the pages still work, and the
// palette is not the place to report a broken task list.
async function loadEntries(): Promise<void> {
const [taskPage, workflowList] = await Promise.all([
api.taskPage<TaskEntry>({ limit: 100 }).catch(() => null),
showWorkflows.value
? api.workflows<{ definitions?: { id: string }[] }>().catch(() => null)
: null,
]);
tasks.value = taskPage?.tasks ?? [];
workflows.value = (workflowList?.definitions ?? []).map(({ id }) => id);
}
function close(): void {
watch(open, (value) => {
if (value) void loadEntries();
});
function go(path: string): void {
open.value = false;
field.value?.blur();
void router.push(path);
}
function toggle(): void {
if (open.value) close();
else void show();
}
// '/' opens only when the keystroke was meant for a field, not for the page:
// typing a slash into the composer or the topbar search must stay typing.
// '/' opens only when the keystroke was not meant for a field.
function isEditableTarget(event: KeyboardEvent): boolean {
const el = event.target;
return (
el instanceof HTMLElement &&
(el.isContentEditable ||
el.tagName === "INPUT" ||
el.tagName === "TEXTAREA" ||
el.tagName === "SELECT")
(el.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(el.tagName))
);
}
// Registered on document in the bubble phase (capture: false): the palette is
// the last thing that should see a keystroke, after any focused field has had
// its turn.
function onGlobalKeydown(event: KeyboardEvent): void {
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
event.preventDefault();
toggle();
return;
}
if (event.key === "/" && !open.value && !isEditableTarget(event)) {
open.value = !open.value;
} else if (event.key === "/" && !open.value && !isEditableTarget(event)) {
event.preventDefault();
void show();
open.value = true;
}
}
onMounted(() => document.addEventListener("keydown", onGlobalKeydown));
onUnmounted(() => document.removeEventListener("keydown", onGlobalKeydown));
function onKeydown(event: KeyboardEvent): void {
if (event.key === "Escape") {
// Consumed here so closing the palette is not also read as a dismissal of
// whatever is open behind it (ChatLauncher watches defaultPrevented).
event.preventDefault();
close();
return;
}
if (event.key === "ArrowDown") {
event.preventDefault();
if (matches.value.length)
selection.value = Math.min(selection.value + 1, matches.value.length - 1);
return;
}
if (event.key === "ArrowUp") {
event.preventDefault();
selection.value = Math.max(selection.value - 1, 0);
return;
}
if (event.key === "Enter") {
event.preventDefault();
const entry = matches.value[selection.value];
if (entry) choose(entry);
}
}
function choose(entry: NavEntry): void {
void router.push(entry.path);
close();
}
// The pointer and the keyboard share one highlight, so a scroll must never
// move it: when the list scrolls under a stationary pointer (including the
// scrollIntoView below) the browser reports a move with no delta, and
// letting it steal selection puts the highlight on the wrong row.
function onHover(index: number, event: MouseEvent): void {
if (event.movementX === 0 && event.movementY === 0) return;
selection.value = index;
}
// Keep the highlighted row visible once matches run past the rows that fit.
// block: 'nearest' scrolls the minimum distance and never animates, so reduced
// motion needs no handling here. Optional call: not every environment
// implements scrollIntoView.
watch([selection, matches], async () => {
if (!open.value) return;
await nextTick();
list.value
?.querySelector('[aria-selected="true"]')
?.scrollIntoView?.({ block: "nearest" });
});
</script>
<template>
<div v-if="open" class="fixed inset-0 isolate z-50" @mousedown.self="close">
<div
class="bg-black/10 supports-backdrop-filter:backdrop-blur-xs absolute inset-0"
aria-hidden="true"
/>
<div
role="dialog"
aria-label="Command palette"
class="bg-popover text-popover-foreground border-border-strong shadow-md relative mx-auto mt-[15vh] w-[calc(100%-2rem)] max-w-lg overflow-hidden rounded-xl border"
>
<div class="border-border flex items-center gap-2 border-b px-3">
<Search :size="15" class="text-muted-foreground shrink-0" />
<input
ref="field"
v-model="query"
type="text"
role="combobox"
aria-label="Filter sections"
aria-expanded="true"
aria-controls="command-palette-list"
:aria-activedescendant="
matches[selection] ? optionId(selection) : undefined
"
class="h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"
placeholder="Jump to a section…"
@keydown="onKeydown"
/>
</div>
<div
id="command-palette-list"
ref="list"
role="listbox"
aria-label="Sections"
class="max-h-72 overflow-x-hidden overflow-y-auto p-1.5"
>
<button
v-for="(entry, index) in matches"
:id="optionId(index)"
<Button
variant="outline"
size="sm"
class="text-muted-foreground w-44 justify-start max-lg:w-auto"
aria-label="Jump to"
@click="open = true"
>
<Search data-icon="inline-start" />
<span class="max-lg:hidden">Jump to</span>
<Kbd class="ml-auto max-lg:hidden">{{ shortcut }}</Kbd>
</Button>
<CommandDialog v-model:open="open" title="Jump to" description="Find a page, task or workflow.">
<CommandInput placeholder="Find a page, task or workflow" />
<CommandList>
<CommandEmpty>No matches.</CommandEmpty>
<CommandGroup heading="Pages">
<CommandItem
v-for="entry in pages"
:key="entry.path"
type="button"
role="option"
:aria-selected="index === selection"
class="hover:bg-muted aria-selected:bg-muted flex flex-col gap-0.5 rounded-md px-2.5 py-2 text-left outline-none"
@mousedown.prevent
@mousemove="onHover(index, $event)"
@click="choose(entry)"
:value="`page:${entry.path}`"
@select="go(entry.path)"
>
<span class="truncate text-sm text-foreground min-w-0">{{
entry.label
{{ entry.label }}
</CommandItem>
</CommandGroup>
<CommandGroup v-if="workflows.length" heading="Workflows">
<CommandItem
v-for="id in workflows"
:key="id"
:value="`workflow:${id}`"
@select="go(`/workflows?workflow=${encodeURIComponent(id)}`)"
>
{{ id }}
</CommandItem>
</CommandGroup>
<CommandGroup v-if="tasks.length" heading="Tasks">
<CommandItem
v-for="task in tasks"
:key="task.id"
:value="`task:${task.id}`"
@select="go(`/tasks/${task.id}`)"
>
<span class="text-muted-foreground shrink-0 tabular-nums">#{{ task.id }}</span>
<span class="truncate">{{ task.title }}</span>
<span v-if="task.status" class="text-muted-foreground ml-auto shrink-0 text-xs">{{
statusLabel(task.status)
}}</span>
<span
v-if="entry.description"
class="text-fg-muted truncate text-xs min-w-0"
>{{ entry.description }}</span
>
</button>
<p v-if="!matches.length" class="text-fg-muted px-2.5 py-3 text-sm">
No matching section.
</p>
</div>
</div>
</div>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
</template>
+16 -13
View File
@@ -1,22 +1,25 @@
<script setup lang="ts">
import { computed } from "vue";
import { storeToRefs } from "pinia";
import { connectionStatus } from "@/lib/connection";
import { useLiveUpdatesStore } from "@/stores/live-updates";
import { useSessionStore } from "@/stores/session";
const { streamState } = storeToRefs(useLiveUpdatesStore());
const status = computed(() => connectionStatus(streamState.value));
const look = {
ok: { dot: "bg-primary", text: "text-fg-subtle" },
warn: { dot: "bg-warn", text: "text-warn" },
danger: { dot: "bg-danger", text: "text-danger" },
} as const;
// Silent while the stream is live or opening for the first time; only a lost
// stream is worth the operator's attention.
const { streamState } = storeToRefs(useSessionStore());
</script>
<template>
<span role="status" class="inline-flex items-center gap-1.5 px-1 text-xs max-sm:hidden" :class="look[status.tone].text">
<span class="size-1.5 rounded-full" :class="look[status.tone].dot" aria-hidden="true" />
{{ status.label }}
<span
v-if="streamState === 'reconnecting' || streamState === 'unavailable'"
role="status"
class="inline-flex items-center gap-1.5 px-1 text-xs max-sm:hidden"
:class="streamState === 'unavailable' ? 'text-danger' : 'text-warn'"
>
<span
class="size-1.5 rounded-full"
:class="streamState === 'unavailable' ? 'bg-danger' : 'bg-warn'"
aria-hidden="true"
/>
{{ streamState === "unavailable" ? "Disconnected" : "Reconnecting" }}
</span>
</template>
+12 -21
View File
@@ -2,14 +2,14 @@
import { computed } from "vue";
import { useRoute } from "vue-router";
import { activeNavPath, navTree } from "@/lib/nav";
import NavGroup from "./NavGroup.vue";
import NavTrigger from "./NavTrigger.vue";
import { activeNavPath, navTree, type NavEntry } from "@/lib/nav";
const props = defineProps<{ hidden: string[] }>();
const route = useRoute();
const tree = computed(() => navTree(props.hidden));
const links = computed(() =>
navTree(props.hidden).flatMap((node): NavEntry[] => (node.kind === "link" ? [node.entry] : [])),
);
const activePath = computed(() => activeNavPath(route.path));
</script>
@@ -18,23 +18,14 @@ const activePath = computed(() => activeNavPath(route.path));
aria-label="Sections"
class="flex min-w-0 flex-1 items-center gap-0.5 overflow-x-auto [scrollbar-width:none]"
>
<template
v-for="node in tree"
:key="node.kind === 'link' ? node.entry.path : node.label"
<RouterLink
v-for="entry in links"
:key="entry.path"
:to="entry.path"
:aria-current="activePath === entry.path ? 'page' : undefined"
:data-current="activePath === entry.path ? '' : undefined"
class="text-muted-foreground hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center rounded-md px-2.5 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
>{{ entry.label }}</RouterLink
>
<NavTrigger
v-if="node.kind === 'link'"
:to="node.entry.path"
:current="activePath === node.entry.path"
>
{{ node.entry.label }}
</NavTrigger>
<NavGroup
v-else
:label="node.label"
:items="node.items"
:active-path="activePath"
/>
</template>
</nav>
</template>
-75
View File
@@ -1,75 +0,0 @@
<script setup lang="ts">
import { ref } from "vue";
import { ChevronDown } from "@lucide/vue";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import type { NavEntry } from "@/lib/nav";
import NavItem from "./NavItem.vue";
import NavTrigger from "./NavTrigger.vue";
const props = defineProps<{
label: string;
items: NavEntry[];
activePath: string;
}>();
const holds = (path: string) => props.activePath === path;
/**
* Hover-open, click-toggling menu.
*
* Pointing at the group opens it; leaving it closes it after a short grace
* period, so the move from trigger to content cannot close what you are
* moving towards (the content carries its own enter/leave handlers, and the
* delay covers the gap between two teleported elements). The trigger keeps
* its click and keyboard semantics: reka still emits update:open on
* activation, this only controls how long the menu stays open.
*/
const open = ref(false);
let closeTimer: ReturnType<typeof setTimeout> | undefined;
function openMenu() {
clearTimeout(closeTimer);
open.value = true;
}
function closeMenuSoon() {
clearTimeout(closeTimer);
closeTimer = setTimeout(() => {
open.value = false;
}, 140);
}
</script>
<template>
<DropdownMenu :open="open" @update:open="open = $event">
<div class="flex" @pointerenter="openMenu" @pointerleave="closeMenuSoon">
<DropdownMenuTrigger as-child>
<NavTrigger :current="items.some((item) => holds(item.path))">
{{ props.label }}
<ChevronDown :size="14" class="opacity-60" />
</NavTrigger>
</DropdownMenuTrigger>
</div>
<DropdownMenuContent
align="start"
class="w-52"
@pointerenter="openMenu"
@pointerleave="closeMenuSoon"
>
<template v-for="(item, index) in items" :key="item.path">
<DropdownMenuSeparator v-if="item.dividerBefore && index > 0" />
<DropdownMenuLabel v-if="item.dividerBefore">{{
item.dividerBefore
}}</DropdownMenuLabel>
<NavItem :entry="item" :current="holds(item.path)" />
</template>
</DropdownMenuContent>
</DropdownMenu>
</template>
-24
View File
@@ -1,24 +0,0 @@
<script setup lang="ts">
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import type { NavEntry } from "@/lib/nav";
defineProps<{ entry: NavEntry; current: boolean }>();
</script>
<template>
<DropdownMenuItem
as-child
:data-current="current ? '' : undefined"
:disabled="entry.soon"
class="data-current:text-foreground data-current:bg-accent/60 px-2 py-1.5"
>
<RouterLink :to="entry.path" class="w-full cursor-pointer">
<span class="flex-1">{{ entry.label }}</span>
<span
v-if="entry.soon"
class="text-muted-foreground text-[11px] tracking-wide uppercase"
>soon</span
>
</RouterLink>
</DropdownMenuItem>
</template>
-16
View File
@@ -1,16 +0,0 @@
<script setup lang="ts">
defineProps<{ to?: string; current?: boolean }>();
</script>
<template>
<component
:is="to ? 'RouterLink' : 'button'"
:to="to"
:type="to ? undefined : 'button'"
:aria-current="to && current ? 'page' : undefined"
:data-current="current ? '' : undefined"
class="text-muted-foreground hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center gap-1 rounded-md px-2.5 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
>
<slot />
</component>
</template>
+5 -6
View File
@@ -21,14 +21,13 @@ import {
</Avatar>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" class="w-48">
<DropdownMenuLabel class="text-muted-foreground text-xs font-normal">
Signed in locally
</DropdownMenuLabel>
<DropdownMenuLabel class="text-muted-foreground text-xs font-normal">Signed in locally</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem as-child>
<RouterLink to="/settings/appearance" class="w-full cursor-pointer"
>Appearance</RouterLink
>
<RouterLink to="/settings/appearance" class="w-full cursor-pointer">Appearance</RouterLink>
</DropdownMenuItem>
<DropdownMenuItem as-child>
<RouterLink to="/logs" class="w-full cursor-pointer">Logs</RouterLink>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
-84
View File
@@ -1,84 +0,0 @@
<script setup lang="ts">
import { computed, nextTick, ref } from "vue";
import { useRouter } from "vue-router";
import { Search } from "@lucide/vue";
import { Input } from "@/components/ui/input";
import { navEntries } from "@/lib/nav";
const props = defineProps<{ hidden: string[] }>();
const router = useRouter();
const field = ref<{ $el: HTMLInputElement } | null>(null);
const query = ref("");
const open = ref(false);
const entries = computed(() =>
navEntries(props.hidden).filter((entry) => !entry.soon),
);
// Jumping between sections, deliberately not a data search: each section owns
// its own filtering, and one box that means something different on every page
// is worse than none.
const hit = computed(() => {
const wanted = query.value.trim().toLowerCase();
if (!wanted) return undefined;
return entries.value.find((entry) =>
entry.label.toLowerCase().startsWith(wanted),
);
});
async function toggle() {
open.value = !open.value;
if (!open.value) return;
await nextTick();
field.value?.$el.focus();
}
function onKeydown(event: KeyboardEvent) {
const input = event.target as HTMLInputElement;
if (event.key === "Escape") {
// Consumed here so a dismissal of the field is not also read as a
// dismissal of whatever is open behind it.
event.preventDefault();
query.value = "";
open.value = false;
input.blur();
return;
}
if (event.key !== "Enter" || !hit.value) return;
void router.push(hit.value.path);
query.value = "";
open.value = false;
input.blur();
}
</script>
<template>
<div class="flex items-center">
<button
type="button"
class="text-muted-foreground hover:text-foreground hover:bg-accent focus-visible:ring-ring/50 inline-flex size-8 items-center justify-center rounded-md outline-none focus-visible:ring-[3px] lg:hidden"
aria-label="Jump to a section"
:aria-expanded="open"
@click="toggle()"
>
<Search :size="16" />
</button>
<div class="relative" :class="open ? 'block' : 'hidden lg:block'">
<Search
:size="15"
class="text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2"
/>
<Input
ref="field"
v-model="query"
type="search"
class="h-8 w-44 pl-8 text-sm"
placeholder="Jump to…"
aria-label="Jump to a section"
@keydown="onKeydown"
/>
</div>
</div>
</template>
-26
View File
@@ -1,26 +0,0 @@
<script setup lang="ts">
import { CircleQuestionMark } from "@lucide/vue";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
</script>
<template>
<Tooltip>
<TooltipTrigger as-child>
<a
href="https://github.com/samcharles93/archie-core/tree/main/docs"
target="_blank"
rel="noreferrer noopener"
class="text-muted-foreground hover:text-foreground hover:bg-accent focus-visible:ring-ring/50 inline-flex size-8 items-center justify-center rounded-md outline-none focus-visible:ring-[3px]"
aria-label="Documentation"
>
<CircleQuestionMark :size="16" />
</a>
</TooltipTrigger>
<TooltipContent :side-offset="8">Documentation</TooltipContent>
</Tooltip>
</template>
+3 -5
View File
@@ -1,12 +1,11 @@
<script setup lang="ts">
import AlertsBell from "@/alerts/AlertsBell.vue";
import CommandPalette from "@/components/command-palette/CommandPalette.vue";
import NewTaskButton from "@/tasks/NewTaskButton.vue";
import Brand from "./Brand.vue";
import ConnectionPill from "./ConnectionPill.vue";
import Nav from "./Nav.vue";
import ProfileDropdown from "./ProfileDropdown.vue";
import SearchBar from "./SearchBar.vue";
import SupportLink from "./SupportLink.vue";
const props = defineProps<{ hidden: string[] }>();
</script>
@@ -18,11 +17,10 @@ const props = defineProps<{ hidden: string[] }>();
<Brand />
<Nav :hidden="props.hidden" />
<div class="flex shrink-0 items-center gap-2">
<SearchBar :hidden="props.hidden" />
<ConnectionPill />
<CommandPalette :hidden="props.hidden" />
<NewTaskButton v-if="!props.hidden.includes('/workflows')" />
<AlertsBell />
<ConnectionPill />
<SupportLink />
<ProfileDropdown />
</div>
</header>
+1 -1
View File
@@ -4,7 +4,7 @@ import { cva } from "class-variance-authority";
export { default as Badge } from "./Badge.vue";
export const badgeVariants = cva(
"h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none",
"h-5 gap-1 rounded-sm border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none",
{
variants: {
variant: {
+88
View File
@@ -0,0 +1,88 @@
<script setup lang="ts">
import type { ListboxRootEmits, ListboxRootProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { ListboxRoot, useFilter, useForwardPropsEmits } from 'reka-ui'
import { reactive, ref, watch } from 'vue'
import { cn } from '@/lib/utils'
import { provideCommandContext } from '.'
const props = withDefaults(defineProps<ListboxRootProps & { class?: HTMLAttributes['class'] }>(), {
modelValue: '',
highlightOnHover: true,
})
const emits = defineEmits<ListboxRootEmits>()
const delegatedProps = reactiveOmit(props, 'class')
const forwarded = useForwardPropsEmits(delegatedProps, emits)
const allItems = ref<Map<string, string>>(new Map())
const allGroups = ref<Map<string, Set<string>>>(new Map())
const { contains } = useFilter({ sensitivity: 'base' })
const filterState = reactive({
search: '',
filtered: {
/** The count of all visible items. */
count: 0,
/** Map from visible item id to its search score. */
items: new Map() as Map<string, number>,
/** Set of groups with at least one visible item. */
groups: new Set() as Set<string>,
},
})
function filterItems() {
if (!filterState.search) {
filterState.filtered.count = allItems.value.size
// Do nothing, each item will know to show itself because search is empty
return
}
// Reset the groups
filterState.filtered.groups = new Set()
let itemCount = 0
// Check which items should be included
for (const [id, value] of allItems.value) {
const score = contains(value, filterState.search)
filterState.filtered.items.set(id, score ? 1 : 0)
if (score)
itemCount++
}
// Check which groups have at least 1 item shown
for (const [groupId, group] of allGroups.value) {
for (const itemId of group) {
if (filterState.filtered.items.get(itemId)! > 0) {
filterState.filtered.groups.add(groupId)
break
}
}
}
filterState.filtered.count = itemCount
}
watch(() => filterState.search, () => {
filterItems()
})
provideCommandContext({
allItems,
allGroups,
filterState,
})
</script>
<template>
<ListboxRoot
data-slot="command"
v-bind="forwarded"
:class="cn('bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden', props.class)"
>
<slot />
</ListboxRoot>
</template>
@@ -0,0 +1,39 @@
<script setup lang="ts">
import type { DialogRootEmits, DialogRootProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { useForwardPropsEmits } from 'reka-ui'
import { cn } from '@/lib/utils'
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'
import Command from './Command.vue'
const props = withDefaults(defineProps<DialogRootProps & {
title?: string
description?: string
class?: HTMLAttributes['class']
showCloseButton?: boolean
}>(), {
title: 'Command Palette',
description: 'Search for a command to run...',
showCloseButton: false,
})
const emits = defineEmits<DialogRootEmits>()
const forwarded = useForwardPropsEmits(props, emits)
</script>
<template>
<Dialog v-slot="slotProps" v-bind="forwarded">
<DialogContent
:class="cn('rounded-xl! top-1/3 translate-y-0 overflow-hidden p-0', props.class)"
:show-close-button="showCloseButton"
>
<DialogHeader class="sr-only">
<DialogTitle>{{ title }}</DialogTitle>
<DialogDescription>{{ description }}</DialogDescription>
</DialogHeader>
<Command>
<slot v-bind="slotProps" />
</Command>
</DialogContent>
</Dialog>
</template>
@@ -0,0 +1,28 @@
<script setup lang="ts">
import type { PrimitiveProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { Primitive } from 'reka-ui'
import { computed } from 'vue'
import { cn } from '@/lib/utils'
import { useCommand } from '.'
const props = defineProps<PrimitiveProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = reactiveOmit(props, 'class')
const { filterState } = useCommand()
const isRender = computed(() => !!filterState.search && filterState.filtered.count === 0,
)
</script>
<template>
<Primitive
v-if="isRender"
data-slot="command-empty"
v-bind="delegatedProps"
:class="cn('py-6 text-center text-sm', props.class)"
>
<slot />
</Primitive>
</template>
@@ -0,0 +1,45 @@
<script setup lang="ts">
import type { ListboxGroupProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { ListboxGroup, ListboxGroupLabel, useId } from 'reka-ui'
import { computed, onMounted, onUnmounted } from 'vue'
import { cn } from '@/lib/utils'
import { provideCommandGroupContext, useCommand } from '.'
const props = defineProps<ListboxGroupProps & {
class?: HTMLAttributes['class']
heading?: string
}>()
const delegatedProps = reactiveOmit(props, 'class')
const { allGroups, filterState } = useCommand()
const id = useId()
const isRender = computed(() => !filterState.search ? true : filterState.filtered.groups.has(id))
provideCommandGroupContext({ id })
onMounted(() => {
if (!allGroups.value.has(id))
allGroups.value.set(id, new Set())
})
onUnmounted(() => {
allGroups.value.delete(id)
})
</script>
<template>
<ListboxGroup
v-bind="delegatedProps"
:id="id"
data-slot="command-group"
:class="cn('text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium', props.class)"
:hidden="isRender ? undefined : true"
>
<ListboxGroupLabel v-if="heading" data-slot="command-group-heading" class="">
{{ heading }}
</ListboxGroupLabel>
<slot />
</ListboxGroup>
</template>
@@ -0,0 +1,45 @@
<script setup lang="ts">
import type { ListboxFilterProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { SearchIcon } from '@lucide/vue'
import { reactiveOmit } from '@vueuse/core'
import { ListboxFilter, useForwardProps } from 'reka-ui'
import { cn } from '@/lib/utils'
import { InputGroup, InputGroupAddon } from '@/components/ui/input-group'
import { useCommand } from '.'
defineOptions({
inheritAttrs: false,
})
const props = defineProps<ListboxFilterProps & {
class?: HTMLAttributes['class']
}>()
const delegatedProps = reactiveOmit(props, 'class')
const forwardedProps = useForwardProps(delegatedProps)
const { filterState } = useCommand()
</script>
<template>
<div
data-slot="command-input-wrapper"
class="p-1 pb-0"
>
<InputGroup class="bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!">
<ListboxFilter
v-bind="{ ...forwardedProps, ...$attrs }"
v-model="filterState.search"
data-slot="command-input"
auto-focus
:class="cn('w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', props.class)"
/>
<InputGroupAddon>
<SearchIcon class="size-4 shrink-0 opacity-50" />
</InputGroupAddon>
</InputGroup>
</div>
</template>
@@ -0,0 +1,79 @@
<script setup lang="ts">
import type { ListboxItemEmits, ListboxItemProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { CheckIcon } from '@lucide/vue'
import { reactiveOmit, useCurrentElement } from '@vueuse/core'
import { ListboxItem, useForwardPropsEmits, useId } from 'reka-ui'
import { computed, onMounted, onUnmounted, ref } from 'vue'
import { cn } from '@/lib/utils'
import { useCommand, useCommandGroup } from '.'
const props = defineProps<ListboxItemProps & { class?: HTMLAttributes['class'] }>()
const emits = defineEmits<ListboxItemEmits>()
const delegatedProps = reactiveOmit(props, 'class')
const forwarded = useForwardPropsEmits(delegatedProps, emits)
const id = useId()
const { filterState, allItems, allGroups } = useCommand()
const groupContext = useCommandGroup()
const isRender = computed(() => {
if (!filterState.search) {
return true
}
else {
const filteredCurrentItem = filterState.filtered.items.get(id)
// If the filtered items is undefined means not in the all times map yet
// Do the first render to add into the map
if (filteredCurrentItem === undefined) {
return true
}
// Check with filter
return filteredCurrentItem > 0
}
})
const itemRef = ref()
const currentElement = useCurrentElement(itemRef)
onMounted(() => {
if (!(currentElement.value instanceof HTMLElement))
return
// textValue to perform filter
allItems.value.set(id, currentElement.value.textContent ?? (props.value?.toString() ?? ''))
const groupId = groupContext?.id
if (groupId) {
if (!allGroups.value.has(groupId)) {
allGroups.value.set(groupId, new Set([id]))
}
else {
allGroups.value.get(groupId)?.add(id)
}
}
})
onUnmounted(() => {
allItems.value.delete(id)
})
</script>
<template>
<ListboxItem
v-if="isRender"
v-bind="forwarded"
:id="id"
ref="itemRef"
data-slot="command-item"
:class="cn('data-highlighted:bg-muted data-highlighted:text-foreground data-highlighted:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! [&_svg:not([class*=size-])]:size-4 group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0', props.class)"
@select="() => {
filterState.search = ''
}"
>
<slot />
<CheckIcon class="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
</ListboxItem>
</template>
@@ -0,0 +1,25 @@
<script setup lang="ts">
import type { ListboxContentProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { ListboxContent, useForwardProps } from 'reka-ui'
import { cn } from '@/lib/utils'
const props = defineProps<ListboxContentProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = reactiveOmit(props, 'class')
const forwarded = useForwardProps(delegatedProps)
</script>
<template>
<ListboxContent
data-slot="command-list"
v-bind="forwarded"
:class="cn('no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto', props.class)"
>
<div role="presentation">
<slot />
</div>
</ListboxContent>
</template>
@@ -0,0 +1,21 @@
<script setup lang="ts">
import type { SeparatorProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { Separator } from 'reka-ui'
import { cn } from '@/lib/utils'
const props = defineProps<SeparatorProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = reactiveOmit(props, 'class')
</script>
<template>
<Separator
data-slot="command-separator"
v-bind="delegatedProps"
:class="cn('bg-border -mx-1 h-px', props.class)"
>
<slot />
</Separator>
</template>
@@ -0,0 +1,17 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<span
data-slot="command-shortcut"
:class="cn('text-muted-foreground group-data-highlighted/command-item:text-foreground ml-auto text-xs tracking-widest', props.class)"
>
<slot />
</span>
</template>
+25
View File
@@ -0,0 +1,25 @@
import type { Ref } from 'vue'
import { createContext } from 'reka-ui'
export { default as Command } from './Command.vue'
export { default as CommandDialog } from './CommandDialog.vue'
export { default as CommandEmpty } from './CommandEmpty.vue'
export { default as CommandGroup } from './CommandGroup.vue'
export { default as CommandInput } from './CommandInput.vue'
export { default as CommandItem } from './CommandItem.vue'
export { default as CommandList } from './CommandList.vue'
export { default as CommandSeparator } from './CommandSeparator.vue'
export { default as CommandShortcut } from './CommandShortcut.vue'
export const [useCommand, provideCommandContext] = createContext<{
allItems: Ref<Map<string, string>>
allGroups: Ref<Map<string, Set<string>>>
filterState: {
search: string
filtered: { count: number, items: Map<string, number>, groups: Set<string> }
}
}>('Command')
export const [useCommandGroup, provideCommandGroupContext] = createContext<{
id?: string
}>('CommandGroup')
+1 -1
View File
@@ -27,7 +27,7 @@ const props = withDefaults(
>
<slot />
<DialogClose v-if="showCloseButton" as-child>
<Button variant="outline"> Close </Button>
<Button variant="outline">Close</Button>
</DialogClose>
</div>
</template>
@@ -0,0 +1,48 @@
<script setup lang="ts">
import type { AcceptableValue } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { ChevronDownIcon } from '@lucide/vue'
import { reactiveOmit, useVModel } from '@vueuse/core'
import { cn } from '@/lib/utils'
defineOptions({
inheritAttrs: false,
})
const props = defineProps<{
modelValue?: AcceptableValue | AcceptableValue[]
class?: HTMLAttributes['class']
size?: 'sm' | 'default'
}>()
const emit = defineEmits<{
'update:modelValue': [value: AcceptableValue]
}>()
const modelValue = useVModel(props, 'modelValue', emit, {
passive: true,
defaultValue: '',
})
const delegatedProps = reactiveOmit(props, 'class', 'size')
</script>
<template>
<div
:class="cn('group/native-select relative w-fit has-[select:disabled]:opacity-50', props.class)"
data-slot="native-select-wrapper"
:data-size="props.size ?? 'default'"
>
<select
v-bind="{ ...$attrs, ...delegatedProps }"
v-model="modelValue"
data-slot="native-select"
class="border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 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 h-8 w-full min-w-0 appearance-none rounded-lg border bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors select-none focus-visible:ring-3 aria-invalid:ring-3 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 outline-none disabled:pointer-events-none disabled:cursor-not-allowed"
:data-size="props.size ?? 'default'"
>
<slot />
</select>
<ChevronDownIcon class="text-muted-foreground top-1/2 right-2.5 size-4 -translate-y-1/2 pointer-events-none absolute select-none" aria-hidden="true" data-slot="native-select-icon" />
</div>
</template>
@@ -0,0 +1,12 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
</script>
<template>
<optgroup data-slot="native-select-optgroup" :class="cn('bg-[Canvas] text-[CanvasText]', props.class)">
<slot />
</optgroup>
</template>
@@ -0,0 +1,12 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{ class?: HTMLAttributes['class'] }>()
</script>
<template>
<option data-slot="native-select-option" :class="cn('bg-[Canvas] text-[CanvasText]', props.class)">
<slot />
</option>
</template>
@@ -0,0 +1,3 @@
export { default as NativeSelect } from './NativeSelect.vue'
export { default as NativeSelectOptGroup } from './NativeSelectOptGroup.vue'
export { default as NativeSelectOption } from './NativeSelectOption.vue'
@@ -1,28 +0,0 @@
<script setup lang="ts">
import type { PaginationRootEmits, PaginationRootProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationRoot, useForwardPropsEmits } from "reka-ui";
import { cn } from "@/lib/utils";
const props = defineProps<
PaginationRootProps & {
class?: HTMLAttributes["class"];
}
>();
const emits = defineEmits<PaginationRootEmits>();
const delegatedProps = reactiveOmit(props, "class");
const forwarded = useForwardPropsEmits(delegatedProps, emits);
</script>
<template>
<PaginationRoot
v-slot="slotProps"
data-slot="pagination"
v-bind="forwarded"
:class="cn('mx-auto flex w-full justify-center', props.class)"
>
<slot v-bind="slotProps" />
</PaginationRoot>
</template>
@@ -1,24 +0,0 @@
<script setup lang="ts">
import type { PaginationListProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationList } from "reka-ui";
import { cn } from "@/lib/utils";
const props = defineProps<
PaginationListProps & { class?: HTMLAttributes["class"] }
>();
const delegatedProps = reactiveOmit(props, "class");
</script>
<template>
<PaginationList
v-slot="slotProps"
data-slot="pagination-content"
v-bind="delegatedProps"
:class="cn('gap-0.5 flex items-center', props.class)"
>
<slot v-bind="slotProps" />
</PaginationList>
</template>
@@ -1,33 +0,0 @@
<script setup lang="ts">
import type { PaginationEllipsisProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { MoreHorizontalIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationEllipsis } from "reka-ui";
import { cn } from "@/lib/utils";
const props = defineProps<
PaginationEllipsisProps & { class?: HTMLAttributes["class"] }
>();
const delegatedProps = reactiveOmit(props, "class");
</script>
<template>
<PaginationEllipsis
data-slot="pagination-ellipsis"
v-bind="delegatedProps"
:class="
cn(
'size-8 [&_svg:not([class*=size-])]:size-4 flex items-center justify-center',
props.class,
)
"
>
<slot>
<MoreHorizontalIcon />
<span class="sr-only">More pages</span>
</slot>
</PaginationEllipsis>
</template>
@@ -1,39 +0,0 @@
<script setup lang="ts">
import type { PaginationFirstProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { ChevronsLeftIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationFirst, useForwardProps } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationFirstProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
}
>(),
{
size: "default",
},
);
const delegatedProps = reactiveOmit(props, "class", "size");
const forwarded = useForwardProps(delegatedProps);
</script>
<template>
<PaginationFirst
data-slot="pagination-first"
:class="cn(buttonVariants({ variant: 'ghost', size }), '', props.class)"
v-bind="forwarded"
>
<slot>
<ChevronsLeftIcon data-icon="inline-start" />
<span class="hidden sm:block">First</span>
</slot>
</PaginationFirst>
</template>
@@ -1,42 +0,0 @@
<script setup lang="ts">
import type { PaginationListItemProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { reactiveOmit } from "@vueuse/core";
import { PaginationListItem } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationListItemProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
isActive?: boolean;
}
>(),
{
size: "icon",
},
);
const delegatedProps = reactiveOmit(props, "class", "size", "isActive");
</script>
<template>
<PaginationListItem
data-slot="pagination-item"
v-bind="delegatedProps"
:class="
cn(
buttonVariants({
variant: isActive ? 'outline' : 'ghost',
size,
}),
props.class,
)
"
>
<slot />
</PaginationListItem>
</template>
@@ -1,39 +0,0 @@
<script setup lang="ts">
import type { PaginationLastProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { ChevronsRightIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationLast, useForwardProps } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationLastProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
}
>(),
{
size: "default",
},
);
const delegatedProps = reactiveOmit(props, "class", "size");
const forwarded = useForwardProps(delegatedProps);
</script>
<template>
<PaginationLast
data-slot="pagination-last"
:class="cn(buttonVariants({ variant: 'ghost', size }), '', props.class)"
v-bind="forwarded"
>
<slot>
<span class="hidden sm:block">Last</span>
<ChevronsRightIcon data-icon="inline-end" />
</slot>
</PaginationLast>
</template>
@@ -1,40 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<{
href?: string;
size?: ButtonVariants["size"];
isActive?: boolean;
class?: HTMLAttributes["class"];
}>(),
{
size: "icon",
isActive: false,
},
);
</script>
<template>
<a
:href="href"
data-slot="pagination-link"
:data-active="isActive ? '' : undefined"
:aria-current="isActive ? 'page' : undefined"
:class="
cn(
buttonVariants({
variant: isActive ? 'outline' : 'ghost',
size,
}),
'',
props.class,
)
"
>
<slot />
</a>
</template>
@@ -1,41 +0,0 @@
<script setup lang="ts">
import type { PaginationNextProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { ChevronRightIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationNext, useForwardProps } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationNextProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
}
>(),
{
size: "default",
},
);
const delegatedProps = reactiveOmit(props, "class", "size");
const forwarded = useForwardProps(delegatedProps);
</script>
<template>
<PaginationNext
data-slot="pagination-next"
:class="
cn(buttonVariants({ variant: 'ghost', size }), 'pr-1.5!', props.class)
"
v-bind="forwarded"
>
<slot>
<ChevronRightIcon data-icon="inline-start" class="cn-rtl-flip" />
<span class="sr-only">Next attempt</span>
</slot>
</PaginationNext>
</template>
@@ -1,41 +0,0 @@
<script setup lang="ts">
import type { PaginationPrevProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import type { ButtonVariants } from "@/components/ui/button";
import { ChevronLeftIcon } from "@lucide/vue";
import { reactiveOmit } from "@vueuse/core";
import { PaginationPrev, useForwardProps } from "reka-ui";
import { cn } from "@/lib/utils";
import { buttonVariants } from "@/components/ui/button";
const props = withDefaults(
defineProps<
PaginationPrevProps & {
size?: ButtonVariants["size"];
class?: HTMLAttributes["class"];
}
>(),
{
size: "default",
},
);
const delegatedProps = reactiveOmit(props, "class", "size");
const forwarded = useForwardProps(delegatedProps);
</script>
<template>
<PaginationPrev
data-slot="pagination-previous"
:class="
cn(buttonVariants({ variant: 'ghost', size }), 'pl-1.5!', props.class)
"
v-bind="forwarded"
>
<slot>
<ChevronLeftIcon data-icon="inline-start" class="cn-rtl-flip" />
<span class="sr-only">Previous attempt</span>
</slot>
</PaginationPrev>
</template>
-9
View File
@@ -1,9 +0,0 @@
export { default as Pagination } from "./Pagination.vue";
export { default as PaginationContent } from "./PaginationContent.vue";
export { default as PaginationEllipsis } from "./PaginationEllipsis.vue";
export { default as PaginationFirst } from "./PaginationFirst.vue";
export { default as PaginationItem } from "./PaginationItem.vue";
export { default as PaginationLast } from "./PaginationLast.vue";
export { default as PaginationLink } from "./PaginationLink.vue";
export { default as PaginationNext } from "./PaginationNext.vue";
export { default as PaginationPrevious } from "./PaginationPrevious.vue";
@@ -1,25 +0,0 @@
<script setup lang="ts">
import type { RadioGroupRootEmits, RadioGroupRootProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { reactiveOmit } from '@vueuse/core'
import { RadioGroupRoot, useForwardPropsEmits } from 'reka-ui'
import { cn } from '@/lib/utils'
const props = defineProps<RadioGroupRootProps & { class?: HTMLAttributes['class'] }>()
const emits = defineEmits<RadioGroupRootEmits>()
const delegatedProps = reactiveOmit(props, 'class')
const forwarded = useForwardPropsEmits(delegatedProps, emits)
</script>
<template>
<RadioGroupRoot
v-slot="slotProps"
data-slot="radio-group"
:class="cn('grid gap-2 w-full', props.class)"
v-bind="forwarded"
>
<slot v-bind="slotProps" />
</RadioGroupRoot>
</template>
@@ -1,41 +0,0 @@
<script setup lang="ts">
import type { RadioGroupItemProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
import { CircleIcon } from '@lucide/vue'
import { reactiveOmit } from '@vueuse/core'
import {
RadioGroupIndicator,
RadioGroupItem,
useForwardProps,
} from 'reka-ui'
import { cn } from '@/lib/utils'
const props = defineProps<RadioGroupItemProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = reactiveOmit(props, 'class')
const forwardedProps = useForwardProps(delegatedProps)
</script>
<template>
<RadioGroupItem
data-slot="radio-group-item"
v-bind="forwardedProps"
:class="
cn(
'border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 flex size-4 rounded-full focus-visible:ring-3 aria-invalid:ring-3 group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"
>
<RadioGroupIndicator
data-slot="radio-group-indicator"
class="flex size-4 items-center justify-center"
>
<slot>
<CircleIcon class="bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full" />
</slot>
</RadioGroupIndicator>
</RadioGroupItem>
</template>
@@ -1,2 +0,0 @@
export { default as RadioGroup } from './RadioGroup.vue'
export { default as RadioGroupItem } from './RadioGroupItem.vue'
@@ -1,31 +0,0 @@
<script setup lang="ts">
import type { ScrollAreaRootProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { reactiveOmit } from "@vueuse/core";
import { ScrollAreaCorner, ScrollAreaRoot, ScrollAreaViewport } from "reka-ui";
import { cn } from "@/lib/utils";
import ScrollBar from "./ScrollBar.vue";
const props = defineProps<
ScrollAreaRootProps & { class?: HTMLAttributes["class"] }
>();
const delegatedProps = reactiveOmit(props, "class");
</script>
<template>
<ScrollAreaRoot
data-slot="scroll-area"
v-bind="delegatedProps"
:class="cn('relative', props.class)"
>
<ScrollAreaViewport
data-slot="scroll-area-viewport"
class="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1"
>
<slot />
</ScrollAreaViewport>
<ScrollBar />
<ScrollAreaCorner />
</ScrollAreaRoot>
</template>
@@ -1,35 +0,0 @@
<script setup lang="ts">
import type { ScrollAreaScrollbarProps } from "reka-ui";
import type { HTMLAttributes } from "vue";
import { reactiveOmit } from "@vueuse/core";
import { ScrollAreaScrollbar, ScrollAreaThumb } from "reka-ui";
import { cn } from "@/lib/utils";
const props = withDefaults(
defineProps<ScrollAreaScrollbarProps & { class?: HTMLAttributes["class"] }>(),
{
orientation: "vertical",
},
);
const delegatedProps = reactiveOmit(props, "class");
</script>
<template>
<ScrollAreaScrollbar
data-slot="scroll-area-scrollbar"
:data-orientation="orientation"
v-bind="delegatedProps"
:class="
cn(
'data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none',
props.class,
)
"
>
<ScrollAreaThumb
data-slot="scroll-area-thumb"
class="rounded-full relative flex-1 bg-border"
/>
</ScrollAreaScrollbar>
</template>
@@ -1,2 +0,0 @@
export { default as ScrollArea } from "./ScrollArea.vue";
export { default as ScrollBar } from "./ScrollBar.vue";
@@ -24,15 +24,11 @@ defineEmits<{ change: [] }>();
<span class="text-muted-foreground">{{ engine }}</span>
<span class="text-muted-foreground" aria-hidden="true">/</span>
<span class="min-w-0 flex-1 truncate">{{ secretKey }}</span>
<Button variant="ghost" size="sm" class="h-7" :disabled="disabled" @click="$emit('change')">
Change
</Button>
<Button variant="ghost" size="sm" class="h-7" :disabled="disabled" @click="$emit('change')">Change</Button>
</div>
<p v-if="resolved === true" class="flex items-center gap-1.5 text-xs text-ok">
<CircleCheck class="size-3.5" aria-hidden="true" /> Credential resolved
</p>
<CircleCheck class="size-3.5" aria-hidden="true" /> Credential resolved</p>
<p v-else-if="resolved === false" class="flex items-center gap-1.5 text-xs text-danger">
<CircleAlert class="size-3.5" aria-hidden="true" /> Credential not found
</p>
<CircleAlert class="size-3.5" aria-hidden="true" /> Credential not found</p>
</div>
</template>
@@ -1,32 +0,0 @@
<script setup lang="ts" generic="T extends string">
import { RadioGroupItem, RadioGroupRoot } from "reka-ui";
import { cn } from "@/lib/utils";
defineProps<{
options: { value: T; label: string }[];
label: string;
disabled?: boolean;
class?: string;
}>();
const model = defineModel<T>({ required: true });
</script>
<template>
<RadioGroupRoot
v-model="model"
:aria-label="label"
:disabled="disabled"
orientation="horizontal"
loop
:class="cn('inline-flex h-9 items-center gap-0.5 rounded-md border border-input bg-background p-0.5', $props.class)"
>
<RadioGroupItem
v-for="option in options"
:key="option.value"
:value="option.value"
class="h-full rounded-sm px-3 text-[13px] font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring data-[state=checked]:bg-secondary data-[state=checked]:text-foreground disabled:opacity-50"
>
{{ option.label }}
</RadioGroupItem>
</RadioGroupRoot>
</template>
@@ -1 +0,0 @@
export { default as SegmentedControl } from "./SegmentedControl.vue";
@@ -16,7 +16,7 @@ defineProps<{
<div
:class="
cn(
'grid gap-2 border-t border-border py-4 md:grid-cols-[17rem_1fr] md:gap-8',
'grid gap-2 border-t border-border py-3 md:grid-cols-[17rem_1fr] md:gap-8',
tone === 'danger' && 'rounded-md border border-danger/40 bg-danger-soft px-4',
$props.class,
)
@@ -1,30 +0,0 @@
<script setup lang="ts">
import { cn } from "@/lib/utils";
defineProps<{
cells: { label: string; value: string | number; sub?: string; tone?: "default" | "warn" | "danger" }[];
class?: string;
}>();
</script>
<template>
<dl
:class="cn('grid auto-cols-fr grid-flow-col divide-x divide-border rounded-lg border border-border bg-card max-md:grid-flow-row max-md:divide-x-0 max-md:divide-y', $props.class)"
>
<div v-for="cell in cells" :key="cell.label" class="min-w-0 px-5 py-4">
<dt class="truncate text-xs text-fg-subtle">{{ cell.label }}</dt>
<dd
:class="
cn(
'mt-1 truncate text-3xl font-semibold tabular-nums',
cell.tone === 'warn' && 'text-warn',
cell.tone === 'danger' && 'text-danger',
)
"
>
{{ cell.value }}
</dd>
<dd v-if="cell.sub" class="mt-1 truncate text-xs text-fg-subtle">{{ cell.sub }}</dd>
</div>
</dl>
</template>
-1
View File
@@ -1 +0,0 @@
export { default as StatStrip } from "./StatStrip.vue";
@@ -1,33 +0,0 @@
<script setup lang="ts">
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
const pill = cva(
"inline-flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 text-xs font-medium",
{
variants: {
tone: {
neutral: "border-border bg-secondary text-muted-foreground",
accent: "border-primary/50 bg-transparent text-primary",
warn: "border-warn/40 bg-warn-soft text-warn",
danger: "border-danger/40 bg-danger-soft text-danger",
},
dot: {
none: "",
live: "before:size-1.5 before:rounded-full before:bg-primary",
warn: "before:size-1.5 before:rounded-full before:bg-warn",
danger: "before:size-1.5 before:rounded-full before:bg-danger",
idle: "before:size-1.5 before:rounded-full before:bg-idle",
},
},
defaultVariants: { tone: "neutral", dot: "none" },
},
);
type PillVariants = VariantProps<typeof pill>;
defineProps<{ tone?: PillVariants["tone"]; dot?: PillVariants["dot"]; class?: string }>();
</script>
<template>
<span :class="cn(pill({ tone, dot }), $props.class)"><slot /></span>
</template>
@@ -1 +0,0 @@
export { default as StatusPill } from "./StatusPill.vue";
+1 -2
View File
@@ -27,8 +27,7 @@ const props = defineProps<{ action: CuratorActionEntry }>();
</p>
<!-- The reason is the point of this list: an action without one is not
reviewable. -->
<p v-if="props.action.reason" class="mt-1 text-xs text-fg-subtle">
Why: {{ props.action.reason }}
<p v-if="props.action.reason" class="mt-1 text-xs text-fg-subtle">Why: {{ props.action.reason }}
</p>
</li>
</template>
+4 -6
View File
@@ -7,7 +7,7 @@ import { Textarea } from "@/components/ui/textarea";
import { Switch } from "@/components/ui/switch";
import { DurationInput } from "@/components/ui/duration-input";
import { SettingRow } from "@/components/ui/setting-row";
import { useControlPlaneStore } from "@/stores/control-plane";
import { useSettingsStore } from "@/stores/settings";
import ApplyStatusRows from "@/settings/ApplyStatusRows.vue";
import HistoryLink from "@/settings/HistoryLink.vue";
import PageHeader from "@/base/PageHeader.vue";
@@ -18,7 +18,7 @@ import {
EmptyTitle,
} from "@/components/ui/empty";
import { api } from "@/lib/api";
import { useLiveResource } from "@/stores/live-updates";
import { useLiveResource } from "@/stores/session";
import CuratorCard, { type Curator } from "./CuratorCard.vue";
/**
@@ -33,7 +33,7 @@ interface Definition {
on_input: boolean; tools: string[]; skills: boolean; memory_engine: string; conversations: boolean; model: string;
}
const KIND = "curators";
const store = useControlPlaneStore();
const store = useSettingsStore();
onMounted(store.load);
const definitions = computed(() => store.drafts[KIND]?.value as Definition[] | null);
const editing = ref(false);
@@ -101,9 +101,7 @@ onMounted(load);
<Empty v-else-if="!curators.length">
<EmptyHeader>
<EmptyTitle>No curators registered</EmptyTitle>
<EmptyDescription>
Curators are background agent loops that maintain memory and skills.
</EmptyDescription>
<EmptyDescription>Curators are background agent loops that maintain memory and skills.</EmptyDescription>
</EmptyHeader>
</Empty>
<CuratorCard v-for="c in curators" v-else :key="c.name" :curator="c" />
+3 -2
View File
@@ -4,7 +4,7 @@ import { computed } from "vue";
import { TableCell, TableRow } from "@/components/ui/table";
import { ago } from "@/lib/format";
import { activityDetail } from "./activity-detail";
import { taskIDFor, type ActivityEvent } from "./state";
import { useTasksStore, type ActivityEvent } from "@/stores/tasks";
/**
* One row of the live activity table. A row whose event resolves to a task is
@@ -14,7 +14,8 @@ import { taskIDFor, type ActivityEvent } from "./state";
const props = defineProps<{ event: ActivityEvent }>();
const emit = defineEmits<{ open: [taskID: number] }>();
const taskID = computed(() => taskIDFor(props.event));
const tasks = useTasksStore();
const taskID = computed(() => tasks.taskIDFor(props.event));
// The detail is cut to one line by activityDetail and clamped again in the
// cell so a long unbroken token (a path, a URL, a hash) cannot widen the column
// past the table. Unclamped, this made the dashboard 7,481px tall.
+9 -6
View File
@@ -1,11 +1,14 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { computed } from "vue";
import { AlignLeft } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { attentionStatusIds } from "@/lib/task-meta";
import { headline } from "./headline";
import { error, summary } from "./state";
import { useTasksStore } from "@/stores/tasks";
const { error, summary } = storeToRefs(useTasksStore());
const text = computed(() => {
const counts = summary.value?.statuses ?? {};
@@ -16,17 +19,17 @@ const text = computed(() => {
</script>
<template>
<div class="mb-6 flex flex-wrap items-center justify-between gap-4">
<header class="mb-4 flex min-h-9 flex-wrap items-center justify-between gap-x-4 gap-y-2">
<div class="min-w-0">
<h1 v-if="summary" class="text-2xl font-semibold">
<h1 v-if="summary" class="text-xl font-semibold tracking-tight">
{{ text.running }}<span class="text-fg-subtle"> · </span
><span :class="text.urgent && 'text-warn'">{{ text.attention }}</span>
</h1>
<h1 v-else class="text-2xl font-semibold">Dashboard</h1>
<h1 v-else class="text-xl font-semibold tracking-tight">Dashboard</h1>
<p v-if="error" class="mt-1 text-sm text-danger" role="alert">Cannot reach archied: {{ error }}</p>
</div>
<Button variant="outline" size="sm" as-child>
<RouterLink to="/logs"><AlignLeft data-icon="inline-start" /> Logs</RouterLink>
<RouterLink to="/logs"><AlignLeft data-icon="inline-start" />Logs</RouterLink>
</Button>
</div>
</header>
</template>
+10 -6
View File
@@ -1,13 +1,16 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { computed } from "vue";
import { useTasksStore } from "@/stores/tasks";
import DashboardHero from "./DashboardHero.vue";
import GatePulseCard from "./GatePulseCard.vue";
import LiveActivityCard from "./LiveActivityCard.vue";
import NeedsYouCard from "./NeedsYouCard.vue";
import SetupPanel from "./SetupPanel.vue";
import { setupPanelState } from "./setup-preference";
import { setup, summary, useDashboard } from "./state";
import { useDashboard } from "./state";
import ThroughputTiles from "./ThroughputTiles.vue";
import TokenOutlookCard from "./TokenOutlookCard.vue";
@@ -16,6 +19,7 @@ import TokenOutlookCard from "./TokenOutlookCard.vue";
* column, health and spend in the rail. Composes the panels; it holds no
* state of its own.
*/
const { setup, summary } = storeToRefs(useTasksStore());
useDashboard();
const setupIncomplete = computed(() => setupPanelState(setup.value).kind === "incomplete");
@@ -23,14 +27,14 @@ const setupIncomplete = computed(() => setupPanelState(setup.value).kind === "in
<template>
<DashboardHero />
<SetupPanel v-if="setupIncomplete" class="mb-6" />
<ThroughputTiles v-if="summary" class="mb-6" />
<div class="grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_380px]">
<div class="grid min-w-0 gap-6">
<SetupPanel v-if="setupIncomplete" class="mb-4" />
<ThroughputTiles v-if="summary" class="mb-4" />
<div class="grid items-start gap-4 lg:grid-cols-[minmax(0,1fr)_380px]">
<div class="grid min-w-0 gap-4">
<NeedsYouCard />
<LiveActivityCard v-if="summary" />
</div>
<div class="grid min-w-0 gap-6">
<div class="grid min-w-0 gap-4">
<GatePulseCard />
<TokenOutlookCard v-if="summary" />
</div>
+5 -10
View File
@@ -1,12 +1,14 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { computed } from "vue";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { delivered } from "@/lib/delivered";
import { STATUS_FILL } from "@/lib/status";
import { passBar } from "./pass-bar";
import { workflows, type WorkflowStat } from "./state";
import { useTasksStore, type WorkflowStat } from "@/stores/tasks";
const { workflows } = storeToRefs(useTasksStore());
/** Sharer of runs: how much of the work that finished passed its gates. */
const stats = computed(() => workflows.value?.workflows ?? []);
@@ -35,17 +37,11 @@ const rowBar = (stat: WorkflowStat) =>
</script>
<template>
<Card v-if="workflows">
<Card v-if="workflows && totals.runs">
<CardHeader>
<CardTitle>Quality gates</CardTitle>
</CardHeader>
<CardContent>
<Empty v-if="!totals.runs">
<EmptyHeader>
<EmptyTitle>No completed runs yet</EmptyTitle>
</EmptyHeader>
</Empty>
<template v-else>
<!--
Two sections, read left to right: the rate on its own, and the
per-workflow counts that explain it. Parked tasks are not listed
@@ -91,7 +87,6 @@ const rowBar = (stat: WorkflowStat) =>
</li>
</ul>
</div>
</template>
</CardContent>
</Card>
</template>
+7 -10
View File
@@ -13,7 +13,7 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { SegmentedControl } from "@/components/ui/segmented-control";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import {
Table,
TableBody,
@@ -23,7 +23,7 @@ import {
TableRow,
} from "@/components/ui/table";
import { ago } from "@/lib/format";
import { useLiveUpdatesStore } from "@/stores/live-updates";
import { useSessionStore } from "@/stores/session";
import ActivityRow from "./ActivityRow.vue";
import { activityDetail } from "./activity-detail";
import {
@@ -42,8 +42,8 @@ import { groupActivity, type ActivityGroup } from "./activity-group";
*/
const router = useRouter();
const { activity, streamKind, streamState } = storeToRefs(
useLiveUpdatesStore(),
const { activity } = storeToRefs(
useSessionStore(),
);
/** Which view of the feed is showing: everything, task runs, or the daemon's
@@ -88,12 +88,9 @@ function openTask(taskID: number) {
<CardHeader>
<CardTitle>Live activity</CardTitle>
<CardAction class="flex items-center gap-2">
<SegmentedControl
v-model="filter"
label="Filter activity"
:options="ACTIVITY_FILTERS"
/>
<Badge :variant="streamKind">{{ streamState }}</Badge>
<ToggleGroup type="single" variant="outline" size="sm" :model-value="filter" aria-label="Filter activity" @update:model-value="(value) => { if (value) filter = value as typeof filter; }">
<ToggleGroupItem v-for="option in ACTIVITY_FILTERS" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
</ToggleGroup>
</CardAction>
</CardHeader>
<CardContent>
+30 -25
View File
@@ -1,12 +1,17 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { computed } from "vue";
import { Button } from "@/components/ui/button";
import { StatusPill } from "@/components/ui/status-pill";
import { Badge } from "@/components/ui/badge";
import { Card, CardAction, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { attentionStatusIds, statusLabel } from "@/lib/task-meta";
import TaskRowActions from "@/tasks/TaskRowActions.vue";
import type { Task } from "@/tasks/TaskRow.vue";
import { loadDashboard, tasks } from "./state";
import { useTasksStore } from "@/stores/tasks";
const { tasks } = storeToRefs(useTasksStore());
const loadDashboard = useTasksStore().load;
/** Tasks waiting on a human, each with the reason and the next action. */
type AttentionTask = Task & { park_reason?: string };
@@ -17,32 +22,32 @@ const waiting = computed(() => {
});
function meta(task: AttentionTask): string {
const where = task.owner && task.repo ? `${task.owner}/${task.repo}${task.issue_number ? ` #${task.issue_number}` : ""}` : "";
const where = task.owner && task.repo ? `${task.owner}/${task.repo}${task.issue_number && task.source !== "chat" ? ` #${task.issue_number}` : ""}` : "";
return [where, task.workflow, task.park_reason].filter(Boolean).join(" · ");
}
</script>
<template>
<section class="rounded-lg border border-border bg-card" aria-labelledby="needs-you">
<header class="flex items-center gap-2 border-b border-border px-5 py-3.5">
<h2 id="needs-you" class="text-[15px] font-medium">Needs you</h2>
<StatusPill v-if="waiting.length" tone="warn">{{ waiting.length }}</StatusPill>
<RouterLink to="/tasks?status=needs_you" class="ml-auto text-xs text-fg-muted hover:text-foreground">All tasks</RouterLink>
</header>
<p v-if="tasks === null" class="px-5 py-6 text-sm text-fg-subtle">Not loaded.</p>
<p v-else-if="!waiting.length" class="px-5 py-6 text-sm text-fg-muted">Nothing waiting.</p>
<ul v-else class="divide-y divide-border">
<li v-for="task in waiting" :key="task.id" class="flex flex-wrap items-center gap-3 px-5 py-3">
<StatusPill tone="warn" class="shrink-0">{{ statusLabel(task.status ?? "") }}</StatusPill>
<div class="min-w-0 flex-1">
<RouterLink :to="`/tasks/${task.id}`" class="block truncate text-sm font-medium hover:underline">
{{ task.title || `Task ${task.id}` }}
</RouterLink>
<p class="truncate font-mono text-xs text-fg-subtle">{{ meta(task) }}</p>
</div>
<Button variant="ghost" size="sm" as-child><RouterLink :to="`/tasks/${task.id}`">Open</RouterLink></Button>
<TaskRowActions :task="task" @done="loadDashboard" />
</li>
</ul>
</section>
<Card v-if="waiting.length">
<CardHeader>
<CardTitle>Needs you</CardTitle>
<CardAction>
<Button variant="ghost" size="sm" as-child><RouterLink to="/tasks?status=needs_you">All tasks</RouterLink></Button>
</CardAction>
</CardHeader>
<CardContent>
<ul class="divide-y divide-border">
<li v-for="task in waiting" :key="task.id" class="flex flex-wrap items-center gap-3 py-2">
<Badge variant="warn">{{ statusLabel(task.status ?? "") }}</Badge>
<div class="min-w-0 flex-1">
<RouterLink :to="`/tasks/${task.id}`" class="block truncate font-medium hover:underline">{{
task.title || `Task ${task.id}`
}}</RouterLink>
<p class="truncate font-mono text-xs text-fg-subtle">{{ meta(task) }}</p>
</div>
<TaskRowActions :task="task" @done="loadDashboard" />
</li>
</ul>
</CardContent>
</Card>
</template>
+4 -1
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { Check } from "@lucide/vue";
import { computed, ref, watch } from "vue";
@@ -11,7 +12,9 @@ import {
} from "@/components/ui/card";
import { Progress } from "@/components/ui/progress";
import { setupPanelState, type SetupPanelState } from "./setup-preference";
import { setup } from "./state";
import { useTasksStore } from "@/stores/tasks";
const { setup } = storeToRefs(useTasksStore());
/**
* The setup checklist, rendered only while there is setup work left.
+14 -3
View File
@@ -1,11 +1,14 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { computed } from "vue";
import { StatStrip } from "@/components/ui/stat-strip";
import { cn } from "@/lib/utils";
import { delivered } from "@/lib/delivered";
import { compact } from "@/lib/format";
import { attentionStatusIds } from "@/lib/task-meta";
import { summary } from "./state";
import { useTasksStore } from "@/stores/tasks";
const { summary } = storeToRefs(useTasksStore());
/** The throughput row: what is running, what needs a human, what shipped. */
@@ -41,5 +44,13 @@ const cells = computed(() => [
</script>
<template>
<StatStrip :cells="cells" />
<dl
class="grid auto-cols-fr grid-flow-col divide-x divide-border rounded-lg border border-border bg-card max-md:grid-flow-row max-md:divide-x-0 max-md:divide-y"
>
<div v-for="cell in cells" :key="cell.label" class="min-w-0 px-4 py-3">
<dt class="truncate text-xs text-fg-subtle">{{ cell.label }}</dt>
<dd :class="cn('mt-1 truncate text-2xl font-semibold tabular-nums', cell.tone === 'warn' && 'text-warn')">{{ cell.value }}</dd>
<dd class="mt-1 truncate text-xs text-fg-subtle">{{ cell.sub }}</dd>
</div>
</dl>
</template>
+7 -14
View File
@@ -1,11 +1,13 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { computed } from "vue";
import SegmentBar from "@/base/SegmentBar.vue";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { compact } from "@/lib/format";
import { summary } from "./state";
import { useTasksStore } from "@/stores/tasks";
const { summary } = storeToRefs(useTasksStore());
/** What the current rate projects to over the next 30 days. */
@@ -23,24 +25,16 @@ const projected = computed(() => Math.round(perDay.value * 30));
</script>
<template>
<Card>
<Card v-if="days.length">
<CardHeader>
<CardTitle>Token outlook</CardTitle>
</CardHeader>
<CardContent>
<Empty v-if="!days.length">
<EmptyHeader>
<EmptyTitle>Nothing spent yet</EmptyTitle>
</EmptyHeader>
</Empty>
<template v-else>
<div class="mb-1 text-3xl font-semibold tracking-[-0.03em]">
{{ compact(projected) }}
</div>
<div class="mb-4 text-xs text-fg-subtle">
Based on {{ compact(Math.round(perDay)) }} per day over
{{ days.length }} days
</div>
<div class="mb-4 text-xs text-fg-subtle">Based on {{ compact(Math.round(perDay)) }} per day over
{{ days.length }} days</div>
<SegmentBar
:segments="[
{
@@ -55,7 +49,6 @@ const projected = computed(() => Math.round(perDay.value * 30));
},
]"
/>
</template>
</CardContent>
</Card>
</template>
+1 -1
View File
@@ -1,4 +1,4 @@
import type { ActivityEvent } from "./state";
import type { ActivityEvent } from "../stores/tasks.ts";
import { activityDetail } from "./activity-detail.ts";
/**
+6 -104
View File
@@ -1,109 +1,11 @@
import { onMounted, ref } from "vue";
import { onMounted } from "vue";
import { api } from "@/lib/api";
import { useLiveResource } from "@/stores/live-updates";
import type { ActivityDetailInput } from "./activity-detail";
import type { Setup } from "./setup-preference";
/**
* The dashboard's shared state.
*
* The health row, the throughput tiles, the token outlook and the activity
* table all read it, and the hero's actions read the task counts, so it lives
* in a module rather than being threaded down through a chain of props.
*/
export interface Summary {
statuses?: Record<string, number>;
tokens_by_day?: Array<{ tokens?: number }>;
}
export interface WorkflowStat {
workflow?: string;
runs?: number;
merged?: number;
completed?: number;
pr_open?: number;
parked?: number;
}
/** An event off the live stream: the payload the detail column reads, plus
* enough to point the row at the task it belongs to. */
export interface ActivityEvent extends ActivityDetailInput {
kind?: string;
type?: string;
task_id?: number | string;
repo?: string;
issue?: number | string;
at?: string | number;
}
/** A task, as far as the dashboard's links read it. */
export interface DashboardTask {
id: number | string;
status?: string;
owner?: string;
repo?: string;
issue_number?: number;
}
export const summary = ref<Summary | null>(null);
export const setup = ref<Setup | null>(null);
export const workflows = ref<{ workflows?: WorkflowStat[] } | null>(null);
// null means loading, [] means loaded.
export const tasks = ref<DashboardTask[] | null>(null);
export const error = ref<string | null>(null);
export const taskIDsBySource = ref(new Map<string, number>());
export async function loadDashboard(): Promise<void> {
error.value = null;
try {
const [nextSummary, nextSetup, nextWorkflows, nextTasks] =
await Promise.all([
api.summary<Summary>(),
api.setup<Setup>().catch(() => null),
api.workflows<{ workflows?: WorkflowStat[] }>().catch(() => null),
// Not defaulted to []: an empty list reads as "nothing needs you",
// which a failed fetch must never claim.
api.tasks<DashboardTask[]>(),
]);
const map = new Map<string, number>();
for (const task of nextTasks) {
if (task.owner && task.repo && task.issue_number) {
map.set(
`${task.owner}/${task.repo}#${task.issue_number}`,
Number(task.id),
);
}
}
taskIDsBySource.value = map;
summary.value = nextSummary;
setup.value = nextSetup;
workflows.value = nextWorkflows;
tasks.value = nextTasks;
} catch (err) {
error.value = String((err as Error).message || err);
}
}
export function taskIDForEvent(
event: ActivityEvent,
bySource: Map<string, number>,
): number {
if (Number(event.task_id) > 0) return Number(event.task_id);
if (!event.repo || !event.issue) return 0;
return Number(bySource.get(`${event.repo}#${event.issue}`)) || 0;
}
/** The task an activity row opens, or 0. An event carries the id, or a
* repo/issue pair the task list resolves. */
export function taskIDFor(event: ActivityEvent): number {
return taskIDForEvent(event, taskIDsBySource.value);
}
import { useLiveResource } from "@/stores/session";
import { useTasksStore } from "@/stores/tasks";
/** Owns the initial fetch and the event stream for the page's lifetime. */
export function useDashboard(): void {
useLiveResource("tasks", () => void loadDashboard(), 500);
onMounted(loadDashboard);
const store = useTasksStore();
useLiveResource("tasks", () => void store.load(), 500);
onMounted(store.load);
}
+28 -34
View File
@@ -1,12 +1,12 @@
<script setup lang="ts">
import { StatusPill } from "@/components/ui/status-pill";
import { Badge } from "@/components/ui/badge";
import { enabled as captureEnabled, loading as captureLoading } from "@/captures/state";
import { computed, onMounted, ref, watch, type Component } from "vue";
import { ArrowRight } from "@lucide/vue";
import { useRoute, useRouter } from "vue-router";
import PageHeader from "@/base/PageHeader.vue";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
import {
Select,
SelectContent,
@@ -15,16 +15,16 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { homeOrg, loadOrg, type OrgWorkspace } from "@/org/org";
import type { OrgWorkspace } from "@/org/org";
import { useEventsStore } from "@/stores/events";
import { useOrgStore } from "@/stores/org";
import BindingsPage from "@/bindings/BindingsPage.vue";
import CapturesPage from "@/captures/CapturesPage.vue";
import { sections } from "@/lib/capabilities";
import { api } from "@/lib/api";
import { useLiveResource } from "@/stores/live-updates";
import { useLiveResource, useSessionStore } from "@/stores/session";
import MappingsPage from "@/mappings/MappingsPage.vue";
import { activeTab, availableTabs, stepsFor } from "./tab-selection";
import { loadEventCounts, type EventsCounts } from "./counts";
import { eventsWorkspace } from "./workspace";
/**
* The Events surfaces: what arrived, how its fields are read, and which workflow
@@ -54,8 +54,11 @@ const PANELS: Record<string, Component> = {
const route = useRoute();
const router = useRouter();
const orgStore = useOrgStore();
const events = useEventsStore();
const tabs = computed(() => availableTabs(sections.value));
const session = useSessionStore();
const tabs = computed(() => availableTabs(session.sections));
const active = computed(() =>
activeTab(String(route.query.tab ?? ""), tabs.value),
);
@@ -77,7 +80,7 @@ watch(active, (tab) => show(tab), { immediate: true });
// read one source rather than three.
const counts = ref<EventsCounts>({});
async function loadCounts() {
const workspace = eventsWorkspace.value;
const workspace = events.workspace;
counts.value = await loadEventCounts({
captures: api.captures,
mappings: () => api.mappings(workspace),
@@ -94,7 +97,7 @@ const workspaces = ref<OrgWorkspace[]>([]);
watch(
() => String(route.query.workspace ?? ""),
(workspace) => {
eventsWorkspace.value = workspace;
events.workspace = workspace;
void loadCounts();
},
{ immediate: true },
@@ -105,9 +108,9 @@ function pickWorkspace(value: unknown): void {
}
onMounted(async () => {
try {
await loadOrg();
await orgStore.loadOrg();
workspaces.value = (
await api.orgWorkspaces<{ workspaces: OrgWorkspace[] }>(homeOrg.value)
await api.orgWorkspaces<{ workspaces: OrgWorkspace[] }>(orgStore.homeOrg)
).workspaces;
} catch {
// Without the list there is nothing to pick; every workspace shows.
@@ -127,7 +130,7 @@ const panel = computed(() => PANELS[active.value]);
<PageHeader title="Events">
<Select
v-if="workspaces.length > 1"
:model-value="eventsWorkspace || ALL"
:model-value="events.workspace || ALL"
@update:model-value="pickWorkspace"
>
<SelectTrigger size="sm" aria-label="Show records from workspace">
@@ -143,32 +146,23 @@ const panel = computed(() => PANELS[active.value]);
</SelectContent>
</Select>
<template v-if="!captureLoading">
<StatusPill v-if="captureEnabled" dot="live">Listening</StatusPill>
<StatusPill v-else>Capture off</StatusPill>
<Badge v-if="!captureEnabled" variant="warn">Capture off</Badge>
</template>
</PageHeader>
<ol class="mb-6 grid grid-cols-1 overflow-hidden rounded-lg border border-border bg-card sm:grid-cols-3" aria-label="How events become work">
<li v-for="(step, i) in steps" :key="step.id" class="relative border-border not-last:border-b sm:not-last:border-r sm:not-last:border-b-0">
<button
type="button"
class="flex w-full items-center gap-3 px-5 py-4 text-left transition-colors hover:bg-secondary"
:class="active === step.id && 'bg-secondary'"
:aria-current="active === step.id ? 'step' : undefined"
@click="show(step.id)"
<Tabs :model-value="active" class="mb-4" @update:model-value="show">
<TabsList variant="line" class="w-full justify-start" aria-label="How events become work">
<TabsTrigger
v-for="step in steps"
:key="step.id"
:value="step.id"
:title="`${counts[step.id] ?? 0} ${step.hint}`"
class="flex-none px-3"
>{{ step.label }}<span class="font-mono text-xs text-fg-subtle">{{ counts[step.id] ?? "" }}</span></TabsTrigger
>
<span class="grid size-7 shrink-0 place-items-center rounded-full border border-border-strong font-mono text-xs text-fg-muted">{{ i + 1 }}</span>
<span class="min-w-0 flex-1">
<span class="block text-sm font-medium">{{ step.label }}</span>
<span class="block text-xs text-fg-subtle">
<span class="font-mono">{{ counts[step.id] ?? "–" }}</span> {{ step.hint }}
</span>
</span>
<ArrowRight v-if="i < steps.length - 1" class="size-4 text-fg-subtle max-sm:hidden" aria-hidden="true" />
</button>
</li>
</ol>
</TabsList>
</Tabs>
<component :is="panel" v-if="panel" :key="`${active}:${eventsWorkspace}`" />
<component :is="panel" v-if="panel" :key="`${active}:${events.workspace}`" />
<Empty v-else>
<EmptyHeader>
<EmptyTitle>Event automation is not enabled</EmptyTitle>
-9
View File
@@ -1,9 +0,0 @@
import { ref } from "vue";
/**
* The workspace the Events pages list records from and create sources in.
* Empty lists every workspace and creates in the org's default one. Event
* types and bindings take their source's workspace, mappings their event
* type's, so the source is the one record this picks for.
*/
export const eventsWorkspace = ref("");
Loaded 100 of 209 files, more files were not shown because too many files have changed in this diff. Show more