cogpit 3.5.2 → 3.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/cli-runtime.js +1917 -1515
  2. package/dist/instance-worker.js +21 -5
  3. package/dist/web/assets/{AutomationsPanel-B3zT5G5K.js → AutomationsPanel-D7XmgTgZ.js} +1 -1
  4. package/dist/web/assets/{CogpitBlock-d05YgSdQ.js → CogpitBlock-CiS2M1Q_.js} +14 -14
  5. package/dist/web/assets/{CommandPaletteHost-D8fk5Qkq.js → CommandPaletteHost-Dj06VjlP.js} +1 -1
  6. package/dist/web/assets/{ConfigBrowser-BRsvua8m.js → ConfigBrowser-DqQo1F4o.js} +1 -1
  7. package/dist/web/assets/{CrewPanel-C1Yq8jMT.js → CrewPanel-DzLPmS6o.js} +1 -1
  8. package/dist/web/assets/{HighlightedEditor-clIIwmWB.js → HighlightedEditor-DPrSCx1c.js} +2 -2
  9. package/dist/web/assets/{KeyboardShortcutsDialog-0VokzXOy.js → KeyboardShortcutsDialog-BdXPWBJw.js} +1 -1
  10. package/dist/web/assets/{MissionHome-CNjhPZva.js → MissionHome-CTcx5vR7.js} +1 -1
  11. package/dist/web/assets/{MobileFileChanges-iLhOAdgx.js → MobileFileChanges-Ngv9AlhR.js} +1 -1
  12. package/dist/web/assets/PluginsDialog-CWRSNNll.js +1 -0
  13. package/dist/web/assets/{PreviewPanel-DF4kUYpX.js → PreviewPanel-CQcJIdef.js} +1 -1
  14. package/dist/web/assets/{ProjectFilesPanel-D9_OzQi2.js → ProjectFilesPanel-D5EKIBD7.js} +4 -4
  15. package/dist/web/assets/{ProjectSwitcherModal-DMEEWm7Q.js → ProjectSwitcherModal-BoSCOiv9.js} +1 -1
  16. package/dist/web/assets/{TerminalOutput-CrGF3VWW.js → TerminalOutput-DYZJD2WR.js} +1 -1
  17. package/dist/web/assets/{ThemeSelectorModal-BLBet6sQ.js → ThemeSelectorModal-8sO11Ob-.js} +1 -1
  18. package/dist/web/assets/{WorkflowsPanel-DkXoYVsK.js → WorkflowsPanel-qv6TkN7g.js} +1 -1
  19. package/dist/web/assets/WorktreePanel-Dr82TWOP.js +1 -0
  20. package/dist/web/assets/{edition-ui-CvFxsVfJ.js → edition-ui-DQHX5fm4.js} +1 -1
  21. package/dist/web/assets/{index-CAupRX51.js → index-BGSPI7dK.js} +1 -1
  22. package/dist/web/assets/index-BVmNox_3.js +504 -0
  23. package/dist/web/assets/{index-DxZSG7e3.js → index-CHtH7TlZ.js} +2 -2
  24. package/dist/web/assets/index-DKDki7Rz.css +1 -0
  25. package/dist/web/assets/index-DU4gWgPu.js +3 -0
  26. package/dist/web/assets/{index-DueGSx7L.js → index-zhwBlO_8.js} +2 -2
  27. package/dist/web/assets/{session-parser.worker-Dv5Kch9n.js → session-parser.worker-DCsmYUeX.js} +22 -22
  28. package/dist/web/assets/{switch-BHG6oFbM.js → switch-gTnbAJaZ.js} +1 -1
  29. package/dist/web/assets/{vendor-ui-keo4oB2X.js → vendor-ui-CKjyvB3_.js} +201 -196
  30. package/dist/web/index.html +3 -3
  31. package/package.json +1 -1
  32. package/dist/web/assets/PluginsDialog-xM9uR8bB.js +0 -1
  33. package/dist/web/assets/WorktreePanel-DvFGKfAn.js +0 -1
  34. package/dist/web/assets/index-BvNyEUVG.js +0 -506
  35. package/dist/web/assets/index-D6HYPdiw.css +0 -1
@@ -115,14 +115,18 @@ var claude = {
115
115
  // registry checks the prefixed agents first, so this is only ever reached
116
116
  // as the terminal arm.
117
117
  owns: (dirName) => typeof dirName === "string" && !dirName.startsWith(CODEX_DIR_PREFIX) && !dirName.startsWith(COPILOT_DIR_PREFIX),
118
- // An absolute path starts with `/` or `\` (`-`) or a drive (`C:\` → `C--`); a drive root alone is `C-`.
118
+ // An absolute path starts with `/` or `\` (`-`) or a drive (`C:\` → `C--`); a bare drive (`C:`) is `C-`.
119
119
  recognizes: (dirName) => /^(?:(?:-|[A-Za-z]--)[A-Za-z0-9-]*|[A-Za-z]-)$/.test(dirName),
120
120
  /**
121
121
  * Claude Code's own convention: every character outside `[A-Za-z0-9]`
122
122
  * becomes `-`, so `/Users/x/proj` and `C:\Users\x\proj` both collapse into a
123
123
  * flat name under `~/.claude/projects`.
124
124
  */
125
- encode: (cwd) => (cwd.replace(/[\\/]+$/, "") || cwd).replace(/[^a-zA-Z0-9]/g, "-"),
125
+ encode: (cwd) => {
126
+ const trimmed = cwd.replace(/[\\/]+$/, "");
127
+ const isDriveRoot = trimmed !== cwd && /^[A-Za-z]:$/.test(trimmed);
128
+ return (isDriveRoot ? cwd.slice(0, trimmed.length + 1) : trimmed || cwd).replace(/[^a-zA-Z0-9]/g, "-");
129
+ },
126
130
  /**
127
131
  * Best-effort inverse. The encoding is lossy — a literal `-` is
128
132
  * indistinguishable from a separator — so a caller that can read the
@@ -2850,6 +2854,7 @@ async function readClaudeSessionMeta(filePath, head) {
2850
2854
  let foundMessage = false;
2851
2855
  let foundTimestamp = false;
2852
2856
  let foundAiTitle = false;
2857
+ let foundCustomTitle = false;
2853
2858
  let foundModel = !!model;
2854
2859
  outer: for (let i = 0; i < MAX_CHUNKS && cursor > 0; i++) {
2855
2860
  const readSize = Math.min(CHUNK, cursor);
@@ -2881,6 +2886,17 @@ async function readClaudeSessionMeta(filePath, head) {
2881
2886
  }
2882
2887
  continue;
2883
2888
  }
2889
+ if (!foundCustomTitle && line.includes('"custom-title"')) {
2890
+ try {
2891
+ const obj = JSON.parse(line);
2892
+ if (obj.type === "custom-title" && obj.customTitle) {
2893
+ customTitle = obj.customTitle;
2894
+ foundCustomTitle = true;
2895
+ }
2896
+ } catch {
2897
+ }
2898
+ continue;
2899
+ }
2884
2900
  if (!line.includes('"user"')) continue;
2885
2901
  try {
2886
2902
  const obj = JSON.parse(line);
@@ -2896,7 +2912,7 @@ async function readClaudeSessionMeta(filePath, head) {
2896
2912
  foundMessage = true;
2897
2913
  }
2898
2914
  }
2899
- if (foundMessage && foundTimestamp && foundAiTitle && foundModel) break outer;
2915
+ if (foundMessage && foundTimestamp && foundAiTitle && foundCustomTitle && foundModel) break outer;
2900
2916
  } catch {
2901
2917
  continue;
2902
2918
  }
@@ -10803,7 +10819,7 @@ import { randomUUID as randomUUID6 } from "node:crypto";
10803
10819
  import { mkdir as mkdir3 } from "node:fs/promises";
10804
10820
  import { join as join16 } from "node:path";
10805
10821
 
10806
- // ../../server/worktreeSetup/project.ts
10822
+ // ../../server/sessionStartup/project.ts
10807
10823
  import { execFile as execFile2 } from "node:child_process";
10808
10824
  import { promisify as promisify2 } from "node:util";
10809
10825
  import { realpath as realpath4, stat as stat9 } from "node:fs/promises";
@@ -16895,7 +16911,7 @@ import { createInterface as createInterface2 } from "node:readline";
16895
16911
  var package_default = {
16896
16912
  name: "cogpit",
16897
16913
  private: true,
16898
- version: "3.5.2",
16914
+ version: "3.5.3",
16899
16915
  description: "Control center for Claude Code, OpenAI Codex, and GitHub Copilot CLI sessions",
16900
16916
  license: "MIT",
16901
16917
  author: {
@@ -1 +1 @@
1
- import{c as xe,r as N,j as t}from"./vendor-react-gGw_S5I_.js";import{F as Ze,a0 as he,b7 as Ue,B as _,bs as Ye,bu as He,db as Je,dc as Qe,dd as et,cg as tt}from"./index-BvNyEUVG.js";import{cG as st,bP as lt,a4 as nt,b1 as at,b0 as it,b2 as ot,bi as rt}from"./vendor-ui-keo4oB2X.js";import"./vendor-markdown-BEJ8yVzA.js";async function Oe(s){const e=await s.json().catch(()=>({}));if(!s.ok)throw new Error(e.error??`Request failed (${s.status})`);return e}function ct(s){const e=xe.c(12),[n,S]=N.useState(null),[o,m]=N.useState(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=async()=>{try{S((await Oe(await Ze("/api/automations"))).tasks),m(null)}catch(i){const u=i;m(u instanceof Error?u.message:"Could not load tasks")}},e[0]=p):p=e[0];const x=p;let l,v;e[1]!==s?(l=()=>{if(!s)return;x();const i=setInterval(()=>{x()},1e4);return()=>clearInterval(i)},v=[s,x],e[1]=s,e[2]=l,e[3]=v):(l=e[2],v=e[3]),N.useEffect(l,v);const I=mt,R=dt;let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=async i=>{const u=await Oe(await i());return x(),u},e[4]=k):k=e[4];const g=k;let E,j,C,b;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=(i,u,f)=>g(()=>f?he(`/api/automations/${f.id}`,{definition:i,state:u,expectedRevision:f.revision},{method:"PUT"}):he("/api/automations",{definition:i,state:u})),j=i=>g(()=>Ze(`/api/automations/${i}`,{method:"DELETE"})),C=(i,u)=>g(()=>he(`/api/automations/${i}/${u}`,{})),b=i=>g(()=>he(`/api/automations/${i}/rotate-secret`,{})),e[5]=E,e[6]=j,e[7]=C,e[8]=b):(E=e[5],j=e[6],C=e[7],b=e[8]);let h;return e[9]!==o||e[10]!==n?(h={tasks:n,error:o,refresh:x,save:E,remove:j,act:C,rotate:b,runs:I,actOnRun:R},e[9]=o,e[10]=n,e[11]=h):h=e[11],h}function dt(s,e,n){return he(`/api/automations/${s}/runs/${e}/${n}`,{}).then(Oe)}async function mt(s){return(await Oe(await Ze(`/api/automations/${s}/runs`))).runs}const Ge=["sun","mon","tue","wed","thu","fri","sat"],$="w-full rounded border bg-background px-2 py-1 text-xs",ut=Intl.DateTimeFormat().resolvedOptions().timeZone;function ht(s){if(!s)return"No schedule";if(s.kind==="interval")return`Every ${s.everyMinutes} min`;const e=s.days.length===7?"every day":s.days.join(", ");return`${s.time} ${e} (${s.timeZone})`}function qe(s){return s?new Date(s).toLocaleString():"—"}const xt={scheduled:"Waiting",admitting:"Starting",creating:"Starting session",admitted:"Delivering",held:"Held",unknown:"Outcome unknown",completed:"Started",failed:"Failed",cancelled:"Cancelled",skipped:"Skipped"};function pt(s,e){var S,o,m;const n=s==null?void 0:s.schedule;return{name:(s==null?void 0:s.name)??"",prompt:(s==null?void 0:s.prompt)??"",cwd:(s==null?void 0:s.project.cwd)??e??"",agent:(s==null?void 0:s.provider.agent)??et,instanceId:(s==null?void 0:s.provider.instanceId)??"default",model:(s==null?void 0:s.provider.model)??"",workspace:(s==null?void 0:s.workspace)??"project",scheduleKind:n?n.kind:s?"none":"daily",everyMinutes:(n==null?void 0:n.kind)==="interval"?n.everyMinutes:60,time:(n==null?void 0:n.kind)==="daily"?n.time:"09:00",days:(n==null?void 0:n.kind)==="daily"?n.days:["mon","tue","wed","thu","fri"],timeZone:(n==null?void 0:n.kind)==="daily"?n.timeZone:ut,webhook:((S=s==null?void 0:s.webhook)==null?void 0:S.enabled)??!1,scheme:((o=s==null?void 0:s.webhook)==null?void 0:o.scheme)??"cogpit",coalesceSeconds:((m=s==null?void 0:s.webhook)==null?void 0:m.coalesceSeconds)??30,missed:(s==null?void 0:s.missed)??"skip",overlap:(s==null?void 0:s.overlap)??"skip",paused:(s==null?void 0:s.state)==="paused"}}function ft(s){const e=s.cwd.trim();return{name:s.name,prompt:s.prompt,project:{dirName:tt(s.agent,e),cwd:e},provider:{agent:s.agent,instanceId:s.instanceId,...s.model.trim()?{model:s.model.trim()}:{}},workspace:s.workspace,schedule:s.scheduleKind==="none"?null:s.scheduleKind==="interval"?{kind:"interval",everyMinutes:s.everyMinutes}:{kind:"daily",time:s.time,days:s.days,timeZone:s.timeZone},webhook:s.webhook?{enabled:!0,scheme:s.scheme,coalesceSeconds:s.coalesceSeconds}:null,missed:s.missed,overlap:s.overlap}}function vt(s){const e=xe.c(131),{task:n,cwd:S,onSave:o,onCancel:m}=s,p=N.useId();let x;e[0]!==S||e[1]!==n?(x=()=>pt(n,S),e[0]=S,e[1]=n,e[2]=x):x=e[2];const[l,v]=N.useState(x),[I,R]=N.useState(null),[k,g]=N.useState(!1);let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[3]=E):E=e[3];const[j,C]=N.useState(E),b=Je(l.agent,l.instanceId);let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=(a,A)=>v(me=>({...me,[a]:A})),e[4]=h):h=e[4];const i=h;let u,f;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{Ze("/api/provider-instances").then(Nt).then(a=>C(a.instances??[]),yt)},f=[],e[5]=u,e[6]=f):(u=e[5],f=e[6]),N.useEffect(u,f);let d;e[7]!==p?(d=a=>`${p}-${a}`,e[7]=p,e[8]=d):d=e[8];const r=d,w=n?`Edit ${n.name}`:"New task";let y;e[9]!==l||e[10]!==o?(y=a=>{a.preventDefault(),g(!0),R(null),o(ft(l),l.paused?"paused":"active").catch(A=>R(A instanceof Error?A.message:"Could not save")).finally(()=>g(!1))},e[9]=l,e[10]=o,e[11]=y):y=e[11];const D=r("name");let F;e[12]!==D?(F=t.jsx("label",{htmlFor:D,children:"Name"}),e[12]=D,e[13]=F):F=e[13];const O=r("name");let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=a=>i("name",a.target.value),e[14]=M):M=e[14];let K;e[15]!==l.name||e[16]!==O?(K=t.jsx("input",{id:O,className:$,value:l.name,required:!0,maxLength:120,onChange:M}),e[15]=l.name,e[16]=O,e[17]=K):K=e[17];const c=r("prompt");let z;e[18]!==c?(z=t.jsx("label",{htmlFor:c,children:"What the session should do"}),e[18]=c,e[19]=z):z=e[19];const T=r("prompt");let Z;e[20]===Symbol.for("react.memo_cache_sentinel")?(Z=a=>i("prompt",a.target.value),e[20]=Z):Z=e[20];let P;e[21]!==l.prompt||e[22]!==T?(P=t.jsx("textarea",{id:T,className:$,rows:4,value:l.prompt,required:!0,onChange:Z}),e[21]=l.prompt,e[22]=T,e[23]=P):P=e[23];const ue=r("cwd");let W;e[24]!==ue?(W=t.jsx("label",{htmlFor:ue,children:"Project folder"}),e[24]=ue,e[25]=W):W=e[25];const We=r("cwd");let pe;e[26]===Symbol.for("react.memo_cache_sentinel")?(pe=a=>i("cwd",a.target.value),e[26]=pe):pe=e[26];let L;e[27]!==l.cwd||e[28]!==We?(L=t.jsx("input",{id:We,className:`${$} font-mono`,value:l.cwd,required:!0,placeholder:"/path/to/project",onChange:pe}),e[27]=l.cwd,e[28]=We,e[29]=L):L=e[29];const Be=l.agent;let fe,ve;e[30]===Symbol.for("react.memo_cache_sentinel")?(fe=a=>v(A=>({...A,agent:a.target.value,instanceId:"default",model:""})),ve=Qe.map(wt),e[30]=fe,e[31]=ve):(fe=e[30],ve=e[31]);let U;e[32]!==l.agent?(U=t.jsxs("label",{className:"flex flex-col gap-1",children:["Provider",t.jsx("select",{className:$,value:Be,onChange:fe,children:ve})]}),e[32]=l.agent,e[33]=U):U=e[33];const Ve=l.instanceId;let ge,je;e[34]===Symbol.for("react.memo_cache_sentinel")?(ge=a=>i("instanceId",a.target.value),je=t.jsx("option",{value:"default",children:"Default"}),e[34]=ge,e[35]=je):(ge=e[34],je=e[35]);let G;if(e[36]!==l.agent||e[37]!==j){let a;e[39]!==l.agent?(a=A=>A.agent===l.agent&&!A.retired,e[39]=l.agent,e[40]=a):a=e[40],G=j.filter(a).map(bt),e[36]=l.agent,e[37]=j,e[38]=G}else G=e[38];let H;e[41]!==l.instanceId||e[42]!==G?(H=t.jsxs("label",{className:"flex flex-col gap-1",children:["Account",t.jsxs("select",{className:$,value:Ve,onChange:ge,children:[je,G]})]}),e[41]=l.instanceId,e[42]=G,e[43]=H):H=e[43];const Xe=l.model;let be,we;e[44]===Symbol.for("react.memo_cache_sentinel")?(be=a=>i("model",a.target.value),we=t.jsx("option",{value:"",children:"Provider default"}),e[44]=be,e[45]=we):(be=e[44],we=e[45]);let q;e[46]!==b?(q=b.filter(jt).map(gt),e[46]=b,e[47]=q):q=e[47];let B;e[48]!==l.model||e[49]!==q?(B=t.jsxs("label",{className:"flex flex-col gap-1",children:["Model",t.jsxs("select",{className:$,value:Xe,onChange:be,children:[we,q]})]}),e[48]=l.model,e[49]=q,e[50]=B):B=e[50];let ye,Ne,Se;e[51]===Symbol.for("react.memo_cache_sentinel")?(ye=a=>i("workspace",a.target.value),Ne=t.jsx("option",{value:"project",children:"Project folder"}),Se=t.jsx("option",{value:"worktree",children:"New worktree per run"}),e[51]=ye,e[52]=Ne,e[53]=Se):(ye=e[51],Ne=e[52],Se=e[53]);let V;e[54]!==l.workspace?(V=t.jsxs("label",{className:"flex flex-col gap-1",children:["Workspace",t.jsxs("select",{className:$,value:l.workspace,onChange:ye,children:[Ne,Se]})]}),e[54]=l.workspace,e[55]=V):V=e[55];let X;e[56]!==U||e[57]!==H||e[58]!==B||e[59]!==V?(X=t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[U,H,B,V]}),e[56]=U,e[57]=H,e[58]=B,e[59]=V,e[60]=X):X=e[60];let Ce;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("legend",{className:"px-1",children:"Schedule"}),e[61]=Ce):Ce=e[61];let _e,Ee,$e,Ie;e[62]===Symbol.for("react.memo_cache_sentinel")?(_e=a=>i("scheduleKind",a.target.value),Ee=t.jsx("option",{value:"none",children:"None (webhook or manual only)"}),$e=t.jsx("option",{value:"interval",children:"Every few minutes"}),Ie=t.jsx("option",{value:"daily",children:"At a time of day"}),e[62]=_e,e[63]=Ee,e[64]=$e,e[65]=Ie):(_e=e[62],Ee=e[63],$e=e[64],Ie=e[65]);let Y;e[66]!==l.scheduleKind?(Y=t.jsxs("select",{"aria-label":"Schedule kind",className:$,value:l.scheduleKind,onChange:_e,children:[Ee,$e,Ie]}),e[66]=l.scheduleKind,e[67]=Y):Y=e[67];let J;e[68]!==l.everyMinutes||e[69]!==l.scheduleKind?(J=l.scheduleKind==="interval"&&t.jsxs("label",{className:"flex items-center gap-2",children:["Every ",t.jsx("input",{"aria-label":"Minutes between runs",type:"number",min:5,className:`${$} w-20`,value:l.everyMinutes,onChange:a=>i("everyMinutes",Number(a.target.value))})," minutes"]}),e[68]=l.everyMinutes,e[69]=l.scheduleKind,e[70]=J):J=e[70];let Q;e[71]!==l.days||e[72]!==l.scheduleKind||e[73]!==l.time||e[74]!==l.timeZone?(Q=l.scheduleKind==="daily"&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"flex items-center gap-2",children:["At ",t.jsx("input",{"aria-label":"Time of day",type:"time",className:`${$} w-28`,value:l.time,onChange:a=>i("time",a.target.value)}),"in ",t.jsx("input",{"aria-label":"Time zone",className:`${$} w-44`,value:l.timeZone,onChange:a=>i("timeZone",a.target.value)})]}),t.jsx("div",{role:"group","aria-label":"Weekdays",className:"flex flex-wrap gap-2",children:Ge.map(a=>t.jsxs("label",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"checkbox",checked:l.days.includes(a),onChange:A=>i("days",A.target.checked?Ge.filter(me=>me===a||l.days.includes(me)):l.days.filter(me=>me!==a))}),a]},a))})]}),e[71]=l.days,e[72]=l.scheduleKind,e[73]=l.time,e[74]=l.timeZone,e[75]=Q):Q=e[75];let ze,Re,ke;e[76]===Symbol.for("react.memo_cache_sentinel")?(ze=a=>i("missed",a.target.value),Re=t.jsx("option",{value:"skip",children:"Skip them"}),ke=t.jsx("option",{value:"run-once",children:"Run once when back"}),e[76]=ze,e[77]=Re,e[78]=ke):(ze=e[76],Re=e[77],ke=e[78]);let ee;e[79]!==l.missed?(ee=t.jsxs("label",{className:"flex flex-col gap-1",children:["If runs were missed while Cogpit was off",t.jsxs("select",{className:$,value:l.missed,onChange:ze,children:[Re,ke]})]}),e[79]=l.missed,e[80]=ee):ee=e[80];let te;e[81]!==Y||e[82]!==J||e[83]!==Q||e[84]!==ee?(te=t.jsxs("fieldset",{className:"flex flex-col gap-2 rounded border p-2",children:[Ce,Y,J,Q,ee]}),e[81]=Y,e[82]=J,e[83]=Q,e[84]=ee,e[85]=te):te=e[85];let Ae;e[86]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("legend",{className:"px-1",children:"Webhook"}),e[86]=Ae):Ae=e[86];let Te;e[87]===Symbol.for("react.memo_cache_sentinel")?(Te=a=>i("webhook",a.target.checked),e[87]=Te):Te=e[87];let se;e[88]!==l.webhook?(se=t.jsxs("label",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l.webhook,onChange:Te})," Run when a signed delivery arrives"]}),e[88]=l.webhook,e[89]=se):se=e[89];let le;e[90]!==l.coalesceSeconds||e[91]!==l.scheme||e[92]!==l.webhook?(le=l.webhook&&t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsxs("label",{className:"flex flex-col gap-1",children:["Signature",t.jsxs("select",{className:$,value:l.scheme,onChange:a=>i("scheme",a.target.value),children:[t.jsx("option",{value:"cogpit",children:"Cogpit (timestamped)"}),t.jsx("option",{value:"github",children:"GitHub (X-Hub-Signature-256)"})]})]}),t.jsxs("label",{className:"flex flex-col gap-1",children:["Group a burst for (seconds)",t.jsx("input",{type:"number",min:0,max:600,className:$,value:l.coalesceSeconds,onChange:a=>i("coalesceSeconds",Number(a.target.value))})]})]}),e[90]=l.coalesceSeconds,e[91]=l.scheme,e[92]=l.webhook,e[93]=le):le=e[93];let ne;e[94]!==se||e[95]!==le?(ne=t.jsxs("fieldset",{className:"flex flex-col gap-2 rounded border p-2",children:[Ae,se,le]}),e[94]=se,e[95]=le,e[96]=ne):ne=e[96];let Fe,Ke,Pe;e[97]===Symbol.for("react.memo_cache_sentinel")?(Fe=a=>i("overlap",a.target.value),Ke=t.jsx("option",{value:"skip",children:"Skip the new run"}),Pe=t.jsx("option",{value:"allow",children:"Start it anyway"}),e[97]=Fe,e[98]=Ke,e[99]=Pe):(Fe=e[97],Ke=e[98],Pe=e[99]);let ae;e[100]!==l.overlap?(ae=t.jsxs("label",{className:"flex flex-col gap-1",children:["While the previous run still works",t.jsxs("select",{className:$,value:l.overlap,onChange:Fe,children:[Ke,Pe]})]}),e[100]=l.overlap,e[101]=ae):ae=e[101];let De;e[102]===Symbol.for("react.memo_cache_sentinel")?(De=a=>i("paused",a.target.checked),e[102]=De):De=e[102];let ie;e[103]!==l.paused?(ie=t.jsxs("label",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l.paused,onChange:De})," Save paused"]}),e[103]=l.paused,e[104]=ie):ie=e[104];let oe;e[105]!==I?(oe=I&&t.jsx("p",{role:"alert",className:"text-destructive",children:I}),e[105]=I,e[106]=oe):oe=e[106];let re;e[107]!==m?(re=t.jsx(_,{type:"button",variant:"ghost",size:"sm",onClick:m,children:"Cancel"}),e[107]=m,e[108]=re):re=e[108];const Le=k?"Saving…":n?"Save changes":"Create task";let ce;e[109]!==k||e[110]!==Le?(ce=t.jsx(_,{type:"submit",size:"sm",disabled:k,children:Le}),e[109]=k,e[110]=Le,e[111]=ce):ce=e[111];let de;e[112]!==re||e[113]!==ce?(de=t.jsxs("div",{className:"flex justify-end gap-2",children:[re,ce]}),e[112]=re,e[113]=ce,e[114]=de):de=e[114];let Me;return e[115]!==F||e[116]!==K||e[117]!==z||e[118]!==P||e[119]!==W||e[120]!==L||e[121]!==X||e[122]!==te||e[123]!==ne||e[124]!==ae||e[125]!==ie||e[126]!==oe||e[127]!==w||e[128]!==de||e[129]!==y?(Me=t.jsxs("form",{className:"flex flex-col gap-2 rounded-md border p-3 text-xs","aria-label":w,onSubmit:y,children:[F,K,z,P,W,L,X,te,ne,ae,ie,oe,de]}),e[115]=F,e[116]=K,e[117]=z,e[118]=P,e[119]=W,e[120]=L,e[121]=X,e[122]=te,e[123]=ne,e[124]=ae,e[125]=ie,e[126]=oe,e[127]=w,e[128]=de,e[129]=y,e[130]=Me):Me=e[130],Me}function gt(s){return t.jsx("option",{value:s.value,children:s.label},s.value)}function jt(s){return s.value}function bt(s){return t.jsx("option",{value:s.id,children:s.label},s.id)}function wt(s){return t.jsx("option",{value:s,children:He(s).displayName},s)}function yt(){}function Nt(s){return s.ok?s.json():{instances:[]}}const St=5e3;function Ct(s){const e=xe.c(28),{task:n,automations:S,active:o,version:m,openSession:p}=s,[x,l]=N.useState(null),[v,I]=N.useState(null),[R,k]=N.useState(0),{runs:g,actOnRun:E}=S;let j;e[0]!==o||e[1]!==g||e[2]!==n.id?(j=()=>{let d=!0;const r=()=>{g(n.id).then(y=>{d&&(l(y),I(null))},y=>{d&&I(y instanceof Error?y.message:"Could not load runs")})};r();const w=o?setInterval(r,St):void 0;return()=>{d=!1,clearInterval(w)}},e[0]=o,e[1]=g,e[2]=n.id,e[3]=j):j=e[3];let C;e[4]!==o||e[5]!==g||e[6]!==R||e[7]!==n.id||e[8]!==n.updatedAt||e[9]!==m?(C=[g,n.id,n.updatedAt,o,m,R],e[4]=o,e[5]=g,e[6]=R,e[7]=n.id,e[8]=n.updatedAt,e[9]=m,e[10]=C):C=e[10],N.useEffect(j,C);let b;e[11]!==E||e[12]!==n.id?(b=(d,r)=>{E(n.id,d.id,r).then(()=>k(_t),w=>I(w instanceof Error?w.message:"Could not update the run"))},e[11]=E,e[12]=n.id,e[13]=b):b=e[13];const h=b;if(v){let d;return e[14]!==v?(d=t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:v}),e[14]=v,e[15]=d):d=e[15],d}if(!x){let d;return e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:"Loading runs…"}),e[16]=d):d=e[16],d}if(x.length===0){let d;return e[17]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:"No runs yet."}),e[17]=d):d=e[17],d}const i=`Runs of ${n.name}`;let u;if(e[18]!==h||e[19]!==p||e[20]!==x){let d;e[22]!==h||e[23]!==p?(d=r=>{var w;return t.jsxs("li",{className:"flex flex-wrap items-center gap-2 rounded border px-2 py-1 text-xs",children:[t.jsx("span",{className:"font-medium",children:xt[r.state]}),t.jsxs("span",{className:"text-muted-foreground",children:[r.trigger,r.deliveries>1?` · ${r.deliveries} deliveries`:""," · ",qe(r.dueAt)]}),r.session&&t.jsx("span",{className:"text-muted-foreground",children:r.session.working?"session working":"session idle"}),r.reason&&t.jsx("span",{className:"basis-full text-muted-foreground",children:r.reason}),t.jsxs("span",{className:"ml-auto flex gap-1",children:[((w=r.session)==null?void 0:w.dirName)&&r.session.fileName&&p&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>p(r.session.dirName,r.session.fileName),children:"Open session"}),(r.state==="scheduled"||r.state==="held")&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"cancel"),children:"Cancel"}),r.state==="held"&&r.hold==="reauthorize"&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"reauthorize"),children:"Reauthorize"}),r.state==="unknown"&&t.jsxs(t.Fragment,{children:[t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"mark-started"),children:"It started"}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"mark-not-started"),children:"It did not start"})]})]})]},r.id)},e[22]=h,e[23]=p,e[24]=d):d=e[24],u=x.map(d),e[18]=h,e[19]=p,e[20]=x,e[21]=u}else u=e[21];let f;return e[25]!==i||e[26]!==u?(f=t.jsx("ol",{"aria-label":i,className:"flex flex-col gap-1",children:u}),e[25]=i,e[26]=u,e[27]=f):f=e[27],f}function _t(s){return s+1}function At(s){const e=xe.c(3),n=Ue("hostFiles"),S=Ue("terminal");if(!n||!S){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("p",{role:"status",className:"p-3 text-xs text-muted-foreground",children:"Scheduled tasks need host-file and terminal access on this server."}),e[0]=m):m=e[0],m}let o;return e[1]!==s?(o=t.jsx(Et,{...s}),e[1]=s,e[2]=o):o=e[2],o}function Et(s){var F,O,M,K;const e=xe.c(31),{context:n,active:S}=s,o=ct(S),[m,p]=N.useState(null),[x,l]=N.useState(null),[v,I]=N.useState(null),[R,k]=N.useState(null),[g,E]=N.useState(0);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=c=>{c.catch(z=>k(z instanceof Error?z.message:"The request failed"))},e[0]=j):j=e[0];const C=j;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("h2",{className:"text-sm font-medium",children:"Scheduled and webhook tasks"}),e[1]=b):b=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"flex items-center justify-between",children:[b,t.jsxs(_,{size:"sm",variant:"outline",onClick:()=>p("new"),children:[t.jsx(rt,{"data-icon":"inline-start"}),"New task"]})]}),e[2]=h):h=e[2];let i;e[3]!==R?(i=R&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:R}),e[3]=R,e[4]=i):i=e[4];let u;e[5]!==o.error?(u=o.error&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:o.error}),e[5]=o.error,e[6]=u):u=e[6];let f;e[7]!==o||e[8]!==n||e[9]!==m?(f=m&&t.jsx(vt,{task:m==="new"?null:m,cwd:n.projectPath,onCancel:()=>p(null),onSave:async(c,z)=>{const T=await o.save(c,z,m==="new"?void 0:m);T.webhookSecret&&I({taskId:T.task.id,value:T.webhookSecret}),p(null)}}),e[7]=o,e[8]=n,e[9]=m,e[10]=f):f=e[10];let d;e[11]!==v?(d=v&&t.jsxs("div",{role:"status",className:"flex flex-col gap-1 rounded-md border border-warning/40 p-2 text-xs",children:[t.jsx("p",{children:"Webhook secret — shown only now. Store it with the sender:"}),t.jsx("code",{className:"break-all font-mono",children:v.value}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(_,{size:"xs",variant:"outline",onClick:()=>void Ye(v.value),children:"Copy secret"}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>I(null),children:"Done"})]})]}),e[11]=v,e[12]=d):d=e[12];let r;e[13]!==((F=o.tasks)==null?void 0:F.length)||e[14]!==m?(r=((O=o.tasks)==null?void 0:O.length)===0&&!m&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No tasks yet. A task starts a new session on a schedule, when a signed webhook arrives, or when you run it."}),e[13]=(M=o.tasks)==null?void 0:M.length,e[14]=m,e[15]=r):r=e[15];let w;e[16]!==S||e[17]!==o||e[18]!==n||e[19]!==x||e[20]!==g?(w=(K=o.tasks)==null?void 0:K.map(c=>{var z,T,Z,P;return t.jsxs("li",{className:"flex flex-col gap-2 rounded-md border p-2 text-xs",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"font-medium",children:c.name}),t.jsx("span",{className:"rounded bg-muted px-1.5",children:c.state==="paused"?"Paused":"Active"}),((z=c.authority)==null?void 0:z.revoked)&&t.jsx("span",{className:"text-destructive",children:"Authorization revoked"}),((T=c.authority)==null?void 0:T.source)==="none"&&t.jsx("span",{className:"text-warning",children:"Runs wait for you to reauthorize them"})]}),t.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-muted-foreground",children:[t.jsxs("span",{children:[t.jsx(st,{className:"mr-1 inline size-3","aria-hidden":!0}),ht(c.schedule)]}),t.jsxs("span",{children:["Next: ",qe(c.nextRunAt)]}),t.jsx("span",{className:"font-mono",children:c.project.cwd}),t.jsxs("span",{children:[He(c.provider.agent).displayName,c.provider.model?` · ${c.provider.model}`:""," · ",c.workspace==="worktree"?"new worktree":"project folder"]})]}),((Z=c.webhook)==null?void 0:Z.enabled)&&t.jsxs("div",{className:"flex flex-col gap-1 text-muted-foreground",children:[t.jsxs("span",{children:[t.jsx(lt,{className:"mr-1 inline size-3","aria-hidden":!0}),c.webhookUrl?t.jsx("code",{className:"break-all",children:c.webhookUrl}):"Webhook ingress is not available on this server's sign-in"]}),c.webhookReachability==="local-only"&&t.jsx("span",{children:"Reachable only where this machine is; set COGPIT_PUBLIC_URL when a tunnel or proxy exposes it."})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.jsxs(_,{size:"xs",variant:"outline",onClick:()=>C(o.act(c.id,"run").then(()=>E($t))),children:[t.jsx(nt,{"data-icon":"inline-start"}),"Run now"]}),c.state==="active"?t.jsxs(_,{size:"xs",variant:"ghost",onClick:()=>C(o.act(c.id,"pause")),children:[t.jsx(at,{"data-icon":"inline-start"}),"Pause"]}):t.jsxs(_,{size:"xs",variant:"ghost",onClick:()=>C(o.act(c.id,"resume")),children:[t.jsx(it,{"data-icon":"inline-start"}),"Resume"]}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>p(c),children:"Edit"}),((P=c.webhook)==null?void 0:P.enabled)&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>C(o.rotate(c.id).then(ue=>I({taskId:c.id,value:ue.webhookSecret}))),children:"Rotate secret"}),t.jsx(_,{size:"xs",variant:"ghost","aria-expanded":x===c.id,onClick:()=>l(x===c.id?null:c.id),children:"History"}),t.jsx(_,{size:"xs",variant:"ghost","aria-label":`Delete ${c.name}`,onClick:()=>{window.confirm(`Delete ${c.name}? Waiting runs are cancelled.`)&&C(o.remove(c.id))},children:t.jsx(ot,{"data-icon":"inline-start"})})]}),x===c.id&&t.jsx(Ct,{task:c,automations:o,active:S,version:g,openSession:n.openSession})]},c.id)}),e[16]=S,e[17]=o,e[18]=n,e[19]=x,e[20]=g,e[21]=w):w=e[21];let y;e[22]!==w?(y=t.jsx("ul",{"aria-label":"Tasks",className:"flex flex-col gap-2",children:w}),e[22]=w,e[23]=y):y=e[23];let D;return e[24]!==y||e[25]!==i||e[26]!==u||e[27]!==f||e[28]!==d||e[29]!==r?(D=t.jsxs("section",{"aria-label":"Automations",className:"flex h-full min-h-0 flex-col gap-3 overflow-auto p-3",children:[h,i,u,f,d,r,y]}),e[24]=y,e[25]=i,e[26]=u,e[27]=f,e[28]=d,e[29]=r,e[30]=D):D=e[30],D}function $t(s){return s+1}export{At as AutomationsPanel};
1
+ import{c as xe,r as N,j as t}from"./vendor-react-gGw_S5I_.js";import{F as Ze,a0 as he,b7 as Ue,B as _,bs as Ye,bu as qe,dr as Je,ds as Qe,dt as et,cg as tt}from"./index-BVmNox_3.js";import{cF as st,bN as lt,a4 as nt,a$ as at,a_ as it,b0 as ot,bg as rt}from"./vendor-ui-CKjyvB3_.js";import"./vendor-markdown-BEJ8yVzA.js";async function Oe(s){const e=await s.json().catch(()=>({}));if(!s.ok)throw new Error(e.error??`Request failed (${s.status})`);return e}function ct(s){const e=xe.c(12),[n,S]=N.useState(null),[o,m]=N.useState(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=async()=>{try{S((await Oe(await Ze("/api/automations"))).tasks),m(null)}catch(i){const u=i;m(u instanceof Error?u.message:"Could not load tasks")}},e[0]=p):p=e[0];const x=p;let l,v;e[1]!==s?(l=()=>{if(!s)return;x();const i=setInterval(()=>{x()},1e4);return()=>clearInterval(i)},v=[s,x],e[1]=s,e[2]=l,e[3]=v):(l=e[2],v=e[3]),N.useEffect(l,v);const I=mt,R=dt;let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=async i=>{const u=await Oe(await i());return x(),u},e[4]=k):k=e[4];const g=k;let E,j,C,b;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=(i,u,f)=>g(()=>f?he(`/api/automations/${f.id}`,{definition:i,state:u,expectedRevision:f.revision},{method:"PUT"}):he("/api/automations",{definition:i,state:u})),j=i=>g(()=>Ze(`/api/automations/${i}`,{method:"DELETE"})),C=(i,u)=>g(()=>he(`/api/automations/${i}/${u}`,{})),b=i=>g(()=>he(`/api/automations/${i}/rotate-secret`,{})),e[5]=E,e[6]=j,e[7]=C,e[8]=b):(E=e[5],j=e[6],C=e[7],b=e[8]);let h;return e[9]!==o||e[10]!==n?(h={tasks:n,error:o,refresh:x,save:E,remove:j,act:C,rotate:b,runs:I,actOnRun:R},e[9]=o,e[10]=n,e[11]=h):h=e[11],h}function dt(s,e,n){return he(`/api/automations/${s}/runs/${e}/${n}`,{}).then(Oe)}async function mt(s){return(await Oe(await Ze(`/api/automations/${s}/runs`))).runs}const He=["sun","mon","tue","wed","thu","fri","sat"],$="w-full rounded border bg-background px-2 py-1 text-xs",ut=Intl.DateTimeFormat().resolvedOptions().timeZone;function ht(s){if(!s)return"No schedule";if(s.kind==="interval")return`Every ${s.everyMinutes} min`;const e=s.days.length===7?"every day":s.days.join(", ");return`${s.time} ${e} (${s.timeZone})`}function Ge(s){return s?new Date(s).toLocaleString():"—"}const xt={scheduled:"Waiting",admitting:"Starting",creating:"Starting session",admitted:"Delivering",held:"Held",unknown:"Outcome unknown",completed:"Started",failed:"Failed",cancelled:"Cancelled",skipped:"Skipped"};function pt(s,e){var S,o,m;const n=s==null?void 0:s.schedule;return{name:(s==null?void 0:s.name)??"",prompt:(s==null?void 0:s.prompt)??"",cwd:(s==null?void 0:s.project.cwd)??e??"",agent:(s==null?void 0:s.provider.agent)??et,instanceId:(s==null?void 0:s.provider.instanceId)??"default",model:(s==null?void 0:s.provider.model)??"",workspace:(s==null?void 0:s.workspace)??"project",scheduleKind:n?n.kind:s?"none":"daily",everyMinutes:(n==null?void 0:n.kind)==="interval"?n.everyMinutes:60,time:(n==null?void 0:n.kind)==="daily"?n.time:"09:00",days:(n==null?void 0:n.kind)==="daily"?n.days:["mon","tue","wed","thu","fri"],timeZone:(n==null?void 0:n.kind)==="daily"?n.timeZone:ut,webhook:((S=s==null?void 0:s.webhook)==null?void 0:S.enabled)??!1,scheme:((o=s==null?void 0:s.webhook)==null?void 0:o.scheme)??"cogpit",coalesceSeconds:((m=s==null?void 0:s.webhook)==null?void 0:m.coalesceSeconds)??30,missed:(s==null?void 0:s.missed)??"skip",overlap:(s==null?void 0:s.overlap)??"skip",paused:(s==null?void 0:s.state)==="paused"}}function ft(s){const e=s.cwd.trim();return{name:s.name,prompt:s.prompt,project:{dirName:tt(s.agent,e),cwd:e},provider:{agent:s.agent,instanceId:s.instanceId,...s.model.trim()?{model:s.model.trim()}:{}},workspace:s.workspace,schedule:s.scheduleKind==="none"?null:s.scheduleKind==="interval"?{kind:"interval",everyMinutes:s.everyMinutes}:{kind:"daily",time:s.time,days:s.days,timeZone:s.timeZone},webhook:s.webhook?{enabled:!0,scheme:s.scheme,coalesceSeconds:s.coalesceSeconds}:null,missed:s.missed,overlap:s.overlap}}function vt(s){const e=xe.c(131),{task:n,cwd:S,onSave:o,onCancel:m}=s,p=N.useId();let x;e[0]!==S||e[1]!==n?(x=()=>pt(n,S),e[0]=S,e[1]=n,e[2]=x):x=e[2];const[l,v]=N.useState(x),[I,R]=N.useState(null),[k,g]=N.useState(!1);let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[3]=E):E=e[3];const[j,C]=N.useState(E),b=Je(l.agent,l.instanceId);let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=(a,A)=>v(me=>({...me,[a]:A})),e[4]=h):h=e[4];const i=h;let u,f;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{Ze("/api/provider-instances").then(Nt).then(a=>C(a.instances??[]),yt)},f=[],e[5]=u,e[6]=f):(u=e[5],f=e[6]),N.useEffect(u,f);let d;e[7]!==p?(d=a=>`${p}-${a}`,e[7]=p,e[8]=d):d=e[8];const r=d,w=n?`Edit ${n.name}`:"New task";let y;e[9]!==l||e[10]!==o?(y=a=>{a.preventDefault(),g(!0),R(null),o(ft(l),l.paused?"paused":"active").catch(A=>R(A instanceof Error?A.message:"Could not save")).finally(()=>g(!1))},e[9]=l,e[10]=o,e[11]=y):y=e[11];const P=r("name");let F;e[12]!==P?(F=t.jsx("label",{htmlFor:P,children:"Name"}),e[12]=P,e[13]=F):F=e[13];const O=r("name");let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=a=>i("name",a.target.value),e[14]=M):M=e[14];let K;e[15]!==l.name||e[16]!==O?(K=t.jsx("input",{id:O,className:$,value:l.name,required:!0,maxLength:120,onChange:M}),e[15]=l.name,e[16]=O,e[17]=K):K=e[17];const c=r("prompt");let z;e[18]!==c?(z=t.jsx("label",{htmlFor:c,children:"What the session should do"}),e[18]=c,e[19]=z):z=e[19];const T=r("prompt");let Z;e[20]===Symbol.for("react.memo_cache_sentinel")?(Z=a=>i("prompt",a.target.value),e[20]=Z):Z=e[20];let D;e[21]!==l.prompt||e[22]!==T?(D=t.jsx("textarea",{id:T,className:$,rows:4,value:l.prompt,required:!0,onChange:Z}),e[21]=l.prompt,e[22]=T,e[23]=D):D=e[23];const ue=r("cwd");let W;e[24]!==ue?(W=t.jsx("label",{htmlFor:ue,children:"Project folder"}),e[24]=ue,e[25]=W):W=e[25];const We=r("cwd");let pe;e[26]===Symbol.for("react.memo_cache_sentinel")?(pe=a=>i("cwd",a.target.value),e[26]=pe):pe=e[26];let L;e[27]!==l.cwd||e[28]!==We?(L=t.jsx("input",{id:We,className:`${$} font-mono`,value:l.cwd,required:!0,placeholder:"/path/to/project",onChange:pe}),e[27]=l.cwd,e[28]=We,e[29]=L):L=e[29];const Be=l.agent;let fe,ve;e[30]===Symbol.for("react.memo_cache_sentinel")?(fe=a=>v(A=>({...A,agent:a.target.value,instanceId:"default",model:""})),ve=Qe.map(wt),e[30]=fe,e[31]=ve):(fe=e[30],ve=e[31]);let U;e[32]!==l.agent?(U=t.jsxs("label",{className:"flex flex-col gap-1",children:["Provider",t.jsx("select",{className:$,value:Be,onChange:fe,children:ve})]}),e[32]=l.agent,e[33]=U):U=e[33];const Ve=l.instanceId;let ge,je;e[34]===Symbol.for("react.memo_cache_sentinel")?(ge=a=>i("instanceId",a.target.value),je=t.jsx("option",{value:"default",children:"Default"}),e[34]=ge,e[35]=je):(ge=e[34],je=e[35]);let H;if(e[36]!==l.agent||e[37]!==j){let a;e[39]!==l.agent?(a=A=>A.agent===l.agent&&!A.retired,e[39]=l.agent,e[40]=a):a=e[40],H=j.filter(a).map(bt),e[36]=l.agent,e[37]=j,e[38]=H}else H=e[38];let q;e[41]!==l.instanceId||e[42]!==H?(q=t.jsxs("label",{className:"flex flex-col gap-1",children:["Account",t.jsxs("select",{className:$,value:Ve,onChange:ge,children:[je,H]})]}),e[41]=l.instanceId,e[42]=H,e[43]=q):q=e[43];const Xe=l.model;let be,we;e[44]===Symbol.for("react.memo_cache_sentinel")?(be=a=>i("model",a.target.value),we=t.jsx("option",{value:"",children:"Provider default"}),e[44]=be,e[45]=we):(be=e[44],we=e[45]);let G;e[46]!==b?(G=b.filter(jt).map(gt),e[46]=b,e[47]=G):G=e[47];let B;e[48]!==l.model||e[49]!==G?(B=t.jsxs("label",{className:"flex flex-col gap-1",children:["Model",t.jsxs("select",{className:$,value:Xe,onChange:be,children:[we,G]})]}),e[48]=l.model,e[49]=G,e[50]=B):B=e[50];let ye,Ne,Se;e[51]===Symbol.for("react.memo_cache_sentinel")?(ye=a=>i("workspace",a.target.value),Ne=t.jsx("option",{value:"project",children:"Project folder"}),Se=t.jsx("option",{value:"worktree",children:"New worktree per run"}),e[51]=ye,e[52]=Ne,e[53]=Se):(ye=e[51],Ne=e[52],Se=e[53]);let V;e[54]!==l.workspace?(V=t.jsxs("label",{className:"flex flex-col gap-1",children:["Workspace",t.jsxs("select",{className:$,value:l.workspace,onChange:ye,children:[Ne,Se]})]}),e[54]=l.workspace,e[55]=V):V=e[55];let X;e[56]!==U||e[57]!==q||e[58]!==B||e[59]!==V?(X=t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[U,q,B,V]}),e[56]=U,e[57]=q,e[58]=B,e[59]=V,e[60]=X):X=e[60];let Ce;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("legend",{className:"px-1",children:"Schedule"}),e[61]=Ce):Ce=e[61];let _e,Ee,$e,Ie;e[62]===Symbol.for("react.memo_cache_sentinel")?(_e=a=>i("scheduleKind",a.target.value),Ee=t.jsx("option",{value:"none",children:"None (webhook or manual only)"}),$e=t.jsx("option",{value:"interval",children:"Every few minutes"}),Ie=t.jsx("option",{value:"daily",children:"At a time of day"}),e[62]=_e,e[63]=Ee,e[64]=$e,e[65]=Ie):(_e=e[62],Ee=e[63],$e=e[64],Ie=e[65]);let Y;e[66]!==l.scheduleKind?(Y=t.jsxs("select",{"aria-label":"Schedule kind",className:$,value:l.scheduleKind,onChange:_e,children:[Ee,$e,Ie]}),e[66]=l.scheduleKind,e[67]=Y):Y=e[67];let J;e[68]!==l.everyMinutes||e[69]!==l.scheduleKind?(J=l.scheduleKind==="interval"&&t.jsxs("label",{className:"flex items-center gap-2",children:["Every ",t.jsx("input",{"aria-label":"Minutes between runs",type:"number",min:5,className:`${$} w-20`,value:l.everyMinutes,onChange:a=>i("everyMinutes",Number(a.target.value))})," minutes"]}),e[68]=l.everyMinutes,e[69]=l.scheduleKind,e[70]=J):J=e[70];let Q;e[71]!==l.days||e[72]!==l.scheduleKind||e[73]!==l.time||e[74]!==l.timeZone?(Q=l.scheduleKind==="daily"&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"flex items-center gap-2",children:["At ",t.jsx("input",{"aria-label":"Time of day",type:"time",className:`${$} w-28`,value:l.time,onChange:a=>i("time",a.target.value)}),"in ",t.jsx("input",{"aria-label":"Time zone",className:`${$} w-44`,value:l.timeZone,onChange:a=>i("timeZone",a.target.value)})]}),t.jsx("div",{role:"group","aria-label":"Weekdays",className:"flex flex-wrap gap-2",children:He.map(a=>t.jsxs("label",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"checkbox",checked:l.days.includes(a),onChange:A=>i("days",A.target.checked?He.filter(me=>me===a||l.days.includes(me)):l.days.filter(me=>me!==a))}),a]},a))})]}),e[71]=l.days,e[72]=l.scheduleKind,e[73]=l.time,e[74]=l.timeZone,e[75]=Q):Q=e[75];let ze,Re,ke;e[76]===Symbol.for("react.memo_cache_sentinel")?(ze=a=>i("missed",a.target.value),Re=t.jsx("option",{value:"skip",children:"Skip them"}),ke=t.jsx("option",{value:"run-once",children:"Run once when back"}),e[76]=ze,e[77]=Re,e[78]=ke):(ze=e[76],Re=e[77],ke=e[78]);let ee;e[79]!==l.missed?(ee=t.jsxs("label",{className:"flex flex-col gap-1",children:["If runs were missed while Cogpit was off",t.jsxs("select",{className:$,value:l.missed,onChange:ze,children:[Re,ke]})]}),e[79]=l.missed,e[80]=ee):ee=e[80];let te;e[81]!==Y||e[82]!==J||e[83]!==Q||e[84]!==ee?(te=t.jsxs("fieldset",{className:"flex flex-col gap-2 rounded border p-2",children:[Ce,Y,J,Q,ee]}),e[81]=Y,e[82]=J,e[83]=Q,e[84]=ee,e[85]=te):te=e[85];let Ae;e[86]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("legend",{className:"px-1",children:"Webhook"}),e[86]=Ae):Ae=e[86];let Te;e[87]===Symbol.for("react.memo_cache_sentinel")?(Te=a=>i("webhook",a.target.checked),e[87]=Te):Te=e[87];let se;e[88]!==l.webhook?(se=t.jsxs("label",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l.webhook,onChange:Te})," Run when a signed delivery arrives"]}),e[88]=l.webhook,e[89]=se):se=e[89];let le;e[90]!==l.coalesceSeconds||e[91]!==l.scheme||e[92]!==l.webhook?(le=l.webhook&&t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsxs("label",{className:"flex flex-col gap-1",children:["Signature",t.jsxs("select",{className:$,value:l.scheme,onChange:a=>i("scheme",a.target.value),children:[t.jsx("option",{value:"cogpit",children:"Cogpit (timestamped)"}),t.jsx("option",{value:"github",children:"GitHub (X-Hub-Signature-256)"})]})]}),t.jsxs("label",{className:"flex flex-col gap-1",children:["Group a burst for (seconds)",t.jsx("input",{type:"number",min:0,max:600,className:$,value:l.coalesceSeconds,onChange:a=>i("coalesceSeconds",Number(a.target.value))})]})]}),e[90]=l.coalesceSeconds,e[91]=l.scheme,e[92]=l.webhook,e[93]=le):le=e[93];let ne;e[94]!==se||e[95]!==le?(ne=t.jsxs("fieldset",{className:"flex flex-col gap-2 rounded border p-2",children:[Ae,se,le]}),e[94]=se,e[95]=le,e[96]=ne):ne=e[96];let Fe,Ke,De;e[97]===Symbol.for("react.memo_cache_sentinel")?(Fe=a=>i("overlap",a.target.value),Ke=t.jsx("option",{value:"skip",children:"Skip the new run"}),De=t.jsx("option",{value:"allow",children:"Start it anyway"}),e[97]=Fe,e[98]=Ke,e[99]=De):(Fe=e[97],Ke=e[98],De=e[99]);let ae;e[100]!==l.overlap?(ae=t.jsxs("label",{className:"flex flex-col gap-1",children:["While the previous run still works",t.jsxs("select",{className:$,value:l.overlap,onChange:Fe,children:[Ke,De]})]}),e[100]=l.overlap,e[101]=ae):ae=e[101];let Pe;e[102]===Symbol.for("react.memo_cache_sentinel")?(Pe=a=>i("paused",a.target.checked),e[102]=Pe):Pe=e[102];let ie;e[103]!==l.paused?(ie=t.jsxs("label",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l.paused,onChange:Pe})," Save paused"]}),e[103]=l.paused,e[104]=ie):ie=e[104];let oe;e[105]!==I?(oe=I&&t.jsx("p",{role:"alert",className:"text-destructive",children:I}),e[105]=I,e[106]=oe):oe=e[106];let re;e[107]!==m?(re=t.jsx(_,{type:"button",variant:"ghost",size:"sm",onClick:m,children:"Cancel"}),e[107]=m,e[108]=re):re=e[108];const Le=k?"Saving…":n?"Save changes":"Create task";let ce;e[109]!==k||e[110]!==Le?(ce=t.jsx(_,{type:"submit",size:"sm",disabled:k,children:Le}),e[109]=k,e[110]=Le,e[111]=ce):ce=e[111];let de;e[112]!==re||e[113]!==ce?(de=t.jsxs("div",{className:"flex justify-end gap-2",children:[re,ce]}),e[112]=re,e[113]=ce,e[114]=de):de=e[114];let Me;return e[115]!==F||e[116]!==K||e[117]!==z||e[118]!==D||e[119]!==W||e[120]!==L||e[121]!==X||e[122]!==te||e[123]!==ne||e[124]!==ae||e[125]!==ie||e[126]!==oe||e[127]!==w||e[128]!==de||e[129]!==y?(Me=t.jsxs("form",{className:"flex flex-col gap-2 rounded-md border p-3 text-xs","aria-label":w,onSubmit:y,children:[F,K,z,D,W,L,X,te,ne,ae,ie,oe,de]}),e[115]=F,e[116]=K,e[117]=z,e[118]=D,e[119]=W,e[120]=L,e[121]=X,e[122]=te,e[123]=ne,e[124]=ae,e[125]=ie,e[126]=oe,e[127]=w,e[128]=de,e[129]=y,e[130]=Me):Me=e[130],Me}function gt(s){return t.jsx("option",{value:s.value,children:s.label},s.value)}function jt(s){return s.value}function bt(s){return t.jsx("option",{value:s.id,children:s.label},s.id)}function wt(s){return t.jsx("option",{value:s,children:qe(s).displayName},s)}function yt(){}function Nt(s){return s.ok?s.json():{instances:[]}}const St=5e3;function Ct(s){const e=xe.c(28),{task:n,automations:S,active:o,version:m,openSession:p}=s,[x,l]=N.useState(null),[v,I]=N.useState(null),[R,k]=N.useState(0),{runs:g,actOnRun:E}=S;let j;e[0]!==o||e[1]!==g||e[2]!==n.id?(j=()=>{let d=!0;const r=()=>{g(n.id).then(y=>{d&&(l(y),I(null))},y=>{d&&I(y instanceof Error?y.message:"Could not load runs")})};r();const w=o?setInterval(r,St):void 0;return()=>{d=!1,clearInterval(w)}},e[0]=o,e[1]=g,e[2]=n.id,e[3]=j):j=e[3];let C;e[4]!==o||e[5]!==g||e[6]!==R||e[7]!==n.id||e[8]!==n.updatedAt||e[9]!==m?(C=[g,n.id,n.updatedAt,o,m,R],e[4]=o,e[5]=g,e[6]=R,e[7]=n.id,e[8]=n.updatedAt,e[9]=m,e[10]=C):C=e[10],N.useEffect(j,C);let b;e[11]!==E||e[12]!==n.id?(b=(d,r)=>{E(n.id,d.id,r).then(()=>k(_t),w=>I(w instanceof Error?w.message:"Could not update the run"))},e[11]=E,e[12]=n.id,e[13]=b):b=e[13];const h=b;if(v){let d;return e[14]!==v?(d=t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:v}),e[14]=v,e[15]=d):d=e[15],d}if(!x){let d;return e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:"Loading runs…"}),e[16]=d):d=e[16],d}if(x.length===0){let d;return e[17]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:"No runs yet."}),e[17]=d):d=e[17],d}const i=`Runs of ${n.name}`;let u;if(e[18]!==h||e[19]!==p||e[20]!==x){let d;e[22]!==h||e[23]!==p?(d=r=>{var w;return t.jsxs("li",{className:"flex flex-wrap items-center gap-2 rounded border px-2 py-1 text-xs",children:[t.jsx("span",{className:"font-medium",children:xt[r.state]}),t.jsxs("span",{className:"text-muted-foreground",children:[r.trigger,r.deliveries>1?` · ${r.deliveries} deliveries`:""," · ",Ge(r.dueAt)]}),r.session&&t.jsx("span",{className:"text-muted-foreground",children:r.session.working?"session working":"session idle"}),r.reason&&t.jsx("span",{className:"basis-full text-muted-foreground",children:r.reason}),t.jsxs("span",{className:"ml-auto flex gap-1",children:[((w=r.session)==null?void 0:w.dirName)&&r.session.fileName&&p&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>p(r.session.dirName,r.session.fileName),children:"Open session"}),(r.state==="scheduled"||r.state==="held")&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"cancel"),children:"Cancel"}),r.state==="held"&&r.hold==="reauthorize"&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"reauthorize"),children:"Reauthorize"}),r.state==="unknown"&&t.jsxs(t.Fragment,{children:[t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"mark-started"),children:"It started"}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"mark-not-started"),children:"It did not start"})]})]})]},r.id)},e[22]=h,e[23]=p,e[24]=d):d=e[24],u=x.map(d),e[18]=h,e[19]=p,e[20]=x,e[21]=u}else u=e[21];let f;return e[25]!==i||e[26]!==u?(f=t.jsx("ol",{"aria-label":i,className:"flex flex-col gap-1",children:u}),e[25]=i,e[26]=u,e[27]=f):f=e[27],f}function _t(s){return s+1}function At(s){const e=xe.c(3),n=Ue("hostFiles"),S=Ue("terminal");if(!n||!S){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("p",{role:"status",className:"p-3 text-xs text-muted-foreground",children:"Scheduled tasks need host-file and terminal access on this server."}),e[0]=m):m=e[0],m}let o;return e[1]!==s?(o=t.jsx(Et,{...s}),e[1]=s,e[2]=o):o=e[2],o}function Et(s){var F,O,M,K;const e=xe.c(31),{context:n,active:S}=s,o=ct(S),[m,p]=N.useState(null),[x,l]=N.useState(null),[v,I]=N.useState(null),[R,k]=N.useState(null),[g,E]=N.useState(0);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=c=>{c.catch(z=>k(z instanceof Error?z.message:"The request failed"))},e[0]=j):j=e[0];const C=j;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("h2",{className:"text-sm font-medium",children:"Scheduled and webhook tasks"}),e[1]=b):b=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"flex items-center justify-between",children:[b,t.jsxs(_,{size:"sm",variant:"outline",onClick:()=>p("new"),children:[t.jsx(rt,{"data-icon":"inline-start"}),"New task"]})]}),e[2]=h):h=e[2];let i;e[3]!==R?(i=R&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:R}),e[3]=R,e[4]=i):i=e[4];let u;e[5]!==o.error?(u=o.error&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:o.error}),e[5]=o.error,e[6]=u):u=e[6];let f;e[7]!==o||e[8]!==n||e[9]!==m?(f=m&&t.jsx(vt,{task:m==="new"?null:m,cwd:n.projectPath,onCancel:()=>p(null),onSave:async(c,z)=>{const T=await o.save(c,z,m==="new"?void 0:m);T.webhookSecret&&I({taskId:T.task.id,value:T.webhookSecret}),p(null)}}),e[7]=o,e[8]=n,e[9]=m,e[10]=f):f=e[10];let d;e[11]!==v?(d=v&&t.jsxs("div",{role:"status",className:"flex flex-col gap-1 rounded-md border border-warning/40 p-2 text-xs",children:[t.jsx("p",{children:"Webhook secret — shown only now. Store it with the sender:"}),t.jsx("code",{className:"break-all font-mono",children:v.value}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(_,{size:"xs",variant:"outline",onClick:()=>void Ye(v.value),children:"Copy secret"}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>I(null),children:"Done"})]})]}),e[11]=v,e[12]=d):d=e[12];let r;e[13]!==((F=o.tasks)==null?void 0:F.length)||e[14]!==m?(r=((O=o.tasks)==null?void 0:O.length)===0&&!m&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No tasks yet. A task starts a new session on a schedule, when a signed webhook arrives, or when you run it."}),e[13]=(M=o.tasks)==null?void 0:M.length,e[14]=m,e[15]=r):r=e[15];let w;e[16]!==S||e[17]!==o||e[18]!==n||e[19]!==x||e[20]!==g?(w=(K=o.tasks)==null?void 0:K.map(c=>{var z,T,Z,D;return t.jsxs("li",{className:"flex flex-col gap-2 rounded-md border p-2 text-xs",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"font-medium",children:c.name}),t.jsx("span",{className:"rounded bg-muted px-1.5",children:c.state==="paused"?"Paused":"Active"}),((z=c.authority)==null?void 0:z.revoked)&&t.jsx("span",{className:"text-destructive",children:"Authorization revoked"}),((T=c.authority)==null?void 0:T.source)==="none"&&t.jsx("span",{className:"text-warning",children:"Runs wait for you to reauthorize them"})]}),t.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-muted-foreground",children:[t.jsxs("span",{children:[t.jsx(st,{className:"mr-1 inline size-3","aria-hidden":!0}),ht(c.schedule)]}),t.jsxs("span",{children:["Next: ",Ge(c.nextRunAt)]}),t.jsx("span",{className:"font-mono",children:c.project.cwd}),t.jsxs("span",{children:[qe(c.provider.agent).displayName,c.provider.model?` · ${c.provider.model}`:""," · ",c.workspace==="worktree"?"new worktree":"project folder"]})]}),((Z=c.webhook)==null?void 0:Z.enabled)&&t.jsxs("div",{className:"flex flex-col gap-1 text-muted-foreground",children:[t.jsxs("span",{children:[t.jsx(lt,{className:"mr-1 inline size-3","aria-hidden":!0}),c.webhookUrl?t.jsx("code",{className:"break-all",children:c.webhookUrl}):"Webhook ingress is not available on this server's sign-in"]}),c.webhookReachability==="local-only"&&t.jsx("span",{children:"Reachable only where this machine is; set COGPIT_PUBLIC_URL when a tunnel or proxy exposes it."})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.jsxs(_,{size:"xs",variant:"outline",onClick:()=>C(o.act(c.id,"run").then(()=>E($t))),children:[t.jsx(nt,{"data-icon":"inline-start"}),"Run now"]}),c.state==="active"?t.jsxs(_,{size:"xs",variant:"ghost",onClick:()=>C(o.act(c.id,"pause")),children:[t.jsx(at,{"data-icon":"inline-start"}),"Pause"]}):t.jsxs(_,{size:"xs",variant:"ghost",onClick:()=>C(o.act(c.id,"resume")),children:[t.jsx(it,{"data-icon":"inline-start"}),"Resume"]}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>p(c),children:"Edit"}),((D=c.webhook)==null?void 0:D.enabled)&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>C(o.rotate(c.id).then(ue=>I({taskId:c.id,value:ue.webhookSecret}))),children:"Rotate secret"}),t.jsx(_,{size:"xs",variant:"ghost","aria-expanded":x===c.id,onClick:()=>l(x===c.id?null:c.id),children:"History"}),t.jsx(_,{size:"xs",variant:"ghost","aria-label":`Delete ${c.name}`,onClick:()=>{window.confirm(`Delete ${c.name}? Waiting runs are cancelled.`)&&C(o.remove(c.id))},children:t.jsx(ot,{"data-icon":"inline-start"})})]}),x===c.id&&t.jsx(Ct,{task:c,automations:o,active:S,version:g,openSession:n.openSession})]},c.id)}),e[16]=S,e[17]=o,e[18]=n,e[19]=x,e[20]=g,e[21]=w):w=e[21];let y;e[22]!==w?(y=t.jsx("ul",{"aria-label":"Tasks",className:"flex flex-col gap-2",children:w}),e[22]=w,e[23]=y):y=e[23];let P;return e[24]!==y||e[25]!==i||e[26]!==u||e[27]!==f||e[28]!==d||e[29]!==r?(P=t.jsxs("section",{"aria-label":"Automations",className:"flex h-full min-h-0 flex-col gap-3 overflow-auto p-3",children:[h,i,u,f,d,r,y]}),e[24]=y,e[25]=i,e[26]=u,e[27]=f,e[28]=d,e[29]=r,e[30]=P):P=e[30],P}function $t(s){return s+1}export{At as AutomationsPanel};
@@ -1,35 +1,35 @@
1
- import{c as qe,j as O,r as ge}from"./vendor-react-gGw_S5I_.js";import{cB as si,cC as fi,cD as ai,cE as pi,aZ as di,c as xe,B as Ke}from"./index-BvNyEUVG.js";import{u as Un,aU as hi}from"./vendor-ui-keo4oB2X.js";import"./vendor-markdown-BEJ8yVzA.js";function mi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K={},Fe={},te={},gn;function ke(){if(gn)return te;gn=1;function t(s){return typeof s>"u"||s===null}function i(s){return typeof s=="object"&&s!==null}function m(s){return Array.isArray(s)?s:t(s)?[]:[s]}function y(s,c){if(c){const A=Object.keys(c);for(let r=0,f=A.length;r<f;r+=1){const C=A[r];s[C]=c[C]}}return s}function p(s,c){let A="";for(let r=0;r<c;r+=1)A+=s;return A}function h(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return te.isNothing=t,te.isObject=i,te.toArray=m,te.repeat=p,te.isNegativeZero=h,te.extend=y,te}var $e,xn;function Ee(){if(xn)return $e;xn=1;function t(m,y){let p="";const h=m.reason||"(unknown reason)";return m.mark?(m.mark.name&&(p+='in "'+m.mark.name+'" '),p+="("+(m.mark.line+1)+":"+(m.mark.column+1)+")",!y&&m.mark.snippet&&(p+=`
1
+ import{c as qe,j as O,r as ge}from"./vendor-react-gGw_S5I_.js";import{cR as si,cS as fi,cT as ai,cU as pi,aZ as di,c as xe,B as Ke}from"./index-BVmNox_3.js";import{u as Un,aS as hi}from"./vendor-ui-CKjyvB3_.js";import"./vendor-markdown-BEJ8yVzA.js";function mi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K={},Fe={},te={},gn;function ke(){if(gn)return te;gn=1;function t(s){return typeof s>"u"||s===null}function i(s){return typeof s=="object"&&s!==null}function m(s){return Array.isArray(s)?s:t(s)?[]:[s]}function y(s,c){if(c){const A=Object.keys(c);for(let r=0,f=A.length;r<f;r+=1){const C=A[r];s[C]=c[C]}}return s}function p(s,c){let A="";for(let r=0;r<c;r+=1)A+=s;return A}function h(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return te.isNothing=t,te.isObject=i,te.toArray=m,te.repeat=p,te.isNegativeZero=h,te.extend=y,te}var $e,xn;function Ee(){if(xn)return $e;xn=1;function t(m,y){let p="";const h=m.reason||"(unknown reason)";return m.mark?(m.mark.name&&(p+='in "'+m.mark.name+'" '),p+="("+(m.mark.line+1)+":"+(m.mark.column+1)+")",!y&&m.mark.snippet&&(p+=`
2
2
 
3
- `+m.mark.snippet),h+" "+p):h}function i(m,y){Error.call(this),this.name="YAMLException",this.reason=m,this.mark=y,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(y){return this.name+": "+t(this,y)},$e=i,$e}var Ge,An;function gi(){if(An)return Ge;An=1;const t=ke();function i(p,h,s,c,A){let r="",f="";const C=Math.floor(A/2)-1;return c-h>C&&(r=" ... ",h=c-C+r.length),s-c>C&&(f=" ...",s=c+C-f.length),{str:r+p.slice(h,s).replace(/\t/g,"→")+f,pos:c-h+r.length}}function m(p,h){return t.repeat(" ",h-p.length)+p}function y(p,h){if(h=Object.create(h||null),!p.buffer)return null;h.maxLength||(h.maxLength=79),typeof h.indent!="number"&&(h.indent=1),typeof h.linesBefore!="number"&&(h.linesBefore=3),typeof h.linesAfter!="number"&&(h.linesAfter=2);const s=/\r?\n|\r|\0/g,c=[0],A=[];let r,f=-1;for(;r=s.exec(p.buffer);)A.push(r.index),c.push(r.index+r[0].length),p.position<=r.index&&f<0&&(f=c.length-2);f<0&&(f=c.length-1);let C="";const L=Math.min(p.line+h.linesAfter,A.length).toString().length,R=h.maxLength-(h.indent+L+3);for(let F=1;F<=h.linesBefore&&!(f-F<0);F++){const H=i(p.buffer,c[f-F],A[f-F],p.position-(c[f]-c[f-F]),R);C=t.repeat(" ",h.indent)+m((p.line-F+1).toString(),L)+" | "+H.str+`
4
- `+C}const V=i(p.buffer,c[f],A[f],p.position,R);C+=t.repeat(" ",h.indent)+m((p.line+1).toString(),L)+" | "+V.str+`
3
+ `+m.mark.snippet),h+" "+p):h}function i(m,y){Error.call(this),this.name="YAMLException",this.reason=m,this.mark=y,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(y){return this.name+": "+t(this,y)},$e=i,$e}var Ge,An;function gi(){if(An)return Ge;An=1;const t=ke();function i(p,h,s,c,A){let r="",f="";const C=Math.floor(A/2)-1;return c-h>C&&(r=" ... ",h=c-C+r.length),s-c>C&&(f=" ...",s=c+C-f.length),{str:r+p.slice(h,s).replace(/\t/g,"→")+f,pos:c-h+r.length}}function m(p,h){return t.repeat(" ",h-p.length)+p}function y(p,h){if(h=Object.create(h||null),!p.buffer)return null;h.maxLength||(h.maxLength=79),typeof h.indent!="number"&&(h.indent=1),typeof h.linesBefore!="number"&&(h.linesBefore=3),typeof h.linesAfter!="number"&&(h.linesAfter=2);const s=/\r?\n|\r|\0/g,c=[0],A=[];let r,f=-1;for(;r=s.exec(p.buffer);)A.push(r.index),c.push(r.index+r[0].length),p.position<=r.index&&f<0&&(f=c.length-2);f<0&&(f=c.length-1);let C="";const L=Math.min(p.line+h.linesAfter,A.length).toString().length,M=h.maxLength-(h.indent+L+3);for(let F=1;F<=h.linesBefore&&!(f-F<0);F++){const H=i(p.buffer,c[f-F],A[f-F],p.position-(c[f]-c[f-F]),M);C=t.repeat(" ",h.indent)+m((p.line-F+1).toString(),L)+" | "+H.str+`
4
+ `+C}const V=i(p.buffer,c[f],A[f],p.position,M);C+=t.repeat(" ",h.indent)+m((p.line+1).toString(),L)+" | "+V.str+`
5
5
  `,C+=t.repeat("-",h.indent+L+3+V.pos)+`^
6
- `;for(let F=1;F<=h.linesAfter&&!(f+F>=A.length);F++){const H=i(p.buffer,c[f+F],A[f+F],p.position-(c[f]-c[f+F]),R);C+=t.repeat(" ",h.indent)+m((p.line+F+1).toString(),L)+" | "+H.str+`
7
- `}return C.replace(/\n$/,"")}return Ge=y,Ge}var We,yn;function G(){if(yn)return We;yn=1;const t=Ee(),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],m=["scalar","sequence","mapping"];function y(h){const s={};return h!==null&&Object.keys(h).forEach(function(c){h[c].forEach(function(A){s[String(A)]=c})}),s}function p(h,s){if(s=s||{},Object.keys(s).forEach(function(c){if(i.indexOf(c)===-1)throw new t('Unknown option "'+c+'" is met in definition of "'+h+'" YAML type.')}),this.options=s,this.tag=h,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(c){return c},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=y(s.styleAliases||null),m.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+h+'" YAML type.')}return We=p,We}var Qe,bn;function Kn(){if(bn)return Qe;bn=1;const t=Ee(),i=G();function m(h,s){const c=[];return h[s].forEach(function(A){let r=c.length;c.forEach(function(f,C){f.tag===A.tag&&f.kind===A.kind&&f.multi===A.multi&&(r=C)}),c[r]=A}),c}function y(){const h={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(c){c.multi?(h.multi[c.kind].push(c),h.multi.fallback.push(c)):h[c.kind][c.tag]=h.fallback[c.tag]=c}for(let c=0,A=arguments.length;c<A;c+=1)arguments[c].forEach(s);return h}function p(h){return this.extend(h)}return p.prototype.extend=function(s){let c=[],A=[];if(s instanceof i)A.push(s);else if(Array.isArray(s))A=A.concat(s);else if(s&&(Array.isArray(s.implicit)||Array.isArray(s.explicit)))s.implicit&&(c=c.concat(s.implicit)),s.explicit&&(A=A.concat(s.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");c.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(f.loadKind&&f.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(f.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),A.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const r=Object.create(p.prototype);return r.implicit=(this.implicit||[]).concat(c),r.explicit=(this.explicit||[]).concat(A),r.compiledImplicit=m(r,"implicit"),r.compiledExplicit=m(r,"explicit"),r.compiledTypeMap=y(r.compiledImplicit,r.compiledExplicit),r},Qe=p,Qe}var ze,wn;function $n(){if(wn)return ze;wn=1;const t=G();return ze=new t("tag:yaml.org,2002:str",{kind:"scalar",construct:function(i){return i!==null?i:""}}),ze}var Ve,Sn;function Gn(){if(Sn)return Ve;Sn=1;const t=G();return Ve=new t("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(i){return i!==null?i:[]}}),Ve}var Xe,Cn;function Wn(){if(Cn)return Xe;Cn=1;const t=G();return Xe=new t("tag:yaml.org,2002:map",{kind:"mapping",construct:function(i){return i!==null?i:{}}}),Xe}var Ze,Tn;function Qn(){if(Tn)return Ze;Tn=1;const t=Kn();return Ze=new t({explicit:[$n(),Gn(),Wn()]}),Ze}var Je,kn;function zn(){if(kn)return Je;kn=1;const t=G();function i(p){if(p===null)return!0;const h=p.length;return h===1&&p==="~"||h===4&&(p==="null"||p==="Null"||p==="NULL")}function m(){return null}function y(p){return p===null}return Je=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:m,predicate:y,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Je}var en,En;function Vn(){if(En)return en;En=1;const t=G();function i(p){if(p===null)return!1;const h=p.length;return h===4&&(p==="true"||p==="True"||p==="TRUE")||h===5&&(p==="false"||p==="False"||p==="FALSE")}function m(p){return p==="true"||p==="True"||p==="TRUE"}function y(p){return Object.prototype.toString.call(p)==="[object Boolean]"}return en=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:m,predicate:y,represent:{lowercase:function(p){return p?"true":"false"},uppercase:function(p){return p?"TRUE":"FALSE"},camelcase:function(p){return p?"True":"False"}},defaultStyle:"lowercase"}),en}var nn,Nn;function Xn(){if(Nn)return nn;Nn=1;const t=ke(),i=G();function m(r){return r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102}function y(r){return r>=48&&r<=55}function p(r){return r>=48&&r<=57}function h(r){if(r===null)return!1;const f=r.length;let C=0,L=!1;if(!f)return!1;let R=r[C];if((R==="-"||R==="+")&&(R=r[++C]),R==="0"){if(C+1===f)return!0;if(R=r[++C],R==="b"){for(C++;C<f;C++){if(R=r[C],R!=="0"&&R!=="1")return!1;L=!0}return L&&isFinite(s(r))}if(R==="x"){for(C++;C<f;C++){if(!m(r.charCodeAt(C)))return!1;L=!0}return L&&isFinite(s(r))}if(R==="o"){for(C++;C<f;C++){if(!y(r.charCodeAt(C)))return!1;L=!0}return L&&isFinite(s(r))}}for(;C<f;C++){if(!p(r.charCodeAt(C)))return!1;L=!0}return L?isFinite(s(r)):!1}function s(r){let f=r,C=1,L=f[0];if((L==="-"||L==="+")&&(L==="-"&&(C=-1),f=f.slice(1),L=f[0]),f==="0")return 0;if(L==="0"){if(f[1]==="b")return C*parseInt(f.slice(2),2);if(f[1]==="x")return C*parseInt(f.slice(2),16);if(f[1]==="o")return C*parseInt(f.slice(2),8)}return C*parseInt(f,10)}function c(r){return s(r)}function A(r){return Object.prototype.toString.call(r)==="[object Number]"&&r%1===0&&!t.isNegativeZero(r)}return nn=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:h,construct:c,predicate:A,represent:{binary:function(r){return r>=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0o"+r.toString(8):"-0o"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),nn}var rn,In;function Zn(){if(In)return rn;In=1;const t=ke(),i=G(),m=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),y=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function p(r){return r===null||!m.test(r)?!1:isFinite(parseFloat(r,10))?!0:y.test(r)}function h(r){let f=r.toLowerCase();const C=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?C===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:C*parseFloat(f,10)}const s=/^[-+]?[0-9]+e/;function c(r,f){if(isNaN(r))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(r))return"-0.0";const C=r.toString(10);return s.test(C)?C.replace("e",".e"):C}function A(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!==0||t.isNegativeZero(r))}return rn=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:p,construct:h,predicate:A,represent:c,defaultStyle:"lowercase"}),rn}var ln,On;function Jn(){return On||(On=1,ln=Qn().extend({implicit:[zn(),Vn(),Xn(),Zn()]})),ln}var on,Ln;function ei(){return Ln||(Ln=1,on=Jn()),on}var tn,_n;function ni(){if(_n)return tn;_n=1;const t=G(),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),m=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function y(s){return s===null?!1:i.exec(s)!==null||m.exec(s)!==null}function p(s){let c=0,A=null,r=i.exec(s);if(r===null&&(r=m.exec(s)),r===null)throw new Error("Date resolve error");const f=+r[1],C=+r[2]-1,L=+r[3];if(!r[4])return new Date(Date.UTC(f,C,L));const R=+r[4],V=+r[5],F=+r[6];if(r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}if(r[9]){const X=+r[10],U=+(r[11]||0);A=(X*60+U)*6e4,r[9]==="-"&&(A=-A)}const H=new Date(Date.UTC(f,C,L,R,V,F,c));return A&&H.setTime(H.getTime()-A),H}function h(s){return s.toISOString()}return tn=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:y,construct:p,instanceOf:Date,represent:h}),tn}var cn,vn;function ii(){if(vn)return cn;vn=1;const t=G();function i(m){return m==="<<"||m===null}return cn=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i}),cn}var un,Mn;function ri(){if(Mn)return un;Mn=1;const t=G(),i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
- \r`;function m(s){if(s===null)return!1;let c=0;const A=s.length,r=i;for(let f=0;f<A;f++){const C=r.indexOf(s.charAt(f));if(!(C>64)){if(C<0)return!1;c+=6}}return c%8===0}function y(s){const c=s.replace(/[\r\n=]/g,""),A=c.length,r=i;let f=0;const C=[];for(let R=0;R<A;R++)R%4===0&&R&&(C.push(f>>16&255),C.push(f>>8&255),C.push(f&255)),f=f<<6|r.indexOf(c.charAt(R));const L=A%4*6;return L===0?(C.push(f>>16&255),C.push(f>>8&255),C.push(f&255)):L===18?(C.push(f>>10&255),C.push(f>>2&255)):L===12&&C.push(f>>4&255),new Uint8Array(C)}function p(s){let c="",A=0;const r=s.length,f=i;for(let L=0;L<r;L++)L%3===0&&L&&(c+=f[A>>18&63],c+=f[A>>12&63],c+=f[A>>6&63],c+=f[A&63]),A=(A<<8)+s[L];const C=r%3;return C===0?(c+=f[A>>18&63],c+=f[A>>12&63],c+=f[A>>6&63],c+=f[A&63]):C===2?(c+=f[A>>10&63],c+=f[A>>4&63],c+=f[A<<2&63],c+=f[64]):C===1&&(c+=f[A>>2&63],c+=f[A<<4&63],c+=f[64],c+=f[64]),c}function h(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}return un=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:m,construct:y,predicate:h,represent:p}),un}var sn,Rn;function li(){if(Rn)return sn;Rn=1;const t=G(),i=Object.prototype.hasOwnProperty,m=Object.prototype.toString;function y(h){if(h===null)return!0;const s={},c=h;for(let A=0,r=c.length;A<r;A+=1){const f=c[A];let C=!1;if(m.call(f)!=="[object Object]")return!1;let L;for(L in f)if(i.call(f,L))if(!C)C=!0;else return!1;if(!C||i.call(s,L))return!1;Object.defineProperty(s,L,{value:!0})}return!0}function p(h){return h!==null?h:[]}return sn=new t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:y,construct:p}),sn}var fn,jn;function oi(){if(jn)return fn;jn=1;const t=G(),i=Object.prototype.toString;function m(p){if(p===null)return!0;const h=p,s=new Array(h.length);for(let c=0,A=h.length;c<A;c+=1){const r=h[c];if(i.call(r)!=="[object Object]")return!1;const f=Object.keys(r);if(f.length!==1)return!1;s[c]=[f[0],r[f[0]]]}return!0}function y(p){if(p===null)return[];const h=p,s=new Array(h.length);for(let c=0,A=h.length;c<A;c+=1){const r=h[c],f=Object.keys(r);s[c]=[f[0],r[f[0]]]}return s}return fn=new t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:m,construct:y}),fn}var an,Fn;function ti(){if(Fn)return an;Fn=1;const t=G(),i=Object.prototype.hasOwnProperty;function m(p){if(p===null)return!0;const h=p;for(const s in h)if(i.call(h,s)&&h[s]!==null)return!1;return!0}function y(p){return p!==null?p:{}}return an=new t("tag:yaml.org,2002:set",{kind:"mapping",resolve:m,construct:y}),an}var pn,qn;function hn(){return qn||(qn=1,pn=ei().extend({implicit:[ni(),ii()],explicit:[ri(),li(),oi(),ti()]})),pn}var Dn;function xi(){if(Dn)return Fe;Dn=1;const t=ke(),i=Ee(),m=gi(),y=hn(),p=Object.prototype.hasOwnProperty,h=1,s=2,c=3,A=4,r=1,f=2,C=3,L=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,R=/[\x85\u2028\u2029]/,V=/[,\[\]{}]/,F=/^(?:!|!!|![0-9A-Za-z-]+!)$/,H=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function X(e){return Object.prototype.toString.call(e)}function U(e){return e===10||e===13}function D(e){return e===9||e===32}function q(e){return e===9||e===32||e===10||e===13}function z(e){return e===44||e===91||e===93||e===123||e===125}function se(e){if(e>=48&&e<=57)return e-48;const l=e|32;return l>=97&&l<=102?l-97+10:-1}function fe(e){return e===120?2:e===117?4:e===85?8:0}function ae(e){return e>=48&&e<=57?e-48:-1}function ne(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
6
+ `;for(let F=1;F<=h.linesAfter&&!(f+F>=A.length);F++){const H=i(p.buffer,c[f+F],A[f+F],p.position-(c[f]-c[f+F]),M);C+=t.repeat(" ",h.indent)+m((p.line+F+1).toString(),L)+" | "+H.str+`
7
+ `}return C.replace(/\n$/,"")}return Ge=y,Ge}var We,yn;function G(){if(yn)return We;yn=1;const t=Ee(),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],m=["scalar","sequence","mapping"];function y(h){const s={};return h!==null&&Object.keys(h).forEach(function(c){h[c].forEach(function(A){s[String(A)]=c})}),s}function p(h,s){if(s=s||{},Object.keys(s).forEach(function(c){if(i.indexOf(c)===-1)throw new t('Unknown option "'+c+'" is met in definition of "'+h+'" YAML type.')}),this.options=s,this.tag=h,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(c){return c},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=y(s.styleAliases||null),m.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+h+'" YAML type.')}return We=p,We}var Qe,bn;function Kn(){if(bn)return Qe;bn=1;const t=Ee(),i=G();function m(h,s){const c=[];return h[s].forEach(function(A){let r=c.length;c.forEach(function(f,C){f.tag===A.tag&&f.kind===A.kind&&f.multi===A.multi&&(r=C)}),c[r]=A}),c}function y(){const h={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(c){c.multi?(h.multi[c.kind].push(c),h.multi.fallback.push(c)):h[c.kind][c.tag]=h.fallback[c.tag]=c}for(let c=0,A=arguments.length;c<A;c+=1)arguments[c].forEach(s);return h}function p(h){return this.extend(h)}return p.prototype.extend=function(s){let c=[],A=[];if(s instanceof i)A.push(s);else if(Array.isArray(s))A=A.concat(s);else if(s&&(Array.isArray(s.implicit)||Array.isArray(s.explicit)))s.implicit&&(c=c.concat(s.implicit)),s.explicit&&(A=A.concat(s.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");c.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(f.loadKind&&f.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(f.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),A.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const r=Object.create(p.prototype);return r.implicit=(this.implicit||[]).concat(c),r.explicit=(this.explicit||[]).concat(A),r.compiledImplicit=m(r,"implicit"),r.compiledExplicit=m(r,"explicit"),r.compiledTypeMap=y(r.compiledImplicit,r.compiledExplicit),r},Qe=p,Qe}var ze,wn;function $n(){if(wn)return ze;wn=1;const t=G();return ze=new t("tag:yaml.org,2002:str",{kind:"scalar",construct:function(i){return i!==null?i:""}}),ze}var Ve,Sn;function Gn(){if(Sn)return Ve;Sn=1;const t=G();return Ve=new t("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(i){return i!==null?i:[]}}),Ve}var Xe,Cn;function Wn(){if(Cn)return Xe;Cn=1;const t=G();return Xe=new t("tag:yaml.org,2002:map",{kind:"mapping",construct:function(i){return i!==null?i:{}}}),Xe}var Ze,Tn;function Qn(){if(Tn)return Ze;Tn=1;const t=Kn();return Ze=new t({explicit:[$n(),Gn(),Wn()]}),Ze}var Je,kn;function zn(){if(kn)return Je;kn=1;const t=G();function i(p){if(p===null)return!0;const h=p.length;return h===1&&p==="~"||h===4&&(p==="null"||p==="Null"||p==="NULL")}function m(){return null}function y(p){return p===null}return Je=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:m,predicate:y,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Je}var en,En;function Vn(){if(En)return en;En=1;const t=G();function i(p){if(p===null)return!1;const h=p.length;return h===4&&(p==="true"||p==="True"||p==="TRUE")||h===5&&(p==="false"||p==="False"||p==="FALSE")}function m(p){return p==="true"||p==="True"||p==="TRUE"}function y(p){return Object.prototype.toString.call(p)==="[object Boolean]"}return en=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:m,predicate:y,represent:{lowercase:function(p){return p?"true":"false"},uppercase:function(p){return p?"TRUE":"FALSE"},camelcase:function(p){return p?"True":"False"}},defaultStyle:"lowercase"}),en}var nn,Nn;function Xn(){if(Nn)return nn;Nn=1;const t=ke(),i=G();function m(r){return r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102}function y(r){return r>=48&&r<=55}function p(r){return r>=48&&r<=57}function h(r){if(r===null)return!1;const f=r.length;let C=0,L=!1;if(!f)return!1;let M=r[C];if((M==="-"||M==="+")&&(M=r[++C]),M==="0"){if(C+1===f)return!0;if(M=r[++C],M==="b"){for(C++;C<f;C++){if(M=r[C],M!=="0"&&M!=="1")return!1;L=!0}return L&&isFinite(s(r))}if(M==="x"){for(C++;C<f;C++){if(!m(r.charCodeAt(C)))return!1;L=!0}return L&&isFinite(s(r))}if(M==="o"){for(C++;C<f;C++){if(!y(r.charCodeAt(C)))return!1;L=!0}return L&&isFinite(s(r))}}for(;C<f;C++){if(!p(r.charCodeAt(C)))return!1;L=!0}return L?isFinite(s(r)):!1}function s(r){let f=r,C=1,L=f[0];if((L==="-"||L==="+")&&(L==="-"&&(C=-1),f=f.slice(1),L=f[0]),f==="0")return 0;if(L==="0"){if(f[1]==="b")return C*parseInt(f.slice(2),2);if(f[1]==="x")return C*parseInt(f.slice(2),16);if(f[1]==="o")return C*parseInt(f.slice(2),8)}return C*parseInt(f,10)}function c(r){return s(r)}function A(r){return Object.prototype.toString.call(r)==="[object Number]"&&r%1===0&&!t.isNegativeZero(r)}return nn=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:h,construct:c,predicate:A,represent:{binary:function(r){return r>=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0o"+r.toString(8):"-0o"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),nn}var rn,In;function Zn(){if(In)return rn;In=1;const t=ke(),i=G(),m=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),y=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function p(r){return r===null||!m.test(r)?!1:isFinite(parseFloat(r,10))?!0:y.test(r)}function h(r){let f=r.toLowerCase();const C=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?C===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:C*parseFloat(f,10)}const s=/^[-+]?[0-9]+e/;function c(r,f){if(isNaN(r))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(r))return"-0.0";const C=r.toString(10);return s.test(C)?C.replace("e",".e"):C}function A(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!==0||t.isNegativeZero(r))}return rn=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:p,construct:h,predicate:A,represent:c,defaultStyle:"lowercase"}),rn}var ln,On;function Jn(){return On||(On=1,ln=Qn().extend({implicit:[zn(),Vn(),Xn(),Zn()]})),ln}var on,Ln;function ei(){return Ln||(Ln=1,on=Jn()),on}var tn,_n;function ni(){if(_n)return tn;_n=1;const t=G(),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),m=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function y(s){return s===null?!1:i.exec(s)!==null||m.exec(s)!==null}function p(s){let c=0,A=null,r=i.exec(s);if(r===null&&(r=m.exec(s)),r===null)throw new Error("Date resolve error");const f=+r[1],C=+r[2]-1,L=+r[3];if(!r[4])return new Date(Date.UTC(f,C,L));const M=+r[4],V=+r[5],F=+r[6];if(r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}if(r[9]){const X=+r[10],U=+(r[11]||0);A=(X*60+U)*6e4,r[9]==="-"&&(A=-A)}const H=new Date(Date.UTC(f,C,L,M,V,F,c));return A&&H.setTime(H.getTime()-A),H}function h(s){return s.toISOString()}return tn=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:y,construct:p,instanceOf:Date,represent:h}),tn}var cn,vn;function ii(){if(vn)return cn;vn=1;const t=G();function i(m){return m==="<<"||m===null}return cn=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i}),cn}var un,Rn;function ri(){if(Rn)return un;Rn=1;const t=G(),i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
+ \r`;function m(s){if(s===null)return!1;let c=0;const A=s.length,r=i;for(let f=0;f<A;f++){const C=r.indexOf(s.charAt(f));if(!(C>64)){if(C<0)return!1;c+=6}}return c%8===0}function y(s){const c=s.replace(/[\r\n=]/g,""),A=c.length,r=i;let f=0;const C=[];for(let M=0;M<A;M++)M%4===0&&M&&(C.push(f>>16&255),C.push(f>>8&255),C.push(f&255)),f=f<<6|r.indexOf(c.charAt(M));const L=A%4*6;return L===0?(C.push(f>>16&255),C.push(f>>8&255),C.push(f&255)):L===18?(C.push(f>>10&255),C.push(f>>2&255)):L===12&&C.push(f>>4&255),new Uint8Array(C)}function p(s){let c="",A=0;const r=s.length,f=i;for(let L=0;L<r;L++)L%3===0&&L&&(c+=f[A>>18&63],c+=f[A>>12&63],c+=f[A>>6&63],c+=f[A&63]),A=(A<<8)+s[L];const C=r%3;return C===0?(c+=f[A>>18&63],c+=f[A>>12&63],c+=f[A>>6&63],c+=f[A&63]):C===2?(c+=f[A>>10&63],c+=f[A>>4&63],c+=f[A<<2&63],c+=f[64]):C===1&&(c+=f[A>>2&63],c+=f[A<<4&63],c+=f[64],c+=f[64]),c}function h(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}return un=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:m,construct:y,predicate:h,represent:p}),un}var sn,Mn;function li(){if(Mn)return sn;Mn=1;const t=G(),i=Object.prototype.hasOwnProperty,m=Object.prototype.toString;function y(h){if(h===null)return!0;const s={},c=h;for(let A=0,r=c.length;A<r;A+=1){const f=c[A];let C=!1;if(m.call(f)!=="[object Object]")return!1;let L;for(L in f)if(i.call(f,L))if(!C)C=!0;else return!1;if(!C||i.call(s,L))return!1;Object.defineProperty(s,L,{value:!0})}return!0}function p(h){return h!==null?h:[]}return sn=new t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:y,construct:p}),sn}var fn,jn;function oi(){if(jn)return fn;jn=1;const t=G(),i=Object.prototype.toString;function m(p){if(p===null)return!0;const h=p,s=new Array(h.length);for(let c=0,A=h.length;c<A;c+=1){const r=h[c];if(i.call(r)!=="[object Object]")return!1;const f=Object.keys(r);if(f.length!==1)return!1;s[c]=[f[0],r[f[0]]]}return!0}function y(p){if(p===null)return[];const h=p,s=new Array(h.length);for(let c=0,A=h.length;c<A;c+=1){const r=h[c],f=Object.keys(r);s[c]=[f[0],r[f[0]]]}return s}return fn=new t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:m,construct:y}),fn}var an,Fn;function ti(){if(Fn)return an;Fn=1;const t=G(),i=Object.prototype.hasOwnProperty;function m(p){if(p===null)return!0;const h=p;for(const s in h)if(i.call(h,s)&&h[s]!==null)return!1;return!0}function y(p){return p!==null?p:{}}return an=new t("tag:yaml.org,2002:set",{kind:"mapping",resolve:m,construct:y}),an}var pn,qn;function hn(){return qn||(qn=1,pn=ei().extend({implicit:[ni(),ii()],explicit:[ri(),li(),oi(),ti()]})),pn}var Dn;function xi(){if(Dn)return Fe;Dn=1;const t=ke(),i=Ee(),m=gi(),y=hn(),p=Object.prototype.hasOwnProperty,h=1,s=2,c=3,A=4,r=1,f=2,C=3,L=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,M=/[\x85\u2028\u2029]/,V=/[,\[\]{}]/,F=/^(?:!|!!|![0-9A-Za-z-]+!)$/,H=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function X(e){return Object.prototype.toString.call(e)}function U(e){return e===10||e===13}function D(e){return e===9||e===32}function q(e){return e===9||e===32||e===10||e===13}function z(e){return e===44||e===91||e===93||e===123||e===125}function se(e){if(e>=48&&e<=57)return e-48;const l=e|32;return l>=97&&l<=102?l-97+10:-1}function fe(e){return e===120?2:e===117?4:e===85?8:0}function ae(e){return e>=48&&e<=57?e-48:-1}function ne(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
9
9
  `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"…";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function pe(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function _(e,l,g){l==="__proto__"?Object.defineProperty(e,l,{configurable:!0,enumerable:!0,writable:!0,value:g}):e[l]=g}const P=new Array(256),$=new Array(256);for(let e=0;e<256;e++)P[e]=ne(e)?1:0,$[e]=ne(e);function j(e,l){this.input=e,this.filename=l.filename||null,this.schema=l.schema||y,this.onWarning=l.onWarning||null,this.legacy=l.legacy||!1,this.json=l.json||!1,this.listener=l.listener||null,this.maxDepth=typeof l.maxDepth=="number"?l.maxDepth:100,this.maxTotalMergeKeys=typeof l.maxTotalMergeKeys=="number"?l.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function B(e,l){const g={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return g.snippet=m(g),new i(l,g)}function k(e,l){throw B(e,l)}function de(e,l){e.onWarning&&e.onWarning.call(null,B(e,l))}function J(e,l,g){const x=e.anchorMapTransactions;if(x.length!==0){const a=x[x.length-1];p.call(a,l)||(a[l]={existed:p.call(e.anchorMap,l),value:e.anchorMap[l]})}e.anchorMap[l]=g}function De(e){e.anchorMapTransactions.push(Object.create(null))}function ce(e){const l=e.anchorMapTransactions.pop(),g=e.anchorMapTransactions;if(g.length===0)return;const x=g[g.length-1],a=Object.keys(l);for(let n=0,o=a.length;n<o;n+=1){const u=a[n];p.call(x,u)||(x[u]=l[u])}}function Ye(e){const l=e.anchorMapTransactions.pop(),g=Object.keys(l);for(let x=g.length-1;x>=0;x-=1){const a=l[g[x]];a.existed?e.anchorMap[g[x]]=a.value:delete e.anchorMap[g[x]]}}function Ae(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,tag:e.tag,anchor:e.anchor,kind:e.kind,result:e.result}}function he(e,l){e.position=l.position,e.line=l.line,e.lineStart=l.lineStart,e.lineIndent=l.lineIndent,e.firstTabInLine=l.firstTabInLine,e.tag=l.tag,e.anchor=l.anchor,e.kind=l.kind,e.result=l.result}const Ne={YAML:function(l,g,x){l.version!==null&&k(l,"duplication of %YAML directive"),x.length!==1&&k(l,"YAML directive accepts exactly one argument");const a=/^([0-9]+)\.([0-9]+)$/.exec(x[0]);a===null&&k(l,"ill-formed argument of the YAML directive");const n=parseInt(a[1],10),o=parseInt(a[2],10);n!==1&&k(l,"unacceptable YAML version of the document"),l.version=x[0],l.checkLineBreaks=o<2,o!==1&&o!==2&&de(l,"unsupported YAML version of the document")},TAG:function(l,g,x){let a;x.length!==2&&k(l,"TAG directive accepts exactly two arguments");const n=x[0];a=x[1],F.test(n)||k(l,"ill-formed tag handle (first argument) of the TAG directive"),p.call(l.tagMap,n)&&k(l,'there is a previously declared suffix for "'+n+'" tag handle'),H.test(a)||k(l,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{k(l,"tag prefix is malformed: "+a)}l.tagMap[n]=a}};function W(e,l,g,x){if(l<g){const a=e.input.slice(l,g);if(x)for(let n=0,o=a.length;n<o;n+=1){const u=a.charCodeAt(n);u===9||u>=32&&u<=1114111||k(e,"expected valid JSON character")}else L.test(a)&&k(e,"the stream contains non-printable characters");e.result+=a}}function ie(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&k(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")")}function ye(e,l,g,x){t.isObject(g)||k(e,"cannot merge mappings; the provided source object is unacceptable"),ie(e);const a=Object.keys(g);for(let n=0,o=a.length;n<o;n+=1){const u=a[n];ie(e),p.call(l,u)||(_(l,u,g[u]),x[u]=!0)}}function ee(e,l,g,x,a,n,o,u,b){if(Array.isArray(a)){a=Array.prototype.slice.call(a);for(let w=0,S=a.length;w<S;w+=1)Array.isArray(a[w])&&k(e,"nested arrays are not supported inside keys"),typeof a=="object"&&X(a[w])==="[object Object]"&&(a[w]="[object Object]")}if(typeof a=="object"&&X(a)==="[object Object]"&&(a="[object Object]"),a=String(a),l===null&&(l={}),x==="tag:yaml.org,2002:merge")if(Array.isArray(n)){n.length>100&&k(e,"abnormal merge sequence size");for(let w=0,S=n.length;w<S;w+=1)ye(e,l,n[w],g)}else ye(e,l,n,g);else!e.json&&!p.call(g,a)&&p.call(l,a)&&(e.line=o||e.line,e.lineStart=u||e.lineStart,e.position=b||e.position,k(e,"duplicated mapping key")),_(l,a,n),delete g[a];return l}function be(e){const l=e.input.charCodeAt(e.position);l===10?e.position++:l===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):k(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Y(e,l,g){let x=0,a=e.input.charCodeAt(e.position);for(;a!==0;){for(;D(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(l&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(U(a))for(be(e),a=e.input.charCodeAt(e.position),x++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return g!==-1&&x!==0&&e.lineIndent<g&&de(e,"deficient indentation"),x}function Z(e){let l=e.position,g=e.input.charCodeAt(l);return!!((g===45||g===46)&&g===e.input.charCodeAt(l+1)&&g===e.input.charCodeAt(l+2)&&(l+=3,g=e.input.charCodeAt(l),g===0||q(g)))}function me(e,l){l===1?e.result+=" ":l>1&&(e.result+=t.repeat(`
10
- `,l-1))}function Ie(e,l,g){let x,a,n,o,u,b;const w=e.kind,S=e.result;let d=e.input.charCodeAt(e.position);if(q(d)||z(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96)return!1;if(d===63||d===45){const T=e.input.charCodeAt(e.position+1);if(q(T)||g&&z(T))return!1}for(e.kind="scalar",e.result="",x=a=e.position,n=!1;d!==0;){if(d===58){const T=e.input.charCodeAt(e.position+1);if(q(T)||g&&z(T))break}else if(d===35){const T=e.input.charCodeAt(e.position-1);if(q(T))break}else{if(e.position===e.lineStart&&Z(e)||g&&z(d))break;if(U(d))if(o=e.line,u=e.lineStart,b=e.lineIndent,Y(e,!1,-1),e.lineIndent>=l){n=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=o,e.lineStart=u,e.lineIndent=b;break}}n&&(W(e,x,a,!1),me(e,e.line-o),x=a=e.position,n=!1),D(d)||(a=e.position+1),d=e.input.charCodeAt(++e.position)}return W(e,x,a,!1),e.result?!0:(e.kind=w,e.result=S,!1)}function we(e,l){let g,x,a=e.input.charCodeAt(e.position);if(a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,g=x=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(W(e,g,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)g=e.position,e.position++,x=e.position;else return!0;else U(a)?(W(e,g,x,!0),me(e,Y(e,!1,l)),g=x=e.position):e.position===e.lineStart&&Z(e)?k(e,"unexpected end of the document within a single quoted scalar"):(e.position++,D(a)||(x=e.position));k(e,"unexpected end of the stream within a single quoted scalar")}function Oe(e,l){let g,x,a,n=e.input.charCodeAt(e.position);if(n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,g=x=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return W(e,g,e.position,!0),e.position++,!0;if(n===92){if(W(e,g,e.position,!0),n=e.input.charCodeAt(++e.position),U(n))Y(e,!1,l);else if(n<256&&P[n])e.result+=$[n],e.position++;else if((a=fe(n))>0){let o=a,u=0;for(;o>0;o--)n=e.input.charCodeAt(++e.position),(a=se(n))>=0?u=(u<<4)+a:k(e,"expected hexadecimal character");e.result+=pe(u),e.position++}else k(e,"unknown escape sequence");g=x=e.position}else U(n)?(W(e,g,x,!0),me(e,Y(e,!1,l)),g=x=e.position):e.position===e.lineStart&&Z(e)?k(e,"unexpected end of the document within a double quoted scalar"):(e.position++,D(n)||(x=e.position))}k(e,"unexpected end of the stream within a double quoted scalar")}function Le(e,l){let g=!0,x,a,n;const o=e.tag;let u;const b=e.anchor;let w,S,d,T;const E=Object.create(null);let N,I,v,M=e.input.charCodeAt(e.position);if(M===91)w=93,T=!1,u=[];else if(M===123)w=125,T=!0,u={};else return!1;for(e.anchor!==null&&J(e,e.anchor,u),M=e.input.charCodeAt(++e.position);M!==0;){if(Y(e,!0,l),M=e.input.charCodeAt(e.position),M===w)return e.position++,e.tag=o,e.anchor=b,e.kind=T?"mapping":"sequence",e.result=u,!0;if(g?M===44&&k(e,"expected the node content, but found ','"):k(e,"missed comma between flow collection entries"),I=N=v=null,S=d=!1,M===63){const oe=e.input.charCodeAt(e.position+1);q(oe)&&(S=d=!0,e.position++,Y(e,!0,l))}x=e.line,a=e.lineStart,n=e.position,le(e,l,h,!1,!0),I=e.tag,N=e.result,Y(e,!0,l),M=e.input.charCodeAt(e.position),(d||e.line===x)&&M===58&&(S=!0,M=e.input.charCodeAt(++e.position),Y(e,!0,l),le(e,l,h,!1,!0),v=e.result),T?ee(e,u,E,I,N,v,x,a,n):S?u.push(ee(e,null,E,I,N,v,x,a,n)):u.push(N),Y(e,!0,l),M=e.input.charCodeAt(e.position),M===44?(g=!0,M=e.input.charCodeAt(++e.position)):g=!1}k(e,"unexpected end of the stream within a flow collection")}function re(e,l){let g,x=r,a=!1,n=!1,o=l,u=0,b=!1,w,S=e.input.charCodeAt(e.position);if(S===124)g=!1;else if(S===62)g=!0;else return!1;for(e.kind="scalar",e.result="";S!==0;)if(S=e.input.charCodeAt(++e.position),S===43||S===45)r===x?x=S===43?C:f:k(e,"repeat of a chomping mode identifier");else if((w=ae(S))>=0)w===0?k(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):n?k(e,"repeat of an indentation width identifier"):(o=l+w-1,n=!0);else break;if(D(S)){do S=e.input.charCodeAt(++e.position);while(D(S));if(S===35)do S=e.input.charCodeAt(++e.position);while(!U(S)&&S!==0)}for(;S!==0;){for(be(e),e.lineIndent=0,S=e.input.charCodeAt(e.position);(!n||e.lineIndent<o)&&S===32;)e.lineIndent++,S=e.input.charCodeAt(++e.position);if(!n&&e.lineIndent>o&&(o=e.lineIndent),U(S)){u++;continue}if(!n&&o===0&&k(e,"missing indentation for block scalar"),e.lineIndent<o){x===C?e.result+=t.repeat(`
10
+ `,l-1))}function Ie(e,l,g){let x,a,n,o,u,b;const w=e.kind,S=e.result;let d=e.input.charCodeAt(e.position);if(q(d)||z(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96)return!1;if(d===63||d===45){const T=e.input.charCodeAt(e.position+1);if(q(T)||g&&z(T))return!1}for(e.kind="scalar",e.result="",x=a=e.position,n=!1;d!==0;){if(d===58){const T=e.input.charCodeAt(e.position+1);if(q(T)||g&&z(T))break}else if(d===35){const T=e.input.charCodeAt(e.position-1);if(q(T))break}else{if(e.position===e.lineStart&&Z(e)||g&&z(d))break;if(U(d))if(o=e.line,u=e.lineStart,b=e.lineIndent,Y(e,!1,-1),e.lineIndent>=l){n=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=o,e.lineStart=u,e.lineIndent=b;break}}n&&(W(e,x,a,!1),me(e,e.line-o),x=a=e.position,n=!1),D(d)||(a=e.position+1),d=e.input.charCodeAt(++e.position)}return W(e,x,a,!1),e.result?!0:(e.kind=w,e.result=S,!1)}function we(e,l){let g,x,a=e.input.charCodeAt(e.position);if(a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,g=x=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(W(e,g,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)g=e.position,e.position++,x=e.position;else return!0;else U(a)?(W(e,g,x,!0),me(e,Y(e,!1,l)),g=x=e.position):e.position===e.lineStart&&Z(e)?k(e,"unexpected end of the document within a single quoted scalar"):(e.position++,D(a)||(x=e.position));k(e,"unexpected end of the stream within a single quoted scalar")}function Oe(e,l){let g,x,a,n=e.input.charCodeAt(e.position);if(n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,g=x=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return W(e,g,e.position,!0),e.position++,!0;if(n===92){if(W(e,g,e.position,!0),n=e.input.charCodeAt(++e.position),U(n))Y(e,!1,l);else if(n<256&&P[n])e.result+=$[n],e.position++;else if((a=fe(n))>0){let o=a,u=0;for(;o>0;o--)n=e.input.charCodeAt(++e.position),(a=se(n))>=0?u=(u<<4)+a:k(e,"expected hexadecimal character");e.result+=pe(u),e.position++}else k(e,"unknown escape sequence");g=x=e.position}else U(n)?(W(e,g,x,!0),me(e,Y(e,!1,l)),g=x=e.position):e.position===e.lineStart&&Z(e)?k(e,"unexpected end of the document within a double quoted scalar"):(e.position++,D(n)||(x=e.position))}k(e,"unexpected end of the stream within a double quoted scalar")}function Le(e,l){let g=!0,x,a,n;const o=e.tag;let u;const b=e.anchor;let w,S,d,T;const E=Object.create(null);let N,I,v,R=e.input.charCodeAt(e.position);if(R===91)w=93,T=!1,u=[];else if(R===123)w=125,T=!0,u={};else return!1;for(e.anchor!==null&&J(e,e.anchor,u),R=e.input.charCodeAt(++e.position);R!==0;){if(Y(e,!0,l),R=e.input.charCodeAt(e.position),R===w)return e.position++,e.tag=o,e.anchor=b,e.kind=T?"mapping":"sequence",e.result=u,!0;if(g?R===44&&k(e,"expected the node content, but found ','"):k(e,"missed comma between flow collection entries"),I=N=v=null,S=d=!1,R===63){const oe=e.input.charCodeAt(e.position+1);q(oe)&&(S=d=!0,e.position++,Y(e,!0,l))}x=e.line,a=e.lineStart,n=e.position,le(e,l,h,!1,!0),I=e.tag,N=e.result,Y(e,!0,l),R=e.input.charCodeAt(e.position),(d||e.line===x)&&R===58&&(S=!0,R=e.input.charCodeAt(++e.position),Y(e,!0,l),le(e,l,h,!1,!0),v=e.result),T?ee(e,u,E,I,N,v,x,a,n):S?u.push(ee(e,null,E,I,N,v,x,a,n)):u.push(N),Y(e,!0,l),R=e.input.charCodeAt(e.position),R===44?(g=!0,R=e.input.charCodeAt(++e.position)):g=!1}k(e,"unexpected end of the stream within a flow collection")}function re(e,l){let g,x=r,a=!1,n=!1,o=l,u=0,b=!1,w,S=e.input.charCodeAt(e.position);if(S===124)g=!1;else if(S===62)g=!0;else return!1;for(e.kind="scalar",e.result="";S!==0;)if(S=e.input.charCodeAt(++e.position),S===43||S===45)r===x?x=S===43?C:f:k(e,"repeat of a chomping mode identifier");else if((w=ae(S))>=0)w===0?k(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):n?k(e,"repeat of an indentation width identifier"):(o=l+w-1,n=!0);else break;if(D(S)){do S=e.input.charCodeAt(++e.position);while(D(S));if(S===35)do S=e.input.charCodeAt(++e.position);while(!U(S)&&S!==0)}for(;S!==0;){for(be(e),e.lineIndent=0,S=e.input.charCodeAt(e.position);(!n||e.lineIndent<o)&&S===32;)e.lineIndent++,S=e.input.charCodeAt(++e.position);if(!n&&e.lineIndent>o&&(o=e.lineIndent),U(S)){u++;continue}if(!n&&o===0&&k(e,"missing indentation for block scalar"),e.lineIndent<o){x===C?e.result+=t.repeat(`
11
11
  `,a?1+u:u):x===r&&a&&(e.result+=`
12
12
  `);break}g?D(S)?(b=!0,e.result+=t.repeat(`
13
13
  `,a?1+u:u)):b?(b=!1,e.result+=t.repeat(`
14
14
  `,u+1)):u===0?a&&(e.result+=" "):e.result+=t.repeat(`
15
15
  `,u):e.result+=t.repeat(`
16
- `,a?1+u:u),a=!0,n=!0,u=0;const d=e.position;for(;!U(S)&&S!==0;)S=e.input.charCodeAt(++e.position);W(e,d,e.position,!1)}return!0}function _e(e,l){const g=e.tag,x=e.anchor,a=[];let n=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&J(e,e.anchor,a);let o=e.input.charCodeAt(e.position);for(;o!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,k(e,"tab characters must not be used in indentation")),o===45);){const u=e.input.charCodeAt(e.position+1);if(!q(u))break;if(n=!0,e.position++,Y(e,!0,-1)&&e.lineIndent<=l){a.push(null),o=e.input.charCodeAt(e.position);continue}const b=e.line;if(le(e,l,c,!1,!0),a.push(e.result),Y(e,!0,-1),o=e.input.charCodeAt(e.position),(e.line===b||e.lineIndent>l)&&o!==0)k(e,"bad indentation of a sequence entry");else if(e.lineIndent<l)break}return n?(e.tag=g,e.anchor=x,e.kind="sequence",e.result=a,!0):!1}function ve(e,l,g){let x,a,n,o;const u=e.tag,b=e.anchor,w={},S=Object.create(null);let d=null,T=null,E=null,N=!1,I=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&J(e,e.anchor,w);let v=e.input.charCodeAt(e.position);for(;v!==0;){!N&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,k(e,"tab characters must not be used in indentation"));const M=e.input.charCodeAt(e.position+1),oe=e.line;if((v===63||v===58)&&q(M))v===63?(N&&(ee(e,w,S,d,T,null,a,n,o),d=T=E=null),I=!0,N=!0,x=!0):N?(N=!1,x=!0):k(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=M;else{if(a=e.line,n=e.lineStart,o=e.position,!le(e,g,s,!1,!0))break;if(e.line===oe){for(v=e.input.charCodeAt(e.position);D(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),q(v)||k(e,"a whitespace character is expected after the key-value separator within a block mapping"),N&&(ee(e,w,S,d,T,null,a,n,o),d=T=E=null),I=!0,N=!1,x=!1,d=e.tag,T=e.result;else if(I)k(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=b,!0}else if(I)k(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=b,!0}if((e.line===oe||e.lineIndent>l)&&(N&&(a=e.line,n=e.lineStart,o=e.position),le(e,l,A,!0,x)&&(N?T=e.result:E=e.result),N||(ee(e,w,S,d,T,E,a,n,o),d=T=E=null),Y(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===oe||e.lineIndent>l)&&v!==0)k(e,"bad indentation of a mapping entry");else if(e.lineIndent<l)break}return N&&ee(e,w,S,d,T,null,a,n,o),I&&(e.tag=u,e.anchor=b,e.kind="mapping",e.result=w),I}function Me(e){let l=!1,g=!1,x,a,n=e.input.charCodeAt(e.position);if(n!==33)return!1;e.tag!==null&&k(e,"duplication of a tag property"),n=e.input.charCodeAt(++e.position),n===60?(l=!0,n=e.input.charCodeAt(++e.position)):n===33?(g=!0,x="!!",n=e.input.charCodeAt(++e.position)):x="!";let o=e.position;if(l){do n=e.input.charCodeAt(++e.position);while(n!==0&&n!==62);e.position<e.length?(a=e.input.slice(o,e.position),n=e.input.charCodeAt(++e.position)):k(e,"unexpected end of the stream within a verbatim tag")}else{for(;n!==0&&!q(n);)n===33&&(g?k(e,"tag suffix cannot contain exclamation marks"):(x=e.input.slice(o-1,e.position+1),F.test(x)||k(e,"named tag handle cannot contain such characters"),g=!0,o=e.position+1)),n=e.input.charCodeAt(++e.position);a=e.input.slice(o,e.position),V.test(a)&&k(e,"tag suffix cannot contain flow indicator characters")}a&&!H.test(a)&&k(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{k(e,"tag name is malformed: "+a)}return l?e.tag=a:p.call(e.tagMap,x)?e.tag=e.tagMap[x]+a:x==="!"?e.tag="!"+a:x==="!!"?e.tag="tag:yaml.org,2002:"+a:k(e,'undeclared tag handle "'+x+'"'),!0}function Re(e){let l=e.input.charCodeAt(e.position);if(l!==38)return!1;e.anchor!==null&&k(e,"duplication of an anchor property"),l=e.input.charCodeAt(++e.position);const g=e.position;for(;l!==0&&!q(l)&&!z(l);)l=e.input.charCodeAt(++e.position);return e.position===g&&k(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(g,e.position),!0}function Pe(e){let l=e.input.charCodeAt(e.position);if(l!==42)return!1;l=e.input.charCodeAt(++e.position);const g=e.position;for(;l!==0&&!q(l)&&!z(l);)l=e.input.charCodeAt(++e.position);e.position===g&&k(e,"name of an alias node must contain at least one character");const x=e.input.slice(g,e.position);return p.call(e.anchorMap,x)||k(e,'unidentified alias "'+x+'"'),e.result=e.anchorMap[x],Y(e,!0,-1),!0}function je(e,l,g,x){const a=Ae(e);return De(e),he(e,l),e.tag=null,e.anchor=null,e.kind=null,e.result=null,ve(e,g,x)&&e.kind==="mapping"?(ce(e),!0):(Ye(e),he(e,a),!1)}function le(e,l,g,x,a){let n,o,u=1,b=!1,w=!1,S=null,d,T,E;e.depth>=e.maxDepth&&k(e,"nesting exceeded maxDepth ("+e.maxDepth+")"),e.depth+=1,e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;const N=n=o=A===g||c===g;if(x&&Y(e,!0,-1)&&(b=!0,e.lineIndent>l?u=1:e.lineIndent===l?u=0:e.lineIndent<l&&(u=-1)),u===1)for(;;){const I=e.input.charCodeAt(e.position),v=Ae(e);if(b&&(I===33&&e.tag!==null||I===38&&e.anchor!==null)||!Me(e)&&!Re(e))break;S===null&&(S=v),Y(e,!0,-1)?(b=!0,o=N,e.lineIndent>l?u=1:e.lineIndent===l?u=0:e.lineIndent<l&&(u=-1)):o=!1}if(o&&(o=b||a),u===1||A===g)if(h===g||s===g?T=l:T=l+1,E=e.position-e.lineStart,u===1)if(o&&(_e(e,E)||ve(e,E,T))||Le(e,T))w=!0;else{const I=e.input.charCodeAt(e.position);S!==null&&N&&!o&&I!==124&&I!==62&&je(e,S,S.position-S.lineStart,T)||n&&re(e,T)||we(e,T)||Oe(e,T)?w=!0:Pe(e)?(w=!0,(e.tag!==null||e.anchor!==null)&&k(e,"alias node should not have any properties")):Ie(e,T,h===g)&&(w=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&J(e,e.anchor,e.result)}else u===0&&(w=o&&_e(e,E));if(e.tag===null)e.anchor!==null&&J(e,e.anchor,e.result);else if(e.tag==="?"){e.result!==null&&e.kind!=="scalar"&&k(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(let I=0,v=e.implicitTypes.length;I<v;I+=1)if(d=e.implicitTypes[I],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&J(e,e.anchor,e.result);break}}else if(e.tag!=="!"){if(p.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else{d=null;const I=e.typeMap.multi[e.kind||"fallback"];for(let v=0,M=I.length;v<M;v+=1)if(e.tag.slice(0,I[v].tag.length)===I[v].tag){d=I[v];break}}d||k(e,"unknown tag !<"+e.tag+">"),e.result!==null&&d.kind!==e.kind&&k(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),e.anchor!==null&&J(e,e.anchor,e.result)):k(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.depth-=1,e.tag!==null||e.anchor!==null||w}function Be(e){const l=e.position;let g=!1,x;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(x=e.input.charCodeAt(e.position))!==0&&(Y(e,!0,-1),x=e.input.charCodeAt(e.position),!(e.lineIndent>0||x!==37));){g=!0,x=e.input.charCodeAt(++e.position);let a=e.position;for(;x!==0&&!q(x);)x=e.input.charCodeAt(++e.position);const n=e.input.slice(a,e.position),o=[];for(n.length<1&&k(e,"directive name must not be less than one character in length");x!==0;){for(;D(x);)x=e.input.charCodeAt(++e.position);if(x===35){do x=e.input.charCodeAt(++e.position);while(x!==0&&!U(x));break}if(U(x))break;for(a=e.position;x!==0&&!q(x);)x=e.input.charCodeAt(++e.position);o.push(e.input.slice(a,e.position))}x!==0&&be(e),p.call(Ne,n)?Ne[n](e,n,o):de(e,'unknown document directive "'+n+'"')}if(Y(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Y(e,!0,-1)):g&&k(e,"directives end mark is expected"),le(e,e.lineIndent-1,A,!1,!0),Y(e,!0,-1),e.checkLineBreaks&&R.test(e.input.slice(l,e.position))&&de(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Z(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Y(e,!0,-1));return}e.position<e.length-1&&k(e,"end of the stream or a document separator is expected")}function Se(e,l){e=String(e),l=l||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));const g=new j(e,l),x=e.indexOf("\0");for(x!==-1&&(g.position=x,k(g,"null byte is not allowed in input")),g.input+="\0";g.input.charCodeAt(g.position)===32;)g.lineIndent+=1,g.position+=1;for(;g.position<g.length-1;)Be(g);return g.documents}function He(e,l,g){l!==null&&typeof l=="object"&&typeof g>"u"&&(g=l,l=null);const x=Se(e,g);if(typeof l!="function")return x;for(let a=0,n=x.length;a<n;a+=1)l(x[a])}function Ue(e,l){const g=Se(e,l);if(g.length!==0){if(g.length===1)return g[0];throw new i("expected a single document in the stream, but found more")}}return Fe.loadAll=He,Fe.load=Ue,Fe}var dn={},Yn;function Ai(){if(Yn)return dn;Yn=1;const t=ke(),i=Ee(),m=hn(),y=Object.prototype.toString,p=Object.prototype.hasOwnProperty,h=65279,s=9,c=10,A=13,r=32,f=33,C=34,L=35,R=37,V=38,F=39,H=42,X=44,U=45,D=58,q=61,z=62,se=63,fe=64,ae=91,ne=93,pe=96,_=123,P=124,$=125,j={};j[0]="\\0",j[7]="\\a",j[8]="\\b",j[9]="\\t",j[10]="\\n",j[11]="\\v",j[12]="\\f",j[13]="\\r",j[27]="\\e",j[34]='\\"',j[92]="\\\\",j[133]="\\N",j[160]="\\_",j[8232]="\\L",j[8233]="\\P";const B=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],k=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function de(n,o){if(o===null)return{};const u={},b=Object.keys(o);for(let w=0,S=b.length;w<S;w+=1){let d=b[w],T=String(o[d]);d.slice(0,2)==="!!"&&(d="tag:yaml.org,2002:"+d.slice(2));const E=n.compiledTypeMap.fallback[d];E&&p.call(E.styleAliases,T)&&(T=E.styleAliases[T]),u[d]=T}return u}function J(n){let o,u;const b=n.toString(16).toUpperCase();if(n<=255)o="x",u=2;else if(n<=65535)o="u",u=4;else if(n<=4294967295)o="U",u=8;else throw new i("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+o+t.repeat("0",u-b.length)+b}const De=1,ce=2;function Ye(n){this.schema=n.schema||m,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=t.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=de(this.schema,n.styles||null),this.sortKeys=n.sortKeys||!1,this.lineWidth=n.lineWidth||80,this.noRefs=n.noRefs||!1,this.noCompatMode=n.noCompatMode||!1,this.condenseFlow=n.condenseFlow||!1,this.quotingType=n.quotingType==='"'?ce:De,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ae(n,o){const u=t.repeat(" ",o);let b=0,w="";const S=n.length;for(;b<S;){let d;const T=n.indexOf(`
16
+ `,a?1+u:u),a=!0,n=!0,u=0;const d=e.position;for(;!U(S)&&S!==0;)S=e.input.charCodeAt(++e.position);W(e,d,e.position,!1)}return!0}function _e(e,l){const g=e.tag,x=e.anchor,a=[];let n=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&J(e,e.anchor,a);let o=e.input.charCodeAt(e.position);for(;o!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,k(e,"tab characters must not be used in indentation")),o===45);){const u=e.input.charCodeAt(e.position+1);if(!q(u))break;if(n=!0,e.position++,Y(e,!0,-1)&&e.lineIndent<=l){a.push(null),o=e.input.charCodeAt(e.position);continue}const b=e.line;if(le(e,l,c,!1,!0),a.push(e.result),Y(e,!0,-1),o=e.input.charCodeAt(e.position),(e.line===b||e.lineIndent>l)&&o!==0)k(e,"bad indentation of a sequence entry");else if(e.lineIndent<l)break}return n?(e.tag=g,e.anchor=x,e.kind="sequence",e.result=a,!0):!1}function ve(e,l,g){let x,a,n,o;const u=e.tag,b=e.anchor,w={},S=Object.create(null);let d=null,T=null,E=null,N=!1,I=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&J(e,e.anchor,w);let v=e.input.charCodeAt(e.position);for(;v!==0;){!N&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,k(e,"tab characters must not be used in indentation"));const R=e.input.charCodeAt(e.position+1),oe=e.line;if((v===63||v===58)&&q(R))v===63?(N&&(ee(e,w,S,d,T,null,a,n,o),d=T=E=null),I=!0,N=!0,x=!0):N?(N=!1,x=!0):k(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=R;else{if(a=e.line,n=e.lineStart,o=e.position,!le(e,g,s,!1,!0))break;if(e.line===oe){for(v=e.input.charCodeAt(e.position);D(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),q(v)||k(e,"a whitespace character is expected after the key-value separator within a block mapping"),N&&(ee(e,w,S,d,T,null,a,n,o),d=T=E=null),I=!0,N=!1,x=!1,d=e.tag,T=e.result;else if(I)k(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=b,!0}else if(I)k(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=b,!0}if((e.line===oe||e.lineIndent>l)&&(N&&(a=e.line,n=e.lineStart,o=e.position),le(e,l,A,!0,x)&&(N?T=e.result:E=e.result),N||(ee(e,w,S,d,T,E,a,n,o),d=T=E=null),Y(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===oe||e.lineIndent>l)&&v!==0)k(e,"bad indentation of a mapping entry");else if(e.lineIndent<l)break}return N&&ee(e,w,S,d,T,null,a,n,o),I&&(e.tag=u,e.anchor=b,e.kind="mapping",e.result=w),I}function Re(e){let l=!1,g=!1,x,a,n=e.input.charCodeAt(e.position);if(n!==33)return!1;e.tag!==null&&k(e,"duplication of a tag property"),n=e.input.charCodeAt(++e.position),n===60?(l=!0,n=e.input.charCodeAt(++e.position)):n===33?(g=!0,x="!!",n=e.input.charCodeAt(++e.position)):x="!";let o=e.position;if(l){do n=e.input.charCodeAt(++e.position);while(n!==0&&n!==62);e.position<e.length?(a=e.input.slice(o,e.position),n=e.input.charCodeAt(++e.position)):k(e,"unexpected end of the stream within a verbatim tag")}else{for(;n!==0&&!q(n);)n===33&&(g?k(e,"tag suffix cannot contain exclamation marks"):(x=e.input.slice(o-1,e.position+1),F.test(x)||k(e,"named tag handle cannot contain such characters"),g=!0,o=e.position+1)),n=e.input.charCodeAt(++e.position);a=e.input.slice(o,e.position),V.test(a)&&k(e,"tag suffix cannot contain flow indicator characters")}a&&!H.test(a)&&k(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{k(e,"tag name is malformed: "+a)}return l?e.tag=a:p.call(e.tagMap,x)?e.tag=e.tagMap[x]+a:x==="!"?e.tag="!"+a:x==="!!"?e.tag="tag:yaml.org,2002:"+a:k(e,'undeclared tag handle "'+x+'"'),!0}function Me(e){let l=e.input.charCodeAt(e.position);if(l!==38)return!1;e.anchor!==null&&k(e,"duplication of an anchor property"),l=e.input.charCodeAt(++e.position);const g=e.position;for(;l!==0&&!q(l)&&!z(l);)l=e.input.charCodeAt(++e.position);return e.position===g&&k(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(g,e.position),!0}function Pe(e){let l=e.input.charCodeAt(e.position);if(l!==42)return!1;l=e.input.charCodeAt(++e.position);const g=e.position;for(;l!==0&&!q(l)&&!z(l);)l=e.input.charCodeAt(++e.position);e.position===g&&k(e,"name of an alias node must contain at least one character");const x=e.input.slice(g,e.position);return p.call(e.anchorMap,x)||k(e,'unidentified alias "'+x+'"'),e.result=e.anchorMap[x],Y(e,!0,-1),!0}function je(e,l,g,x){const a=Ae(e);return De(e),he(e,l),e.tag=null,e.anchor=null,e.kind=null,e.result=null,ve(e,g,x)&&e.kind==="mapping"?(ce(e),!0):(Ye(e),he(e,a),!1)}function le(e,l,g,x,a){let n,o,u=1,b=!1,w=!1,S=null,d,T,E;e.depth>=e.maxDepth&&k(e,"nesting exceeded maxDepth ("+e.maxDepth+")"),e.depth+=1,e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;const N=n=o=A===g||c===g;if(x&&Y(e,!0,-1)&&(b=!0,e.lineIndent>l?u=1:e.lineIndent===l?u=0:e.lineIndent<l&&(u=-1)),u===1)for(;;){const I=e.input.charCodeAt(e.position),v=Ae(e);if(b&&(I===33&&e.tag!==null||I===38&&e.anchor!==null)||!Re(e)&&!Me(e))break;S===null&&(S=v),Y(e,!0,-1)?(b=!0,o=N,e.lineIndent>l?u=1:e.lineIndent===l?u=0:e.lineIndent<l&&(u=-1)):o=!1}if(o&&(o=b||a),u===1||A===g)if(h===g||s===g?T=l:T=l+1,E=e.position-e.lineStart,u===1)if(o&&(_e(e,E)||ve(e,E,T))||Le(e,T))w=!0;else{const I=e.input.charCodeAt(e.position);S!==null&&N&&!o&&I!==124&&I!==62&&je(e,S,S.position-S.lineStart,T)||n&&re(e,T)||we(e,T)||Oe(e,T)?w=!0:Pe(e)?(w=!0,(e.tag!==null||e.anchor!==null)&&k(e,"alias node should not have any properties")):Ie(e,T,h===g)&&(w=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&J(e,e.anchor,e.result)}else u===0&&(w=o&&_e(e,E));if(e.tag===null)e.anchor!==null&&J(e,e.anchor,e.result);else if(e.tag==="?"){e.result!==null&&e.kind!=="scalar"&&k(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(let I=0,v=e.implicitTypes.length;I<v;I+=1)if(d=e.implicitTypes[I],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&J(e,e.anchor,e.result);break}}else if(e.tag!=="!"){if(p.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else{d=null;const I=e.typeMap.multi[e.kind||"fallback"];for(let v=0,R=I.length;v<R;v+=1)if(e.tag.slice(0,I[v].tag.length)===I[v].tag){d=I[v];break}}d||k(e,"unknown tag !<"+e.tag+">"),e.result!==null&&d.kind!==e.kind&&k(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),e.anchor!==null&&J(e,e.anchor,e.result)):k(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.depth-=1,e.tag!==null||e.anchor!==null||w}function Be(e){const l=e.position;let g=!1,x;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(x=e.input.charCodeAt(e.position))!==0&&(Y(e,!0,-1),x=e.input.charCodeAt(e.position),!(e.lineIndent>0||x!==37));){g=!0,x=e.input.charCodeAt(++e.position);let a=e.position;for(;x!==0&&!q(x);)x=e.input.charCodeAt(++e.position);const n=e.input.slice(a,e.position),o=[];for(n.length<1&&k(e,"directive name must not be less than one character in length");x!==0;){for(;D(x);)x=e.input.charCodeAt(++e.position);if(x===35){do x=e.input.charCodeAt(++e.position);while(x!==0&&!U(x));break}if(U(x))break;for(a=e.position;x!==0&&!q(x);)x=e.input.charCodeAt(++e.position);o.push(e.input.slice(a,e.position))}x!==0&&be(e),p.call(Ne,n)?Ne[n](e,n,o):de(e,'unknown document directive "'+n+'"')}if(Y(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Y(e,!0,-1)):g&&k(e,"directives end mark is expected"),le(e,e.lineIndent-1,A,!1,!0),Y(e,!0,-1),e.checkLineBreaks&&M.test(e.input.slice(l,e.position))&&de(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Z(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Y(e,!0,-1));return}e.position<e.length-1&&k(e,"end of the stream or a document separator is expected")}function Se(e,l){e=String(e),l=l||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));const g=new j(e,l),x=e.indexOf("\0");for(x!==-1&&(g.position=x,k(g,"null byte is not allowed in input")),g.input+="\0";g.input.charCodeAt(g.position)===32;)g.lineIndent+=1,g.position+=1;for(;g.position<g.length-1;)Be(g);return g.documents}function He(e,l,g){l!==null&&typeof l=="object"&&typeof g>"u"&&(g=l,l=null);const x=Se(e,g);if(typeof l!="function")return x;for(let a=0,n=x.length;a<n;a+=1)l(x[a])}function Ue(e,l){const g=Se(e,l);if(g.length!==0){if(g.length===1)return g[0];throw new i("expected a single document in the stream, but found more")}}return Fe.loadAll=He,Fe.load=Ue,Fe}var dn={},Yn;function Ai(){if(Yn)return dn;Yn=1;const t=ke(),i=Ee(),m=hn(),y=Object.prototype.toString,p=Object.prototype.hasOwnProperty,h=65279,s=9,c=10,A=13,r=32,f=33,C=34,L=35,M=37,V=38,F=39,H=42,X=44,U=45,D=58,q=61,z=62,se=63,fe=64,ae=91,ne=93,pe=96,_=123,P=124,$=125,j={};j[0]="\\0",j[7]="\\a",j[8]="\\b",j[9]="\\t",j[10]="\\n",j[11]="\\v",j[12]="\\f",j[13]="\\r",j[27]="\\e",j[34]='\\"',j[92]="\\\\",j[133]="\\N",j[160]="\\_",j[8232]="\\L",j[8233]="\\P";const B=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],k=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function de(n,o){if(o===null)return{};const u={},b=Object.keys(o);for(let w=0,S=b.length;w<S;w+=1){let d=b[w],T=String(o[d]);d.slice(0,2)==="!!"&&(d="tag:yaml.org,2002:"+d.slice(2));const E=n.compiledTypeMap.fallback[d];E&&p.call(E.styleAliases,T)&&(T=E.styleAliases[T]),u[d]=T}return u}function J(n){let o,u;const b=n.toString(16).toUpperCase();if(n<=255)o="x",u=2;else if(n<=65535)o="u",u=4;else if(n<=4294967295)o="U",u=8;else throw new i("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+o+t.repeat("0",u-b.length)+b}const De=1,ce=2;function Ye(n){this.schema=n.schema||m,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=t.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=de(this.schema,n.styles||null),this.sortKeys=n.sortKeys||!1,this.lineWidth=n.lineWidth||80,this.noRefs=n.noRefs||!1,this.noCompatMode=n.noCompatMode||!1,this.condenseFlow=n.condenseFlow||!1,this.quotingType=n.quotingType==='"'?ce:De,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ae(n,o){const u=t.repeat(" ",o);let b=0,w="";const S=n.length;for(;b<S;){let d;const T=n.indexOf(`
18
18
  `,b);T===-1?(d=n.slice(b),b=S):(d=n.slice(b,T+1),b=T+1),d.length&&d!==`
19
19
  `&&(w+=u),w+=d}return w}function he(n,o){return`
20
- `+t.repeat(" ",n.indent*o)}function Ne(n,o){for(let u=0,b=n.implicitTypes.length;u<b;u+=1)if(n.implicitTypes[u].resolve(o))return!0;return!1}function W(n){return n===r||n===s}function ie(n){return n>=32&&n<=126||n>=161&&n<=55295&&n!==8232&&n!==8233||n>=57344&&n<=65533&&n!==h||n>=65536&&n<=1114111}function ye(n){return ie(n)&&n!==h&&n!==A&&n!==c}function ee(n,o,u){const b=ye(n),w=b&&!W(n);return(u?b:b&&n!==X&&n!==ae&&n!==ne&&n!==_&&n!==$)&&n!==L&&!(o===D&&!w)||ye(o)&&!W(o)&&n===L||o===D&&w}function be(n){return ie(n)&&n!==h&&!W(n)&&n!==U&&n!==se&&n!==D&&n!==X&&n!==ae&&n!==ne&&n!==_&&n!==$&&n!==L&&n!==V&&n!==H&&n!==f&&n!==P&&n!==q&&n!==z&&n!==F&&n!==C&&n!==R&&n!==fe&&n!==pe}function Y(n){return!W(n)&&n!==D}function Z(n,o){const u=n.charCodeAt(o);let b;return u>=55296&&u<=56319&&o+1<n.length&&(b=n.charCodeAt(o+1),b>=56320&&b<=57343)?(u-55296)*1024+b-56320+65536:u}function me(n){return/^\n* /.test(n)}const Ie=1,we=2,Oe=3,Le=4,re=5;function _e(n,o,u,b,w,S,d,T){let E,N=0,I=null,v=!1,M=!1;const oe=b!==-1;let Ce=-1,Te=be(Z(n,0))&&Y(Z(n,n.length-1));if(o||d)for(E=0;E<n.length;N>=65536?E+=2:E++){if(N=Z(n,E),!ie(N))return re;Te=Te&&ee(N,I,T),I=N}else{for(E=0;E<n.length;N>=65536?E+=2:E++){if(N=Z(n,E),N===c)v=!0,oe&&(M=M||E-Ce-1>b&&n[Ce+1]!==" ",Ce=E);else if(!ie(N))return re;Te=Te&&ee(N,I,T),I=N}M=M||oe&&E-Ce-1>b&&n[Ce+1]!==" "}return!v&&!M?Te&&!d&&!w(n)?Ie:S===ce?re:we:u>9&&me(n)?re:d?S===ce?re:we:M?Le:Oe}function ve(n,o,u,b,w){n.dump=(function(){if(o.length===0)return n.quotingType===ce?'""':"''";if(!n.noCompatMode&&(B.indexOf(o)!==-1||k.test(o)))return n.quotingType===ce?'"'+o+'"':"'"+o+"'";const S=n.indent*Math.max(1,u),d=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-S),T=b||n.flowLevel>-1&&u>=n.flowLevel;function E(N){return Ne(n,N)}switch(_e(o,T,n.indent,d,E,n.quotingType,n.forceQuotes&&!b,w)){case Ie:return o;case we:return"'"+o.replace(/'/g,"''")+"'";case Oe:return"|"+Me(o,n.indent)+Re(Ae(o,S));case Le:return">"+Me(o,n.indent)+Re(Ae(Pe(o,d),S));case re:return'"'+le(o)+'"';default:throw new i("impossible error: invalid scalar style")}})()}function Me(n,o){const u=me(n)?String(o):"",b=n[n.length-1]===`
20
+ `+t.repeat(" ",n.indent*o)}function Ne(n,o){for(let u=0,b=n.implicitTypes.length;u<b;u+=1)if(n.implicitTypes[u].resolve(o))return!0;return!1}function W(n){return n===r||n===s}function ie(n){return n>=32&&n<=126||n>=161&&n<=55295&&n!==8232&&n!==8233||n>=57344&&n<=65533&&n!==h||n>=65536&&n<=1114111}function ye(n){return ie(n)&&n!==h&&n!==A&&n!==c}function ee(n,o,u){const b=ye(n),w=b&&!W(n);return(u?b:b&&n!==X&&n!==ae&&n!==ne&&n!==_&&n!==$)&&n!==L&&!(o===D&&!w)||ye(o)&&!W(o)&&n===L||o===D&&w}function be(n){return ie(n)&&n!==h&&!W(n)&&n!==U&&n!==se&&n!==D&&n!==X&&n!==ae&&n!==ne&&n!==_&&n!==$&&n!==L&&n!==V&&n!==H&&n!==f&&n!==P&&n!==q&&n!==z&&n!==F&&n!==C&&n!==M&&n!==fe&&n!==pe}function Y(n){return!W(n)&&n!==D}function Z(n,o){const u=n.charCodeAt(o);let b;return u>=55296&&u<=56319&&o+1<n.length&&(b=n.charCodeAt(o+1),b>=56320&&b<=57343)?(u-55296)*1024+b-56320+65536:u}function me(n){return/^\n* /.test(n)}const Ie=1,we=2,Oe=3,Le=4,re=5;function _e(n,o,u,b,w,S,d,T){let E,N=0,I=null,v=!1,R=!1;const oe=b!==-1;let Ce=-1,Te=be(Z(n,0))&&Y(Z(n,n.length-1));if(o||d)for(E=0;E<n.length;N>=65536?E+=2:E++){if(N=Z(n,E),!ie(N))return re;Te=Te&&ee(N,I,T),I=N}else{for(E=0;E<n.length;N>=65536?E+=2:E++){if(N=Z(n,E),N===c)v=!0,oe&&(R=R||E-Ce-1>b&&n[Ce+1]!==" ",Ce=E);else if(!ie(N))return re;Te=Te&&ee(N,I,T),I=N}R=R||oe&&E-Ce-1>b&&n[Ce+1]!==" "}return!v&&!R?Te&&!d&&!w(n)?Ie:S===ce?re:we:u>9&&me(n)?re:d?S===ce?re:we:R?Le:Oe}function ve(n,o,u,b,w){n.dump=(function(){if(o.length===0)return n.quotingType===ce?'""':"''";if(!n.noCompatMode&&(B.indexOf(o)!==-1||k.test(o)))return n.quotingType===ce?'"'+o+'"':"'"+o+"'";const S=n.indent*Math.max(1,u),d=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-S),T=b||n.flowLevel>-1&&u>=n.flowLevel;function E(N){return Ne(n,N)}switch(_e(o,T,n.indent,d,E,n.quotingType,n.forceQuotes&&!b,w)){case Ie:return o;case we:return"'"+o.replace(/'/g,"''")+"'";case Oe:return"|"+Re(o,n.indent)+Me(Ae(o,S));case Le:return">"+Re(o,n.indent)+Me(Ae(Pe(o,d),S));case re:return'"'+le(o)+'"';default:throw new i("impossible error: invalid scalar style")}})()}function Re(n,o){const u=me(n)?String(o):"",b=n[n.length-1]===`
21
21
  `,S=b&&(n[n.length-2]===`
22
22
  `||n===`
23
23
  `)?"+":b?"":"-";return u+S+`
24
- `}function Re(n){return n[n.length-1]===`
24
+ `}function Me(n){return n[n.length-1]===`
25
25
  `?n.slice(0,-1):n}function Pe(n,o){const u=/(\n+)([^\n]*)/g;let b=(function(){let T=n.indexOf(`
26
26
  `);return T=T!==-1?T:n.length,u.lastIndex=T,je(n.slice(0,T),o)})(),w=n[0]===`
27
27
  `||n[0]===" ",S,d;for(;d=u.exec(n);){const T=d[1],E=d[2];S=E[0]===" ",b+=T+(!w&&!S&&E!==""?`
28
28
  `:"")+je(E,o),w=S}return b}function je(n,o){if(n===""||n[0]===" ")return n;const u=/ [^ ]/g;let b,w=0,S,d=0,T=0,E="";for(;b=u.exec(n);)T=b.index,T-w>o&&(S=d>w?d:T,E+=`
29
29
  `+n.slice(w,S),w=S+1),d=T;return E+=`
30
30
  `,n.length-w>o&&d>w?E+=n.slice(w,d)+`
31
- `+n.slice(d+1):E+=n.slice(w),E.slice(1)}function le(n){let o="",u=0;for(let b=0;b<n.length;u>=65536?b+=2:b++){u=Z(n,b);const w=j[u];!w&&ie(u)?(o+=n[b],u>=65536&&(o+=n[b+1])):o+=w||J(u)}return o}function Be(n,o,u){let b="";const w=n.tag;for(let S=0,d=u.length;S<d;S+=1){let T=u[S];n.replacer&&(T=n.replacer.call(u,String(S),T)),(l(n,o,T,!1,!1)||typeof T>"u"&&l(n,o,null,!1,!1))&&(b!==""&&(b+=","+(n.condenseFlow?"":" ")),b+=n.dump)}n.tag=w,n.dump="["+b+"]"}function Se(n,o,u,b){let w="";const S=n.tag;for(let d=0,T=u.length;d<T;d+=1){let E=u[d];n.replacer&&(E=n.replacer.call(u,String(d),E)),(l(n,o+1,E,!0,!0,!1,!0)||typeof E>"u"&&l(n,o+1,null,!0,!0,!1,!0))&&((!b||w!=="")&&(w+=he(n,o)),n.dump&&c===n.dump.charCodeAt(0)?w+="-":w+="- ",w+=n.dump)}n.tag=S,n.dump=w||"[]"}function He(n,o,u){let b="";const w=n.tag,S=Object.keys(u);for(let d=0,T=S.length;d<T;d+=1){let E="";b!==""&&(E+=", "),n.condenseFlow&&(E+='"');const N=S[d];let I=u[N];n.replacer&&(I=n.replacer.call(u,N,I)),l(n,o,N,!1,!1)&&(n.dump.length>1024&&(E+="? "),E+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),l(n,o,I,!1,!1)&&(E+=n.dump,b+=E))}n.tag=w,n.dump="{"+b+"}"}function Ue(n,o,u,b){let w="";const S=n.tag,d=Object.keys(u);if(n.sortKeys===!0)d.sort();else if(typeof n.sortKeys=="function")d.sort(n.sortKeys);else if(n.sortKeys)throw new i("sortKeys must be a boolean or a function");for(let T=0,E=d.length;T<E;T+=1){let N="";(!b||w!=="")&&(N+=he(n,o));const I=d[T];let v=u[I];if(n.replacer&&(v=n.replacer.call(u,I,v)),!l(n,o+1,I,!0,!0,!0))continue;const M=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024;M&&(n.dump&&c===n.dump.charCodeAt(0)?N+="?":N+="? "),N+=n.dump,M&&(N+=he(n,o)),l(n,o+1,v,!0,M)&&(n.dump&&c===n.dump.charCodeAt(0)?N+=":":N+=": ",N+=n.dump,w+=N)}n.tag=S,n.dump=w||"{}"}function e(n,o,u){const b=u?n.explicitTypes:n.implicitTypes;for(let w=0,S=b.length;w<S;w+=1){const d=b[w];if((d.instanceOf||d.predicate)&&(!d.instanceOf||typeof o=="object"&&o instanceof d.instanceOf)&&(!d.predicate||d.predicate(o))){if(u?d.multi&&d.representName?n.tag=d.representName(o):n.tag=d.tag:n.tag="?",d.represent){const T=n.styleMap[d.tag]||d.defaultStyle;let E;if(y.call(d.represent)==="[object Function]")E=d.represent(o,T);else if(p.call(d.represent,T))E=d.represent[T](o,T);else throw new i("!<"+d.tag+'> tag resolver accepts not "'+T+'" style');n.dump=E}return!0}}return!1}function l(n,o,u,b,w,S,d){n.tag=null,n.dump=u,e(n,u,!1)||e(n,u,!0);const T=y.call(n.dump),E=b;b&&(b=n.flowLevel<0||n.flowLevel>o);const N=T==="[object Object]"||T==="[object Array]";let I,v;if(N&&(I=n.duplicates.indexOf(u),v=I!==-1),(n.tag!==null&&n.tag!=="?"||v||n.indent!==2&&o>0)&&(w=!1),v&&n.usedDuplicates[I])n.dump="*ref_"+I;else{if(N&&v&&!n.usedDuplicates[I]&&(n.usedDuplicates[I]=!0),T==="[object Object]")b&&Object.keys(n.dump).length!==0?(Ue(n,o,n.dump,w),v&&(n.dump="&ref_"+I+n.dump)):(He(n,o,n.dump),v&&(n.dump="&ref_"+I+" "+n.dump));else if(T==="[object Array]")b&&n.dump.length!==0?(n.noArrayIndent&&!d&&o>0?Se(n,o-1,n.dump,w):Se(n,o,n.dump,w),v&&(n.dump="&ref_"+I+n.dump)):(Be(n,o,n.dump),v&&(n.dump="&ref_"+I+" "+n.dump));else if(T==="[object String]")n.tag!=="?"&&ve(n,n.dump,o,S,E);else{if(T==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+T)}if(n.tag!==null&&n.tag!=="?"){let M=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21");n.tag[0]==="!"?M="!"+M:M.slice(0,18)==="tag:yaml.org,2002:"?M="!!"+M.slice(18):M="!<"+M+">",n.dump=M+" "+n.dump}}return!0}function g(n,o){const u=[],b=[];x(n,u,b);const w=b.length;for(let S=0;S<w;S+=1)o.duplicates.push(u[b[S]]);o.usedDuplicates=new Array(w)}function x(n,o,u){if(n!==null&&typeof n=="object"){const b=o.indexOf(n);if(b!==-1)u.indexOf(b)===-1&&u.push(b);else if(o.push(n),Array.isArray(n))for(let w=0,S=n.length;w<S;w+=1)x(n[w],o,u);else{const w=Object.keys(n);for(let S=0,d=w.length;S<d;S+=1)x(n[w[S]],o,u)}}}function a(n,o){o=o||{};const u=new Ye(o);u.noRefs||g(n,u);let b=n;return u.replacer&&(b=u.replacer.call({"":b},"",b)),l(u,0,b,!0,!0)?u.dump+`
31
+ `+n.slice(d+1):E+=n.slice(w),E.slice(1)}function le(n){let o="",u=0;for(let b=0;b<n.length;u>=65536?b+=2:b++){u=Z(n,b);const w=j[u];!w&&ie(u)?(o+=n[b],u>=65536&&(o+=n[b+1])):o+=w||J(u)}return o}function Be(n,o,u){let b="";const w=n.tag;for(let S=0,d=u.length;S<d;S+=1){let T=u[S];n.replacer&&(T=n.replacer.call(u,String(S),T)),(l(n,o,T,!1,!1)||typeof T>"u"&&l(n,o,null,!1,!1))&&(b!==""&&(b+=","+(n.condenseFlow?"":" ")),b+=n.dump)}n.tag=w,n.dump="["+b+"]"}function Se(n,o,u,b){let w="";const S=n.tag;for(let d=0,T=u.length;d<T;d+=1){let E=u[d];n.replacer&&(E=n.replacer.call(u,String(d),E)),(l(n,o+1,E,!0,!0,!1,!0)||typeof E>"u"&&l(n,o+1,null,!0,!0,!1,!0))&&((!b||w!=="")&&(w+=he(n,o)),n.dump&&c===n.dump.charCodeAt(0)?w+="-":w+="- ",w+=n.dump)}n.tag=S,n.dump=w||"[]"}function He(n,o,u){let b="";const w=n.tag,S=Object.keys(u);for(let d=0,T=S.length;d<T;d+=1){let E="";b!==""&&(E+=", "),n.condenseFlow&&(E+='"');const N=S[d];let I=u[N];n.replacer&&(I=n.replacer.call(u,N,I)),l(n,o,N,!1,!1)&&(n.dump.length>1024&&(E+="? "),E+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),l(n,o,I,!1,!1)&&(E+=n.dump,b+=E))}n.tag=w,n.dump="{"+b+"}"}function Ue(n,o,u,b){let w="";const S=n.tag,d=Object.keys(u);if(n.sortKeys===!0)d.sort();else if(typeof n.sortKeys=="function")d.sort(n.sortKeys);else if(n.sortKeys)throw new i("sortKeys must be a boolean or a function");for(let T=0,E=d.length;T<E;T+=1){let N="";(!b||w!=="")&&(N+=he(n,o));const I=d[T];let v=u[I];if(n.replacer&&(v=n.replacer.call(u,I,v)),!l(n,o+1,I,!0,!0,!0))continue;const R=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024;R&&(n.dump&&c===n.dump.charCodeAt(0)?N+="?":N+="? "),N+=n.dump,R&&(N+=he(n,o)),l(n,o+1,v,!0,R)&&(n.dump&&c===n.dump.charCodeAt(0)?N+=":":N+=": ",N+=n.dump,w+=N)}n.tag=S,n.dump=w||"{}"}function e(n,o,u){const b=u?n.explicitTypes:n.implicitTypes;for(let w=0,S=b.length;w<S;w+=1){const d=b[w];if((d.instanceOf||d.predicate)&&(!d.instanceOf||typeof o=="object"&&o instanceof d.instanceOf)&&(!d.predicate||d.predicate(o))){if(u?d.multi&&d.representName?n.tag=d.representName(o):n.tag=d.tag:n.tag="?",d.represent){const T=n.styleMap[d.tag]||d.defaultStyle;let E;if(y.call(d.represent)==="[object Function]")E=d.represent(o,T);else if(p.call(d.represent,T))E=d.represent[T](o,T);else throw new i("!<"+d.tag+'> tag resolver accepts not "'+T+'" style');n.dump=E}return!0}}return!1}function l(n,o,u,b,w,S,d){n.tag=null,n.dump=u,e(n,u,!1)||e(n,u,!0);const T=y.call(n.dump),E=b;b&&(b=n.flowLevel<0||n.flowLevel>o);const N=T==="[object Object]"||T==="[object Array]";let I,v;if(N&&(I=n.duplicates.indexOf(u),v=I!==-1),(n.tag!==null&&n.tag!=="?"||v||n.indent!==2&&o>0)&&(w=!1),v&&n.usedDuplicates[I])n.dump="*ref_"+I;else{if(N&&v&&!n.usedDuplicates[I]&&(n.usedDuplicates[I]=!0),T==="[object Object]")b&&Object.keys(n.dump).length!==0?(Ue(n,o,n.dump,w),v&&(n.dump="&ref_"+I+n.dump)):(He(n,o,n.dump),v&&(n.dump="&ref_"+I+" "+n.dump));else if(T==="[object Array]")b&&n.dump.length!==0?(n.noArrayIndent&&!d&&o>0?Se(n,o-1,n.dump,w):Se(n,o,n.dump,w),v&&(n.dump="&ref_"+I+n.dump)):(Be(n,o,n.dump),v&&(n.dump="&ref_"+I+" "+n.dump));else if(T==="[object String]")n.tag!=="?"&&ve(n,n.dump,o,S,E);else{if(T==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+T)}if(n.tag!==null&&n.tag!=="?"){let R=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21");n.tag[0]==="!"?R="!"+R:R.slice(0,18)==="tag:yaml.org,2002:"?R="!!"+R.slice(18):R="!<"+R+">",n.dump=R+" "+n.dump}}return!0}function g(n,o){const u=[],b=[];x(n,u,b);const w=b.length;for(let S=0;S<w;S+=1)o.duplicates.push(u[b[S]]);o.usedDuplicates=new Array(w)}function x(n,o,u){if(n!==null&&typeof n=="object"){const b=o.indexOf(n);if(b!==-1)u.indexOf(b)===-1&&u.push(b);else if(o.push(n),Array.isArray(n))for(let w=0,S=n.length;w<S;w+=1)x(n[w],o,u);else{const w=Object.keys(n);for(let S=0,d=w.length;S<d;S+=1)x(n[w[S]],o,u)}}}function a(n,o){o=o||{};const u=new Ye(o);u.noRefs||g(n,u);let b=n;return u.replacer&&(b=u.replacer.call({"":b},"",b)),l(u,0,b,!0,!0)?u.dump+`
32
32
  `:""}return dn.dump=a,dn}var Pn;function yi(){if(Pn)return K;Pn=1;const t=xi(),i=Ai();function m(y,p){return function(){throw new Error("Function yaml."+y+" is removed in js-yaml 4. Use yaml."+p+" instead, which is now safe by default.")}}return K.Type=G(),K.Schema=Kn(),K.FAILSAFE_SCHEMA=Qn(),K.JSON_SCHEMA=Jn(),K.CORE_SCHEMA=ei(),K.DEFAULT_SCHEMA=hn(),K.load=t.load,K.loadAll=t.loadAll,K.dump=i.dump,K.YAMLException=Ee(),K.types={binary:ri(),float:Zn(),map:Wn(),null:zn(),pairs:oi(),set:ti(),timestamp:ni(),bool:Vn(),int:Xn(),merge:ii(),omap:li(),seq:Gn(),str:$n()},K.safeLoad=m("safeLoad","load"),K.safeLoadAll=m("safeLoadAll","loadAll"),K.safeDump=m("safeDump","dump"),K}var bi=yi();const wi=mi(bi),{Type:Ui,Schema:Ki,FAILSAFE_SCHEMA:$i,JSON_SCHEMA:Gi,CORE_SCHEMA:Wi,DEFAULT_SCHEMA:Qi,load:Si,loadAll:zi,dump:Vi,YAMLException:Xi,types:Zi,safeLoad:Ji,safeLoadAll:er,safeDump:nr}=wi,ue=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Q(t){return typeof t=="string"?t.trim()||null:typeof t=="number"||typeof t=="boolean"?String(t):null}function Bn(t){const i=typeof t=="string"?Number(t):t;return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:null}function ci(t,i){if(Array.isArray(t))return t;if(!ue(t))return null;for(const m of i)if(Array.isArray(t[m]))return t[m];return null}function mn(t){const i=ue(t)?Q(t.title):null;return i?{title:i}:{}}const Ci=new Set(["warning","danger","success"]);function Ti(t){if(!ue(t))return null;const i=ue(t.progress)?t.progress:null,m=Bn(i==null?void 0:i.done),y=Bn(i==null?void 0:i.total),p=(Array.isArray(t.values)?t.values:[]).flatMap(s=>{if(!ue(s))return[];const c=Q(s.label),A=Q(s.value);if(!c||A===null)return[];const r=Q(s.tone);return[{label:c,value:A,...r&&Ci.has(r)&&{tone:r}}]}),h={kind:"status",...mn(t),...m!==null&&y!==null&&y>0&&{progress:{done:Math.min(m,y),total:y}},values:p};return h.progress||p.length>0?h:null}function ki(t){const i=ci(t,["decisions","items"]);if(!i)return null;const m=i.flatMap((y,p)=>{if(!ue(y))return[];const h=Q(y.question),s=(Array.isArray(y.options)?y.options:[]).map(Q).filter(r=>!!r);if(!h||s.length===0)return[];const c=Q(y.recommended),A=Q(y.detail);return[{id:Q(y.id)??String(p+1),question:h,options:s,...c&&s.includes(c)&&{recommended:c},...A&&{detail:A}}]});return new Set(m.map(y=>y.id)).size!==m.length?null:m.length>0?{kind:"decisions",...mn(t),decisions:m}:null}const Ei=new Set(["todo","doing","done","blocked","skipped"]);function Ni(t){const i=ci(t,["items"]);if(!i)return null;const m=i.flatMap(y=>{const p=Q(y);if(p)return[{text:p,state:"todo"}];if(!ue(y))return[];const h=Q(y.text);if(!h)return[];const s=Q(y.state),c=Q(y.note);return[{text:h,state:s&&Ei.has(s)?s:"todo",...c&&{note:c}}]});return m.length>0?{kind:"checklist",...mn(t),items:m}:null}const Ii={status:Ti,decisions:ki,checklist:Ni};function Oi(t,i){let m;try{m=Si(i)}catch{return null}return Ii[t](m)}function Li(t,i){return["Decisions:",...t.filter(y=>i[y.id]).map(y=>`- ${y.id}: ${y.question} ${i[y.id]}`)].join(`
33
- `)}function ir(t){const i=qe.c(13),{kind:m,source:y,occurrence:p,fallback:h}=t,s=p===void 0?"0":p;let c;i[0]!==m||i[1]!==y?(c=Oi(m,y),i[0]=m,i[1]=y,i[2]=c):c=i[2];const A=c;if(!A){let r;return i[3]!==h?(r=O.jsx(O.Fragment,{children:h}),i[3]=h,i[4]=r):r=i[4],r}switch(A.kind){case"status":{let r;return i[5]!==A?(r=O.jsx(_i,{block:A}),i[5]=A,i[6]=r):r=i[6],r}case"checklist":{let r;return i[7]!==A?(r=O.jsx(Ri,{block:A}),i[7]=A,i[8]=r):r=i[8],r}case"decisions":{let r;return i[9]!==A||i[10]!==s||i[11]!==y?(r=O.jsx(Di,{block:A,source:y,occurrence:s}),i[9]=A,i[10]=s,i[11]=y,i[12]=r):r=i[12],r}}}function ui(t){const i=qe.c(3),{label:m,children:y}=t;let p;return i[0]!==y||i[1]!==m?(p=O.jsx("section",{"aria-label":m,"data-cogpit-block":!0,className:"my-3 rounded-lg border border-border bg-card p-3 text-sm",children:y}),i[0]=y,i[1]=m,i[2]=p):p=i[2],p}const Hn={warning:"text-warning",danger:"text-destructive",success:"text-success"};function _i(t){const i=qe.c(14),{block:m}=t,{progress:y}=m;let p;i[0]!==y?(p=y?Math.round(y.done/y.total*100):null,i[0]=y,i[1]=p):p=i[1];const h=p,s=m.title??"Status";let c;i[2]!==m.title?(c=m.title&&O.jsx("h4",{className:"mb-2 text-[13.5px] font-medium",children:m.title}),i[2]=m.title,i[3]=c):c=i[3];let A;i[4]!==h||i[5]!==y?(A=y&&O.jsxs("div",{className:"mb-2.5",children:[O.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":y.total,"aria-valuenow":y.done,"aria-label":`${y.done} of ${y.total} done`,className:"h-1.5 overflow-hidden rounded-full bg-muted",children:O.jsx("div",{className:"h-full rounded-full bg-foreground",style:{width:`${h}%`}})}),O.jsxs("div",{className:"mt-1.5 flex justify-between text-xs tabular-nums text-muted-foreground",children:[O.jsxs("span",{children:[y.done," of ",y.total," done"]}),O.jsxs("span",{children:[h,"%"]})]})]}),i[4]=h,i[5]=y,i[6]=A):A=i[6];let r;i[7]!==m.values?(r=m.values.length>0&&O.jsx("dl",{className:"grid grid-cols-1 gap-x-5 sm:grid-cols-2",children:m.values.map(vi)}),i[7]=m.values,i[8]=r):r=i[8];let f;return i[9]!==s||i[10]!==c||i[11]!==A||i[12]!==r?(f=O.jsxs(ui,{label:s,children:[c,A,r]}),i[9]=s,i[10]=c,i[11]=A,i[12]=r,i[13]=f):f=i[13],f}function vi(t){return O.jsxs("div",{className:"flex justify-between gap-3 border-t border-border/70 py-1.5 text-[12.5px]",children:[O.jsx("dt",{className:xe("text-muted-foreground",t.tone&&Hn[t.tone]),children:t.label}),O.jsx("dd",{className:xe("text-right tabular-nums",t.tone&&Hn[t.tone]),children:t.value})]},t.label)}const Mi={done:{mark:O.jsx(Un,{className:"size-2.5"}),ring:"border-success text-success",text:"text-muted-foreground line-through decoration-muted-foreground/50",label:"Done"},doing:{mark:null,ring:"border-success bg-success/25",text:"",label:"In progress"},blocked:{mark:O.jsx(hi,{className:"size-2.5"}),ring:"border-warning text-warning",text:"text-warning",label:"Blocked"},skipped:{mark:null,ring:"border-dashed border-muted-foreground/60",text:"text-muted-foreground line-through",label:"Skipped"},todo:{mark:null,ring:"border-muted-foreground/60",text:"",label:"To do"}};function Ri(t){const i=qe.c(18),{block:m}=t;let y;i[0]!==m.items?(y=m.items.filter(Fi),i[0]=m.items,i[1]=y):y=i[1];const p=y.length,h=m.title??"Checklist";let s;i[2]!==m.title?(s=m.title&&O.jsx("h4",{className:"text-[13.5px] font-medium",children:m.title}),i[2]=m.title,i[3]=s):s=i[3];let c;i[4]!==m.items.length||i[5]!==p?(c=O.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[p," of ",m.items.length]}),i[4]=m.items.length,i[5]=p,i[6]=c):c=i[6];let A;i[7]!==s||i[8]!==c?(A=O.jsxs("div",{className:"mb-1.5 flex items-baseline gap-2",children:[s,c]}),i[7]=s,i[8]=c,i[9]=A):A=i[9];let r;i[10]!==m.items?(r=m.items.map(ji),i[10]=m.items,i[11]=r):r=i[11];let f;i[12]!==r?(f=O.jsx("ul",{className:"flex flex-col",children:r}),i[12]=r,i[13]=f):f=i[13];let C;return i[14]!==h||i[15]!==A||i[16]!==f?(C=O.jsxs(ui,{label:h,children:[A,f]}),i[14]=h,i[15]=A,i[16]=f,i[17]=C):C=i[17],C}function ji(t,i){const m=Mi[t.state];return O.jsxs("li",{className:"flex items-center gap-2.5 py-1 text-[13px]",children:[O.jsx("span",{className:xe("grid size-3.5 shrink-0 place-items-center rounded-full border-[1.5px]",m.ring),"aria-label":m.label,role:"img",children:m.mark}),O.jsx("span",{className:xe("min-w-0 flex-1",m.text),children:t.text}),t.note&&O.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:t.note})]},`${i}:${t.text}`)}function Fi(t){return t.state==="done"}function qi(t){let i=5381;for(let m=0;m<t.length;m++)i=(i<<5)+i+t.charCodeAt(m)|0;return(i>>>0).toString(36)}function Di({block:t,source:i,occurrence:m}){var pe;const y=si(),p=fi(),h=ge.useContext(ai),s=((pe=y==null?void 0:y.session)==null?void 0:pe.sessionId)??"none",[c,A]=pi(di(`cogpit-decisions:${s}:${qi(`${(h==null?void 0:h.messageKey)??""}
33
+ `)}function ir(t){const i=qe.c(13),{kind:m,source:y,occurrence:p,fallback:h}=t,s=p===void 0?"0":p;let c;i[0]!==m||i[1]!==y?(c=Oi(m,y),i[0]=m,i[1]=y,i[2]=c):c=i[2];const A=c;if(!A){let r;return i[3]!==h?(r=O.jsx(O.Fragment,{children:h}),i[3]=h,i[4]=r):r=i[4],r}switch(A.kind){case"status":{let r;return i[5]!==A?(r=O.jsx(_i,{block:A}),i[5]=A,i[6]=r):r=i[6],r}case"checklist":{let r;return i[7]!==A?(r=O.jsx(Mi,{block:A}),i[7]=A,i[8]=r):r=i[8],r}case"decisions":{let r;return i[9]!==A||i[10]!==s||i[11]!==y?(r=O.jsx(Di,{block:A,source:y,occurrence:s}),i[9]=A,i[10]=s,i[11]=y,i[12]=r):r=i[12],r}}}function ui(t){const i=qe.c(3),{label:m,children:y}=t;let p;return i[0]!==y||i[1]!==m?(p=O.jsx("section",{"aria-label":m,"data-cogpit-block":!0,className:"my-3 rounded-lg border border-border bg-card p-3 text-sm",children:y}),i[0]=y,i[1]=m,i[2]=p):p=i[2],p}const Hn={warning:"text-warning",danger:"text-destructive",success:"text-success"};function _i(t){const i=qe.c(14),{block:m}=t,{progress:y}=m;let p;i[0]!==y?(p=y?Math.round(y.done/y.total*100):null,i[0]=y,i[1]=p):p=i[1];const h=p,s=m.title??"Status";let c;i[2]!==m.title?(c=m.title&&O.jsx("h4",{className:"mb-2 text-[13.5px] font-medium",children:m.title}),i[2]=m.title,i[3]=c):c=i[3];let A;i[4]!==h||i[5]!==y?(A=y&&O.jsxs("div",{className:"mb-2.5",children:[O.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":y.total,"aria-valuenow":y.done,"aria-label":`${y.done} of ${y.total} done`,className:"h-1.5 overflow-hidden rounded-full bg-muted",children:O.jsx("div",{className:"h-full rounded-full bg-foreground",style:{width:`${h}%`}})}),O.jsxs("div",{className:"mt-1.5 flex justify-between text-xs tabular-nums text-muted-foreground",children:[O.jsxs("span",{children:[y.done," of ",y.total," done"]}),O.jsxs("span",{children:[h,"%"]})]})]}),i[4]=h,i[5]=y,i[6]=A):A=i[6];let r;i[7]!==m.values?(r=m.values.length>0&&O.jsx("dl",{className:"grid grid-cols-1 gap-x-5 sm:grid-cols-2",children:m.values.map(vi)}),i[7]=m.values,i[8]=r):r=i[8];let f;return i[9]!==s||i[10]!==c||i[11]!==A||i[12]!==r?(f=O.jsxs(ui,{label:s,children:[c,A,r]}),i[9]=s,i[10]=c,i[11]=A,i[12]=r,i[13]=f):f=i[13],f}function vi(t){return O.jsxs("div",{className:"flex justify-between gap-3 border-t border-border/70 py-1.5 text-[12.5px]",children:[O.jsx("dt",{className:xe("text-muted-foreground",t.tone&&Hn[t.tone]),children:t.label}),O.jsx("dd",{className:xe("text-right tabular-nums",t.tone&&Hn[t.tone]),children:t.value})]},t.label)}const Ri={done:{mark:O.jsx(Un,{className:"size-2.5"}),ring:"border-success text-success",text:"text-muted-foreground line-through decoration-muted-foreground/50",label:"Done"},doing:{mark:null,ring:"border-success bg-success/25",text:"",label:"In progress"},blocked:{mark:O.jsx(hi,{className:"size-2.5"}),ring:"border-warning text-warning",text:"text-warning",label:"Blocked"},skipped:{mark:null,ring:"border-dashed border-muted-foreground/60",text:"text-muted-foreground line-through",label:"Skipped"},todo:{mark:null,ring:"border-muted-foreground/60",text:"",label:"To do"}};function Mi(t){const i=qe.c(18),{block:m}=t;let y;i[0]!==m.items?(y=m.items.filter(Fi),i[0]=m.items,i[1]=y):y=i[1];const p=y.length,h=m.title??"Checklist";let s;i[2]!==m.title?(s=m.title&&O.jsx("h4",{className:"text-[13.5px] font-medium",children:m.title}),i[2]=m.title,i[3]=s):s=i[3];let c;i[4]!==m.items.length||i[5]!==p?(c=O.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[p," of ",m.items.length]}),i[4]=m.items.length,i[5]=p,i[6]=c):c=i[6];let A;i[7]!==s||i[8]!==c?(A=O.jsxs("div",{className:"mb-1.5 flex items-baseline gap-2",children:[s,c]}),i[7]=s,i[8]=c,i[9]=A):A=i[9];let r;i[10]!==m.items?(r=m.items.map(ji),i[10]=m.items,i[11]=r):r=i[11];let f;i[12]!==r?(f=O.jsx("ul",{className:"flex flex-col",children:r}),i[12]=r,i[13]=f):f=i[13];let C;return i[14]!==h||i[15]!==A||i[16]!==f?(C=O.jsxs(ui,{label:h,children:[A,f]}),i[14]=h,i[15]=A,i[16]=f,i[17]=C):C=i[17],C}function ji(t,i){const m=Ri[t.state];return O.jsxs("li",{className:"flex items-center gap-2.5 py-1 text-[13px]",children:[O.jsx("span",{className:xe("grid size-3.5 shrink-0 place-items-center rounded-full border-[1.5px]",m.ring),"aria-label":m.label,role:"img",children:m.mark}),O.jsx("span",{className:xe("min-w-0 flex-1",m.text),children:t.text}),t.note&&O.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:t.note})]},`${i}:${t.text}`)}function Fi(t){return t.state==="done"}function qi(t){let i=5381;for(let m=0;m<t.length;m++)i=(i<<5)+i+t.charCodeAt(m)|0;return(i>>>0).toString(36)}function Di({block:t,source:i,occurrence:m}){var pe;const y=si(),p=fi(),h=ge.useContext(ai),s=((pe=y==null?void 0:y.session)==null?void 0:pe.sessionId)??"none",[c,A]=pi(di(`cogpit-decisions:${s}:${qi(`${(h==null?void 0:h.messageKey)??""}
34
34
  ${m}
35
- ${i}`)}`),{answers:{},sentAt:null}),r=c??{answers:{},sentAt:null},[f,C]=ge.useState(0),[L,R]=ge.useState(new Set),[V,F]=ge.useState(!1),H=ge.useRef(!1),[X,U]=ge.useState(null),D=!!p&&(y==null?void 0:y.permissions.send)!==!1&&r.sentAt===null&&!V,q=t.decisions.filter(_=>r.answers[_.id]).length,z=(_,P)=>{if(!D||H.current)return;A({...r,answers:{...r.answers,[_]:P}}),R(j=>{const B=new Set(j);return B.delete(_),B});const $=t.decisions.findIndex((j,B)=>B>f&&!r.answers[j.id]&&j.id!==_);$>=0&&C($)},se=async()=>{if(!p||!D||q===0||H.current)return;H.current=!0,F(!0),U(null);const _=await p.chat.sendMessage(Li(t.decisions,r.answers)).catch(()=>!1);H.current=!1,F(!1),_?A({...r,sentAt:Date.now()}):U("Couldn't send the answers. Try again from the composer if this keeps happening.")},fe=_=>P=>{P.stopPropagation(),_()},ae=_=>{const P=t.decisions[f];P&&((_.metaKey||_.ctrlKey)&&_.key==="Enter"?(_.preventDefault(),se()):_.key==="ArrowDown"||_.key==="ArrowUp"?(_.preventDefault(),C($=>Math.max(0,Math.min(t.decisions.length-1,$+(_.key==="ArrowDown"?1:-1))))):_.key==="Enter"&&P.recommended&&_.target===_.currentTarget?(_.preventDefault(),z(P.id,P.recommended)):/^[1-9]$/.test(_.key)&&P.options[Number(_.key)-1]&&(_.preventDefault(),z(P.id,P.options[Number(_.key)-1])))},ne=t.title??`${t.decisions.length} ${t.decisions.length===1?"decision":"decisions"}`;return O.jsxs("section",{"aria-label":ne,"data-cogpit-block":!0,tabIndex:0,onKeyDown:ae,className:"my-3 rounded-lg border border-border bg-card p-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[O.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline gap-x-2.5",children:[O.jsx("h4",{className:"text-[13.5px] font-medium",children:ne}),O.jsx("span",{className:"text-xs text-muted-foreground",children:r.sentAt?"Sent":"Answer in any order; your answers go back as one message."})]}),O.jsx("ol",{className:"flex flex-col",children:t.decisions.map((_,P)=>{const $=r.answers[_.id],j=!$||L.has(_.id);return O.jsxs("li",{"data-decision":_.id,onClick:()=>C(P),className:xe("grid grid-cols-[18px_minmax(0,1fr)] gap-x-2.5 gap-y-1 border-t border-border/70 py-2.5 first:border-t-0",P===f&&D&&"rounded-md bg-accent/40"),children:[O.jsx("span",{className:"pt-px text-right text-[11px] tabular-nums text-muted-foreground/80",children:P+1}),O.jsx("span",{className:xe("text-[13px]",j?"font-medium":"text-muted-foreground"),children:_.question}),_.detail&&j&&O.jsx("span",{className:"col-start-2 text-xs text-muted-foreground",children:_.detail}),j?O.jsx("span",{className:"col-start-2 mt-1 flex flex-wrap items-center gap-1.5",children:_.options.map((B,k)=>O.jsxs(Ke,{type:"button",size:"xs",variant:$===B?"default":"outline","aria-pressed":$===B,"aria-keyshortcuts":k<9?String(k+1):void 0,disabled:!D,onClick:fe(()=>z(_.id,B)),children:[B,B===_.recommended&&O.jsx("span",{className:"font-normal opacity-60",children:"recommended"})]},B))}):O.jsxs("span",{className:"col-start-2 flex items-center gap-2 text-[12.5px] text-success",children:[O.jsx(Un,{className:"size-3.5","aria-hidden":"true"}),$,D&&O.jsx(Ke,{type:"button",variant:"ghost",size:"xs",className:"text-muted-foreground",onClick:fe(()=>{R(B=>new Set(B).add(_.id)),C(P)}),children:"Change"})]})]},_.id)})}),X&&O.jsx("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:X}),r.sentAt===null&&O.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 border-t border-border/70 pt-2.5 text-xs text-muted-foreground",children:[O.jsxs("span",{className:"tabular-nums",children:[q," of ",t.decisions.length," answered"]}),O.jsx("span",{className:"flex-1"}),D&&O.jsx("span",{className:"hidden sm:inline",children:"1–9 picks · Enter takes the recommended · ⌘Enter sends"}),O.jsx(Ke,{type:"button",size:"xs",disabled:!D||q===0||V,onClick:()=>void se(),children:q===t.decisions.length?"Send answers":`Send ${q} ${q===1?"answer":"answers"}`})]})]})}export{ir as default};
35
+ ${i}`)}`),{answers:{},sentAt:null}),r=c??{answers:{},sentAt:null},[f,C]=ge.useState(0),[L,M]=ge.useState(new Set),[V,F]=ge.useState(!1),H=ge.useRef(!1),[X,U]=ge.useState(null),D=!!p&&(y==null?void 0:y.permissions.send)!==!1&&r.sentAt===null&&!V,q=t.decisions.filter(_=>r.answers[_.id]).length,z=(_,P)=>{if(!D||H.current)return;A({...r,answers:{...r.answers,[_]:P}}),M(j=>{const B=new Set(j);return B.delete(_),B});const $=t.decisions.findIndex((j,B)=>B>f&&!r.answers[j.id]&&j.id!==_);$>=0&&C($)},se=async()=>{if(!p||!D||q===0||H.current)return;H.current=!0,F(!0),U(null);const _=await p.chat.sendMessage(Li(t.decisions,r.answers)).catch(()=>!1);H.current=!1,F(!1),_?A({...r,sentAt:Date.now()}):U("Couldn't send the answers. Try again from the composer if this keeps happening.")},fe=_=>P=>{P.stopPropagation(),_()},ae=_=>{const P=t.decisions[f];P&&((_.metaKey||_.ctrlKey)&&_.key==="Enter"?(_.preventDefault(),se()):_.key==="ArrowDown"||_.key==="ArrowUp"?(_.preventDefault(),C($=>Math.max(0,Math.min(t.decisions.length-1,$+(_.key==="ArrowDown"?1:-1))))):_.key==="Enter"&&P.recommended&&_.target===_.currentTarget?(_.preventDefault(),z(P.id,P.recommended)):/^[1-9]$/.test(_.key)&&P.options[Number(_.key)-1]&&(_.preventDefault(),z(P.id,P.options[Number(_.key)-1])))},ne=t.title??`${t.decisions.length} ${t.decisions.length===1?"decision":"decisions"}`;return O.jsxs("section",{"aria-label":ne,"data-cogpit-block":!0,tabIndex:0,onKeyDown:ae,className:"my-3 rounded-lg border border-border bg-card p-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[O.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline gap-x-2.5",children:[O.jsx("h4",{className:"text-[13.5px] font-medium",children:ne}),O.jsx("span",{className:"text-xs text-muted-foreground",children:r.sentAt?"Sent":"Answer in any order; your answers go back as one message."})]}),O.jsx("ol",{className:"flex flex-col",children:t.decisions.map((_,P)=>{const $=r.answers[_.id],j=!$||L.has(_.id);return O.jsxs("li",{"data-decision":_.id,onClick:()=>C(P),className:xe("grid grid-cols-[18px_minmax(0,1fr)] gap-x-2.5 gap-y-1 border-t border-border/70 py-2.5 first:border-t-0",P===f&&D&&"rounded-md bg-accent/40"),children:[O.jsx("span",{className:"pt-px text-right text-[11px] tabular-nums text-muted-foreground/80",children:P+1}),O.jsx("span",{className:xe("text-[13px]",j?"font-medium":"text-muted-foreground"),children:_.question}),_.detail&&j&&O.jsx("span",{className:"col-start-2 text-xs text-muted-foreground",children:_.detail}),j?O.jsx("span",{className:"col-start-2 mt-1 flex flex-wrap items-center gap-1.5",children:_.options.map((B,k)=>O.jsxs(Ke,{type:"button",size:"xs",variant:$===B?"default":"outline","aria-pressed":$===B,"aria-keyshortcuts":k<9?String(k+1):void 0,disabled:!D,onClick:fe(()=>z(_.id,B)),children:[B,B===_.recommended&&O.jsx("span",{className:"font-normal opacity-60",children:"recommended"})]},B))}):O.jsxs("span",{className:"col-start-2 flex items-center gap-2 text-[12.5px] text-success",children:[O.jsx(Un,{className:"size-3.5","aria-hidden":"true"}),$,D&&O.jsx(Ke,{type:"button",variant:"ghost",size:"xs",className:"text-muted-foreground",onClick:fe(()=>{M(B=>new Set(B).add(_.id)),C(P)}),children:"Change"})]})]},_.id)})}),X&&O.jsx("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:X}),r.sentAt===null&&O.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 border-t border-border/70 pt-2.5 text-xs text-muted-foreground",children:[O.jsxs("span",{className:"tabular-nums",children:[q," of ",t.decisions.length," answered"]}),O.jsx("span",{className:"flex-1"}),D&&O.jsx("span",{className:"hidden sm:inline",children:"1–9 picks · Enter takes the recommended · ⌘Enter sends"}),O.jsx(Ke,{type:"button",size:"xs",disabled:!D||q===0||V,onClick:()=>void se(),children:q===t.decisions.length?"Send answers":`Send ${q} ${q===1?"answer":"answers"}`})]})]})}export{ir as default};
@@ -1 +1 @@
1
- import{c as ie,j as u,r as M}from"./vendor-react-gGw_S5I_.js";import{bb as h,bc as Z,x as ue,bd as he,be as ge,bf as fe,bg as ve,bh as we,bi as be,bj as Ce,bk as Se,W as je,bl as ye,bm as xe,aH as ee,aY as p,bn as Pe,a$ as Te,bo as Oe,bp as ke,bq as Ne,br as Fe,bs as $e,F as Ee}from"./index-BvNyEUVG.js";import{bi as Ie,dc as Re,bU as te,ak as Ae,cR as De,cN as Le,bn as He,cm as Me,b7 as ne,a7 as Be,c1 as qe,aB as Ge,cF as Ke,cx as Ue,dd as We,cu as ze,bQ as _e,c7 as ae,de as pe,cz as Ve,cS as Qe,df as Xe,dg as Ye,aH as Je,a3 as Ze,aV as oe,cp as et,c2 as tt,aa as nt}from"./vendor-ui-keo4oB2X.js";import"./vendor-markdown-BEJ8yVzA.js";function a(t,e,s,c,l,m,d){return{id:t,label:e,icon:c,run:l,shortcut:m,description:d,value:`${e} ${s}`}}function V(...t){return t.filter(e=>e!==!1&&e!==void 0)}function at(t){const e=ie.c(40);let s,c,l,m,d,w,b,r,C,g,j,f,y,N,x;if(e[0]!==t){const I=V(a("home","Go to Mission Control","home overview dashboard",Le,t.onGoHome),a("mission-control",t.showMission?"Exit Mission Control":"Open Mission Control","live sessions blocked waiting answer everything at once",De,t.onToggleMissionControl,h("missionControl")),...(t.extraActions??[]).map(ot),a("new-session","Start a new session","project agent chat create",Ie,t.onNewSession,h("newSession")),t.onDuplicateSession&&a("duplicate-session","Duplicate this session","copy fork clone branch thread",Re,t.onDuplicateSession),t.canFocusComposer&&a("focus-composer","Focus message composer","chat prompt input",te,t.onFocusComposer,h("focusComposer")),t.onFindInConversation&&a("find-in-conversation","Find in conversation","search text transcript turns matches",Ae,t.onFindInConversation,h("findInConversation"))),F=(t.projects??[]).slice(0,8).map(n=>a(`project-${n.dirName}`,n.shortName,`${n.path} ${n.dirName} project workspace`,He,()=>{var i;return(i=t.onOpenProject)==null?void 0:i.call(t,n.dirName)},void 0,`${n.path} · ${n.sessionCount} session${n.sessionCount===1?"":"s"}`)),$=(t.recentSessions??[]).slice(0,10).map(n=>{const v=(n.aiTitle||n.name||n.slug||n.lastUserMessage||n.firstUserMessage||n.sessionId).replace(/\s+/g," ").trim().slice(0,160)||n.sessionId,L=[n.projectShortName,n.gitBranch].filter(Boolean).join(" · ");return a(`session-${n.dirName}-${n.fileName}`,v,`${n.projectShortName} ${n.cwd??""} ${n.gitBranch??""} ${n.sessionId} recent thread conversation`,te,()=>{var q;return(q=t.onOpenSession)==null?void 0:q.call(t,n.dirName,n.fileName)},void 0,L)}),R=t.devices??[],E=R.length>1&&t.onSwitchDevice?R.slice(0,Z.length).map((n,i)=>a(`device-${n.id}`,n.isActive?`${n.name} (current)`:`Switch to ${n.name}`,`device machine host remote ${n.id}`,n.isLocal?Me:ne,()=>{var v;return(v=t.onSwitchDevice)==null?void 0:v.call(t,n.id)},h(Z[i]))):[],o=V(a("toggle-sidebar",t.showSidebar?"Hide session sidebar":"Show session sidebar","projects navigation panel",We,t.onToggleSidebar,h("toggleSidebar")),t.hasSession&&a("toggle-stats",t.showStats?"Hide session details":"Show session details","stats tokens usage panel",Ue,t.onToggleStats,h("toggleStats")),t.onToggleProjectFiles&&a("project-files",t.showProjectFiles?"Close project files":"Open project files","browse edit save workspace source code",Ke,t.onToggleProjectFiles,h("projectFiles")),t.onToggleBrowser&&a("toggle-browser",t.showBrowser?"Hide browser":"Show browser","web page live view browse panel",Ge,t.onToggleBrowser),t.hasFileChanges&&a("toggle-file-changes",t.showFileChanges?"Hide file changes":"Show file changes","diff edits review panel",qe,t.onToggleFileChanges),t.supportsWorktrees&&t.canOpenTerminal&&a("toggle-worktrees",t.showWorktrees?"Hide worktrees":"Show worktrees","git branches panel",Be,t.onToggleWorktrees)),A=V(t.onOpenProjectInEditor&&a("open-project-editor","Open project in editor","code cursor vscode zed workspace",tt,t.onOpenProjectInEditor),t.onRevealProject&&a("reveal-project","Reveal project in file manager","finder explorer folder directory",et,t.onRevealProject),t.onCopyResumeCommand&&a("copy-resume-command","Copy resume command","cli claude codex copilot terminal clipboard continue session",oe,t.onCopyResumeCommand),t.onCopyProjectPath&&a("copy-project-path","Copy project path","workspace directory clipboard",oe,t.onCopyProjectPath),t.onOpenIntegratedTerminal&&a("integrated-terminal","New integrated terminal","embedded shell command line process panel",Ze,t.onOpenIntegratedTerminal,h("newIntegratedTerminal")),t.canOpenTerminal&&a("terminal","Open in system terminal","external shell command line app",Je,t.onOpenTerminal,h("systemTerminal")),t.onTogglePreview&&a("preview","Toggle development preview","browser localhost dev server website",Ye,t.onTogglePreview,h("preview")),t.onOpenKeyboardShortcuts&&a("keyboard-shortcuts","Customize keyboard shortcuts","keybindings hotkeys settings",Xe,t.onOpenKeyboardShortcuts),t.onOpenConfig&&a("config",t.showConfig?"Close agent configuration":"Open agent configuration","skills commands claude settings files",Qe,t.onOpenConfig),a("settings","Open Cogpit settings","preferences network",Ve,t.onOpenSettings),a("theme","Change theme & chat width","appearance light dark oled width narrow wide",pe,t.onOpenTheme,h("themeSelector")),a("expand","Expand all groups","conversation details",ae,t.onExpandAll,h("expandAll")),a("expand-payloads","Expand all tool payloads","raw input result diff conversation details",ae,t.onExpandToolPayloads,h("expandToolPayloads")),a("collapse","Collapse all","conversation groups payloads details",_e,t.onCollapseAll),t.onKillAll&&a("kill-all","Kill all agent processes","stop terminate halt everything runaway",ze,t.onKillAll),t.onOpenDevices&&a("manage-devices","Manage devices…","remote machines hub hosts edit rename remove switch",nt,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"manage")}),t.onOpenDevices&&a("add-device","Add device…","remote machine hub host connect pair new",ne,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"add")})),k=[{value:"Navigation",items:I},...$.length>0?[{value:"Recent sessions",items:$}]:[],...F.length>0?[{value:"Projects",items:F}]:[],...E.length>0?[{value:"Devices",items:E}]:[],{value:"View",items:o},{value:"Tools",items:A}],D=function(i){t.onOpenChange(!1),i.run()};l=ve,y=t.open,N=t.onOpenChange,x="Command palette",w="Search for a Cogpit action to run.",b="max-w-xl",c=we,C="Search commands",g=!0,e[16]===Symbol.for("react.memo_cache_sentinel")?(j=u.jsx(be,{"aria-label":"Search commands",autoFocus:!0,placeholder:"Search commands..."}),e[16]=j):j=e[16],e[17]!==t.loadingNavigation?(f=t.loadingNavigation&&u.jsxs("div",{className:"motion-enter flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground",role:"status",children:[u.jsx(ue,{className:"size-3.5"}),"Loading projects and sessions..."]}),e[17]=t.loadingNavigation,e[18]=f):f=e[18],s=Ce,m="max-h-[min(26rem,60vh)]",e[19]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Se,{children:"No matching actions."}),e[19]=d):d=e[19],r=k.map(n=>u.jsx(he,{heading:n.value,children:n.items.map(i=>{const v=i.icon;return u.jsxs(ge,{value:i.value,onSelect:()=>D(i),children:[u.jsx(v,{"aria-hidden":"true"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate",children:i.label}),i.description&&u.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.description})]}),i.shortcut&&u.jsx(fe,{children:i.shortcut})]},i.id)})},n.value)),e[0]=t,e[1]=s,e[2]=c,e[3]=l,e[4]=m,e[5]=d,e[6]=w,e[7]=b,e[8]=r,e[9]=C,e[10]=g,e[11]=j,e[12]=f,e[13]=y,e[14]=N,e[15]=x}else s=e[1],c=e[2],l=e[3],m=e[4],d=e[5],w=e[6],b=e[7],r=e[8],C=e[9],g=e[10],j=e[11],f=e[12],y=e[13],N=e[14],x=e[15];let P;e[20]!==s||e[21]!==m||e[22]!==d||e[23]!==r?(P=u.jsxs(s,{className:m,children:[d,r]}),e[20]=s,e[21]=m,e[22]=d,e[23]=r,e[24]=P):P=e[24];let T;e[25]!==c||e[26]!==P||e[27]!==C||e[28]!==g||e[29]!==j||e[30]!==f?(T=u.jsxs(c,{label:C,loop:g,children:[j,f,P]}),e[25]=c,e[26]=P,e[27]=C,e[28]=g,e[29]=j,e[30]=f,e[31]=T):T=e[31];let O;return e[32]!==l||e[33]!==w||e[34]!==b||e[35]!==T||e[36]!==y||e[37]!==N||e[38]!==x?(O=u.jsx(l,{open:y,onOpenChange:N,title:x,description:w,className:b,children:T}),e[32]=l,e[33]=w,e[34]=b,e[35]=T,e[36]=y,e[37]=N,e[38]=x,e[39]=O):O=e[39],O}function ot(t){return a(t.id,t.label,t.keywords,t.icon,t.onSelect)}async function se(t,e){const s=await Ee(t,{signal:e});if(!s.ok)throw new Error(`Request failed (${s.status})`);const c=await s.json();return Array.isArray(c)?c:[]}function rt(t){var Q;const e=ie.c(51);let s,c,l,m,d,w;e[0]!==t?({open:l,currentProjectDirName:s,projectCwd:d,onProcessStarted:c,launchTerminalRequest:w,...m}=t,e[0]=t,e[1]=s,e[2]=c,e[3]=l,e[4]=m,e[5]=d,e[6]=w):(s=e[1],c=e[2],l=e[3],m=e[4],d=e[5],w=e[6]);const b=w===void 0?0:w,r=je();let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=[],e[7]=C):C=e[7];const[g,j]=M.useState(C);let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[8]=f):f=e[8];const[y,N]=M.useState(f),[x,P]=M.useState(!1),T=M.useRef(0),O=ye();let I,F;e[9]!==O||e[10]!==l?(I=()=>{if(!l)return;const S=new AbortController,B=Te();return P(!0),Promise.allSettled([se("/api/projects",S.signal),se(Oe({limit:"12",perProject:"3"},O),S.signal)]).then(me=>{const[X,Y]=me;if(S.signal.aborted)return;const J=Y.status==="fulfilled"?Y.value:[];ke(J,B),j(X.status==="fulfilled"?X.value:[]),N(J),P(!1)}),()=>S.abort()},F=[l,O],e[9]=O,e[10]=l,e[11]=I,e[12]=F):(I=e[11],F=e[12]),M.useEffect(I,F);let $;e[13]!==g?($=xe(g),e[13]=g,e[14]=$):$=e[14];const R=$;let E;e:{if(d){E=d;break e}if(!s){E=null;break e}let S;e[15]!==s||e[16]!==g?(S=((Q=g.find(B=>B.dirName===s))==null?void 0:Q.path)??null,e[15]=s,e[16]=g,e[17]=S):S=e[17],E=S}const o=E;let A;e[18]!==c||e[19]!==r||e[20]!==o?(A=()=>{if(!o)return;const S=r.spawnTerminal({cwd:o}),B=o.replace(/\/+$/,"").split("/").at(-1)||"Terminal";c({id:S,name:B,type:"terminal",status:"running",source:o})},e[18]=c,e[19]=r,e[20]=o,e[21]=A):A=e[21];const k=A;let D,n;e[22]!==k||e[23]!==b||e[24]!==r.status||e[25]!==o?(n=()=>{b<=T.current||!o||r.status!=="connected"||(T.current=b,k())},D=[k,b,r.status,o],e[22]=k,e[23]=b,e[24]=r.status,e[25]=o,e[26]=D,e[27]=n):(D=e[26],n=e[27]),M.useEffect(n,D);let i;e[28]!==s||e[29]!==o?(i={path:o,dirName:s},e[28]=s,e[29]=o,e[30]=i):i=e[30];const v=i;let L;e[31]!==v?(L=()=>Ne(v),e[31]=v,e[32]=L):L=e[32];const q=L;let G;e[33]!==v?(G=()=>Fe(v),e[33]=v,e[34]=G):G=e[34];const le=G,ce=!ee()&&p("hostFiles"),re=p("hostFiles")&&(!ee()||Pe());let K;e[35]!==o?(K=()=>{o&&$e(o)},e[35]=o,e[36]=K):K=e[36];const de=K;let H;e[37]!==k||e[38]!==r.status||e[39]!==o?(H=o&&r.status==="connected"&&p("terminal")?k:void 0,e[37]=k,e[38]=r.status,e[39]=o,e[40]=H):H=e[40];const W=o&&re?q:void 0,z=o&&ce?le:void 0,_=o?de:void 0;let U;return e[41]!==x||e[42]!==l||e[43]!==m||e[44]!==y||e[45]!==R||e[46]!==H||e[47]!==W||e[48]!==z||e[49]!==_?(U=u.jsx(at,{...m,open:l,projects:R,recentSessions:y,loadingNavigation:x,onOpenIntegratedTerminal:H,onOpenProjectInEditor:W,onRevealProject:z,onCopyProjectPath:_}),e[41]=x,e[42]=l,e[43]=m,e[44]=y,e[45]=R,e[46]=H,e[47]=W,e[48]=z,e[49]=_,e[50]=U):U=e[50],U}export{rt as CommandPaletteHost};
1
+ import{c as ie,j as u,r as M}from"./vendor-react-gGw_S5I_.js";import{bb as h,bc as Z,x as ue,bd as he,be as ge,bf as fe,bg as ve,bh as we,bi as be,bj as Ce,bk as Se,W as je,bl as ye,bm as xe,aH as ee,aY as p,bn as Te,a$ as Pe,bo as Oe,bp as ke,bq as Ne,br as Fe,bs as $e,F as Ee}from"./index-BVmNox_3.js";import{bg as Ie,dc as Re,bS as te,ak as Ae,cR as De,cN as Le,bl as He,ck as Me,b5 as ne,a7 as Be,b$ as qe,aB as Ge,cE as Ke,cw as We,dd as Ue,ct as ze,bO as _e,c5 as ae,de as pe,cy as Ve,cS as Xe,df as Ye,dg as Je,aF as Qe,a3 as Ze,aT as oe,cn as et,c0 as tt,aa as nt}from"./vendor-ui-CKjyvB3_.js";import"./vendor-markdown-BEJ8yVzA.js";function a(t,e,s,c,l,m,d){return{id:t,label:e,icon:c,run:l,shortcut:m,description:d,value:`${e} ${s}`}}function V(...t){return t.filter(e=>e!==!1&&e!==void 0)}function at(t){const e=ie.c(40);let s,c,l,m,d,w,b,r,C,g,j,f,y,N,x;if(e[0]!==t){const I=V(a("home","Go to Mission Control","home overview dashboard",Le,t.onGoHome),a("mission-control",t.showMission?"Exit Mission Control":"Open Mission Control","live sessions blocked waiting answer everything at once",De,t.onToggleMissionControl,h("missionControl")),...(t.extraActions??[]).map(ot),a("new-session","Start a new session","project agent chat create",Ie,t.onNewSession,h("newSession")),t.onDuplicateSession&&a("duplicate-session","Duplicate this session","copy fork clone branch thread",Re,t.onDuplicateSession),t.canFocusComposer&&a("focus-composer","Focus message composer","chat prompt input",te,t.onFocusComposer,h("focusComposer")),t.onFindInConversation&&a("find-in-conversation","Find in conversation","search text transcript turns matches",Ae,t.onFindInConversation,h("findInConversation"))),F=(t.projects??[]).slice(0,8).map(n=>a(`project-${n.dirName}`,n.shortName,`${n.path} ${n.dirName} project workspace`,He,()=>{var i;return(i=t.onOpenProject)==null?void 0:i.call(t,n.dirName)},void 0,`${n.path} · ${n.sessionCount} session${n.sessionCount===1?"":"s"}`)),$=(t.recentSessions??[]).slice(0,10).map(n=>{const v=(n.aiTitle||n.name||n.slug||n.lastUserMessage||n.firstUserMessage||n.sessionId).replace(/\s+/g," ").trim().slice(0,160)||n.sessionId,L=[n.projectShortName,n.gitBranch].filter(Boolean).join(" · ");return a(`session-${n.dirName}-${n.fileName}`,v,`${n.projectShortName} ${n.cwd??""} ${n.gitBranch??""} ${n.sessionId} recent thread conversation`,te,()=>{var q;return(q=t.onOpenSession)==null?void 0:q.call(t,n.dirName,n.fileName)},void 0,L)}),R=t.devices??[],E=R.length>1&&t.onSwitchDevice?R.slice(0,Z.length).map((n,i)=>a(`device-${n.id}`,n.isActive?`${n.name} (current)`:`Switch to ${n.name}`,`device machine host remote ${n.id}`,n.isLocal?Me:ne,()=>{var v;return(v=t.onSwitchDevice)==null?void 0:v.call(t,n.id)},h(Z[i]))):[],o=V(a("toggle-sidebar",t.showSidebar?"Hide session sidebar":"Show session sidebar","projects navigation panel",Ue,t.onToggleSidebar,h("toggleSidebar")),t.hasSession&&a("toggle-stats",t.showStats?"Hide session details":"Show session details","stats tokens usage panel",We,t.onToggleStats,h("toggleStats")),t.onToggleProjectFiles&&a("project-files",t.showProjectFiles?"Close project files":"Open project files","browse edit save workspace source code",Ke,t.onToggleProjectFiles,h("projectFiles")),t.onToggleBrowser&&a("toggle-browser",t.showBrowser?"Hide browser":"Show browser","web page live view browse panel",Ge,t.onToggleBrowser),t.hasFileChanges&&a("toggle-file-changes",t.showFileChanges?"Hide file changes":"Show file changes","diff edits review panel",qe,t.onToggleFileChanges),t.supportsWorktrees&&t.canOpenTerminal&&a("toggle-worktrees",t.showWorktrees?"Hide worktrees":"Show worktrees","git branches panel",Be,t.onToggleWorktrees)),A=V(t.onOpenProjectInEditor&&a("open-project-editor","Open project in editor","code cursor vscode zed workspace",tt,t.onOpenProjectInEditor),t.onRevealProject&&a("reveal-project","Reveal project in file manager","finder explorer folder directory",et,t.onRevealProject),t.onCopyResumeCommand&&a("copy-resume-command","Copy resume command","cli claude codex copilot terminal clipboard continue session",oe,t.onCopyResumeCommand),t.onCopyProjectPath&&a("copy-project-path","Copy project path","workspace directory clipboard",oe,t.onCopyProjectPath),t.onOpenIntegratedTerminal&&a("integrated-terminal","New integrated terminal","embedded shell command line process panel",Ze,t.onOpenIntegratedTerminal,h("newIntegratedTerminal")),t.canOpenTerminal&&a("terminal","Open in system terminal","external shell command line app",Qe,t.onOpenTerminal,h("systemTerminal")),t.onTogglePreview&&a("preview","Toggle development preview","browser localhost dev server website",Je,t.onTogglePreview,h("preview")),t.onOpenKeyboardShortcuts&&a("keyboard-shortcuts","Customize keyboard shortcuts","keybindings hotkeys settings",Ye,t.onOpenKeyboardShortcuts),t.onOpenConfig&&a("config",t.showConfig?"Close agent configuration":"Open agent configuration","skills commands claude settings files",Xe,t.onOpenConfig),a("settings","Open Cogpit settings","preferences network",Ve,t.onOpenSettings),a("theme","Change theme & chat width","appearance light dark oled width narrow wide",pe,t.onOpenTheme,h("themeSelector")),a("expand","Expand all groups","conversation details",ae,t.onExpandAll,h("expandAll")),a("expand-payloads","Expand all tool payloads","raw input result diff conversation details",ae,t.onExpandToolPayloads,h("expandToolPayloads")),a("collapse","Collapse all","conversation groups payloads details",_e,t.onCollapseAll),t.onKillAll&&a("kill-all","Kill all agent processes","stop terminate halt everything runaway",ze,t.onKillAll),t.onOpenDevices&&a("manage-devices","Manage devices…","remote machines hub hosts edit rename remove switch",nt,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"manage")}),t.onOpenDevices&&a("add-device","Add device…","remote machine hub host connect pair new",ne,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"add")})),k=[{value:"Navigation",items:I},...$.length>0?[{value:"Recent sessions",items:$}]:[],...F.length>0?[{value:"Projects",items:F}]:[],...E.length>0?[{value:"Devices",items:E}]:[],{value:"View",items:o},{value:"Tools",items:A}],D=function(i){t.onOpenChange(!1),i.run()};l=ve,y=t.open,N=t.onOpenChange,x="Command palette",w="Search for a Cogpit action to run.",b="max-w-xl",c=we,C="Search commands",g=!0,e[16]===Symbol.for("react.memo_cache_sentinel")?(j=u.jsx(be,{"aria-label":"Search commands",autoFocus:!0,placeholder:"Search commands..."}),e[16]=j):j=e[16],e[17]!==t.loadingNavigation?(f=t.loadingNavigation&&u.jsxs("div",{className:"motion-enter flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground",role:"status",children:[u.jsx(ue,{className:"size-3.5"}),"Loading projects and sessions..."]}),e[17]=t.loadingNavigation,e[18]=f):f=e[18],s=Ce,m="max-h-[min(26rem,60vh)]",e[19]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(Se,{children:"No matching actions."}),e[19]=d):d=e[19],r=k.map(n=>u.jsx(he,{heading:n.value,children:n.items.map(i=>{const v=i.icon;return u.jsxs(ge,{value:i.value,onSelect:()=>D(i),children:[u.jsx(v,{"aria-hidden":"true"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate",children:i.label}),i.description&&u.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.description})]}),i.shortcut&&u.jsx(fe,{children:i.shortcut})]},i.id)})},n.value)),e[0]=t,e[1]=s,e[2]=c,e[3]=l,e[4]=m,e[5]=d,e[6]=w,e[7]=b,e[8]=r,e[9]=C,e[10]=g,e[11]=j,e[12]=f,e[13]=y,e[14]=N,e[15]=x}else s=e[1],c=e[2],l=e[3],m=e[4],d=e[5],w=e[6],b=e[7],r=e[8],C=e[9],g=e[10],j=e[11],f=e[12],y=e[13],N=e[14],x=e[15];let T;e[20]!==s||e[21]!==m||e[22]!==d||e[23]!==r?(T=u.jsxs(s,{className:m,children:[d,r]}),e[20]=s,e[21]=m,e[22]=d,e[23]=r,e[24]=T):T=e[24];let P;e[25]!==c||e[26]!==T||e[27]!==C||e[28]!==g||e[29]!==j||e[30]!==f?(P=u.jsxs(c,{label:C,loop:g,children:[j,f,T]}),e[25]=c,e[26]=T,e[27]=C,e[28]=g,e[29]=j,e[30]=f,e[31]=P):P=e[31];let O;return e[32]!==l||e[33]!==w||e[34]!==b||e[35]!==P||e[36]!==y||e[37]!==N||e[38]!==x?(O=u.jsx(l,{open:y,onOpenChange:N,title:x,description:w,className:b,children:P}),e[32]=l,e[33]=w,e[34]=b,e[35]=P,e[36]=y,e[37]=N,e[38]=x,e[39]=O):O=e[39],O}function ot(t){return a(t.id,t.label,t.keywords,t.icon,t.onSelect)}async function se(t,e){const s=await Ee(t,{signal:e});if(!s.ok)throw new Error(`Request failed (${s.status})`);const c=await s.json();return Array.isArray(c)?c:[]}function rt(t){var X;const e=ie.c(51);let s,c,l,m,d,w;e[0]!==t?({open:l,currentProjectDirName:s,projectCwd:d,onProcessStarted:c,launchTerminalRequest:w,...m}=t,e[0]=t,e[1]=s,e[2]=c,e[3]=l,e[4]=m,e[5]=d,e[6]=w):(s=e[1],c=e[2],l=e[3],m=e[4],d=e[5],w=e[6]);const b=w===void 0?0:w,r=je();let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=[],e[7]=C):C=e[7];const[g,j]=M.useState(C);let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[8]=f):f=e[8];const[y,N]=M.useState(f),[x,T]=M.useState(!1),P=M.useRef(0),O=ye();let I,F;e[9]!==O||e[10]!==l?(I=()=>{if(!l)return;const S=new AbortController,B=Pe();return T(!0),Promise.allSettled([se("/api/projects",S.signal),se(Oe({limit:"12",perProject:"3"},O),S.signal)]).then(me=>{const[Y,J]=me;if(S.signal.aborted)return;const Q=J.status==="fulfilled"?J.value:[];ke(Q,B),j(Y.status==="fulfilled"?Y.value:[]),N(Q),T(!1)}),()=>S.abort()},F=[l,O],e[9]=O,e[10]=l,e[11]=I,e[12]=F):(I=e[11],F=e[12]),M.useEffect(I,F);let $;e[13]!==g?($=xe(g),e[13]=g,e[14]=$):$=e[14];const R=$;let E;e:{if(d){E=d;break e}if(!s){E=null;break e}let S;e[15]!==s||e[16]!==g?(S=((X=g.find(B=>B.dirName===s))==null?void 0:X.path)??null,e[15]=s,e[16]=g,e[17]=S):S=e[17],E=S}const o=E;let A;e[18]!==c||e[19]!==r||e[20]!==o?(A=()=>{if(!o)return;const S=r.spawnTerminal({cwd:o}),B=o.replace(/\/+$/,"").split("/").at(-1)||"Terminal";c({id:S,name:B,type:"terminal",status:"running",source:o})},e[18]=c,e[19]=r,e[20]=o,e[21]=A):A=e[21];const k=A;let D,n;e[22]!==k||e[23]!==b||e[24]!==r.status||e[25]!==o?(n=()=>{b<=P.current||!o||r.status!=="connected"||(P.current=b,k())},D=[k,b,r.status,o],e[22]=k,e[23]=b,e[24]=r.status,e[25]=o,e[26]=D,e[27]=n):(D=e[26],n=e[27]),M.useEffect(n,D);let i;e[28]!==s||e[29]!==o?(i={path:o,dirName:s},e[28]=s,e[29]=o,e[30]=i):i=e[30];const v=i;let L;e[31]!==v?(L=()=>Ne(v),e[31]=v,e[32]=L):L=e[32];const q=L;let G;e[33]!==v?(G=()=>Fe(v),e[33]=v,e[34]=G):G=e[34];const le=G,ce=!ee()&&p("hostFiles"),re=p("hostFiles")&&(!ee()||Te());let K;e[35]!==o?(K=()=>{o&&$e(o)},e[35]=o,e[36]=K):K=e[36];const de=K;let H;e[37]!==k||e[38]!==r.status||e[39]!==o?(H=o&&r.status==="connected"&&p("terminal")?k:void 0,e[37]=k,e[38]=r.status,e[39]=o,e[40]=H):H=e[40];const U=o&&re?q:void 0,z=o&&ce?le:void 0,_=o?de:void 0;let W;return e[41]!==x||e[42]!==l||e[43]!==m||e[44]!==y||e[45]!==R||e[46]!==H||e[47]!==U||e[48]!==z||e[49]!==_?(W=u.jsx(at,{...m,open:l,projects:R,recentSessions:y,loadingNavigation:x,onOpenIntegratedTerminal:H,onOpenProjectInEditor:U,onRevealProject:z,onCopyProjectPath:_}),e[41]=x,e[42]=l,e[43]=m,e[44]=y,e[45]=R,e[46]=H,e[47]=U,e[48]=z,e[49]=_,e[50]=W):W=e[50],W}export{rt as CommandPaletteHost};