@edspencer/paddock 0.74.1 → 0.74.2

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 (66) hide show
  1. package/package.json +1 -1
  2. package/packages/server/package.json +1 -1
  3. package/packages/web/dist/assets/DiscoverPage-Dtkk3A6j.js +2 -0
  4. package/packages/web/dist/assets/{DiscoverView-DRVLL5xS.js → DiscoverView-LAqnHF4r.js} +1 -1
  5. package/packages/web/dist/assets/{InstanceConfigPage-CIcvLQ6G.js → InstanceConfigPage-ebm3Ua9F.js} +1 -1
  6. package/packages/web/dist/assets/{MarkdownRenderer-XpIO-7ZB.js → MarkdownRenderer-CaioYX-m.js} +1 -1
  7. package/packages/web/dist/assets/{ProjectMenu-B2WgwthY.js → ProjectMenu-CD77oQB2.js} +1 -1
  8. package/packages/web/dist/assets/{ProjectRedirect-BOlalXQj.js → ProjectRedirect-EAHrDG-U.js} +1 -1
  9. package/packages/web/dist/assets/{ProjectView-BFqBZN4B.js → ProjectView-B6yCxYmu.js} +11 -11
  10. package/packages/web/dist/assets/{ProjectsGrid-CAfZxKyD.js → ProjectsGrid-CWxQwyDb.js} +1 -1
  11. package/packages/web/dist/assets/{RootHome-BjgcSYDC.js → RootHome-BAd1VQCG.js} +1 -1
  12. package/packages/web/dist/assets/{Surfaces-CFgCNuC1.js → Surfaces-CcrPbt9t.js} +1 -1
  13. package/packages/web/dist/assets/{arc-CYW5GwlQ.js → arc-CRjeT6NW.js} +1 -1
  14. package/packages/web/dist/assets/{architectureDiagram-3BPJPVTR-C-EjuJSG.js → architectureDiagram-3BPJPVTR-Bl8_Z2Ii.js} +1 -1
  15. package/packages/web/dist/assets/{blockDiagram-GPEHLZMM-CfU6rvzn.js → blockDiagram-GPEHLZMM-CjLYm5rP.js} +1 -1
  16. package/packages/web/dist/assets/{c4Diagram-AAUBKEIU-Cv8yYt3B.js → c4Diagram-AAUBKEIU-BD6huhil.js} +1 -1
  17. package/packages/web/dist/assets/channel-BqKZMUTG.js +2 -0
  18. package/packages/web/dist/assets/{chunk-2J33WTMH-DlQLV12H.js → chunk-2J33WTMH-BQdm3w56.js} +1 -1
  19. package/packages/web/dist/assets/{chunk-4BX2VUAB-COl2xBZj.js → chunk-4BX2VUAB-zMRjrIlg.js} +1 -1
  20. package/packages/web/dist/assets/{chunk-55IACEB6-BOpitM0E.js → chunk-55IACEB6-C3z0C07R.js} +1 -1
  21. package/packages/web/dist/assets/{chunk-727SXJPM-CJlLWtSg.js → chunk-727SXJPM-Berq8tYQ.js} +1 -1
  22. package/packages/web/dist/assets/{chunk-AQP2D5EJ-DeDZ88Lo.js → chunk-AQP2D5EJ-pmNomPLh.js} +1 -1
  23. package/packages/web/dist/assets/{chunk-FMBD7UC4-CV2SkG7q.js → chunk-FMBD7UC4-Dib6k_Jt.js} +1 -1
  24. package/packages/web/dist/assets/{chunk-ND2GUHAM-7I3lq0Fn.js → chunk-ND2GUHAM-BLJ8I_5a.js} +1 -1
  25. package/packages/web/dist/assets/{chunk-QZHKN3VN-Cf3pbZ7F.js → chunk-QZHKN3VN-CF9IQ9Hb.js} +1 -1
  26. package/packages/web/dist/assets/classDiagram-4FO5ZUOK-C7S-8iK8.js +2 -0
  27. package/packages/web/dist/assets/classDiagram-v2-Q7XG4LA2-C7S-8iK8.js +2 -0
  28. package/packages/web/dist/assets/{core-opQe9BZr.js → core-VRqhWYeo.js} +1 -1
  29. package/packages/web/dist/assets/{cose-bilkent-S5V4N54A-DNqx3JMw.js → cose-bilkent-S5V4N54A-CaaPGPzi.js} +1 -1
  30. package/packages/web/dist/assets/{dagre-BM42HDAG--zmK8uff.js → dagre-BM42HDAG-nDaGcD3m.js} +1 -1
  31. package/packages/web/dist/assets/{diagram-2AECGRRQ-m66wiDlX.js → diagram-2AECGRRQ-C2HxszOk.js} +1 -1
  32. package/packages/web/dist/assets/{diagram-5GNKFQAL-D-B5R8EU.js → diagram-5GNKFQAL-B7vhf-SU.js} +1 -1
  33. package/packages/web/dist/assets/{diagram-KO2AKTUF-Ddy41-7w.js → diagram-KO2AKTUF-DwzUplqR.js} +1 -1
  34. package/packages/web/dist/assets/{diagram-LMA3HP47-BbmHkSQO.js → diagram-LMA3HP47-jxA4r1TT.js} +1 -1
  35. package/packages/web/dist/assets/{diagram-OG6HWLK6-BCh58FBP.js → diagram-OG6HWLK6-bJj3XuXO.js} +1 -1
  36. package/packages/web/dist/assets/{erDiagram-TEJ5UH35-DR9xzBOs.js → erDiagram-TEJ5UH35-BCmsvJ1E.js} +1 -1
  37. package/packages/web/dist/assets/{flowDiagram-I6XJVG4X-CJfa3p8F.js → flowDiagram-I6XJVG4X-BBXF7i-3.js} +1 -1
  38. package/packages/web/dist/assets/{ganttDiagram-6RSMTGT7-yzPDDVW3.js → ganttDiagram-6RSMTGT7-Cy2XuuX9.js} +1 -1
  39. package/packages/web/dist/assets/{gitGraphDiagram-PVQCEYII-CJXPtboA.js → gitGraphDiagram-PVQCEYII-BZ52y55B.js} +1 -1
  40. package/packages/web/dist/assets/{index-BaPY10t-.js → index-WSqceBAp.js} +2 -2
  41. package/packages/web/dist/assets/{infoDiagram-5YYISTIA-D9vhRGL_.js → infoDiagram-5YYISTIA-BRZze51k.js} +1 -1
  42. package/packages/web/dist/assets/{ishikawaDiagram-YF4QCWOH-B9RBJT-k.js → ishikawaDiagram-YF4QCWOH-CrbLPmKO.js} +1 -1
  43. package/packages/web/dist/assets/{journeyDiagram-JHISSGLW-zzNNWXdy.js → journeyDiagram-JHISSGLW-CCuPv3E6.js} +1 -1
  44. package/packages/web/dist/assets/{kanban-definition-UN3LZRKU-Dg_wJtNi.js → kanban-definition-UN3LZRKU-ACw0bggP.js} +1 -1
  45. package/packages/web/dist/assets/{linear-DASr4ns5.js → linear-CLHufD5E.js} +1 -1
  46. package/packages/web/dist/assets/{mermaid.core-CAePmquc.js → mermaid.core-BojCLaOp.js} +4 -4
  47. package/packages/web/dist/assets/{mindmap-definition-RKZ34NQL-Cl2HK0sl.js → mindmap-definition-RKZ34NQL-DXjvLyss.js} +1 -1
  48. package/packages/web/dist/assets/{pieDiagram-4H26LBE5-DIaazut3.js → pieDiagram-4H26LBE5-Bqtv9pr3.js} +1 -1
  49. package/packages/web/dist/assets/{quadrantDiagram-W4KKPZXB-NGp4Bzwf.js → quadrantDiagram-W4KKPZXB-KM3FkuU3.js} +1 -1
  50. package/packages/web/dist/assets/{requirementDiagram-4Y6WPE33-RTl5o3vw.js → requirementDiagram-4Y6WPE33-D3oU5kKQ.js} +1 -1
  51. package/packages/web/dist/assets/{sankeyDiagram-5OEKKPKP-Dtr5vEYU.js → sankeyDiagram-5OEKKPKP-zzk0leIT.js} +1 -1
  52. package/packages/web/dist/assets/{sequenceDiagram-3UESZ5HK-C6W0N-LY.js → sequenceDiagram-3UESZ5HK-DRe52gP-.js} +1 -1
  53. package/packages/web/dist/assets/{stateDiagram-AJRCARHV-DALH820h.js → stateDiagram-AJRCARHV-xqVTWU6m.js} +1 -1
  54. package/packages/web/dist/assets/stateDiagram-v2-BHNVJYJU-CmOXl_Qz.js +2 -0
  55. package/packages/web/dist/assets/{timeline-definition-PNZ67QCA-upVsHNqm.js → timeline-definition-PNZ67QCA-CQTQxBCe.js} +1 -1
  56. package/packages/web/dist/assets/{vennDiagram-CIIHVFJN-yJqMTwk8.js → vennDiagram-CIIHVFJN-CJp83Tu0.js} +1 -1
  57. package/packages/web/dist/assets/{wardley-L42UT6IY-dzsAgGjL.js → wardley-L42UT6IY-BwZIWjv9.js} +1 -1
  58. package/packages/web/dist/assets/{wardleyDiagram-YWT4CUSO-DqziJNNu.js → wardleyDiagram-YWT4CUSO-BeQgKrX9.js} +1 -1
  59. package/packages/web/dist/assets/{xychartDiagram-2RQKCTM6-DG3Ah5cE.js → xychartDiagram-2RQKCTM6-9lr7Zmnk.js} +1 -1
  60. package/packages/web/dist/index.html +1 -1
  61. package/packages/web/dist/sw.js +1 -1
  62. package/packages/web/dist/assets/DiscoverPage-DbCP4Xx5.js +0 -2
  63. package/packages/web/dist/assets/channel-Dy4nz2ZR.js +0 -2
  64. package/packages/web/dist/assets/classDiagram-4FO5ZUOK-DefN1Ykd.js +0 -2
  65. package/packages/web/dist/assets/classDiagram-v2-Q7XG4LA2-DefN1Ykd.js +0 -2
  66. package/packages/web/dist/assets/stateDiagram-v2-BHNVJYJU-BYXq4u6b.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edspencer/paddock",
3
- "version": "0.74.1",
3
+ "version": "0.74.2",
4
4
  "description": "Project-first launchpad for Claude Code: server-hosted, persistent, resumable sessions organized by project.",
5
5
  "keywords": [
6
6
  "claude",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paddock/server",
3
- "version": "0.74.1",
3
+ "version": "0.74.2",
4
4
  "private": true,
5
5
  "type": "module"
6
6
  }
@@ -0,0 +1,2 @@
1
+ import{j as r}from"./index-WSqceBAp.js";import{D as o}from"./DiscoverView-LAqnHF4r.js";import"./Surfaces-CcrPbt9t.js";function s(){return r.jsx(o,{})}export{s as DiscoverPage};
2
+
@@ -1,2 +1,2 @@
1
- import{a as oe,u as ie,V as de,r as u,b as A,j as s,J as X,G as Y,_ as Z,z as $,W as ce,H as le,P as he,$ as ue,a0 as _,D,l as J,a1 as pe,h as xe,M as K}from"./index-BaPY10t-.js";import{E as R,C as me}from"./Surfaces-CFgCNuC1.js";function ge(e){const t={};for(const n of e)t[n.path]={checked:!0,expanded:!1,loading:!1,error:null};return t}function fe(e){if(!e.sessions||!e.selected)return e.checked?"on":"off";const t=e.sessions.sessions.length,n=e.selected.size;return t===0||n===0?"off":n===t?"on":"mixed"}function C(e,t){return e.sessions&&e.selected?e.selected.size:e.checked?t.sessionCount:0}function je(e,t){return t.reduce((n,r)=>n+C(e[r.path]??z(),r),0)}function be(e,t){return t.filter(n=>C(e[n.path]??z(),n)>0)}function we(e,t,n){const r=e[t];if(!r)return e;const a={...r,checked:n};return r.sessions&&(a.selected=n?new Set(r.sessions.sessions.map(c=>c.sessionId)):new Set),{...e,[t]:a}}function ye(e,t,n){const r=e[t];if(!r||!r.sessions)return e;const a=new Set(r.selected??[]);return a.delete(n)||a.add(n),{...e,[t]:{...r,selected:a,checked:a.size>0}}}function ve(e,t,n){const r=e[t];if(!r)return e;const a=r.checked?new Set(n.sessions.map(c=>c.sessionId)):new Set;return{...e,[t]:{...r,sessions:n,selected:a,loading:!1,error:null}}}function T(e,t,n){const r=e[t];return r?{...e,[t]:{...r,...n}}:e}function Ne(e,t){const n=e??z();return C(n,t)===0?null:n.sessions&&n.selected?{sessionIds:[...n.selected]}:{}}function z(){return{checked:!1,expanded:!1,loading:!1,error:null}}function ke(e){return e.error!==void 0?e.stage==="create"?"danger":"warn":e.adopted>0?"success":"warn"}async function Se(e,t,n){let r;try{r=await e.createProject({name:t.name,slug:t.suggestedSlug,path:t.path,managed:!1})}catch(a){return{stage:"create",adopted:0,skipped:[],error:q(a)}}try{const a=await e.adoptChats(r.slug,{sourceCwd:r.workingDir,...n.sessionIds?{sessionIds:n.sessionIds}:{}});return{project:r,adopted:a.adopted.length,skipped:a.skipped}}catch(a){return{stage:"import",project:r,adopted:0,skipped:[],error:q(a)}}}async function $e(e,t,n){const r=[];for(const a of t){n(a.candidate.path,"running");const c=await Se(e,a.candidate,a.plan);r.push(c),n(a.candidate.path,"done",c)}return r}const Ce={sidechain:"sub-agent transcript","already-adopted":"already adopted","destination-exists":"a chat with that id already exists here","attributed-to-run":"belongs to a Paddock run",unreadable:"transcript unreadable","placement-failed":"copy failed","record-failed":"could not be recorded"};function W(e){if(e.length===0)return"";const t=[...new Set(e.map(n=>Ce[n.reason]??n.reason))];return`${e.length} skipped (${t.join(", ")})`}function Ie(e,t){var l;if(e.stage==="create")return`Couldn't create the project: ${e.error}`;const n=((l=e.project)==null?void 0:l.slug)??t.suggestedSlug;if(e.stage==="import")return`Project “${n}” was created, but importing its chats failed: ${e.error}. It is there and empty — you can import them from the project itself.`;if(e.adopted===0){const m=W(e.skipped);return t.recordedPath!==void 0?`Project “${n}” was created but no chats came with it. Its transcripts record ${t.recordedPath}, a different spelling of ${t.path}, and an import matches on the exact path.`:m?`Project “${n}” was created but no chats came with it — ${m}.`:`Project “${n}” was created but no chats came with it.`}const r=e.adopted,a=W(e.skipped),c=`Adopted ${r} chat${r===1?"":"s"} into “${n}”`;return a?`${c} — ${a}.`:`${c}.`}function q(e){return e instanceof Error?e.message:String(e)}function He({firstRun:e=!1,embedded:t=!1,onLeave:n,onStartChat:r}){const a=oe(),{refresh:c}=ie(),l=de(),[m,d]=u.useState(!1),[j,I]=u.useState(!1),[h,x]=u.useState(null),[y,O]=u.useState(null),[G,P]=u.useState(!0),[f,v]=u.useState({}),[k,H]=u.useState(!1),[L,F]=u.useState({}),[E,B]=u.useState({}),[S,ee]=u.useState(!1);u.useEffect(()=>{let o=!0;return P(!0),O(null),A.discover({includeNonGit:m,includeOutsideHome:j}).then(i=>{o&&(x(i),v(ge(i.candidates)),P(!1))}).catch(i=>{o&&(O(i instanceof Error?i.message:"Discovery failed"),P(!1))}),()=>{o=!1}},[m,j]);const w=(h==null?void 0:h.candidates)??[],M=u.useMemo(()=>je(f,w),[f,w]),b=u.useMemo(()=>be(f,w),[f,w]),se=u.useCallback(o=>{v(p=>{const g=p[o.path];if(!g)return p;const N=T(p,o.path,{expanded:!g.expanded});return g.expanded||g.sessions||g.loading?N:T(N,o.path,{loading:!0,error:null})});const i=f[o.path];!i||i.expanded||i.sessions||i.loading||A.discoverSessions(o.path).then(p=>v(g=>ve(g,o.path,p))).catch(p=>v(g=>T(g,o.path,{loading:!1,error:p instanceof Error?p.message:"Could not read this directory's sessions"})))},[f]),te=u.useCallback(async()=>{if(k)return;H(!0),F(Object.fromEntries(b.map(i=>[i.path,"pending"]))),B({});const o=b.map(i=>({candidate:i,plan:Ne(f[i.path],i)??{}}));await $e(A,o,(i,p,g)=>{F(N=>({...N,[i]:p})),g&&B(N=>({...N,[i]:g}))}),H(!1),ee(!0),await c()},[b,f,k,c]),ne=u.useCallback(async()=>{await c(),n==null||n(),a("/")},[a,c,n]),ae=Object.values(E).reduce((o,i)=>o+i.adopted,0),re=Object.values(E).filter(o=>o.project).length,V=s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"mb-5 text-sm text-fg-muted",children:e?"If you have used Claude Code in a terminal on this machine, Paddock can adopt that history: each directory becomes a project with its conversations already in it.":"Directories on this machine with existing Claude Code history. Adopting one links it as a project and brings its conversations in; your own history is never moved or deleted."}),S&&s.jsx(De,{imported:ae,projects:re,onGetStarted:ne}),y!==null&&s.jsx(X,{tone:"danger",icon:s.jsx(Y,{width:16,height:16}),children:y}),G&&s.jsx(Te,{}),!G&&y===null&&h!==null&&s.jsxs(s.Fragment,{children:[h.scanned===0?s.jsx(Ae,{claudeHome:h.claudeHome,onStartChat:r}):w.length===0?s.jsx(R,{variant:"panel",icon:s.jsx(Z,{width:22,height:22}),title:"Nothing to adopt",body:"Paddock found Claude Code history on this machine, but none of it is available to adopt right now. The tally below says what was skipped, and the two toggles relax the rules that are safe to relax."}):s.jsx("ul",{className:"space-y-2",children:w.map(o=>s.jsx(Pe,{candidate:o,row:f[o.path],status:L[o.path],outcome:E[o.path],locked:k||S,onToggleRow:i=>v(p=>we(p,o.path,i)),onToggleSession:i=>v(p=>ye(p,o.path,i)),onToggleExpanded:()=>se(o)},o.path))}),!S&&h.scanned>0&&s.jsx(Ee,{result:h,includeNonGit:m,includeOutsideHome:j,disabled:k,onIncludeNonGit:d,onIncludeOutsideHome:I}),w.length>0&&!S&&s.jsxs("div",{className:"mt-5 flex items-center justify-between gap-3 border-t border-edge pt-4",children:[s.jsxs("span",{className:"text-sm text-fg-muted",children:[M," conversation",M===1?"":"s"," from ",b.length," director",b.length===1?"y":"ies"]}),s.jsxs($,{variant:"primary",onClick:()=>void te(),disabled:b.length===0,loading:k,loadingLabel:"Adopting…",children:["Adopt ",b.length," project",b.length===1?"":"s"]})]})]})]});return t?V:s.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[s.jsxs("header",{className:"pt-safe flex items-center gap-2 border-b border-edge px-3 pb-2.5 sm:px-6 lg:py-4",children:[s.jsx("button",{type:"button",onClick:()=>l==null?void 0:l.openNav(),"aria-label":"Open menu",className:"btn-subtle -ml-1 shrink-0 px-2 py-1.5 lg:hidden",children:s.jsx(ce,{width:20,height:20})}),s.jsx(le,{width:18,height:18,className:"shrink-0 text-fg-subtle"}),s.jsx("h1",{className:"text-md font-semibold tracking-tight",children:"Discover"})]}),s.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:s.jsx("div",{className:"mx-auto max-w-3xl px-6 py-6",children:V})})]})}function Pe({candidate:e,row:t,status:n,outcome:r,locked:a,onToggleRow:c,onToggleSession:l,onToggleExpanded:m}){const d=t??{checked:!1,expanded:!1,loading:!1,error:null},j=fe(d),I=C(d,e),h=r?ke(r):null;return s.jsx("li",{children:s.jsxs(me,{flush:!0,className:J("overflow-hidden",h==="success"&&"border-success-edge bg-success-soft",h==="warn"&&"border-warn-edge bg-warn-soft",h==="danger"&&"border-danger-edge bg-danger-soft",n==="running"&&"border-accent-edge"),"data-testid":`discover-row-${e.suggestedSlug}`,"data-tone":h??void 0,children:[s.jsxs("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[s.jsx(_,{className:"mt-1",checked:j==="on",indeterminate:j==="mixed",disabled:a,"aria-label":`Adopt ${e.path}`,onChange:x=>c(x.target.checked)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("code",{className:"block break-all text-sm text-fg",children:e.path}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-muted",children:[s.jsxs("span",{className:"tabular",children:[e.sessionCount," conversation",e.sessionCount===1?"":"s"]}),e.filteredCount>0&&s.jsxs("span",{className:"tabular",title:"Empty, slash-command-only or sweeper transcripts, withheld as noise",children:["· ",e.filteredCount," filtered out"]}),e.lastSessionAt!==void 0&&s.jsxs("span",{className:"tabular",children:["· last ",U(e.lastSessionAt)]}),e.gitRemote!==void 0&&s.jsx(D,{tone:"lineage",size:"sm",children:e.gitRemote}),!e.hasGit&&s.jsx(D,{tone:"neutral",size:"sm",children:"no git"}),!e.insideHome&&s.jsx(D,{tone:"neutral",size:"sm",children:"outside home"})]}),e.recordedPath!==void 0&&s.jsx(X,{tone:"warn",className:"mt-2",icon:s.jsx(Y,{width:14,height:14}),children:s.jsxs("span",{className:"text-xs",children:["These transcripts record"," ",s.jsx("code",{className:"break-all",children:e.recordedPath})," — a different spelling of this path. The import matches on the exact path, so it may bring nothing in."]})}),r&&s.jsx("p",{className:J("mt-2 text-xs",h==="success"&&"text-success",h==="warn"&&"text-warn",h==="danger"&&"text-danger"),children:Ie(r,e)}),n==="running"&&!r&&s.jsx("p",{className:"mt-2 text-xs text-fg-muted",children:"Adopting…"})]}),s.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[s.jsx("span",{className:"tabular text-xs text-fg-subtle",children:I}),s.jsx($,{size:"icon-sm",variant:"subtle","aria-label":d.expanded?"Hide conversations":"Show conversations","aria-expanded":d.expanded,onClick:m,children:d.expanded?s.jsx(pe,{width:14,height:14}):s.jsx(xe,{width:14,height:14})})]})]}),d.expanded&&s.jsxs("div",{className:"border-t border-edge px-3 py-2",children:[d.loading&&s.jsx("p",{className:"py-2 text-xs text-fg-muted",children:"Reading transcripts…"}),d.error!==null&&s.jsx("p",{className:"py-2 text-xs text-danger",children:d.error}),d.sessions&&d.sessions.sessions.length===0&&s.jsx("p",{className:"py-2 text-xs text-fg-muted",children:"Nothing to adopt here any more — it may have been adopted since the scan."}),d.sessions&&d.sessions.sessions.length>0&&s.jsx("ul",{className:"space-y-1",children:d.sessions.sessions.map(x=>{var y;return s.jsx("li",{children:s.jsxs("label",{className:"flex cursor-pointer items-start gap-2 rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-hover",children:[s.jsx(_,{checked:((y=d.selected)==null?void 0:y.has(x.sessionId))??!1,disabled:a,"aria-label":Q(x),onChange:()=>l(x.sessionId)}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-xs text-fg",children:Q(x)}),s.jsxs("span",{className:"tabular mt-0.5 block text-3xs text-fg-muted",children:[U(x.mtime)," · ",ze(x.sizeBytes)]})]})]})},x.sessionId)})}),d.sessions&&d.sessions.filtered.length>0&&s.jsxs("p",{className:"mt-2 px-2 text-3xs text-fg-subtle",children:[d.sessions.filtered.length," more withheld as noise (",[...new Set(d.sessions.filtered.map(x=>x.reason))].join(", "),")."]})]})]})})}function Ee({result:e,includeNonGit:t,includeOutsideHome:n,disabled:r,onIncludeNonGit:a,onIncludeOutsideHome:c}){const l=e.excluded["no-git"]??0,m=e.excluded["outside-home"]??0,d=l>0||t,j=m>0||n;return e.scanned===0?null:s.jsxs("div",{className:"mt-5 space-y-2 border-t border-edge pt-4",children:[s.jsx("p",{className:"text-xs text-fg-muted",children:Re(e)}),d&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[s.jsx(K,{checked:t,disabled:r,onChange:a,label:"Also offer directories without a git repository"}),s.jsxs("span",{children:["Also offer directories without a git repository",l>0&&` (${l} hidden)`]})]}),j&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[s.jsx(K,{checked:n,disabled:r,onChange:c,label:"Also offer directories outside your home directory"}),s.jsxs("span",{children:["Also offer directories outside ",s.jsx("code",{children:e.homeDir}),m>0&&` (${m} hidden)`]})]})]})}function Ae({claudeHome:e,onStartChat:t}){return s.jsx(R,{variant:"panel",icon:s.jsx(ue,{width:22,height:22}),title:"Nothing to adopt yet",body:s.jsxs(s.Fragment,{children:["No Claude Code history has been recorded under"," ",s.jsx("code",{className:"break-all",children:e}),". That is normal on a new install, and on a container whose Claude home is its own rather than yours — nothing is wrong. Start a chat here and Paddock writes its own history; or bind-mount an existing one there and re-open this page, or import it headlessly with ",s.jsx("code",{children:"npm run import-chats"}),"."]}),action:t&&s.jsx($,{variant:"primary",icon:s.jsx(he,{width:14,height:14}),onClick:t,children:"Start a chat"})})}function De({imported:e,projects:t,onGetStarted:n}){return s.jsx("div",{className:"mb-6",children:s.jsx(R,{variant:"panel",icon:s.jsx(Z,{width:22,height:22}),title:t===0?"Nothing was adopted":`${t} project${t===1?"":"s"}, ${e} conversation${e===1?"":"s"}`,body:t===0?"Every row failed. Each one says why below.":"They are in the sidebar now. Anything that did not land says why below.",action:s.jsx($,{variant:"primary",onClick:()=>void n(),children:"Get started"})})})}function Te(){return s.jsx("div",{className:"space-y-2","aria-label":"Scanning",role:"status",children:[0,1,2].map(e=>s.jsx("div",{className:"h-16 animate-pulse rounded-2xl bg-surface-active"},e))})}function Re(e){const t=[],n=[["temp-root",a=>`${a} in temp directories`],["no-git",a=>`${a} without a git repository`],["outside-home",a=>`${a} outside your home directory`],["already-managed",a=>`${a} already a project`],["no-sessions",a=>`${a} with nothing to adopt`],["no-recorded-cwd",a=>`${a} with no recorded directory`],["missing",a=>`${a} no longer on disk`],["home-root",a=>`${a} your home directory itself`],["system-path",a=>`${a} system directories`],["paddock-internal",a=>`${a} inside Paddock's own data`]];for(const[a,c]of n){const l=e.excluded[a];l!==void 0&&l>0&&t.push(c(l))}const r=`${e.scanned} transcript folder${e.scanned===1?"":"s"} scanned`;return t.length===0?`${r}.`:`${r}; skipped ${t.join(", ")}.`}function Q(e){var r,a;const t=(r=e.autoName)==null?void 0:r.trim();if(t!==void 0&&t!=="")return t;const n=(a=e.preview)==null?void 0:a.trim();return n!==void 0&&n!==""?n:e.sessionId}function U(e){const t=new Date(e);return Number.isNaN(t.getTime())?"unknown date":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ze(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} kB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{He as D};
1
+ import{a as oe,u as ie,V as de,r as u,b as A,j as s,J as X,G as Y,_ as Z,z as $,W as ce,H as le,P as he,$ as ue,a0 as _,D,l as J,a1 as pe,h as xe,M as K}from"./index-WSqceBAp.js";import{E as R,C as me}from"./Surfaces-CcrPbt9t.js";function ge(e){const t={};for(const n of e)t[n.path]={checked:!0,expanded:!1,loading:!1,error:null};return t}function fe(e){if(!e.sessions||!e.selected)return e.checked?"on":"off";const t=e.sessions.sessions.length,n=e.selected.size;return t===0||n===0?"off":n===t?"on":"mixed"}function C(e,t){return e.sessions&&e.selected?e.selected.size:e.checked?t.sessionCount:0}function je(e,t){return t.reduce((n,r)=>n+C(e[r.path]??z(),r),0)}function be(e,t){return t.filter(n=>C(e[n.path]??z(),n)>0)}function we(e,t,n){const r=e[t];if(!r)return e;const a={...r,checked:n};return r.sessions&&(a.selected=n?new Set(r.sessions.sessions.map(c=>c.sessionId)):new Set),{...e,[t]:a}}function ye(e,t,n){const r=e[t];if(!r||!r.sessions)return e;const a=new Set(r.selected??[]);return a.delete(n)||a.add(n),{...e,[t]:{...r,selected:a,checked:a.size>0}}}function ve(e,t,n){const r=e[t];if(!r)return e;const a=r.checked?new Set(n.sessions.map(c=>c.sessionId)):new Set;return{...e,[t]:{...r,sessions:n,selected:a,loading:!1,error:null}}}function T(e,t,n){const r=e[t];return r?{...e,[t]:{...r,...n}}:e}function Ne(e,t){const n=e??z();return C(n,t)===0?null:n.sessions&&n.selected?{sessionIds:[...n.selected]}:{}}function z(){return{checked:!1,expanded:!1,loading:!1,error:null}}function ke(e){return e.error!==void 0?e.stage==="create"?"danger":"warn":e.adopted>0?"success":"warn"}async function Se(e,t,n){let r;try{r=await e.createProject({name:t.name,slug:t.suggestedSlug,path:t.path,managed:!1})}catch(a){return{stage:"create",adopted:0,skipped:[],error:q(a)}}try{const a=await e.adoptChats(r.slug,{sourceCwd:r.workingDir,...n.sessionIds?{sessionIds:n.sessionIds}:{}});return{project:r,adopted:a.adopted.length,skipped:a.skipped}}catch(a){return{stage:"import",project:r,adopted:0,skipped:[],error:q(a)}}}async function $e(e,t,n){const r=[];for(const a of t){n(a.candidate.path,"running");const c=await Se(e,a.candidate,a.plan);r.push(c),n(a.candidate.path,"done",c)}return r}const Ce={sidechain:"sub-agent transcript","already-adopted":"already adopted","destination-exists":"a chat with that id already exists here","attributed-to-run":"belongs to a Paddock run",unreadable:"transcript unreadable","placement-failed":"copy failed","record-failed":"could not be recorded"};function W(e){if(e.length===0)return"";const t=[...new Set(e.map(n=>Ce[n.reason]??n.reason))];return`${e.length} skipped (${t.join(", ")})`}function Ie(e,t){var l;if(e.stage==="create")return`Couldn't create the project: ${e.error}`;const n=((l=e.project)==null?void 0:l.slug)??t.suggestedSlug;if(e.stage==="import")return`Project “${n}” was created, but importing its chats failed: ${e.error}. It is there and empty — you can import them from the project itself.`;if(e.adopted===0){const m=W(e.skipped);return t.recordedPath!==void 0?`Project “${n}” was created but no chats came with it. Its transcripts record ${t.recordedPath}, a different spelling of ${t.path}, and an import matches on the exact path.`:m?`Project “${n}” was created but no chats came with it — ${m}.`:`Project “${n}” was created but no chats came with it.`}const r=e.adopted,a=W(e.skipped),c=`Adopted ${r} chat${r===1?"":"s"} into “${n}”`;return a?`${c} — ${a}.`:`${c}.`}function q(e){return e instanceof Error?e.message:String(e)}function He({firstRun:e=!1,embedded:t=!1,onLeave:n,onStartChat:r}){const a=oe(),{refresh:c}=ie(),l=de(),[m,d]=u.useState(!1),[j,I]=u.useState(!1),[h,x]=u.useState(null),[y,O]=u.useState(null),[G,P]=u.useState(!0),[f,v]=u.useState({}),[k,H]=u.useState(!1),[L,F]=u.useState({}),[E,B]=u.useState({}),[S,ee]=u.useState(!1);u.useEffect(()=>{let o=!0;return P(!0),O(null),A.discover({includeNonGit:m,includeOutsideHome:j}).then(i=>{o&&(x(i),v(ge(i.candidates)),P(!1))}).catch(i=>{o&&(O(i instanceof Error?i.message:"Discovery failed"),P(!1))}),()=>{o=!1}},[m,j]);const w=(h==null?void 0:h.candidates)??[],M=u.useMemo(()=>je(f,w),[f,w]),b=u.useMemo(()=>be(f,w),[f,w]),se=u.useCallback(o=>{v(p=>{const g=p[o.path];if(!g)return p;const N=T(p,o.path,{expanded:!g.expanded});return g.expanded||g.sessions||g.loading?N:T(N,o.path,{loading:!0,error:null})});const i=f[o.path];!i||i.expanded||i.sessions||i.loading||A.discoverSessions(o.path).then(p=>v(g=>ve(g,o.path,p))).catch(p=>v(g=>T(g,o.path,{loading:!1,error:p instanceof Error?p.message:"Could not read this directory's sessions"})))},[f]),te=u.useCallback(async()=>{if(k)return;H(!0),F(Object.fromEntries(b.map(i=>[i.path,"pending"]))),B({});const o=b.map(i=>({candidate:i,plan:Ne(f[i.path],i)??{}}));await $e(A,o,(i,p,g)=>{F(N=>({...N,[i]:p})),g&&B(N=>({...N,[i]:g}))}),H(!1),ee(!0),await c()},[b,f,k,c]),ne=u.useCallback(async()=>{await c(),n==null||n(),a("/")},[a,c,n]),ae=Object.values(E).reduce((o,i)=>o+i.adopted,0),re=Object.values(E).filter(o=>o.project).length,V=s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"mb-5 text-sm text-fg-muted",children:e?"If you have used Claude Code in a terminal on this machine, Paddock can adopt that history: each directory becomes a project with its conversations already in it.":"Directories on this machine with existing Claude Code history. Adopting one links it as a project and brings its conversations in; your own history is never moved or deleted."}),S&&s.jsx(De,{imported:ae,projects:re,onGetStarted:ne}),y!==null&&s.jsx(X,{tone:"danger",icon:s.jsx(Y,{width:16,height:16}),children:y}),G&&s.jsx(Te,{}),!G&&y===null&&h!==null&&s.jsxs(s.Fragment,{children:[h.scanned===0?s.jsx(Ae,{claudeHome:h.claudeHome,onStartChat:r}):w.length===0?s.jsx(R,{variant:"panel",icon:s.jsx(Z,{width:22,height:22}),title:"Nothing to adopt",body:"Paddock found Claude Code history on this machine, but none of it is available to adopt right now. The tally below says what was skipped, and the two toggles relax the rules that are safe to relax."}):s.jsx("ul",{className:"space-y-2",children:w.map(o=>s.jsx(Pe,{candidate:o,row:f[o.path],status:L[o.path],outcome:E[o.path],locked:k||S,onToggleRow:i=>v(p=>we(p,o.path,i)),onToggleSession:i=>v(p=>ye(p,o.path,i)),onToggleExpanded:()=>se(o)},o.path))}),!S&&h.scanned>0&&s.jsx(Ee,{result:h,includeNonGit:m,includeOutsideHome:j,disabled:k,onIncludeNonGit:d,onIncludeOutsideHome:I}),w.length>0&&!S&&s.jsxs("div",{className:"mt-5 flex items-center justify-between gap-3 border-t border-edge pt-4",children:[s.jsxs("span",{className:"text-sm text-fg-muted",children:[M," conversation",M===1?"":"s"," from ",b.length," director",b.length===1?"y":"ies"]}),s.jsxs($,{variant:"primary",onClick:()=>void te(),disabled:b.length===0,loading:k,loadingLabel:"Adopting…",children:["Adopt ",b.length," project",b.length===1?"":"s"]})]})]})]});return t?V:s.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[s.jsxs("header",{className:"pt-safe flex items-center gap-2 border-b border-edge px-3 pb-2.5 sm:px-6 lg:py-4",children:[s.jsx("button",{type:"button",onClick:()=>l==null?void 0:l.openNav(),"aria-label":"Open menu",className:"btn-subtle -ml-1 shrink-0 px-2 py-1.5 lg:hidden",children:s.jsx(ce,{width:20,height:20})}),s.jsx(le,{width:18,height:18,className:"shrink-0 text-fg-subtle"}),s.jsx("h1",{className:"text-md font-semibold tracking-tight",children:"Discover"})]}),s.jsx("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:s.jsx("div",{className:"mx-auto max-w-3xl px-6 py-6",children:V})})]})}function Pe({candidate:e,row:t,status:n,outcome:r,locked:a,onToggleRow:c,onToggleSession:l,onToggleExpanded:m}){const d=t??{checked:!1,expanded:!1,loading:!1,error:null},j=fe(d),I=C(d,e),h=r?ke(r):null;return s.jsx("li",{children:s.jsxs(me,{flush:!0,className:J("overflow-hidden",h==="success"&&"border-success-edge bg-success-soft",h==="warn"&&"border-warn-edge bg-warn-soft",h==="danger"&&"border-danger-edge bg-danger-soft",n==="running"&&"border-accent-edge"),"data-testid":`discover-row-${e.suggestedSlug}`,"data-tone":h??void 0,children:[s.jsxs("div",{className:"flex items-start gap-3 px-3 py-2.5",children:[s.jsx(_,{className:"mt-1",checked:j==="on",indeterminate:j==="mixed",disabled:a,"aria-label":`Adopt ${e.path}`,onChange:x=>c(x.target.checked)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("code",{className:"block break-all text-sm text-fg",children:e.path}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-fg-muted",children:[s.jsxs("span",{className:"tabular",children:[e.sessionCount," conversation",e.sessionCount===1?"":"s"]}),e.filteredCount>0&&s.jsxs("span",{className:"tabular",title:"Empty, slash-command-only or sweeper transcripts, withheld as noise",children:["· ",e.filteredCount," filtered out"]}),e.lastSessionAt!==void 0&&s.jsxs("span",{className:"tabular",children:["· last ",U(e.lastSessionAt)]}),e.gitRemote!==void 0&&s.jsx(D,{tone:"lineage",size:"sm",children:e.gitRemote}),!e.hasGit&&s.jsx(D,{tone:"neutral",size:"sm",children:"no git"}),!e.insideHome&&s.jsx(D,{tone:"neutral",size:"sm",children:"outside home"})]}),e.recordedPath!==void 0&&s.jsx(X,{tone:"warn",className:"mt-2",icon:s.jsx(Y,{width:14,height:14}),children:s.jsxs("span",{className:"text-xs",children:["These transcripts record"," ",s.jsx("code",{className:"break-all",children:e.recordedPath})," — a different spelling of this path. The import matches on the exact path, so it may bring nothing in."]})}),r&&s.jsx("p",{className:J("mt-2 text-xs",h==="success"&&"text-success",h==="warn"&&"text-warn",h==="danger"&&"text-danger"),children:Ie(r,e)}),n==="running"&&!r&&s.jsx("p",{className:"mt-2 text-xs text-fg-muted",children:"Adopting…"})]}),s.jsxs("span",{className:"flex shrink-0 items-center gap-1",children:[s.jsx("span",{className:"tabular text-xs text-fg-subtle",children:I}),s.jsx($,{size:"icon-sm",variant:"subtle","aria-label":d.expanded?"Hide conversations":"Show conversations","aria-expanded":d.expanded,onClick:m,children:d.expanded?s.jsx(pe,{width:14,height:14}):s.jsx(xe,{width:14,height:14})})]})]}),d.expanded&&s.jsxs("div",{className:"border-t border-edge px-3 py-2",children:[d.loading&&s.jsx("p",{className:"py-2 text-xs text-fg-muted",children:"Reading transcripts…"}),d.error!==null&&s.jsx("p",{className:"py-2 text-xs text-danger",children:d.error}),d.sessions&&d.sessions.sessions.length===0&&s.jsx("p",{className:"py-2 text-xs text-fg-muted",children:"Nothing to adopt here any more — it may have been adopted since the scan."}),d.sessions&&d.sessions.sessions.length>0&&s.jsx("ul",{className:"space-y-1",children:d.sessions.sessions.map(x=>{var y;return s.jsx("li",{children:s.jsxs("label",{className:"flex cursor-pointer items-start gap-2 rounded-lg px-2 py-1.5 transition-colors hover:bg-surface-hover",children:[s.jsx(_,{checked:((y=d.selected)==null?void 0:y.has(x.sessionId))??!1,disabled:a,"aria-label":Q(x),onChange:()=>l(x.sessionId)}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate text-xs text-fg",children:Q(x)}),s.jsxs("span",{className:"tabular mt-0.5 block text-3xs text-fg-muted",children:[U(x.mtime)," · ",ze(x.sizeBytes)]})]})]})},x.sessionId)})}),d.sessions&&d.sessions.filtered.length>0&&s.jsxs("p",{className:"mt-2 px-2 text-3xs text-fg-subtle",children:[d.sessions.filtered.length," more withheld as noise (",[...new Set(d.sessions.filtered.map(x=>x.reason))].join(", "),")."]})]})]})})}function Ee({result:e,includeNonGit:t,includeOutsideHome:n,disabled:r,onIncludeNonGit:a,onIncludeOutsideHome:c}){const l=e.excluded["no-git"]??0,m=e.excluded["outside-home"]??0,d=l>0||t,j=m>0||n;return e.scanned===0?null:s.jsxs("div",{className:"mt-5 space-y-2 border-t border-edge pt-4",children:[s.jsx("p",{className:"text-xs text-fg-muted",children:Re(e)}),d&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[s.jsx(K,{checked:t,disabled:r,onChange:a,label:"Also offer directories without a git repository"}),s.jsxs("span",{children:["Also offer directories without a git repository",l>0&&` (${l} hidden)`]})]}),j&&s.jsxs("div",{className:"flex items-center gap-2 text-xs text-fg-muted",children:[s.jsx(K,{checked:n,disabled:r,onChange:c,label:"Also offer directories outside your home directory"}),s.jsxs("span",{children:["Also offer directories outside ",s.jsx("code",{children:e.homeDir}),m>0&&` (${m} hidden)`]})]})]})}function Ae({claudeHome:e,onStartChat:t}){return s.jsx(R,{variant:"panel",icon:s.jsx(ue,{width:22,height:22}),title:"Nothing to adopt yet",body:s.jsxs(s.Fragment,{children:["No Claude Code history has been recorded under"," ",s.jsx("code",{className:"break-all",children:e}),". That is normal on a new install, and on a container whose Claude home is its own rather than yours — nothing is wrong. Start a chat here and Paddock writes its own history; or bind-mount an existing one there and re-open this page, or import it headlessly with ",s.jsx("code",{children:"npm run import-chats"}),"."]}),action:t&&s.jsx($,{variant:"primary",icon:s.jsx(he,{width:14,height:14}),onClick:t,children:"Start a chat"})})}function De({imported:e,projects:t,onGetStarted:n}){return s.jsx("div",{className:"mb-6",children:s.jsx(R,{variant:"panel",icon:s.jsx(Z,{width:22,height:22}),title:t===0?"Nothing was adopted":`${t} project${t===1?"":"s"}, ${e} conversation${e===1?"":"s"}`,body:t===0?"Every row failed. Each one says why below.":"They are in the sidebar now. Anything that did not land says why below.",action:s.jsx($,{variant:"primary",onClick:()=>void n(),children:"Get started"})})})}function Te(){return s.jsx("div",{className:"space-y-2","aria-label":"Scanning",role:"status",children:[0,1,2].map(e=>s.jsx("div",{className:"h-16 animate-pulse rounded-2xl bg-surface-active"},e))})}function Re(e){const t=[],n=[["temp-root",a=>`${a} in temp directories`],["no-git",a=>`${a} without a git repository`],["outside-home",a=>`${a} outside your home directory`],["already-managed",a=>`${a} already a project`],["no-sessions",a=>`${a} with nothing to adopt`],["no-recorded-cwd",a=>`${a} with no recorded directory`],["missing",a=>`${a} no longer on disk`],["home-root",a=>`${a} your home directory itself`],["system-path",a=>`${a} system directories`],["paddock-internal",a=>`${a} inside Paddock's own data`]];for(const[a,c]of n){const l=e.excluded[a];l!==void 0&&l>0&&t.push(c(l))}const r=`${e.scanned} transcript folder${e.scanned===1?"":"s"} scanned`;return t.length===0?`${r}.`:`${r}; skipped ${t.join(", ")}.`}function Q(e){var r,a;const t=(r=e.autoName)==null?void 0:r.trim();if(t!==void 0&&t!=="")return t;const n=(a=e.preview)==null?void 0:a.trim();return n!==void 0&&n!==""?n:e.sessionId}function U(e){const t=new Date(e);return Number.isNaN(t.getTime())?"unknown date":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ze(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} kB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{He as D};
2
2
 
@@ -1,2 +1,2 @@
1
- import{r as d,n as Z,s as ee,A as te,p as je,j as e,q as ie,l as b,t as le,v as ve,w as ye,x as oe,y as we,z as E,D as ce,E as L,F as Ne,b as D,G as de,H as ke,I as B,X as Se,J as Ce,K as Ae,M as Ee,O as Re,Q as Pe,U as Me,V as $e,W as Fe,Y as Oe,Z as Ie}from"./index-BaPY10t-.js";import{S as ne}from"./Surfaces-CFgCNuC1.js";const Te=Array.from({length:72},(t,n)=>n*5),A=[...le].sort((t,n)=>t.hue-n.hue),z=(t,n)=>Math.min(Math.abs(t-n),360-Math.abs(t-n));function se(t){const n=A.reduce((i,s)=>z(s.hue,t)<z(i.hue,t)?s:i);if(z(n.hue,t)<=8)return n.name;const a=A.find(i=>i.hue>t)??A[0];return`between ${A[(A.indexOf(a)-1+A.length)%A.length].name} and ${a.name}`}function Le({theme:t,dark:n,hue:a,className:u}){const i=d.useRef(null);return d.useLayoutEffect(()=>{const s=i.current;s&&(a===null?ye(s):oe(a,s))},[t,n,a]),e.jsx("div",{ref:i,"data-theme":t,className:b("overflow-hidden rounded-lg border border-edge",n&&"dark",u),children:e.jsxs("div",{className:"flex h-full items-center gap-2 bg-surface p-2",children:[e.jsxs("div",{className:"flex-1 rounded-md border border-edge-subtle bg-surface-raised p-1.5",children:[e.jsx("div",{className:"h-1 w-4/5 rounded-full bg-fg"}),e.jsx("div",{className:"mt-1 h-1 w-3/5 rounded-full bg-fg-subtle"})]}),e.jsx("div",{className:"grid h-6 w-6 shrink-0 place-items-center rounded-md bg-accent-solid",children:e.jsx("div",{className:"h-1 w-3 rounded-full bg-accent-fg"})})]})})}function De({hexes:t,hue:n,active:a,onCommit:u}){const i=d.useRef(null),s=d.useRef(null),o=d.useRef(null),x=d.useRef(0),h=d.useRef(null),p=d.useRef(!1),g=d.useRef(null),c=d.useMemo(()=>{if(t.length===0)return;const m=t.map((j,w)=>`${j} ${(w/t.length*100).toFixed(2)}%`);return m.push(`${t[0]} 100%`),`linear-gradient(to right, ${m.join(", ")})`},[t]),f=d.useCallback(m=>{s.current&&(s.current.style.left=`${m/360*100}%`),o.current&&(o.current.textContent=se(m))},[]);d.useEffect(()=>{p.current||f(n)},[n,f]);const N=m=>{var P;const j=(P=i.current)==null?void 0:P.getBoundingClientRect();if(!j||j.width===0)return 0;const w=Math.min(1,Math.max(0,(m-j.left)/j.width));return Math.round(w*360)%360},y=d.useCallback(m=>{h.current=m,!x.current&&(x.current=requestAnimationFrame(()=>{x.current=0;const j=h.current;h.current=null,j!==null&&(f(j),oe(j,document.documentElement,{context:g.current??void 0,live:!0}))}))},[f]);d.useEffect(()=>()=>cancelAnimationFrame(x.current),[]);const I=m=>{p.current=!1,g.current=null,cancelAnimationFrame(x.current),x.current=0,h.current=null,u(m)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-2 flex items-baseline justify-between gap-2",children:[e.jsx("span",{className:"text-3xs text-fg-subtle",children:"Drag along the strip"}),e.jsx("span",{ref:o,className:"text-3xs font-medium text-fg-muted","aria-hidden":!0})]}),e.jsx("div",{ref:i,role:"slider",tabIndex:0,"aria-label":"Accent colour","aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":n,"aria-valuetext":a?se(n):"the theme’s own colour",onPointerDown:m=>{m.currentTarget.setPointerCapture(m.pointerId),p.current=!0,g.current=we(),y(N(m.clientX))},onPointerMove:m=>{p.current&&y(N(m.clientX))},onPointerUp:m=>{p.current&&I(N(m.clientX))},onPointerCancel:()=>{p.current&&I(n)},onKeyDown:m=>{const j=m.key==="PageUp"||m.key==="PageDown"?15:m.shiftKey?10:2;let w=null;m.key==="ArrowLeft"||m.key==="ArrowDown"||m.key==="PageDown"?w=(n-j+360)%360:m.key==="ArrowRight"||m.key==="ArrowUp"||m.key==="PageUp"?w=(n+j)%360:m.key==="Home"?w=0:m.key==="End"&&(w=359),w!==null&&(m.preventDefault(),u(w))},style:{backgroundImage:c,touchAction:"none"},className:b("relative mt-1 h-8 cursor-pointer rounded-lg border border-edge shadow-xs select-none","focus-visible:focus-ring"),children:e.jsx("div",{ref:s,"aria-hidden":!0,style:{left:`${n/360*100}%`},className:b("pointer-events-none absolute top-1/2 h-[calc(100%+6px)] w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full","border border-fg bg-surface-raised shadow-sm",!a&&"opacity-0")})})]})}function Ve({className:t}){const[n,a]=d.useState(Z),[u,i]=d.useState(null),s=typeof document<"u"&&document.documentElement.classList.contains("dark"),o=d.useRef(n),x=d.useCallback(c=>{const f={...o.current,...c};o.current=f,a(f),i(ee(f))},[]);d.useEffect(()=>{const c=f=>i(f.detail);return window.addEventListener(te,c),i(ee(Z())),()=>window.removeEventListener(te,c)},[]);const h=d.useMemo(()=>je(Te),[n.theme,s,u==null?void 0:u.mode]),p=(u==null?void 0:u.hue)??0,g=n.hue!==null;return e.jsxs("div",{className:b("space-y-5",t),children:[e.jsxs("fieldset",{children:[e.jsx("legend",{className:"text-2xs font-semibold uppercase tracking-wide text-fg-muted",children:"Theme"}),e.jsx("div",{className:b("mt-2 grid gap-2","grid-cols-2 sm:grid-cols-4"),children:ie.map(c=>{const f=n.theme===c.id;return e.jsxs("button",{type:"button","aria-pressed":f,title:`${c.label} — ${c.blurb}`,onClick:()=>x({theme:c.id}),className:b("motion-fast rounded-xl border text-left transition-[border-color,box-shadow]","focus-visible:focus-ring","p-1.5",f?"border-accent-edge bg-accent-soft shadow-xs":"border-edge bg-surface-raised hover:border-edge-strong"),children:[e.jsx(Le,{theme:c.id,dark:s,hue:n.hue,className:"h-10"}),e.jsxs("div",{className:"mt-1.5 min-w-0 px-0.5 pb-0.5",children:[e.jsx("span",{className:"block truncate text-xs font-semibold text-fg",children:c.label}),e.jsx("span",{className:"mt-0.5 line-clamp-2 text-3xs leading-snug text-fg-muted",children:c.blurb})]})]},c.id)})})]}),e.jsxs("div",{className:b("grid gap-5 lg:grid-cols-[minmax(0,1fr)_15rem] lg:items-start"),children:[e.jsxs("fieldset",{children:[e.jsx("legend",{className:"text-2xs font-semibold uppercase tracking-wide text-fg-muted",children:"Accent colour"}),e.jsx("p",{className:"mt-1 text-3xs leading-snug text-fg-subtle",children:"Pick any colour. The theme adjusts it so buttons and labels stay readable in both light and dark."}),e.jsx(De,{hexes:h,hue:p,active:g,onCommit:c=>x({hue:c})}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[e.jsx("button",{type:"button",onClick:()=>x({hue:null}),"aria-pressed":!g,className:b("motion-fast rounded-md border px-2 py-1 text-3xs transition-colors","focus-visible:focus-ring",g?"border-edge text-fg-muted hover:border-edge-strong hover:text-fg":"border-accent-edge bg-accent-soft text-accent"),children:"Theme’s own"}),le.map(c=>{const f=g&&Math.abs(p-c.hue)<2.5;return e.jsxs("button",{type:"button","aria-pressed":f,onClick:()=>x({hue:c.hue}),className:b("motion-fast inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-3xs transition-colors","focus-visible:focus-ring",f?"border-edge-strong bg-surface-active text-fg":"border-edge text-fg-muted hover:border-edge-strong hover:text-fg"),children:[e.jsx("span",{"aria-hidden":!0,className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:h[Math.round(c.hue/5)%h.length]}}),c.name]},c.name)})]})]}),e.jsxs("fieldset",{children:[e.jsx("legend",{className:"text-2xs font-semibold uppercase tracking-wide text-fg-muted",children:"Tint the background"}),e.jsx("p",{className:"mt-1 text-3xs leading-snug text-fg-subtle",children:"Colours the whole page a little, not just the buttons. Useful for telling two Paddock instances apart at a glance."}),e.jsx("div",{className:"mt-2 inline-flex rounded-lg border border-edge p-0.5",children:ve.map(c=>e.jsx("button",{type:"button","aria-pressed":n.tint===c.level,onClick:()=>x({tint:c.level}),className:b("motion-fast rounded-md px-2.5 py-1 text-3xs transition-colors","focus-visible:focus-ring",n.tint===c.level?"bg-surface-active font-medium text-fg":"text-fg-muted hover:text-fg"),children:c.label},c.level))})]})]}),e.jsx(Ue,{})]})}function Ue(){return e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-wide text-fg-muted",children:"Preview"}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 rounded-xl border border-edge bg-surface p-3",children:[e.jsx(E,{variant:"primary",size:"sm",children:"Send"}),e.jsx(E,{variant:"ghost",size:"sm",children:"Cancel"}),e.jsx(E,{variant:"link",size:"sm",children:"A link"}),e.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-accent-edge bg-accent-soft px-1.5 py-0.5 text-2xs font-medium text-accent",children:"accent chip"}),e.jsx(ce,{tone:"accent",shape:"pill",dot:!0,children:"running"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-fg-subtle",children:[e.jsx("span",{className:"h-4 w-4 rounded-md border border-edge bg-accent-solid-hover","aria-hidden":!0}),"hovered"]}),e.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5",children:[e.jsx(L,{tone:"success"}),e.jsx(L,{tone:"warn"}),e.jsx(L,{tone:"danger"}),e.jsx(L,{tone:"info"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"status hues (theme’s, not yours)"})]})]})]})}const G="mx-auto w-full max-w-4xl",Be="sm:w-64";function _e(){const[t,n]=d.useState(null),[a,u]=d.useState(!0),[i,s]=d.useState(null),[o,x]=d.useState({}),[h,p]=d.useState(!1),[g,c]=d.useState(null),[f,N]=d.useState(!1),[y,I]=d.useState(""),[m,j]=d.useState(!1),[w,P]=d.useState(null),X=d.useRef(null),ue=Ne("(min-width: 1024px)");d.useEffect(()=>{let r=!0;return u(!0),D.getInstanceConfig().then(l=>{r&&(n(l),s(null))}).catch(l=>r&&s(l instanceof Error?l.message:String(l))).finally(()=>r&&u(!1)),()=>{r=!1}},[]);const me=(r,l)=>{N(!1),c(null),x(v=>({...v,[r]:l}))},xe=r=>re(r,o),M=d.useMemo(()=>t?t.groups.flatMap(r=>r.fields):[],[t]),k=d.useMemo(()=>M.filter(r=>r.editable&&!r.envOverridden).filter(r=>Object.prototype.hasOwnProperty.call(o,r.key)).filter(r=>!ae(o[r.key],q(r))).map(r=>r.key),[M,o]),J=d.useMemo(()=>new Set(k),[k]),S=d.useMemo(()=>{if(!t)return[];const r=y.trim().toLowerCase(),l=[];for(const v of t.groups){const F=r!==""&&v.label.toLowerCase().includes(r),O=v.fields.filter(R=>{const T=re(R,o);return m&&ae(T,R.default)?!1:r===""||F?!0:tt(R).includes(r)});O.length>0&&l.push({...v,fields:O})}return l},[t,y,m,o]),W=S.reduce((r,l)=>r+l.fields.length,0),he=y.trim()!==""||m,_=!m&&(y.trim()===""||st.includes(y.trim().toLowerCase())),$=d.useMemo(()=>_?[U,...S]:S,[_,S]),fe=S.some(r=>r.fields.some(l=>l.envOverridden)),H=d.useMemo(()=>{const r=M.find(l=>l.key==="profile");return typeof(r==null?void 0:r.value)=="string"?r.value:null},[M]),ge=S.some(r=>r.fields.some(l=>l.fromProfile)),Y=nt(S,J);d.useEffect(()=>{const r=X.current;if(!r||$.length===0)return;const l=$.map(F=>F.id),v=()=>{const F=r.getBoundingClientRect().top;let O=l[0];for(const R of l){const T=document.getElementById(V(R));if(T)if(T.getBoundingClientRect().top-F<=80)O=R;else break}P(O)};return v(),r.addEventListener("scroll",v,{passive:!0}),()=>r.removeEventListener("scroll",v)},[$]);const Q=r=>{var v;const l=document.getElementById(V(r));(v=l==null?void 0:l.scrollIntoView)==null||v.call(l,{behavior:"smooth",block:"start"}),P(r)},pe=async()=>{if(k.length===0||!t)return;const r={};for(const l of k)r[l]=o[l];p(!0),c(null);try{await D.updateInstanceConfig(r,t.configVersion);const l=await D.getInstanceConfig();n(l),x({}),N(!0)}catch(l){if(l instanceof Re&&l.status===409)try{n(await D.getInstanceConfig())}catch{}c(l instanceof Error?l.message:String(l))}finally{p(!1)}},be=()=>{x({}),c(null),N(!1)};return e.jsxs("div",{className:"flex min-h-0 flex-1",children:[t&&e.jsx(He,{groups:$,active:w,onJump:Q,dirtyCount:Y}),e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[t&&e.jsx("div",{className:"border-b border-edge px-4 py-2.5 sm:px-6",children:e.jsxs("div",{className:G,children:[e.jsx(Ge,{query:y,onQuery:I,modifiedOnly:m,onModifiedOnly:j,visibleCount:W,totalCount:M.length,filtering:he,autoFocus:ue}),e.jsx(ze,{groups:$,active:w,onJump:Q,dirtyCount:Y})]})}),e.jsx("div",{ref:X,className:"min-h-0 flex-1 overflow-y-auto px-4 py-5 sm:px-6",children:e.jsxs("div",{className:G,children:[_&&e.jsx("div",{className:"mb-8 border-b border-edge pb-7",children:e.jsx(ne,{id:V(U.id),title:U.label,description:U.description,variant:"rule",first:!0,children:e.jsx(Ve,{})})}),e.jsx(Ke,{saved:f,configPath:t==null?void 0:t.configPath,restartRequired:(t==null?void 0:t.restartRequired)??!1,fileError:t==null?void 0:t.configFileError}),a&&e.jsx("p",{className:"text-sm text-fg-muted",children:"Loading…"}),i&&e.jsxs("p",{className:"text-sm text-danger",role:"alert",children:["Failed to load settings: ",i]}),t&&ge&&H&&e.jsx(qe,{name:H}),t&&fe&&e.jsx(Je,{}),t&&W===0&&e.jsxs("p",{className:"py-8 text-center text-sm text-fg-muted",children:["No settings match"," ",y.trim()?e.jsxs(e.Fragment,{children:["“",e.jsx("span",{className:"font-medium",children:y.trim()}),"”"]}):"this filter","."]}),S.map(r=>e.jsx(ne,{id:V(r.id),title:r.label,description:r.description,variant:"card",flush:!0,children:e.jsx("div",{className:"divide-y divide-edge-subtle",children:r.fields.map(l=>e.jsx(We,{field:l,value:xe(l),dirty:J.has(l.key),profileName:H,onChange:v=>me(l.key,v)},l.key))})},r.id))]})}),t&&e.jsx("footer",{className:"border-t border-edge px-4 py-3 sm:px-6",children:e.jsxs("div",{className:`${G} flex items-center gap-3`,children:[g&&e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-sm text-danger",role:"alert",children:[e.jsx(de,{width:14,height:14,className:"shrink-0"}),e.jsx("span",{className:"truncate",children:g})]}),e.jsx("span",{className:"ml-auto shrink-0 text-xs tabular text-fg-subtle",children:k.length>0?`${k.length} unsaved change${k.length===1?"":"s"}`:"No changes"}),e.jsx(E,{variant:"subtle",onClick:be,disabled:k.length===0||h,children:"Reset"}),e.jsx(E,{variant:"primary",onClick:pe,disabled:k.length===0,loading:h,loadingLabel:"Saving…",children:"Save changes"})]})})]})]})}function He({groups:t,active:n,onJump:a,dirtyCount:u}){return e.jsx("nav",{"aria-label":"Config sections",className:"hidden w-52 shrink-0 overflow-y-auto border-r border-edge px-2 py-4 lg:block",children:e.jsx("ul",{className:"space-y-0.5",children:t.map(i=>{const s=i.id===n,o=u[i.id]??0;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>a(i.id),"aria-current":s?"true":void 0,className:b("motion-fast flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors",s?"bg-surface-selected font-medium text-fg":"text-fg-muted hover:bg-surface-hover hover:text-fg"),children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.label}),o>0&&e.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-accent-solid","aria-label":`${o} unsaved`}),i.fields.length>0&&e.jsx("span",{className:"shrink-0 text-2xs tabular text-fg-subtle",children:i.fields.length})]})},i.id)})})})}function ze({groups:t,active:n,onJump:a,dirtyCount:u}){return t.length===0?null:e.jsx("nav",{"aria-label":"Config sections",className:"-mx-1 mt-2 flex gap-1 overflow-x-auto px-1 pb-0.5 lg:hidden",children:t.map(i=>{const s=i.id===n,o=u[i.id]??0;return e.jsxs("button",{type:"button",onClick:()=>a(i.id),"aria-current":s?"true":void 0,className:b("motion-fast flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors",s?"bg-surface-selected font-medium text-fg":"text-fg-muted hover:bg-surface-hover hover:text-fg"),children:[i.label,o>0&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent-solid","aria-label":`${o} unsaved`})]},i.id)})})}function Ge({query:t,onQuery:n,modifiedOnly:a,onModifiedOnly:u,visibleCount:i,totalCount:s,filtering:o,autoFocus:x}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"relative min-w-0 flex-1 sm:max-w-sm",children:[e.jsx(ke,{width:14,height:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-fg-subtle"}),e.jsx(B,{type:"search","aria-label":"Search settings",placeholder:"Search settings, keys, env vars…",className:"h-8 py-0 pl-8 pr-7 [&::-webkit-search-cancel-button]:appearance-none",value:t,autoFocus:x,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&t!==""&&(h.preventDefault(),n(""))}}),t!==""&&e.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>n(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-fg-subtle hover:text-fg",children:e.jsx(Se,{width:13,height:13})})]}),e.jsx("button",{type:"button","aria-pressed":a,onClick:()=>u(!a),className:b("motion-fast shrink-0 rounded-md border px-2.5 py-1 text-xs transition-colors",a?"border-accent-edge bg-accent-soft text-accent":"border-edge text-fg-muted hover:text-fg"),children:"Modified only"}),e.jsx("span",{className:"shrink-0 text-xs tabular text-fg-subtle",children:o?`${i} of ${s}`:`${s} settings`})]})}function Ke({saved:t,configPath:n,restartRequired:a,fileError:u}){const i=u?"danger":t?"success":"warn";return e.jsx(Ce,{tone:i,className:"mb-5 leading-snug",icon:i==="success"?e.jsx(Ae,{width:15,height:15}):e.jsx(de,{width:15,height:15}),children:e.jsx("span",{role:"status",children:u?e.jsxs(e.Fragment,{children:[e.jsxs("strong",{children:["Could not read ",K(n),"."]})," ",u," — the values below are the running instance's; what a restart would load is unknown until the file parses."]}):t?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"Saved to disk."})," These changes take effect only after the server restarts."]}):a?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"Restart pending."})," ",e.jsx("code",{className:"font-mono text-xs",children:K(n)})," holds changes the running instance has not picked up — the fields below marked"," ",e.jsx(C,{tone:"warn",children:"restart"})," differ from what is in force right now."]}):e.jsxs(e.Fragment,{children:["Changes here are written to"," ",e.jsx("code",{className:"font-mono text-xs",children:K(n)})," and take effect only after the server restarts — the running instance keeps its current config until then."]})})})}function qe({name:t}){return e.jsxs("p",{className:"mb-3 text-xs leading-snug text-fg-muted",children:["This instance's posture profile is ",e.jsx("span",{className:"font-medium text-fg",children:t}),". Settings marked ",e.jsx(C,{tone:"neutral",children:"profile"})," are the ones it chose; anything you set yourself, here or in the environment, wins over it."," ",e.jsx("a",{className:"underline decoration-edge underline-offset-2 hover:text-fg",href:Xe,target:"_blank",rel:"noreferrer",children:"What the profiles do"})]})}const Xe="https://paddock.edspencer.net/configuration/profiles/";function Je(){return e.jsxs("p",{className:"mb-5 text-xs leading-snug text-fg-muted",children:["Settings marked ",e.jsx(C,{tone:"neutral",children:"env"})," are overridden by an environment variable, which wins over this file — edit that variable (and restart) to change them."]})}function We({field:t,value:n,dirty:a,profileName:u,onChange:i}){const s=!t.editable||t.envOverridden,o=`cfg-${t.key}`,x=t.help?`${o}-help`:void 0,h=t.type==="boolean",p=d.useMemo(()=>et(t,q(t)),[t]),g=h&&!s,c=!t.help&&!t.envOverridden&&!t.pendingRestart,f=c?"items-center":"items-start",N=c?"sm:items-center":"sm:items-start",y=s?e.jsx(Ze,{field:t,value:n}):h?e.jsx(Ee,{id:o,checked:!!n,onChange:i,label:t.label}):e.jsx(Qe,{field:t,value:n,onChange:i,inputId:o,describedBy:x});return e.jsxs("div",{className:"relative px-4 py-3",children:[a&&e.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-2 left-0 w-0.5 rounded-full bg-accent-solid"}),e.jsxs("div",{className:b(p?"":g?`flex gap-4 ${f}`:`sm:flex sm:gap-6 ${N}`),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("label",{htmlFor:s?void 0:o,className:"text-sm font-medium text-fg",children:t.label}),t.sensitive&&e.jsx(C,{tone:"warn",children:"sensitive"}),t.envOverridden&&e.jsx(C,{tone:"neutral",title:`Overridden by environment variable ${t.envVar} — edit that env var (and restart) to change it.`,children:"env"}),t.fromProfile&&e.jsx(C,{tone:"neutral",title:u?`Set by the "${u}" posture profile — neither this config file nor an environment variable overrides it.`:"Set by this instance's posture profile — neither this config file nor an environment variable overrides it.",children:"profile"}),!t.editable&&!t.envOverridden&&e.jsx(C,{tone:"neutral",children:"read-only"}),t.pendingRestart&&e.jsx(C,{tone:"warn",title:"The config file and the running instance disagree on this field — restart to apply.",children:"restart"})]}),t.help&&e.jsx("p",{id:x,className:"mt-0.5 text-xs leading-snug text-fg-muted",children:t.help}),t.envOverridden&&e.jsx("p",{className:"mt-1 truncate font-mono text-2xs text-fg-subtle",children:t.envVar}),t.pendingRestart&&e.jsxs("p",{className:"mt-1 text-2xs leading-snug text-warn",children:["In force now: ",e.jsx("span",{className:"font-mono",children:Ye(t.value)})]})]}),e.jsx("div",{className:b(p?"mt-2":g?"flex shrink-0 justify-end":`mt-2 sm:mt-0 sm:shrink-0 ${Be}`),children:y})]})]})}function Ye(t){if(t==null||t==="")return"(not set)";const a=(Array.isArray(t)?t.join(", "):String(t)).replace(/\s+/g," ").trim();return a.length>60?`${a.slice(0,60)}…`:a}function C({children:t,tone:n,title:a}){return e.jsx(ce,{tone:n,size:"sm",title:a,className:"uppercase tracking-wide",children:t})}function Qe({field:t,value:n,onChange:a,inputId:u,describedBy:i}){if(t.type==="enum")return e.jsx(Pe,{id:u,"aria-describedby":i,value:String(n??""),onChange:s=>a(s.target.value),children:(t.enumValues??[]).map(s=>e.jsx("option",{value:s,children:s},s))});if(t.type==="number")return e.jsx(B,{id:u,type:"number","aria-describedby":i,className:"tabular",value:n==null?"":String(n),placeholder:t.default===null?"default":String(t.default),onChange:s=>a(s.target.value===""?null:Number(s.target.value))});if(t.type==="text"){const s=n==null||n===t.default,o=n==null?String(t.default??""):String(n),x=typeof t.default=="string"&&!s;return e.jsxs("div",{children:[e.jsx(Me,{id:u,"aria-describedby":i,className:"min-h-[7rem] font-mono text-xs leading-relaxed",rows:6,spellCheck:!1,value:o,onChange:h=>a(h.target.value)}),e.jsxs("div",{className:"mt-1 flex items-center justify-between gap-3 text-xs text-fg-muted",children:[e.jsx("span",{children:s?"Using the built-in default.":n===""?"Empty — nothing will be appended.":`${o.length.toLocaleString()} characters.`}),x&&e.jsx(E,{variant:"link",size:"sm",className:"shrink-0",onClick:()=>a(null),children:"Restore default"})]})]})}if(t.type==="string-list"){const s=Array.isArray(t.default)?t.default.map(String):null,o=Array.isArray(n)?n.map(String):null,x=o===null||s!==null&&o.length===s.length&&o.every((g,c)=>g===s[c]),h=o!==null?o.join(", "):(s==null?void 0:s.join(", "))??"",p=s!==null&&!x;return e.jsxs("div",{children:[e.jsx(B,{id:u,type:"text","aria-describedby":i,value:h,placeholder:(s==null?void 0:s.join(", "))??"",onChange:g=>a(g.target.value.split(",").map(c=>c.trim()).filter(Boolean))}),e.jsxs("div",{className:"mt-1 flex items-center justify-between gap-3 text-xs text-fg-muted",children:[e.jsx("span",{children:x?"Using the built-in default.":o!==null&&o.length===0?"Empty — none offered.":`${(o==null?void 0:o.length)??0} in the list.`}),p&&e.jsx(E,{variant:"link",size:"sm",className:"shrink-0",onClick:()=>a(null),children:"Restore default"})]})]})}return e.jsx(B,{id:u,type:"text","aria-describedby":i,value:n==null?"":String(n),placeholder:t.default===null?"":String(t.default),onChange:s=>a(s.target.value)})}function Ze({field:t,value:n}){const a="rounded-lg bg-surface-sunken px-3 py-2 font-mono text-xs text-fg-muted";return t.type==="boolean"?e.jsx("div",{className:a,children:n?"true":"false"}):n==null||n===""?e.jsx("div",{className:a,children:e.jsx("span",{className:"italic text-fg-subtle",children:t.type==="text"&&n===""?"(empty — nothing appended)":"(not set)"})}):t.type==="text"?e.jsx("div",{className:b(a,"max-h-40 overflow-y-auto whitespace-pre-wrap leading-relaxed"),children:String(n)}):e.jsx("div",{className:b(a,"break-all"),children:Array.isArray(n)?n.join(", "):String(n)})}function et(t,n){return t.type==="text"||t.type==="string-list"?!0:(Array.isArray(n)?n.join(", "):n==null?"":String(n)).length>38}function tt(t){return[t.label,t.key,t.help,t.envVar,...t.enumValues??[]].filter(Boolean).join(" ").toLowerCase()}function nt(t,n){const a={};for(const u of t)a[u.id]=u.fields.filter(i=>n.has(i.key)).length;return a}const V=t=>`cfg-section-${t}`,U={id:"appearance",label:"Appearance",description:"Theme and accent colour for this browser. Applies immediately — no save, no restart.",fields:[]},st=["appearance theme themes colour color accent tint dark light font",...ie.map(t=>t.id)].join(" ");function q(t){return t.pendingValue===void 0?t.value:t.pendingValue}function re(t,n){return Object.prototype.hasOwnProperty.call(n,t.key)?n[t.key]:q(t)}function ae(t,n){return Array.isArray(t)&&Array.isArray(n)?t.length===n.length&&t.every((a,u)=>a===n[u]):t===n}function K(t){if(!t)return"paddock.config.yaml";const n=t.split("/");return n[n.length-1]||t}function it(){const t=$e(),n=(t==null?void 0:t.openNav)??(()=>{});return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("header",{className:"pt-safe flex items-center gap-2 border-b border-edge px-3 pb-2.5 sm:px-6 lg:py-4",children:[e.jsx("button",{type:"button",onClick:n,"aria-label":"Open menu",className:"btn-subtle -ml-1 shrink-0 px-2 py-1.5 lg:hidden",children:e.jsx(Fe,{width:20,height:20})}),e.jsx(Oe,{width:18,height:18,className:"shrink-0 text-fg-subtle"}),e.jsx("h1",{className:"text-md font-semibold tracking-tight",children:"Config"})]}),e.jsx(Ie,{}),e.jsx(_e,{})]})}export{it as InstanceConfigPage};
1
+ import{r as d,n as Z,s as ee,A as te,p as je,j as e,q as ie,l as b,t as le,v as ve,w as ye,x as oe,y as we,z as E,D as ce,E as L,F as Ne,b as D,G as de,H as ke,I as B,X as Se,J as Ce,K as Ae,M as Ee,O as Re,Q as Pe,U as Me,V as $e,W as Fe,Y as Oe,Z as Ie}from"./index-WSqceBAp.js";import{S as ne}from"./Surfaces-CcrPbt9t.js";const Te=Array.from({length:72},(t,n)=>n*5),A=[...le].sort((t,n)=>t.hue-n.hue),z=(t,n)=>Math.min(Math.abs(t-n),360-Math.abs(t-n));function se(t){const n=A.reduce((i,s)=>z(s.hue,t)<z(i.hue,t)?s:i);if(z(n.hue,t)<=8)return n.name;const a=A.find(i=>i.hue>t)??A[0];return`between ${A[(A.indexOf(a)-1+A.length)%A.length].name} and ${a.name}`}function Le({theme:t,dark:n,hue:a,className:u}){const i=d.useRef(null);return d.useLayoutEffect(()=>{const s=i.current;s&&(a===null?ye(s):oe(a,s))},[t,n,a]),e.jsx("div",{ref:i,"data-theme":t,className:b("overflow-hidden rounded-lg border border-edge",n&&"dark",u),children:e.jsxs("div",{className:"flex h-full items-center gap-2 bg-surface p-2",children:[e.jsxs("div",{className:"flex-1 rounded-md border border-edge-subtle bg-surface-raised p-1.5",children:[e.jsx("div",{className:"h-1 w-4/5 rounded-full bg-fg"}),e.jsx("div",{className:"mt-1 h-1 w-3/5 rounded-full bg-fg-subtle"})]}),e.jsx("div",{className:"grid h-6 w-6 shrink-0 place-items-center rounded-md bg-accent-solid",children:e.jsx("div",{className:"h-1 w-3 rounded-full bg-accent-fg"})})]})})}function De({hexes:t,hue:n,active:a,onCommit:u}){const i=d.useRef(null),s=d.useRef(null),o=d.useRef(null),x=d.useRef(0),h=d.useRef(null),p=d.useRef(!1),g=d.useRef(null),c=d.useMemo(()=>{if(t.length===0)return;const m=t.map((j,w)=>`${j} ${(w/t.length*100).toFixed(2)}%`);return m.push(`${t[0]} 100%`),`linear-gradient(to right, ${m.join(", ")})`},[t]),f=d.useCallback(m=>{s.current&&(s.current.style.left=`${m/360*100}%`),o.current&&(o.current.textContent=se(m))},[]);d.useEffect(()=>{p.current||f(n)},[n,f]);const N=m=>{var P;const j=(P=i.current)==null?void 0:P.getBoundingClientRect();if(!j||j.width===0)return 0;const w=Math.min(1,Math.max(0,(m-j.left)/j.width));return Math.round(w*360)%360},y=d.useCallback(m=>{h.current=m,!x.current&&(x.current=requestAnimationFrame(()=>{x.current=0;const j=h.current;h.current=null,j!==null&&(f(j),oe(j,document.documentElement,{context:g.current??void 0,live:!0}))}))},[f]);d.useEffect(()=>()=>cancelAnimationFrame(x.current),[]);const I=m=>{p.current=!1,g.current=null,cancelAnimationFrame(x.current),x.current=0,h.current=null,u(m)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-2 flex items-baseline justify-between gap-2",children:[e.jsx("span",{className:"text-3xs text-fg-subtle",children:"Drag along the strip"}),e.jsx("span",{ref:o,className:"text-3xs font-medium text-fg-muted","aria-hidden":!0})]}),e.jsx("div",{ref:i,role:"slider",tabIndex:0,"aria-label":"Accent colour","aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":n,"aria-valuetext":a?se(n):"the theme’s own colour",onPointerDown:m=>{m.currentTarget.setPointerCapture(m.pointerId),p.current=!0,g.current=we(),y(N(m.clientX))},onPointerMove:m=>{p.current&&y(N(m.clientX))},onPointerUp:m=>{p.current&&I(N(m.clientX))},onPointerCancel:()=>{p.current&&I(n)},onKeyDown:m=>{const j=m.key==="PageUp"||m.key==="PageDown"?15:m.shiftKey?10:2;let w=null;m.key==="ArrowLeft"||m.key==="ArrowDown"||m.key==="PageDown"?w=(n-j+360)%360:m.key==="ArrowRight"||m.key==="ArrowUp"||m.key==="PageUp"?w=(n+j)%360:m.key==="Home"?w=0:m.key==="End"&&(w=359),w!==null&&(m.preventDefault(),u(w))},style:{backgroundImage:c,touchAction:"none"},className:b("relative mt-1 h-8 cursor-pointer rounded-lg border border-edge shadow-xs select-none","focus-visible:focus-ring"),children:e.jsx("div",{ref:s,"aria-hidden":!0,style:{left:`${n/360*100}%`},className:b("pointer-events-none absolute top-1/2 h-[calc(100%+6px)] w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full","border border-fg bg-surface-raised shadow-sm",!a&&"opacity-0")})})]})}function Ve({className:t}){const[n,a]=d.useState(Z),[u,i]=d.useState(null),s=typeof document<"u"&&document.documentElement.classList.contains("dark"),o=d.useRef(n),x=d.useCallback(c=>{const f={...o.current,...c};o.current=f,a(f),i(ee(f))},[]);d.useEffect(()=>{const c=f=>i(f.detail);return window.addEventListener(te,c),i(ee(Z())),()=>window.removeEventListener(te,c)},[]);const h=d.useMemo(()=>je(Te),[n.theme,s,u==null?void 0:u.mode]),p=(u==null?void 0:u.hue)??0,g=n.hue!==null;return e.jsxs("div",{className:b("space-y-5",t),children:[e.jsxs("fieldset",{children:[e.jsx("legend",{className:"text-2xs font-semibold uppercase tracking-wide text-fg-muted",children:"Theme"}),e.jsx("div",{className:b("mt-2 grid gap-2","grid-cols-2 sm:grid-cols-4"),children:ie.map(c=>{const f=n.theme===c.id;return e.jsxs("button",{type:"button","aria-pressed":f,title:`${c.label} — ${c.blurb}`,onClick:()=>x({theme:c.id}),className:b("motion-fast rounded-xl border text-left transition-[border-color,box-shadow]","focus-visible:focus-ring","p-1.5",f?"border-accent-edge bg-accent-soft shadow-xs":"border-edge bg-surface-raised hover:border-edge-strong"),children:[e.jsx(Le,{theme:c.id,dark:s,hue:n.hue,className:"h-10"}),e.jsxs("div",{className:"mt-1.5 min-w-0 px-0.5 pb-0.5",children:[e.jsx("span",{className:"block truncate text-xs font-semibold text-fg",children:c.label}),e.jsx("span",{className:"mt-0.5 line-clamp-2 text-3xs leading-snug text-fg-muted",children:c.blurb})]})]},c.id)})})]}),e.jsxs("div",{className:b("grid gap-5 lg:grid-cols-[minmax(0,1fr)_15rem] lg:items-start"),children:[e.jsxs("fieldset",{children:[e.jsx("legend",{className:"text-2xs font-semibold uppercase tracking-wide text-fg-muted",children:"Accent colour"}),e.jsx("p",{className:"mt-1 text-3xs leading-snug text-fg-subtle",children:"Pick any colour. The theme adjusts it so buttons and labels stay readable in both light and dark."}),e.jsx(De,{hexes:h,hue:p,active:g,onCommit:c=>x({hue:c})}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[e.jsx("button",{type:"button",onClick:()=>x({hue:null}),"aria-pressed":!g,className:b("motion-fast rounded-md border px-2 py-1 text-3xs transition-colors","focus-visible:focus-ring",g?"border-edge text-fg-muted hover:border-edge-strong hover:text-fg":"border-accent-edge bg-accent-soft text-accent"),children:"Theme’s own"}),le.map(c=>{const f=g&&Math.abs(p-c.hue)<2.5;return e.jsxs("button",{type:"button","aria-pressed":f,onClick:()=>x({hue:c.hue}),className:b("motion-fast inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-3xs transition-colors","focus-visible:focus-ring",f?"border-edge-strong bg-surface-active text-fg":"border-edge text-fg-muted hover:border-edge-strong hover:text-fg"),children:[e.jsx("span",{"aria-hidden":!0,className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:h[Math.round(c.hue/5)%h.length]}}),c.name]},c.name)})]})]}),e.jsxs("fieldset",{children:[e.jsx("legend",{className:"text-2xs font-semibold uppercase tracking-wide text-fg-muted",children:"Tint the background"}),e.jsx("p",{className:"mt-1 text-3xs leading-snug text-fg-subtle",children:"Colours the whole page a little, not just the buttons. Useful for telling two Paddock instances apart at a glance."}),e.jsx("div",{className:"mt-2 inline-flex rounded-lg border border-edge p-0.5",children:ve.map(c=>e.jsx("button",{type:"button","aria-pressed":n.tint===c.level,onClick:()=>x({tint:c.level}),className:b("motion-fast rounded-md px-2.5 py-1 text-3xs transition-colors","focus-visible:focus-ring",n.tint===c.level?"bg-surface-active font-medium text-fg":"text-fg-muted hover:text-fg"),children:c.label},c.level))})]})]}),e.jsx(Ue,{})]})}function Ue(){return e.jsxs("div",{children:[e.jsx("p",{className:"text-2xs font-semibold uppercase tracking-wide text-fg-muted",children:"Preview"}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 rounded-xl border border-edge bg-surface p-3",children:[e.jsx(E,{variant:"primary",size:"sm",children:"Send"}),e.jsx(E,{variant:"ghost",size:"sm",children:"Cancel"}),e.jsx(E,{variant:"link",size:"sm",children:"A link"}),e.jsx("span",{className:"inline-flex items-center gap-1 rounded-md border border-accent-edge bg-accent-soft px-1.5 py-0.5 text-2xs font-medium text-accent",children:"accent chip"}),e.jsx(ce,{tone:"accent",shape:"pill",dot:!0,children:"running"}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-fg-subtle",children:[e.jsx("span",{className:"h-4 w-4 rounded-md border border-edge bg-accent-solid-hover","aria-hidden":!0}),"hovered"]}),e.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5",children:[e.jsx(L,{tone:"success"}),e.jsx(L,{tone:"warn"}),e.jsx(L,{tone:"danger"}),e.jsx(L,{tone:"info"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"status hues (theme’s, not yours)"})]})]})]})}const G="mx-auto w-full max-w-4xl",Be="sm:w-64";function _e(){const[t,n]=d.useState(null),[a,u]=d.useState(!0),[i,s]=d.useState(null),[o,x]=d.useState({}),[h,p]=d.useState(!1),[g,c]=d.useState(null),[f,N]=d.useState(!1),[y,I]=d.useState(""),[m,j]=d.useState(!1),[w,P]=d.useState(null),X=d.useRef(null),ue=Ne("(min-width: 1024px)");d.useEffect(()=>{let r=!0;return u(!0),D.getInstanceConfig().then(l=>{r&&(n(l),s(null))}).catch(l=>r&&s(l instanceof Error?l.message:String(l))).finally(()=>r&&u(!1)),()=>{r=!1}},[]);const me=(r,l)=>{N(!1),c(null),x(v=>({...v,[r]:l}))},xe=r=>re(r,o),M=d.useMemo(()=>t?t.groups.flatMap(r=>r.fields):[],[t]),k=d.useMemo(()=>M.filter(r=>r.editable&&!r.envOverridden).filter(r=>Object.prototype.hasOwnProperty.call(o,r.key)).filter(r=>!ae(o[r.key],q(r))).map(r=>r.key),[M,o]),J=d.useMemo(()=>new Set(k),[k]),S=d.useMemo(()=>{if(!t)return[];const r=y.trim().toLowerCase(),l=[];for(const v of t.groups){const F=r!==""&&v.label.toLowerCase().includes(r),O=v.fields.filter(R=>{const T=re(R,o);return m&&ae(T,R.default)?!1:r===""||F?!0:tt(R).includes(r)});O.length>0&&l.push({...v,fields:O})}return l},[t,y,m,o]),W=S.reduce((r,l)=>r+l.fields.length,0),he=y.trim()!==""||m,_=!m&&(y.trim()===""||st.includes(y.trim().toLowerCase())),$=d.useMemo(()=>_?[U,...S]:S,[_,S]),fe=S.some(r=>r.fields.some(l=>l.envOverridden)),H=d.useMemo(()=>{const r=M.find(l=>l.key==="profile");return typeof(r==null?void 0:r.value)=="string"?r.value:null},[M]),ge=S.some(r=>r.fields.some(l=>l.fromProfile)),Y=nt(S,J);d.useEffect(()=>{const r=X.current;if(!r||$.length===0)return;const l=$.map(F=>F.id),v=()=>{const F=r.getBoundingClientRect().top;let O=l[0];for(const R of l){const T=document.getElementById(V(R));if(T)if(T.getBoundingClientRect().top-F<=80)O=R;else break}P(O)};return v(),r.addEventListener("scroll",v,{passive:!0}),()=>r.removeEventListener("scroll",v)},[$]);const Q=r=>{var v;const l=document.getElementById(V(r));(v=l==null?void 0:l.scrollIntoView)==null||v.call(l,{behavior:"smooth",block:"start"}),P(r)},pe=async()=>{if(k.length===0||!t)return;const r={};for(const l of k)r[l]=o[l];p(!0),c(null);try{await D.updateInstanceConfig(r,t.configVersion);const l=await D.getInstanceConfig();n(l),x({}),N(!0)}catch(l){if(l instanceof Re&&l.status===409)try{n(await D.getInstanceConfig())}catch{}c(l instanceof Error?l.message:String(l))}finally{p(!1)}},be=()=>{x({}),c(null),N(!1)};return e.jsxs("div",{className:"flex min-h-0 flex-1",children:[t&&e.jsx(He,{groups:$,active:w,onJump:Q,dirtyCount:Y}),e.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[t&&e.jsx("div",{className:"border-b border-edge px-4 py-2.5 sm:px-6",children:e.jsxs("div",{className:G,children:[e.jsx(Ge,{query:y,onQuery:I,modifiedOnly:m,onModifiedOnly:j,visibleCount:W,totalCount:M.length,filtering:he,autoFocus:ue}),e.jsx(ze,{groups:$,active:w,onJump:Q,dirtyCount:Y})]})}),e.jsx("div",{ref:X,className:"min-h-0 flex-1 overflow-y-auto px-4 py-5 sm:px-6",children:e.jsxs("div",{className:G,children:[_&&e.jsx("div",{className:"mb-8 border-b border-edge pb-7",children:e.jsx(ne,{id:V(U.id),title:U.label,description:U.description,variant:"rule",first:!0,children:e.jsx(Ve,{})})}),e.jsx(Ke,{saved:f,configPath:t==null?void 0:t.configPath,restartRequired:(t==null?void 0:t.restartRequired)??!1,fileError:t==null?void 0:t.configFileError}),a&&e.jsx("p",{className:"text-sm text-fg-muted",children:"Loading…"}),i&&e.jsxs("p",{className:"text-sm text-danger",role:"alert",children:["Failed to load settings: ",i]}),t&&ge&&H&&e.jsx(qe,{name:H}),t&&fe&&e.jsx(Je,{}),t&&W===0&&e.jsxs("p",{className:"py-8 text-center text-sm text-fg-muted",children:["No settings match"," ",y.trim()?e.jsxs(e.Fragment,{children:["“",e.jsx("span",{className:"font-medium",children:y.trim()}),"”"]}):"this filter","."]}),S.map(r=>e.jsx(ne,{id:V(r.id),title:r.label,description:r.description,variant:"card",flush:!0,children:e.jsx("div",{className:"divide-y divide-edge-subtle",children:r.fields.map(l=>e.jsx(We,{field:l,value:xe(l),dirty:J.has(l.key),profileName:H,onChange:v=>me(l.key,v)},l.key))})},r.id))]})}),t&&e.jsx("footer",{className:"border-t border-edge px-4 py-3 sm:px-6",children:e.jsxs("div",{className:`${G} flex items-center gap-3`,children:[g&&e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-sm text-danger",role:"alert",children:[e.jsx(de,{width:14,height:14,className:"shrink-0"}),e.jsx("span",{className:"truncate",children:g})]}),e.jsx("span",{className:"ml-auto shrink-0 text-xs tabular text-fg-subtle",children:k.length>0?`${k.length} unsaved change${k.length===1?"":"s"}`:"No changes"}),e.jsx(E,{variant:"subtle",onClick:be,disabled:k.length===0||h,children:"Reset"}),e.jsx(E,{variant:"primary",onClick:pe,disabled:k.length===0,loading:h,loadingLabel:"Saving…",children:"Save changes"})]})})]})]})}function He({groups:t,active:n,onJump:a,dirtyCount:u}){return e.jsx("nav",{"aria-label":"Config sections",className:"hidden w-52 shrink-0 overflow-y-auto border-r border-edge px-2 py-4 lg:block",children:e.jsx("ul",{className:"space-y-0.5",children:t.map(i=>{const s=i.id===n,o=u[i.id]??0;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>a(i.id),"aria-current":s?"true":void 0,className:b("motion-fast flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-left text-sm transition-colors",s?"bg-surface-selected font-medium text-fg":"text-fg-muted hover:bg-surface-hover hover:text-fg"),children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.label}),o>0&&e.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-accent-solid","aria-label":`${o} unsaved`}),i.fields.length>0&&e.jsx("span",{className:"shrink-0 text-2xs tabular text-fg-subtle",children:i.fields.length})]})},i.id)})})})}function ze({groups:t,active:n,onJump:a,dirtyCount:u}){return t.length===0?null:e.jsx("nav",{"aria-label":"Config sections",className:"-mx-1 mt-2 flex gap-1 overflow-x-auto px-1 pb-0.5 lg:hidden",children:t.map(i=>{const s=i.id===n,o=u[i.id]??0;return e.jsxs("button",{type:"button",onClick:()=>a(i.id),"aria-current":s?"true":void 0,className:b("motion-fast flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs transition-colors",s?"bg-surface-selected font-medium text-fg":"text-fg-muted hover:bg-surface-hover hover:text-fg"),children:[i.label,o>0&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent-solid","aria-label":`${o} unsaved`})]},i.id)})})}function Ge({query:t,onQuery:n,modifiedOnly:a,onModifiedOnly:u,visibleCount:i,totalCount:s,filtering:o,autoFocus:x}){return e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"relative min-w-0 flex-1 sm:max-w-sm",children:[e.jsx(ke,{width:14,height:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-fg-subtle"}),e.jsx(B,{type:"search","aria-label":"Search settings",placeholder:"Search settings, keys, env vars…",className:"h-8 py-0 pl-8 pr-7 [&::-webkit-search-cancel-button]:appearance-none",value:t,autoFocus:x,onChange:h=>n(h.target.value),onKeyDown:h=>{h.key==="Escape"&&t!==""&&(h.preventDefault(),n(""))}}),t!==""&&e.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>n(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-fg-subtle hover:text-fg",children:e.jsx(Se,{width:13,height:13})})]}),e.jsx("button",{type:"button","aria-pressed":a,onClick:()=>u(!a),className:b("motion-fast shrink-0 rounded-md border px-2.5 py-1 text-xs transition-colors",a?"border-accent-edge bg-accent-soft text-accent":"border-edge text-fg-muted hover:text-fg"),children:"Modified only"}),e.jsx("span",{className:"shrink-0 text-xs tabular text-fg-subtle",children:o?`${i} of ${s}`:`${s} settings`})]})}function Ke({saved:t,configPath:n,restartRequired:a,fileError:u}){const i=u?"danger":t?"success":"warn";return e.jsx(Ce,{tone:i,className:"mb-5 leading-snug",icon:i==="success"?e.jsx(Ae,{width:15,height:15}):e.jsx(de,{width:15,height:15}),children:e.jsx("span",{role:"status",children:u?e.jsxs(e.Fragment,{children:[e.jsxs("strong",{children:["Could not read ",K(n),"."]})," ",u," — the values below are the running instance's; what a restart would load is unknown until the file parses."]}):t?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"Saved to disk."})," These changes take effect only after the server restarts."]}):a?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:"Restart pending."})," ",e.jsx("code",{className:"font-mono text-xs",children:K(n)})," holds changes the running instance has not picked up — the fields below marked"," ",e.jsx(C,{tone:"warn",children:"restart"})," differ from what is in force right now."]}):e.jsxs(e.Fragment,{children:["Changes here are written to"," ",e.jsx("code",{className:"font-mono text-xs",children:K(n)})," and take effect only after the server restarts — the running instance keeps its current config until then."]})})})}function qe({name:t}){return e.jsxs("p",{className:"mb-3 text-xs leading-snug text-fg-muted",children:["This instance's posture profile is ",e.jsx("span",{className:"font-medium text-fg",children:t}),". Settings marked ",e.jsx(C,{tone:"neutral",children:"profile"})," are the ones it chose; anything you set yourself, here or in the environment, wins over it."," ",e.jsx("a",{className:"underline decoration-edge underline-offset-2 hover:text-fg",href:Xe,target:"_blank",rel:"noreferrer",children:"What the profiles do"})]})}const Xe="https://paddock.edspencer.net/configuration/profiles/";function Je(){return e.jsxs("p",{className:"mb-5 text-xs leading-snug text-fg-muted",children:["Settings marked ",e.jsx(C,{tone:"neutral",children:"env"})," are overridden by an environment variable, which wins over this file — edit that variable (and restart) to change them."]})}function We({field:t,value:n,dirty:a,profileName:u,onChange:i}){const s=!t.editable||t.envOverridden,o=`cfg-${t.key}`,x=t.help?`${o}-help`:void 0,h=t.type==="boolean",p=d.useMemo(()=>et(t,q(t)),[t]),g=h&&!s,c=!t.help&&!t.envOverridden&&!t.pendingRestart,f=c?"items-center":"items-start",N=c?"sm:items-center":"sm:items-start",y=s?e.jsx(Ze,{field:t,value:n}):h?e.jsx(Ee,{id:o,checked:!!n,onChange:i,label:t.label}):e.jsx(Qe,{field:t,value:n,onChange:i,inputId:o,describedBy:x});return e.jsxs("div",{className:"relative px-4 py-3",children:[a&&e.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-2 left-0 w-0.5 rounded-full bg-accent-solid"}),e.jsxs("div",{className:b(p?"":g?`flex gap-4 ${f}`:`sm:flex sm:gap-6 ${N}`),children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("label",{htmlFor:s?void 0:o,className:"text-sm font-medium text-fg",children:t.label}),t.sensitive&&e.jsx(C,{tone:"warn",children:"sensitive"}),t.envOverridden&&e.jsx(C,{tone:"neutral",title:`Overridden by environment variable ${t.envVar} — edit that env var (and restart) to change it.`,children:"env"}),t.fromProfile&&e.jsx(C,{tone:"neutral",title:u?`Set by the "${u}" posture profile — neither this config file nor an environment variable overrides it.`:"Set by this instance's posture profile — neither this config file nor an environment variable overrides it.",children:"profile"}),!t.editable&&!t.envOverridden&&e.jsx(C,{tone:"neutral",children:"read-only"}),t.pendingRestart&&e.jsx(C,{tone:"warn",title:"The config file and the running instance disagree on this field — restart to apply.",children:"restart"})]}),t.help&&e.jsx("p",{id:x,className:"mt-0.5 text-xs leading-snug text-fg-muted",children:t.help}),t.envOverridden&&e.jsx("p",{className:"mt-1 truncate font-mono text-2xs text-fg-subtle",children:t.envVar}),t.pendingRestart&&e.jsxs("p",{className:"mt-1 text-2xs leading-snug text-warn",children:["In force now: ",e.jsx("span",{className:"font-mono",children:Ye(t.value)})]})]}),e.jsx("div",{className:b(p?"mt-2":g?"flex shrink-0 justify-end":`mt-2 sm:mt-0 sm:shrink-0 ${Be}`),children:y})]})]})}function Ye(t){if(t==null||t==="")return"(not set)";const a=(Array.isArray(t)?t.join(", "):String(t)).replace(/\s+/g," ").trim();return a.length>60?`${a.slice(0,60)}…`:a}function C({children:t,tone:n,title:a}){return e.jsx(ce,{tone:n,size:"sm",title:a,className:"uppercase tracking-wide",children:t})}function Qe({field:t,value:n,onChange:a,inputId:u,describedBy:i}){if(t.type==="enum")return e.jsx(Pe,{id:u,"aria-describedby":i,value:String(n??""),onChange:s=>a(s.target.value),children:(t.enumValues??[]).map(s=>e.jsx("option",{value:s,children:s},s))});if(t.type==="number")return e.jsx(B,{id:u,type:"number","aria-describedby":i,className:"tabular",value:n==null?"":String(n),placeholder:t.default===null?"default":String(t.default),onChange:s=>a(s.target.value===""?null:Number(s.target.value))});if(t.type==="text"){const s=n==null||n===t.default,o=n==null?String(t.default??""):String(n),x=typeof t.default=="string"&&!s;return e.jsxs("div",{children:[e.jsx(Me,{id:u,"aria-describedby":i,className:"min-h-[7rem] font-mono text-xs leading-relaxed",rows:6,spellCheck:!1,value:o,onChange:h=>a(h.target.value)}),e.jsxs("div",{className:"mt-1 flex items-center justify-between gap-3 text-xs text-fg-muted",children:[e.jsx("span",{children:s?"Using the built-in default.":n===""?"Empty — nothing will be appended.":`${o.length.toLocaleString()} characters.`}),x&&e.jsx(E,{variant:"link",size:"sm",className:"shrink-0",onClick:()=>a(null),children:"Restore default"})]})]})}if(t.type==="string-list"){const s=Array.isArray(t.default)?t.default.map(String):null,o=Array.isArray(n)?n.map(String):null,x=o===null||s!==null&&o.length===s.length&&o.every((g,c)=>g===s[c]),h=o!==null?o.join(", "):(s==null?void 0:s.join(", "))??"",p=s!==null&&!x;return e.jsxs("div",{children:[e.jsx(B,{id:u,type:"text","aria-describedby":i,value:h,placeholder:(s==null?void 0:s.join(", "))??"",onChange:g=>a(g.target.value.split(",").map(c=>c.trim()).filter(Boolean))}),e.jsxs("div",{className:"mt-1 flex items-center justify-between gap-3 text-xs text-fg-muted",children:[e.jsx("span",{children:x?"Using the built-in default.":o!==null&&o.length===0?"Empty — none offered.":`${(o==null?void 0:o.length)??0} in the list.`}),p&&e.jsx(E,{variant:"link",size:"sm",className:"shrink-0",onClick:()=>a(null),children:"Restore default"})]})]})}return e.jsx(B,{id:u,type:"text","aria-describedby":i,value:n==null?"":String(n),placeholder:t.default===null?"":String(t.default),onChange:s=>a(s.target.value)})}function Ze({field:t,value:n}){const a="rounded-lg bg-surface-sunken px-3 py-2 font-mono text-xs text-fg-muted";return t.type==="boolean"?e.jsx("div",{className:a,children:n?"true":"false"}):n==null||n===""?e.jsx("div",{className:a,children:e.jsx("span",{className:"italic text-fg-subtle",children:t.type==="text"&&n===""?"(empty — nothing appended)":"(not set)"})}):t.type==="text"?e.jsx("div",{className:b(a,"max-h-40 overflow-y-auto whitespace-pre-wrap leading-relaxed"),children:String(n)}):e.jsx("div",{className:b(a,"break-all"),children:Array.isArray(n)?n.join(", "):String(n)})}function et(t,n){return t.type==="text"||t.type==="string-list"?!0:(Array.isArray(n)?n.join(", "):n==null?"":String(n)).length>38}function tt(t){return[t.label,t.key,t.help,t.envVar,...t.enumValues??[]].filter(Boolean).join(" ").toLowerCase()}function nt(t,n){const a={};for(const u of t)a[u.id]=u.fields.filter(i=>n.has(i.key)).length;return a}const V=t=>`cfg-section-${t}`,U={id:"appearance",label:"Appearance",description:"Theme and accent colour for this browser. Applies immediately — no save, no restart.",fields:[]},st=["appearance theme themes colour color accent tint dark light font",...ie.map(t=>t.id)].join(" ");function q(t){return t.pendingValue===void 0?t.value:t.pendingValue}function re(t,n){return Object.prototype.hasOwnProperty.call(n,t.key)?n[t.key]:q(t)}function ae(t,n){return Array.isArray(t)&&Array.isArray(n)?t.length===n.length&&t.every((a,u)=>a===n[u]):t===n}function K(t){if(!t)return"paddock.config.yaml";const n=t.split("/");return n[n.length-1]||t}function it(){const t=$e(),n=(t==null?void 0:t.openNav)??(()=>{});return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[e.jsxs("header",{className:"pt-safe flex items-center gap-2 border-b border-edge px-3 pb-2.5 sm:px-6 lg:py-4",children:[e.jsx("button",{type:"button",onClick:n,"aria-label":"Open menu",className:"btn-subtle -ml-1 shrink-0 px-2 py-1.5 lg:hidden",children:e.jsx(Fe,{width:20,height:20})}),e.jsx(Oe,{width:18,height:18,className:"shrink-0 text-fg-subtle"}),e.jsx("h1",{className:"text-md font-semibold tracking-tight",children:"Config"})]}),e.jsx(Ie,{}),e.jsx(_e,{})]})}export{it as InstanceConfigPage};
2
2
 
@@ -1,4 +1,4 @@
1
- import{a6 as tn,m as or,j as xe}from"./index-BaPY10t-.js";import{M as wi}from"./ProjectView-BFqBZN4B.js";import"./ProjectMenu-B2WgwthY.js";import"./lastTab-CU1zsF0j.js";import"./queued-CagZVfWU.js";import"./Surfaces-CFgCNuC1.js";import"./DiscoverView-DRVLL5xS.js";function Si(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ci=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ei=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ii={};function ft(e,t){return(Ii.jsx?Ei:Ci).test(e)}const Ai=/[ \t\n\f\r]/g;function Ti(e){return typeof e=="object"?e.type==="text"?ht(e.value):!1:ht(e)}function ht(e){return e.replace(Ai,"")===""}class We{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}We.prototype.normal={};We.prototype.property={};We.prototype.space=void 0;function ar(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new We(n,r,t)}function vn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Pi=0;const L=Te(),W=Te(),zn=Te(),C=Te(),U=Te(),Ie=Te(),te=Te();function Te(){return 2**++Pi}const Dn=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:W,commaOrSpaceSeparated:te,commaSeparated:Ie,number:C,overloadedBoolean:zn,spaceSeparated:U},Symbol.toStringTag,{value:"Module"})),mn=Object.keys(Dn);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o<mn.length;){const l=mn[o];pt(this,mn[o],(r&Dn[l])===Dn[l])}}}Hn.prototype.defined=!0;function pt(e,t,n){n&&(e[t]=n)}function Re(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Hn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[vn(r)]=r,n[vn(o.attribute)]=r}return new We(t,n,e.space)}const ur=Re({properties:{ariaActiveDescendant:null,ariaAtomic:W,ariaAutoComplete:null,ariaBusy:W,ariaChecked:W,ariaColCount:C,ariaColIndex:C,ariaColSpan:C,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:W,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:W,ariaFlowTo:U,ariaGrabbed:W,ariaHasPopup:null,ariaHidden:W,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:C,ariaLive:null,ariaModal:W,ariaMultiLine:W,ariaMultiSelectable:W,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:C,ariaPressed:W,ariaReadOnly:W,ariaRelevant:null,ariaRequired:W,ariaRoleDescription:U,ariaRowCount:C,ariaRowIndex:C,ariaRowSpan:C,ariaSelected:W,ariaSetSize:C,ariaSort:null,ariaValueMax:C,ariaValueMin:C,ariaValueNow:C,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sr(e,t){return t in e?e[t]:t}function cr(e,t){return sr(e,t.toLowerCase())}const vi=Re({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ie,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:U,autoFocus:L,autoPlay:L,blocking:U,capture:null,charSet:null,checked:L,cite:null,className:U,closedBy:null,colorSpace:null,cols:C,colSpan:C,command:null,commandFor:null,content:null,contentEditable:W,controls:L,controlsList:U,coords:C|Ie,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:zn,draggable:W,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:U,height:C,hidden:zn,high:C,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:U,itemRef:U,itemScope:L,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:C,manifest:null,max:null,maxLength:C,media:null,method:null,min:null,minLength:C,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:L,optimum:C,pattern:null,ping:U,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:U,required:L,reversed:L,rows:C,rowSpan:C,sandbox:U,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:C,sizes:null,slot:null,span:C,spellCheck:W,src:null,srcDoc:null,srcLang:null,srcSet:null,start:C,step:null,style:null,tabIndex:C,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:W,width:C,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:C,borderColor:null,bottomMargin:C,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:C,leftMargin:C,link:null,longDesc:null,lowSrc:null,marginHeight:C,marginWidth:C,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:C,rules:null,scheme:null,scrolling:W,standby:null,summary:null,text:null,topMargin:C,valueType:null,version:null,vAlign:null,vLink:null,vSpace:C,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:Ie,part:U,prefix:null,property:null,results:C,security:null,unselectable:null},space:"html",transform:cr}),zi=Re({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:te,accentHeight:C,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:C,amplitude:C,arabicForm:null,ascent:C,attributeName:null,attributeType:null,azimuth:C,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:C,by:null,calcMode:null,capHeight:C,className:U,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:C,diffuseConstant:C,direction:null,display:null,dur:null,divisor:C,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:C,enableBackground:null,end:null,event:null,exponent:C,externalResourcesRequired:null,fill:null,fillOpacity:C,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ie,g2:Ie,glyphName:Ie,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:C,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:C,horizOriginX:C,horizOriginY:C,id:null,ideographic:C,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:C,k:C,k1:C,k2:C,k3:C,k4:C,kernelMatrix:te,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:C,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:C,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:C,overlineThickness:C,paintOrder:null,panose1:null,path:null,pathLength:C,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:C,pointsAtY:C,pointsAtZ:C,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:te,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:te,rev:te,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:te,requiredFeatures:te,requiredFonts:te,requiredFormats:te,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:C,specularExponent:C,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:C,strikethroughThickness:C,string:null,stroke:null,strokeDashArray:te,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:C,strokeOpacity:C,strokeWidth:null,style:null,surfaceScale:C,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:te,tabIndex:C,tableValues:null,target:null,targetX:C,targetY:C,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:te,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:C,underlineThickness:C,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:C,values:null,vAlphabetic:C,vMathematical:C,vectorEffect:null,vHanging:C,vIdeographic:C,version:null,vertAdvY:C,vertOriginX:C,vertOriginY:C,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:C,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sr}),fr=Re({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),hr=Re({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:cr}),pr=Re({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Di={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Li=/[A-Z]/g,mt=/-[a-z]/g,Fi=/^data[-\w.:]+$/i;function Ri(e,t){const n=vn(t);let r=t,i=ee;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Fi.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Oi);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Li,_i);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function _i(e){return"-"+e.toLowerCase()}function Oi(e){return e.charAt(1).toUpperCase()}const Mi=ar([ur,vi,fr,hr,pr],"html"),Un=ar([ur,zi,fr,hr,pr],"svg");function Ni(e){return e.join(" ").trim()}var Vn={},gt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Bi=/\n/g,ji=/^\s*/,Hi=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ui=/^:\s*/,Vi=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,$i=/^[;\s]*/,qi=/^\s+|\s+$/g,Wi=`
1
+ import{a6 as tn,m as or,j as xe}from"./index-WSqceBAp.js";import{M as wi}from"./ProjectView-B6yCxYmu.js";import"./ProjectMenu-CD77oQB2.js";import"./lastTab-CU1zsF0j.js";import"./queued-CagZVfWU.js";import"./Surfaces-CcrPbt9t.js";import"./DiscoverView-LAqnHF4r.js";function Si(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ci=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ei=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ii={};function ft(e,t){return(Ii.jsx?Ei:Ci).test(e)}const Ai=/[ \t\n\f\r]/g;function Ti(e){return typeof e=="object"?e.type==="text"?ht(e.value):!1:ht(e)}function ht(e){return e.replace(Ai,"")===""}class We{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}We.prototype.normal={};We.prototype.property={};We.prototype.space=void 0;function ar(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new We(n,r,t)}function vn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Pi=0;const L=Te(),W=Te(),zn=Te(),C=Te(),U=Te(),Ie=Te(),te=Te();function Te(){return 2**++Pi}const Dn=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:W,commaOrSpaceSeparated:te,commaSeparated:Ie,number:C,overloadedBoolean:zn,spaceSeparated:U},Symbol.toStringTag,{value:"Module"})),mn=Object.keys(Dn);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o<mn.length;){const l=mn[o];pt(this,mn[o],(r&Dn[l])===Dn[l])}}}Hn.prototype.defined=!0;function pt(e,t,n){n&&(e[t]=n)}function Re(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Hn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[vn(r)]=r,n[vn(o.attribute)]=r}return new We(t,n,e.space)}const ur=Re({properties:{ariaActiveDescendant:null,ariaAtomic:W,ariaAutoComplete:null,ariaBusy:W,ariaChecked:W,ariaColCount:C,ariaColIndex:C,ariaColSpan:C,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:W,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:W,ariaFlowTo:U,ariaGrabbed:W,ariaHasPopup:null,ariaHidden:W,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:C,ariaLive:null,ariaModal:W,ariaMultiLine:W,ariaMultiSelectable:W,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:C,ariaPressed:W,ariaReadOnly:W,ariaRelevant:null,ariaRequired:W,ariaRoleDescription:U,ariaRowCount:C,ariaRowIndex:C,ariaRowSpan:C,ariaSelected:W,ariaSetSize:C,ariaSort:null,ariaValueMax:C,ariaValueMin:C,ariaValueNow:C,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sr(e,t){return t in e?e[t]:t}function cr(e,t){return sr(e,t.toLowerCase())}const vi=Re({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ie,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:U,autoFocus:L,autoPlay:L,blocking:U,capture:null,charSet:null,checked:L,cite:null,className:U,closedBy:null,colorSpace:null,cols:C,colSpan:C,command:null,commandFor:null,content:null,contentEditable:W,controls:L,controlsList:U,coords:C|Ie,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:zn,draggable:W,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:U,height:C,hidden:zn,high:C,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:U,itemRef:U,itemScope:L,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:C,manifest:null,max:null,maxLength:C,media:null,method:null,min:null,minLength:C,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:L,optimum:C,pattern:null,ping:U,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:U,required:L,reversed:L,rows:C,rowSpan:C,sandbox:U,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:C,sizes:null,slot:null,span:C,spellCheck:W,src:null,srcDoc:null,srcLang:null,srcSet:null,start:C,step:null,style:null,tabIndex:C,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:W,width:C,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:C,borderColor:null,bottomMargin:C,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:C,leftMargin:C,link:null,longDesc:null,lowSrc:null,marginHeight:C,marginWidth:C,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:C,rules:null,scheme:null,scrolling:W,standby:null,summary:null,text:null,topMargin:C,valueType:null,version:null,vAlign:null,vLink:null,vSpace:C,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:Ie,part:U,prefix:null,property:null,results:C,security:null,unselectable:null},space:"html",transform:cr}),zi=Re({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:te,accentHeight:C,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:C,amplitude:C,arabicForm:null,ascent:C,attributeName:null,attributeType:null,azimuth:C,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:C,by:null,calcMode:null,capHeight:C,className:U,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:C,diffuseConstant:C,direction:null,display:null,dur:null,divisor:C,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:C,enableBackground:null,end:null,event:null,exponent:C,externalResourcesRequired:null,fill:null,fillOpacity:C,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ie,g2:Ie,glyphName:Ie,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:C,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:C,horizOriginX:C,horizOriginY:C,id:null,ideographic:C,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:C,k:C,k1:C,k2:C,k3:C,k4:C,kernelMatrix:te,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:C,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:C,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:C,overlineThickness:C,paintOrder:null,panose1:null,path:null,pathLength:C,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:C,pointsAtY:C,pointsAtZ:C,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:te,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:te,rev:te,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:te,requiredFeatures:te,requiredFonts:te,requiredFormats:te,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:C,specularExponent:C,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:C,strikethroughThickness:C,string:null,stroke:null,strokeDashArray:te,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:C,strokeOpacity:C,strokeWidth:null,style:null,surfaceScale:C,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:te,tabIndex:C,tableValues:null,target:null,targetX:C,targetY:C,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:te,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:C,underlineThickness:C,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:C,values:null,vAlphabetic:C,vMathematical:C,vectorEffect:null,vHanging:C,vIdeographic:C,version:null,vertAdvY:C,vertOriginX:C,vertOriginY:C,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:C,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sr}),fr=Re({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),hr=Re({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:cr}),pr=Re({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Di={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Li=/[A-Z]/g,mt=/-[a-z]/g,Fi=/^data[-\w.:]+$/i;function Ri(e,t){const n=vn(t);let r=t,i=ee;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Fi.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Oi);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Li,_i);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function _i(e){return"-"+e.toLowerCase()}function Oi(e){return e.charAt(1).toUpperCase()}const Mi=ar([ur,vi,fr,hr,pr],"html"),Un=ar([ur,zi,fr,hr,pr],"svg");function Ni(e){return e.join(" ").trim()}var Vn={},gt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Bi=/\n/g,ji=/^\s*/,Hi=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ui=/^:\s*/,Vi=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,$i=/^[;\s]*/,qi=/^\s+|\s+$/g,Wi=`
2
2
  `,dt="/",yt="*",Ee="",Yi="comment",Xi="declaration";function Qi(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(d){var x=d.match(Bi);x&&(n+=x.length);var E=d.lastIndexOf(Wi);r=~E?d.length-E:r+d.length}function o(){var d={line:n,column:r};return function(x){return x.position=new l(d),s(),x}}function l(d){this.start=d,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(d){var x=new Error(t.source+":"+n+":"+r+": "+d);if(x.reason=d,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(d){var x=d.exec(e);if(x){var E=x[0];return i(E),e=e.slice(E.length),x}}function s(){u(ji)}function f(d){var x;for(d=d||[];x=c();)x!==!1&&d.push(x);return d}function c(){var d=o();if(!(dt!=e.charAt(0)||yt!=e.charAt(1))){for(var x=2;Ee!=e.charAt(x)&&(yt!=e.charAt(x)||dt!=e.charAt(x+1));)++x;if(x+=2,Ee===e.charAt(x-1))return a("End of comment missing");var E=e.slice(2,x-2);return r+=2,i(E),e=e.slice(x),r+=2,d({type:Yi,comment:E})}}function p(){var d=o(),x=u(Hi);if(x){if(c(),!u(Ui))return a("property missing ':'");var E=u(Vi),y=d({type:Xi,property:kt(x[0].replace(gt,Ee)),value:E?kt(E[0].replace(gt,Ee)):Ee});return u($i),y}}function h(){var d=[];f(d);for(var x;x=p();)x!==!1&&(d.push(x),f(d));return d}return s(),h()}function kt(e){return e?e.replace(qi,Ee):Ee}var Gi=Qi,Ki=tn&&tn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.default=Zi;const Ji=Ki(Gi);function Zi(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Ji.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:a}=o;i?t(l,a,o):a&&(n=n||{},n[l]=a)}),n}var un={};Object.defineProperty(un,"__esModule",{value:!0});un.camelCase=void 0;var el=/^--[a-zA-Z0-9_-]+$/,nl=/-([a-z])/g,tl=/^[^-]+$/,rl=/^-(webkit|moz|ms|o|khtml)-/,il=/^-(ms)-/,ll=function(e){return!e||tl.test(e)||el.test(e)},ol=function(e,t){return t.toUpperCase()},xt=function(e,t){return"".concat(t,"-")},al=function(e,t){return t===void 0&&(t={}),ll(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(il,xt):e=e.replace(rl,xt),e.replace(nl,ol))};un.camelCase=al;var ul=tn&&tn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},sl=ul(Vn),cl=un;function Ln(e,t){var n={};return!e||typeof e!="string"||(0,sl.default)(e,function(r,i){r&&i&&(n[(0,cl.camelCase)(r,t)]=i)}),n}Ln.default=Ln;var fl=Ln;const hl=or(fl),mr=gr("end"),$n=gr("start");function gr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function pl(e){const t=$n(e),n=mr(e);if(t&&n)return{start:t,end:n}}function He(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?bt(e.position):"start"in e||"end"in e?bt(e):"line"in e||"column"in e?Fn(e):""}function Fn(e){return wt(e&&e.line)+":"+wt(e&&e.column)}function bt(e){return Fn(e&&e.start)+"-"+Fn(e&&e.end)}function wt(e){return e&&typeof e=="number"?e:1}class K extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=He(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const qn={}.hasOwnProperty,ml=new Map,gl=/[A-Z]/g,dl=new Set(["table","tbody","thead","tfoot","tr"]),yl=new Set(["td","th"]),dr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kl(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Al(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Il(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Un:Mi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=yr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function yr(e,t,n){if(t.type==="element")return xl(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return bl(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Sl(e,t,n);if(t.type==="mdxjsEsm")return wl(e,t);if(t.type==="root")return Cl(e,t,n);if(t.type==="text")return El(e,t)}function xl(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=xr(e,t.tagName,!1),l=Tl(e,t);let a=Yn(e,t);return dl.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!Ti(u):!0})),kr(e,l,o,t),Wn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function bl(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}$e(e,t.position)}function wl(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$e(e,t.position)}function Sl(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:xr(e,t.name,!0),l=Pl(e,t),a=Yn(e,t);return kr(e,l,o,t),Wn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Cl(e,t,n){const r={};return Wn(r,Yn(e,t)),e.create(t,e.Fragment,r,n)}function El(e,t){return t.value}function kr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Il(e,t,n){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?n:t;return a?s(o,l,a):s(o,l)}}function Al(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=$n(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Tl(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&qn.call(t.properties,i)){const o=vl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&yl.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Pl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $e(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else $e(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Yn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ml;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const s=i.get(u)||0;l=u+"-"+s,i.set(u,s+1)}}const a=yr(e,o,l);a!==void 0&&n.push(a)}return n}function vl(e,t,n){const r=Ri(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Si(n):Ni(n)),r.property==="style"){let i=typeof n=="object"?n:zl(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Dl(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Di[r.property]||r.property:r.attribute,n]}}function zl(e,t){try{return hl(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new K("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=dr+"#cannot-parse-style-attribute",i}}function xr(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const a=ft(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=ft(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return qn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);$e(e)}function $e(e,t){const n=new K("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=dr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Dl(e){const t={};let n;for(n in e)qn.call(e,n)&&(t[Ll(n)]=e[n]);return t}function Ll(e){let t=e.replace(gl,Fl);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Fl(e){return"-"+e.toLowerCase()}const gn={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Rl={};function Xn(e,t){const n=Rl,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return br(e,r,i)}function br(e,t,n){if(_l(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return St(e.children,t,n)}return Array.isArray(e)?St(e,t,n):""}function St(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=br(e[i],t,n);return r.join("")}function _l(e){return!!(e&&typeof e=="object")}const Ct=document.createElement("i");function Qn(e){const t="&"+e+";";Ct.innerHTML=t;const n=Ct.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function re(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function ie(e,t){return e.length>0?(re(e,e.length,0,t),e):t}const Et={}.hasOwnProperty;function wr(e){const t={};let n=-1;for(;++n<e.length;)Ol(t,e[n]);return t}function Ol(e,t){let n;for(n in t){const i=(Et.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){Et.call(i,l)||(i[l]=[]);const a=o[l];Ml(i[l],Array.isArray(a)?a:a?[a]:[])}}}function Ml(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);re(e,0,0,r)}function Sr(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function se(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=be(/[A-Za-z]/),G=be(/[\dA-Za-z]/),Nl=be(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const Rn=be(/\d/),Bl=be(/[\dA-Fa-f]/),jl=be(/[!-/:-@[-`{-~]/);function v(e){return e!==null&&e<-2}function V(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}const sn=be(new RegExp("\\p{P}|\\p{S}","u")),Ae=be(/\s/);function be(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function _e(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&G(e.charCodeAt(n+1))&&G(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function M(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return R(u)?(e.enter(n),a(u)):t(u)}function a(u){return R(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const Hl={tokenize:Ul};function Ul(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),M(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return v(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const Vl={tokenize:$l},It={tokenize:ql};function $l(e){const t=this,n=[];let r=0,i,o,l;return a;function a(S){if(r<n.length){const D=n[r];return t.containerState=D[1],e.attempt(D[0].continuation,u,s)(S)}return s(S)}function u(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&I();const D=t.events.length;let z=D,w;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){w=t.events[z][1].end;break}y(r);let _=D;for(;_<t.events.length;)t.events[_][1].end={...w},_++;return re(t.events,z+1,0,t.events.slice(D)),t.events.length=_,s(S)}return a(S)}function s(S){if(r===n.length){if(!i)return p(S);if(i.currentConstruct&&i.currentConstruct.concrete)return d(S);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(It,f,c)(S)}function f(S){return i&&I(),y(r),p(S)}function c(S){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,d(S)}function p(S){return t.containerState={},e.attempt(It,h,d)(S)}function h(S){return r++,n.push([t.currentConstruct,t.containerState]),p(S)}function d(S){if(S===null){i&&I(),y(0),e.consume(S);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(S)}function x(S){if(S===null){E(e.exit("chunkFlow"),!0),y(0),e.consume(S);return}return v(S)?(e.consume(S),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(S),x)}function E(S,D){const z=t.sliceStream(S);if(D&&z.push(null),S.previous=o,o&&(o.next=S),o=S,i.defineSkip(S.start),i.write(z),t.parser.lazy[S.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<l&&(!i.events[w][1].end||i.events[w][1].end.offset>l))return;const _=t.events.length;let $=_,B,k;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){if(B){k=t.events[$][1].end;break}B=!0}for(y(r),w=_;w<t.events.length;)t.events[w][1].end={...k},w++;re(t.events,$+1,0,t.events.slice(_)),t.events.length=w}}function y(S){let D=n.length;for(;D-- >S;){const z=n[D];t.containerState=z[1],z[0].exit.call(t,e)}n.length=S}function I(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ql(e,t,n){return M(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Fe(e){if(e===null||V(e)||Ae(e))return 1;if(sn(e))return 2}function cn(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const _n={name:"attention",resolveAll:Wl,tokenize:Yl};function Wl(e,t){let n=-1,r,i,o,l,a,u,s,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};At(c,-u),At(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ie(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=ie(s,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),s=ie(s,cn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=ie(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,s=ie(s,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,re(e,r-1,n-r+3,s),n=r+s.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Yl(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Fe(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Fe(u),c=!f||f===2&&i||n.includes(u),p=!i||i===2&&f||n.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),t(u)}}function At(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Xl={name:"autolink",tokenize:Ql};function Ql(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return J(h)?(e.consume(h),l):h===64?n(h):s(h)}function l(h){return h===43||h===45||h===46||G(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||G(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||rn(h)?n(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):Nl(h)?(e.consume(h),s):n(h)}function f(h){return G(h)?c(h):n(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||G(h))&&r++<63){const d=h===45?p:c;return e.consume(h),d}return n(h)}}const Ye={partial:!0,tokenize:Gl};function Gl(e,t,n){return r;function r(o){return R(o)?M(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||v(o)?t(o):n(o)}}const Cr={continuation:{tokenize:Jl},exit:Zl,name:"blockQuote",tokenize:Kl};function Kl(e,t,n){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return R(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Jl(e,t,n){const r=this;return i;function i(l){return R(l)?M(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Cr,t,n)(l)}}function Zl(e){e.exit("blockQuote")}const Er={name:"characterEscape",tokenize:eo};function eo(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return jl(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ir={name:"characterReference",tokenize:no};function no(e,t,n){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=G,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Bl,f):(e.enter("characterReferenceValue"),o=7,l=Rn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===G&&!Qn(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(c)&&i++<o?(e.consume(c),f):n(c)}}const Tt={partial:!0,tokenize:ro},Pt={concrete:!0,name:"codeFenced",tokenize:to};function to(e,t,n){const r=this,i={partial:!0,tokenize:z};let o=0,l=0,a;return u;function u(w){return s(w)}function s(w){const _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(w)}function f(w){return w===a?(l++,e.consume(w),f):l<3?n(w):(e.exit("codeFencedFenceSequence"),R(w)?M(e,c,"whitespace")(w):c(w))}function c(w){return w===null||v(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(Tt,x,D)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||v(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(w)):R(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),M(e,h,"whitespace")(w)):w===96&&w===a?n(w):(e.consume(w),p)}function h(w){return w===null||v(w)?c(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||v(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(w)):w===96&&w===a?n(w):(e.consume(w),d)}function x(w){return e.attempt(i,D,E)(w)}function E(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return o>0&&R(w)?M(e,I,"linePrefix",o+1)(w):I(w)}function I(w){return w===null||v(w)?e.check(Tt,x,D)(w):(e.enter("codeFlowValue"),S(w))}function S(w){return w===null||v(w)?(e.exit("codeFlowValue"),I(w)):(e.consume(w),S)}function D(w){return e.exit("codeFenced"),t(w)}function z(w,_,$){let B=0;return k;function k(N){return w.enter("lineEnding"),w.consume(N),w.exit("lineEnding"),T}function T(N){return w.enter("codeFencedFence"),R(N)?M(w,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):P(N)}function P(N){return N===a?(w.enter("codeFencedFenceSequence"),j(N)):$(N)}function j(N){return N===a?(B++,w.consume(N),j):B>=l?(w.exit("codeFencedFenceSequence"),R(N)?M(w,q,"whitespace")(N):q(N)):$(N)}function q(N){return N===null||v(N)?(w.exit("codeFencedFence"),_(N)):$(N)}}}function ro(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const dn={name:"codeIndented",tokenize:lo},io={partial:!0,tokenize:oo};function lo(e,t,n){const r=this;return i;function i(s){return e.enter("codeIndented"),M(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):n(s)}function l(s){return s===null?u(s):v(s)?e.attempt(io,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||v(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),t(s)}}function oo(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):M(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):v(l)?i(l):n(l)}}const ao={name:"codeText",previous:so,resolve:uo,tokenize:co};function uo(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function so(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function co(e,t,n){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):v(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||v(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",s(c))}}class fo{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Be(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Be(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Be(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Be(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Be(this.left,n.reverse())}}}function Be(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ar(e){const t={};let n=-1,r,i,o,l,a,u,s;const f=new fo(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ho(f,n)),n=t[n],s=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return re(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function ho(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=n,d=0,x=0;const E=[x];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(x=p+1,E.push(x),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):E.pop(),p=E.length;p--;){const y=a.slice(E[p],E[p+1]),I=o.pop();u.push([I,I+y.length-1]),e.splice(I,2,y)}for(u.reverse(),p=-1;++p<u.length;)s[d+u[p][0]]=d+u[p][1],d+=u[p][1]-u[p][0]-1;return s}const po={resolve:go,tokenize:yo},mo={partial:!0,tokenize:ko};function go(e){return Ar(e),e}function yo(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):v(a)?e.check(mo,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function l(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ko(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),M(e,o,"linePrefix")}function o(l){if(l===null||v(l))return n(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Tr(e,t,n,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||rn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||v(y)?n(y):(e.consume(y),y===92?d:h)}function d(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function x(y){return!f&&(y===null||y===41||V(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f<s&&y===40?(e.consume(y),f++,x):y===41?(e.consume(y),f--,x):y===null||y===32||y===40||rn(y)?n(y):(e.consume(y),y===92?E:x)}function E(y){return y===40||y===41||y===92?(e.consume(y),x):x(y)}}function Pr(e,t,n,r,i,o){const l=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):v(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||v(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!R(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function vr(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?n(p):v(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),M(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||v(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function Ue(e,t){let n;return r;function r(i){return v(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):R(i)?M(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const xo={name:"definition",tokenize:wo},bo={partial:!0,tokenize:So};function wo(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return Pr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return V(h)?Ue(e,s)(h):s(h)}function s(h){return Tr(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(bo,c,c)(h)}function c(h){return R(h)?M(e,p,"whitespace")(h):p(h)}function p(h){return h===null||v(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function So(e,t,n){return r;function r(a){return V(a)?Ue(e,i)(a):n(a)}function i(a){return vr(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return R(a)?M(e,l,"whitespace")(a):l(a)}function l(a){return a===null||v(a)?t(a):n(a)}}const Co={name:"hardBreakEscape",tokenize:Eo};function Eo(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return v(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Io={name:"headingAtx",resolve:Ao,tokenize:To};function Ao(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},re(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function To(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||V(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||v(f)?(e.exit("atxHeading"),t(f)):R(f)?M(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||V(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const Po=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vt=["pre","script","style","textarea"],vo={concrete:!0,name:"htmlFlow",resolveTo:Lo,tokenize:Fo},zo={partial:!0,tokenize:_o},Do={partial:!0,tokenize:Ro};function Lo(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Fo(e,t,n){const r=this;let i,o,l,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),o=!0,x):g===63?(e.consume(g),i=3,r.interrupt?t:m):J(g)?(e.consume(g),l=String.fromCharCode(g),E):n(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,a=0,d):J(g)?(e.consume(g),i=4,r.interrupt?t:m):n(g)}function h(g){return g===45?(e.consume(g),r.interrupt?t:m):n(g)}function d(g){const ae="CDATA[";return g===ae.charCodeAt(a++)?(e.consume(g),a===ae.length?r.interrupt?t:P:d):n(g)}function x(g){return J(g)?(e.consume(g),l=String.fromCharCode(g),E):n(g)}function E(g){if(g===null||g===47||g===62||V(g)){const ae=g===47,we=l.toLowerCase();return!ae&&!o&&vt.includes(we)?(i=1,r.interrupt?t(g):P(g)):Po.includes(l.toLowerCase())?(i=6,ae?(e.consume(g),y):r.interrupt?t(g):P(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?I(g):S(g))}return g===45||G(g)?(e.consume(g),l+=String.fromCharCode(g),E):n(g)}function y(g){return g===62?(e.consume(g),r.interrupt?t:P):n(g)}function I(g){return R(g)?(e.consume(g),I):k(g)}function S(g){return g===47?(e.consume(g),k):g===58||g===95||J(g)?(e.consume(g),D):R(g)?(e.consume(g),S):k(g)}function D(g){return g===45||g===46||g===58||g===95||G(g)?(e.consume(g),D):z(g)}function z(g){return g===61?(e.consume(g),w):R(g)?(e.consume(g),z):S(g)}function w(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,_):R(g)?(e.consume(g),w):$(g)}function _(g){return g===u?(e.consume(g),u=null,B):g===null||v(g)?n(g):(e.consume(g),_)}function $(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||V(g)?z(g):(e.consume(g),$)}function B(g){return g===47||g===62||R(g)?S(g):n(g)}function k(g){return g===62?(e.consume(g),T):n(g)}function T(g){return g===null||v(g)?P(g):R(g)?(e.consume(g),T):n(g)}function P(g){return g===45&&i===2?(e.consume(g),Q):g===60&&i===1?(e.consume(g),Y):g===62&&i===4?(e.consume(g),oe):g===63&&i===3?(e.consume(g),m):g===93&&i===5?(e.consume(g),he):v(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(zo,pe,j)(g)):g===null||v(g)?(e.exit("htmlFlowData"),j(g)):(e.consume(g),P)}function j(g){return e.check(Do,q,pe)(g)}function q(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),N}function N(g){return g===null||v(g)?j(g):(e.enter("htmlFlowData"),P(g))}function Q(g){return g===45?(e.consume(g),m):P(g)}function Y(g){return g===47?(e.consume(g),l="",le):P(g)}function le(g){if(g===62){const ae=l.toLowerCase();return vt.includes(ae)?(e.consume(g),oe):P(g)}return J(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),le):P(g)}function he(g){return g===93?(e.consume(g),m):P(g)}function m(g){return g===62?(e.consume(g),oe):g===45&&i===2?(e.consume(g),m):P(g)}function oe(g){return g===null||v(g)?(e.exit("htmlFlowData"),pe(g)):(e.consume(g),oe)}function pe(g){return e.exit("htmlFlow"),t(g)}}function Ro(e,t,n){const r=this;return i;function i(l){return v(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function _o(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ye,t,n)}}const Oo={name:"htmlText",tokenize:Mo};function Mo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),z):m===63?(e.consume(m),S):J(m)?(e.consume(m),$):n(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,d):J(m)?(e.consume(m),I):n(m)}function f(m){return m===45?(e.consume(m),h):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):v(m)?(l=c,Y(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?Q(m):m===45?p(m):c(m)}function d(m){const oe="CDATA[";return m===oe.charCodeAt(o++)?(e.consume(m),o===oe.length?x:d):n(m)}function x(m){return m===null?n(m):m===93?(e.consume(m),E):v(m)?(l=x,Y(m)):(e.consume(m),x)}function E(m){return m===93?(e.consume(m),y):x(m)}function y(m){return m===62?Q(m):m===93?(e.consume(m),y):x(m)}function I(m){return m===null||m===62?Q(m):v(m)?(l=I,Y(m)):(e.consume(m),I)}function S(m){return m===null?n(m):m===63?(e.consume(m),D):v(m)?(l=S,Y(m)):(e.consume(m),S)}function D(m){return m===62?Q(m):S(m)}function z(m){return J(m)?(e.consume(m),w):n(m)}function w(m){return m===45||G(m)?(e.consume(m),w):_(m)}function _(m){return v(m)?(l=_,Y(m)):R(m)?(e.consume(m),_):Q(m)}function $(m){return m===45||G(m)?(e.consume(m),$):m===47||m===62||V(m)?B(m):n(m)}function B(m){return m===47?(e.consume(m),Q):m===58||m===95||J(m)?(e.consume(m),k):v(m)?(l=B,Y(m)):R(m)?(e.consume(m),B):Q(m)}function k(m){return m===45||m===46||m===58||m===95||G(m)?(e.consume(m),k):T(m)}function T(m){return m===61?(e.consume(m),P):v(m)?(l=T,Y(m)):R(m)?(e.consume(m),T):B(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,j):v(m)?(l=P,Y(m)):R(m)?(e.consume(m),P):(e.consume(m),q)}function j(m){return m===i?(e.consume(m),i=void 0,N):m===null?n(m):v(m)?(l=j,Y(m)):(e.consume(m),j)}function q(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||V(m)?B(m):(e.consume(m),q)}function N(m){return m===47||m===62||V(m)?B(m):n(m)}function Q(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function Y(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),le}function le(m){return R(m)?M(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):he(m)}function he(m){return e.enter("htmlTextData"),l(m)}}const Gn={name:"labelEnd",resolveAll:Ho,resolveTo:Uo,tokenize:Vo},No={tokenize:$o},Bo={tokenize:qo},jo={tokenize:Wo};function Ho(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&re(e,0,e.length,n),e}function Uo(e,t){let n=e.length,r=0,i,o,l,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,t],["enter",s,t]],a=ie(a,e.slice(o+1,o+r+3)),a=ie(a,[["enter",f,t]]),a=ie(a,cn(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),a=ie(a,[["exit",f,t],e[l-2],e[l-1],["exit",s,t]]),a=ie(a,e.slice(l+1)),a=ie(a,[["exit",u,t]]),re(e,o,e.length,a),e}function Vo(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(se(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt(No,f,l?f:c)(p):p===91?e.attempt(Bo,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(jo,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function $o(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return V(c)?Ue(e,o)(c):o(c)}function o(c){return c===41?f(c):Tr(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return V(c)?Ue(e,u)(c):f(c)}function a(c){return n(c)}function u(c){return c===34||c===39||c===40?vr(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return V(c)?Ue(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function qo(e,t,n){const r=this;return i;function i(a){return Pr.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function l(a){return n(a)}}function Wo(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const Yo={name:"labelStartImage",resolveAll:Gn.resolveAll,tokenize:Xo};function Xo(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):n(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Qo={name:"labelStartLink",resolveAll:Gn.resolveAll,tokenize:Go};function Go(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const yn={name:"lineEnding",tokenize:Ko};function Ko(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),M(e,t,"linePrefix")}}const en={name:"thematicBreak",tokenize:Jo};function Jo(e,t,n){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||v(s))?(e.exit("thematicBreak"),t(s)):n(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),R(s)?M(e,a,"whitespace")(s):a(s))}}const Z={continuation:{tokenize:ta},exit:ia,name:"list",tokenize:na},Zo={partial:!0,tokenize:la},ea={partial:!0,tokenize:ra};function na(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const d=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Rn(h)){if(r.containerState.type||(r.containerState.type=d,e.enter(d,{_container:!0})),d==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(en,n,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return Rn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):n(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ye,r.interrupt?n:f,e.attempt(Zo,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return R(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function ta(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ye,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,M(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!R(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ea,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,M(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ra(e,t,n){const r=this;return M(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function ia(e){e.exit(this.containerState.type)}function la(e,t,n){const r=this;return M(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!R(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const zt={name:"setextUnderline",resolveTo:oa,tokenize:aa};function oa(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function aa(e,t,n){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):n(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),R(s)?M(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||v(s)?(e.exit("setextHeadingLine"),t(s)):n(s)}}const ua={tokenize:sa};function sa(e){const t=this,n=e.attempt(Ye,r,e.attempt(this.parser.constructs.flowInitial,i,M(e,e.attempt(this.parser.constructs.flow,i,e.attempt(po,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ca={resolveAll:Dr()},fa=zr("string"),ha=zr("text");function zr(e){return{resolveAll:Dr(e==="text"?pa:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return s(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Dr(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function pa(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const s={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(n,0,["enter",s,t],["exit",s,t]),n+=2)}n++}return e}const ma={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:Cr},ga={91:xo},da={[-2]:dn,[-1]:dn,32:dn},ya={35:Io,42:en,45:[zt,en],60:vo,61:zt,95:en,96:Pt,126:Pt},ka={38:Ir,92:Er},xa={[-5]:yn,[-4]:yn,[-3]:yn,33:Yo,38:Ir,42:_n,60:[Xl,Oo],91:Qo,92:[Co,Er],93:Gn,95:_n,96:ao},ba={null:[_n,ca]},wa={null:[42,95]},Sa={null:[]},Ca=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:wa,contentInitial:ga,disable:Sa,document:ma,flow:ya,flowInitial:da,insideSpan:ba,string:ka,text:xa},Symbol.toStringTag,{value:"Module"}));function Ea(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],a=[];const u={attempt:_(z),check:_(w),consume:I,enter:S,exit:D,interrupt:_(w,{interrupt:!0})},s={code:null,containerState:{},defineSkip:x,events:[],now:d,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=t.tokenize.call(s,u);return t.resolveAll&&o.push(t),s;function c(T){return l=ie(l,T),E(),l[l.length-1]!==null?[]:($(t,0),s.events=cn(o,s.events,s),s.events)}function p(T,P){return Aa(h(T),P)}function h(T){return Ia(l,T)}function d(){const{_bufferIndex:T,_index:P,line:j,column:q,offset:N}=r;return{_bufferIndex:T,_index:P,line:j,column:q,offset:N}}function x(T){i[T.line]=T.column,k()}function E(){let T;for(;r._index<l.length;){const P=l[r._index];if(typeof P=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<P.length;)y(P.charCodeAt(r._bufferIndex));else y(P)}}function y(T){f=f(T)}function I(T){v(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,k()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=T}function S(T,P){const j=P||{};return j.type=T,j.start=d(),s.events.push(["enter",j,s]),a.push(j),j}function D(T){const P=a.pop();return P.end=d(),s.events.push(["exit",P,s]),P}function z(T,P){$(T,P.from)}function w(T,P){P.restore()}function _(T,P){return j;function j(q,N,Q){let Y,le,he,m;return Array.isArray(q)?pe(q):"tokenize"in q?pe([q]):oe(q);function oe(X){return Oe;function Oe(ye){const Pe=ye!==null&&X[ye],ve=ye!==null&&X.null,Qe=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(ve)?ve:ve?[ve]:[]];return pe(Qe)(ye)}}function pe(X){return Y=X,le=0,X.length===0?Q:g(X[le])}function g(X){return Oe;function Oe(ye){return m=B(),he=X,X.partial||(s.currentConstruct=X),X.name&&s.parser.constructs.disable.null.includes(X.name)?we():X.tokenize.call(P?Object.assign(Object.create(s),P):s,u,ae,we)(ye)}}function ae(X){return T(he,m),N}function we(X){return m.restore(),++le<Y.length?g(Y[le]):Q}}}function $(T,P){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&re(s.events,P,s.events.length-P,T.resolve(s.events.slice(P),s)),T.resolveTo&&(s.events=T.resolveTo(s.events,s))}function B(){const T=d(),P=s.previous,j=s.currentConstruct,q=s.events.length,N=Array.from(a);return{from:q,restore:Q};function Q(){r=T,s.previous=P,s.currentConstruct=j,s.events.length=q,a=N,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ia(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Aa(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
3
3
  `;break}case-3:{l=`\r
4
4
  `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function Ta(e){const r={constructs:wr([Ca,...(e||{}).extensions||[]]),content:i(Hl),defined:[],document:i(Vl),flow:i(ua),lazy:{},string:i(fa),text:i(ha)};return r;function i(o){return l;function l(a){return Ea(r,o,a)}}}function Pa(e){for(;!Ar(e););return e}const Dt=/[\0\t\n\r]/g;function va(){let e=1,t="",n=!0,r;return i;function i(o,l,a){const u=[];let s,f,c,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Dt.lastIndex=c,s=Dt.exec(o),p=s&&s.index!==void 0?s.index:o.length,h=o.charCodeAt(p),!s){t=o.slice(c);break}if(h===10&&c===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<p&&(u.push(o.slice(c,p)),e+=p-c),h){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const za=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Da(e){return e.replace(za,La)}function La(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Sr(n.slice(o?2:1),o?16:10)}return Qn(n)||e}const Lr={}.hasOwnProperty;function Fa(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Ra(n)(Pa(Ta(n).document().write(va()(e,t,!0))))}function Ra(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(st),autolinkProtocol:B,autolinkEmail:B,atxHeading:o(ot),blockQuote:o(ve),characterEscape:B,characterReference:B,codeFenced:o(Qe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Qe,l),codeText:o(hi,l),codeTextData:B,data:B,codeFlowValue:B,definition:o(pi),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(mi),hardBreakEscape:o(at),hardBreakTrailing:o(at),htmlFlow:o(ut,l),htmlFlowData:B,htmlText:o(ut,l),htmlTextData:B,image:o(gi),label:l,link:o(st),listItem:o(di),listItemValue:p,listOrdered:o(ct,c),listUnordered:o(ct),paragraph:o(yi),reference:g,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(ot),strong:o(ki),thematicBreak:o(bi)},exit:{atxHeading:u(),atxHeadingSequence:z,autolink:u(),autolinkEmail:Pe,autolinkProtocol:ye,blockQuote:u(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:we,characterReferenceMarkerNumeric:we,characterReferenceValue:X,characterReference:Oe,codeFenced:u(E),codeFencedFence:x,codeFencedFenceInfo:h,codeFencedFenceMeta:d,codeFlowValue:k,codeIndented:u(y),codeText:u(N),codeTextData:k,data:k,definition:u(),definitionDestinationString:D,definitionLabelString:I,definitionTitleString:S,emphasis:u(),hardBreakEscape:u(P),hardBreakTrailing:u(P),htmlFlow:u(j),htmlFlowData:k,htmlText:u(q),htmlTextData:k,image:u(Y),label:he,labelText:le,lineEnding:T,link:u(Q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ae,resourceDestinationString:m,resourceTitleString:oe,resource:pe,setextHeading:u($),setextHeadingLineSequence:_,setextHeadingText:w,strong:u(),thematicBreak:u()}};Fr(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(b){let A={type:"root",children:[]};const F={stack:[A],tokenStack:[],config:t,enter:a,exit:s,buffer:l,resume:f,data:n},O=[];let H=-1;for(;++H<b.length;)if(b[H][1].type==="listOrdered"||b[H][1].type==="listUnordered")if(b[H][0]==="enter")O.push(H);else{const ue=O.pop();H=i(b,ue,H)}for(H=-1;++H<b.length;){const ue=t[b[H][0]];Lr.call(ue,b[H][1].type)&&ue[b[H][1].type].call(Object.assign({sliceSerialize:b[H][2].sliceSerialize},F),b[H][1])}if(F.tokenStack.length>0){const ue=F.tokenStack[F.tokenStack.length-1];(ue[1]||Lt).call(F,void 0,ue[0])}for(A.position={start:ke(b.length>0?b[0][1].start:{line:1,column:1,offset:0}),end:ke(b.length>0?b[b.length-2][1].end:{line:1,column:1,offset:0})},H=-1;++H<t.transforms.length;)A=t.transforms[H](A)||A;return A}function i(b,A,F){let O=A-1,H=-1,ue=!1,Se,me,Me,Ne;for(;++O<=F;){const ne=b[O];switch(ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ne[0]==="enter"?H++:H--,Ne=void 0;break}case"lineEndingBlank":{ne[0]==="enter"&&(Se&&!Ne&&!H&&!Me&&(Me=O),Ne=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ne=void 0}if(!H&&ne[0]==="enter"&&ne[1].type==="listItemPrefix"||H===-1&&ne[0]==="exit"&&(ne[1].type==="listUnordered"||ne[1].type==="listOrdered")){if(Se){let ze=O;for(me=void 0;ze--;){const ge=b[ze];if(ge[1].type==="lineEnding"||ge[1].type==="lineEndingBlank"){if(ge[0]==="exit")continue;me&&(b[me][1].type="lineEndingBlank",ue=!0),ge[1].type="lineEnding",me=ze}else if(!(ge[1].type==="linePrefix"||ge[1].type==="blockQuotePrefix"||ge[1].type==="blockQuotePrefixWhitespace"||ge[1].type==="blockQuoteMarker"||ge[1].type==="listItemIndent"))break}Me&&(!me||Me<me)&&(Se._spread=!0),Se.end=Object.assign({},me?b[me][1].start:ne[1].end),b.splice(me||O,0,["exit",Se,ne[2]]),O++,F++}if(ne[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},ne[1].start),end:void 0};Se=ze,b.splice(O,0,["enter",ze,ne[2]]),O++,F++,Me=void 0,Ne=!0}}}return b[A][1]._spread=ue,F}function o(b,A){return F;function F(O){a.call(this,b(O),O),A&&A.call(this,O)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(b,A,F){this.stack[this.stack.length-1].children.push(b),this.stack.push(b),this.tokenStack.push([A,F||void 0]),b.position={start:ke(A.start),end:void 0}}function u(b){return A;function A(F){b&&b.call(this,F),s.call(this,F)}}function s(b,A){const F=this.stack.pop(),O=this.tokenStack.pop();if(O)O[0].type!==b.type&&(A?A.call(this,b,O[0]):(O[1]||Lt).call(this,b,O[0]));else throw new Error("Cannot close `"+b.type+"` ("+He({start:b.start,end:b.end})+"): it’s not open");F.position.end=ke(b.end)}function f(){return Xn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(b){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(b),10),this.data.expectingFirstListItemValue=void 0}}function h(){const b=this.resume(),A=this.stack[this.stack.length-1];A.lang=b}function d(){const b=this.resume(),A=this.stack[this.stack.length-1];A.meta=b}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b.replace(/(\r?\n|\r)$/g,"")}function I(b){const A=this.resume(),F=this.stack[this.stack.length-1];F.label=A,F.identifier=se(this.sliceSerialize(b)).toLowerCase()}function S(){const b=this.resume(),A=this.stack[this.stack.length-1];A.title=b}function D(){const b=this.resume(),A=this.stack[this.stack.length-1];A.url=b}function z(b){const A=this.stack[this.stack.length-1];if(!A.depth){const F=this.sliceSerialize(b).length;A.depth=F}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function _(b){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(b).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function B(b){const F=this.stack[this.stack.length-1].children;let O=F[F.length-1];(!O||O.type!=="text")&&(O=xi(),O.position={start:ke(b.start),end:void 0},F.push(O)),this.stack.push(O)}function k(b){const A=this.stack.pop();A.value+=this.sliceSerialize(b),A.position.end=ke(b.end)}function T(b){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const F=A.children[A.children.length-1];F.position.end=ke(b.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(A.type)&&(B.call(this,b),k.call(this,b))}function P(){this.data.atHardBreak=!0}function j(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b}function q(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b}function N(){const b=this.resume(),A=this.stack[this.stack.length-1];A.value=b}function Q(){const b=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";b.type+="Reference",b.referenceType=A,delete b.url,delete b.title}else delete b.identifier,delete b.label;this.data.referenceType=void 0}function Y(){const b=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";b.type+="Reference",b.referenceType=A,delete b.url,delete b.title}else delete b.identifier,delete b.label;this.data.referenceType=void 0}function le(b){const A=this.sliceSerialize(b),F=this.stack[this.stack.length-2];F.label=Da(A),F.identifier=se(A).toLowerCase()}function he(){const b=this.stack[this.stack.length-1],A=this.resume(),F=this.stack[this.stack.length-1];if(this.data.inReference=!0,F.type==="link"){const O=b.children;F.children=O}else F.alt=A}function m(){const b=this.resume(),A=this.stack[this.stack.length-1];A.url=b}function oe(){const b=this.resume(),A=this.stack[this.stack.length-1];A.title=b}function pe(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function ae(b){const A=this.resume(),F=this.stack[this.stack.length-1];F.label=A,F.identifier=se(this.sliceSerialize(b)).toLowerCase(),this.data.referenceType="full"}function we(b){this.data.characterReferenceType=b.type}function X(b){const A=this.sliceSerialize(b),F=this.data.characterReferenceType;let O;F?(O=Sr(A,F==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):O=Qn(A);const H=this.stack[this.stack.length-1];H.value+=O}function Oe(b){const A=this.stack.pop();A.position.end=ke(b.end)}function ye(b){k.call(this,b);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(b)}function Pe(b){k.call(this,b);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(b)}function ve(){return{type:"blockquote",children:[]}}function Qe(){return{type:"code",lang:null,meta:null,value:""}}function hi(){return{type:"inlineCode",value:""}}function pi(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function mi(){return{type:"emphasis",children:[]}}function ot(){return{type:"heading",depth:0,children:[]}}function at(){return{type:"break"}}function ut(){return{type:"html",value:""}}function gi(){return{type:"image",title:null,url:"",alt:null}}function st(){return{type:"link",title:null,url:"",children:[]}}function ct(b){return{type:"list",ordered:b.type==="listOrdered",start:null,spread:b._spread,children:[]}}function di(b){return{type:"listItem",spread:b._spread,checked:null,children:[]}}function yi(){return{type:"paragraph",children:[]}}function ki(){return{type:"strong",children:[]}}function xi(){return{type:"text",value:""}}function bi(){return{type:"thematicBreak"}}}function ke(e){return{line:e.line,column:e.column,offset:e.offset}}function Fr(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Fr(e,r):_a(e,r)}}function _a(e,t){let n;for(n in t)if(Lr.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Lt(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+He({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+He({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+He({start:t.start,end:t.end})+") is still open")}function Oa(e){const t=this;t.parser=n;function n(r){return Fa(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ma(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Na(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
@@ -1,2 +1,2 @@
1
- import{j as e,r as o,a2 as w,G as y,u as k,b as v,a3 as N,a4 as P,a5 as E}from"./index-BaPY10t-.js";import{c as C}from"./lastTab-CU1zsF0j.js";const b={idea:{pill:"bg-surface-active text-fg-muted",dot:"bg-fg-muted"},active:{pill:"bg-success-soft text-success",dot:"bg-success-solid"},paused:{pill:"bg-warn-soft text-warn",dot:"bg-warn-solid"},blocked:{pill:"bg-danger-soft text-danger",dot:"bg-danger-solid"},done:{pill:"bg-info-soft text-info",dot:"bg-info-solid"},abandoned:{pill:"bg-surface-active text-fg-subtle",dot:"bg-fg-subtle"}};function M({status:t}){const s=b[t]??b.idea;return e.jsxs("span",{className:`status-pill ${s.pill}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${s.dot}`}),t]})}function D({open:t,title:s,message:u,confirmLabel:r="Delete",cancelLabel:c="Cancel",danger:a=!0,wide:l=!1,dismissOnBackdrop:m=!0,onConfirm:f,onClose:n}){const[i,d]=o.useState(!1),[h,g]=o.useState(null);if(o.useEffect(()=>{t&&g(null)},[t]),w(t&&!i,n),!t)return null;const j=async()=>{d(!0),g(null);try{await f()}catch(x){g(x instanceof Error?x.message:"Action failed"),d(!1)}};return e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-overlay p-4 backdrop-blur-sm",onClick:()=>m&&!i&&n(),children:e.jsxs("div",{className:`w-full ${l?"max-w-md":"max-w-sm"} animate-scale-in rounded-2xl border border-edge bg-surface-raised p-6 shadow-2xl`,onClick:x=>x.stopPropagation(),role:"alertdialog","aria-modal":"true",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[a&&e.jsx("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-danger-soft text-danger",children:e.jsx(y,{width:18,height:18})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-base font-semibold",children:s}),e.jsx("div",{className:"mt-1.5 text-sm text-fg-muted",children:u})]})]}),h&&e.jsx("p",{className:"mt-4 rounded-lg bg-danger-soft px-3 py-2 text-sm text-danger",children:h}),e.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[e.jsx("button",{type:"button",className:"btn-ghost",onClick:n,disabled:i,children:c}),e.jsx("button",{type:"button",className:a?"btn btn-danger":"btn-primary",onClick:j,disabled:i,children:i?"Working…":r})]})]})})}function L(t,s){return t===s?!0:t.startsWith(s.endsWith("/")?s:`${s}/`)}function p(t){return!L(t.workingDir,t.dir)}function S({project:t}){const s=e.jsx("span",{className:"font-medium text-fg",children:t.name});return p(t)?e.jsxs(e.Fragment,{children:[s," will be unlinked. Paddock’s notes, settings and chats for it are permanently removed, and this cannot be undone — but the directory it works in is left alone:",e.jsx("span",{className:"mt-1.5 block break-all font-mono text-xs text-fg",children:t.workingDir}),e.jsx("span",{className:"mt-1.5 block",children:"Nothing in there is deleted."})]}):e.jsxs(e.Fragment,{children:[s," and all its chats and files will be permanently removed. This cannot be undone."]})}function I(){const{remove:t}=k();return o.useCallback(async s=>{await v.deleteProject(s),t(s),C(s)},[t])}function O({project:t,open:s,onClose:u,onDeleted:r}){const c=I(),a=p(t);return e.jsx(D,{open:s,title:"Delete project?",message:e.jsx(S,{project:t}),confirmLabel:"Delete project",wide:a,dismissOnBackdrop:!a,onConfirm:async()=>{await c(t.slug),r==null||r()},onClose:u})}function W({onEdit:t,onDelete:s,align:u="right",label:r="Project actions",size:c=16}){const[a,l]=o.useState(!1),m=o.useRef(null);o.useEffect(()=>{if(!a)return;const n=d=>{m.current&&!m.current.contains(d.target)&&l(!1)},i=d=>{d.key==="Escape"&&l(!1)};return document.addEventListener("mousedown",n),document.addEventListener("keydown",i),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",i)}},[a]);const f=n=>{n.preventDefault(),n.stopPropagation()};return e.jsxs("div",{className:"relative",ref:m,children:[e.jsx("button",{type:"button","aria-label":r,"aria-haspopup":"menu","aria-expanded":a,title:r,onClick:n=>{f(n),l(i=>!i)},className:"flex h-7 w-7 items-center justify-center rounded-lg text-fg-subtle transition-colors hover:bg-surface-active hover:text-fg",children:e.jsx(N,{width:c,height:c})}),a&&e.jsxs("div",{className:`menu top-8 ${u==="right"?"right-0":"left-0"}`,role:"menu",children:[e.jsxs("button",{type:"button",role:"menuitem",className:"menu-item",onClick:n=>{f(n),l(!1),t()},children:[e.jsx(P,{width:14,height:14}),"Edit details"]}),s&&e.jsxs("button",{type:"button",role:"menuitem",className:"menu-item-danger",onClick:n=>{f(n),l(!1),s()},children:[e.jsx(E,{width:14,height:14}),"Delete project"]})]})]})}export{D as C,O as D,W as P,M as S,p as d};
1
+ import{j as e,r as o,a2 as w,G as y,u as k,b as v,a3 as N,a4 as P,a5 as E}from"./index-WSqceBAp.js";import{c as C}from"./lastTab-CU1zsF0j.js";const b={idea:{pill:"bg-surface-active text-fg-muted",dot:"bg-fg-muted"},active:{pill:"bg-success-soft text-success",dot:"bg-success-solid"},paused:{pill:"bg-warn-soft text-warn",dot:"bg-warn-solid"},blocked:{pill:"bg-danger-soft text-danger",dot:"bg-danger-solid"},done:{pill:"bg-info-soft text-info",dot:"bg-info-solid"},abandoned:{pill:"bg-surface-active text-fg-subtle",dot:"bg-fg-subtle"}};function M({status:t}){const s=b[t]??b.idea;return e.jsxs("span",{className:`status-pill ${s.pill}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${s.dot}`}),t]})}function D({open:t,title:s,message:u,confirmLabel:r="Delete",cancelLabel:c="Cancel",danger:a=!0,wide:l=!1,dismissOnBackdrop:m=!0,onConfirm:f,onClose:n}){const[i,d]=o.useState(!1),[h,g]=o.useState(null);if(o.useEffect(()=>{t&&g(null)},[t]),w(t&&!i,n),!t)return null;const j=async()=>{d(!0),g(null);try{await f()}catch(x){g(x instanceof Error?x.message:"Action failed"),d(!1)}};return e.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-overlay p-4 backdrop-blur-sm",onClick:()=>m&&!i&&n(),children:e.jsxs("div",{className:`w-full ${l?"max-w-md":"max-w-sm"} animate-scale-in rounded-2xl border border-edge bg-surface-raised p-6 shadow-2xl`,onClick:x=>x.stopPropagation(),role:"alertdialog","aria-modal":"true",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[a&&e.jsx("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-danger-soft text-danger",children:e.jsx(y,{width:18,height:18})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-base font-semibold",children:s}),e.jsx("div",{className:"mt-1.5 text-sm text-fg-muted",children:u})]})]}),h&&e.jsx("p",{className:"mt-4 rounded-lg bg-danger-soft px-3 py-2 text-sm text-danger",children:h}),e.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[e.jsx("button",{type:"button",className:"btn-ghost",onClick:n,disabled:i,children:c}),e.jsx("button",{type:"button",className:a?"btn btn-danger":"btn-primary",onClick:j,disabled:i,children:i?"Working…":r})]})]})})}function L(t,s){return t===s?!0:t.startsWith(s.endsWith("/")?s:`${s}/`)}function p(t){return!L(t.workingDir,t.dir)}function S({project:t}){const s=e.jsx("span",{className:"font-medium text-fg",children:t.name});return p(t)?e.jsxs(e.Fragment,{children:[s," will be unlinked. Paddock’s notes, settings and chats for it are permanently removed, and this cannot be undone — but the directory it works in is left alone:",e.jsx("span",{className:"mt-1.5 block break-all font-mono text-xs text-fg",children:t.workingDir}),e.jsx("span",{className:"mt-1.5 block",children:"Nothing in there is deleted."})]}):e.jsxs(e.Fragment,{children:[s," and all its chats and files will be permanently removed. This cannot be undone."]})}function I(){const{remove:t}=k();return o.useCallback(async s=>{await v.deleteProject(s),t(s),C(s)},[t])}function O({project:t,open:s,onClose:u,onDeleted:r}){const c=I(),a=p(t);return e.jsx(D,{open:s,title:"Delete project?",message:e.jsx(S,{project:t}),confirmLabel:"Delete project",wide:a,dismissOnBackdrop:!a,onConfirm:async()=>{await c(t.slug),r==null||r()},onClose:u})}function W({onEdit:t,onDelete:s,align:u="right",label:r="Project actions",size:c=16}){const[a,l]=o.useState(!1),m=o.useRef(null);o.useEffect(()=>{if(!a)return;const n=d=>{m.current&&!m.current.contains(d.target)&&l(!1)},i=d=>{d.key==="Escape"&&l(!1)};return document.addEventListener("mousedown",n),document.addEventListener("keydown",i),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",i)}},[a]);const f=n=>{n.preventDefault(),n.stopPropagation()};return e.jsxs("div",{className:"relative",ref:m,children:[e.jsx("button",{type:"button","aria-label":r,"aria-haspopup":"menu","aria-expanded":a,title:r,onClick:n=>{f(n),l(i=>!i)},className:"flex h-7 w-7 items-center justify-center rounded-lg text-fg-subtle transition-colors hover:bg-surface-active hover:text-fg",children:e.jsx(N,{width:c,height:c})}),a&&e.jsxs("div",{className:`menu top-8 ${u==="right"?"right-0":"left-0"}`,role:"menu",children:[e.jsxs("button",{type:"button",role:"menuitem",className:"menu-item",onClick:n=>{f(n),l(!1),t()},children:[e.jsx(P,{width:14,height:14}),"Edit details"]}),s&&e.jsxs("button",{type:"button",role:"menuitem",className:"menu-item-danger",onClick:n=>{f(n),l(!1),s()},children:[e.jsx(E,{width:14,height:14}),"Delete project"]})]})]})}export{D as C,O as D,W as P,M as S,p as d};
2
2
 
@@ -1,2 +1,2 @@
1
- import{i as u,r as i,b as o,j as n,k as p}from"./index-BaPY10t-.js";import{r as m,v as f}from"./lastTab-CU1zsF0j.js";function j(){const{slug:t=""}=u(),[s,r]=i.useState(null);return i.useEffect(()=>{let c=!1;const e=m(t);if(!e){r("home");return}if(e==="home"||e.startsWith("chat")){r(e);return}return Promise.all([o.getProjectDetail(t).then(a=>a.project.pinned).catch(()=>[]),o.listProjectFiles(t).catch(()=>[])]).then(([a,l])=>{c||r(f(e,{pinned:a,files:l}))}),()=>{c=!0}},[t]),s===null?n.jsx("div",{className:"p-8 text-sm text-fg-muted",children:"Opening project…"}):n.jsx(p,{to:`/projects/${t}/${s}`,replace:!0})}export{j as ProjectRedirect};
1
+ import{i as u,r as i,b as o,j as n,k as p}from"./index-WSqceBAp.js";import{r as m,v as f}from"./lastTab-CU1zsF0j.js";function j(){const{slug:t=""}=u(),[s,r]=i.useState(null);return i.useEffect(()=>{let c=!1;const e=m(t);if(!e){r("home");return}if(e==="home"||e.startsWith("chat")){r(e);return}return Promise.all([o.getProjectDetail(t).then(a=>a.project.pinned).catch(()=>[]),o.listProjectFiles(t).catch(()=>[])]).then(([a,l])=>{c||r(f(e,{pinned:a,files:l}))}),()=>{c=!0}},[t]),s===null?n.jsx("div",{className:"p-8 text-sm text-fg-muted",children:"Opening project…"}):n.jsx(p,{to:`/projects/${t}/${s}`,replace:!0})}export{j as ProjectRedirect};
2
2