quadwork 1.19.1 → 1.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/out/404.html +1 -1
  2. package/out/__next.__PAGE__.txt +1 -1
  3. package/out/__next._full.txt +2 -2
  4. package/out/__next._head.txt +1 -1
  5. package/out/__next._index.txt +2 -2
  6. package/out/__next._tree.txt +2 -2
  7. package/out/_next/static/chunks/08kw.2kplxa.6.css +2 -0
  8. package/out/_next/static/chunks/{153f.fj8jlvle.js → 08tog0xc~.es_.js} +1 -1
  9. package/out/_next/static/chunks/{0makcdqkwobp6.js → 0_nm7se0m3twm.js} +1 -1
  10. package/out/_not-found/__next._full.txt +2 -2
  11. package/out/_not-found/__next._head.txt +1 -1
  12. package/out/_not-found/__next._index.txt +2 -2
  13. package/out/_not-found/__next._not-found.__PAGE__.txt +1 -1
  14. package/out/_not-found/__next._not-found.txt +1 -1
  15. package/out/_not-found/__next._tree.txt +2 -2
  16. package/out/_not-found.html +1 -1
  17. package/out/_not-found.txt +2 -2
  18. package/out/app-shell/__next._full.txt +2 -2
  19. package/out/app-shell/__next._head.txt +1 -1
  20. package/out/app-shell/__next._index.txt +2 -2
  21. package/out/app-shell/__next._tree.txt +2 -2
  22. package/out/app-shell/__next.app-shell.__PAGE__.txt +1 -1
  23. package/out/app-shell/__next.app-shell.txt +1 -1
  24. package/out/app-shell.html +1 -1
  25. package/out/app-shell.txt +2 -2
  26. package/out/index.html +1 -1
  27. package/out/index.txt +2 -2
  28. package/out/project/_/__next._full.txt +3 -3
  29. package/out/project/_/__next._head.txt +1 -1
  30. package/out/project/_/__next._index.txt +2 -2
  31. package/out/project/_/__next._tree.txt +2 -2
  32. package/out/project/_/__next.project.$d$id.__PAGE__.txt +2 -2
  33. package/out/project/_/__next.project.$d$id.txt +1 -1
  34. package/out/project/_/__next.project.txt +1 -1
  35. package/out/project/_/queue/__next._full.txt +2 -2
  36. package/out/project/_/queue/__next._head.txt +1 -1
  37. package/out/project/_/queue/__next._index.txt +2 -2
  38. package/out/project/_/queue/__next._tree.txt +2 -2
  39. package/out/project/_/queue/__next.project.$d$id.queue.__PAGE__.txt +1 -1
  40. package/out/project/_/queue/__next.project.$d$id.queue.txt +1 -1
  41. package/out/project/_/queue/__next.project.$d$id.txt +1 -1
  42. package/out/project/_/queue/__next.project.txt +1 -1
  43. package/out/project/_/queue.html +1 -1
  44. package/out/project/_/queue.txt +2 -2
  45. package/out/project/_.html +1 -1
  46. package/out/project/_.txt +3 -3
  47. package/out/settings/__next._full.txt +2 -2
  48. package/out/settings/__next._head.txt +1 -1
  49. package/out/settings/__next._index.txt +2 -2
  50. package/out/settings/__next._tree.txt +2 -2
  51. package/out/settings/__next.settings.__PAGE__.txt +1 -1
  52. package/out/settings/__next.settings.txt +1 -1
  53. package/out/settings.html +1 -1
  54. package/out/settings.txt +2 -2
  55. package/out/setup/__next._full.txt +2 -2
  56. package/out/setup/__next._head.txt +1 -1
  57. package/out/setup/__next._index.txt +2 -2
  58. package/out/setup/__next._tree.txt +2 -2
  59. package/out/setup/__next.setup.__PAGE__.txt +1 -1
  60. package/out/setup/__next.setup.txt +1 -1
  61. package/out/setup.html +1 -1
  62. package/out/setup.txt +2 -2
  63. package/package.json +1 -1
  64. package/server/index.js +52 -0
  65. package/server/routes.js +413 -22
  66. package/out/_next/static/chunks/0_bb~2.5h2ntm.css +0 -2
  67. /package/out/_next/static/{55YICUuE6JNvvGBzMKKu0 → D66Um4H226QD5y4w5xTKq}/_buildManifest.js +0 -0
  68. /package/out/_next/static/{55YICUuE6JNvvGBzMKKu0 → D66Um4H226QD5y4w5xTKq}/_clientMiddlewareManifest.js +0 -0
  69. /package/out/_next/static/{55YICUuE6JNvvGBzMKKu0 → D66Um4H226QD5y4w5xTKq}/_ssgManifest.js +0 -0
@@ -2,7 +2,7 @@
2
2
  @head: Merge any PR with both approvals, assign next from ~/.quadwork/{{project}}/OVERNIGHT-QUEUE.md.
3
3
  @dev: Work on assigned ticket or address review feedback.
4
4
  @re1 & @re2: Review open PRs. If @dev pushed fixes, re-review. Post verdict on PR AND notify @dev here.
5
- ALL: Communicate via this chat by tagging agents. Your terminal is NOT visible.`},{id:"default-2",title:"Suffix Reminder",message:"All agents: ignore numeric suffixes in your identity. dev, dev-1, dev-2 are the same Dev agent. re1, re1-2 are the same RE1. re2, re2-2 are the same RE2. head, head-2 are the same Head. When tagging others, use the base name (@dev, @re1, @re2, @head). When checking for mentions to you, match your base role name regardless of suffix."},{id:"default-3",title:"Check Queue Format",message:"@head Check your OVERNIGHT-QUEUE.md formatting. Each Active Batch item must start with `- #<number>` (dash, space, hash, issue number). Do NOT use `- Issue #598` format — only `- #598 description`. The Current Batch panel won't recognize items in any other format. Fix if needed and confirm."},{id:"default-4",title:"Agent Online Check",message:"@head Are you online? If so, ping @dev, @re1, and @re2 to confirm whether they are online and available."}];function d({projectId:e,onSend:r}){let[l,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)([]),[s,p]=(0,n.useState)(null),[h,f]=(0,n.useState)(""),[m,x]=(0,n.useState)("");(0,n.useEffect)(()=>{o(function(){try{let e=localStorage.getItem(c);if(!e)return localStorage.setItem(c,JSON.stringify(u)),u;return JSON.parse(e)}catch{return u}}())},[]);let g=(0,n.useCallback)(e=>{o(e),localStorage.setItem(c,JSON.stringify(e))},[]);return l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>i(!1),className:"shrink-0 px-1.5 py-2 text-[10px] text-accent transition-colors",title:"Close presets",children:"Preset"}),(0,t.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>{i(!1),p(null)}}),(0,t.jsxs)("div",{className:"absolute bottom-full left-0 right-0 mb-1 z-50 border border-border bg-bg-surface max-h-[60vh] overflow-y-auto",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50",children:[(0,t.jsx)("span",{className:"text-[11px] text-text font-semibold",children:"Message Presets"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{p({id:"",title:"",message:""}),f(""),x("")},className:"text-[10px] text-accent hover:underline",children:"+ New"}),(0,t.jsx)("button",{type:"button",onClick:()=>{i(!1),p(null)},className:"text-[11px] text-text-muted hover:text-text",children:"✕"})]})]}),s?(0,t.jsxs)("div",{className:"p-3 flex flex-col gap-2",children:[(0,t.jsx)("input",{type:"text",value:h,onChange:e=>f(e.target.value),placeholder:"Preset title",className:"w-full bg-transparent border border-border px-2 py-1 text-[11px] text-text outline-none focus:border-accent"}),(0,t.jsx)("textarea",{value:m,onChange:e=>x(e.target.value),placeholder:"Message body",rows:5,className:"w-full bg-transparent border border-border px-2 py-1 text-[11px] text-text outline-none focus:border-accent resize-y font-mono"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{h.trim()&&m.trim()&&(s&&s.id?g(a.map(e=>e.id===s.id?{...e,title:h,message:m}:e)):g([...a,{id:`preset-${Date.now()}`,title:h,message:m}]),p(null))},disabled:!h.trim()||!m.trim(),className:"px-2 py-0.5 text-[10px] text-accent border border-accent/40 hover:bg-accent/10 transition-colors disabled:opacity-30",children:"Save"}),(0,t.jsx)("button",{type:"button",onClick:()=>p(null),className:"px-2 py-0.5 text-[10px] text-text-muted border border-border hover:text-text transition-colors",children:"Cancel"})]})]}):(0,t.jsxs)("div",{className:"divide-y divide-border/30",children:[0===a.length&&(0,t.jsx)("div",{className:"px-3 py-4 text-[11px] text-text-muted text-center",children:'No presets. Click "+ New" to create one.'}),a.map(n=>(0,t.jsx)("div",{className:"px-3 py-2 hover:bg-accent/5 group",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{r(n.message.replace(/\{\{project\}\}/g,e)),i(!1)},className:"text-left flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-[11px] text-text font-medium truncate",children:n.title}),(0,t.jsxs)("div",{className:"text-[10px] text-text-muted truncate mt-0.5",children:[n.message.slice(0,80),n.message.length>80?"…":""]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{p(n),f(n.title),x(n.message)},className:"text-[10px] text-text-muted hover:text-accent",title:"Edit",children:"✎"}),(0,t.jsx)("button",{type:"button",onClick:()=>{var e;return e=n.id,void g(a.filter(t=>t.id!==e))},className:"text-[10px] text-text-muted hover:text-error",title:"Delete",children:"✕"})]})]})},n.id))]})]})]}):(0,t.jsx)("button",{type:"button",onClick:()=>i(!0),className:"shrink-0 px-1.5 py-2 text-[10px] text-text-muted hover:text-accent transition-colors",title:"Message presets",children:"Preset"})}let p={head:"#00ff88",re1:"#4488ff",re2:"#cc44ff",dev:"#ffcc00",user:"#e0e0e0",system:"#737373"},h=["head","re1","re2","dev","user"],f=[/^.+ is online$/,/disconnected \(timeout\)/,/^.+ disconnected$/,/auto-recovered/,/Resuming agent conversation/,/Loop guard:/],m=[{command:"/artchallenge",description:"SVG art challenge — all agents create artwork (optional theme)"},{command:"/hatmaking",description:"All agents design a hat to wear on their avatar"},{command:"/roastreview",description:"Get all agents to review and roast each other's work"},{command:"/poetry haiku",description:"Agents write a haiku about the codebase"},{command:"/poetry limerick",description:"Agents write a limerick about the codebase"},{command:"/poetry sonnet",description:"Agents write a sonnet about the codebase"},{command:"/summary",description:"Summarize recent messages — tag an agent (e.g. /summary @head)"},{command:"/continue",description:"Resume after loop guard pauses"},{command:"/clear",description:"Clear messages in current channel"}];function x(e){return p[e.toLowerCase()]||"#e0e0e0"}let g=/(^|\s)(@(?:head|dev|re1|re2|user))(?![\w-])/gi;function b({projectId:e,filterSystem:n}){return(0,t.jsx)(y,{projectId:e,filterSystem:n})}function y({projectId:e,filterSystem:r=!1}){let l="general",[i,a]=(0,n.useState)([]),[o,c]=(0,n.useState)(!1),[u,p]=(0,n.useState)(""),b=(0,n.useRef)(0),v=(0,n.useRef)(null),[w,k]=(0,n.useState)(!1),[j,N]=(0,n.useState)(""),[S,C]=(0,n.useState)(!1),[E,A]=(0,n.useState)(0),[T,I]=(0,n.useState)(null),[R,O]=(0,n.useState)(null),P=(0,n.useRef)(0),M=(0,n.useRef)(null),F=(0,n.useRef)(null),D=(0,n.useRef)(!1),_=(0,n.useRef)(!0),L=(0,n.useRef)(0);(0,n.useEffect)(()=>{P.current=0,a([]),c(!1),b.current=0,v.current&&(clearTimeout(v.current),v.current=null)},[e]);let $=(0,n.useCallback)(()=>{fetch(`/api/chat?path=/api/messages&channel=${encodeURIComponent(l)}&cursor=${P.current}${e?`&project=${encodeURIComponent(e)}`:""}`).then(e=>{if(403===e.status)throw L.current<3?I(null):I("Chat authentication failed (403). Set agentchattr_token in Settings or ~/.quadwork/config.json."),Error("auth failed");if(!e.ok)throw Error(`Poll failed: ${e.status}`);return e.json()}).then(e=>{I(null);let t=Array.isArray(e)?e:e.messages||[];if(t.length>0){a(e=>{let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return r.length>0?[...e,...r]:e});let e=Math.max(...t.map(e=>e.id));e>P.current&&(P.current=e)}c(!0)}).catch(()=>{!o&&b.current<3&&(b.current+=1,v.current=setTimeout($,2e3))})},[l,e,o]);(0,n.useEffect)(()=>{$();let e=setInterval($,3e3);return()=>{clearInterval(e),v.current&&(clearTimeout(v.current),v.current=null)}},[$]),(0,n.useEffect)(()=>{_.current&&M.current&&(M.current.scrollTop=M.current.scrollHeight)},[i]);let[U,z]=(0,n.useState)(!1),[B,H]=(0,n.useState)(null),[q,V]=(0,n.useState)([]),[W,G]=(0,n.useState)(!1),J=(0,n.useRef)(null),Q=async t=>{if(e){G(!0);try{let n=new FormData;n.append("file",t);let r=await fetch(`/api/upload?project=${encodeURIComponent(e)}`,{method:"POST",body:n});if(!r.ok){let e=await r.json().catch(()=>({error:`${r.status}`}));H(e.error||`Upload failed: ${r.status}`);return}let l=await r.json();V(e=>[...e,{path:l.path,name:l.name}])}catch(e){H(e.message)}finally{G(!1)}}},K=e=>{for(let t of e)t.type.startsWith("image/")&&Q(t)};(0,n.useEffect)(()=>{let e=F.current;e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,120)+"px")},[u]);let Y=()=>{let t=u.trim();if(!t&&0===q.length||U)return;let n=t.startsWith("/")||/^@(head|dev|re1|re2)\b/i.test(t)?t:`@head ${t}`;z(!0),H(null),fetch(`/api/chat${e?`?project=${encodeURIComponent(e)}`:""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n,channel:l,sender:"user",...q.length>0?{attachments:q}:{},...R?{reply_to:R.id}:{}})}).then(e=>{if(!e.ok)throw Error(`Send failed: ${e.status}`);p(""),V([]),O(null),setTimeout($,300)}).catch(e=>{H(e.message),console.error(e.message)}).finally(()=>z(!1))},X=(0,n.useCallback)(t=>{if(U)return;let n=t.startsWith("/")||/^@(head|dev|re1|re2)\b/i.test(t)?t:`@head ${t}`;z(!0),H(null),fetch(`/api/chat${e?`?project=${encodeURIComponent(e)}`:""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n,channel:l,sender:"user"})}).then(e=>{if(!e.ok)throw Error(`Send failed: ${e.status}`);setTimeout($,300)}).catch(e=>{H(e.message),console.error(e.message)}).finally(()=>z(!1))},[U,e,l,$]),Z=e=>{p(u.replace(/@\w*$/,`@${e} `)),k(!1),F.current?.focus()},ee=e=>{p(e.includes(" ")?e:`${e} `),C(!1),F.current?.focus()},et=h.filter(e=>e.toLowerCase().startsWith(j)),en=m.filter(e=>e.command.toLowerCase().startsWith(u.toLowerCase())),er=r?i.filter(e=>!function(e){if("system"===e.sender||"join"===e.type||"leave"===e.type)return!0;for(let t of f)if(t.test(e.text))return!0;return!1}(e)):i;return(0,t.jsxs)("div",{className:"flex flex-col h-full bg-bg",children:[T&&(0,t.jsx)("div",{className:"px-3 py-2 bg-red-900/30 border-b border-red-700/50 text-[11px] text-red-400",children:T}),(0,t.jsxs)("div",{ref:M,onScroll:()=>{if(!M.current)return;let{scrollTop:e,scrollHeight:t,clientHeight:n}=M.current;_.current=t-e-n<40},className:"flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-0.5",children:[!o&&0===i.length&&(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"Loading messages..."})}),o&&0===er.length&&(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)(s,{onInsert:e=>{p(e),F.current?.focus()}})}),er.map(n=>{var r;let l;return(0,t.jsxs)("div",{className:"group flex gap-2 text-[12px] leading-5",children:[(0,t.jsx)("span",{className:"text-text-muted shrink-0 w-12 text-right tabular-nums",children:n.time?.slice(0,5)||""}),(0,t.jsx)("span",{className:"shrink-0 font-semibold w-10 text-right",style:{color:x(n.sender)},children:"re1"===(l=(r=n.sender).toLowerCase())?"RE1":"re2"===l?"RE2":r}),(0,t.jsxs)("span",{className:"text-text break-words min-w-0 whitespace-pre-wrap flex-1",children:[function(e){let n=[],r=0,l=0;for(let i of e.matchAll(g)){let a=i.index??0,o=i[1],s=i[2],c=a+o.length;c>r&&n.push(e.slice(r,c));let u=x(s.slice(1).toLowerCase());n.push((0,t.jsx)("span",{className:"inline-block px-1 py-0 rounded font-mono",style:{backgroundColor:`${u}22`,color:u},children:s},`m${l++}`)),r=c+s.length}return r<e.length&&n.push(e.slice(r)),n.length>0?n:[e]}(n.text),n.attachments&&n.attachments.length>0&&(0,t.jsx)("span",{className:"flex gap-2 mt-1",children:n.attachments.map(n=>(0,t.jsx)("a",{href:`/api/uploads/${encodeURIComponent(e||"")}/${encodeURIComponent(n.name)}`,target:"_blank",rel:"noopener noreferrer",children:(0,t.jsx)("img",{src:`/api/uploads/${encodeURIComponent(e||"")}/${encodeURIComponent(n.name)}`,alt:n.name,className:"max-w-[200px] max-h-[150px] object-cover border border-border rounded hover:border-accent transition-colors"})},n.name))})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{if(O({id:n.id,sender:n.sender}),new Set(["head","dev","re1","re2"]).has(n.sender.toLowerCase())){let e=`@${n.sender} `;p(t=>t.startsWith(e)?t:e)}F.current?.focus()},className:"shrink-0 self-start opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-[10px] text-text-muted hover:text-text px-1 py-0.5 border border-border/50 rounded",title:`Reply to message #${n.id}`,children:"reply"})]},n.id)})]}),(0,t.jsxs)("div",{className:"relative shrink-0 border-t border-border",children:[w&&et.length>0&&(0,t.jsx)("div",{className:"absolute bottom-full left-0 right-0 border border-border bg-bg-surface",children:et.map(e=>(0,t.jsxs)("button",{onClick:()=>Z(e),className:"w-full text-left px-3 py-1 text-[12px] hover:bg-[#1a1a1a] transition-colors",style:{color:x(e)},children:["@",e]},e))}),S&&en.length>0&&(0,t.jsx)("div",{className:"absolute bottom-full left-0 right-0 max-h-60 overflow-y-auto border border-border bg-bg-surface z-10",children:en.map((e,n)=>{let r=n===Math.min(E,en.length-1);return(0,t.jsxs)("button",{onClick:()=>ee(e.command),onMouseEnter:()=>A(n),className:`w-full text-left px-3 py-1 transition-colors flex items-baseline gap-2 ${r?"bg-[#1a1a1a]":"hover:bg-[#1a1a1a]"}`,children:[(0,t.jsx)("span",{className:"text-[12px] text-accent font-mono",children:e.command}),(0,t.jsx)("span",{className:"text-[10px] text-text-muted truncate",children:e.description})]},e.command)})}),B&&(0,t.jsx)("div",{className:"px-3 py-1 text-[11px] text-red-400 bg-red-900/20 border-b border-red-700/40",children:B}),R&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1 text-[11px] text-text-muted bg-bg-surface border-b border-border/50",children:[(0,t.jsxs)("span",{children:["Replying to ",(0,t.jsxs)("span",{style:{color:x(R.sender)},children:["@",R.sender]})," #",R.id]}),(0,t.jsx)("button",{type:"button",onClick:()=>O(null),className:"ml-auto hover:text-text",title:"Cancel reply (Esc)",children:"✕"})]}),(0,t.jsxs)("div",{className:"flex items-end gap-1 px-1 relative",children:[(0,t.jsx)("textarea",{ref:F,rows:1,value:u,onChange:e=>(e=>{p(e);let t=e.match(/@(\w*)$/);if(t){k(!0),N(t[1].toLowerCase()),C(!1);return}if(k(!1),e.startsWith("/")){let t=e.slice(1).includes(" "),n=e.startsWith("/poetry");C(!t||n),A(0)}else C(!1)})(e.target.value),onCompositionStart:()=>{D.current=!0},onCompositionEnd:()=>{D.current=!1},onKeyDown:e=>{if("Tab"===e.key&&w&&et.length>0){e.preventDefault(),Z(et[0]);return}if(S&&en.length>0){if("ArrowDown"===e.key){e.preventDefault(),A(e=>(e+1)%en.length);return}if("ArrowUp"===e.key){e.preventDefault(),A(e=>(e-1+en.length)%en.length);return}if("Tab"===e.key||"Enter"===e.key&&!e.shiftKey){e.preventDefault();let t=Math.min(E,en.length-1);ee(en[t].command);return}}"Enter"!==e.key||e.shiftKey||D.current||e.nativeEvent.isComposing||(e.preventDefault(),Y()),"Escape"===e.key&&(k(!1),C(!1),R&&O(null))},onPaste:e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of Array.from(t))if(e.type.startsWith("image/")){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),K(n))},onDrop:e=>{let t=e.dataTransfer?.files;if(!t)return;let n=Array.from(t).filter(e=>e.type.startsWith("image/"));n.length>0&&(e.preventDefault(),K(n))},onDragOver:e=>{e.dataTransfer?.types?.includes("Files")&&e.preventDefault()},placeholder:`Message #${l}...`,disabled:U,className:"flex-1 bg-transparent px-2 py-2 text-[12px] font-mono text-text placeholder:text-text-muted outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 resize-none overflow-y-auto leading-snug",style:{maxHeight:120}}),(0,t.jsx)("input",{ref:J,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,className:"hidden",onChange:e=>{let t=e.target.files;t&&t.length>0&&K(Array.from(t)),e.target.value=""}}),(0,t.jsx)(d,{projectId:e||"",onSend:X}),(0,t.jsx)("button",{type:"button",onClick:()=>J.current?.click(),disabled:W,className:"shrink-0 px-1.5 py-2 text-[13px] text-text-muted hover:text-accent transition-colors disabled:opacity-30",title:"Attach image",children:"📎"}),(0,t.jsx)("button",{onClick:Y,disabled:U||!u.trim()&&0===q.length,className:"shrink-0 px-2 py-2 text-[11px] font-mono text-accent border border-accent/40 rounded hover:bg-accent/10 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send (Enter)",children:U?"…":"Send"})]}),(q.length>0||W)&&(0,t.jsxs)("div",{className:"flex gap-2 px-2 py-1 flex-wrap",children:[q.map((n,r)=>(0,t.jsxs)("div",{className:"relative group",children:[(0,t.jsx)("img",{src:`/api/uploads/${encodeURIComponent(e||"")}/${encodeURIComponent(n.name)}`,alt:n.name,className:"h-16 max-w-[200px] object-cover border border-border rounded"}),(0,t.jsx)("button",{type:"button",onClick:()=>V(e=>e.filter((e,t)=>t!==r)),className:"absolute -top-1.5 -right-1.5 w-4 h-4 bg-bg border border-border rounded-full text-[10px] text-text-muted hover:text-error opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",title:"Remove",children:"×"})]},n.name)),W&&(0,t.jsx)("div",{className:"h-16 w-16 border border-border rounded flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-[10px] text-text-muted animate-pulse",children:"..."})})]})]})]})}function v(){}function w(){}let k=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N={};function S(e,t){return((t||N).jsx?j:k).test(e)}let C=/[ \t\n\f\r]/g;function E(e){return""===e.replace(C,"")}class A{constructor(e,t){this.attribute=t,this.property=e}}A.prototype.attribute="",A.prototype.booleanish=!1,A.prototype.boolean=!1,A.prototype.commaOrSpaceSeparated=!1,A.prototype.commaSeparated=!1,A.prototype.defined=!1,A.prototype.mustUseProperty=!1,A.prototype.number=!1,A.prototype.overloadedBoolean=!1,A.prototype.property="",A.prototype.spaceSeparated=!1,A.prototype.space=void 0;let T=0,I=_(),R=_(),O=_(),P=_(),M=_(),F=_(),D=_();function _(){return 2**++T}e.s(["boolean",0,I,"booleanish",0,R,"commaOrSpaceSeparated",0,D,"commaSeparated",0,F,"number",0,P,"overloadedBoolean",0,O,"spaceSeparated",0,M],744);var L=e.i(744);let $=Object.keys(L);class U extends A{constructor(e,t,n,r){let l=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++l<$.length;){const e=$[l];!function(e,t,n){n&&(e[t]=n)}(this,$[l],(n&L[e])===L[e])}}}function z(e){return e.toLowerCase()}U.prototype.defined=!0;let B=/[A-Z]/g,H=/-[a-z]/g,q=/^data[-\w.:]+$/i;function V(e){return"-"+e.toLowerCase()}function W(e){return e.charAt(1).toUpperCase()}let G={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"};class J{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Q(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new J(n,r,t)}function K(e){let t={},n={};for(let[r,l]of Object.entries(e.properties)){let i=new U(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[z(r)]=r,n[z(i.attribute)]=r}return new J(t,n,e.space)}J.prototype.normal={},J.prototype.property={},J.prototype.space=void 0;let Y=K({properties:{ariaActiveDescendant:null,ariaAtomic:R,ariaAutoComplete:null,ariaBusy:R,ariaChecked:R,ariaColCount:P,ariaColIndex:P,ariaColSpan:P,ariaControls:M,ariaCurrent:null,ariaDescribedBy:M,ariaDetails:null,ariaDisabled:R,ariaDropEffect:M,ariaErrorMessage:null,ariaExpanded:R,ariaFlowTo:M,ariaGrabbed:R,ariaHasPopup:null,ariaHidden:R,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:M,ariaLevel:P,ariaLive:null,ariaModal:R,ariaMultiLine:R,ariaMultiSelectable:R,ariaOrientation:null,ariaOwns:M,ariaPlaceholder:null,ariaPosInSet:P,ariaPressed:R,ariaReadOnly:R,ariaRelevant:null,ariaRequired:R,ariaRoleDescription:M,ariaRowCount:P,ariaRowIndex:P,ariaRowSpan:P,ariaSelected:R,ariaSetSize:P,ariaSort:null,ariaValueMax:P,ariaValueMin:P,ariaValueNow:P,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function X(e,t){return t in e?e[t]:t}function Z(e,t){return X(e,t.toLowerCase())}let ee=K({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:F,acceptCharset:M,accessKey:M,action:null,allow:null,allowFullScreen:I,allowPaymentRequest:I,allowUserMedia:I,alt:null,as:null,async:I,autoCapitalize:null,autoComplete:M,autoFocus:I,autoPlay:I,blocking:M,capture:null,charSet:null,checked:I,cite:null,className:M,cols:P,colSpan:null,content:null,contentEditable:R,controls:I,controlsList:M,coords:P|F,crossOrigin:null,data:null,dateTime:null,decoding:null,default:I,defer:I,dir:null,dirName:null,disabled:I,download:O,draggable:R,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:I,formTarget:null,headers:M,height:P,hidden:O,high:P,href:null,hrefLang:null,htmlFor:M,httpEquiv:M,id:null,imageSizes:null,imageSrcSet:null,inert:I,inputMode:null,integrity:null,is:null,isMap:I,itemId:null,itemProp:M,itemRef:M,itemScope:I,itemType:M,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:I,low:P,manifest:null,max:null,maxLength:P,media:null,method:null,min:null,minLength:P,multiple:I,muted:I,name:null,nonce:null,noModule:I,noValidate:I,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:I,optimum:P,pattern:null,ping:M,placeholder:null,playsInline:I,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:I,referrerPolicy:null,rel:M,required:I,reversed:I,rows:P,rowSpan:P,sandbox:M,scope:null,scoped:I,seamless:I,selected:I,shadowRootClonable:I,shadowRootDelegatesFocus:I,shadowRootMode:null,shape:null,size:P,sizes:null,slot:null,span:P,spellCheck:R,src:null,srcDoc:null,srcLang:null,srcSet:null,start:P,step:null,style:null,tabIndex:P,target:null,title:null,translate:null,type:null,typeMustMatch:I,useMap:null,value:R,width:P,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:M,axis:null,background:null,bgColor:null,border:P,borderColor:null,bottomMargin:P,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:I,declare:I,event:null,face:null,frame:null,frameBorder:null,hSpace:P,leftMargin:P,link:null,longDesc:null,lowSrc:null,marginHeight:P,marginWidth:P,noResize:I,noHref:I,noShade:I,noWrap:I,object:null,profile:null,prompt:null,rev:null,rightMargin:P,rules:null,scheme:null,scrolling:R,standby:null,summary:null,text:null,topMargin:P,valueType:null,version:null,vAlign:null,vLink:null,vSpace:P,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:I,disableRemotePlayback:I,prefix:null,property:null,results:P,security:null,unselectable:null},space:"html",transform:Z}),et=K({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",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:D,accentHeight:P,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:P,amplitude:P,arabicForm:null,ascent:P,attributeName:null,attributeType:null,azimuth:P,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:P,by:null,calcMode:null,capHeight:P,className:M,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:P,diffuseConstant:P,direction:null,display:null,dur:null,divisor:P,dominantBaseline:null,download:I,dx:null,dy:null,edgeMode:null,editable:null,elevation:P,enableBackground:null,end:null,event:null,exponent:P,externalResourcesRequired:null,fill:null,fillOpacity:P,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:F,g2:F,glyphName:F,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:P,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:P,horizOriginX:P,horizOriginY:P,id:null,ideographic:P,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:P,k:P,k1:P,k2:P,k3:P,k4:P,kernelMatrix:D,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:P,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:P,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:P,overlineThickness:P,paintOrder:null,panose1:null,path:null,pathLength:P,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:M,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:P,pointsAtY:P,pointsAtZ:P,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D,rev:D,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D,requiredFeatures:D,requiredFonts:D,requiredFormats:D,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:P,specularExponent:P,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:P,strikethroughThickness:P,string:null,stroke:null,strokeDashArray:D,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:P,strokeOpacity:P,strokeWidth:null,style:null,surfaceScale:P,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D,tabIndex:P,tableValues:null,target:null,targetX:P,targetY:P,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:P,underlineThickness:P,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:P,values:null,vAlphabetic:P,vMathematical:P,vectorEffect:null,vHanging:P,vIdeographic:P,version:null,vertAdvY:P,vertOriginX:P,vertOriginY:P,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:P,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:X}),en=K({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),er=K({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Z}),el=K({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),ei=Q([Y,ee,en,er,el],"html"),ea=Q([Y,et,en,er,el],"svg");var eo=e.i(15511);let es=eu("end"),ec=eu("start");function eu(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function ed(e){return e&&"object"==typeof e?"position"in e||"type"in e?eh(e.position):"start"in e||"end"in e?eh(e):"line"in e||"column"in e?ep(e):"":""}function ep(e){return ef(e&&e.line)+":"+ef(e&&e.column)}function eh(e){return ep(e&&e.start)+"-"+ep(e&&e.end)}function ef(e){return e&&"number"==typeof e?e:1}class em extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",l={},i=!1;if(t&&(l="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!l.cause&&e&&(i=!0,r=e.message,l.cause=e),!l.ruleId&&!l.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?l.ruleId=n:(l.source=n.slice(0,e),l.ruleId=n.slice(e+1))}if(!l.place&&l.ancestors&&l.ancestors){const e=l.ancestors[l.ancestors.length-1];e&&(l.place=e.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=ed(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=i&&l.cause&&"string"==typeof l.cause.stack?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}em.prototype.file="",em.prototype.name="",em.prototype.reason="",em.prototype.message="",em.prototype.stack="",em.prototype.column=void 0,em.prototype.line=void 0,em.prototype.ancestors=void 0,em.prototype.cause=void 0,em.prototype.fatal=void 0,em.prototype.place=void 0,em.prototype.ruleId=void 0,em.prototype.source=void 0;let ex={}.hasOwnProperty,eg=new Map,eb=/[A-Z]/g,ey=new Set(["table","tbody","thead","tfoot","tr"]),ev=new Set(["td","th"]),ew="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ek(e,t,n){var r,l,i,a,o,s,c,u,d;let p,h,f,m,x,g,b,y,w,k,j;return"element"===t.type?(r=e,l=t,i=n,h=p=r.schema,"svg"===l.tagName.toLowerCase()&&"html"===p.space&&(r.schema=ea),r.ancestors.push(l),f=eC(r,l.tagName,!1),m=function(e,t){let n,r,l={};for(r in t.properties)if("children"!==r&&ex.call(t.properties,r)){let i=function(e,t,n){let r=function(e,t){let n=z(t),r=t,l=A;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&q.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(H,W);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!H.test(e)){let n=e.replace(B,V);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}l=U}return new l(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var l;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(l=n)[l.length-1]?[...l,""]:l).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,eo.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new em("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=ew+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)ex.call(e,t)&&(n[function(e){let t=e.replace(eb,eA);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?G[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(i){let[r,a]=i;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&ev.has(t.tagName)?n=a:l[r]=a}}return n&&((l.style||(l.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),l}(r,l),x=eS(r,l),ey.has(l.tagName)&&(x=x.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&E(e.value):E(e))})),ej(r,m,f,l),eN(m,x),r.ancestors.pop(),r.schema=p,r.create(l,f,m,i)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return v("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}eE(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(a=e,o=t,s=n,b=g=a.schema,"svg"===o.name&&"html"===g.space&&(a.schema=ea),a.ancestors.push(o),y=null===o.name?a.Fragment:eC(a,o.name,!0),w=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];v("ExpressionStatement"===t.type);let l=t.expression;v("ObjectExpression"===l.type);let i=l.properties[0];v("SpreadElement"===i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else eE(e,t.position);else{let l,i=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];v("ExpressionStatement"===t.type),l=e.evaluater.evaluateExpression(t.expression)}else eE(e,t.position);else l=null===r.value||r.value;n[i]=l}return n}(a,o),k=eS(a,o),ej(a,w,y,o),eN(w,k),a.ancestors.pop(),a.schema=g,a.create(o,y,w,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eE(e,t.position)}(e,t):"root"===t.type?(c=e,u=t,d=n,eN(j={},eS(c,u)),c.create(u,c.Fragment,j,d)):"text"===t.type?t.value:void 0}function ej(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eN(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function eS(e,t){let n=[],r=-1,l=e.passKeys?new Map:eg;for(;++r<t.children.length;){let i,a=t.children[r];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let t=l.get(e)||0;i=e+"-"+t,l.set(e,t+1)}}let o=ek(e,a,i);void 0!==o&&n.push(o)}return n}function eC(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),l=-1;for(;++l<n.length;){let t=S(n[l])?{type:"Identifier",name:n[l]}:{type:"Literal",value:n[l]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(l&&"Literal"===t.type),optional:!1}:t}v(e,"always a result"),r=e}else r=S(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return ex.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);eE(e)}function eE(e,t){let n=new em("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=ew+"#cannot-handle-mdx-estrees-without-createevaluater",n}function eA(e){return"-"+e.toLowerCase()}let eT={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"]},eI={};function eR(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eO(e.children,t,n)}return Array.isArray(e)?eO(e,t,n):""}function eO(e,t,n){let r=[],l=-1;for(;++l<e.length;)r[l]=eR(e[l],t,n);return r.join("")}function eP(e,t,n,r){let l,i=e.length,a=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(l=Array.from(r)).unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)(l=r.slice(a,a+1e4)).unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function eM(e,t){return e.length>0?(eP(e,e.length,0,t),e):t}let eF={}.hasOwnProperty,eD=eJ(/[A-Za-z]/),e_=eJ(/[\dA-Za-z]/),eL=eJ(/[#-'*+\--9=?A-Z^-~]/);function e$(e){return null!==e&&(e<32||127===e)}let eU=eJ(/\d/),ez=eJ(/[\dA-Fa-f]/),eB=eJ(/[!-/:-@[-`{-~]/);function eH(e){return null!==e&&e<-2}function eq(e){return null!==e&&(e<0||32===e)}function eV(e){return -2===e||-1===e||32===e}let eW=eJ(/\p{P}|\p{S}/u),eG=eJ(/\s/);function eJ(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function eQ(e,t,n,r){let l=r?r-1:1/0,i=0;return function(r){return eV(r)?(e.enter(n),function r(a){return eV(a)&&i++<l?(e.consume(a),r):(e.exit(n),t(a))}(r)):t(r)}}let eK={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eQ(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let l=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return eH(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},eY={tokenize:function(e){let t,n,r,l=this,i=[],a=0;return o;function o(t){if(a<i.length){let n=i[a];return l.containerState=n[1],e.attempt(n[0].continuation,s,c)(t)}return c(t)}function s(e){if(a++,l.containerState._closeFlow){let n;l.containerState._closeFlow=void 0,t&&g();let r=l.events.length,i=r;for(;i--;)if("exit"===l.events[i][0]&&"chunkFlow"===l.events[i][1].type){n=l.events[i][1].end;break}x(a);let o=r;for(;o<l.events.length;)l.events[o][1].end={...n},o++;return eP(l.events,i+1,0,l.events.slice(r)),l.events.length=o,c(e)}return o(e)}function c(n){if(a===i.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);l.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return l.containerState={},e.check(eX,u,d)(n)}function u(e){return t&&g(),x(a),p(e)}function d(e){return l.parser.lazy[l.now().line]=a!==i.length,r=l.now().offset,f(e)}function p(t){return l.containerState={},e.attempt(eX,h,f)(t)}function h(e){return a++,i.push([l.currentConstruct,l.containerState]),p(e)}function f(r){if(null===r){t&&g(),x(0),e.consume(r);return}return t=t||l.parser.flow(l.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),x(0),e.consume(n);return}return eH(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,l.interrupt=void 0,o):(e.consume(n),t)}(r)}function m(e,i){let o=l.sliceStream(e);if(i&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),l.parser.lazy[e.start.line]){let e,n,i=t.events.length;for(;i--;)if(t.events[i][1].start.offset<r&&(!t.events[i][1].end||t.events[i][1].end.offset>r))return;let o=l.events.length,s=o;for(;s--;)if("exit"===l.events[s][0]&&"chunkFlow"===l.events[s][1].type){if(e){n=l.events[s][1].end;break}e=!0}for(x(a),i=o;i<l.events.length;)l.events[i][1].end={...n},i++;eP(l.events,s+1,0,l.events.slice(o)),l.events.length=i}}function x(t){let n=i.length;for(;n-- >t;){let t=i[n];l.containerState=t[1],t[0].exit.call(l,e)}i.length=t}function g(){t.write([null]),n=void 0,t=void 0,l.containerState._closeFlow=void 0}}},eX={tokenize:function(e,t,n){return eQ(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},eZ={partial:!0,tokenize:function(e,t,n){return function(t){return eV(t)?eQ(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||eH(e)?t(e):n(e)}}};class e0{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&e1(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),e1(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),e1(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);e1(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);e1(this.left,t.reverse())}}}function e1(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 e2(e){let t,n,r,l,i,a,o,s={},c=-1,u=new e0(e);for(;++c<u.length;){for(;c in s;)c=s[c];if(t=u.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&((r=0)<(a=t[1]._tokenizer.events).length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,l=e.get(t)[1],i=e.get(t)[2],a=t-1,o=[],s=l._tokenizer;!s&&(s=i.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let c=s.events,u=[],d={},p=-1,h=l,f=0,m=0,x=[0];for(;h;){for(;e.get(++a)[1]!==h;);o.push(a),!h._tokenizer&&(n=i.sliceStream(h),h.next||n.push(null),r&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=h,h=h.next}for(h=l;++p<c.length;)"exit"===c[p][0]&&"enter"===c[p-1][0]&&c[p][1].type===c[p-1][1].type&&c[p][1].start.line!==c[p][1].end.line&&(m=p+1,x.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):x.pop(),p=x.length;p--;){let t=c.slice(x[p],x[p+1]),n=o.pop();u.push([n,n+t.length-1]),e.splice(n,2,t)}for(u.reverse(),p=-1;++p<u.length;)d[f+u[p][0]]=f+u[p][1],f+=u[p][1]-u[p][0]-1;return d}(u,c)),c=s[c],o=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(l=u.get(r))[1].type||"lineEndingBlank"===l[1].type)"enter"===l[0]&&(n&&(u.get(n)[1].type="lineEndingBlank"),l[1].type="lineEnding",n=r);else if("linePrefix"===l[1].type||"listItemIndent"===l[1].type);else break;n&&(t[1].end={...u.get(n)[1].start},(i=u.slice(n,c)).unshift(t),u.splice(n,c-n+1,i))}}return eP(e,0,1/0,u.slice(0)),!o}let e5={resolve:function(e){return e2(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?l(t):eH(t)?e.check(e4,i,l)(t):(e.consume(t),r)}function l(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},e4={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eQ(e,l,"linePrefix")};function l(l){if(null===l||eH(l))return n(l);let i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}},e3={tokenize:function(e){let t=this,n=e.attempt(eZ,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,eQ(e,e.attempt(this.parser.constructs.flow,r,e.attempt(e5,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},e6={resolveAll:te()},e9=e8("string"),e7=e8("text");function e8(e){return{resolveAll:te("text"===e?tt:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],l=t.attempt(r,i,a);return i;function i(e){return s(e)?l(e):a(e)}function a(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),o)}function o(e){return s(e)?(t.exit("data"),l(e)):(t.consume(e),o)}function s(e){if(null===e)return!0;let t=r[e],l=-1;if(t)for(;++l<t.length;){let e=t[l];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function te(e){return function(t,n){let r,l=-1;for(;++l<=t.length;)void 0===r?t[l]&&"data"===t[l][1].type&&(r=l,l++):t[l]&&"data"===t[l][1].type||(l!==r+2&&(t[r][1].end=t[l-1][1].end,t.splice(r+2,l-r-2),l=r+2),r=void 0);return e?e(t,n):t}}function tt(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,l=e[n-1][1],i=t.sliceStream(l),a=i.length,o=-1,s=0;for(;a--;){let e=i[a];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)s++,o--;if(o)break;o=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:l.start._bufferIndex+o,_index:l.start._index+a,line:l.end.line,column:l.end.column-s,offset:l.end.offset-s},end:{...l.end}};l.end={...i.start},l.start.offset===l.end.offset?Object.assign(l,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}function tn(e){return null===e||eq(e)||eG(e)?1:eW(e)?2:void 0}function tr(e,t,n){let r=[],l=-1;for(;++l<e.length;){let i=e[l].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}let tl={name:"attention",resolveAll:function(e,t){let n,r,l,i,a,o,s,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[u][1].start};ti(d,-o),ti(p,o),i={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:o>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},l={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:o>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=eM(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=eM(s,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",l,t]]),s=eM(s,tr(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),s=eM(s,[["exit",l,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,s=eM(s,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,eP(e,n-1,u-n+3,s),u=n+s.length-c-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,l=this.previous,i=tn(l);return function(a){return n=a,e.enter("attentionSequence"),function a(o){if(o===n)return e.consume(o),a;let s=e.exit("attentionSequence"),c=tn(o),u=!c||2===c&&i||r.includes(o),d=!i||2===i&&c||r.includes(l);return s._open=!!(42===n?u:u&&(i||!d)),s._close=!!(42===n?d:d&&(c||!u)),t(o)}(a)}}};function ti(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let ta={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return eV(t)?eQ(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)};function l(r){return e.attempt(ta,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),l}return n(t)};function l(n){return eV(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},to={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return eB(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},ts=document.createElement("i");function tc(e){let t="&"+e+";";ts.innerHTML=t;let n=ts.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let tu={name:"characterReference",tokenize:function(e,t,n){let r,l,i=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,l=e_,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,l=ez,c):(e.enter("characterReferenceValue"),r=7,l=eU,c(t))}function c(o){if(59===o&&a){let r=e.exit("characterReferenceValue");return l!==e_||tc(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return l(o)&&a++<r?(e.consume(o),c):n(o)}}},td={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tp={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,l=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),eV(t)?eQ(e,s,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(l){return l===r?(i++,e.consume(l),t):i>=o?(e.exit("codeFencedFenceSequence"),eV(l)?eQ(e,c,"whitespace")(l):c(l)):n(l)}(t)):n(t)}function c(r){return null===r||eH(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},a=0,o=0;return function(t){var i;let c;return i=t,a=(c=l.events[l.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(l){return l===r?(o++,e.consume(l),t):o<3?n(l):(e.exit("codeFencedFenceSequence"),eV(l)?eQ(e,s,"whitespace")(l):s(l))}(i)};function s(i){return null===i||eH(i)?(e.exit("codeFencedFence"),l.interrupt?t(i):e.check(td,u,f)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||eH(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(l)):eV(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),eQ(e,c,"whitespace")(l)):96===l&&l===r?n(l):(e.consume(l),t)}(i))}function c(t){return null===t||eH(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||eH(l)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(l)):96===l&&l===r?n(l):(e.consume(l),t)}(t))}function u(t){return e.attempt(i,f,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return a>0&&eV(t)?eQ(e,h,"linePrefix",a+1)(t):h(t)}function h(t){return null===t||eH(t)?e.check(td,u,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||eH(n)?(e.exit("codeFlowValue"),h(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},th={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),eQ(e,l,"linePrefix",5)(t)};function l(t){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?function t(n){return null===n?i(n):eH(n)?e.attempt(tf,t,i)(n):(e.enter("codeFlowValue"),function n(r){return null===r||eH(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function i(n){return e.exit("codeIndented"),t(n)}}},tf={partial:!0,tokenize:function(e,t,n){let r=this;return l;function l(t){return r.parser.lazy[r.now().line]?n(t):eH(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):eQ(e,i,"linePrefix",5)(t)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):eH(e)?l(e):n(e)}}};function tm(e,t,n,r,l,i,a,o,s){let c=s||1/0,u=0;return function(t){return 60===t?(e.enter(r),e.enter(l),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||e$(t)?n(t):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(l),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(o),d(t)):null===t||60===t||eH(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(l){return!u&&(null===l||41===l||eq(l))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(l)):u<c&&40===l?(e.consume(l),u++,f):41===l?(e.consume(l),u--,f):null===l||32===l||40===l||e$(l)?n(l):(e.consume(l),92===l?m:f)}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function tx(e,t,n,r,l,i){let a,o=this,s=0;return function(t){return e.enter(r),e.enter(l),e.consume(t),e.exit(l),e.enter(i),c};function c(d){return s>999||null===d||91===d||93===d&&!a||94===d&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(d):93===d?(e.exit(i),e.enter(l),e.consume(d),e.exit(l),e.exit(r),t):eH(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||eH(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!eV(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}}function tg(e,t,n,r,l,i){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(l),e.consume(t),e.exit(l),a=40===t?41:t,o):n(t)};function o(n){return n===a?(e.enter(l),e.consume(n),e.exit(l),e.exit(r),t):(e.enter(i),s(n))}function s(t){return t===a?(e.exit(i),o(a)):null===t?n(t):eH(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eQ(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||eH(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function tb(e,t){let n;return function r(l){return eH(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):eV(l)?eQ(e,r,n?"linePrefix":"lineSuffix")(l):t(l)}}function ty(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let tv={partial:!0,tokenize:function(e,t,n){return function(t){return eq(t)?tb(e,r)(t):n(t)};function r(t){return tg(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function l(t){return eV(t)?eQ(e,i,"whitespace")(t):i(t)}function i(e){return null===e||eH(e)?t(e):n(e)}}},tw=["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"],tk=["pre","script","style","textarea"],tj={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(eZ,t,n)}}},tN={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return eH(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):n(t)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tS={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&eP(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,l,i,a=e.length,o=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(l){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(l=a);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[l][1].end}},u={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[l-2][1].start}};return i=eM(i=[["enter",s,t],["enter",c,t]],e.slice(r+1,r+o+3)),i=eM(i,[["enter",u,t]]),i=eM(i,tr(t.parser.constructs.insideSpan.null,e.slice(r+o+4,l-3),t)),i=eM(i,[["exit",u,t],e[l-2],e[l-1],["exit",c,t]]),i=eM(i,e.slice(l+1)),i=eM(i,[["exit",s,t]]),eP(e,r,e.length,i),e},tokenize:function(e,t,n){let r,l,i=this,a=i.events.length;for(;a--;)if(("labelImage"===i.events[a][1].type||"labelLink"===i.events[a][1].type)&&!i.events[a][1]._balanced){r=i.events[a][1];break}return function(t){return r?r._inactive?u(t):(l=i.parser.defined.includes(ty(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(tC,c,l?c:u)(t):91===t?e.attempt(tE,c,l?s:u)(t):l?c(t):u(t)}function s(t){return e.attempt(tA,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},tC={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return eq(t)?tb(e,l)(t):l(t)}function l(t){return 41===t?c(t):tm(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return eq(t)?tb(e,o)(t):c(t)}function a(e){return n(e)}function o(t){return 34===t||39===t||40===t?tg(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function s(t){return eq(t)?tb(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},tE={tokenize:function(e,t,n){let r=this;return function(t){return tx.call(r,e,l,i,"reference","referenceMarker","referenceString")(t)};function l(e){return r.parser.defined.includes(ty(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},tA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},tT={name:"labelStartImage",resolveAll:tS.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),l};function l(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},tI={name:"labelStartLink",resolveAll:tS.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),l};function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},tR={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),eQ(e,t,"linePrefix")}}},tO={name:"thematicBreak",tokenize:function(e,t,n){let r,l=0;return function(i){var a;return e.enter("thematicBreak"),r=a=i,function i(a){return a===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),l++,t):(e.exit("thematicBreakSequence"),eV(n)?eQ(e,i,"whitespace")(n):i(n))}(a)):l>=3&&(null===a||eH(a))?(e.exit("thematicBreak"),t(a)):n(a)}(a)}}},tP={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(eZ,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,eQ(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!eV(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(tF,t,l)(n))});function l(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,eQ(e,e.attempt(tP,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,l=r.events[r.events.length-1],i=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,a=0;return function(t){let l=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===l?!r.containerState.marker||t===r.containerState.marker:eU(t)){if(r.containerState.type||(r.containerState.type=l,e.enter(l,{_container:!0})),"listUnordered"===l)return e.enter("listItemPrefix"),42===t||45===t?e.check(tO,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(l){return eU(l)&&++a<10?(e.consume(l),t):(!r.interrupt||a<2)&&(r.containerState.marker?l===r.containerState.marker:41===l||46===l)?(e.exit("listItemValue"),o(l)):n(l)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(eZ,r.interrupt?n:s,e.attempt(tM,u,c))}function s(e){return r.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return eV(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},tM={partial:!0,tokenize:function(e,t,n){let r=this;return eQ(e,function(e){let l=r.events[r.events.length-1];return!eV(e)&&l&&"listItemPrefixWhitespace"===l[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},tF={partial:!0,tokenize:function(e,t,n){let r=this;return eQ(e,function(e){let l=r.events[r.events.length-1];return l&&"listItemIndent"===l[1].type&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},tD={name:"setextUnderline",resolveTo:function(e,t){let n,r,l,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),l||"definition"!==e[i][1].type||(l=i);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",a,t]),e.splice(l+1,0,["exit",e[n][1],t]),e[n][1].end={...e[l][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){let r,l=this;return function(t){var a;let o,s=l.events.length;for(;s--;)if("lineEnding"!==l.events[s][1].type&&"linePrefix"!==l.events[s][1].type&&"content"!==l.events[s][1].type){o="paragraph"===l.events[s][1].type;break}return!l.parser.lazy[l.now().line]&&(l.interrupt||o)?(e.enter("setextHeadingLine"),r=t,a=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),eV(n)?eQ(e,i,"lineSuffix")(n):i(n))}(a)):n(t)};function i(r){return null===r||eH(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,l=this;return function(t){var r;return e.enter("definition"),r=t,tx.call(l,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function i(t){return(r=ty(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return eq(t)?tb(e,o)(t):o(t)}function o(t){return tm(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(tv,c,c)(t)}function c(t){return eV(t)?eQ(e,u,"whitespace")(t):u(t)}function u(i){return null===i||eH(i)?(e.exit("definition"),l.parser.defined.push(r),t(i)):n(i)}}}},"disable",0,{null:[]},"document",0,{42:tP,43:tP,45:tP,48:tP,49:tP,50:tP,51:tP,52:tP,53:tP,54:tP,55:tP,56:tP,57:tP,62:ta},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,l=e.length-2,i=3;return"whitespace"===e[3][1].type&&(i+=2),l-2>i&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(i===l-1||l-4>i&&"whitespace"===e[l-2][1].type)&&(l-=i+1===l?2:4),l>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[l][1].end},r={type:"chunkText",start:e[i][1].start,end:e[l][1].end,contentType:"text"},eP(e,i,l-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(l){var i;return e.enter("atxHeading"),i=l,e.enter("atxHeadingSequence"),function l(i){return 35===i&&r++<6?(e.consume(i),l):null===i||eq(i)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||eH(r)?(e.exit("atxHeading"),t(r)):eV(r)?eQ(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||eq(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(i)):n(i)}(i)}}},42:tO,45:[tD,tO],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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},tokenize:function(e,t,n){let r,l,i,a,o,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),l=!0,h):63===a?(e.consume(a),r=3,s.interrupt?t:O):eD(a)?(e.consume(a),i=String.fromCharCode(a),f):n(a)}function u(l){return 45===l?(e.consume(l),r=2,d):91===l?(e.consume(l),r=5,a=0,p):eD(l)?(e.consume(l),r=4,s.interrupt?t:O):n(l)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:O):n(r)}function p(r){let l="CDATA[";return r===l.charCodeAt(a++)?(e.consume(r),a===l.length)?s.interrupt?t:N:p:n(r)}function h(t){return eD(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||eq(a)){let o=47===a,c=i.toLowerCase();return!o&&!l&&tk.includes(c)?(r=1,s.interrupt?t(a):N(a)):tw.includes(i.toLowerCase())?(r=6,o)?(e.consume(a),m):s.interrupt?t(a):N(a):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):l?function t(n){return eV(n)?(e.consume(n),t):k(n)}(a):x(a))}return 45===a||e_(a)?(e.consume(a),i+=String.fromCharCode(a),f):n(a)}function m(r){return 62===r?(e.consume(r),s.interrupt?t:N):n(r)}function x(t){return 47===t?(e.consume(t),k):58===t||95===t||eD(t)?(e.consume(t),g):eV(t)?(e.consume(t),x):k(t)}function g(t){return 45===t||46===t||58===t||95===t||e_(t)?(e.consume(t),g):b(t)}function b(t){return 61===t?(e.consume(t),y):eV(t)?(e.consume(t),b):x(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,v):eV(t)?(e.consume(t),y):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||eq(n)?b(n):(e.consume(n),t)}(t)}function v(t){return t===o?(e.consume(t),o=null,w):null===t||eH(t)?n(t):(e.consume(t),v)}function w(e){return 47===e||62===e||eV(e)?x(e):n(e)}function k(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||eH(t)?N(t):eV(t)?(e.consume(t),j):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),A):60===t&&1===r?(e.consume(t),T):62===t&&4===r?(e.consume(t),P):63===t&&3===r?(e.consume(t),O):93===t&&5===r?(e.consume(t),R):eH(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(tj,M,S)(t)):null===t||eH(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),N)}function S(t){return e.check(tN,C,M)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return null===t||eH(t)?S(t):(e.enter("htmlFlowData"),N(t))}function A(t){return 45===t?(e.consume(t),O):N(t)}function T(t){return 47===t?(e.consume(t),i="",I):N(t)}function I(t){if(62===t){let n=i.toLowerCase();return tk.includes(n)?(e.consume(t),P):N(t)}return eD(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),I):N(t)}function R(t){return 93===t?(e.consume(t),O):N(t)}function O(t){return 62===t?(e.consume(t),P):45===t&&2===r?(e.consume(t),O):N(t)}function P(t){return null===t||eH(t)?(e.exit("htmlFlowData"),M(t)):(e.consume(t),P)}function M(n){return e.exit("htmlFlow"),t(n)}}},61:tD,95:tO,96:tp,126:tp},"flowInitial",0,{[-2]:th,[-1]:th,32:th},"insideSpan",0,{null:[tl,e6]},"string",0,{38:tu,92:to},"text",0,{[-5]:tR,[-4]:tR,[-3]:tR,33:tT,38:tu,42:tl,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(t){return eD(t)?(e.consume(t),i):64===t?n(t):o(t)}function i(t){return 43===t||45===t||46===t||e_(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||e_(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||e$(r)?n(r):(e.consume(r),a)}function o(t){return 64===t?(e.consume(t),s):eL(t)?(e.consume(t),o):n(t)}function s(l){return e_(l)?function l(i){return 46===i?(e.consume(i),r=0,s):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||e_(i))&&r++<63){let n=45===i?t:l;return e.consume(i),n}return n(i)}(i)}(l):n(l)}}},{name:"htmlText",tokenize:function(e,t,n){let r,l,i,a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),v):63===t?(e.consume(t),b):eD(t)?(e.consume(t),k):n(t)}function s(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),l=0,h):eD(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):eH(t)?(i=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?T(e):45===e?d(e):u(e)}function h(t){let r="CDATA[";return t===r.charCodeAt(l++)?(e.consume(t),l===r.length?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):eH(t)?(i=f,I(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),x):f(t)}function x(t){return 62===t?T(t):93===t?(e.consume(t),x):f(t)}function g(t){return null===t||62===t?T(t):eH(t)?(i=g,I(t)):(e.consume(t),g)}function b(t){return null===t?n(t):63===t?(e.consume(t),y):eH(t)?(i=b,I(t)):(e.consume(t),b)}function y(e){return 62===e?T(e):b(e)}function v(t){return eD(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||e_(t)?(e.consume(t),w):function t(n){return eH(n)?(i=t,I(n)):eV(n)?(e.consume(n),t):T(n)}(t)}function k(t){return 45===t||e_(t)?(e.consume(t),k):47===t||62===t||eq(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),T):58===t||95===t||eD(t)?(e.consume(t),N):eH(t)?(i=j,I(t)):eV(t)?(e.consume(t),j):T(t)}function N(t){return 45===t||46===t||58===t||95===t||e_(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),S):eH(n)?(i=t,I(n)):eV(n)?(e.consume(n),t):j(n)}(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,C):eH(t)?(i=S,I(t)):eV(t)?(e.consume(t),S):(e.consume(t),E)}function C(t){return t===r?(e.consume(t),r=void 0,A):null===t?n(t):eH(t)?(i=C,I(t)):(e.consume(t),C)}function E(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||eq(t)?j(t):(e.consume(t),E)}function A(e){return 47===e||62===e||eq(e)?j(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),R}function R(t){return eV(t)?eQ(e,O,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}}],91:tI,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return eH(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},to],93:tS,95:tl,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=l;++t<r;)if("codeTextData"===e[t][1].type){e[l][1].type="codeTextPadding",e[r][1].type="codeTextPadding",l+=2,r-=2;break}}for(t=l-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,l,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),i++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),a):96===s?(l=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(l.type="codeTextData",o(a))}(s)):eH(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):(e.enter("codeTextData"),o(s))}function o(t){return null===t||32===t||96===t||eH(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),o)}}}}],4127);var t_=e.i(4127);let tL=/[\0\t\n\r]/g;function t$(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let tU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tz(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return t$(n.slice(t?2:1),t?16:10)}return tc(n)||e}let tB={}.hasOwnProperty;function tH(e){return{line:e.line,column:e.column,offset:e.offset}}function tq(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+ed({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ed({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+ed({start:t.start,end:t.end})+") is still open")}function tV(e){let t=this;t.parser=function(n){var r,l;let i,a,o,s;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(l=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(g),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(h),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:r(h,l),codeText:r(function(){return{type:"inlineCode",value:""}},l),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(x,l),htmlFlowData:c,htmlText:r(x,l),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:l,link:r(g),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(b,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(b),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=t$(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=tc(n);let l=this.stack[this.stack.length-1];l.value+=t},characterReference:function(e){this.stack.pop().position.end=tH(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ty(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(tU,tz),n.identifier=ty(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=tH(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),u.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ty(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(t,n){let r=-1;for(;++r<n.length;){let l=n[r];Array.isArray(l)?e(t,l):function(e,t){let n;for(n in t)if(tB.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,l)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},a={stack:[r],tokenStack:[],config:t,enter:i,exit:o,buffer:l,resume:s,data:n},c=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?c.push(u):u=function(e,t,n){let r,l,i,a,o=t-1,s=-1,c=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||s||i||(i=o),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=o;for(l=void 0;a--;){let t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;l&&(e[l][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",l=a}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}i&&(!l||i<l)&&(r._spread=!0),r.end=Object.assign({},l?e[l][1].start:t[1].end),e.splice(l||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let l={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=l,e.splice(o,0,["enter",l,t[2]]),o++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),u));for(u=-1;++u<e.length;){let n=t[e[u][0]];tB.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},a),e[u][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||tq).call(a,void 0,e[0])}for(r.position={start:tH(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:tH(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r};function r(e,t){return function(n){i.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function i(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:tH(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||tq).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+ed({start:e.start,end:e.end})+"): it’s not open");n.position.end=tH(e.end)}function s(){var e;return e=this.stack.pop(),eR(e,"boolean"!=typeof eI.includeImageAlt||eI.includeImageAlt,"boolean"!=typeof eI.includeHtml||eI.includeHtml)}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:tH(e.start),end:void 0},t.push(n)),this.stack.push(n)}function u(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=tH(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function h(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function x(){return{type:"html",value:""}}function g(){return{type:"link",title:null,url:"",children:[]}}function b(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(l)(function(e){for(;!e2(e););return e}((function(e){let t={constructs:function(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,l=(eF.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];if(i)for(r in i){eF.call(l,r)||(l[r]=[]);let e=i[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);eP(e,0,0,r)}(l[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}([t_,...(e||{}).extensions||[]]),content:n(eK),defined:[],document:n(eY),flow:n(e3),lazy:{},string:n(e9),text:n(e7)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},l={},i=[],a=[],o=[],s={attempt:f(function(e,t){m(e,t.from)}),check:f(h),consume:function(e){eH(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,x()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:f(h,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){l[e.line]=e.column,x()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,l=[];for(;++r<e.length;){let i,a=e[r];if("string"==typeof a)i=a;else switch(a){case -5:i="\r";break;case -4:i="\n";break;case -3:i="\r\n";break;case -2:i=t?" ":" ";break;case -1:if(!t&&n)continue;i=" ";break;default:i=String.fromCharCode(a)}n=-2===a,l.push(i)}return l.join("")}(d(e),t)},sliceStream:d,write:function(e){return(a=eM(a,e),function(){let e;for(;r._index<a.length;){let n=a[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),u=u(t)}else u=u(n)}}(),null!==a[a.length-1])?[]:(m(t,0),c.events=tr(i,c.events,c),c.events)}},u=t.tokenize.call(c,s);return t.resolveAll&&i.push(t),c;function d(e){return function(e,t){let n,r=t.start._index,l=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;if(r===i)n=[e[r].slice(l,a)];else{if(n=e.slice(r,i),l>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(l):n.shift()}a>0&&n.push(e[i].slice(0,a))}return n}(a,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:l,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:l,offset:i}}function h(e,t){t.restore()}function f(e,t){return function(n,l,i){var a;let u,d,h,f;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(a=n,function(e){let t=null!==e&&a[e],n=null!==e&&a.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?i:g(e[d])}function g(e){return function(n){let l,i,a,u,d;return(l=p(),i=c.previous,a=c.currentConstruct,u=c.events.length,d=Array.from(o),f={from:u,restore:function(){r=l,c.previous=i,c.currentConstruct=a,c.events.length=u,o=d,x()}},h=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?y(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,s,b,y)(n)}}function b(t){return e(h,f),l}function y(e){return(f.restore(),++d<u.length)?g(u[d]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&eP(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function x(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}(t,e,n)}}})(l).document().write((a=1,o="",s=!0,function(e,t,n){let r,l,c,u,d,p=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,o="",s&&(65279===e.charCodeAt(0)&&c++,s=void 0);c<e.length;){if(tL.lastIndex=c,u=(r=tL.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(u),!r){o=e.slice(c);break}if(10===d&&c===u&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),c<u&&(p.push(e.slice(c,u)),a+=u-c),d){case 0:p.push(65533),a++;break;case 9:for(l=4*Math.ceil(a/4),p.push(-2);a++<l;)p.push(-1);break;case 10:p.push(-4),a=1;break;default:i=!0,a=1}c=u+1}return n&&(i&&p.push(-5),o&&p.push(o),p.push(null)),p})(n,r,!0))))}}let tW="object"==typeof self?self:globalThis,tG=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=l=>{if(t.has(l))return t.get(l);let[i,a]=e[l];switch(i){case 0:case -1:return n(a,l);case 1:{let e=n([],l);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},l);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),l);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),l)}case 5:{let e=n(new Map,l);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,l);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new tW[e](t),l)}case 8:return n(BigInt(a),l);case"BigInt":return n(Object(BigInt(a)),l);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new tW[i](a),l)})(0)},{toString:tJ}={},{keys:tQ}=Object,tK=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=tJ.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},tY=([e,t])=>0===e&&("function"===t||"symbol"===t),tX=(e,{json:t,lossy:n}={})=>{var r,l,i;let a,o,s=[];return(r=!(t||n),l=!!t,i=new Map,a=(e,t)=>{let n=s.push(e)-1;return i.set(t,n),n},o=e=>{if(i.has(e))return i.get(e);let[t,n]=tK(e);switch(t){case 0:{let l=e;switch(n){case"bigint":t=8,l=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);l=null;break;case"undefined":return a([-1],e)}return a([t,l],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),a([n,[...t]],e)}let r=[],l=a([t,r],e);for(let t of e)r.push(o(t));return l}case 2:{if(n)switch(n){case"BigInt":return a([n,e.toString()],e);case"Boolean":case"Number":case"String":return a([n,e.valueOf()],e)}if(l&&"toJSON"in e)return o(e.toJSON());let i=[],s=a([t,i],e);for(let t of tQ(e))(r||!tY(tK(e[t])))&&i.push([o(t),o(e[t])]);return s}case 3:return a([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return a([t,{source:n,flags:r}],e)}case 5:{let n=[],l=a([t,n],e);for(let[t,l]of e)(r||!(tY(tK(t))||tY(tK(l))))&&n.push([o(t),o(l)]);return l}case 6:{let n=[],l=a([t,n],e);for(let t of e)(r||!tY(tK(t)))&&n.push(o(t));return l}}let{message:s}=e;return a([t,{name:n,message:s}],e)})(e),s},tZ="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?tG(tX(e,t)):structuredClone(e):(e,t)=>tG(tX(e,t));function t0(e){let t=[],n=-1,r=0,l=0;for(;++n<e.length;){let i=e.charCodeAt(n),a="";if(37===i&&e_(e.charCodeAt(n+1))&&e_(e.charCodeAt(n+2)))l=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),l=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+l+1,a=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function t1(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function t2(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let t5=function(e){var t,n;if(null==e)return t3;if("function"==typeof e)return t4(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=t5(e[n]);return t4(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,t4(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,t4(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function t4(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function t3(){return!0}let t6=[];function t9(e,t,n,r){var l,i,a;let o,s,c,u,d,p;"function"==typeof t&&"function"!=typeof n?(s=void 0,c=t,o=n):(s=t,c=n,o=r),l=s,i=function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return c(e,r,n)},a=o,"function"==typeof l&&"function"!=typeof i?(a=i,i=l):u=l,d=t5(u),p=a?-1:1,(function e(t,n,r){let o=t&&"object"==typeof t?t:{};if("string"==typeof o.type){let e="string"==typeof o.tagName?o.tagName:"string"==typeof o.name?o.name:void 0;Object.defineProperty(s,"name",{value:"node ("+t.type+(e?"<"+e+">":"")+")"})}return s;function s(){var o;let s,c,u,h=t6;if((!l||d(t,n,r[r.length-1]||void 0))&&!1===(h=Array.isArray(o=i(t,r))?o:"number"==typeof o?[!0,o]:null==o?t6:[o])[0])return h;if("children"in t&&t.children&&t.children&&"skip"!==h[0])for(c=(a?t.children.length:-1)+p,u=r.concat(t);c>-1&&c<t.children.length;){if(!1===(s=e(t.children[c],c,u)())[0])return s;c="number"==typeof s[1]?s[1]:c+p}return h}})(e,void 0,[])()}function t7(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let l=e.all(t),i=l[0];i&&"text"===i.type?i.value="["+i.value:l.unshift({type:"text",value:"["});let a=l[l.length-1];return a&&"text"===a.type?a.value+=r:l.push({type:"text",value:r}),l}function t8(e){let t=e.spread;return null==t?e.children.length>1:t}function ne(e,t,n){let r=0,l=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(l-1);for(;9===t||32===t;)l--,t=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let nt={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(r.className=["language-"+l[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i={type:"element",tagName:"pre",properties:{},children:[i=e.applyData(t,i)]},e.patch(t,i),i},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),i=t0(l.toLowerCase()),a=e.footnoteOrder.indexOf(l),o=e.footnoteCounts.get(l);void 0===o?(o=0,e.footnoteOrder.push(l),n=e.footnoteOrder.length):n=a+1,o+=1,e.footnoteCounts.set(l,o);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return t7(e,t);let l={src:t0(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let n={src:t0(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return t7(e,t);let l={href:t0(r.url||"")};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let n={href:t0(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),l=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=t8(n[r])}return t}(n):t8(t),i={},a=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(l||0!==o||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||l?a.push(e):a.push(...e.children)}let s=r[r.length-1];s&&(l||"element"!==s.type||"p"!==s.tagName)&&a.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),l=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++l<r.length;){let e=r[l];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),l=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),l.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=ec(t.children[1]),a=es(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),l.push(r)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,l=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length,o=-1,s=[];for(;++o<a;){let n=t.children[o],r={},a=i?i[o]:void 0;a&&(r.align=a);let c={type:"element",tagName:l,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),s.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),l=0,i=[];for(;r;)i.push(ne(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return i.push(ne(t.slice(l),l>0,!1)),i.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:nn,yaml:nn,definition:nn,footnoteDefinition:nn};function nn(){}let nr={}.hasOwnProperty,nl={};function ni(e,t){e.position&&(t.position=function(e){let t=ec(e),n=es(e);if(t&&n)return{start:t,end:n}}(e))}function na(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,l=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&l&&Object.assign(n.properties,tZ(l)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function no(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function ns(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function nc(e,t){let n,r,l,i,a=(n=t||nl,r=new Map,l=new Map,i={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let l=i.one(n[r],e);if(l){if(r&&"break"===n[r-1].type&&(Array.isArray(l)||"text"!==l.type||(l.value=ns(l.value)),!Array.isArray(l)&&"element"===l.type)){let e=l.children[0];e&&"text"===e.type&&(e.value=ns(e.value))}Array.isArray(l)?t.push(...l):t.push(l)}}}return t},applyData:na,definitionById:r,footnoteById:l,footnoteCounts:new Map,footnoteOrder:[],handlers:{...nt,...n.handlers},one:function(e,t){let n=e.type,r=i.handlers[n];if(nr.call(i.handlers,n)&&r)return r(i,e,t);if(i.options.passThrough&&i.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=tZ(n);return r.children=i.all(e),r}return tZ(e)}return(i.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(nr.call(n,"hProperties")||nr.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(i,e,t)},options:n,patch:ni,wrap:no},t9(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:l,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),i),o=a.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||t1,r=e.options.footnoteBackLabel||t2,l=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],s=-1;for(;++s<e.footnoteOrder.length;){let l=e.footnoteById.get(e.footnoteOrder[s]);if(!l)continue;let i=e.all(l),a=String(l.identifier).toUpperCase(),c=t0(a.toLowerCase()),u=0,d=[],p=e.footnoteCounts.get(a);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(l,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...tZ(a),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(a),c=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return s&&(v("children"in c),c.children.push({type:"text",value:"\n"},s)),c}function nu(e,t){return e&&"run"in e?async function(n,r){let l=nc(n,{file:r,...t});await e.run(l,r)}:function(n,r){return nc(n,{file:r,...e||t})}}function nd(e){if(e)throw e}var np=e.i(4100);function nh(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let nf=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');nb(e);let r=0,l=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else l<0&&(n=!0,l=i+1);return l<0?"":e.slice(r,l)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(l=i):(o=-1,l=a));return r===l?l=a:l<0&&(l=e.length),e.slice(r,l)},nm=function(e){let t;if(nb(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},nx=function(e){let t;nb(e);let n=e.length,r=-1,l=0,i=-1,a=0;for(;n--;){let o=e.codePointAt(n);if(47===o){if(t){l=n+1;break}continue}r<0&&(t=!0,r=n+1),46===o?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1)}return i<0||r<0||0===a||1===a&&i===r-1&&i===l+1?"":e.slice(i,r)},ng=function(...e){var t;let n,r,l,i=-1;for(;++i<e.length;)nb(e[i]),e[i]&&(l=void 0===l?e[i]:l+"/"+e[i]);return void 0===l?".":(nb(t=l),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,l="",i=0,a=-1,o=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(a===s-1||1===o);else if(a!==s-1&&2===o){if(l.length<2||2!==i||46!==l.codePointAt(l.length-1)||46!==l.codePointAt(l.length-2)){if(l.length>2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",i=0):i=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),a=s,o=0;continue}}else if(l.length>0){l="",i=0,a=s,o=0;continue}}t&&(l=l.length>0?l+"/..":"..",i=2)}else l.length>0?l+="/"+e.slice(a+1,s):l=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===n&&o>-1?o++:o=-1}return l}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function nb(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function ny(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let nv=["history","path","basename","stem","extname","dirname"];class nw{constructor(e){let t,n;t=e?ny(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nv.length;){const e=nv[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)nv.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?nf(this.path):void 0}set basename(e){nj(e,"basename"),nk(e,"basename"),this.path=ng(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?nm(this.path):void 0}set dirname(e){nN(this.basename,"dirname"),this.path=ng(e||"",this.basename)}get extname(){return"string"==typeof this.path?nx(this.path):void 0}set extname(e){if(nk(e,"extname"),nN(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=ng(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ny(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!ny(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),nj(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?nf(this.path,this.extname):void 0}set stem(e){nj(e,"stem"),nk(e,"stem"),this.path=ng(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new em(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function nk(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function nj(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function nN(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let nS=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},nC={}.hasOwnProperty;class nE extends nS{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function l(i,...a){let o=e[++n],s=-1;if(i)return void r(i);for(;++s<t.length;)(null===a[s]||void 0===a[s])&&(a[s]=t[s]);t=a,o?(function(e,t){let n;return function(...t){let i,a=e.length>t.length;a&&t.push(r);try{i=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(i&&i.then&&"function"==typeof i.then?i.then(l,r):i instanceof Error?r(i):l(i))};function r(e,...l){n||(n=!0,t(e,...l))}function l(e){r(null,e)}})(o,l)(...a):r(null,...a)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new nE,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,np.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(nR("data",this.frozen),this.namespace[e]=t,this):nC.call(this.namespace,e)&&this.namespace[e]||void 0:e?(nR("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=nM(e),n=this.parser||this.Parser;return nT("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),nT("process",this.parser||this.Parser),nI("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,l){let i=nM(e),a=n.parse(i);function o(e,n){e||!n?l(e):r?r(n):(v(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(a,i,function(e,t,r){var l,i;if(e||!t||!r)return o(e);let a=n.stringify(t,r);"string"==typeof(l=a)||(i=l)&&"object"==typeof i&&"byteLength"in i&&"byteOffset"in i?r.value=a:r.result=a,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),nT("processSync",this.parser||this.Parser),nI("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,nd(e),t=r}),nP("processSync","process",n),v(t,"we either bailed on an error or have a tree"),t}run(e,t,n){nO(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?l(void 0,n):new Promise(l);function l(l,i){v("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let a=nM(t);r.run(e,a,function(t,r,a){let o=r||e;t?i(t):l?l(o):(v(n,"`done` is defined if `resolve` is not"),n(void 0,o,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){nd(e),n=t,r=!0}),nP("runSync","run",r),v(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=nM(t),r=this.compiler||this.Compiler;return nI("stringify",r),nO(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(nR("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else if("object"==typeof e)Array.isArray(e)?i(e):l(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function l(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(e.plugins),e.settings&&(r.settings=(0,np.default)(!0,r.settings,e.settings))}function i(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;a(t,n)}else l(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,t){let r=-1,l=-1;for(;++r<n.length;)if(n[r][0]===e){l=r;break}if(-1===l)n.push([e,...t]);else if(t.length>0){let[r,...i]=t,a=n[l][1];nh(a)&&nh(r)&&(r=(0,np.default)(!0,a,r)),n[l]=[e,r,...i]}}}}let nA=new nE().freeze();function nT(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function nI(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function nR(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nO(e){if(!nh(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function nP(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function nM(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new nw(e)}let nF=[],nD={allowDangerousHtml:!0},n_=/^(https?|ircs?|mailto|xmpp)$/i,nL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function n$(e){var n;let r,l,i,a,o,s=(r=(n=e).rehypePlugins||nF,l=n.remarkPlugins||nF,i=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...nD}:nD,nA().use(tV).use(l).use(nu,i).use(r)),c=(a=e.children||"",o=new nw,"string"==typeof a?o.value=a:w("Unexpected value `"+a+"` for `children` prop, expected `string`"),o);return function(e,n){let r=n.allowedElements,l=n.allowElement,i=n.components,a=n.disallowedElements,o=n.skipHtml,s=n.unwrapDisallowed,c=n.urlTransform||nU;for(let e of nL)Object.hasOwn(n,e.from)&&w("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&a&&w("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),t9(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return o?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in eT)if(Object.hasOwn(eT,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=eT[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!a&&a.includes(e.tagName);if(!i&&l&&"number"==typeof t&&(i=!l(e,t,n)),i&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,l,i;let a;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=o,r=t.jsxDEV,a=function(e,t,l,i){let a=Array.isArray(l.children),o=ec(e);return r(t,l,i,a,{columnNumber:o?o.column-1:void 0,fileName:n,lineNumber:o?o.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");l=t.jsx,i=t.jsxs,a=function(e,t,n,r){let a=Array.isArray(n.children)?i:l;return r?a(t,n,r):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?ea:ei,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=ek(s,e,void 0);return c&&"string"!=typeof c?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}(e,{Fragment:t.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(c),c),e)}function nU(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),l=e.indexOf("/");return -1===t||-1!==l&&t>l||-1!==n&&t>n||-1!==r&&t>r||n_.test(e.slice(0,t))?e:""}function nz({projectId:e,startInEditMode:r=!1}){let[l,i]=(0,n.useState)(""),[a,o]=(0,n.useState)(null),[s,c]=(0,n.useState)(r),[u,d]=(0,n.useState)(""),[p,h]=(0,n.useState)(!1),[f,m]=(0,n.useState)(null),x=(0,n.useRef)(!1);x.current=s;let g=(0,n.useRef)(r),b=(0,n.useCallback)(async()=>{try{let t=await fetch(`/api/queue?project=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`${t.status}`);let n=await t.json();o(!!n.exists),x.current||i(n.content||""),g.current&&(d(n.content||""),g.current=!1),m(null)}catch(e){m(e.message)}},[e]);(0,n.useEffect)(()=>{b();let e=setInterval(b,1e4);return()=>clearInterval(e)},[b]);let y=async()=>{h(!0),m(null);try{let t=await fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:u})});if(!t.ok)throw Error(`${t.status}`);i(u),c(!1)}catch(e){m(e.message)}finally{h(!1)}},v=async()=>{h(!0);try{let t=await fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"POST"});if(!t.ok)throw Error(`${t.status}`);await b()}catch(e){m(e.message)}finally{h(!1)}};return(0,t.jsxs)("div",{className:"flex flex-col h-full min-h-0 border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"OVERNIGHT-QUEUE.md"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[f&&(0,t.jsxs)("span",{className:"text-[10px] text-error",children:["err: ",f]}),!s&&a&&(0,t.jsx)("button",{onClick:()=>{d(l),c(!0)},className:"text-[10px] text-text-muted hover:text-accent uppercase tracking-wider",children:"Edit"}),s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:y,disabled:p,className:"text-[10px] text-accent hover:text-accent-dim uppercase tracking-wider disabled:opacity-50",children:p?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:()=>{c(!1),d(""),b()},disabled:p,className:"text-[10px] text-text-muted hover:text-text uppercase tracking-wider disabled:opacity-50",children:"Cancel"})]})]})]}),s&&(0,t.jsx)("div",{className:"shrink-0 px-3 py-1.5 border-b border-border bg-bg-surface text-[10px] text-text-muted leading-snug",children:"⚠️ Editing manually may conflict with the Head agent. Use the chat panel to ask Head to update the queue when possible."}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:!1===a?(0,t.jsxs)("div",{className:"p-3 text-[11px] text-text-muted",children:[(0,t.jsx)("p",{className:"mb-2",children:"No OVERNIGHT-QUEUE.md for this project yet."}),(0,t.jsx)("button",{onClick:v,disabled:p,className:"px-2 py-1 border border-border hover:border-accent hover:text-accent text-[11px] disabled:opacity-50",children:"Create OVERNIGHT-QUEUE.md from template"})]}):s?(0,t.jsx)("textarea",{value:u,onChange:e=>d(e.target.value),spellCheck:!1,className:"w-full h-full p-3 bg-bg text-text text-[11px] font-mono resize-none outline-none"}):(0,t.jsx)("div",{className:"p-3 text-[12px] text-text prose prose-invert prose-sm max-w-none [&_h1]:text-[14px] [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mb-2 [&_h2]:text-[13px] [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1.5 [&_h3]:text-[12px] [&_h3]:font-semibold [&_h3]:mt-2 [&_h3]:mb-1 [&_p]:my-1.5 [&_ul]:my-1.5 [&_ul]:pl-4 [&_ul]:list-disc [&_ol]:my-1.5 [&_ol]:pl-4 [&_ol]:list-decimal [&_li]:my-0.5 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-2 [&_blockquote]:text-text-muted [&_hr]:my-3 [&_hr]:border-border [&_code]:bg-bg-surface [&_code]:px-1 [&_code]:rounded [&_code]:text-[11px] [&_strong]:text-text [&_a]:text-accent [&_a]:underline",children:(0,t.jsx)(n$,{children:l})})})]})}function nB({open:e,projectId:r,onClose:l}){return((0,n.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&l()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,l]),e)?(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:l,role:"dialog","aria-modal":"true","aria-labelledby":"queue-modal-title",children:(0,t.jsxs)("div",{className:"relative mx-4 w-full max-w-3xl h-[80vh] flex flex-col rounded-lg border border-white/10 bg-neutral-950 shadow-2xl overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-white/10",children:[(0,t.jsx)("h2",{id:"queue-modal-title",className:"text-[12px] font-semibold text-white",children:"OVERNIGHT-QUEUE.md"}),(0,t.jsx)("button",{type:"button",onClick:l,"aria-label":"Close",className:"rounded p-1 text-neutral-400 hover:bg-white/5 hover:text-white",children:(0,t.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,t.jsx)("path",{d:"M4 4l12 12M16 4L4 16",strokeLinecap:"round"})})})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:(0,t.jsx)(nz,{projectId:r,startInEditMode:!0})})]})}):null}let nH={en:{loading:"Loading batch progress…",currentBatchNone:"Current Batch: (none)",noActiveBatch:"No active batch. Ask Head to start one via the chat.",currentBatch:e=>`Current Batch: Batch ${e}`,complete:"✅ COMPLETE",allMerged:e=>`All ${e} items merged. Waiting for the next batch.`,itemsCount:e=>`(${e} items)`,tooltip:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Current Batch"}),"— progress tracker for the active batch. Polls GitHub to resolve each issue's status (queued → in review → approved → merged)."]})},ko:{loading:"배치 진행 상황 로딩 중...",currentBatchNone:"현재 배치: (없음)",noActiveBatch:"활성 배치가 없습니다. 채팅에서 Head에게 시작을 요청하세요.",currentBatch:e=>`현재 배치: ${e}번`,complete:"✅ 완료",allMerged:e=>`${e}개 항목 모두 병합됨. 다음 배치를 기다리는 중.`,itemsCount:e=>`(${e}개 항목)`,tooltip:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"현재 배치"})," - 활성 배치 진행 상황 추적기입니다. GitHub를 조회해 각 이슈 상태를 대기 → 검토 중 → 승인 → 병합 순으로 추적합니다."]})}};function nq({percent:e}){let n=Math.round(e/100*20);return(0,t.jsxs)("span",{className:"font-mono text-[11px] tabular-nums whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-accent",children:"█".repeat(n)}),(0,t.jsx)("span",{className:"text-text-muted",children:"░".repeat(20-n)})]})}function nV({projectId:e}){let{locale:r}=(0,a.useLocale)(),i=nH[r],[o,s]=(0,n.useState)(null),c=(0,n.useCallback)(()=>{fetch(`/api/batch-progress?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{e&&s(e)}).catch(()=>{})},[e]);return((0,n.useEffect)(()=>{c();let e=setInterval(c,3e4);return()=>clearInterval(e)},[c]),o)?o.items&&0!==o.items.length?o.complete?(0,t.jsxs)("div",{className:"border-t border-border",children:[(0,t.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.currentBatch(o.batch_number??"—")}),(0,t.jsx)("span",{className:"text-[10px] text-accent",children:i.complete})]}),(0,t.jsx)("div",{className:"px-3 pb-2 text-[11px] text-text-muted",children:i.allMerged(o.items.length)})]}):(0,t.jsxs)("div",{className:"border-t border-border",children:[(0,t.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-2 border-b border-border/40",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.currentBatch(o.batch_number??"—")}),(0,t.jsx)("span",{className:"text-[10px] text-text-muted",children:i.itemsCount(o.items.length)}),(0,t.jsx)(l.default,{children:i.tooltip})]}),(0,t.jsx)("div",{className:"max-h-40 overflow-y-auto",children:o.items.map(e=>{let n=(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1 font-mono",children:[(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0 tabular-nums",children:["#",e.issue_number]}),(0,t.jsx)(nq,{percent:e.progress}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted tabular-nums shrink-0 w-9 text-right",children:[e.progress,"%"]}),(0,t.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.label})]});return e.url?(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block hover:bg-[#1a1a1a] transition-colors border-b border-border/30",children:n},e.issue_number):(0,t.jsx)("div",{children:n},e.issue_number)})}),o.summary&&(0,t.jsx)("div",{className:"px-3 py-1.5 text-[11px] text-text-muted border-t border-border/40",children:o.summary})]}):(0,t.jsxs)("div",{className:"border-t border-border",children:[(0,t.jsx)("div",{className:"px-3 py-1.5 flex items-center gap-2",children:(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.currentBatchNone})}),(0,t.jsx)("div",{className:"px-3 pb-2 text-[11px] text-text-muted",children:i.noActiveBatch})]}):(0,t.jsx)("div",{className:"px-3 py-1.5 text-[11px] text-text-muted border-t border-border",children:i.loading})}let nW={en:{rateLimitCritical:e=>`GitHub Rate Limit CRITICAL: 0 remaining. Resets in ${e}m.`,rateLimitLow:(e,t,n)=>`GitHub Rate Limit LOW: ${e}/${t} remaining. Resets in ${n}m.`,issues:e=>`Issues (${e})`,issuesHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Issues"})," — open issues in this repository. Agents will pick these up automatically if they are part of the overnight queue."]}),noIssues:"No open issues.",recentlyClosed:"Recently closed",noneYet:"None yet.",prs:e=>`Pull Requests (${e})`,prsHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Pull Requests"})," — active PRs in this repository. Shows review status from RE1/RE2 and CI status."]}),noPrs:"No active PRs.",recentlyMerged:"Recently merged / closed",overnightQueueHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"OVERNIGHT-QUEUE.md"})," — a list of issue numbers (one per line) for agents to process autonomously. Edit this file to add or remove tasks from the queue."]}),edit:"Edit"},ko:{rateLimitCritical:e=>`GitHub API 제한 위험: 잔여 0개. ${e}분 후 초기화됩니다.`,rateLimitLow:(e,t,n)=>`GitHub API 제한 낮음: ${e}/${t} 남음. ${n}분 후 초기화됩니다.`,issues:e=>`이슈 (${e})`,issuesHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"이슈"})," - 이 저장소의 열려 있는 이슈들입니다. 야간 큐에 포함되면 에이전트가 자동으로 작업을 시작합니다."]}),noIssues:"열린 이슈가 없습니다.",recentlyClosed:"최근 닫힌 이슈",noneYet:"아직 없습니다.",prs:e=>`풀 리퀘스트 (${e})`,prsHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"풀 리퀘스트"})," - 이 저장소의 활성화된 PR들입니다. RE1/RE2의 리뷰 상태와 CI 상태를 보여줍니다."]}),noPrs:"활성 PR이 없습니다.",recentlyMerged:"최근 머지/닫힘",overnightQueueHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"OVERNIGHT-QUEUE.md"})," - 에이전트가 자율적으로 처리할 이슈 번호 목록(한 줄에 하나씩)입니다. 이 파일을 편집하여 큐에 작업을 추가하거나 제거할 수 있습니다."]}),edit:"편집"}};function nG({color:e}){return(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${e}`})}function nJ({projectId:e}){let{locale:r}=(0,a.useLocale)(),i=nW[r],[o,s]=(0,n.useState)([]),[c,u]=(0,n.useState)([]),[d,p]=(0,n.useState)([]),[h,f]=(0,n.useState)([]),[m,x]=(0,n.useState)(!1),[g,b]=(0,n.useState)(null);(0,n.useEffect)(()=>{let t=!1;return fetch(`/api/queue?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(n=>{if(!t&&n&&!n.exists)return fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"POST"})}).catch(()=>{}),()=>{t=!0}},[e]);let y=(0,n.useCallback)(()=>{fetch(`/api/github/issues?project=${encodeURIComponent(e)}`).then(e=>{if(!e.ok)throw Error(`${e.status}`);return e.json()}).then(e=>{Array.isArray(e)&&s(e)}).catch(()=>{}),fetch(`/api/github/prs?project=${encodeURIComponent(e)}`).then(e=>{if(!e.ok)throw Error(`${e.status}`);return e.json()}).then(e=>{Array.isArray(e)&&u(e)}).catch(()=>{}),fetch(`/api/github/closed-issues?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{Array.isArray(e)&&p(e)}).catch(()=>{}),fetch(`/api/github/merged-prs?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{Array.isArray(e)&&f(e)}).catch(()=>{})},[e]);return(0,n.useEffect)(()=>{let e=()=>{fetch("/api/github/rate-limit").then(e=>e.ok?e.json():null).then(e=>{e&&b(e)}).catch(()=>{})};e();let t=setInterval(e,6e4);return()=>clearInterval(t)},[]),(0,n.useEffect)(()=>{y();let e=setInterval(y,6e4);return()=>clearInterval(e)},[y]),(0,t.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[g&&(g.critical||g.low)&&(0,t.jsx)("div",{className:`px-3 py-1 text-[10px] shrink-0 ${g.critical?"bg-error/20 text-error":"bg-[#ffcc00]/20 text-[#ffcc00]"}`,children:g.critical?i.rateLimitCritical(g.resetInMinutes):i.rateLimitLow(g.remaining,g.limit,g.resetInMinutes)}),(0,t.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col lg:flex-row",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col border-b lg:border-b-0 lg:border-r border-border",children:[(0,t.jsxs)("div",{className:"px-3 py-1.5 border-b border-border shrink-0 flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.issues(o.length)}),(0,t.jsx)(l.default,{children:i.issuesHelp})]}),(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[0===o.length&&(0,t.jsx)("div",{className:"px-3 py-2 text-[11px] text-text-muted",children:i.noIssues}),o.map(e=>(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1 font-mono hover:bg-[#1a1a1a] transition-colors cursor-pointer border-b border-border/50",children:[(0,t.jsx)(nG,{color:"OPEN"===e.state?"bg-accent":"bg-error"}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,t.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.title}),e.assignees?.[0]&&(0,t.jsx)("span",{className:"text-[10px] text-text-muted shrink-0",children:e.assignees[0].login})]},e.number)),(0,t.jsx)("div",{className:"px-3 pt-2 pb-1 text-[9px] text-text-muted uppercase tracking-wider",children:i.recentlyClosed}),0===d.length&&(0,t.jsx)("div",{className:"px-3 py-1 text-[11px] text-text-muted",children:i.noneYet}),d.map(e=>(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1 font-mono opacity-60 hover:opacity-100 hover:bg-[#1a1a1a] transition-all cursor-pointer border-b border-border/30",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:"✓"}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted truncate flex-1 min-w-0",children:e.title})]},`closed-${e.number}`))]})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,t.jsxs)("div",{className:"px-3 py-1.5 border-b border-border shrink-0 flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.prs(c.length)}),(0,t.jsx)(l.default,{children:i.prsHelp})]}),(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[0===c.length&&(0,t.jsx)("div",{className:"px-3 py-2 text-[11px] text-text-muted",children:i.noPrs}),c.map(e=>{let n=e.reviews||[],r=e.reviewDecision||"REVIEW_REQUIRED",l={};for(let e of n){let t=(e.body||"").trim();/^(?:RE2|Reviewer2|T2b)\b/i.test(t)?l.re2=e.state:(/^(?:RE1|Reviewer1|T2a)\b/i.test(t)||/^##\s*Verdict/i.test(t))&&(l.re1=e.state)}return(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1 font-mono hover:bg-[#1a1a1a] transition-colors cursor-pointer border-b border-border/50",children:[(0,t.jsx)(nG,{color:"APPROVED"===r?"bg-accent":"CHANGES_REQUESTED"===r?"bg-error":"bg-[#ffcc00]"}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,t.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.title}),e.assignees?.[0]&&(0,t.jsx)("span",{className:"text-[10px] text-text-muted shrink-0",children:e.assignees[0].login}),["re1","re2"].map(e=>{let n=l[e];return(0,t.jsxs)("span",{className:`text-[10px] shrink-0 ${n?"APPROVED"===n?"text-accent":"CHANGES_REQUESTED"===n?"text-error":"text-[#ffcc00]":"text-text-muted"}`,children:[e,":",n?"APPROVED"===n?"ok":"CHANGES_REQUESTED"===n?"chg":"rev":"—"]},e)}),(0,t.jsx)("span",{className:`text-[10px] shrink-0 ${function(e){if(!e||0===e.length)return"text-text-muted";let t=e.map(e=>e.state);return t.every(e=>"SUCCESS"===e)?"text-accent":t.some(e=>"FAILURE"===e||"ERROR"===e)?"text-error":"text-[#ffcc00]"}(e.statusCheckRollup)}`,children:function(e){if(!e||0===e.length)return"—";let t=e.map(e=>e.state);return t.every(e=>"SUCCESS"===e)?"pass":t.some(e=>"FAILURE"===e||"ERROR"===e)?"fail":"run"}(e.statusCheckRollup)})]},e.number)}),(0,t.jsx)("div",{className:"px-3 pt-2 pb-1 text-[9px] text-text-muted uppercase tracking-wider",children:i.recentlyMerged}),0===h.length&&(0,t.jsx)("div",{className:"px-3 py-1 text-[11px] text-text-muted",children:i.noneYet}),h.map(e=>(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1 font-mono opacity-60 hover:opacity-100 hover:bg-[#1a1a1a] transition-all cursor-pointer border-b border-border/30",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:"✓"}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted truncate flex-1 min-w-0",children:e.title})]},`merged-${e.number}`))]})]})]}),(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(nV,{projectId:e})}),(0,t.jsxs)("div",{className:"shrink-0 flex items-center justify-between px-3 py-1.5 border-t border-border",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted font-mono",children:"OVERNIGHT-QUEUE.md"}),(0,t.jsx)(l.default,{position:"above",children:i.overnightQueueHelp})]}),(0,t.jsx)("button",{onClick:()=>x(!0),className:"px-2 py-0.5 text-[10px] text-text-muted hover:text-accent border border-border hover:border-accent transition-colors uppercase tracking-wider",children:i.edit})]}),(0,t.jsx)(nB,{open:m,projectId:e,onClose:()=>x(!1)})]})}var nQ=e.i(67449);let nK={en:{server:{title:"Server",stop:"Stop",confirmStop:"Confirm Stop?",restart:"Restart",resetAgents:"Reset Agents",healthGaveUp:"AC auto-restart failed 3x — manual restart required",healthRestarted:e=>`AC auto-restarted at ${e}`,stopped:"Stopped",failed:"Failed",error:"Error",acRestarted:e=>`AC restarted (PID: ${e}) — resetting agents...`,acAndAgentsRestarted:e=>`AC + ${e} agent${1!==e?"s":""} restarted`,agentResetFailed:"AC restarted — agent reset failed",resetResult:(e,t)=>`Reset — ${e} of ${t} agent${1!==t?"s":""} restarted`,fullReset:"Full Reset",confirmFullReset:"Reset all projects?",fullResetResult:(e,t,n)=>`Full reset — ${e} project${1!==e?"s":""}, ${t} agent${1!==t?"s":""} (${(n/1e3).toFixed(1)}s)`,fullResetFailed:"Full reset failed"},system:{keepAwake:"Keep Mac Awake",keepAwakeAbout:"About Keep Mac Awake",keepAwakeHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Keep Mac Awake"})," runs macOS ",(0,t.jsx)("code",{children:"caffeinate"})," to stop the screen, disk, and system idle timers from sleeping your Mac during an overnight run. Make sure the laptop is plugged in — caffeinate blocks sleep but not battery drain."]}),autoAwakeOn:"Auto-awake ON: caffeinate starts/stops with batch lifecycle",autoAwakeOff:"Auto-awake OFF: manual Start/Stop only",awakeFor:e=>`Awake for ${e} more — keep Mac plugged in`,awakeIndefinitely:"Awake indefinitely — keep Mac plugged in",awakeDesc:"Prevents your Mac from sleeping during overnight runs.",awake:"Awake",start:"Start",on:"on",sound:"Notification Sound",soundAbout:"About Notification Sound",soundHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Notification Sound"})," plays a brief chime when an agent posts a new message (not your own sends, not system events). Sound choice picks one of the bundled chimes. Background-only mode suppresses the chime while the tab is focused — ding only when you're looking elsewhere. All prefs persist in localStorage."]}),soundDesc:"Plays a chime when an agent posts a new message.",soundLabel:"Sound",soundBgOnly:"Only when tab is in background",awakeStatusActive:"Batch active — auto-started caffeinate.",awakeStatusComplete:"Batch complete — awake paused.",awakeStatusNew:"New batch detected — auto-started caffeinate.",keepAwakeModalTitle:"Keep Awake",keepAwakeModalAbout:"About Keep Awake",keepAwakeModalHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Keep Awake"})," prevents your Mac from sleeping for the duration you set. Use this when you want agents to keep working overnight.",(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"Under the hood, this runs macOS's ",(0,t.jsx)("code",{children:"caffeinate"})," command. While it's active your screen, disk, and system idle timers are all paused — make sure your Mac is ",(0,t.jsx)("b",{children:"plugged in"})," to avoid draining the battery."]}),makeSurePluggedIn:"Make sure Mac is plugged in",for:"for",hours:"hours",untilStopped:"Until stopped (no expiry)"}},ko:{server:{title:"서버",stop:"중지",confirmStop:"정말 중지?",restart:"재시작",resetAgents:"에이전트 초기화",healthGaveUp:"AC 자동 재시작 3회 실패 — 수동 재시작이 필요합니다",healthRestarted:e=>`AC가 ${e}에 자동 재시작되었습니다`,stopped:"중지됨",failed:"실패",error:"오류",acRestarted:e=>`AC 재시작됨 (PID: ${e}) — 에이전트 초기화 중...`,acAndAgentsRestarted:e=>`AC 및 ${e}개 에이전트 재시작됨`,agentResetFailed:"AC 재시작됨 — 에이전트 초기화 실패",resetResult:(e,t)=>`초기화 완료 — ${t}개 중 ${e}개 에이전트 재시작됨`,fullReset:"전체 리셋",confirmFullReset:"모든 프로젝트를 리셋할까요?",fullResetResult:(e,t,n)=>`전체 리셋 완료 — ${e}개 프로젝트, ${t}개 에이전트 (${(n/1e3).toFixed(1)}초)`,fullResetFailed:"전체 리셋 실패"},system:{keepAwake:"Mac 절전 방지",keepAwakeAbout:"Mac 절전 방지 정보",keepAwakeHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Mac 절전 방지"}),"는 macOS의 ",(0,t.jsx)("code",{children:"caffeinate"}),"를 실행해 야간 작업 중 Mac이 절전 상태로 들어가는 것을 막습니다. 충전기를 연결해 두세요. caffeinate는 절전은 막지만 배터리 소모를 막아주지는 않습니다."]}),autoAwakeOn:"자동 절전 방지 켬: 배치 상태에 따라 caffeinate 시작/종료",autoAwakeOff:"자동 절전 방지 끔: 수동 시작/종료만 가능",awakeFor:e=>`앞으로 ${e} 동안 절전 방지 — 전원을 연결해 두세요`,awakeIndefinitely:"무기한 절전 방지 중 — 전원을 연결해 두세요",awakeDesc:"야간 작업 중 Mac이 잠들지 않도록 합니다.",awake:"절전 방지 중",start:"시작",on:"켬",sound:"알림음",soundAbout:"알림음 정보",soundHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"알림음"}),"은 에이전트가 새 메시지를 보낼 때 짧은 알림음을 재생합니다. 내 메시지나 시스템 이벤트에는 울리지 않습니다. 사운드 선택으로 내장 알림음 중 하나를 고를 수 있고, 백그라운드 전용 모드는 탭이 포커스된 동안에는 알림음을 막습니다. 모든 설정은 localStorage에 저장됩니다."]}),soundDesc:"에이전트가 새 메시지를 보낼 때 알림음을 재생합니다.",soundLabel:"알림음",soundBgOnly:"탭이 백그라운드에 있을 때만",awakeStatusActive:"배치 실행 중 — caffeinate를 자동으로 시작했습니다.",awakeStatusComplete:"배치 완료 — 절전 방지를 일시 중단했습니다.",awakeStatusNew:"새 배치 감지 — caffeinate를 자동으로 시작했습니다.",keepAwakeModalTitle:"절전 방지",keepAwakeModalAbout:"절전 방지 정보",keepAwakeModalHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"절전 방지"}),"는 설정한 시간 동안 Mac이 절전 상태로 들어가는 것을 막습니다. 에이전트가 밤새 작업하게 하려면 이 기능을 사용하세요.",(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"내부적으로는 macOS의 ",(0,t.jsx)("code",{children:"caffeinate"})," 명령을 실행합니다. 실행 중에는 화면, 디스크, 시스템 유휴 타이머가 모두 정지됩니다. 배터리 소모를 막으려면 Mac에 ",(0,t.jsx)("b",{children:"전원을 연결"}),"해 두세요."]}),makeSurePluggedIn:"전원을 연결해 두세요",for:"시간:",hours:"시간",untilStopped:"중지할 때까지 (만료 없음)"}}};function nY({projectId:e}){let{locale:r}=(0,a.useLocale)(),l=nK[r].server,[i,o]=(0,n.useState)(null),[s,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(!1),[p,h]=(0,n.useState)(!1),[f,m]=(0,n.useState)(null);(0,n.useEffect)(()=>{let t=()=>{fetch(`/api/agentchattr/${encodeURIComponent(e)}/health`).then(e=>e.ok?e.json():null).then(e=>{if(!e)return void m(null);if(e.autoRestart?.gaveUp)m(l.healthGaveUp);else if(e.autoRestart?.lastRestart)if(300>Math.round((Date.now()-e.autoRestart.lastRestart)/1e3)){let t=new Date(e.autoRestart.lastRestart).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});m(l.healthRestarted(t))}else m(null);else m(null)}).catch(()=>m(null))};t();let n=setInterval(t,3e4);return()=>clearInterval(n)},[e,l]);let x=()=>{setTimeout(()=>c(null),3e3)};(0,n.useEffect)(()=>{if(!u)return;let e=setTimeout(()=>d(!1),4e3);return()=>clearTimeout(e)},[u]),(0,n.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>h(!1),4e3);return()=>clearTimeout(e)},[p]);let g=async()=>{if(!p)return void h(!0);h(!1),o("fullReset");try{let e=await fetch("/api/full-reset",{method:"POST"}),t=await e.json();c(t.ok?l.fullResetResult(t.projects,t.agents,t.duration_ms):t.error||l.fullResetFailed)}catch{c(l.fullResetFailed)}o(null),x()},b=async()=>{if(!u)return void d(!0);d(!1),o("stop");try{let t=await fetch(`/api/agentchattr/${encodeURIComponent(e)}/stop`,{method:"POST"}),n=await t.json();c(n.ok?l.stopped:l.failed)}catch{c(l.error)}o(null),x()},y=async()=>{o("restart");try{let t=await fetch(`/api/agentchattr/${encodeURIComponent(e)}/restart`,{method:"POST"}),n=await t.json();if(n.ok&&n.pid){c(l.acRestarted(n.pid));try{let t=await fetch(`/api/agents/${encodeURIComponent(e)}/reset`,{method:"POST"}),n=await t.json();n.ok?c(l.acAndAgentsRestarted(n.restarted)):c(l.agentResetFailed)}catch{c(l.agentResetFailed)}}else c(n.error||l.failed)}catch{c(l.error)}o(null),x()},v=async()=>{o("reset");try{let t=await fetch(`/api/agents/${encodeURIComponent(e)}/reset`,{method:"POST"}),n=await t.json();c(n.ok?l.resetResult(n.restarted,n.total):n.error||l.failed)}catch{c(l.error)}o(null),x()};return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:l.title}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,t.jsx)("button",{onClick:b,disabled:!!i,className:`px-1.5 py-0.5 text-[10px] border transition-colors disabled:opacity-50 ${u?"text-error border-error/60 bg-error/10 hover:bg-error/20":"text-text-muted border-border hover:text-error hover:border-error/40"}`,children:"stop"===i?"...":u?l.confirmStop:l.stop}),(0,t.jsx)("button",{onClick:y,disabled:!!i,className:"px-1.5 py-0.5 text-[10px] text-text-muted border border-border hover:text-accent hover:border-accent/40 transition-colors disabled:opacity-50",children:"restart"===i?"...":l.restart}),(0,t.jsx)("button",{onClick:v,disabled:!!i,className:"px-1.5 py-0.5 text-[10px] text-text-muted border border-border hover:text-accent hover:border-accent/40 transition-colors disabled:opacity-50",children:"reset"===i?"...":l.resetAgents}),(0,t.jsx)("button",{onClick:g,disabled:!!i,className:`px-1.5 py-0.5 text-[10px] border transition-colors disabled:opacity-50 ${p?"text-error border-error/60 bg-error/10 hover:bg-error/20":"text-text-muted border-border hover:text-accent hover:border-accent/40"}`,children:"fullReset"===i?"...":p?l.confirmFullReset:l.fullReset})]}),s&&(0,t.jsx)("div",{className:"text-[10px] text-accent",children:s}),f&&!s&&(0,t.jsx)("div",{className:`text-[10px] ${f.includes("failed")||f.includes("실패")?"text-error":"text-[#ffcc00]"}`,children:f})]})}function nX(e){return Number.isFinite(e)?Math.min(Math.max(e,.1),24):3}function nZ(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return t>0?`${t}h ${n}m`:`${n}m`}function n0({projectId:e}){let{locale:r}=(0,a.useLocale)(),l=nK[r].system,[i,o]=(0,n.useState)(!1),[s,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(""),[p,h]=(0,n.useState)(!1),[f,m]=(0,n.useState)(String(3)),[x,g]=(0,n.useState)(!1),[b,y]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),[k,j]=(0,n.useState)(null),N=(0,n.useRef)(!1),S=(0,n.useRef)(null),C=(0,n.useRef)(!1),E=(0,n.useRef)(!1);E.current=i,N.current=v;let[A,T]=(0,n.useState)(!1),[I,R]=(0,n.useState)(!1),[O,P]=(0,n.useState)(!0),[M,F]=(0,n.useState)("soft-chime"),[D,_]=(0,n.useState)(!0);(0,n.useEffect)(()=>{P((0,nQ.getNotificationEnabled)()),F((0,nQ.getNotificationChoice)()),_((0,nQ.getNotificationBackgroundOnly)())},[]);let L=(0,n.useCallback)(()=>{fetch("/api/caffeinate/status").then(e=>e.ok?e.json():null).then(e=>{e&&(o(e.active),c(e.remaining),d(e.platform))}).catch(()=>{})},[]);(0,n.useEffect)(()=>{L();let e=setInterval(L,5e3);return()=>clearInterval(e)},[L]);let $=e=>{fetch("/api/caffeinate/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({duration:e})}).then(e=>e.json()).then(t=>{t.ok&&(o(!0),c(e||null))}).catch(()=>{}),h(!1)};(0,n.useEffect)(()=>{w(!1),j(null),S.current=null,C.current=!1,fetch("/api/config").then(e=>e.ok?e.json():null).then(t=>{if(!t)return;let n=(t.projects||[]).find(t=>t.id===e);n?.awake_auto&&w(!0)}).catch(()=>{})},[e]);let U=(0,n.useCallback)(async()=>{let t=!v;w(t),t||(j(null),S.current=null,C.current=!1);try{let n=await fetch("/api/config");if(!n.ok)return;let r=await n.json(),l=(r.projects||[]).find(t=>t.id===e);l&&(l.awake_auto=t,await fetch("/api/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}))}catch{}},[v,e]),z=(0,n.useCallback)(()=>{let e=parseFloat(f),t=Math.round(3600*(Number.isFinite(e)?nX(e):8));fetch("/api/caffeinate/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({duration:t})}).then(e=>e.json()).then(e=>{e.ok&&(o(!0),c(t),C.current=!1)}).catch(()=>{})},[f]),B=(0,n.useCallback)(()=>{fetch("/api/caffeinate/stop",{method:"POST"}).then(()=>{o(!1),c(null)}).catch(()=>{})},[]);(0,n.useEffect)(()=>{if(!v)return;let t=async()=>{if(N.current)try{let t=await fetch(`/api/batch-progress?project=${encodeURIComponent(e)}`);if(!t.ok)return;let n=await t.json(),r=n.items.length>0,i=S.current;if(S.current={complete:n.complete,hasItems:r},!i){!r||n.complete||E.current||(z(),j(l.awakeStatusActive)),r&&n.complete&&E.current&&(B(),j(l.awakeStatusComplete));return}r&&n.complete&&!i.complete&&E.current&&(B(),j(l.awakeStatusComplete),C.current=!1),!r||n.complete||!i.complete&&i.hasItems||E.current||C.current||(z(),j(l.awakeStatusNew))}catch{}};t();let n=setInterval(t,3e4);return()=>clearInterval(n)},[v,e,z,B,l]);let H=!u||"darwin"===u;return(0,t.jsxs)("div",{className:"flex flex-col md:flex-row md:items-start gap-2 md:gap-6 relative",children:[H&&(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 relative",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:[(0,t.jsx)("span",{children:l.keepAwake}),(0,t.jsx)("button",{type:"button","aria-label":l.keepAwakeAbout,onClick:()=>T(e=>!e),className:"w-3.5 h-3.5 rounded-full border border-border text-[9px] leading-none text-text-muted hover:text-accent hover:border-accent inline-flex items-center justify-center",children:"?"}),(0,t.jsxs)("button",{type:"button",onClick:U,title:v?l.autoAwakeOn:l.autoAwakeOff,className:`ml-1 px-1.5 py-0.5 text-[10px] border transition-colors ${v?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:["Auto ",v?"●":"○"]})]}),A&&(0,t.jsx)("div",{className:"absolute left-0 top-4 z-30 w-64 p-2 text-[10px] leading-snug text-text bg-bg-surface border border-border rounded shadow-lg",children:l.keepAwakeHelp}),k&&(0,t.jsx)("div",{className:"text-[10px] text-accent bg-accent/5 border border-border/50 px-1.5 py-0.5 mt-0.5",children:k}),(0,t.jsx)("div",{className:"text-[10px] text-text-muted leading-tight",children:i&&null!==s&&s>0?l.awakeFor(nZ(s)):i&&null===s?l.awakeIndefinitely:l.awakeDesc}),(0,t.jsx)("div",{className:"flex items-center gap-1.5 flex-wrap mt-0.5",children:(0,t.jsxs)("button",{onClick:()=>i?void(C.current=!0,fetch("/api/caffeinate/stop",{method:"POST"}).then(()=>{o(!1),c(null)}).catch(()=>{})):h(!p),title:"Keep Mac awake (caffeinate)",className:`px-1.5 py-0.5 text-[10px] border transition-colors ${i?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:[i?l.awake:l.start,i&&null!==s&&s>0&&(0,t.jsx)("span",{className:"ml-1 text-accent/70",children:nZ(s)}),i&&null===s&&(0,t.jsx)("span",{className:"ml-1 text-accent/70",children:l.on})]})})]}),H&&(0,t.jsx)("div",{className:"border-t border-border/40 md:border-t-0 md:w-px md:h-auto md:self-stretch md:bg-border"}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 relative",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:[(0,t.jsx)("span",{children:l.sound}),(0,t.jsx)("button",{type:"button","aria-label":l.soundAbout,onClick:()=>R(e=>!e),className:"w-3.5 h-3.5 rounded-full border border-border text-[9px] leading-none text-text-muted hover:text-accent hover:border-accent inline-flex items-center justify-center",children:"?"})]}),I&&(0,t.jsx)("div",{className:"absolute left-0 top-4 z-30 w-64 p-2 text-[10px] leading-snug text-text bg-bg-surface border border-border rounded shadow-lg",children:l.soundHelp}),(0,t.jsx)("div",{className:"text-[10px] text-text-muted leading-tight",children:l.soundDesc}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap mt-0.5",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{let e=!O;P(e),(0,nQ.setNotificationEnabled)(e)},title:O?"Notification sound on (click to mute)":"Notification sound off (click to unmute)",className:`px-1.5 py-0.5 text-[10px] border transition-colors ${O?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:[O?"🔔":"🔕"," ",l.soundLabel]}),O&&(0,t.jsx)("select",{value:M,onChange:e=>(e=>{if(F(e),(0,nQ.setNotificationChoice)(e),O)try{let t=new Audio(`/sounds/${e}.mp3`);t.volume=.6,t.play().catch(()=>{})}catch{}})(e.target.value),title:"Notification sound",className:"bg-transparent border border-border px-1 py-0.5 text-[10px] text-text outline-none focus:border-accent cursor-pointer",children:nQ.NOTIFICATION_SOUND_OPTIONS.map(e=>(0,t.jsx)("option",{value:e.value,className:"bg-bg-surface",children:e.label},e.value))})]}),O&&(0,t.jsxs)("label",{className:"flex items-center gap-1 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:D,onChange:e=>{var t;_(t=e.target.checked),(0,nQ.setNotificationBackgroundOnly)(t)}}),l.soundBgOnly]})]}),p&&!i&&(0,t.jsxs)("div",{className:"absolute bottom-full left-0 mb-1 p-2 border border-border bg-bg-surface z-20 min-w-[220px] flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:l.keepAwakeModalTitle}),(0,t.jsx)("button",{type:"button","aria-label":l.keepAwakeModalAbout,onClick:()=>y(e=>!e),className:"w-3.5 h-3.5 rounded-full border border-border text-[9px] leading-none text-text-muted hover:text-accent hover:border-accent inline-flex items-center justify-center",children:"?"})]}),b&&(0,t.jsx)("div",{className:"p-1.5 text-[10px] leading-snug text-text bg-bg border border-border/60 rounded",children:l.keepAwakeModalHelp}),(0,t.jsx)("p",{className:"text-[10px] text-[#ffcc00]",children:l.makeSurePluggedIn}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",children:[(0,t.jsx)("span",{className:"text-text-muted",children:l.for}),(0,t.jsx)("input",{type:"number",value:f,onChange:e=>m(e.target.value),onBlur:()=>{let e=parseFloat(f);m(String(Math.round(10*(Number.isFinite(e)?nX(e):3))/10))},disabled:x,min:.1,max:24,step:.1,className:"w-14 bg-transparent border border-border px-1 py-0.5 text-text outline-none focus:border-accent text-center disabled:opacity-40"}),(0,t.jsx)("span",{className:"text-text-muted",children:l.hours})]}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:x,onChange:e=>g(e.target.checked)}),l.untilStopped]}),(0,t.jsx)("button",{type:"button",onClick:()=>{if(x)return void $(0);let e=parseFloat(f);$(Math.round(3600*(Number.isFinite(e)?nX(e):3)))},className:"self-start px-2 py-0.5 text-[10px] text-accent border border-accent/40 rounded hover:bg-accent/10 transition-colors",children:l.start})]})]})}function n1({projectId:e}){return(0,t.jsx)("div",{className:"border-t border-border px-3 py-2",children:(0,t.jsxs)("div",{className:"flex flex-col md:flex-row md:items-start gap-2 md:gap-6",children:[(0,t.jsx)(nY,{projectId:e}),(0,t.jsx)("div",{className:"border-t border-border/40 md:border-t-0 md:w-px md:h-auto md:self-stretch md:bg-border"}),(0,t.jsx)(n0,{projectId:e})]})})}var n2=e.i(99894),n5=e.i(93309);function n4({projectId:e,agentId:r,wsUrl:l,onActivity:i}){let a=(0,n.useRef)(null),o=(0,n.useRef)(null),s=(0,n.useRef)(null),c=(0,n.useRef)(null),u=(0,n.useRef)(i);(0,n.useEffect)(()=>{u.current=i},[i]);let d=(0,n.useCallback)(()=>{if(s.current&&o.current&&a.current)try{s.current.fit();let e=c.current;e&&e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:"resize",cols:o.current.cols,rows:o.current.rows}))}catch{}},[]);return(0,n.useEffect)(()=>{if(!a.current)return;let t=new n2.Terminal({scrollback:1e3,fontSize:11,fontFamily:'"Geist Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", monospace',lineHeight:1.2,letterSpacing:.5,cursorBlink:!1,cursorStyle:"block",theme:{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#00ff88",cursorAccent:"#0a0a0a",selectionBackground:"#00ff8844",black:"#0a0a0a",red:"#ff4444",green:"#00ff88",yellow:"#ffcc00",blue:"#4488ff",magenta:"#cc44ff",cyan:"#44ccff",white:"#e0e0e0",brightBlack:"#737373",brightRed:"#ff6666",brightGreen:"#00ff88",brightYellow:"#ffdd44",brightBlue:"#66aaff",brightMagenta:"#dd66ff",brightCyan:"#66ddff",brightWhite:"#ffffff"},allowTransparency:!1,drawBoldTextInBrightColors:!0}),n=new n5.FitAddon;t.loadAddon(n),t.open(a.current),o.current=t,s.current=n,requestAnimationFrame(()=>d());let i=new ResizeObserver(()=>requestAnimationFrame(()=>d()));i.observe(a.current),t.onData(e=>{let t=c.current;t&&t.readyState===WebSocket.OPEN&&t.send(e)});let p=!1,h=null,f=async()=>{if(h)return h;if(l)return h=l;let e="https:"===window.location.protocol?"wss:":"ws:";try{let t=await fetch("/api/config");if(t.ok){let n=(await t.json()).port||8400,r=parseInt(window.location.port,10);h=r&&r!==n?`${e}//${window.location.hostname}:${n}`:`${e}//${window.location.host}`}else h=`${e}//${window.location.host}`}catch{h=`${e}//${window.location.host}`}return h},m=async()=>{try{let t=await fetch("/api/sessions");if(!t.ok)return!1;let n=await t.json();return Array.isArray(n)&&n.some(t=>t&&t.projectId===e&&t.agentId===r)}catch{return!1}},x=0,g=!1,b=async()=>{let n=await f();if(p)return;let l=new WebSocket(`${n}/ws/terminal?project=${encodeURIComponent(e)}&agent=${encodeURIComponent(r)}`);c.current=l,l.onopen=()=>{x=0,l.send(JSON.stringify({type:"resize",cols:t.cols,rows:t.rows})),l.send(JSON.stringify({type:"replay"}))},l.onmessage=e=>{t.write(e.data),g||(g=!0,requestAnimationFrame(()=>{d(),g=!1}));let n=u.current;n&&n()},l.onclose=async e=>{if(!p){if(x<5){let e=Date.now(),n=!1;for(;Date.now()-e<2e3;){if(await new Promise(e=>setTimeout(e,200)),p)return;if(await m()){n=!0;break}}if(p)return;if(n){x+=1,t.reset(),t.write(`\x1b[38;2;115;115;115m[reattached to new session]\x1b[0m\r
5
+ ALL: Communicate via this chat by tagging agents. Your terminal is NOT visible.`},{id:"default-2",title:"Suffix Reminder",message:"All agents: ignore numeric suffixes in your identity. dev, dev-1, dev-2 are the same Dev agent. re1, re1-2 are the same RE1. re2, re2-2 are the same RE2. head, head-2 are the same Head. When tagging others, use the base name (@dev, @re1, @re2, @head). When checking for mentions to you, match your base role name regardless of suffix."},{id:"default-3",title:"Check Queue Format",message:"@head Check your OVERNIGHT-QUEUE.md formatting. Each Active Batch item must start with `- #<number>` (dash, space, hash, issue number). Do NOT use `- Issue #598` format — only `- #598 description`. The Current Batch panel won't recognize items in any other format. Fix if needed and confirm."},{id:"default-4",title:"Agent Online Check",message:"@head Are you online? If so, ping @dev, @re1, and @re2 to confirm whether they are online and available."}];function d({projectId:e,onSend:r}){let[l,i]=(0,n.useState)(!1),[a,o]=(0,n.useState)([]),[s,p]=(0,n.useState)(null),[h,f]=(0,n.useState)(""),[m,x]=(0,n.useState)("");(0,n.useEffect)(()=>{o(function(){try{let e=localStorage.getItem(c);if(!e)return localStorage.setItem(c,JSON.stringify(u)),u;return JSON.parse(e)}catch{return u}}())},[]);let g=(0,n.useCallback)(e=>{o(e),localStorage.setItem(c,JSON.stringify(e))},[]);return l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>i(!1),className:"shrink-0 px-1.5 py-2 text-[10px] text-accent transition-colors",title:"Close presets",children:"Preset"}),(0,t.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>{i(!1),p(null)}}),(0,t.jsxs)("div",{className:"absolute bottom-full left-0 right-0 mb-1 z-50 border border-border bg-bg-surface max-h-[60vh] overflow-y-auto",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50",children:[(0,t.jsx)("span",{className:"text-[11px] text-text font-semibold",children:"Message Presets"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{p({id:"",title:"",message:""}),f(""),x("")},className:"text-[10px] text-accent hover:underline",children:"+ New"}),(0,t.jsx)("button",{type:"button",onClick:()=>{i(!1),p(null)},className:"text-[11px] text-text-muted hover:text-text",children:"✕"})]})]}),s?(0,t.jsxs)("div",{className:"p-3 flex flex-col gap-2",children:[(0,t.jsx)("input",{type:"text",value:h,onChange:e=>f(e.target.value),placeholder:"Preset title",className:"w-full bg-transparent border border-border px-2 py-1 text-[11px] text-text outline-none focus:border-accent"}),(0,t.jsx)("textarea",{value:m,onChange:e=>x(e.target.value),placeholder:"Message body",rows:5,className:"w-full bg-transparent border border-border px-2 py-1 text-[11px] text-text outline-none focus:border-accent resize-y font-mono"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{h.trim()&&m.trim()&&(s&&s.id?g(a.map(e=>e.id===s.id?{...e,title:h,message:m}:e)):g([...a,{id:`preset-${Date.now()}`,title:h,message:m}]),p(null))},disabled:!h.trim()||!m.trim(),className:"px-2 py-0.5 text-[10px] text-accent border border-accent/40 hover:bg-accent/10 transition-colors disabled:opacity-30",children:"Save"}),(0,t.jsx)("button",{type:"button",onClick:()=>p(null),className:"px-2 py-0.5 text-[10px] text-text-muted border border-border hover:text-text transition-colors",children:"Cancel"})]})]}):(0,t.jsxs)("div",{className:"divide-y divide-border/30",children:[0===a.length&&(0,t.jsx)("div",{className:"px-3 py-4 text-[11px] text-text-muted text-center",children:'No presets. Click "+ New" to create one.'}),a.map(n=>(0,t.jsx)("div",{className:"px-3 py-2 hover:bg-accent/5 group",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{r(n.message.replace(/\{\{project\}\}/g,e)),i(!1)},className:"text-left flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-[11px] text-text font-medium truncate",children:n.title}),(0,t.jsxs)("div",{className:"text-[10px] text-text-muted truncate mt-0.5",children:[n.message.slice(0,80),n.message.length>80?"…":""]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{p(n),f(n.title),x(n.message)},className:"text-[10px] text-text-muted hover:text-accent",title:"Edit",children:"✎"}),(0,t.jsx)("button",{type:"button",onClick:()=>{var e;return e=n.id,void g(a.filter(t=>t.id!==e))},className:"text-[10px] text-text-muted hover:text-error",title:"Delete",children:"✕"})]})]})},n.id))]})]})]}):(0,t.jsx)("button",{type:"button",onClick:()=>i(!0),className:"shrink-0 px-1.5 py-2 text-[10px] text-text-muted hover:text-accent transition-colors",title:"Message presets",children:"Preset"})}let p={head:"#00ff88",re1:"#4488ff",re2:"#cc44ff",dev:"#ffcc00",user:"#e0e0e0",system:"#737373"},h=["head","re1","re2","dev","user"],f=[/^.+ is online$/,/disconnected \(timeout\)/,/^.+ disconnected$/,/auto-recovered/,/Resuming agent conversation/,/Loop guard:/],m=[{command:"/artchallenge",description:"SVG art challenge — all agents create artwork (optional theme)"},{command:"/hatmaking",description:"All agents design a hat to wear on their avatar"},{command:"/roastreview",description:"Get all agents to review and roast each other's work"},{command:"/poetry haiku",description:"Agents write a haiku about the codebase"},{command:"/poetry limerick",description:"Agents write a limerick about the codebase"},{command:"/poetry sonnet",description:"Agents write a sonnet about the codebase"},{command:"/summary",description:"Summarize recent messages — tag an agent (e.g. /summary @head)"},{command:"/continue",description:"Resume after loop guard pauses"},{command:"/clear",description:"Clear messages in current channel"}];function x(e){return p[e.toLowerCase()]||"#e0e0e0"}let g=/(^|\s)(@(?:head|dev|re1|re2|user))(?![\w-])/gi;function b({projectId:e,filterSystem:n}){return(0,t.jsx)(y,{projectId:e,filterSystem:n})}function y({projectId:e,filterSystem:r=!1}){let l="general",[i,a]=(0,n.useState)([]),[o,c]=(0,n.useState)(!1),[u,p]=(0,n.useState)(""),b=(0,n.useRef)(0),v=(0,n.useRef)(null),[w,k]=(0,n.useState)(!1),[j,N]=(0,n.useState)(""),[S,C]=(0,n.useState)(!1),[E,A]=(0,n.useState)(0),[T,I]=(0,n.useState)(null),[R,O]=(0,n.useState)(null),P=(0,n.useRef)(0),M=(0,n.useRef)(null),F=(0,n.useRef)(null),D=(0,n.useRef)(!1),_=(0,n.useRef)(!0),L=(0,n.useRef)(0);(0,n.useEffect)(()=>{P.current=0,a([]),c(!1),b.current=0,v.current&&(clearTimeout(v.current),v.current=null)},[e]);let $=(0,n.useCallback)(()=>{fetch(`/api/chat?path=/api/messages&channel=${encodeURIComponent(l)}&cursor=${P.current}${e?`&project=${encodeURIComponent(e)}`:""}`).then(e=>{if(403===e.status)throw L.current<3?I(null):I("Chat authentication failed (403). Set agentchattr_token in Settings or ~/.quadwork/config.json."),Error("auth failed");if(!e.ok)throw Error(`Poll failed: ${e.status}`);return e.json()}).then(e=>{I(null);let t=Array.isArray(e)?e:e.messages||[];if(t.length>0){a(e=>{let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return r.length>0?[...e,...r]:e});let e=Math.max(...t.map(e=>e.id));e>P.current&&(P.current=e)}c(!0)}).catch(()=>{!o&&b.current<3&&(b.current+=1,v.current=setTimeout($,2e3))})},[l,e,o]);(0,n.useEffect)(()=>{$();let e=setInterval($,3e3);return()=>{clearInterval(e),v.current&&(clearTimeout(v.current),v.current=null)}},[$]),(0,n.useEffect)(()=>{_.current&&M.current&&(M.current.scrollTop=M.current.scrollHeight)},[i]);let[U,z]=(0,n.useState)(!1),[B,H]=(0,n.useState)(null),[q,V]=(0,n.useState)([]),[W,G]=(0,n.useState)(!1),J=(0,n.useRef)(null),Q=async t=>{if(e){G(!0);try{let n=new FormData;n.append("file",t);let r=await fetch(`/api/upload?project=${encodeURIComponent(e)}`,{method:"POST",body:n});if(!r.ok){let e=await r.json().catch(()=>({error:`${r.status}`}));H(e.error||`Upload failed: ${r.status}`);return}let l=await r.json();V(e=>[...e,{path:l.path,name:l.name}])}catch(e){H(e.message)}finally{G(!1)}}},K=e=>{for(let t of e)t.type.startsWith("image/")&&Q(t)};(0,n.useEffect)(()=>{let e=F.current;e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,120)+"px")},[u]);let Y=()=>{let t=u.trim();if(!t&&0===q.length||U)return;let n=t.startsWith("/")||/^@(head|dev|re1|re2)\b/i.test(t)?t:`@head ${t}`;z(!0),H(null),fetch(`/api/chat${e?`?project=${encodeURIComponent(e)}`:""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n,channel:l,sender:"user",...q.length>0?{attachments:q}:{},...R?{reply_to:R.id}:{}})}).then(e=>{if(!e.ok)throw Error(`Send failed: ${e.status}`);p(""),V([]),O(null),setTimeout($,300)}).catch(e=>{H(e.message),console.error(e.message)}).finally(()=>z(!1))},X=(0,n.useCallback)(t=>{if(U)return;let n=t.startsWith("/")||/^@(head|dev|re1|re2)\b/i.test(t)?t:`@head ${t}`;z(!0),H(null),fetch(`/api/chat${e?`?project=${encodeURIComponent(e)}`:""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n,channel:l,sender:"user"})}).then(e=>{if(!e.ok)throw Error(`Send failed: ${e.status}`);setTimeout($,300)}).catch(e=>{H(e.message),console.error(e.message)}).finally(()=>z(!1))},[U,e,l,$]),Z=e=>{p(u.replace(/@\w*$/,`@${e} `)),k(!1),F.current?.focus()},ee=e=>{p(e.includes(" ")?e:`${e} `),C(!1),F.current?.focus()},et=h.filter(e=>e.toLowerCase().startsWith(j)),en=m.filter(e=>e.command.toLowerCase().startsWith(u.toLowerCase())),er=r?i.filter(e=>!function(e){if("system"===e.sender||"join"===e.type||"leave"===e.type)return!0;for(let t of f)if(t.test(e.text))return!0;return!1}(e)):i;return(0,t.jsxs)("div",{className:"flex flex-col h-full bg-bg",children:[T&&(0,t.jsx)("div",{className:"px-3 py-2 bg-red-900/30 border-b border-red-700/50 text-[11px] text-red-400",children:T}),(0,t.jsxs)("div",{ref:M,onScroll:()=>{if(!M.current)return;let{scrollTop:e,scrollHeight:t,clientHeight:n}=M.current;_.current=t-e-n<40},className:"flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-0.5",children:[!o&&0===i.length&&(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"Loading messages..."})}),o&&0===er.length&&(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)(s,{onInsert:e=>{p(e),F.current?.focus()}})}),er.map(n=>{var r;let l;return(0,t.jsxs)("div",{className:"group flex gap-2 text-[12px] leading-5",children:[(0,t.jsx)("span",{className:"text-text-muted shrink-0 w-12 text-right tabular-nums",children:n.time?.slice(0,5)||""}),(0,t.jsx)("span",{className:"shrink-0 font-semibold w-10 text-right",style:{color:x(n.sender)},children:"re1"===(l=(r=n.sender).toLowerCase())?"RE1":"re2"===l?"RE2":r}),(0,t.jsxs)("span",{className:"text-text break-words min-w-0 whitespace-pre-wrap flex-1",children:[function(e){let n=[],r=0,l=0;for(let i of e.matchAll(g)){let a=i.index??0,o=i[1],s=i[2],c=a+o.length;c>r&&n.push(e.slice(r,c));let u=x(s.slice(1).toLowerCase());n.push((0,t.jsx)("span",{className:"inline-block px-1 py-0 rounded font-mono",style:{backgroundColor:`${u}22`,color:u},children:s},`m${l++}`)),r=c+s.length}return r<e.length&&n.push(e.slice(r)),n.length>0?n:[e]}(n.text),n.attachments&&n.attachments.length>0&&(0,t.jsx)("span",{className:"flex gap-2 mt-1",children:n.attachments.map(n=>(0,t.jsx)("a",{href:`/api/uploads/${encodeURIComponent(e||"")}/${encodeURIComponent(n.name)}`,target:"_blank",rel:"noopener noreferrer",children:(0,t.jsx)("img",{src:`/api/uploads/${encodeURIComponent(e||"")}/${encodeURIComponent(n.name)}`,alt:n.name,className:"max-w-[200px] max-h-[150px] object-cover border border-border rounded hover:border-accent transition-colors"})},n.name))})]}),(0,t.jsx)("button",{type:"button",onClick:()=>{if(O({id:n.id,sender:n.sender}),new Set(["head","dev","re1","re2"]).has(n.sender.toLowerCase())){let e=`@${n.sender} `;p(t=>t.startsWith(e)?t:e)}F.current?.focus()},className:"shrink-0 self-start opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity text-[10px] text-text-muted hover:text-text px-1 py-0.5 border border-border/50 rounded",title:`Reply to message #${n.id}`,children:"reply"})]},n.id)})]}),(0,t.jsxs)("div",{className:"relative shrink-0 border-t border-border",children:[w&&et.length>0&&(0,t.jsx)("div",{className:"absolute bottom-full left-0 right-0 border border-border bg-bg-surface",children:et.map(e=>(0,t.jsxs)("button",{onClick:()=>Z(e),className:"w-full text-left px-3 py-1 text-[12px] hover:bg-[#1a1a1a] transition-colors",style:{color:x(e)},children:["@",e]},e))}),S&&en.length>0&&(0,t.jsx)("div",{className:"absolute bottom-full left-0 right-0 max-h-60 overflow-y-auto border border-border bg-bg-surface z-10",children:en.map((e,n)=>{let r=n===Math.min(E,en.length-1);return(0,t.jsxs)("button",{onClick:()=>ee(e.command),onMouseEnter:()=>A(n),className:`w-full text-left px-3 py-1 transition-colors flex items-baseline gap-2 ${r?"bg-[#1a1a1a]":"hover:bg-[#1a1a1a]"}`,children:[(0,t.jsx)("span",{className:"text-[12px] text-accent font-mono",children:e.command}),(0,t.jsx)("span",{className:"text-[10px] text-text-muted truncate",children:e.description})]},e.command)})}),B&&(0,t.jsx)("div",{className:"px-3 py-1 text-[11px] text-red-400 bg-red-900/20 border-b border-red-700/40",children:B}),R&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1 text-[11px] text-text-muted bg-bg-surface border-b border-border/50",children:[(0,t.jsxs)("span",{children:["Replying to ",(0,t.jsxs)("span",{style:{color:x(R.sender)},children:["@",R.sender]})," #",R.id]}),(0,t.jsx)("button",{type:"button",onClick:()=>O(null),className:"ml-auto hover:text-text",title:"Cancel reply (Esc)",children:"✕"})]}),(0,t.jsxs)("div",{className:"flex items-end gap-1 px-1 relative",children:[(0,t.jsx)("textarea",{ref:F,rows:1,value:u,onChange:e=>(e=>{p(e);let t=e.match(/@(\w*)$/);if(t){k(!0),N(t[1].toLowerCase()),C(!1);return}if(k(!1),e.startsWith("/")){let t=e.slice(1).includes(" "),n=e.startsWith("/poetry");C(!t||n),A(0)}else C(!1)})(e.target.value),onCompositionStart:()=>{D.current=!0},onCompositionEnd:()=>{D.current=!1},onKeyDown:e=>{if("Tab"===e.key&&w&&et.length>0){e.preventDefault(),Z(et[0]);return}if(S&&en.length>0){if("ArrowDown"===e.key){e.preventDefault(),A(e=>(e+1)%en.length);return}if("ArrowUp"===e.key){e.preventDefault(),A(e=>(e-1+en.length)%en.length);return}if("Tab"===e.key||"Enter"===e.key&&!e.shiftKey){e.preventDefault();let t=Math.min(E,en.length-1);ee(en[t].command);return}}"Enter"!==e.key||e.shiftKey||D.current||e.nativeEvent.isComposing||(e.preventDefault(),Y()),"Escape"===e.key&&(k(!1),C(!1),R&&O(null))},onPaste:e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of Array.from(t))if(e.type.startsWith("image/")){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),K(n))},onDrop:e=>{let t=e.dataTransfer?.files;if(!t)return;let n=Array.from(t).filter(e=>e.type.startsWith("image/"));n.length>0&&(e.preventDefault(),K(n))},onDragOver:e=>{e.dataTransfer?.types?.includes("Files")&&e.preventDefault()},placeholder:`Message #${l}...`,disabled:U,className:"flex-1 bg-transparent px-2 py-2 text-[12px] font-mono text-text placeholder:text-text-muted outline-none focus:ring-1 focus:ring-accent disabled:opacity-50 resize-none overflow-y-auto leading-snug",style:{maxHeight:120}}),(0,t.jsx)("input",{ref:J,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,className:"hidden",onChange:e=>{let t=e.target.files;t&&t.length>0&&K(Array.from(t)),e.target.value=""}}),(0,t.jsx)(d,{projectId:e||"",onSend:X}),(0,t.jsx)("button",{type:"button",onClick:()=>J.current?.click(),disabled:W,className:"shrink-0 px-1.5 py-2 text-[13px] text-text-muted hover:text-accent transition-colors disabled:opacity-30",title:"Attach image",children:"📎"}),(0,t.jsx)("button",{onClick:Y,disabled:U||!u.trim()&&0===q.length,className:"shrink-0 px-2 py-2 text-[11px] font-mono text-accent border border-accent/40 rounded hover:bg-accent/10 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send (Enter)",children:U?"…":"Send"})]}),(q.length>0||W)&&(0,t.jsxs)("div",{className:"flex gap-2 px-2 py-1 flex-wrap",children:[q.map((n,r)=>(0,t.jsxs)("div",{className:"relative group",children:[(0,t.jsx)("img",{src:`/api/uploads/${encodeURIComponent(e||"")}/${encodeURIComponent(n.name)}`,alt:n.name,className:"h-16 max-w-[200px] object-cover border border-border rounded"}),(0,t.jsx)("button",{type:"button",onClick:()=>V(e=>e.filter((e,t)=>t!==r)),className:"absolute -top-1.5 -right-1.5 w-4 h-4 bg-bg border border-border rounded-full text-[10px] text-text-muted hover:text-error opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",title:"Remove",children:"×"})]},n.name)),W&&(0,t.jsx)("div",{className:"h-16 w-16 border border-border rounded flex items-center justify-center",children:(0,t.jsx)("span",{className:"text-[10px] text-text-muted animate-pulse",children:"..."})})]})]})]})}function v(){}function w(){}let k=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N={};function S(e,t){return((t||N).jsx?j:k).test(e)}let C=/[ \t\n\f\r]/g;function E(e){return""===e.replace(C,"")}class A{constructor(e,t){this.attribute=t,this.property=e}}A.prototype.attribute="",A.prototype.booleanish=!1,A.prototype.boolean=!1,A.prototype.commaOrSpaceSeparated=!1,A.prototype.commaSeparated=!1,A.prototype.defined=!1,A.prototype.mustUseProperty=!1,A.prototype.number=!1,A.prototype.overloadedBoolean=!1,A.prototype.property="",A.prototype.spaceSeparated=!1,A.prototype.space=void 0;let T=0,I=_(),R=_(),O=_(),P=_(),M=_(),F=_(),D=_();function _(){return 2**++T}e.s(["boolean",0,I,"booleanish",0,R,"commaOrSpaceSeparated",0,D,"commaSeparated",0,F,"number",0,P,"overloadedBoolean",0,O,"spaceSeparated",0,M],744);var L=e.i(744);let $=Object.keys(L);class U extends A{constructor(e,t,n,r){let l=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++l<$.length;){const e=$[l];!function(e,t,n){n&&(e[t]=n)}(this,$[l],(n&L[e])===L[e])}}}function z(e){return e.toLowerCase()}U.prototype.defined=!0;let B=/[A-Z]/g,H=/-[a-z]/g,q=/^data[-\w.:]+$/i;function V(e){return"-"+e.toLowerCase()}function W(e){return e.charAt(1).toUpperCase()}let G={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"};class J{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function Q(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new J(n,r,t)}function K(e){let t={},n={};for(let[r,l]of Object.entries(e.properties)){let i=new U(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[z(r)]=r,n[z(i.attribute)]=r}return new J(t,n,e.space)}J.prototype.normal={},J.prototype.property={},J.prototype.space=void 0;let Y=K({properties:{ariaActiveDescendant:null,ariaAtomic:R,ariaAutoComplete:null,ariaBusy:R,ariaChecked:R,ariaColCount:P,ariaColIndex:P,ariaColSpan:P,ariaControls:M,ariaCurrent:null,ariaDescribedBy:M,ariaDetails:null,ariaDisabled:R,ariaDropEffect:M,ariaErrorMessage:null,ariaExpanded:R,ariaFlowTo:M,ariaGrabbed:R,ariaHasPopup:null,ariaHidden:R,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:M,ariaLevel:P,ariaLive:null,ariaModal:R,ariaMultiLine:R,ariaMultiSelectable:R,ariaOrientation:null,ariaOwns:M,ariaPlaceholder:null,ariaPosInSet:P,ariaPressed:R,ariaReadOnly:R,ariaRelevant:null,ariaRequired:R,ariaRoleDescription:M,ariaRowCount:P,ariaRowIndex:P,ariaRowSpan:P,ariaSelected:R,ariaSetSize:P,ariaSort:null,ariaValueMax:P,ariaValueMin:P,ariaValueNow:P,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function X(e,t){return t in e?e[t]:t}function Z(e,t){return X(e,t.toLowerCase())}let ee=K({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:F,acceptCharset:M,accessKey:M,action:null,allow:null,allowFullScreen:I,allowPaymentRequest:I,allowUserMedia:I,alt:null,as:null,async:I,autoCapitalize:null,autoComplete:M,autoFocus:I,autoPlay:I,blocking:M,capture:null,charSet:null,checked:I,cite:null,className:M,cols:P,colSpan:null,content:null,contentEditable:R,controls:I,controlsList:M,coords:P|F,crossOrigin:null,data:null,dateTime:null,decoding:null,default:I,defer:I,dir:null,dirName:null,disabled:I,download:O,draggable:R,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:I,formTarget:null,headers:M,height:P,hidden:O,high:P,href:null,hrefLang:null,htmlFor:M,httpEquiv:M,id:null,imageSizes:null,imageSrcSet:null,inert:I,inputMode:null,integrity:null,is:null,isMap:I,itemId:null,itemProp:M,itemRef:M,itemScope:I,itemType:M,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:I,low:P,manifest:null,max:null,maxLength:P,media:null,method:null,min:null,minLength:P,multiple:I,muted:I,name:null,nonce:null,noModule:I,noValidate:I,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:I,optimum:P,pattern:null,ping:M,placeholder:null,playsInline:I,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:I,referrerPolicy:null,rel:M,required:I,reversed:I,rows:P,rowSpan:P,sandbox:M,scope:null,scoped:I,seamless:I,selected:I,shadowRootClonable:I,shadowRootDelegatesFocus:I,shadowRootMode:null,shape:null,size:P,sizes:null,slot:null,span:P,spellCheck:R,src:null,srcDoc:null,srcLang:null,srcSet:null,start:P,step:null,style:null,tabIndex:P,target:null,title:null,translate:null,type:null,typeMustMatch:I,useMap:null,value:R,width:P,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:M,axis:null,background:null,bgColor:null,border:P,borderColor:null,bottomMargin:P,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:I,declare:I,event:null,face:null,frame:null,frameBorder:null,hSpace:P,leftMargin:P,link:null,longDesc:null,lowSrc:null,marginHeight:P,marginWidth:P,noResize:I,noHref:I,noShade:I,noWrap:I,object:null,profile:null,prompt:null,rev:null,rightMargin:P,rules:null,scheme:null,scrolling:R,standby:null,summary:null,text:null,topMargin:P,valueType:null,version:null,vAlign:null,vLink:null,vSpace:P,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:I,disableRemotePlayback:I,prefix:null,property:null,results:P,security:null,unselectable:null},space:"html",transform:Z}),et=K({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",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:D,accentHeight:P,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:P,amplitude:P,arabicForm:null,ascent:P,attributeName:null,attributeType:null,azimuth:P,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:P,by:null,calcMode:null,capHeight:P,className:M,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:P,diffuseConstant:P,direction:null,display:null,dur:null,divisor:P,dominantBaseline:null,download:I,dx:null,dy:null,edgeMode:null,editable:null,elevation:P,enableBackground:null,end:null,event:null,exponent:P,externalResourcesRequired:null,fill:null,fillOpacity:P,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:F,g2:F,glyphName:F,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:P,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:P,horizOriginX:P,horizOriginY:P,id:null,ideographic:P,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:P,k:P,k1:P,k2:P,k3:P,k4:P,kernelMatrix:D,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:P,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:P,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:P,overlineThickness:P,paintOrder:null,panose1:null,path:null,pathLength:P,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:M,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:P,pointsAtY:P,pointsAtZ:P,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D,rev:D,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D,requiredFeatures:D,requiredFonts:D,requiredFormats:D,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:P,specularExponent:P,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:P,strikethroughThickness:P,string:null,stroke:null,strokeDashArray:D,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:P,strokeOpacity:P,strokeWidth:null,style:null,surfaceScale:P,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D,tabIndex:P,tableValues:null,target:null,targetX:P,targetY:P,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:P,underlineThickness:P,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:P,values:null,vAlphabetic:P,vMathematical:P,vectorEffect:null,vHanging:P,vIdeographic:P,version:null,vertAdvY:P,vertOriginX:P,vertOriginY:P,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:P,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:X}),en=K({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),er=K({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Z}),el=K({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),ei=Q([Y,ee,en,er,el],"html"),ea=Q([Y,et,en,er,el],"svg");var eo=e.i(15511);let es=eu("end"),ec=eu("start");function eu(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function ed(e){return e&&"object"==typeof e?"position"in e||"type"in e?eh(e.position):"start"in e||"end"in e?eh(e):"line"in e||"column"in e?ep(e):"":""}function ep(e){return ef(e&&e.line)+":"+ef(e&&e.column)}function eh(e){return ep(e&&e.start)+"-"+ep(e&&e.end)}function ef(e){return e&&"number"==typeof e?e:1}class em extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",l={},i=!1;if(t&&(l="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!l.cause&&e&&(i=!0,r=e.message,l.cause=e),!l.ruleId&&!l.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?l.ruleId=n:(l.source=n.slice(0,e),l.ruleId=n.slice(e+1))}if(!l.place&&l.ancestors&&l.ancestors){const e=l.ancestors[l.ancestors.length-1];e&&(l.place=e.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=ed(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=i&&l.cause&&"string"==typeof l.cause.stack?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}em.prototype.file="",em.prototype.name="",em.prototype.reason="",em.prototype.message="",em.prototype.stack="",em.prototype.column=void 0,em.prototype.line=void 0,em.prototype.ancestors=void 0,em.prototype.cause=void 0,em.prototype.fatal=void 0,em.prototype.place=void 0,em.prototype.ruleId=void 0,em.prototype.source=void 0;let ex={}.hasOwnProperty,eg=new Map,eb=/[A-Z]/g,ey=new Set(["table","tbody","thead","tfoot","tr"]),ev=new Set(["td","th"]),ew="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ek(e,t,n){var r,l,i,a,o,s,c,u,d;let p,h,f,m,x,g,b,y,w,k,j;return"element"===t.type?(r=e,l=t,i=n,h=p=r.schema,"svg"===l.tagName.toLowerCase()&&"html"===p.space&&(r.schema=ea),r.ancestors.push(l),f=eC(r,l.tagName,!1),m=function(e,t){let n,r,l={};for(r in t.properties)if("children"!==r&&ex.call(t.properties,r)){let i=function(e,t,n){let r=function(e,t){let n=z(t),r=t,l=A;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&q.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(H,W);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!H.test(e)){let n=e.replace(B,V);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}l=U}return new l(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var l;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(l=n)[l.length-1]?[...l,""]:l).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,eo.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new em("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=ew+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)ex.call(e,t)&&(n[function(e){let t=e.replace(eb,eA);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?G[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(i){let[r,a]=i;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof a&&ev.has(t.tagName)?n=a:l[r]=a}}return n&&((l.style||(l.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),l}(r,l),x=eS(r,l),ey.has(l.tagName)&&(x=x.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&E(e.value):E(e))})),ej(r,m,f,l),eN(m,x),r.ancestors.pop(),r.schema=p,r.create(l,f,m,i)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return v("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}eE(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(a=e,o=t,s=n,b=g=a.schema,"svg"===o.name&&"html"===g.space&&(a.schema=ea),a.ancestors.push(o),y=null===o.name?a.Fragment:eC(a,o.name,!0),w=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];v("ExpressionStatement"===t.type);let l=t.expression;v("ObjectExpression"===l.type);let i=l.properties[0];v("SpreadElement"===i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else eE(e,t.position);else{let l,i=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];v("ExpressionStatement"===t.type),l=e.evaluater.evaluateExpression(t.expression)}else eE(e,t.position);else l=null===r.value||r.value;n[i]=l}return n}(a,o),k=eS(a,o),ej(a,w,y,o),eN(w,k),a.ancestors.pop(),a.schema=g,a.create(o,y,w,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eE(e,t.position)}(e,t):"root"===t.type?(c=e,u=t,d=n,eN(j={},eS(c,u)),c.create(u,c.Fragment,j,d)):"text"===t.type?t.value:void 0}function ej(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eN(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function eS(e,t){let n=[],r=-1,l=e.passKeys?new Map:eg;for(;++r<t.children.length;){let i,a=t.children[r];if(e.passKeys){let e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){let t=l.get(e)||0;i=e+"-"+t,l.set(e,t+1)}}let o=ek(e,a,i);void 0!==o&&n.push(o)}return n}function eC(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),l=-1;for(;++l<n.length;){let t=S(n[l])?{type:"Identifier",name:n[l]}:{type:"Literal",value:n[l]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(l&&"Literal"===t.type),optional:!1}:t}v(e,"always a result"),r=e}else r=S(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return ex.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);eE(e)}function eE(e,t){let n=new em("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=ew+"#cannot-handle-mdx-estrees-without-createevaluater",n}function eA(e){return"-"+e.toLowerCase()}let eT={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"]},eI={};function eR(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eO(e.children,t,n)}return Array.isArray(e)?eO(e,t,n):""}function eO(e,t,n){let r=[],l=-1;for(;++l<e.length;)r[l]=eR(e[l],t,n);return r.join("")}function eP(e,t,n,r){let l,i=e.length,a=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(l=Array.from(r)).unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)(l=r.slice(a,a+1e4)).unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function eM(e,t){return e.length>0?(eP(e,e.length,0,t),e):t}let eF={}.hasOwnProperty,eD=eJ(/[A-Za-z]/),e_=eJ(/[\dA-Za-z]/),eL=eJ(/[#-'*+\--9=?A-Z^-~]/);function e$(e){return null!==e&&(e<32||127===e)}let eU=eJ(/\d/),ez=eJ(/[\dA-Fa-f]/),eB=eJ(/[!-/:-@[-`{-~]/);function eH(e){return null!==e&&e<-2}function eq(e){return null!==e&&(e<0||32===e)}function eV(e){return -2===e||-1===e||32===e}let eW=eJ(/\p{P}|\p{S}/u),eG=eJ(/\s/);function eJ(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function eQ(e,t,n,r){let l=r?r-1:1/0,i=0;return function(r){return eV(r)?(e.enter(n),function r(a){return eV(a)&&i++<l?(e.consume(a),r):(e.exit(n),t(a))}(r)):t(r)}}let eK={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eQ(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let l=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return eH(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},eY={tokenize:function(e){let t,n,r,l=this,i=[],a=0;return o;function o(t){if(a<i.length){let n=i[a];return l.containerState=n[1],e.attempt(n[0].continuation,s,c)(t)}return c(t)}function s(e){if(a++,l.containerState._closeFlow){let n;l.containerState._closeFlow=void 0,t&&g();let r=l.events.length,i=r;for(;i--;)if("exit"===l.events[i][0]&&"chunkFlow"===l.events[i][1].type){n=l.events[i][1].end;break}x(a);let o=r;for(;o<l.events.length;)l.events[o][1].end={...n},o++;return eP(l.events,i+1,0,l.events.slice(r)),l.events.length=o,c(e)}return o(e)}function c(n){if(a===i.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);l.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return l.containerState={},e.check(eX,u,d)(n)}function u(e){return t&&g(),x(a),p(e)}function d(e){return l.parser.lazy[l.now().line]=a!==i.length,r=l.now().offset,f(e)}function p(t){return l.containerState={},e.attempt(eX,h,f)(t)}function h(e){return a++,i.push([l.currentConstruct,l.containerState]),p(e)}function f(r){if(null===r){t&&g(),x(0),e.consume(r);return}return t=t||l.parser.flow(l.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),x(0),e.consume(n);return}return eH(n)?(e.consume(n),m(e.exit("chunkFlow")),a=0,l.interrupt=void 0,o):(e.consume(n),t)}(r)}function m(e,i){let o=l.sliceStream(e);if(i&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),l.parser.lazy[e.start.line]){let e,n,i=t.events.length;for(;i--;)if(t.events[i][1].start.offset<r&&(!t.events[i][1].end||t.events[i][1].end.offset>r))return;let o=l.events.length,s=o;for(;s--;)if("exit"===l.events[s][0]&&"chunkFlow"===l.events[s][1].type){if(e){n=l.events[s][1].end;break}e=!0}for(x(a),i=o;i<l.events.length;)l.events[i][1].end={...n},i++;eP(l.events,s+1,0,l.events.slice(o)),l.events.length=i}}function x(t){let n=i.length;for(;n-- >t;){let t=i[n];l.containerState=t[1],t[0].exit.call(l,e)}i.length=t}function g(){t.write([null]),n=void 0,t=void 0,l.containerState._closeFlow=void 0}}},eX={tokenize:function(e,t,n){return eQ(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},eZ={partial:!0,tokenize:function(e,t,n){return function(t){return eV(t)?eQ(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||eH(e)?t(e):n(e)}}};class e0{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&e1(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),e1(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),e1(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);e1(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);e1(this.left,t.reverse())}}}function e1(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 e2(e){let t,n,r,l,i,a,o,s={},c=-1,u=new e0(e);for(;++c<u.length;){for(;c in s;)c=s[c];if(t=u.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&((r=0)<(a=t[1]._tokenizer.events).length&&"lineEndingBlank"===a[r][1].type&&(r+=2),r<a.length&&"content"===a[r][1].type))for(;++r<a.length&&"content"!==a[r][1].type;)"chunkText"===a[r][1].type&&(a[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,l=e.get(t)[1],i=e.get(t)[2],a=t-1,o=[],s=l._tokenizer;!s&&(s=i.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let c=s.events,u=[],d={},p=-1,h=l,f=0,m=0,x=[0];for(;h;){for(;e.get(++a)[1]!==h;);o.push(a),!h._tokenizer&&(n=i.sliceStream(h),h.next||n.push(null),r&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=h,h=h.next}for(h=l;++p<c.length;)"exit"===c[p][0]&&"enter"===c[p-1][0]&&c[p][1].type===c[p-1][1].type&&c[p][1].start.line!==c[p][1].end.line&&(m=p+1,x.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):x.pop(),p=x.length;p--;){let t=c.slice(x[p],x[p+1]),n=o.pop();u.push([n,n+t.length-1]),e.splice(n,2,t)}for(u.reverse(),p=-1;++p<u.length;)d[f+u[p][0]]=f+u[p][1],f+=u[p][1]-u[p][0]-1;return d}(u,c)),c=s[c],o=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(l=u.get(r))[1].type||"lineEndingBlank"===l[1].type)"enter"===l[0]&&(n&&(u.get(n)[1].type="lineEndingBlank"),l[1].type="lineEnding",n=r);else if("linePrefix"===l[1].type||"listItemIndent"===l[1].type);else break;n&&(t[1].end={...u.get(n)[1].start},(i=u.slice(n,c)).unshift(t),u.splice(n,c-n+1,i))}}return eP(e,0,1/0,u.slice(0)),!o}let e5={resolve:function(e){return e2(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?l(t):eH(t)?e.check(e4,i,l)(t):(e.consume(t),r)}function l(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},e4={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eQ(e,l,"linePrefix")};function l(l){if(null===l||eH(l))return n(l);let i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}},e3={tokenize:function(e){let t=this,n=e.attempt(eZ,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,eQ(e,e.attempt(this.parser.constructs.flow,r,e.attempt(e5,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},e6={resolveAll:te()},e9=e8("string"),e7=e8("text");function e8(e){return{resolveAll:te("text"===e?tt:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],l=t.attempt(r,i,a);return i;function i(e){return s(e)?l(e):a(e)}function a(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),o)}function o(e){return s(e)?(t.exit("data"),l(e)):(t.consume(e),o)}function s(e){if(null===e)return!0;let t=r[e],l=-1;if(t)for(;++l<t.length;){let e=t[l];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function te(e){return function(t,n){let r,l=-1;for(;++l<=t.length;)void 0===r?t[l]&&"data"===t[l][1].type&&(r=l,l++):t[l]&&"data"===t[l][1].type||(l!==r+2&&(t[r][1].end=t[l-1][1].end,t.splice(r+2,l-r-2),l=r+2),r=void 0);return e?e(t,n):t}}function tt(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,l=e[n-1][1],i=t.sliceStream(l),a=i.length,o=-1,s=0;for(;a--;){let e=i[a];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)s++,o--;if(o)break;o=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:l.start._bufferIndex+o,_index:l.start._index+a,line:l.end.line,column:l.end.column-s,offset:l.end.offset-s},end:{...l.end}};l.end={...i.start},l.start.offset===l.end.offset?Object.assign(l,i):(e.splice(n,0,["enter",i,t],["exit",i,t]),n+=2)}n++}return e}function tn(e){return null===e||eq(e)||eG(e)?1:eW(e)?2:void 0}function tr(e,t,n){let r=[],l=-1;for(;++l<e.length;){let i=e[l].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}let tl={name:"attention",resolveAll:function(e,t){let n,r,l,i,a,o,s,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[u][1].start};ti(d,-o),ti(p,o),i={type:o>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:o>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},l={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:o>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=eM(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=eM(s,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",l,t]]),s=eM(s,tr(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),s=eM(s,[["exit",l,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,s=eM(s,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,eP(e,n-1,u-n+3,s),u=n+s.length-c-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,l=this.previous,i=tn(l);return function(a){return n=a,e.enter("attentionSequence"),function a(o){if(o===n)return e.consume(o),a;let s=e.exit("attentionSequence"),c=tn(o),u=!c||2===c&&i||r.includes(o),d=!i||2===i&&c||r.includes(l);return s._open=!!(42===n?u:u&&(i||!d)),s._close=!!(42===n?d:d&&(c||!u)),t(o)}(a)}}};function ti(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let ta={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return eV(t)?eQ(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)};function l(r){return e.attempt(ta,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),l}return n(t)};function l(n){return eV(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},to={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return eB(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},ts=document.createElement("i");function tc(e){let t="&"+e+";";ts.innerHTML=t;let n=ts.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let tu={name:"characterReference",tokenize:function(e,t,n){let r,l,i=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,l=e_,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,l=ez,c):(e.enter("characterReferenceValue"),r=7,l=eU,c(t))}function c(o){if(59===o&&a){let r=e.exit("characterReferenceValue");return l!==e_||tc(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return l(o)&&a++<r?(e.consume(o),c):n(o)}}},td={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tp={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,l=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a};function a(t){return e.enter("codeFencedFence"),eV(t)?eQ(e,s,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(l){return l===r?(i++,e.consume(l),t):i>=o?(e.exit("codeFencedFenceSequence"),eV(l)?eQ(e,c,"whitespace")(l):c(l)):n(l)}(t)):n(t)}function c(r){return null===r||eH(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},a=0,o=0;return function(t){var i;let c;return i=t,a=(c=l.events[l.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(l){return l===r?(o++,e.consume(l),t):o<3?n(l):(e.exit("codeFencedFenceSequence"),eV(l)?eQ(e,s,"whitespace")(l):s(l))}(i)};function s(i){return null===i||eH(i)?(e.exit("codeFencedFence"),l.interrupt?t(i):e.check(td,u,f)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||eH(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(l)):eV(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),eQ(e,c,"whitespace")(l)):96===l&&l===r?n(l):(e.consume(l),t)}(i))}function c(t){return null===t||eH(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||eH(l)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(l)):96===l&&l===r?n(l):(e.consume(l),t)}(t))}function u(t){return e.attempt(i,f,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return a>0&&eV(t)?eQ(e,h,"linePrefix",a+1)(t):h(t)}function h(t){return null===t||eH(t)?e.check(td,u,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||eH(n)?(e.exit("codeFlowValue"),h(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},th={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),eQ(e,l,"linePrefix",5)(t)};function l(t){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?function t(n){return null===n?i(n):eH(n)?e.attempt(tf,t,i)(n):(e.enter("codeFlowValue"),function n(r){return null===r||eH(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function i(n){return e.exit("codeIndented"),t(n)}}},tf={partial:!0,tokenize:function(e,t,n){let r=this;return l;function l(t){return r.parser.lazy[r.now().line]?n(t):eH(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):eQ(e,i,"linePrefix",5)(t)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):eH(e)?l(e):n(e)}}};function tm(e,t,n,r,l,i,a,o,s){let c=s||1/0,u=0;return function(t){return 60===t?(e.enter(r),e.enter(l),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||e$(t)?n(t):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(l),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(o),d(t)):null===t||60===t||eH(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(l){return!u&&(null===l||41===l||eq(l))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(l)):u<c&&40===l?(e.consume(l),u++,f):41===l?(e.consume(l),u--,f):null===l||32===l||40===l||e$(l)?n(l):(e.consume(l),92===l?m:f)}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function tx(e,t,n,r,l,i){let a,o=this,s=0;return function(t){return e.enter(r),e.enter(l),e.consume(t),e.exit(l),e.enter(i),c};function c(d){return s>999||null===d||91===d||93===d&&!a||94===d&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(d):93===d?(e.exit(i),e.enter(l),e.consume(d),e.exit(l),e.exit(r),t):eH(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||eH(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a||(a=!eV(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}}function tg(e,t,n,r,l,i){let a;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(l),e.consume(t),e.exit(l),a=40===t?41:t,o):n(t)};function o(n){return n===a?(e.enter(l),e.consume(n),e.exit(l),e.exit(r),t):(e.enter(i),s(n))}function s(t){return t===a?(e.exit(i),o(a)):null===t?n(t):eH(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),eQ(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||eH(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function tb(e,t){let n;return function r(l){return eH(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):eV(l)?eQ(e,r,n?"linePrefix":"lineSuffix")(l):t(l)}}function ty(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let tv={partial:!0,tokenize:function(e,t,n){return function(t){return eq(t)?tb(e,r)(t):n(t)};function r(t){return tg(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function l(t){return eV(t)?eQ(e,i,"whitespace")(t):i(t)}function i(e){return null===e||eH(e)?t(e):n(e)}}},tw=["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"],tk=["pre","script","style","textarea"],tj={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(eZ,t,n)}}},tN={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return eH(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):n(t)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},tS={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&eP(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,l,i,a=e.length,o=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(l){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(l=a);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[l][1].end}},u={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[l-2][1].start}};return i=eM(i=[["enter",s,t],["enter",c,t]],e.slice(r+1,r+o+3)),i=eM(i,[["enter",u,t]]),i=eM(i,tr(t.parser.constructs.insideSpan.null,e.slice(r+o+4,l-3),t)),i=eM(i,[["exit",u,t],e[l-2],e[l-1],["exit",c,t]]),i=eM(i,e.slice(l+1)),i=eM(i,[["exit",s,t]]),eP(e,r,e.length,i),e},tokenize:function(e,t,n){let r,l,i=this,a=i.events.length;for(;a--;)if(("labelImage"===i.events[a][1].type||"labelLink"===i.events[a][1].type)&&!i.events[a][1]._balanced){r=i.events[a][1];break}return function(t){return r?r._inactive?u(t):(l=i.parser.defined.includes(ty(i.sliceSerialize({start:r.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(tC,c,l?c:u)(t):91===t?e.attempt(tE,c,l?s:u)(t):l?c(t):u(t)}function s(t){return e.attempt(tA,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},tC={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return eq(t)?tb(e,l)(t):l(t)}function l(t){return 41===t?c(t):tm(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return eq(t)?tb(e,o)(t):c(t)}function a(e){return n(e)}function o(t){return 34===t||39===t||40===t?tg(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function s(t){return eq(t)?tb(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},tE={tokenize:function(e,t,n){let r=this;return function(t){return tx.call(r,e,l,i,"reference","referenceMarker","referenceString")(t)};function l(e){return r.parser.defined.includes(ty(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},tA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},tT={name:"labelStartImage",resolveAll:tS.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),l};function l(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},tI={name:"labelStartLink",resolveAll:tS.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),l};function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},tR={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),eQ(e,t,"linePrefix")}}},tO={name:"thematicBreak",tokenize:function(e,t,n){let r,l=0;return function(i){var a;return e.enter("thematicBreak"),r=a=i,function i(a){return a===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),l++,t):(e.exit("thematicBreakSequence"),eV(n)?eQ(e,i,"whitespace")(n):i(n))}(a)):l>=3&&(null===a||eH(a))?(e.exit("thematicBreak"),t(a)):n(a)}(a)}}},tP={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(eZ,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,eQ(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!eV(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(tF,t,l)(n))});function l(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,eQ(e,e.attempt(tP,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,l=r.events[r.events.length-1],i=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,a=0;return function(t){let l=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===l?!r.containerState.marker||t===r.containerState.marker:eU(t)){if(r.containerState.type||(r.containerState.type=l,e.enter(l,{_container:!0})),"listUnordered"===l)return e.enter("listItemPrefix"),42===t||45===t?e.check(tO,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(l){return eU(l)&&++a<10?(e.consume(l),t):(!r.interrupt||a<2)&&(r.containerState.marker?l===r.containerState.marker:41===l||46===l)?(e.exit("listItemValue"),o(l)):n(l)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(eZ,r.interrupt?n:s,e.attempt(tM,u,c))}function s(e){return r.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return eV(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},tM={partial:!0,tokenize:function(e,t,n){let r=this;return eQ(e,function(e){let l=r.events[r.events.length-1];return!eV(e)&&l&&"listItemPrefixWhitespace"===l[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},tF={partial:!0,tokenize:function(e,t,n){let r=this;return eQ(e,function(e){let l=r.events[r.events.length-1];return l&&"listItemIndent"===l[1].type&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},tD={name:"setextUnderline",resolveTo:function(e,t){let n,r,l,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),l||"definition"!==e[i][1].type||(l=i);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",a,t]),e.splice(l+1,0,["exit",e[n][1],t]),e[n][1].end={...e[l][1].end}):e[n][1]=a,e.push(["exit",a,t]),e},tokenize:function(e,t,n){let r,l=this;return function(t){var a;let o,s=l.events.length;for(;s--;)if("lineEnding"!==l.events[s][1].type&&"linePrefix"!==l.events[s][1].type&&"content"!==l.events[s][1].type){o="paragraph"===l.events[s][1].type;break}return!l.parser.lazy[l.now().line]&&(l.interrupt||o)?(e.enter("setextHeadingLine"),r=t,a=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),eV(n)?eQ(e,i,"lineSuffix")(n):i(n))}(a)):n(t)};function i(r){return null===r||eH(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,l=this;return function(t){var r;return e.enter("definition"),r=t,tx.call(l,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function i(t){return(r=ty(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return eq(t)?tb(e,o)(t):o(t)}function o(t){return tm(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(tv,c,c)(t)}function c(t){return eV(t)?eQ(e,u,"whitespace")(t):u(t)}function u(i){return null===i||eH(i)?(e.exit("definition"),l.parser.defined.push(r),t(i)):n(i)}}}},"disable",0,{null:[]},"document",0,{42:tP,43:tP,45:tP,48:tP,49:tP,50:tP,51:tP,52:tP,53:tP,54:tP,55:tP,56:tP,57:tP,62:ta},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,l=e.length-2,i=3;return"whitespace"===e[3][1].type&&(i+=2),l-2>i&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(i===l-1||l-4>i&&"whitespace"===e[l-2][1].type)&&(l-=i+1===l?2:4),l>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[l][1].end},r={type:"chunkText",start:e[i][1].start,end:e[l][1].end,contentType:"text"},eP(e,i,l-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(l){var i;return e.enter("atxHeading"),i=l,e.enter("atxHeadingSequence"),function l(i){return 35===i&&r++<6?(e.consume(i),l):null===i||eq(i)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||eH(r)?(e.exit("atxHeading"),t(r)):eV(r)?eQ(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||eq(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(i)):n(i)}(i)}}},42:tO,45:[tD,tO],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(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},tokenize:function(e,t,n){let r,l,i,a,o,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),l=!0,h):63===a?(e.consume(a),r=3,s.interrupt?t:O):eD(a)?(e.consume(a),i=String.fromCharCode(a),f):n(a)}function u(l){return 45===l?(e.consume(l),r=2,d):91===l?(e.consume(l),r=5,a=0,p):eD(l)?(e.consume(l),r=4,s.interrupt?t:O):n(l)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:O):n(r)}function p(r){let l="CDATA[";return r===l.charCodeAt(a++)?(e.consume(r),a===l.length)?s.interrupt?t:N:p:n(r)}function h(t){return eD(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||eq(a)){let o=47===a,c=i.toLowerCase();return!o&&!l&&tk.includes(c)?(r=1,s.interrupt?t(a):N(a)):tw.includes(i.toLowerCase())?(r=6,o)?(e.consume(a),m):s.interrupt?t(a):N(a):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(a):l?function t(n){return eV(n)?(e.consume(n),t):k(n)}(a):x(a))}return 45===a||e_(a)?(e.consume(a),i+=String.fromCharCode(a),f):n(a)}function m(r){return 62===r?(e.consume(r),s.interrupt?t:N):n(r)}function x(t){return 47===t?(e.consume(t),k):58===t||95===t||eD(t)?(e.consume(t),g):eV(t)?(e.consume(t),x):k(t)}function g(t){return 45===t||46===t||58===t||95===t||e_(t)?(e.consume(t),g):b(t)}function b(t){return 61===t?(e.consume(t),y):eV(t)?(e.consume(t),b):x(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,v):eV(t)?(e.consume(t),y):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||eq(n)?b(n):(e.consume(n),t)}(t)}function v(t){return t===o?(e.consume(t),o=null,w):null===t||eH(t)?n(t):(e.consume(t),v)}function w(e){return 47===e||62===e||eV(e)?x(e):n(e)}function k(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||eH(t)?N(t):eV(t)?(e.consume(t),j):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),A):60===t&&1===r?(e.consume(t),T):62===t&&4===r?(e.consume(t),P):63===t&&3===r?(e.consume(t),O):93===t&&5===r?(e.consume(t),R):eH(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(tj,M,S)(t)):null===t||eH(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),N)}function S(t){return e.check(tN,C,M)(t)}function C(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return null===t||eH(t)?S(t):(e.enter("htmlFlowData"),N(t))}function A(t){return 45===t?(e.consume(t),O):N(t)}function T(t){return 47===t?(e.consume(t),i="",I):N(t)}function I(t){if(62===t){let n=i.toLowerCase();return tk.includes(n)?(e.consume(t),P):N(t)}return eD(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),I):N(t)}function R(t){return 93===t?(e.consume(t),O):N(t)}function O(t){return 62===t?(e.consume(t),P):45===t&&2===r?(e.consume(t),O):N(t)}function P(t){return null===t||eH(t)?(e.exit("htmlFlowData"),M(t)):(e.consume(t),P)}function M(n){return e.exit("htmlFlow"),t(n)}}},61:tD,95:tO,96:tp,126:tp},"flowInitial",0,{[-2]:th,[-1]:th,32:th},"insideSpan",0,{null:[tl,e6]},"string",0,{38:tu,92:to},"text",0,{[-5]:tR,[-4]:tR,[-3]:tR,33:tT,38:tu,42:tl,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(t){return eD(t)?(e.consume(t),i):64===t?n(t):o(t)}function i(t){return 43===t||45===t||46===t||e_(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,a):(43===n||45===n||46===n||e_(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function a(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||e$(r)?n(r):(e.consume(r),a)}function o(t){return 64===t?(e.consume(t),s):eL(t)?(e.consume(t),o):n(t)}function s(l){return e_(l)?function l(i){return 46===i?(e.consume(i),r=0,s):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||e_(i))&&r++<63){let n=45===i?t:l;return e.consume(i),n}return n(i)}(i)}(l):n(l)}}},{name:"htmlText",tokenize:function(e,t,n){let r,l,i,a=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),v):63===t?(e.consume(t),b):eD(t)?(e.consume(t),k):n(t)}function s(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),l=0,h):eD(t)?(e.consume(t),g):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):eH(t)?(i=u,I(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?T(e):45===e?d(e):u(e)}function h(t){let r="CDATA[";return t===r.charCodeAt(l++)?(e.consume(t),l===r.length?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):eH(t)?(i=f,I(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),x):f(t)}function x(t){return 62===t?T(t):93===t?(e.consume(t),x):f(t)}function g(t){return null===t||62===t?T(t):eH(t)?(i=g,I(t)):(e.consume(t),g)}function b(t){return null===t?n(t):63===t?(e.consume(t),y):eH(t)?(i=b,I(t)):(e.consume(t),b)}function y(e){return 62===e?T(e):b(e)}function v(t){return eD(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||e_(t)?(e.consume(t),w):function t(n){return eH(n)?(i=t,I(n)):eV(n)?(e.consume(n),t):T(n)}(t)}function k(t){return 45===t||e_(t)?(e.consume(t),k):47===t||62===t||eq(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),T):58===t||95===t||eD(t)?(e.consume(t),N):eH(t)?(i=j,I(t)):eV(t)?(e.consume(t),j):T(t)}function N(t){return 45===t||46===t||58===t||95===t||e_(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),S):eH(n)?(i=t,I(n)):eV(n)?(e.consume(n),t):j(n)}(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,C):eH(t)?(i=S,I(t)):eV(t)?(e.consume(t),S):(e.consume(t),E)}function C(t){return t===r?(e.consume(t),r=void 0,A):null===t?n(t):eH(t)?(i=C,I(t)):(e.consume(t),C)}function E(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||eq(t)?j(t):(e.consume(t),E)}function A(e){return 47===e||62===e||eq(e)?j(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function I(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),R}function R(t){return eV(t)?eQ(e,O,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}}],91:tI,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return eH(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},to],93:tS,95:tl,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=l;++t<r;)if("codeTextData"===e[t][1].type){e[l][1].type="codeTextPadding",e[r][1].type="codeTextPadding",l+=2,r-=2;break}}for(t=l-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,l,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),i++,t):(e.exit("codeTextSequence"),a(n))}(t)};function a(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),a):96===s?(l=e.enter("codeTextSequence"),r=0,function n(a){return 96===a?(e.consume(a),r++,n):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(a)):(l.type="codeTextData",o(a))}(s)):eH(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):(e.enter("codeTextData"),o(s))}function o(t){return null===t||32===t||96===t||eH(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),o)}}}}],4127);var t_=e.i(4127);let tL=/[\0\t\n\r]/g;function t$(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let tU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tz(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return t$(n.slice(t?2:1),t?16:10)}return tc(n)||e}let tB={}.hasOwnProperty;function tH(e){return{line:e.line,column:e.column,offset:e.offset}}function tq(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+ed({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ed({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+ed({start:t.start,end:t.end})+") is still open")}function tV(e){let t=this;t.parser=function(n){var r,l;let i,a,o,s;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(l=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(g),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(h),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:r(h,l),codeText:r(function(){return{type:"inlineCode",value:""}},l),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(x,l),htmlFlowData:c,htmlText:r(x,l),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:l,link:r(g),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(b,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(b),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:a(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:a(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:a(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=t$(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=tc(n);let l=this.stack[this.stack.length-1];l.value+=t},characterReference:function(e){this.stack.pop().position.end=tH(e.end)},codeFenced:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:a(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ty(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:a(),hardBreakEscape:a(d),hardBreakTrailing:a(d),htmlFlow:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:a(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(tU,tz),n.identifier=ty(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=tH(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),u.call(this,e))},link:a(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ty(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:a(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:a(),thematicBreak:a()}};!function e(t,n){let r=-1;for(;++r<n.length;){let l=n[r];Array.isArray(l)?e(t,l):function(e,t){let n;for(n in t)if(tB.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,l)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},a={stack:[r],tokenStack:[],config:t,enter:i,exit:o,buffer:l,resume:s,data:n},c=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?c.push(u):u=function(e,t,n){let r,l,i,a,o=t-1,s=-1,c=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||s||i||(i=o),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=o;for(l=void 0;a--;){let t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;l&&(e[l][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",l=a}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}i&&(!l||i<l)&&(r._spread=!0),r.end=Object.assign({},l?e[l][1].start:t[1].end),e.splice(l||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let l={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=l,e.splice(o,0,["enter",l,t[2]]),o++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),u));for(u=-1;++u<e.length;){let n=t[e[u][0]];tB.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},a),e[u][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||tq).call(a,void 0,e[0])}for(r.position={start:tH(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:tH(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r};function r(e,t){return function(n){i.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function i(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:tH(t.start),end:void 0}}function a(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||tq).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+ed({start:e.start,end:e.end})+"): it’s not open");n.position.end=tH(e.end)}function s(){var e;return e=this.stack.pop(),eR(e,"boolean"!=typeof eI.includeImageAlt||eI.includeImageAlt,"boolean"!=typeof eI.includeHtml||eI.includeHtml)}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:tH(e.start),end:void 0},t.push(n)),this.stack.push(n)}function u(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=tH(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function h(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function x(){return{type:"html",value:""}}function g(){return{type:"link",title:null,url:"",children:[]}}function b(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(l)(function(e){for(;!e2(e););return e}((function(e){let t={constructs:function(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,l=(eF.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];if(i)for(r in i){eF.call(l,r)||(l[r]=[]);let e=i[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);eP(e,0,0,r)}(l[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}([t_,...(e||{}).extensions||[]]),content:n(eK),defined:[],document:n(eY),flow:n(e3),lazy:{},string:n(e9),text:n(e7)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},l={},i=[],a=[],o=[],s={attempt:f(function(e,t){m(e,t.from)}),check:f(h),consume:function(e){eH(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,x()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:f(h,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){l[e.line]=e.column,x()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,l=[];for(;++r<e.length;){let i,a=e[r];if("string"==typeof a)i=a;else switch(a){case -5:i="\r";break;case -4:i="\n";break;case -3:i="\r\n";break;case -2:i=t?" ":" ";break;case -1:if(!t&&n)continue;i=" ";break;default:i=String.fromCharCode(a)}n=-2===a,l.push(i)}return l.join("")}(d(e),t)},sliceStream:d,write:function(e){return(a=eM(a,e),function(){let e;for(;r._index<a.length;){let n=a[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),u=u(t)}else u=u(n)}}(),null!==a[a.length-1])?[]:(m(t,0),c.events=tr(i,c.events,c),c.events)}},u=t.tokenize.call(c,s);return t.resolveAll&&i.push(t),c;function d(e){return function(e,t){let n,r=t.start._index,l=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;if(r===i)n=[e[r].slice(l,a)];else{if(n=e.slice(r,i),l>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(l):n.shift()}a>0&&n.push(e[i].slice(0,a))}return n}(a,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:l,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:l,offset:i}}function h(e,t){t.restore()}function f(e,t){return function(n,l,i){var a;let u,d,h,f;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(a=n,function(e){let t=null!==e&&a[e],n=null!==e&&a.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(u=e,d=0,0===e.length)?i:g(e[d])}function g(e){return function(n){let l,i,a,u,d;return(l=p(),i=c.previous,a=c.currentConstruct,u=c.events.length,d=Array.from(o),f={from:u,restore:function(){r=l,c.previous=i,c.currentConstruct=a,c.events.length=u,o=d,x()}},h=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?y(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,s,b,y)(n)}}function b(t){return e(h,f),l}function y(e){return(f.restore(),++d<u.length)?g(u[d]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&eP(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function x(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}(t,e,n)}}})(l).document().write((a=1,o="",s=!0,function(e,t,n){let r,l,c,u,d,p=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,o="",s&&(65279===e.charCodeAt(0)&&c++,s=void 0);c<e.length;){if(tL.lastIndex=c,u=(r=tL.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(u),!r){o=e.slice(c);break}if(10===d&&c===u&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),c<u&&(p.push(e.slice(c,u)),a+=u-c),d){case 0:p.push(65533),a++;break;case 9:for(l=4*Math.ceil(a/4),p.push(-2);a++<l;)p.push(-1);break;case 10:p.push(-4),a=1;break;default:i=!0,a=1}c=u+1}return n&&(i&&p.push(-5),o&&p.push(o),p.push(null)),p})(n,r,!0))))}}let tW="object"==typeof self?self:globalThis,tG=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=l=>{if(t.has(l))return t.get(l);let[i,a]=e[l];switch(i){case 0:case -1:return n(a,l);case 1:{let e=n([],l);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},l);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),l);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),l)}case 5:{let e=n(new Map,l);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,l);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new tW[e](t),l)}case 8:return n(BigInt(a),l);case"BigInt":return n(Object(BigInt(a)),l);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new tW[i](a),l)})(0)},{toString:tJ}={},{keys:tQ}=Object,tK=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=tJ.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},tY=([e,t])=>0===e&&("function"===t||"symbol"===t),tX=(e,{json:t,lossy:n}={})=>{var r,l,i;let a,o,s=[];return(r=!(t||n),l=!!t,i=new Map,a=(e,t)=>{let n=s.push(e)-1;return i.set(t,n),n},o=e=>{if(i.has(e))return i.get(e);let[t,n]=tK(e);switch(t){case 0:{let l=e;switch(n){case"bigint":t=8,l=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);l=null;break;case"undefined":return a([-1],e)}return a([t,l],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),a([n,[...t]],e)}let r=[],l=a([t,r],e);for(let t of e)r.push(o(t));return l}case 2:{if(n)switch(n){case"BigInt":return a([n,e.toString()],e);case"Boolean":case"Number":case"String":return a([n,e.valueOf()],e)}if(l&&"toJSON"in e)return o(e.toJSON());let i=[],s=a([t,i],e);for(let t of tQ(e))(r||!tY(tK(e[t])))&&i.push([o(t),o(e[t])]);return s}case 3:return a([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return a([t,{source:n,flags:r}],e)}case 5:{let n=[],l=a([t,n],e);for(let[t,l]of e)(r||!(tY(tK(t))||tY(tK(l))))&&n.push([o(t),o(l)]);return l}case 6:{let n=[],l=a([t,n],e);for(let t of e)(r||!tY(tK(t)))&&n.push(o(t));return l}}let{message:s}=e;return a([t,{name:n,message:s}],e)})(e),s},tZ="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?tG(tX(e,t)):structuredClone(e):(e,t)=>tG(tX(e,t));function t0(e){let t=[],n=-1,r=0,l=0;for(;++n<e.length;){let i=e.charCodeAt(n),a="";if(37===i&&e_(e.charCodeAt(n+1))&&e_(e.charCodeAt(n+2)))l=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),l=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+l+1,a=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function t1(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function t2(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let t5=function(e){var t,n;if(null==e)return t3;if("function"==typeof e)return t4(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=t5(e[n]);return t4(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,t4(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,t4(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function t4(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function t3(){return!0}let t6=[];function t9(e,t,n,r){var l,i,a;let o,s,c,u,d,p;"function"==typeof t&&"function"!=typeof n?(s=void 0,c=t,o=n):(s=t,c=n,o=r),l=s,i=function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return c(e,r,n)},a=o,"function"==typeof l&&"function"!=typeof i?(a=i,i=l):u=l,d=t5(u),p=a?-1:1,(function e(t,n,r){let o=t&&"object"==typeof t?t:{};if("string"==typeof o.type){let e="string"==typeof o.tagName?o.tagName:"string"==typeof o.name?o.name:void 0;Object.defineProperty(s,"name",{value:"node ("+t.type+(e?"<"+e+">":"")+")"})}return s;function s(){var o;let s,c,u,h=t6;if((!l||d(t,n,r[r.length-1]||void 0))&&!1===(h=Array.isArray(o=i(t,r))?o:"number"==typeof o?[!0,o]:null==o?t6:[o])[0])return h;if("children"in t&&t.children&&t.children&&"skip"!==h[0])for(c=(a?t.children.length:-1)+p,u=r.concat(t);c>-1&&c<t.children.length;){if(!1===(s=e(t.children[c],c,u)())[0])return s;c="number"==typeof s[1]?s[1]:c+p}return h}})(e,void 0,[])()}function t7(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let l=e.all(t),i=l[0];i&&"text"===i.type?i.value="["+i.value:l.unshift({type:"text",value:"["});let a=l[l.length-1];return a&&"text"===a.type?a.value+=r:l.push({type:"text",value:r}),l}function t8(e){let t=e.spread;return null==t?e.children.length>1:t}function ne(e,t,n){let r=0,l=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(l-1);for(;9===t||32===t;)l--,t=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let nt={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(r.className=["language-"+l[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i={type:"element",tagName:"pre",properties:{},children:[i=e.applyData(t,i)]},e.patch(t,i),i},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),i=t0(l.toLowerCase()),a=e.footnoteOrder.indexOf(l),o=e.footnoteCounts.get(l);void 0===o?(o=0,e.footnoteOrder.push(l),n=e.footnoteOrder.length):n=a+1,o+=1,e.footnoteCounts.set(l,o);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return t7(e,t);let l={src:t0(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let n={src:t0(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return t7(e,t);let l={href:t0(r.url||"")};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let n={href:t0(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),l=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=t8(n[r])}return t}(n):t8(t),i={},a=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(l||0!==o||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||l?a.push(e):a.push(...e.children)}let s=r[r.length-1];s&&(l||"element"!==s.type||"p"!==s.tagName)&&a.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let n={},r=e.all(t),l=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++l<r.length;){let e=r[l];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),l=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),l.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=ec(t.children[1]),a=es(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),l.push(r)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,l=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length,o=-1,s=[];for(;++o<a;){let n=t.children[o],r={},a=i?i[o]:void 0;a&&(r.align=a);let c={type:"element",tagName:l,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),s.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),l=0,i=[];for(;r;)i.push(ne(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return i.push(ne(t.slice(l),l>0,!1)),i.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:nn,yaml:nn,definition:nn,footnoteDefinition:nn};function nn(){}let nr={}.hasOwnProperty,nl={};function ni(e,t){e.position&&(t.position=function(e){let t=ec(e),n=es(e);if(t&&n)return{start:t,end:n}}(e))}function na(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,l=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&l&&Object.assign(n.properties,tZ(l)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function no(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function ns(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function nc(e,t){let n,r,l,i,a=(n=t||nl,r=new Map,l=new Map,i={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let l=i.one(n[r],e);if(l){if(r&&"break"===n[r-1].type&&(Array.isArray(l)||"text"!==l.type||(l.value=ns(l.value)),!Array.isArray(l)&&"element"===l.type)){let e=l.children[0];e&&"text"===e.type&&(e.value=ns(e.value))}Array.isArray(l)?t.push(...l):t.push(l)}}}return t},applyData:na,definitionById:r,footnoteById:l,footnoteCounts:new Map,footnoteOrder:[],handlers:{...nt,...n.handlers},one:function(e,t){let n=e.type,r=i.handlers[n];if(nr.call(i.handlers,n)&&r)return r(i,e,t);if(i.options.passThrough&&i.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=tZ(n);return r.children=i.all(e),r}return tZ(e)}return(i.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(nr.call(n,"hProperties")||nr.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(i,e,t)},options:n,patch:ni,wrap:no},t9(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:l,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),i),o=a.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||t1,r=e.options.footnoteBackLabel||t2,l=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],s=-1;for(;++s<e.footnoteOrder.length;){let l=e.footnoteById.get(e.footnoteOrder[s]);if(!l)continue;let i=e.all(l),a=String(l.identifier).toUpperCase(),c=t0(a.toLowerCase()),u=0,d=[],p=e.footnoteCounts.get(a);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(l,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...tZ(a),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(a),c=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return s&&(v("children"in c),c.children.push({type:"text",value:"\n"},s)),c}function nu(e,t){return e&&"run"in e?async function(n,r){let l=nc(n,{file:r,...t});await e.run(l,r)}:function(n,r){return nc(n,{file:r,...e||t})}}function nd(e){if(e)throw e}var np=e.i(4100);function nh(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let nf=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');nb(e);let r=0,l=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else l<0&&(n=!0,l=i+1);return l<0?"":e.slice(r,l)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(l=i):(o=-1,l=a));return r===l?l=a:l<0&&(l=e.length),e.slice(r,l)},nm=function(e){let t;if(nb(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},nx=function(e){let t;nb(e);let n=e.length,r=-1,l=0,i=-1,a=0;for(;n--;){let o=e.codePointAt(n);if(47===o){if(t){l=n+1;break}continue}r<0&&(t=!0,r=n+1),46===o?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1)}return i<0||r<0||0===a||1===a&&i===r-1&&i===l+1?"":e.slice(i,r)},ng=function(...e){var t;let n,r,l,i=-1;for(;++i<e.length;)nb(e[i]),e[i]&&(l=void 0===l?e[i]:l+"/"+e[i]);return void 0===l?".":(nb(t=l),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,l="",i=0,a=-1,o=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(a===s-1||1===o);else if(a!==s-1&&2===o){if(l.length<2||2!==i||46!==l.codePointAt(l.length-1)||46!==l.codePointAt(l.length-2)){if(l.length>2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",i=0):i=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),a=s,o=0;continue}}else if(l.length>0){l="",i=0,a=s,o=0;continue}}t&&(l=l.length>0?l+"/..":"..",i=2)}else l.length>0?l+="/"+e.slice(a+1,s):l=e.slice(a+1,s),i=s-a-1;a=s,o=0}else 46===n&&o>-1?o++:o=-1}return l}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function nb(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function ny(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let nv=["history","path","basename","stem","extname","dirname"];class nw{constructor(e){let t,n;t=e?ny(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<nv.length;){const e=nv[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)nv.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?nf(this.path):void 0}set basename(e){nj(e,"basename"),nk(e,"basename"),this.path=ng(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?nm(this.path):void 0}set dirname(e){nN(this.basename,"dirname"),this.path=ng(e||"",this.basename)}get extname(){return"string"==typeof this.path?nx(this.path):void 0}set extname(e){if(nk(e,"extname"),nN(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=ng(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){ny(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!ny(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),nj(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?nf(this.path,this.extname):void 0}set stem(e){nj(e,"stem"),nk(e,"stem"),this.path=ng(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new em(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function nk(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function nj(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function nN(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let nS=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},nC={}.hasOwnProperty;class nE extends nS{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function l(i,...a){let o=e[++n],s=-1;if(i)return void r(i);for(;++s<t.length;)(null===a[s]||void 0===a[s])&&(a[s]=t[s]);t=a,o?(function(e,t){let n;return function(...t){let i,a=e.length>t.length;a&&t.push(r);try{i=e.apply(this,t)}catch(e){if(a&&n)throw e;return r(e)}a||(i&&i.then&&"function"==typeof i.then?i.then(l,r):i instanceof Error?r(i):l(i))};function r(e,...l){n||(n=!0,t(e,...l))}function l(e){r(null,e)}})(o,l)(...a):r(null,...a)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new nE,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,np.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(nR("data",this.frozen),this.namespace[e]=t,this):nC.call(this.namespace,e)&&this.namespace[e]||void 0:e?(nR("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=nM(e),n=this.parser||this.Parser;return nT("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),nT("process",this.parser||this.Parser),nI("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,l){let i=nM(e),a=n.parse(i);function o(e,n){e||!n?l(e):r?r(n):(v(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(a,i,function(e,t,r){var l,i;if(e||!t||!r)return o(e);let a=n.stringify(t,r);"string"==typeof(l=a)||(i=l)&&"object"==typeof i&&"byteLength"in i&&"byteOffset"in i?r.value=a:r.result=a,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),nT("processSync",this.parser||this.Parser),nI("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,nd(e),t=r}),nP("processSync","process",n),v(t,"we either bailed on an error or have a tree"),t}run(e,t,n){nO(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?l(void 0,n):new Promise(l);function l(l,i){v("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let a=nM(t);r.run(e,a,function(t,r,a){let o=r||e;t?i(t):l?l(o):(v(n,"`done` is defined if `resolve` is not"),n(void 0,o,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){nd(e),n=t,r=!0}),nP("runSync","run",r),v(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=nM(t),r=this.compiler||this.Compiler;return nI("stringify",r),nO(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(nR("use",this.frozen),null==e);else if("function"==typeof e)a(e,t);else if("object"==typeof e)Array.isArray(e)?i(e):l(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function l(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");i(e.plugins),e.settings&&(r.settings=(0,np.default)(!0,r.settings,e.settings))}function i(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)a(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;a(t,n)}else l(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function a(e,t){let r=-1,l=-1;for(;++r<n.length;)if(n[r][0]===e){l=r;break}if(-1===l)n.push([e,...t]);else if(t.length>0){let[r,...i]=t,a=n[l][1];nh(a)&&nh(r)&&(r=(0,np.default)(!0,a,r)),n[l]=[e,r,...i]}}}}let nA=new nE().freeze();function nT(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function nI(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function nR(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function nO(e){if(!nh(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function nP(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function nM(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new nw(e)}let nF=[],nD={allowDangerousHtml:!0},n_=/^(https?|ircs?|mailto|xmpp)$/i,nL=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function n$(e){var n;let r,l,i,a,o,s=(r=(n=e).rehypePlugins||nF,l=n.remarkPlugins||nF,i=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...nD}:nD,nA().use(tV).use(l).use(nu,i).use(r)),c=(a=e.children||"",o=new nw,"string"==typeof a?o.value=a:w("Unexpected value `"+a+"` for `children` prop, expected `string`"),o);return function(e,n){let r=n.allowedElements,l=n.allowElement,i=n.components,a=n.disallowedElements,o=n.skipHtml,s=n.unwrapDisallowed,c=n.urlTransform||nU;for(let e of nL)Object.hasOwn(n,e.from)&&w("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&a&&w("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),t9(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return o?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in eT)if(Object.hasOwn(eT,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=eT[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=c(String(n||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!a&&a.includes(e.tagName);if(!i&&l&&"number"==typeof t&&(i=!l(e,t,n)),i&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,l,i;let a;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=o,r=t.jsxDEV,a=function(e,t,l,i){let a=Array.isArray(l.children),o=ec(e);return r(t,l,i,a,{columnNumber:o?o.column-1:void 0,fileName:n,lineNumber:o?o.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");l=t.jsx,i=t.jsxs,a=function(e,t,n,r){let a=Array.isArray(n.children)?i:l;return r?a(t,n,r):a(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?ea:ei,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},c=ek(s,e,void 0);return c&&"string"!=typeof c?c:s.create(e,s.Fragment,{children:c||void 0},void 0)}(e,{Fragment:t.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(c),c),e)}function nU(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),l=e.indexOf("/");return -1===t||-1!==l&&t>l||-1!==n&&t>n||-1!==r&&t>r||n_.test(e.slice(0,t))?e:""}function nz({projectId:e,startInEditMode:r=!1}){let[l,i]=(0,n.useState)(""),[a,o]=(0,n.useState)(null),[s,c]=(0,n.useState)(r),[u,d]=(0,n.useState)(""),[p,h]=(0,n.useState)(!1),[f,m]=(0,n.useState)(null),x=(0,n.useRef)(!1);x.current=s;let g=(0,n.useRef)(r),b=(0,n.useCallback)(async()=>{try{let t=await fetch(`/api/queue?project=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`${t.status}`);let n=await t.json();o(!!n.exists),x.current||i(n.content||""),g.current&&(d(n.content||""),g.current=!1),m(null)}catch(e){m(e.message)}},[e]);(0,n.useEffect)(()=>{b();let e=setInterval(b,1e4);return()=>clearInterval(e)},[b]);let y=async()=>{h(!0),m(null);try{let t=await fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:u})});if(!t.ok)throw Error(`${t.status}`);i(u),c(!1)}catch(e){m(e.message)}finally{h(!1)}},v=async()=>{h(!0);try{let t=await fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"POST"});if(!t.ok)throw Error(`${t.status}`);await b()}catch(e){m(e.message)}finally{h(!1)}};return(0,t.jsxs)("div",{className:"flex flex-col h-full min-h-0 border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"OVERNIGHT-QUEUE.md"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[f&&(0,t.jsxs)("span",{className:"text-[10px] text-error",children:["err: ",f]}),!s&&a&&(0,t.jsx)("button",{onClick:()=>{d(l),c(!0)},className:"text-[10px] text-text-muted hover:text-accent uppercase tracking-wider",children:"Edit"}),s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:y,disabled:p,className:"text-[10px] text-accent hover:text-accent-dim uppercase tracking-wider disabled:opacity-50",children:p?"Saving…":"Save"}),(0,t.jsx)("button",{onClick:()=>{c(!1),d(""),b()},disabled:p,className:"text-[10px] text-text-muted hover:text-text uppercase tracking-wider disabled:opacity-50",children:"Cancel"})]})]})]}),s&&(0,t.jsx)("div",{className:"shrink-0 px-3 py-1.5 border-b border-border bg-bg-surface text-[10px] text-text-muted leading-snug",children:"⚠️ Editing manually may conflict with the Head agent. Use the chat panel to ask Head to update the queue when possible."}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:!1===a?(0,t.jsxs)("div",{className:"p-3 text-[11px] text-text-muted",children:[(0,t.jsx)("p",{className:"mb-2",children:"No OVERNIGHT-QUEUE.md for this project yet."}),(0,t.jsx)("button",{onClick:v,disabled:p,className:"px-2 py-1 border border-border hover:border-accent hover:text-accent text-[11px] disabled:opacity-50",children:"Create OVERNIGHT-QUEUE.md from template"})]}):s?(0,t.jsx)("textarea",{value:u,onChange:e=>d(e.target.value),spellCheck:!1,className:"w-full h-full p-3 bg-bg text-text text-[11px] font-mono resize-none outline-none"}):(0,t.jsx)("div",{className:"p-3 text-[12px] text-text prose prose-invert prose-sm max-w-none [&_h1]:text-[14px] [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mb-2 [&_h2]:text-[13px] [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1.5 [&_h3]:text-[12px] [&_h3]:font-semibold [&_h3]:mt-2 [&_h3]:mb-1 [&_p]:my-1.5 [&_ul]:my-1.5 [&_ul]:pl-4 [&_ul]:list-disc [&_ol]:my-1.5 [&_ol]:pl-4 [&_ol]:list-decimal [&_li]:my-0.5 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-2 [&_blockquote]:text-text-muted [&_hr]:my-3 [&_hr]:border-border [&_code]:bg-bg-surface [&_code]:px-1 [&_code]:rounded [&_code]:text-[11px] [&_strong]:text-text [&_a]:text-accent [&_a]:underline",children:(0,t.jsx)(n$,{children:l})})})]})}function nB({open:e,projectId:r,onClose:l}){return((0,n.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&l()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,l]),e)?(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:l,role:"dialog","aria-modal":"true","aria-labelledby":"queue-modal-title",children:(0,t.jsxs)("div",{className:"relative mx-4 w-full max-w-3xl h-[80vh] flex flex-col rounded-lg border border-white/10 bg-neutral-950 shadow-2xl overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-white/10",children:[(0,t.jsx)("h2",{id:"queue-modal-title",className:"text-[12px] font-semibold text-white",children:"OVERNIGHT-QUEUE.md"}),(0,t.jsx)("button",{type:"button",onClick:l,"aria-label":"Close",className:"rounded p-1 text-neutral-400 hover:bg-white/5 hover:text-white",children:(0,t.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,t.jsx)("path",{d:"M4 4l12 12M16 4L4 16",strokeLinecap:"round"})})})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:(0,t.jsx)(nz,{projectId:r,startInEditMode:!0})})]})}):null}let nH={en:{loading:"Loading batch progress…",currentBatchNone:"Current Batch: (none)",noActiveBatch:"No active batch. Ask Head to start one via the chat.",currentBatch:e=>`Current Batch: Batch ${e}`,complete:"✅ COMPLETE",allMerged:e=>`All ${e} items merged. Waiting for the next batch.`,itemsCount:e=>`(${e} items)`,tooltip:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Current Batch"}),"— progress tracker for the active batch. Polls GitHub to resolve each issue's status (queued → in review → approved → merged)."]})},ko:{loading:"배치 진행 상황 로딩 중...",currentBatchNone:"현재 배치: (없음)",noActiveBatch:"활성 배치가 없습니다. 채팅에서 Head에게 시작을 요청하세요.",currentBatch:e=>`현재 배치: ${e}번`,complete:"✅ 완료",allMerged:e=>`${e}개 항목 모두 병합됨. 다음 배치를 기다리는 중.`,itemsCount:e=>`(${e}개 항목)`,tooltip:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"현재 배치"})," - 활성 배치 진행 상황 추적기입니다. GitHub를 조회해 각 이슈 상태를 대기 → 검토 중 → 승인 → 병합 순으로 추적합니다."]})}};function nq({percent:e}){let n=Math.round(e/100*20);return(0,t.jsxs)("span",{className:"font-mono text-[11px] tabular-nums whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-accent",children:"█".repeat(n)}),(0,t.jsx)("span",{className:"text-text-muted",children:"░".repeat(20-n)})]})}function nV({projectId:e}){let{locale:r}=(0,a.useLocale)(),i=nH[r],[o,s]=(0,n.useState)(null),c=(0,n.useCallback)(()=>{fetch(`/api/batch-progress?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{e&&s(e)}).catch(()=>{})},[e]);return((0,n.useEffect)(()=>{c();let e=setInterval(c,3e4);return()=>clearInterval(e)},[c]),o)?o.items&&0!==o.items.length?o.complete?(0,t.jsxs)("div",{className:"border-t border-border",children:[(0,t.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.currentBatch(o.batch_number??"—")}),(0,t.jsx)("span",{className:"text-[10px] text-accent",children:i.complete})]}),(0,t.jsx)("div",{className:"px-3 pb-2 text-[11px] text-text-muted",children:i.allMerged(o.items.length)})]}):(0,t.jsxs)("div",{className:"border-t border-border",children:[(0,t.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-2 border-b border-border/40",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.currentBatch(o.batch_number??"—")}),(0,t.jsx)("span",{className:"text-[10px] text-text-muted",children:i.itemsCount(o.items.length)}),(0,t.jsx)(l.default,{children:i.tooltip})]}),(0,t.jsx)("div",{className:"max-h-40 overflow-y-auto",children:o.items.map(e=>{let n=(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1 font-mono",children:[(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0 tabular-nums",children:["#",e.issue_number]}),(0,t.jsx)(nq,{percent:e.progress}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted tabular-nums shrink-0 w-9 text-right",children:[e.progress,"%"]}),(0,t.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.label})]});return e.url?(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block hover:bg-[#1a1a1a] transition-colors border-b border-border/30",children:n},e.issue_number):(0,t.jsx)("div",{children:n},e.issue_number)})}),o.summary&&(0,t.jsx)("div",{className:"px-3 py-1.5 text-[11px] text-text-muted border-t border-border/40",children:o.summary})]}):(0,t.jsxs)("div",{className:"border-t border-border",children:[(0,t.jsx)("div",{className:"px-3 py-1.5 flex items-center gap-2",children:(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.currentBatchNone})}),(0,t.jsx)("div",{className:"px-3 pb-2 text-[11px] text-text-muted",children:i.noActiveBatch})]}):(0,t.jsx)("div",{className:"px-3 py-1.5 text-[11px] text-text-muted border-t border-border",children:i.loading})}let nW={en:{rateLimitCritical:e=>`GitHub Rate Limit CRITICAL: 0 remaining. Resets in ${e}m.`,rateLimitLow:(e,t,n)=>`GitHub Rate Limit LOW: ${e}/${t} remaining. Resets in ${n}m.`,issues:e=>`Issues (${e})`,issuesHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Issues"})," — open issues in this repository. Agents will pick these up automatically if they are part of the overnight queue."]}),noIssues:"No open issues.",recentlyClosed:"Recently closed",noneYet:"None yet.",prs:e=>`Pull Requests (${e})`,prsHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Pull Requests"})," — active PRs in this repository. Shows review status from RE1/RE2 and CI status."]}),noPrs:"No active PRs.",recentlyMerged:"Recently merged / closed",overnightQueueHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"OVERNIGHT-QUEUE.md"})," — a list of issue numbers (one per line) for agents to process autonomously. Edit this file to add or remove tasks from the queue."]}),edit:"Edit"},ko:{rateLimitCritical:e=>`GitHub API 제한 위험: 잔여 0개. ${e}분 후 초기화됩니다.`,rateLimitLow:(e,t,n)=>`GitHub API 제한 낮음: ${e}/${t} 남음. ${n}분 후 초기화됩니다.`,issues:e=>`이슈 (${e})`,issuesHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"이슈"})," - 이 저장소의 열려 있는 이슈들입니다. 야간 큐에 포함되면 에이전트가 자동으로 작업을 시작합니다."]}),noIssues:"열린 이슈가 없습니다.",recentlyClosed:"최근 닫힌 이슈",noneYet:"아직 없습니다.",prs:e=>`풀 리퀘스트 (${e})`,prsHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"풀 리퀘스트"})," - 이 저장소의 활성화된 PR들입니다. RE1/RE2의 리뷰 상태와 CI 상태를 보여줍니다."]}),noPrs:"활성 PR이 없습니다.",recentlyMerged:"최근 머지/닫힘",overnightQueueHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"OVERNIGHT-QUEUE.md"})," - 에이전트가 자율적으로 처리할 이슈 번호 목록(한 줄에 하나씩)입니다. 이 파일을 편집하여 큐에 작업을 추가하거나 제거할 수 있습니다."]}),edit:"편집"}};function nG({color:e}){return(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${e}`})}function nJ({projectId:e}){let{locale:r}=(0,a.useLocale)(),i=nW[r],[o,s]=(0,n.useState)([]),[c,u]=(0,n.useState)([]),[d,p]=(0,n.useState)([]),[h,f]=(0,n.useState)([]),[m,x]=(0,n.useState)(!1),[g,b]=(0,n.useState)(null);(0,n.useEffect)(()=>{let t=!1;return fetch(`/api/queue?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(n=>{if(!t&&n&&!n.exists)return fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"POST"})}).catch(()=>{}),()=>{t=!0}},[e]);let y=(0,n.useCallback)(()=>{fetch(`/api/github/issues?project=${encodeURIComponent(e)}`).then(e=>{if(!e.ok)throw Error(`${e.status}`);return e.json()}).then(e=>{Array.isArray(e)&&s(e)}).catch(()=>{}),fetch(`/api/github/prs?project=${encodeURIComponent(e)}`).then(e=>{if(!e.ok)throw Error(`${e.status}`);return e.json()}).then(e=>{Array.isArray(e)&&u(e)}).catch(()=>{}),fetch(`/api/github/closed-issues?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{Array.isArray(e)&&p(e)}).catch(()=>{}),fetch(`/api/github/merged-prs?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{Array.isArray(e)&&f(e)}).catch(()=>{})},[e]);return(0,n.useEffect)(()=>{let e=()=>{fetch("/api/github/rate-limit").then(e=>e.ok?e.json():null).then(e=>{e&&b(e)}).catch(()=>{})};e();let t=setInterval(e,6e4);return()=>clearInterval(t)},[]),(0,n.useEffect)(()=>{y();let e=setInterval(y,6e4);return()=>clearInterval(e)},[y]),(0,t.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[g&&(g.critical||g.low)&&(0,t.jsx)("div",{className:`px-3 py-1 text-[10px] shrink-0 ${g.critical?"bg-error/20 text-error":"bg-[#ffcc00]/20 text-[#ffcc00]"}`,children:g.critical?i.rateLimitCritical(g.resetInMinutes):i.rateLimitLow(g.remaining,g.limit,g.resetInMinutes)}),(0,t.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col lg:flex-row",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col border-b lg:border-b-0 lg:border-r border-border",children:[(0,t.jsxs)("div",{className:"px-3 py-1.5 border-b border-border shrink-0 flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.issues(o.length)}),(0,t.jsx)(l.default,{children:i.issuesHelp})]}),(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[0===o.length&&(0,t.jsx)("div",{className:"px-3 py-2 text-[11px] text-text-muted",children:i.noIssues}),o.map(e=>(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1 font-mono hover:bg-[#1a1a1a] transition-colors cursor-pointer border-b border-border/50",children:[(0,t.jsx)(nG,{color:"OPEN"===e.state?"bg-accent":"bg-error"}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,t.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.title}),e.assignees?.[0]&&(0,t.jsx)("span",{className:"text-[10px] text-text-muted shrink-0",children:e.assignees[0].login})]},e.number)),(0,t.jsx)("div",{className:"px-3 pt-2 pb-1 text-[9px] text-text-muted uppercase tracking-wider",children:i.recentlyClosed}),0===d.length&&(0,t.jsx)("div",{className:"px-3 py-1 text-[11px] text-text-muted",children:i.noneYet}),d.map(e=>(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1 font-mono opacity-60 hover:opacity-100 hover:bg-[#1a1a1a] transition-all cursor-pointer border-b border-border/30",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:"✓"}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted truncate flex-1 min-w-0",children:e.title})]},`closed-${e.number}`))]})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,t.jsxs)("div",{className:"px-3 py-1.5 border-b border-border shrink-0 flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:i.prs(c.length)}),(0,t.jsx)(l.default,{children:i.prsHelp})]}),(0,t.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[0===c.length&&(0,t.jsx)("div",{className:"px-3 py-2 text-[11px] text-text-muted",children:i.noPrs}),c.map(e=>{let n=e.reviews||[],r=e.reviewDecision||"REVIEW_REQUIRED",l={};for(let e of n){let t=(e.body||"").trim();/^(?:RE2|Reviewer2|T2b)\b/i.test(t)?l.re2=e.state:(/^(?:RE1|Reviewer1|T2a)\b/i.test(t)||/^##\s*Verdict/i.test(t))&&(l.re1=e.state)}return(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1 font-mono hover:bg-[#1a1a1a] transition-colors cursor-pointer border-b border-border/50",children:[(0,t.jsx)(nG,{color:"APPROVED"===r?"bg-accent":"CHANGES_REQUESTED"===r?"bg-error":"bg-[#ffcc00]"}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,t.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.title}),e.assignees?.[0]&&(0,t.jsx)("span",{className:"text-[10px] text-text-muted shrink-0",children:e.assignees[0].login}),["re1","re2"].map(e=>{let n=l[e];return(0,t.jsxs)("span",{className:`text-[10px] shrink-0 ${n?"APPROVED"===n?"text-accent":"CHANGES_REQUESTED"===n?"text-error":"text-[#ffcc00]":"text-text-muted"}`,children:[e,":",n?"APPROVED"===n?"ok":"CHANGES_REQUESTED"===n?"chg":"rev":"—"]},e)}),(0,t.jsx)("span",{className:`text-[10px] shrink-0 ${function(e){if(!e||0===e.length)return"text-text-muted";let t=e.map(e=>e.state);return t.every(e=>"SUCCESS"===e)?"text-accent":t.some(e=>"FAILURE"===e||"ERROR"===e)?"text-error":"text-[#ffcc00]"}(e.statusCheckRollup)}`,children:function(e){if(!e||0===e.length)return"—";let t=e.map(e=>e.state);return t.every(e=>"SUCCESS"===e)?"pass":t.some(e=>"FAILURE"===e||"ERROR"===e)?"fail":"run"}(e.statusCheckRollup)})]},e.number)}),(0,t.jsx)("div",{className:"px-3 pt-2 pb-1 text-[9px] text-text-muted uppercase tracking-wider",children:i.recentlyMerged}),0===h.length&&(0,t.jsx)("div",{className:"px-3 py-1 text-[11px] text-text-muted",children:i.noneYet}),h.map(e=>(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1 font-mono opacity-60 hover:opacity-100 hover:bg-[#1a1a1a] transition-all cursor-pointer border-b border-border/30",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:"✓"}),(0,t.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,t.jsx)("span",{className:"text-[11px] text-text-muted truncate flex-1 min-w-0",children:e.title})]},`merged-${e.number}`))]})]})]}),(0,t.jsx)("div",{className:"shrink-0",children:(0,t.jsx)(nV,{projectId:e})}),(0,t.jsxs)("div",{className:"shrink-0 flex items-center justify-between px-3 py-1.5 border-t border-border",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted font-mono",children:"OVERNIGHT-QUEUE.md"}),(0,t.jsx)(l.default,{position:"above",children:i.overnightQueueHelp})]}),(0,t.jsx)("button",{onClick:()=>x(!0),className:"px-2 py-0.5 text-[10px] text-text-muted hover:text-accent border border-border hover:border-accent transition-colors uppercase tracking-wider",children:i.edit})]}),(0,t.jsx)(nB,{open:m,projectId:e,onClose:()=>x(!1)})]})}var nQ=e.i(67449);let nK={en:{server:{title:"Server",stop:"Stop",confirmStop:"Confirm Stop?",restart:"Restart",resetAgents:"Reset Agents",healthGaveUp:"AC auto-restart failed 3x — manual restart required",healthRestarted:e=>`AC auto-restarted at ${e}`,stopped:"Stopped",failed:"Failed",error:"Error",acRestarted:e=>`AC restarted (PID: ${e}) — resetting agents...`,acAndAgentsRestarted:e=>`AC + ${e} agent${1!==e?"s":""} restarted`,agentResetFailed:"AC restarted — agent reset failed",resetResult:(e,t)=>`Reset — ${e} of ${t} agent${1!==t?"s":""} restarted`,fullReset:"Full Reset",confirmFullReset:"Reset all projects?",fullResetResult:(e,t,n)=>`Full reset — ${e} project${1!==e?"s":""}, ${t} agent${1!==t?"s":""} (${(n/1e3).toFixed(1)}s)`,fullResetFailed:"Full reset failed",interrupt:"Interrupt",interruptAll:"All agents",interrupted:e=>`Interrupted ${e}`,interruptedAll:e=>`Interrupted ${e} agent${1!==e?"s":""}`},system:{keepAwake:"Keep Mac Awake",keepAwakeAbout:"About Keep Mac Awake",keepAwakeHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Keep Mac Awake"})," runs macOS ",(0,t.jsx)("code",{children:"caffeinate"})," to stop the screen, disk, and system idle timers from sleeping your Mac during an overnight run. Make sure the laptop is plugged in — caffeinate blocks sleep but not battery drain."]}),autoAwakeOn:"Auto-awake ON: caffeinate starts/stops with batch lifecycle",autoAwakeOff:"Auto-awake OFF: manual Start/Stop only",awakeFor:e=>`Awake for ${e} more — keep Mac plugged in`,awakeIndefinitely:"Awake indefinitely — keep Mac plugged in",awakeDesc:"Prevents your Mac from sleeping during overnight runs.",awake:"Awake",start:"Start",on:"on",sound:"Notification Sound",soundAbout:"About Notification Sound",soundHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Notification Sound"})," plays a brief chime when an agent posts a new message (not your own sends, not system events). Sound choice picks one of the bundled chimes. Background-only mode suppresses the chime while the tab is focused — ding only when you're looking elsewhere. All prefs persist in localStorage."]}),soundDesc:"Plays a chime when an agent posts a new message.",soundLabel:"Sound",soundBgOnly:"Only when tab is in background",awakeStatusActive:"Batch active — auto-started caffeinate.",awakeStatusComplete:"Batch complete — awake paused.",awakeStatusNew:"New batch detected — auto-started caffeinate.",keepAwakeModalTitle:"Keep Awake",keepAwakeModalAbout:"About Keep Awake",keepAwakeModalHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Keep Awake"})," prevents your Mac from sleeping for the duration you set. Use this when you want agents to keep working overnight.",(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"Under the hood, this runs macOS's ",(0,t.jsx)("code",{children:"caffeinate"})," command. While it's active your screen, disk, and system idle timers are all paused — make sure your Mac is ",(0,t.jsx)("b",{children:"plugged in"})," to avoid draining the battery."]}),makeSurePluggedIn:"Make sure Mac is plugged in",for:"for",hours:"hours",untilStopped:"Until stopped (no expiry)"}},ko:{server:{title:"서버",stop:"중지",confirmStop:"정말 중지?",restart:"재시작",resetAgents:"에이전트 초기화",healthGaveUp:"AC 자동 재시작 3회 실패 — 수동 재시작이 필요합니다",healthRestarted:e=>`AC가 ${e}에 자동 재시작되었습니다`,stopped:"중지됨",failed:"실패",error:"오류",acRestarted:e=>`AC 재시작됨 (PID: ${e}) — 에이전트 초기화 중...`,acAndAgentsRestarted:e=>`AC 및 ${e}개 에이전트 재시작됨`,agentResetFailed:"AC 재시작됨 — 에이전트 초기화 실패",resetResult:(e,t)=>`초기화 완료 — ${t}개 중 ${e}개 에이전트 재시작됨`,fullReset:"전체 리셋",confirmFullReset:"모든 프로젝트를 리셋할까요?",fullResetResult:(e,t,n)=>`전체 리셋 완료 — ${e}개 프로젝트, ${t}개 에이전트 (${(n/1e3).toFixed(1)}초)`,fullResetFailed:"전체 리셋 실패",interrupt:"중단",interruptAll:"모든 에이전트",interrupted:e=>`${e} 중단됨`,interruptedAll:e=>`${e}개 에이전트 중단됨`},system:{keepAwake:"Mac 절전 방지",keepAwakeAbout:"Mac 절전 방지 정보",keepAwakeHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Mac 절전 방지"}),"는 macOS의 ",(0,t.jsx)("code",{children:"caffeinate"}),"를 실행해 야간 작업 중 Mac이 절전 상태로 들어가는 것을 막습니다. 충전기를 연결해 두세요. caffeinate는 절전은 막지만 배터리 소모를 막아주지는 않습니다."]}),autoAwakeOn:"자동 절전 방지 켬: 배치 상태에 따라 caffeinate 시작/종료",autoAwakeOff:"자동 절전 방지 끔: 수동 시작/종료만 가능",awakeFor:e=>`앞으로 ${e} 동안 절전 방지 — 전원을 연결해 두세요`,awakeIndefinitely:"무기한 절전 방지 중 — 전원을 연결해 두세요",awakeDesc:"야간 작업 중 Mac이 잠들지 않도록 합니다.",awake:"절전 방지 중",start:"시작",on:"켬",sound:"알림음",soundAbout:"알림음 정보",soundHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"알림음"}),"은 에이전트가 새 메시지를 보낼 때 짧은 알림음을 재생합니다. 내 메시지나 시스템 이벤트에는 울리지 않습니다. 사운드 선택으로 내장 알림음 중 하나를 고를 수 있고, 백그라운드 전용 모드는 탭이 포커스된 동안에는 알림음을 막습니다. 모든 설정은 localStorage에 저장됩니다."]}),soundDesc:"에이전트가 새 메시지를 보낼 때 알림음을 재생합니다.",soundLabel:"알림음",soundBgOnly:"탭이 백그라운드에 있을 때만",awakeStatusActive:"배치 실행 중 — caffeinate를 자동으로 시작했습니다.",awakeStatusComplete:"배치 완료 — 절전 방지를 일시 중단했습니다.",awakeStatusNew:"새 배치 감지 — caffeinate를 자동으로 시작했습니다.",keepAwakeModalTitle:"절전 방지",keepAwakeModalAbout:"절전 방지 정보",keepAwakeModalHelp:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"절전 방지"}),"는 설정한 시간 동안 Mac이 절전 상태로 들어가는 것을 막습니다. 에이전트가 밤새 작업하게 하려면 이 기능을 사용하세요.",(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"내부적으로는 macOS의 ",(0,t.jsx)("code",{children:"caffeinate"})," 명령을 실행합니다. 실행 중에는 화면, 디스크, 시스템 유휴 타이머가 모두 정지됩니다. 배터리 소모를 막으려면 Mac에 ",(0,t.jsx)("b",{children:"전원을 연결"}),"해 두세요."]}),makeSurePluggedIn:"전원을 연결해 두세요",for:"시간:",hours:"시간",untilStopped:"중지할 때까지 (만료 없음)"}}};function nY({projectId:e}){let{locale:r}=(0,a.useLocale)(),l=nK[r].server,[i,o]=(0,n.useState)(null),[s,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(!1),[p,h]=(0,n.useState)(!1),[f,m]=(0,n.useState)(null),[x,g]=(0,n.useState)(!1),[b,y]=(0,n.useState)({}),v=(0,n.useRef)(null);(0,n.useEffect)(()=>{let t=()=>{fetch(`/api/agentchattr/${encodeURIComponent(e)}/health`).then(e=>e.ok?e.json():null).then(e=>{if(!e)return void m(null);if(e.autoRestart?.gaveUp)m(l.healthGaveUp);else if(e.autoRestart?.lastRestart)if(300>Math.round((Date.now()-e.autoRestart.lastRestart)/1e3)){let t=new Date(e.autoRestart.lastRestart).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});m(l.healthRestarted(t))}else m(null);else m(null)}).catch(()=>m(null))};t();let n=setInterval(t,3e4);return()=>clearInterval(n)},[e,l]);let w=["head","dev","re1","re2"];(0,n.useEffect)(()=>{let t=()=>{fetch("/api/agents").then(e=>e.ok?e.json():{}).then(t=>{let n={};for(let r of w){let l=`${e}/${r}`;n[r]=t[l]?.state||"stopped"}y(n)}).catch(()=>{})};t();let n=setInterval(t,5e3);return()=>clearInterval(n)},[e]),(0,n.useEffect)(()=>{if(!x)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[x]);let k=async t=>{g(!1);let n=t?`/api/agents/${encodeURIComponent(e)}/${encodeURIComponent(t)}/interrupt`:`/api/agents/${encodeURIComponent(e)}/interrupt-all`;o("interrupt");try{let e=await fetch(n,{method:"POST"}),r=await e.json();t?c(r.ok?l.interrupted(t):r.error||l.failed):c(r.ok?l.interruptedAll(r.interrupted):r.error||l.failed)}catch{c(l.error)}o(null),j()},j=()=>{setTimeout(()=>c(null),3e3)};(0,n.useEffect)(()=>{if(!u)return;let e=setTimeout(()=>d(!1),4e3);return()=>clearTimeout(e)},[u]),(0,n.useEffect)(()=>{if(!p)return;let e=setTimeout(()=>h(!1),4e3);return()=>clearTimeout(e)},[p]);let N=async()=>{if(!p)return void h(!0);h(!1),o("fullReset");try{let e=await fetch("/api/full-reset",{method:"POST"}),t=await e.json();c(t.ok?l.fullResetResult(t.projects,t.agents,t.duration_ms):t.error||l.fullResetFailed)}catch{c(l.fullResetFailed)}o(null),j()},S=async()=>{if(!u)return void d(!0);d(!1),o("stop");try{let t=await fetch(`/api/agentchattr/${encodeURIComponent(e)}/stop`,{method:"POST"}),n=await t.json();c(n.ok?l.stopped:l.failed)}catch{c(l.error)}o(null),j()},C=async()=>{o("restart");try{let t=await fetch(`/api/agentchattr/${encodeURIComponent(e)}/restart`,{method:"POST"}),n=await t.json();if(n.ok&&n.pid){c(l.acRestarted(n.pid));try{let t=await fetch(`/api/agents/${encodeURIComponent(e)}/reset`,{method:"POST"}),n=await t.json();n.ok?c(l.acAndAgentsRestarted(n.restarted)):c(l.agentResetFailed)}catch{c(l.agentResetFailed)}}else c(n.error||l.failed)}catch{c(l.error)}o(null),j()},E=async()=>{o("reset");try{let t=await fetch(`/api/agents/${encodeURIComponent(e)}/reset`,{method:"POST"}),n=await t.json();c(n.ok?l.resetResult(n.restarted,n.total):n.error||l.failed)}catch{c(l.error)}o(null),j()};return(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:l.title}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,t.jsx)("button",{onClick:S,disabled:!!i,className:`px-1.5 py-0.5 text-[10px] border transition-colors disabled:opacity-50 ${u?"text-error border-error/60 bg-error/10 hover:bg-error/20":"text-text-muted border-border hover:text-error hover:border-error/40"}`,children:"stop"===i?"...":u?l.confirmStop:l.stop}),(0,t.jsx)("button",{onClick:C,disabled:!!i,className:"px-1.5 py-0.5 text-[10px] text-text-muted border border-border hover:text-accent hover:border-accent/40 transition-colors disabled:opacity-50",children:"restart"===i?"...":l.restart}),(0,t.jsx)("button",{onClick:E,disabled:!!i,className:"px-1.5 py-0.5 text-[10px] text-text-muted border border-border hover:text-accent hover:border-accent/40 transition-colors disabled:opacity-50",children:"reset"===i?"...":l.resetAgents}),(0,t.jsx)("button",{onClick:N,disabled:!!i,className:`px-1.5 py-0.5 text-[10px] border transition-colors disabled:opacity-50 ${p?"text-error border-error/60 bg-error/10 hover:bg-error/20":"text-text-muted border-border hover:text-accent hover:border-accent/40"}`,children:"fullReset"===i?"...":p?l.confirmFullReset:l.fullReset}),(0,t.jsxs)("div",{className:"relative",ref:v,children:[(0,t.jsx)("button",{onClick:()=>g(e=>!e),disabled:!!i,className:"px-1.5 py-0.5 text-[10px] text-text-muted border border-border hover:text-accent hover:border-accent/40 transition-colors disabled:opacity-50",children:"interrupt"===i?"...":`${l.interrupt} ▾`}),x&&(0,t.jsxs)("div",{className:"absolute bottom-full left-0 mb-1 p-1 border border-border bg-bg-surface z-20 min-w-[140px] flex flex-col",children:[w.map(e=>(0,t.jsxs)("button",{onClick:()=>k(e),className:"flex items-center gap-1.5 px-2 py-1 text-[10px] text-text-muted hover:text-accent hover:bg-white/5 text-left",children:[(0,t.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${"running"===b[e]?"bg-accent":"bg-text-muted/40"}`}),e.charAt(0).toUpperCase()+e.slice(1)]},e)),(0,t.jsx)("div",{className:"border-t border-border my-0.5"}),(0,t.jsx)("button",{onClick:()=>k(null),className:"px-2 py-1 text-[10px] text-text-muted hover:text-accent hover:bg-white/5 text-left",children:l.interruptAll})]})]})]}),s&&(0,t.jsx)("div",{className:"text-[10px] text-accent",children:s}),f&&!s&&(0,t.jsx)("div",{className:`text-[10px] ${f.includes("failed")||f.includes("실패")?"text-error":"text-[#ffcc00]"}`,children:f})]})}function nX(e){return Number.isFinite(e)?Math.min(Math.max(e,.1),24):3}function nZ(e){let t=Math.floor(e/3600),n=Math.floor(e%3600/60);return t>0?`${t}h ${n}m`:`${n}m`}function n0({projectId:e}){let{locale:r}=(0,a.useLocale)(),l=nK[r].system,[i,o]=(0,n.useState)(!1),[s,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(""),[p,h]=(0,n.useState)(!1),[f,m]=(0,n.useState)(String(3)),[x,g]=(0,n.useState)(!1),[b,y]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),[k,j]=(0,n.useState)(null),N=(0,n.useRef)(!1),S=(0,n.useRef)(null),C=(0,n.useRef)(!1),E=(0,n.useRef)(!1);E.current=i,N.current=v;let[A,T]=(0,n.useState)(!1),[I,R]=(0,n.useState)(!1),[O,P]=(0,n.useState)(!0),[M,F]=(0,n.useState)("soft-chime"),[D,_]=(0,n.useState)(!0);(0,n.useEffect)(()=>{P((0,nQ.getNotificationEnabled)()),F((0,nQ.getNotificationChoice)()),_((0,nQ.getNotificationBackgroundOnly)())},[]);let L=(0,n.useCallback)(()=>{fetch("/api/caffeinate/status").then(e=>e.ok?e.json():null).then(e=>{e&&(o(e.active),c(e.remaining),d(e.platform))}).catch(()=>{})},[]);(0,n.useEffect)(()=>{L();let e=setInterval(L,5e3);return()=>clearInterval(e)},[L]);let $=e=>{fetch("/api/caffeinate/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({duration:e})}).then(e=>e.json()).then(t=>{t.ok&&(o(!0),c(e||null))}).catch(()=>{}),h(!1)};(0,n.useEffect)(()=>{w(!1),j(null),S.current=null,C.current=!1,fetch("/api/config").then(e=>e.ok?e.json():null).then(t=>{if(!t)return;let n=(t.projects||[]).find(t=>t.id===e);n?.awake_auto&&w(!0)}).catch(()=>{})},[e]);let U=(0,n.useCallback)(async()=>{let t=!v;w(t),t||(j(null),S.current=null,C.current=!1);try{let n=await fetch("/api/config");if(!n.ok)return;let r=await n.json(),l=(r.projects||[]).find(t=>t.id===e);l&&(l.awake_auto=t,await fetch("/api/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}))}catch{}},[v,e]),z=(0,n.useCallback)(()=>{let e=parseFloat(f),t=Math.round(3600*(Number.isFinite(e)?nX(e):8));fetch("/api/caffeinate/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({duration:t})}).then(e=>e.json()).then(e=>{e.ok&&(o(!0),c(t),C.current=!1)}).catch(()=>{})},[f]),B=(0,n.useCallback)(()=>{fetch("/api/caffeinate/stop",{method:"POST"}).then(()=>{o(!1),c(null)}).catch(()=>{})},[]);(0,n.useEffect)(()=>{if(!v)return;let t=async()=>{if(N.current)try{let t=await fetch(`/api/batch-progress?project=${encodeURIComponent(e)}`);if(!t.ok)return;let n=await t.json(),r=n.items.length>0,i=S.current;if(S.current={complete:n.complete,hasItems:r},!i){!r||n.complete||E.current||(z(),j(l.awakeStatusActive)),r&&n.complete&&E.current&&(B(),j(l.awakeStatusComplete));return}r&&n.complete&&!i.complete&&E.current&&(B(),j(l.awakeStatusComplete),C.current=!1),!r||n.complete||!i.complete&&i.hasItems||E.current||C.current||(z(),j(l.awakeStatusNew))}catch{}};t();let n=setInterval(t,3e4);return()=>clearInterval(n)},[v,e,z,B,l]);let H=!u||"darwin"===u;return(0,t.jsxs)("div",{className:"flex flex-col md:flex-row md:items-start gap-2 md:gap-6 relative",children:[H&&(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 relative",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:[(0,t.jsx)("span",{children:l.keepAwake}),(0,t.jsx)("button",{type:"button","aria-label":l.keepAwakeAbout,onClick:()=>T(e=>!e),className:"w-3.5 h-3.5 rounded-full border border-border text-[9px] leading-none text-text-muted hover:text-accent hover:border-accent inline-flex items-center justify-center",children:"?"}),(0,t.jsxs)("button",{type:"button",onClick:U,title:v?l.autoAwakeOn:l.autoAwakeOff,className:`ml-1 px-1.5 py-0.5 text-[10px] border transition-colors ${v?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:["Auto ",v?"●":"○"]})]}),A&&(0,t.jsx)("div",{className:"absolute left-0 top-4 z-30 w-64 p-2 text-[10px] leading-snug text-text bg-bg-surface border border-border rounded shadow-lg",children:l.keepAwakeHelp}),k&&(0,t.jsx)("div",{className:"text-[10px] text-accent bg-accent/5 border border-border/50 px-1.5 py-0.5 mt-0.5",children:k}),(0,t.jsx)("div",{className:"text-[10px] text-text-muted leading-tight",children:i&&null!==s&&s>0?l.awakeFor(nZ(s)):i&&null===s?l.awakeIndefinitely:l.awakeDesc}),(0,t.jsx)("div",{className:"flex items-center gap-1.5 flex-wrap mt-0.5",children:(0,t.jsxs)("button",{onClick:()=>i?void(C.current=!0,fetch("/api/caffeinate/stop",{method:"POST"}).then(()=>{o(!1),c(null)}).catch(()=>{})):h(!p),title:"Keep Mac awake (caffeinate)",className:`px-1.5 py-0.5 text-[10px] border transition-colors ${i?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:[i?l.awake:l.start,i&&null!==s&&s>0&&(0,t.jsx)("span",{className:"ml-1 text-accent/70",children:nZ(s)}),i&&null===s&&(0,t.jsx)("span",{className:"ml-1 text-accent/70",children:l.on})]})})]}),H&&(0,t.jsx)("div",{className:"border-t border-border/40 md:border-t-0 md:w-px md:h-auto md:self-stretch md:bg-border"}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 relative",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:[(0,t.jsx)("span",{children:l.sound}),(0,t.jsx)("button",{type:"button","aria-label":l.soundAbout,onClick:()=>R(e=>!e),className:"w-3.5 h-3.5 rounded-full border border-border text-[9px] leading-none text-text-muted hover:text-accent hover:border-accent inline-flex items-center justify-center",children:"?"})]}),I&&(0,t.jsx)("div",{className:"absolute left-0 top-4 z-30 w-64 p-2 text-[10px] leading-snug text-text bg-bg-surface border border-border rounded shadow-lg",children:l.soundHelp}),(0,t.jsx)("div",{className:"text-[10px] text-text-muted leading-tight",children:l.soundDesc}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap mt-0.5",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{let e=!O;P(e),(0,nQ.setNotificationEnabled)(e)},title:O?"Notification sound on (click to mute)":"Notification sound off (click to unmute)",className:`px-1.5 py-0.5 text-[10px] border transition-colors ${O?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:[O?"🔔":"🔕"," ",l.soundLabel]}),O&&(0,t.jsx)("select",{value:M,onChange:e=>(e=>{if(F(e),(0,nQ.setNotificationChoice)(e),O)try{let t=new Audio(`/sounds/${e}.mp3`);t.volume=.6,t.play().catch(()=>{})}catch{}})(e.target.value),title:"Notification sound",className:"bg-transparent border border-border px-1 py-0.5 text-[10px] text-text outline-none focus:border-accent cursor-pointer",children:nQ.NOTIFICATION_SOUND_OPTIONS.map(e=>(0,t.jsx)("option",{value:e.value,className:"bg-bg-surface",children:e.label},e.value))})]}),O&&(0,t.jsxs)("label",{className:"flex items-center gap-1 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:D,onChange:e=>{var t;_(t=e.target.checked),(0,nQ.setNotificationBackgroundOnly)(t)}}),l.soundBgOnly]})]}),p&&!i&&(0,t.jsxs)("div",{className:"absolute bottom-full left-0 mb-1 p-2 border border-border bg-bg-surface z-20 min-w-[220px] flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:l.keepAwakeModalTitle}),(0,t.jsx)("button",{type:"button","aria-label":l.keepAwakeModalAbout,onClick:()=>y(e=>!e),className:"w-3.5 h-3.5 rounded-full border border-border text-[9px] leading-none text-text-muted hover:text-accent hover:border-accent inline-flex items-center justify-center",children:"?"})]}),b&&(0,t.jsx)("div",{className:"p-1.5 text-[10px] leading-snug text-text bg-bg border border-border/60 rounded",children:l.keepAwakeModalHelp}),(0,t.jsx)("p",{className:"text-[10px] text-[#ffcc00]",children:l.makeSurePluggedIn}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",children:[(0,t.jsx)("span",{className:"text-text-muted",children:l.for}),(0,t.jsx)("input",{type:"number",value:f,onChange:e=>m(e.target.value),onBlur:()=>{let e=parseFloat(f);m(String(Math.round(10*(Number.isFinite(e)?nX(e):3))/10))},disabled:x,min:.1,max:24,step:.1,className:"w-14 bg-transparent border border-border px-1 py-0.5 text-text outline-none focus:border-accent text-center disabled:opacity-40"}),(0,t.jsx)("span",{className:"text-text-muted",children:l.hours})]}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,t.jsx)("input",{type:"checkbox",checked:x,onChange:e=>g(e.target.checked)}),l.untilStopped]}),(0,t.jsx)("button",{type:"button",onClick:()=>{if(x)return void $(0);let e=parseFloat(f);$(Math.round(3600*(Number.isFinite(e)?nX(e):3)))},className:"self-start px-2 py-0.5 text-[10px] text-accent border border-accent/40 rounded hover:bg-accent/10 transition-colors",children:l.start})]})]})}function n1({projectId:e}){return(0,t.jsx)("div",{className:"border-t border-border px-3 py-2",children:(0,t.jsxs)("div",{className:"flex flex-col md:flex-row md:items-start gap-2 md:gap-6",children:[(0,t.jsx)(nY,{projectId:e}),(0,t.jsx)("div",{className:"border-t border-border/40 md:border-t-0 md:w-px md:h-auto md:self-stretch md:bg-border"}),(0,t.jsx)(n0,{projectId:e})]})})}var n2=e.i(99894),n5=e.i(93309);function n4({projectId:e,agentId:r,wsUrl:l,onActivity:i}){let a=(0,n.useRef)(null),o=(0,n.useRef)(null),s=(0,n.useRef)(null),c=(0,n.useRef)(null),u=(0,n.useRef)(i);(0,n.useEffect)(()=>{u.current=i},[i]);let d=(0,n.useCallback)(()=>{if(s.current&&o.current&&a.current)try{s.current.fit();let e=c.current;e&&e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:"resize",cols:o.current.cols,rows:o.current.rows}))}catch{}},[]);return(0,n.useEffect)(()=>{if(!a.current)return;let t=new n2.Terminal({scrollback:1e3,fontSize:11,fontFamily:'"Geist Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", monospace',lineHeight:1.2,letterSpacing:.5,cursorBlink:!1,cursorStyle:"block",theme:{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#00ff88",cursorAccent:"#0a0a0a",selectionBackground:"#00ff8844",black:"#0a0a0a",red:"#ff4444",green:"#00ff88",yellow:"#ffcc00",blue:"#4488ff",magenta:"#cc44ff",cyan:"#44ccff",white:"#e0e0e0",brightBlack:"#737373",brightRed:"#ff6666",brightGreen:"#00ff88",brightYellow:"#ffdd44",brightBlue:"#66aaff",brightMagenta:"#dd66ff",brightCyan:"#66ddff",brightWhite:"#ffffff"},allowTransparency:!1,drawBoldTextInBrightColors:!0}),n=new n5.FitAddon;t.loadAddon(n),t.open(a.current),o.current=t,s.current=n,requestAnimationFrame(()=>d());let i=new ResizeObserver(()=>requestAnimationFrame(()=>d()));i.observe(a.current),t.onData(e=>{let t=c.current;t&&t.readyState===WebSocket.OPEN&&t.send(e)});let p=!1,h=null,f=async()=>{if(h)return h;if(l)return h=l;let e="https:"===window.location.protocol?"wss:":"ws:";try{let t=await fetch("/api/config");if(t.ok){let n=(await t.json()).port||8400,r=parseInt(window.location.port,10);h=r&&r!==n?`${e}//${window.location.hostname}:${n}`:`${e}//${window.location.host}`}else h=`${e}//${window.location.host}`}catch{h=`${e}//${window.location.host}`}return h},m=async()=>{try{let t=await fetch("/api/sessions");if(!t.ok)return!1;let n=await t.json();return Array.isArray(n)&&n.some(t=>t&&t.projectId===e&&t.agentId===r)}catch{return!1}},x=0,g=!1,b=async()=>{let n=await f();if(p)return;let l=new WebSocket(`${n}/ws/terminal?project=${encodeURIComponent(e)}&agent=${encodeURIComponent(r)}`);c.current=l,l.onopen=()=>{x=0,l.send(JSON.stringify({type:"resize",cols:t.cols,rows:t.rows})),l.send(JSON.stringify({type:"replay"}))},l.onmessage=e=>{t.write(e.data),g||(g=!0,requestAnimationFrame(()=>{d(),g=!1}));let n=u.current;n&&n()},l.onclose=async e=>{if(!p){if(x<5){let e=Date.now(),n=!1;for(;Date.now()-e<2e3;){if(await new Promise(e=>setTimeout(e,200)),p)return;if(await m()){n=!0;break}}if(p)return;if(n){x+=1,t.reset(),t.write(`\x1b[38;2;115;115;115m[reattached to new session]\x1b[0m\r
6
6
  `),b();return}}t.write(`\r
7
7
  \x1b[38;2;115;115;115m[session closed: ${e.reason||e.code}]\x1b[0m\r
8
8
  `)}}};return b(),()=>{p=!0,i.disconnect(),c.current?.close(),t.dispose(),o.current=null,s.current=null,c.current=null}},[e,r,l,d]),(0,t.jsx)("div",{ref:a,className:"w-full h-full"})}let n3=[{id:"re1",label:"RE1"},{id:"re2",label:"RE2"},{id:"dev",label:"Dev"}],n6=["border-r border-b border-border","border-b border-border","col-span-2"],n9=["border-r border-b border-border","border-b border-border","border-r border-border",""];function n7({projectId:e,agents:r=n3,agentStates:l={},onStatusChange:i}){let[a,o]=(0,n.useState)(null),s=r.length>=4?n9:n6,c=(0,n.useRef)({}),[u,d]=(0,n.useState)(0),p=(0,n.useCallback)(e=>{c.current[e]=Date.now()},[]),h=(0,n.useRef)({}),f=(0,n.useCallback)((t,n)=>{fetch("/api/activity/log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e,agent:t,type:n,timestamp:Date.now()})}).catch(()=>{})},[e]);(0,n.useEffect)(()=>{let e=setInterval(()=>{for(let e of(d(e=>e+1),r)){let t=c.current[e.id],n=void 0!==t&&Date.now()-t<5e3,r=!!h.current[e.id];n&&!r?(h.current[e.id]=!0,f(e.id,"start")):!n&&r&&(h.current[e.id]=!1,f(e.id,"end"))}},500);return()=>clearInterval(e)},[r,f]);let m=e=>{let t=c.current[e];return void 0!==t&&Date.now()-t<5e3};return(0,t.jsx)("div",{className:"w-full h-full relative grid grid-rows-2 grid-cols-2",children:r.map((n,r)=>{let c=a===n.id,u=null!==a&&!c;return(0,t.jsxs)("div",{className:`flex flex-col ${c?"absolute inset-0 z-10 bg-bg":`${s[r]||""}`}`,style:u?{visibility:"hidden",overflow:"hidden"}:void 0,children:[(0,t.jsxs)("div",{className:`flex items-center justify-between px-3 shrink-0 border-b border-border ${c?"h-7":"h-6"}`,children:[(0,t.jsxs)("div",{className:`flex items-center gap-1.5 ${!c?"cursor-pointer":""}`,onClick:c?void 0:()=>o(n.id),children:[(0,t.jsxs)("span",{className:"relative inline-flex items-center justify-center w-2 h-2",children:["running"===l[n.id]&&m(n.id)&&(0,t.jsx)("span",{className:"absolute inline-flex h-full w-full rounded-full bg-accent opacity-60 animate-ping"}),(0,t.jsx)("span",{className:`relative w-1.5 h-1.5 rounded-full ${"running"===l[n.id]?"bg-accent":"error"===l[n.id]?"bg-error":"bg-text-muted"}`})]}),(0,t.jsx)("span",{className:`text-[11px] uppercase tracking-wider ${"running"===l[n.id]&&m(n.id)?"text-accent animate-name-shimmer":"text-text-muted"}`,children:n.label})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:["running"!==l[n.id]&&(0,t.jsx)("button",{onClick:()=>{fetch(`/api/agents?project=${encodeURIComponent(e)}&agent=${encodeURIComponent(n.id)}&action=start`,{method:"POST"}).then(e=>e.json()).then(e=>{e.state&&i&&i(n.id,e.state)}).catch(()=>{})},className:"text-[10px] text-text-muted hover:text-accent transition-colors px-0.5",title:"Start",children:"▶"}),"running"===l[n.id]&&(0,t.jsx)("button",{onClick:()=>{fetch(`/api/agents?project=${encodeURIComponent(e)}&agent=${encodeURIComponent(n.id)}&action=stop`,{method:"POST"}).then(e=>e.json()).then(e=>{e.state&&i&&i(n.id,e.state)}).catch(()=>{})},className:"text-[10px] text-text-muted hover:text-error transition-colors px-0.5",title:"Stop",children:"■"}),(0,t.jsx)("button",{onClick:()=>{fetch(`/api/agents?project=${encodeURIComponent(e)}&agent=${encodeURIComponent(n.id)}&action=restart`,{method:"POST"}).then(e=>e.json()).then(e=>{e.state&&i&&i(n.id,e.state)}).catch(()=>{})},className:"text-[10px] text-text-muted hover:text-accent transition-colors px-0.5",title:"Restart",children:"↻"}),"running"===l[n.id]&&(0,t.jsx)("button",{onClick:()=>{fetch(`/api/agents/${encodeURIComponent(e)}/${encodeURIComponent(n.id)}/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:"/compact\n"})}).catch(()=>{})},className:"text-[10px] text-text-muted hover:text-accent transition-colors px-0.5",title:"Compact — frees context/memory when agent is stuck",children:"/c"}),c&&(0,t.jsx)("button",{onClick:()=>o(null),className:"text-[11px] text-text-muted hover:text-text transition-colors ml-1",children:"esc"})]})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:(0,t.jsx)(n4,{projectId:e,agentId:n.id,onActivity:()=>p(n.id)})})]},n.id)})})}let n8="qw-terminals-collapsed",re={en:{title:"Agent Terminals",aboutLabel:"About agent terminals",tooltip:(0,t.jsxs)(t.Fragment,{children:["These show what each agent is doing in their CLI session. ",(0,t.jsx)("b",{children:"Do not type here directly"}),"— use the AgentChattr chat above instead. Agents won't see messages typed in their terminals."]}),hide:"hide",show:"show"},ko:{title:"에이전트 터미널",aboutLabel:"에이전트 터미널 설명",tooltip:(0,t.jsxs)(t.Fragment,{children:["각 에이전트가 CLI 세션에서 무엇을 하고 있는지 보여주는 읽기 전용 터미널입니다. ",(0,t.jsx)("b",{children:"여기에 직접 입력하지 마세요."})," 위의 AgentChattr 채팅을 사용해야 에이전트가 메시지를 볼 수 있습니다."]}),hide:"접기",show:"펼치기"}},rt=[{id:"head",label:"Head"},{id:"dev",label:"Dev"},{id:"re1",label:"RE1"},{id:"re2",label:"RE2"}];function rn({projectId:e,agentStates:r,onStatusChange:l,onCollapsedChange:i}){let{locale:o}=(0,a.useLocale)(),s=re[o],[c,u]=(0,n.useState)(!1),[d,p]=(0,n.useState)(!1),[h,f]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{p("true"===localStorage.getItem(n8)),f(!0)},[]),(0,n.useEffect)(()=>{h&&(localStorage.setItem(n8,String(d)),i?.(d))},[d,h,i]),d)?(0,t.jsx)("div",{className:"flex flex-col h-full min-h-0",children:(0,t.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:s.title}),(0,t.jsxs)("button",{type:"button",onClick:()=>p(!1),className:"text-[10px] text-text-muted hover:text-text transition-colors",children:["▸ ",s.show]})]})}):(0,t.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:s.title}),(0,t.jsxs)("div",{className:"relative inline-flex items-center",onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onFocus:()=>u(!0),onBlur:()=>u(!1),children:[(0,t.jsx)("button",{type:"button","aria-label":s.aboutLabel,className:"w-3.5 h-3.5 rounded-full border border-border text-[9px] leading-none text-text-muted hover:text-accent hover:border-accent inline-flex items-center justify-center",children:"?"}),c&&(0,t.jsx)("div",{role:"tooltip",className:"ko-help absolute top-5 left-0 z-20 w-72 max-w-[min(18rem,calc(100vw-2rem))] p-2 text-[11px] leading-snug text-text bg-bg-surface border border-border shadow-lg",children:s.tooltip})]})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>p(!0),className:"text-[10px] text-text-muted hover:text-text transition-colors",children:["▾ ",s.hide]})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:(0,t.jsx)(n7,{projectId:e,agents:rt,agentStates:r,onStatusChange:l})})]})}let rr={en:{label:(e,t)=>`Scheduled Trigger${e?t?" (auto)":" (running)":""}`,tooltip:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"Scheduled Trigger"})," sends a periodic message to all agents on a timer. Use this to keep the autonomous workflow running overnight. First message fires after the configured interval, not immediately."]}),autoTriggerOn:"Auto-trigger ON — trigger follows batch lifecycle",autoTriggerOff:"Auto-trigger OFF — manual start/stop only",auto:"Auto ",message:"Message",sendEvery:"Send every",minFor:"min for",hours:"hours",starting:"Starting…",startTrigger:"Start Trigger",sending:"Sending:",running:"Running",next:"Next: ",stopsIn:"Stops in: ",untilStopped:"(until stopped)",stopping:"Stopping…",stopTrigger:"Stop Trigger",autoStopStatus:"Batch complete — trigger paused. Waiting for next batch."},ko:{label:(e,t)=>`예약 트리거${e?t?" (자동)":" (실행 중)":""}`,tooltip:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{children:"예약 트리거"})," - 타이머에 따라 모든 에이전트에게 주기적으로 메시지를 보냅니다. 야간 자율 워크플로우를 계속 돌릴 때 사용하세요. 첫 메시지는 즉시가 아니라 설정한 간격 후에 전송됩니다."]}),autoTriggerOn:"자동 트리거 ON - 배치 생명주기에 따라 트리거가 동작합니다",autoTriggerOff:"자동 트리거 OFF - 수동 시작/중지만 가능합니다",auto:"자동 ",message:"메시지",sendEvery:"전송 간격: ",minFor:"분 마다, ",hours:"시간 동안",starting:"시작 중…",startTrigger:"트리거 시작",sending:"전송 중:",running:"실행 중",next:"다음 전송: ",stopsIn:"종료까지: ",untilStopped:"(중지할 때까지)",stopping:"중지 중…",stopTrigger:"트리거 중지",autoStopStatus:"배치 완료 — 트리거 일시 중지. 다음 배치를 기다리는 중."}};function rl(e){return Number.isFinite(e)?Math.min(Math.max(e,.1),24):3}function ri(e){return!Number.isFinite(e)||e<=0?String(3):(Math.round(e/60*10)/10).toString()}function ra(e){if(e<=0)return"0m 0s";let t=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),r=Math.floor(e%6e4/1e3);return t>0?`${t}h ${n}m`:`${n}m ${r}s`}function ro({projectId:e}){let{locale:r}=(0,a.useLocale)(),i=rr[r],[o,s]=(0,n.useState)(null),[c,u]=(0,n.useState)(""),[d,p]=(0,n.useState)(15),[h,f]=(0,n.useState)("15"),[m,x]=(0,n.useState)(180),[g,b]=(0,n.useState)(()=>ri(180)),[y,v]=(0,n.useState)(!1),[w,k]=(0,n.useState)(!1),j=(0,n.useRef)(""),N=(0,n.useRef)(!1),S=(0,n.useRef)(!1);(0,n.useEffect)(()=>{j.current=c},[c]),(0,n.useEffect)(()=>{N.current=y},[y]),(0,n.useEffect)(()=>{S.current=w},[w]);let[C,E]=(0,n.useState)(!1),[A,T]=(0,n.useState)(null),[I,R]=(0,n.useState)(""),[O,P]=(0,n.useState)(""),M=(0,n.useMemo)(()=>{let t;return t=`~/.quadwork/${e}/OVERNIGHT-QUEUE.md`,`@head @dev @re1 @re2 — Queue check.