quadwork 1.5.3 → 1.5.4

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 (116) hide show
  1. package/bin/quadwork.js +4 -1
  2. package/out/404.html +1 -1
  3. package/out/__next.__PAGE__.txt +3 -3
  4. package/out/__next._full.txt +11 -11
  5. package/out/__next._head.txt +4 -4
  6. package/out/__next._index.txt +5 -5
  7. package/out/__next._tree.txt +1 -1
  8. package/out/_next/static/chunks/0.bbxho1vnxin.js +1 -0
  9. package/out/_next/static/chunks/{0wreuebrwlg.2.js → 0.fo6qk3ltnbn.js} +2 -2
  10. package/out/_next/static/chunks/00n1ppi~-l_sv.js +1 -0
  11. package/out/_next/static/chunks/{0.57eg262w~qg.js → 01xlw8hd842-c.js} +1 -1
  12. package/out/_next/static/chunks/{135rms05ismy4.js → 0656i.-.r7.a9.js} +2 -2
  13. package/out/_next/static/chunks/09elx026_5z7..js +1 -0
  14. package/out/_next/static/chunks/0d3shmwh5_nmn.js +1 -0
  15. package/out/_next/static/chunks/0fkhi51bdw9~~.js +1 -0
  16. package/out/_next/static/chunks/0fpg8z.yd2xb7.js +1 -0
  17. package/out/_next/static/chunks/0iwycgwby2dd_.js +1 -0
  18. package/out/_next/static/chunks/0mtmv-f5qymoi.js +1 -0
  19. package/out/_next/static/chunks/0pqt~8bl3ukh4.js +4 -0
  20. package/out/_next/static/chunks/0ze4gu236oq96.js +31 -0
  21. package/out/_next/static/chunks/0zfotsowwll1x.js +2 -0
  22. package/out/_next/static/chunks/0~xrqi87fqraz.js +1 -0
  23. package/out/_next/static/chunks/11v7tu7pto6_x.js +1 -0
  24. package/out/_next/static/chunks/{0dmi9pk2bd712.js → 12i404gkhv7q..js} +2 -2
  25. package/out/_next/static/chunks/16g.ca89g7fib.js +1 -0
  26. package/out/_next/static/chunks/{turbopack-0wh29ykoy-rb5.js → turbopack-0lcwh84lrj9gi.js} +1 -1
  27. package/out/_not-found/__next._full.txt +10 -10
  28. package/out/_not-found/__next._head.txt +4 -4
  29. package/out/_not-found/__next._index.txt +5 -5
  30. package/out/_not-found/__next._not-found.__PAGE__.txt +2 -2
  31. package/out/_not-found/__next._not-found.txt +3 -3
  32. package/out/_not-found/__next._tree.txt +1 -1
  33. package/out/_not-found.html +1 -1
  34. package/out/_not-found.txt +10 -10
  35. package/out/app-shell/__next._full.txt +10 -10
  36. package/out/app-shell/__next._head.txt +4 -4
  37. package/out/app-shell/__next._index.txt +5 -5
  38. package/out/app-shell/__next._tree.txt +1 -1
  39. package/out/app-shell/__next.app-shell.__PAGE__.txt +2 -2
  40. package/out/app-shell/__next.app-shell.txt +3 -3
  41. package/out/app-shell.html +1 -1
  42. package/out/app-shell.txt +10 -10
  43. package/out/index.html +1 -1
  44. package/out/index.txt +11 -11
  45. package/out/project/_/__next._full.txt +11 -11
  46. package/out/project/_/__next._head.txt +4 -4
  47. package/out/project/_/__next._index.txt +5 -5
  48. package/out/project/_/__next._tree.txt +1 -1
  49. package/out/project/_/__next.project.$d$id.__PAGE__.txt +3 -3
  50. package/out/project/_/__next.project.$d$id.txt +3 -3
  51. package/out/project/_/__next.project.txt +3 -3
  52. package/out/project/_/memory/__next._full.txt +11 -11
  53. package/out/project/_/memory/__next._head.txt +4 -4
  54. package/out/project/_/memory/__next._index.txt +5 -5
  55. package/out/project/_/memory/__next._tree.txt +1 -1
  56. package/out/project/_/memory/__next.project.$d$id.memory.__PAGE__.txt +3 -3
  57. package/out/project/_/memory/__next.project.$d$id.memory.txt +3 -3
  58. package/out/project/_/memory/__next.project.$d$id.txt +3 -3
  59. package/out/project/_/memory/__next.project.txt +3 -3
  60. package/out/project/_/memory.html +1 -1
  61. package/out/project/_/memory.txt +11 -11
  62. package/out/project/_/queue/__next._full.txt +11 -11
  63. package/out/project/_/queue/__next._head.txt +4 -4
  64. package/out/project/_/queue/__next._index.txt +5 -5
  65. package/out/project/_/queue/__next._tree.txt +1 -1
  66. package/out/project/_/queue/__next.project.$d$id.queue.__PAGE__.txt +3 -3
  67. package/out/project/_/queue/__next.project.$d$id.queue.txt +3 -3
  68. package/out/project/_/queue/__next.project.$d$id.txt +3 -3
  69. package/out/project/_/queue/__next.project.txt +3 -3
  70. package/out/project/_/queue.html +1 -1
  71. package/out/project/_/queue.txt +11 -11
  72. package/out/project/_.html +1 -1
  73. package/out/project/_.txt +11 -11
  74. package/out/settings/__next._full.txt +11 -11
  75. package/out/settings/__next._head.txt +4 -4
  76. package/out/settings/__next._index.txt +5 -5
  77. package/out/settings/__next._tree.txt +1 -1
  78. package/out/settings/__next.settings.__PAGE__.txt +3 -3
  79. package/out/settings/__next.settings.txt +3 -3
  80. package/out/settings.html +1 -1
  81. package/out/settings.txt +11 -11
  82. package/out/setup/__next._full.txt +11 -11
  83. package/out/setup/__next._head.txt +4 -4
  84. package/out/setup/__next._index.txt +5 -5
  85. package/out/setup/__next._tree.txt +1 -1
  86. package/out/setup/__next.setup.__PAGE__.txt +3 -3
  87. package/out/setup/__next.setup.txt +3 -3
  88. package/out/setup.html +1 -1
  89. package/out/setup.txt +11 -11
  90. package/package.json +1 -1
  91. package/server/index.js +130 -41
  92. package/server/install-agentchattr.js +53 -0
  93. package/server/routes.js +25 -3
  94. package/server/routes.telegramBridge.test.js +4 -1
  95. package/templates/CLAUDE.md +2 -1
  96. package/templates/seeds/dev.AGENTS.md +2 -0
  97. package/templates/seeds/head.AGENTS.md +2 -0
  98. package/templates/seeds/reviewer1.AGENTS.md +3 -1
  99. package/templates/seeds/reviewer2.AGENTS.md +3 -1
  100. package/out/_next/static/chunks/04_t39bv8y9pe.js +0 -1
  101. package/out/_next/static/chunks/084lff9v4p_vh.js +0 -1
  102. package/out/_next/static/chunks/09sq17vme9g6p.js +0 -1
  103. package/out/_next/static/chunks/0e.ktwt1nyj...js +0 -1
  104. package/out/_next/static/chunks/0excsn2a_5qsb.js +0 -4
  105. package/out/_next/static/chunks/0ezniz80psxr6.js +0 -1
  106. package/out/_next/static/chunks/0g-nq4.uckan-.js +0 -1
  107. package/out/_next/static/chunks/0ox7p_szjhn69.js +0 -1
  108. package/out/_next/static/chunks/0r7t_sj_sejq9.js +0 -1
  109. package/out/_next/static/chunks/0r_tb4lmfa_yb.js +0 -1
  110. package/out/_next/static/chunks/0whtwwbpg72ar.js +0 -1
  111. package/out/_next/static/chunks/0z~0.4hivi.f2.js +0 -31
  112. package/out/_next/static/chunks/15i5_ay.0ap.6.js +0 -2
  113. package/out/_next/static/chunks/17y2walb2um9w.js +0 -1
  114. /package/out/_next/static/{X4zdS6Y6HkLOaElNeHwnq → XCVQTR6dRg8tK75W8jDzw}/_buildManifest.js +0 -0
  115. /package/out/_next/static/{X4zdS6Y6HkLOaElNeHwnq → XCVQTR6dRg8tK75W8jDzw}/_clientMiddlewareManifest.js +0 -0
  116. /package/out/_next/static/{X4zdS6Y6HkLOaElNeHwnq → XCVQTR6dRg8tK75W8jDzw}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,87038,(e,i,r)=>{"use strict";var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,o=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,h=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g;function u(e){return e?e.replace(d,""):""}i.exports=function(e,i){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];i=i||{};var r=1,d=1;function f(e){var i=e.match(n);i&&(r+=i.length);var s=e.lastIndexOf("\n");d=~s?e.length-s:d+e.length}function p(){var e={line:r,column:d};return function(i){return i.position=new _(e),g(o),i}}function _(e){this.start=e,this.end={line:r,column:d},this.source=i.source}function m(s){var n=Error(i.source+":"+r+":"+d+": "+s);if(n.reason=s,n.filename=i.source,n.line=r,n.column=d,n.source=e,i.silent);else throw n}function g(i){var r=i.exec(e);if(r){var s=r[0];return f(s),e=e.slice(s.length),r}}function v(e){var i;for(e=e||[];i=x();)!1!==i&&e.push(i);return e}function x(){var i=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return m("End of comment missing");var s=e.slice(2,r-2);return d+=2,f(s),e=e.slice(r),d+=2,i({type:"comment",comment:s})}}_.prototype.content=e,g(o);var b,y=[];for(v(y);b=function(){var e=p(),i=g(l);if(i){if(x(),!g(a))return m("property missing ':'");var r=g(h),n=e({type:"declaration",property:u(i[0].replace(s,"")),value:r?u(r[0].replace(s,"")):""});return g(c),n}}();)!1!==b&&(y.push(b),v(y));return y}},74499,(e,i,r)=>{"use strict";var s=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,i){let r=null;if(!e||"string"!=typeof e)return r;let s=(0,n.default)(e),o="function"==typeof i;return s.forEach(e=>{if("declaration"!==e.type)return;let{property:s,value:n}=e;o?i(s,n,e):n&&((r=r||{})[s]=n)}),r};let n=s(e.r(87038))},20461,(e,i,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.camelCase=void 0;var s=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,o=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,h=function(e,i){return i.toUpperCase()},c=function(e,i){return"".concat(i,"-")};r.camelCase=function(e,i){var r;return(void 0===i&&(i={}),!(r=e)||o.test(r)||s.test(r))?e:(e=e.toLowerCase(),(e=i.reactCompat?e.replace(a,c):e.replace(l,c)).replace(n,h))}},38671,(e,i,r)=>{"use strict";var s=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(74499)),n=e.r(20461);function o(e,i){var r={};return e&&"string"==typeof e&&(0,s.default)(e,function(e,s){e&&s&&(r[(0,n.camelCase)(e,i)]=s)}),r}o.default=o,i.exports=o},99834,(e,i,r)=>{"use strict";var s=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},h=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=s.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||s.call(e,i)},c=function(e,i){o&&"__proto__"===i.name?o(e,i.name,{enumerable:!0,configurable:!0,value:i.newValue,writable:!0}):e[i.name]=i.newValue},d=function(e,i){if("__proto__"===i){if(!s.call(e,i))return;else if(l)return l(e,i).value}return e[i]};i.exports=function e(){var i,r,s,n,o,l,u=arguments[0],f=1,p=arguments.length,_=!1;for("boolean"==typeof u&&(_=u,u=arguments[1]||{},f=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});f<p;++f)if(i=arguments[f],null!=i)for(r in i)s=d(u,r),u!==(n=d(i,r))&&(_&&n&&(h(n)||(o=a(n)))?(o?(o=!1,l=s&&a(s)?s:[]):l=s&&h(s)?s:{},c(u,{name:r,newValue:e(_,l,n)})):void 0!==n&&c(u,{name:r,newValue:n}));return u}},36330,e=>{"use strict";let i,r,s,n,o,l,a,h,c,d,u,f;var p=e.i(85899),_=e.i(4232);function m({label:e,status:i,projectId:r,agentId:s,onStatusChange:n}){let o="running"===i?"bg-accent":"error"===i?"bg-error":"bg-text-muted",l=e=>{r&&s&&fetch(`/api/agents?project=${encodeURIComponent(r)}&agent=${encodeURIComponent(s)}&action=${e}`,{method:"POST"}).then(e=>e.json()).then(e=>{n&&e.state&&n(e.state)}).catch(()=>{})};return(0,p.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 h-7 shrink-0 border-b border-border",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[i&&(0,p.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${o}`}),(0,p.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:e})]}),r&&s&&(0,p.jsxs)("div",{className:"flex items-center gap-1",children:["running"!==i&&(0,p.jsx)("button",{onClick:()=>l("start"),className:"text-[10px] text-text-muted hover:text-accent transition-colors px-1",title:"Start",children:"▶"}),"running"===i&&(0,p.jsx)("button",{onClick:()=>l("stop"),className:"text-[10px] text-text-muted hover:text-error transition-colors px-1",title:"Stop",children:"■"}),(0,p.jsx)("button",{onClick:()=>l("restart"),className:"text-[10px] text-text-muted hover:text-accent transition-colors px-1",title:"Restart",children:"↻"})]})]})}var g=e.i(18540);let v=["@head start a new feature: <describe>","@head review the latest PR","@head what's our current sprint?"];function x({onInsert:e}){let[i,r]=(0,_.useState)(!1);return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center text-center px-6 py-10 gap-3",children:[(0,p.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none","aria-hidden":!0,className:"text-accent",children:[(0,p.jsx)("path",{d:"M6 8h28a2 2 0 0 1 2 2v17a2 2 0 0 1-2 2H16l-7 6v-6h-3a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),(0,p.jsx)("circle",{cx:"14",cy:"18",r:"1.4",fill:"currentColor"}),(0,p.jsx)("circle",{cx:"20",cy:"18",r:"1.4",fill:"currentColor"}),(0,p.jsx)("circle",{cx:"26",cy:"18",r:"1.4",fill:"currentColor"})]}),(0,p.jsx)("div",{className:"text-[13px] font-semibold text-text",children:"Ready when you are"}),(0,p.jsx)("div",{className:"text-[11px] text-text-muted",children:"Tell your team what to build. Try something like:"}),(0,p.jsx)("div",{className:"flex flex-col gap-1.5 mt-1 w-full max-w-sm",children:v.map(i=>(0,p.jsx)("button",{type:"button",onClick:()=>e(i),className:"text-left px-2 py-1 text-[11px] font-mono text-text-muted border border-border hover:text-accent hover:border-accent transition-colors truncate",children:i},i))}),(0,p.jsx)("button",{type:"button",onClick:()=>r(!0),className:"mt-2 text-[11px] text-text-muted underline underline-offset-2 hover:text-text",children:"How to Work"}),(0,p.jsx)(g.default,{open:i,onClose:()=>r(!1)})]})}let b=[{value:"soft-chime",label:"Soft Chime"},{value:"warm-bell",label:"Warm Bell"},{value:"click",label:"Click"},{value:"alert-tone",label:"Alert Tone"},{value:"pluck",label:"Pluck"}],y="quadwork_notification_sound",S="quadwork_notification_sound_choice",w="quadwork_notification_sound_background_only";function C(e){try{return window.localStorage.getItem(e)}catch{return null}}function k(e,i){try{window.localStorage.setItem(e,i)}catch{}}function E(){return"off"!==C(y)}function R(){let e=C(S);return e&&b.some(i=>i.value===e)?e:"soft-chime"}function N(){let e=C(w);return null===e||"off"!==e}let D={head:"#00ff88",reviewer1:"#4488ff",reviewer2:"#cc44ff",dev:"#ffcc00",user:"#e0e0e0",system:"#737373"},M=["head","reviewer1","reviewer2","dev","user"],P=[{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 T(e){return D[e.toLowerCase()]||"#e0e0e0"}let L=/(^|\s)(@(?:head|dev|reviewer1|reviewer2|user))(?![\w-])/gi;function B({projectId:e}){let[i,r]=(0,_.useState)("loading"),[s,n]=(0,_.useState)(""),[o,l]=(0,_.useState)("");return((0,_.useEffect)(()=>{fetch("/api/config").then(e=>{if(!e.ok)throw Error("config fetch failed");return e.json()}).then(i=>{let r=e?i.projects?.find(i=>i.id===e):null;n(r?.agentchattr_url||i.agentchattr_url||"http://127.0.0.1:8300"),l(r?.agentchattr_token||i.agentchattr_token||"")}).catch(()=>n("http://127.0.0.1:8300"))},[e]),(0,_.useEffect)(()=>{if("loading"!==i)return;let e=setTimeout(()=>{r(e=>"loading"===e?"api":e)},3e3);return()=>clearTimeout(e)},[i]),s)?"loading"===i||"iframe"===i?(0,p.jsxs)("div",{className:"w-full h-full",children:[(0,p.jsx)("iframe",{ref:e=>{e&&(e.onload=()=>{try{let i=e.contentDocument||e.contentWindow?.document;i&&i.body&&i.body.innerHTML.length>0?r("iframe"):r("api")}catch{r("api")}},e.onerror=()=>r("api"))},src:o?`${s}?token=${encodeURIComponent(o)}`:s,className:"w-full h-full border-0",style:{display:"loading"===i?"none":"block"},sandbox:"allow-same-origin allow-scripts allow-forms allow-popups"}),"loading"===i&&(0,p.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,p.jsx)("span",{className:"text-xs text-text-muted",children:"Connecting to AgentChattr..."})})]}):(0,p.jsx)(A,{projectId:e}):null}function A({projectId:e}){let i="general",[r,s]=(0,_.useState)([]),[n,o]=(0,_.useState)(""),[l,a]=(0,_.useState)(!1),[h,c]=(0,_.useState)(""),[d,u]=(0,_.useState)(!1),[f,m]=(0,_.useState)(0),[g,v]=(0,_.useState)(null),[b,y]=(0,_.useState)(null),S=(0,_.useRef)("user");(0,_.useEffect)(()=>{fetch("/api/config").then(e=>e.ok?e.json():null).then(e=>{e&&"string"==typeof e.operator_name&&e.operator_name&&(S.current=e.operator_name)}).catch(()=>{})},[]);let w=(0,_.useRef)(0),C=(0,_.useRef)(null),k=(0,_.useRef)(null),D=(0,_.useRef)(!1),B=(0,_.useRef)(!0),I=(0,_.useRef)(0);(0,_.useEffect)(()=>{w.current=0,s([])},[e]);let O=(0,_.useCallback)(()=>{fetch(`/api/chat?path=/api/messages&channel=${encodeURIComponent(i)}&cursor=${w.current}${e?`&project=${encodeURIComponent(e)}`:""}`).then(e=>{if(403===e.status)throw I.current<3?v(null):v("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=>{v(null);let i=Array.isArray(e)?e:e.messages||[];if(i.length>0){let e=w.current,r=S.current,n=e>0&&i.some(i=>i.id>e&&(void 0===i.type||"chat"===i.type)&&"user"!==i.sender&&i.sender!==r&&"system"!==i.sender);s(e=>{let r=new Set(e.map(e=>e.id)),s=i.filter(e=>!r.has(e.id));return s.length>0?[...e,...s]:e});let o=Math.max(...i.map(e=>e.id));o>w.current&&(w.current=o),n&&function(){if(!E()||N()&&document.hasFocus())return;let e=R();try{let i=new Audio(`/sounds/${e}.mp3`);i.volume=.6,i.play().catch(()=>{})}catch{}}()}}).catch(()=>{})},[i,e]);(0,_.useEffect)(()=>{O();let e=setInterval(O,3e3);return()=>clearInterval(e)},[O]),(0,_.useEffect)(()=>{B.current&&C.current&&(C.current.scrollTop=C.current.scrollHeight)},[r]);let[j,z]=(0,_.useState)(!1),[H,F]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=k.current;e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,120)+"px")},[n]);let W=()=>{let r=n.trim();if(!r||j)return;let s=r.startsWith("/")||/@(head|dev|reviewer1|reviewer2)\b/i.test(r)?r:`@head ${r}`;z(!0),F(null),fetch(`/api/chat${e?`?project=${encodeURIComponent(e)}`:""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:s,channel:i,sender:"user",...b?{reply_to:b.id}:{}})}).then(e=>{if(!e.ok)throw Error(`Send failed: ${e.status}`);o(""),y(null),setTimeout(O,300)}).catch(e=>{F(e.message),console.error(e.message)}).finally(()=>z(!1))},$=e=>{o(n.replace(/@\w*$/,`@${e} `)),a(!1),k.current?.focus()},U=e=>{o(e.includes(" ")?e:`${e} `),u(!1),k.current?.focus()},K=M.filter(e=>e.toLowerCase().startsWith(h)),q=P.filter(e=>e.command.toLowerCase().startsWith(n.toLowerCase()));return(0,p.jsxs)("div",{className:"flex flex-col h-full bg-bg",children:[g&&(0,p.jsx)("div",{className:"px-3 py-2 bg-red-900/30 border-b border-red-700/50 text-[11px] text-red-400",children:g}),(0,p.jsxs)("div",{ref:C,onScroll:()=>{if(!C.current)return;let{scrollTop:e,scrollHeight:i,clientHeight:r}=C.current;B.current=i-e-r<40},className:"flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-0.5",children:[0===r.length&&(0,p.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,p.jsx)(x,{onInsert:e=>{o(e),k.current?.focus()}})}),r.map(e=>{var i;let r;return(0,p.jsxs)("div",{className:"group flex gap-2 text-[12px] leading-5",children:[(0,p.jsx)("span",{className:"text-text-muted shrink-0 w-12 text-right tabular-nums",children:e.time?.slice(0,5)||""}),(0,p.jsx)("span",{className:"shrink-0 font-semibold w-10 text-right",style:{color:T(e.sender)},children:"reviewer1"===(r=(i=e.sender).toLowerCase())?"RE1":"reviewer2"===r?"RE2":i}),(0,p.jsx)("span",{className:"text-text break-words min-w-0 whitespace-pre-wrap flex-1",children:function(e){let i=[],r=0,s=0;for(let n of e.matchAll(L)){let o=n.index??0,l=n[1],a=n[2],h=o+l.length;h>r&&i.push(e.slice(r,h));let c=T(a.slice(1).toLowerCase());i.push((0,p.jsx)("span",{className:"inline-block px-1 py-0 rounded font-mono",style:{backgroundColor:`${c}22`,color:c},children:a},`m${s++}`)),r=h+a.length}return r<e.length&&i.push(e.slice(r)),i.length>0?i:[e]}(e.text)}),(0,p.jsx)("button",{type:"button",onClick:()=>{if(y({id:e.id,sender:e.sender}),new Set(["head","dev","reviewer1","reviewer2"]).has(e.sender.toLowerCase())){let i=`@${e.sender} `;o(e=>e.startsWith(i)?e:i)}k.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 #${e.id}`,children:"reply"})]},e.id)})]}),(0,p.jsxs)("div",{className:"relative shrink-0 border-t border-border",children:[l&&K.length>0&&(0,p.jsx)("div",{className:"absolute bottom-full left-0 right-0 border border-border bg-bg-surface",children:K.map(e=>(0,p.jsxs)("button",{onClick:()=>$(e),className:"w-full text-left px-3 py-1 text-[12px] hover:bg-[#1a1a1a] transition-colors",style:{color:T(e)},children:["@",e]},e))}),d&&q.length>0&&(0,p.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:q.map((e,i)=>{let r=i===Math.min(f,q.length-1);return(0,p.jsxs)("button",{onClick:()=>U(e.command),onMouseEnter:()=>m(i),className:`w-full text-left px-3 py-1 transition-colors flex items-baseline gap-2 ${r?"bg-[#1a1a1a]":"hover:bg-[#1a1a1a]"}`,children:[(0,p.jsx)("span",{className:"text-[12px] text-accent font-mono",children:e.command}),(0,p.jsx)("span",{className:"text-[10px] text-text-muted truncate",children:e.description})]},e.command)})}),H&&(0,p.jsx)("div",{className:"px-3 py-1 text-[11px] text-red-400 bg-red-900/20 border-b border-red-700/40",children:H}),b&&(0,p.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,p.jsxs)("span",{children:["Replying to ",(0,p.jsxs)("span",{style:{color:T(b.sender)},children:["@",b.sender]})," #",b.id]}),(0,p.jsx)("button",{type:"button",onClick:()=>y(null),className:"ml-auto hover:text-text",title:"Cancel reply (Esc)",children:"✕"})]}),(0,p.jsxs)("div",{className:"flex items-end gap-1 px-1",children:[(0,p.jsx)("textarea",{ref:k,rows:1,value:n,onChange:e=>(e=>{o(e);let i=e.match(/@(\w*)$/);if(i){a(!0),c(i[1].toLowerCase()),u(!1);return}if(a(!1),e.startsWith("/")){let i=e.slice(1).includes(" "),r=e.startsWith("/poetry");u(!i||r),m(0)}else u(!1)})(e.target.value),onCompositionStart:()=>{D.current=!0},onCompositionEnd:()=>{D.current=!1},onKeyDown:e=>{if("Tab"===e.key&&l&&K.length>0){e.preventDefault(),$(K[0]);return}if(d&&q.length>0){if("ArrowDown"===e.key){e.preventDefault(),m(e=>(e+1)%q.length);return}if("ArrowUp"===e.key){e.preventDefault(),m(e=>(e-1+q.length)%q.length);return}if("Tab"===e.key||"Enter"===e.key&&!e.shiftKey){e.preventDefault();let i=Math.min(f,q.length-1);U(q[i].command);return}}"Enter"!==e.key||e.shiftKey||D.current||e.nativeEvent.isComposing||(e.preventDefault(),W()),"Escape"===e.key&&(a(!1),u(!1),b&&y(null))},placeholder:`Message #${i}...`,disabled:j,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,p.jsx)("button",{onClick:W,disabled:j||!n.trim(),className:"shrink-0 px-2 py-1 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:j?"…":"Send"})]})]})]})}function I(){}function O(){}let j=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,z=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,H={};function F(e,i){return((i||H).jsx?z:j).test(e)}let W=/[ \t\n\f\r]/g;function $(e){return""===e.replace(W,"")}class U{constructor(e,i){this.attribute=i,this.property=e}}U.prototype.attribute="",U.prototype.booleanish=!1,U.prototype.boolean=!1,U.prototype.commaOrSpaceSeparated=!1,U.prototype.commaSeparated=!1,U.prototype.defined=!1,U.prototype.mustUseProperty=!1,U.prototype.number=!1,U.prototype.overloadedBoolean=!1,U.prototype.property="",U.prototype.spaceSeparated=!1,U.prototype.space=void 0;let K=0,q=Q(),V=Q(),Y=Q(),X=Q(),G=Q(),J=Q(),Z=Q();function Q(){return 2**++K}e.s(["boolean",0,q,"booleanish",0,V,"commaOrSpaceSeparated",0,Z,"commaSeparated",0,J,"number",0,X,"overloadedBoolean",0,Y,"spaceSeparated",0,G],61163);var ee=e.i(61163);let et=Object.keys(ee);class ei extends U{constructor(e,i,r,s){let n=-1;if(super(e,i),function(e,i,r){r&&(e[i]=r)}(this,"space",s),"number"==typeof r)for(;++n<et.length;){const e=et[n];!function(e,i,r){r&&(e[i]=r)}(this,et[n],(r&ee[e])===ee[e])}}}function er(e){return e.toLowerCase()}ei.prototype.defined=!0;let es=/[A-Z]/g,en=/-[a-z]/g,eo=/^data[-\w.:]+$/i;function el(e){return"-"+e.toLowerCase()}function ea(e){return e.charAt(1).toUpperCase()}let eh={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 ec{constructor(e,i,r){this.normal=i,this.property=e,r&&(this.space=r)}}function ed(e,i){let r={},s={};for(let i of e)Object.assign(r,i.property),Object.assign(s,i.normal);return new ec(r,s,i)}function eu(e){let i={},r={};for(let[s,n]of Object.entries(e.properties)){let o=new ei(s,e.transform(e.attributes||{},s),n,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(o.mustUseProperty=!0),i[s]=o,r[er(s)]=s,r[er(o.attribute)]=s}return new ec(i,r,e.space)}ec.prototype.normal={},ec.prototype.property={},ec.prototype.space=void 0;let ef=eu({properties:{ariaActiveDescendant:null,ariaAtomic:V,ariaAutoComplete:null,ariaBusy:V,ariaChecked:V,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:G,ariaCurrent:null,ariaDescribedBy:G,ariaDetails:null,ariaDisabled:V,ariaDropEffect:G,ariaErrorMessage:null,ariaExpanded:V,ariaFlowTo:G,ariaGrabbed:V,ariaHasPopup:null,ariaHidden:V,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:G,ariaLevel:X,ariaLive:null,ariaModal:V,ariaMultiLine:V,ariaMultiSelectable:V,ariaOrientation:null,ariaOwns:G,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:V,ariaReadOnly:V,ariaRelevant:null,ariaRequired:V,ariaRoleDescription:G,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:V,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform:(e,i)=>"role"===i?i:"aria-"+i.slice(4).toLowerCase()});function ep(e,i){return i in e?e[i]:i}function e_(e,i){return ep(e,i.toLowerCase())}let em=eu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:J,acceptCharset:G,accessKey:G,action:null,allow:null,allowFullScreen:q,allowPaymentRequest:q,allowUserMedia:q,alt:null,as:null,async:q,autoCapitalize:null,autoComplete:G,autoFocus:q,autoPlay:q,blocking:G,capture:null,charSet:null,checked:q,cite:null,className:G,cols:X,colSpan:null,content:null,contentEditable:V,controls:q,controlsList:G,coords:X|J,crossOrigin:null,data:null,dateTime:null,decoding:null,default:q,defer:q,dir:null,dirName:null,disabled:q,download:Y,draggable:V,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:q,formTarget:null,headers:G,height:X,hidden:Y,high:X,href:null,hrefLang:null,htmlFor:G,httpEquiv:G,id:null,imageSizes:null,imageSrcSet:null,inert:q,inputMode:null,integrity:null,is:null,isMap:q,itemId:null,itemProp:G,itemRef:G,itemScope:q,itemType:G,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:q,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:q,muted:q,name:null,nonce:null,noModule:q,noValidate:q,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:q,optimum:X,pattern:null,ping:G,placeholder:null,playsInline:q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:q,referrerPolicy:null,rel:G,required:q,reversed:q,rows:X,rowSpan:X,sandbox:G,scope:null,scoped:q,seamless:q,selected:q,shadowRootClonable:q,shadowRootDelegatesFocus:q,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:V,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:q,useMap:null,value:V,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:G,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:q,declare:q,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:q,noHref:q,noShade:q,noWrap:q,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:V,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:q,disableRemotePlayback:q,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:e_}),eg=eu({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:Z,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:G,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:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:q,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,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:J,g2:J,glyphName:J,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:Z,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,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:X,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:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:G,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Z,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Z,rev:Z,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Z,requiredFeatures:Z,requiredFonts:Z,requiredFormats:Z,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:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:Z,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Z,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Z,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ep}),ev=eu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,i)=>"xlink:"+i.slice(5).toLowerCase()}),ex=eu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:e_}),eb=eu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,i)=>"xml:"+i.slice(3).toLowerCase()}),ey=ed([ef,em,ev,ex,eb],"html"),eS=ed([ef,eg,ev,ex,eb],"svg");var ew=e.i(38671);let eC=eE("end"),ek=eE("start");function eE(e){return function(i){let r=i&&i.position&&i.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function eR(e){return e&&"object"==typeof e?"position"in e||"type"in e?eD(e.position):"start"in e||"end"in e?eD(e):"line"in e||"column"in e?eN(e):"":""}function eN(e){return eM(e&&e.line)+":"+eM(e&&e.column)}function eD(e){return eN(e&&e.start)+"-"+eN(e&&e.end)}function eM(e){return e&&"number"==typeof e?e:1}class eP extends Error{constructor(e,i,r){super(),"string"==typeof i&&(r=i,i=void 0);let s="",n={},o=!1;if(i&&(n="line"in i&&"column"in i||"start"in i&&"end"in i?{place:i}:"type"in i?{ancestors:[i],place:i.position}:{...i}),"string"==typeof e?s=e:!n.cause&&e&&(o=!0,s=e.message,n.cause=e),!n.ruleId&&!n.source&&"string"==typeof r){const e=r.indexOf(":");-1===e?n.ruleId=r:(n.source=r.slice(0,e),n.ruleId=r.slice(e+1))}if(!n.place&&n.ancestors&&n.ancestors){const e=n.ancestors[n.ancestors.length-1];e&&(n.place=e.position)}const l=n.place&&"start"in n.place?n.place.start:n.place;this.ancestors=n.ancestors||void 0,this.cause=n.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=eR(n.place)||"1:1",this.place=n.place||void 0,this.reason=this.message,this.ruleId=n.ruleId||void 0,this.source=n.source||void 0,this.stack=o&&n.cause&&"string"==typeof n.cause.stack?n.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}eP.prototype.file="",eP.prototype.name="",eP.prototype.reason="",eP.prototype.message="",eP.prototype.stack="",eP.prototype.column=void 0,eP.prototype.line=void 0,eP.prototype.ancestors=void 0,eP.prototype.cause=void 0,eP.prototype.fatal=void 0,eP.prototype.place=void 0,eP.prototype.ruleId=void 0,eP.prototype.source=void 0;let eT={}.hasOwnProperty,eL=new Map,eB=/[A-Z]/g,eA=new Set(["table","tbody","thead","tfoot","tr"]),eI=new Set(["td","th"]),eO="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ej(e,i,r){var s,n,o,l,a,h,c,d,u;let f,p,_,m,g,v,x,b,y,S,w;return"element"===i.type?(s=e,n=i,o=r,p=f=s.schema,"svg"===n.tagName.toLowerCase()&&"html"===f.space&&(s.schema=eS),s.ancestors.push(n),_=eW(s,n.tagName,!1),m=function(e,i){let r,s,n={};for(s in i.properties)if("children"!==s&&eT.call(i.properties,s)){let o=function(e,i,r){let s=function(e,i){let r=er(i),s=i,n=U;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&eo.test(i)){if("-"===i.charAt(4)){let e=i.slice(5).replace(en,ea);s="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=i.slice(4);if(!en.test(e)){let r=e.replace(es,el);"-"!==r.charAt(0)&&(r="-"+r),i="data"+r}}n=ei}return new n(s,i)}(e.schema,i);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){var n;let i;if(Array.isArray(r)&&(r=s.commaSeparated?(i={},(""===(n=r)[n.length-1]?[...n,""]:n).join((i.padRight?" ":"")+","+(!1===i.padLeft?"":" ")).trim()):r.join(" ").trim()),"style"===s.property){let i="object"==typeof r?r:function(e,i){try{return(0,ew.default)(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let i=new eP("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=eO+"#cannot-parse-style-attribute",i}}(e,String(r));return"css"===e.stylePropertyNameCase&&(i=function(e){let i,r={};for(i in e)eT.call(e,i)&&(r[function(e){let i=e.replace(eB,eU);return"ms-"===i.slice(0,3)&&(i="-"+i),i}(i)]=e[i]);return r}(i)),["style",i]}return["react"===e.elementAttributeNameCase&&s.space?eh[s.property]||s.property:s.attribute,r]}}(e,s,i.properties[s]);if(o){let[s,l]=o;e.tableCellAlignToStyle&&"align"===s&&"string"==typeof l&&eI.has(i.tagName)?r=l:n[s]=l}}return r&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),n}(s,n),g=eF(s,n),eA.has(n.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&$(e.value):$(e))})),ez(s,m,_,n),eH(m,g),s.ancestors.pop(),s.schema=f,s.create(n,_,m,o)):"mdxFlowExpression"===i.type||"mdxTextExpression"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater){let r=i.data.estree.body[0];return I("ExpressionStatement"===r.type),e.evaluater.evaluateExpression(r.expression)}e$(e,i.position)}(e,i):"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?(l=e,a=i,h=r,x=v=l.schema,"svg"===a.name&&"html"===v.space&&(l.schema=eS),l.ancestors.push(a),b=null===a.name?l.Fragment:eW(l,a.name,!0),y=function(e,i){let r={};for(let s of i.attributes)if("mdxJsxExpressionAttribute"===s.type)if(s.data&&s.data.estree&&e.evaluater){let i=s.data.estree.body[0];I("ExpressionStatement"===i.type);let n=i.expression;I("ObjectExpression"===n.type);let o=n.properties[0];I("SpreadElement"===o.type),Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else e$(e,i.position);else{let n,o=s.name;if(s.value&&"object"==typeof s.value)if(s.value.data&&s.value.data.estree&&e.evaluater){let i=s.value.data.estree.body[0];I("ExpressionStatement"===i.type),n=e.evaluater.evaluateExpression(i.expression)}else e$(e,i.position);else n=null===s.value||s.value;r[o]=n}return r}(l,a),S=eF(l,a),ez(l,y,b,a),eH(y,S),l.ancestors.pop(),l.schema=v,l.create(a,b,y,h)):"mdxjsEsm"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);e$(e,i.position)}(e,i):"root"===i.type?(c=e,d=i,u=r,eH(w={},eF(c,d)),c.create(d,c.Fragment,w,u)):"text"===i.type?i.value:void 0}function ez(e,i,r,s){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(i.node=s)}function eH(e,i){if(i.length>0){let r=i.length>1?i:i[0];r&&(e.children=r)}}function eF(e,i){let r=[],s=-1,n=e.passKeys?new Map:eL;for(;++s<i.children.length;){let o,l=i.children[s];if(e.passKeys){let e="element"===l.type?l.tagName:"mdxJsxFlowElement"===l.type||"mdxJsxTextElement"===l.type?l.name:void 0;if(e){let i=n.get(e)||0;o=e+"-"+i,n.set(e,i+1)}}let a=ej(e,l,o);void 0!==a&&r.push(a)}return r}function eW(e,i,r){let s;if(r)if(i.includes(".")){let e,r=i.split("."),n=-1;for(;++n<r.length;){let i=F(r[n])?{type:"Identifier",name:r[n]}:{type:"Literal",value:r[n]};e=e?{type:"MemberExpression",object:e,property:i,computed:!!(n&&"Literal"===i.type),optional:!1}:i}I(e,"always a result"),s=e}else s=F(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};else s={type:"Literal",value:i};if("Literal"===s.type){let i=s.value;return eT.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(s);e$(e)}function e$(e,i){let r=new eP("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=eO+"#cannot-handle-mdx-estrees-without-createevaluater",r}function eU(e){return"-"+e.toLowerCase()}let eK={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"]},eq={};function eV(e,i,r){var s;if((s=e)&&"object"==typeof s){if("value"in e)return"html"!==e.type||r?e.value:"";if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eY(e.children,i,r)}return Array.isArray(e)?eY(e,i,r):""}function eY(e,i,r){let s=[],n=-1;for(;++n<e.length;)s[n]=eV(e[n],i,r);return s.join("")}function eX(e,i,r,s){let n,o=e.length,l=0;if(i=i<0?-i>o?0:o+i:i>o?o:i,r=r>0?r:0,s.length<1e4)(n=Array.from(s)).unshift(i,r),e.splice(...n);else for(r&&e.splice(i,r);l<s.length;)(n=s.slice(l,l+1e4)).unshift(i,0),e.splice(...n),l+=1e4,i+=1e4}function eG(e,i){return e.length>0?(eX(e,e.length,0,i),e):i}let eJ={}.hasOwnProperty,eZ=te(/[A-Za-z]/),eQ=te(/[\dA-Za-z]/),e0=te(/[#-'*+\--9=?A-Z^-~]/);function e1(e){return null!==e&&(e<32||127===e)}let e2=te(/\d/),e5=te(/[\dA-Fa-f]/),e3=te(/[!-/:-@[-`{-~]/);function e4(e){return null!==e&&e<-2}function e6(e){return null!==e&&(e<0||32===e)}function e9(e){return -2===e||-1===e||32===e}let e8=te(/\p{P}|\p{S}/u),e7=te(/\s/);function te(e){return function(i){return null!==i&&i>-1&&e.test(String.fromCharCode(i))}}function tt(e,i,r,s){let n=s?s-1:1/0,o=0;return function(s){return e9(s)?(e.enter(r),function s(l){return e9(l)&&o++<n?(e.consume(l),s):(e.exit(r),i(l))}(s)):i(s)}}let ti={tokenize:function(e){let i,r=e.attempt(this.parser.constructs.contentInitial,function(i){return null===i?void e.consume(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),tt(e,r,"linePrefix"))},function(r){return e.enter("paragraph"),function r(s){let n=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=n),i=n,function i(s){if(null===s){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return e4(s)?(e.consume(s),e.exit("chunkText"),r):(e.consume(s),i)}(s)}(r)});return r}},tr={tokenize:function(e){let i,r,s,n=this,o=[],l=0;return a;function a(i){if(l<o.length){let r=o[l];return n.containerState=r[1],e.attempt(r[0].continuation,h,c)(i)}return c(i)}function h(e){if(l++,n.containerState._closeFlow){let r;n.containerState._closeFlow=void 0,i&&v();let s=n.events.length,o=s;for(;o--;)if("exit"===n.events[o][0]&&"chunkFlow"===n.events[o][1].type){r=n.events[o][1].end;break}g(l);let a=s;for(;a<n.events.length;)n.events[a][1].end={...r},a++;return eX(n.events,o+1,0,n.events.slice(s)),n.events.length=a,c(e)}return a(e)}function c(r){if(l===o.length){if(!i)return f(r);if(i.currentConstruct&&i.currentConstruct.concrete)return _(r);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(ts,d,u)(r)}function d(e){return i&&v(),g(l),f(e)}function u(e){return n.parser.lazy[n.now().line]=l!==o.length,s=n.now().offset,_(e)}function f(i){return n.containerState={},e.attempt(ts,p,_)(i)}function p(e){return l++,o.push([n.currentConstruct,n.containerState]),f(e)}function _(s){if(null===s){i&&v(),g(0),e.consume(s);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:r}),function i(r){if(null===r){m(e.exit("chunkFlow"),!0),g(0),e.consume(r);return}return e4(r)?(e.consume(r),m(e.exit("chunkFlow")),l=0,n.interrupt=void 0,a):(e.consume(r),i)}(s)}function m(e,o){let a=n.sliceStream(e);if(o&&a.push(null),e.previous=r,r&&(r.next=e),r=e,i.defineSkip(e.start),i.write(a),n.parser.lazy[e.start.line]){let e,r,o=i.events.length;for(;o--;)if(i.events[o][1].start.offset<s&&(!i.events[o][1].end||i.events[o][1].end.offset>s))return;let a=n.events.length,h=a;for(;h--;)if("exit"===n.events[h][0]&&"chunkFlow"===n.events[h][1].type){if(e){r=n.events[h][1].end;break}e=!0}for(g(l),o=a;o<n.events.length;)n.events[o][1].end={...r},o++;eX(n.events,h+1,0,n.events.slice(a)),n.events.length=o}}function g(i){let r=o.length;for(;r-- >i;){let i=o[r];n.containerState=i[1],i[0].exit.call(n,e)}o.length=i}function v(){i.write([null]),r=void 0,i=void 0,n.containerState._closeFlow=void 0}}},ts={tokenize:function(e,i,r){return tt(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},tn={partial:!0,tokenize:function(e,i,r){return function(i){return e9(i)?tt(e,s,"linePrefix")(i):s(i)};function s(e){return null===e||e4(e)?i(e):r(e)}}};class to{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,i){let r=null==i?1/0:i;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,i,r){this.setCursor(Math.trunc(e));let s=this.right.splice(this.right.length-(i||0),1/0);return r&&tl(this.left,r),s.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),tl(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tl(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 i=this.left.splice(e,1/0);tl(this.right,i.reverse())}else{let i=this.right.splice(this.left.length+this.right.length-e,1/0);tl(this.left,i.reverse())}}}function tl(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function ta(e){let i,r,s,n,o,l,a,h={},c=-1,d=new to(e);for(;++c<d.length;){for(;c in h;)c=h[c];if(i=d.get(c),c&&"chunkFlow"===i[1].type&&"listItemPrefix"===d.get(c-1)[1].type&&((s=0)<(l=i[1]._tokenizer.events).length&&"lineEndingBlank"===l[s][1].type&&(s+=2),s<l.length&&"content"===l[s][1].type))for(;++s<l.length&&"content"!==l[s][1].type;)"chunkText"===l[s][1].type&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if("enter"===i[0])i[1].contentType&&(Object.assign(h,function(e,i){let r,s,n=e.get(i)[1],o=e.get(i)[2],l=i-1,a=[],h=n._tokenizer;!h&&(h=o.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(h._contentTypeTextTrailing=!0));let c=h.events,d=[],u={},f=-1,p=n,_=0,m=0,g=[0];for(;p;){for(;e.get(++l)[1]!==p;);a.push(l),!p._tokenizer&&(r=o.sliceStream(p),p.next||r.push(null),s&&h.defineSkip(p.start),p._isInFirstContentOfListItem&&(h._gfmTasklistFirstContentOfListItem=!0),h.write(r),p._isInFirstContentOfListItem&&(h._gfmTasklistFirstContentOfListItem=void 0)),s=p,p=p.next}for(p=n;++f<c.length;)"exit"===c[f][0]&&"enter"===c[f-1][0]&&c[f][1].type===c[f-1][1].type&&c[f][1].start.line!==c[f][1].end.line&&(m=f+1,g.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(h.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let i=c.slice(g[f],g[f+1]),r=a.pop();d.push([r,r+i.length-1]),e.splice(r,2,i)}for(d.reverse(),f=-1;++f<d.length;)u[_+d[f][0]]=_+d[f][1],_+=d[f][1]-d[f][0]-1;return u}(d,c)),c=h[c],a=!0);else if(i[1]._container){for(s=c,r=void 0;s--;)if("lineEnding"===(n=d.get(s))[1].type||"lineEndingBlank"===n[1].type)"enter"===n[0]&&(r&&(d.get(r)[1].type="lineEndingBlank"),n[1].type="lineEnding",r=s);else if("linePrefix"===n[1].type||"listItemIndent"===n[1].type);else break;r&&(i[1].end={...d.get(r)[1].start},(o=d.slice(r,c)).unshift(i),d.splice(r,c-r+1,o))}}return eX(e,0,1/0,d.slice(0)),!a}let th={resolve:function(e){return ta(e),e},tokenize:function(e,i){let r;return function(i){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),s(i)};function s(i){return null===i?n(i):e4(i)?e.check(tc,o,n)(i):(e.consume(i),s)}function n(r){return e.exit("chunkContent"),e.exit("content"),i(r)}function o(i){return e.consume(i),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,s}}},tc={partial:!0,tokenize:function(e,i,r){let s=this;return function(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),tt(e,n,"linePrefix")};function n(n){if(null===n||e4(n))return r(n);let o=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(n):e.interrupt(s.parser.constructs.flow,r,i)(n)}}},td={tokenize:function(e){let i=this,r=e.attempt(tn,function(s){return null===s?void e.consume(s):(e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,s,tt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(th,s)),"linePrefix")));return r;function s(s){return null===s?void e.consume(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i.currentConstruct=void 0,r)}}},tu={resolveAll:tm()},tf=t_("string"),tp=t_("text");function t_(e){return{resolveAll:tm("text"===e?tg:void 0),tokenize:function(i){let r=this,s=this.parser.constructs[e],n=i.attempt(s,o,l);return o;function o(e){return h(e)?n(e):l(e)}function l(e){return null===e?void i.consume(e):(i.enter("data"),i.consume(e),a)}function a(e){return h(e)?(i.exit("data"),n(e)):(i.consume(e),a)}function h(e){if(null===e)return!0;let i=s[e],n=-1;if(i)for(;++n<i.length;){let e=i[n];if(!e.previous||e.previous.call(r,r.previous))return!0}return!1}}}}function tm(e){return function(i,r){let s,n=-1;for(;++n<=i.length;)void 0===s?i[n]&&"data"===i[n][1].type&&(s=n,n++):i[n]&&"data"===i[n][1].type||(n!==s+2&&(i[s][1].end=i[n-1][1].end,i.splice(s+2,n-s-2),n=s+2),s=void 0);return e?e(i,r):i}}function tg(e,i){let r=0;for(;++r<=e.length;)if((r===e.length||"lineEnding"===e[r][1].type)&&"data"===e[r-1][1].type){let s,n=e[r-1][1],o=i.sliceStream(n),l=o.length,a=-1,h=0;for(;l--;){let e=o[l];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)h++,a--;if(a)break;a=-1}else if(-2===e)s=!0,h++;else if(-1===e);else{l++;break}}if(i._contentTypeTextTrailing&&r===e.length&&(h=0),h){let o={type:r===e.length||s||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:n.start._bufferIndex+a,_index:n.start._index+l,line:n.end.line,column:n.end.column-h,offset:n.end.offset-h},end:{...n.end}};n.end={...o.start},n.start.offset===n.end.offset?Object.assign(n,o):(e.splice(r,0,["enter",o,i],["exit",o,i]),r+=2)}r++}return e}function tv(e){return null===e||e6(e)||e7(e)?1:e8(e)?2:void 0}function tx(e,i,r){let s=[],n=-1;for(;++n<e.length;){let o=e[n].resolveAll;o&&!s.includes(o)&&(i=o(i,r),s.push(o))}return i}let tb={name:"attention",resolveAll:function(e,i){let r,s,n,o,l,a,h,c,d=-1;for(;++d<e.length;)if("enter"===e[d][0]&&"attentionSequence"===e[d][1].type&&e[d][1]._close){for(r=d;r--;)if("exit"===e[r][0]&&"attentionSequence"===e[r][1].type&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[d][1]).charCodeAt(0)){if((e[r][1]._close||e[d][1]._open)&&(e[d][1].end.offset-e[d][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[d][1].end.offset-e[d][1].start.offset)%3))continue;a=e[r][1].end.offset-e[r][1].start.offset>1&&e[d][1].end.offset-e[d][1].start.offset>1?2:1;let u={...e[r][1].end},f={...e[d][1].start};ty(u,-a),ty(f,a),o={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[d][1].start},end:f},n={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[d][1].start}},s={type:a>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[d][1].start={...l.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=eG(h,[["enter",e[r][1],i],["exit",e[r][1],i]])),h=eG(h,[["enter",s,i],["enter",o,i],["exit",o,i],["enter",n,i]]),h=eG(h,tx(i.parser.constructs.insideSpan.null,e.slice(r+1,d),i)),h=eG(h,[["exit",n,i],["enter",l,i],["exit",l,i],["exit",s,i]]),e[d][1].end.offset-e[d][1].start.offset?(c=2,h=eG(h,[["enter",e[d][1],i],["exit",e[d][1],i]])):c=0,eX(e,r-1,d-r+3,h),d=r+h.length-c-2;break}}for(d=-1;++d<e.length;)"attentionSequence"===e[d][1].type&&(e[d][1].type="data");return e},tokenize:function(e,i){let r,s=this.parser.constructs.attentionMarkers.null,n=this.previous,o=tv(n);return function(l){return r=l,e.enter("attentionSequence"),function l(a){if(a===r)return e.consume(a),l;let h=e.exit("attentionSequence"),c=tv(a),d=!c||2===c&&o||s.includes(a),u=!o||2===o&&c||s.includes(n);return h._open=!!(42===r?d:d&&(o||!u)),h._close=!!(42===r?u:u&&(c||!d)),i(a)}(l)}}};function ty(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}let tS={continuation:{tokenize:function(e,i,r){let s=this;return function(i){return e9(i)?tt(e,n,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):n(i)};function n(s){return e.attempt(tS,i,r)(s)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,i,r){let s=this;return function(i){if(62===i){let r=s.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),n}return r(i)};function n(r){return e9(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(r))}}},tw={name:"characterEscape",tokenize:function(e,i,r){return function(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s};function s(s){return e3(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(s)}}},tC=document.createElement("i");function tk(e){let i="&"+e+";";tC.innerHTML=i;let r=tC.textContent;return(59!==r.charCodeAt(r.length-1)||"semi"===e)&&r!==i&&r}let tE={name:"characterReference",tokenize:function(e,i,r){let s,n,o=this,l=0;return function(i){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(i),e.exit("characterReferenceMarker"),a};function a(i){return 35===i?(e.enter("characterReferenceMarkerNumeric"),e.consume(i),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),s=31,n=eQ,c(i))}function h(i){return 88===i||120===i?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(i),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,n=e5,c):(e.enter("characterReferenceValue"),s=7,n=e2,c(i))}function c(a){if(59===a&&l){let s=e.exit("characterReferenceValue");return n!==eQ||tk(o.sliceSerialize(s))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),i):r(a)}return n(a)&&l++<s?(e.consume(a),c):r(a)}}},tR={partial:!0,tokenize:function(e,i,r){let s=this;return function(i){return null===i?r(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n)};function n(e){return s.parser.lazy[s.now().line]?r(e):i(e)}}},tN={concrete:!0,name:"codeFenced",tokenize:function(e,i,r){let s,n=this,o={partial:!0,tokenize:function(e,i,r){let o=0;return function(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),l};function l(i){return e.enter("codeFencedFence"),e9(i)?tt(e,h,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):h(i)}function h(i){return i===s?(e.enter("codeFencedFenceSequence"),function i(n){return n===s?(o++,e.consume(n),i):o>=a?(e.exit("codeFencedFenceSequence"),e9(n)?tt(e,c,"whitespace")(n):c(n)):r(n)}(i)):r(i)}function c(s){return null===s||e4(s)?(e.exit("codeFencedFence"),i(s)):r(s)}}},l=0,a=0;return function(i){var o;let c;return o=i,l=(c=n.events[n.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,s=o,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function i(n){return n===s?(a++,e.consume(n),i):a<3?r(n):(e.exit("codeFencedFenceSequence"),e9(n)?tt(e,h,"whitespace")(n):h(n))}(o)};function h(o){return null===o||e4(o)?(e.exit("codeFencedFence"),n.interrupt?i(o):e.check(tR,d,_)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function i(n){return null===n||e4(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(n)):e9(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,c,"whitespace")(n)):96===n&&n===s?r(n):(e.consume(n),i)}(o))}function c(i){return null===i||e4(i)?h(i):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function i(n){return null===n||e4(n)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(n)):96===n&&n===s?r(n):(e.consume(n),i)}(i))}function d(i){return e.attempt(o,_,u)(i)}function u(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),f}function f(i){return l>0&&e9(i)?tt(e,p,"linePrefix",l+1)(i):p(i)}function p(i){return null===i||e4(i)?e.check(tR,d,_)(i):(e.enter("codeFlowValue"),function i(r){return null===r||e4(r)?(e.exit("codeFlowValue"),p(r)):(e.consume(r),i)}(i))}function _(r){return e.exit("codeFenced"),i(r)}}},tD={name:"codeIndented",tokenize:function(e,i,r){let s=this;return function(i){return e.enter("codeIndented"),tt(e,n,"linePrefix",5)(i)};function n(i){let n=s.events[s.events.length-1];return n&&"linePrefix"===n[1].type&&n[2].sliceSerialize(n[1],!0).length>=4?function i(r){return null===r?o(r):e4(r)?e.attempt(tM,i,o)(r):(e.enter("codeFlowValue"),function r(s){return null===s||e4(s)?(e.exit("codeFlowValue"),i(s)):(e.consume(s),r)}(r))}(i):r(i)}function o(r){return e.exit("codeIndented"),i(r)}}},tM={partial:!0,tokenize:function(e,i,r){let s=this;return n;function n(i){return s.parser.lazy[s.now().line]?r(i):e4(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n):tt(e,o,"linePrefix",5)(i)}function o(e){let o=s.events[s.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(e):e4(e)?n(e):r(e)}}};function tP(e,i,r,s,n,o,l,a,h){let c=h||1/0,d=0;return function(i){return 60===i?(e.enter(s),e.enter(n),e.enter(o),e.consume(i),e.exit(o),u):null===i||32===i||41===i||e1(i)?r(i):(e.enter(s),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),_(i))};function u(r){return 62===r?(e.enter(o),e.consume(r),e.exit(o),e.exit(n),e.exit(s),i):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(r))}function f(i){return 62===i?(e.exit("chunkString"),e.exit(a),u(i)):null===i||60===i||e4(i)?r(i):(e.consume(i),92===i?p:f)}function p(i){return 60===i||62===i||92===i?(e.consume(i),f):f(i)}function _(n){return!d&&(null===n||41===n||e6(n))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(s),i(n)):d<c&&40===n?(e.consume(n),d++,_):41===n?(e.consume(n),d--,_):null===n||32===n||40===n||e1(n)?r(n):(e.consume(n),92===n?m:_)}function m(i){return 40===i||41===i||92===i?(e.consume(i),_):_(i)}}function tT(e,i,r,s,n,o){let l,a=this,h=0;return function(i){return e.enter(s),e.enter(n),e.consume(i),e.exit(n),e.enter(o),c};function c(u){return h>999||null===u||91===u||93===u&&!l||94===u&&!h&&"_hiddenFootnoteSupport"in a.parser.constructs?r(u):93===u?(e.exit(o),e.enter(n),e.consume(u),e.exit(n),e.exit(s),i):e4(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(u))}function d(i){return null===i||91===i||93===i||e4(i)||h++>999?(e.exit("chunkString"),c(i)):(e.consume(i),l||(l=!e9(i)),92===i?u:d)}function u(i){return 91===i||92===i||93===i?(e.consume(i),h++,d):d(i)}}function tL(e,i,r,s,n,o){let l;return function(i){return 34===i||39===i||40===i?(e.enter(s),e.enter(n),e.consume(i),e.exit(n),l=40===i?41:i,a):r(i)};function a(r){return r===l?(e.enter(n),e.consume(r),e.exit(n),e.exit(s),i):(e.enter(o),h(r))}function h(i){return i===l?(e.exit(o),a(l)):null===i?r(i):e4(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),tt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(i))}function c(i){return i===l||null===i||e4(i)?(e.exit("chunkString"),h(i)):(e.consume(i),92===i?d:c)}function d(i){return i===l||92===i?(e.consume(i),c):c(i)}}function tB(e,i){let r;return function s(n){return e4(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),r=!0,s):e9(n)?tt(e,s,r?"linePrefix":"lineSuffix")(n):i(n)}}function tA(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let tI={partial:!0,tokenize:function(e,i,r){return function(i){return e6(i)?tB(e,s)(i):r(i)};function s(i){return tL(e,n,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function n(i){return e9(i)?tt(e,o,"whitespace")(i):o(i)}function o(e){return null===e||e4(e)?i(e):r(e)}}},tO=["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"],tj=["pre","script","style","textarea"],tz={partial:!0,tokenize:function(e,i,r){return function(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(tn,i,r)}}},tH={partial:!0,tokenize:function(e,i,r){let s=this;return function(i){return e4(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n):r(i)};function n(e){return s.parser.lazy[s.now().line]?r(e):i(e)}}},tF={name:"labelEnd",resolveAll:function(e){let i=-1,r=[];for(;++i<e.length;){let s=e[i][1];if(r.push(e[i]),"labelImage"===s.type||"labelLink"===s.type||"labelEnd"===s.type){let e="labelImage"===s.type?4:2;s.type="data",i+=e}}return e.length!==r.length&&eX(e,0,e.length,r),e},resolveTo:function(e,i){let r,s,n,o,l=e.length,a=0;for(;l--;)if(r=e[l][1],s){if("link"===r.type||"labelLink"===r.type&&r._inactive)break;"enter"===e[l][0]&&"labelLink"===r.type&&(r._inactive=!0)}else if(n){if("enter"===e[l][0]&&("labelImage"===r.type||"labelLink"===r.type)&&!r._balanced&&(s=l,"labelLink"!==r.type)){a=2;break}}else"labelEnd"===r.type&&(n=l);let h={type:"labelLink"===e[s][1].type?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[n][1].end}},d={type:"labelText",start:{...e[s+a+2][1].end},end:{...e[n-2][1].start}};return o=eG(o=[["enter",h,i],["enter",c,i]],e.slice(s+1,s+a+3)),o=eG(o,[["enter",d,i]]),o=eG(o,tx(i.parser.constructs.insideSpan.null,e.slice(s+a+4,n-3),i)),o=eG(o,[["exit",d,i],e[n-2],e[n-1],["exit",c,i]]),o=eG(o,e.slice(n+1)),o=eG(o,[["exit",h,i]]),eX(e,s,e.length,o),e},tokenize:function(e,i,r){let s,n,o=this,l=o.events.length;for(;l--;)if(("labelImage"===o.events[l][1].type||"labelLink"===o.events[l][1].type)&&!o.events[l][1]._balanced){s=o.events[l][1];break}return function(i){return s?s._inactive?d(i):(n=o.parser.defined.includes(tA(o.sliceSerialize({start:s.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelEnd"),a):r(i)};function a(i){return 40===i?e.attempt(tW,c,n?c:d)(i):91===i?e.attempt(t$,c,n?h:d)(i):n?c(i):d(i)}function h(i){return e.attempt(tU,c,d)(i)}function c(e){return i(e)}function d(e){return s._balanced=!0,r(e)}}},tW={tokenize:function(e,i,r){return function(i){return e.enter("resource"),e.enter("resourceMarker"),e.consume(i),e.exit("resourceMarker"),s};function s(i){return e6(i)?tB(e,n)(i):n(i)}function n(i){return 41===i?c(i):tP(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(i)}function o(i){return e6(i)?tB(e,a)(i):c(i)}function l(e){return r(e)}function a(i){return 34===i||39===i||40===i?tL(e,h,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(i):c(i)}function h(i){return e6(i)?tB(e,c)(i):c(i)}function c(s){return 41===s?(e.enter("resourceMarker"),e.consume(s),e.exit("resourceMarker"),e.exit("resource"),i):r(s)}}},t$={tokenize:function(e,i,r){let s=this;return function(i){return tT.call(s,e,n,o,"reference","referenceMarker","referenceString")(i)};function n(e){return s.parser.defined.includes(tA(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?i(e):r(e)}function o(e){return r(e)}}},tU={tokenize:function(e,i,r){return function(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s};function s(s){return 93===s?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),i):r(s)}}},tK={name:"labelStartImage",resolveAll:tF.resolveAll,tokenize:function(e,i,r){let s=this;return function(i){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(i),e.exit("labelImageMarker"),n};function n(i){return 91===i?(e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelImage"),o):r(i)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in s.parser.constructs?r(e):i(e)}}},tq={name:"labelStartLink",resolveAll:tF.resolveAll,tokenize:function(e,i,r){let s=this;return function(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),n};function n(e){return 94===e&&"_hiddenFootnoteSupport"in s.parser.constructs?r(e):i(e)}}},tV={name:"lineEnding",tokenize:function(e,i){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),tt(e,i,"linePrefix")}}},tY={name:"thematicBreak",tokenize:function(e,i,r){let s,n=0;return function(o){var l;return e.enter("thematicBreak"),s=l=o,function o(l){return l===s?(e.enter("thematicBreakSequence"),function i(r){return r===s?(e.consume(r),n++,i):(e.exit("thematicBreakSequence"),e9(r)?tt(e,o,"whitespace")(r):o(r))}(l)):n>=3&&(null===l||e4(l))?(e.exit("thematicBreak"),i(l)):r(l)}(l)}}},tX={continuation:{tokenize:function(e,i,r){let s=this;return s.containerState._closeFlow=void 0,e.check(tn,function(r){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,tt(e,i,"listItemIndent",s.containerState.size+1)(r)},function(r){return s.containerState.furtherBlankLines||!e9(r)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,n(r)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(tJ,i,n)(r))});function n(n){return s.containerState._closeFlow=!0,s.interrupt=void 0,tt(e,e.attempt(tX,i,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,i,r){let s=this,n=s.events[s.events.length-1],o=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,l=0;return function(i){let n=s.containerState.type||(42===i||43===i||45===i?"listUnordered":"listOrdered");if("listUnordered"===n?!s.containerState.marker||i===s.containerState.marker:e2(i)){if(s.containerState.type||(s.containerState.type=n,e.enter(n,{_container:!0})),"listUnordered"===n)return e.enter("listItemPrefix"),42===i||45===i?e.check(tY,r,a)(i):a(i);if(!s.interrupt||49===i)return e.enter("listItemPrefix"),e.enter("listItemValue"),function i(n){return e2(n)&&++l<10?(e.consume(n),i):(!s.interrupt||l<2)&&(s.containerState.marker?n===s.containerState.marker:41===n||46===n)?(e.exit("listItemValue"),a(n)):r(n)}(i)}return r(i)};function a(i){return e.enter("listItemMarker"),e.consume(i),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||i,e.check(tn,s.interrupt?r:h,e.attempt(tG,d,c))}function h(e){return s.containerState.initialBlankLine=!0,o++,d(e)}function c(i){return e9(i)?(e.enter("listItemPrefixWhitespace"),e.consume(i),e.exit("listItemPrefixWhitespace"),d):r(i)}function d(r){return s.containerState.size=o+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(r)}}},tG={partial:!0,tokenize:function(e,i,r){let s=this;return tt(e,function(e){let n=s.events[s.events.length-1];return!e9(e)&&n&&"listItemPrefixWhitespace"===n[1].type?i(e):r(e)},"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},tJ={partial:!0,tokenize:function(e,i,r){let s=this;return tt(e,function(e){let n=s.events[s.events.length-1];return n&&"listItemIndent"===n[1].type&&n[2].sliceSerialize(n[1],!0).length===s.containerState.size?i(e):r(e)},"listItemIndent",s.containerState.size+1)}},tZ={name:"setextUnderline",resolveTo:function(e,i){let r,s,n,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){r=o;break}"paragraph"===e[o][1].type&&(s=o)}else"content"===e[o][1].type&&e.splice(o,1),n||"definition"!==e[o][1].type||(n=o);let l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",n?(e.splice(s,0,["enter",l,i]),e.splice(n+1,0,["exit",e[r][1],i]),e[r][1].end={...e[n][1].end}):e[r][1]=l,e.push(["exit",l,i]),e},tokenize:function(e,i,r){let s,n=this;return function(i){var l;let a,h=n.events.length;for(;h--;)if("lineEnding"!==n.events[h][1].type&&"linePrefix"!==n.events[h][1].type&&"content"!==n.events[h][1].type){a="paragraph"===n.events[h][1].type;break}return!n.parser.lazy[n.now().line]&&(n.interrupt||a)?(e.enter("setextHeadingLine"),s=i,l=i,e.enter("setextHeadingLineSequence"),function i(r){return r===s?(e.consume(r),i):(e.exit("setextHeadingLineSequence"),e9(r)?tt(e,o,"lineSuffix")(r):o(r))}(l)):r(i)};function o(s){return null===s||e4(s)?(e.exit("setextHeadingLine"),i(s)):r(s)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,i,r){let s,n=this;return function(i){var s;return e.enter("definition"),s=i,tT.call(n,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(s)};function o(i){return(s=tA(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),58===i)?(e.enter("definitionMarker"),e.consume(i),e.exit("definitionMarker"),l):r(i)}function l(i){return e6(i)?tB(e,a)(i):a(i)}function a(i){return tP(e,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(i)}function h(i){return e.attempt(tI,c,c)(i)}function c(i){return e9(i)?tt(e,d,"whitespace")(i):d(i)}function d(o){return null===o||e4(o)?(e.exit("definition"),n.parser.defined.push(s),i(o)):r(o)}}}},"disable",0,{null:[]},"document",0,{42:tX,43:tX,45:tX,48:tX,49:tX,50:tX,51:tX,52:tX,53:tX,54:tX,55:tX,56:tX,57:tX,62:tS},"flow",0,{35:{name:"headingAtx",resolve:function(e,i){let r,s,n=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),n-2>o&&"whitespace"===e[n][1].type&&(n-=2),"atxHeadingSequence"===e[n][1].type&&(o===n-1||n-4>o&&"whitespace"===e[n-2][1].type)&&(n-=o+1===n?2:4),n>o&&(r={type:"atxHeadingText",start:e[o][1].start,end:e[n][1].end},s={type:"chunkText",start:e[o][1].start,end:e[n][1].end,contentType:"text"},eX(e,o,n-o+1,[["enter",r,i],["enter",s,i],["exit",s,i],["exit",r,i]])),e},tokenize:function(e,i,r){let s=0;return function(n){var o;return e.enter("atxHeading"),o=n,e.enter("atxHeadingSequence"),function n(o){return 35===o&&s++<6?(e.consume(o),n):null===o||e6(o)?(e.exit("atxHeadingSequence"),function r(s){return 35===s?(e.enter("atxHeadingSequence"),function i(s){return 35===s?(e.consume(s),i):(e.exit("atxHeadingSequence"),r(s))}(s)):null===s||e4(s)?(e.exit("atxHeading"),i(s)):e9(s)?tt(e,r,"whitespace")(s):(e.enter("atxHeadingText"),function i(s){return null===s||35===s||e6(s)?(e.exit("atxHeadingText"),r(s)):(e.consume(s),i)}(s))}(o)):r(o)}(o)}}},42:tY,45:[tZ,tY],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let i=e.length;for(;i--&&("enter"!==e[i][0]||"htmlFlow"!==e[i][1].type););return i>1&&"linePrefix"===e[i-2][1].type&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e},tokenize:function(e,i,r){let s,n,o,l,a,h=this;return function(i){var r;return r=i,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),c};function c(l){return 33===l?(e.consume(l),d):47===l?(e.consume(l),n=!0,p):63===l?(e.consume(l),s=3,h.interrupt?i:L):eZ(l)?(e.consume(l),o=String.fromCharCode(l),_):r(l)}function d(n){return 45===n?(e.consume(n),s=2,u):91===n?(e.consume(n),s=5,l=0,f):eZ(n)?(e.consume(n),s=4,h.interrupt?i:L):r(n)}function u(s){return 45===s?(e.consume(s),h.interrupt?i:L):r(s)}function f(s){let n="CDATA[";return s===n.charCodeAt(l++)?(e.consume(s),l===n.length)?h.interrupt?i:k:f:r(s)}function p(i){return eZ(i)?(e.consume(i),o=String.fromCharCode(i),_):r(i)}function _(l){if(null===l||47===l||62===l||e6(l)){let a=47===l,c=o.toLowerCase();return!a&&!n&&tj.includes(c)?(s=1,h.interrupt?i(l):k(l)):tO.includes(o.toLowerCase())?(s=6,a)?(e.consume(l),m):h.interrupt?i(l):k(l):(s=7,h.interrupt&&!h.parser.lazy[h.now().line]?r(l):n?function i(r){return e9(r)?(e.consume(r),i):w(r)}(l):g(l))}return 45===l||eQ(l)?(e.consume(l),o+=String.fromCharCode(l),_):r(l)}function m(s){return 62===s?(e.consume(s),h.interrupt?i:k):r(s)}function g(i){return 47===i?(e.consume(i),w):58===i||95===i||eZ(i)?(e.consume(i),v):e9(i)?(e.consume(i),g):w(i)}function v(i){return 45===i||46===i||58===i||95===i||eQ(i)?(e.consume(i),v):x(i)}function x(i){return 61===i?(e.consume(i),b):e9(i)?(e.consume(i),x):g(i)}function b(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),a=i,y):e9(i)?(e.consume(i),b):function i(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||e6(r)?x(r):(e.consume(r),i)}(i)}function y(i){return i===a?(e.consume(i),a=null,S):null===i||e4(i)?r(i):(e.consume(i),y)}function S(e){return 47===e||62===e||e9(e)?g(e):r(e)}function w(i){return 62===i?(e.consume(i),C):r(i)}function C(i){return null===i||e4(i)?k(i):e9(i)?(e.consume(i),C):r(i)}function k(i){return 45===i&&2===s?(e.consume(i),D):60===i&&1===s?(e.consume(i),M):62===i&&4===s?(e.consume(i),B):63===i&&3===s?(e.consume(i),L):93===i&&5===s?(e.consume(i),T):e4(i)&&(6===s||7===s)?(e.exit("htmlFlowData"),e.check(tz,A,E)(i)):null===i||e4(i)?(e.exit("htmlFlowData"),E(i)):(e.consume(i),k)}function E(i){return e.check(tH,R,A)(i)}function R(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),N}function N(i){return null===i||e4(i)?E(i):(e.enter("htmlFlowData"),k(i))}function D(i){return 45===i?(e.consume(i),L):k(i)}function M(i){return 47===i?(e.consume(i),o="",P):k(i)}function P(i){if(62===i){let r=o.toLowerCase();return tj.includes(r)?(e.consume(i),B):k(i)}return eZ(i)&&o.length<8?(e.consume(i),o+=String.fromCharCode(i),P):k(i)}function T(i){return 93===i?(e.consume(i),L):k(i)}function L(i){return 62===i?(e.consume(i),B):45===i&&2===s?(e.consume(i),L):k(i)}function B(i){return null===i||e4(i)?(e.exit("htmlFlowData"),A(i)):(e.consume(i),B)}function A(r){return e.exit("htmlFlow"),i(r)}}},61:tZ,95:tY,96:tN,126:tN},"flowInitial",0,{[-2]:tD,[-1]:tD,32:tD},"insideSpan",0,{null:[tb,tu]},"string",0,{38:tE,92:tw},"text",0,{[-5]:tV,[-4]:tV,[-3]:tV,33:tK,38:tE,42:tb,60:[{name:"autolink",tokenize:function(e,i,r){let s=0;return function(i){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),n};function n(i){return eZ(i)?(e.consume(i),o):64===i?r(i):a(i)}function o(i){return 43===i||45===i||46===i||eQ(i)?(s=1,function i(r){return 58===r?(e.consume(r),s=0,l):(43===r||45===r||46===r||eQ(r))&&s++<32?(e.consume(r),i):(s=0,a(r))}(i)):a(i)}function l(s){return 62===s?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(s),e.exit("autolinkMarker"),e.exit("autolink"),i):null===s||32===s||60===s||e1(s)?r(s):(e.consume(s),l)}function a(i){return 64===i?(e.consume(i),h):e0(i)?(e.consume(i),a):r(i)}function h(n){return eQ(n)?function n(o){return 46===o?(e.consume(o),s=0,h):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),i):function i(o){if((45===o||eQ(o))&&s++<63){let r=45===o?i:n;return e.consume(o),r}return r(o)}(o)}(n):r(n)}}},{name:"htmlText",tokenize:function(e,i,r){let s,n,o,l=this;return function(i){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(i),a};function a(i){return 33===i?(e.consume(i),h):47===i?(e.consume(i),y):63===i?(e.consume(i),x):eZ(i)?(e.consume(i),w):r(i)}function h(i){return 45===i?(e.consume(i),c):91===i?(e.consume(i),n=0,p):eZ(i)?(e.consume(i),v):r(i)}function c(i){return 45===i?(e.consume(i),f):r(i)}function d(i){return null===i?r(i):45===i?(e.consume(i),u):e4(i)?(o=d,P(i)):(e.consume(i),d)}function u(i){return 45===i?(e.consume(i),f):d(i)}function f(e){return 62===e?M(e):45===e?u(e):d(e)}function p(i){let s="CDATA[";return i===s.charCodeAt(n++)?(e.consume(i),n===s.length?_:p):r(i)}function _(i){return null===i?r(i):93===i?(e.consume(i),m):e4(i)?(o=_,P(i)):(e.consume(i),_)}function m(i){return 93===i?(e.consume(i),g):_(i)}function g(i){return 62===i?M(i):93===i?(e.consume(i),g):_(i)}function v(i){return null===i||62===i?M(i):e4(i)?(o=v,P(i)):(e.consume(i),v)}function x(i){return null===i?r(i):63===i?(e.consume(i),b):e4(i)?(o=x,P(i)):(e.consume(i),x)}function b(e){return 62===e?M(e):x(e)}function y(i){return eZ(i)?(e.consume(i),S):r(i)}function S(i){return 45===i||eQ(i)?(e.consume(i),S):function i(r){return e4(r)?(o=i,P(r)):e9(r)?(e.consume(r),i):M(r)}(i)}function w(i){return 45===i||eQ(i)?(e.consume(i),w):47===i||62===i||e6(i)?C(i):r(i)}function C(i){return 47===i?(e.consume(i),M):58===i||95===i||eZ(i)?(e.consume(i),k):e4(i)?(o=C,P(i)):e9(i)?(e.consume(i),C):M(i)}function k(i){return 45===i||46===i||58===i||95===i||eQ(i)?(e.consume(i),k):function i(r){return 61===r?(e.consume(r),E):e4(r)?(o=i,P(r)):e9(r)?(e.consume(r),i):C(r)}(i)}function E(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),s=i,R):e4(i)?(o=E,P(i)):e9(i)?(e.consume(i),E):(e.consume(i),N)}function R(i){return i===s?(e.consume(i),s=void 0,D):null===i?r(i):e4(i)?(o=R,P(i)):(e.consume(i),R)}function N(i){return null===i||34===i||39===i||60===i||61===i||96===i?r(i):47===i||62===i||e6(i)?C(i):(e.consume(i),N)}function D(e){return 47===e||62===e||e6(e)?C(e):r(e)}function M(s){return 62===s?(e.consume(s),e.exit("htmlTextData"),e.exit("htmlText"),i):r(s)}function P(i){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),T}function T(i){return e9(i)?tt(e,L,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):L(i)}function L(i){return e.enter("htmlTextData"),o(i)}}}],91:tq,92:[{name:"hardBreakEscape",tokenize:function(e,i,r){return function(i){return e.enter("hardBreakEscape"),e.consume(i),s};function s(s){return e4(s)?(e.exit("hardBreakEscape"),i(s)):r(s)}}},tw],93:tF,95:tb,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let i,r,s=e.length-4,n=3;if(("lineEnding"===e[3][1].type||"space"===e[n][1].type)&&("lineEnding"===e[s][1].type||"space"===e[s][1].type)){for(i=n;++i<s;)if("codeTextData"===e[i][1].type){e[n][1].type="codeTextPadding",e[s][1].type="codeTextPadding",n+=2,s-=2;break}}for(i=n-1,s++;++i<=s;)void 0===r?i!==s&&"lineEnding"!==e[i][1].type&&(r=i):(i===s||"lineEnding"===e[i][1].type)&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),s-=i-r-2,i=r+2),r=void 0);return e},tokenize:function(e,i,r){let s,n,o=0;return function(i){return e.enter("codeText"),e.enter("codeTextSequence"),function i(r){return 96===r?(e.consume(r),o++,i):(e.exit("codeTextSequence"),l(r))}(i)};function l(h){return null===h?r(h):32===h?(e.enter("space"),e.consume(h),e.exit("space"),l):96===h?(n=e.enter("codeTextSequence"),s=0,function r(l){return 96===l?(e.consume(l),s++,r):s===o?(e.exit("codeTextSequence"),e.exit("codeText"),i(l)):(n.type="codeTextData",a(l))}(h)):e4(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),a(h))}function a(i){return null===i||32===i||96===i||e4(i)?(e.exit("codeTextData"),l(i)):(e.consume(i),a)}}}}],94125);var tQ=e.i(94125);let t0=/[\0\t\n\r]/g;function t1(e,i){let r=Number.parseInt(e,i);return r<9||11===r||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}let t2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function t5(e,i,r){if(i)return i;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),i=120===e||88===e;return t1(r.slice(i?2:1),i?16:10)}return tk(r)||e}let t3={}.hasOwnProperty;function t4(e){return{line:e.line,column:e.column,offset:e.offset}}function t6(e,i){if(e)throw Error("Cannot close `"+e.type+"` ("+eR({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+eR({start:i.start,end:i.end})+") is open");throw Error("Cannot close document, a token (`"+i.type+"`, "+eR({start:i.start,end:i.end})+") is still open")}function t9(e){let i=this;i.parser=function(r){var s,n;let o,l,a,h;return"object"==typeof(s={...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})&&(n=s,s=void 0),(function(e){let i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(v),autolinkProtocol:c,autolinkEmail:c,atxHeading:s(_),blockQuote:s(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:s(p),codeFencedFenceInfo:n,codeFencedFenceMeta:n,codeIndented:s(p,n),codeText:s(function(){return{type:"inlineCode",value:""}},n),codeTextData:c,data:c,codeFlowValue:c,definition:s(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:n,definitionLabelString:n,definitionTitleString:n,emphasis:s(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:s(m),hardBreakTrailing:s(m),htmlFlow:s(g,n),htmlFlowData:c,htmlText:s(g,n),htmlTextData:c,image:s(function(){return{type:"image",title:null,url:"",alt:null}}),label:n,link:s(v),listItem:s(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:s(x,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:s(x),paragraph:s(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:n,resourceDestinationString:n,resourceTitleString:n,setextHeading:s(_),strong:s(function(){return{type:"strong",children:[]}}),thematicBreak:s(function(){return{type:"thematicBreak"}})},exit:{atxHeading:l(),atxHeadingSequence:function(e){let i=this.stack[this.stack.length-1];i.depth||(i.depth=this.sliceSerialize(e).length)},autolink:l(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:l(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let i,r=this.sliceSerialize(e),s=this.data.characterReferenceType;s?(i=t1(r,"characterReferenceMarkerNumeric"===s?10:16),this.data.characterReferenceType=void 0):i=tk(r);let n=this.stack[this.stack.length-1];n.value+=i},characterReference:function(e){this.stack.pop().position.end=t4(e.end)},codeFenced:l(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:d,codeIndented:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:l(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=tA(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:l(),hardBreakEscape:l(u),hardBreakTrailing:l(u),htmlFlow:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,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],i=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=i},labelText:function(e){let i=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=i.replace(t2,t5),r.identifier=tA(i).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=t4(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(r.type)&&(c.call(this,e),d.call(this,e))},link:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=tA(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:l(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:l(),thematicBreak:l()}};!function e(i,r){let s=-1;for(;++s<r.length;){let n=r[s];Array.isArray(n)?e(i,n):function(e,i){let r;for(r in i)if(t3.call(i,r))switch(r){case"canContainEols":{let s=i[r];s&&e[r].push(...s);break}case"transforms":{let s=i[r];s&&e[r].push(...s);break}case"enter":case"exit":{let s=i[r];s&&Object.assign(e[r],s)}}}(i,n)}}(i,(e||{}).mdastExtensions||[]);let r={};return function(e){let s={type:"root",children:[]},l={stack:[s],tokenStack:[],config:i,enter:o,exit:a,buffer:n,resume:h,data:r},c=[],d=-1;for(;++d<e.length;)("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)&&("enter"===e[d][0]?c.push(d):d=function(e,i,r){let s,n,o,l,a=i-1,h=-1,c=!1;for(;++a<=r;){let i=e[a];switch(i[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===i[0]?h++:h--,l=void 0;break;case"lineEndingBlank":"enter"===i[0]&&(!s||l||h||o||(o=a),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!h&&"enter"===i[0]&&"listItemPrefix"===i[1].type||-1===h&&"exit"===i[0]&&("listUnordered"===i[1].type||"listOrdered"===i[1].type)){if(s){let l=a;for(n=void 0;l--;){let i=e[l];if("lineEnding"===i[1].type||"lineEndingBlank"===i[1].type){if("exit"===i[0])continue;n&&(e[n][1].type="lineEndingBlank",c=!0),i[1].type="lineEnding",n=l}else if("linePrefix"===i[1].type||"blockQuotePrefix"===i[1].type||"blockQuotePrefixWhitespace"===i[1].type||"blockQuoteMarker"===i[1].type||"listItemIndent"===i[1].type);else break}o&&(!n||o<n)&&(s._spread=!0),s.end=Object.assign({},n?e[n][1].start:i[1].end),e.splice(n||a,0,["exit",s,i[2]]),a++,r++}if("listItemPrefix"===i[1].type){let n={type:"listItem",_spread:!1,start:Object.assign({},i[1].start),end:void 0};s=n,e.splice(a,0,["enter",n,i[2]]),a++,r++,o=void 0,l=!0}}}return e[i][1]._spread=c,r}(e,c.pop(),d));for(d=-1;++d<e.length;){let r=i[e[d][0]];t3.call(r,e[d][1].type)&&r[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},l),e[d][1])}if(l.tokenStack.length>0){let e=l.tokenStack[l.tokenStack.length-1];(e[1]||t6).call(l,void 0,e[0])}for(s.position={start:t4(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:t4(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<i.transforms.length;)s=i.transforms[d](s)||s;return s};function s(e,i){return function(r){o.call(this,e(r),r),i&&i.call(this,r)}}function n(){this.stack.push({type:"fragment",children:[]})}function o(e,i,r){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([i,r||void 0]),e.position={start:t4(i.start),end:void 0}}function l(e){return function(i){e&&e.call(this,i),a.call(this,i)}}function a(e,i){let r=this.stack.pop(),s=this.tokenStack.pop();if(s)s[0].type!==e.type&&(i?i.call(this,e,s[0]):(s[1]||t6).call(this,e,s[0]));else throw Error("Cannot close `"+e.type+"` ("+eR({start:e.start,end:e.end})+"): it’s not open");r.position.end=t4(e.end)}function h(){var e;return e=this.stack.pop(),eV(e,"boolean"!=typeof eq.includeImageAlt||eq.includeImageAlt,"boolean"!=typeof eq.includeHtml||eq.includeHtml)}function c(e){let i=this.stack[this.stack.length-1].children,r=i[i.length-1];r&&"text"===r.type||((r={type:"text",value:""}).position={start:t4(e.start),end:void 0},i.push(r)),this.stack.push(r)}function d(e){let i=this.stack.pop();i.value+=this.sliceSerialize(e),i.position.end=t4(e.end)}function u(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function _(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function g(){return{type:"html",value:""}}function v(){return{type:"link",title:null,url:"",children:[]}}function x(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(n)(function(e){for(;!ta(e););return e}((function(e){let i={constructs:function(e){let i={},r=-1;for(;++r<e.length;)!function(e,i){let r;for(r in i){let s,n=(eJ.call(e,r)?e[r]:void 0)||(e[r]={}),o=i[r];if(o)for(s in o){eJ.call(n,s)||(n[s]=[]);let e=o[s];!function(e,i){let r=-1,s=[];for(;++r<i.length;)("after"===i[r].add?e:s).push(i[r]);eX(e,0,0,s)}(n[s],Array.isArray(e)?e:e?[e]:[])}}}(i,e[r]);return i}([tQ,...(e||{}).extensions||[]]),content:r(ti),defined:[],document:r(tr),flow:r(td),lazy:{},string:r(tf),text:r(tp)};return i;function r(e){return function(r){return function(e,i,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},n={},o=[],l=[],a=[],h={attempt:_(function(e,i){m(e,i.from)}),check:_(p),consume:function(e){e4(e)?(s.line++,s.column=1,s.offset+=-3===e?2:1,g()):-1!==e&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===l[s._index].length&&(s._bufferIndex=-1,s._index++)),c.previous=e},enter:function(e,i){let r=i||{};return r.type=e,r.start=f(),c.events.push(["enter",r,c]),a.push(r),r},exit:function(e){let i=a.pop();return i.end=f(),c.events.push(["exit",i,c]),i},interrupt:_(p,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){n[e.line]=e.column,g()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,i){return function(e,i){let r,s=-1,n=[];for(;++s<e.length;){let o,l=e[s];if("string"==typeof l)o=l;else switch(l){case -5:o="\r";break;case -4:o="\n";break;case -3:o="\r\n";break;case -2:o=i?" ":" ";break;case -1:if(!i&&r)continue;o=" ";break;default:o=String.fromCharCode(l)}r=-2===l,n.push(o)}return n.join("")}(u(e),i)},sliceStream:u,write:function(e){return(l=eG(l,e),function(){let e;for(;s._index<l.length;){let r=l[s._index];if("string"==typeof r)for(e=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===e&&s._bufferIndex<r.length;){var i;i=r.charCodeAt(s._bufferIndex),d=d(i)}else d=d(r)}}(),null!==l[l.length-1])?[]:(m(i,0),c.events=tx(o,c.events,c),c.events)}},d=i.tokenize.call(c,h);return i.resolveAll&&o.push(i),c;function u(e){return function(e,i){let r,s=i.start._index,n=i.start._bufferIndex,o=i.end._index,l=i.end._bufferIndex;if(s===o)r=[e[s].slice(n,l)];else{if(r=e.slice(s,o),n>-1){let e=r[0];"string"==typeof e?r[0]=e.slice(n):r.shift()}l>0&&r.push(e[o].slice(0,l))}return r}(l,e)}function f(){let{_bufferIndex:e,_index:i,line:r,column:n,offset:o}=s;return{_bufferIndex:e,_index:i,line:r,column:n,offset:o}}function p(e,i){i.restore()}function _(e,i){return function(r,n,o){var l;let d,u,p,_;return Array.isArray(r)?m(r):"tokenize"in r?m([r]):(l=r,function(e){let i=null!==e&&l[e],r=null!==e&&l.null;return m([...Array.isArray(i)?i:i?[i]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function m(e){return(d=e,u=0,0===e.length)?o:v(e[u])}function v(e){return function(r){let n,o,l,d,u;return(n=f(),o=c.previous,l=c.currentConstruct,d=c.events.length,u=Array.from(a),_={from:d,restore:function(){s=n,c.previous=o,c.currentConstruct=l,c.events.length=d,a=u,g()}},p=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?b(r):e.tokenize.call(i?Object.assign(Object.create(c),i):c,h,x,b)(r)}}function x(i){return e(p,_),n}function b(e){return(_.restore(),++u<d.length)?v(d[u]):o}}}function m(e,i){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&eX(c.events,i,c.events.length-i,e.resolve(c.events.slice(i),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function g(){s.line in n&&s.column<2&&(s.column=n[s.line],s.offset+=n[s.line]-1)}}(i,e,r)}}})(n).document().write((l=1,a="",h=!0,function(e,i,r){let s,n,c,d,u,f=[];for(e=a+("string"==typeof e?e.toString():new TextDecoder(i||void 0).decode(e)),c=0,a="",h&&(65279===e.charCodeAt(0)&&c++,h=void 0);c<e.length;){if(t0.lastIndex=c,d=(s=t0.exec(e))&&void 0!==s.index?s.index:e.length,u=e.charCodeAt(d),!s){a=e.slice(c);break}if(10===u&&c===d&&o)f.push(-3),o=void 0;else switch(o&&(f.push(-5),o=void 0),c<d&&(f.push(e.slice(c,d)),l+=d-c),u){case 0:f.push(65533),l++;break;case 9:for(n=4*Math.ceil(l/4),f.push(-2);l++<n;)f.push(-1);break;case 10:f.push(-4),l=1;break;default:o=!0,l=1}c=d+1}return r&&(o&&f.push(-5),a&&f.push(a),f.push(null)),f})(r,s,!0))))}}let t8="object"==typeof self?self:globalThis,t7=e=>{var i;let r,s;return(i=new Map,r=(e,r)=>(i.set(r,e),e),s=n=>{if(i.has(n))return i.get(n);let[o,l]=e[n];switch(o){case 0:case -1:return r(l,n);case 1:{let e=r([],n);for(let i of l)e.push(s(i));return e}case 2:{let e=r({},n);for(let[i,r]of l)e[s(i)]=s(r);return e}case 3:return r(new Date(l),n);case 4:{let{source:e,flags:i}=l;return r(new RegExp(e,i),n)}case 5:{let e=r(new Map,n);for(let[i,r]of l)e.set(s(i),s(r));return e}case 6:{let e=r(new Set,n);for(let i of l)e.add(s(i));return e}case 7:{let{name:e,message:i}=l;return r(new t8[e](i),n)}case 8:return r(BigInt(l),n);case"BigInt":return r(Object(BigInt(l)),n);case"ArrayBuffer":return r(new Uint8Array(l).buffer,l);case"DataView":{let{buffer:e}=new Uint8Array(l);return r(new DataView(e),l)}}return r(new t8[o](l),n)})(0)},{toString:ie}={},{keys:it}=Object,ii=e=>{let i=typeof e;if("object"!==i||!e)return[0,i];let r=ie.call(e).slice(8,-1);switch(r){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,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},ir=([e,i])=>0===e&&("function"===i||"symbol"===i),is=(e,{json:i,lossy:r}={})=>{var s,n,o;let l,a,h=[];return(s=!(i||r),n=!!i,o=new Map,l=(e,i)=>{let r=h.push(e)-1;return o.set(i,r),r},a=e=>{if(o.has(e))return o.get(e);let[i,r]=ii(e);switch(i){case 0:{let n=e;switch(r){case"bigint":i=8,n=e.toString();break;case"function":case"symbol":if(s)throw TypeError("unable to serialize "+r);n=null;break;case"undefined":return l([-1],e)}return l([i,n],e)}case 1:{if(r){let i=e;return"DataView"===r?i=new Uint8Array(e.buffer):"ArrayBuffer"===r&&(i=new Uint8Array(e)),l([r,[...i]],e)}let s=[],n=l([i,s],e);for(let i of e)s.push(a(i));return n}case 2:{if(r)switch(r){case"BigInt":return l([r,e.toString()],e);case"Boolean":case"Number":case"String":return l([r,e.valueOf()],e)}if(n&&"toJSON"in e)return a(e.toJSON());let o=[],h=l([i,o],e);for(let i of it(e))(s||!ir(ii(e[i])))&&o.push([a(i),a(e[i])]);return h}case 3:return l([i,e.toISOString()],e);case 4:{let{source:r,flags:s}=e;return l([i,{source:r,flags:s}],e)}case 5:{let r=[],n=l([i,r],e);for(let[i,n]of e)(s||!(ir(ii(i))||ir(ii(n))))&&r.push([a(i),a(n)]);return n}case 6:{let r=[],n=l([i,r],e);for(let i of e)(s||!ir(ii(i)))&&r.push(a(i));return n}}let{message:h}=e;return l([i,{name:r,message:h}],e)})(e),h},io="function"==typeof structuredClone?(e,i)=>i&&("json"in i||"lossy"in i)?t7(is(e,i)):structuredClone(e):(e,i)=>t7(is(e,i));function il(e){let i=[],r=-1,s=0,n=0;for(;++r<e.length;){let o=e.charCodeAt(r),l="";if(37===o&&eQ(e.charCodeAt(r+1))&&eQ(e.charCodeAt(r+2)))n=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){let i=e.charCodeAt(r+1);o<56320&&i>56319&&i<57344?(l=String.fromCharCode(o,i),n=1):l="�"}else l=String.fromCharCode(o);l&&(i.push(e.slice(s,r),encodeURIComponent(l)),s=r+n+1,l=""),n&&(r+=n,n=0)}return i.join("")+e.slice(s)}function ia(e,i){let r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function ih(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}let ic=function(e){var i,r;if(null==e)return iu;if("function"==typeof e)return id(e);if("object"==typeof e){return Array.isArray(e)?function(e){let i=[],r=-1;for(;++r<e.length;)i[r]=ic(e[r]);return id(function(...e){let r=-1;for(;++r<i.length;)if(i[r].apply(this,e))return!0;return!1})}(e):(i=e,id(function(e){let r;for(r in i)if(e[r]!==i[r])return!1;return!0}))}if("string"==typeof e){return r=e,id(function(e){return e&&e.type===r})}throw Error("Expected function, string, or object as test")};function id(e){return function(i,r,s){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(i)&&e.call(this,i,"number"==typeof r?r:void 0,s||void 0))}}function iu(){return!0}let ip=[];function i_(e,i,r,s){var n,o,l;let a,h,c,d,u,f;"function"==typeof i&&"function"!=typeof r?(h=void 0,c=i,a=r):(h=i,c=r,a=s),n=h,o=function(e,i){let r=i[i.length-1],s=r?r.children.indexOf(e):void 0;return c(e,s,r)},l=a,"function"==typeof n&&"function"!=typeof o?(l=o,o=n):d=n,u=ic(d),f=l?-1:1,(function e(i,r,s){let a=i&&"object"==typeof i?i:{};if("string"==typeof a.type){let e="string"==typeof a.tagName?a.tagName:"string"==typeof a.name?a.name:void 0;Object.defineProperty(h,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return h;function h(){var a;let h,c,d,p=ip;if((!n||u(i,r,s[s.length-1]||void 0))&&!1===(p=Array.isArray(a=o(i,s))?a:"number"==typeof a?[!0,a]:null==a?ip:[a])[0])return p;if("children"in i&&i.children&&i.children&&"skip"!==p[0])for(c=(l?i.children.length:-1)+f,d=s.concat(i);c>-1&&c<i.children.length;){if(!1===(h=e(i.children[c],c,d)())[0])return h;c="number"==typeof h[1]?h[1]:c+f}return p}})(e,void 0,[])()}function im(e,i){let r=i.referenceType,s="]";if("collapsed"===r?s+="[]":"full"===r&&(s+="["+(i.label||i.identifier)+"]"),"imageReference"===i.type)return[{type:"text",value:"!["+i.alt+s}];let n=e.all(i),o=n[0];o&&"text"===o.type?o.value="["+o.value:n.unshift({type:"text",value:"["});let l=n[n.length-1];return l&&"text"===l.type?l.value+=s:n.push({type:"text",value:s}),n}function ig(e){let i=e.spread;return null==i?e.children.length>1:i}function iv(e,i,r){let s=0,n=e.length;if(i){let i=e.codePointAt(s);for(;9===i||32===i;)s++,i=e.codePointAt(s)}if(r){let i=e.codePointAt(n-1);for(;9===i||32===i;)n--,i=e.codePointAt(n-1)}return n>s?e.slice(s,n):""}let ix={blockquote:function(e,i){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)},break:function(e,i){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:"\n"}]},code:function(e,i){let r=i.value?i.value+"\n":"",s={},n=i.lang?i.lang.split(/\s+/):[];n.length>0&&(s.className=["language-"+n[0]]);let o={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return i.meta&&(o.data={meta:i.meta}),e.patch(i,o),o={type:"element",tagName:"pre",properties:{},children:[o=e.applyData(i,o)]},e.patch(i,o),o},delete:function(e,i){let r={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},emphasis:function(e,i){let r={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},footnoteReference:function(e,i){let r,s="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=String(i.identifier).toUpperCase(),o=il(n.toLowerCase()),l=e.footnoteOrder.indexOf(n),a=e.footnoteCounts.get(n);void 0===a?(a=0,e.footnoteOrder.push(n),r=e.footnoteOrder.length):r=l+1,a+=1,e.footnoteCounts.set(n,a);let h={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+o,id:s+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(i,h);let c={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(i,c),e.applyData(i,c)},heading:function(e,i){let r={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},html:function(e,i){if(e.options.allowDangerousHtml){let r={type:"raw",value:i.value};return e.patch(i,r),e.applyData(i,r)}},imageReference:function(e,i){let r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return im(e,i);let n={src:il(s.url||""),alt:i.alt};null!==s.title&&void 0!==s.title&&(n.title=s.title);let o={type:"element",tagName:"img",properties:n,children:[]};return e.patch(i,o),e.applyData(i,o)},image:function(e,i){let r={src:il(i.url)};null!==i.alt&&void 0!==i.alt&&(r.alt=i.alt),null!==i.title&&void 0!==i.title&&(r.title=i.title);let s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(i,s),e.applyData(i,s)},inlineCode:function(e,i){let r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,r);let s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(i,s),e.applyData(i,s)},linkReference:function(e,i){let r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return im(e,i);let n={href:il(s.url||"")};null!==s.title&&void 0!==s.title&&(n.title=s.title);let o={type:"element",tagName:"a",properties:n,children:e.all(i)};return e.patch(i,o),e.applyData(i,o)},link:function(e,i){let r={href:il(i.url)};null!==i.title&&void 0!==i.title&&(r.title=i.title);let s={type:"element",tagName:"a",properties:r,children:e.all(i)};return e.patch(i,s),e.applyData(i,s)},listItem:function(e,i,r){let s=e.all(i),n=r?function(e){let i=!1;if("list"===e.type){i=e.spread||!1;let r=e.children,s=-1;for(;!i&&++s<r.length;)i=ig(r[s])}return i}(r):ig(i),o={},l=[];if("boolean"==typeof i.checked){let e,r=s[0];r&&"element"===r.type&&"p"===r.tagName?e=r:(e={type:"element",tagName:"p",properties:{},children:[]},s.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<s.length;){let e=s[a];(n||0!==a||"element"!==e.type||"p"!==e.tagName)&&l.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||n?l.push(e):l.push(...e.children)}let h=s[s.length-1];h&&(n||"element"!==h.type||"p"!==h.tagName)&&l.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:o,children:l};return e.patch(i,c),e.applyData(i,c)},list:function(e,i){let r={},s=e.all(i),n=-1;for("number"==typeof i.start&&1!==i.start&&(r.start=i.start);++n<s.length;){let e=s[n];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}let o={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:e.wrap(s,!0)};return e.patch(i,o),e.applyData(i,o)},paragraph:function(e,i){let r={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},root:function(e,i){let r={type:"root",children:e.wrap(e.all(i))};return e.patch(i,r),e.applyData(i,r)},strong:function(e,i){let r={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},table:function(e,i){let r=e.all(i),s=r.shift(),n=[];if(s){let r={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(i.children[0],r),n.push(r)}if(r.length>0){let s={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=ek(i.children[1]),l=eC(i.children[i.children.length-1]);o&&l&&(s.position={start:o,end:l}),n.push(s)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(n,!0)};return e.patch(i,o),e.applyData(i,o)},tableCell:function(e,i){let r={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},tableRow:function(e,i,r){let s=r?r.children:void 0,n=0===(s?s.indexOf(i):1)?"th":"td",o=r&&"table"===r.type?r.align:void 0,l=o?o.length:i.children.length,a=-1,h=[];for(;++a<l;){let r=i.children[a],s={},l=o?o[a]:void 0;l&&(s.align=l);let c={type:"element",tagName:n,properties:s,children:[]};r&&(c.children=e.all(r),e.patch(r,c),c=e.applyData(r,c)),h.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(i,c),e.applyData(i,c)},text:function(e,i){let r={type:"text",value:function(e){let i=String(e),r=/\r?\n|\r/g,s=r.exec(i),n=0,o=[];for(;s;)o.push(iv(i.slice(n,s.index),n>0,!0),s[0]),n=s.index+s[0].length,s=r.exec(i);return o.push(iv(i.slice(n),n>0,!1)),o.join("")}(String(i.value))};return e.patch(i,r),e.applyData(i,r)},thematicBreak:function(e,i){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,r),e.applyData(i,r)},toml:ib,yaml:ib,definition:ib,footnoteDefinition:ib};function ib(){}let iy={}.hasOwnProperty,iS={};function iw(e,i){e.position&&(i.position=function(e){let i=ek(e),r=eC(e);if(i&&r)return{start:i,end:r}}(e))}function iC(e,i){let r=i;if(e&&e.data){let i=e.data.hName,s=e.data.hChildren,n=e.data.hProperties;"string"==typeof i&&("element"===r.type?r.tagName=i:r={type:"element",tagName:i,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&n&&Object.assign(r.properties,io(n)),"children"in r&&r.children&&null!=s&&(r.children=s)}return r}function ik(e,i){let r=[],s=-1;for(i&&r.push({type:"text",value:"\n"});++s<e.length;)s&&r.push({type:"text",value:"\n"}),r.push(e[s]);return i&&e.length>0&&r.push({type:"text",value:"\n"}),r}function iE(e){let i=0,r=e.charCodeAt(i);for(;9===r||32===r;)i++,r=e.charCodeAt(i);return e.slice(i)}function iR(e,i){let r,s,n,o,l=(r=i||iS,s=new Map,n=new Map,o={all:function(e){let i=[];if("children"in e){let r=e.children,s=-1;for(;++s<r.length;){let n=o.one(r[s],e);if(n){if(s&&"break"===r[s-1].type&&(Array.isArray(n)||"text"!==n.type||(n.value=iE(n.value)),!Array.isArray(n)&&"element"===n.type)){let e=n.children[0];e&&"text"===e.type&&(e.value=iE(e.value))}Array.isArray(n)?i.push(...n):i.push(n)}}}return i},applyData:iC,definitionById:s,footnoteById:n,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ix,...r.handlers},one:function(e,i){let r=e.type,s=o.handlers[r];if(iy.call(o.handlers,r)&&s)return s(o,e,i);if(o.options.passThrough&&o.options.passThrough.includes(r)){if("children"in e){let{children:i,...r}=e,s=io(r);return s.children=o.all(e),s}return io(e)}return(o.options.unknownHandler||function(e,i){let r=i.data||{},s="value"in i&&!(iy.call(r,"hProperties")||iy.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,s),e.applyData(i,s)})(o,e,i)},options:r,patch:iw,wrap:ik},i_(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let i="definition"===e.type?s:n,r=String(e.identifier).toUpperCase();i.has(r)||i.set(r,e)}}),o),a=l.one(e,void 0),h=function(e){let i="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||ia,s=e.options.footnoteBackLabel||ih,n=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],h=-1;for(;++h<e.footnoteOrder.length;){let n=e.footnoteById.get(e.footnoteOrder[h]);if(!n)continue;let o=e.all(n),l=String(n.identifier).toUpperCase(),c=il(l.toLowerCase()),d=0,u=[],f=e.footnoteCounts.get(l);for(;void 0!==f&&++d<=f;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof r?r:r(h,d);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+c+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof s?s:s(h,d),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else o.push(...u);let _={type:"element",tagName:"li",properties:{id:i+"fn-"+c},children:e.wrap(o,!0)};e.patch(n,_),a.push(_)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...io(l),id:"footnote-label"},children:[{type:"text",value:n}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(l),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return h&&(I("children"in c),c.children.push({type:"text",value:"\n"},h)),c}function iN(e,i){return e&&"run"in e?async function(r,s){let n=iR(r,{file:s,...i});await e.run(n,s)}:function(r,s){return iR(r,{file:s,...e||i})}}function iD(e){if(e)throw e}var iM=e.i(99834);function iP(e){if("object"!=typeof e||null===e)return!1;let i=Object.getPrototypeOf(e);return(null===i||i===Object.prototype||null===Object.getPrototypeOf(i))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let iT=function(e,i){let r;if(void 0!==i&&"string"!=typeof i)throw TypeError('"ext" argument must be a string');iI(e);let s=0,n=-1,o=e.length;if(void 0===i||0===i.length||i.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(r){s=o+1;break}}else n<0&&(r=!0,n=o+1);return n<0?"":e.slice(s,n)}if(i===e)return"";let l=-1,a=i.length-1;for(;o--;)if(47===e.codePointAt(o)){if(r){s=o+1;break}}else l<0&&(r=!0,l=o+1),a>-1&&(e.codePointAt(o)===i.codePointAt(a--)?a<0&&(n=o):(a=-1,n=l));return s===n?n=l:n<0&&(n=e.length),e.slice(s,n)},iL=function(e){let i;if(iI(e),0===e.length)return".";let r=-1,s=e.length;for(;--s;)if(47===e.codePointAt(s)){if(i){r=s;break}}else i||(i=!0);return r<0?47===e.codePointAt(0)?"/":".":1===r&&47===e.codePointAt(0)?"//":e.slice(0,r)},iB=function(e){let i;iI(e);let r=e.length,s=-1,n=0,o=-1,l=0;for(;r--;){let a=e.codePointAt(r);if(47===a){if(i){n=r+1;break}continue}s<0&&(i=!0,s=r+1),46===a?o<0?o=r:1!==l&&(l=1):o>-1&&(l=-1)}return o<0||s<0||0===l||1===l&&o===s-1&&o===n+1?"":e.slice(o,s)},iA=function(...e){var i;let r,s,n,o=-1;for(;++o<e.length;)iI(e[o]),e[o]&&(n=void 0===n?e[o]:n+"/"+e[o]);return void 0===n?".":(iI(i=n),r=47===i.codePointAt(0),0!==(s=function(e,i){let r,s,n="",o=0,l=-1,a=0,h=-1;for(;++h<=e.length;){if(h<e.length)r=e.codePointAt(h);else if(47===r)break;else r=47;if(47===r){if(l===h-1||1===a);else if(l!==h-1&&2===a){if(n.length<2||2!==o||46!==n.codePointAt(n.length-1)||46!==n.codePointAt(n.length-2)){if(n.length>2){if((s=n.lastIndexOf("/"))!==n.length-1){s<0?(n="",o=0):o=(n=n.slice(0,s)).length-1-n.lastIndexOf("/"),l=h,a=0;continue}}else if(n.length>0){n="",o=0,l=h,a=0;continue}}i&&(n=n.length>0?n+"/..":"..",o=2)}else n.length>0?n+="/"+e.slice(l+1,h):n=e.slice(l+1,h),o=h-l-1;l=h,a=0}else 46===r&&a>-1?a++:a=-1}return n}(i,!r)).length||r||(s="."),s.length>0&&47===i.codePointAt(i.length-1)&&(s+="/"),r?"/"+s:s)};function iI(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function iO(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let ij=["history","path","basename","stem","extname","dirname"];class iz{constructor(e){let i,r;i=e?iO(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 i?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<ij.length;){const e=ij[s];e in i&&void 0!==i[e]&&null!==i[e]&&(this[e]="history"===e?[...i[e]]:i[e])}for(r in i)ij.includes(r)||(this[r]=i[r])}get basename(){return"string"==typeof this.path?iT(this.path):void 0}set basename(e){iF(e,"basename"),iH(e,"basename"),this.path=iA(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?iL(this.path):void 0}set dirname(e){iW(this.basename,"dirname"),this.path=iA(e||"",this.basename)}get extname(){return"string"==typeof this.path?iB(this.path):void 0}set extname(e){if(iH(e,"extname"),iW(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=iA(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){iO(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!iO(e)){let i=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}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 i=e.pathname,r=-1;for(;++r<i.length;)if(37===i.codePointAt(r)&&50===i.codePointAt(r+1)){let e=i.codePointAt(r+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(i)}(e)}(e)),iF(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?iT(this.path,this.extname):void 0}set stem(e){iF(e,"stem"),iH(e,"stem"),this.path=iA(this.dirname||"",e+(this.extname||""))}fail(e,i,r){let s=this.message(e,i,r);throw s.fatal=!0,s}info(e,i,r){let s=this.message(e,i,r);return s.fatal=void 0,s}message(e,i,r){let s=new eP(e,i,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function iH(e,i){if(e&&e.includes("/"))throw Error("`"+i+"` cannot be a path: did not expect `/`")}function iF(e,i){if(!e)throw Error("`"+i+"` cannot be empty")}function iW(e,i){if(!e)throw Error("Setting `"+i+"` requires `path` to be set too")}let i$=function(e){let i=this.constructor.prototype,r=i[e],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,i),s},iU={}.hasOwnProperty;class iK extends i${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=[],i={run:function(...i){let r=-1,s=i.pop();if("function"!=typeof s)throw TypeError("Expected function as last argument, not "+s);!function n(o,...l){let a=e[++r],h=-1;if(o)return void s(o);for(;++h<i.length;)(null===l[h]||void 0===l[h])&&(l[h]=i[h]);i=l,a?(function(e,i){let r;return function(...i){let o,l=e.length>i.length;l&&i.push(s);try{o=e.apply(this,i)}catch(e){if(l&&r)throw e;return s(e)}l||(o&&o.then&&"function"==typeof o.then?o.then(n,s):o instanceof Error?s(o):n(o))};function s(e,...n){r||(r=!0,i(e,...n))}function n(e){s(null,e)}})(a,n)(...l):s(null,...l)}(null,...i)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),i}};return i}()}copy(){let e=new iK,i=-1;for(;++i<this.attachers.length;){let r=this.attachers[i];e.use(...r)}return e.data((0,iM.default)(!0,{},this.namespace)),e}data(e,i){return"string"==typeof e?2==arguments.length?(iX("data",this.frozen),this.namespace[e]=i,this):iU.call(this.namespace,e)&&this.namespace[e]||void 0:e?(iX("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...i]=this.attachers[this.freezeIndex];if(!1===i[0])continue;!0===i[0]&&(i[0]=void 0);let r=e.call(this,...i);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let i=iZ(e),r=this.parser||this.Parser;return iV("parse",r),r(String(i),i)}process(e,i){let r=this;return this.freeze(),iV("process",this.parser||this.Parser),iY("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(s,n){let o=iZ(e),l=r.parse(o);function a(e,r){e||!r?n(e):s?s(r):(I(i,"`done` is defined if `resolve` is not"),i(void 0,r))}r.run(l,o,function(e,i,s){var n,o;if(e||!i||!s)return a(e);let l=r.stringify(i,s);"string"==typeof(n=l)||(o=n)&&"object"==typeof o&&"byteLength"in o&&"byteOffset"in o?s.value=l:s.result=l,a(e,s)})}}processSync(e){let i,r=!1;return this.freeze(),iV("processSync",this.parser||this.Parser),iY("processSync",this.compiler||this.Compiler),this.process(e,function(e,s){r=!0,iD(e),i=s}),iJ("processSync","process",r),I(i,"we either bailed on an error or have a tree"),i}run(e,i,r){iG(e),this.freeze();let s=this.transformers;return r||"function"!=typeof i||(r=i,i=void 0),r?n(void 0,r):new Promise(n);function n(n,o){I("function"!=typeof i,"`file` can’t be a `done` anymore, we checked");let l=iZ(i);s.run(e,l,function(i,s,l){let a=s||e;i?o(i):n?n(a):(I(r,"`done` is defined if `resolve` is not"),r(void 0,a,l))})}}runSync(e,i){let r,s=!1;return this.run(e,i,function(e,i){iD(e),r=i,s=!0}),iJ("runSync","run",s),I(r,"we either bailed on an error or have a tree"),r}stringify(e,i){this.freeze();let r=iZ(i),s=this.compiler||this.Compiler;return iY("stringify",s),iG(e),s(e,r)}use(e,...i){let r=this.attachers,s=this.namespace;if(iX("use",this.frozen),null==e);else if("function"==typeof e)l(e,i);else if("object"==typeof e)Array.isArray(e)?o(e):n(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function n(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");o(e.plugins),e.settings&&(s.settings=(0,iM.default)(!0,s.settings,e.settings))}function o(e){let i=-1;if(null==e);else if(Array.isArray(e))for(;++i<e.length;)!function(e){if("function"==typeof e)l(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[i,...r]=e;l(i,r)}else n(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[i]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function l(e,i){let s=-1,n=-1;for(;++s<r.length;)if(r[s][0]===e){n=s;break}if(-1===n)r.push([e,...i]);else if(i.length>0){let[s,...o]=i,l=r[n][1];iP(l)&&iP(s)&&(s=(0,iM.default)(!0,l,s)),r[n]=[e,s,...o]}}}}let iq=new iK().freeze();function iV(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `parser`")}function iY(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `compiler`")}function iX(e,i){if(i)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function iG(e){if(!iP(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function iJ(e,i,r){if(!r)throw Error("`"+e+"` finished async. Use `"+i+"` instead")}function iZ(e){var i;return(i=e)&&"object"==typeof i&&"message"in i&&"messages"in i?e:new iz(e)}let iQ=[],i0={allowDangerousHtml:!0},i1=/^(https?|ircs?|mailto|xmpp)$/i,i2=[{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 i5(e){var i;let r,s,n,o,l,a=(r=(i=e).rehypePlugins||iQ,s=i.remarkPlugins||iQ,n=i.remarkRehypeOptions?{...i.remarkRehypeOptions,...i0}:i0,iq().use(t9).use(s).use(iN,n).use(r)),h=(o=e.children||"",l=new iz,"string"==typeof o?l.value=o:O("Unexpected value `"+o+"` for `children` prop, expected `string`"),l);return function(e,i){let r=i.allowedElements,s=i.allowElement,n=i.components,o=i.disallowedElements,l=i.skipHtml,a=i.unwrapDisallowed,h=i.urlTransform||i3;for(let e of i2)Object.hasOwn(i,e.from)&&O("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&&o&&O("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),i_(e,function(e,i,n){if("raw"===e.type&&n&&"number"==typeof i)return l?n.children.splice(i,1):n.children[i]={type:"text",value:e.value},i;if("element"===e.type){let i;for(i in eK)if(Object.hasOwn(eK,i)&&Object.hasOwn(e.properties,i)){let r=e.properties[i],s=eK[i];(null===s||s.includes(e.tagName))&&(e.properties[i]=h(String(r||""),i,e))}}if("element"===e.type){let l=r?!r.includes(e.tagName):!!o&&o.includes(e.tagName);if(!l&&s&&"number"==typeof i&&(l=!s(e,i,n)),l&&n&&"number"==typeof i)return a&&e.children?n.children.splice(i,1,...e.children):n.children.splice(i,1),i}}),function(e,i){var r,s,n,o;let l;if(!i||void 0===i.Fragment)throw TypeError("Expected `Fragment` in options");let a=i.filePath||void 0;if(i.development){if("function"!=typeof i.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=a,s=i.jsxDEV,l=function(e,i,n,o){let l=Array.isArray(n.children),a=ek(e);return s(i,n,o,l,{columnNumber:a?a.column-1:void 0,fileName:r,lineNumber:a?a.line:void 0},void 0)}}else{if("function"!=typeof i.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof i.jsxs)throw TypeError("Expected `jsxs` in production options");n=i.jsx,o=i.jsxs,l=function(e,i,r,s){let l=Array.isArray(r.children)?o:n;return s?l(i,r,s):l(i,r)}}let h={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:l,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:!1!==i.passKeys,passNode:i.passNode||!1,schema:"svg"===i.space?eS:ey,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==i.tableCellAlignToStyle},c=ej(h,e,void 0);return c&&"string"!=typeof c?c:h.create(e,h.Fragment,{children:c||void 0},void 0)}(e,{Fragment:p.Fragment,components:n,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0})}(a.runSync(a.parse(h),h),e)}function i3(e){let i=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),n=e.indexOf("/");return -1===i||-1!==n&&i>n||-1!==r&&i>r||-1!==s&&i>s||i1.test(e.slice(0,i))?e:""}function i4({projectId:e,startInEditMode:i=!1}){let[r,s]=(0,_.useState)(""),[n,o]=(0,_.useState)(null),[l,a]=(0,_.useState)(i),[h,c]=(0,_.useState)(""),[d,u]=(0,_.useState)(!1),[f,m]=(0,_.useState)(null),g=(0,_.useRef)(!1);g.current=l;let v=(0,_.useRef)(i),x=(0,_.useCallback)(async()=>{try{let i=await fetch(`/api/queue?project=${encodeURIComponent(e)}`);if(!i.ok)throw Error(`${i.status}`);let r=await i.json();o(!!r.exists),g.current||s(r.content||""),v.current&&(c(r.content||""),v.current=!1),m(null)}catch(e){m(e.message)}},[e]);(0,_.useEffect)(()=>{x();let e=setInterval(x,1e4);return()=>clearInterval(e)},[x]);let b=async()=>{u(!0),m(null);try{let i=await fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:h})});if(!i.ok)throw Error(`${i.status}`);s(h),a(!1)}catch(e){m(e.message)}finally{u(!1)}},y=async()=>{u(!0);try{let i=await fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"POST"});if(!i.ok)throw Error(`${i.status}`);await x()}catch(e){m(e.message)}finally{u(!1)}};return(0,p.jsxs)("div",{className:"flex flex-col h-full min-h-0 border border-border",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,p.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"OVERNIGHT-QUEUE.md"}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[f&&(0,p.jsxs)("span",{className:"text-[10px] text-error",children:["err: ",f]}),!l&&n&&(0,p.jsx)("button",{onClick:()=>{c(r),a(!0)},className:"text-[10px] text-text-muted hover:text-accent uppercase tracking-wider",children:"Edit"}),l&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("button",{onClick:b,disabled:d,className:"text-[10px] text-accent hover:text-accent-dim uppercase tracking-wider disabled:opacity-50",children:d?"Saving…":"Save"}),(0,p.jsx)("button",{onClick:()=>{a(!1),c(""),x()},disabled:d,className:"text-[10px] text-text-muted hover:text-text uppercase tracking-wider disabled:opacity-50",children:"Cancel"})]})]})]}),l&&(0,p.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,p.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:!1===n?(0,p.jsxs)("div",{className:"p-3 text-[11px] text-text-muted",children:[(0,p.jsx)("p",{className:"mb-2",children:"No OVERNIGHT-QUEUE.md for this project yet."}),(0,p.jsx)("button",{onClick:y,disabled:d,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"})]}):l?(0,p.jsx)("textarea",{value:h,onChange:e=>c(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,p.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,p.jsx)(i5,{children:r})})})]})}function i6({open:e,projectId:i,onClose:r}){return((0,_.useEffect)(()=>{if(!e)return;let i=e=>{"Escape"===e.key&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,r]),e)?(0,p.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,role:"dialog","aria-modal":"true","aria-labelledby":"queue-modal-title",children:(0,p.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,p.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-white/10",children:[(0,p.jsx)("h2",{id:"queue-modal-title",className:"text-[12px] font-semibold text-white",children:"OVERNIGHT-QUEUE.md"}),(0,p.jsx)("button",{type:"button",onClick:r,"aria-label":"Close",className:"rounded p-1 text-neutral-400 hover:bg-white/5 hover:text-white",children:(0,p.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,p.jsx)("path",{d:"M4 4l12 12M16 4L4 16",strokeLinecap:"round"})})})]}),(0,p.jsx)("div",{className:"flex-1 min-h-0",children:(0,p.jsx)(i4,{projectId:i,startInEditMode:!0})})]})}):null}function i9({percent:e}){let i=Math.round(e/100*20);return(0,p.jsxs)("span",{className:"font-mono text-[11px] tabular-nums whitespace-nowrap",children:[(0,p.jsx)("span",{className:"text-accent",children:"█".repeat(i)}),(0,p.jsx)("span",{className:"text-text-muted",children:"░".repeat(20-i)})]})}function i8({projectId:e}){let[i,r]=(0,_.useState)(null),s=(0,_.useCallback)(()=>{fetch(`/api/batch-progress?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{e&&r(e)}).catch(()=>{})},[e]);return((0,_.useEffect)(()=>{s();let e=setInterval(s,3e4);return()=>clearInterval(e)},[s]),i)?i.items&&0!==i.items.length?i.complete?(0,p.jsxs)("div",{className:"border-t border-border",children:[(0,p.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[(0,p.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:["Current Batch: Batch ",i.batch_number??"—"]}),(0,p.jsx)("span",{className:"text-[10px] text-accent",children:"✅ COMPLETE"})]}),(0,p.jsxs)("div",{className:"px-3 pb-2 text-[11px] text-text-muted",children:["All ",i.items.length," items merged. Waiting for the next batch."]})]}):(0,p.jsxs)("div",{className:"border-t border-border",children:[(0,p.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-2 border-b border-border/40",children:[(0,p.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:["Current Batch: Batch ",i.batch_number??"—"]}),(0,p.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",i.items.length," items)"]})]}),(0,p.jsx)("div",{className:"max-h-40 overflow-y-auto",children:i.items.map(e=>{let i=(0,p.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1 font-mono",children:[(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0 tabular-nums",children:["#",e.issue_number]}),(0,p.jsx)(i9,{percent:e.progress}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted tabular-nums shrink-0 w-9 text-right",children:[e.progress,"%"]}),(0,p.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.label})]});return e.url?(0,p.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block hover:bg-[#1a1a1a] transition-colors border-b border-border/30",children:i},e.issue_number):(0,p.jsx)("div",{children:i},e.issue_number)})}),i.summary&&(0,p.jsx)("div",{className:"px-3 py-1.5 text-[11px] text-text-muted border-t border-border/40",children:i.summary})]}):(0,p.jsxs)("div",{className:"border-t border-border",children:[(0,p.jsx)("div",{className:"px-3 py-1.5 flex items-center gap-2",children:(0,p.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Current Batch: (none)"})}),(0,p.jsx)("div",{className:"px-3 pb-2 text-[11px] text-text-muted",children:"No active batch. Ask Head to start one via the chat."})]}):(0,p.jsx)("div",{className:"px-3 py-1.5 text-[11px] text-text-muted border-t border-border",children:"Loading batch progress…"})}function i7({color:e}){return(0,p.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${e}`})}function re({projectId:e}){let[i,r]=(0,_.useState)([]),[s,n]=(0,_.useState)([]),[o,l]=(0,_.useState)([]),[a,h]=(0,_.useState)([]),[c,d]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let i=!1;return fetch(`/api/queue?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(r=>{if(!i&&r&&!r.exists)return fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"POST"})}).catch(()=>{}),()=>{i=!0}},[e]);let u=(0,_.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)&&r(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)&&n(e)}).catch(()=>{}),fetch(`/api/github/closed-issues?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{Array.isArray(e)&&l(e)}).catch(()=>{}),fetch(`/api/github/merged-prs?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{Array.isArray(e)&&h(e)}).catch(()=>{})},[e]);return(0,_.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,p.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[(0,p.jsxs)("div",{className:"flex-1 min-h-0 flex",children:[(0,p.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col border-r border-border",children:[(0,p.jsx)("div",{className:"px-3 py-1.5 border-b border-border shrink-0",children:(0,p.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:["Issues (",i.length,")"]})}),(0,p.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[0===i.length&&(0,p.jsx)("div",{className:"px-3 py-2 text-[11px] text-text-muted",children:"No issues"}),i.map(e=>(0,p.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,p.jsx)(i7,{color:"OPEN"===e.state?"bg-accent":"bg-error"}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,p.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.title}),e.assignees?.[0]&&(0,p.jsx)("span",{className:"text-[10px] text-text-muted shrink-0",children:e.assignees[0].login})]},e.number)),(0,p.jsx)("div",{className:"px-3 pt-2 pb-1 text-[9px] text-text-muted uppercase tracking-wider",children:"Recently closed"}),0===o.length&&(0,p.jsx)("div",{className:"px-3 py-1 text-[11px] text-text-muted",children:"None yet"}),o.map(e=>(0,p.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,p.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:"✓"}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,p.jsx)("span",{className:"text-[11px] text-text-muted truncate flex-1 min-w-0",children:e.title})]},`closed-${e.number}`))]})]}),(0,p.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,p.jsx)("div",{className:"px-3 py-1.5 border-b border-border shrink-0",children:(0,p.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:["Pull Requests (",s.length,")"]})}),(0,p.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[0===s.length&&(0,p.jsx)("div",{className:"px-3 py-2 text-[11px] text-text-muted",children:"No PRs"}),s.map(e=>{let i=e.reviews||[],r=e.reviewDecision||"REVIEW_REQUIRED",s={};for(let e of i){let i=(e.body||"").trim();/^(?:Reviewer2|T2b)\b/i.test(i)?s.reviewer2=e.state:(/^(?:Reviewer1|T2a)\b/i.test(i)||/^##\s*Verdict/i.test(i))&&(s.reviewer1=e.state)}return(0,p.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,p.jsx)(i7,{color:"APPROVED"===r?"bg-accent":"CHANGES_REQUESTED"===r?"bg-error":"bg-[#ffcc00]"}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,p.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.title}),e.assignees?.[0]&&(0,p.jsx)("span",{className:"text-[10px] text-text-muted shrink-0",children:e.assignees[0].login}),["reviewer1","reviewer2"].map(e=>{let i=s[e];return(0,p.jsxs)("span",{className:`text-[10px] shrink-0 ${i?"APPROVED"===i?"text-accent":"CHANGES_REQUESTED"===i?"text-error":"text-[#ffcc00]":"text-text-muted"}`,children:[e,":",i?"APPROVED"===i?"ok":"CHANGES_REQUESTED"===i?"chg":"rev":"—"]},e)}),(0,p.jsx)("span",{className:`text-[10px] shrink-0 ${function(e){if(!e||0===e.length)return"text-text-muted";let i=e.map(e=>e.state);return i.every(e=>"SUCCESS"===e)?"text-accent":i.some(e=>"FAILURE"===e||"ERROR"===e)?"text-error":"text-[#ffcc00]"}(e.statusCheckRollup)}`,children:function(e){if(!e||0===e.length)return"—";let i=e.map(e=>e.state);return i.every(e=>"SUCCESS"===e)?"pass":i.some(e=>"FAILURE"===e||"ERROR"===e)?"fail":"run"}(e.statusCheckRollup)})]},e.number)}),(0,p.jsx)("div",{className:"px-3 pt-2 pb-1 text-[9px] text-text-muted uppercase tracking-wider",children:"Recently merged"}),0===a.length&&(0,p.jsx)("div",{className:"px-3 py-1 text-[11px] text-text-muted",children:"None yet"}),a.map(e=>(0,p.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,p.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:"✓"}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,p.jsx)("span",{className:"text-[11px] text-text-muted truncate flex-1 min-w-0",children:e.title})]},`merged-${e.number}`))]})]})]}),(0,p.jsx)("div",{className:"shrink-0",children:(0,p.jsx)(i8,{projectId:e})}),(0,p.jsxs)("div",{className:"shrink-0 flex items-center justify-between px-3 py-1.5 border-t border-border",children:[(0,p.jsx)("span",{className:"text-[11px] text-text-muted font-mono",children:"OVERNIGHT-QUEUE.md"}),(0,p.jsx)("button",{onClick:()=>d(!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:"Edit"})]}),(0,p.jsx)(i6,{open:c,projectId:e,onClose:()=>d(!1)})]})}function rt({projectId:e}){let[i,r]=(0,_.useState)(null),[s,n]=(0,_.useState)(null),[o,l]=(0,_.useState)(!1),a=()=>{setTimeout(()=>n(null),3e3)};(0,_.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>l(!1),4e3);return()=>clearTimeout(e)},[o]);let h=async()=>{if(!o)return void l(!0);l(!1),r("stop");try{let i=await fetch(`/api/agentchattr/${encodeURIComponent(e)}/stop`,{method:"POST"}),r=await i.json();n(r.ok?"Stopped":"Failed")}catch{n("Error")}r(null),a()},c=async()=>{r("restart");try{let i=await fetch(`/api/agentchattr/${encodeURIComponent(e)}/restart`,{method:"POST"}),r=await i.json();r.ok&&r.pid?n(`Restarted (PID: ${r.pid})`):n(r.error||"Failed to restart")}catch{n("Error")}r(null),a()},d=async()=>{r("reset");try{let i=await fetch(`/api/agents/${encodeURIComponent(e)}/reset`,{method:"POST"}),r=await i.json();n(r.ok?`Reset — ${r.cleared} of ${r.total} slot${1!==r.total?"s":""} deregistered`:"Failed")}catch{n("Error")}r(null),a()};return(0,p.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,p.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:"Server"}),(0,p.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,p.jsx)("button",{onClick:h,disabled:!!i,className:`px-1.5 py-0.5 text-[10px] border transition-colors disabled:opacity-50 ${o?"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?"...":o?"Confirm Stop?":"Stop"}),(0,p.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?"...":"Restart"}),(0,p.jsx)("button",{onClick:d,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?"...":"Reset Agents"})]}),s&&(0,p.jsx)("div",{className:"text-[10px] text-accent",children:s})]})}function ri(e){return Number.isFinite(e)?Math.min(Math.max(e,.1),24):3}function rr(e){let i=Math.floor(e/3600),r=Math.floor(e%3600/60);return i>0?`${i}h ${r}m`:`${r}m`}function rs(){let[e,i]=(0,_.useState)(!1),[r,s]=(0,_.useState)(null),[n,o]=(0,_.useState)(""),[l,a]=(0,_.useState)(!1),[h,c]=(0,_.useState)(String(3)),[d,u]=(0,_.useState)(!1),[f,m]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),[x,C]=(0,_.useState)(!1),[D,M]=(0,_.useState)(!0),[P,T]=(0,_.useState)("soft-chime"),[L,B]=(0,_.useState)(!0);(0,_.useEffect)(()=>{M(E()),T(R()),B(N())},[]);let A=(0,_.useCallback)(()=>{fetch("/api/caffeinate/status").then(e=>e.ok?e.json():null).then(e=>{e&&(i(e.active),s(e.remaining),o(e.platform))}).catch(()=>{})},[]);(0,_.useEffect)(()=>{A();let e=setInterval(A,5e3);return()=>clearInterval(e)},[A]);let I=e=>{fetch("/api/caffeinate/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({duration:e})}).then(e=>e.json()).then(r=>{r.ok&&(i(!0),s(e||null))}).catch(()=>{}),a(!1)},O=!n||"darwin"===n;return(0,p.jsxs)("div",{className:"flex flex-col md:flex-row md:items-start gap-2 md:gap-6 relative",children:[O&&(0,p.jsxs)("div",{className:"flex flex-col gap-0.5 relative",children:[(0,p.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:[(0,p.jsx)("span",{children:"Keep Mac Awake"}),(0,p.jsx)("button",{type:"button","aria-label":"About Keep Mac Awake",onClick:()=>v(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:"?"})]}),g&&(0,p.jsxs)("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:[(0,p.jsx)("b",{children:"Keep Mac Awake"})," runs macOS ",(0,p.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."]}),(0,p.jsx)("div",{className:"text-[10px] text-text-muted leading-tight",children:e&&null!==r&&r>0?`Awake for ${rr(r)} more — keep Mac plugged in`:e&&null===r?"Awake indefinitely — keep Mac plugged in":"Prevents your Mac from sleeping during overnight runs."}),(0,p.jsx)("div",{className:"flex items-center gap-1.5 flex-wrap mt-0.5",children:(0,p.jsxs)("button",{onClick:()=>e?void fetch("/api/caffeinate/stop",{method:"POST"}).then(()=>{i(!1),s(null)}).catch(()=>{}):a(!l),title:"Keep Mac awake (caffeinate)",className:`px-1.5 py-0.5 text-[10px] border transition-colors ${e?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:[e?"Awake":"Start",e&&null!==r&&r>0&&(0,p.jsx)("span",{className:"ml-1 text-accent/70",children:rr(r)}),e&&null===r&&(0,p.jsx)("span",{className:"ml-1 text-accent/70",children:"on"})]})})]}),O&&(0,p.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,p.jsxs)("div",{className:"flex flex-col gap-0.5 relative",children:[(0,p.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:[(0,p.jsx)("span",{children:"Notification Sound"}),(0,p.jsx)("button",{type:"button","aria-label":"About Notification Sound",onClick:()=>C(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:"?"})]}),x&&(0,p.jsxs)("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:[(0,p.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."]}),(0,p.jsx)("div",{className:"text-[10px] text-text-muted leading-tight",children:"Plays a chime when an agent posts a new message."}),(0,p.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap mt-0.5",children:[(0,p.jsxs)("button",{type:"button",onClick:()=>{let e=!D;M(e),k(y,e?"on":"off")},title:D?"Notification sound on (click to mute)":"Notification sound off (click to unmute)",className:`px-1.5 py-0.5 text-[10px] border transition-colors ${D?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:[D?"🔔":"🔕"," Sound"]}),D&&(0,p.jsx)("select",{value:P,onChange:e=>(e=>{if(T(e),k(S,e),D)try{let i=new Audio(`/sounds/${e}.mp3`);i.volume=.6,i.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:b.map(e=>(0,p.jsx)("option",{value:e.value,className:"bg-bg-surface",children:e.label},e.value))})]}),D&&(0,p.jsxs)("label",{className:"flex items-center gap-1 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,p.jsx)("input",{type:"checkbox",checked:L,onChange:e=>{var i;B(i=e.target.checked),k(w,i?"on":"off")}}),"Only when tab is in background"]})]}),l&&!e&&(0,p.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,p.jsxs)("div",{className:"flex items-center justify-between",children:[(0,p.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Keep Awake"}),(0,p.jsx)("button",{type:"button","aria-label":"About Keep Awake",onClick:()=>m(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:"?"})]}),f&&(0,p.jsxs)("div",{className:"p-1.5 text-[10px] leading-snug text-text bg-bg border border-border/60 rounded",children:[(0,p.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,p.jsx)("br",{}),(0,p.jsx)("br",{}),"Under the hood, this runs macOS's ",(0,p.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,p.jsx)("b",{children:"plugged in"})," to avoid draining the battery."]}),(0,p.jsx)("p",{className:"text-[10px] text-[#ffcc00]",children:"Make sure Mac is plugged in"}),(0,p.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",children:[(0,p.jsx)("span",{className:"text-text-muted",children:"for"}),(0,p.jsx)("input",{type:"number",value:h,onChange:e=>c(e.target.value),onBlur:()=>{let e=parseFloat(h);c(String(Math.round(10*(Number.isFinite(e)?ri(e):3))/10))},disabled:d,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,p.jsx)("span",{className:"text-text-muted",children:"hours"})]}),(0,p.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,p.jsx)("input",{type:"checkbox",checked:d,onChange:e=>u(e.target.checked)}),"Until stopped (no expiry)"]}),(0,p.jsx)("button",{type:"button",onClick:()=>{if(d)return void I(0);let e=parseFloat(h);I(Math.round(3600*(Number.isFinite(e)?ri(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:"Start"})]})]})}function rn({projectId:e}){return(0,p.jsx)("div",{className:"border-t border-border px-3 py-2",children:(0,p.jsxs)("div",{className:"flex flex-col md:flex-row md:items-start gap-2 md:gap-6",children:[(0,p.jsx)(rt,{projectId:e}),(0,p.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,p.jsx)(rs,{})]})})}var ro=e.i(24046),rl=Object.defineProperty,ra=Object.getOwnPropertyDescriptor,rh=(e,i,r,s)=>{for(var n,o=s>1?void 0:s?ra(i,r):i,l=e.length-1;l>=0;l--)(n=e[l])&&(o=(s?n(i,r,o):n(o))||o);return s&&o&&rl(i,r,o),o},rc=(e,i)=>(r,s)=>i(r,s,e),rd="Terminal input",ru="Too much output to announce, navigate to rows manually to read";function rf(e,i,r,s){var n;n=e=e.replace(/\r?\n/g,"\r"),e=r.decPrivateModes.bracketedPasteMode&&!0!==s.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+n+"\x1b[201~":n,r.triggerDataEvent(e,!0),i.value=""}function rp(e,i,r){let s=r.getBoundingClientRect(),n=e.clientX-s.left-10,o=e.clientY-s.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${n}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function r_(e,i,r,s,n){rp(e,i,r),n&&s.rightClickSelect(e),i.value=s.selectionText,i.select()}function rm(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function rg(e,i=0,r=e.length){let s="";for(let n=i;n<r;++n){let i=e[n];i>65535?(i-=65536,s+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):s+=String.fromCharCode(i)}return s}var rv=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let r=e.length;if(!r)return 0;let s=0,n=0;if(this._interim){let r=e.charCodeAt(n++);56320<=r&&r<=57343?i[s++]=(this._interim-55296)*1024+r-56320+65536:(i[s++]=this._interim,i[s++]=r),this._interim=0}for(let o=n;o<r;++o){let n=e.charCodeAt(o);if(55296<=n&&n<=56319){if(++o>=r)return this._interim=n,s;let l=e.charCodeAt(o);56320<=l&&l<=57343?i[s++]=(n-55296)*1024+l-56320+65536:(i[s++]=n,i[s++]=l);continue}65279!==n&&(i[s++]=n)}return s}},rx=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let r=e.length;if(!r)return 0;let s=0,n,o,l,a,h=0,c=0;if(this.interim[0]){let n=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let l=0,a;for(;(a=63&this.interim[++l])&&l<4;)o<<=6,o|=a;let h=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,d=h-l;for(;c<d;){if(c>=r)return 0;if((192&(a=e[c++]))!=128){c--,n=!0;break}this.interim[l++]=a,o<<=6,o|=63&a}n||(2===h?o<128?c--:i[s++]=o:3===h?o<2048||o>=55296&&o<=57343||65279===o||(i[s++]=o):o<65536||o>1114111||(i[s++]=o)),this.interim.fill(0)}let d=r-4,u=c;for(;u<r;){for(;u<d&&!(128&(n=e[u]))&&!(128&(o=e[u+1]))&&!(128&(l=e[u+2]))&&!(128&(a=e[u+3]));)i[s++]=n,i[s++]=o,i[s++]=l,i[s++]=a,u+=4;if((n=e[u++])<128)i[s++]=n;else if((224&n)==192){if(u>=r)return this.interim[0]=n,s;if((192&(o=e[u++]))!=128||(h=(31&n)<<6|63&o)<128){u--;continue}i[s++]=h}else if((240&n)==224){if(u>=r)return this.interim[0]=n,s;if((192&(o=e[u++]))!=128){u--;continue}if(u>=r)return this.interim[0]=n,this.interim[1]=o,s;if((192&(l=e[u++]))!=128){u--;continue}if((h=(15&n)<<12|(63&o)<<6|63&l)<2048||h>=55296&&h<=57343||65279===h)continue;i[s++]=h}else if((248&n)==240){if(u>=r)return this.interim[0]=n,s;if((192&(o=e[u++]))!=128){u--;continue}if(u>=r)return this.interim[0]=n,this.interim[1]=o,s;if((192&(l=e[u++]))!=128){u--;continue}if(u>=r)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=l,s;if((192&(a=e[u++]))!=128){u--;continue}if((h=(7&n)<<18|(63&o)<<12|(63&l)<<6|63&a)<65536||h>1114111)continue;i[s++]=h}}return s}},rb=class e{constructor(){this.fg=0,this.bg=0,this.extended=new ry}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ry=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},rS=class e extends rb{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ry,this.combinedData=""}static fromCharData(i){let r=new e;return r.setFromCharData(i),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?rm(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let s=e[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(r-55296)*1024+s-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},rw="di$target",rC="di$dependencies",rk=new Map;function rE(e){if(rk.has(e))return rk.get(e);let i=function(e,r,s){var n,o,l;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");n=i,o=e,l=s,o[rw]===o?o[rC].push({id:n,index:l}):(o[rC]=[{id:n,index:l}],o[rw]=o)};return i._id=e,rk.set(e,i),i}var rR=rE("BufferService"),rN=rE("CoreMouseService"),rD=rE("CoreService"),rM=rE("CharsetService"),rP=rE("InstantiationService"),rT=rE("LogService"),rL=rE("OptionsService"),rB=rE("OscLinkService"),rA=rE("UnicodeService"),rI=rE("DecorationService"),rO=class{constructor(e,i,r){this._bufferService=e,this._optionsService=i,this._oscLinkService=r}provideLinks(e,i){let r=this._bufferService.buffer.lines.get(e-1);if(!r)return void i(void 0);let s=[],n=this._optionsService.rawOptions.linkHandler,o=new rS,l=r.getTrimmedLength(),a=-1,h=-1,c=!1;for(let i=0;i<l;i++)if(!(-1===h&&!r.hasContent(i))){if(r.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId)if(-1===h){h=i,a=o.extended.urlId;continue}else c=o.extended.urlId!==a;else -1!==h&&(c=!0);if(c||-1!==h&&i===l-1){let r=this._oscLinkService.getLinkData(a)?.uri;if(r){let o={start:{x:h+1,y:e},end:{x:i+ +(!c&&i===l-1),y:e}},a=!1;if(!n?.allowNonHttpProtocols)try{let e=new URL(r);["http:","https:"].includes(e.protocol)||(a=!0)}catch{a=!0}a||s.push({text:r,range:o,activate:(e,i)=>n?n.activate(e,i,o):function(e){if(confirm(`Do you want to navigate to ${e}?
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26568,(e,i,r)=>{"use strict";var s=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,o=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,h=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g;function u(e){return e?e.replace(d,""):""}i.exports=function(e,i){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];i=i||{};var r=1,d=1;function f(e){var i=e.match(n);i&&(r+=i.length);var s=e.lastIndexOf("\n");d=~s?e.length-s:d+e.length}function p(){var e={line:r,column:d};return function(i){return i.position=new _(e),g(o),i}}function _(e){this.start=e,this.end={line:r,column:d},this.source=i.source}function m(s){var n=Error(i.source+":"+r+":"+d+": "+s);if(n.reason=s,n.filename=i.source,n.line=r,n.column=d,n.source=e,i.silent);else throw n}function g(i){var r=i.exec(e);if(r){var s=r[0];return f(s),e=e.slice(s.length),r}}function v(e){var i;for(e=e||[];i=x();)!1!==i&&e.push(i);return e}function x(){var i=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return m("End of comment missing");var s=e.slice(2,r-2);return d+=2,f(s),e=e.slice(r),d+=2,i({type:"comment",comment:s})}}_.prototype.content=e,g(o);var b,y=[];for(v(y);b=function(){var e=p(),i=g(l);if(i){if(x(),!g(a))return m("property missing ':'");var r=g(h),n=e({type:"declaration",property:u(i[0].replace(s,"")),value:r?u(r[0].replace(s,"")):""});return g(c),n}}();)!1!==b&&(y.push(b),v(y));return y}},70454,(e,i,r)=>{"use strict";var s=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,i){let r=null;if(!e||"string"!=typeof e)return r;let s=(0,n.default)(e),o="function"==typeof i;return s.forEach(e=>{if("declaration"!==e.type)return;let{property:s,value:n}=e;o?i(s,n,e):n&&((r=r||{})[s]=n)}),r};let n=s(e.r(26568))},65185,(e,i,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.camelCase=void 0;var s=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,o=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,h=function(e,i){return i.toUpperCase()},c=function(e,i){return"".concat(i,"-")};r.camelCase=function(e,i){var r;return(void 0===i&&(i={}),!(r=e)||o.test(r)||s.test(r))?e:(e=e.toLowerCase(),(e=i.reactCompat?e.replace(a,c):e.replace(l,c)).replace(n,h))}},15511,(e,i,r)=>{"use strict";var s=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(70454)),n=e.r(65185);function o(e,i){var r={};return e&&"string"==typeof e&&(0,s.default)(e,function(e,s){e&&s&&(r[(0,n.camelCase)(e,i)]=s)}),r}o.default=o,i.exports=o},4100,(e,i,r)=>{"use strict";var s=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},h=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=s.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||s.call(e,i)},c=function(e,i){o&&"__proto__"===i.name?o(e,i.name,{enumerable:!0,configurable:!0,value:i.newValue,writable:!0}):e[i.name]=i.newValue},d=function(e,i){if("__proto__"===i){if(!s.call(e,i))return;else if(l)return l(e,i).value}return e[i]};i.exports=function e(){var i,r,s,n,o,l,u=arguments[0],f=1,p=arguments.length,_=!1;for("boolean"==typeof u&&(_=u,u=arguments[1]||{},f=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});f<p;++f)if(i=arguments[f],null!=i)for(r in i)s=d(u,r),u!==(n=d(i,r))&&(_&&n&&(h(n)||(o=a(n)))?(o?(o=!1,l=s&&a(s)?s:[]):l=s&&h(s)?s:{},c(u,{name:r,newValue:e(_,l,n)})):void 0!==n&&c(u,{name:r,newValue:n}));return u}},55601,e=>{"use strict";let i,r,s,n,o,l,a,h,c,d,u,f;var p=e.i(43476),_=e.i(71645);function m({label:e,status:i,projectId:r,agentId:s,onStatusChange:n}){let o="running"===i?"bg-accent":"error"===i?"bg-error":"bg-text-muted",l=e=>{r&&s&&fetch(`/api/agents?project=${encodeURIComponent(r)}&agent=${encodeURIComponent(s)}&action=${e}`,{method:"POST"}).then(e=>e.json()).then(e=>{n&&e.state&&n(e.state)}).catch(()=>{})};return(0,p.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 h-7 shrink-0 border-b border-border",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[i&&(0,p.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${o}`}),(0,p.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:e})]}),r&&s&&(0,p.jsxs)("div",{className:"flex items-center gap-1",children:["running"!==i&&(0,p.jsx)("button",{onClick:()=>l("start"),className:"text-[10px] text-text-muted hover:text-accent transition-colors px-1",title:"Start",children:"▶"}),"running"===i&&(0,p.jsx)("button",{onClick:()=>l("stop"),className:"text-[10px] text-text-muted hover:text-error transition-colors px-1",title:"Stop",children:"■"}),(0,p.jsx)("button",{onClick:()=>l("restart"),className:"text-[10px] text-text-muted hover:text-accent transition-colors px-1",title:"Restart",children:"↻"})]})]})}var g=e.i(78759);let v=["@head start a new feature: <describe>","@head review the latest PR","@head what's our current sprint?"];function x({onInsert:e}){let[i,r]=(0,_.useState)(!1);return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center text-center px-6 py-10 gap-3",children:[(0,p.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none","aria-hidden":!0,className:"text-accent",children:[(0,p.jsx)("path",{d:"M6 8h28a2 2 0 0 1 2 2v17a2 2 0 0 1-2 2H16l-7 6v-6h-3a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),(0,p.jsx)("circle",{cx:"14",cy:"18",r:"1.4",fill:"currentColor"}),(0,p.jsx)("circle",{cx:"20",cy:"18",r:"1.4",fill:"currentColor"}),(0,p.jsx)("circle",{cx:"26",cy:"18",r:"1.4",fill:"currentColor"})]}),(0,p.jsx)("div",{className:"text-[13px] font-semibold text-text",children:"Ready when you are"}),(0,p.jsx)("div",{className:"text-[11px] text-text-muted",children:"Tell your team what to build. Try something like:"}),(0,p.jsx)("div",{className:"flex flex-col gap-1.5 mt-1 w-full max-w-sm",children:v.map(i=>(0,p.jsx)("button",{type:"button",onClick:()=>e(i),className:"text-left px-2 py-1 text-[11px] font-mono text-text-muted border border-border hover:text-accent hover:border-accent transition-colors truncate",children:i},i))}),(0,p.jsx)("button",{type:"button",onClick:()=>r(!0),className:"mt-2 text-[11px] text-text-muted underline underline-offset-2 hover:text-text",children:"How to Work"}),(0,p.jsx)(g.default,{open:i,onClose:()=>r(!1)})]})}let b=[{value:"soft-chime",label:"Soft Chime"},{value:"warm-bell",label:"Warm Bell"},{value:"click",label:"Click"},{value:"alert-tone",label:"Alert Tone"},{value:"pluck",label:"Pluck"}],y="quadwork_notification_sound",S="quadwork_notification_sound_choice",w="quadwork_notification_sound_background_only";function C(e){try{return window.localStorage.getItem(e)}catch{return null}}function k(e,i){try{window.localStorage.setItem(e,i)}catch{}}function E(){return"off"!==C(y)}function R(){let e=C(S);return e&&b.some(i=>i.value===e)?e:"soft-chime"}function N(){let e=C(w);return null===e||"off"!==e}let D={head:"#00ff88",reviewer1:"#4488ff",reviewer2:"#cc44ff",dev:"#ffcc00",user:"#e0e0e0",system:"#737373"},M=["head","reviewer1","reviewer2","dev","user"],P=[{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 T(e){return D[e.toLowerCase()]||"#e0e0e0"}let L=/(^|\s)(@(?:head|dev|reviewer1|reviewer2|user))(?![\w-])/gi;function B({projectId:e}){let[i,r]=(0,_.useState)("loading"),[s,n]=(0,_.useState)(""),[o,l]=(0,_.useState)("");return((0,_.useEffect)(()=>{fetch("/api/config").then(e=>{if(!e.ok)throw Error("config fetch failed");return e.json()}).then(i=>{let r=e?i.projects?.find(i=>i.id===e):null;n(r?.agentchattr_url||i.agentchattr_url||"http://127.0.0.1:8300"),l(r?.agentchattr_token||i.agentchattr_token||"")}).catch(()=>n("http://127.0.0.1:8300"))},[e]),(0,_.useEffect)(()=>{if("loading"!==i)return;let e=setTimeout(()=>{r(e=>"loading"===e?"api":e)},3e3);return()=>clearTimeout(e)},[i]),s)?"loading"===i||"iframe"===i?(0,p.jsxs)("div",{className:"w-full h-full",children:[(0,p.jsx)("iframe",{ref:e=>{e&&(e.onload=()=>{try{let i=e.contentDocument||e.contentWindow?.document;i&&i.body&&i.body.innerHTML.length>0?r("iframe"):r("api")}catch{r("api")}},e.onerror=()=>r("api"))},src:o?`${s}?token=${encodeURIComponent(o)}`:s,className:"w-full h-full border-0",style:{display:"loading"===i?"none":"block"},sandbox:"allow-same-origin allow-scripts allow-forms allow-popups"}),"loading"===i&&(0,p.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,p.jsx)("span",{className:"text-xs text-text-muted",children:"Connecting to AgentChattr..."})})]}):(0,p.jsx)(A,{projectId:e}):null}function A({projectId:e}){let i="general",[r,s]=(0,_.useState)([]),[n,o]=(0,_.useState)(""),[l,a]=(0,_.useState)(!1),[h,c]=(0,_.useState)(""),[d,u]=(0,_.useState)(!1),[f,m]=(0,_.useState)(0),[g,v]=(0,_.useState)(null),[b,y]=(0,_.useState)(null),S=(0,_.useRef)("user");(0,_.useEffect)(()=>{fetch("/api/config").then(e=>e.ok?e.json():null).then(e=>{e&&"string"==typeof e.operator_name&&e.operator_name&&(S.current=e.operator_name)}).catch(()=>{})},[]);let w=(0,_.useRef)(0),C=(0,_.useRef)(null),k=(0,_.useRef)(null),D=(0,_.useRef)(!1),B=(0,_.useRef)(!0),I=(0,_.useRef)(0);(0,_.useEffect)(()=>{w.current=0,s([])},[e]);let O=(0,_.useCallback)(()=>{fetch(`/api/chat?path=/api/messages&channel=${encodeURIComponent(i)}&cursor=${w.current}${e?`&project=${encodeURIComponent(e)}`:""}`).then(e=>{if(403===e.status)throw I.current<3?v(null):v("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=>{v(null);let i=Array.isArray(e)?e:e.messages||[];if(i.length>0){let e=w.current,r=S.current,n=e>0&&i.some(i=>i.id>e&&(void 0===i.type||"chat"===i.type)&&"user"!==i.sender&&i.sender!==r&&"system"!==i.sender);s(e=>{let r=new Set(e.map(e=>e.id)),s=i.filter(e=>!r.has(e.id));return s.length>0?[...e,...s]:e});let o=Math.max(...i.map(e=>e.id));o>w.current&&(w.current=o),n&&function(){if(!E()||N()&&document.hasFocus())return;let e=R();try{let i=new Audio(`/sounds/${e}.mp3`);i.volume=.6,i.play().catch(()=>{})}catch{}}()}}).catch(()=>{})},[i,e]);(0,_.useEffect)(()=>{O();let e=setInterval(O,3e3);return()=>clearInterval(e)},[O]),(0,_.useEffect)(()=>{B.current&&C.current&&(C.current.scrollTop=C.current.scrollHeight)},[r]);let[j,z]=(0,_.useState)(!1),[H,F]=(0,_.useState)(null);(0,_.useEffect)(()=>{let e=k.current;e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,120)+"px")},[n]);let W=()=>{let r=n.trim();if(!r||j)return;let s=r.startsWith("/")||/@(head|dev|reviewer1|reviewer2)\b/i.test(r)?r:`@head ${r}`;z(!0),F(null),fetch(`/api/chat${e?`?project=${encodeURIComponent(e)}`:""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:s,channel:i,sender:"user",...b?{reply_to:b.id}:{}})}).then(e=>{if(!e.ok)throw Error(`Send failed: ${e.status}`);o(""),y(null),setTimeout(O,300)}).catch(e=>{F(e.message),console.error(e.message)}).finally(()=>z(!1))},$=e=>{o(n.replace(/@\w*$/,`@${e} `)),a(!1),k.current?.focus()},U=e=>{o(e.includes(" ")?e:`${e} `),u(!1),k.current?.focus()},K=M.filter(e=>e.toLowerCase().startsWith(h)),q=P.filter(e=>e.command.toLowerCase().startsWith(n.toLowerCase()));return(0,p.jsxs)("div",{className:"flex flex-col h-full bg-bg",children:[g&&(0,p.jsx)("div",{className:"px-3 py-2 bg-red-900/30 border-b border-red-700/50 text-[11px] text-red-400",children:g}),(0,p.jsxs)("div",{ref:C,onScroll:()=>{if(!C.current)return;let{scrollTop:e,scrollHeight:i,clientHeight:r}=C.current;B.current=i-e-r<40},className:"flex-1 min-h-0 overflow-y-auto px-3 py-2 space-y-0.5",children:[0===r.length&&(0,p.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,p.jsx)(x,{onInsert:e=>{o(e),k.current?.focus()}})}),r.map(e=>{var i;let r;return(0,p.jsxs)("div",{className:"group flex gap-2 text-[12px] leading-5",children:[(0,p.jsx)("span",{className:"text-text-muted shrink-0 w-12 text-right tabular-nums",children:e.time?.slice(0,5)||""}),(0,p.jsx)("span",{className:"shrink-0 font-semibold w-10 text-right",style:{color:T(e.sender)},children:"reviewer1"===(r=(i=e.sender).toLowerCase())?"RE1":"reviewer2"===r?"RE2":i}),(0,p.jsx)("span",{className:"text-text break-words min-w-0 whitespace-pre-wrap flex-1",children:function(e){let i=[],r=0,s=0;for(let n of e.matchAll(L)){let o=n.index??0,l=n[1],a=n[2],h=o+l.length;h>r&&i.push(e.slice(r,h));let c=T(a.slice(1).toLowerCase());i.push((0,p.jsx)("span",{className:"inline-block px-1 py-0 rounded font-mono",style:{backgroundColor:`${c}22`,color:c},children:a},`m${s++}`)),r=h+a.length}return r<e.length&&i.push(e.slice(r)),i.length>0?i:[e]}(e.text)}),(0,p.jsx)("button",{type:"button",onClick:()=>{if(y({id:e.id,sender:e.sender}),new Set(["head","dev","reviewer1","reviewer2"]).has(e.sender.toLowerCase())){let i=`@${e.sender} `;o(e=>e.startsWith(i)?e:i)}k.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 #${e.id}`,children:"reply"})]},e.id)})]}),(0,p.jsxs)("div",{className:"relative shrink-0 border-t border-border",children:[l&&K.length>0&&(0,p.jsx)("div",{className:"absolute bottom-full left-0 right-0 border border-border bg-bg-surface",children:K.map(e=>(0,p.jsxs)("button",{onClick:()=>$(e),className:"w-full text-left px-3 py-1 text-[12px] hover:bg-[#1a1a1a] transition-colors",style:{color:T(e)},children:["@",e]},e))}),d&&q.length>0&&(0,p.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:q.map((e,i)=>{let r=i===Math.min(f,q.length-1);return(0,p.jsxs)("button",{onClick:()=>U(e.command),onMouseEnter:()=>m(i),className:`w-full text-left px-3 py-1 transition-colors flex items-baseline gap-2 ${r?"bg-[#1a1a1a]":"hover:bg-[#1a1a1a]"}`,children:[(0,p.jsx)("span",{className:"text-[12px] text-accent font-mono",children:e.command}),(0,p.jsx)("span",{className:"text-[10px] text-text-muted truncate",children:e.description})]},e.command)})}),H&&(0,p.jsx)("div",{className:"px-3 py-1 text-[11px] text-red-400 bg-red-900/20 border-b border-red-700/40",children:H}),b&&(0,p.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,p.jsxs)("span",{children:["Replying to ",(0,p.jsxs)("span",{style:{color:T(b.sender)},children:["@",b.sender]})," #",b.id]}),(0,p.jsx)("button",{type:"button",onClick:()=>y(null),className:"ml-auto hover:text-text",title:"Cancel reply (Esc)",children:"✕"})]}),(0,p.jsxs)("div",{className:"flex items-end gap-1 px-1",children:[(0,p.jsx)("textarea",{ref:k,rows:1,value:n,onChange:e=>(e=>{o(e);let i=e.match(/@(\w*)$/);if(i){a(!0),c(i[1].toLowerCase()),u(!1);return}if(a(!1),e.startsWith("/")){let i=e.slice(1).includes(" "),r=e.startsWith("/poetry");u(!i||r),m(0)}else u(!1)})(e.target.value),onCompositionStart:()=>{D.current=!0},onCompositionEnd:()=>{D.current=!1},onKeyDown:e=>{if("Tab"===e.key&&l&&K.length>0){e.preventDefault(),$(K[0]);return}if(d&&q.length>0){if("ArrowDown"===e.key){e.preventDefault(),m(e=>(e+1)%q.length);return}if("ArrowUp"===e.key){e.preventDefault(),m(e=>(e-1+q.length)%q.length);return}if("Tab"===e.key||"Enter"===e.key&&!e.shiftKey){e.preventDefault();let i=Math.min(f,q.length-1);U(q[i].command);return}}"Enter"!==e.key||e.shiftKey||D.current||e.nativeEvent.isComposing||(e.preventDefault(),W()),"Escape"===e.key&&(a(!1),u(!1),b&&y(null))},placeholder:`Message #${i}...`,disabled:j,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,p.jsx)("button",{onClick:W,disabled:j||!n.trim(),className:"shrink-0 px-2 py-1 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:j?"…":"Send"})]})]})]})}function I(){}function O(){}let j=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,z=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,H={};function F(e,i){return((i||H).jsx?z:j).test(e)}let W=/[ \t\n\f\r]/g;function $(e){return""===e.replace(W,"")}class U{constructor(e,i){this.attribute=i,this.property=e}}U.prototype.attribute="",U.prototype.booleanish=!1,U.prototype.boolean=!1,U.prototype.commaOrSpaceSeparated=!1,U.prototype.commaSeparated=!1,U.prototype.defined=!1,U.prototype.mustUseProperty=!1,U.prototype.number=!1,U.prototype.overloadedBoolean=!1,U.prototype.property="",U.prototype.spaceSeparated=!1,U.prototype.space=void 0;let K=0,q=Q(),V=Q(),Y=Q(),X=Q(),G=Q(),J=Q(),Z=Q();function Q(){return 2**++K}e.s(["boolean",0,q,"booleanish",0,V,"commaOrSpaceSeparated",0,Z,"commaSeparated",0,J,"number",0,X,"overloadedBoolean",0,Y,"spaceSeparated",0,G],744);var ee=e.i(744);let et=Object.keys(ee);class ei extends U{constructor(e,i,r,s){let n=-1;if(super(e,i),function(e,i,r){r&&(e[i]=r)}(this,"space",s),"number"==typeof r)for(;++n<et.length;){const e=et[n];!function(e,i,r){r&&(e[i]=r)}(this,et[n],(r&ee[e])===ee[e])}}}function er(e){return e.toLowerCase()}ei.prototype.defined=!0;let es=/[A-Z]/g,en=/-[a-z]/g,eo=/^data[-\w.:]+$/i;function el(e){return"-"+e.toLowerCase()}function ea(e){return e.charAt(1).toUpperCase()}let eh={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 ec{constructor(e,i,r){this.normal=i,this.property=e,r&&(this.space=r)}}function ed(e,i){let r={},s={};for(let i of e)Object.assign(r,i.property),Object.assign(s,i.normal);return new ec(r,s,i)}function eu(e){let i={},r={};for(let[s,n]of Object.entries(e.properties)){let o=new ei(s,e.transform(e.attributes||{},s),n,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(o.mustUseProperty=!0),i[s]=o,r[er(s)]=s,r[er(o.attribute)]=s}return new ec(i,r,e.space)}ec.prototype.normal={},ec.prototype.property={},ec.prototype.space=void 0;let ef=eu({properties:{ariaActiveDescendant:null,ariaAtomic:V,ariaAutoComplete:null,ariaBusy:V,ariaChecked:V,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:G,ariaCurrent:null,ariaDescribedBy:G,ariaDetails:null,ariaDisabled:V,ariaDropEffect:G,ariaErrorMessage:null,ariaExpanded:V,ariaFlowTo:G,ariaGrabbed:V,ariaHasPopup:null,ariaHidden:V,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:G,ariaLevel:X,ariaLive:null,ariaModal:V,ariaMultiLine:V,ariaMultiSelectable:V,ariaOrientation:null,ariaOwns:G,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:V,ariaReadOnly:V,ariaRelevant:null,ariaRequired:V,ariaRoleDescription:G,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:V,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform:(e,i)=>"role"===i?i:"aria-"+i.slice(4).toLowerCase()});function ep(e,i){return i in e?e[i]:i}function e_(e,i){return ep(e,i.toLowerCase())}let em=eu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:J,acceptCharset:G,accessKey:G,action:null,allow:null,allowFullScreen:q,allowPaymentRequest:q,allowUserMedia:q,alt:null,as:null,async:q,autoCapitalize:null,autoComplete:G,autoFocus:q,autoPlay:q,blocking:G,capture:null,charSet:null,checked:q,cite:null,className:G,cols:X,colSpan:null,content:null,contentEditable:V,controls:q,controlsList:G,coords:X|J,crossOrigin:null,data:null,dateTime:null,decoding:null,default:q,defer:q,dir:null,dirName:null,disabled:q,download:Y,draggable:V,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:q,formTarget:null,headers:G,height:X,hidden:Y,high:X,href:null,hrefLang:null,htmlFor:G,httpEquiv:G,id:null,imageSizes:null,imageSrcSet:null,inert:q,inputMode:null,integrity:null,is:null,isMap:q,itemId:null,itemProp:G,itemRef:G,itemScope:q,itemType:G,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:q,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:q,muted:q,name:null,nonce:null,noModule:q,noValidate:q,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:q,optimum:X,pattern:null,ping:G,placeholder:null,playsInline:q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:q,referrerPolicy:null,rel:G,required:q,reversed:q,rows:X,rowSpan:X,sandbox:G,scope:null,scoped:q,seamless:q,selected:q,shadowRootClonable:q,shadowRootDelegatesFocus:q,shadowRootMode:null,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:V,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:q,useMap:null,value:V,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:G,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:q,declare:q,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:q,noHref:q,noShade:q,noWrap:q,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:V,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:q,disableRemotePlayback:q,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:e_}),eg=eu({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:Z,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:G,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:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:q,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,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:J,g2:J,glyphName:J,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:Z,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,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:X,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:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:G,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Z,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Z,rev:Z,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Z,requiredFeatures:Z,requiredFonts:Z,requiredFormats:Z,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:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:Z,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Z,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Z,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ep}),ev=eu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,i)=>"xlink:"+i.slice(5).toLowerCase()}),ex=eu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:e_}),eb=eu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,i)=>"xml:"+i.slice(3).toLowerCase()}),ey=ed([ef,em,ev,ex,eb],"html"),eS=ed([ef,eg,ev,ex,eb],"svg");var ew=e.i(15511);let eC=eE("end"),ek=eE("start");function eE(e){return function(i){let r=i&&i.position&&i.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function eR(e){return e&&"object"==typeof e?"position"in e||"type"in e?eD(e.position):"start"in e||"end"in e?eD(e):"line"in e||"column"in e?eN(e):"":""}function eN(e){return eM(e&&e.line)+":"+eM(e&&e.column)}function eD(e){return eN(e&&e.start)+"-"+eN(e&&e.end)}function eM(e){return e&&"number"==typeof e?e:1}class eP extends Error{constructor(e,i,r){super(),"string"==typeof i&&(r=i,i=void 0);let s="",n={},o=!1;if(i&&(n="line"in i&&"column"in i||"start"in i&&"end"in i?{place:i}:"type"in i?{ancestors:[i],place:i.position}:{...i}),"string"==typeof e?s=e:!n.cause&&e&&(o=!0,s=e.message,n.cause=e),!n.ruleId&&!n.source&&"string"==typeof r){const e=r.indexOf(":");-1===e?n.ruleId=r:(n.source=r.slice(0,e),n.ruleId=r.slice(e+1))}if(!n.place&&n.ancestors&&n.ancestors){const e=n.ancestors[n.ancestors.length-1];e&&(n.place=e.position)}const l=n.place&&"start"in n.place?n.place.start:n.place;this.ancestors=n.ancestors||void 0,this.cause=n.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=eR(n.place)||"1:1",this.place=n.place||void 0,this.reason=this.message,this.ruleId=n.ruleId||void 0,this.source=n.source||void 0,this.stack=o&&n.cause&&"string"==typeof n.cause.stack?n.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}eP.prototype.file="",eP.prototype.name="",eP.prototype.reason="",eP.prototype.message="",eP.prototype.stack="",eP.prototype.column=void 0,eP.prototype.line=void 0,eP.prototype.ancestors=void 0,eP.prototype.cause=void 0,eP.prototype.fatal=void 0,eP.prototype.place=void 0,eP.prototype.ruleId=void 0,eP.prototype.source=void 0;let eT={}.hasOwnProperty,eL=new Map,eB=/[A-Z]/g,eA=new Set(["table","tbody","thead","tfoot","tr"]),eI=new Set(["td","th"]),eO="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ej(e,i,r){var s,n,o,l,a,h,c,d,u;let f,p,_,m,g,v,x,b,y,S,w;return"element"===i.type?(s=e,n=i,o=r,p=f=s.schema,"svg"===n.tagName.toLowerCase()&&"html"===f.space&&(s.schema=eS),s.ancestors.push(n),_=eW(s,n.tagName,!1),m=function(e,i){let r,s,n={};for(s in i.properties)if("children"!==s&&eT.call(i.properties,s)){let o=function(e,i,r){let s=function(e,i){let r=er(i),s=i,n=U;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&eo.test(i)){if("-"===i.charAt(4)){let e=i.slice(5).replace(en,ea);s="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=i.slice(4);if(!en.test(e)){let r=e.replace(es,el);"-"!==r.charAt(0)&&(r="-"+r),i="data"+r}}n=ei}return new n(s,i)}(e.schema,i);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){var n;let i;if(Array.isArray(r)&&(r=s.commaSeparated?(i={},(""===(n=r)[n.length-1]?[...n,""]:n).join((i.padRight?" ":"")+","+(!1===i.padLeft?"":" ")).trim()):r.join(" ").trim()),"style"===s.property){let i="object"==typeof r?r:function(e,i){try{return(0,ew.default)(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let i=new eP("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=eO+"#cannot-parse-style-attribute",i}}(e,String(r));return"css"===e.stylePropertyNameCase&&(i=function(e){let i,r={};for(i in e)eT.call(e,i)&&(r[function(e){let i=e.replace(eB,eU);return"ms-"===i.slice(0,3)&&(i="-"+i),i}(i)]=e[i]);return r}(i)),["style",i]}return["react"===e.elementAttributeNameCase&&s.space?eh[s.property]||s.property:s.attribute,r]}}(e,s,i.properties[s]);if(o){let[s,l]=o;e.tableCellAlignToStyle&&"align"===s&&"string"==typeof l&&eI.has(i.tagName)?r=l:n[s]=l}}return r&&((n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),n}(s,n),g=eF(s,n),eA.has(n.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&$(e.value):$(e))})),ez(s,m,_,n),eH(m,g),s.ancestors.pop(),s.schema=f,s.create(n,_,m,o)):"mdxFlowExpression"===i.type||"mdxTextExpression"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater){let r=i.data.estree.body[0];return I("ExpressionStatement"===r.type),e.evaluater.evaluateExpression(r.expression)}e$(e,i.position)}(e,i):"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?(l=e,a=i,h=r,x=v=l.schema,"svg"===a.name&&"html"===v.space&&(l.schema=eS),l.ancestors.push(a),b=null===a.name?l.Fragment:eW(l,a.name,!0),y=function(e,i){let r={};for(let s of i.attributes)if("mdxJsxExpressionAttribute"===s.type)if(s.data&&s.data.estree&&e.evaluater){let i=s.data.estree.body[0];I("ExpressionStatement"===i.type);let n=i.expression;I("ObjectExpression"===n.type);let o=n.properties[0];I("SpreadElement"===o.type),Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else e$(e,i.position);else{let n,o=s.name;if(s.value&&"object"==typeof s.value)if(s.value.data&&s.value.data.estree&&e.evaluater){let i=s.value.data.estree.body[0];I("ExpressionStatement"===i.type),n=e.evaluater.evaluateExpression(i.expression)}else e$(e,i.position);else n=null===s.value||s.value;r[o]=n}return r}(l,a),S=eF(l,a),ez(l,y,b,a),eH(y,S),l.ancestors.pop(),l.schema=v,l.create(a,b,y,h)):"mdxjsEsm"===i.type?function(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);e$(e,i.position)}(e,i):"root"===i.type?(c=e,d=i,u=r,eH(w={},eF(c,d)),c.create(d,c.Fragment,w,u)):"text"===i.type?i.value:void 0}function ez(e,i,r,s){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(i.node=s)}function eH(e,i){if(i.length>0){let r=i.length>1?i:i[0];r&&(e.children=r)}}function eF(e,i){let r=[],s=-1,n=e.passKeys?new Map:eL;for(;++s<i.children.length;){let o,l=i.children[s];if(e.passKeys){let e="element"===l.type?l.tagName:"mdxJsxFlowElement"===l.type||"mdxJsxTextElement"===l.type?l.name:void 0;if(e){let i=n.get(e)||0;o=e+"-"+i,n.set(e,i+1)}}let a=ej(e,l,o);void 0!==a&&r.push(a)}return r}function eW(e,i,r){let s;if(r)if(i.includes(".")){let e,r=i.split("."),n=-1;for(;++n<r.length;){let i=F(r[n])?{type:"Identifier",name:r[n]}:{type:"Literal",value:r[n]};e=e?{type:"MemberExpression",object:e,property:i,computed:!!(n&&"Literal"===i.type),optional:!1}:i}I(e,"always a result"),s=e}else s=F(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};else s={type:"Literal",value:i};if("Literal"===s.type){let i=s.value;return eT.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(s);e$(e)}function e$(e,i){let r=new eP("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=eO+"#cannot-handle-mdx-estrees-without-createevaluater",r}function eU(e){return"-"+e.toLowerCase()}let eK={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"]},eq={};function eV(e,i,r){var s;if((s=e)&&"object"==typeof s){if("value"in e)return"html"!==e.type||r?e.value:"";if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return eY(e.children,i,r)}return Array.isArray(e)?eY(e,i,r):""}function eY(e,i,r){let s=[],n=-1;for(;++n<e.length;)s[n]=eV(e[n],i,r);return s.join("")}function eX(e,i,r,s){let n,o=e.length,l=0;if(i=i<0?-i>o?0:o+i:i>o?o:i,r=r>0?r:0,s.length<1e4)(n=Array.from(s)).unshift(i,r),e.splice(...n);else for(r&&e.splice(i,r);l<s.length;)(n=s.slice(l,l+1e4)).unshift(i,0),e.splice(...n),l+=1e4,i+=1e4}function eG(e,i){return e.length>0?(eX(e,e.length,0,i),e):i}let eJ={}.hasOwnProperty,eZ=te(/[A-Za-z]/),eQ=te(/[\dA-Za-z]/),e0=te(/[#-'*+\--9=?A-Z^-~]/);function e1(e){return null!==e&&(e<32||127===e)}let e2=te(/\d/),e5=te(/[\dA-Fa-f]/),e3=te(/[!-/:-@[-`{-~]/);function e4(e){return null!==e&&e<-2}function e6(e){return null!==e&&(e<0||32===e)}function e9(e){return -2===e||-1===e||32===e}let e8=te(/\p{P}|\p{S}/u),e7=te(/\s/);function te(e){return function(i){return null!==i&&i>-1&&e.test(String.fromCharCode(i))}}function tt(e,i,r,s){let n=s?s-1:1/0,o=0;return function(s){return e9(s)?(e.enter(r),function s(l){return e9(l)&&o++<n?(e.consume(l),s):(e.exit(r),i(l))}(s)):i(s)}}let ti={tokenize:function(e){let i,r=e.attempt(this.parser.constructs.contentInitial,function(i){return null===i?void e.consume(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),tt(e,r,"linePrefix"))},function(r){return e.enter("paragraph"),function r(s){let n=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=n),i=n,function i(s){if(null===s){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return e4(s)?(e.consume(s),e.exit("chunkText"),r):(e.consume(s),i)}(s)}(r)});return r}},tr={tokenize:function(e){let i,r,s,n=this,o=[],l=0;return a;function a(i){if(l<o.length){let r=o[l];return n.containerState=r[1],e.attempt(r[0].continuation,h,c)(i)}return c(i)}function h(e){if(l++,n.containerState._closeFlow){let r;n.containerState._closeFlow=void 0,i&&v();let s=n.events.length,o=s;for(;o--;)if("exit"===n.events[o][0]&&"chunkFlow"===n.events[o][1].type){r=n.events[o][1].end;break}g(l);let a=s;for(;a<n.events.length;)n.events[a][1].end={...r},a++;return eX(n.events,o+1,0,n.events.slice(s)),n.events.length=a,c(e)}return a(e)}function c(r){if(l===o.length){if(!i)return f(r);if(i.currentConstruct&&i.currentConstruct.concrete)return _(r);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(ts,d,u)(r)}function d(e){return i&&v(),g(l),f(e)}function u(e){return n.parser.lazy[n.now().line]=l!==o.length,s=n.now().offset,_(e)}function f(i){return n.containerState={},e.attempt(ts,p,_)(i)}function p(e){return l++,o.push([n.currentConstruct,n.containerState]),f(e)}function _(s){if(null===s){i&&v(),g(0),e.consume(s);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:r}),function i(r){if(null===r){m(e.exit("chunkFlow"),!0),g(0),e.consume(r);return}return e4(r)?(e.consume(r),m(e.exit("chunkFlow")),l=0,n.interrupt=void 0,a):(e.consume(r),i)}(s)}function m(e,o){let a=n.sliceStream(e);if(o&&a.push(null),e.previous=r,r&&(r.next=e),r=e,i.defineSkip(e.start),i.write(a),n.parser.lazy[e.start.line]){let e,r,o=i.events.length;for(;o--;)if(i.events[o][1].start.offset<s&&(!i.events[o][1].end||i.events[o][1].end.offset>s))return;let a=n.events.length,h=a;for(;h--;)if("exit"===n.events[h][0]&&"chunkFlow"===n.events[h][1].type){if(e){r=n.events[h][1].end;break}e=!0}for(g(l),o=a;o<n.events.length;)n.events[o][1].end={...r},o++;eX(n.events,h+1,0,n.events.slice(a)),n.events.length=o}}function g(i){let r=o.length;for(;r-- >i;){let i=o[r];n.containerState=i[1],i[0].exit.call(n,e)}o.length=i}function v(){i.write([null]),r=void 0,i=void 0,n.containerState._closeFlow=void 0}}},ts={tokenize:function(e,i,r){return tt(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},tn={partial:!0,tokenize:function(e,i,r){return function(i){return e9(i)?tt(e,s,"linePrefix")(i):s(i)};function s(e){return null===e||e4(e)?i(e):r(e)}}};class to{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,i){let r=null==i?1/0:i;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,i,r){this.setCursor(Math.trunc(e));let s=this.right.splice(this.right.length-(i||0),1/0);return r&&tl(this.left,r),s.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),tl(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tl(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 i=this.left.splice(e,1/0);tl(this.right,i.reverse())}else{let i=this.right.splice(this.left.length+this.right.length-e,1/0);tl(this.left,i.reverse())}}}function tl(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function ta(e){let i,r,s,n,o,l,a,h={},c=-1,d=new to(e);for(;++c<d.length;){for(;c in h;)c=h[c];if(i=d.get(c),c&&"chunkFlow"===i[1].type&&"listItemPrefix"===d.get(c-1)[1].type&&((s=0)<(l=i[1]._tokenizer.events).length&&"lineEndingBlank"===l[s][1].type&&(s+=2),s<l.length&&"content"===l[s][1].type))for(;++s<l.length&&"content"!==l[s][1].type;)"chunkText"===l[s][1].type&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if("enter"===i[0])i[1].contentType&&(Object.assign(h,function(e,i){let r,s,n=e.get(i)[1],o=e.get(i)[2],l=i-1,a=[],h=n._tokenizer;!h&&(h=o.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(h._contentTypeTextTrailing=!0));let c=h.events,d=[],u={},f=-1,p=n,_=0,m=0,g=[0];for(;p;){for(;e.get(++l)[1]!==p;);a.push(l),!p._tokenizer&&(r=o.sliceStream(p),p.next||r.push(null),s&&h.defineSkip(p.start),p._isInFirstContentOfListItem&&(h._gfmTasklistFirstContentOfListItem=!0),h.write(r),p._isInFirstContentOfListItem&&(h._gfmTasklistFirstContentOfListItem=void 0)),s=p,p=p.next}for(p=n;++f<c.length;)"exit"===c[f][0]&&"enter"===c[f-1][0]&&c[f][1].type===c[f-1][1].type&&c[f][1].start.line!==c[f][1].end.line&&(m=f+1,g.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(h.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let i=c.slice(g[f],g[f+1]),r=a.pop();d.push([r,r+i.length-1]),e.splice(r,2,i)}for(d.reverse(),f=-1;++f<d.length;)u[_+d[f][0]]=_+d[f][1],_+=d[f][1]-d[f][0]-1;return u}(d,c)),c=h[c],a=!0);else if(i[1]._container){for(s=c,r=void 0;s--;)if("lineEnding"===(n=d.get(s))[1].type||"lineEndingBlank"===n[1].type)"enter"===n[0]&&(r&&(d.get(r)[1].type="lineEndingBlank"),n[1].type="lineEnding",r=s);else if("linePrefix"===n[1].type||"listItemIndent"===n[1].type);else break;r&&(i[1].end={...d.get(r)[1].start},(o=d.slice(r,c)).unshift(i),d.splice(r,c-r+1,o))}}return eX(e,0,1/0,d.slice(0)),!a}let th={resolve:function(e){return ta(e),e},tokenize:function(e,i){let r;return function(i){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),s(i)};function s(i){return null===i?n(i):e4(i)?e.check(tc,o,n)(i):(e.consume(i),s)}function n(r){return e.exit("chunkContent"),e.exit("content"),i(r)}function o(i){return e.consume(i),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,s}}},tc={partial:!0,tokenize:function(e,i,r){let s=this;return function(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),tt(e,n,"linePrefix")};function n(n){if(null===n||e4(n))return r(n);let o=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(n):e.interrupt(s.parser.constructs.flow,r,i)(n)}}},td={tokenize:function(e){let i=this,r=e.attempt(tn,function(s){return null===s?void e.consume(s):(e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,s,tt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(th,s)),"linePrefix")));return r;function s(s){return null===s?void e.consume(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i.currentConstruct=void 0,r)}}},tu={resolveAll:tm()},tf=t_("string"),tp=t_("text");function t_(e){return{resolveAll:tm("text"===e?tg:void 0),tokenize:function(i){let r=this,s=this.parser.constructs[e],n=i.attempt(s,o,l);return o;function o(e){return h(e)?n(e):l(e)}function l(e){return null===e?void i.consume(e):(i.enter("data"),i.consume(e),a)}function a(e){return h(e)?(i.exit("data"),n(e)):(i.consume(e),a)}function h(e){if(null===e)return!0;let i=s[e],n=-1;if(i)for(;++n<i.length;){let e=i[n];if(!e.previous||e.previous.call(r,r.previous))return!0}return!1}}}}function tm(e){return function(i,r){let s,n=-1;for(;++n<=i.length;)void 0===s?i[n]&&"data"===i[n][1].type&&(s=n,n++):i[n]&&"data"===i[n][1].type||(n!==s+2&&(i[s][1].end=i[n-1][1].end,i.splice(s+2,n-s-2),n=s+2),s=void 0);return e?e(i,r):i}}function tg(e,i){let r=0;for(;++r<=e.length;)if((r===e.length||"lineEnding"===e[r][1].type)&&"data"===e[r-1][1].type){let s,n=e[r-1][1],o=i.sliceStream(n),l=o.length,a=-1,h=0;for(;l--;){let e=o[l];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)h++,a--;if(a)break;a=-1}else if(-2===e)s=!0,h++;else if(-1===e);else{l++;break}}if(i._contentTypeTextTrailing&&r===e.length&&(h=0),h){let o={type:r===e.length||s||h<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:n.start._bufferIndex+a,_index:n.start._index+l,line:n.end.line,column:n.end.column-h,offset:n.end.offset-h},end:{...n.end}};n.end={...o.start},n.start.offset===n.end.offset?Object.assign(n,o):(e.splice(r,0,["enter",o,i],["exit",o,i]),r+=2)}r++}return e}function tv(e){return null===e||e6(e)||e7(e)?1:e8(e)?2:void 0}function tx(e,i,r){let s=[],n=-1;for(;++n<e.length;){let o=e[n].resolveAll;o&&!s.includes(o)&&(i=o(i,r),s.push(o))}return i}let tb={name:"attention",resolveAll:function(e,i){let r,s,n,o,l,a,h,c,d=-1;for(;++d<e.length;)if("enter"===e[d][0]&&"attentionSequence"===e[d][1].type&&e[d][1]._close){for(r=d;r--;)if("exit"===e[r][0]&&"attentionSequence"===e[r][1].type&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[d][1]).charCodeAt(0)){if((e[r][1]._close||e[d][1]._open)&&(e[d][1].end.offset-e[d][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[d][1].end.offset-e[d][1].start.offset)%3))continue;a=e[r][1].end.offset-e[r][1].start.offset>1&&e[d][1].end.offset-e[d][1].start.offset>1?2:1;let u={...e[r][1].end},f={...e[d][1].start};ty(u,-a),ty(f,a),o={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...e[r][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[d][1].start},end:f},n={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[d][1].start}},s={type:a>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[d][1].start={...l.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=eG(h,[["enter",e[r][1],i],["exit",e[r][1],i]])),h=eG(h,[["enter",s,i],["enter",o,i],["exit",o,i],["enter",n,i]]),h=eG(h,tx(i.parser.constructs.insideSpan.null,e.slice(r+1,d),i)),h=eG(h,[["exit",n,i],["enter",l,i],["exit",l,i],["exit",s,i]]),e[d][1].end.offset-e[d][1].start.offset?(c=2,h=eG(h,[["enter",e[d][1],i],["exit",e[d][1],i]])):c=0,eX(e,r-1,d-r+3,h),d=r+h.length-c-2;break}}for(d=-1;++d<e.length;)"attentionSequence"===e[d][1].type&&(e[d][1].type="data");return e},tokenize:function(e,i){let r,s=this.parser.constructs.attentionMarkers.null,n=this.previous,o=tv(n);return function(l){return r=l,e.enter("attentionSequence"),function l(a){if(a===r)return e.consume(a),l;let h=e.exit("attentionSequence"),c=tv(a),d=!c||2===c&&o||s.includes(a),u=!o||2===o&&c||s.includes(n);return h._open=!!(42===r?d:d&&(o||!u)),h._close=!!(42===r?u:u&&(c||!d)),i(a)}(l)}}};function ty(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}let tS={continuation:{tokenize:function(e,i,r){let s=this;return function(i){return e9(i)?tt(e,n,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):n(i)};function n(s){return e.attempt(tS,i,r)(s)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,i,r){let s=this;return function(i){if(62===i){let r=s.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),n}return r(i)};function n(r){return e9(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(r))}}},tw={name:"characterEscape",tokenize:function(e,i,r){return function(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s};function s(s){return e3(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(s)}}},tC=document.createElement("i");function tk(e){let i="&"+e+";";tC.innerHTML=i;let r=tC.textContent;return(59!==r.charCodeAt(r.length-1)||"semi"===e)&&r!==i&&r}let tE={name:"characterReference",tokenize:function(e,i,r){let s,n,o=this,l=0;return function(i){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(i),e.exit("characterReferenceMarker"),a};function a(i){return 35===i?(e.enter("characterReferenceMarkerNumeric"),e.consume(i),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),s=31,n=eQ,c(i))}function h(i){return 88===i||120===i?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(i),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,n=e5,c):(e.enter("characterReferenceValue"),s=7,n=e2,c(i))}function c(a){if(59===a&&l){let s=e.exit("characterReferenceValue");return n!==eQ||tk(o.sliceSerialize(s))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),i):r(a)}return n(a)&&l++<s?(e.consume(a),c):r(a)}}},tR={partial:!0,tokenize:function(e,i,r){let s=this;return function(i){return null===i?r(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n)};function n(e){return s.parser.lazy[s.now().line]?r(e):i(e)}}},tN={concrete:!0,name:"codeFenced",tokenize:function(e,i,r){let s,n=this,o={partial:!0,tokenize:function(e,i,r){let o=0;return function(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),l};function l(i){return e.enter("codeFencedFence"),e9(i)?tt(e,h,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):h(i)}function h(i){return i===s?(e.enter("codeFencedFenceSequence"),function i(n){return n===s?(o++,e.consume(n),i):o>=a?(e.exit("codeFencedFenceSequence"),e9(n)?tt(e,c,"whitespace")(n):c(n)):r(n)}(i)):r(i)}function c(s){return null===s||e4(s)?(e.exit("codeFencedFence"),i(s)):r(s)}}},l=0,a=0;return function(i){var o;let c;return o=i,l=(c=n.events[n.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,s=o,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function i(n){return n===s?(a++,e.consume(n),i):a<3?r(n):(e.exit("codeFencedFenceSequence"),e9(n)?tt(e,h,"whitespace")(n):h(n))}(o)};function h(o){return null===o||e4(o)?(e.exit("codeFencedFence"),n.interrupt?i(o):e.check(tR,d,_)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function i(n){return null===n||e4(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(n)):e9(n)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,c,"whitespace")(n)):96===n&&n===s?r(n):(e.consume(n),i)}(o))}function c(i){return null===i||e4(i)?h(i):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function i(n){return null===n||e4(n)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(n)):96===n&&n===s?r(n):(e.consume(n),i)}(i))}function d(i){return e.attempt(o,_,u)(i)}function u(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),f}function f(i){return l>0&&e9(i)?tt(e,p,"linePrefix",l+1)(i):p(i)}function p(i){return null===i||e4(i)?e.check(tR,d,_)(i):(e.enter("codeFlowValue"),function i(r){return null===r||e4(r)?(e.exit("codeFlowValue"),p(r)):(e.consume(r),i)}(i))}function _(r){return e.exit("codeFenced"),i(r)}}},tD={name:"codeIndented",tokenize:function(e,i,r){let s=this;return function(i){return e.enter("codeIndented"),tt(e,n,"linePrefix",5)(i)};function n(i){let n=s.events[s.events.length-1];return n&&"linePrefix"===n[1].type&&n[2].sliceSerialize(n[1],!0).length>=4?function i(r){return null===r?o(r):e4(r)?e.attempt(tM,i,o)(r):(e.enter("codeFlowValue"),function r(s){return null===s||e4(s)?(e.exit("codeFlowValue"),i(s)):(e.consume(s),r)}(r))}(i):r(i)}function o(r){return e.exit("codeIndented"),i(r)}}},tM={partial:!0,tokenize:function(e,i,r){let s=this;return n;function n(i){return s.parser.lazy[s.now().line]?r(i):e4(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n):tt(e,o,"linePrefix",5)(i)}function o(e){let o=s.events[s.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?i(e):e4(e)?n(e):r(e)}}};function tP(e,i,r,s,n,o,l,a,h){let c=h||1/0,d=0;return function(i){return 60===i?(e.enter(s),e.enter(n),e.enter(o),e.consume(i),e.exit(o),u):null===i||32===i||41===i||e1(i)?r(i):(e.enter(s),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),_(i))};function u(r){return 62===r?(e.enter(o),e.consume(r),e.exit(o),e.exit(n),e.exit(s),i):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(r))}function f(i){return 62===i?(e.exit("chunkString"),e.exit(a),u(i)):null===i||60===i||e4(i)?r(i):(e.consume(i),92===i?p:f)}function p(i){return 60===i||62===i||92===i?(e.consume(i),f):f(i)}function _(n){return!d&&(null===n||41===n||e6(n))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(s),i(n)):d<c&&40===n?(e.consume(n),d++,_):41===n?(e.consume(n),d--,_):null===n||32===n||40===n||e1(n)?r(n):(e.consume(n),92===n?m:_)}function m(i){return 40===i||41===i||92===i?(e.consume(i),_):_(i)}}function tT(e,i,r,s,n,o){let l,a=this,h=0;return function(i){return e.enter(s),e.enter(n),e.consume(i),e.exit(n),e.enter(o),c};function c(u){return h>999||null===u||91===u||93===u&&!l||94===u&&!h&&"_hiddenFootnoteSupport"in a.parser.constructs?r(u):93===u?(e.exit(o),e.enter(n),e.consume(u),e.exit(n),e.exit(s),i):e4(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(u))}function d(i){return null===i||91===i||93===i||e4(i)||h++>999?(e.exit("chunkString"),c(i)):(e.consume(i),l||(l=!e9(i)),92===i?u:d)}function u(i){return 91===i||92===i||93===i?(e.consume(i),h++,d):d(i)}}function tL(e,i,r,s,n,o){let l;return function(i){return 34===i||39===i||40===i?(e.enter(s),e.enter(n),e.consume(i),e.exit(n),l=40===i?41:i,a):r(i)};function a(r){return r===l?(e.enter(n),e.consume(r),e.exit(n),e.exit(s),i):(e.enter(o),h(r))}function h(i){return i===l?(e.exit(o),a(l)):null===i?r(i):e4(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),tt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(i))}function c(i){return i===l||null===i||e4(i)?(e.exit("chunkString"),h(i)):(e.consume(i),92===i?d:c)}function d(i){return i===l||92===i?(e.consume(i),c):c(i)}}function tB(e,i){let r;return function s(n){return e4(n)?(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),r=!0,s):e9(n)?tt(e,s,r?"linePrefix":"lineSuffix")(n):i(n)}}function tA(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let tI={partial:!0,tokenize:function(e,i,r){return function(i){return e6(i)?tB(e,s)(i):r(i)};function s(i){return tL(e,n,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(i)}function n(i){return e9(i)?tt(e,o,"whitespace")(i):o(i)}function o(e){return null===e||e4(e)?i(e):r(e)}}},tO=["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"],tj=["pre","script","style","textarea"],tz={partial:!0,tokenize:function(e,i,r){return function(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(tn,i,r)}}},tH={partial:!0,tokenize:function(e,i,r){let s=this;return function(i){return e4(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n):r(i)};function n(e){return s.parser.lazy[s.now().line]?r(e):i(e)}}},tF={name:"labelEnd",resolveAll:function(e){let i=-1,r=[];for(;++i<e.length;){let s=e[i][1];if(r.push(e[i]),"labelImage"===s.type||"labelLink"===s.type||"labelEnd"===s.type){let e="labelImage"===s.type?4:2;s.type="data",i+=e}}return e.length!==r.length&&eX(e,0,e.length,r),e},resolveTo:function(e,i){let r,s,n,o,l=e.length,a=0;for(;l--;)if(r=e[l][1],s){if("link"===r.type||"labelLink"===r.type&&r._inactive)break;"enter"===e[l][0]&&"labelLink"===r.type&&(r._inactive=!0)}else if(n){if("enter"===e[l][0]&&("labelImage"===r.type||"labelLink"===r.type)&&!r._balanced&&(s=l,"labelLink"!==r.type)){a=2;break}}else"labelEnd"===r.type&&(n=l);let h={type:"labelLink"===e[s][1].type?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[n][1].end}},d={type:"labelText",start:{...e[s+a+2][1].end},end:{...e[n-2][1].start}};return o=eG(o=[["enter",h,i],["enter",c,i]],e.slice(s+1,s+a+3)),o=eG(o,[["enter",d,i]]),o=eG(o,tx(i.parser.constructs.insideSpan.null,e.slice(s+a+4,n-3),i)),o=eG(o,[["exit",d,i],e[n-2],e[n-1],["exit",c,i]]),o=eG(o,e.slice(n+1)),o=eG(o,[["exit",h,i]]),eX(e,s,e.length,o),e},tokenize:function(e,i,r){let s,n,o=this,l=o.events.length;for(;l--;)if(("labelImage"===o.events[l][1].type||"labelLink"===o.events[l][1].type)&&!o.events[l][1]._balanced){s=o.events[l][1];break}return function(i){return s?s._inactive?d(i):(n=o.parser.defined.includes(tA(o.sliceSerialize({start:s.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelEnd"),a):r(i)};function a(i){return 40===i?e.attempt(tW,c,n?c:d)(i):91===i?e.attempt(t$,c,n?h:d)(i):n?c(i):d(i)}function h(i){return e.attempt(tU,c,d)(i)}function c(e){return i(e)}function d(e){return s._balanced=!0,r(e)}}},tW={tokenize:function(e,i,r){return function(i){return e.enter("resource"),e.enter("resourceMarker"),e.consume(i),e.exit("resourceMarker"),s};function s(i){return e6(i)?tB(e,n)(i):n(i)}function n(i){return 41===i?c(i):tP(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(i)}function o(i){return e6(i)?tB(e,a)(i):c(i)}function l(e){return r(e)}function a(i){return 34===i||39===i||40===i?tL(e,h,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(i):c(i)}function h(i){return e6(i)?tB(e,c)(i):c(i)}function c(s){return 41===s?(e.enter("resourceMarker"),e.consume(s),e.exit("resourceMarker"),e.exit("resource"),i):r(s)}}},t$={tokenize:function(e,i,r){let s=this;return function(i){return tT.call(s,e,n,o,"reference","referenceMarker","referenceString")(i)};function n(e){return s.parser.defined.includes(tA(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?i(e):r(e)}function o(e){return r(e)}}},tU={tokenize:function(e,i,r){return function(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s};function s(s){return 93===s?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),i):r(s)}}},tK={name:"labelStartImage",resolveAll:tF.resolveAll,tokenize:function(e,i,r){let s=this;return function(i){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(i),e.exit("labelImageMarker"),n};function n(i){return 91===i?(e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelImage"),o):r(i)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in s.parser.constructs?r(e):i(e)}}},tq={name:"labelStartLink",resolveAll:tF.resolveAll,tokenize:function(e,i,r){let s=this;return function(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),n};function n(e){return 94===e&&"_hiddenFootnoteSupport"in s.parser.constructs?r(e):i(e)}}},tV={name:"lineEnding",tokenize:function(e,i){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),tt(e,i,"linePrefix")}}},tY={name:"thematicBreak",tokenize:function(e,i,r){let s,n=0;return function(o){var l;return e.enter("thematicBreak"),s=l=o,function o(l){return l===s?(e.enter("thematicBreakSequence"),function i(r){return r===s?(e.consume(r),n++,i):(e.exit("thematicBreakSequence"),e9(r)?tt(e,o,"whitespace")(r):o(r))}(l)):n>=3&&(null===l||e4(l))?(e.exit("thematicBreak"),i(l)):r(l)}(l)}}},tX={continuation:{tokenize:function(e,i,r){let s=this;return s.containerState._closeFlow=void 0,e.check(tn,function(r){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,tt(e,i,"listItemIndent",s.containerState.size+1)(r)},function(r){return s.containerState.furtherBlankLines||!e9(r)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,n(r)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(tJ,i,n)(r))});function n(n){return s.containerState._closeFlow=!0,s.interrupt=void 0,tt(e,e.attempt(tX,i,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(n)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,i,r){let s=this,n=s.events[s.events.length-1],o=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,l=0;return function(i){let n=s.containerState.type||(42===i||43===i||45===i?"listUnordered":"listOrdered");if("listUnordered"===n?!s.containerState.marker||i===s.containerState.marker:e2(i)){if(s.containerState.type||(s.containerState.type=n,e.enter(n,{_container:!0})),"listUnordered"===n)return e.enter("listItemPrefix"),42===i||45===i?e.check(tY,r,a)(i):a(i);if(!s.interrupt||49===i)return e.enter("listItemPrefix"),e.enter("listItemValue"),function i(n){return e2(n)&&++l<10?(e.consume(n),i):(!s.interrupt||l<2)&&(s.containerState.marker?n===s.containerState.marker:41===n||46===n)?(e.exit("listItemValue"),a(n)):r(n)}(i)}return r(i)};function a(i){return e.enter("listItemMarker"),e.consume(i),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||i,e.check(tn,s.interrupt?r:h,e.attempt(tG,d,c))}function h(e){return s.containerState.initialBlankLine=!0,o++,d(e)}function c(i){return e9(i)?(e.enter("listItemPrefixWhitespace"),e.consume(i),e.exit("listItemPrefixWhitespace"),d):r(i)}function d(r){return s.containerState.size=o+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(r)}}},tG={partial:!0,tokenize:function(e,i,r){let s=this;return tt(e,function(e){let n=s.events[s.events.length-1];return!e9(e)&&n&&"listItemPrefixWhitespace"===n[1].type?i(e):r(e)},"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},tJ={partial:!0,tokenize:function(e,i,r){let s=this;return tt(e,function(e){let n=s.events[s.events.length-1];return n&&"listItemIndent"===n[1].type&&n[2].sliceSerialize(n[1],!0).length===s.containerState.size?i(e):r(e)},"listItemIndent",s.containerState.size+1)}},tZ={name:"setextUnderline",resolveTo:function(e,i){let r,s,n,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){r=o;break}"paragraph"===e[o][1].type&&(s=o)}else"content"===e[o][1].type&&e.splice(o,1),n||"definition"!==e[o][1].type||(n=o);let l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",n?(e.splice(s,0,["enter",l,i]),e.splice(n+1,0,["exit",e[r][1],i]),e[r][1].end={...e[n][1].end}):e[r][1]=l,e.push(["exit",l,i]),e},tokenize:function(e,i,r){let s,n=this;return function(i){var l;let a,h=n.events.length;for(;h--;)if("lineEnding"!==n.events[h][1].type&&"linePrefix"!==n.events[h][1].type&&"content"!==n.events[h][1].type){a="paragraph"===n.events[h][1].type;break}return!n.parser.lazy[n.now().line]&&(n.interrupt||a)?(e.enter("setextHeadingLine"),s=i,l=i,e.enter("setextHeadingLineSequence"),function i(r){return r===s?(e.consume(r),i):(e.exit("setextHeadingLineSequence"),e9(r)?tt(e,o,"lineSuffix")(r):o(r))}(l)):r(i)};function o(s){return null===s||e4(s)?(e.exit("setextHeadingLine"),i(s)):r(s)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,i,r){let s,n=this;return function(i){var s;return e.enter("definition"),s=i,tT.call(n,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(s)};function o(i){return(s=tA(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),58===i)?(e.enter("definitionMarker"),e.consume(i),e.exit("definitionMarker"),l):r(i)}function l(i){return e6(i)?tB(e,a)(i):a(i)}function a(i){return tP(e,h,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(i)}function h(i){return e.attempt(tI,c,c)(i)}function c(i){return e9(i)?tt(e,d,"whitespace")(i):d(i)}function d(o){return null===o||e4(o)?(e.exit("definition"),n.parser.defined.push(s),i(o)):r(o)}}}},"disable",0,{null:[]},"document",0,{42:tX,43:tX,45:tX,48:tX,49:tX,50:tX,51:tX,52:tX,53:tX,54:tX,55:tX,56:tX,57:tX,62:tS},"flow",0,{35:{name:"headingAtx",resolve:function(e,i){let r,s,n=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),n-2>o&&"whitespace"===e[n][1].type&&(n-=2),"atxHeadingSequence"===e[n][1].type&&(o===n-1||n-4>o&&"whitespace"===e[n-2][1].type)&&(n-=o+1===n?2:4),n>o&&(r={type:"atxHeadingText",start:e[o][1].start,end:e[n][1].end},s={type:"chunkText",start:e[o][1].start,end:e[n][1].end,contentType:"text"},eX(e,o,n-o+1,[["enter",r,i],["enter",s,i],["exit",s,i],["exit",r,i]])),e},tokenize:function(e,i,r){let s=0;return function(n){var o;return e.enter("atxHeading"),o=n,e.enter("atxHeadingSequence"),function n(o){return 35===o&&s++<6?(e.consume(o),n):null===o||e6(o)?(e.exit("atxHeadingSequence"),function r(s){return 35===s?(e.enter("atxHeadingSequence"),function i(s){return 35===s?(e.consume(s),i):(e.exit("atxHeadingSequence"),r(s))}(s)):null===s||e4(s)?(e.exit("atxHeading"),i(s)):e9(s)?tt(e,r,"whitespace")(s):(e.enter("atxHeadingText"),function i(s){return null===s||35===s||e6(s)?(e.exit("atxHeadingText"),r(s)):(e.consume(s),i)}(s))}(o)):r(o)}(o)}}},42:tY,45:[tZ,tY],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let i=e.length;for(;i--&&("enter"!==e[i][0]||"htmlFlow"!==e[i][1].type););return i>1&&"linePrefix"===e[i-2][1].type&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e},tokenize:function(e,i,r){let s,n,o,l,a,h=this;return function(i){var r;return r=i,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),c};function c(l){return 33===l?(e.consume(l),d):47===l?(e.consume(l),n=!0,p):63===l?(e.consume(l),s=3,h.interrupt?i:L):eZ(l)?(e.consume(l),o=String.fromCharCode(l),_):r(l)}function d(n){return 45===n?(e.consume(n),s=2,u):91===n?(e.consume(n),s=5,l=0,f):eZ(n)?(e.consume(n),s=4,h.interrupt?i:L):r(n)}function u(s){return 45===s?(e.consume(s),h.interrupt?i:L):r(s)}function f(s){let n="CDATA[";return s===n.charCodeAt(l++)?(e.consume(s),l===n.length)?h.interrupt?i:k:f:r(s)}function p(i){return eZ(i)?(e.consume(i),o=String.fromCharCode(i),_):r(i)}function _(l){if(null===l||47===l||62===l||e6(l)){let a=47===l,c=o.toLowerCase();return!a&&!n&&tj.includes(c)?(s=1,h.interrupt?i(l):k(l)):tO.includes(o.toLowerCase())?(s=6,a)?(e.consume(l),m):h.interrupt?i(l):k(l):(s=7,h.interrupt&&!h.parser.lazy[h.now().line]?r(l):n?function i(r){return e9(r)?(e.consume(r),i):w(r)}(l):g(l))}return 45===l||eQ(l)?(e.consume(l),o+=String.fromCharCode(l),_):r(l)}function m(s){return 62===s?(e.consume(s),h.interrupt?i:k):r(s)}function g(i){return 47===i?(e.consume(i),w):58===i||95===i||eZ(i)?(e.consume(i),v):e9(i)?(e.consume(i),g):w(i)}function v(i){return 45===i||46===i||58===i||95===i||eQ(i)?(e.consume(i),v):x(i)}function x(i){return 61===i?(e.consume(i),b):e9(i)?(e.consume(i),x):g(i)}function b(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),a=i,y):e9(i)?(e.consume(i),b):function i(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||e6(r)?x(r):(e.consume(r),i)}(i)}function y(i){return i===a?(e.consume(i),a=null,S):null===i||e4(i)?r(i):(e.consume(i),y)}function S(e){return 47===e||62===e||e9(e)?g(e):r(e)}function w(i){return 62===i?(e.consume(i),C):r(i)}function C(i){return null===i||e4(i)?k(i):e9(i)?(e.consume(i),C):r(i)}function k(i){return 45===i&&2===s?(e.consume(i),D):60===i&&1===s?(e.consume(i),M):62===i&&4===s?(e.consume(i),B):63===i&&3===s?(e.consume(i),L):93===i&&5===s?(e.consume(i),T):e4(i)&&(6===s||7===s)?(e.exit("htmlFlowData"),e.check(tz,A,E)(i)):null===i||e4(i)?(e.exit("htmlFlowData"),E(i)):(e.consume(i),k)}function E(i){return e.check(tH,R,A)(i)}function R(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),N}function N(i){return null===i||e4(i)?E(i):(e.enter("htmlFlowData"),k(i))}function D(i){return 45===i?(e.consume(i),L):k(i)}function M(i){return 47===i?(e.consume(i),o="",P):k(i)}function P(i){if(62===i){let r=o.toLowerCase();return tj.includes(r)?(e.consume(i),B):k(i)}return eZ(i)&&o.length<8?(e.consume(i),o+=String.fromCharCode(i),P):k(i)}function T(i){return 93===i?(e.consume(i),L):k(i)}function L(i){return 62===i?(e.consume(i),B):45===i&&2===s?(e.consume(i),L):k(i)}function B(i){return null===i||e4(i)?(e.exit("htmlFlowData"),A(i)):(e.consume(i),B)}function A(r){return e.exit("htmlFlow"),i(r)}}},61:tZ,95:tY,96:tN,126:tN},"flowInitial",0,{[-2]:tD,[-1]:tD,32:tD},"insideSpan",0,{null:[tb,tu]},"string",0,{38:tE,92:tw},"text",0,{[-5]:tV,[-4]:tV,[-3]:tV,33:tK,38:tE,42:tb,60:[{name:"autolink",tokenize:function(e,i,r){let s=0;return function(i){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),n};function n(i){return eZ(i)?(e.consume(i),o):64===i?r(i):a(i)}function o(i){return 43===i||45===i||46===i||eQ(i)?(s=1,function i(r){return 58===r?(e.consume(r),s=0,l):(43===r||45===r||46===r||eQ(r))&&s++<32?(e.consume(r),i):(s=0,a(r))}(i)):a(i)}function l(s){return 62===s?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(s),e.exit("autolinkMarker"),e.exit("autolink"),i):null===s||32===s||60===s||e1(s)?r(s):(e.consume(s),l)}function a(i){return 64===i?(e.consume(i),h):e0(i)?(e.consume(i),a):r(i)}function h(n){return eQ(n)?function n(o){return 46===o?(e.consume(o),s=0,h):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),i):function i(o){if((45===o||eQ(o))&&s++<63){let r=45===o?i:n;return e.consume(o),r}return r(o)}(o)}(n):r(n)}}},{name:"htmlText",tokenize:function(e,i,r){let s,n,o,l=this;return function(i){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(i),a};function a(i){return 33===i?(e.consume(i),h):47===i?(e.consume(i),y):63===i?(e.consume(i),x):eZ(i)?(e.consume(i),w):r(i)}function h(i){return 45===i?(e.consume(i),c):91===i?(e.consume(i),n=0,p):eZ(i)?(e.consume(i),v):r(i)}function c(i){return 45===i?(e.consume(i),f):r(i)}function d(i){return null===i?r(i):45===i?(e.consume(i),u):e4(i)?(o=d,P(i)):(e.consume(i),d)}function u(i){return 45===i?(e.consume(i),f):d(i)}function f(e){return 62===e?M(e):45===e?u(e):d(e)}function p(i){let s="CDATA[";return i===s.charCodeAt(n++)?(e.consume(i),n===s.length?_:p):r(i)}function _(i){return null===i?r(i):93===i?(e.consume(i),m):e4(i)?(o=_,P(i)):(e.consume(i),_)}function m(i){return 93===i?(e.consume(i),g):_(i)}function g(i){return 62===i?M(i):93===i?(e.consume(i),g):_(i)}function v(i){return null===i||62===i?M(i):e4(i)?(o=v,P(i)):(e.consume(i),v)}function x(i){return null===i?r(i):63===i?(e.consume(i),b):e4(i)?(o=x,P(i)):(e.consume(i),x)}function b(e){return 62===e?M(e):x(e)}function y(i){return eZ(i)?(e.consume(i),S):r(i)}function S(i){return 45===i||eQ(i)?(e.consume(i),S):function i(r){return e4(r)?(o=i,P(r)):e9(r)?(e.consume(r),i):M(r)}(i)}function w(i){return 45===i||eQ(i)?(e.consume(i),w):47===i||62===i||e6(i)?C(i):r(i)}function C(i){return 47===i?(e.consume(i),M):58===i||95===i||eZ(i)?(e.consume(i),k):e4(i)?(o=C,P(i)):e9(i)?(e.consume(i),C):M(i)}function k(i){return 45===i||46===i||58===i||95===i||eQ(i)?(e.consume(i),k):function i(r){return 61===r?(e.consume(r),E):e4(r)?(o=i,P(r)):e9(r)?(e.consume(r),i):C(r)}(i)}function E(i){return null===i||60===i||61===i||62===i||96===i?r(i):34===i||39===i?(e.consume(i),s=i,R):e4(i)?(o=E,P(i)):e9(i)?(e.consume(i),E):(e.consume(i),N)}function R(i){return i===s?(e.consume(i),s=void 0,D):null===i?r(i):e4(i)?(o=R,P(i)):(e.consume(i),R)}function N(i){return null===i||34===i||39===i||60===i||61===i||96===i?r(i):47===i||62===i||e6(i)?C(i):(e.consume(i),N)}function D(e){return 47===e||62===e||e6(e)?C(e):r(e)}function M(s){return 62===s?(e.consume(s),e.exit("htmlTextData"),e.exit("htmlText"),i):r(s)}function P(i){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),T}function T(i){return e9(i)?tt(e,L,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):L(i)}function L(i){return e.enter("htmlTextData"),o(i)}}}],91:tq,92:[{name:"hardBreakEscape",tokenize:function(e,i,r){return function(i){return e.enter("hardBreakEscape"),e.consume(i),s};function s(s){return e4(s)?(e.exit("hardBreakEscape"),i(s)):r(s)}}},tw],93:tF,95:tb,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let i,r,s=e.length-4,n=3;if(("lineEnding"===e[3][1].type||"space"===e[n][1].type)&&("lineEnding"===e[s][1].type||"space"===e[s][1].type)){for(i=n;++i<s;)if("codeTextData"===e[i][1].type){e[n][1].type="codeTextPadding",e[s][1].type="codeTextPadding",n+=2,s-=2;break}}for(i=n-1,s++;++i<=s;)void 0===r?i!==s&&"lineEnding"!==e[i][1].type&&(r=i):(i===s||"lineEnding"===e[i][1].type)&&(e[r][1].type="codeTextData",i!==r+2&&(e[r][1].end=e[i-1][1].end,e.splice(r+2,i-r-2),s-=i-r-2,i=r+2),r=void 0);return e},tokenize:function(e,i,r){let s,n,o=0;return function(i){return e.enter("codeText"),e.enter("codeTextSequence"),function i(r){return 96===r?(e.consume(r),o++,i):(e.exit("codeTextSequence"),l(r))}(i)};function l(h){return null===h?r(h):32===h?(e.enter("space"),e.consume(h),e.exit("space"),l):96===h?(n=e.enter("codeTextSequence"),s=0,function r(l){return 96===l?(e.consume(l),s++,r):s===o?(e.exit("codeTextSequence"),e.exit("codeText"),i(l)):(n.type="codeTextData",a(l))}(h)):e4(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),a(h))}function a(i){return null===i||32===i||96===i||e4(i)?(e.exit("codeTextData"),l(i)):(e.consume(i),a)}}}}],4127);var tQ=e.i(4127);let t0=/[\0\t\n\r]/g;function t1(e,i){let r=Number.parseInt(e,i);return r<9||11===r||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}let t2=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function t5(e,i,r){if(i)return i;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),i=120===e||88===e;return t1(r.slice(i?2:1),i?16:10)}return tk(r)||e}let t3={}.hasOwnProperty;function t4(e){return{line:e.line,column:e.column,offset:e.offset}}function t6(e,i){if(e)throw Error("Cannot close `"+e.type+"` ("+eR({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+eR({start:i.start,end:i.end})+") is open");throw Error("Cannot close document, a token (`"+i.type+"`, "+eR({start:i.start,end:i.end})+") is still open")}function t9(e){let i=this;i.parser=function(r){var s,n;let o,l,a,h;return"object"==typeof(s={...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})&&(n=s,s=void 0),(function(e){let i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(v),autolinkProtocol:c,autolinkEmail:c,atxHeading:s(_),blockQuote:s(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:s(p),codeFencedFenceInfo:n,codeFencedFenceMeta:n,codeIndented:s(p,n),codeText:s(function(){return{type:"inlineCode",value:""}},n),codeTextData:c,data:c,codeFlowValue:c,definition:s(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:n,definitionLabelString:n,definitionTitleString:n,emphasis:s(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:s(m),hardBreakTrailing:s(m),htmlFlow:s(g,n),htmlFlowData:c,htmlText:s(g,n),htmlTextData:c,image:s(function(){return{type:"image",title:null,url:"",alt:null}}),label:n,link:s(v),listItem:s(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:s(x,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:s(x),paragraph:s(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:n,resourceDestinationString:n,resourceTitleString:n,setextHeading:s(_),strong:s(function(){return{type:"strong",children:[]}}),thematicBreak:s(function(){return{type:"thematicBreak"}})},exit:{atxHeading:l(),atxHeadingSequence:function(e){let i=this.stack[this.stack.length-1];i.depth||(i.depth=this.sliceSerialize(e).length)},autolink:l(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:l(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let i,r=this.sliceSerialize(e),s=this.data.characterReferenceType;s?(i=t1(r,"characterReferenceMarkerNumeric"===s?10:16),this.data.characterReferenceType=void 0):i=tk(r);let n=this.stack[this.stack.length-1];n.value+=i},characterReference:function(e){this.stack.pop().position.end=t4(e.end)},codeFenced:l(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:d,codeIndented:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:l(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=tA(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:l(),hardBreakEscape:l(u),hardBreakTrailing:l(u),htmlFlow:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,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],i=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=i},labelText:function(e){let i=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=i.replace(t2,t5),r.identifier=tA(i).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=t4(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(r.type)&&(c.call(this,e),d.call(this,e))},link:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let i=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=i,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:function(e){let i=this.resume(),r=this.stack[this.stack.length-1];r.label=i,r.identifier=tA(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:l(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:l(),thematicBreak:l()}};!function e(i,r){let s=-1;for(;++s<r.length;){let n=r[s];Array.isArray(n)?e(i,n):function(e,i){let r;for(r in i)if(t3.call(i,r))switch(r){case"canContainEols":{let s=i[r];s&&e[r].push(...s);break}case"transforms":{let s=i[r];s&&e[r].push(...s);break}case"enter":case"exit":{let s=i[r];s&&Object.assign(e[r],s)}}}(i,n)}}(i,(e||{}).mdastExtensions||[]);let r={};return function(e){let s={type:"root",children:[]},l={stack:[s],tokenStack:[],config:i,enter:o,exit:a,buffer:n,resume:h,data:r},c=[],d=-1;for(;++d<e.length;)("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)&&("enter"===e[d][0]?c.push(d):d=function(e,i,r){let s,n,o,l,a=i-1,h=-1,c=!1;for(;++a<=r;){let i=e[a];switch(i[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===i[0]?h++:h--,l=void 0;break;case"lineEndingBlank":"enter"===i[0]&&(!s||l||h||o||(o=a),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!h&&"enter"===i[0]&&"listItemPrefix"===i[1].type||-1===h&&"exit"===i[0]&&("listUnordered"===i[1].type||"listOrdered"===i[1].type)){if(s){let l=a;for(n=void 0;l--;){let i=e[l];if("lineEnding"===i[1].type||"lineEndingBlank"===i[1].type){if("exit"===i[0])continue;n&&(e[n][1].type="lineEndingBlank",c=!0),i[1].type="lineEnding",n=l}else if("linePrefix"===i[1].type||"blockQuotePrefix"===i[1].type||"blockQuotePrefixWhitespace"===i[1].type||"blockQuoteMarker"===i[1].type||"listItemIndent"===i[1].type);else break}o&&(!n||o<n)&&(s._spread=!0),s.end=Object.assign({},n?e[n][1].start:i[1].end),e.splice(n||a,0,["exit",s,i[2]]),a++,r++}if("listItemPrefix"===i[1].type){let n={type:"listItem",_spread:!1,start:Object.assign({},i[1].start),end:void 0};s=n,e.splice(a,0,["enter",n,i[2]]),a++,r++,o=void 0,l=!0}}}return e[i][1]._spread=c,r}(e,c.pop(),d));for(d=-1;++d<e.length;){let r=i[e[d][0]];t3.call(r,e[d][1].type)&&r[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},l),e[d][1])}if(l.tokenStack.length>0){let e=l.tokenStack[l.tokenStack.length-1];(e[1]||t6).call(l,void 0,e[0])}for(s.position={start:t4(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:t4(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<i.transforms.length;)s=i.transforms[d](s)||s;return s};function s(e,i){return function(r){o.call(this,e(r),r),i&&i.call(this,r)}}function n(){this.stack.push({type:"fragment",children:[]})}function o(e,i,r){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([i,r||void 0]),e.position={start:t4(i.start),end:void 0}}function l(e){return function(i){e&&e.call(this,i),a.call(this,i)}}function a(e,i){let r=this.stack.pop(),s=this.tokenStack.pop();if(s)s[0].type!==e.type&&(i?i.call(this,e,s[0]):(s[1]||t6).call(this,e,s[0]));else throw Error("Cannot close `"+e.type+"` ("+eR({start:e.start,end:e.end})+"): it’s not open");r.position.end=t4(e.end)}function h(){var e;return e=this.stack.pop(),eV(e,"boolean"!=typeof eq.includeImageAlt||eq.includeImageAlt,"boolean"!=typeof eq.includeHtml||eq.includeHtml)}function c(e){let i=this.stack[this.stack.length-1].children,r=i[i.length-1];r&&"text"===r.type||((r={type:"text",value:""}).position={start:t4(e.start),end:void 0},i.push(r)),this.stack.push(r)}function d(e){let i=this.stack.pop();i.value+=this.sliceSerialize(e),i.position.end=t4(e.end)}function u(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function _(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function g(){return{type:"html",value:""}}function v(){return{type:"link",title:null,url:"",children:[]}}function x(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(n)(function(e){for(;!ta(e););return e}((function(e){let i={constructs:function(e){let i={},r=-1;for(;++r<e.length;)!function(e,i){let r;for(r in i){let s,n=(eJ.call(e,r)?e[r]:void 0)||(e[r]={}),o=i[r];if(o)for(s in o){eJ.call(n,s)||(n[s]=[]);let e=o[s];!function(e,i){let r=-1,s=[];for(;++r<i.length;)("after"===i[r].add?e:s).push(i[r]);eX(e,0,0,s)}(n[s],Array.isArray(e)?e:e?[e]:[])}}}(i,e[r]);return i}([tQ,...(e||{}).extensions||[]]),content:r(ti),defined:[],document:r(tr),flow:r(td),lazy:{},string:r(tf),text:r(tp)};return i;function r(e){return function(r){return function(e,i,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},n={},o=[],l=[],a=[],h={attempt:_(function(e,i){m(e,i.from)}),check:_(p),consume:function(e){e4(e)?(s.line++,s.column=1,s.offset+=-3===e?2:1,g()):-1!==e&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===l[s._index].length&&(s._bufferIndex=-1,s._index++)),c.previous=e},enter:function(e,i){let r=i||{};return r.type=e,r.start=f(),c.events.push(["enter",r,c]),a.push(r),r},exit:function(e){let i=a.pop();return i.end=f(),c.events.push(["exit",i,c]),i},interrupt:_(p,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){n[e.line]=e.column,g()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,i){return function(e,i){let r,s=-1,n=[];for(;++s<e.length;){let o,l=e[s];if("string"==typeof l)o=l;else switch(l){case -5:o="\r";break;case -4:o="\n";break;case -3:o="\r\n";break;case -2:o=i?" ":" ";break;case -1:if(!i&&r)continue;o=" ";break;default:o=String.fromCharCode(l)}r=-2===l,n.push(o)}return n.join("")}(u(e),i)},sliceStream:u,write:function(e){return(l=eG(l,e),function(){let e;for(;s._index<l.length;){let r=l[s._index];if("string"==typeof r)for(e=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===e&&s._bufferIndex<r.length;){var i;i=r.charCodeAt(s._bufferIndex),d=d(i)}else d=d(r)}}(),null!==l[l.length-1])?[]:(m(i,0),c.events=tx(o,c.events,c),c.events)}},d=i.tokenize.call(c,h);return i.resolveAll&&o.push(i),c;function u(e){return function(e,i){let r,s=i.start._index,n=i.start._bufferIndex,o=i.end._index,l=i.end._bufferIndex;if(s===o)r=[e[s].slice(n,l)];else{if(r=e.slice(s,o),n>-1){let e=r[0];"string"==typeof e?r[0]=e.slice(n):r.shift()}l>0&&r.push(e[o].slice(0,l))}return r}(l,e)}function f(){let{_bufferIndex:e,_index:i,line:r,column:n,offset:o}=s;return{_bufferIndex:e,_index:i,line:r,column:n,offset:o}}function p(e,i){i.restore()}function _(e,i){return function(r,n,o){var l;let d,u,p,_;return Array.isArray(r)?m(r):"tokenize"in r?m([r]):(l=r,function(e){let i=null!==e&&l[e],r=null!==e&&l.null;return m([...Array.isArray(i)?i:i?[i]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function m(e){return(d=e,u=0,0===e.length)?o:v(e[u])}function v(e){return function(r){let n,o,l,d,u;return(n=f(),o=c.previous,l=c.currentConstruct,d=c.events.length,u=Array.from(a),_={from:d,restore:function(){s=n,c.previous=o,c.currentConstruct=l,c.events.length=d,a=u,g()}},p=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?b(r):e.tokenize.call(i?Object.assign(Object.create(c),i):c,h,x,b)(r)}}function x(i){return e(p,_),n}function b(e){return(_.restore(),++u<d.length)?v(d[u]):o}}}function m(e,i){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&eX(c.events,i,c.events.length-i,e.resolve(c.events.slice(i),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function g(){s.line in n&&s.column<2&&(s.column=n[s.line],s.offset+=n[s.line]-1)}}(i,e,r)}}})(n).document().write((l=1,a="",h=!0,function(e,i,r){let s,n,c,d,u,f=[];for(e=a+("string"==typeof e?e.toString():new TextDecoder(i||void 0).decode(e)),c=0,a="",h&&(65279===e.charCodeAt(0)&&c++,h=void 0);c<e.length;){if(t0.lastIndex=c,d=(s=t0.exec(e))&&void 0!==s.index?s.index:e.length,u=e.charCodeAt(d),!s){a=e.slice(c);break}if(10===u&&c===d&&o)f.push(-3),o=void 0;else switch(o&&(f.push(-5),o=void 0),c<d&&(f.push(e.slice(c,d)),l+=d-c),u){case 0:f.push(65533),l++;break;case 9:for(n=4*Math.ceil(l/4),f.push(-2);l++<n;)f.push(-1);break;case 10:f.push(-4),l=1;break;default:o=!0,l=1}c=d+1}return r&&(o&&f.push(-5),a&&f.push(a),f.push(null)),f})(r,s,!0))))}}let t8="object"==typeof self?self:globalThis,t7=e=>{var i;let r,s;return(i=new Map,r=(e,r)=>(i.set(r,e),e),s=n=>{if(i.has(n))return i.get(n);let[o,l]=e[n];switch(o){case 0:case -1:return r(l,n);case 1:{let e=r([],n);for(let i of l)e.push(s(i));return e}case 2:{let e=r({},n);for(let[i,r]of l)e[s(i)]=s(r);return e}case 3:return r(new Date(l),n);case 4:{let{source:e,flags:i}=l;return r(new RegExp(e,i),n)}case 5:{let e=r(new Map,n);for(let[i,r]of l)e.set(s(i),s(r));return e}case 6:{let e=r(new Set,n);for(let i of l)e.add(s(i));return e}case 7:{let{name:e,message:i}=l;return r(new t8[e](i),n)}case 8:return r(BigInt(l),n);case"BigInt":return r(Object(BigInt(l)),n);case"ArrayBuffer":return r(new Uint8Array(l).buffer,l);case"DataView":{let{buffer:e}=new Uint8Array(l);return r(new DataView(e),l)}}return r(new t8[o](l),n)})(0)},{toString:ie}={},{keys:it}=Object,ii=e=>{let i=typeof e;if("object"!==i||!e)return[0,i];let r=ie.call(e).slice(8,-1);switch(r){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,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},ir=([e,i])=>0===e&&("function"===i||"symbol"===i),is=(e,{json:i,lossy:r}={})=>{var s,n,o;let l,a,h=[];return(s=!(i||r),n=!!i,o=new Map,l=(e,i)=>{let r=h.push(e)-1;return o.set(i,r),r},a=e=>{if(o.has(e))return o.get(e);let[i,r]=ii(e);switch(i){case 0:{let n=e;switch(r){case"bigint":i=8,n=e.toString();break;case"function":case"symbol":if(s)throw TypeError("unable to serialize "+r);n=null;break;case"undefined":return l([-1],e)}return l([i,n],e)}case 1:{if(r){let i=e;return"DataView"===r?i=new Uint8Array(e.buffer):"ArrayBuffer"===r&&(i=new Uint8Array(e)),l([r,[...i]],e)}let s=[],n=l([i,s],e);for(let i of e)s.push(a(i));return n}case 2:{if(r)switch(r){case"BigInt":return l([r,e.toString()],e);case"Boolean":case"Number":case"String":return l([r,e.valueOf()],e)}if(n&&"toJSON"in e)return a(e.toJSON());let o=[],h=l([i,o],e);for(let i of it(e))(s||!ir(ii(e[i])))&&o.push([a(i),a(e[i])]);return h}case 3:return l([i,e.toISOString()],e);case 4:{let{source:r,flags:s}=e;return l([i,{source:r,flags:s}],e)}case 5:{let r=[],n=l([i,r],e);for(let[i,n]of e)(s||!(ir(ii(i))||ir(ii(n))))&&r.push([a(i),a(n)]);return n}case 6:{let r=[],n=l([i,r],e);for(let i of e)(s||!ir(ii(i)))&&r.push(a(i));return n}}let{message:h}=e;return l([i,{name:r,message:h}],e)})(e),h},io="function"==typeof structuredClone?(e,i)=>i&&("json"in i||"lossy"in i)?t7(is(e,i)):structuredClone(e):(e,i)=>t7(is(e,i));function il(e){let i=[],r=-1,s=0,n=0;for(;++r<e.length;){let o=e.charCodeAt(r),l="";if(37===o&&eQ(e.charCodeAt(r+1))&&eQ(e.charCodeAt(r+2)))n=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){let i=e.charCodeAt(r+1);o<56320&&i>56319&&i<57344?(l=String.fromCharCode(o,i),n=1):l="�"}else l=String.fromCharCode(o);l&&(i.push(e.slice(s,r),encodeURIComponent(l)),s=r+n+1,l=""),n&&(r+=n,n=0)}return i.join("")+e.slice(s)}function ia(e,i){let r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function ih(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}let ic=function(e){var i,r;if(null==e)return iu;if("function"==typeof e)return id(e);if("object"==typeof e){return Array.isArray(e)?function(e){let i=[],r=-1;for(;++r<e.length;)i[r]=ic(e[r]);return id(function(...e){let r=-1;for(;++r<i.length;)if(i[r].apply(this,e))return!0;return!1})}(e):(i=e,id(function(e){let r;for(r in i)if(e[r]!==i[r])return!1;return!0}))}if("string"==typeof e){return r=e,id(function(e){return e&&e.type===r})}throw Error("Expected function, string, or object as test")};function id(e){return function(i,r,s){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(i)&&e.call(this,i,"number"==typeof r?r:void 0,s||void 0))}}function iu(){return!0}let ip=[];function i_(e,i,r,s){var n,o,l;let a,h,c,d,u,f;"function"==typeof i&&"function"!=typeof r?(h=void 0,c=i,a=r):(h=i,c=r,a=s),n=h,o=function(e,i){let r=i[i.length-1],s=r?r.children.indexOf(e):void 0;return c(e,s,r)},l=a,"function"==typeof n&&"function"!=typeof o?(l=o,o=n):d=n,u=ic(d),f=l?-1:1,(function e(i,r,s){let a=i&&"object"==typeof i?i:{};if("string"==typeof a.type){let e="string"==typeof a.tagName?a.tagName:"string"==typeof a.name?a.name:void 0;Object.defineProperty(h,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return h;function h(){var a;let h,c,d,p=ip;if((!n||u(i,r,s[s.length-1]||void 0))&&!1===(p=Array.isArray(a=o(i,s))?a:"number"==typeof a?[!0,a]:null==a?ip:[a])[0])return p;if("children"in i&&i.children&&i.children&&"skip"!==p[0])for(c=(l?i.children.length:-1)+f,d=s.concat(i);c>-1&&c<i.children.length;){if(!1===(h=e(i.children[c],c,d)())[0])return h;c="number"==typeof h[1]?h[1]:c+f}return p}})(e,void 0,[])()}function im(e,i){let r=i.referenceType,s="]";if("collapsed"===r?s+="[]":"full"===r&&(s+="["+(i.label||i.identifier)+"]"),"imageReference"===i.type)return[{type:"text",value:"!["+i.alt+s}];let n=e.all(i),o=n[0];o&&"text"===o.type?o.value="["+o.value:n.unshift({type:"text",value:"["});let l=n[n.length-1];return l&&"text"===l.type?l.value+=s:n.push({type:"text",value:s}),n}function ig(e){let i=e.spread;return null==i?e.children.length>1:i}function iv(e,i,r){let s=0,n=e.length;if(i){let i=e.codePointAt(s);for(;9===i||32===i;)s++,i=e.codePointAt(s)}if(r){let i=e.codePointAt(n-1);for(;9===i||32===i;)n--,i=e.codePointAt(n-1)}return n>s?e.slice(s,n):""}let ix={blockquote:function(e,i){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)},break:function(e,i){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:"\n"}]},code:function(e,i){let r=i.value?i.value+"\n":"",s={},n=i.lang?i.lang.split(/\s+/):[];n.length>0&&(s.className=["language-"+n[0]]);let o={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return i.meta&&(o.data={meta:i.meta}),e.patch(i,o),o={type:"element",tagName:"pre",properties:{},children:[o=e.applyData(i,o)]},e.patch(i,o),o},delete:function(e,i){let r={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},emphasis:function(e,i){let r={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},footnoteReference:function(e,i){let r,s="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=String(i.identifier).toUpperCase(),o=il(n.toLowerCase()),l=e.footnoteOrder.indexOf(n),a=e.footnoteCounts.get(n);void 0===a?(a=0,e.footnoteOrder.push(n),r=e.footnoteOrder.length):r=l+1,a+=1,e.footnoteCounts.set(n,a);let h={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+o,id:s+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(i,h);let c={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(i,c),e.applyData(i,c)},heading:function(e,i){let r={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},html:function(e,i){if(e.options.allowDangerousHtml){let r={type:"raw",value:i.value};return e.patch(i,r),e.applyData(i,r)}},imageReference:function(e,i){let r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return im(e,i);let n={src:il(s.url||""),alt:i.alt};null!==s.title&&void 0!==s.title&&(n.title=s.title);let o={type:"element",tagName:"img",properties:n,children:[]};return e.patch(i,o),e.applyData(i,o)},image:function(e,i){let r={src:il(i.url)};null!==i.alt&&void 0!==i.alt&&(r.alt=i.alt),null!==i.title&&void 0!==i.title&&(r.title=i.title);let s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(i,s),e.applyData(i,s)},inlineCode:function(e,i){let r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,r);let s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(i,s),e.applyData(i,s)},linkReference:function(e,i){let r=String(i.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return im(e,i);let n={href:il(s.url||"")};null!==s.title&&void 0!==s.title&&(n.title=s.title);let o={type:"element",tagName:"a",properties:n,children:e.all(i)};return e.patch(i,o),e.applyData(i,o)},link:function(e,i){let r={href:il(i.url)};null!==i.title&&void 0!==i.title&&(r.title=i.title);let s={type:"element",tagName:"a",properties:r,children:e.all(i)};return e.patch(i,s),e.applyData(i,s)},listItem:function(e,i,r){let s=e.all(i),n=r?function(e){let i=!1;if("list"===e.type){i=e.spread||!1;let r=e.children,s=-1;for(;!i&&++s<r.length;)i=ig(r[s])}return i}(r):ig(i),o={},l=[];if("boolean"==typeof i.checked){let e,r=s[0];r&&"element"===r.type&&"p"===r.tagName?e=r:(e={type:"element",tagName:"p",properties:{},children:[]},s.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<s.length;){let e=s[a];(n||0!==a||"element"!==e.type||"p"!==e.tagName)&&l.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||n?l.push(e):l.push(...e.children)}let h=s[s.length-1];h&&(n||"element"!==h.type||"p"!==h.tagName)&&l.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:o,children:l};return e.patch(i,c),e.applyData(i,c)},list:function(e,i){let r={},s=e.all(i),n=-1;for("number"==typeof i.start&&1!==i.start&&(r.start=i.start);++n<s.length;){let e=s[n];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}let o={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:e.wrap(s,!0)};return e.patch(i,o),e.applyData(i,o)},paragraph:function(e,i){let r={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},root:function(e,i){let r={type:"root",children:e.wrap(e.all(i))};return e.patch(i,r),e.applyData(i,r)},strong:function(e,i){let r={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},table:function(e,i){let r=e.all(i),s=r.shift(),n=[];if(s){let r={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(i.children[0],r),n.push(r)}if(r.length>0){let s={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=ek(i.children[1]),l=eC(i.children[i.children.length-1]);o&&l&&(s.position={start:o,end:l}),n.push(s)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(n,!0)};return e.patch(i,o),e.applyData(i,o)},tableCell:function(e,i){let r={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)},tableRow:function(e,i,r){let s=r?r.children:void 0,n=0===(s?s.indexOf(i):1)?"th":"td",o=r&&"table"===r.type?r.align:void 0,l=o?o.length:i.children.length,a=-1,h=[];for(;++a<l;){let r=i.children[a],s={},l=o?o[a]:void 0;l&&(s.align=l);let c={type:"element",tagName:n,properties:s,children:[]};r&&(c.children=e.all(r),e.patch(r,c),c=e.applyData(r,c)),h.push(c)}let c={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(i,c),e.applyData(i,c)},text:function(e,i){let r={type:"text",value:function(e){let i=String(e),r=/\r?\n|\r/g,s=r.exec(i),n=0,o=[];for(;s;)o.push(iv(i.slice(n,s.index),n>0,!0),s[0]),n=s.index+s[0].length,s=r.exec(i);return o.push(iv(i.slice(n),n>0,!1)),o.join("")}(String(i.value))};return e.patch(i,r),e.applyData(i,r)},thematicBreak:function(e,i){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,r),e.applyData(i,r)},toml:ib,yaml:ib,definition:ib,footnoteDefinition:ib};function ib(){}let iy={}.hasOwnProperty,iS={};function iw(e,i){e.position&&(i.position=function(e){let i=ek(e),r=eC(e);if(i&&r)return{start:i,end:r}}(e))}function iC(e,i){let r=i;if(e&&e.data){let i=e.data.hName,s=e.data.hChildren,n=e.data.hProperties;"string"==typeof i&&("element"===r.type?r.tagName=i:r={type:"element",tagName:i,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&n&&Object.assign(r.properties,io(n)),"children"in r&&r.children&&null!=s&&(r.children=s)}return r}function ik(e,i){let r=[],s=-1;for(i&&r.push({type:"text",value:"\n"});++s<e.length;)s&&r.push({type:"text",value:"\n"}),r.push(e[s]);return i&&e.length>0&&r.push({type:"text",value:"\n"}),r}function iE(e){let i=0,r=e.charCodeAt(i);for(;9===r||32===r;)i++,r=e.charCodeAt(i);return e.slice(i)}function iR(e,i){let r,s,n,o,l=(r=i||iS,s=new Map,n=new Map,o={all:function(e){let i=[];if("children"in e){let r=e.children,s=-1;for(;++s<r.length;){let n=o.one(r[s],e);if(n){if(s&&"break"===r[s-1].type&&(Array.isArray(n)||"text"!==n.type||(n.value=iE(n.value)),!Array.isArray(n)&&"element"===n.type)){let e=n.children[0];e&&"text"===e.type&&(e.value=iE(e.value))}Array.isArray(n)?i.push(...n):i.push(n)}}}return i},applyData:iC,definitionById:s,footnoteById:n,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ix,...r.handlers},one:function(e,i){let r=e.type,s=o.handlers[r];if(iy.call(o.handlers,r)&&s)return s(o,e,i);if(o.options.passThrough&&o.options.passThrough.includes(r)){if("children"in e){let{children:i,...r}=e,s=io(r);return s.children=o.all(e),s}return io(e)}return(o.options.unknownHandler||function(e,i){let r=i.data||{},s="value"in i&&!(iy.call(r,"hProperties")||iy.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,s),e.applyData(i,s)})(o,e,i)},options:r,patch:iw,wrap:ik},i_(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let i="definition"===e.type?s:n,r=String(e.identifier).toUpperCase();i.has(r)||i.set(r,e)}}),o),a=l.one(e,void 0),h=function(e){let i="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||ia,s=e.options.footnoteBackLabel||ih,n=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],h=-1;for(;++h<e.footnoteOrder.length;){let n=e.footnoteById.get(e.footnoteOrder[h]);if(!n)continue;let o=e.all(n),l=String(n.identifier).toUpperCase(),c=il(l.toLowerCase()),d=0,u=[],f=e.footnoteCounts.get(l);for(;void 0!==f&&++d<=f;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof r?r:r(h,d);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+c+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof s?s:s(h,d),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else o.push(...u);let _={type:"element",tagName:"li",properties:{id:i+"fn-"+c},children:e.wrap(o,!0)};e.patch(n,_),a.push(_)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...io(l),id:"footnote-label"},children:[{type:"text",value:n}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(l),c=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return h&&(I("children"in c),c.children.push({type:"text",value:"\n"},h)),c}function iN(e,i){return e&&"run"in e?async function(r,s){let n=iR(r,{file:s,...i});await e.run(n,s)}:function(r,s){return iR(r,{file:s,...e||i})}}function iD(e){if(e)throw e}var iM=e.i(4100);function iP(e){if("object"!=typeof e||null===e)return!1;let i=Object.getPrototypeOf(e);return(null===i||i===Object.prototype||null===Object.getPrototypeOf(i))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let iT=function(e,i){let r;if(void 0!==i&&"string"!=typeof i)throw TypeError('"ext" argument must be a string');iI(e);let s=0,n=-1,o=e.length;if(void 0===i||0===i.length||i.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(r){s=o+1;break}}else n<0&&(r=!0,n=o+1);return n<0?"":e.slice(s,n)}if(i===e)return"";let l=-1,a=i.length-1;for(;o--;)if(47===e.codePointAt(o)){if(r){s=o+1;break}}else l<0&&(r=!0,l=o+1),a>-1&&(e.codePointAt(o)===i.codePointAt(a--)?a<0&&(n=o):(a=-1,n=l));return s===n?n=l:n<0&&(n=e.length),e.slice(s,n)},iL=function(e){let i;if(iI(e),0===e.length)return".";let r=-1,s=e.length;for(;--s;)if(47===e.codePointAt(s)){if(i){r=s;break}}else i||(i=!0);return r<0?47===e.codePointAt(0)?"/":".":1===r&&47===e.codePointAt(0)?"//":e.slice(0,r)},iB=function(e){let i;iI(e);let r=e.length,s=-1,n=0,o=-1,l=0;for(;r--;){let a=e.codePointAt(r);if(47===a){if(i){n=r+1;break}continue}s<0&&(i=!0,s=r+1),46===a?o<0?o=r:1!==l&&(l=1):o>-1&&(l=-1)}return o<0||s<0||0===l||1===l&&o===s-1&&o===n+1?"":e.slice(o,s)},iA=function(...e){var i;let r,s,n,o=-1;for(;++o<e.length;)iI(e[o]),e[o]&&(n=void 0===n?e[o]:n+"/"+e[o]);return void 0===n?".":(iI(i=n),r=47===i.codePointAt(0),0!==(s=function(e,i){let r,s,n="",o=0,l=-1,a=0,h=-1;for(;++h<=e.length;){if(h<e.length)r=e.codePointAt(h);else if(47===r)break;else r=47;if(47===r){if(l===h-1||1===a);else if(l!==h-1&&2===a){if(n.length<2||2!==o||46!==n.codePointAt(n.length-1)||46!==n.codePointAt(n.length-2)){if(n.length>2){if((s=n.lastIndexOf("/"))!==n.length-1){s<0?(n="",o=0):o=(n=n.slice(0,s)).length-1-n.lastIndexOf("/"),l=h,a=0;continue}}else if(n.length>0){n="",o=0,l=h,a=0;continue}}i&&(n=n.length>0?n+"/..":"..",o=2)}else n.length>0?n+="/"+e.slice(l+1,h):n=e.slice(l+1,h),o=h-l-1;l=h,a=0}else 46===r&&a>-1?a++:a=-1}return n}(i,!r)).length||r||(s="."),s.length>0&&47===i.codePointAt(i.length-1)&&(s+="/"),r?"/"+s:s)};function iI(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function iO(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let ij=["history","path","basename","stem","extname","dirname"];class iz{constructor(e){let i,r;i=e?iO(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 i?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<ij.length;){const e=ij[s];e in i&&void 0!==i[e]&&null!==i[e]&&(this[e]="history"===e?[...i[e]]:i[e])}for(r in i)ij.includes(r)||(this[r]=i[r])}get basename(){return"string"==typeof this.path?iT(this.path):void 0}set basename(e){iF(e,"basename"),iH(e,"basename"),this.path=iA(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?iL(this.path):void 0}set dirname(e){iW(this.basename,"dirname"),this.path=iA(e||"",this.basename)}get extname(){return"string"==typeof this.path?iB(this.path):void 0}set extname(e){if(iH(e,"extname"),iW(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=iA(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){iO(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!iO(e)){let i=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}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 i=e.pathname,r=-1;for(;++r<i.length;)if(37===i.codePointAt(r)&&50===i.codePointAt(r+1)){let e=i.codePointAt(r+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(i)}(e)}(e)),iF(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?iT(this.path,this.extname):void 0}set stem(e){iF(e,"stem"),iH(e,"stem"),this.path=iA(this.dirname||"",e+(this.extname||""))}fail(e,i,r){let s=this.message(e,i,r);throw s.fatal=!0,s}info(e,i,r){let s=this.message(e,i,r);return s.fatal=void 0,s}message(e,i,r){let s=new eP(e,i,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function iH(e,i){if(e&&e.includes("/"))throw Error("`"+i+"` cannot be a path: did not expect `/`")}function iF(e,i){if(!e)throw Error("`"+i+"` cannot be empty")}function iW(e,i){if(!e)throw Error("Setting `"+i+"` requires `path` to be set too")}let i$=function(e){let i=this.constructor.prototype,r=i[e],s=function(){return r.apply(s,arguments)};return Object.setPrototypeOf(s,i),s},iU={}.hasOwnProperty;class iK extends i${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=[],i={run:function(...i){let r=-1,s=i.pop();if("function"!=typeof s)throw TypeError("Expected function as last argument, not "+s);!function n(o,...l){let a=e[++r],h=-1;if(o)return void s(o);for(;++h<i.length;)(null===l[h]||void 0===l[h])&&(l[h]=i[h]);i=l,a?(function(e,i){let r;return function(...i){let o,l=e.length>i.length;l&&i.push(s);try{o=e.apply(this,i)}catch(e){if(l&&r)throw e;return s(e)}l||(o&&o.then&&"function"==typeof o.then?o.then(n,s):o instanceof Error?s(o):n(o))};function s(e,...n){r||(r=!0,i(e,...n))}function n(e){s(null,e)}})(a,n)(...l):s(null,...l)}(null,...i)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),i}};return i}()}copy(){let e=new iK,i=-1;for(;++i<this.attachers.length;){let r=this.attachers[i];e.use(...r)}return e.data((0,iM.default)(!0,{},this.namespace)),e}data(e,i){return"string"==typeof e?2==arguments.length?(iX("data",this.frozen),this.namespace[e]=i,this):iU.call(this.namespace,e)&&this.namespace[e]||void 0:e?(iX("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...i]=this.attachers[this.freezeIndex];if(!1===i[0])continue;!0===i[0]&&(i[0]=void 0);let r=e.call(this,...i);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let i=iZ(e),r=this.parser||this.Parser;return iV("parse",r),r(String(i),i)}process(e,i){let r=this;return this.freeze(),iV("process",this.parser||this.Parser),iY("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(s,n){let o=iZ(e),l=r.parse(o);function a(e,r){e||!r?n(e):s?s(r):(I(i,"`done` is defined if `resolve` is not"),i(void 0,r))}r.run(l,o,function(e,i,s){var n,o;if(e||!i||!s)return a(e);let l=r.stringify(i,s);"string"==typeof(n=l)||(o=n)&&"object"==typeof o&&"byteLength"in o&&"byteOffset"in o?s.value=l:s.result=l,a(e,s)})}}processSync(e){let i,r=!1;return this.freeze(),iV("processSync",this.parser||this.Parser),iY("processSync",this.compiler||this.Compiler),this.process(e,function(e,s){r=!0,iD(e),i=s}),iJ("processSync","process",r),I(i,"we either bailed on an error or have a tree"),i}run(e,i,r){iG(e),this.freeze();let s=this.transformers;return r||"function"!=typeof i||(r=i,i=void 0),r?n(void 0,r):new Promise(n);function n(n,o){I("function"!=typeof i,"`file` can’t be a `done` anymore, we checked");let l=iZ(i);s.run(e,l,function(i,s,l){let a=s||e;i?o(i):n?n(a):(I(r,"`done` is defined if `resolve` is not"),r(void 0,a,l))})}}runSync(e,i){let r,s=!1;return this.run(e,i,function(e,i){iD(e),r=i,s=!0}),iJ("runSync","run",s),I(r,"we either bailed on an error or have a tree"),r}stringify(e,i){this.freeze();let r=iZ(i),s=this.compiler||this.Compiler;return iY("stringify",s),iG(e),s(e,r)}use(e,...i){let r=this.attachers,s=this.namespace;if(iX("use",this.frozen),null==e);else if("function"==typeof e)l(e,i);else if("object"==typeof e)Array.isArray(e)?o(e):n(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function n(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");o(e.plugins),e.settings&&(s.settings=(0,iM.default)(!0,s.settings,e.settings))}function o(e){let i=-1;if(null==e);else if(Array.isArray(e))for(;++i<e.length;)!function(e){if("function"==typeof e)l(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[i,...r]=e;l(i,r)}else n(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[i]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function l(e,i){let s=-1,n=-1;for(;++s<r.length;)if(r[s][0]===e){n=s;break}if(-1===n)r.push([e,...i]);else if(i.length>0){let[s,...o]=i,l=r[n][1];iP(l)&&iP(s)&&(s=(0,iM.default)(!0,l,s)),r[n]=[e,s,...o]}}}}let iq=new iK().freeze();function iV(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `parser`")}function iY(e,i){if("function"!=typeof i)throw TypeError("Cannot `"+e+"` without `compiler`")}function iX(e,i){if(i)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function iG(e){if(!iP(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function iJ(e,i,r){if(!r)throw Error("`"+e+"` finished async. Use `"+i+"` instead")}function iZ(e){var i;return(i=e)&&"object"==typeof i&&"message"in i&&"messages"in i?e:new iz(e)}let iQ=[],i0={allowDangerousHtml:!0},i1=/^(https?|ircs?|mailto|xmpp)$/i,i2=[{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 i5(e){var i;let r,s,n,o,l,a=(r=(i=e).rehypePlugins||iQ,s=i.remarkPlugins||iQ,n=i.remarkRehypeOptions?{...i.remarkRehypeOptions,...i0}:i0,iq().use(t9).use(s).use(iN,n).use(r)),h=(o=e.children||"",l=new iz,"string"==typeof o?l.value=o:O("Unexpected value `"+o+"` for `children` prop, expected `string`"),l);return function(e,i){let r=i.allowedElements,s=i.allowElement,n=i.components,o=i.disallowedElements,l=i.skipHtml,a=i.unwrapDisallowed,h=i.urlTransform||i3;for(let e of i2)Object.hasOwn(i,e.from)&&O("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&&o&&O("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),i_(e,function(e,i,n){if("raw"===e.type&&n&&"number"==typeof i)return l?n.children.splice(i,1):n.children[i]={type:"text",value:e.value},i;if("element"===e.type){let i;for(i in eK)if(Object.hasOwn(eK,i)&&Object.hasOwn(e.properties,i)){let r=e.properties[i],s=eK[i];(null===s||s.includes(e.tagName))&&(e.properties[i]=h(String(r||""),i,e))}}if("element"===e.type){let l=r?!r.includes(e.tagName):!!o&&o.includes(e.tagName);if(!l&&s&&"number"==typeof i&&(l=!s(e,i,n)),l&&n&&"number"==typeof i)return a&&e.children?n.children.splice(i,1,...e.children):n.children.splice(i,1),i}}),function(e,i){var r,s,n,o;let l;if(!i||void 0===i.Fragment)throw TypeError("Expected `Fragment` in options");let a=i.filePath||void 0;if(i.development){if("function"!=typeof i.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=a,s=i.jsxDEV,l=function(e,i,n,o){let l=Array.isArray(n.children),a=ek(e);return s(i,n,o,l,{columnNumber:a?a.column-1:void 0,fileName:r,lineNumber:a?a.line:void 0},void 0)}}else{if("function"!=typeof i.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof i.jsxs)throw TypeError("Expected `jsxs` in production options");n=i.jsx,o=i.jsxs,l=function(e,i,r,s){let l=Array.isArray(r.children)?o:n;return s?l(i,r,s):l(i,r)}}let h={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:l,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:!1!==i.passKeys,passNode:i.passNode||!1,schema:"svg"===i.space?eS:ey,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==i.tableCellAlignToStyle},c=ej(h,e,void 0);return c&&"string"!=typeof c?c:h.create(e,h.Fragment,{children:c||void 0},void 0)}(e,{Fragment:p.Fragment,components:n,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0})}(a.runSync(a.parse(h),h),e)}function i3(e){let i=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),n=e.indexOf("/");return -1===i||-1!==n&&i>n||-1!==r&&i>r||-1!==s&&i>s||i1.test(e.slice(0,i))?e:""}function i4({projectId:e,startInEditMode:i=!1}){let[r,s]=(0,_.useState)(""),[n,o]=(0,_.useState)(null),[l,a]=(0,_.useState)(i),[h,c]=(0,_.useState)(""),[d,u]=(0,_.useState)(!1),[f,m]=(0,_.useState)(null),g=(0,_.useRef)(!1);g.current=l;let v=(0,_.useRef)(i),x=(0,_.useCallback)(async()=>{try{let i=await fetch(`/api/queue?project=${encodeURIComponent(e)}`);if(!i.ok)throw Error(`${i.status}`);let r=await i.json();o(!!r.exists),g.current||s(r.content||""),v.current&&(c(r.content||""),v.current=!1),m(null)}catch(e){m(e.message)}},[e]);(0,_.useEffect)(()=>{x();let e=setInterval(x,1e4);return()=>clearInterval(e)},[x]);let b=async()=>{u(!0),m(null);try{let i=await fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:h})});if(!i.ok)throw Error(`${i.status}`);s(h),a(!1)}catch(e){m(e.message)}finally{u(!1)}},y=async()=>{u(!0);try{let i=await fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"POST"});if(!i.ok)throw Error(`${i.status}`);await x()}catch(e){m(e.message)}finally{u(!1)}};return(0,p.jsxs)("div",{className:"flex flex-col h-full min-h-0 border border-border",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,p.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"OVERNIGHT-QUEUE.md"}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[f&&(0,p.jsxs)("span",{className:"text-[10px] text-error",children:["err: ",f]}),!l&&n&&(0,p.jsx)("button",{onClick:()=>{c(r),a(!0)},className:"text-[10px] text-text-muted hover:text-accent uppercase tracking-wider",children:"Edit"}),l&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("button",{onClick:b,disabled:d,className:"text-[10px] text-accent hover:text-accent-dim uppercase tracking-wider disabled:opacity-50",children:d?"Saving…":"Save"}),(0,p.jsx)("button",{onClick:()=>{a(!1),c(""),x()},disabled:d,className:"text-[10px] text-text-muted hover:text-text uppercase tracking-wider disabled:opacity-50",children:"Cancel"})]})]})]}),l&&(0,p.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,p.jsx)("div",{className:"flex-1 min-h-0 overflow-auto",children:!1===n?(0,p.jsxs)("div",{className:"p-3 text-[11px] text-text-muted",children:[(0,p.jsx)("p",{className:"mb-2",children:"No OVERNIGHT-QUEUE.md for this project yet."}),(0,p.jsx)("button",{onClick:y,disabled:d,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"})]}):l?(0,p.jsx)("textarea",{value:h,onChange:e=>c(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,p.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,p.jsx)(i5,{children:r})})})]})}function i6({open:e,projectId:i,onClose:r}){return((0,_.useEffect)(()=>{if(!e)return;let i=e=>{"Escape"===e.key&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,r]),e)?(0,p.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,role:"dialog","aria-modal":"true","aria-labelledby":"queue-modal-title",children:(0,p.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,p.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-white/10",children:[(0,p.jsx)("h2",{id:"queue-modal-title",className:"text-[12px] font-semibold text-white",children:"OVERNIGHT-QUEUE.md"}),(0,p.jsx)("button",{type:"button",onClick:r,"aria-label":"Close",className:"rounded p-1 text-neutral-400 hover:bg-white/5 hover:text-white",children:(0,p.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,p.jsx)("path",{d:"M4 4l12 12M16 4L4 16",strokeLinecap:"round"})})})]}),(0,p.jsx)("div",{className:"flex-1 min-h-0",children:(0,p.jsx)(i4,{projectId:i,startInEditMode:!0})})]})}):null}function i9({percent:e}){let i=Math.round(e/100*20);return(0,p.jsxs)("span",{className:"font-mono text-[11px] tabular-nums whitespace-nowrap",children:[(0,p.jsx)("span",{className:"text-accent",children:"█".repeat(i)}),(0,p.jsx)("span",{className:"text-text-muted",children:"░".repeat(20-i)})]})}function i8({projectId:e}){let[i,r]=(0,_.useState)(null),s=(0,_.useCallback)(()=>{fetch(`/api/batch-progress?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{e&&r(e)}).catch(()=>{})},[e]);return((0,_.useEffect)(()=>{s();let e=setInterval(s,3e4);return()=>clearInterval(e)},[s]),i)?i.items&&0!==i.items.length?i.complete?(0,p.jsxs)("div",{className:"border-t border-border",children:[(0,p.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-2",children:[(0,p.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:["Current Batch: Batch ",i.batch_number??"—"]}),(0,p.jsx)("span",{className:"text-[10px] text-accent",children:"✅ COMPLETE"})]}),(0,p.jsxs)("div",{className:"px-3 pb-2 text-[11px] text-text-muted",children:["All ",i.items.length," items merged. Waiting for the next batch."]})]}):(0,p.jsxs)("div",{className:"border-t border-border",children:[(0,p.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-2 border-b border-border/40",children:[(0,p.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:["Current Batch: Batch ",i.batch_number??"—"]}),(0,p.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",i.items.length," items)"]})]}),(0,p.jsx)("div",{className:"max-h-40 overflow-y-auto",children:i.items.map(e=>{let i=(0,p.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1 font-mono",children:[(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0 tabular-nums",children:["#",e.issue_number]}),(0,p.jsx)(i9,{percent:e.progress}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted tabular-nums shrink-0 w-9 text-right",children:[e.progress,"%"]}),(0,p.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.label})]});return e.url?(0,p.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block hover:bg-[#1a1a1a] transition-colors border-b border-border/30",children:i},e.issue_number):(0,p.jsx)("div",{children:i},e.issue_number)})}),i.summary&&(0,p.jsx)("div",{className:"px-3 py-1.5 text-[11px] text-text-muted border-t border-border/40",children:i.summary})]}):(0,p.jsxs)("div",{className:"border-t border-border",children:[(0,p.jsx)("div",{className:"px-3 py-1.5 flex items-center gap-2",children:(0,p.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Current Batch: (none)"})}),(0,p.jsx)("div",{className:"px-3 pb-2 text-[11px] text-text-muted",children:"No active batch. Ask Head to start one via the chat."})]}):(0,p.jsx)("div",{className:"px-3 py-1.5 text-[11px] text-text-muted border-t border-border",children:"Loading batch progress…"})}function i7({color:e}){return(0,p.jsx)("span",{className:`inline-block w-1.5 h-1.5 rounded-full shrink-0 ${e}`})}function re({projectId:e}){let[i,r]=(0,_.useState)([]),[s,n]=(0,_.useState)([]),[o,l]=(0,_.useState)([]),[a,h]=(0,_.useState)([]),[c,d]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let i=!1;return fetch(`/api/queue?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(r=>{if(!i&&r&&!r.exists)return fetch(`/api/queue?project=${encodeURIComponent(e)}`,{method:"POST"})}).catch(()=>{}),()=>{i=!0}},[e]);let u=(0,_.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)&&r(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)&&n(e)}).catch(()=>{}),fetch(`/api/github/closed-issues?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{Array.isArray(e)&&l(e)}).catch(()=>{}),fetch(`/api/github/merged-prs?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{Array.isArray(e)&&h(e)}).catch(()=>{})},[e]);return(0,_.useEffect)(()=>{u();let e=setInterval(u,3e4);return()=>clearInterval(e)},[u]),(0,p.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[(0,p.jsxs)("div",{className:"flex-1 min-h-0 flex",children:[(0,p.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col border-r border-border",children:[(0,p.jsx)("div",{className:"px-3 py-1.5 border-b border-border shrink-0",children:(0,p.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:["Issues (",i.length,")"]})}),(0,p.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[0===i.length&&(0,p.jsx)("div",{className:"px-3 py-2 text-[11px] text-text-muted",children:"No issues"}),i.map(e=>(0,p.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,p.jsx)(i7,{color:"OPEN"===e.state?"bg-accent":"bg-error"}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,p.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.title}),e.assignees?.[0]&&(0,p.jsx)("span",{className:"text-[10px] text-text-muted shrink-0",children:e.assignees[0].login})]},e.number)),(0,p.jsx)("div",{className:"px-3 pt-2 pb-1 text-[9px] text-text-muted uppercase tracking-wider",children:"Recently closed"}),0===o.length&&(0,p.jsx)("div",{className:"px-3 py-1 text-[11px] text-text-muted",children:"None yet"}),o.map(e=>(0,p.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,p.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:"✓"}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,p.jsx)("span",{className:"text-[11px] text-text-muted truncate flex-1 min-w-0",children:e.title})]},`closed-${e.number}`))]})]}),(0,p.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,p.jsx)("div",{className:"px-3 py-1.5 border-b border-border shrink-0",children:(0,p.jsxs)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:["Pull Requests (",s.length,")"]})}),(0,p.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[0===s.length&&(0,p.jsx)("div",{className:"px-3 py-2 text-[11px] text-text-muted",children:"No PRs"}),s.map(e=>{let i=e.reviews||[],r=e.reviewDecision||"REVIEW_REQUIRED",s={};for(let e of i){let i=(e.body||"").trim();/^(?:Reviewer2|T2b)\b/i.test(i)?s.reviewer2=e.state:(/^(?:Reviewer1|T2a)\b/i.test(i)||/^##\s*Verdict/i.test(i))&&(s.reviewer1=e.state)}return(0,p.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,p.jsx)(i7,{color:"APPROVED"===r?"bg-accent":"CHANGES_REQUESTED"===r?"bg-error":"bg-[#ffcc00]"}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,p.jsx)("span",{className:"text-[11px] text-text truncate flex-1 min-w-0",children:e.title}),e.assignees?.[0]&&(0,p.jsx)("span",{className:"text-[10px] text-text-muted shrink-0",children:e.assignees[0].login}),["reviewer1","reviewer2"].map(e=>{let i=s[e];return(0,p.jsxs)("span",{className:`text-[10px] shrink-0 ${i?"APPROVED"===i?"text-accent":"CHANGES_REQUESTED"===i?"text-error":"text-[#ffcc00]":"text-text-muted"}`,children:[e,":",i?"APPROVED"===i?"ok":"CHANGES_REQUESTED"===i?"chg":"rev":"—"]},e)}),(0,p.jsx)("span",{className:`text-[10px] shrink-0 ${function(e){if(!e||0===e.length)return"text-text-muted";let i=e.map(e=>e.state);return i.every(e=>"SUCCESS"===e)?"text-accent":i.some(e=>"FAILURE"===e||"ERROR"===e)?"text-error":"text-[#ffcc00]"}(e.statusCheckRollup)}`,children:function(e){if(!e||0===e.length)return"—";let i=e.map(e=>e.state);return i.every(e=>"SUCCESS"===e)?"pass":i.some(e=>"FAILURE"===e||"ERROR"===e)?"fail":"run"}(e.statusCheckRollup)})]},e.number)}),(0,p.jsx)("div",{className:"px-3 pt-2 pb-1 text-[9px] text-text-muted uppercase tracking-wider",children:"Recently merged"}),0===a.length&&(0,p.jsx)("div",{className:"px-3 py-1 text-[11px] text-text-muted",children:"None yet"}),a.map(e=>(0,p.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,p.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:"✓"}),(0,p.jsxs)("span",{className:"text-[11px] text-text-muted w-8 shrink-0",children:["#",e.number]}),(0,p.jsx)("span",{className:"text-[11px] text-text-muted truncate flex-1 min-w-0",children:e.title})]},`merged-${e.number}`))]})]})]}),(0,p.jsx)("div",{className:"shrink-0",children:(0,p.jsx)(i8,{projectId:e})}),(0,p.jsxs)("div",{className:"shrink-0 flex items-center justify-between px-3 py-1.5 border-t border-border",children:[(0,p.jsx)("span",{className:"text-[11px] text-text-muted font-mono",children:"OVERNIGHT-QUEUE.md"}),(0,p.jsx)("button",{onClick:()=>d(!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:"Edit"})]}),(0,p.jsx)(i6,{open:c,projectId:e,onClose:()=>d(!1)})]})}function rt({projectId:e}){let[i,r]=(0,_.useState)(null),[s,n]=(0,_.useState)(null),[o,l]=(0,_.useState)(!1),a=()=>{setTimeout(()=>n(null),3e3)};(0,_.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>l(!1),4e3);return()=>clearTimeout(e)},[o]);let h=async()=>{if(!o)return void l(!0);l(!1),r("stop");try{let i=await fetch(`/api/agentchattr/${encodeURIComponent(e)}/stop`,{method:"POST"}),r=await i.json();n(r.ok?"Stopped":"Failed")}catch{n("Error")}r(null),a()},c=async()=>{r("restart");try{let i=await fetch(`/api/agentchattr/${encodeURIComponent(e)}/restart`,{method:"POST"}),r=await i.json();r.ok&&r.pid?n(`Restarted (PID: ${r.pid})`):n(r.error||"Failed to restart")}catch{n("Error")}r(null),a()},d=async()=>{r("reset");try{let i=await fetch(`/api/agents/${encodeURIComponent(e)}/reset`,{method:"POST"}),r=await i.json();n(r.ok?`Reset — ${r.cleared} of ${r.total} slot${1!==r.total?"s":""} deregistered`:"Failed")}catch{n("Error")}r(null),a()};return(0,p.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,p.jsx)("div",{className:"text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:"Server"}),(0,p.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,p.jsx)("button",{onClick:h,disabled:!!i,className:`px-1.5 py-0.5 text-[10px] border transition-colors disabled:opacity-50 ${o?"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?"...":o?"Confirm Stop?":"Stop"}),(0,p.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?"...":"Restart"}),(0,p.jsx)("button",{onClick:d,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?"...":"Reset Agents"})]}),s&&(0,p.jsx)("div",{className:"text-[10px] text-accent",children:s})]})}function ri(e){return Number.isFinite(e)?Math.min(Math.max(e,.1),24):3}function rr(e){let i=Math.floor(e/3600),r=Math.floor(e%3600/60);return i>0?`${i}h ${r}m`:`${r}m`}function rs(){let[e,i]=(0,_.useState)(!1),[r,s]=(0,_.useState)(null),[n,o]=(0,_.useState)(""),[l,a]=(0,_.useState)(!1),[h,c]=(0,_.useState)(String(3)),[d,u]=(0,_.useState)(!1),[f,m]=(0,_.useState)(!1),[g,v]=(0,_.useState)(!1),[x,C]=(0,_.useState)(!1),[D,M]=(0,_.useState)(!0),[P,T]=(0,_.useState)("soft-chime"),[L,B]=(0,_.useState)(!0);(0,_.useEffect)(()=>{M(E()),T(R()),B(N())},[]);let A=(0,_.useCallback)(()=>{fetch("/api/caffeinate/status").then(e=>e.ok?e.json():null).then(e=>{e&&(i(e.active),s(e.remaining),o(e.platform))}).catch(()=>{})},[]);(0,_.useEffect)(()=>{A();let e=setInterval(A,5e3);return()=>clearInterval(e)},[A]);let I=e=>{fetch("/api/caffeinate/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({duration:e})}).then(e=>e.json()).then(r=>{r.ok&&(i(!0),s(e||null))}).catch(()=>{}),a(!1)},O=!n||"darwin"===n;return(0,p.jsxs)("div",{className:"flex flex-col md:flex-row md:items-start gap-2 md:gap-6 relative",children:[O&&(0,p.jsxs)("div",{className:"flex flex-col gap-0.5 relative",children:[(0,p.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:[(0,p.jsx)("span",{children:"Keep Mac Awake"}),(0,p.jsx)("button",{type:"button","aria-label":"About Keep Mac Awake",onClick:()=>v(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:"?"})]}),g&&(0,p.jsxs)("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:[(0,p.jsx)("b",{children:"Keep Mac Awake"})," runs macOS ",(0,p.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."]}),(0,p.jsx)("div",{className:"text-[10px] text-text-muted leading-tight",children:e&&null!==r&&r>0?`Awake for ${rr(r)} more — keep Mac plugged in`:e&&null===r?"Awake indefinitely — keep Mac plugged in":"Prevents your Mac from sleeping during overnight runs."}),(0,p.jsx)("div",{className:"flex items-center gap-1.5 flex-wrap mt-0.5",children:(0,p.jsxs)("button",{onClick:()=>e?void fetch("/api/caffeinate/stop",{method:"POST"}).then(()=>{i(!1),s(null)}).catch(()=>{}):a(!l),title:"Keep Mac awake (caffeinate)",className:`px-1.5 py-0.5 text-[10px] border transition-colors ${e?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:[e?"Awake":"Start",e&&null!==r&&r>0&&(0,p.jsx)("span",{className:"ml-1 text-accent/70",children:rr(r)}),e&&null===r&&(0,p.jsx)("span",{className:"ml-1 text-accent/70",children:"on"})]})})]}),O&&(0,p.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,p.jsxs)("div",{className:"flex flex-col gap-0.5 relative",children:[(0,p.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-text-muted uppercase tracking-wider font-semibold",children:[(0,p.jsx)("span",{children:"Notification Sound"}),(0,p.jsx)("button",{type:"button","aria-label":"About Notification Sound",onClick:()=>C(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:"?"})]}),x&&(0,p.jsxs)("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:[(0,p.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."]}),(0,p.jsx)("div",{className:"text-[10px] text-text-muted leading-tight",children:"Plays a chime when an agent posts a new message."}),(0,p.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap mt-0.5",children:[(0,p.jsxs)("button",{type:"button",onClick:()=>{let e=!D;M(e),k(y,e?"on":"off")},title:D?"Notification sound on (click to mute)":"Notification sound off (click to unmute)",className:`px-1.5 py-0.5 text-[10px] border transition-colors ${D?"border-accent/50 text-accent bg-accent/10 hover:bg-accent/20":"border-border text-text-muted hover:text-text hover:border-accent"}`,children:[D?"🔔":"🔕"," Sound"]}),D&&(0,p.jsx)("select",{value:P,onChange:e=>(e=>{if(T(e),k(S,e),D)try{let i=new Audio(`/sounds/${e}.mp3`);i.volume=.6,i.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:b.map(e=>(0,p.jsx)("option",{value:e.value,className:"bg-bg-surface",children:e.label},e.value))})]}),D&&(0,p.jsxs)("label",{className:"flex items-center gap-1 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,p.jsx)("input",{type:"checkbox",checked:L,onChange:e=>{var i;B(i=e.target.checked),k(w,i?"on":"off")}}),"Only when tab is in background"]})]}),l&&!e&&(0,p.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,p.jsxs)("div",{className:"flex items-center justify-between",children:[(0,p.jsx)("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Keep Awake"}),(0,p.jsx)("button",{type:"button","aria-label":"About Keep Awake",onClick:()=>m(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:"?"})]}),f&&(0,p.jsxs)("div",{className:"p-1.5 text-[10px] leading-snug text-text bg-bg border border-border/60 rounded",children:[(0,p.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,p.jsx)("br",{}),(0,p.jsx)("br",{}),"Under the hood, this runs macOS's ",(0,p.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,p.jsx)("b",{children:"plugged in"})," to avoid draining the battery."]}),(0,p.jsx)("p",{className:"text-[10px] text-[#ffcc00]",children:"Make sure Mac is plugged in"}),(0,p.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px]",children:[(0,p.jsx)("span",{className:"text-text-muted",children:"for"}),(0,p.jsx)("input",{type:"number",value:h,onChange:e=>c(e.target.value),onBlur:()=>{let e=parseFloat(h);c(String(Math.round(10*(Number.isFinite(e)?ri(e):3))/10))},disabled:d,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,p.jsx)("span",{className:"text-text-muted",children:"hours"})]}),(0,p.jsxs)("label",{className:"flex items-center gap-1.5 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,p.jsx)("input",{type:"checkbox",checked:d,onChange:e=>u(e.target.checked)}),"Until stopped (no expiry)"]}),(0,p.jsx)("button",{type:"button",onClick:()=>{if(d)return void I(0);let e=parseFloat(h);I(Math.round(3600*(Number.isFinite(e)?ri(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:"Start"})]})]})}function rn({projectId:e}){return(0,p.jsx)("div",{className:"border-t border-border px-3 py-2",children:(0,p.jsxs)("div",{className:"flex flex-col md:flex-row md:items-start gap-2 md:gap-6",children:[(0,p.jsx)(rt,{projectId:e}),(0,p.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,p.jsx)(rs,{})]})})}var ro=e.i(47167),rl=Object.defineProperty,ra=Object.getOwnPropertyDescriptor,rh=(e,i,r,s)=>{for(var n,o=s>1?void 0:s?ra(i,r):i,l=e.length-1;l>=0;l--)(n=e[l])&&(o=(s?n(i,r,o):n(o))||o);return s&&o&&rl(i,r,o),o},rc=(e,i)=>(r,s)=>i(r,s,e),rd="Terminal input",ru="Too much output to announce, navigate to rows manually to read";function rf(e,i,r,s){var n;n=e=e.replace(/\r?\n/g,"\r"),e=r.decPrivateModes.bracketedPasteMode&&!0!==s.rawOptions.ignoreBracketedPasteMode?"\x1b[200~"+n+"\x1b[201~":n,r.triggerDataEvent(e,!0),i.value=""}function rp(e,i,r){let s=r.getBoundingClientRect(),n=e.clientX-s.left-10,o=e.clientY-s.top-10;i.style.width="20px",i.style.height="20px",i.style.left=`${n}px`,i.style.top=`${o}px`,i.style.zIndex="1000",i.focus()}function r_(e,i,r,s,n){rp(e,i,r),n&&s.rightClickSelect(e),i.value=s.selectionText,i.select()}function rm(e){return e>65535?String.fromCharCode(((e-=65536)>>10)+55296)+String.fromCharCode(e%1024+56320):String.fromCharCode(e)}function rg(e,i=0,r=e.length){let s="";for(let n=i;n<r;++n){let i=e[n];i>65535?(i-=65536,s+=String.fromCharCode((i>>10)+55296)+String.fromCharCode(i%1024+56320)):s+=String.fromCharCode(i)}return s}var rv=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let r=e.length;if(!r)return 0;let s=0,n=0;if(this._interim){let r=e.charCodeAt(n++);56320<=r&&r<=57343?i[s++]=(this._interim-55296)*1024+r-56320+65536:(i[s++]=this._interim,i[s++]=r),this._interim=0}for(let o=n;o<r;++o){let n=e.charCodeAt(o);if(55296<=n&&n<=56319){if(++o>=r)return this._interim=n,s;let l=e.charCodeAt(o);56320<=l&&l<=57343?i[s++]=(n-55296)*1024+l-56320+65536:(i[s++]=n,i[s++]=l);continue}65279!==n&&(i[s++]=n)}return s}},rx=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let r=e.length;if(!r)return 0;let s=0,n,o,l,a,h=0,c=0;if(this.interim[0]){let n=!1,o=this.interim[0];o&=(224&o)==192?31:(240&o)==224?15:7;let l=0,a;for(;(a=63&this.interim[++l])&&l<4;)o<<=6,o|=a;let h=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,d=h-l;for(;c<d;){if(c>=r)return 0;if((192&(a=e[c++]))!=128){c--,n=!0;break}this.interim[l++]=a,o<<=6,o|=63&a}n||(2===h?o<128?c--:i[s++]=o:3===h?o<2048||o>=55296&&o<=57343||65279===o||(i[s++]=o):o<65536||o>1114111||(i[s++]=o)),this.interim.fill(0)}let d=r-4,u=c;for(;u<r;){for(;u<d&&!(128&(n=e[u]))&&!(128&(o=e[u+1]))&&!(128&(l=e[u+2]))&&!(128&(a=e[u+3]));)i[s++]=n,i[s++]=o,i[s++]=l,i[s++]=a,u+=4;if((n=e[u++])<128)i[s++]=n;else if((224&n)==192){if(u>=r)return this.interim[0]=n,s;if((192&(o=e[u++]))!=128||(h=(31&n)<<6|63&o)<128){u--;continue}i[s++]=h}else if((240&n)==224){if(u>=r)return this.interim[0]=n,s;if((192&(o=e[u++]))!=128){u--;continue}if(u>=r)return this.interim[0]=n,this.interim[1]=o,s;if((192&(l=e[u++]))!=128){u--;continue}if((h=(15&n)<<12|(63&o)<<6|63&l)<2048||h>=55296&&h<=57343||65279===h)continue;i[s++]=h}else if((248&n)==240){if(u>=r)return this.interim[0]=n,s;if((192&(o=e[u++]))!=128){u--;continue}if(u>=r)return this.interim[0]=n,this.interim[1]=o,s;if((192&(l=e[u++]))!=128){u--;continue}if(u>=r)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=l,s;if((192&(a=e[u++]))!=128){u--;continue}if((h=(7&n)<<18|(63&o)<<12|(63&l)<<6|63&a)<65536||h>1114111)continue;i[s++]=h}}return s}},rb=class e{constructor(){this.fg=0,this.bg=0,this.extended=new ry}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let i=new e;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return 0x4000000&this.fg}isBold(){return 0x8000000&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:0x10000000&this.fg}isBlink(){return 0x20000000&this.fg}isInvisible(){return 0x40000000&this.fg}isItalic(){return 0x4000000&this.bg}isDim(){return 0x8000000&this.bg}isStrikethrough(){return 0x80000000&this.fg}isProtected(){return 0x20000000&this.bg}isOverline(){return 0x40000000&this.bg}getFgColorMode(){return 0x3000000&this.fg}getBgColorMode(){return 0x3000000&this.bg}isFgRGB(){return(0x3000000&this.fg)==0x3000000}isBgRGB(){return(0x3000000&this.bg)==0x3000000}isFgPalette(){return(0x3000000&this.fg)==0x1000000||(0x3000000&this.fg)==0x2000000}isBgPalette(){return(0x3000000&this.bg)==0x1000000||(0x3000000&this.bg)==0x2000000}isFgDefault(){return(0x3000000&this.fg)==0}isBgDefault(){return(0x3000000&this.bg)==0}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(0x3000000&this.fg){case 0x1000000:case 0x2000000:return 255&this.fg;case 0x3000000:return 0xffffff&this.fg;default:return -1}}getBgColor(){switch(0x3000000&this.bg){case 0x1000000:case 0x2000000:return 255&this.bg;case 0x3000000:return 0xffffff&this.bg;default:return -1}}hasExtendedAttrs(){return 0x10000000&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-0x10000001:this.bg|=0x10000000}getUnderlineColor(){if(0x10000000&this.bg&&~this.extended.underlineColor)switch(0x3000000&this.extended.underlineColor){case 0x1000000:case 0x2000000:return 255&this.extended.underlineColor;case 0x3000000:return 0xffffff&this.extended.underlineColor}return this.getFgColor()}getUnderlineColorMode(){return 0x10000000&this.bg&&~this.extended.underlineColor?0x3000000&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x3000000:this.isFgRGB()}isUnderlineColorPalette(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0x1000000||(0x3000000&this.extended.underlineColor)==0x2000000:this.isFgPalette()}isUnderlineColorDefault(){return 0x10000000&this.bg&&~this.extended.underlineColor?(0x3000000&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 0x10000000&this.fg?0x10000000&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ry=class e{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?-0x1c000001&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(0x1c000000&this._ext)>>26}set underlineStyle(e){this._ext&=-0x1c000001,this._ext|=e<<26&0x1c000000}get underlineColor(){return 0x3ffffff&this._ext}set underlineColor(e){this._ext&=-0x4000000,this._ext|=0x3ffffff&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(0xe0000000&this._ext)>>29;return e<0?0xfffffff8^e:e}set underlineVariantOffset(e){this._ext&=0x1fffffff,this._ext|=e<<29&0xe0000000}clone(){return new e(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}},rS=class e extends rb{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ry,this.combinedData=""}static fromCharData(i){let r=new e;return r.setFromCharData(i),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?rm(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(2===e[1].length){let r=e[1].charCodeAt(0);if(55296<=r&&r<=56319){let s=e[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(r-55296)*1024+s-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},rw="di$target",rC="di$dependencies",rk=new Map;function rE(e){if(rk.has(e))return rk.get(e);let i=function(e,r,s){var n,o,l;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");n=i,o=e,l=s,o[rw]===o?o[rC].push({id:n,index:l}):(o[rC]=[{id:n,index:l}],o[rw]=o)};return i._id=e,rk.set(e,i),i}var rR=rE("BufferService"),rN=rE("CoreMouseService"),rD=rE("CoreService"),rM=rE("CharsetService"),rP=rE("InstantiationService"),rT=rE("LogService"),rL=rE("OptionsService"),rB=rE("OscLinkService"),rA=rE("UnicodeService"),rI=rE("DecorationService"),rO=class{constructor(e,i,r){this._bufferService=e,this._optionsService=i,this._oscLinkService=r}provideLinks(e,i){let r=this._bufferService.buffer.lines.get(e-1);if(!r)return void i(void 0);let s=[],n=this._optionsService.rawOptions.linkHandler,o=new rS,l=r.getTrimmedLength(),a=-1,h=-1,c=!1;for(let i=0;i<l;i++)if(!(-1===h&&!r.hasContent(i))){if(r.loadCell(i,o),o.hasExtendedAttrs()&&o.extended.urlId)if(-1===h){h=i,a=o.extended.urlId;continue}else c=o.extended.urlId!==a;else -1!==h&&(c=!0);if(c||-1!==h&&i===l-1){let r=this._oscLinkService.getLinkData(a)?.uri;if(r){let o={start:{x:h+1,y:e},end:{x:i+ +(!c&&i===l-1),y:e}},a=!1;if(!n?.allowNonHttpProtocols)try{let e=new URL(r);["http:","https:"].includes(e.protocol)||(a=!0)}catch{a=!0}a||s.push({text:r,range:o,activate:(e,i)=>n?n.activate(e,i,o):function(e){if(confirm(`Do you want to navigate to ${e}?
2
2
 
3
3
  WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}(i),hover:(e,i)=>n?.hover?.(e,i,o),leave:(e,i)=>n?.leave?.(e,i,o)})}c=!1,o.hasExtendedAttrs()&&o.extended.urlId?(h=i,a=o.extended.urlId):(h=-1,a=-1)}}i(s)}};rO=rh([rc(0,rR),rc(1,rL),rc(2,rB)],rO);var rj=rE("CharSizeService"),rz=rE("CoreBrowserService"),rH=rE("MouseService"),rF=rE("RenderService"),rW=rE("SelectionService"),r$=rE("CharacterJoinerService"),rU=rE("ThemeService"),rK=rE("LinkProviderService"),rq=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?rG.isErrorNoTelemetry(e)?new rG(e.message+`
4
4
 
@@ -24,4 +24,4 @@ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){t
24
24
  @reviewer1 & 2: Review open PRs. If @dev pushed fixes, re-review. Post verdict on PR AND notify @dev here.
25
25
  ALL: Communicate via this chat by tagging agents. Your terminal is NOT visible.`},[e]),T=(0,_.useCallback)(async()=>{try{let i=await fetch("/api/triggers");if(!i.ok)throw Error(`${i.status}`);let s=(await i.json())[e]||null;if(r(s),s){if(s.message&&!b.current&&(n(s.message),b.current=s.message),!y.current)if(s.enabled&&s.interval){let e=Math.max(1,Math.round(s.interval/6e4));l(e),h(String(e))}else"number"==typeof s.intervalMin&&s.intervalMin>0&&(l(s.intervalMin),h(String(s.intervalMin)));!S.current&&"number"==typeof s.durationMin&&s.durationMin>=0&&(d(s.durationMin),f(aU(s.durationMin)))}E(null)}catch(e){E(e.message)}},[e]);(0,_.useEffect)(()=>{s||n(P)},[P,s]),(0,_.useEffect)(()=>{T();let e=window.setInterval(T,5e3);return()=>window.clearInterval(e)},[T]),(0,_.useEffect)(()=>{if(!i?.enabled){N(""),M("");return}let e=()=>{if(i.nextAt&&N(aK(Math.max(0,i.nextAt-Date.now()))),i.expiresAt){let e=Math.max(0,i.expiresAt-Date.now());M(aK(e)),e<=0&&T()}else M("")};e();let r=window.setInterval(e,1e3);return()=>window.clearInterval(r)},[i?.enabled,i?.nextAt,i?.expiresAt,T]);let L=async()=>{C(!0),E(null);let i=parseFloat(u),r=Math.round(60*(Number.isFinite(i)?a$(i):3));r!==c&&(d(r),f(aU(r)));let n=parseInt(a,10),p=Number.isFinite(n)?Math.max(1,Math.min(1440,n)):15;p!==o&&(l(p),h(String(p)));try{let i=await fetch(`/api/triggers/${encodeURIComponent(e)}/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({interval:p,duration:r,message:s})});if(!i.ok)throw Error(`${i.status}`);g(!1),x(!1),await T()}catch(e){E(e.message)}finally{C(!1)}},B=async()=>{C(!0),E(null);try{let n=await fetch(`/api/triggers/${encodeURIComponent(e)}/stop`,{method:"POST"});if(!n.ok)throw Error(`${n.status}`);r({...i||{interval:0,lastSent:null,nextAt:null,expiresAt:null,message:s,intervalMin:o,durationMin:c},enabled:!1}),await T()}catch(e){E(e.message)}finally{C(!1)}},A=!!i?.enabled;return(0,p.jsxs)("div",{className:"flex flex-col border border-border",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,p.jsxs)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:["Scheduled Trigger",A?" (running)":""]}),k&&(0,p.jsxs)("span",{className:"text-[10px] text-error",children:["err: ",k]})]}),A?(0,p.jsxs)("div",{className:"p-3 flex flex-col gap-2",children:[(0,p.jsx)("div",{className:"text-[11px] text-text-muted",children:"Sending:"}),(0,p.jsx)("pre",{className:"text-[11px] font-mono whitespace-pre-wrap text-text bg-bg-surface border border-border p-2 max-h-28 overflow-auto",children:(i?.message||s).slice(0,400)}),(0,p.jsxs)("div",{className:"flex items-center gap-3 flex-wrap text-[11px]",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1",children:[(0,p.jsxs)("span",{className:"relative inline-flex items-center justify-center w-2 h-2",children:[(0,p.jsx)("span",{className:"absolute inline-flex h-full w-full rounded-full bg-accent opacity-60 animate-ping"}),(0,p.jsx)("span",{className:"relative w-1.5 h-1.5 rounded-full bg-accent"})]}),(0,p.jsx)("span",{className:"text-accent",children:"Running"})]}),(0,p.jsxs)("span",{className:"tabular-nums text-text",children:["Next: ",R]}),D&&(0,p.jsxs)("span",{className:"tabular-nums text-text-muted",children:["Stops in: ",D]}),!i?.expiresAt&&(0,p.jsx)("span",{className:"text-text-muted",children:"(until stopped)"})]}),(0,p.jsx)("button",{onClick:B,disabled:w,className:"self-start px-3 py-1 text-[11px] text-text-muted border border-border hover:text-error hover:border-error/40 disabled:opacity-50 transition-colors",children:w?"Stopping…":"Stop Trigger"})]}):(0,p.jsxs)("div",{className:"p-3 flex flex-col gap-2",children:[(0,p.jsx)("label",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Message"}),(0,p.jsx)("textarea",{value:s,onChange:e=>n(e.target.value),rows:6,spellCheck:!1,className:"w-full bg-bg text-text text-[11px] font-mono p-2 border border-border outline-none focus:border-accent resize-y"}),(0,p.jsxs)("div",{className:"flex items-center gap-2 flex-wrap text-[11px]",children:[(0,p.jsx)("span",{className:"text-text-muted",children:"Send every"}),(0,p.jsx)("input",{type:"number",value:a,onChange:e=>{h(e.target.value),g(!0)},onBlur:()=>{let e=parseInt(a,10),i=Number.isFinite(e)?Math.max(1,Math.min(1440,e)):15;l(i),h(String(i))},min:1,max:1440,className:"w-12 bg-transparent border border-border px-1 py-0.5 text-[11px] text-text outline-none focus:border-accent text-center"}),(0,p.jsx)("span",{className:"text-text-muted",children:"min for"}),(0,p.jsx)("input",{type:"number",value:u,onChange:e=>{f(e.target.value),x(!0)},onBlur:()=>{let e=parseFloat(u),i=Math.round(60*(Number.isFinite(e)?a$(e):3));d(i),f(aU(i))},min:.1,max:24,step:.1,className:"w-14 bg-transparent border border-border px-1 py-0.5 text-[11px] text-text outline-none focus:border-accent text-center"}),(0,p.jsx)("span",{className:"text-text-muted",children:"hours"})]}),(0,p.jsx)("button",{onClick:L,disabled:w||!s.trim(),className:"self-start px-3 py-1 text-[11px] font-semibold text-bg bg-accent hover:bg-accent-dim disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:w?"Starting…":"Start Trigger"})]})]})}function aV({open:e,initialChatId:i="",onClose:r,onSave:s}){let[n,o]=(0,_.useState)(""),[l,a]=(0,_.useState)(i),[h,c]=(0,_.useState)(!1),[d,u]=(0,_.useState)(null),[f,m]=(0,_.useState)(!1);if((0,_.useEffect)(()=>{e&&a(i)},[e,i]),(0,_.useEffect)(()=>{if(!e)return;let i=e=>{"Escape"===e.key&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,r]),!e)return null;let g=async()=>{c(!0),u(null);try{await s(n.trim(),l.trim()),r()}catch(e){u(e.message||"Save failed")}finally{c(!1)}};return(0,p.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:r,role:"dialog","aria-modal":"true","aria-labelledby":"telegram-setup-title",children:(0,p.jsxs)("div",{className:"relative mx-4 max-w-xl w-full max-h-[90vh] overflow-auto rounded-lg border border-white/10 bg-neutral-950 p-6 shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,p.jsx)("button",{type:"button",onClick:r,"aria-label":"Close",className:"absolute right-3 top-3 rounded p-1 text-neutral-400 hover:bg-white/5 hover:text-white",children:(0,p.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,p.jsx)("path",{d:"M4 4l12 12M16 4L4 16",strokeLinecap:"round"})})}),(0,p.jsx)("h2",{id:"telegram-setup-title",className:"text-base font-semibold text-white",children:"Set up your Telegram Bridge"}),(0,p.jsx)("p",{className:"mt-2 text-[12px] leading-relaxed text-neutral-300",children:"The bridge forwards AgentChattr messages from your project to a Telegram chat, so you can read and reply on your phone."}),(0,p.jsxs)("div",{className:"mt-4 text-[12px] text-neutral-300 space-y-3",children:[(0,p.jsxs)("section",{children:[(0,p.jsx)("h3",{className:"text-[13px] font-semibold text-white",children:"Step 1 — Create a Telegram bot"}),(0,p.jsxs)("ol",{className:"mt-1 pl-4 list-decimal space-y-0.5 text-neutral-300",children:[(0,p.jsxs)("li",{children:["Open Telegram and search for ",(0,p.jsx)("b",{children:"@BotFather"}),"."]}),(0,p.jsxs)("li",{children:["Send ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:"/newbot"})," and follow the prompts."]}),(0,p.jsxs)("li",{children:["Choose a name and username (must end in ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:"bot"}),")."]}),(0,p.jsxs)("li",{children:["BotFather replies with a ",(0,p.jsx)("b",{children:"bot token"})," that looks like ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:"123456:ABC-DEF1234ghIkl…"}),". Copy it."]})]})]}),(0,p.jsxs)("section",{children:[(0,p.jsx)("h3",{className:"text-[13px] font-semibold text-white",children:"Step 2 — Get your chat ID"}),(0,p.jsxs)("ol",{className:"mt-1 pl-4 list-decimal space-y-0.5 text-neutral-300",children:[(0,p.jsxs)("li",{children:["Open Telegram and search for your new bot by its exact ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:"@username"}),"."]}),(0,p.jsxs)("li",{children:["Tap ",(0,p.jsx)("b",{children:"Start"})," and send any message (e.g. ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:"hello"}),")."," ",(0,p.jsxs)("span",{className:"text-neutral-400",children:["You must send at least one message first — ",(0,p.jsx)("code",{className:"bg-white/5 px-0.5 rounded",children:"getUpdates"})," returns ",(0,p.jsx)("code",{className:"bg-white/5 px-0.5 rounded",children:'{"ok":true,"result":[]}'})," until Telegram has an inbound message on record."]})]}),(0,p.jsxs)("li",{children:["Open this URL in your browser (replace ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:"YOUR_TOKEN"}),"):",(0,p.jsx)("pre",{className:"mt-1 p-2 bg-white/5 rounded text-[11px] text-neutral-200 overflow-auto",children:"https://api.telegram.org/botYOUR_TOKEN/getUpdates"})]}),(0,p.jsxs)("li",{children:["Look for ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:'"chat":{"id":<NUMBER>'})," in the JSON. That number is your ",(0,p.jsx)("b",{children:"chat id"}),". Group chat ids are negative (e.g. ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:"-1001234567890"}),") — paste the full value ",(0,p.jsx)("b",{children:"including the minus sign"}),"."]})]}),(0,p.jsx)("p",{className:"mt-1 text-neutral-400",children:"Or use one of these terminal one-liners:"}),(0,p.jsxs)("p",{className:"mt-1 text-[11px] text-neutral-400",children:["With ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:"jq"})," (cleanest):"]}),(0,p.jsx)("pre",{className:"mt-1 p-2 bg-white/5 rounded text-[11px] text-neutral-200 overflow-auto",children:"curl -s \"https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates\" | jq '.result[-1].message.chat.id'"}),(0,p.jsxs)("p",{className:"mt-1 text-[11px] text-neutral-400",children:["Without ",(0,p.jsx)("code",{className:"bg-white/5 px-1 rounded text-[11px]",children:"jq"})," (pure grep):"]}),(0,p.jsx)("pre",{className:"mt-1 p-2 bg-white/5 rounded text-[11px] text-neutral-200 overflow-auto",children:'curl -s "https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates" | grep -o \'"chat":{"id":-\\?[0-9]*\' | tail -1'}),(0,p.jsxs)("p",{className:"mt-1 text-[11px] text-neutral-500",children:["The first message from a brand-new bot sometimes doesn't propagate to ",(0,p.jsx)("code",{className:"bg-white/5 px-0.5 rounded",children:"getUpdates"})," instantly. If ",(0,p.jsx)("code",{className:"bg-white/5 px-0.5 rounded",children:"result"})," is empty, send 2-3 more messages and retry."]}),(0,p.jsx)("button",{type:"button",onClick:()=>m(e=>!e),className:"mt-2 text-[11px] text-accent hover:underline","aria-expanded":f,children:f?"Hide troubleshooting ▾":"Still empty? Troubleshooting ▸"}),f&&(0,p.jsxs)("div",{className:"mt-2 p-2 border border-white/10 rounded text-[11px] text-neutral-300 space-y-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("b",{className:"text-white",children:"Webhook conflict."})," Something else may be consuming updates. Check and delete any active webhook:",(0,p.jsx)("pre",{className:"mt-1 p-2 bg-white/5 rounded text-[11px] text-neutral-200 overflow-auto",children:'curl -s "https://api.telegram.org/bot<TOKEN>/getWebhookInfo" curl -s "https://api.telegram.org/bot<TOKEN>/deleteWebhook"'})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("b",{className:"text-white",children:"Stale bridge process."}),"A leftover bridge from a previous install will hold the update queue. Two consumers can't share one bot:",(0,p.jsx)("pre",{className:"mt-1 p-2 bg-white/5 rounded text-[11px] text-neutral-200 overflow-auto",children:"ps aux | grep telegram_bridge | grep -v grep"}),"Kill any PIDs that show up before retrying the curl."]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("b",{className:"text-white",children:"Token / bot mismatch."})," A token that doesn't match the bot you're messaging silently returns empty results. Confirm the token's ",(0,p.jsx)("code",{className:"bg-white/5 px-0.5 rounded",children:"username"})," matches the ",(0,p.jsx)("code",{className:"bg-white/5 px-0.5 rounded",children:"@username"}),"you're chatting with:",(0,p.jsx)("pre",{className:"mt-1 p-2 bg-white/5 rounded text-[11px] text-neutral-200 overflow-auto",children:'curl -s "https://api.telegram.org/bot<TOKEN>/getMe"'})]})]})]}),(0,p.jsxs)("section",{children:[(0,p.jsx)("h3",{className:"text-[13px] font-semibold text-white",children:"Step 3 — Paste credentials below"}),(0,p.jsxs)("div",{className:"mt-2 flex flex-col gap-2",children:[(0,p.jsxs)("label",{className:"text-[11px] text-neutral-400",children:["Bot token",(0,p.jsx)("input",{type:"password",value:n,onChange:e=>o(e.target.value),placeholder:"123456:ABC-DEF…",className:"mt-0.5 w-full bg-transparent border border-white/10 px-2 py-1 text-[12px] text-white outline-none focus:border-accent font-mono"})]}),(0,p.jsxs)("label",{className:"text-[11px] text-neutral-400",children:["Chat id",(0,p.jsx)("input",{type:"text",value:l,onChange:e=>a(e.target.value),placeholder:"123456789",className:"mt-0.5 w-full bg-transparent border border-white/10 px-2 py-1 text-[12px] text-white outline-none focus:border-accent font-mono"})]}),d&&(0,p.jsx)("div",{className:"text-[11px] text-error",children:d}),(0,p.jsx)("button",{type:"button",onClick:g,disabled:h||!n.trim()||!l.trim(),className:"mt-1 self-start px-3 py-1 text-[11px] font-semibold text-bg bg-accent hover:bg-accent-dim disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:h?"Saving…":"Save and start bridge"})]})]})]})]})})}async function aY(e,i){let r=await fetch(`/api/telegram?action=${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),s=await r.json();if(!r.ok||!1===s.ok)throw Error(s.error||`${r.status}`);return s}function aX({projectId:e}){let[i,r]=(0,_.useState)(null),[s,n]=(0,_.useState)(!1),[o,l]=(0,_.useState)(null),[a,h]=(0,_.useState)(null),[c,d]=(0,_.useState)(!1),[u,f]=(0,_.useState)(null),m=(0,_.useCallback)(async()=>{try{let i=await fetch(`/api/telegram?project=${encodeURIComponent(e)}`);if(!i.ok)throw Error(`${i.status}`);let s=await i.json();r(s),h(null)}catch(e){h(e.message)}},[e]);(0,_.useEffect)(()=>{m();let e=window.setInterval(m,5e3);return()=>window.clearInterval(e)},[m]);let g=e=>{let i=Array.isArray(e?.patched_projects)?e.patched_projects:[];i.length>0?f(`Install Bridge patched ${i.length} AgentChattr config(s) (${i.join(", ")}) to declare [agents.telegram-bridge]. Click SERVER → Restart so AgentChattr picks up the new agent slug, then click Start again. Without the restart, Start will fail with a 400 registration loop.`):f(null)},v=async()=>{n(!0),l(null);try{if(i&&!i.bridge_installed){let e=await aY("install",{});g(e)}await aY("start",{project_id:e}),await m()}catch(e){l(e.message)}finally{n(!1)}},x=async()=>{n(!0),l(null);try{await aY("stop",{project_id:e}),await m()}catch(e){l(e.message)}finally{n(!1)}},b=async(r,s)=>{await aY("save-config",{project_id:e,bot_token:r,chat_id:s});try{if(i&&!i.bridge_installed){let e=await aY("install",{});g(e)}await aY("start",{project_id:e})}catch(e){l(e.message)}await m()},y=!!i?.configured,S=!!i?.running,w=o||a||!S&&i?.last_error||"";return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"flex flex-col border border-border",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,p.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Telegram Bridge"}),w&&(0,p.jsx)("span",{className:"text-[10px] text-error",children:"error"})]}),(0,p.jsxs)("div",{className:"p-3 flex flex-col gap-2",children:[y?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 text-[11px] flex-wrap",children:[S?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("span",{className:"relative inline-flex items-center justify-center w-2 h-2",children:[(0,p.jsx)("span",{className:"absolute inline-flex h-full w-full rounded-full bg-accent opacity-60 animate-ping"}),(0,p.jsx)("span",{className:"relative w-1.5 h-1.5 rounded-full bg-accent"})]}),(0,p.jsx)("span",{className:"text-accent",children:"Running"})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-text-muted"}),(0,p.jsx)("span",{className:"text-text-muted",children:"Stopped"})]}),i?.bot_username&&(0,p.jsxs)("span",{className:"text-text-muted",children:["· Bot: @",i.bot_username]}),i?.chat_id&&(0,p.jsxs)("span",{className:"text-text-muted tabular-nums",children:["· Chat: ",i.chat_id]})]}),(0,p.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[S?(0,p.jsx)("button",{onClick:x,disabled:s,className:"px-3 py-1 text-[11px] text-text-muted border border-border hover:text-error hover:border-error/40 disabled:opacity-50 transition-colors",children:s?"Stopping…":"Stop"}):(0,p.jsx)("button",{onClick:v,disabled:s,className:"px-3 py-1 text-[11px] font-semibold text-bg bg-accent hover:bg-accent-dim disabled:opacity-50 transition-colors",children:s?"Starting…":"Start"}),(0,p.jsx)("button",{onClick:()=>d(!0),disabled:s,className:"px-3 py-1 text-[11px] text-text-muted border border-border hover:text-text disabled:opacity-50 transition-colors",children:"How to set up"}),(0,p.jsx)("button",{onClick:()=>d(!0),disabled:s,className:"px-3 py-1 text-[11px] text-text-muted border border-border hover:text-text disabled:opacity-50 transition-colors",children:"Edit credentials"})]})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted",children:[(0,p.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-text-muted"}),(0,p.jsx)("span",{children:"Not configured"})]}),(0,p.jsx)("button",{onClick:()=>d(!0),disabled:s,className:"self-start px-3 py-1 text-[11px] font-semibold text-bg bg-accent hover:bg-accent-dim disabled:opacity-50 transition-colors",children:"Set up Telegram Bridge"})]}),u&&(0,p.jsxs)("div",{className:"mt-1 p-2 text-[10px] text-accent border border-accent/40 bg-accent/5 whitespace-pre-wrap break-words",children:[u,(0,p.jsx)("button",{type:"button",onClick:()=>f(null),className:"block mt-1 text-text-muted hover:text-text underline",children:"dismiss"})]}),w&&(0,p.jsxs)("div",{className:"mt-1 p-2 text-[10px] text-error border border-error/40 bg-error/5 font-mono whitespace-pre-wrap break-words max-h-40 overflow-y-auto",children:[w,o&&(0,p.jsx)("button",{type:"button",onClick:()=>l(null),className:"block mt-1 text-text-muted hover:text-text underline",children:"dismiss"})]})]})]}),(0,p.jsx)(aV,{open:c,initialChatId:i?.chat_id||"",onClose:()=>d(!1),onSave:b})]})}function aG({projectId:e}){let[i,r]=(0,_.useState)(30),[s,n]=(0,_.useState)("30"),[o,l]=(0,_.useState)(!1),[a,h]=(0,_.useState)(null),[c,d]=(0,_.useState)(null),[u,f]=(0,_.useState)(!1),[m,g]=(0,_.useState)(!1),[v,x]=(0,_.useState)(30),[b,y]=(0,_.useState)("30"),[S,w]=(0,_.useState)(!1);(0,_.useEffect)(()=>{fetch(`/api/loop-guard?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{e&&"number"==typeof e.value&&(r(e.value),n(String(e.value)))}).catch(()=>{}),fetch("/api/config").then(e=>e.ok?e.json():null).then(i=>{if(!i||!Array.isArray(i.projects))return;let r=i.projects.find(i=>i.id===e);if(!r)return;g(!!r.auto_continue_loop_guard);let s=Number.isFinite(r.auto_continue_delay_sec)?r.auto_continue_delay_sec:30;x(s),y(String(s))}).catch(()=>{})},[e]);let C=async(i,r)=>{w(!0);try{let s=await fetch("/api/config");if(!s.ok)throw Error(`GET /api/config ${s.status}`);let n=await s.json();if(!n||!Array.isArray(n.projects))throw Error("config shape");let o=n.projects.findIndex(i=>i.id===e);if(o<0)throw Error(`project ${e} not found`);n.projects[o]={...n.projects[o],auto_continue_loop_guard:i,auto_continue_delay_sec:r};let l=await fetch("/api/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!l.ok)throw Error(`PUT /api/config ${l.status}`)}finally{w(!1)}};return(0,p.jsxs)("div",{className:"border border-border rounded p-2 text-[11px] font-mono",children:[(0,p.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,p.jsx)("span",{className:"uppercase tracking-wider text-text-muted",children:"Loop Guard"}),(0,p.jsx)("button",{type:"button","aria-label":"About loop guard",onClick:()=>f(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:"?"})]}),u&&(0,p.jsxs)("div",{className:"mb-1.5 p-1.5 text-[10px] leading-snug text-text bg-bg-surface border border-border/60 rounded",children:[(0,p.jsx)("b",{children:"Loop Guard"})," pauses agent-to-agent message chains after this many hops with no human reply. Higher values let agents work longer overnight; lower values add safety against runaway loops. AgentChattr accepts ",(0,p.jsx)("b",{children:"4–50"}),"; QuadWork defaults to ",(0,p.jsx)("b",{children:"30"})," (about 5–6 full PR cycles). Posting any chat message yourself resets the counter immediately."]}),(0,p.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,p.jsx)("span",{className:"text-text-muted",children:"Pause after"}),(0,p.jsx)("input",{type:"number",min:4,max:50,value:s,onChange:e=>n(e.target.value),disabled:o,className:"w-12 bg-transparent px-1 py-0.5 border border-border rounded text-text outline-none focus:ring-1 focus:ring-accent"}),(0,p.jsx)("span",{className:"text-text-muted",children:"hops"}),(0,p.jsx)("button",{type:"button",onClick:()=>{let i=parseInt(s,10);!Number.isInteger(i)||i<4||i>50?h("Must be an integer between 4 and 50."):(l(!0),h(null),fetch(`/api/loop-guard?project=${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({value:i})}).then(async e=>{if(!e.ok){let i=await e.text().catch(()=>"");throw Error(`${e.status}: ${i.slice(0,120)}`)}return e.json()}).then(e=>{r(e.value),d(e.live)}).catch(e=>h(e.message||String(e))).finally(()=>l(!1)))},disabled:o||s===String(i),className:"ml-auto px-2 py-0.5 text-[10px] text-accent border border-accent/40 rounded hover:bg-accent/10 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Apply (writes config.toml + live-pushes to AgentChattr)",children:o?"…":"Apply"})]}),a&&(0,p.jsx)("div",{className:"mt-1 text-[10px] text-red-400",children:a}),!1===c&&!a&&(0,p.jsx)("div",{className:"mt-1 text-[10px] text-text-muted",children:"Saved to config.toml — live update failed; takes effect on next AC restart."}),(0,p.jsxs)("label",{className:"mt-2 flex items-center gap-1.5 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,p.jsx)("input",{type:"checkbox",checked:m,disabled:S,onChange:e=>{let i=e.target.checked;g(i),C(i,v).catch(()=>{g(!i)})}}),"Auto-continue after pause",(0,p.jsx)("span",{className:"text-text-muted",children:"— wait"}),(0,p.jsx)("input",{type:"number",min:5,max:300,value:b,disabled:S||!m,onChange:e=>y(e.target.value),onBlur:()=>{let e=parseInt(b,10),i=Number.isFinite(e)?Math.max(5,Math.min(300,e)):30;x(i),y(String(i)),i!==v&&C(m,i).catch(()=>{})},className:"w-10 bg-transparent px-1 py-0.5 border border-border rounded text-text outline-none focus:ring-1 focus:ring-accent disabled:opacity-40 text-center"}),(0,p.jsx)("span",{className:"text-text-muted",children:"s before /continue"})]})]})}function aJ({projectId:e}){let i=(0,_.useRef)(null),[r,s]=(0,_.useState)(null),[n,o]=(0,_.useState)(null),[l,a]=(0,_.useState)(null),[h,c]=(0,_.useState)([]),[d,u]=(0,_.useState)(!1),[f,m]=(0,_.useState)(!1);(0,_.useEffect)(()=>{fetch("/api/config").then(e=>e.ok?e.json():null).then(i=>{if(!i||!Array.isArray(i.projects))return;let r=i.projects.find(i=>i.id===e);r&&u(!!r.auto_restore_after_restart)}).catch(()=>{})},[e]);let g=async i=>{m(!0);try{let r=await fetch("/api/config");if(!r.ok)throw Error(`GET /api/config ${r.status}`);let s=await r.json(),n=s.projects?.findIndex(i=>i.id===e)??-1;if(n<0)throw Error("project not found");s.projects[n]={...s.projects[n],auto_restore_after_restart:i};let o=await fetch("/api/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok)throw Error(`PUT /api/config ${o.status}`)}finally{m(!1)}},v=()=>{fetch(`/api/project-history/snapshots?project=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():null).then(e=>{e&&Array.isArray(e.snapshots)&&c(e.snapshots)}).catch(()=>{})};(0,_.useEffect)(()=>{v();let e=setInterval(v,15e3);return()=>clearInterval(e)},[e]);let x=async i=>{if(window.confirm(`Restore snapshot ${i}? This will replay every message through AgentChattr (tagged by the original sender) and may duplicate history already in the chat. Continue?`)){s("restore"),o(null),a(null);try{let r=await fetch(`/api/project-history/restore?project=${encodeURIComponent(e)}&name=${encodeURIComponent(i)}`,{method:"POST"}),s=await r.json().catch(()=>null);if(!r.ok)throw Error(s&&s.error||`HTTP ${r.status}`);s&&"number"==typeof s.imported&&a(s)}catch(e){o(e.message||String(e))}finally{s(null),v()}}},b=async()=>{s("export"),o(null),a(null);try{let i=await fetch(`/api/project-history?project=${encodeURIComponent(e)}`);if(!i.ok){let e=await i.text().catch(()=>"");throw Error(`HTTP ${i.status}: ${e.slice(0,200)}`)}let r=await i.blob(),s=URL.createObjectURL(r),n=document.createElement("a"),o=new Date().toISOString().slice(0,10);n.href=s,n.download=`${e}-history-${o}.json`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(s)}catch(e){o(e.message||String(e))}finally{s(null)}},y=async r=>{let n;if(r.size>0xa00000)return void o(`File too large (${r.size} bytes; limit 10485760)`);s("import"),o(null),a(null);try{let e=await r.text();n=JSON.parse(e)}catch(e){s(null),o(`Invalid JSON: ${e.message||String(e)}`);return}if(!n||"object"!=typeof n||!Array.isArray(n.messages)){s(null),o("File missing 'messages' array");return}let l=!1;if(n.project_id&&n.project_id!==e){if(!window.confirm(`This export is from project '${n.project_id}' but you're importing into '${e}'. Continue anyway?`))return void s(null);l=!0}let h=new Set(["head","dev","reviewer1","reviewer2","t1","t2a","t2b","t3","system"]),c=!1,d=new Set;for(let e of n.messages)if(e&&"object"==typeof e){let i=e.sender;if("string"==typeof i&&h.has(i.toLowerCase())&&(d.add(i),d.size>=5))break}if(d.size>0){if(!window.confirm(`This export contains messages attributed to reserved agent/system identities (${[...d].join(", ")}). Importing will replay them as those agents — only do this for a legitimate disaster-recovery restore. Continue?`))return void s(null);c=!0}let u=!1,f=i=>fetch(`/api/project-history?project=${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,allow_project_mismatch:l,allow_agent_senders:c,allow_duplicate:u,...i})});try{let e=await f({}),i=await e.json().catch(()=>null);if(409===e.status&&i&&"string"==typeof i.error&&/already imported/i.test(i.error)){if(!window.confirm(`${i.error}
26
26
 
27
- This file looks like it was already imported. Re-import will duplicate every message. Continue anyway?`))return void s(null);u=!0,e=await f({allow_duplicate:!0}),i=await e.json().catch(()=>null)}if(!e.ok)throw Error(i&&i.error||`HTTP ${e.status}`);a(i)}catch(e){o(e.message||String(e))}finally{s(null),i.current&&(i.current.value="")}};return(0,p.jsxs)("div",{className:"border border-border rounded p-2 text-[11px] font-mono",children:[(0,p.jsx)("div",{className:"text-text-muted uppercase tracking-wider mb-1.5",children:"Project History"}),(0,p.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,p.jsx)("button",{type:"button",onClick:b,disabled:null!==r,className:"px-2 py-0.5 text-[10px] text-accent border border-accent/40 rounded hover:bg-accent/10 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Download a JSON snapshot of this project's chat history",children:"export"===r?"…":`Export ${e} chat`}),(0,p.jsx)("button",{type:"button",onClick:()=>{o(null),a(null),i.current?.click()},disabled:null!==r,className:"px-2 py-0.5 text-[10px] text-text-muted border border-border rounded hover:text-text hover:border-accent transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Restore a previously exported chat history (JSON)",children:"import"===r?"Importing…":"Import history…"}),(0,p.jsx)("input",{ref:i,type:"file",accept:"application/json,.json",className:"hidden",onChange:e=>{let i=e.target.files&&e.target.files[0];i&&y(i)}})]}),n&&(0,p.jsx)("div",{className:"mt-1 text-[10px] text-red-400",children:n}),l&&(0,p.jsxs)("div",{className:"mt-1 text-[10px] text-text-muted",children:["Imported ",l.imported," / ",l.total,l.skipped>0&&` \xb7 skipped ${l.skipped}`,l.errors.length>0&&` \xb7 ${l.errors.length} errors`]}),(0,p.jsxs)("label",{className:"mt-2 flex items-center gap-1.5 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,p.jsx)("input",{type:"checkbox",checked:d,disabled:f,onChange:e=>{let i=e.target.checked;u(i),g(i).catch(()=>u(!i))}}),"Auto-restore newest snapshot after AC restart"]}),h.length>0&&(0,p.jsxs)("div",{className:"mt-2 border-t border-border/50 pt-1.5",children:[(0,p.jsx)("div",{className:"text-[9px] text-text-muted uppercase tracking-wider mb-0.5",children:"Auto-snapshots (before restart)"}),h.map(e=>{let i=new Date(e.mtime).toLocaleString();return(0,p.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] py-0.5",children:[(0,p.jsx)("span",{className:"text-text-muted tabular-nums flex-1 truncate",title:e.name,children:i}),(0,p.jsxs)("span",{className:"text-text-muted tabular-nums shrink-0",children:[Math.round(e.size/1024),"KB"]}),(0,p.jsx)("button",{type:"button",onClick:()=>x(e.name),disabled:null!==r,className:"px-1.5 py-0.5 text-[10px] text-accent border border-accent/40 rounded hover:bg-accent/10 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:`Restore ${e.name}`,children:"restore"===r?"…":"Restore"})]},e.name)})]})]})}let aZ=["minimal","low","medium","high"],aQ={codex:[{value:"",label:"(CLI default)"},{value:"gpt-5.4",label:"gpt-5.4"},{value:"gpt-5",label:"gpt-5"},{value:"gpt-4o",label:"gpt-4o"}],claude:[{value:"",label:"(CLI default)"},{value:"claude-opus-4-6",label:"claude-opus-4-6"},{value:"claude-sonnet-4-6",label:"claude-sonnet-4-6"},{value:"claude-haiku-4-5-20251001",label:"claude-haiku-4-5"}]};function a0(e){return aQ[e]||[{value:"",label:"(CLI default)"}]}function a1({projectId:e,onClose:i}){let[r,s]=(0,_.useState)(null),[n,o]=(0,_.useState)(null),[l,a]=(0,_.useState)(null),[h,c]=(0,_.useState)(new Set),d=(0,_.useCallback)(async()=>{try{let i=await fetch(`/api/project/${encodeURIComponent(e)}/agent-models`);if(!i.ok)throw Error(`${i.status}`);let r=await i.json();s(r.agents||[]),o(null)}catch(e){o(e.message)}},[e]);(0,_.useEffect)(()=>{d()},[d]),(0,_.useEffect)(()=>{let e=e=>{"Escape"===e.key&&i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]);let u=async(i,r)=>{a(i),o(null);try{let s=await fetch(`/api/project/${encodeURIComponent(e)}/agent-models/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),n=await s.json();if(!s.ok||!1===n.ok)throw Error(n.error||`${s.status}`);c(e=>{let r=new Set(e);return r.add(i),r}),await d()}catch(e){o(e.message)}finally{a(null)}},f=async i=>{a(i),o(null);try{let r=await fetch(`/api/agents/${encodeURIComponent(e)}/${encodeURIComponent(i)}/restart`,{method:"POST"}),s=await r.json();if(!r.ok||!1===s.ok)throw Error(s.error||`${r.status}`);c(e=>{let r=new Set(e);return r.delete(i),r})}catch(e){o(e.message)}finally{a(null)}};return(0,p.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:i,role:"dialog","aria-modal":"true","aria-labelledby":"agent-models-title",children:(0,p.jsxs)("div",{className:"relative mx-4 w-full max-w-[520px] max-h-[90vh] overflow-auto rounded-lg border border-white/10 bg-neutral-950 p-6 shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,p.jsx)("button",{type:"button",onClick:i,"aria-label":"Close",className:"absolute right-3 top-3 rounded p-1 text-neutral-400 hover:bg-white/5 hover:text-white",children:(0,p.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,p.jsx)("path",{d:"M4 4l12 12M16 4L4 16",strokeLinecap:"round"})})}),(0,p.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,p.jsx)("h2",{id:"agent-models-title",className:"text-base font-semibold text-white",children:"Agent Models"}),n&&(0,p.jsxs)("span",{className:"text-[10px] text-error max-w-[60%] truncate ml-2",title:n,children:["err: ",n]})]}),(0,p.jsxs)("div",{className:"flex flex-col gap-1.5",children:[!r&&(0,p.jsx)("div",{className:"text-[11px] text-text-muted",children:"Loading…"}),r&&0===r.length&&(0,p.jsx)("div",{className:"text-[11px] text-text-muted",children:"No agents configured."}),r&&r.map(e=>(0,p.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,p.jsx)("span",{className:"text-[11px] text-text font-semibold w-16 shrink-0",children:e.agent_id}),(0,p.jsx)("span",{className:"text-[10px] text-text-muted w-12 shrink-0",children:e.backend}),h.has(e.agent_id)&&(0,p.jsx)("span",{className:"text-[9px] text-[#ffcc00] border border-[#ffcc00]/40 px-1 py-[1px] shrink-0",title:"Config changed — running session is still on the old model/effort. Click Restart to apply.",children:"restart required"}),(0,p.jsxs)("select",{value:e.model,disabled:l===e.agent_id,onChange:i=>u(e.agent_id,{model:i.target.value}),className:"flex-1 min-w-[140px] bg-transparent border border-border px-1 py-0.5 text-[11px] font-mono text-text outline-none focus:border-accent cursor-pointer disabled:opacity-50",children:[a0(e.backend).map(e=>(0,p.jsx)("option",{value:e.value,className:"bg-bg-surface",children:e.label},e.value)),e.model&&!a0(e.backend).some(i=>i.value===e.model)&&(0,p.jsxs)("option",{value:e.model,className:"bg-bg-surface",children:[e.model," (custom)"]})]}),e.reasoning_supported?(0,p.jsxs)("select",{value:e.reasoning_effort||"",disabled:l===e.agent_id,onChange:i=>u(e.agent_id,{reasoning_effort:i.target.value}),className:"bg-transparent border border-border px-1 py-0.5 text-[11px] text-text outline-none focus:border-accent cursor-pointer disabled:opacity-50",children:[(0,p.jsx)("option",{value:"",className:"bg-bg-surface",children:"(default)"}),aZ.map(e=>(0,p.jsx)("option",{value:e,className:"bg-bg-surface",children:e},e))]}):(0,p.jsx)("span",{className:"text-[10px] text-text-muted w-16 text-center",children:"—"}),(0,p.jsx)("button",{type:"button",onClick:()=>f(e.agent_id),disabled:l===e.agent_id,title:"Restart this agent to pick up the new model / reasoning setting",className:"shrink-0 px-1.5 py-0.5 text-[10px] text-text-muted border border-border hover:text-accent hover:border-accent/40 disabled:opacity-50 transition-colors",children:l===e.agent_id?"…":"Restart"})]},e.agent_id)),(0,p.jsxs)("p",{className:"mt-2 text-[10px] text-text-muted leading-snug",children:["Codex reasoning effort defaults to ",(0,p.jsx)("code",{className:"text-text",children:"medium"})," for new projects. Blank model falls back to the CLI default. Click Restart to apply changes to a live session."]})]})]})})}function a2({projectId:e}){let[i,r]=(0,_.useState)(!1),[s,n]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let i=!1;return fetch(`/api/project/${encodeURIComponent(e)}/agent-models`).then(e=>e.ok?e.json():null).then(e=>{i||!e||n((e.agents||[]).map(e=>({id:e.agent_id,backend:e.backend})))}).catch(()=>{}),()=>{i=!0}},[e]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"flex flex-col border border-border",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,p.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Agent Models"}),(0,p.jsx)("button",{type:"button",onClick:()=>r(!0),className:"px-2 py-0.5 text-[10px] text-text-muted border border-border hover:text-accent hover:border-accent/40 transition-colors",children:"Configure →"})]}),s&&s.length>0&&(0,p.jsx)("div",{className:"px-3 py-1 text-[10px] text-text-muted truncate",title:s.map(e=>`${e.id}: ${e.backend}`).join(" · "),children:s.map((e,i)=>(0,p.jsxs)("span",{children:[i>0&&(0,p.jsx)("span",{className:"text-text-muted/60",children:" · "}),(0,p.jsx)("span",{className:"text-text",children:e.id}),(0,p.jsxs)("span",{children:[": ",e.backend]})]},e.id))})]}),i&&(0,p.jsx)(a1,{projectId:e,onClose:()=>r(!1)})]})}function a5({projectId:e}){return(0,p.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[(0,p.jsx)(m,{label:"Operator Features"}),(0,p.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col lg:flex-row gap-2 p-2 overflow-auto lg:overflow-hidden",children:[(0,p.jsx)("div",{className:"lg:flex-1 lg:min-w-[280px] lg:min-h-0",children:(0,p.jsx)(aq,{projectId:e})}),(0,p.jsx)("div",{className:"hidden lg:block w-px self-stretch bg-border"}),(0,p.jsxs)("div",{className:"lg:flex-1 lg:min-h-0 lg:overflow-y-auto flex flex-col gap-2",children:[(0,p.jsx)(a2,{projectId:e}),(0,p.jsx)(aX,{projectId:e}),(0,p.jsx)(aG,{projectId:e}),(0,p.jsx)(aJ,{projectId:e})]})]})]})}e.s(["default",0,function({projectId:e}){let i=(0,_.useRef)(null),[r,s]=(0,_.useState)(.5),[n,o]=(0,_.useState)(.5),l=(0,_.useRef)(null),[a,h]=(0,_.useState)({});(0,_.useEffect)(()=>{let i=()=>{fetch("/api/agents").then(e=>e.ok?e.json():{}).then(i=>{let r={};for(let[s,n]of Object.entries(i))s.startsWith(`${e}/`)&&(r[s.split("/")[1]]=n.state);h(r)}).catch(()=>{})};i();let r=setInterval(i,5e3);return()=>clearInterval(r)},[e]);let c=(0,_.useCallback)((e,i)=>Math.min((i-4-150)/i,Math.max(150/i,e)),[]);(0,_.useEffect)(()=>{let e=e=>{if(!l.current||!i.current)return;let r=i.current.getBoundingClientRect();"col"===l.current?s(c((e.clientX-r.left)/r.width,r.width)):o(c((e.clientY-r.top)/r.height,r.height))},r=()=>{l.current=null,document.body.style.cursor="",document.body.style.userSelect=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",r),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",r)}},[c]);let d=e=>{l.current=e,document.body.style.cursor="col"===e?"col-resize":"row-resize",document.body.style.userSelect="none"},u=`${100*r}% 4px 1fr`,f=`${100*n}% 4px 1fr`;return(0,p.jsxs)("div",{ref:i,className:"w-full h-full",style:{display:"grid",gridTemplateColumns:u,gridTemplateRows:f},children:[(0,p.jsxs)("div",{className:"flex flex-col overflow-hidden border-2 border-accent",children:[(0,p.jsx)(m,{label:"AgentChattr — primary chat"}),(0,p.jsx)("div",{className:"flex-1 min-h-0",children:(0,p.jsx)(B,{projectId:e})}),(0,p.jsx)(rn,{projectId:e})]}),(0,p.jsx)("div",{className:"bg-border cursor-col-resize hover:bg-accent-dim transition-colors",onMouseDown:()=>d("col")}),(0,p.jsx)("div",{className:"flex flex-col overflow-hidden",children:(0,p.jsx)(aW,{projectId:e,agentStates:a,onStatusChange:(e,i)=>{h(r=>({...r,[e]:i}))}})}),(0,p.jsx)("div",{className:"bg-border cursor-row-resize hover:bg-accent-dim transition-colors",onMouseDown:()=>d("row")}),(0,p.jsx)("div",{className:"bg-border cursor-move",onMouseDown:()=>d("col")}),(0,p.jsx)("div",{className:"bg-border cursor-row-resize hover:bg-accent-dim transition-colors",onMouseDown:()=>d("row")}),(0,p.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[(0,p.jsx)(m,{label:"GitHub"}),(0,p.jsx)("div",{className:"flex-1 min-h-0",children:(0,p.jsx)(re,{projectId:e})})]}),(0,p.jsx)("div",{className:"bg-border cursor-col-resize hover:bg-accent-dim transition-colors",onMouseDown:()=>d("col")}),(0,p.jsx)(a5,{projectId:e})]})}],36330)},71714,e=>{e.n(e.i(36330))}]);
27
+ This file looks like it was already imported. Re-import will duplicate every message. Continue anyway?`))return void s(null);u=!0,e=await f({allow_duplicate:!0}),i=await e.json().catch(()=>null)}if(!e.ok)throw Error(i&&i.error||`HTTP ${e.status}`);a(i)}catch(e){o(e.message||String(e))}finally{s(null),i.current&&(i.current.value="")}};return(0,p.jsxs)("div",{className:"border border-border rounded p-2 text-[11px] font-mono",children:[(0,p.jsx)("div",{className:"text-text-muted uppercase tracking-wider mb-1.5",children:"Project History"}),(0,p.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,p.jsx)("button",{type:"button",onClick:b,disabled:null!==r,className:"px-2 py-0.5 text-[10px] text-accent border border-accent/40 rounded hover:bg-accent/10 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Download a JSON snapshot of this project's chat history",children:"export"===r?"…":`Export ${e} chat`}),(0,p.jsx)("button",{type:"button",onClick:()=>{o(null),a(null),i.current?.click()},disabled:null!==r,className:"px-2 py-0.5 text-[10px] text-text-muted border border-border rounded hover:text-text hover:border-accent transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Restore a previously exported chat history (JSON)",children:"import"===r?"Importing…":"Import history…"}),(0,p.jsx)("input",{ref:i,type:"file",accept:"application/json,.json",className:"hidden",onChange:e=>{let i=e.target.files&&e.target.files[0];i&&y(i)}})]}),n&&(0,p.jsx)("div",{className:"mt-1 text-[10px] text-red-400",children:n}),l&&(0,p.jsxs)("div",{className:"mt-1 text-[10px] text-text-muted",children:["Imported ",l.imported," / ",l.total,l.skipped>0&&` \xb7 skipped ${l.skipped}`,l.errors.length>0&&` \xb7 ${l.errors.length} errors`]}),(0,p.jsxs)("label",{className:"mt-2 flex items-center gap-1.5 text-[10px] text-text-muted cursor-pointer select-none",children:[(0,p.jsx)("input",{type:"checkbox",checked:d,disabled:f,onChange:e=>{let i=e.target.checked;u(i),g(i).catch(()=>u(!i))}}),"Auto-restore newest snapshot after AC restart"]}),h.length>0&&(0,p.jsxs)("div",{className:"mt-2 border-t border-border/50 pt-1.5",children:[(0,p.jsx)("div",{className:"text-[9px] text-text-muted uppercase tracking-wider mb-0.5",children:"Auto-snapshots (before restart)"}),h.map(e=>{let i=new Date(e.mtime).toLocaleString();return(0,p.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] py-0.5",children:[(0,p.jsx)("span",{className:"text-text-muted tabular-nums flex-1 truncate",title:e.name,children:i}),(0,p.jsxs)("span",{className:"text-text-muted tabular-nums shrink-0",children:[Math.round(e.size/1024),"KB"]}),(0,p.jsx)("button",{type:"button",onClick:()=>x(e.name),disabled:null!==r,className:"px-1.5 py-0.5 text-[10px] text-accent border border-accent/40 rounded hover:bg-accent/10 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:`Restore ${e.name}`,children:"restore"===r?"…":"Restore"})]},e.name)})]})]})}let aZ=["minimal","low","medium","high"],aQ={codex:[{value:"",label:"(CLI default)"},{value:"gpt-5.4",label:"gpt-5.4"},{value:"gpt-5",label:"gpt-5"},{value:"gpt-4o",label:"gpt-4o"}],claude:[{value:"",label:"(CLI default)"},{value:"claude-opus-4-6",label:"claude-opus-4-6"},{value:"claude-sonnet-4-6",label:"claude-sonnet-4-6"},{value:"claude-haiku-4-5-20251001",label:"claude-haiku-4-5"}]};function a0(e){return aQ[e]||[{value:"",label:"(CLI default)"}]}function a1({projectId:e,onClose:i}){let[r,s]=(0,_.useState)(null),[n,o]=(0,_.useState)(null),[l,a]=(0,_.useState)(null),[h,c]=(0,_.useState)(new Set),d=(0,_.useCallback)(async()=>{try{let i=await fetch(`/api/project/${encodeURIComponent(e)}/agent-models`);if(!i.ok)throw Error(`${i.status}`);let r=await i.json();s(r.agents||[]),o(null)}catch(e){o(e.message)}},[e]);(0,_.useEffect)(()=>{d()},[d]),(0,_.useEffect)(()=>{let e=e=>{"Escape"===e.key&&i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]);let u=async(i,r)=>{a(i),o(null);try{let s=await fetch(`/api/project/${encodeURIComponent(e)}/agent-models/${i}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),n=await s.json();if(!s.ok||!1===n.ok)throw Error(n.error||`${s.status}`);c(e=>{let r=new Set(e);return r.add(i),r}),await d()}catch(e){o(e.message)}finally{a(null)}},f=async i=>{a(i),o(null);try{let r=await fetch(`/api/agents/${encodeURIComponent(e)}/${encodeURIComponent(i)}/restart`,{method:"POST"}),s=await r.json();if(!r.ok||!1===s.ok)throw Error(s.error||`${r.status}`);c(e=>{let r=new Set(e);return r.delete(i),r})}catch(e){o(e.message)}finally{a(null)}};return(0,p.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:i,role:"dialog","aria-modal":"true","aria-labelledby":"agent-models-title",children:(0,p.jsxs)("div",{className:"relative mx-4 w-full max-w-[520px] max-h-[90vh] overflow-auto rounded-lg border border-white/10 bg-neutral-950 p-6 shadow-2xl",onClick:e=>e.stopPropagation(),children:[(0,p.jsx)("button",{type:"button",onClick:i,"aria-label":"Close",className:"absolute right-3 top-3 rounded p-1 text-neutral-400 hover:bg-white/5 hover:text-white",children:(0,p.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:(0,p.jsx)("path",{d:"M4 4l12 12M16 4L4 16",strokeLinecap:"round"})})}),(0,p.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,p.jsx)("h2",{id:"agent-models-title",className:"text-base font-semibold text-white",children:"Agent Models"}),n&&(0,p.jsxs)("span",{className:"text-[10px] text-error max-w-[60%] truncate ml-2",title:n,children:["err: ",n]})]}),(0,p.jsxs)("div",{className:"flex flex-col gap-1.5",children:[!r&&(0,p.jsx)("div",{className:"text-[11px] text-text-muted",children:"Loading…"}),r&&0===r.length&&(0,p.jsx)("div",{className:"text-[11px] text-text-muted",children:"No agents configured."}),r&&r.map(e=>(0,p.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,p.jsx)("span",{className:"text-[11px] text-text font-semibold w-16 shrink-0",children:e.agent_id}),(0,p.jsx)("span",{className:"text-[10px] text-text-muted w-12 shrink-0",children:e.backend}),h.has(e.agent_id)&&(0,p.jsx)("span",{className:"text-[9px] text-[#ffcc00] border border-[#ffcc00]/40 px-1 py-[1px] shrink-0",title:"Config changed — running session is still on the old model/effort. Click Restart to apply.",children:"restart required"}),(0,p.jsxs)("select",{value:e.model,disabled:l===e.agent_id,onChange:i=>u(e.agent_id,{model:i.target.value}),className:"flex-1 min-w-[140px] bg-transparent border border-border px-1 py-0.5 text-[11px] font-mono text-text outline-none focus:border-accent cursor-pointer disabled:opacity-50",children:[a0(e.backend).map(e=>(0,p.jsx)("option",{value:e.value,className:"bg-bg-surface",children:e.label},e.value)),e.model&&!a0(e.backend).some(i=>i.value===e.model)&&(0,p.jsxs)("option",{value:e.model,className:"bg-bg-surface",children:[e.model," (custom)"]})]}),e.reasoning_supported?(0,p.jsxs)("select",{value:e.reasoning_effort||"",disabled:l===e.agent_id,onChange:i=>u(e.agent_id,{reasoning_effort:i.target.value}),className:"bg-transparent border border-border px-1 py-0.5 text-[11px] text-text outline-none focus:border-accent cursor-pointer disabled:opacity-50",children:[(0,p.jsx)("option",{value:"",className:"bg-bg-surface",children:"(default)"}),aZ.map(e=>(0,p.jsx)("option",{value:e,className:"bg-bg-surface",children:e},e))]}):(0,p.jsx)("span",{className:"text-[10px] text-text-muted w-16 text-center",children:"—"}),(0,p.jsx)("button",{type:"button",onClick:()=>f(e.agent_id),disabled:l===e.agent_id,title:"Restart this agent to pick up the new model / reasoning setting",className:"shrink-0 px-1.5 py-0.5 text-[10px] text-text-muted border border-border hover:text-accent hover:border-accent/40 disabled:opacity-50 transition-colors",children:l===e.agent_id?"…":"Restart"})]},e.agent_id)),(0,p.jsxs)("p",{className:"mt-2 text-[10px] text-text-muted leading-snug",children:["Codex reasoning effort defaults to ",(0,p.jsx)("code",{className:"text-text",children:"medium"})," for new projects. Blank model falls back to the CLI default. Click Restart to apply changes to a live session."]})]})]})})}function a2({projectId:e}){let[i,r]=(0,_.useState)(!1),[s,n]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let i=!1;return fetch(`/api/project/${encodeURIComponent(e)}/agent-models`).then(e=>e.ok?e.json():null).then(e=>{i||!e||n((e.agents||[]).map(e=>({id:e.agent_id,backend:e.backend})))}).catch(()=>{}),()=>{i=!0}},[e]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"flex flex-col border border-border",children:[(0,p.jsxs)("div",{className:"flex items-center justify-between h-7 px-3 shrink-0 border-b border-border",children:[(0,p.jsx)("span",{className:"text-[11px] text-text-muted uppercase tracking-wider",children:"Agent Models"}),(0,p.jsx)("button",{type:"button",onClick:()=>r(!0),className:"px-2 py-0.5 text-[10px] text-text-muted border border-border hover:text-accent hover:border-accent/40 transition-colors",children:"Configure →"})]}),s&&s.length>0&&(0,p.jsx)("div",{className:"px-3 py-1 text-[10px] text-text-muted truncate",title:s.map(e=>`${e.id}: ${e.backend}`).join(" · "),children:s.map((e,i)=>(0,p.jsxs)("span",{children:[i>0&&(0,p.jsx)("span",{className:"text-text-muted/60",children:" · "}),(0,p.jsx)("span",{className:"text-text",children:e.id}),(0,p.jsxs)("span",{children:[": ",e.backend]})]},e.id))})]}),i&&(0,p.jsx)(a1,{projectId:e,onClose:()=>r(!1)})]})}function a5({projectId:e}){return(0,p.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[(0,p.jsx)(m,{label:"Operator Features"}),(0,p.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col lg:flex-row gap-2 p-2 overflow-auto lg:overflow-hidden",children:[(0,p.jsx)("div",{className:"lg:flex-1 lg:min-w-[280px] lg:min-h-0",children:(0,p.jsx)(aq,{projectId:e})}),(0,p.jsx)("div",{className:"hidden lg:block w-px self-stretch bg-border"}),(0,p.jsxs)("div",{className:"lg:flex-1 lg:min-h-0 lg:overflow-y-auto flex flex-col gap-2",children:[(0,p.jsx)(a2,{projectId:e}),(0,p.jsx)(aX,{projectId:e}),(0,p.jsx)(aG,{projectId:e}),(0,p.jsx)(aJ,{projectId:e})]})]})]})}e.s(["default",0,function({projectId:e}){let i=(0,_.useRef)(null),[r,s]=(0,_.useState)(.5),[n,o]=(0,_.useState)(.5),l=(0,_.useRef)(null),[a,h]=(0,_.useState)({});(0,_.useEffect)(()=>{let i=()=>{fetch("/api/agents").then(e=>e.ok?e.json():{}).then(i=>{let r={};for(let[s,n]of Object.entries(i))s.startsWith(`${e}/`)&&(r[s.split("/")[1]]=n.state);h(r)}).catch(()=>{})};i();let r=setInterval(i,5e3);return()=>clearInterval(r)},[e]);let c=(0,_.useCallback)((e,i)=>Math.min((i-4-150)/i,Math.max(150/i,e)),[]);(0,_.useEffect)(()=>{let e=e=>{if(!l.current||!i.current)return;let r=i.current.getBoundingClientRect();"col"===l.current?s(c((e.clientX-r.left)/r.width,r.width)):o(c((e.clientY-r.top)/r.height,r.height))},r=()=>{l.current=null,document.body.style.cursor="",document.body.style.userSelect=""};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",r),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",r)}},[c]);let d=e=>{l.current=e,document.body.style.cursor="col"===e?"col-resize":"row-resize",document.body.style.userSelect="none"},u=`${100*r}% 4px 1fr`,f=`${100*n}% 4px 1fr`;return(0,p.jsxs)("div",{ref:i,className:"w-full h-full",style:{display:"grid",gridTemplateColumns:u,gridTemplateRows:f},children:[(0,p.jsxs)("div",{className:"flex flex-col overflow-hidden border-2 border-accent",children:[(0,p.jsx)(m,{label:"AgentChattr — primary chat"}),(0,p.jsx)("div",{className:"flex-1 min-h-0",children:(0,p.jsx)(B,{projectId:e})}),(0,p.jsx)(rn,{projectId:e})]}),(0,p.jsx)("div",{className:"bg-border cursor-col-resize hover:bg-accent-dim transition-colors",onMouseDown:()=>d("col")}),(0,p.jsx)("div",{className:"flex flex-col overflow-hidden",children:(0,p.jsx)(aW,{projectId:e,agentStates:a,onStatusChange:(e,i)=>{h(r=>({...r,[e]:i}))}})}),(0,p.jsx)("div",{className:"bg-border cursor-row-resize hover:bg-accent-dim transition-colors",onMouseDown:()=>d("row")}),(0,p.jsx)("div",{className:"bg-border cursor-move",onMouseDown:()=>d("col")}),(0,p.jsx)("div",{className:"bg-border cursor-row-resize hover:bg-accent-dim transition-colors",onMouseDown:()=>d("row")}),(0,p.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[(0,p.jsx)(m,{label:"GitHub"}),(0,p.jsx)("div",{className:"flex-1 min-h-0",children:(0,p.jsx)(re,{projectId:e})})]}),(0,p.jsx)("div",{className:"bg-border cursor-col-resize hover:bg-accent-dim transition-colors",onMouseDown:()=>d("col")}),(0,p.jsx)(a5,{projectId:e})]})}],55601)},73766,e=>{e.n(e.i(55601))}]);