fourth-spark 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -402,50 +402,50 @@ Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}
402
402
  *
403
403
  * This source code is licensed under the ISC license.
404
404
  * See the LICENSE file in the root directory of this source tree.
405
- */const t3=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Sh=Oe("zap",t3);function HE(e){var t,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(a=HE(e[t]))&&(s&&(s+=" "),s+=a)}else for(a in e)e[a]&&(s&&(s+=" "),s+=a);return s}function ce(){for(var e,t,a=0,s="",l=arguments.length;a<l;a++)(e=arguments[a])&&(t=HE(e))&&(s&&(s+=" "),s+=t);return s}const Xb=e=>{let t;const a=new Set,s=(h,x)=>{const b=typeof h=="function"?h(t):h;if(!Object.is(b,t)){const y=t;t=x??(typeof b!="object"||b===null)?b:Object.assign({},t,b),a.forEach(T=>T(t,y))}},l=()=>t,f={setState:s,getState:l,getInitialState:()=>m,subscribe:h=>(a.add(h),()=>a.delete(h))},m=t=e(s,l,f);return f},n3=(e=>e?Xb(e):Xb),a3=e=>e;function r3(e,t=a3){const a=Ku.useSyncExternalStore(e.subscribe,Ku.useCallback(()=>t(e.getState()),[e,t]),Ku.useCallback(()=>t(e.getInitialState()),[e,t]));return Ku.useDebugValue(a),a}const Zb=e=>{const t=n3(e),a=s=>r3(t,s);return Object.assign(a,t),a},zs=(e=>e?Zb(e):Zb),cm="fs-theme";function FE(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Wb(e){return e==="system"?FE():e}function Jb(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const qm=zs((e,t)=>({preference:localStorage.getItem(cm)??"system",resolved:Wb(localStorage.getItem(cm)??"system"),setPreference(a){const s=Wb(a);localStorage.setItem(cm,a),Jb(a),e({preference:a,resolved:s})},cycle(){const a=["system","light","dark"],s=a[(a.indexOf(t().preference)+1)%a.length];t().setPreference(s)},init(){Jb(t().preference);const a=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>{const{preference:l}=t();if(l==="system"){const o=FE();e({resolved:o})}};return a.addEventListener("change",s),()=>a.removeEventListener("change",s)}})),bc="fourth-spark-server-url";function zE(){if(typeof window>"u")return!1;const t=window.Capacitor;return typeof(t==null?void 0:t.isNativePlatform)=="function"&&t.isNativePlatform()}function qE(){return localStorage.getItem(bc)??""}function s3(e){const t=e.replace(/\/+$/,"");t?localStorage.setItem(bc,t):localStorage.removeItem(bc)}function Ym(){return localStorage.getItem(bc)??""}class Hs extends Error{constructor(a,s){super(a);rn(this,"status");this.name="ApiError",this.status=s}}async function Ce(e,t){let a;try{a=await fetch(qE()+e,{...t,headers:{Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers}})}catch(l){throw new Hs(l instanceof Error?l.message:"Network request failed",0)}if(!a.ok){const l=await a.text().catch(()=>"");throw new Hs(l.trim()||`${a.status} ${a.statusText}`,a.status)}if(a.status===204)return;const s=await a.text();if(s)return JSON.parse(s)}function Mn(e,...t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){const a=e;for(const s of[...t,"data","items"])if(Array.isArray(a[s]))return a[s]}return[]}async function i3(){return Mn(await Ce("/api/repos"),"repos")}async function l3(e,t,a){return Ce("/api/repos",{method:"POST",body:JSON.stringify({name:e,gitUrl:t,localPath:a})})}async function o3(e){return Ce("/api/repos/resolve",{method:"POST",body:JSON.stringify({localPath:e})})}async function u3(e){await Ce(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}async function c3(e){await Ce(`/api/repos/${encodeURIComponent(e)}/start`,{method:"POST"})}async function d3(e){await Ce(`/api/repos/${encodeURIComponent(e)}/stop`,{method:"POST"})}async function f3(e){return Ce(`/api/repos/${encodeURIComponent(e)}/branches`)}async function m3(e,t){return Ce(`/api/repos/${encodeURIComponent(e)}/checkout`,{method:"POST",body:JSON.stringify({branch:t})})}async function h3(e){return Ce(`/api/repos/${encodeURIComponent(e)}/pull`,{method:"POST"})}function We(e){return`/api/repos/${encodeURIComponent(e)}`}async function p3(e){return Mn(await Ce(`${We(e)}/sessions`),"sessions")}async function g3(e,t,a,s,l,o,d){return Ce(`${We(e)}/sessions`,{method:"POST",body:JSON.stringify({message:t,agent:a,model:s,variant:l,issueId:o,customAgentId:d})})}async function b3(e,t){return Ce(`${We(e)}/sessions/${encodeURIComponent(t)}`)}async function x3(e,t){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}`,{method:"DELETE"})}async function E3(e,t,a,s,l){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/prompt`,{method:"POST",body:JSON.stringify({content:a,agent:s,model:l})})}async function y3(e,t){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/abort`,{method:"POST"})}async function T3(e,t,a){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/questions/reply`,{method:"POST",body:JSON.stringify({answers:a})})}async function _3(e,t){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/questions/reject`,{method:"POST"})}function N3(e){const t=e,a=t.info;if(a&&typeof a.id=="string"){const s=Array.isArray(t.parts)?t.parts:void 0;return{...a,...s?{parts:s}:{}}}return t}async function S3(e,t){return Mn(await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/messages`),"messages").map(N3)}async function v3(e,t){return Mn(await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/todos`),"todos")}async function YE(e,t){return Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/status`)}async function ex(e,t){return Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/links`)}async function tx(e){return Ce(`${We(e)}/sessions/all-links`)}async function A3(e,t,a,s){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"POST",body:JSON.stringify({type:a,targetId:s})})}async function C3(e,t,a,s){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"DELETE",body:JSON.stringify({type:a,targetId:s})})}async function $E(){return Mn(await Ce("/api/custom-agents"))}async function GE(e){return Ce("/api/custom-agents",{method:"POST",body:JSON.stringify(e)})}async function KE(e,t){return Ce(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function VE(e){await Ce(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function nx(e){return Ce(`/api/custom-agents/${encodeURIComponent(e)}/export`)}async function w3(e){return Ce("/api/custom-agents/import",{method:"POST",body:JSON.stringify(e)})}async function k3(e){return Mn(await Ce(`${We(e)}/custom-agents`))}async function R3(e,t){return Ce(`${We(e)}/custom-agents`,{method:"POST",body:JSON.stringify(t)})}async function vh(e){return Mn(await Ce(`${We(e)}/models`))}async function O3(){return Mn(await Ce("/api/prompt-fragments"))}async function I3(e){return Ce("/api/prompt-fragments",{method:"POST",body:JSON.stringify(e)})}async function M3(e,t){return Ce(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function D3(e){await Ce(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"DELETE"})}async function ax(e){return Mn(await Ce(`${We(e)}/tags`))}async function rx(e,t){return Mn(await Ce(`${We(e)}/milestones`))}async function sx(e,t="open"){return Mn(await Ce(`${We(e)}/issues?state=${encodeURIComponent(t)}`),"issues")}async function L3(e,t="all"){return Ce(`${We(e)}/issues/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function j3(e,t,a){return Ce(`${We(e)}/issues`,{method:"POST",body:JSON.stringify({title:t,body:a})})}async function B3(e,t,a){await Ce(`${We(e)}/issues/${t}/children`,{method:"POST",body:JSON.stringify({childNumber:a})})}async function QE(e,t,a){return Ce(`${We(e)}/issues/${t}`,{method:"PATCH",body:JSON.stringify(a)})}async function ix(e,t){return Mn(await Ce(`${We(e)}/issues/${t}/pulls`))}async function P3(e,t,a,s=!1){await Ce(`${We(e)}/issues/${t}/pulls/${a}/merge`,{method:"POST",body:JSON.stringify({closeIssue:s})})}async function lx(e,t="open"){return Mn(await Ce(`${We(e)}/pulls?state=${encodeURIComponent(t)}`))}async function U3(e,t="all"){return Ce(`${We(e)}/pulls/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function H3(e,t){await Ce(`${We(e)}/pulls/${t}/merge`,{method:"POST"})}async function XE(e,t){return Mn(await Ce(`${We(e)}/pulls/${t}/issues`))}async function F3(e,t,a){await Ce(`${We(e)}/pulls/${t}/issues`,{method:"POST",body:JSON.stringify({issueNumber:a})})}async function z3(e,t,a){await Ce(`${We(e)}/pulls/${t}/issues/${a}`,{method:"DELETE"})}async function q3(e,t){return Ce(`${We(e)}/pulls/${t}/comments`)}async function Y3(e,t){return Ce(`${We(e)}/issues/${t}/comments`)}async function ox(e,t,a){return Ce(`${We(e)}/issues/${t}/comments`,{method:"POST",body:JSON.stringify({body:a})})}async function $3(e,t,a){return Ce(`${We(e)}/issues/${t}/polish`,{method:"POST",body:JSON.stringify({draft:a})})}async function ux(e,t){return Ce(`${We(e)}/issues/${t}/draft`)}async function G3(e,t,a){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({title:a})})}async function K3(){return Ce("/api/agents-md")}async function V3(e){await Ce("/api/agents-md",{method:"PUT",body:JSON.stringify({content:e})})}async function Q3(e){return Ce(`/api/repos/${encodeURIComponent(e)}/agents-md`)}async function X3(e,t){await Ce(`/api/repos/${encodeURIComponent(e)}/agents-md`,{method:"PUT",body:JSON.stringify({content:t})})}function Z3(e){return`${qE()}${We(e)}/events`}async function W3(e){return Ce(`${We(e)}/sessions/status`)}async function Uc(){return Ce("/api/settings")}async function $m(e,t){await Ce(`/api/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({value:t})})}async function ZE(){return Ce("/api/cloud/status")}async function J3(e){try{return(await Ce("/api/cloud/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).connected}catch{return!1}}async function eC(){return Mn(await Ce("/api/git-hosts"),"gitHosts")}async function tC(e,t,a,s="gitea"){return Ce("/api/git-hosts",{method:"POST",body:JSON.stringify({host:e,name:t,token:a,platform:s})})}async function nC(e){await Ce(`/api/git-hosts/${encodeURIComponent(e)}`,{method:"DELETE"})}async function aC(){return Ce("/api/usage")}async function rC(e){return Ce("/api/usage/switch",{method:"POST",body:JSON.stringify({accountId:e})})}async function sC(e,t="ios"){await Ce("/api/push/register",{method:"POST",body:JSON.stringify({token:e,platform:t})})}const ts="fs-active-repo",qe=zs((e,t)=>({repos:[],activeRepoId:localStorage.getItem(ts),loading:!1,loadError:null,loadRepos:async()=>{e({loading:!0,loadError:null});try{const a=await i3(),s=t().activeRepoId,l=s&&a.some(d=>d.id===s);e({repos:a,loading:!1,activeRepoId:l?s:a.length>0?a[0].id:null});const o=t().activeRepoId;o?localStorage.setItem(ts,o):localStorage.removeItem(ts)}catch(a){e({loading:!1,loadError:a instanceof Error?a.message:"Failed to load repos"})}},setActiveRepo:a=>{e({activeRepoId:a}),a?localStorage.setItem(ts,a):localStorage.removeItem(ts)},addRepo:async(a,s,l)=>{try{const o=await l3(a,s,l);return e(d=>({repos:[...d.repos,o],activeRepoId:o.id})),localStorage.setItem(ts,o.id),o}catch(o){return e({loadError:o instanceof Error?o.message:"Failed to add repo"}),null}},removeRepo:async a=>{try{await u3(a)}catch{}e(s=>{const l=s.repos.filter(d=>d.id!==a),o=s.activeRepoId===a?l.length>0?l[0].id:null:s.activeRepoId;return o?localStorage.setItem(ts,o):localStorage.removeItem(ts),{repos:l,activeRepoId:o}})},updateRepoBranch:(a,s)=>{e(l=>({repos:l.repos.map(o=>o.id===a?{...o,branch:s}:o)}))}})),Da=e=>{var t;return((t=e.repos.find(a=>a.id===e.activeRepoId))==null?void 0:t.name)??null},WE=[{segment:"repos",icon:Iv,label:"仓库管理",global:!0},{segment:"run",icon:Bc,label:"运行面板",global:!1},{segment:"issues",icon:fo,label:"Issues",global:!1},{segment:"pulls",icon:mo,label:"PRs",global:!1},{segment:"settings",icon:HA,label:"设置",global:!0}];function JE(e,t,a){return t?`/${e}`:a?`/${encodeURIComponent(a)}/${e}`:`/${e}`}function iC({repoId:e,currentBranch:t}){const a=qe(A=>A.updateRepoBranch),[s,l]=v.useState(!1),[o,d]=v.useState(null),[f,m]=v.useState(!1),[h,x]=v.useState(null),[b,y]=v.useState(null),T=v.useRef(null),N=v.useCallback(()=>{l(!1),y(null)},[]);v.useEffect(()=>{if(!s)return;const A=D=>{T.current&&!T.current.contains(D.target)&&N()};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[s,N]);const S=async()=>{if(s){N();return}l(!0),m(!0),y(null);try{d(await f3(e))}catch{y("加载分支失败")}finally{m(!1)}},C=async A=>{if(!(A===t||h)){x(A),y(null);try{const D=await m3(e,A);a(e,D.branch),N()}catch(D){y(D instanceof Error?D.message:"切换失败")}finally{x(null)}}};return t?u.jsxs("div",{ref:T,className:"relative",children:[u.jsxs("button",{type:"button",onClick:S,className:"flex items-center gap-1 rounded-md bg-elevated px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-blue-500/10 hover:text-blue-600",children:[u.jsx(_o,{className:"h-3 w-3"}),t,u.jsx(ss,{className:ce("h-3 w-3 transition-transform",s&&"rotate-180")})]}),s&&u.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 w-56 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[f?u.jsx("div",{className:"flex items-center justify-center py-4",children:u.jsx(Va,{className:"h-4 w-4 animate-spin text-fg-4"})}):o?u.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[o.local.map(A=>u.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>C(A),className:ce("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",A===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[A===t?u.jsx(oa,{className:"h-3 w-3 shrink-0"}):h===A?u.jsx(Va,{className:"h-3 w-3 shrink-0 animate-spin"}):u.jsx("span",{className:"h-3 w-3 shrink-0"}),u.jsx("span",{className:"truncate",children:A})]},A)),o.remote.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mx-3 my-1 border-t border-line"}),u.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider text-fg-4",children:"Remote"}),o.remote.map(A=>u.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>C(A),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[h===A?u.jsx(Va,{className:"h-3 w-3 shrink-0 animate-spin"}):u.jsx("span",{className:"h-3 w-3 shrink-0"}),u.jsx("span",{className:"truncate",children:A})]},`remote-${A}`))]})]}):null,b&&u.jsx("div",{className:"border-t border-line px-3 py-2 text-xs text-red-500",children:b})]})]}):null}function lC(){const[e,t]=v.useState(null);return v.useEffect(()=>{const a=()=>fetch("/api/health").then(o=>o.json()).then(o=>{o.latestVersion&&o.latestVersion!=="0.7.1"&&t(o.latestVersion)}).catch(()=>{});a();const s=setInterval(a,30*6e4),l=()=>a();return window.addEventListener("focus",l),()=>{clearInterval(s),window.removeEventListener("focus",l)}},[]),e}function oC(){const e=va(),t=ca(),a=qe(b=>b.repos),s=qe(b=>b.activeRepoId),l=qe(b=>b.setActiveRepo),o=qm(b=>b.preference),d=qm(b=>b.cycle),f=o==="light"?YA:o==="dark"?CA:vA,m=a.find(b=>b.id===s),h=lC(),x=b=>{var N;if(!b)return;l(b);const y=a.find(S=>S.id===b);if(!y)return;const T=((N=t.pathname.match(/\/(run|issues|pulls)/))==null?void 0:N[1])??"run";e(`/${encodeURIComponent(y.name)}/${T}`)};return u.jsx("header",{className:"shrink-0 border-b border-line bg-surface pt-[var(--safe-top)]",children:u.jsxs("div",{className:"flex h-12 items-center justify-between px-4",children:[u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx(Sh,{className:"h-5 w-5 text-blue-500"}),u.jsx("span",{className:"text-sm font-bold tracking-tight text-fg",children:"Fourth Spark"}),u.jsxs("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-fg-4",children:["v","0.7.1"]}),h&&u.jsxs("span",{className:"text-[10px] text-amber-500",children:["→ v",h," 可用,运行 ",u.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[a.length>0&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("select",{value:s??"",onChange:b=>x(b.target.value),className:"rounded-md border border-line bg-base px-2.5 py-1 text-xs text-fg-2 focus:border-blue-500 focus:outline-none",children:a.map(b=>u.jsx("option",{value:b.id,children:b.name},b.id))}),m&&s&&u.jsx(iC,{repoId:s,currentBranch:m.branch})]}),u.jsx("a",{href:"https://github.com/kinminghao/fourth-spark",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:u.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:u.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),u.jsx("button",{type:"button",onClick:d,"aria-label":`主题: ${o}`,className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:u.jsx(f,{className:"h-4 w-4"})})]})]})})}function uC(){const e=qe(Da);return u.jsx("nav",{className:"hidden w-48 shrink-0 flex-col border-r border-line bg-surface py-2 md:flex",children:WE.map(t=>u.jsxs(Th,{to:JE(t.segment,t.global,e),className:({isActive:a})=>ce("mx-2 flex items-center gap-2.5 rounded-md px-3 py-2 text-sm transition-colors",a?"bg-blue-500/10 font-medium text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:[u.jsx(t.icon,{className:"h-4 w-4 shrink-0"}),t.label]},t.segment))})}function cC(){const e=qe(Da);return u.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-30 border-t border-line bg-surface pb-[var(--safe-bottom)] md:hidden",children:u.jsx("div",{className:"flex h-14 items-center justify-around",children:WE.map(t=>u.jsx(Th,{to:JE(t.segment,t.global,e),"aria-label":t.label,className:({isActive:a})=>ce("flex h-10 w-10 items-center justify-center rounded-md transition-colors",a?"bg-blue-500/10 text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:u.jsx(t.icon,{className:"h-5 w-5 shrink-0"})},t.segment))})})}function dC(){return u.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-base text-fg",children:[u.jsx(oC,{}),u.jsxs("div",{className:"flex min-h-0 flex-1",children:[u.jsx(uC,{}),u.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden pb-[calc(3.5rem_+_var(--safe-bottom))] md:pb-0",children:u.jsx(OS,{})})]}),u.jsx(cC,{})]})}function fC({onClose:e}){const[t,a]=v.useState(""),[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(!1),[h,x]=v.useState(""),b=qe(C=>C.addRepo),y=s.trim()!==""&&o.trim()!==""&&t.trim()!==""&&!f,T=async C=>{const A=C.trim();if(A){m(!0),x("");try{const D=await o3(A);D.name&&!s.trim()&&l(D.name),D.gitUrl&&!o.trim()&&d(D.gitUrl)}catch(D){const k=D instanceof Error?D.message:"无法解析路径";try{const z=JSON.parse(k);x(z.error??k)}catch{x(k)}}m(!1)}},N=v.useRef(T);N.current=T,v.useEffect(()=>{const C=t.trim();if(!C)return;const A=setTimeout(()=>{N.current(C)},500);return()=>clearTimeout(A)},[t]);const S=async()=>{if(!y)return;x(""),await b(s.trim(),o.trim(),t.trim())&&e()};return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:e,children:u.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:C=>C.stopPropagation(),children:[u.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[u.jsx("h2",{className:"text-base font-semibold text-fg",children:"添加仓库"}),u.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:u.jsx(Tt,{className:"h-4 w-4"})})]}),u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:"m-path",className:"text-xs font-medium text-fg-3",children:"本地路径"}),u.jsx("input",{id:"m-path",value:t,onChange:C=>a(C.target.value),onBlur:C=>void T(C.target.value),placeholder:"/Users/you/code/repo",autoFocus:!0,className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"}),u.jsx("span",{className:"text-[11px] text-fg-5",children:f?"正在读取 Git 信息…":"输入路径后自动读取仓库信息"})]}),u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:"m-name",className:"text-xs font-medium text-fg-3",children:"名称"}),u.jsx("input",{id:"m-name",value:s,onChange:C=>l(C.target.value),placeholder:"my-project",className:"w-full rounded-lg border border-line bg-base px-3 py-2 text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:"m-git",className:"text-xs font-medium text-fg-3",children:"Git 远程地址"}),u.jsx("input",{id:"m-git",value:o,onChange:C=>d(C.target.value),placeholder:"https://github.com/org/repo.git",className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-xs text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),h&&u.jsx("p",{className:"rounded-md bg-red-500/10 px-3 py-2 text-xs text-red-500",children:h}),u.jsxs("div",{className:"mt-1 flex items-center justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:e,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),u.jsx("button",{type:"button",onClick:S,disabled:!y,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:bg-fg-6 disabled:text-fg-4",children:"添加仓库"})]})]})]})})}function mC({repoId:e,repoName:t,onClose:a}){const[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(!0),[h,x]=v.useState(!1),[b,y]=v.useState(null);v.useEffect(()=>{Q3(e).then(S=>{l(S.content),d(S.content),m(!1)}).catch(S=>{y(S instanceof Error?S.message:String(S)),m(!1)})},[e]);const T=async()=>{x(!0),y(null);try{await X3(e,s),d(s)}catch(S){y(S instanceof Error?S.message:String(S))}x(!1)},N=s!==o;return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:a,children:u.jsxs("div",{className:"flex w-full max-w-2xl flex-col rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:S=>S.stopPropagation(),children:[u.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("h2",{className:"text-base font-semibold text-fg",children:[t," — AGENTS.md"]}),u.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"仅对此仓库生效,修改后 opencode 热加载即时生效。"})]}),u.jsx("button",{type:"button",onClick:a,className:"shrink-0 rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:u.jsx(Tt,{className:"h-4 w-4"})})]}),b&&u.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"min-w-0 break-words",children:b})]}),f?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[u.jsx(Va,{className:"h-5 w-5 fs-spin"}),u.jsx("p",{className:"text-xs",children:"加载中…"})]}):u.jsx("textarea",{value:s,onChange:S=>l(S.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
405
+ */const t3=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Sh=Oe("zap",t3);function HE(e){var t,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(a=HE(e[t]))&&(s&&(s+=" "),s+=a)}else for(a in e)e[a]&&(s&&(s+=" "),s+=a);return s}function ce(){for(var e,t,a=0,s="",l=arguments.length;a<l;a++)(e=arguments[a])&&(t=HE(e))&&(s&&(s+=" "),s+=t);return s}const Xb=e=>{let t;const a=new Set,s=(h,x)=>{const b=typeof h=="function"?h(t):h;if(!Object.is(b,t)){const y=t;t=x??(typeof b!="object"||b===null)?b:Object.assign({},t,b),a.forEach(T=>T(t,y))}},l=()=>t,f={setState:s,getState:l,getInitialState:()=>m,subscribe:h=>(a.add(h),()=>a.delete(h))},m=t=e(s,l,f);return f},n3=(e=>e?Xb(e):Xb),a3=e=>e;function r3(e,t=a3){const a=Ku.useSyncExternalStore(e.subscribe,Ku.useCallback(()=>t(e.getState()),[e,t]),Ku.useCallback(()=>t(e.getInitialState()),[e,t]));return Ku.useDebugValue(a),a}const Zb=e=>{const t=n3(e),a=s=>r3(t,s);return Object.assign(a,t),a},zs=(e=>e?Zb(e):Zb),cm="fs-theme";function FE(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Wb(e){return e==="system"?FE():e}function Jb(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const qm=zs((e,t)=>({preference:localStorage.getItem(cm)??"system",resolved:Wb(localStorage.getItem(cm)??"system"),setPreference(a){const s=Wb(a);localStorage.setItem(cm,a),Jb(a),e({preference:a,resolved:s})},cycle(){const a=["system","light","dark"],s=a[(a.indexOf(t().preference)+1)%a.length];t().setPreference(s)},init(){Jb(t().preference);const a=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>{const{preference:l}=t();if(l==="system"){const o=FE();e({resolved:o})}};return a.addEventListener("change",s),()=>a.removeEventListener("change",s)}})),bc="fourth-spark-server-url";function zE(){if(typeof window>"u")return!1;const t=window.Capacitor;return typeof(t==null?void 0:t.isNativePlatform)=="function"&&t.isNativePlatform()}function qE(){return localStorage.getItem(bc)??""}function s3(e){const t=e.replace(/\/+$/,"");t?localStorage.setItem(bc,t):localStorage.removeItem(bc)}function Ym(){return localStorage.getItem(bc)??""}class Hs extends Error{constructor(a,s){super(a);rn(this,"status");this.name="ApiError",this.status=s}}async function Ce(e,t){let a;try{a=await fetch(qE()+e,{...t,headers:{Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers}})}catch(l){throw new Hs(l instanceof Error?l.message:"Network request failed",0)}if(!a.ok){const l=await a.text().catch(()=>"");throw new Hs(l.trim()||`${a.status} ${a.statusText}`,a.status)}if(a.status===204)return;const s=await a.text();if(s)return JSON.parse(s)}function Mn(e,...t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){const a=e;for(const s of[...t,"data","items"])if(Array.isArray(a[s]))return a[s]}return[]}async function i3(){return Mn(await Ce("/api/repos"),"repos")}async function l3(e,t,a){return Ce("/api/repos",{method:"POST",body:JSON.stringify({name:e,gitUrl:t,localPath:a})})}async function o3(e){return Ce("/api/repos/resolve",{method:"POST",body:JSON.stringify({localPath:e})})}async function u3(e){await Ce(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}async function c3(e){await Ce(`/api/repos/${encodeURIComponent(e)}/start`,{method:"POST"})}async function d3(e){await Ce(`/api/repos/${encodeURIComponent(e)}/stop`,{method:"POST"})}async function f3(e){return Ce(`/api/repos/${encodeURIComponent(e)}/branches`)}async function m3(e,t){return Ce(`/api/repos/${encodeURIComponent(e)}/checkout`,{method:"POST",body:JSON.stringify({branch:t})})}async function h3(e){return Ce(`/api/repos/${encodeURIComponent(e)}/pull`,{method:"POST"})}function We(e){return`/api/repos/${encodeURIComponent(e)}`}async function p3(e){return Mn(await Ce(`${We(e)}/sessions`),"sessions")}async function g3(e,t,a,s,l,o,d){return Ce(`${We(e)}/sessions`,{method:"POST",body:JSON.stringify({message:t,agent:a,model:s,variant:l,issueId:o,customAgentId:d})})}async function b3(e,t){return Ce(`${We(e)}/sessions/${encodeURIComponent(t)}`)}async function x3(e,t){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}`,{method:"DELETE"})}async function E3(e,t,a,s,l){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/prompt`,{method:"POST",body:JSON.stringify({content:a,agent:s,model:l})})}async function y3(e,t){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/abort`,{method:"POST"})}async function T3(e,t,a){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/questions/reply`,{method:"POST",body:JSON.stringify({answers:a})})}async function _3(e,t){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/questions/reject`,{method:"POST"})}function N3(e){const t=e,a=t.info;if(a&&typeof a.id=="string"){const s=Array.isArray(t.parts)?t.parts:void 0;return{...a,...s?{parts:s}:{}}}return t}async function S3(e,t){return Mn(await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/messages`),"messages").map(N3)}async function v3(e,t){return Mn(await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/todos`),"todos")}async function YE(e,t){return Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/status`)}async function ex(e,t){return Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/links`)}async function tx(e){return Ce(`${We(e)}/sessions/all-links`)}async function A3(e,t,a,s){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"POST",body:JSON.stringify({type:a,targetId:s})})}async function C3(e,t,a,s){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"DELETE",body:JSON.stringify({type:a,targetId:s})})}async function $E(){return Mn(await Ce("/api/custom-agents"))}async function GE(e){return Ce("/api/custom-agents",{method:"POST",body:JSON.stringify(e)})}async function KE(e,t){return Ce(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function VE(e){await Ce(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function nx(e){return Ce(`/api/custom-agents/${encodeURIComponent(e)}/export`)}async function w3(e){return Ce("/api/custom-agents/import",{method:"POST",body:JSON.stringify(e)})}async function k3(e){return Mn(await Ce(`${We(e)}/custom-agents`))}async function R3(e,t){return Ce(`${We(e)}/custom-agents`,{method:"POST",body:JSON.stringify(t)})}async function vh(e){return Mn(await Ce(`${We(e)}/models`))}async function O3(){return Mn(await Ce("/api/prompt-fragments"))}async function I3(e){return Ce("/api/prompt-fragments",{method:"POST",body:JSON.stringify(e)})}async function M3(e,t){return Ce(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function D3(e){await Ce(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"DELETE"})}async function ax(e){return Mn(await Ce(`${We(e)}/tags`))}async function rx(e,t){return Mn(await Ce(`${We(e)}/milestones`))}async function sx(e,t="open"){return Mn(await Ce(`${We(e)}/issues?state=${encodeURIComponent(t)}`),"issues")}async function L3(e,t="all"){return Ce(`${We(e)}/issues/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function j3(e,t,a){return Ce(`${We(e)}/issues`,{method:"POST",body:JSON.stringify({title:t,body:a})})}async function B3(e,t,a){await Ce(`${We(e)}/issues/${t}/children`,{method:"POST",body:JSON.stringify({childNumber:a})})}async function QE(e,t,a){return Ce(`${We(e)}/issues/${t}`,{method:"PATCH",body:JSON.stringify(a)})}async function ix(e,t){return Mn(await Ce(`${We(e)}/issues/${t}/pulls`))}async function P3(e,t,a,s=!1){await Ce(`${We(e)}/issues/${t}/pulls/${a}/merge`,{method:"POST",body:JSON.stringify({closeIssue:s})})}async function lx(e,t="open"){return Mn(await Ce(`${We(e)}/pulls?state=${encodeURIComponent(t)}`))}async function U3(e,t="all"){return Ce(`${We(e)}/pulls/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function H3(e,t){await Ce(`${We(e)}/pulls/${t}/merge`,{method:"POST"})}async function XE(e,t){return Mn(await Ce(`${We(e)}/pulls/${t}/issues`))}async function F3(e,t,a){await Ce(`${We(e)}/pulls/${t}/issues`,{method:"POST",body:JSON.stringify({issueNumber:a})})}async function z3(e,t,a){await Ce(`${We(e)}/pulls/${t}/issues/${a}`,{method:"DELETE"})}async function q3(e,t){return Ce(`${We(e)}/pulls/${t}/comments`)}async function Y3(e,t){return Ce(`${We(e)}/issues/${t}/comments`)}async function ox(e,t,a){return Ce(`${We(e)}/issues/${t}/comments`,{method:"POST",body:JSON.stringify({body:a})})}async function $3(e,t,a){return Ce(`${We(e)}/issues/${t}/polish`,{method:"POST",body:JSON.stringify({draft:a})})}async function ux(e,t){return Ce(`${We(e)}/issues/${t}/draft`)}async function G3(e,t,a){await Ce(`${We(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({title:a})})}async function K3(){return Ce("/api/agents-md")}async function V3(e){await Ce("/api/agents-md",{method:"PUT",body:JSON.stringify({content:e})})}async function Q3(e){return Ce(`/api/repos/${encodeURIComponent(e)}/agents-md`)}async function X3(e,t){await Ce(`/api/repos/${encodeURIComponent(e)}/agents-md`,{method:"PUT",body:JSON.stringify({content:t})})}function Z3(e){return`${qE()}${We(e)}/events`}async function W3(e){return Ce(`${We(e)}/sessions/status`)}async function Uc(){return Ce("/api/settings")}async function $m(e,t){await Ce(`/api/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({value:t})})}async function ZE(){return Ce("/api/cloud/status")}async function J3(){return Ce("/api/cloud/reload",{method:"POST"})}async function eC(e){try{return(await Ce("/api/cloud/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).connected}catch{return!1}}async function tC(){return Mn(await Ce("/api/git-hosts"),"gitHosts")}async function nC(e,t,a,s="gitea"){return Ce("/api/git-hosts",{method:"POST",body:JSON.stringify({host:e,name:t,token:a,platform:s})})}async function aC(e){await Ce(`/api/git-hosts/${encodeURIComponent(e)}`,{method:"DELETE"})}async function rC(){return Ce("/api/usage")}async function sC(e){return Ce("/api/usage/switch",{method:"POST",body:JSON.stringify({accountId:e})})}async function iC(e,t="ios"){await Ce("/api/push/register",{method:"POST",body:JSON.stringify({token:e,platform:t})})}const ts="fs-active-repo",qe=zs((e,t)=>({repos:[],activeRepoId:localStorage.getItem(ts),loading:!1,loadError:null,loadRepos:async()=>{e({loading:!0,loadError:null});try{const a=await i3(),s=t().activeRepoId,l=s&&a.some(d=>d.id===s);e({repos:a,loading:!1,activeRepoId:l?s:a.length>0?a[0].id:null});const o=t().activeRepoId;o?localStorage.setItem(ts,o):localStorage.removeItem(ts)}catch(a){e({loading:!1,loadError:a instanceof Error?a.message:"Failed to load repos"})}},setActiveRepo:a=>{e({activeRepoId:a}),a?localStorage.setItem(ts,a):localStorage.removeItem(ts)},addRepo:async(a,s,l)=>{try{const o=await l3(a,s,l);return e(d=>({repos:[...d.repos,o],activeRepoId:o.id})),localStorage.setItem(ts,o.id),o}catch(o){return e({loadError:o instanceof Error?o.message:"Failed to add repo"}),null}},removeRepo:async a=>{try{await u3(a)}catch{}e(s=>{const l=s.repos.filter(d=>d.id!==a),o=s.activeRepoId===a?l.length>0?l[0].id:null:s.activeRepoId;return o?localStorage.setItem(ts,o):localStorage.removeItem(ts),{repos:l,activeRepoId:o}})},updateRepoBranch:(a,s)=>{e(l=>({repos:l.repos.map(o=>o.id===a?{...o,branch:s}:o)}))}})),Da=e=>{var t;return((t=e.repos.find(a=>a.id===e.activeRepoId))==null?void 0:t.name)??null},WE=[{segment:"repos",icon:Iv,label:"仓库管理",global:!0},{segment:"run",icon:Bc,label:"运行面板",global:!1},{segment:"issues",icon:fo,label:"Issues",global:!1},{segment:"pulls",icon:mo,label:"PRs",global:!1},{segment:"settings",icon:HA,label:"设置",global:!0}];function JE(e,t,a){return t?`/${e}`:a?`/${encodeURIComponent(a)}/${e}`:`/${e}`}function lC({repoId:e,currentBranch:t}){const a=qe(A=>A.updateRepoBranch),[s,l]=v.useState(!1),[o,d]=v.useState(null),[f,m]=v.useState(!1),[h,x]=v.useState(null),[b,y]=v.useState(null),T=v.useRef(null),N=v.useCallback(()=>{l(!1),y(null)},[]);v.useEffect(()=>{if(!s)return;const A=D=>{T.current&&!T.current.contains(D.target)&&N()};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[s,N]);const S=async()=>{if(s){N();return}l(!0),m(!0),y(null);try{d(await f3(e))}catch{y("加载分支失败")}finally{m(!1)}},C=async A=>{if(!(A===t||h)){x(A),y(null);try{const D=await m3(e,A);a(e,D.branch),N()}catch(D){y(D instanceof Error?D.message:"切换失败")}finally{x(null)}}};return t?u.jsxs("div",{ref:T,className:"relative",children:[u.jsxs("button",{type:"button",onClick:S,className:"flex items-center gap-1 rounded-md bg-elevated px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-blue-500/10 hover:text-blue-600",children:[u.jsx(_o,{className:"h-3 w-3"}),t,u.jsx(ss,{className:ce("h-3 w-3 transition-transform",s&&"rotate-180")})]}),s&&u.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 w-56 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[f?u.jsx("div",{className:"flex items-center justify-center py-4",children:u.jsx(Va,{className:"h-4 w-4 animate-spin text-fg-4"})}):o?u.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[o.local.map(A=>u.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>C(A),className:ce("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",A===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[A===t?u.jsx(oa,{className:"h-3 w-3 shrink-0"}):h===A?u.jsx(Va,{className:"h-3 w-3 shrink-0 animate-spin"}):u.jsx("span",{className:"h-3 w-3 shrink-0"}),u.jsx("span",{className:"truncate",children:A})]},A)),o.remote.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mx-3 my-1 border-t border-line"}),u.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider text-fg-4",children:"Remote"}),o.remote.map(A=>u.jsxs("button",{type:"button",disabled:h!==null,onClick:()=>C(A),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[h===A?u.jsx(Va,{className:"h-3 w-3 shrink-0 animate-spin"}):u.jsx("span",{className:"h-3 w-3 shrink-0"}),u.jsx("span",{className:"truncate",children:A})]},`remote-${A}`))]})]}):null,b&&u.jsx("div",{className:"border-t border-line px-3 py-2 text-xs text-red-500",children:b})]})]}):null}function oC(){const[e,t]=v.useState(null);return v.useEffect(()=>{const a=()=>fetch("/api/health").then(o=>o.json()).then(o=>{o.latestVersion&&o.latestVersion!=="0.7.3"&&t(o.latestVersion)}).catch(()=>{});a();const s=setInterval(a,30*6e4),l=()=>a();return window.addEventListener("focus",l),()=>{clearInterval(s),window.removeEventListener("focus",l)}},[]),e}function uC(){const e=va(),t=ca(),a=qe(b=>b.repos),s=qe(b=>b.activeRepoId),l=qe(b=>b.setActiveRepo),o=qm(b=>b.preference),d=qm(b=>b.cycle),f=o==="light"?YA:o==="dark"?CA:vA,m=a.find(b=>b.id===s),h=oC(),x=b=>{var N;if(!b)return;l(b);const y=a.find(S=>S.id===b);if(!y)return;const T=((N=t.pathname.match(/\/(run|issues|pulls)/))==null?void 0:N[1])??"run";e(`/${encodeURIComponent(y.name)}/${T}`)};return u.jsx("header",{className:"shrink-0 border-b border-line bg-surface pt-[var(--safe-top)]",children:u.jsxs("div",{className:"flex h-12 items-center justify-between px-4",children:[u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx(Sh,{className:"h-5 w-5 text-blue-500"}),u.jsx("span",{className:"text-sm font-bold tracking-tight text-fg",children:"Fourth Spark"}),u.jsxs("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-fg-4",children:["v","0.7.3"]}),h&&u.jsxs("span",{className:"text-[10px] text-amber-500",children:["→ v",h," 可用,运行 ",u.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[a.length>0&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("select",{value:s??"",onChange:b=>x(b.target.value),className:"rounded-md border border-line bg-base px-2.5 py-1 text-xs text-fg-2 focus:border-blue-500 focus:outline-none",children:a.map(b=>u.jsx("option",{value:b.id,children:b.name},b.id))}),m&&s&&u.jsx(lC,{repoId:s,currentBranch:m.branch})]}),u.jsx("a",{href:"https://github.com/kinminghao/fourth-spark",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:u.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:u.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),u.jsx("button",{type:"button",onClick:d,"aria-label":`主题: ${o}`,className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:u.jsx(f,{className:"h-4 w-4"})})]})]})})}function cC(){const e=qe(Da);return u.jsx("nav",{className:"hidden w-48 shrink-0 flex-col border-r border-line bg-surface py-2 md:flex",children:WE.map(t=>u.jsxs(Th,{to:JE(t.segment,t.global,e),className:({isActive:a})=>ce("mx-2 flex items-center gap-2.5 rounded-md px-3 py-2 text-sm transition-colors",a?"bg-blue-500/10 font-medium text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:[u.jsx(t.icon,{className:"h-4 w-4 shrink-0"}),t.label]},t.segment))})}function dC(){const e=qe(Da);return u.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-30 border-t border-line bg-surface pb-[var(--safe-bottom)] md:hidden",children:u.jsx("div",{className:"flex h-14 items-center justify-around",children:WE.map(t=>u.jsx(Th,{to:JE(t.segment,t.global,e),"aria-label":t.label,className:({isActive:a})=>ce("flex h-10 w-10 items-center justify-center rounded-md transition-colors",a?"bg-blue-500/10 text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:u.jsx(t.icon,{className:"h-5 w-5 shrink-0"})},t.segment))})})}function fC(){return u.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-base text-fg",children:[u.jsx(uC,{}),u.jsxs("div",{className:"flex min-h-0 flex-1",children:[u.jsx(cC,{}),u.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden pb-[calc(3.5rem_+_var(--safe-bottom))] md:pb-0",children:u.jsx(OS,{})})]}),u.jsx(dC,{})]})}function mC({onClose:e}){const[t,a]=v.useState(""),[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(!1),[h,x]=v.useState(""),b=qe(C=>C.addRepo),y=s.trim()!==""&&o.trim()!==""&&t.trim()!==""&&!f,T=async C=>{const A=C.trim();if(A){m(!0),x("");try{const D=await o3(A);D.name&&!s.trim()&&l(D.name),D.gitUrl&&!o.trim()&&d(D.gitUrl)}catch(D){const k=D instanceof Error?D.message:"无法解析路径";try{const z=JSON.parse(k);x(z.error??k)}catch{x(k)}}m(!1)}},N=v.useRef(T);N.current=T,v.useEffect(()=>{const C=t.trim();if(!C)return;const A=setTimeout(()=>{N.current(C)},500);return()=>clearTimeout(A)},[t]);const S=async()=>{if(!y)return;x(""),await b(s.trim(),o.trim(),t.trim())&&e()};return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:e,children:u.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:C=>C.stopPropagation(),children:[u.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[u.jsx("h2",{className:"text-base font-semibold text-fg",children:"添加仓库"}),u.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:u.jsx(Tt,{className:"h-4 w-4"})})]}),u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:"m-path",className:"text-xs font-medium text-fg-3",children:"本地路径"}),u.jsx("input",{id:"m-path",value:t,onChange:C=>a(C.target.value),onBlur:C=>void T(C.target.value),placeholder:"/Users/you/code/repo",autoFocus:!0,className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"}),u.jsx("span",{className:"text-[11px] text-fg-5",children:f?"正在读取 Git 信息…":"输入路径后自动读取仓库信息"})]}),u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:"m-name",className:"text-xs font-medium text-fg-3",children:"名称"}),u.jsx("input",{id:"m-name",value:s,onChange:C=>l(C.target.value),placeholder:"my-project",className:"w-full rounded-lg border border-line bg-base px-3 py-2 text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("label",{htmlFor:"m-git",className:"text-xs font-medium text-fg-3",children:"Git 远程地址"}),u.jsx("input",{id:"m-git",value:o,onChange:C=>d(C.target.value),placeholder:"https://github.com/org/repo.git",className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-xs text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),h&&u.jsx("p",{className:"rounded-md bg-red-500/10 px-3 py-2 text-xs text-red-500",children:h}),u.jsxs("div",{className:"mt-1 flex items-center justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:e,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),u.jsx("button",{type:"button",onClick:S,disabled:!y,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:bg-fg-6 disabled:text-fg-4",children:"添加仓库"})]})]})]})})}function hC({repoId:e,repoName:t,onClose:a}){const[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(!0),[h,x]=v.useState(!1),[b,y]=v.useState(null);v.useEffect(()=>{Q3(e).then(S=>{l(S.content),d(S.content),m(!1)}).catch(S=>{y(S instanceof Error?S.message:String(S)),m(!1)})},[e]);const T=async()=>{x(!0),y(null);try{await X3(e,s),d(s)}catch(S){y(S instanceof Error?S.message:String(S))}x(!1)},N=s!==o;return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:a,children:u.jsxs("div",{className:"flex w-full max-w-2xl flex-col rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:S=>S.stopPropagation(),children:[u.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("h2",{className:"text-base font-semibold text-fg",children:[t," — AGENTS.md"]}),u.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"仅对此仓库生效,修改后 opencode 热加载即时生效。"})]}),u.jsx("button",{type:"button",onClick:a,className:"shrink-0 rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:u.jsx(Tt,{className:"h-4 w-4"})})]}),b&&u.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"min-w-0 break-words",children:b})]}),f?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[u.jsx(Va,{className:"h-5 w-5 fs-spin"}),u.jsx("p",{className:"text-xs",children:"加载中…"})]}):u.jsx("textarea",{value:s,onChange:S=>l(S.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
406
406
 
407
- 在此编写该仓库的 Agent 指令…`}),u.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:a,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"关闭"}),u.jsxs("button",{type:"button",onClick:()=>void T(),disabled:h||!N,className:"flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(Pc,{className:"h-3.5 w-3.5"}),h?"保存中…":"保存"]})]})]})})}function hC(){const e=qe(k=>k.repos),t=qe(k=>k.activeRepoId),a=qe(k=>k.setActiveRepo),s=qe(k=>k.removeRepo),l=qe(k=>k.loadRepos),[o,d]=v.useState(!1),[f,m]=v.useState(null),[h,x]=v.useState(null),[b,y]=v.useState(null),[T,N]=v.useState(null),[S,C]=v.useState(null),A=async(k,z)=>{x(k);try{z?await d3(k):await c3(k),await l()}catch{}x(null)},D=async k=>{y(k),N(null);try{await h3(k),await l()}catch(z){let V="拉取失败";if(z instanceof Hs)try{V=JSON.parse(z.message).error??z.message}catch{V=z.message}N(V)}y(null)};return u.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[u.jsxs("div",{className:"mx-auto max-w-4xl",children:[u.jsxs("div",{className:"mb-6 flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h1",{className:"text-lg font-semibold text-fg",children:"仓库管理"}),u.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"管理代码仓库,每个仓库对应一个独立的 Agent 运行环境"})]}),u.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex shrink-0 items-center gap-1.5 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 md:px-4",children:[u.jsx(Sr,{className:"h-4 w-4"}),u.jsx("span",{className:"hidden md:inline",children:"添加仓库"})]})]}),T&&u.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3 rounded-lg border border-red-500/30 bg-red-500/5 px-4 py-2.5 text-sm text-red-600",children:[u.jsx("span",{children:T}),u.jsx("button",{type:"button",onClick:()=>N(null),className:"shrink-0 rounded p-0.5 transition-colors hover:bg-red-500/10",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}),e.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed border-line-hard py-16 text-center",children:[u.jsx("div",{className:"rounded-full bg-elevated p-3",children:u.jsx(Sr,{className:"h-6 w-6 text-fg-4"})}),u.jsx("p",{className:"text-sm font-medium text-fg-3",children:"暂无代码仓库"}),u.jsx("p",{className:"text-xs text-fg-5",children:"添加一个本地仓库开始使用"}),u.jsx("button",{type:"button",onClick:()=>d(!0),className:"mt-2 rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"添加仓库"})]}):u.jsx(u.Fragment,{children:u.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:e.map(k=>{const z=k.id===t;return u.jsxs("div",{className:ce("rounded-xl border p-4 transition-colors",z?"border-blue-500/40 bg-blue-500/5":"border-line"),children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>a(k.id),className:"flex min-w-0 items-center gap-2 text-left",children:[z?u.jsx(fo,{className:"h-4 w-4 shrink-0 text-blue-500"}):u.jsx(Fv,{className:"h-4 w-4 shrink-0 text-fg-5"}),u.jsx("span",{className:ce("truncate font-medium",z?"text-fg":"text-fg-2"),children:k.name})]}),u.jsxs("span",{className:ce("inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",k.running?"bg-emerald-500/10 text-emerald-600":"bg-fg-6/30 text-fg-4"),children:[u.jsx("span",{className:ce("h-1.5 w-1.5 rounded-full",k.running?"bg-emerald-500":"bg-fg-5")}),k.running?"运行中":"已停止"]})]}),u.jsxs("dl",{className:"mt-3 space-y-1 font-mono text-xs text-fg-4",children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("dt",{className:"shrink-0 text-fg-5",children:"Git"}),u.jsx("dd",{className:"min-w-0 truncate",children:k.gitUrl})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("dt",{className:"shrink-0 text-fg-5",children:"路径"}),u.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx("span",{className:"truncate",children:k.localPath}),u.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(k.localPath),title:"复制路径",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:u.jsx(mc,{className:"h-3 w-3"})})]})]}),k.running&&k.port&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("dt",{className:"shrink-0 text-fg-5",children:"直连"}),u.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsxs("a",{href:`http://127.0.0.1:${k.port}`,target:"_blank",rel:"noopener noreferrer",className:"truncate text-blue-500 hover:underline",children:["127.0.0.1:",k.port]}),u.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(`http://127.0.0.1:${k.port}`),title:"复制链接",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:u.jsx(mc,{className:"h-3 w-3"})})]})]})]}),u.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>C({id:k.id,name:k.name}),className:"flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border border-line px-2.5 text-xs font-medium text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[u.jsx(ME,{className:"h-3 w-3"}),"配置"]}),u.jsx("button",{type:"button",onClick:()=>void D(k.id),disabled:b===k.id,className:"flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border border-blue-500/30 px-2.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-500/10 disabled:opacity-50",children:b===k.id?u.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):u.jsxs(u.Fragment,{children:[u.jsx(Tv,{className:"h-3 w-3"}),"拉取"]})}),u.jsx("button",{type:"button",onClick:()=>void A(k.id,k.running),disabled:h===k.id,className:ce("flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md border text-xs font-medium transition-colors disabled:opacity-50",k.running?"border-amber-500/30 text-amber-600 hover:bg-amber-500/10":"border-emerald-500/30 text-emerald-600 hover:bg-emerald-500/10"),children:h===k.id?u.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):k.running?u.jsxs(u.Fragment,{children:[u.jsx(jE,{className:"h-3 w-3 fill-current"}),"停止"]}):u.jsxs(u.Fragment,{children:[u.jsx(Bc,{className:"h-3 w-3 fill-current"}),"启动"]})}),f===k.id?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>{s(k.id),m(null)},className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-red-500/30 text-red-500 transition-colors hover:bg-red-500/10",children:u.jsx(oa,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>m(null),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:bg-elevated",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}):u.jsx("button",{type:"button",onClick:()=>m(k.id),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-500",children:u.jsx(ji,{className:"h-3.5 w-3.5"})})]})]},k.id)})})}),u.jsxs("p",{className:"mt-3 text-xs text-fg-5",children:[e.length," 个仓库"]})]}),o&&u.jsx(fC,{onClose:()=>d(!1)}),S&&u.jsx(mC,{repoId:S.id,repoName:S.name,onClose:()=>C(null)})]})}const pC=new Set(["tool","tool-use","tool_use","tool-call","tool_call","tool-result","tool_result"]),gC=new Set(["thinking","reasoning","reason"]),bC=new Set(["text","output_text","message"]);function Ah(e){var a;const t=((a=e.type)==null?void 0:a.toLowerCase())??"";return pC.has(t)||e.toolName!=null||e.tool!=null?"tool":gC.has(t)?"thinking":bC.has(t)||e.content!=null||e.text!=null?"text":"other"}function xc(e){return e.content??e.text??""}function ey(e){return e.toolName??e.tool??"tool"}function Hc(e){var t;return e.input??((t=e.state)==null?void 0:t.input)}function Ch(e){var t;return e.output??((t=e.state)==null?void 0:t.output)}function wh(e){var a,s,l;const t=(s=(a=e.state)==null?void 0:a.status)==null?void 0:s.toLowerCase();return t==="completed"||t==="done"||t==="success"?"completed":t==="error"||t==="failed"||((l=e.state)==null?void 0:l.error)!=null?"error":t==="pending"||t==="queued"?"pending":t==="running"||t==="in_progress"?"running":Ch(e)!=null?"completed":"running"}function cx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Bi(e){const t=e==null?void 0:e.toLowerCase();return t==="in_progress"||t==="in-progress"||t==="active"?"in_progress":t==="completed"||t==="done"||t==="complete"?"completed":t==="cancelled"||t==="canceled"?"cancelled":"pending"}function xC(e){return e.filter(t=>Bi(t.status)==="completed").length}function ho(e){const t=ey(e).toLowerCase();return t==="question"||t==="mcp_question"}function EC(e){const t=Hc(e);if(!t||typeof t!="object")return null;const a=t;return Array.isArray(a.questions)?a.questions:null}function Ec(e){if(!ho(e))return!1;const t=wh(e);return t==="pending"||t==="running"}const yC=/\bses_[a-zA-Z0-9]+/;function TC(e){var l;const t=Hc(e);if(t&&typeof t=="object"){const o=t;if(typeof o.task_id=="string"&&o.task_id.startsWith("ses_"))return o.task_id}const a=(l=e.state)==null?void 0:l.metadata;if(a){const o=a.session_id??a.sessionId;if(typeof o=="string"&&o.startsWith("ses_"))return o}const s=Ch(e);if(typeof s=="string"){const o=yC.exec(s);if(o)return o[0]}if(s&&typeof s=="object"){const o=s,d=o.session_id??o.sessionId??o.task_id;if(typeof d=="string"&&d.startsWith("ses_"))return d}return null}let _C=0;const Yt=zs(e=>({toasts:[],addToast:(t,a="info",s,l)=>{const o=(l==null?void 0:l.id)??`toast-${++_C}-${Date.now()}`;e(d=>d.toasts.some(f=>f.id===o)?d:{toasts:[...d.toasts,{id:o,message:t,variant:a,sessionId:s,persistent:l==null?void 0:l.persistent}]}),l!=null&&l.persistent||setTimeout(()=>{e(d=>({toasts:d.toasts.filter(f=>f.id!==o)}))},4e3)},removeToast:t=>{e(a=>({toasts:a.toasts.filter(s=>s.id!==t)}))}}));function ty(e){return`question-${e}`}function dm(e,t){const a=t.find(l=>l.id===e),s=(a==null?void 0:a.title)||e.slice(-8);Yt.getState().addToast(`${s} — 等待回复`,"warning",e,{id:ty(e),persistent:!0})}function NC(e){var t;for(const a of e)if((t=a.parts)!=null&&t.some(s=>ho(s)&&Ec(s)))return!0;return!1}const po=[],yc=[],dx=[],Ms={};function fx(e){return e.id??e.callID}function sa(){return qe.getState().activeRepoId}const Le=zs((e,t)=>({sessions:[],activeSessionId:null,messages:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},loadingSessions:!1,loadError:null,sendError:null,loadSessions:async()=>{const a=sa();if(!a){e({sessions:[],loadingSessions:!1});return}e({loadingSessions:!0,loadError:null});try{const[s,l]=await Promise.all([p3(a),tx(a).catch(()=>null)]),o={sessions:s,loadingSessions:!1};l&&(o.allSessionLinks=l),e(o)}catch(s){e({loadingSessions:!1,loadError:s instanceof Error?s.message:"Failed to load sessions"})}},createSession:async(a,s,l,o,d,f)=>{const m=sa();if(!m)return null;e({sendError:null});try{const h=await g3(m,a,s,l,o,d,f);return e(x=>({sessions:[h,...x.sessions.filter(b=>b.id!==h.id)],activeSessionId:h.id,messages:{...x.messages,[h.id]:[]}})),t().setSessionStatus(h.id,"busy"),h}catch(h){return e({sendError:h instanceof Error?h.message:"Failed to create session"}),null}},setActiveSession:async a=>{sa()&&(e({activeSessionId:a,sendError:null}),await t().refreshSessionData(a))},refreshSessionData:async a=>{const s=sa();if(!s)return;const[l,o,d,f,m]=await Promise.allSettled([S3(s,a),v3(s,a),YE(s,a),b3(s,a),ex(s,a)]);e(h=>{const x={};if(l.status==="fulfilled"&&(x.messages={...h.messages,[a]:l.value}),o.status==="fulfilled"&&(x.todos={...h.todos,[a]:o.value}),d.status==="fulfilled"&&(x.sessionStatuses={...h.sessionStatuses,[a]:d.value.type}),f.status==="fulfilled"){const b=f.value;x.sessions=h.sessions.map(y=>y.id===a?{...y,...b}:y)}return m.status==="fulfilled"&&(x.sessionLinks={...h.sessionLinks,[a]:m.value}),x}),l.status==="fulfilled"&&NC(l.value)&&dm(a,t().sessions)},refreshSessionLinks:async a=>{const s=sa();if(s)try{const[l,o]=await Promise.all([ex(s,a),tx(s).catch(()=>null)]);e(d=>{const f={sessionLinks:{...d.sessionLinks,[a]:l}};return o&&(f.allSessionLinks=o),f})}catch{}},addLink:async(a,s,l)=>{const o=sa();if(!o)return!1;try{return await A3(o,a,s,l),await t().refreshSessionLinks(a),!0}catch{return!1}},removeLink:async(a,s,l)=>{const o=sa();if(!o)return!1;try{return await C3(o,a,s,l),await t().refreshSessionLinks(a),!0}catch{return!1}},deleteSession:async a=>{const s=sa();if(s)try{await x3(s,a)}catch{}delete Ms[a],e(l=>{const{[a]:o,...d}=l.messages,{[a]:f,...m}=l.todos,{[a]:h,...x}=l.sessionStatuses,{[a]:b,...y}=l.errorReasons,{[a]:T,...N}=l.queuedMessageIds,{[a]:S,...C}=l.sessionLinks,{[a]:A,...D}=l.allSessionLinks;return{sessions:l.sessions.filter(k=>k.id!==a),messages:d,todos:m,sessionStatuses:x,errorReasons:y,queuedMessageIds:N,sessionLinks:C,allSessionLinks:D,activeSessionId:l.activeSessionId===a?null:l.activeSessionId}})},sendMessage:async(a,s)=>{const l=sa(),o=t().activeSessionId;if(!l||!o)return;const d=t().sessions.find(m=>m.id===o),f=t().sessionStatuses[o]==="busy";e({sendError:null}),f||t().setSessionStatus(o,"busy");try{await E3(l,o,a,d==null?void 0:d.agent,s),f&&(Ms[o]=(Ms[o]||0)+1)}catch(m){e({sendError:m instanceof Error?m.message:"Failed to send message"}),f||t().setSessionStatus(o,"idle")}},replyQuestion:async a=>{const s=sa(),l=t().activeSessionId;if(!(!s||!l))try{await T3(s,l,a)}catch(o){e({sendError:o instanceof Error?o.message:"Failed to reply to question"})}},rejectQuestion:async()=>{const a=sa(),s=t().activeSessionId;if(!(!a||!s))try{await _3(a,s)}catch{}},abortSession:async()=>{const a=sa(),s=t().activeSessionId;if(!(!a||!s)){try{await y3(a,s)}catch{}t().setSessionStatus(s,"idle")}},clearSessions:()=>{for(const a of Object.keys(Ms))delete Ms[a];e({sessions:[],activeSessionId:null,messages:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},loadError:null,sendError:null})},updateMessage:(a,s)=>{var l;e(o=>{const d=o.messages[a]??[],f=d.findIndex(x=>x.id===s.id);let m,h=o.queuedMessageIds;if(f>=0){const x={...d[f],...s};(!s.parts||s.parts.length===0)&&d[f].parts&&(x.parts=d[f].parts),m=[...d],m[f]=x}else{m=[...d,s];const x=Ms[a]||0;if(s.role==="user"&&x>0){const b=[...h[a]??[]];b.push(s.id),h={...h,[a]:b},Ms[a]=x-1}else if(s.role==="assistant"){const b=h[a];b&&b.length>0&&(h={...h,[a]:b.slice(1)})}}return{messages:{...o.messages,[a]:m},queuedMessageIds:h}}),(l=s.parts)!=null&&l.some(o=>ho(o)&&Ec(o))&&dm(a,t().sessions)},updateMessagePart:(a,s,l)=>{e(o=>{const d=o.messages[a]??[],f=d.findIndex(N=>N.id===s),m=f>=0?d[f]:{id:s,role:"assistant"},h=m.parts?[...m.parts]:[],x=fx(l),b=x!=null?h.findIndex(N=>fx(N)===x):-1;b>=0?h[b]={...h[b],...l}:h.push(l);const y={...m,parts:h},T=f>=0?[...d]:[...d,y];return f>=0&&(T[f]=y),{messages:{...o.messages,[a]:T}}}),ho(l)&&Ec(l)&&dm(a,t().sessions)},appendMessagePartDelta:(a,s,l,o)=>{e(d=>{const f=d.messages[a]??[],m=f.findIndex(N=>N.id===s),h=m>=0?f[m]:{id:s,role:"assistant"},x=h.parts?[...h.parts]:[],b=x.findIndex(N=>N.id===l);if(b>=0){const N=x[b],S=xc(N)+o;x[b]=N.content!=null?{...N,content:S}:{...N,text:S}}else x.push({id:l,type:"text",text:o});const y={...h,parts:x},T=m>=0?[...f]:[...f,y];return m>=0&&(T[m]=y),{messages:{...d.messages,[a]:T}}})},updateTodos:(a,s)=>{e(l=>({todos:{...l.todos,[a]:s}}))},updateSessionInfo:a=>{e(s=>s.sessions.some(o=>o.id===a.id)?{sessions:s.sessions.map(o=>o.id===a.id?{...o,...a}:o)}:{sessions:[a,...s.sessions]})},setSessionStatus:(a,s,l)=>{const o=t().sessionStatuses[a];if(o!==s){const d=t().sessions.find(m=>m.id===a),f=(d==null?void 0:d.title)||a.slice(-8);if(s==="idle"&&o!==void 0&&o!=="idle")Yt.getState().removeToast(ty(a)),Yt.getState().addToast(`${f} — 完成`,"success",a);else if(s==="busy"&&(o===void 0||o==="idle"))Yt.getState().addToast(`${f} — 开始运行`,"info",a);else if(s==="retry")Yt.getState().addToast(`${f} — 进入重试`,"warning",a);else if(s==="error"){const m=l?`${f} — 错误: ${l}`:`${f} — 发生错误`;Yt.getState().addToast(m,"error",a)}}e(d=>{const f=l?{...d.errorReasons,[a]:l}:s!=="error"?(()=>{const{[a]:m,...h}=d.errorReasons;return h})():d.errorReasons;return{sessionStatuses:{...d.sessionStatuses,[a]:s},errorReasons:f}})},bulkSetStatuses:a=>{e({sessionStatuses:{...t().sessionStatuses,...a}})},renameSession:async(a,s)=>{const l=sa();if(l){e(o=>({sessions:o.sessions.map(d=>d.id===a?{...d,title:s}:d)}));try{await G3(l,a,s)}catch{await t().loadSessions()}}}})),Ue=zs((e,t)=>({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,syncing:!1,selectedIssueId:null,previewIssueId:null,matchingParentId:null,matchingCandidateId:null,pendingDraft:null,clearIssues:()=>e({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,selectedIssueId:null,previewIssueId:null,matchingParentId:null,matchingCandidateId:null,pendingDraft:null}),setSelectedIssue:a=>e({selectedIssueId:a}),setPreviewIssue:a=>e({previewIssueId:a}),setPendingDraft:a=>e({pendingDraft:a}),enterMatchMode:a=>e({matchingParentId:a,matchingCandidateId:null,previewIssueId:null}),exitMatchMode:()=>{const a=t().matchingParentId;e({matchingParentId:null,matchingCandidateId:null,previewIssueId:a})},setMatchCandidate:a=>e({matchingCandidateId:a}),linkChild:async(a,s)=>{var o;const l=qe.getState().activeRepoId;if(!l)return!1;try{await B3(l,a,s);const d=(o=t().issues.find(f=>f.number===a))==null?void 0:o.id;return d&&e(f=>({issues:f.issues.map(m=>m.number===s?{...m,parentId:d}:m),matchingCandidateId:null})),!0}catch{return!1}},updateIssueState:async(a,s)=>{const l=qe.getState().activeRepoId;if(!l)return!1;try{const o=await QE(l,a,{state:s});return e(d=>({issues:d.issues.map(f=>f.number===a?{...f,state:o.state}:f)})),!0}catch{return!1}},loadIssues:async()=>{const a=qe.getState().activeRepoId;if(!a){e({issues:[],loaded:!0});return}try{const s=await sx(a,"all");e({issues:s,loaded:!0})}catch{e({loaded:!0})}},syncIssues:async()=>{const a=qe.getState().activeRepoId;if(a){e({syncing:!0});try{await L3(a);const[s,l,o]=await Promise.all([sx(a,"all"),ax(a),rx(a)]);e({issues:s,tags:l,milestones:o,syncing:!1})}catch(s){e({syncing:!1});let l="同步 Issue 失败";if(s instanceof Hs)try{const o=JSON.parse(s.message);o.error&&(l=o.error)}catch{s.message&&(l=s.message)}Yt.getState().addToast(l,"error")}}},createIssue:async(a,s)=>{const l=qe.getState().activeRepoId;if(!l)return null;try{const o=await j3(l,a,s);return e(d=>({issues:[o,...d.issues]})),o}catch{return null}},loadTags:async()=>{const a=qe.getState().activeRepoId;if(!a){e({tags:[]});return}try{const s=await ax(a);e({tags:s})}catch{}},cycleTagFilter:a=>{e(s=>{const l=new Map(s.tagFilterMode),o=l.get(a);return o?o==="include"?l.set(a,"exclude"):l.delete(a):l.set(a,"include"),{tagFilterMode:l}})},clearTagFilter:()=>e({tagFilterMode:new Map}),loadMilestones:async()=>{const a=qe.getState().activeRepoId;if(!a){e({milestones:[]});return}try{const s=await rx(a);e({milestones:s})}catch{}},setMilestoneFilter:a=>e({selectedMilestoneId:a})}));function mx(e){const t=[],a=String(e||"");let s=a.indexOf(","),l=0,o=!1;for(;!o;){s===-1&&(s=a.length,o=!0);const d=a.slice(l,s).trim();(d||!o)&&t.push(d),l=s+1,s=a.indexOf(",",l)}return t}function ny(e,t){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const SC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AC={};function hx(e,t){return(AC.jsx?vC:SC).test(e)}const CC=/[ \t\n\f\r]/g;function wC(e){return typeof e=="object"?e.type==="text"?px(e.value):!1:px(e)}function px(e){return e.replace(CC,"")===""}class No{constructor(t,a,s){this.normal=a,this.property=t,s&&(this.space=s)}}No.prototype.normal={};No.prototype.property={};No.prototype.space=void 0;function ay(e,t){const a={},s={};for(const l of e)Object.assign(a,l.property),Object.assign(s,l.normal);return new No(a,s,t)}function go(e){return e.toLowerCase()}class Vn{constructor(t,a){this.attribute=a,this.property=t}}Vn.prototype.attribute="";Vn.prototype.booleanish=!1;Vn.prototype.boolean=!1;Vn.prototype.commaOrSpaceSeparated=!1;Vn.prototype.commaSeparated=!1;Vn.prototype.defined=!1;Vn.prototype.mustUseProperty=!1;Vn.prototype.number=!1;Vn.prototype.overloadedBoolean=!1;Vn.prototype.property="";Vn.prototype.spaceSeparated=!1;Vn.prototype.space=void 0;let kC=0;const Ke=qs(),sn=qs(),Gm=qs(),ye=qs(),kt=qs(),Ps=qs(),ia=qs();function qs(){return 2**++kC}const Km=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:sn,commaOrSpaceSeparated:ia,commaSeparated:Ps,number:ye,overloadedBoolean:Gm,spaceSeparated:kt},Symbol.toStringTag,{value:"Module"})),fm=Object.keys(Km);class kh extends Vn{constructor(t,a,s,l){let o=-1;if(super(t,a),gx(this,"space",l),typeof s=="number")for(;++o<fm.length;){const d=fm[o];gx(this,fm[o],(s&Km[d])===Km[d])}}}kh.prototype.defined=!0;function gx(e,t,a){a&&(e[t]=a)}function $i(e){const t={},a={};for(const[s,l]of Object.entries(e.properties)){const o=new kh(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(o.mustUseProperty=!0),t[s]=o,a[go(s)]=s,a[go(o.attribute)]=s}return new No(t,a,e.space)}const ry=$i({properties:{ariaActiveDescendant:null,ariaAtomic:sn,ariaAutoComplete:null,ariaBusy:sn,ariaChecked:sn,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:kt,ariaCurrent:null,ariaDescribedBy:kt,ariaDetails:null,ariaDisabled:sn,ariaDropEffect:kt,ariaErrorMessage:null,ariaExpanded:sn,ariaFlowTo:kt,ariaGrabbed:sn,ariaHasPopup:null,ariaHidden:sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kt,ariaLevel:ye,ariaLive:null,ariaModal:sn,ariaMultiLine:sn,ariaMultiSelectable:sn,ariaOrientation:null,ariaOwns:kt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:sn,ariaReadOnly:sn,ariaRelevant:null,ariaRequired:sn,ariaRoleDescription:kt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:sn,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sy(e,t){return t in e?e[t]:t}function iy(e,t){return sy(e,t.toLowerCase())}const RC=$i({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ps,acceptCharset:kt,accessKey:kt,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alpha:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:kt,autoFocus:Ke,autoPlay:Ke,blocking:kt,capture:null,charSet:null,checked:Ke,cite:null,className:kt,closedBy:null,colorSpace:null,cols:ye,colSpan:ye,command:null,commandFor:null,content:null,contentEditable:sn,controls:Ke,controlsList:kt,coords:ye|Ps,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:Gm,draggable:sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:kt,height:ye,hidden:Gm,high:ye,href:null,hrefLang:null,htmlFor:kt,httpEquiv:kt,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:kt,itemRef:kt,itemScope:Ke,itemType:kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,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:Ke,optimum:ye,pattern:null,ping:kt,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:kt,required:Ke,reversed:Ke,rows:ye,rowSpan:ye,sandbox:kt,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootCustomElementRegistry:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shadowRootSerializable:Ke,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:sn,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:sn,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ke,disablePictureInPicture:Ke,disableRemotePlayback:Ke,exportParts:Ps,part:kt,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:iy}),OC=$i({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ia,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:kt,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:Ps,g2:Ps,glyphName:Ps,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:ia,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ia,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ia,rev:ia,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ia,requiredFeatures:ia,requiredFonts:ia,requiredFormats:ia,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:ia,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ia,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ia,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sy}),ly=$i({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),oy=$i({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:iy}),uy=$i({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),IC={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"},MC=/[A-Z]/g,bx=/-[a-z]/g,DC=/^data[-\w.:]+$/i;function Fc(e,t){const a=go(t);let s=t,l=Vn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&DC.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(bx,jC);s="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!bx.test(o)){let d=o.replace(MC,LC);d.charAt(0)!=="-"&&(d="-"+d),t="data"+d}}l=kh}return new l(s,t)}function LC(e){return"-"+e.toLowerCase()}function jC(e){return e.charAt(1).toUpperCase()}const So=ay([ry,RC,ly,oy,uy],"html"),cs=ay([ry,OC,ly,oy,uy],"svg");function xx(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function cy(e){return e.join(" ").trim()}var Ri={},mm,Ex;function BC(){if(Ex)return mm;Ex=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,a=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
408
- `,h="/",x="*",b="",y="comment",T="declaration";function N(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var D=1,k=1;function z(Z){var ee=Z.match(t);ee&&(D+=ee.length);var Q=Z.lastIndexOf(m);k=~Q?Z.length-Q:k+Z.length}function V(){var Z={line:D,column:k};return function(ee){return ee.position=new M(Z),se(),ee}}function M(Z){this.start=Z,this.end={line:D,column:k},this.source=A.source}M.prototype.content=C;function L(Z){var ee=new Error(A.source+":"+D+":"+k+": "+Z);if(ee.reason=Z,ee.filename=A.source,ee.line=D,ee.column=k,ee.source=C,!A.silent)throw ee}function K(Z){var ee=Z.exec(C);if(ee){var Q=ee[0];return z(Q),C=C.slice(Q.length),ee}}function se(){K(a)}function B(Z){var ee;for(Z=Z||[];ee=U();)ee!==!1&&Z.push(ee);return Z}function U(){var Z=V();if(!(h!=C.charAt(0)||x!=C.charAt(1))){for(var ee=2;b!=C.charAt(ee)&&(x!=C.charAt(ee)||h!=C.charAt(ee+1));)++ee;if(ee+=2,b===C.charAt(ee-1))return L("End of comment missing");var Q=C.slice(2,ee-2);return k+=2,z(Q),C=C.slice(ee),k+=2,Z({type:y,comment:Q})}}function te(){var Z=V(),ee=K(s);if(ee){if(U(),!K(l))return L("property missing ':'");var Q=K(o),$=Z({type:T,property:S(ee[0].replace(e,b)),value:Q?S(Q[0].replace(e,b)):b});return K(d),$}}function ie(){var Z=[];B(Z);for(var ee;ee=te();)ee!==!1&&(Z.push(ee),B(Z));return Z}return se(),ie()}function S(C){return C?C.replace(f,b):b}return mm=N,mm}var yx;function PC(){if(yx)return Ri;yx=1;var e=Ri&&Ri.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.default=a;const t=e(BC());function a(s,l){let o=null;if(!s||typeof s!="string")return o;const d=(0,t.default)(s),f=typeof l=="function";return d.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:x}=m;f?l(h,x,m):x&&(o=o||{},o[h]=x)}),o}return Ri}var Gl={},Tx;function UC(){if(Tx)return Gl;Tx=1,Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,a=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||a.test(h)||e.test(h)},d=function(h,x){return x.toUpperCase()},f=function(h,x){return"".concat(x,"-")},m=function(h,x){return x===void 0&&(x={}),o(h)?h:(h=h.toLowerCase(),x.reactCompat?h=h.replace(l,f):h=h.replace(s,f),h.replace(t,d))};return Gl.camelCase=m,Gl}var Kl,_x;function HC(){if(_x)return Kl;_x=1;var e=Kl&&Kl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(PC()),a=UC();function s(l,o){var d={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(d[(0,a.camelCase)(f,o)]=m)}),d}return s.default=s,Kl=s,Kl}var FC=HC();const zC=Rc(FC),zc=dy("end"),Xa=dy("start");function dy(e){return t;function t(a){const s=a&&a.position&&a.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function qC(e){const t=Xa(e),a=zc(e);if(t&&a)return{start:t,end:a}}function to(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nx(e.position):"start"in e||"end"in e?Nx(e):"line"in e||"column"in e?Vm(e):""}function Vm(e){return Sx(e&&e.line)+":"+Sx(e&&e.column)}function Nx(e){return Vm(e&&e.start)+"-"+Vm(e&&e.end)}function Sx(e){return e&&typeof e=="number"?e:1}class vn extends Error{constructor(t,a,s){super(),typeof a=="string"&&(s=a,a=void 0);let l="",o={},d=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?l=t:!o.cause&&t&&(d=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof s=="string"){const m=s.indexOf(":");m===-1?o.ruleId=s:(o.source=s.slice(0,m),o.ruleId=s.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=to(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=d&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vn.prototype.file="";vn.prototype.name="";vn.prototype.reason="";vn.prototype.message="";vn.prototype.stack="";vn.prototype.column=void 0;vn.prototype.line=void 0;vn.prototype.ancestors=void 0;vn.prototype.cause=void 0;vn.prototype.fatal=void 0;vn.prototype.place=void 0;vn.prototype.ruleId=void 0;vn.prototype.source=void 0;const Rh={}.hasOwnProperty,YC=new Map,$C=/[A-Z]/g,GC=new Set(["table","tbody","thead","tfoot","tr"]),KC=new Set(["td","th"]),fy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=nw(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=tw(a,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?cs:So,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=my(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function my(e,t,a){if(t.type==="element")return QC(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return XC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return WC(e,t,a);if(t.type==="mdxjsEsm")return ZC(e,t);if(t.type==="root")return JC(e,t,a);if(t.type==="text")return ew(e,t)}function QC(e,t,a){const s=e.schema;let l=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=cs,e.schema=l),e.ancestors.push(t);const o=py(e,t.tagName,!1),d=aw(e,t);let f=Ih(e,t);return GC.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!wC(m):!0})),hy(e,d,o,t),Oh(d,f),e.ancestors.pop(),e.schema=s,e.create(t,o,d,a)}function XC(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}bo(e,t.position)}function ZC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bo(e,t.position)}function WC(e,t,a){const s=e.schema;let l=s;t.name==="svg"&&s.space==="html"&&(l=cs,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:py(e,t.name,!0),d=rw(e,t),f=Ih(e,t);return hy(e,d,o,t),Oh(d,f),e.ancestors.pop(),e.schema=s,e.create(t,o,d,a)}function JC(e,t,a){const s={};return Oh(s,Ih(e,t)),e.create(t,e.Fragment,s,a)}function ew(e,t){return t.value}function hy(e,t,a,s){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=s)}function Oh(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function tw(e,t,a){return s;function s(l,o,d,f){const h=Array.isArray(d.children)?a:t;return f?h(o,d,f):h(o,d)}}function nw(e,t){return a;function a(s,l,o,d){const f=Array.isArray(o.children),m=Xa(s);return t(l,o,d,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function aw(e,t){const a={};let s,l;for(l in t.properties)if(l!=="children"&&Rh.call(t.properties,l)){const o=sw(e,l,t.properties[l]);if(o){const[d,f]=o;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&KC.has(t.tagName)?s=f:a[d]=f}}if(s){const o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return a}function rw(e,t){const a={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const o=s.data.estree.body[0];o.type;const d=o.expression;d.type;const f=d.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else bo(e,t.position);else{const l=s.name;let o;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const f=s.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else bo(e,t.position);else o=s.value===null?!0:s.value;a[l]=o}return a}function Ih(e,t){const a=[];let s=-1;const l=e.passKeys?new Map:YC;for(;++s<t.children.length;){const o=t.children[s];let d;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;d=m+"-"+h,l.set(m,h+1)}}const f=my(e,o,d);f!==void 0&&a.push(f)}return a}function sw(e,t,a){const s=Fc(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=s.commaSeparated?ny(a):cy(a)),s.property==="style"){let l=typeof a=="object"?a:iw(e,String(a));return e.stylePropertyNameCase==="css"&&(l=lw(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?IC[s.property]||s.property:s.attribute,a]}}function iw(e,t){try{return zC(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const s=a,l=new vn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=fy+"#cannot-parse-style-attribute",l}}function py(e,t,a){let s;if(!a)s={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,d;for(;++o<l.length;){const f=hx(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}s=d}else s=hx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const l=s.value;return Rh.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);bo(e)}function bo(e,t){const a=new vn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=fy+"#cannot-handle-mdx-estrees-without-createevaluater",a}function lw(e){const t={};let a;for(a in e)Rh.call(e,a)&&(t[ow(a)]=e[a]);return t}function ow(e){let t=e.replace($C,uw);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function uw(e){return"-"+e.toLowerCase()}const hm={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"]},cw={};function Mh(e,t){const a=cw,s=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,l=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return gy(e,s,l)}function gy(e,t,a){if(dw(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return vx(e.children,t,a)}return Array.isArray(e)?vx(e,t,a):""}function vx(e,t,a){const s=[];let l=-1;for(;++l<e.length;)s[l]=gy(e[l],t,a);return s.join("")}function dw(e){return!!(e&&typeof e=="object")}const Ax=document.createElement("i");function Dh(e){const t="&"+e+";";Ax.innerHTML=t;const a=Ax.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function la(e,t,a,s){const l=e.length;let o=0,d;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,a=a>0?a:0,s.length<1e4)d=Array.from(s),d.unshift(t,a),e.splice(...d);else for(a&&e.splice(t,a);o<s.length;)d=s.slice(o,o+1e4),d.unshift(t,0),e.splice(...d),o+=1e4,t+=1e4}function _a(e,t){return e.length>0?(la(e,e.length,0,t),e):t}const Cx={}.hasOwnProperty;function by(e){const t={};let a=-1;for(;++a<e.length;)fw(t,e[a]);return t}function fw(e,t){let a;for(a in t){const l=(Cx.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a];let d;if(o)for(d in o){Cx.call(l,d)||(l[d]=[]);const f=o[d];mw(l[d],Array.isArray(f)?f:f?[f]:[])}}}function mw(e,t){let a=-1;const s=[];for(;++a<t.length;)(t[a].add==="after"?e:s).push(t[a]);la(e,0,0,s)}function xy(e,t){const a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ia(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const In=ds(/[A-Za-z]/),Sn=ds(/[\dA-Za-z]/),hw=ds(/[#-'*+\--9=?A-Z^-~]/);function Tc(e){return e!==null&&(e<32||e===127)}const Qm=ds(/\d/),pw=ds(/[\dA-Fa-f]/),gw=ds(/[!-/:-@[-`{-~]/);function He(e){return e!==null&&e<-2}function Rt(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const qc=ds(new RegExp("\\p{P}|\\p{S}","u")),Fs=ds(/\s/);function ds(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Gi(e){const t=[];let a=-1,s=0,l=0;for(;++a<e.length;){const o=e.charCodeAt(a);let d="";if(o===37&&Sn(e.charCodeAt(a+1))&&Sn(e.charCodeAt(a+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(d=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(a+1);o<56320&&f>56319&&f<57344?(d=String.fromCharCode(o,f),l=1):d="�"}else d=String.fromCharCode(o);d&&(t.push(e.slice(s,a),encodeURIComponent(d)),s=a+l+1,d=""),l&&(a+=l,l=0)}return t.join("")+e.slice(s)}function ct(e,t,a,s){const l=s?s-1:Number.POSITIVE_INFINITY;let o=0;return d;function d(m){return rt(m)?(e.enter(a),f(m)):t(m)}function f(m){return rt(m)&&o++<l?(e.consume(m),f):(e.exit(a),t(m))}}const bw={tokenize:xw};function xw(e){const t=e.attempt(this.parser.constructs.contentInitial,s,l);let a;return t;function s(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ct(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=m),a=m,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return He(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),d)}}const Ew={tokenize:yw},wx={tokenize:Tw};function yw(e){const t=this,a=[];let s=0,l,o,d;return f;function f(k){if(s<a.length){const z=a[s];return t.containerState=z[1],e.attempt(z[0].continuation,m,h)(k)}return h(k)}function m(k){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&D();const z=t.events.length;let V=z,M;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){M=t.events[V][1].end;break}A(s);let L=z;for(;L<t.events.length;)t.events[L][1].end={...M},L++;return la(t.events,V+1,0,t.events.slice(z)),t.events.length=L,h(k)}return f(k)}function h(k){if(s===a.length){if(!l)return y(k);if(l.currentConstruct&&l.currentConstruct.concrete)return N(k);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wx,x,b)(k)}function x(k){return l&&D(),A(s),y(k)}function b(k){return t.parser.lazy[t.now().line]=s!==a.length,d=t.now().offset,N(k)}function y(k){return t.containerState={},e.attempt(wx,T,N)(k)}function T(k){return s++,a.push([t.currentConstruct,t.containerState]),y(k)}function N(k){if(k===null){l&&D(),A(0),e.consume(k);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),S(k)}function S(k){if(k===null){C(e.exit("chunkFlow"),!0),A(0),e.consume(k);return}return He(k)?(e.consume(k),C(e.exit("chunkFlow")),s=0,t.interrupt=void 0,f):(e.consume(k),S)}function C(k,z){const V=t.sliceStream(k);if(z&&V.push(null),k.previous=o,o&&(o.next=k),o=k,l.defineSkip(k.start),l.write(V),t.parser.lazy[k.start.line]){let M=l.events.length;for(;M--;)if(l.events[M][1].start.offset<d&&(!l.events[M][1].end||l.events[M][1].end.offset>d))return;const L=t.events.length;let K=L,se,B;for(;K--;)if(t.events[K][0]==="exit"&&t.events[K][1].type==="chunkFlow"){if(se){B=t.events[K][1].end;break}se=!0}for(A(s),M=L;M<t.events.length;)t.events[M][1].end={...B},M++;la(t.events,K+1,0,t.events.slice(L)),t.events.length=M}}function A(k){let z=a.length;for(;z-- >k;){const V=a[z];t.containerState=V[1],V[0].exit.call(t,e)}a.length=k}function D(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function Tw(e,t,a){return ct(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pi(e){if(e===null||Rt(e)||Fs(e))return 1;if(qc(e))return 2}function Yc(e,t,a){const s=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!s.includes(o)&&(t=o(t,a),s.push(o))}return t}const Xm={name:"attention",resolveAll:_w,tokenize:Nw};function _w(e,t){let a=-1,s,l,o,d,f,m,h,x;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(s=a;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[s][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;m=e[s][1].end.offset-e[s][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const b={...e[s][1].end},y={...e[a][1].start};kx(b,-m),kx(y,m),d={type:m>1?"strongSequence":"emphasisSequence",start:b,end:{...e[s][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:y},o={type:m>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[a][1].start}},l={type:m>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[s][1].end={...d.start},e[a][1].start={...f.end},h=[],e[s][1].end.offset-e[s][1].start.offset&&(h=_a(h,[["enter",e[s][1],t],["exit",e[s][1],t]])),h=_a(h,[["enter",l,t],["enter",d,t],["exit",d,t],["enter",o,t]]),h=_a(h,Yc(t.parser.constructs.insideSpan.null,e.slice(s+1,a),t)),h=_a(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[a][1].end.offset-e[a][1].start.offset?(x=2,h=_a(h,[["enter",e[a][1],t],["exit",e[a][1],t]])):x=0,la(e,s-1,a-s+3,h),a=s+h.length-x-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function Nw(e,t){const a=this.parser.constructs.attentionMarkers.null,s=this.previous,l=Pi(s);let o;return d;function d(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),x=Pi(m),b=!x||x===2&&l||a.includes(m),y=!l||l===2&&x||a.includes(s);return h._open=!!(o===42?b:b&&(l||!y)),h._close=!!(o===42?y:y&&(x||!b)),t(m)}}function kx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Sw={name:"autolink",tokenize:vw};function vw(e,t,a){let s=0;return l;function l(T){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(T),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(T){return In(T)?(e.consume(T),d):T===64?a(T):h(T)}function d(T){return T===43||T===45||T===46||Sn(T)?(s=1,f(T)):h(T)}function f(T){return T===58?(e.consume(T),s=0,m):(T===43||T===45||T===46||Sn(T))&&s++<32?(e.consume(T),f):(s=0,h(T))}function m(T){return T===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(T),e.exit("autolinkMarker"),e.exit("autolink"),t):T===null||T===32||T===60||Tc(T)?a(T):(e.consume(T),m)}function h(T){return T===64?(e.consume(T),x):hw(T)?(e.consume(T),h):a(T)}function x(T){return Sn(T)?b(T):a(T)}function b(T){return T===46?(e.consume(T),s=0,x):T===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(T),e.exit("autolinkMarker"),e.exit("autolink"),t):y(T)}function y(T){if((T===45||Sn(T))&&s++<63){const N=T===45?y:b;return e.consume(T),N}return a(T)}}const vo={partial:!0,tokenize:Aw};function Aw(e,t,a){return s;function s(o){return rt(o)?ct(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||He(o)?t(o):a(o)}}const Ey={continuation:{tokenize:ww},exit:kw,name:"blockQuote",tokenize:Cw};function Cw(e,t,a){const s=this;return l;function l(d){if(d===62){const f=s.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),o}return a(d)}function o(d){return rt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(d))}}function ww(e,t,a){const s=this;return l;function l(d){return rt(d)?ct(e,o,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):o(d)}function o(d){return e.attempt(Ey,t,a)(d)}}function kw(e){e.exit("blockQuote")}const yy={name:"characterEscape",tokenize:Rw};function Rw(e,t,a){return s;function s(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return gw(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}const Ty={name:"characterReference",tokenize:Ow};function Ow(e,t,a){const s=this;let l=0,o,d;return f;function f(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),m}function m(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,d=Sn,x(b))}function h(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,d=pw,x):(e.enter("characterReferenceValue"),o=7,d=Qm,x(b))}function x(b){if(b===59&&l){const y=e.exit("characterReferenceValue");return d===Sn&&!Dh(s.sliceSerialize(y))?a(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return d(b)&&l++<o?(e.consume(b),x):a(b)}}const Rx={partial:!0,tokenize:Mw},Ox={concrete:!0,name:"codeFenced",tokenize:Iw};function Iw(e,t,a){const s=this,l={partial:!0,tokenize:V};let o=0,d=0,f;return m;function m(M){return h(M)}function h(M){const L=s.events[s.events.length-1];return o=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,f=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),x(M)}function x(M){return M===f?(d++,e.consume(M),x):d<3?a(M):(e.exit("codeFencedFenceSequence"),rt(M)?ct(e,b,"whitespace")(M):b(M))}function b(M){return M===null||He(M)?(e.exit("codeFencedFence"),s.interrupt?t(M):e.check(Rx,S,z)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===null||He(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(M)):rt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ct(e,T,"whitespace")(M)):M===96&&M===f?a(M):(e.consume(M),y)}function T(M){return M===null||He(M)?b(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),N(M))}function N(M){return M===null||He(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(M)):M===96&&M===f?a(M):(e.consume(M),N)}function S(M){return e.attempt(l,z,C)(M)}function C(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),A}function A(M){return o>0&&rt(M)?ct(e,D,"linePrefix",o+1)(M):D(M)}function D(M){return M===null||He(M)?e.check(Rx,S,z)(M):(e.enter("codeFlowValue"),k(M))}function k(M){return M===null||He(M)?(e.exit("codeFlowValue"),D(M)):(e.consume(M),k)}function z(M){return e.exit("codeFenced"),t(M)}function V(M,L,K){let se=0;return B;function B(ee){return M.enter("lineEnding"),M.consume(ee),M.exit("lineEnding"),U}function U(ee){return M.enter("codeFencedFence"),rt(ee)?ct(M,te,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):te(ee)}function te(ee){return ee===f?(M.enter("codeFencedFenceSequence"),ie(ee)):K(ee)}function ie(ee){return ee===f?(se++,M.consume(ee),ie):se>=d?(M.exit("codeFencedFenceSequence"),rt(ee)?ct(M,Z,"whitespace")(ee):Z(ee)):K(ee)}function Z(ee){return ee===null||He(ee)?(M.exit("codeFencedFence"),L(ee)):K(ee)}}}function Mw(e,t,a){const s=this;return l;function l(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o)}function o(d){return s.parser.lazy[s.now().line]?a(d):t(d)}}const pm={name:"codeIndented",tokenize:Lw},Dw={partial:!0,tokenize:jw};function Lw(e,t,a){const s=this;return l;function l(h){return e.enter("codeIndented"),ct(e,o,"linePrefix",5)(h)}function o(h){const x=s.events[s.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?d(h):a(h)}function d(h){return h===null?m(h):He(h)?e.attempt(Dw,d,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||He(h)?(e.exit("codeFlowValue"),d(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function jw(e,t,a){const s=this;return l;function l(d){return s.parser.lazy[s.now().line]?a(d):He(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):ct(e,o,"linePrefix",5)(d)}function o(d){const f=s.events[s.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(d):He(d)?l(d):a(d)}}const Bw={name:"codeText",previous:Uw,resolve:Pw,tokenize:Hw};function Pw(e){let t=e.length-4,a=3,s,l;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=a;++s<t;)if(e[s][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(s=a-1,t++;++s<=t;)l===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(l=s):(s===t||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),t-=s-l-2,s=l+2),l=void 0);return e}function Uw(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Hw(e,t,a){let s=0,l,o;return d;function d(b){return e.enter("codeText"),e.enter("codeTextSequence"),f(b)}function f(b){return b===96?(e.consume(b),s++,f):(e.exit("codeTextSequence"),m(b))}function m(b){return b===null?a(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),m):b===96?(o=e.enter("codeTextSequence"),l=0,x(b)):He(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(b))}function h(b){return b===null||b===32||b===96||He(b)?(e.exit("codeTextData"),m(b)):(e.consume(b),h)}function x(b){return b===96?(e.consume(b),l++,x):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(b)):(o.type="codeTextData",h(b))}}class Fw{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){const s=a??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,a,s){const l=a||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&Vl(this.left,s),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Vl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const a=this.left.splice(t,Number.POSITIVE_INFINITY);Vl(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Vl(this.left,a.reverse())}}}function Vl(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function _y(e){const t={};let a=-1,s,l,o,d,f,m,h;const x=new Fw(e);for(;++a<x.length;){for(;a in t;)a=t[a];if(s=x.get(a),a&&s[1].type==="chunkFlow"&&x.get(a-1)[1].type==="listItemPrefix"&&(m=s[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,zw(x,a)),a=t[a],h=!0);else if(s[1]._container){for(o=a,l=void 0;o--;)if(d=x.get(o),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(l&&(x.get(l)[1].type="lineEndingBlank"),d[1].type="lineEnding",l=o);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;l&&(s[1].end={...x.get(l)[1].start},f=x.slice(l,a),f.unshift(s),x.splice(l,a-l+1,f))}}return la(e,0,Number.POSITIVE_INFINITY,x.slice(0)),!h}function zw(e,t){const a=e.get(t)[1],s=e.get(t)[2];let l=t-1;const o=[];let d=a._tokenizer;d||(d=s.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,m=[],h={};let x,b,y=-1,T=a,N=0,S=0;const C=[S];for(;T;){for(;e.get(++l)[1]!==T;);o.push(l),T._tokenizer||(x=s.sliceStream(T),T.next||x.push(null),b&&d.defineSkip(T.start),T._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(x),T._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),b=T,T=T.next}for(T=a;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(S=y+1,C.push(S),T._tokenizer=void 0,T.previous=void 0,T=T.next);for(d.events=[],T?(T._tokenizer=void 0,T.previous=void 0):C.pop(),y=C.length;y--;){const A=f.slice(C[y],C[y+1]),D=o.pop();m.push([D,D+A.length-1]),e.splice(D,2,A)}for(m.reverse(),y=-1;++y<m.length;)h[N+m[y][0]]=N+m[y][1],N+=m[y][1]-m[y][0]-1;return h}const qw={resolve:$w,tokenize:Gw},Yw={partial:!0,tokenize:Kw};function $w(e){return _y(e),e}function Gw(e,t){let a;return s;function s(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):He(f)?e.check(Yw,d,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function d(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,l}}function Kw(e,t,a){const s=this;return l;function l(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ct(e,o,"linePrefix")}function o(d){if(d===null||He(d))return a(d);const f=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(d):e.interrupt(s.parser.constructs.flow,a,t)(d)}}function Ny(e,t,a,s,l,o,d,f,m){const h=m||Number.POSITIVE_INFINITY;let x=0;return b;function b(A){return A===60?(e.enter(s),e.enter(l),e.enter(o),e.consume(A),e.exit(o),y):A===null||A===32||A===41||Tc(A)?a(A):(e.enter(s),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(A))}function y(A){return A===62?(e.enter(o),e.consume(A),e.exit(o),e.exit(l),e.exit(s),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),T(A))}function T(A){return A===62?(e.exit("chunkString"),e.exit(f),y(A)):A===null||A===60||He(A)?a(A):(e.consume(A),A===92?N:T)}function N(A){return A===60||A===62||A===92?(e.consume(A),T):T(A)}function S(A){return!x&&(A===null||A===41||Rt(A))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(s),t(A)):x<h&&A===40?(e.consume(A),x++,S):A===41?(e.consume(A),x--,S):A===null||A===32||A===40||Tc(A)?a(A):(e.consume(A),A===92?C:S)}function C(A){return A===40||A===41||A===92?(e.consume(A),S):S(A)}}function Sy(e,t,a,s,l,o){const d=this;let f=0,m;return h;function h(T){return e.enter(s),e.enter(l),e.consume(T),e.exit(l),e.enter(o),x}function x(T){return f>999||T===null||T===91||T===93&&!m||T===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?a(T):T===93?(e.exit(o),e.enter(l),e.consume(T),e.exit(l),e.exit(s),t):He(T)?(e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),x):(e.enter("chunkString",{contentType:"string"}),b(T))}function b(T){return T===null||T===91||T===93||He(T)||f++>999?(e.exit("chunkString"),x(T)):(e.consume(T),m||(m=!rt(T)),T===92?y:b)}function y(T){return T===91||T===92||T===93?(e.consume(T),f++,b):b(T)}}function vy(e,t,a,s,l,o){let d;return f;function f(y){return y===34||y===39||y===40?(e.enter(s),e.enter(l),e.consume(y),e.exit(l),d=y===40?41:y,m):a(y)}function m(y){return y===d?(e.enter(l),e.consume(y),e.exit(l),e.exit(s),t):(e.enter(o),h(y))}function h(y){return y===d?(e.exit(o),m(d)):y===null?a(y):He(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),ct(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),x(y))}function x(y){return y===d||y===null||He(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?b:x)}function b(y){return y===d||y===92?(e.consume(y),x):x(y)}}function no(e,t){let a;return s;function s(l){return He(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a=!0,s):rt(l)?ct(e,s,a?"linePrefix":"lineSuffix")(l):t(l)}}const Vw={name:"definition",tokenize:Xw},Qw={partial:!0,tokenize:Zw};function Xw(e,t,a){const s=this;let l;return o;function o(T){return e.enter("definition"),d(T)}function d(T){return Sy.call(s,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(T)}function f(T){return l=Ia(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),T===58?(e.enter("definitionMarker"),e.consume(T),e.exit("definitionMarker"),m):a(T)}function m(T){return Rt(T)?no(e,h)(T):h(T)}function h(T){return Ny(e,x,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(T)}function x(T){return e.attempt(Qw,b,b)(T)}function b(T){return rt(T)?ct(e,y,"whitespace")(T):y(T)}function y(T){return T===null||He(T)?(e.exit("definition"),s.parser.defined.push(l),t(T)):a(T)}}function Zw(e,t,a){return s;function s(f){return Rt(f)?no(e,l)(f):a(f)}function l(f){return vy(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return rt(f)?ct(e,d,"whitespace")(f):d(f)}function d(f){return f===null||He(f)?t(f):a(f)}}const Ww={name:"hardBreakEscape",tokenize:Jw};function Jw(e,t,a){return s;function s(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return He(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}const e5={name:"headingAtx",resolve:t5,tokenize:n5};function t5(e,t){let a=e.length-2,s=3,l,o;return e[s][1].type==="whitespace"&&(s+=2),a-2>s&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(s===a-1||a-4>s&&e[a-2][1].type==="whitespace")&&(a-=s+1===a?2:4),a>s&&(l={type:"atxHeadingText",start:e[s][1].start,end:e[a][1].end},o={type:"chunkText",start:e[s][1].start,end:e[a][1].end,contentType:"text"},la(e,s,a-s+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function n5(e,t,a){let s=0;return l;function l(x){return e.enter("atxHeading"),o(x)}function o(x){return e.enter("atxHeadingSequence"),d(x)}function d(x){return x===35&&s++<6?(e.consume(x),d):x===null||Rt(x)?(e.exit("atxHeadingSequence"),f(x)):a(x)}function f(x){return x===35?(e.enter("atxHeadingSequence"),m(x)):x===null||He(x)?(e.exit("atxHeading"),t(x)):rt(x)?ct(e,f,"whitespace")(x):(e.enter("atxHeadingText"),h(x))}function m(x){return x===35?(e.consume(x),m):(e.exit("atxHeadingSequence"),f(x))}function h(x){return x===null||x===35||Rt(x)?(e.exit("atxHeadingText"),f(x)):(e.consume(x),h)}}const a5=["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"],Ix=["pre","script","style","textarea"],r5={concrete:!0,name:"htmlFlow",resolveTo:l5,tokenize:o5},s5={partial:!0,tokenize:c5},i5={partial:!0,tokenize:u5};function l5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function o5(e,t,a){const s=this;let l,o,d,f,m;return h;function h(O){return x(O)}function x(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),b}function b(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),o=!0,S):O===63?(e.consume(O),l=3,s.interrupt?t:P):In(O)?(e.consume(O),d=String.fromCharCode(O),C):a(O)}function y(O){return O===45?(e.consume(O),l=2,T):O===91?(e.consume(O),l=5,f=0,N):In(O)?(e.consume(O),l=4,s.interrupt?t:P):a(O)}function T(O){return O===45?(e.consume(O),s.interrupt?t:P):a(O)}function N(O){const ge="CDATA[";return O===ge.charCodeAt(f++)?(e.consume(O),f===ge.length?s.interrupt?t:te:N):a(O)}function S(O){return In(O)?(e.consume(O),d=String.fromCharCode(O),C):a(O)}function C(O){if(O===null||O===47||O===62||Rt(O)){const ge=O===47,ve=d.toLowerCase();return!ge&&!o&&Ix.includes(ve)?(l=1,s.interrupt?t(O):te(O)):a5.includes(d.toLowerCase())?(l=6,ge?(e.consume(O),A):s.interrupt?t(O):te(O)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?a(O):o?D(O):k(O))}return O===45||Sn(O)?(e.consume(O),d+=String.fromCharCode(O),C):a(O)}function A(O){return O===62?(e.consume(O),s.interrupt?t:te):a(O)}function D(O){return rt(O)?(e.consume(O),D):B(O)}function k(O){return O===47?(e.consume(O),B):O===58||O===95||In(O)?(e.consume(O),z):rt(O)?(e.consume(O),k):B(O)}function z(O){return O===45||O===46||O===58||O===95||Sn(O)?(e.consume(O),z):V(O)}function V(O){return O===61?(e.consume(O),M):rt(O)?(e.consume(O),V):k(O)}function M(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),m=O,L):rt(O)?(e.consume(O),M):K(O)}function L(O){return O===m?(e.consume(O),m=null,se):O===null||He(O)?a(O):(e.consume(O),L)}function K(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Rt(O)?V(O):(e.consume(O),K)}function se(O){return O===47||O===62||rt(O)?k(O):a(O)}function B(O){return O===62?(e.consume(O),U):a(O)}function U(O){return O===null||He(O)?te(O):rt(O)?(e.consume(O),U):a(O)}function te(O){return O===45&&l===2?(e.consume(O),Q):O===60&&l===1?(e.consume(O),$):O===62&&l===4?(e.consume(O),R):O===63&&l===3?(e.consume(O),P):O===93&&l===5?(e.consume(O),ke):He(O)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(s5,W,ie)(O)):O===null||He(O)?(e.exit("htmlFlowData"),ie(O)):(e.consume(O),te)}function ie(O){return e.check(i5,Z,W)(O)}function Z(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ee}function ee(O){return O===null||He(O)?ie(O):(e.enter("htmlFlowData"),te(O))}function Q(O){return O===45?(e.consume(O),P):te(O)}function $(O){return O===47?(e.consume(O),d="",pe):te(O)}function pe(O){if(O===62){const ge=d.toLowerCase();return Ix.includes(ge)?(e.consume(O),R):te(O)}return In(O)&&d.length<8?(e.consume(O),d+=String.fromCharCode(O),pe):te(O)}function ke(O){return O===93?(e.consume(O),P):te(O)}function P(O){return O===62?(e.consume(O),R):O===45&&l===2?(e.consume(O),P):te(O)}function R(O){return O===null||He(O)?(e.exit("htmlFlowData"),W(O)):(e.consume(O),R)}function W(O){return e.exit("htmlFlow"),t(O)}}function u5(e,t,a){const s=this;return l;function l(d){return He(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):a(d)}function o(d){return s.parser.lazy[s.now().line]?a(d):t(d)}}function c5(e,t,a){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(vo,t,a)}}const d5={name:"htmlText",tokenize:f5};function f5(e,t,a){const s=this;let l,o,d;return f;function f(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),m}function m(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),V):P===63?(e.consume(P),k):In(P)?(e.consume(P),K):a(P)}function h(P){return P===45?(e.consume(P),x):P===91?(e.consume(P),o=0,N):In(P)?(e.consume(P),D):a(P)}function x(P){return P===45?(e.consume(P),T):a(P)}function b(P){return P===null?a(P):P===45?(e.consume(P),y):He(P)?(d=b,$(P)):(e.consume(P),b)}function y(P){return P===45?(e.consume(P),T):b(P)}function T(P){return P===62?Q(P):P===45?y(P):b(P)}function N(P){const R="CDATA[";return P===R.charCodeAt(o++)?(e.consume(P),o===R.length?S:N):a(P)}function S(P){return P===null?a(P):P===93?(e.consume(P),C):He(P)?(d=S,$(P)):(e.consume(P),S)}function C(P){return P===93?(e.consume(P),A):S(P)}function A(P){return P===62?Q(P):P===93?(e.consume(P),A):S(P)}function D(P){return P===null||P===62?Q(P):He(P)?(d=D,$(P)):(e.consume(P),D)}function k(P){return P===null?a(P):P===63?(e.consume(P),z):He(P)?(d=k,$(P)):(e.consume(P),k)}function z(P){return P===62?Q(P):k(P)}function V(P){return In(P)?(e.consume(P),M):a(P)}function M(P){return P===45||Sn(P)?(e.consume(P),M):L(P)}function L(P){return He(P)?(d=L,$(P)):rt(P)?(e.consume(P),L):Q(P)}function K(P){return P===45||Sn(P)?(e.consume(P),K):P===47||P===62||Rt(P)?se(P):a(P)}function se(P){return P===47?(e.consume(P),Q):P===58||P===95||In(P)?(e.consume(P),B):He(P)?(d=se,$(P)):rt(P)?(e.consume(P),se):Q(P)}function B(P){return P===45||P===46||P===58||P===95||Sn(P)?(e.consume(P),B):U(P)}function U(P){return P===61?(e.consume(P),te):He(P)?(d=U,$(P)):rt(P)?(e.consume(P),U):se(P)}function te(P){return P===null||P===60||P===61||P===62||P===96?a(P):P===34||P===39?(e.consume(P),l=P,ie):He(P)?(d=te,$(P)):rt(P)?(e.consume(P),te):(e.consume(P),Z)}function ie(P){return P===l?(e.consume(P),l=void 0,ee):P===null?a(P):He(P)?(d=ie,$(P)):(e.consume(P),ie)}function Z(P){return P===null||P===34||P===39||P===60||P===61||P===96?a(P):P===47||P===62||Rt(P)?se(P):(e.consume(P),Z)}function ee(P){return P===47||P===62||Rt(P)?se(P):a(P)}function Q(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):a(P)}function $(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),pe}function pe(P){return rt(P)?ct(e,ke,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):ke(P)}function ke(P){return e.enter("htmlTextData"),d(P)}}const Lh={name:"labelEnd",resolveAll:g5,resolveTo:b5,tokenize:x5},m5={tokenize:E5},h5={tokenize:y5},p5={tokenize:T5};function g5(e){let t=-1;const a=[];for(;++t<e.length;){const s=e[t][1];if(a.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",t+=l}}return e.length!==a.length&&la(e,0,e.length,a),e}function b5(e,t){let a=e.length,s=0,l,o,d,f;for(;a--;)if(l=e[a][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[a][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=a,l.type!=="labelLink")){s=2;break}}else l.type==="labelEnd"&&(d=a);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[d][1].end}},x={type:"labelText",start:{...e[o+s+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=_a(f,e.slice(o+1,o+s+3)),f=_a(f,[["enter",x,t]]),f=_a(f,Yc(t.parser.constructs.insideSpan.null,e.slice(o+s+4,d-3),t)),f=_a(f,[["exit",x,t],e[d-2],e[d-1],["exit",h,t]]),f=_a(f,e.slice(d+1)),f=_a(f,[["exit",m,t]]),la(e,o,e.length,f),e}function x5(e,t,a){const s=this;let l=s.events.length,o,d;for(;l--;)if((s.events[l][1].type==="labelImage"||s.events[l][1].type==="labelLink")&&!s.events[l][1]._balanced){o=s.events[l][1];break}return f;function f(y){return o?o._inactive?b(y):(d=s.parser.defined.includes(Ia(s.sliceSerialize({start:o.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),m):a(y)}function m(y){return y===40?e.attempt(m5,x,d?x:b)(y):y===91?e.attempt(h5,x,d?h:b)(y):d?x(y):b(y)}function h(y){return e.attempt(p5,x,b)(y)}function x(y){return t(y)}function b(y){return o._balanced=!0,a(y)}}function E5(e,t,a){return s;function s(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),l}function l(b){return Rt(b)?no(e,o)(b):o(b)}function o(b){return b===41?x(b):Ny(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function d(b){return Rt(b)?no(e,m)(b):x(b)}function f(b){return a(b)}function m(b){return b===34||b===39||b===40?vy(e,h,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):x(b)}function h(b){return Rt(b)?no(e,x)(b):x(b)}function x(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),t):a(b)}}function y5(e,t,a){const s=this;return l;function l(f){return Sy.call(s,e,o,d,"reference","referenceMarker","referenceString")(f)}function o(f){return s.parser.defined.includes(Ia(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(f):a(f)}function d(f){return a(f)}}function T5(e,t,a){return s;function s(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):a(o)}}const _5={name:"labelStartImage",resolveAll:Lh.resolveAll,tokenize:N5};function N5(e,t,a){const s=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):a(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(f):t(f)}}const S5={name:"labelStartLink",resolveAll:Lh.resolveAll,tokenize:v5};function v5(e,t,a){const s=this;return l;function l(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),o}function o(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(d):t(d)}}const gm={name:"lineEnding",tokenize:A5};function A5(e,t){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ct(e,t,"linePrefix")}}const oc={name:"thematicBreak",tokenize:C5};function C5(e,t,a){let s=0,l;return o;function o(h){return e.enter("thematicBreak"),d(h)}function d(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):s>=3&&(h===null||He(h))?(e.exit("thematicBreak"),t(h)):a(h)}function m(h){return h===l?(e.consume(h),s++,m):(e.exit("thematicBreakSequence"),rt(h)?ct(e,f,"whitespace")(h):f(h))}}const $n={continuation:{tokenize:O5},exit:M5,name:"list",tokenize:R5},w5={partial:!0,tokenize:D5},k5={partial:!0,tokenize:I5};function R5(e,t,a){const s=this,l=s.events[s.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,d=0;return f;function f(T){const N=s.containerState.type||(T===42||T===43||T===45?"listUnordered":"listOrdered");if(N==="listUnordered"?!s.containerState.marker||T===s.containerState.marker:Qm(T)){if(s.containerState.type||(s.containerState.type=N,e.enter(N,{_container:!0})),N==="listUnordered")return e.enter("listItemPrefix"),T===42||T===45?e.check(oc,a,h)(T):h(T);if(!s.interrupt||T===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(T)}return a(T)}function m(T){return Qm(T)&&++d<10?(e.consume(T),m):(!s.interrupt||d<2)&&(s.containerState.marker?T===s.containerState.marker:T===41||T===46)?(e.exit("listItemValue"),h(T)):a(T)}function h(T){return e.enter("listItemMarker"),e.consume(T),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||T,e.check(vo,s.interrupt?a:x,e.attempt(w5,y,b))}function x(T){return s.containerState.initialBlankLine=!0,o++,y(T)}function b(T){return rt(T)?(e.enter("listItemPrefixWhitespace"),e.consume(T),e.exit("listItemPrefixWhitespace"),y):a(T)}function y(T){return s.containerState.size=o+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(T)}}function O5(e,t,a){const s=this;return s.containerState._closeFlow=void 0,e.check(vo,l,o);function l(f){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,ct(e,t,"listItemIndent",s.containerState.size+1)(f)}function o(f){return s.containerState.furtherBlankLines||!rt(f)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,d(f)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(k5,t,d)(f))}function d(f){return s.containerState._closeFlow=!0,s.interrupt=void 0,ct(e,e.attempt($n,t,a),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function I5(e,t,a){const s=this;return ct(e,l,"listItemIndent",s.containerState.size+1);function l(o){const d=s.events[s.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===s.containerState.size?t(o):a(o)}}function M5(e){e.exit(this.containerState.type)}function D5(e,t,a){const s=this;return ct(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const d=s.events[s.events.length-1];return!rt(o)&&d&&d[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}const Mx={name:"setextUnderline",resolveTo:L5,tokenize:j5};function L5(e,t){let a=e.length,s,l,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){s=a;break}e[a][1].type==="paragraph"&&(l=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);const d={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",d,t]),e.splice(o+1,0,["exit",e[s][1],t]),e[s][1].end={...e[o][1].end}):e[s][1]=d,e.push(["exit",d,t]),e}function j5(e,t,a){const s=this;let l;return o;function o(h){let x=s.events.length,b;for(;x--;)if(s.events[x][1].type!=="lineEnding"&&s.events[x][1].type!=="linePrefix"&&s.events[x][1].type!=="content"){b=s.events[x][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||b)?(e.enter("setextHeadingLine"),l=h,d(h)):a(h)}function d(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),rt(h)?ct(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||He(h)?(e.exit("setextHeadingLine"),t(h)):a(h)}}const B5={tokenize:P5};function P5(e){const t=this,a=e.attempt(vo,s,e.attempt(this.parser.constructs.flowInitial,l,ct(e,e.attempt(this.parser.constructs.flow,l,e.attempt(qw,l)),"linePrefix")));return a;function s(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,a}}const U5={resolveAll:Cy()},H5=Ay("string"),F5=Ay("text");function Ay(e){return{resolveAll:Cy(e==="text"?z5:void 0),tokenize:t};function t(a){const s=this,l=this.parser.constructs[e],o=a.attempt(l,d,f);return d;function d(x){return h(x)?o(x):f(x)}function f(x){if(x===null){a.consume(x);return}return a.enter("data"),a.consume(x),m}function m(x){return h(x)?(a.exit("data"),o(x)):(a.consume(x),m)}function h(x){if(x===null)return!0;const b=l[x];let y=-1;if(b)for(;++y<b.length;){const T=b[y];if(!T.previous||T.previous.call(s,s.previous))return!0}return!1}}}function Cy(e){return t;function t(a,s){let l=-1,o;for(;++l<=a.length;)o===void 0?a[l]&&a[l][1].type==="data"&&(o=l,l++):(!a[l]||a[l][1].type!=="data")&&(l!==o+2&&(a[o][1].end=a[l-1][1].end,a.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(a,s):a}}function z5(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const s=e[a-1][1],l=t.sliceStream(s);let o=l.length,d=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(d=h.length;h.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(f=0),f){const h={type:a===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?d:s.start._bufferIndex+d,_index:s.start._index+o,line:s.end.line,column:s.end.column-f,offset:s.end.offset-f},end:{...s.end}};s.end={...h.start},s.start.offset===s.end.offset?Object.assign(s,h):(e.splice(a,0,["enter",h,t],["exit",h,t]),a+=2)}a++}return e}const q5={42:$n,43:$n,45:$n,48:$n,49:$n,50:$n,51:$n,52:$n,53:$n,54:$n,55:$n,56:$n,57:$n,62:Ey},Y5={91:Vw},$5={[-2]:pm,[-1]:pm,32:pm},G5={35:e5,42:oc,45:[Mx,oc],60:r5,61:Mx,95:oc,96:Ox,126:Ox},K5={38:Ty,92:yy},V5={[-5]:gm,[-4]:gm,[-3]:gm,33:_5,38:Ty,42:Xm,60:[Sw,d5],91:S5,92:[Ww,yy],93:Lh,95:Xm,96:Bw},Q5={null:[Xm,U5]},X5={null:[42,95]},Z5={null:[]},W5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:X5,contentInitial:Y5,disable:Z5,document:q5,flow:G5,flowInitial:$5,insideSpan:Q5,string:K5,text:V5},Symbol.toStringTag,{value:"Module"}));function J5(e,t,a){let s={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const l={},o=[];let d=[],f=[];const m={attempt:L(V),check:L(M),consume:D,enter:k,exit:z,interrupt:L(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:N,parser:e,previous:null,sliceSerialize:y,sliceStream:T,write:b};let x=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function b(U){return d=_a(d,U),C(),d[d.length-1]!==null?[]:(K(t,0),h.events=Yc(o,h.events,h),h.events)}function y(U,te){return tk(T(U),te)}function T(U){return ek(d,U)}function N(){const{_bufferIndex:U,_index:te,line:ie,column:Z,offset:ee}=s;return{_bufferIndex:U,_index:te,line:ie,column:Z,offset:ee}}function S(U){l[U.line]=U.column,B()}function C(){let U;for(;s._index<d.length;){const te=d[s._index];if(typeof te=="string")for(U=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===U&&s._bufferIndex<te.length;)A(te.charCodeAt(s._bufferIndex));else A(te)}}function A(U){x=x(U)}function D(U){He(U)?(s.line++,s.column=1,s.offset+=U===-3?2:1,B()):U!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===d[s._index].length&&(s._bufferIndex=-1,s._index++)),h.previous=U}function k(U,te){const ie=te||{};return ie.type=U,ie.start=N(),h.events.push(["enter",ie,h]),f.push(ie),ie}function z(U){const te=f.pop();return te.end=N(),h.events.push(["exit",te,h]),te}function V(U,te){K(U,te.from)}function M(U,te){te.restore()}function L(U,te){return ie;function ie(Z,ee,Q){let $,pe,ke,P;return Array.isArray(Z)?W(Z):"tokenize"in Z?W([Z]):R(Z);function R(Ae){return $e;function $e(dt){const ut=dt!==null&&Ae[dt],Ft=dt!==null&&Ae.null,yn=[...Array.isArray(ut)?ut:ut?[ut]:[],...Array.isArray(Ft)?Ft:Ft?[Ft]:[]];return W(yn)(dt)}}function W(Ae){return $=Ae,pe=0,Ae.length===0?Q:O(Ae[pe])}function O(Ae){return $e;function $e(dt){return P=se(),ke=Ae,Ae.partial||(h.currentConstruct=Ae),Ae.name&&h.parser.constructs.disable.null.includes(Ae.name)?ve():Ae.tokenize.call(te?Object.assign(Object.create(h),te):h,m,ge,ve)(dt)}}function ge(Ae){return U(ke,P),ee}function ve(Ae){return P.restore(),++pe<$.length?O($[pe]):Q}}}function K(U,te){U.resolveAll&&!o.includes(U)&&o.push(U),U.resolve&&la(h.events,te,h.events.length-te,U.resolve(h.events.slice(te),h)),U.resolveTo&&(h.events=U.resolveTo(h.events,h))}function se(){const U=N(),te=h.previous,ie=h.currentConstruct,Z=h.events.length,ee=Array.from(f);return{from:Z,restore:Q};function Q(){s=U,h.previous=te,h.currentConstruct=ie,h.events.length=Z,f=ee,B()}}function B(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function ek(e,t){const a=t.start._index,s=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let d;if(a===l)d=[e[a].slice(s,o)];else{if(d=e.slice(a,l),s>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(s):d.shift()}o>0&&d.push(e[l].slice(0,o))}return d}function tk(e,t){let a=-1;const s=[];let l;for(;++a<e.length;){const o=e[a];let d;if(typeof o=="string")d=o;else switch(o){case-5:{d="\r";break}case-4:{d=`
407
+ 在此编写该仓库的 Agent 指令…`}),u.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:a,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"关闭"}),u.jsxs("button",{type:"button",onClick:()=>void T(),disabled:h||!N,className:"flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(Pc,{className:"h-3.5 w-3.5"}),h?"保存中…":"保存"]})]})]})})}function pC(){const e=qe(k=>k.repos),t=qe(k=>k.activeRepoId),a=qe(k=>k.setActiveRepo),s=qe(k=>k.removeRepo),l=qe(k=>k.loadRepos),[o,d]=v.useState(!1),[f,m]=v.useState(null),[h,x]=v.useState(null),[b,y]=v.useState(null),[T,N]=v.useState(null),[S,C]=v.useState(null),A=async(k,z)=>{x(k);try{z?await d3(k):await c3(k),await l()}catch{}x(null)},D=async k=>{y(k),N(null);try{await h3(k),await l()}catch(z){let V="拉取失败";if(z instanceof Hs)try{V=JSON.parse(z.message).error??z.message}catch{V=z.message}N(V)}y(null)};return u.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[u.jsxs("div",{className:"mx-auto max-w-4xl",children:[u.jsxs("div",{className:"mb-6 flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h1",{className:"text-lg font-semibold text-fg",children:"仓库管理"}),u.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"管理代码仓库,每个仓库对应一个独立的 Agent 运行环境"})]}),u.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex shrink-0 items-center gap-1.5 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 md:px-4",children:[u.jsx(Sr,{className:"h-4 w-4"}),u.jsx("span",{className:"hidden md:inline",children:"添加仓库"})]})]}),T&&u.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3 rounded-lg border border-red-500/30 bg-red-500/5 px-4 py-2.5 text-sm text-red-600",children:[u.jsx("span",{children:T}),u.jsx("button",{type:"button",onClick:()=>N(null),className:"shrink-0 rounded p-0.5 transition-colors hover:bg-red-500/10",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}),e.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed border-line-hard py-16 text-center",children:[u.jsx("div",{className:"rounded-full bg-elevated p-3",children:u.jsx(Sr,{className:"h-6 w-6 text-fg-4"})}),u.jsx("p",{className:"text-sm font-medium text-fg-3",children:"暂无代码仓库"}),u.jsx("p",{className:"text-xs text-fg-5",children:"添加一个本地仓库开始使用"}),u.jsx("button",{type:"button",onClick:()=>d(!0),className:"mt-2 rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"添加仓库"})]}):u.jsx(u.Fragment,{children:u.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:e.map(k=>{const z=k.id===t;return u.jsxs("div",{className:ce("rounded-xl border p-4 transition-colors",z?"border-blue-500/40 bg-blue-500/5":"border-line"),children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>a(k.id),className:"flex min-w-0 items-center gap-2 text-left",children:[z?u.jsx(fo,{className:"h-4 w-4 shrink-0 text-blue-500"}):u.jsx(Fv,{className:"h-4 w-4 shrink-0 text-fg-5"}),u.jsx("span",{className:ce("truncate font-medium",z?"text-fg":"text-fg-2"),children:k.name})]}),u.jsxs("span",{className:ce("inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",k.running?"bg-emerald-500/10 text-emerald-600":"bg-fg-6/30 text-fg-4"),children:[u.jsx("span",{className:ce("h-1.5 w-1.5 rounded-full",k.running?"bg-emerald-500":"bg-fg-5")}),k.running?"运行中":"已停止"]})]}),u.jsxs("dl",{className:"mt-3 space-y-1 font-mono text-xs text-fg-4",children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("dt",{className:"shrink-0 text-fg-5",children:"Git"}),u.jsx("dd",{className:"min-w-0 truncate",children:k.gitUrl})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("dt",{className:"shrink-0 text-fg-5",children:"路径"}),u.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx("span",{className:"truncate",children:k.localPath}),u.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(k.localPath),title:"复制路径",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:u.jsx(mc,{className:"h-3 w-3"})})]})]}),k.running&&k.port&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("dt",{className:"shrink-0 text-fg-5",children:"直连"}),u.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsxs("a",{href:`http://127.0.0.1:${k.port}`,target:"_blank",rel:"noopener noreferrer",className:"truncate text-blue-500 hover:underline",children:["127.0.0.1:",k.port]}),u.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(`http://127.0.0.1:${k.port}`),title:"复制链接",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:u.jsx(mc,{className:"h-3 w-3"})})]})]})]}),u.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>C({id:k.id,name:k.name}),className:"flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border border-line px-2.5 text-xs font-medium text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[u.jsx(ME,{className:"h-3 w-3"}),"配置"]}),u.jsx("button",{type:"button",onClick:()=>void D(k.id),disabled:b===k.id,className:"flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border border-blue-500/30 px-2.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-500/10 disabled:opacity-50",children:b===k.id?u.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):u.jsxs(u.Fragment,{children:[u.jsx(Tv,{className:"h-3 w-3"}),"拉取"]})}),u.jsx("button",{type:"button",onClick:()=>void A(k.id,k.running),disabled:h===k.id,className:ce("flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md border text-xs font-medium transition-colors disabled:opacity-50",k.running?"border-amber-500/30 text-amber-600 hover:bg-amber-500/10":"border-emerald-500/30 text-emerald-600 hover:bg-emerald-500/10"),children:h===k.id?u.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):k.running?u.jsxs(u.Fragment,{children:[u.jsx(jE,{className:"h-3 w-3 fill-current"}),"停止"]}):u.jsxs(u.Fragment,{children:[u.jsx(Bc,{className:"h-3 w-3 fill-current"}),"启动"]})}),f===k.id?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>{s(k.id),m(null)},className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-red-500/30 text-red-500 transition-colors hover:bg-red-500/10",children:u.jsx(oa,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>m(null),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:bg-elevated",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}):u.jsx("button",{type:"button",onClick:()=>m(k.id),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-500",children:u.jsx(ji,{className:"h-3.5 w-3.5"})})]})]},k.id)})})}),u.jsxs("p",{className:"mt-3 text-xs text-fg-5",children:[e.length," 个仓库"]})]}),o&&u.jsx(mC,{onClose:()=>d(!1)}),S&&u.jsx(hC,{repoId:S.id,repoName:S.name,onClose:()=>C(null)})]})}const gC=new Set(["tool","tool-use","tool_use","tool-call","tool_call","tool-result","tool_result"]),bC=new Set(["thinking","reasoning","reason"]),xC=new Set(["text","output_text","message"]);function Ah(e){var a;const t=((a=e.type)==null?void 0:a.toLowerCase())??"";return gC.has(t)||e.toolName!=null||e.tool!=null?"tool":bC.has(t)?"thinking":xC.has(t)||e.content!=null||e.text!=null?"text":"other"}function xc(e){return e.content??e.text??""}function ey(e){return e.toolName??e.tool??"tool"}function Hc(e){var t;return e.input??((t=e.state)==null?void 0:t.input)}function Ch(e){var t;return e.output??((t=e.state)==null?void 0:t.output)}function wh(e){var a,s,l;const t=(s=(a=e.state)==null?void 0:a.status)==null?void 0:s.toLowerCase();return t==="completed"||t==="done"||t==="success"?"completed":t==="error"||t==="failed"||((l=e.state)==null?void 0:l.error)!=null?"error":t==="pending"||t==="queued"?"pending":t==="running"||t==="in_progress"?"running":Ch(e)!=null?"completed":"running"}function cx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Bi(e){const t=e==null?void 0:e.toLowerCase();return t==="in_progress"||t==="in-progress"||t==="active"?"in_progress":t==="completed"||t==="done"||t==="complete"?"completed":t==="cancelled"||t==="canceled"?"cancelled":"pending"}function EC(e){return e.filter(t=>Bi(t.status)==="completed").length}function ho(e){const t=ey(e).toLowerCase();return t==="question"||t==="mcp_question"}function yC(e){const t=Hc(e);if(!t||typeof t!="object")return null;const a=t;return Array.isArray(a.questions)?a.questions:null}function Ec(e){if(!ho(e))return!1;const t=wh(e);return t==="pending"||t==="running"}const TC=/\bses_[a-zA-Z0-9]+/;function _C(e){var l;const t=Hc(e);if(t&&typeof t=="object"){const o=t;if(typeof o.task_id=="string"&&o.task_id.startsWith("ses_"))return o.task_id}const a=(l=e.state)==null?void 0:l.metadata;if(a){const o=a.session_id??a.sessionId;if(typeof o=="string"&&o.startsWith("ses_"))return o}const s=Ch(e);if(typeof s=="string"){const o=TC.exec(s);if(o)return o[0]}if(s&&typeof s=="object"){const o=s,d=o.session_id??o.sessionId??o.task_id;if(typeof d=="string"&&d.startsWith("ses_"))return d}return null}let NC=0;const Yt=zs(e=>({toasts:[],addToast:(t,a="info",s,l)=>{const o=(l==null?void 0:l.id)??`toast-${++NC}-${Date.now()}`;e(d=>d.toasts.some(f=>f.id===o)?d:{toasts:[...d.toasts,{id:o,message:t,variant:a,sessionId:s,persistent:l==null?void 0:l.persistent}]}),l!=null&&l.persistent||setTimeout(()=>{e(d=>({toasts:d.toasts.filter(f=>f.id!==o)}))},4e3)},removeToast:t=>{e(a=>({toasts:a.toasts.filter(s=>s.id!==t)}))}}));function ty(e){return`question-${e}`}function dm(e,t){const a=t.find(l=>l.id===e),s=(a==null?void 0:a.title)||e.slice(-8);Yt.getState().addToast(`${s} — 等待回复`,"warning",e,{id:ty(e),persistent:!0})}function SC(e){var t;for(const a of e)if((t=a.parts)!=null&&t.some(s=>ho(s)&&Ec(s)))return!0;return!1}const po=[],yc=[],dx=[],Ms={};function fx(e){return e.id??e.callID}function sa(){return qe.getState().activeRepoId}const Le=zs((e,t)=>({sessions:[],activeSessionId:null,messages:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},loadingSessions:!1,loadError:null,sendError:null,loadSessions:async()=>{const a=sa();if(!a){e({sessions:[],loadingSessions:!1});return}e({loadingSessions:!0,loadError:null});try{const[s,l]=await Promise.all([p3(a),tx(a).catch(()=>null)]),o={sessions:s,loadingSessions:!1};l&&(o.allSessionLinks=l),e(o)}catch(s){e({loadingSessions:!1,loadError:s instanceof Error?s.message:"Failed to load sessions"})}},createSession:async(a,s,l,o,d,f)=>{const m=sa();if(!m)return null;e({sendError:null});try{const h=await g3(m,a,s,l,o,d,f);return e(x=>({sessions:[h,...x.sessions.filter(b=>b.id!==h.id)],activeSessionId:h.id,messages:{...x.messages,[h.id]:[]}})),t().setSessionStatus(h.id,"busy"),h}catch(h){return e({sendError:h instanceof Error?h.message:"Failed to create session"}),null}},setActiveSession:async a=>{sa()&&(e({activeSessionId:a,sendError:null}),await t().refreshSessionData(a))},refreshSessionData:async a=>{const s=sa();if(!s)return;const[l,o,d,f,m]=await Promise.allSettled([S3(s,a),v3(s,a),YE(s,a),b3(s,a),ex(s,a)]);e(h=>{const x={};if(l.status==="fulfilled"&&(x.messages={...h.messages,[a]:l.value}),o.status==="fulfilled"&&(x.todos={...h.todos,[a]:o.value}),d.status==="fulfilled"&&(x.sessionStatuses={...h.sessionStatuses,[a]:d.value.type}),f.status==="fulfilled"){const b=f.value;x.sessions=h.sessions.map(y=>y.id===a?{...y,...b}:y)}return m.status==="fulfilled"&&(x.sessionLinks={...h.sessionLinks,[a]:m.value}),x}),l.status==="fulfilled"&&SC(l.value)&&dm(a,t().sessions)},refreshSessionLinks:async a=>{const s=sa();if(s)try{const[l,o]=await Promise.all([ex(s,a),tx(s).catch(()=>null)]);e(d=>{const f={sessionLinks:{...d.sessionLinks,[a]:l}};return o&&(f.allSessionLinks=o),f})}catch{}},addLink:async(a,s,l)=>{const o=sa();if(!o)return!1;try{return await A3(o,a,s,l),await t().refreshSessionLinks(a),!0}catch{return!1}},removeLink:async(a,s,l)=>{const o=sa();if(!o)return!1;try{return await C3(o,a,s,l),await t().refreshSessionLinks(a),!0}catch{return!1}},deleteSession:async a=>{const s=sa();if(s)try{await x3(s,a)}catch{}delete Ms[a],e(l=>{const{[a]:o,...d}=l.messages,{[a]:f,...m}=l.todos,{[a]:h,...x}=l.sessionStatuses,{[a]:b,...y}=l.errorReasons,{[a]:T,...N}=l.queuedMessageIds,{[a]:S,...C}=l.sessionLinks,{[a]:A,...D}=l.allSessionLinks;return{sessions:l.sessions.filter(k=>k.id!==a),messages:d,todos:m,sessionStatuses:x,errorReasons:y,queuedMessageIds:N,sessionLinks:C,allSessionLinks:D,activeSessionId:l.activeSessionId===a?null:l.activeSessionId}})},sendMessage:async(a,s)=>{const l=sa(),o=t().activeSessionId;if(!l||!o)return;const d=t().sessions.find(m=>m.id===o),f=t().sessionStatuses[o]==="busy";e({sendError:null}),f||t().setSessionStatus(o,"busy");try{await E3(l,o,a,d==null?void 0:d.agent,s),f&&(Ms[o]=(Ms[o]||0)+1)}catch(m){e({sendError:m instanceof Error?m.message:"Failed to send message"}),f||t().setSessionStatus(o,"idle")}},replyQuestion:async a=>{const s=sa(),l=t().activeSessionId;if(!(!s||!l))try{await T3(s,l,a)}catch(o){e({sendError:o instanceof Error?o.message:"Failed to reply to question"})}},rejectQuestion:async()=>{const a=sa(),s=t().activeSessionId;if(!(!a||!s))try{await _3(a,s)}catch{}},abortSession:async()=>{const a=sa(),s=t().activeSessionId;if(!(!a||!s)){try{await y3(a,s)}catch{}t().setSessionStatus(s,"idle")}},clearSessions:()=>{for(const a of Object.keys(Ms))delete Ms[a];e({sessions:[],activeSessionId:null,messages:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},loadError:null,sendError:null})},updateMessage:(a,s)=>{var l;e(o=>{const d=o.messages[a]??[],f=d.findIndex(x=>x.id===s.id);let m,h=o.queuedMessageIds;if(f>=0){const x={...d[f],...s};(!s.parts||s.parts.length===0)&&d[f].parts&&(x.parts=d[f].parts),m=[...d],m[f]=x}else{m=[...d,s];const x=Ms[a]||0;if(s.role==="user"&&x>0){const b=[...h[a]??[]];b.push(s.id),h={...h,[a]:b},Ms[a]=x-1}else if(s.role==="assistant"){const b=h[a];b&&b.length>0&&(h={...h,[a]:b.slice(1)})}}return{messages:{...o.messages,[a]:m},queuedMessageIds:h}}),(l=s.parts)!=null&&l.some(o=>ho(o)&&Ec(o))&&dm(a,t().sessions)},updateMessagePart:(a,s,l)=>{e(o=>{const d=o.messages[a]??[],f=d.findIndex(N=>N.id===s),m=f>=0?d[f]:{id:s,role:"assistant"},h=m.parts?[...m.parts]:[],x=fx(l),b=x!=null?h.findIndex(N=>fx(N)===x):-1;b>=0?h[b]={...h[b],...l}:h.push(l);const y={...m,parts:h},T=f>=0?[...d]:[...d,y];return f>=0&&(T[f]=y),{messages:{...o.messages,[a]:T}}}),ho(l)&&Ec(l)&&dm(a,t().sessions)},appendMessagePartDelta:(a,s,l,o)=>{e(d=>{const f=d.messages[a]??[],m=f.findIndex(N=>N.id===s),h=m>=0?f[m]:{id:s,role:"assistant"},x=h.parts?[...h.parts]:[],b=x.findIndex(N=>N.id===l);if(b>=0){const N=x[b],S=xc(N)+o;x[b]=N.content!=null?{...N,content:S}:{...N,text:S}}else x.push({id:l,type:"text",text:o});const y={...h,parts:x},T=m>=0?[...f]:[...f,y];return m>=0&&(T[m]=y),{messages:{...d.messages,[a]:T}}})},updateTodos:(a,s)=>{e(l=>({todos:{...l.todos,[a]:s}}))},updateSessionInfo:a=>{e(s=>s.sessions.some(o=>o.id===a.id)?{sessions:s.sessions.map(o=>o.id===a.id?{...o,...a}:o)}:{sessions:[a,...s.sessions]})},setSessionStatus:(a,s,l)=>{const o=t().sessionStatuses[a];if(o!==s){const d=t().sessions.find(m=>m.id===a),f=(d==null?void 0:d.title)||a.slice(-8);if(s==="idle"&&o!==void 0&&o!=="idle")Yt.getState().removeToast(ty(a)),Yt.getState().addToast(`${f} — 完成`,"success",a);else if(s==="busy"&&(o===void 0||o==="idle"))Yt.getState().addToast(`${f} — 开始运行`,"info",a);else if(s==="retry")Yt.getState().addToast(`${f} — 进入重试`,"warning",a);else if(s==="error"){const m=l?`${f} — 错误: ${l}`:`${f} — 发生错误`;Yt.getState().addToast(m,"error",a)}}e(d=>{const f=l?{...d.errorReasons,[a]:l}:s!=="error"?(()=>{const{[a]:m,...h}=d.errorReasons;return h})():d.errorReasons;return{sessionStatuses:{...d.sessionStatuses,[a]:s},errorReasons:f}})},bulkSetStatuses:a=>{e({sessionStatuses:{...t().sessionStatuses,...a}})},renameSession:async(a,s)=>{const l=sa();if(l){e(o=>({sessions:o.sessions.map(d=>d.id===a?{...d,title:s}:d)}));try{await G3(l,a,s)}catch{await t().loadSessions()}}}})),Ue=zs((e,t)=>({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,syncing:!1,selectedIssueId:null,previewIssueId:null,matchingParentId:null,matchingCandidateId:null,pendingDraft:null,clearIssues:()=>e({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,selectedIssueId:null,previewIssueId:null,matchingParentId:null,matchingCandidateId:null,pendingDraft:null}),setSelectedIssue:a=>e({selectedIssueId:a}),setPreviewIssue:a=>e({previewIssueId:a}),setPendingDraft:a=>e({pendingDraft:a}),enterMatchMode:a=>e({matchingParentId:a,matchingCandidateId:null,previewIssueId:null}),exitMatchMode:()=>{const a=t().matchingParentId;e({matchingParentId:null,matchingCandidateId:null,previewIssueId:a})},setMatchCandidate:a=>e({matchingCandidateId:a}),linkChild:async(a,s)=>{var o;const l=qe.getState().activeRepoId;if(!l)return!1;try{await B3(l,a,s);const d=(o=t().issues.find(f=>f.number===a))==null?void 0:o.id;return d&&e(f=>({issues:f.issues.map(m=>m.number===s?{...m,parentId:d}:m),matchingCandidateId:null})),!0}catch{return!1}},updateIssueState:async(a,s)=>{const l=qe.getState().activeRepoId;if(!l)return!1;try{const o=await QE(l,a,{state:s});return e(d=>({issues:d.issues.map(f=>f.number===a?{...f,state:o.state}:f)})),!0}catch{return!1}},loadIssues:async()=>{const a=qe.getState().activeRepoId;if(!a){e({issues:[],loaded:!0});return}try{const s=await sx(a,"all");e({issues:s,loaded:!0})}catch{e({loaded:!0})}},syncIssues:async()=>{const a=qe.getState().activeRepoId;if(a){e({syncing:!0});try{await L3(a);const[s,l,o]=await Promise.all([sx(a,"all"),ax(a),rx(a)]);e({issues:s,tags:l,milestones:o,syncing:!1})}catch(s){e({syncing:!1});let l="同步 Issue 失败";if(s instanceof Hs)try{const o=JSON.parse(s.message);o.error&&(l=o.error)}catch{s.message&&(l=s.message)}Yt.getState().addToast(l,"error")}}},createIssue:async(a,s)=>{const l=qe.getState().activeRepoId;if(!l)return null;try{const o=await j3(l,a,s);return e(d=>({issues:[o,...d.issues]})),o}catch{return null}},loadTags:async()=>{const a=qe.getState().activeRepoId;if(!a){e({tags:[]});return}try{const s=await ax(a);e({tags:s})}catch{}},cycleTagFilter:a=>{e(s=>{const l=new Map(s.tagFilterMode),o=l.get(a);return o?o==="include"?l.set(a,"exclude"):l.delete(a):l.set(a,"include"),{tagFilterMode:l}})},clearTagFilter:()=>e({tagFilterMode:new Map}),loadMilestones:async()=>{const a=qe.getState().activeRepoId;if(!a){e({milestones:[]});return}try{const s=await rx(a);e({milestones:s})}catch{}},setMilestoneFilter:a=>e({selectedMilestoneId:a})}));function mx(e){const t=[],a=String(e||"");let s=a.indexOf(","),l=0,o=!1;for(;!o;){s===-1&&(s=a.length,o=!0);const d=a.slice(l,s).trim();(d||!o)&&t.push(d),l=s+1,s=a.indexOf(",",l)}return t}function ny(e,t){const a={};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const vC=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AC=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CC={};function hx(e,t){return(CC.jsx?AC:vC).test(e)}const wC=/[ \t\n\f\r]/g;function kC(e){return typeof e=="object"?e.type==="text"?px(e.value):!1:px(e)}function px(e){return e.replace(wC,"")===""}class No{constructor(t,a,s){this.normal=a,this.property=t,s&&(this.space=s)}}No.prototype.normal={};No.prototype.property={};No.prototype.space=void 0;function ay(e,t){const a={},s={};for(const l of e)Object.assign(a,l.property),Object.assign(s,l.normal);return new No(a,s,t)}function go(e){return e.toLowerCase()}class Vn{constructor(t,a){this.attribute=a,this.property=t}}Vn.prototype.attribute="";Vn.prototype.booleanish=!1;Vn.prototype.boolean=!1;Vn.prototype.commaOrSpaceSeparated=!1;Vn.prototype.commaSeparated=!1;Vn.prototype.defined=!1;Vn.prototype.mustUseProperty=!1;Vn.prototype.number=!1;Vn.prototype.overloadedBoolean=!1;Vn.prototype.property="";Vn.prototype.spaceSeparated=!1;Vn.prototype.space=void 0;let RC=0;const Ke=qs(),sn=qs(),Gm=qs(),ye=qs(),kt=qs(),Ps=qs(),ia=qs();function qs(){return 2**++RC}const Km=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:sn,commaOrSpaceSeparated:ia,commaSeparated:Ps,number:ye,overloadedBoolean:Gm,spaceSeparated:kt},Symbol.toStringTag,{value:"Module"})),fm=Object.keys(Km);class kh extends Vn{constructor(t,a,s,l){let o=-1;if(super(t,a),gx(this,"space",l),typeof s=="number")for(;++o<fm.length;){const d=fm[o];gx(this,fm[o],(s&Km[d])===Km[d])}}}kh.prototype.defined=!0;function gx(e,t,a){a&&(e[t]=a)}function $i(e){const t={},a={};for(const[s,l]of Object.entries(e.properties)){const o=new kh(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(o.mustUseProperty=!0),t[s]=o,a[go(s)]=s,a[go(o.attribute)]=s}return new No(t,a,e.space)}const ry=$i({properties:{ariaActiveDescendant:null,ariaAtomic:sn,ariaAutoComplete:null,ariaBusy:sn,ariaChecked:sn,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:kt,ariaCurrent:null,ariaDescribedBy:kt,ariaDetails:null,ariaDisabled:sn,ariaDropEffect:kt,ariaErrorMessage:null,ariaExpanded:sn,ariaFlowTo:kt,ariaGrabbed:sn,ariaHasPopup:null,ariaHidden:sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kt,ariaLevel:ye,ariaLive:null,ariaModal:sn,ariaMultiLine:sn,ariaMultiSelectable:sn,ariaOrientation:null,ariaOwns:kt,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:sn,ariaReadOnly:sn,ariaRelevant:null,ariaRequired:sn,ariaRoleDescription:kt,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:sn,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function sy(e,t){return t in e?e[t]:t}function iy(e,t){return sy(e,t.toLowerCase())}const OC=$i({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ps,acceptCharset:kt,accessKey:kt,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alpha:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:kt,autoFocus:Ke,autoPlay:Ke,blocking:kt,capture:null,charSet:null,checked:Ke,cite:null,className:kt,closedBy:null,colorSpace:null,cols:ye,colSpan:ye,command:null,commandFor:null,content:null,contentEditable:sn,controls:Ke,controlsList:kt,coords:ye|Ps,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:Gm,draggable:sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:kt,height:ye,hidden:Gm,high:ye,href:null,hrefLang:null,htmlFor:kt,httpEquiv:kt,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:kt,itemRef:kt,itemScope:Ke,itemType:kt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,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:Ke,optimum:ye,pattern:null,ping:kt,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:kt,required:Ke,reversed:Ke,rows:ye,rowSpan:ye,sandbox:kt,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootCustomElementRegistry:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shadowRootSerializable:Ke,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:sn,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kt,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:sn,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ke,disablePictureInPicture:Ke,disableRemotePlayback:Ke,exportParts:Ps,part:kt,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:iy}),IC=$i({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ia,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:kt,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:Ps,g2:Ps,glyphName:Ps,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:ia,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ia,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ia,rev:ia,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ia,requiredFeatures:ia,requiredFonts:ia,requiredFormats:ia,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:ia,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ia,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ia,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sy}),ly=$i({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),oy=$i({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:iy}),uy=$i({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),MC={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"},DC=/[A-Z]/g,bx=/-[a-z]/g,LC=/^data[-\w.:]+$/i;function Fc(e,t){const a=go(t);let s=t,l=Vn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&LC.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(bx,BC);s="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!bx.test(o)){let d=o.replace(DC,jC);d.charAt(0)!=="-"&&(d="-"+d),t="data"+d}}l=kh}return new l(s,t)}function jC(e){return"-"+e.toLowerCase()}function BC(e){return e.charAt(1).toUpperCase()}const So=ay([ry,OC,ly,oy,uy],"html"),cs=ay([ry,IC,ly,oy,uy],"svg");function xx(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function cy(e){return e.join(" ").trim()}var Ri={},mm,Ex;function PC(){if(Ex)return mm;Ex=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,a=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,f=/^\s+|\s+$/g,m=`
408
+ `,h="/",x="*",b="",y="comment",T="declaration";function N(C,A){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];A=A||{};var D=1,k=1;function z(Z){var ee=Z.match(t);ee&&(D+=ee.length);var Q=Z.lastIndexOf(m);k=~Q?Z.length-Q:k+Z.length}function V(){var Z={line:D,column:k};return function(ee){return ee.position=new M(Z),se(),ee}}function M(Z){this.start=Z,this.end={line:D,column:k},this.source=A.source}M.prototype.content=C;function L(Z){var ee=new Error(A.source+":"+D+":"+k+": "+Z);if(ee.reason=Z,ee.filename=A.source,ee.line=D,ee.column=k,ee.source=C,!A.silent)throw ee}function K(Z){var ee=Z.exec(C);if(ee){var Q=ee[0];return z(Q),C=C.slice(Q.length),ee}}function se(){K(a)}function B(Z){var ee;for(Z=Z||[];ee=U();)ee!==!1&&Z.push(ee);return Z}function U(){var Z=V();if(!(h!=C.charAt(0)||x!=C.charAt(1))){for(var ee=2;b!=C.charAt(ee)&&(x!=C.charAt(ee)||h!=C.charAt(ee+1));)++ee;if(ee+=2,b===C.charAt(ee-1))return L("End of comment missing");var Q=C.slice(2,ee-2);return k+=2,z(Q),C=C.slice(ee),k+=2,Z({type:y,comment:Q})}}function te(){var Z=V(),ee=K(s);if(ee){if(U(),!K(l))return L("property missing ':'");var Q=K(o),$=Z({type:T,property:S(ee[0].replace(e,b)),value:Q?S(Q[0].replace(e,b)):b});return K(d),$}}function ie(){var Z=[];B(Z);for(var ee;ee=te();)ee!==!1&&(Z.push(ee),B(Z));return Z}return se(),ie()}function S(C){return C?C.replace(f,b):b}return mm=N,mm}var yx;function UC(){if(yx)return Ri;yx=1;var e=Ri&&Ri.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.default=a;const t=e(PC());function a(s,l){let o=null;if(!s||typeof s!="string")return o;const d=(0,t.default)(s),f=typeof l=="function";return d.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:x}=m;f?l(h,x,m):x&&(o=o||{},o[h]=x)}),o}return Ri}var Gl={},Tx;function HC(){if(Tx)return Gl;Tx=1,Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,a=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(h){return!h||a.test(h)||e.test(h)},d=function(h,x){return x.toUpperCase()},f=function(h,x){return"".concat(x,"-")},m=function(h,x){return x===void 0&&(x={}),o(h)?h:(h=h.toLowerCase(),x.reactCompat?h=h.replace(l,f):h=h.replace(s,f),h.replace(t,d))};return Gl.camelCase=m,Gl}var Kl,_x;function FC(){if(_x)return Kl;_x=1;var e=Kl&&Kl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(UC()),a=HC();function s(l,o){var d={};return!l||typeof l!="string"||(0,t.default)(l,function(f,m){f&&m&&(d[(0,a.camelCase)(f,o)]=m)}),d}return s.default=s,Kl=s,Kl}var zC=FC();const qC=Rc(zC),zc=dy("end"),Xa=dy("start");function dy(e){return t;function t(a){const s=a&&a.position&&a.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function YC(e){const t=Xa(e),a=zc(e);if(t&&a)return{start:t,end:a}}function to(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Nx(e.position):"start"in e||"end"in e?Nx(e):"line"in e||"column"in e?Vm(e):""}function Vm(e){return Sx(e&&e.line)+":"+Sx(e&&e.column)}function Nx(e){return Vm(e&&e.start)+"-"+Vm(e&&e.end)}function Sx(e){return e&&typeof e=="number"?e:1}class vn extends Error{constructor(t,a,s){super(),typeof a=="string"&&(s=a,a=void 0);let l="",o={},d=!1;if(a&&("line"in a&&"column"in a?o={place:a}:"start"in a&&"end"in a?o={place:a}:"type"in a?o={ancestors:[a],place:a.position}:o={...a}),typeof t=="string"?l=t:!o.cause&&t&&(d=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof s=="string"){const m=s.indexOf(":");m===-1?o.ruleId=s:(o.source=s.slice(0,m),o.ruleId=s.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=to(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=d&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vn.prototype.file="";vn.prototype.name="";vn.prototype.reason="";vn.prototype.message="";vn.prototype.stack="";vn.prototype.column=void 0;vn.prototype.line=void 0;vn.prototype.ancestors=void 0;vn.prototype.cause=void 0;vn.prototype.fatal=void 0;vn.prototype.place=void 0;vn.prototype.ruleId=void 0;vn.prototype.source=void 0;const Rh={}.hasOwnProperty,$C=new Map,GC=/[A-Z]/g,KC=new Set(["table","tbody","thead","tfoot","tr"]),VC=new Set(["td","th"]),fy="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function QC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=aw(a,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=nw(a,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?cs:So,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=my(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function my(e,t,a){if(t.type==="element")return XC(e,t,a);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ZC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return JC(e,t,a);if(t.type==="mdxjsEsm")return WC(e,t);if(t.type==="root")return ew(e,t,a);if(t.type==="text")return tw(e,t)}function XC(e,t,a){const s=e.schema;let l=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=cs,e.schema=l),e.ancestors.push(t);const o=py(e,t.tagName,!1),d=rw(e,t);let f=Ih(e,t);return KC.has(t.tagName)&&(f=f.filter(function(m){return typeof m=="string"?!kC(m):!0})),hy(e,d,o,t),Oh(d,f),e.ancestors.pop(),e.schema=s,e.create(t,o,d,a)}function ZC(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}bo(e,t.position)}function WC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bo(e,t.position)}function JC(e,t,a){const s=e.schema;let l=s;t.name==="svg"&&s.space==="html"&&(l=cs,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:py(e,t.name,!0),d=sw(e,t),f=Ih(e,t);return hy(e,d,o,t),Oh(d,f),e.ancestors.pop(),e.schema=s,e.create(t,o,d,a)}function ew(e,t,a){const s={};return Oh(s,Ih(e,t)),e.create(t,e.Fragment,s,a)}function tw(e,t){return t.value}function hy(e,t,a,s){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(t.node=s)}function Oh(e,t){if(t.length>0){const a=t.length>1?t:t[0];a&&(e.children=a)}}function nw(e,t,a){return s;function s(l,o,d,f){const h=Array.isArray(d.children)?a:t;return f?h(o,d,f):h(o,d)}}function aw(e,t){return a;function a(s,l,o,d){const f=Array.isArray(o.children),m=Xa(s);return t(l,o,d,f,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function rw(e,t){const a={};let s,l;for(l in t.properties)if(l!=="children"&&Rh.call(t.properties,l)){const o=iw(e,l,t.properties[l]);if(o){const[d,f]=o;e.tableCellAlignToStyle&&d==="align"&&typeof f=="string"&&VC.has(t.tagName)?s=f:a[d]=f}}if(s){const o=a.style||(a.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return a}function sw(e,t){const a={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const o=s.data.estree.body[0];o.type;const d=o.expression;d.type;const f=d.properties[0];f.type,Object.assign(a,e.evaluater.evaluateExpression(f.argument))}else bo(e,t.position);else{const l=s.name;let o;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const f=s.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else bo(e,t.position);else o=s.value===null?!0:s.value;a[l]=o}return a}function Ih(e,t){const a=[];let s=-1;const l=e.passKeys?new Map:$C;for(;++s<t.children.length;){const o=t.children[s];let d;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=l.get(m)||0;d=m+"-"+h,l.set(m,h+1)}}const f=my(e,o,d);f!==void 0&&a.push(f)}return a}function iw(e,t,a){const s=Fc(e.schema,t);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=s.commaSeparated?ny(a):cy(a)),s.property==="style"){let l=typeof a=="object"?a:lw(e,String(a));return e.stylePropertyNameCase==="css"&&(l=ow(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?MC[s.property]||s.property:s.attribute,a]}}function lw(e,t){try{return qC(t,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const s=a,l=new vn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=fy+"#cannot-parse-style-attribute",l}}function py(e,t,a){let s;if(!a)s={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,d;for(;++o<l.length;){const f=hx(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};d=d?{type:"MemberExpression",object:d,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}s=d}else s=hx(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const l=s.value;return Rh.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);bo(e)}function bo(e,t){const a=new vn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=fy+"#cannot-handle-mdx-estrees-without-createevaluater",a}function ow(e){const t={};let a;for(a in e)Rh.call(e,a)&&(t[uw(a)]=e[a]);return t}function uw(e){let t=e.replace(GC,cw);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function cw(e){return"-"+e.toLowerCase()}const hm={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"]},dw={};function Mh(e,t){const a=dw,s=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,l=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return gy(e,s,l)}function gy(e,t,a){if(fw(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return vx(e.children,t,a)}return Array.isArray(e)?vx(e,t,a):""}function vx(e,t,a){const s=[];let l=-1;for(;++l<e.length;)s[l]=gy(e[l],t,a);return s.join("")}function fw(e){return!!(e&&typeof e=="object")}const Ax=document.createElement("i");function Dh(e){const t="&"+e+";";Ax.innerHTML=t;const a=Ax.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===t?!1:a}function la(e,t,a,s){const l=e.length;let o=0,d;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,a=a>0?a:0,s.length<1e4)d=Array.from(s),d.unshift(t,a),e.splice(...d);else for(a&&e.splice(t,a);o<s.length;)d=s.slice(o,o+1e4),d.unshift(t,0),e.splice(...d),o+=1e4,t+=1e4}function _a(e,t){return e.length>0?(la(e,e.length,0,t),e):t}const Cx={}.hasOwnProperty;function by(e){const t={};let a=-1;for(;++a<e.length;)mw(t,e[a]);return t}function mw(e,t){let a;for(a in t){const l=(Cx.call(e,a)?e[a]:void 0)||(e[a]={}),o=t[a];let d;if(o)for(d in o){Cx.call(l,d)||(l[d]=[]);const f=o[d];hw(l[d],Array.isArray(f)?f:f?[f]:[])}}}function hw(e,t){let a=-1;const s=[];for(;++a<t.length;)(t[a].add==="after"?e:s).push(t[a]);la(e,0,0,s)}function xy(e,t){const a=Number.parseInt(e,t);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ia(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const In=ds(/[A-Za-z]/),Sn=ds(/[\dA-Za-z]/),pw=ds(/[#-'*+\--9=?A-Z^-~]/);function Tc(e){return e!==null&&(e<32||e===127)}const Qm=ds(/\d/),gw=ds(/[\dA-Fa-f]/),bw=ds(/[!-/:-@[-`{-~]/);function He(e){return e!==null&&e<-2}function Rt(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const qc=ds(new RegExp("\\p{P}|\\p{S}","u")),Fs=ds(/\s/);function ds(e){return t;function t(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Gi(e){const t=[];let a=-1,s=0,l=0;for(;++a<e.length;){const o=e.charCodeAt(a);let d="";if(o===37&&Sn(e.charCodeAt(a+1))&&Sn(e.charCodeAt(a+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(d=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(a+1);o<56320&&f>56319&&f<57344?(d=String.fromCharCode(o,f),l=1):d="�"}else d=String.fromCharCode(o);d&&(t.push(e.slice(s,a),encodeURIComponent(d)),s=a+l+1,d=""),l&&(a+=l,l=0)}return t.join("")+e.slice(s)}function ct(e,t,a,s){const l=s?s-1:Number.POSITIVE_INFINITY;let o=0;return d;function d(m){return rt(m)?(e.enter(a),f(m)):t(m)}function f(m){return rt(m)&&o++<l?(e.consume(m),f):(e.exit(a),t(m))}}const xw={tokenize:Ew};function Ew(e){const t=e.attempt(this.parser.constructs.contentInitial,s,l);let a;return t;function s(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),ct(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const m=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=m),a=m,d(f)}function d(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return He(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),d)}}const yw={tokenize:Tw},wx={tokenize:_w};function Tw(e){const t=this,a=[];let s=0,l,o,d;return f;function f(k){if(s<a.length){const z=a[s];return t.containerState=z[1],e.attempt(z[0].continuation,m,h)(k)}return h(k)}function m(k){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&D();const z=t.events.length;let V=z,M;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){M=t.events[V][1].end;break}A(s);let L=z;for(;L<t.events.length;)t.events[L][1].end={...M},L++;return la(t.events,V+1,0,t.events.slice(z)),t.events.length=L,h(k)}return f(k)}function h(k){if(s===a.length){if(!l)return y(k);if(l.currentConstruct&&l.currentConstruct.concrete)return N(k);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wx,x,b)(k)}function x(k){return l&&D(),A(s),y(k)}function b(k){return t.parser.lazy[t.now().line]=s!==a.length,d=t.now().offset,N(k)}function y(k){return t.containerState={},e.attempt(wx,T,N)(k)}function T(k){return s++,a.push([t.currentConstruct,t.containerState]),y(k)}function N(k){if(k===null){l&&D(),A(0),e.consume(k);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),S(k)}function S(k){if(k===null){C(e.exit("chunkFlow"),!0),A(0),e.consume(k);return}return He(k)?(e.consume(k),C(e.exit("chunkFlow")),s=0,t.interrupt=void 0,f):(e.consume(k),S)}function C(k,z){const V=t.sliceStream(k);if(z&&V.push(null),k.previous=o,o&&(o.next=k),o=k,l.defineSkip(k.start),l.write(V),t.parser.lazy[k.start.line]){let M=l.events.length;for(;M--;)if(l.events[M][1].start.offset<d&&(!l.events[M][1].end||l.events[M][1].end.offset>d))return;const L=t.events.length;let K=L,se,B;for(;K--;)if(t.events[K][0]==="exit"&&t.events[K][1].type==="chunkFlow"){if(se){B=t.events[K][1].end;break}se=!0}for(A(s),M=L;M<t.events.length;)t.events[M][1].end={...B},M++;la(t.events,K+1,0,t.events.slice(L)),t.events.length=M}}function A(k){let z=a.length;for(;z-- >k;){const V=a[z];t.containerState=V[1],V[0].exit.call(t,e)}a.length=k}function D(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function _w(e,t,a){return ct(e,e.attempt(this.parser.constructs.document,t,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pi(e){if(e===null||Rt(e)||Fs(e))return 1;if(qc(e))return 2}function Yc(e,t,a){const s=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!s.includes(o)&&(t=o(t,a),s.push(o))}return t}const Xm={name:"attention",resolveAll:Nw,tokenize:Sw};function Nw(e,t){let a=-1,s,l,o,d,f,m,h,x;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(s=a;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[s][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;m=e[s][1].end.offset-e[s][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const b={...e[s][1].end},y={...e[a][1].start};kx(b,-m),kx(y,m),d={type:m>1?"strongSequence":"emphasisSequence",start:b,end:{...e[s][1].end}},f={type:m>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:y},o={type:m>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[a][1].start}},l={type:m>1?"strong":"emphasis",start:{...d.start},end:{...f.end}},e[s][1].end={...d.start},e[a][1].start={...f.end},h=[],e[s][1].end.offset-e[s][1].start.offset&&(h=_a(h,[["enter",e[s][1],t],["exit",e[s][1],t]])),h=_a(h,[["enter",l,t],["enter",d,t],["exit",d,t],["enter",o,t]]),h=_a(h,Yc(t.parser.constructs.insideSpan.null,e.slice(s+1,a),t)),h=_a(h,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[a][1].end.offset-e[a][1].start.offset?(x=2,h=_a(h,[["enter",e[a][1],t],["exit",e[a][1],t]])):x=0,la(e,s-1,a-s+3,h),a=s+h.length-x-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function Sw(e,t){const a=this.parser.constructs.attentionMarkers.null,s=this.previous,l=Pi(s);let o;return d;function d(m){return o=m,e.enter("attentionSequence"),f(m)}function f(m){if(m===o)return e.consume(m),f;const h=e.exit("attentionSequence"),x=Pi(m),b=!x||x===2&&l||a.includes(m),y=!l||l===2&&x||a.includes(s);return h._open=!!(o===42?b:b&&(l||!y)),h._close=!!(o===42?y:y&&(x||!b)),t(m)}}function kx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const vw={name:"autolink",tokenize:Aw};function Aw(e,t,a){let s=0;return l;function l(T){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(T),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(T){return In(T)?(e.consume(T),d):T===64?a(T):h(T)}function d(T){return T===43||T===45||T===46||Sn(T)?(s=1,f(T)):h(T)}function f(T){return T===58?(e.consume(T),s=0,m):(T===43||T===45||T===46||Sn(T))&&s++<32?(e.consume(T),f):(s=0,h(T))}function m(T){return T===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(T),e.exit("autolinkMarker"),e.exit("autolink"),t):T===null||T===32||T===60||Tc(T)?a(T):(e.consume(T),m)}function h(T){return T===64?(e.consume(T),x):pw(T)?(e.consume(T),h):a(T)}function x(T){return Sn(T)?b(T):a(T)}function b(T){return T===46?(e.consume(T),s=0,x):T===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(T),e.exit("autolinkMarker"),e.exit("autolink"),t):y(T)}function y(T){if((T===45||Sn(T))&&s++<63){const N=T===45?y:b;return e.consume(T),N}return a(T)}}const vo={partial:!0,tokenize:Cw};function Cw(e,t,a){return s;function s(o){return rt(o)?ct(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||He(o)?t(o):a(o)}}const Ey={continuation:{tokenize:kw},exit:Rw,name:"blockQuote",tokenize:ww};function ww(e,t,a){const s=this;return l;function l(d){if(d===62){const f=s.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),o}return a(d)}function o(d){return rt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(d))}}function kw(e,t,a){const s=this;return l;function l(d){return rt(d)?ct(e,o,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):o(d)}function o(d){return e.attempt(Ey,t,a)(d)}}function Rw(e){e.exit("blockQuote")}const yy={name:"characterEscape",tokenize:Ow};function Ow(e,t,a){return s;function s(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return bw(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):a(o)}}const Ty={name:"characterReference",tokenize:Iw};function Iw(e,t,a){const s=this;let l=0,o,d;return f;function f(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),m}function m(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,d=Sn,x(b))}function h(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,d=gw,x):(e.enter("characterReferenceValue"),o=7,d=Qm,x(b))}function x(b){if(b===59&&l){const y=e.exit("characterReferenceValue");return d===Sn&&!Dh(s.sliceSerialize(y))?a(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return d(b)&&l++<o?(e.consume(b),x):a(b)}}const Rx={partial:!0,tokenize:Dw},Ox={concrete:!0,name:"codeFenced",tokenize:Mw};function Mw(e,t,a){const s=this,l={partial:!0,tokenize:V};let o=0,d=0,f;return m;function m(M){return h(M)}function h(M){const L=s.events[s.events.length-1];return o=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,f=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),x(M)}function x(M){return M===f?(d++,e.consume(M),x):d<3?a(M):(e.exit("codeFencedFenceSequence"),rt(M)?ct(e,b,"whitespace")(M):b(M))}function b(M){return M===null||He(M)?(e.exit("codeFencedFence"),s.interrupt?t(M):e.check(Rx,S,z)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===null||He(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(M)):rt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ct(e,T,"whitespace")(M)):M===96&&M===f?a(M):(e.consume(M),y)}function T(M){return M===null||He(M)?b(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),N(M))}function N(M){return M===null||He(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(M)):M===96&&M===f?a(M):(e.consume(M),N)}function S(M){return e.attempt(l,z,C)(M)}function C(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),A}function A(M){return o>0&&rt(M)?ct(e,D,"linePrefix",o+1)(M):D(M)}function D(M){return M===null||He(M)?e.check(Rx,S,z)(M):(e.enter("codeFlowValue"),k(M))}function k(M){return M===null||He(M)?(e.exit("codeFlowValue"),D(M)):(e.consume(M),k)}function z(M){return e.exit("codeFenced"),t(M)}function V(M,L,K){let se=0;return B;function B(ee){return M.enter("lineEnding"),M.consume(ee),M.exit("lineEnding"),U}function U(ee){return M.enter("codeFencedFence"),rt(ee)?ct(M,te,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ee):te(ee)}function te(ee){return ee===f?(M.enter("codeFencedFenceSequence"),ie(ee)):K(ee)}function ie(ee){return ee===f?(se++,M.consume(ee),ie):se>=d?(M.exit("codeFencedFenceSequence"),rt(ee)?ct(M,Z,"whitespace")(ee):Z(ee)):K(ee)}function Z(ee){return ee===null||He(ee)?(M.exit("codeFencedFence"),L(ee)):K(ee)}}}function Dw(e,t,a){const s=this;return l;function l(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o)}function o(d){return s.parser.lazy[s.now().line]?a(d):t(d)}}const pm={name:"codeIndented",tokenize:jw},Lw={partial:!0,tokenize:Bw};function jw(e,t,a){const s=this;return l;function l(h){return e.enter("codeIndented"),ct(e,o,"linePrefix",5)(h)}function o(h){const x=s.events[s.events.length-1];return x&&x[1].type==="linePrefix"&&x[2].sliceSerialize(x[1],!0).length>=4?d(h):a(h)}function d(h){return h===null?m(h):He(h)?e.attempt(Lw,d,m)(h):(e.enter("codeFlowValue"),f(h))}function f(h){return h===null||He(h)?(e.exit("codeFlowValue"),d(h)):(e.consume(h),f)}function m(h){return e.exit("codeIndented"),t(h)}}function Bw(e,t,a){const s=this;return l;function l(d){return s.parser.lazy[s.now().line]?a(d):He(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):ct(e,o,"linePrefix",5)(d)}function o(d){const f=s.events[s.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(d):He(d)?l(d):a(d)}}const Pw={name:"codeText",previous:Hw,resolve:Uw,tokenize:Fw};function Uw(e){let t=e.length-4,a=3,s,l;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=a;++s<t;)if(e[s][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[t][1].type="codeTextPadding",a+=2,t-=2;break}}for(s=a-1,t++;++s<=t;)l===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(l=s):(s===t||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),t-=s-l-2,s=l+2),l=void 0);return e}function Hw(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Fw(e,t,a){let s=0,l,o;return d;function d(b){return e.enter("codeText"),e.enter("codeTextSequence"),f(b)}function f(b){return b===96?(e.consume(b),s++,f):(e.exit("codeTextSequence"),m(b))}function m(b){return b===null?a(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),m):b===96?(o=e.enter("codeTextSequence"),l=0,x(b)):He(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(b))}function h(b){return b===null||b===32||b===96||He(b)?(e.exit("codeTextData"),m(b)):(e.consume(b),h)}function x(b){return b===96?(e.consume(b),l++,x):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(b)):(o.type="codeTextData",h(b))}}class zw{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,a){const s=a??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,a,s){const l=a||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&Vl(this.left,s),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Vl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Vl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const a=this.left.splice(t,Number.POSITIVE_INFINITY);Vl(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Vl(this.left,a.reverse())}}}function Vl(e,t){let a=0;if(t.length<1e4)e.push(...t);else for(;a<t.length;)e.push(...t.slice(a,a+1e4)),a+=1e4}function _y(e){const t={};let a=-1,s,l,o,d,f,m,h;const x=new zw(e);for(;++a<x.length;){for(;a in t;)a=t[a];if(s=x.get(a),a&&s[1].type==="chunkFlow"&&x.get(a-1)[1].type==="listItemPrefix"&&(m=s[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,qw(x,a)),a=t[a],h=!0);else if(s[1]._container){for(o=a,l=void 0;o--;)if(d=x.get(o),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(l&&(x.get(l)[1].type="lineEndingBlank"),d[1].type="lineEnding",l=o);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;l&&(s[1].end={...x.get(l)[1].start},f=x.slice(l,a),f.unshift(s),x.splice(l,a-l+1,f))}}return la(e,0,Number.POSITIVE_INFINITY,x.slice(0)),!h}function qw(e,t){const a=e.get(t)[1],s=e.get(t)[2];let l=t-1;const o=[];let d=a._tokenizer;d||(d=s.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const f=d.events,m=[],h={};let x,b,y=-1,T=a,N=0,S=0;const C=[S];for(;T;){for(;e.get(++l)[1]!==T;);o.push(l),T._tokenizer||(x=s.sliceStream(T),T.next||x.push(null),b&&d.defineSkip(T.start),T._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(x),T._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),b=T,T=T.next}for(T=a;++y<f.length;)f[y][0]==="exit"&&f[y-1][0]==="enter"&&f[y][1].type===f[y-1][1].type&&f[y][1].start.line!==f[y][1].end.line&&(S=y+1,C.push(S),T._tokenizer=void 0,T.previous=void 0,T=T.next);for(d.events=[],T?(T._tokenizer=void 0,T.previous=void 0):C.pop(),y=C.length;y--;){const A=f.slice(C[y],C[y+1]),D=o.pop();m.push([D,D+A.length-1]),e.splice(D,2,A)}for(m.reverse(),y=-1;++y<m.length;)h[N+m[y][0]]=N+m[y][1],N+=m[y][1]-m[y][0]-1;return h}const Yw={resolve:Gw,tokenize:Kw},$w={partial:!0,tokenize:Vw};function Gw(e){return _y(e),e}function Kw(e,t){let a;return s;function s(f){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):He(f)?e.check($w,d,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function d(f){return e.consume(f),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,l}}function Vw(e,t,a){const s=this;return l;function l(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ct(e,o,"linePrefix")}function o(d){if(d===null||He(d))return a(d);const f=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(d):e.interrupt(s.parser.constructs.flow,a,t)(d)}}function Ny(e,t,a,s,l,o,d,f,m){const h=m||Number.POSITIVE_INFINITY;let x=0;return b;function b(A){return A===60?(e.enter(s),e.enter(l),e.enter(o),e.consume(A),e.exit(o),y):A===null||A===32||A===41||Tc(A)?a(A):(e.enter(s),e.enter(d),e.enter(f),e.enter("chunkString",{contentType:"string"}),S(A))}function y(A){return A===62?(e.enter(o),e.consume(A),e.exit(o),e.exit(l),e.exit(s),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),T(A))}function T(A){return A===62?(e.exit("chunkString"),e.exit(f),y(A)):A===null||A===60||He(A)?a(A):(e.consume(A),A===92?N:T)}function N(A){return A===60||A===62||A===92?(e.consume(A),T):T(A)}function S(A){return!x&&(A===null||A===41||Rt(A))?(e.exit("chunkString"),e.exit(f),e.exit(d),e.exit(s),t(A)):x<h&&A===40?(e.consume(A),x++,S):A===41?(e.consume(A),x--,S):A===null||A===32||A===40||Tc(A)?a(A):(e.consume(A),A===92?C:S)}function C(A){return A===40||A===41||A===92?(e.consume(A),S):S(A)}}function Sy(e,t,a,s,l,o){const d=this;let f=0,m;return h;function h(T){return e.enter(s),e.enter(l),e.consume(T),e.exit(l),e.enter(o),x}function x(T){return f>999||T===null||T===91||T===93&&!m||T===94&&!f&&"_hiddenFootnoteSupport"in d.parser.constructs?a(T):T===93?(e.exit(o),e.enter(l),e.consume(T),e.exit(l),e.exit(s),t):He(T)?(e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),x):(e.enter("chunkString",{contentType:"string"}),b(T))}function b(T){return T===null||T===91||T===93||He(T)||f++>999?(e.exit("chunkString"),x(T)):(e.consume(T),m||(m=!rt(T)),T===92?y:b)}function y(T){return T===91||T===92||T===93?(e.consume(T),f++,b):b(T)}}function vy(e,t,a,s,l,o){let d;return f;function f(y){return y===34||y===39||y===40?(e.enter(s),e.enter(l),e.consume(y),e.exit(l),d=y===40?41:y,m):a(y)}function m(y){return y===d?(e.enter(l),e.consume(y),e.exit(l),e.exit(s),t):(e.enter(o),h(y))}function h(y){return y===d?(e.exit(o),m(d)):y===null?a(y):He(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),ct(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),x(y))}function x(y){return y===d||y===null||He(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?b:x)}function b(y){return y===d||y===92?(e.consume(y),x):x(y)}}function no(e,t){let a;return s;function s(l){return He(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a=!0,s):rt(l)?ct(e,s,a?"linePrefix":"lineSuffix")(l):t(l)}}const Qw={name:"definition",tokenize:Zw},Xw={partial:!0,tokenize:Ww};function Zw(e,t,a){const s=this;let l;return o;function o(T){return e.enter("definition"),d(T)}function d(T){return Sy.call(s,e,f,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(T)}function f(T){return l=Ia(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),T===58?(e.enter("definitionMarker"),e.consume(T),e.exit("definitionMarker"),m):a(T)}function m(T){return Rt(T)?no(e,h)(T):h(T)}function h(T){return Ny(e,x,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(T)}function x(T){return e.attempt(Xw,b,b)(T)}function b(T){return rt(T)?ct(e,y,"whitespace")(T):y(T)}function y(T){return T===null||He(T)?(e.exit("definition"),s.parser.defined.push(l),t(T)):a(T)}}function Ww(e,t,a){return s;function s(f){return Rt(f)?no(e,l)(f):a(f)}function l(f){return vy(e,o,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return rt(f)?ct(e,d,"whitespace")(f):d(f)}function d(f){return f===null||He(f)?t(f):a(f)}}const Jw={name:"hardBreakEscape",tokenize:e5};function e5(e,t,a){return s;function s(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return He(o)?(e.exit("hardBreakEscape"),t(o)):a(o)}}const t5={name:"headingAtx",resolve:n5,tokenize:a5};function n5(e,t){let a=e.length-2,s=3,l,o;return e[s][1].type==="whitespace"&&(s+=2),a-2>s&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(s===a-1||a-4>s&&e[a-2][1].type==="whitespace")&&(a-=s+1===a?2:4),a>s&&(l={type:"atxHeadingText",start:e[s][1].start,end:e[a][1].end},o={type:"chunkText",start:e[s][1].start,end:e[a][1].end,contentType:"text"},la(e,s,a-s+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function a5(e,t,a){let s=0;return l;function l(x){return e.enter("atxHeading"),o(x)}function o(x){return e.enter("atxHeadingSequence"),d(x)}function d(x){return x===35&&s++<6?(e.consume(x),d):x===null||Rt(x)?(e.exit("atxHeadingSequence"),f(x)):a(x)}function f(x){return x===35?(e.enter("atxHeadingSequence"),m(x)):x===null||He(x)?(e.exit("atxHeading"),t(x)):rt(x)?ct(e,f,"whitespace")(x):(e.enter("atxHeadingText"),h(x))}function m(x){return x===35?(e.consume(x),m):(e.exit("atxHeadingSequence"),f(x))}function h(x){return x===null||x===35||Rt(x)?(e.exit("atxHeadingText"),f(x)):(e.consume(x),h)}}const r5=["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"],Ix=["pre","script","style","textarea"],s5={concrete:!0,name:"htmlFlow",resolveTo:o5,tokenize:u5},i5={partial:!0,tokenize:d5},l5={partial:!0,tokenize:c5};function o5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function u5(e,t,a){const s=this;let l,o,d,f,m;return h;function h(O){return x(O)}function x(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),b}function b(O){return O===33?(e.consume(O),y):O===47?(e.consume(O),o=!0,S):O===63?(e.consume(O),l=3,s.interrupt?t:P):In(O)?(e.consume(O),d=String.fromCharCode(O),C):a(O)}function y(O){return O===45?(e.consume(O),l=2,T):O===91?(e.consume(O),l=5,f=0,N):In(O)?(e.consume(O),l=4,s.interrupt?t:P):a(O)}function T(O){return O===45?(e.consume(O),s.interrupt?t:P):a(O)}function N(O){const ge="CDATA[";return O===ge.charCodeAt(f++)?(e.consume(O),f===ge.length?s.interrupt?t:te:N):a(O)}function S(O){return In(O)?(e.consume(O),d=String.fromCharCode(O),C):a(O)}function C(O){if(O===null||O===47||O===62||Rt(O)){const ge=O===47,ve=d.toLowerCase();return!ge&&!o&&Ix.includes(ve)?(l=1,s.interrupt?t(O):te(O)):r5.includes(d.toLowerCase())?(l=6,ge?(e.consume(O),A):s.interrupt?t(O):te(O)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?a(O):o?D(O):k(O))}return O===45||Sn(O)?(e.consume(O),d+=String.fromCharCode(O),C):a(O)}function A(O){return O===62?(e.consume(O),s.interrupt?t:te):a(O)}function D(O){return rt(O)?(e.consume(O),D):B(O)}function k(O){return O===47?(e.consume(O),B):O===58||O===95||In(O)?(e.consume(O),z):rt(O)?(e.consume(O),k):B(O)}function z(O){return O===45||O===46||O===58||O===95||Sn(O)?(e.consume(O),z):V(O)}function V(O){return O===61?(e.consume(O),M):rt(O)?(e.consume(O),V):k(O)}function M(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),m=O,L):rt(O)?(e.consume(O),M):K(O)}function L(O){return O===m?(e.consume(O),m=null,se):O===null||He(O)?a(O):(e.consume(O),L)}function K(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Rt(O)?V(O):(e.consume(O),K)}function se(O){return O===47||O===62||rt(O)?k(O):a(O)}function B(O){return O===62?(e.consume(O),U):a(O)}function U(O){return O===null||He(O)?te(O):rt(O)?(e.consume(O),U):a(O)}function te(O){return O===45&&l===2?(e.consume(O),Q):O===60&&l===1?(e.consume(O),$):O===62&&l===4?(e.consume(O),R):O===63&&l===3?(e.consume(O),P):O===93&&l===5?(e.consume(O),ke):He(O)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(i5,W,ie)(O)):O===null||He(O)?(e.exit("htmlFlowData"),ie(O)):(e.consume(O),te)}function ie(O){return e.check(l5,Z,W)(O)}function Z(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ee}function ee(O){return O===null||He(O)?ie(O):(e.enter("htmlFlowData"),te(O))}function Q(O){return O===45?(e.consume(O),P):te(O)}function $(O){return O===47?(e.consume(O),d="",pe):te(O)}function pe(O){if(O===62){const ge=d.toLowerCase();return Ix.includes(ge)?(e.consume(O),R):te(O)}return In(O)&&d.length<8?(e.consume(O),d+=String.fromCharCode(O),pe):te(O)}function ke(O){return O===93?(e.consume(O),P):te(O)}function P(O){return O===62?(e.consume(O),R):O===45&&l===2?(e.consume(O),P):te(O)}function R(O){return O===null||He(O)?(e.exit("htmlFlowData"),W(O)):(e.consume(O),R)}function W(O){return e.exit("htmlFlow"),t(O)}}function c5(e,t,a){const s=this;return l;function l(d){return He(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):a(d)}function o(d){return s.parser.lazy[s.now().line]?a(d):t(d)}}function d5(e,t,a){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(vo,t,a)}}const f5={name:"htmlText",tokenize:m5};function m5(e,t,a){const s=this;let l,o,d;return f;function f(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),m}function m(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),V):P===63?(e.consume(P),k):In(P)?(e.consume(P),K):a(P)}function h(P){return P===45?(e.consume(P),x):P===91?(e.consume(P),o=0,N):In(P)?(e.consume(P),D):a(P)}function x(P){return P===45?(e.consume(P),T):a(P)}function b(P){return P===null?a(P):P===45?(e.consume(P),y):He(P)?(d=b,$(P)):(e.consume(P),b)}function y(P){return P===45?(e.consume(P),T):b(P)}function T(P){return P===62?Q(P):P===45?y(P):b(P)}function N(P){const R="CDATA[";return P===R.charCodeAt(o++)?(e.consume(P),o===R.length?S:N):a(P)}function S(P){return P===null?a(P):P===93?(e.consume(P),C):He(P)?(d=S,$(P)):(e.consume(P),S)}function C(P){return P===93?(e.consume(P),A):S(P)}function A(P){return P===62?Q(P):P===93?(e.consume(P),A):S(P)}function D(P){return P===null||P===62?Q(P):He(P)?(d=D,$(P)):(e.consume(P),D)}function k(P){return P===null?a(P):P===63?(e.consume(P),z):He(P)?(d=k,$(P)):(e.consume(P),k)}function z(P){return P===62?Q(P):k(P)}function V(P){return In(P)?(e.consume(P),M):a(P)}function M(P){return P===45||Sn(P)?(e.consume(P),M):L(P)}function L(P){return He(P)?(d=L,$(P)):rt(P)?(e.consume(P),L):Q(P)}function K(P){return P===45||Sn(P)?(e.consume(P),K):P===47||P===62||Rt(P)?se(P):a(P)}function se(P){return P===47?(e.consume(P),Q):P===58||P===95||In(P)?(e.consume(P),B):He(P)?(d=se,$(P)):rt(P)?(e.consume(P),se):Q(P)}function B(P){return P===45||P===46||P===58||P===95||Sn(P)?(e.consume(P),B):U(P)}function U(P){return P===61?(e.consume(P),te):He(P)?(d=U,$(P)):rt(P)?(e.consume(P),U):se(P)}function te(P){return P===null||P===60||P===61||P===62||P===96?a(P):P===34||P===39?(e.consume(P),l=P,ie):He(P)?(d=te,$(P)):rt(P)?(e.consume(P),te):(e.consume(P),Z)}function ie(P){return P===l?(e.consume(P),l=void 0,ee):P===null?a(P):He(P)?(d=ie,$(P)):(e.consume(P),ie)}function Z(P){return P===null||P===34||P===39||P===60||P===61||P===96?a(P):P===47||P===62||Rt(P)?se(P):(e.consume(P),Z)}function ee(P){return P===47||P===62||Rt(P)?se(P):a(P)}function Q(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):a(P)}function $(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),pe}function pe(P){return rt(P)?ct(e,ke,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):ke(P)}function ke(P){return e.enter("htmlTextData"),d(P)}}const Lh={name:"labelEnd",resolveAll:b5,resolveTo:x5,tokenize:E5},h5={tokenize:y5},p5={tokenize:T5},g5={tokenize:_5};function b5(e){let t=-1;const a=[];for(;++t<e.length;){const s=e[t][1];if(a.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",t+=l}}return e.length!==a.length&&la(e,0,e.length,a),e}function x5(e,t){let a=e.length,s=0,l,o,d,f;for(;a--;)if(l=e[a][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[a][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=a,l.type!=="labelLink")){s=2;break}}else l.type==="labelEnd"&&(d=a);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[d][1].end}},x={type:"labelText",start:{...e[o+s+2][1].end},end:{...e[d-2][1].start}};return f=[["enter",m,t],["enter",h,t]],f=_a(f,e.slice(o+1,o+s+3)),f=_a(f,[["enter",x,t]]),f=_a(f,Yc(t.parser.constructs.insideSpan.null,e.slice(o+s+4,d-3),t)),f=_a(f,[["exit",x,t],e[d-2],e[d-1],["exit",h,t]]),f=_a(f,e.slice(d+1)),f=_a(f,[["exit",m,t]]),la(e,o,e.length,f),e}function E5(e,t,a){const s=this;let l=s.events.length,o,d;for(;l--;)if((s.events[l][1].type==="labelImage"||s.events[l][1].type==="labelLink")&&!s.events[l][1]._balanced){o=s.events[l][1];break}return f;function f(y){return o?o._inactive?b(y):(d=s.parser.defined.includes(Ia(s.sliceSerialize({start:o.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),m):a(y)}function m(y){return y===40?e.attempt(h5,x,d?x:b)(y):y===91?e.attempt(p5,x,d?h:b)(y):d?x(y):b(y)}function h(y){return e.attempt(g5,x,b)(y)}function x(y){return t(y)}function b(y){return o._balanced=!0,a(y)}}function y5(e,t,a){return s;function s(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),l}function l(b){return Rt(b)?no(e,o)(b):o(b)}function o(b){return b===41?x(b):Ny(e,d,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function d(b){return Rt(b)?no(e,m)(b):x(b)}function f(b){return a(b)}function m(b){return b===34||b===39||b===40?vy(e,h,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):x(b)}function h(b){return Rt(b)?no(e,x)(b):x(b)}function x(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),t):a(b)}}function T5(e,t,a){const s=this;return l;function l(f){return Sy.call(s,e,o,d,"reference","referenceMarker","referenceString")(f)}function o(f){return s.parser.defined.includes(Ia(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(f):a(f)}function d(f){return a(f)}}function _5(e,t,a){return s;function s(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):a(o)}}const N5={name:"labelStartImage",resolveAll:Lh.resolveAll,tokenize:S5};function S5(e,t,a){const s=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),d):a(f)}function d(f){return f===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(f):t(f)}}const v5={name:"labelStartLink",resolveAll:Lh.resolveAll,tokenize:A5};function A5(e,t,a){const s=this;return l;function l(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),o}function o(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?a(d):t(d)}}const gm={name:"lineEnding",tokenize:C5};function C5(e,t){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ct(e,t,"linePrefix")}}const oc={name:"thematicBreak",tokenize:w5};function w5(e,t,a){let s=0,l;return o;function o(h){return e.enter("thematicBreak"),d(h)}function d(h){return l=h,f(h)}function f(h){return h===l?(e.enter("thematicBreakSequence"),m(h)):s>=3&&(h===null||He(h))?(e.exit("thematicBreak"),t(h)):a(h)}function m(h){return h===l?(e.consume(h),s++,m):(e.exit("thematicBreakSequence"),rt(h)?ct(e,f,"whitespace")(h):f(h))}}const $n={continuation:{tokenize:I5},exit:D5,name:"list",tokenize:O5},k5={partial:!0,tokenize:L5},R5={partial:!0,tokenize:M5};function O5(e,t,a){const s=this,l=s.events[s.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,d=0;return f;function f(T){const N=s.containerState.type||(T===42||T===43||T===45?"listUnordered":"listOrdered");if(N==="listUnordered"?!s.containerState.marker||T===s.containerState.marker:Qm(T)){if(s.containerState.type||(s.containerState.type=N,e.enter(N,{_container:!0})),N==="listUnordered")return e.enter("listItemPrefix"),T===42||T===45?e.check(oc,a,h)(T):h(T);if(!s.interrupt||T===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(T)}return a(T)}function m(T){return Qm(T)&&++d<10?(e.consume(T),m):(!s.interrupt||d<2)&&(s.containerState.marker?T===s.containerState.marker:T===41||T===46)?(e.exit("listItemValue"),h(T)):a(T)}function h(T){return e.enter("listItemMarker"),e.consume(T),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||T,e.check(vo,s.interrupt?a:x,e.attempt(k5,y,b))}function x(T){return s.containerState.initialBlankLine=!0,o++,y(T)}function b(T){return rt(T)?(e.enter("listItemPrefixWhitespace"),e.consume(T),e.exit("listItemPrefixWhitespace"),y):a(T)}function y(T){return s.containerState.size=o+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(T)}}function I5(e,t,a){const s=this;return s.containerState._closeFlow=void 0,e.check(vo,l,o);function l(f){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,ct(e,t,"listItemIndent",s.containerState.size+1)(f)}function o(f){return s.containerState.furtherBlankLines||!rt(f)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,d(f)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(R5,t,d)(f))}function d(f){return s.containerState._closeFlow=!0,s.interrupt=void 0,ct(e,e.attempt($n,t,a),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function M5(e,t,a){const s=this;return ct(e,l,"listItemIndent",s.containerState.size+1);function l(o){const d=s.events[s.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===s.containerState.size?t(o):a(o)}}function D5(e){e.exit(this.containerState.type)}function L5(e,t,a){const s=this;return ct(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const d=s.events[s.events.length-1];return!rt(o)&&d&&d[1].type==="listItemPrefixWhitespace"?t(o):a(o)}}const Mx={name:"setextUnderline",resolveTo:j5,tokenize:B5};function j5(e,t){let a=e.length,s,l,o;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){s=a;break}e[a][1].type==="paragraph"&&(l=a)}else e[a][1].type==="content"&&e.splice(a,1),!o&&e[a][1].type==="definition"&&(o=a);const d={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",d,t]),e.splice(o+1,0,["exit",e[s][1],t]),e[s][1].end={...e[o][1].end}):e[s][1]=d,e.push(["exit",d,t]),e}function B5(e,t,a){const s=this;let l;return o;function o(h){let x=s.events.length,b;for(;x--;)if(s.events[x][1].type!=="lineEnding"&&s.events[x][1].type!=="linePrefix"&&s.events[x][1].type!=="content"){b=s.events[x][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||b)?(e.enter("setextHeadingLine"),l=h,d(h)):a(h)}function d(h){return e.enter("setextHeadingLineSequence"),f(h)}function f(h){return h===l?(e.consume(h),f):(e.exit("setextHeadingLineSequence"),rt(h)?ct(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||He(h)?(e.exit("setextHeadingLine"),t(h)):a(h)}}const P5={tokenize:U5};function U5(e){const t=this,a=e.attempt(vo,s,e.attempt(this.parser.constructs.flowInitial,l,ct(e,e.attempt(this.parser.constructs.flow,l,e.attempt(Yw,l)),"linePrefix")));return a;function s(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,a}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,a}}const H5={resolveAll:Cy()},F5=Ay("string"),z5=Ay("text");function Ay(e){return{resolveAll:Cy(e==="text"?q5:void 0),tokenize:t};function t(a){const s=this,l=this.parser.constructs[e],o=a.attempt(l,d,f);return d;function d(x){return h(x)?o(x):f(x)}function f(x){if(x===null){a.consume(x);return}return a.enter("data"),a.consume(x),m}function m(x){return h(x)?(a.exit("data"),o(x)):(a.consume(x),m)}function h(x){if(x===null)return!0;const b=l[x];let y=-1;if(b)for(;++y<b.length;){const T=b[y];if(!T.previous||T.previous.call(s,s.previous))return!0}return!1}}}function Cy(e){return t;function t(a,s){let l=-1,o;for(;++l<=a.length;)o===void 0?a[l]&&a[l][1].type==="data"&&(o=l,l++):(!a[l]||a[l][1].type!=="data")&&(l!==o+2&&(a[o][1].end=a[l-1][1].end,a.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(a,s):a}}function q5(e,t){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const s=e[a-1][1],l=t.sliceStream(s);let o=l.length,d=-1,f=0,m;for(;o--;){const h=l[o];if(typeof h=="string"){for(d=h.length;h.charCodeAt(d-1)===32;)f++,d--;if(d)break;d=-1}else if(h===-2)m=!0,f++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&a===e.length&&(f=0),f){const h={type:a===e.length||m||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?d:s.start._bufferIndex+d,_index:s.start._index+o,line:s.end.line,column:s.end.column-f,offset:s.end.offset-f},end:{...s.end}};s.end={...h.start},s.start.offset===s.end.offset?Object.assign(s,h):(e.splice(a,0,["enter",h,t],["exit",h,t]),a+=2)}a++}return e}const Y5={42:$n,43:$n,45:$n,48:$n,49:$n,50:$n,51:$n,52:$n,53:$n,54:$n,55:$n,56:$n,57:$n,62:Ey},$5={91:Qw},G5={[-2]:pm,[-1]:pm,32:pm},K5={35:t5,42:oc,45:[Mx,oc],60:s5,61:Mx,95:oc,96:Ox,126:Ox},V5={38:Ty,92:yy},Q5={[-5]:gm,[-4]:gm,[-3]:gm,33:N5,38:Ty,42:Xm,60:[vw,f5],91:v5,92:[Jw,yy],93:Lh,95:Xm,96:Pw},X5={null:[Xm,H5]},Z5={null:[42,95]},W5={null:[]},J5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Z5,contentInitial:$5,disable:W5,document:Y5,flow:K5,flowInitial:G5,insideSpan:X5,string:V5,text:Q5},Symbol.toStringTag,{value:"Module"}));function ek(e,t,a){let s={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const l={},o=[];let d=[],f=[];const m={attempt:L(V),check:L(M),consume:D,enter:k,exit:z,interrupt:L(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:S,events:[],now:N,parser:e,previous:null,sliceSerialize:y,sliceStream:T,write:b};let x=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function b(U){return d=_a(d,U),C(),d[d.length-1]!==null?[]:(K(t,0),h.events=Yc(o,h.events,h),h.events)}function y(U,te){return nk(T(U),te)}function T(U){return tk(d,U)}function N(){const{_bufferIndex:U,_index:te,line:ie,column:Z,offset:ee}=s;return{_bufferIndex:U,_index:te,line:ie,column:Z,offset:ee}}function S(U){l[U.line]=U.column,B()}function C(){let U;for(;s._index<d.length;){const te=d[s._index];if(typeof te=="string")for(U=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===U&&s._bufferIndex<te.length;)A(te.charCodeAt(s._bufferIndex));else A(te)}}function A(U){x=x(U)}function D(U){He(U)?(s.line++,s.column=1,s.offset+=U===-3?2:1,B()):U!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===d[s._index].length&&(s._bufferIndex=-1,s._index++)),h.previous=U}function k(U,te){const ie=te||{};return ie.type=U,ie.start=N(),h.events.push(["enter",ie,h]),f.push(ie),ie}function z(U){const te=f.pop();return te.end=N(),h.events.push(["exit",te,h]),te}function V(U,te){K(U,te.from)}function M(U,te){te.restore()}function L(U,te){return ie;function ie(Z,ee,Q){let $,pe,ke,P;return Array.isArray(Z)?W(Z):"tokenize"in Z?W([Z]):R(Z);function R(Ae){return $e;function $e(dt){const ut=dt!==null&&Ae[dt],Ft=dt!==null&&Ae.null,yn=[...Array.isArray(ut)?ut:ut?[ut]:[],...Array.isArray(Ft)?Ft:Ft?[Ft]:[]];return W(yn)(dt)}}function W(Ae){return $=Ae,pe=0,Ae.length===0?Q:O(Ae[pe])}function O(Ae){return $e;function $e(dt){return P=se(),ke=Ae,Ae.partial||(h.currentConstruct=Ae),Ae.name&&h.parser.constructs.disable.null.includes(Ae.name)?ve():Ae.tokenize.call(te?Object.assign(Object.create(h),te):h,m,ge,ve)(dt)}}function ge(Ae){return U(ke,P),ee}function ve(Ae){return P.restore(),++pe<$.length?O($[pe]):Q}}}function K(U,te){U.resolveAll&&!o.includes(U)&&o.push(U),U.resolve&&la(h.events,te,h.events.length-te,U.resolve(h.events.slice(te),h)),U.resolveTo&&(h.events=U.resolveTo(h.events,h))}function se(){const U=N(),te=h.previous,ie=h.currentConstruct,Z=h.events.length,ee=Array.from(f);return{from:Z,restore:Q};function Q(){s=U,h.previous=te,h.currentConstruct=ie,h.events.length=Z,f=ee,B()}}function B(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function tk(e,t){const a=t.start._index,s=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let d;if(a===l)d=[e[a].slice(s,o)];else{if(d=e.slice(a,l),s>-1){const f=d[0];typeof f=="string"?d[0]=f.slice(s):d.shift()}o>0&&d.push(e[l].slice(0,o))}return d}function nk(e,t){let a=-1;const s=[];let l;for(;++a<e.length;){const o=e[a];let d;if(typeof o=="string")d=o;else switch(o){case-5:{d="\r";break}case-4:{d=`
409
409
  `;break}case-3:{d=`\r
410
- `;break}case-2:{d=t?" ":" ";break}case-1:{if(!t&&l)continue;d=" ";break}default:d=String.fromCharCode(o)}l=o===-2,s.push(d)}return s.join("")}function nk(e){const s={constructs:by([W5,...(e||{}).extensions||[]]),content:l(bw),defined:[],document:l(Ew),flow:l(B5),lazy:{},string:l(H5),text:l(F5)};return s;function l(o){return d;function d(f){return J5(s,o,f)}}}function ak(e){for(;!_y(e););return e}const Dx=/[\0\t\n\r]/g;function rk(){let e=1,t="",a=!0,s;return l;function l(o,d,f){const m=[];let h,x,b,y,T;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(d||void 0).decode(o)),b=0,t="",a&&(o.charCodeAt(0)===65279&&b++,a=void 0);b<o.length;){if(Dx.lastIndex=b,h=Dx.exec(o),y=h&&h.index!==void 0?h.index:o.length,T=o.charCodeAt(y),!h){t=o.slice(b);break}if(T===10&&b===y&&s)m.push(-3),s=void 0;else switch(s&&(m.push(-5),s=void 0),b<y&&(m.push(o.slice(b,y)),e+=y-b),T){case 0:{m.push(65533),e++;break}case 9:{for(x=Math.ceil(e/4)*4,m.push(-2);e++<x;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:s=!0,e=1}b=y+1}return f&&(s&&m.push(-5),t&&m.push(t),m.push(null)),m}}const sk=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ik(e){return e.replace(sk,lk)}function lk(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){const l=a.charCodeAt(1),o=l===120||l===88;return xy(a.slice(o?2:1),o?16:10)}return Dh(a)||e}const wy={}.hasOwnProperty;function ok(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),uk(a)(ak(nk(a).document().write(rk()(e,t,!0))))}function uk(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fa),autolinkProtocol:se,autolinkEmail:se,atxHeading:o(Qn),blockQuote:o(Ft),characterEscape:se,characterReference:se,codeFenced:o(yn),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:o(yn,d),codeText:o(da,d),codeTextData:se,data:se,codeFlowValue:se,definition:o(Aa),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:o(un),hardBreakEscape:o(Je),hardBreakTrailing:o(Je),htmlFlow:o(Dn,d),htmlFlowData:se,htmlText:o(Dn,d),htmlTextData:se,image:o(Cn),label:d,link:o(fa),listItem:o(Wa),listItemValue:y,listOrdered:o(Ca,b),listUnordered:o(Ca),paragraph:o(ja),reference:O,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:o(Qn),strong:o(Ar),thematicBreak:o(Ja)},exit:{atxHeading:m(),atxHeadingSequence:V,autolink:m(),autolinkEmail:ut,autolinkProtocol:dt,blockQuote:m(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:Ae,characterReference:$e,codeFenced:m(C),codeFencedFence:S,codeFencedFenceInfo:T,codeFencedFenceMeta:N,codeFlowValue:B,codeIndented:m(A),codeText:m(ee),codeTextData:B,data:B,definition:m(),definitionDestinationString:z,definitionLabelString:D,definitionTitleString:k,emphasis:m(),hardBreakEscape:m(te),hardBreakTrailing:m(te),htmlFlow:m(ie),htmlFlowData:B,htmlText:m(Z),htmlTextData:B,image:m($),label:ke,labelText:pe,lineEnding:U,link:m(Q),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:ge,resourceDestinationString:P,resourceTitleString:R,resource:W,setextHeading:m(K),setextHeadingLineSequence:L,setextHeadingText:M,strong:m(),thematicBreak:m()}};ky(t,(e||{}).mdastExtensions||[]);const a={};return s;function s(ue){let Te={type:"root",children:[]};const Pe={stack:[Te],tokenStack:[],config:t,enter:f,exit:h,buffer:d,resume:x,data:a},H=[];let Se=-1;for(;++Se<ue.length;)if(ue[Se][1].type==="listOrdered"||ue[Se][1].type==="listUnordered")if(ue[Se][0]==="enter")H.push(Se);else{const ft=H.pop();Se=l(ue,ft,Se)}for(Se=-1;++Se<ue.length;){const ft=t[ue[Se][0]];wy.call(ft,ue[Se][1].type)&&ft[ue[Se][1].type].call(Object.assign({sliceSerialize:ue[Se][2].sliceSerialize},Pe),ue[Se][1])}if(Pe.tokenStack.length>0){const ft=Pe.tokenStack[Pe.tokenStack.length-1];(ft[1]||Lx).call(Pe,void 0,ft[0])}for(Te.position={start:ns(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:ns(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;++Se<t.transforms.length;)Te=t.transforms[Se](Te)||Te;return Te}function l(ue,Te,Pe){let H=Te-1,Se=-1,ft=!1,ln,Zt,Ot,cn;for(;++H<=Pe;){const gt=ue[H];switch(gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{gt[0]==="enter"?Se++:Se--,cn=void 0;break}case"lineEndingBlank":{gt[0]==="enter"&&(ln&&!cn&&!Se&&!Ot&&(Ot=H),cn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:cn=void 0}if(!Se&&gt[0]==="enter"&&gt[1].type==="listItemPrefix"||Se===-1&&gt[0]==="exit"&&(gt[1].type==="listUnordered"||gt[1].type==="listOrdered")){if(ln){let Ba=H;for(Zt=void 0;Ba--;){const wn=ue[Ba];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Zt&&(ue[Zt][1].type="lineEndingBlank",ft=!0),wn[1].type="lineEnding",Zt=Ba}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}Ot&&(!Zt||Ot<Zt)&&(ln._spread=!0),ln.end=Object.assign({},Zt?ue[Zt][1].start:gt[1].end),ue.splice(Zt||H,0,["exit",ln,gt[2]]),H++,Pe++}if(gt[1].type==="listItemPrefix"){const Ba={type:"listItem",_spread:!1,start:Object.assign({},gt[1].start),end:void 0};ln=Ba,ue.splice(H,0,["enter",Ba,gt[2]]),H++,Pe++,Ot=void 0,cn=!0}}}return ue[Te][1]._spread=ft,Pe}function o(ue,Te){return Pe;function Pe(H){f.call(this,ue(H),H),Te&&Te.call(this,H)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(ue,Te,Pe){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Te,Pe||void 0]),ue.position={start:ns(Te.start),end:void 0}}function m(ue){return Te;function Te(Pe){ue&&ue.call(this,Pe),h.call(this,Pe)}}function h(ue,Te){const Pe=this.stack.pop(),H=this.tokenStack.pop();if(H)H[0].type!==ue.type&&(Te?Te.call(this,ue,H[0]):(H[1]||Lx).call(this,ue,H[0]));else throw new Error("Cannot close `"+ue.type+"` ("+to({start:ue.start,end:ue.end})+"): it’s not open");Pe.position.end=ns(ue.end)}function x(){return Mh(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function y(ue){if(this.data.expectingFirstListItemValue){const Te=this.stack[this.stack.length-2];Te.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function T(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.lang=ue}function N(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.meta=ue}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue.replace(/(\r?\n|\r)$/g,"")}function D(ue){const Te=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=Te,Pe.identifier=Ia(this.sliceSerialize(ue)).toLowerCase()}function k(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.title=ue}function z(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.url=ue}function V(ue){const Te=this.stack[this.stack.length-1];if(!Te.depth){const Pe=this.sliceSerialize(ue).length;Te.depth=Pe}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function L(ue){const Te=this.stack[this.stack.length-1];Te.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function K(){this.data.setextHeadingSlurpLineEnding=void 0}function se(ue){const Pe=this.stack[this.stack.length-1].children;let H=Pe[Pe.length-1];(!H||H.type!=="text")&&(H=_t(),H.position={start:ns(ue.start),end:void 0},Pe.push(H)),this.stack.push(H)}function B(ue){const Te=this.stack.pop();Te.value+=this.sliceSerialize(ue),Te.position.end=ns(ue.end)}function U(ue){const Te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=Te.children[Te.children.length-1];Pe.position.end=ns(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Te.type)&&(se.call(this,ue),B.call(this,ue))}function te(){this.data.atHardBreak=!0}function ie(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue}function Z(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue}function ee(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue}function Q(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Te,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function $(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Te,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function pe(ue){const Te=this.sliceSerialize(ue),Pe=this.stack[this.stack.length-2];Pe.label=ik(Te),Pe.identifier=Ia(Te).toLowerCase()}function ke(){const ue=this.stack[this.stack.length-1],Te=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const H=ue.children;Pe.children=H}else Pe.alt=Te}function P(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.url=ue}function R(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.title=ue}function W(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ge(ue){const Te=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=Te,Pe.identifier=Ia(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function ve(ue){this.data.characterReferenceType=ue.type}function Ae(ue){const Te=this.sliceSerialize(ue),Pe=this.data.characterReferenceType;let H;Pe?(H=xy(Te,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):H=Dh(Te);const Se=this.stack[this.stack.length-1];Se.value+=H}function $e(ue){const Te=this.stack.pop();Te.position.end=ns(ue.end)}function dt(ue){B.call(this,ue);const Te=this.stack[this.stack.length-1];Te.url=this.sliceSerialize(ue)}function ut(ue){B.call(this,ue);const Te=this.stack[this.stack.length-1];Te.url="mailto:"+this.sliceSerialize(ue)}function Ft(){return{type:"blockquote",children:[]}}function yn(){return{type:"code",lang:null,meta:null,value:""}}function da(){return{type:"inlineCode",value:""}}function Aa(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function un(){return{type:"emphasis",children:[]}}function Qn(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function Dn(){return{type:"html",value:""}}function Cn(){return{type:"image",title:null,url:"",alt:null}}function fa(){return{type:"link",title:null,url:"",children:[]}}function Ca(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function Wa(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function ja(){return{type:"paragraph",children:[]}}function Ar(){return{type:"strong",children:[]}}function _t(){return{type:"text",value:""}}function Ja(){return{type:"thematicBreak"}}}function ns(e){return{line:e.line,column:e.column,offset:e.offset}}function ky(e,t){let a=-1;for(;++a<t.length;){const s=t[a];Array.isArray(s)?ky(e,s):ck(e,s)}}function ck(e,t){let a;for(a in t)if(wy.call(t,a))switch(a){case"canContainEols":{const s=t[a];s&&e[a].push(...s);break}case"transforms":{const s=t[a];s&&e[a].push(...s);break}case"enter":case"exit":{const s=t[a];s&&Object.assign(e[a],s);break}}}function Lx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+to({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+to({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+to({start:t.start,end:t.end})+") is still open")}function dk(e){const t=this;t.parser=a;function a(s){return ok(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function fk(e,t){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function mk(e,t){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
411
- `}]}function hk(e,t){const a=t.value?t.value+`
412
- `:"",s={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:s,children:[{type:"text",value:a}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function pk(e,t){const a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function gk(e,t){const a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bk(e,t){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),l=Gi(s.toLowerCase()),o=e.footnoteOrder.indexOf(s);let d,f=e.footnoteCounts.get(s);f===void 0?(f=0,e.footnoteOrder.push(s),d=e.footnoteOrder.length):d=o+1,f+=1,e.footnoteCounts.set(s,f);const m={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+l,id:a+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function xk(e,t){const a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ek(e,t){if(e.options.allowDangerousHtml){const a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function Ry(e,t){const a=t.referenceType;let s="]";if(a==="collapsed"?s+="[]":a==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const d=l[l.length-1];return d&&d.type==="text"?d.value+=s:l.push({type:"text",value:s}),l}function yk(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return Ry(e,t);const l={src:Gi(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function Tk(e,t){const a={src:Gi(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,s),e.applyData(t,s)}function _k(e,t){const a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);const s={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,s),e.applyData(t,s)}function Nk(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return Ry(e,t);const l={href:Gi(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Sk(e,t){const a={href:Gi(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function vk(e,t,a){const s=e.all(t),l=a?Ak(a):Oy(t),o={},d=[];if(typeof t.checked=="boolean"){const x=s[0];let b;x&&x.type==="element"&&x.tagName==="p"?b=x:(b={type:"element",tagName:"p",properties:{},children:[]},s.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<s.length;){const x=s[f];(l||f!==0||x.type!=="element"||x.tagName!=="p")&&d.push({type:"text",value:`
410
+ `;break}case-2:{d=t?" ":" ";break}case-1:{if(!t&&l)continue;d=" ";break}default:d=String.fromCharCode(o)}l=o===-2,s.push(d)}return s.join("")}function ak(e){const s={constructs:by([J5,...(e||{}).extensions||[]]),content:l(xw),defined:[],document:l(yw),flow:l(P5),lazy:{},string:l(F5),text:l(z5)};return s;function l(o){return d;function d(f){return ek(s,o,f)}}}function rk(e){for(;!_y(e););return e}const Dx=/[\0\t\n\r]/g;function sk(){let e=1,t="",a=!0,s;return l;function l(o,d,f){const m=[];let h,x,b,y,T;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(d||void 0).decode(o)),b=0,t="",a&&(o.charCodeAt(0)===65279&&b++,a=void 0);b<o.length;){if(Dx.lastIndex=b,h=Dx.exec(o),y=h&&h.index!==void 0?h.index:o.length,T=o.charCodeAt(y),!h){t=o.slice(b);break}if(T===10&&b===y&&s)m.push(-3),s=void 0;else switch(s&&(m.push(-5),s=void 0),b<y&&(m.push(o.slice(b,y)),e+=y-b),T){case 0:{m.push(65533),e++;break}case 9:{for(x=Math.ceil(e/4)*4,m.push(-2);e++<x;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:s=!0,e=1}b=y+1}return f&&(s&&m.push(-5),t&&m.push(t),m.push(null)),m}}const ik=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lk(e){return e.replace(ik,ok)}function ok(e,t,a){if(t)return t;if(a.charCodeAt(0)===35){const l=a.charCodeAt(1),o=l===120||l===88;return xy(a.slice(o?2:1),o?16:10)}return Dh(a)||e}const wy={}.hasOwnProperty;function uk(e,t,a){return t&&typeof t=="object"&&(a=t,t=void 0),ck(a)(rk(ak(a).document().write(sk()(e,t,!0))))}function ck(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fa),autolinkProtocol:se,autolinkEmail:se,atxHeading:o(Qn),blockQuote:o(Ft),characterEscape:se,characterReference:se,codeFenced:o(yn),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:o(yn,d),codeText:o(da,d),codeTextData:se,data:se,codeFlowValue:se,definition:o(Aa),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:o(un),hardBreakEscape:o(Je),hardBreakTrailing:o(Je),htmlFlow:o(Dn,d),htmlFlowData:se,htmlText:o(Dn,d),htmlTextData:se,image:o(Cn),label:d,link:o(fa),listItem:o(Wa),listItemValue:y,listOrdered:o(Ca,b),listUnordered:o(Ca),paragraph:o(ja),reference:O,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:o(Qn),strong:o(Ar),thematicBreak:o(Ja)},exit:{atxHeading:m(),atxHeadingSequence:V,autolink:m(),autolinkEmail:ut,autolinkProtocol:dt,blockQuote:m(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:Ae,characterReference:$e,codeFenced:m(C),codeFencedFence:S,codeFencedFenceInfo:T,codeFencedFenceMeta:N,codeFlowValue:B,codeIndented:m(A),codeText:m(ee),codeTextData:B,data:B,definition:m(),definitionDestinationString:z,definitionLabelString:D,definitionTitleString:k,emphasis:m(),hardBreakEscape:m(te),hardBreakTrailing:m(te),htmlFlow:m(ie),htmlFlowData:B,htmlText:m(Z),htmlTextData:B,image:m($),label:ke,labelText:pe,lineEnding:U,link:m(Q),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:ge,resourceDestinationString:P,resourceTitleString:R,resource:W,setextHeading:m(K),setextHeadingLineSequence:L,setextHeadingText:M,strong:m(),thematicBreak:m()}};ky(t,(e||{}).mdastExtensions||[]);const a={};return s;function s(ue){let Te={type:"root",children:[]};const Pe={stack:[Te],tokenStack:[],config:t,enter:f,exit:h,buffer:d,resume:x,data:a},H=[];let Se=-1;for(;++Se<ue.length;)if(ue[Se][1].type==="listOrdered"||ue[Se][1].type==="listUnordered")if(ue[Se][0]==="enter")H.push(Se);else{const ft=H.pop();Se=l(ue,ft,Se)}for(Se=-1;++Se<ue.length;){const ft=t[ue[Se][0]];wy.call(ft,ue[Se][1].type)&&ft[ue[Se][1].type].call(Object.assign({sliceSerialize:ue[Se][2].sliceSerialize},Pe),ue[Se][1])}if(Pe.tokenStack.length>0){const ft=Pe.tokenStack[Pe.tokenStack.length-1];(ft[1]||Lx).call(Pe,void 0,ft[0])}for(Te.position={start:ns(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:ns(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Se=-1;++Se<t.transforms.length;)Te=t.transforms[Se](Te)||Te;return Te}function l(ue,Te,Pe){let H=Te-1,Se=-1,ft=!1,ln,Zt,Ot,cn;for(;++H<=Pe;){const gt=ue[H];switch(gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{gt[0]==="enter"?Se++:Se--,cn=void 0;break}case"lineEndingBlank":{gt[0]==="enter"&&(ln&&!cn&&!Se&&!Ot&&(Ot=H),cn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:cn=void 0}if(!Se&&gt[0]==="enter"&&gt[1].type==="listItemPrefix"||Se===-1&&gt[0]==="exit"&&(gt[1].type==="listUnordered"||gt[1].type==="listOrdered")){if(ln){let Ba=H;for(Zt=void 0;Ba--;){const wn=ue[Ba];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Zt&&(ue[Zt][1].type="lineEndingBlank",ft=!0),wn[1].type="lineEnding",Zt=Ba}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}Ot&&(!Zt||Ot<Zt)&&(ln._spread=!0),ln.end=Object.assign({},Zt?ue[Zt][1].start:gt[1].end),ue.splice(Zt||H,0,["exit",ln,gt[2]]),H++,Pe++}if(gt[1].type==="listItemPrefix"){const Ba={type:"listItem",_spread:!1,start:Object.assign({},gt[1].start),end:void 0};ln=Ba,ue.splice(H,0,["enter",Ba,gt[2]]),H++,Pe++,Ot=void 0,cn=!0}}}return ue[Te][1]._spread=ft,Pe}function o(ue,Te){return Pe;function Pe(H){f.call(this,ue(H),H),Te&&Te.call(this,H)}}function d(){this.stack.push({type:"fragment",children:[]})}function f(ue,Te,Pe){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Te,Pe||void 0]),ue.position={start:ns(Te.start),end:void 0}}function m(ue){return Te;function Te(Pe){ue&&ue.call(this,Pe),h.call(this,Pe)}}function h(ue,Te){const Pe=this.stack.pop(),H=this.tokenStack.pop();if(H)H[0].type!==ue.type&&(Te?Te.call(this,ue,H[0]):(H[1]||Lx).call(this,ue,H[0]));else throw new Error("Cannot close `"+ue.type+"` ("+to({start:ue.start,end:ue.end})+"): it’s not open");Pe.position.end=ns(ue.end)}function x(){return Mh(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function y(ue){if(this.data.expectingFirstListItemValue){const Te=this.stack[this.stack.length-2];Te.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function T(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.lang=ue}function N(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.meta=ue}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function A(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue.replace(/(\r?\n|\r)$/g,"")}function D(ue){const Te=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=Te,Pe.identifier=Ia(this.sliceSerialize(ue)).toLowerCase()}function k(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.title=ue}function z(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.url=ue}function V(ue){const Te=this.stack[this.stack.length-1];if(!Te.depth){const Pe=this.sliceSerialize(ue).length;Te.depth=Pe}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function L(ue){const Te=this.stack[this.stack.length-1];Te.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function K(){this.data.setextHeadingSlurpLineEnding=void 0}function se(ue){const Pe=this.stack[this.stack.length-1].children;let H=Pe[Pe.length-1];(!H||H.type!=="text")&&(H=_t(),H.position={start:ns(ue.start),end:void 0},Pe.push(H)),this.stack.push(H)}function B(ue){const Te=this.stack.pop();Te.value+=this.sliceSerialize(ue),Te.position.end=ns(ue.end)}function U(ue){const Te=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=Te.children[Te.children.length-1];Pe.position.end=ns(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Te.type)&&(se.call(this,ue),B.call(this,ue))}function te(){this.data.atHardBreak=!0}function ie(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue}function Z(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue}function ee(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.value=ue}function Q(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Te,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function $(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Te=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Te,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function pe(ue){const Te=this.sliceSerialize(ue),Pe=this.stack[this.stack.length-2];Pe.label=lk(Te),Pe.identifier=Ia(Te).toLowerCase()}function ke(){const ue=this.stack[this.stack.length-1],Te=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const H=ue.children;Pe.children=H}else Pe.alt=Te}function P(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.url=ue}function R(){const ue=this.resume(),Te=this.stack[this.stack.length-1];Te.title=ue}function W(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ge(ue){const Te=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=Te,Pe.identifier=Ia(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function ve(ue){this.data.characterReferenceType=ue.type}function Ae(ue){const Te=this.sliceSerialize(ue),Pe=this.data.characterReferenceType;let H;Pe?(H=xy(Te,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):H=Dh(Te);const Se=this.stack[this.stack.length-1];Se.value+=H}function $e(ue){const Te=this.stack.pop();Te.position.end=ns(ue.end)}function dt(ue){B.call(this,ue);const Te=this.stack[this.stack.length-1];Te.url=this.sliceSerialize(ue)}function ut(ue){B.call(this,ue);const Te=this.stack[this.stack.length-1];Te.url="mailto:"+this.sliceSerialize(ue)}function Ft(){return{type:"blockquote",children:[]}}function yn(){return{type:"code",lang:null,meta:null,value:""}}function da(){return{type:"inlineCode",value:""}}function Aa(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function un(){return{type:"emphasis",children:[]}}function Qn(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function Dn(){return{type:"html",value:""}}function Cn(){return{type:"image",title:null,url:"",alt:null}}function fa(){return{type:"link",title:null,url:"",children:[]}}function Ca(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function Wa(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function ja(){return{type:"paragraph",children:[]}}function Ar(){return{type:"strong",children:[]}}function _t(){return{type:"text",value:""}}function Ja(){return{type:"thematicBreak"}}}function ns(e){return{line:e.line,column:e.column,offset:e.offset}}function ky(e,t){let a=-1;for(;++a<t.length;){const s=t[a];Array.isArray(s)?ky(e,s):dk(e,s)}}function dk(e,t){let a;for(a in t)if(wy.call(t,a))switch(a){case"canContainEols":{const s=t[a];s&&e[a].push(...s);break}case"transforms":{const s=t[a];s&&e[a].push(...s);break}case"enter":case"exit":{const s=t[a];s&&Object.assign(e[a],s);break}}}function Lx(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+to({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+to({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+to({start:t.start,end:t.end})+") is still open")}function fk(e){const t=this;t.parser=a;function a(s){return uk(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function mk(e,t){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,a),e.applyData(t,a)}function hk(e,t){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,a),[e.applyData(t,a),{type:"text",value:`
411
+ `}]}function pk(e,t){const a=t.value?t.value+`
412
+ `:"",s={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:s,children:[{type:"text",value:a}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function gk(e,t){const a={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bk(e,t){const a={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function xk(e,t){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),l=Gi(s.toLowerCase()),o=e.footnoteOrder.indexOf(s);let d,f=e.footnoteCounts.get(s);f===void 0?(f=0,e.footnoteOrder.push(s),d=e.footnoteOrder.length):d=o+1,f+=1,e.footnoteCounts.set(s,f);const m={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+l,id:a+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function Ek(e,t){const a={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function yk(e,t){if(e.options.allowDangerousHtml){const a={type:"raw",value:t.value};return e.patch(t,a),e.applyData(t,a)}}function Ry(e,t){const a=t.referenceType;let s="]";if(a==="collapsed"?s+="[]":a==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const d=l[l.length-1];return d&&d.type==="text"?d.value+=s:l.push({type:"text",value:s}),l}function Tk(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return Ry(e,t);const l={src:Gi(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function _k(e,t){const a={src:Gi(t.url)};t.alt!==null&&t.alt!==void 0&&(a.alt=t.alt),t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,s),e.applyData(t,s)}function Nk(e,t){const a={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,a);const s={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(t,s),e.applyData(t,s)}function Sk(e,t){const a=String(t.identifier).toUpperCase(),s=e.definitionById.get(a);if(!s)return Ry(e,t);const l={href:Gi(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function vk(e,t){const a={href:Gi(t.url)};t.title!==null&&t.title!==void 0&&(a.title=t.title);const s={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Ak(e,t,a){const s=e.all(t),l=a?Ck(a):Oy(t),o={},d=[];if(typeof t.checked=="boolean"){const x=s[0];let b;x&&x.type==="element"&&x.tagName==="p"?b=x:(b={type:"element",tagName:"p",properties:{},children:[]},s.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<s.length;){const x=s[f];(l||f!==0||x.type!=="element"||x.tagName!=="p")&&d.push({type:"text",value:`
413
413
  `}),x.type==="element"&&x.tagName==="p"&&!l?d.push(...x.children):d.push(x)}const m=s[s.length-1];m&&(l||m.type!=="element"||m.tagName!=="p")&&d.push({type:"text",value:`
414
- `});const h={type:"element",tagName:"li",properties:o,children:d};return e.patch(t,h),e.applyData(t,h)}function Ak(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const a=e.children;let s=-1;for(;!t&&++s<a.length;)t=Oy(a[s])}return t}function Oy(e){const t=e.spread;return t??e.children.length>1}function Ck(e,t){const a={},s=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++l<s.length;){const d=s[l];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function wk(e,t){const a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function kk(e,t){const a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function Rk(e,t){const a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ok(e,t){const a=e.all(t),s=a.shift(),l=[];if(s){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],d),l.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=Xa(t.children[1]),m=zc(t.children[t.children.length-1]);f&&m&&(d.position={start:f,end:m}),l.push(d)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function Ik(e,t,a){const s=a?a.children:void 0,o=(s?s.indexOf(t):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,f=d?d.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const b=t.children[m],y={},T=d?d[m]:void 0;T&&(y.align=T);let N={type:"element",tagName:o,properties:y,children:[]};b&&(N.children=e.all(b),e.patch(b,N),N=e.applyData(b,N)),h.push(N)}const x={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,x),e.applyData(t,x)}function Mk(e,t){const a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}const jx=9,Bx=32;function Dk(e){const t=String(e),a=/\r?\n|\r/g;let s=a.exec(t),l=0;const o=[];for(;s;)o.push(Px(t.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=a.exec(t);return o.push(Px(t.slice(l),l>0,!1)),o.join("")}function Px(e,t,a){let s=0,l=e.length;if(t){let o=e.codePointAt(s);for(;o===jx||o===Bx;)s++,o=e.codePointAt(s)}if(a){let o=e.codePointAt(l-1);for(;o===jx||o===Bx;)l--,o=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function Lk(e,t){const a={type:"text",value:Dk(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function jk(e,t){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}const Bk={blockquote:fk,break:mk,code:hk,delete:pk,emphasis:gk,footnoteReference:bk,heading:xk,html:Ek,imageReference:yk,image:Tk,inlineCode:_k,linkReference:Nk,link:Sk,listItem:vk,list:Ck,paragraph:wk,root:kk,strong:Rk,table:Ok,tableCell:Mk,tableRow:Ik,text:Lk,thematicBreak:jk,toml:Qu,yaml:Qu,definition:Qu,footnoteDefinition:Qu};function Qu(){}const Iy=-1,$c=0,ao=1,_c=2,jh=3,Bh=4,Ph=5,Uh=6,My=7,Dy=8,Ly=typeof self=="object"?self:globalThis,Ux=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ly[e](t)},Pk=(e,t)=>{const a=(l,o)=>(e.set(o,l),l),s=l=>{if(e.has(l))return e.get(l);const[o,d]=t[l];switch(o){case $c:case Iy:return a(d,l);case ao:{const f=a([],l);for(const m of d)f.push(s(m));return f}case _c:{const f=a({},l);for(const[m,h]of d)f[s(m)]=s(h);return f}case jh:return a(new Date(d),l);case Bh:{const{source:f,flags:m}=d;return a(new RegExp(f,m),l)}case Ph:{const f=a(new Map,l);for(const[m,h]of d)f.set(s(m),s(h));return f}case Uh:{const f=a(new Set,l);for(const m of d)f.add(s(m));return f}case My:{const{name:f,message:m}=d;return a(typeof Ly[f]=="function"?Ux(f,m):new Error(m),l)}case Dy:return a(BigInt(d),l);case"BigInt":return a(Object(BigInt(d)),l);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return a(new DataView(f),d)}}return a(Ux(o,d),l)};return s},Hx=e=>Pk(new Map,e)(0),js="",{toString:Uk}={},{keys:Hk}=Object,Ql=e=>{const t=typeof e;if(t!=="object"||!e)return[$c,t];const a=Uk.call(e).slice(8,-1);switch(a){case"Array":return[ao,js];case"Object":return[_c,js];case"Date":return[jh,js];case"RegExp":return[Bh,js];case"Map":return[Ph,js];case"Set":return[Uh,js];case"DataView":return[ao,a]}return a.includes("Array")?[ao,a]:e instanceof Error?[My,e.name||"Error"]:[_c,a]},Xu=([e,t])=>e===$c&&(t==="function"||t==="symbol"),Fk=(e,t,a,s)=>{const l=(d,f)=>{const m=s.push(d)-1;return a.set(f,m),m},o=d=>{if(a.has(d))return a.get(d);let[f,m]=Ql(d);switch(f){case $c:{let x=d;switch(m){case"bigint":f=Dy,x=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);x=null;break;case"undefined":return l([Iy],d)}return l([f,x],d)}case ao:{if(m){let y=d;return m==="DataView"?y=new Uint8Array(d.buffer):m==="ArrayBuffer"&&(y=new Uint8Array(d)),l([m,[...y]],d)}const x=[],b=l([f,x],d);for(const y of d)x.push(o(y));return b}case _c:{if(m)switch(m){case"BigInt":return l([m,d.toString()],d);case"Boolean":case"Number":case"String":return l([m,d.valueOf()],d)}if(t&&"toJSON"in d)return o(d.toJSON());const x=[],b=l([f,x],d);for(const y of Hk(d))(e||!Xu(Ql(d[y])))&&x.push([o(y),o(d[y])]);return b}case jh:return l([f,isNaN(d.getTime())?js:d.toISOString()],d);case Bh:{const{source:x,flags:b}=d;return l([f,{source:x,flags:b}],d)}case Ph:{const x=[],b=l([f,x],d);for(const[y,T]of d)(e||!(Xu(Ql(y))||Xu(Ql(T))))&&x.push([o(y),o(T)]);return b}case Uh:{const x=[],b=l([f,x],d);for(const y of d)(e||!Xu(Ql(y)))&&x.push(o(y));return b}}const{message:h}=d;return l([f,{name:m,message:h}],d)};return o},Fx=(e,{json:t,lossy:a}={})=>{const s=[];return Fk(!(t||a),!!t,new Map,s)(e),s},Ui=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Hx(Fx(e,t)):structuredClone(e):(e,t)=>Hx(Fx(e,t));function zk(e,t){const a=[{type:"text",value:"↩"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function qk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Yk(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||zk,s=e.options.footnoteBackLabel||qk,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const x=e.all(h),b=String(h.identifier).toUpperCase(),y=Gi(b.toLowerCase());let T=0;const N=[],S=e.footnoteCounts.get(b);for(;S!==void 0&&++T<=S;){N.length>0&&N.push({type:"text",value:" "});let D=typeof a=="string"?a:a(m,T);typeof D=="string"&&(D={type:"text",value:D}),N.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(T>1?"-"+T:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(m,T),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}const C=x[x.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const D=C.children[C.children.length-1];D&&D.type==="text"?D.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...N)}else x.push(...N);const A={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(x,!0)};e.patch(h,A),f.push(A)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ui(d),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
414
+ `});const h={type:"element",tagName:"li",properties:o,children:d};return e.patch(t,h),e.applyData(t,h)}function Ck(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const a=e.children;let s=-1;for(;!t&&++s<a.length;)t=Oy(a[s])}return t}function Oy(e){const t=e.spread;return t??e.children.length>1}function wk(e,t){const a={},s=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(a.start=t.start);++l<s.length;){const d=s[l];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:a,children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function kk(e,t){const a={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Rk(e,t){const a={type:"root",children:e.wrap(e.all(t))};return e.patch(t,a),e.applyData(t,a)}function Ok(e,t){const a={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ik(e,t){const a=e.all(t),s=a.shift(),l=[];if(s){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],d),l.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},f=Xa(t.children[1]),m=zc(t.children[t.children.length-1]);f&&m&&(d.position={start:f,end:m}),l.push(d)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)}function Mk(e,t,a){const s=a?a.children:void 0,o=(s?s.indexOf(t):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,f=d?d.length:t.children.length;let m=-1;const h=[];for(;++m<f;){const b=t.children[m],y={},T=d?d[m]:void 0;T&&(y.align=T);let N={type:"element",tagName:o,properties:y,children:[]};b&&(N.children=e.all(b),e.patch(b,N),N=e.applyData(b,N)),h.push(N)}const x={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,x),e.applyData(t,x)}function Dk(e,t){const a={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}const jx=9,Bx=32;function Lk(e){const t=String(e),a=/\r?\n|\r/g;let s=a.exec(t),l=0;const o=[];for(;s;)o.push(Px(t.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=a.exec(t);return o.push(Px(t.slice(l),l>0,!1)),o.join("")}function Px(e,t,a){let s=0,l=e.length;if(t){let o=e.codePointAt(s);for(;o===jx||o===Bx;)s++,o=e.codePointAt(s)}if(a){let o=e.codePointAt(l-1);for(;o===jx||o===Bx;)l--,o=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function jk(e,t){const a={type:"text",value:Lk(String(t.value))};return e.patch(t,a),e.applyData(t,a)}function Bk(e,t){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,a),e.applyData(t,a)}const Pk={blockquote:mk,break:hk,code:pk,delete:gk,emphasis:bk,footnoteReference:xk,heading:Ek,html:yk,imageReference:Tk,image:_k,inlineCode:Nk,linkReference:Sk,link:vk,listItem:Ak,list:wk,paragraph:kk,root:Rk,strong:Ok,table:Ik,tableCell:Dk,tableRow:Mk,text:jk,thematicBreak:Bk,toml:Qu,yaml:Qu,definition:Qu,footnoteDefinition:Qu};function Qu(){}const Iy=-1,$c=0,ao=1,_c=2,jh=3,Bh=4,Ph=5,Uh=6,My=7,Dy=8,Ly=typeof self=="object"?self:globalThis,Ux=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ly[e](t)},Uk=(e,t)=>{const a=(l,o)=>(e.set(o,l),l),s=l=>{if(e.has(l))return e.get(l);const[o,d]=t[l];switch(o){case $c:case Iy:return a(d,l);case ao:{const f=a([],l);for(const m of d)f.push(s(m));return f}case _c:{const f=a({},l);for(const[m,h]of d)f[s(m)]=s(h);return f}case jh:return a(new Date(d),l);case Bh:{const{source:f,flags:m}=d;return a(new RegExp(f,m),l)}case Ph:{const f=a(new Map,l);for(const[m,h]of d)f.set(s(m),s(h));return f}case Uh:{const f=a(new Set,l);for(const m of d)f.add(s(m));return f}case My:{const{name:f,message:m}=d;return a(typeof Ly[f]=="function"?Ux(f,m):new Error(m),l)}case Dy:return a(BigInt(d),l);case"BigInt":return a(Object(BigInt(d)),l);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:f}=new Uint8Array(d);return a(new DataView(f),d)}}return a(Ux(o,d),l)};return s},Hx=e=>Uk(new Map,e)(0),js="",{toString:Hk}={},{keys:Fk}=Object,Ql=e=>{const t=typeof e;if(t!=="object"||!e)return[$c,t];const a=Hk.call(e).slice(8,-1);switch(a){case"Array":return[ao,js];case"Object":return[_c,js];case"Date":return[jh,js];case"RegExp":return[Bh,js];case"Map":return[Ph,js];case"Set":return[Uh,js];case"DataView":return[ao,a]}return a.includes("Array")?[ao,a]:e instanceof Error?[My,e.name||"Error"]:[_c,a]},Xu=([e,t])=>e===$c&&(t==="function"||t==="symbol"),zk=(e,t,a,s)=>{const l=(d,f)=>{const m=s.push(d)-1;return a.set(f,m),m},o=d=>{if(a.has(d))return a.get(d);let[f,m]=Ql(d);switch(f){case $c:{let x=d;switch(m){case"bigint":f=Dy,x=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);x=null;break;case"undefined":return l([Iy],d)}return l([f,x],d)}case ao:{if(m){let y=d;return m==="DataView"?y=new Uint8Array(d.buffer):m==="ArrayBuffer"&&(y=new Uint8Array(d)),l([m,[...y]],d)}const x=[],b=l([f,x],d);for(const y of d)x.push(o(y));return b}case _c:{if(m)switch(m){case"BigInt":return l([m,d.toString()],d);case"Boolean":case"Number":case"String":return l([m,d.valueOf()],d)}if(t&&"toJSON"in d)return o(d.toJSON());const x=[],b=l([f,x],d);for(const y of Fk(d))(e||!Xu(Ql(d[y])))&&x.push([o(y),o(d[y])]);return b}case jh:return l([f,isNaN(d.getTime())?js:d.toISOString()],d);case Bh:{const{source:x,flags:b}=d;return l([f,{source:x,flags:b}],d)}case Ph:{const x=[],b=l([f,x],d);for(const[y,T]of d)(e||!(Xu(Ql(y))||Xu(Ql(T))))&&x.push([o(y),o(T)]);return b}case Uh:{const x=[],b=l([f,x],d);for(const y of d)(e||!Xu(Ql(y)))&&x.push(o(y));return b}}const{message:h}=d;return l([f,{name:m,message:h}],d)};return o},Fx=(e,{json:t,lossy:a}={})=>{const s=[];return zk(!(t||a),!!t,new Map,s)(e),s},Ui=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Hx(Fx(e,t)):structuredClone(e):(e,t)=>Hx(Fx(e,t));function qk(e,t){const a=[{type:"text",value:"↩"}];return t>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),a}function Yk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function $k(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||qk,s=e.options.footnoteBackLabel||Yk,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const x=e.all(h),b=String(h.identifier).toUpperCase(),y=Gi(b.toLowerCase());let T=0;const N=[],S=e.footnoteCounts.get(b);for(;S!==void 0&&++T<=S;){N.length>0&&N.push({type:"text",value:" "});let D=typeof a=="string"?a:a(m,T);typeof D=="string"&&(D={type:"text",value:D}),N.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(T>1?"-"+T:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(m,T),className:["data-footnote-backref"]},children:Array.isArray(D)?D:[D]})}const C=x[x.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const D=C.children[C.children.length-1];D&&D.type==="text"?D.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...N)}else x.push(...N);const A={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(x,!0)};e.patch(h,A),f.push(A)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Ui(d),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
415
415
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
416
- `}]}}const Ao=(function(e){if(e==null)return Vk;if(typeof e=="function")return Gc(e);if(typeof e=="object")return Array.isArray(e)?$k(e):Gk(e);if(typeof e=="string")return Kk(e);throw new Error("Expected function, string, or object as test")});function $k(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Ao(e[a]);return Gc(s);function s(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function Gk(e){const t=e;return Gc(a);function a(s){const l=s;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function Kk(e){return Gc(t);function t(a){return a&&a.type===e}}function Gc(e){return t;function t(a,s,l){return!!(Qk(a)&&e.call(this,a,typeof s=="number"?s:void 0,l||void 0))}}function Vk(){return!0}function Qk(e){return e!==null&&typeof e=="object"&&"type"in e}const jy=[],Xk=!0,Zm=!1,Zk="skip";function By(e,t,a,s){let l;typeof t=="function"&&typeof a!="function"?(s=a,a=t):l=t;const o=Ao(l),d=s?-1:1;f(e,void 0,[])();function f(m,h,x){const b=m&&typeof m=="object"?m:{};if(typeof b.type=="string"){const T=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(m.type+(T?"<"+T+">":""))+")"})}return y;function y(){let T=jy,N,S,C;if((!t||o(m,h,x[x.length-1]||void 0))&&(T=Wk(a(m,x)),T[0]===Zm))return T;if("children"in m&&m.children){const A=m;if(A.children&&T[0]!==Zk)for(S=(s?A.children.length:-1)+d,C=x.concat(A);S>-1&&S<A.children.length;){const D=A.children[S];if(N=f(D,S,C)(),N[0]===Zm)return N;S=typeof N[1]=="number"?N[1]:S+d}}return T}}}function Wk(e){return Array.isArray(e)?e:typeof e=="number"?[Xk,e]:e==null?jy:[e]}function Co(e,t,a,s){let l,o,d;typeof t=="function"&&typeof a!="function"?(o=void 0,d=t,l=a):(o=t,d=a,l=s),By(e,o,f,l);function f(m,h){const x=h[h.length-1],b=x?x.children.indexOf(m):void 0;return d(m,b,x)}}const Wm={}.hasOwnProperty,Jk={};function eR(e,t){const a=t||Jk,s=new Map,l=new Map,o=new Map,d={...Bk,...a.handlers},f={all:h,applyData:nR,definitionById:s,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:d,one:m,options:a,patch:tR,wrap:rR};return Co(e,function(x){if(x.type==="definition"||x.type==="footnoteDefinition"){const b=x.type==="definition"?s:l,y=String(x.identifier).toUpperCase();b.has(y)||b.set(y,x)}}),f;function m(x,b){const y=x.type,T=f.handlers[y];if(Wm.call(f.handlers,y)&&T)return T(f,x,b);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in x){const{children:S,...C}=x,A=Ui(C);return A.children=f.all(x),A}return Ui(x)}return(f.options.unknownHandler||aR)(f,x,b)}function h(x){const b=[];if("children"in x){const y=x.children;let T=-1;for(;++T<y.length;){const N=f.one(y[T],x);if(N){if(T&&y[T-1].type==="break"&&(!Array.isArray(N)&&N.type==="text"&&(N.value=zx(N.value)),!Array.isArray(N)&&N.type==="element")){const S=N.children[0];S&&S.type==="text"&&(S.value=zx(S.value))}Array.isArray(N)?b.push(...N):b.push(N)}}}return b}}function tR(e,t){e.position&&(t.position=qC(e))}function nR(e,t){let a=t;if(e&&e.data){const s=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof s=="string")if(a.type==="element")a.tagName=s;else{const d="children"in a?a.children:[a];a={type:"element",tagName:s,properties:{},children:d}}a.type==="element"&&o&&Object.assign(a.properties,Ui(o)),"children"in a&&a.children&&l!==null&&l!==void 0&&(a.children=l)}return a}function aR(e,t){const a=t.data||{},s="value"in t&&!(Wm.call(a,"hProperties")||Wm.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function rR(e,t){const a=[];let s=-1;for(t&&a.push({type:"text",value:`
416
+ `}]}}const Ao=(function(e){if(e==null)return Qk;if(typeof e=="function")return Gc(e);if(typeof e=="object")return Array.isArray(e)?Gk(e):Kk(e);if(typeof e=="string")return Vk(e);throw new Error("Expected function, string, or object as test")});function Gk(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=Ao(e[a]);return Gc(s);function s(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function Kk(e){const t=e;return Gc(a);function a(s){const l=s;let o;for(o in e)if(l[o]!==t[o])return!1;return!0}}function Vk(e){return Gc(t);function t(a){return a&&a.type===e}}function Gc(e){return t;function t(a,s,l){return!!(Xk(a)&&e.call(this,a,typeof s=="number"?s:void 0,l||void 0))}}function Qk(){return!0}function Xk(e){return e!==null&&typeof e=="object"&&"type"in e}const jy=[],Zk=!0,Zm=!1,Wk="skip";function By(e,t,a,s){let l;typeof t=="function"&&typeof a!="function"?(s=a,a=t):l=t;const o=Ao(l),d=s?-1:1;f(e,void 0,[])();function f(m,h,x){const b=m&&typeof m=="object"?m:{};if(typeof b.type=="string"){const T=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(m.type+(T?"<"+T+">":""))+")"})}return y;function y(){let T=jy,N,S,C;if((!t||o(m,h,x[x.length-1]||void 0))&&(T=Jk(a(m,x)),T[0]===Zm))return T;if("children"in m&&m.children){const A=m;if(A.children&&T[0]!==Wk)for(S=(s?A.children.length:-1)+d,C=x.concat(A);S>-1&&S<A.children.length;){const D=A.children[S];if(N=f(D,S,C)(),N[0]===Zm)return N;S=typeof N[1]=="number"?N[1]:S+d}}return T}}}function Jk(e){return Array.isArray(e)?e:typeof e=="number"?[Zk,e]:e==null?jy:[e]}function Co(e,t,a,s){let l,o,d;typeof t=="function"&&typeof a!="function"?(o=void 0,d=t,l=a):(o=t,d=a,l=s),By(e,o,f,l);function f(m,h){const x=h[h.length-1],b=x?x.children.indexOf(m):void 0;return d(m,b,x)}}const Wm={}.hasOwnProperty,eR={};function tR(e,t){const a=t||eR,s=new Map,l=new Map,o=new Map,d={...Pk,...a.handlers},f={all:h,applyData:aR,definitionById:s,footnoteById:l,footnoteCounts:o,footnoteOrder:[],handlers:d,one:m,options:a,patch:nR,wrap:sR};return Co(e,function(x){if(x.type==="definition"||x.type==="footnoteDefinition"){const b=x.type==="definition"?s:l,y=String(x.identifier).toUpperCase();b.has(y)||b.set(y,x)}}),f;function m(x,b){const y=x.type,T=f.handlers[y];if(Wm.call(f.handlers,y)&&T)return T(f,x,b);if(f.options.passThrough&&f.options.passThrough.includes(y)){if("children"in x){const{children:S,...C}=x,A=Ui(C);return A.children=f.all(x),A}return Ui(x)}return(f.options.unknownHandler||rR)(f,x,b)}function h(x){const b=[];if("children"in x){const y=x.children;let T=-1;for(;++T<y.length;){const N=f.one(y[T],x);if(N){if(T&&y[T-1].type==="break"&&(!Array.isArray(N)&&N.type==="text"&&(N.value=zx(N.value)),!Array.isArray(N)&&N.type==="element")){const S=N.children[0];S&&S.type==="text"&&(S.value=zx(S.value))}Array.isArray(N)?b.push(...N):b.push(N)}}}return b}}function nR(e,t){e.position&&(t.position=YC(e))}function aR(e,t){let a=t;if(e&&e.data){const s=e.data.hName,l=e.data.hChildren,o=e.data.hProperties;if(typeof s=="string")if(a.type==="element")a.tagName=s;else{const d="children"in a?a.children:[a];a={type:"element",tagName:s,properties:{},children:d}}a.type==="element"&&o&&Object.assign(a.properties,Ui(o)),"children"in a&&a.children&&l!==null&&l!==void 0&&(a.children=l)}return a}function rR(e,t){const a=t.data||{},s="value"in t&&!(Wm.call(a,"hProperties")||Wm.call(a,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function sR(e,t){const a=[];let s=-1;for(t&&a.push({type:"text",value:`
417
417
  `});++s<e.length;)s&&a.push({type:"text",value:`
418
418
  `}),a.push(e[s]);return t&&e.length>0&&a.push({type:"text",value:`
419
- `}),a}function zx(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function qx(e,t){const a=eR(e,t),s=a.one(e,void 0),l=Yk(a),o=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
420
- `},l),o}function sR(e,t){return e&&"run"in e?async function(a,s){const l=qx(a,{file:s,...t});await e.run(l,s)}:function(a,s){return qx(a,{file:s,...e||t})}}function Yx(e){if(e)throw e}var bm,$x;function iR(){if($x)return bm;$x=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var x=e.call(h,"constructor"),b=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!x&&!b)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},d=function(h,x){a&&x.name==="__proto__"?a(h,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):h[x.name]=x.newValue},f=function(h,x){if(x==="__proto__")if(e.call(h,x)){if(s)return s(h,x).value}else return;return h[x]};return bm=function m(){var h,x,b,y,T,N,S=arguments[0],C=1,A=arguments.length,D=!1;for(typeof S=="boolean"&&(D=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<A;++C)if(h=arguments[C],h!=null)for(x in h)b=f(S,x),y=f(h,x),S!==y&&(D&&y&&(o(y)||(T=l(y)))?(T?(T=!1,N=b&&l(b)?b:[]):N=b&&o(b)?b:{},d(S,{name:x,newValue:m(D,N,y)})):typeof y<"u"&&d(S,{name:x,newValue:y}));return S},bm}var lR=iR();const xm=Rc(lR);function Jm(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oR(){const e=[],t={run:a,use:s};return t;function a(...l){let o=-1;const d=l.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...l);function f(m,...h){const x=e[++o];let b=-1;if(m){d(m);return}for(;++b<l.length;)(h[b]===null||h[b]===void 0)&&(h[b]=l[b]);l=h,x?uR(x,f)(...h):d(null,...h)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function uR(e,t){let a;return s;function s(...d){const f=e.length>d.length;let m;f&&d.push(l);try{m=e.apply(this,d)}catch(h){const x=h;if(f&&a)throw x;return l(x)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(d,...f){a||(a=!0,t(d,...f))}function o(d){l(null,d)}}const $a={basename:cR,dirname:dR,extname:fR,join:mR,sep:"/"};function cR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');wo(e);let a=0,s=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){a=l+1;break}}else s<0&&(o=!0,s=l+1);return s<0?"":e.slice(a,s)}if(t===e)return"";let d=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){a=l+1;break}}else d<0&&(o=!0,d=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(s=l):(f=-1,s=d));return a===s?s=d:s<0&&(s=e.length),e.slice(a,s)}function dR(e){if(wo(e),e.length===0)return".";let t=-1,a=e.length,s;for(;--a;)if(e.codePointAt(a)===47){if(s){t=a;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function fR(e){wo(e);let t=e.length,a=-1,s=0,l=-1,o=0,d;for(;t--;){const f=e.codePointAt(t);if(f===47){if(d){s=t+1;break}continue}a<0&&(d=!0,a=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||a<0||o===0||o===1&&l===a-1&&l===s+1?"":e.slice(l,a)}function mR(...e){let t=-1,a;for(;++t<e.length;)wo(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":hR(a)}function hR(e){wo(e);const t=e.codePointAt(0)===47;let a=pR(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function pR(e,t){let a="",s=0,l=-1,o=0,d=-1,f,m;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(l===d-1||o===1))if(l!==d-1&&o===2){if(a.length<2||s!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(m=a.lastIndexOf("/"),m!==a.length-1){m<0?(a="",s=0):(a=a.slice(0,m),s=a.length-1-a.lastIndexOf("/")),l=d,o=0;continue}}else if(a.length>0){a="",s=0,l=d,o=0;continue}}t&&(a=a.length>0?a+"/..":"..",s=2)}else a.length>0?a+="/"+e.slice(l+1,d):a=e.slice(l+1,d),s=d-l-1;l=d,o=0}else f===46&&o>-1?o++:o=-1}return a}function wo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const gR={cwd:bR};function bR(){return"/"}function eh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xR(e){if(typeof e=="string")e=new URL(e);else if(!eh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return ER(e)}function ER(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const s=t.codePointAt(a+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Em=["history","path","basename","stem","extname","dirname"];class Py{constructor(t){let a;t?eh(t)?a={path:t}:typeof t=="string"||yR(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":gR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Em.length;){const o=Em[s];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let l;for(l in a)Em.includes(l)||(this[l]=a[l])}get basename(){return typeof this.path=="string"?$a.basename(this.path):void 0}set basename(t){Tm(t,"basename"),ym(t,"basename"),this.path=$a.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$a.dirname(this.path):void 0}set dirname(t){Gx(this.basename,"dirname"),this.path=$a.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$a.extname(this.path):void 0}set extname(t){if(ym(t,"extname"),Gx(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$a.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eh(t)&&(t=xR(t)),Tm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$a.basename(this.path,this.extname):void 0}set stem(t){Tm(t,"stem"),ym(t,"stem"),this.path=$a.join(this.dirname||"",t+(this.extname||""))}fail(t,a,s){const l=this.message(t,a,s);throw l.fatal=!0,l}info(t,a,s){const l=this.message(t,a,s);return l.fatal=void 0,l}message(t,a,s){const l=new vn(t,a,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ym(e,t){if(e&&e.includes($a.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$a.sep+"`")}function Tm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Gx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function yR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const TR=(function(e){const s=this.constructor.prototype,l=s[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,s),o}),_R={}.hasOwnProperty;class Hh extends TR{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=oR()}copy(){const t=new Hh;let a=-1;for(;++a<this.attachers.length;){const s=this.attachers[a];t.use(...s)}return t.data(xm(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Sm("data",this.frozen),this.namespace[t]=a,this):_R.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Sm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=a.call(t,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=Zu(t),s=this.parser||this.Parser;return _m("parse",s),s(String(a),a)}process(t,a){const s=this;return this.freeze(),_m("process",this.parser||this.Parser),Nm("process",this.compiler||this.Compiler),a?l(void 0,a):new Promise(l);function l(o,d){const f=Zu(t),m=s.parse(f);s.run(m,f,function(x,b,y){if(x||!b||!y)return h(x);const T=b,N=s.stringify(T,y);vR(N)?y.value=N:y.result=N,h(x,y)});function h(x,b){x||!b?d(x):o?o(b):a(void 0,b)}}}processSync(t){let a=!1,s;return this.freeze(),_m("processSync",this.parser||this.Parser),Nm("processSync",this.compiler||this.Compiler),this.process(t,l),Vx("processSync","process",a),s;function l(o,d){a=!0,Yx(o),s=d}}run(t,a,s){Kx(t),this.freeze();const l=this.transformers;return!s&&typeof a=="function"&&(s=a,a=void 0),s?o(void 0,s):new Promise(o);function o(d,f){const m=Zu(a);l.run(t,m,h);function h(x,b,y){const T=b||t;x?f(x):d?d(T):s(void 0,T,y)}}}runSync(t,a){let s=!1,l;return this.run(t,a,o),Vx("runSync","run",s),l;function o(d,f){Yx(d),l=f,s=!0}}stringify(t,a){this.freeze();const s=Zu(a),l=this.compiler||this.Compiler;return Nm("stringify",l),Kx(t),l(t,s)}use(t,...a){const s=this.attachers,l=this.namespace;if(Sm("use",this.frozen),t!=null)if(typeof t=="function")m(t,a);else if(typeof t=="object")Array.isArray(t)?f(t):d(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[x,...b]=h;m(x,b)}else d(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function d(h){if(!("plugins"in h)&&!("settings"in h))throw new 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");f(h.plugins),h.settings&&(l.settings=xm(!0,l.settings,h.settings))}function f(h){let x=-1;if(h!=null)if(Array.isArray(h))for(;++x<h.length;){const b=h[x];o(b)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,x){let b=-1,y=-1;for(;++b<s.length;)if(s[b][0]===h){y=b;break}if(y===-1)s.push([h,...x]);else if(x.length>0){let[T,...N]=x;const S=s[y][1];Jm(S)&&Jm(T)&&(T=xm(!0,S,T)),s[y]=[h,T,...N]}}}}const NR=new Hh().freeze();function _m(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Nm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Kx(e){if(!Jm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Vx(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zu(e){return SR(e)?e:new Py(e)}function SR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function vR(e){return typeof e=="string"||AR(e)}function AR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Qx=[],Xx={allowDangerousHtml:!0},wR=/^(https?|ircs?|mailto|xmpp)$/i,kR=[{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 ls(e){const t=RR(e),a=OR(e);return IR(t.runSync(t.parse(a),a),e)}function RR(e){const t=e.rehypePlugins||Qx,a=e.remarkPlugins||Qx,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Xx}:Xx;return NR().use(dk).use(a).use(sR,s).use(t)}function OR(e){const t=e.children||"",a=new Py;return typeof t=="string"&&(a.value=t),a}function IR(e,t){const a=t.allowedElements,s=t.allowElement,l=t.components,o=t.disallowedElements,d=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||MR;for(const x of kR)Object.hasOwn(t,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+CR+x.id,void 0);return Co(e,h),VC(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(x,b,y){if(x.type==="raw"&&y&&typeof b=="number")return d?y.children.splice(b,1):y.children[b]={type:"text",value:x.value},b;if(x.type==="element"){let T;for(T in hm)if(Object.hasOwn(hm,T)&&Object.hasOwn(x.properties,T)){const N=x.properties[T],S=hm[T];(S===null||S.includes(x.tagName))&&(x.properties[T]=m(String(N||""),T,x))}}if(x.type==="element"){let T=a?!a.includes(x.tagName):o?o.includes(x.tagName):!1;if(!T&&s&&typeof b=="number"&&(T=!s(x,b,y)),T&&y&&typeof b=="number")return f&&x.children?y.children.splice(b,1,...x.children):y.children.splice(b,1),b}}}function MR(e){const t=e.indexOf(":"),a=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||a!==-1&&t>a||s!==-1&&t>s||wR.test(e.slice(0,t))?e:""}function Zx(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,l=a.indexOf(t);for(;l!==-1;)s++,l=a.indexOf(t,l+t.length);return s}function DR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function LR(e,t,a){const l=Ao((a||{}).ignore||[]),o=jR(t);let d=-1;for(;++d<o.length;)By(e,"text",f);function f(h,x){let b=-1,y;for(;++b<x.length;){const T=x[b],N=y?y.children:void 0;if(l(T,N?N.indexOf(T):void 0,y))return;y=T}if(y)return m(h,x)}function m(h,x){const b=x[x.length-1],y=o[d][0],T=o[d][1];let N=0;const C=b.children.indexOf(h);let A=!1,D=[];y.lastIndex=0;let k=y.exec(h.value);for(;k;){const z=k.index,V={index:k.index,input:k.input,stack:[...x,h]};let M=T(...k,V);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?y.lastIndex=z+1:(N!==z&&D.push({type:"text",value:h.value.slice(N,z)}),Array.isArray(M)?D.push(...M):M&&D.push(M),N=z+k[0].length,A=!0),!y.global)break;k=y.exec(h.value)}return A?(N<h.value.length&&D.push({type:"text",value:h.value.slice(N)}),b.children.splice(C,1,...D)):D=[h],C+D.length}}function jR(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<a.length;){const l=a[s];t.push([BR(l[0]),PR(l[1])])}return t}function BR(e){return typeof e=="string"?new RegExp(DR(e),"g"):e}function PR(e){return typeof e=="function"?e:function(){return e}}const vm="phrasing",Am=["autolink","link","image","label"];function UR(){return{transforms:[GR],enter:{literalAutolink:FR,literalAutolinkEmail:Cm,literalAutolinkHttp:Cm,literalAutolinkWww:Cm},exit:{literalAutolink:$R,literalAutolinkEmail:YR,literalAutolinkHttp:zR,literalAutolinkWww:qR}}}function HR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vm,notInConstruct:Am},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vm,notInConstruct:Am},{character:":",before:"[ps]",after:"\\/",inConstruct:vm,notInConstruct:Am}]}}function FR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Cm(e){this.config.enter.autolinkProtocol.call(this,e)}function zR(e){this.config.exit.autolinkProtocol.call(this,e)}function qR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function YR(e){this.config.exit.autolinkEmail.call(this,e)}function $R(e){this.exit(e)}function GR(e){LR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,KR],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),VR]],{ignore:["link","linkReference"]})}function KR(e,t,a,s,l){let o="";if(!Uy(l)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!QR(a)))return!1;const d=XR(a+s);if(!d[0])return!1;const f={type:"link",title:null,url:o+t+d[0],children:[{type:"text",value:t+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function VR(e,t,a,s){return!Uy(s,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function QR(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function XR(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],s=a.indexOf(")");const l=Zx(e,"(");let o=Zx(e,")");for(;s!==-1&&l>o;)e+=a.slice(0,s+1),a=a.slice(s+1),s=a.indexOf(")"),o++;return[e,a]}function Uy(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Fs(a)||qc(a))&&(!t||a!==47)}Hy.peek=sO;function ZR(){this.buffer()}function WR(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function JR(){this.buffer()}function eO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function tO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),a.label=t}function nO(e){this.exit(e)}function aO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),a.label=t}function rO(e){this.exit(e)}function sO(){return"["}function Hy(e,t,a,s){const l=a.createTracker(s);let o=l.move("[^");const d=a.enter("footnoteReference"),f=a.enter("reference");return o+=l.move(a.safe(a.associationId(e),{after:"]",before:o})),f(),d(),o+=l.move("]"),o}function iO(){return{enter:{gfmFootnoteCallString:ZR,gfmFootnoteCall:WR,gfmFootnoteDefinitionLabelString:JR,gfmFootnoteDefinition:eO},exit:{gfmFootnoteCallString:tO,gfmFootnoteCall:nO,gfmFootnoteDefinitionLabelString:aO,gfmFootnoteDefinition:rO}}}function lO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:Hy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(s,l,o,d){const f=o.createTracker(d);let m=f.move("[^");const h=o.enter("footnoteDefinition"),x=o.enter("label");return m+=f.move(o.safe(o.associationId(s),{before:m,after:"]"})),x(),m+=f.move("]:"),s.children&&s.children.length>0&&(f.shift(4),m+=f.move((t?`
421
- `:" ")+o.indentLines(o.containerFlow(s,f.current()),t?Fy:oO))),h(),m}}function oO(e,t,a){return t===0?e:Fy(e,t,a)}function Fy(e,t,a){return(a?"":" ")+e}const uO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zy.peek=hO;function cO(){return{canContainEols:["delete"],enter:{strikethrough:fO},exit:{strikethrough:mO}}}function dO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:uO}],handlers:{delete:zy}}}function fO(e){this.enter({type:"delete",children:[]},e)}function mO(e){this.exit(e)}function zy(e,t,a,s){const l=a.createTracker(s),o=a.enter("strikethrough");let d=l.move("~~");return d+=a.containerPhrasing(e,{...l.current(),before:d,after:"~"}),d+=l.move("~~"),o(),d}function hO(){return"~"}function pO(e){return e.length}function gO(e,t){const a=t||{},s=(a.align||[]).concat(),l=a.stringLength||pO,o=[],d=[],f=[],m=[];let h=0,x=-1;for(;++x<e.length;){const S=[],C=[];let A=-1;for(e[x].length>h&&(h=e[x].length);++A<e[x].length;){const D=bO(e[x][A]);if(a.alignDelimiters!==!1){const k=l(D);C[A]=k,(m[A]===void 0||k>m[A])&&(m[A]=k)}S.push(D)}d[x]=S,f[x]=C}let b=-1;if(typeof s=="object"&&"length"in s)for(;++b<h;)o[b]=Wx(s[b]);else{const S=Wx(s);for(;++b<h;)o[b]=S}b=-1;const y=[],T=[];for(;++b<h;){const S=o[b];let C="",A="";S===99?(C=":",A=":"):S===108?C=":":S===114&&(A=":");let D=a.alignDelimiters===!1?1:Math.max(1,m[b]-C.length-A.length);const k=C+"-".repeat(D)+A;a.alignDelimiters!==!1&&(D=C.length+D+A.length,D>m[b]&&(m[b]=D),T[b]=D),y[b]=k}d.splice(1,0,y),f.splice(1,0,T),x=-1;const N=[];for(;++x<d.length;){const S=d[x],C=f[x];b=-1;const A=[];for(;++b<h;){const D=S[b]||"";let k="",z="";if(a.alignDelimiters!==!1){const V=m[b]-(C[b]||0),M=o[b];M===114?k=" ".repeat(V):M===99?V%2?(k=" ".repeat(V/2+.5),z=" ".repeat(V/2-.5)):(k=" ".repeat(V/2),z=k):z=" ".repeat(V)}a.delimiterStart!==!1&&!b&&A.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&D==="")&&(a.delimiterStart!==!1||b)&&A.push(" "),a.alignDelimiters!==!1&&A.push(k),A.push(D),a.alignDelimiters!==!1&&A.push(z),a.padding!==!1&&A.push(" "),(a.delimiterEnd!==!1||b!==h-1)&&A.push("|")}N.push(a.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return N.join(`
422
- `)}function bO(e){return e==null?"":String(e)}function Wx(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const Jx={}.hasOwnProperty;function qy(e,t){const a=t||{};function s(l,...o){let d=s.invalid;const f=s.handlers;if(l&&Jx.call(l,e)){const m=String(l[e]);d=Jx.call(f,m)?f[m]:s.unknown}if(d)return d.call(this,l,...o)}return s.handlers=a.handlers||{},s.invalid=a.invalid,s.unknown=a.unknown,s}function xO(e,t,a,s){const l=a.enter("blockquote"),o=a.createTracker(s);o.move("> "),o.shift(2);const d=a.indentLines(a.containerFlow(e,o.current()),EO);return l(),d}function EO(e,t,a){return">"+(a?"":" ")+e}function yO(e,t){return e1(e,t.inConstruct,!0)&&!e1(e,t.notInConstruct,!1)}function e1(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function t1(e,t,a,s){let l=-1;for(;++l<a.unsafe.length;)if(a.unsafe[l].character===`
423
- `&&yO(a.stack,a.unsafe[l]))return/[ \t]/.test(s.before)?"":" ";return`\\
424
- `}function TO(e,t){const a=String(e);let s=a.indexOf(t),l=s,o=0,d=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++o>d&&(d=o):o=1,l=s+t.length,s=a.indexOf(t,l);return d}function _O(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function NO(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function SO(e,t,a,s){const l=NO(a),o=e.value||"",d=l==="`"?"GraveAccent":"Tilde";if(_O(e,a)){const b=a.enter("codeIndented"),y=a.indentLines(o,vO);return b(),y}const f=a.createTracker(s),m=l.repeat(Math.max(TO(o,l)+1,3)),h=a.enter("codeFenced");let x=f.move(m);if(e.lang){const b=a.enter(`codeFencedLang${d}`);x+=f.move(a.safe(e.lang,{before:x,after:" ",encode:["`"],...f.current()})),b()}if(e.lang&&e.meta){const b=a.enter(`codeFencedMeta${d}`);x+=f.move(" "),x+=f.move(a.safe(e.meta,{before:x,after:`
419
+ `}),a}function zx(e){let t=0,a=e.charCodeAt(t);for(;a===9||a===32;)t++,a=e.charCodeAt(t);return e.slice(t)}function qx(e,t){const a=tR(e,t),s=a.one(e,void 0),l=$k(a),o=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
420
+ `},l),o}function iR(e,t){return e&&"run"in e?async function(a,s){const l=qx(a,{file:s,...t});await e.run(l,s)}:function(a,s){return qx(a,{file:s,...e||t})}}function Yx(e){if(e)throw e}var bm,$x;function lR(){if($x)return bm;$x=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var x=e.call(h,"constructor"),b=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!x&&!b)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},d=function(h,x){a&&x.name==="__proto__"?a(h,x.name,{enumerable:!0,configurable:!0,value:x.newValue,writable:!0}):h[x.name]=x.newValue},f=function(h,x){if(x==="__proto__")if(e.call(h,x)){if(s)return s(h,x).value}else return;return h[x]};return bm=function m(){var h,x,b,y,T,N,S=arguments[0],C=1,A=arguments.length,D=!1;for(typeof S=="boolean"&&(D=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<A;++C)if(h=arguments[C],h!=null)for(x in h)b=f(S,x),y=f(h,x),S!==y&&(D&&y&&(o(y)||(T=l(y)))?(T?(T=!1,N=b&&l(b)?b:[]):N=b&&o(b)?b:{},d(S,{name:x,newValue:m(D,N,y)})):typeof y<"u"&&d(S,{name:x,newValue:y}));return S},bm}var oR=lR();const xm=Rc(oR);function Jm(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function uR(){const e=[],t={run:a,use:s};return t;function a(...l){let o=-1;const d=l.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);f(null,...l);function f(m,...h){const x=e[++o];let b=-1;if(m){d(m);return}for(;++b<l.length;)(h[b]===null||h[b]===void 0)&&(h[b]=l[b]);l=h,x?cR(x,f)(...h):d(null,...h)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function cR(e,t){let a;return s;function s(...d){const f=e.length>d.length;let m;f&&d.push(l);try{m=e.apply(this,d)}catch(h){const x=h;if(f&&a)throw x;return l(x)}f||(m&&m.then&&typeof m.then=="function"?m.then(o,l):m instanceof Error?l(m):o(m))}function l(d,...f){a||(a=!0,t(d,...f))}function o(d){l(null,d)}}const $a={basename:dR,dirname:fR,extname:mR,join:hR,sep:"/"};function dR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');wo(e);let a=0,s=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){a=l+1;break}}else s<0&&(o=!0,s=l+1);return s<0?"":e.slice(a,s)}if(t===e)return"";let d=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){a=l+1;break}}else d<0&&(o=!0,d=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(s=l):(f=-1,s=d));return a===s?s=d:s<0&&(s=e.length),e.slice(a,s)}function fR(e){if(wo(e),e.length===0)return".";let t=-1,a=e.length,s;for(;--a;)if(e.codePointAt(a)===47){if(s){t=a;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function mR(e){wo(e);let t=e.length,a=-1,s=0,l=-1,o=0,d;for(;t--;){const f=e.codePointAt(t);if(f===47){if(d){s=t+1;break}continue}a<0&&(d=!0,a=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||a<0||o===0||o===1&&l===a-1&&l===s+1?"":e.slice(l,a)}function hR(...e){let t=-1,a;for(;++t<e.length;)wo(e[t]),e[t]&&(a=a===void 0?e[t]:a+"/"+e[t]);return a===void 0?".":pR(a)}function pR(e){wo(e);const t=e.codePointAt(0)===47;let a=gR(e,!t);return a.length===0&&!t&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),t?"/"+a:a}function gR(e,t){let a="",s=0,l=-1,o=0,d=-1,f,m;for(;++d<=e.length;){if(d<e.length)f=e.codePointAt(d);else{if(f===47)break;f=47}if(f===47){if(!(l===d-1||o===1))if(l!==d-1&&o===2){if(a.length<2||s!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(m=a.lastIndexOf("/"),m!==a.length-1){m<0?(a="",s=0):(a=a.slice(0,m),s=a.length-1-a.lastIndexOf("/")),l=d,o=0;continue}}else if(a.length>0){a="",s=0,l=d,o=0;continue}}t&&(a=a.length>0?a+"/..":"..",s=2)}else a.length>0?a+="/"+e.slice(l+1,d):a=e.slice(l+1,d),s=d-l-1;l=d,o=0}else f===46&&o>-1?o++:o=-1}return a}function wo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const bR={cwd:xR};function xR(){return"/"}function eh(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ER(e){if(typeof e=="string")e=new URL(e);else if(!eh(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return yR(e)}function yR(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let a=-1;for(;++a<t.length;)if(t.codePointAt(a)===37&&t.codePointAt(a+1)===50){const s=t.codePointAt(a+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Em=["history","path","basename","stem","extname","dirname"];class Py{constructor(t){let a;t?eh(t)?a={path:t}:typeof t=="string"||TR(t)?a={value:t}:a=t:a={},this.cwd="cwd"in a?"":bR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Em.length;){const o=Em[s];o in a&&a[o]!==void 0&&a[o]!==null&&(this[o]=o==="history"?[...a[o]]:a[o])}let l;for(l in a)Em.includes(l)||(this[l]=a[l])}get basename(){return typeof this.path=="string"?$a.basename(this.path):void 0}set basename(t){Tm(t,"basename"),ym(t,"basename"),this.path=$a.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$a.dirname(this.path):void 0}set dirname(t){Gx(this.basename,"dirname"),this.path=$a.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$a.extname(this.path):void 0}set extname(t){if(ym(t,"extname"),Gx(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$a.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eh(t)&&(t=ER(t)),Tm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$a.basename(this.path,this.extname):void 0}set stem(t){Tm(t,"stem"),ym(t,"stem"),this.path=$a.join(this.dirname||"",t+(this.extname||""))}fail(t,a,s){const l=this.message(t,a,s);throw l.fatal=!0,l}info(t,a,s){const l=this.message(t,a,s);return l.fatal=void 0,l}message(t,a,s){const l=new vn(t,a,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ym(e,t){if(e&&e.includes($a.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$a.sep+"`")}function Tm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Gx(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function TR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _R=(function(e){const s=this.constructor.prototype,l=s[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,s),o}),NR={}.hasOwnProperty;class Hh extends _R{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=uR()}copy(){const t=new Hh;let a=-1;for(;++a<this.attachers.length;){const s=this.attachers[a];t.use(...s)}return t.data(xm(!0,{},this.namespace)),t}data(t,a){return typeof t=="string"?arguments.length===2?(Sm("data",this.frozen),this.namespace[t]=a,this):NR.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Sm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=a.call(t,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const a=Zu(t),s=this.parser||this.Parser;return _m("parse",s),s(String(a),a)}process(t,a){const s=this;return this.freeze(),_m("process",this.parser||this.Parser),Nm("process",this.compiler||this.Compiler),a?l(void 0,a):new Promise(l);function l(o,d){const f=Zu(t),m=s.parse(f);s.run(m,f,function(x,b,y){if(x||!b||!y)return h(x);const T=b,N=s.stringify(T,y);AR(N)?y.value=N:y.result=N,h(x,y)});function h(x,b){x||!b?d(x):o?o(b):a(void 0,b)}}}processSync(t){let a=!1,s;return this.freeze(),_m("processSync",this.parser||this.Parser),Nm("processSync",this.compiler||this.Compiler),this.process(t,l),Vx("processSync","process",a),s;function l(o,d){a=!0,Yx(o),s=d}}run(t,a,s){Kx(t),this.freeze();const l=this.transformers;return!s&&typeof a=="function"&&(s=a,a=void 0),s?o(void 0,s):new Promise(o);function o(d,f){const m=Zu(a);l.run(t,m,h);function h(x,b,y){const T=b||t;x?f(x):d?d(T):s(void 0,T,y)}}}runSync(t,a){let s=!1,l;return this.run(t,a,o),Vx("runSync","run",s),l;function o(d,f){Yx(d),l=f,s=!0}}stringify(t,a){this.freeze();const s=Zu(a),l=this.compiler||this.Compiler;return Nm("stringify",l),Kx(t),l(t,s)}use(t,...a){const s=this.attachers,l=this.namespace;if(Sm("use",this.frozen),t!=null)if(typeof t=="function")m(t,a);else if(typeof t=="object")Array.isArray(t)?f(t):d(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[x,...b]=h;m(x,b)}else d(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function d(h){if(!("plugins"in h)&&!("settings"in h))throw new 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");f(h.plugins),h.settings&&(l.settings=xm(!0,l.settings,h.settings))}function f(h){let x=-1;if(h!=null)if(Array.isArray(h))for(;++x<h.length;){const b=h[x];o(b)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,x){let b=-1,y=-1;for(;++b<s.length;)if(s[b][0]===h){y=b;break}if(y===-1)s.push([h,...x]);else if(x.length>0){let[T,...N]=x;const S=s[y][1];Jm(S)&&Jm(T)&&(T=xm(!0,S,T)),s[y]=[h,T,...N]}}}}const SR=new Hh().freeze();function _m(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Nm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Kx(e){if(!Jm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Vx(e,t,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zu(e){return vR(e)?e:new Py(e)}function vR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function AR(e){return typeof e=="string"||CR(e)}function CR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Qx=[],Xx={allowDangerousHtml:!0},kR=/^(https?|ircs?|mailto|xmpp)$/i,RR=[{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 ls(e){const t=OR(e),a=IR(e);return MR(t.runSync(t.parse(a),a),e)}function OR(e){const t=e.rehypePlugins||Qx,a=e.remarkPlugins||Qx,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Xx}:Xx;return SR().use(fk).use(a).use(iR,s).use(t)}function IR(e){const t=e.children||"",a=new Py;return typeof t=="string"&&(a.value=t),a}function MR(e,t){const a=t.allowedElements,s=t.allowElement,l=t.components,o=t.disallowedElements,d=t.skipHtml,f=t.unwrapDisallowed,m=t.urlTransform||DR;for(const x of RR)Object.hasOwn(t,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+wR+x.id,void 0);return Co(e,h),QC(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(x,b,y){if(x.type==="raw"&&y&&typeof b=="number")return d?y.children.splice(b,1):y.children[b]={type:"text",value:x.value},b;if(x.type==="element"){let T;for(T in hm)if(Object.hasOwn(hm,T)&&Object.hasOwn(x.properties,T)){const N=x.properties[T],S=hm[T];(S===null||S.includes(x.tagName))&&(x.properties[T]=m(String(N||""),T,x))}}if(x.type==="element"){let T=a?!a.includes(x.tagName):o?o.includes(x.tagName):!1;if(!T&&s&&typeof b=="number"&&(T=!s(x,b,y)),T&&y&&typeof b=="number")return f&&x.children?y.children.splice(b,1,...x.children):y.children.splice(b,1),b}}}function DR(e){const t=e.indexOf(":"),a=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||a!==-1&&t>a||s!==-1&&t>s||kR.test(e.slice(0,t))?e:""}function Zx(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,l=a.indexOf(t);for(;l!==-1;)s++,l=a.indexOf(t,l+t.length);return s}function LR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function jR(e,t,a){const l=Ao((a||{}).ignore||[]),o=BR(t);let d=-1;for(;++d<o.length;)By(e,"text",f);function f(h,x){let b=-1,y;for(;++b<x.length;){const T=x[b],N=y?y.children:void 0;if(l(T,N?N.indexOf(T):void 0,y))return;y=T}if(y)return m(h,x)}function m(h,x){const b=x[x.length-1],y=o[d][0],T=o[d][1];let N=0;const C=b.children.indexOf(h);let A=!1,D=[];y.lastIndex=0;let k=y.exec(h.value);for(;k;){const z=k.index,V={index:k.index,input:k.input,stack:[...x,h]};let M=T(...k,V);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?y.lastIndex=z+1:(N!==z&&D.push({type:"text",value:h.value.slice(N,z)}),Array.isArray(M)?D.push(...M):M&&D.push(M),N=z+k[0].length,A=!0),!y.global)break;k=y.exec(h.value)}return A?(N<h.value.length&&D.push({type:"text",value:h.value.slice(N)}),b.children.splice(C,1,...D)):D=[h],C+D.length}}function BR(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<a.length;){const l=a[s];t.push([PR(l[0]),UR(l[1])])}return t}function PR(e){return typeof e=="string"?new RegExp(LR(e),"g"):e}function UR(e){return typeof e=="function"?e:function(){return e}}const vm="phrasing",Am=["autolink","link","image","label"];function HR(){return{transforms:[KR],enter:{literalAutolink:zR,literalAutolinkEmail:Cm,literalAutolinkHttp:Cm,literalAutolinkWww:Cm},exit:{literalAutolink:GR,literalAutolinkEmail:$R,literalAutolinkHttp:qR,literalAutolinkWww:YR}}}function FR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vm,notInConstruct:Am},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vm,notInConstruct:Am},{character:":",before:"[ps]",after:"\\/",inConstruct:vm,notInConstruct:Am}]}}function zR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Cm(e){this.config.enter.autolinkProtocol.call(this,e)}function qR(e){this.config.exit.autolinkProtocol.call(this,e)}function YR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function $R(e){this.config.exit.autolinkEmail.call(this,e)}function GR(e){this.exit(e)}function KR(e){jR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,VR],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),QR]],{ignore:["link","linkReference"]})}function VR(e,t,a,s,l){let o="";if(!Uy(l)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!XR(a)))return!1;const d=ZR(a+s);if(!d[0])return!1;const f={type:"link",title:null,url:o+t+d[0],children:[{type:"text",value:t+d[0]}]};return d[1]?[f,{type:"text",value:d[1]}]:f}function QR(e,t,a,s){return!Uy(s,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function XR(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ZR(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],s=a.indexOf(")");const l=Zx(e,"(");let o=Zx(e,")");for(;s!==-1&&l>o;)e+=a.slice(0,s+1),a=a.slice(s+1),s=a.indexOf(")"),o++;return[e,a]}function Uy(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Fs(a)||qc(a))&&(!t||a!==47)}Hy.peek=iO;function WR(){this.buffer()}function JR(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function eO(){this.buffer()}function tO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function nO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),a.label=t}function aO(e){this.exit(e)}function rO(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ia(this.sliceSerialize(e)).toLowerCase(),a.label=t}function sO(e){this.exit(e)}function iO(){return"["}function Hy(e,t,a,s){const l=a.createTracker(s);let o=l.move("[^");const d=a.enter("footnoteReference"),f=a.enter("reference");return o+=l.move(a.safe(a.associationId(e),{after:"]",before:o})),f(),d(),o+=l.move("]"),o}function lO(){return{enter:{gfmFootnoteCallString:WR,gfmFootnoteCall:JR,gfmFootnoteDefinitionLabelString:eO,gfmFootnoteDefinition:tO},exit:{gfmFootnoteCallString:nO,gfmFootnoteCall:aO,gfmFootnoteDefinitionLabelString:rO,gfmFootnoteDefinition:sO}}}function oO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:a,footnoteReference:Hy},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(s,l,o,d){const f=o.createTracker(d);let m=f.move("[^");const h=o.enter("footnoteDefinition"),x=o.enter("label");return m+=f.move(o.safe(o.associationId(s),{before:m,after:"]"})),x(),m+=f.move("]:"),s.children&&s.children.length>0&&(f.shift(4),m+=f.move((t?`
421
+ `:" ")+o.indentLines(o.containerFlow(s,f.current()),t?Fy:uO))),h(),m}}function uO(e,t,a){return t===0?e:Fy(e,t,a)}function Fy(e,t,a){return(a?"":" ")+e}const cO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];zy.peek=pO;function dO(){return{canContainEols:["delete"],enter:{strikethrough:mO},exit:{strikethrough:hO}}}function fO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:cO}],handlers:{delete:zy}}}function mO(e){this.enter({type:"delete",children:[]},e)}function hO(e){this.exit(e)}function zy(e,t,a,s){const l=a.createTracker(s),o=a.enter("strikethrough");let d=l.move("~~");return d+=a.containerPhrasing(e,{...l.current(),before:d,after:"~"}),d+=l.move("~~"),o(),d}function pO(){return"~"}function gO(e){return e.length}function bO(e,t){const a=t||{},s=(a.align||[]).concat(),l=a.stringLength||gO,o=[],d=[],f=[],m=[];let h=0,x=-1;for(;++x<e.length;){const S=[],C=[];let A=-1;for(e[x].length>h&&(h=e[x].length);++A<e[x].length;){const D=xO(e[x][A]);if(a.alignDelimiters!==!1){const k=l(D);C[A]=k,(m[A]===void 0||k>m[A])&&(m[A]=k)}S.push(D)}d[x]=S,f[x]=C}let b=-1;if(typeof s=="object"&&"length"in s)for(;++b<h;)o[b]=Wx(s[b]);else{const S=Wx(s);for(;++b<h;)o[b]=S}b=-1;const y=[],T=[];for(;++b<h;){const S=o[b];let C="",A="";S===99?(C=":",A=":"):S===108?C=":":S===114&&(A=":");let D=a.alignDelimiters===!1?1:Math.max(1,m[b]-C.length-A.length);const k=C+"-".repeat(D)+A;a.alignDelimiters!==!1&&(D=C.length+D+A.length,D>m[b]&&(m[b]=D),T[b]=D),y[b]=k}d.splice(1,0,y),f.splice(1,0,T),x=-1;const N=[];for(;++x<d.length;){const S=d[x],C=f[x];b=-1;const A=[];for(;++b<h;){const D=S[b]||"";let k="",z="";if(a.alignDelimiters!==!1){const V=m[b]-(C[b]||0),M=o[b];M===114?k=" ".repeat(V):M===99?V%2?(k=" ".repeat(V/2+.5),z=" ".repeat(V/2-.5)):(k=" ".repeat(V/2),z=k):z=" ".repeat(V)}a.delimiterStart!==!1&&!b&&A.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&D==="")&&(a.delimiterStart!==!1||b)&&A.push(" "),a.alignDelimiters!==!1&&A.push(k),A.push(D),a.alignDelimiters!==!1&&A.push(z),a.padding!==!1&&A.push(" "),(a.delimiterEnd!==!1||b!==h-1)&&A.push("|")}N.push(a.delimiterEnd===!1?A.join("").replace(/ +$/,""):A.join(""))}return N.join(`
422
+ `)}function xO(e){return e==null?"":String(e)}function Wx(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const Jx={}.hasOwnProperty;function qy(e,t){const a=t||{};function s(l,...o){let d=s.invalid;const f=s.handlers;if(l&&Jx.call(l,e)){const m=String(l[e]);d=Jx.call(f,m)?f[m]:s.unknown}if(d)return d.call(this,l,...o)}return s.handlers=a.handlers||{},s.invalid=a.invalid,s.unknown=a.unknown,s}function EO(e,t,a,s){const l=a.enter("blockquote"),o=a.createTracker(s);o.move("> "),o.shift(2);const d=a.indentLines(a.containerFlow(e,o.current()),yO);return l(),d}function yO(e,t,a){return">"+(a?"":" ")+e}function TO(e,t){return e1(e,t.inConstruct,!0)&&!e1(e,t.notInConstruct,!1)}function e1(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let s=-1;for(;++s<t.length;)if(e.includes(t[s]))return!0;return!1}function t1(e,t,a,s){let l=-1;for(;++l<a.unsafe.length;)if(a.unsafe[l].character===`
423
+ `&&TO(a.stack,a.unsafe[l]))return/[ \t]/.test(s.before)?"":" ";return`\\
424
+ `}function _O(e,t){const a=String(e);let s=a.indexOf(t),l=s,o=0,d=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++o>d&&(d=o):o=1,l=s+t.length,s=a.indexOf(t,l);return d}function NO(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function SO(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function vO(e,t,a,s){const l=SO(a),o=e.value||"",d=l==="`"?"GraveAccent":"Tilde";if(NO(e,a)){const b=a.enter("codeIndented"),y=a.indentLines(o,AO);return b(),y}const f=a.createTracker(s),m=l.repeat(Math.max(_O(o,l)+1,3)),h=a.enter("codeFenced");let x=f.move(m);if(e.lang){const b=a.enter(`codeFencedLang${d}`);x+=f.move(a.safe(e.lang,{before:x,after:" ",encode:["`"],...f.current()})),b()}if(e.lang&&e.meta){const b=a.enter(`codeFencedMeta${d}`);x+=f.move(" "),x+=f.move(a.safe(e.meta,{before:x,after:`
425
425
  `,encode:["`"],...f.current()})),b()}return x+=f.move(`
426
426
  `),o&&(x+=f.move(o+`
427
- `)),x+=f.move(m),h(),x}function vO(e,t,a){return(a?"":" ")+e}function Fh(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function AO(e,t,a,s){const l=Fh(a),o=l==='"'?"Quote":"Apostrophe",d=a.enter("definition");let f=a.enter("label");const m=a.createTracker(s);let h=m.move("[");return h+=m.move(a.safe(a.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(a.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=a.enter("destinationRaw"),h+=m.move(a.safe(e.url,{before:h,after:e.title?" ":`
428
- `,...m.current()}))),f(),e.title&&(f=a.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(a.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),d(),h}function CO(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function xo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Nc(e,t,a){const s=Pi(e),l=Pi(t);return s===void 0?l===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Yy.peek=wO;function Yy(e,t,a,s){const l=CO(a),o=a.enter("emphasis"),d=a.createTracker(s),f=d.move(l);let m=d.move(a.containerPhrasing(e,{after:l,before:f,...d.current()}));const h=m.charCodeAt(0),x=Nc(s.before.charCodeAt(s.before.length-1),h,l);x.inside&&(m=xo(h)+m.slice(1));const b=m.charCodeAt(m.length-1),y=Nc(s.after.charCodeAt(0),b,l);y.inside&&(m=m.slice(0,-1)+xo(b));const T=d.move(l);return o(),a.attentionEncodeSurroundingInfo={after:y.outside,before:x.outside},f+m+T}function wO(e,t,a){return a.options.emphasis||"*"}function kO(e,t){let a=!1;return Co(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return a=!0,Zm}),!!((!e.depth||e.depth<3)&&Mh(e)&&(t.options.setext||a))}function RO(e,t,a,s){const l=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(s);if(kO(e,a)){const x=a.enter("headingSetext"),b=a.enter("phrasing"),y=a.containerPhrasing(e,{...o.current(),before:`
427
+ `)),x+=f.move(m),h(),x}function AO(e,t,a){return(a?"":" ")+e}function Fh(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function CO(e,t,a,s){const l=Fh(a),o=l==='"'?"Quote":"Apostrophe",d=a.enter("definition");let f=a.enter("label");const m=a.createTracker(s);let h=m.move("[");return h+=m.move(a.safe(a.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(a.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=a.enter("destinationRaw"),h+=m.move(a.safe(e.url,{before:h,after:e.title?" ":`
428
+ `,...m.current()}))),f(),e.title&&(f=a.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(a.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),d(),h}function wO(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function xo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Nc(e,t,a){const s=Pi(e),l=Pi(t);return s===void 0?l===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Yy.peek=kO;function Yy(e,t,a,s){const l=wO(a),o=a.enter("emphasis"),d=a.createTracker(s),f=d.move(l);let m=d.move(a.containerPhrasing(e,{after:l,before:f,...d.current()}));const h=m.charCodeAt(0),x=Nc(s.before.charCodeAt(s.before.length-1),h,l);x.inside&&(m=xo(h)+m.slice(1));const b=m.charCodeAt(m.length-1),y=Nc(s.after.charCodeAt(0),b,l);y.inside&&(m=m.slice(0,-1)+xo(b));const T=d.move(l);return o(),a.attentionEncodeSurroundingInfo={after:y.outside,before:x.outside},f+m+T}function kO(e,t,a){return a.options.emphasis||"*"}function RO(e,t){let a=!1;return Co(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return a=!0,Zm}),!!((!e.depth||e.depth<3)&&Mh(e)&&(t.options.setext||a))}function OO(e,t,a,s){const l=Math.max(Math.min(6,e.depth||1),1),o=a.createTracker(s);if(RO(e,a)){const x=a.enter("headingSetext"),b=a.enter("phrasing"),y=a.containerPhrasing(e,{...o.current(),before:`
429
429
  `,after:`
430
430
  `});return b(),x(),y+`
431
431
  `+(l===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
432
432
  `))+1))}const d="#".repeat(l),f=a.enter("headingAtx"),m=a.enter("phrasing");o.move(d+" ");let h=a.containerPhrasing(e,{before:"# ",after:`
433
- `,...o.current()});return/^[\t ]/.test(h)&&(h=xo(h.charCodeAt(0))+h.slice(1)),h=h?d+" "+h:d,a.options.closeAtx&&(h+=" "+d),m(),f(),h}$y.peek=OO;function $y(e){return e.value||""}function OO(){return"<"}Gy.peek=IO;function Gy(e,t,a,s){const l=Fh(a),o=l==='"'?"Quote":"Apostrophe",d=a.enter("image");let f=a.enter("label");const m=a.createTracker(s);let h=m.move("![");return h+=m.move(a.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(a.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=a.enter("destinationRaw"),h+=m.move(a.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=a.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(a.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),d(),h}function IO(){return"!"}Ky.peek=MO;function Ky(e,t,a,s){const l=e.referenceType,o=a.enter("imageReference");let d=a.enter("label");const f=a.createTracker(s);let m=f.move("![");const h=a.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),d();const x=a.stack;a.stack=[],d=a.enter("reference");const b=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return d(),a.stack=x,o(),l==="full"||!h||h!==b?m+=f.move(b+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function MO(){return"!"}Vy.peek=DO;function Vy(e,t,a){let s=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++o<a.unsafe.length;){const d=a.unsafe[o],f=a.compilePattern(d);let m;if(d.atBreak)for(;m=f.exec(s);){let h=m.index;s.charCodeAt(h)===10&&s.charCodeAt(h-1)===13&&h--,s=s.slice(0,h)+" "+s.slice(m.index+1)}}return l+s+l}function DO(){return"`"}function Qy(e,t){const a=Mh(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Xy.peek=LO;function Xy(e,t,a,s){const l=Fh(a),o=l==='"'?"Quote":"Apostrophe",d=a.createTracker(s);let f,m;if(Qy(e,a)){const x=a.stack;a.stack=[],f=a.enter("autolink");let b=d.move("<");return b+=d.move(a.containerPhrasing(e,{before:b,after:">",...d.current()})),b+=d.move(">"),f(),a.stack=x,b}f=a.enter("link"),m=a.enter("label");let h=d.move("[");return h+=d.move(a.containerPhrasing(e,{before:h,after:"](",...d.current()})),h+=d.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=a.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(a.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(m=a.enter("destinationRaw"),h+=d.move(a.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),m(),e.title&&(m=a.enter(`title${o}`),h+=d.move(" "+l),h+=d.move(a.safe(e.title,{before:h,after:l,...d.current()})),h+=d.move(l),m()),h+=d.move(")"),f(),h}function LO(e,t,a){return Qy(e,a)?"<":"["}Zy.peek=jO;function Zy(e,t,a,s){const l=e.referenceType,o=a.enter("linkReference");let d=a.enter("label");const f=a.createTracker(s);let m=f.move("[");const h=a.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),d();const x=a.stack;a.stack=[],d=a.enter("reference");const b=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return d(),a.stack=x,o(),l==="full"||!h||h!==b?m+=f.move(b+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function jO(){return"["}function zh(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function BO(e){const t=zh(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function PO(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Wy(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function UO(e,t,a,s){const l=a.enter("list"),o=a.bulletCurrent;let d=e.ordered?PO(a):zh(a);const f=e.ordered?d==="."?")":".":BO(a);let m=t&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const x=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&x&&(!x.children||!x.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(m=!0),Wy(a)===d&&x){let b=-1;for(;++b<e.children.length;){const y=e.children[b];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(d=f),a.bulletCurrent=d;const h=a.containerFlow(e,s);return a.bulletLastUsed=d,a.bulletCurrent=o,l(),h}function HO(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function FO(e,t,a,s){const l=HO(a);let o=a.bulletCurrent||zh(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let d=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=a.createTracker(s);f.move(o+" ".repeat(d-o.length)),f.shift(d);const m=a.enter("listItem"),h=a.indentLines(a.containerFlow(e,f.current()),x);return m(),h;function x(b,y,T){return y?(T?"":" ".repeat(d))+b:(T?o:o+" ".repeat(d-o.length))+b}}function zO(e,t,a,s){const l=a.enter("paragraph"),o=a.enter("phrasing"),d=a.containerPhrasing(e,s);return o(),l(),d}const qO=Ao(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function YO(e,t,a,s){return(e.children.some(function(d){return qO(d)})?a.containerPhrasing:a.containerFlow).call(a,e,s)}function $O(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Jy.peek=GO;function Jy(e,t,a,s){const l=$O(a),o=a.enter("strong"),d=a.createTracker(s),f=d.move(l+l);let m=d.move(a.containerPhrasing(e,{after:l,before:f,...d.current()}));const h=m.charCodeAt(0),x=Nc(s.before.charCodeAt(s.before.length-1),h,l);x.inside&&(m=xo(h)+m.slice(1));const b=m.charCodeAt(m.length-1),y=Nc(s.after.charCodeAt(0),b,l);y.inside&&(m=m.slice(0,-1)+xo(b));const T=d.move(l+l);return o(),a.attentionEncodeSurroundingInfo={after:y.outside,before:x.outside},f+m+T}function GO(e,t,a){return a.options.strong||"*"}function KO(e,t,a,s){return a.safe(e.value,s)}function VO(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function QO(e,t,a){const s=(Wy(a)+(a.options.ruleSpaces?" ":"")).repeat(VO(a));return a.options.ruleSpaces?s.slice(0,-1):s}const eT={blockquote:xO,break:t1,code:SO,definition:AO,emphasis:Yy,hardBreak:t1,heading:RO,html:$y,image:Gy,imageReference:Ky,inlineCode:Vy,link:Xy,linkReference:Zy,list:UO,listItem:FO,paragraph:zO,root:YO,strong:Jy,text:KO,thematicBreak:QO};function XO(){return{enter:{table:ZO,tableData:n1,tableHeader:n1,tableRow:JO},exit:{codeText:e4,table:WO,tableData:wm,tableHeader:wm,tableRow:wm}}}function ZO(e){const t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function WO(e){this.exit(e),this.data.inTable=void 0}function JO(e){this.enter({type:"tableRow",children:[]},e)}function wm(e){this.exit(e)}function n1(e){this.enter({type:"tableCell",children:[]},e)}function e4(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,t4));const a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function t4(e,t){return t==="|"?t:e}function n4(e){const t=e||{},a=t.tableCellPadding,s=t.tablePipeAlign,l=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
433
+ `,...o.current()});return/^[\t ]/.test(h)&&(h=xo(h.charCodeAt(0))+h.slice(1)),h=h?d+" "+h:d,a.options.closeAtx&&(h+=" "+d),m(),f(),h}$y.peek=IO;function $y(e){return e.value||""}function IO(){return"<"}Gy.peek=MO;function Gy(e,t,a,s){const l=Fh(a),o=l==='"'?"Quote":"Apostrophe",d=a.enter("image");let f=a.enter("label");const m=a.createTracker(s);let h=m.move("![");return h+=m.move(a.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=a.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(a.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(f=a.enter("destinationRaw"),h+=m.move(a.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),f(),e.title&&(f=a.enter(`title${o}`),h+=m.move(" "+l),h+=m.move(a.safe(e.title,{before:h,after:l,...m.current()})),h+=m.move(l),f()),h+=m.move(")"),d(),h}function MO(){return"!"}Ky.peek=DO;function Ky(e,t,a,s){const l=e.referenceType,o=a.enter("imageReference");let d=a.enter("label");const f=a.createTracker(s);let m=f.move("![");const h=a.safe(e.alt,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),d();const x=a.stack;a.stack=[],d=a.enter("reference");const b=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return d(),a.stack=x,o(),l==="full"||!h||h!==b?m+=f.move(b+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function DO(){return"!"}Vy.peek=LO;function Vy(e,t,a){let s=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++o<a.unsafe.length;){const d=a.unsafe[o],f=a.compilePattern(d);let m;if(d.atBreak)for(;m=f.exec(s);){let h=m.index;s.charCodeAt(h)===10&&s.charCodeAt(h-1)===13&&h--,s=s.slice(0,h)+" "+s.slice(m.index+1)}}return l+s+l}function LO(){return"`"}function Qy(e,t){const a=Mh(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Xy.peek=jO;function Xy(e,t,a,s){const l=Fh(a),o=l==='"'?"Quote":"Apostrophe",d=a.createTracker(s);let f,m;if(Qy(e,a)){const x=a.stack;a.stack=[],f=a.enter("autolink");let b=d.move("<");return b+=d.move(a.containerPhrasing(e,{before:b,after:">",...d.current()})),b+=d.move(">"),f(),a.stack=x,b}f=a.enter("link"),m=a.enter("label");let h=d.move("[");return h+=d.move(a.containerPhrasing(e,{before:h,after:"](",...d.current()})),h+=d.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=a.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(a.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(m=a.enter("destinationRaw"),h+=d.move(a.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),m(),e.title&&(m=a.enter(`title${o}`),h+=d.move(" "+l),h+=d.move(a.safe(e.title,{before:h,after:l,...d.current()})),h+=d.move(l),m()),h+=d.move(")"),f(),h}function jO(e,t,a){return Qy(e,a)?"<":"["}Zy.peek=BO;function Zy(e,t,a,s){const l=e.referenceType,o=a.enter("linkReference");let d=a.enter("label");const f=a.createTracker(s);let m=f.move("[");const h=a.containerPhrasing(e,{before:m,after:"]",...f.current()});m+=f.move(h+"]["),d();const x=a.stack;a.stack=[],d=a.enter("reference");const b=a.safe(a.associationId(e),{before:m,after:"]",...f.current()});return d(),a.stack=x,o(),l==="full"||!h||h!==b?m+=f.move(b+"]"):l==="shortcut"?m=m.slice(0,-1):m+=f.move("]"),m}function BO(){return"["}function zh(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function PO(e){const t=zh(e),a=e.options.bulletOther;if(!a)return t==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+a+"`) to be different");return a}function UO(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Wy(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function HO(e,t,a,s){const l=a.enter("list"),o=a.bulletCurrent;let d=e.ordered?UO(a):zh(a);const f=e.ordered?d==="."?")":".":PO(a);let m=t&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const x=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&x&&(!x.children||!x.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(m=!0),Wy(a)===d&&x){let b=-1;for(;++b<e.children.length;){const y=e.children[b];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(d=f),a.bulletCurrent=d;const h=a.containerFlow(e,s);return a.bulletLastUsed=d,a.bulletCurrent=o,l(),h}function FO(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function zO(e,t,a,s){const l=FO(a);let o=a.bulletCurrent||zh(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let d=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(d=Math.ceil(d/4)*4);const f=a.createTracker(s);f.move(o+" ".repeat(d-o.length)),f.shift(d);const m=a.enter("listItem"),h=a.indentLines(a.containerFlow(e,f.current()),x);return m(),h;function x(b,y,T){return y?(T?"":" ".repeat(d))+b:(T?o:o+" ".repeat(d-o.length))+b}}function qO(e,t,a,s){const l=a.enter("paragraph"),o=a.enter("phrasing"),d=a.containerPhrasing(e,s);return o(),l(),d}const YO=Ao(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $O(e,t,a,s){return(e.children.some(function(d){return YO(d)})?a.containerPhrasing:a.containerFlow).call(a,e,s)}function GO(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Jy.peek=KO;function Jy(e,t,a,s){const l=GO(a),o=a.enter("strong"),d=a.createTracker(s),f=d.move(l+l);let m=d.move(a.containerPhrasing(e,{after:l,before:f,...d.current()}));const h=m.charCodeAt(0),x=Nc(s.before.charCodeAt(s.before.length-1),h,l);x.inside&&(m=xo(h)+m.slice(1));const b=m.charCodeAt(m.length-1),y=Nc(s.after.charCodeAt(0),b,l);y.inside&&(m=m.slice(0,-1)+xo(b));const T=d.move(l+l);return o(),a.attentionEncodeSurroundingInfo={after:y.outside,before:x.outside},f+m+T}function KO(e,t,a){return a.options.strong||"*"}function VO(e,t,a,s){return a.safe(e.value,s)}function QO(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function XO(e,t,a){const s=(Wy(a)+(a.options.ruleSpaces?" ":"")).repeat(QO(a));return a.options.ruleSpaces?s.slice(0,-1):s}const eT={blockquote:EO,break:t1,code:vO,definition:CO,emphasis:Yy,hardBreak:t1,heading:OO,html:$y,image:Gy,imageReference:Ky,inlineCode:Vy,link:Xy,linkReference:Zy,list:HO,listItem:zO,paragraph:qO,root:$O,strong:Jy,text:VO,thematicBreak:XO};function ZO(){return{enter:{table:WO,tableData:n1,tableHeader:n1,tableRow:e4},exit:{codeText:t4,table:JO,tableData:wm,tableHeader:wm,tableRow:wm}}}function WO(e){const t=e._align;this.enter({type:"table",align:t.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function JO(e){this.exit(e),this.data.inTable=void 0}function e4(e){this.enter({type:"tableRow",children:[]},e)}function wm(e){this.exit(e)}function n1(e){this.enter({type:"tableCell",children:[]},e)}function t4(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,n4));const a=this.stack[this.stack.length-1];a.type,a.value=t,this.exit(e)}function n4(e,t){return t==="|"?t:e}function a4(e){const t=e||{},a=t.tableCellPadding,s=t.tablePipeAlign,l=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
434
434
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:d,tableCell:m,tableRow:f}};function d(T,N,S,C){return h(x(T,S,C),T.align)}function f(T,N,S,C){const A=b(T,S,C),D=h([A]);return D.slice(0,D.indexOf(`
435
- `))}function m(T,N,S,C){const A=S.enter("tableCell"),D=S.enter("phrasing"),k=S.containerPhrasing(T,{...C,before:o,after:o});return D(),A(),k}function h(T,N){return gO(T,{align:N,alignDelimiters:s,padding:a,stringLength:l})}function x(T,N,S){const C=T.children;let A=-1;const D=[],k=N.enter("table");for(;++A<C.length;)D[A]=b(C[A],N,S);return k(),D}function b(T,N,S){const C=T.children;let A=-1;const D=[],k=N.enter("tableRow");for(;++A<C.length;)D[A]=m(C[A],T,N,S);return k(),D}function y(T,N,S){let C=eT.inlineCode(T,N,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function a4(){return{exit:{taskListCheckValueChecked:a1,taskListCheckValueUnchecked:a1,paragraph:s4}}}function r4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:i4}}}function a1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function s4(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const s=a.children[0];if(s&&s.type==="text"){const l=t.children;let o=-1,d;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){d=f;break}}d===a&&(s.value=s.value.slice(1),s.value.length===0?a.children.shift():a.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,a.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function i4(e,t,a,s){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=a.createTracker(s);o&&f.move(d);let m=eT.listItem(e,t,a,{...s,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(x){return x+d}}function l4(){return[UR(),iO(),cO(),XO(),a4()]}function o4(e){return{extensions:[HR(),lO(e),dO(),n4(e),r4()]}}const u4={tokenize:p4,partial:!0},tT={tokenize:g4,partial:!0},nT={tokenize:b4,partial:!0},aT={tokenize:x4,partial:!0},c4={tokenize:E4,partial:!0},rT={name:"wwwAutolink",tokenize:m4,previous:iT},sT={name:"protocolAutolink",tokenize:h4,previous:lT},vr={name:"emailAutolink",tokenize:f4,previous:oT},Za={};function d4(){return{text:Za}}let Ds=48;for(;Ds<123;)Za[Ds]=vr,Ds++,Ds===58?Ds=65:Ds===91&&(Ds=97);Za[43]=vr;Za[45]=vr;Za[46]=vr;Za[95]=vr;Za[72]=[vr,sT];Za[104]=[vr,sT];Za[87]=[vr,rT];Za[119]=[vr,rT];function f4(e,t,a){const s=this;let l,o;return d;function d(b){return!th(b)||!oT.call(s,s.previous)||qh(s.events)?a(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(b))}function f(b){return th(b)?(e.consume(b),f):b===64?(e.consume(b),m):a(b)}function m(b){return b===46?e.check(c4,x,h)(b):b===45||b===95||Sn(b)?(o=!0,e.consume(b),m):x(b)}function h(b){return e.consume(b),l=!0,m}function x(b){return o&&l&&In(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(b)):a(b)}}function m4(e,t,a){const s=this;return l;function l(d){return d!==87&&d!==119||!iT.call(s,s.previous)||qh(s.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(u4,e.attempt(tT,e.attempt(nT,o),a),a)(d))}function o(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(d)}}function h4(e,t,a){const s=this;let l="",o=!1;return d;function d(b){return(b===72||b===104)&&lT.call(s,s.previous)&&!qh(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(b),e.consume(b),f):a(b)}function f(b){if(In(b)&&l.length<5)return l+=String.fromCodePoint(b),e.consume(b),f;if(b===58){const y=l.toLowerCase();if(y==="http"||y==="https")return e.consume(b),m}return a(b)}function m(b){return b===47?(e.consume(b),o?h:(o=!0,m)):a(b)}function h(b){return b===null||Tc(b)||Rt(b)||Fs(b)||qc(b)?a(b):e.attempt(tT,e.attempt(nT,x),a)(b)}function x(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(b)}}function p4(e,t,a){let s=0;return l;function l(d){return(d===87||d===119)&&s<3?(s++,e.consume(d),l):d===46&&s===3?(e.consume(d),o):a(d)}function o(d){return d===null?a(d):t(d)}}function g4(e,t,a){let s,l,o;return d;function d(h){return h===46||h===95?e.check(aT,m,f)(h):h===null||Rt(h)||Fs(h)||h!==45&&qc(h)?m(h):(o=!0,e.consume(h),d)}function f(h){return h===95?s=!0:(l=s,s=void 0),e.consume(h),d}function m(h){return l||s||!o?a(h):t(h)}}function b4(e,t){let a=0,s=0;return l;function l(d){return d===40?(a++,e.consume(d),l):d===41&&s<a?o(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(aT,t,o)(d):d===null||Rt(d)||Fs(d)?t(d):(e.consume(d),l)}function o(d){return d===41&&s++,e.consume(d),l}}function x4(e,t,a){return s;function s(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),s):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||Rt(f)||Fs(f)?t(f):a(f)}function l(f){return f===null||f===40||f===91||Rt(f)||Fs(f)?t(f):s(f)}function o(f){return In(f)?d(f):a(f)}function d(f){return f===59?(e.consume(f),s):In(f)?(e.consume(f),d):a(f)}}function E4(e,t,a){return s;function s(o){return e.consume(o),l}function l(o){return Sn(o)?a(o):t(o)}}function iT(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Rt(e)}function lT(e){return!In(e)}function oT(e){return!(e===47||th(e))}function th(e){return e===43||e===45||e===46||e===95||Sn(e)}function qh(e){let t=e.length,a=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){a=!0;break}if(s._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const y4={tokenize:w4,partial:!0};function T4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:v4,continuation:{tokenize:A4},exit:C4}},text:{91:{name:"gfmFootnoteCall",tokenize:S4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_4,resolveTo:N4}}}}function _4(e,t,a){const s=this;let l=s.events.length;const o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let d;for(;l--;){const m=s.events[l][1];if(m.type==="labelImage"){d=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!d||!d._balanced)return a(m);const h=Ia(s.sliceSerialize({start:d.end,end:s.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?a(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function N4(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[a+1],e[a+2],["enter",s,t],e[a+3],e[a+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",d,t],["exit",d,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(a,e.length-a+1,...f),e}function S4(e,t,a){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o=0,d;return f;function f(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),m}function m(b){return b!==94?a(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(b){if(o>999||b===93&&!d||b===null||b===91||Rt(b))return a(b);if(b===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(Ia(s.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(b)}return Rt(b)||(d=!0),o++,e.consume(b),b===92?x:h}function x(b){return b===91||b===92||b===93?(e.consume(b),o++,h):h(b)}}function v4(e,t,a){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o,d=0,f;return m;function m(N){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(N){return N===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",x):a(N)}function x(N){if(d>999||N===93&&!f||N===null||N===91||Rt(N))return a(N);if(N===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return o=Ia(s.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Rt(N)||(f=!0),d++,e.consume(N),N===92?b:x}function b(N){return N===91||N===92||N===93?(e.consume(N),d++,x):x(N)}function y(N){return N===58?(e.enter("definitionMarker"),e.consume(N),e.exit("definitionMarker"),l.includes(o)||l.push(o),ct(e,T,"gfmFootnoteDefinitionWhitespace")):a(N)}function T(N){return t(N)}}function A4(e,t,a){return e.check(vo,t,e.attempt(y4,t,a))}function C4(e){e.exit("gfmFootnoteDefinition")}function w4(e,t,a){const s=this;return ct(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const d=s.events[s.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?t(o):a(o)}}function k4(e){let a=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:o,resolveAll:l};return a==null&&(a=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(d,f){let m=-1;for(;++m<d.length;)if(d[m][0]==="enter"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._close){let h=m;for(;h--;)if(d[h][0]==="exit"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._open&&d[m][1].end.offset-d[m][1].start.offset===d[h][1].end.offset-d[h][1].start.offset){d[m][1].type="strikethroughSequence",d[h][1].type="strikethroughSequence";const x={type:"strikethrough",start:Object.assign({},d[h][1].start),end:Object.assign({},d[m][1].end)},b={type:"strikethroughText",start:Object.assign({},d[h][1].end),end:Object.assign({},d[m][1].start)},y=[["enter",x,f],["enter",d[h][1],f],["exit",d[h][1],f],["enter",b,f]],T=f.parser.constructs.insideSpan.null;T&&la(y,y.length,0,Yc(T,d.slice(h+1,m),f)),la(y,y.length,0,[["exit",b,f],["enter",d[m][1],f],["exit",d[m][1],f],["exit",x,f]]),la(d,h-1,m-h+3,y),m=h+y.length-2;break}}for(m=-1;++m<d.length;)d[m][1].type==="strikethroughSequenceTemporary"&&(d[m][1].type="data");return d}function o(d,f,m){const h=this.previous,x=this.events;let b=0;return y;function y(N){return h===126&&x[x.length-1][1].type!=="characterEscape"?m(N):(d.enter("strikethroughSequenceTemporary"),T(N))}function T(N){const S=Pi(h);if(N===126)return b>1?m(N):(d.consume(N),b++,T);if(b<2&&!a)return m(N);const C=d.exit("strikethroughSequenceTemporary"),A=Pi(N);return C._open=!A||A===2&&!!S,C._close=!S||S===2&&!!A,f(N)}}}class R4{constructor(){this.map=[]}add(t,a,s){O4(this,t,a,s)}consume(t){if(this.map.sort(function(o,d){return o[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const s=[];for(;a>0;)a-=1,s.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];s.push(t.slice()),t.length=0;let l=s.pop();for(;l;){for(const o of l)t.push(o);l=s.pop()}this.map.length=0}}function O4(e,t,a,s){let l=0;if(!(a===0&&s.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=a,e.map[l][2].push(...s);return}l+=1}e.map.push([t,a,s])}}function I4(e,t){let a=!1;const s=[];for(;t<e.length;){const l=e[t];if(a){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=s.length-1;s[o]=s[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return s}function M4(){return{flow:{null:{name:"table",tokenize:D4,resolveAll:L4}}}}function D4(e,t,a){const s=this;let l=0,o=0,d;return f;function f(B){let U=s.events.length-1;for(;U>-1;){const Z=s.events[U][1].type;if(Z==="lineEnding"||Z==="linePrefix")U--;else break}const te=U>-1?s.events[U][1].type:null,ie=te==="tableHead"||te==="tableRow"?M:m;return ie===M&&s.parser.lazy[s.now().line]?a(B):ie(B)}function m(B){return e.enter("tableHead"),e.enter("tableRow"),h(B)}function h(B){return B===124||(d=!0,o+=1),x(B)}function x(B){return B===null?a(B):He(B)?o>1?(o=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),T):a(B):rt(B)?ct(e,x,"whitespace")(B):(o+=1,d&&(d=!1,l+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),d=!0,x):(e.enter("data"),b(B)))}function b(B){return B===null||B===124||Rt(B)?(e.exit("data"),x(B)):(e.consume(B),B===92?y:b)}function y(B){return B===92||B===124?(e.consume(B),b):b(B)}function T(B){return s.interrupt=!1,s.parser.lazy[s.now().line]?a(B):(e.enter("tableDelimiterRow"),d=!1,rt(B)?ct(e,N,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):N(B))}function N(B){return B===45||B===58?C(B):B===124?(d=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),S):V(B)}function S(B){return rt(B)?ct(e,C,"whitespace")(B):C(B)}function C(B){return B===58?(o+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),A):B===45?(o+=1,A(B)):B===null||He(B)?z(B):V(B)}function A(B){return B===45?(e.enter("tableDelimiterFiller"),D(B)):V(B)}function D(B){return B===45?(e.consume(B),D):B===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(B))}function k(B){return rt(B)?ct(e,z,"whitespace")(B):z(B)}function z(B){return B===124?N(B):B===null||He(B)?!d||l!==o?V(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):V(B)}function V(B){return a(B)}function M(B){return e.enter("tableRow"),L(B)}function L(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),L):B===null||He(B)?(e.exit("tableRow"),t(B)):rt(B)?ct(e,L,"whitespace")(B):(e.enter("data"),K(B))}function K(B){return B===null||B===124||Rt(B)?(e.exit("data"),L(B)):(e.consume(B),B===92?se:K)}function se(B){return B===92||B===124?(e.consume(B),K):K(B)}}function L4(e,t){let a=-1,s=!0,l=0,o=[0,0,0,0],d=[0,0,0,0],f=!1,m=0,h,x,b;const y=new R4;for(;++a<e.length;){const T=e[a],N=T[1];T[0]==="enter"?N.type==="tableHead"?(f=!1,m!==0&&(r1(y,t,m,h,x),x=void 0,m=0),h={type:"table",start:Object.assign({},N.start),end:Object.assign({},N.end)},y.add(a,0,[["enter",h,t]])):N.type==="tableRow"||N.type==="tableDelimiterRow"?(s=!0,b=void 0,o=[0,0,0,0],d=[0,a+1,0,0],f&&(f=!1,x={type:"tableBody",start:Object.assign({},N.start),end:Object.assign({},N.end)},y.add(a,0,[["enter",x,t]])),l=N.type==="tableDelimiterRow"?2:x?3:1):l&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")?(s=!1,d[2]===0&&(o[1]!==0&&(d[0]=d[1],b=Wu(y,t,o,l,void 0,b),o=[0,0,0,0]),d[2]=a)):N.type==="tableCellDivider"&&(s?s=!1:(o[1]!==0&&(d[0]=d[1],b=Wu(y,t,o,l,void 0,b)),o=d,d=[o[1],a,0,0])):N.type==="tableHead"?(f=!0,m=a):N.type==="tableRow"||N.type==="tableDelimiterRow"?(m=a,o[1]!==0?(d[0]=d[1],b=Wu(y,t,o,l,a,b)):d[1]!==0&&(b=Wu(y,t,d,l,a,b)),l=0):l&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")&&(d[3]=a)}for(m!==0&&r1(y,t,m,h,x),y.consume(t.events),a=-1;++a<t.events.length;){const T=t.events[a];T[0]==="enter"&&T[1].type==="table"&&(T[1]._align=I4(t.events,a))}return e}function Wu(e,t,a,s,l,o){const d=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(o.end=Object.assign({},Oi(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));const m=Oi(t.events,a[1]);if(o={type:d,start:Object.assign({},m),end:Object.assign({},m)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){const h=Oi(t.events,a[2]),x=Oi(t.events,a[3]),b={type:f,start:Object.assign({},h),end:Object.assign({},x)};if(e.add(a[2],0,[["enter",b,t]]),s!==2){const y=t.events[a[2]],T=t.events[a[3]];if(y[1].end=Object.assign({},T[1].end),y[1].type="chunkText",y[1].contentType="text",a[3]>a[2]+1){const N=a[2]+1,S=a[3]-a[2]-1;e.add(N,S,[])}}e.add(a[3]+1,0,[["exit",b,t]])}return l!==void 0&&(o.end=Object.assign({},Oi(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function r1(e,t,a,s,l){const o=[],d=Oi(t.events,a);l&&(l.end=Object.assign({},d),o.push(["exit",l,t])),s.end=Object.assign({},d),o.push(["exit",s,t]),e.add(a+1,0,o)}function Oi(e,t){const a=e[t],s=a[0]==="enter"?"start":"end";return a[1][s]}const j4={name:"tasklistCheck",tokenize:P4};function B4(){return{text:{91:j4}}}function P4(e,t,a){const s=this;return l;function l(m){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?a(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return Rt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),d):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),d):a(m)}function d(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(m)}function f(m){return He(m)?t(m):rt(m)?e.check({tokenize:U4},t,a)(m):a(m)}}function U4(e,t,a){return ct(e,s,"whitespace");function s(l){return l===null?a(l):t(l)}}function H4(e){return by([d4(),T4(),k4(e),M4(),B4()])}const F4={};function os(e){const t=this,a=e||F4,s=t.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),o=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),d=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(H4(a)),o.push(l4()),d.push(o4(a))}function Yh(e){const[t,a]=v.useState("fit"),s=t==="wide";return u.jsxs("div",{className:`md-table-wrap ${s?"md-table-wide":"md-table-fit"}`,children:[u.jsxs("button",{type:"button",className:"md-table-toggle",title:s?"适应屏幕":"超宽展开",onClick:()=>a(s?"fit":"wide"),children:[s?u.jsx(NA,{className:"h-3 w-3"}):u.jsx(hA,{className:"h-3 w-3"}),u.jsx("span",{children:s?"适应屏幕":"超宽展开"})]}),u.jsx("div",{className:"md-table-scroll",children:u.jsx("table",{...e})})]})}const Di=zs(e=>({agents:[],loaded:!1,loadAgents:async()=>{const t=qe.getState().activeRepoId;try{const a=t?await k3(t):await $E();e({agents:a,loaded:!0})}catch{e({loaded:!0})}},createAgent:async(t,a)=>{const s=a?await R3(a,t):await GE(t);return e(l=>({agents:[...l.agents,s]})),s},updateAgent:async(t,a)=>{const s=await KE(t,a);e(l=>({agents:l.agents.map(o=>o.id===t?s:o)}))},deleteAgent:async t=>{await VE(t),e(a=>({agents:a.agents.filter(s=>s.id!==t)}))}}));function z4(e){if(typeof e!="string")return e;const t=e.trim();if(t)try{return JSON.parse(t)}catch{return t}}function hn(e){return e&&typeof e=="object"?e:null}function Ys(e){const t=hn(e);return t&&"properties"in t?t.properties:e}function q4(e){const t=hn(e);return typeof(t==null?void 0:t.type)=="string"?t.type:void 0}function Y4(e){const t=hn(Ys(e));if(!t)return null;const a=hn(t.info);if(a&&typeof a.id=="string"){const l=Array.isArray(t.parts)?t.parts:void 0;return{...a,...l?{parts:l}:{}}}if(typeof t.id=="string"&&typeof t.role=="string")return t;const s=hn(t.message);return s&&typeof s.id=="string"?s:null}function $4(e){const t=hn(Ys(e));if(!t)return{};const a=hn(t.part)??t;return typeof a.type!="string"?{}:{messageId:typeof a.messageID=="string"&&a.messageID||typeof a.messageId=="string"&&a.messageId||typeof t.messageID=="string"&&t.messageID||typeof t.messageId=="string"&&t.messageId||void 0,part:a}}function G4(e){const t=hn(Ys(e));if(!t||t.field!=="text")return null;const a=typeof t.messageID=="string"?t.messageID:null,s=typeof t.partID=="string"?t.partID:null,l=typeof t.delta=="string"?t.delta:null;return!a||!s||l===null?null:{messageId:a,partId:s,delta:l}}function K4(e){const t=Ys(e);if(Array.isArray(t))return t;const a=hn(t);return a&&Array.isArray(a.todos)?a.todos:[]}function qa(e){return typeof e=="number"?e:0}function V4(e){const t=hn(Ys(e));if(!t||typeof t.id!="string")return null;const a={id:t.id};typeof t.title=="string"&&(a.title=t.title),typeof t.agent=="string"&&(a.agent=t.agent),typeof t.cost=="number"&&(a.cost=t.cost);const s=typeof t.parentID=="string"?t.parentID:typeof t.parent_id=="string"?t.parent_id:void 0;s&&(a.parentID=s);const l=hn(t.tokens),o=typeof t.tokens_input=="number"||typeof t.tokens_output=="number";if(l||o){const f=l?hn(l.cache):null;a.tokens={input:qa(l==null?void 0:l.input)||qa(t.tokens_input),output:qa(l==null?void 0:l.output)||qa(t.tokens_output),reasoning:qa(l==null?void 0:l.reasoning)||qa(t.tokens_reasoning),cache:{read:qa(f==null?void 0:f.read)||qa(t.tokens_cache_read),write:qa(f==null?void 0:f.write)||qa(t.tokens_cache_write)}}}const d=hn(t.model);return d&&(a.model={providerID:typeof d.providerID=="string"?d.providerID:void 0,modelID:typeof d.modelID=="string"?d.modelID:void 0,variant:typeof d.variant=="string"?d.variant:void 0}),a}function Q4(e){const t=hn(Ys(e));if(!t)return null;if(typeof t.message=="string")return t.message;const a=hn(t.error);if(a){const s=hn(a.data);if(typeof(s==null?void 0:s.message)=="string")return`${a.name??"Error"}: ${s.message}`;if(typeof a.message=="string")return`${a.name??"Error"}: ${a.message}`;if(typeof a.name=="string")return String(a.name)}return typeof t.reason=="string"?t.reason:null}function X4(e){const t=Ys(e);if(typeof t=="string")return t;const a=hn(t);if(typeof(a==null?void 0:a.status)=="string")return a.status;const s=hn(a==null?void 0:a.status);return typeof(s==null?void 0:s.type)=="string"?s.type:typeof(a==null?void 0:a.type)=="string"?a.type:null}function Z4(e,t,a,s){switch(e==="message"||e===""?q4(t)??e:e){case"message.updated":{const o=Y4(t);o&&s.updateMessage(a,o);break}case"session.updated":{const o=V4(t);o&&s.updateSessionInfo(o);break}case"message.part.updated":{const{messageId:o,part:d}=$4(t);d&&o&&s.updateMessagePart(a,o,d);break}case"message.part.delta":{const o=G4(t);o&&s.appendMessagePartDelta(a,o.messageId,o.partId,o.delta);break}case"todo.updated":{s.updateTodos(a,K4(t));break}case"session.status":{const o=X4(t);o&&s.setSessionStatus(a,o);break}case"session.idle":{s.setSessionStatus(a,"idle");break}case"session.error":{const o=Q4(t);s.setSessionStatus(a,"error",o??void 0);break}}}const W4=600*1e3;class J4{constructor(t,a){rn(this,"sessionId");rn(this,"idleTimer",null);rn(this,"active",!1);rn(this,"alive",!0);rn(this,"callbacks");this.sessionId=t,this.callbacks=a,this.resetIdleTimer()}dispatch(t,a){if(!this.alive)return;this.resetIdleTimer();const s=Le.getState();Z4(t,a,this.sessionId,s)}activate(){this.active=!0,this.clearIdleTimer()}deactivate(){this.active=!1,this.resetIdleTimer()}refreshOnIdle(){Le.getState().refreshSessionData(this.sessionId)}stop(){this.alive=!1,this.clearIdleTimer()}resetIdleTimer(){this.clearIdleTimer(),!this.active&&(this.idleTimer=setTimeout(()=>{this.callbacks.onWorkerIdle(this.sessionId)},W4))}clearIdleTimer(){this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}}const eI=1e3,tI=3e4;class nI{constructor(t,a){rn(this,"source",null);rn(this,"reconnectTimer",null);rn(this,"attempts",0);rn(this,"disposed",!1);rn(this,"repoId");rn(this,"onEvent");this.repoId=t,this.onEvent=a}start(){this.connect()}stop(){var t;this.disposed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.source)==null||t.close(),this.source=null}connect(){if(this.disposed)return;const t=Z3(this.repoId),a=new EventSource(t);this.source=a,a.onopen=()=>{this.attempts=0},a.onmessage=l=>{this.handleRaw("message",l)};const s=["message.updated","message.part.updated","message.part.delta","message.removed","todo.updated","session.status","session.idle","session.error","session.updated"];for(const l of s)a.addEventListener(l,o=>{this.handleRaw(l,o)});a.onerror=()=>{if(!(this.disposed||!this.source)&&this.source.readyState===EventSource.CLOSED){this.source.close(),this.source=null;const l=Math.min(eI*2**this.attempts,tI);this.attempts++,this.reconnectTimer=setTimeout(()=>this.connect(),l)}}}handleRaw(t,a){if(!(a instanceof MessageEvent))return;const s=z4(a.data);if(s===void 0)return;const l=this.extractSessionId(s);if(!l)return;let o=t;if(t==="message"||t===""){const d=s&&typeof s=="object"?s:null;typeof(d==null?void 0:d.type)=="string"&&(o=d.type)}this.onEvent(l,o,s)}extractSessionId(t){if(!t||typeof t!="object")return null;const a=t;if(a.properties&&typeof a.properties=="object"){const s=a.properties;if(typeof s.sessionID=="string")return s.sessionID;if(typeof s.id=="string")return s.id}return typeof a.sessionID=="string"?a.sessionID:typeof a.sessionId=="string"?a.sessionId:null}}const aI=6e4;class rI{constructor(t){rn(this,"timer",null);rn(this,"paused",!1);rn(this,"callbacks");this.callbacks=t}start(){this.tick(),this.timer=setInterval(()=>{this.paused||this.tick()},aI)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null)}pause(){this.paused=!0}resume(){this.paused=!1,this.tick()}tick(){const t=qe.getState().activeRepoId;t&&(Le.getState().loadSessions(),W3(t).then(a=>{const s={};for(const[l,o]of Object.entries(a))s[l]=o.type??"idle";Le.getState().bulkSetStatuses(s);for(const[l,o]of Object.entries(s))(o==="busy"||o==="retry")&&this.callbacks.ensureWorker(l)}).catch(()=>{}))}}class sI{constructor(){rn(this,"workers",new Map);rn(this,"dispatcher",null);rn(this,"supervisor",null);rn(this,"visibilityHandler",null)}start(t){this.stop();const a={onWorkerIdle:s=>this.removeWorker(s)};this.dispatcher=new nI(t,(s,l,o)=>{const d=this.ensureWorker(s,a);if(l==="session.idle"||l==="session.status"){const f=Le.getState().sessionStatuses[s];d.dispatch(l,o);const m=Le.getState().sessionStatuses[s];f&&f!=="idle"&&m==="idle"&&d.refreshOnIdle()}else d.dispatch(l,o)}),this.dispatcher.start(),this.supervisor=new rI({ensureWorker:s=>this.ensureWorker(s,a)}),this.supervisor.start(),this.visibilityHandler=()=>{var s,l;document.hidden?(s=this.supervisor)==null||s.pause():(l=this.supervisor)==null||l.resume()},document.addEventListener("visibilitychange",this.visibilityHandler)}stop(){var t,a;(t=this.dispatcher)==null||t.stop(),this.dispatcher=null,(a=this.supervisor)==null||a.stop(),this.supervisor=null;for(const s of this.workers.values())s.stop();this.workers.clear(),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null)}activateSession(t){for(const l of this.workers.values())l.sessionId!==t&&l.deactivate();if(!t)return;const a={onWorkerIdle:l=>this.removeWorker(l)};this.ensureWorker(t,a).activate(),Le.getState().refreshSessionData(t)}deactivateSession(t){var a;(a=this.workers.get(t))==null||a.deactivate()}ensureWorker(t,a){let s=this.workers.get(t);return s||(s=new J4(t,a),this.workers.set(t,s)),s}removeWorker(t){const a=Le.getState().activeSessionId;if(t===a)return;const s=this.workers.get(t);s&&(s.stop(),this.workers.delete(t))}}const Sc=new sI,s1=(function(e,t,a){const s=Ao(a);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(s(e.children[t],t,e))return e.children[t]}),$s=(function(e){if(e==null)return oI;if(typeof e=="string")return lI(e);if(typeof e=="object")return iI(e);if(typeof e=="function")return $h(e);throw new Error("Expected function, string, or array as `test`")});function iI(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=$s(e[a]);return $h(s);function s(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function lI(e){return $h(t);function t(a){return a.tagName===e}}function $h(e){return t;function t(a,s,l){return!!(uI(a)&&e.call(this,a,typeof s=="number"?s:void 0,l||void 0))}}function oI(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function uI(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const i1=/\n/g,l1=/[\t ]+/g,nh=$s("br"),o1=$s(bI),cI=$s("p"),u1=$s("tr"),dI=$s(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",gI,xI]),uT=$s(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function fI(e,t){const a=t||{},s="children"in e?e.children:[],l=uT(e),o=fT(e,{whitespace:a.whitespace||"normal"}),d=[];(e.type==="text"||e.type==="comment")&&d.push(...dT(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<s.length;)d.push(...cT(s[f],e,{whitespace:o,breakBefore:f?void 0:l,breakAfter:f<s.length-1?nh(s[f+1]):l}));const m=[];let h;for(f=-1;++f<d.length;){const x=d[f];typeof x=="number"?h!==void 0&&x>h&&(h=x):x&&(h!==void 0&&h>-1&&m.push(`
436
- `.repeat(h)||" "),h=-1,m.push(x))}return m.join("")}function cT(e,t,a){return e.type==="element"?mI(e,t,a):e.type==="text"?a.whitespace==="normal"?dT(e,a):hI(e):[]}function mI(e,t,a){const s=fT(e,a),l=e.children||[];let o=-1,d=[];if(dI(e))return d;let f,m;for(nh(e)||u1(e)&&s1(t,e,u1)?m=`
437
- `:cI(e)?(f=2,m=2):uT(e)&&(f=1,m=1);++o<l.length;)d=d.concat(cT(l[o],e,{whitespace:s,breakBefore:o?void 0:f,breakAfter:o<l.length-1?nh(l[o+1]):m}));return o1(e)&&s1(t,e,o1)&&d.push(" "),f&&d.unshift(f),m&&d.push(m),d}function dT(e,t){const a=String(e.value),s=[],l=[];let o=0;for(;o<=a.length;){i1.lastIndex=o;const m=i1.exec(a),h=m&&"index"in m?m.index:a.length;s.push(pI(a.slice(o,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,h===a.length?t.breakAfter:!0)),o=h+1}let d=-1,f;for(;++d<s.length;)s[d].charCodeAt(s[d].length-1)===8203||d<s.length-1&&s[d+1].charCodeAt(0)===8203?(l.push(s[d]),f=void 0):s[d]?(typeof f=="number"&&l.push(f),l.push(s[d]),f=0):(d===0||d===s.length-1)&&l.push(0);return l}function hI(e){return[String(e.value)]}function pI(e,t,a){const s=[];let l=0,o;for(;l<e.length;){l1.lastIndex=l;const d=l1.exec(e);o=d?d.index:e.length,!l&&!o&&d&&!t&&s.push(""),l!==o&&s.push(e.slice(l,o)),l=d?o+d[0].length:o}return l!==o&&!a&&s.push(""),s.join(" ")}function fT(e,t){if(e.type==="element"){const a=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return a.wrap?"pre-wrap":"pre";case"td":case"th":return a.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function gI(e){return!!(e.properties||{}).hidden}function bI(e){return e.tagName==="td"||e.tagName==="th"}function xI(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function EI(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},x={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},T=t.optional(l)+e.IDENT_RE+"\\s*\\(",N=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],z={type:S,keyword:N,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},V={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},M=[V,b,f,a,e.C_BLOCK_COMMENT_MODE,x,h],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:M.concat([{begin:/\(/,end:/\)/,keywords:z,contains:M.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+d+"[\\*&\\s]+)+"+T,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:z,relevance:0},{begin:T,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,x]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,x,f,{begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,x,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(L,K,V,M,[b,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:z,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function yI(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},a=EI(e),s=a.keywords;return s.type=[...s.type,...t.type],s.literal=[...s.literal,...t.literal],s.built_in=[...s.built_in,...t.built_in],s._hints=t._hints,a.name="Arduino",a.aliases=["ino"],a.supersetOf="cpp",a}function TI(e){const t=e.regex,a={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,l]};l.contains.push(f);const m={match:/\\"/},h={className:"string",begin:/'/,end:/'/},x={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,a]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],T=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),N={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],A={match:/(\/[a-z._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],z=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],V=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:S,literal:C,built_in:[...D,...k,"set","shopt",...z,...V]},contains:[T,e.SHEBANG(),N,b,o,d,A,f,m,h,x,a]}}function _I(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="("+s+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},x={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},T=t.optional(l)+e.IDENT_RE+"\\s*\\(",C={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},A=[b,f,a,e.C_BLOCK_COMMENT_MODE,x,h],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:A.concat([{begin:/\(/,end:/\)/,keywords:C,contains:A.concat(["self"]),relevance:0}]),relevance:0},k={begin:"("+d+"[\\*&\\s]+)+"+T,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:C,relevance:0},{begin:T,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,x,f,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,x,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C",aliases:["h"],keywords:C,disableAutodetect:!0,illegal:"</",contains:[].concat(D,k,A,[b,{begin:e.IDENT_RE+"::",keywords:C},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:b,strings:h,keywords:C}}}function NI(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},x={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},T=t.optional(l)+e.IDENT_RE+"\\s*\\(",N=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],z={type:S,keyword:N,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},V={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},M=[V,b,f,a,e.C_BLOCK_COMMENT_MODE,x,h],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:M.concat([{begin:/\(/,end:/\)/,keywords:z,contains:M.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+d+"[\\*&\\s]+)+"+T,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:z,relevance:0},{begin:T,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,x]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,x,f,{begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,x,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(L,K,V,M,[b,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:z,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function SI(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],l=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:l.concat(o),built_in:t,literal:s},f=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),m={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},x={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},b=e.inherit(x,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:d},T=e.inherit(y,{illegal:/\n/}),N={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,T]},S={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},C=e.inherit(S,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},T]});y.contains=[S,N,x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.C_BLOCK_COMMENT_MODE],T.contains=[C,N,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const A={variants:[h,S,N,x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},k=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",z={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},A,m,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,D,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,D,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+k+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,D],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[A,m,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},z]}}const vI=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),AI=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],CI=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],wI=[...AI,...CI],kI=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),RI=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),OI=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),II=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function MI(e){const t=e.regex,a=vI(e),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",o=/@-?\w[\w]*(-\w+)*/,d="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[a.BLOCK_COMMENT,s,a.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+d,relevance:0},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+RI.join("|")+")"},{begin:":(:)?("+OI.join("|")+")"}]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+II.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[a.BLOCK_COMMENT,a.HEXCOLOR,a.IMPORTANT,a.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},a.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:kI.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,a.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+wI.join("|")+")\\b"}]}}function DI(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function LI(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function jI(e){const t=e.regex,a=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(a,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function BI(e){const t=e.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},s=e.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const l={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[s,o,l,d,a,"self"],relevance:0},m=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,x=/'[^']*'/,b=t.either(m,h,x),y=t.concat(b,"(\\s*\\.\\s*",b,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[s,f,o,l,d,a]}}]}}var Ii="[0-9](_*[0-9])*",Ju=`\\.(${Ii})`,ec="[0-9a-fA-F](_*[0-9a-fA-F])*",c1={className:"number",variants:[{begin:`(\\b(${Ii})((${Ju})|\\.)?|(${Ju}))[eE][+-]?(${Ii})[fFdD]?\\b`},{begin:`\\b(${Ii})((${Ju})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ju})[fFdD]?\\b`},{begin:`\\b(${Ii})[fFdD]\\b`},{begin:`\\b0[xX]((${ec})\\.?|(${ec})?\\.(${ec}))[pP][+-]?(${Ii})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ec})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function mT(e,t,a){return a===-1?"":e.replace(t,s=>mT(e,t,a-1))}function PI(e){const t=e.regex,a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",s=a+mT("(?:<"+a+"~~~(?:\\s*,\\s*"+a+"~~~)*>)?",/~~~/g,2),m={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+a,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},x={className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:m,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,a),/\s+/,a,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,a],className:{1:"keyword",3:"title.class"},contains:[x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+s+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:m,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c1,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},c1,h]}}const d1="[A-Za-z$_][0-9A-Za-z$_]*",UI=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],HI=["true","false","null","undefined","NaN","Infinity"],hT=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],pT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],FI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],zI=[].concat(gT,hT,pT);function qI(e){const t=e.regex,a=(pe,{after:ke})=>{const P="</"+pe[0].slice(1);return pe.input.indexOf(P,ke)!==-1},s=d1,l={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(pe,ke)=>{const P=pe[0].length+pe.index,R=pe.input[P];if(R==="<"||R===","){ke.ignoreMatch();return}R===">"&&(a(pe,{after:P})||ke.ignoreMatch());let W;const O=pe.input.substring(P);if(W=O.match(/^\s*=/)){ke.ignoreMatch();return}if((W=O.match(/^\s+extends\s+/))&&W.index===0){ke.ignoreMatch();return}}},f={$pattern:d1,keyword:UI,literal:HI,built_in:zI,"variable.language":FI},m="[0-9](_?[0-9])*",h=`\\.(${m})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${h})|\\.)?|(${h}))[eE][+-]?(${m})\\b`},{begin:`\\b(${x})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},T={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},N={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},k=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,N,S,C,{match:/\$\d+/},b];y.contains=k.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(k)});const z=[].concat(D,y.contains),V=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(z)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:V},L={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...hT,...pT]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(pe){return t.concat("(?!",pe.join("|"),")")}const ie={match:t.concat(/\b/,te([...gT,"super","import"].map(pe=>`${pe}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Z={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ee={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},Q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:V,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,N,S,C,D,{match:/\$\d+/},b,K,{scope:"attr",match:s+t.lookahead(":"),relevance:0},$,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:Q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:V}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:o},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},ie,U,L,ee,{match:/\$[(.]/}]}}function YI(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],l={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[t,a,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Mi="[0-9](_*[0-9])*",tc=`\\.(${Mi})`,nc="[0-9a-fA-F](_*[0-9a-fA-F])*",$I={className:"number",variants:[{begin:`(\\b(${Mi})((${tc})|\\.)?|(${tc}))[eE][+-]?(${Mi})[fFdD]?\\b`},{begin:`\\b(${Mi})((${tc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${tc})[fFdD]?\\b`},{begin:`\\b(${Mi})[fFdD]\\b`},{begin:`\\b0[xX]((${nc})\\.?|(${nc})?\\.(${nc}))[pP][+-]?(${Mi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${nc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function GI(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},s={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},l={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},d={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,l]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,l]}]};l.contains.push(d);const f={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},m={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(d,{className:"string"}),"self"]}]},h=$I,x=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),b={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},y=b;return y.variants[1].contains=[b],b.variants[1].contains=[y],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,x,a,s,f,m,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[b,e.C_LINE_COMMENT_MODE,x],relevance:0},e.C_LINE_COMMENT_MODE,x,f,m,d,e.C_NUMBER_MODE]},x]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},f,m]},d,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
438
- `},h]}}const KI=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),VI=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],QI=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],XI=[...VI,...QI],ZI=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),bT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),xT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),WI=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),JI=bT.concat(xT).sort().reverse();function e6(e){const t=KI(e),a=JI,s="and or not only",l="[\\w-]+",o="("+l+"|@\\{"+l+"\\})",d=[],f=[],m=function(k){return{className:"string",begin:"~?"+k+".*?"+k}},h=function(k,z,V){return{className:k,begin:z,relevance:V}},x={$pattern:/[a-z-]+/,keyword:s,attribute:ZI.join(" ")},b={begin:"\\(",end:"\\)",contains:f,keywords:x,relevance:0};f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m("'"),m('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,b,h("variable","@@?"+l,10),h("variable","@\\{"+l+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:l+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const y=f.concat({begin:/\{/,end:/\}/,contains:d}),T={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},N={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+WI.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},S={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:x,returnEnd:!0,contains:f,relevance:0}},C={className:"variable",variants:[{begin:"@"+l+"\\s*:",relevance:15},{begin:"@"+l}],starts:{end:"[;}]",returnEnd:!0,contains:y}},A={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,T,h("keyword","all\\b"),h("variable","@\\{"+l+"\\}"),{begin:"\\b("+XI.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",o,0),h("selector-id","#"+o),h("selector-class","\\."+o,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+bT.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+xT.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:y},{begin:"!important"},t.FUNCTION_DISPATCH]},D={begin:l+`:(:)?(${a.join("|")})`,returnBegin:!0,contains:[A]};return d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,S,C,D,N,A,T,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:d}}function t6(e){const t="\\[=*\\[",a="\\]=*\\]",s={begin:t,end:a,contains:["self"]},l=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,a,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:l.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:l}].concat(l)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:a,contains:[s],relevance:5}])}}function n6(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,a]},l={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,a,s,l,o,d]}}function a6(e){const t=e.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,m={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},x={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=e.inherit(h,{contains:[]}),y=e.inherit(x,{contains:[]});h.contains.push(y),x.contains.push(b);let T=[a,m];return[h,x,b,y].forEach(A=>{A.contains=A.contains.concat(T)}),T=T.concat(h,x),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:T},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:T}]}]},a,o,h,x,{className:"quote",begin:"^>\\s+",contains:T,end:"$"},l,s,m,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function r6(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:a,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},m={$pattern:a,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+m.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:m,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function s6(e){const t=e.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,l={$pattern:/[\w.]+/,keyword:a.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:l},d={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},m={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},x=[e.BACKSLASH_ESCAPE,o,m],b=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(S,C,A="\\1")=>{const D=A==="\\1"?A:t.concat(A,C);return t.concat(t.concat("(?:",S,")"),C,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,A,s)},T=(S,C,A)=>t.concat(t.concat("(?:",S,")"),C,/(?:\\.|[^\\\/])*?/,A,s),N=[m,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:x,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",t.either(...b,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:T("(?:m|qr)?",/\//,/\//)},{begin:T("m|qr",t.either(...b,{capture:!0}),/\1/)},{begin:T("m|qr",/\(/,/\)/)},{begin:T("m|qr",/\[/,/\]/)},{begin:T("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=N,d.contains=N,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:N}}function i6(e){const t=e.regex,a=/(?![A-Za-z0-9])(?![$])/,s=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),l=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),o=t.concat(/[A-Z]+/,a),d={scope:"variable",match:"\\$+"+s},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},m={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),x=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(m)}),b={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(m),"on:begin":(Z,ee)=>{ee.data._beginMatch=Z[1]||Z[2]},"on:end":(Z,ee)=>{ee.data._beginMatch!==Z[1]&&ee.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),T=`[
439
- ]`,N={scope:"string",variants:[x,h,b,y]},S={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},C=["false","null","true"],A=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],D=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],z={keyword:A,literal:(Z=>{const ee=[];return Z.forEach(Q=>{ee.push(Q),Q.toLowerCase()===Q?ee.push(Q.toUpperCase()):ee.push(Q.toLowerCase())}),ee})(C),built_in:D},V=Z=>Z.map(ee=>ee.replace(/\|\d+$/,"")),M={variants:[{match:[/new/,t.concat(T,"+"),t.concat("(?!",V(D).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},L=t.concat(s,"\\b(?!\\()"),K={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{1:"title.class",3:"variable.constant"}},{match:[l,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},se={scope:"attr",match:t.concat(s,t.lookahead(":"),t.lookahead(/(?!::)/))},B={relevance:0,begin:/\(/,end:/\)/,keywords:z,contains:[se,d,K,e.C_BLOCK_COMMENT_MODE,N,S,M]},U={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",V(A).join("\\b|"),"|",V(D).join("\\b|"),"\\b)"),s,t.concat(T,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[B]};B.contains.push(U);const te=[se,K,e.C_BLOCK_COMMENT_MODE,N,S,M],ie={begin:t.concat(/#\[\s*\\?/,t.either(l,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:C,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:C,keyword:["new","array"]},contains:["self",...te]},...te,{scope:"meta",variants:[{match:l},{match:o}]}]};return{case_insensitive:!1,keywords:z,contains:[ie,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},d,U,K,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},M,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",ie,d,K,e.C_BLOCK_COMMENT_MODE,N,S]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},N,S]}}function l6(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function o6(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function u6(e){const t=e.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},m={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},x={begin:/\{\{/,relevance:0},b={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m,x,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m,x,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,x,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,x,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",T=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,N=`\\b|${s.join("|")}`,S={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${T}))[eE][+-]?(${y})[jJ]?(?=${N})`},{begin:`(${T})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${N})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${N})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${N})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${N})`},{begin:`\\b(${y})[jJ](?=${N})`}]},C={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",m,S,b,e.HASH_COMMENT_MODE]}]};return h.contains=[b,S,m],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[m,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,C,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[S,A,b]}]}}function c6(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function d6(e){const t=e.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),l=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[l,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[o,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:l},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function f6(e){const t=e.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),l=t.concat(s,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},m={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],x={className:"subst",begin:/#\{/,end:/\}/,keywords:d},b={className:"string",contains:[e.BACKSLASH_ESCAPE,x],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,x]})]}]},y="[1-9](_?[0-9])*|0",T="[0-9](_?[0-9])*",N={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${T}))?([eE][+-]?(${T})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},S={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},M=[b,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:d},{relevance:0,match:[l,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[S]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[b,{begin:a}],relevance:0},N,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:d},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,x],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(m,h),relevance:0}].concat(m,h);x.contains=M,S.contains=M;const B=[{begin:/^\s*=>/,starts:{end:"$",contains:M}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:M}}];return h.unshift(m),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(B).concat(h).concat(M)}}function m6(e){const t=e.regex,a=/(r#)?/,s=t.concat(a,e.UNDERSCORE_IDENT_RE),l=t.concat(a,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,t.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],m=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],x=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:x,keyword:f,literal:m,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:x}},{className:"punctuation",begin:"->"},o]}}const h6=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),p6=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],g6=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],b6=[...p6,...g6],x6=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),E6=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),y6=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),T6=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function _6(e){const t=h6(e),a=y6,s=E6,l="@[a-z-]+",o="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+b6.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+s.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+a.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+T6.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,f,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:l,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:x6.join(" ")},contains:[{begin:l,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function N6(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function S6(e){const t=e.regex,a=e.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],m=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],x=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],b=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],T=x,N=[...h,...m].filter(V=>!x.includes(V)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:t.concat(/\b/,t.either(...T),/\s*\(/),relevance:0,keywords:{built_in:T}};function D(V){return t.concat(/\b/,t.either(...V.map(M=>M.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:D(y),relevance:0};function z(V,{exceptions:M,when:L}={}){const K=L;return M=M||[],V.map(se=>se.match(/\|\d+$/)||M.includes(se)?se:K(se)?`${se}|0`:se)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:z(N,{when:V=>V.length<3}),literal:o,type:f,built_in:b},contains:[{scope:"type",match:D(d)},k,A,S,s,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,a,C]}}function ET(e){return e?typeof e=="string"?e:e.source:null}function Xl(e){return At("(?=",e,")")}function At(...e){return e.map(a=>ET(a)).join("")}function v6(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function On(...e){return"("+(v6(e).capture?"":"?:")+e.map(s=>ET(s)).join("|")+")"}const Gh=e=>At(/\b/,e,/\w$/.test(e)?/\b/:/\B/),A6=["Protocol","Type"].map(Gh),f1=["init","self"].map(Gh),C6=["Any","Self"],km=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],m1=["false","nil","true"],w6=["assignment","associativity","higherThan","left","lowerThan","none","right"],k6=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],h1=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],yT=On(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),TT=On(yT,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Rm=At(yT,TT,"*"),_T=On(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),vc=On(_T,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ya=At(_T,vc,"*"),ac=At(/[A-Z]/,vc,"*"),R6=["attached","autoclosure",At(/convention\(/,On("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",At(/objc\(/,Ya,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],O6=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function I6(e){const t={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,a],l={match:[/\./,On(...A6,...f1)],className:{2:"keyword"}},o={match:At(/\./,On(...km)),relevance:0},d=km.filter(Je=>typeof Je=="string").concat(["_|0"]),f=km.filter(Je=>typeof Je!="string").concat(C6).map(Gh),m={variants:[{className:"keyword",match:On(...f,...f1)}]},h={$pattern:On(/\b\w+/,/#\w+/),keyword:d.concat(k6),literal:m1},x=[l,o,m],b={match:At(/\./,On(...h1)),relevance:0},y={className:"built_in",match:At(/\b/,On(...h1),/(?=\()/)},T=[b,y],N={match:/->/,relevance:0},S={className:"operator",relevance:0,variants:[{match:Rm},{match:`\\.(\\.|${TT})+`}]},C=[N,S],A="([0-9]_*)+",D="([0-9a-fA-F]_*)+",k={className:"number",relevance:0,variants:[{match:`\\b(${A})(\\.(${A}))?([eE][+-]?(${A}))?\\b`},{match:`\\b0x(${D})(\\.(${D}))?([pP][+-]?(${A}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},z=(Je="")=>({className:"subst",variants:[{match:At(/\\/,Je,/[0\\tnr"']/)},{match:At(/\\/,Je,/u\{[0-9a-fA-F]{1,8}\}/)}]}),V=(Je="")=>({className:"subst",match:At(/\\/,Je,/[\t ]*(?:[\r\n]|\r\n)/)}),M=(Je="")=>({className:"subst",label:"interpol",begin:At(/\\/,Je,/\(/),end:/\)/}),L=(Je="")=>({begin:At(Je,/"""/),end:At(/"""/,Je),contains:[z(Je),V(Je),M(Je)]}),K=(Je="")=>({begin:At(Je,/"/),end:At(/"/,Je),contains:[z(Je),M(Je)]}),se={className:"string",variants:[L(),L("#"),L("##"),L("###"),K(),K("#"),K("##"),K("###")]},B=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],U={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:B},te=Je=>{const Dn=At(Je,/\//),Cn=At(/\//,Je);return{begin:Dn,end:Cn,contains:[...B,{scope:"comment",begin:`#(?!.*${Cn})`,end:/$/}]}},ie={scope:"regexp",variants:[te("###"),te("##"),te("#"),U]},Z={match:At(/`/,Ya,/`/)},ee={className:"variable",match:/\$\d+/},Q={className:"variable",match:`\\$${vc}+`},$=[Z,ee,Q],pe={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:O6,contains:[...C,k,se]}]}},ke={scope:"keyword",match:At(/@/,On(...R6),Xl(On(/\(/,/\s+/)))},P={scope:"meta",match:At(/@/,Ya)},R=[pe,ke,P],W={match:Xl(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:At(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,vc,"+")},{className:"type",match:ac,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:At(/\s+&\s+/,Xl(ac)),relevance:0}]},O={begin:/</,end:/>/,keywords:h,contains:[...s,...x,...R,N,W]};W.contains.push(O);const ge={match:At(Ya,/\s*:/),keywords:"_|0",relevance:0},ve={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",ge,...s,ie,...x,...T,...C,k,se,...$,...R,W]},Ae={begin:/</,end:/>/,keywords:"repeat each",contains:[...s,W]},$e={begin:On(Xl(At(Ya,/\s*:/)),Xl(At(Ya,/\s+/,Ya,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ya}]},dt={begin:/\(/,end:/\)/,keywords:h,contains:[$e,...s,...x,...C,k,se,...R,W,ve],endsParent:!0,illegal:/["']/},ut={match:[/(func|macro)/,/\s+/,On(Z.match,Ya,Rm)],className:{1:"keyword",3:"title.function"},contains:[Ae,dt,t],illegal:[/\[/,/%/]},Ft={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ae,dt,t],illegal:/\[|%/},yn={match:[/operator/,/\s+/,Rm],className:{1:"keyword",3:"title"}},da={begin:[/precedencegroup/,/\s+/,ac],className:{1:"keyword",3:"title"},contains:[W],keywords:[...w6,...m1],end:/}/},Aa={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},un={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Qn={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ya,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[Ae,...x,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:ac},...x],relevance:0}]};for(const Je of se.variants){const Dn=Je.contains.find(fa=>fa.label==="interpol");Dn.keywords=h;const Cn=[...x,...T,...C,k,se,...$];Dn.contains=[...Cn,{begin:/\(/,end:/\)/,contains:["self",...Cn]}]}return{name:"Swift",keywords:h,contains:[...s,ut,Ft,Aa,un,Qn,yn,da,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},ie,...x,...T,...C,k,se,...$,...R,W,ve]}}const Ac="[A-Za-z$_][0-9A-Za-z$_]*",NT=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ST=["true","false","null","undefined","NaN","Infinity"],vT=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],AT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],CT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],wT=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],kT=[].concat(CT,vT,AT);function M6(e){const t=e.regex,a=(pe,{after:ke})=>{const P="</"+pe[0].slice(1);return pe.input.indexOf(P,ke)!==-1},s=Ac,l={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(pe,ke)=>{const P=pe[0].length+pe.index,R=pe.input[P];if(R==="<"||R===","){ke.ignoreMatch();return}R===">"&&(a(pe,{after:P})||ke.ignoreMatch());let W;const O=pe.input.substring(P);if(W=O.match(/^\s*=/)){ke.ignoreMatch();return}if((W=O.match(/^\s+extends\s+/))&&W.index===0){ke.ignoreMatch();return}}},f={$pattern:Ac,keyword:NT,literal:ST,built_in:kT,"variable.language":wT},m="[0-9](_?[0-9])*",h=`\\.(${m})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${h})|\\.)?|(${h}))[eE][+-]?(${m})\\b`},{begin:`\\b(${x})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},T={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},N={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},k=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,N,S,C,{match:/\$\d+/},b];y.contains=k.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(k)});const z=[].concat(D,y.contains),V=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(z)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:V},L={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...vT,...AT]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(pe){return t.concat("(?!",pe.join("|"),")")}const ie={match:t.concat(/\b/,te([...CT,"super","import"].map(pe=>`${pe}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Z={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ee={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},Q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:V,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,N,S,C,D,{match:/\$\d+/},b,K,{scope:"attr",match:s+t.lookahead(":"),relevance:0},$,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:Q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:V}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:o},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},ie,U,L,ee,{match:/\$[(.]/}]}}function D6(e){const t=e.regex,a=M6(e),s=Ac,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},d={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[a.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},m=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Ac,keyword:NT.concat(m),literal:ST,built_in:kT.concat(l),"variable.language":wT},x={className:"meta",begin:"@"+s},b=(S,C,A)=>{const D=S.contains.findIndex(k=>k.label===C);if(D===-1)throw new Error("can not find mode to replace");S.contains.splice(D,1,A)};Object.assign(a.keywords,h),a.exports.PARAMS_CONTAINS.push(x);const y=a.contains.find(S=>S.scope==="attr"),T=Object.assign({},y,{match:t.concat(s,t.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,y,T]),a.contains=a.contains.concat([x,o,d,T]),b(a,"shebang",e.SHEBANG()),b(a,"use_strict",f);const N=a.contains.find(S=>S.label==="func.def");return N.relevance=0,Object.assign(a,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),a}function L6(e){const t=e.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},l=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,m={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,l),/ *#/)},{begin:t.concat(/# */,f,/ *#/)},{begin:t.concat(/# */,d,/ *#/)},{begin:t.concat(/# */,t.either(o,l),/ +/,t.either(d,f),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},x={className:"label",begin:/^\w+:/},b=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[a,s,m,h,x,b,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}function j6(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const a=e.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],l={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},m={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[a,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,d,l,e.QUOTE_STRING_MODE,m,h,f]}}function B6(e){const t=e.regex,a=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=e.inherit(o,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),m=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,m,f,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,d,m,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[m]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(a,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function P6(e){const t="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},f=e.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},T={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},N={begin:/\{/,end:/\}/,contains:[T],illegal:"\\n",relevance:0},S={begin:"\\[",end:"\\]",contains:[T],illegal:"\\n",relevance:0},C=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},N,S,o,d],A=[...C];return A.pop(),A.push(f),T.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const U6={arduino:yI,bash:TI,c:_I,cpp:NI,csharp:SI,css:MI,diff:DI,go:LI,graphql:jI,ini:BI,java:PI,javascript:qI,json:YI,kotlin:GI,less:e6,lua:t6,makefile:n6,markdown:a6,objectivec:r6,perl:s6,php:i6,"php-template":l6,plaintext:o6,python:u6,"python-repl":c6,r:d6,ruby:f6,rust:m6,scss:_6,shell:N6,sql:S6,swift:I6,typescript:D6,vbnet:L6,wasm:j6,xml:B6,yaml:P6};var Om,p1;function H6(){if(p1)return Om;p1=1;function e(Y){return Y instanceof Map?Y.clear=Y.delete=Y.set=function(){throw new Error("map is read-only")}:Y instanceof Set&&(Y.add=Y.clear=Y.delete=function(){throw new Error("set is read-only")}),Object.freeze(Y),Object.getOwnPropertyNames(Y).forEach(fe=>{const Ne=Y[fe],Ge=typeof Ne;(Ge==="object"||Ge==="function")&&!Object.isFrozen(Ne)&&e(Ne)}),Y}class t{constructor(fe){fe.data===void 0&&(fe.data={}),this.data=fe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(Y){return Y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(Y,...fe){const Ne=Object.create(null);for(const Ge in Y)Ne[Ge]=Y[Ge];return fe.forEach(function(Ge){for(const Mt in Ge)Ne[Mt]=Ge[Mt]}),Ne}const l="</span>",o=Y=>!!Y.scope,d=(Y,{prefix:fe})=>{if(Y.startsWith("language:"))return Y.replace("language:","language-");if(Y.includes(".")){const Ne=Y.split(".");return[`${fe}${Ne.shift()}`,...Ne.map((Ge,Mt)=>`${Ge}${"_".repeat(Mt+1)}`)].join(" ")}return`${fe}${Y}`};class f{constructor(fe,Ne){this.buffer="",this.classPrefix=Ne.classPrefix,fe.walk(this)}addText(fe){this.buffer+=a(fe)}openNode(fe){if(!o(fe))return;const Ne=d(fe.scope,{prefix:this.classPrefix});this.span(Ne)}closeNode(fe){o(fe)&&(this.buffer+=l)}value(){return this.buffer}span(fe){this.buffer+=`<span class="${fe}">`}}const m=(Y={})=>{const fe={children:[]};return Object.assign(fe,Y),fe};class h{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(fe){this.top.children.push(fe)}openNode(fe){const Ne=m({scope:fe});this.add(Ne),this.stack.push(Ne)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(fe){return this.constructor._walk(fe,this.rootNode)}static _walk(fe,Ne){return typeof Ne=="string"?fe.addText(Ne):Ne.children&&(fe.openNode(Ne),Ne.children.forEach(Ge=>this._walk(fe,Ge)),fe.closeNode(Ne)),fe}static _collapse(fe){typeof fe!="string"&&fe.children&&(fe.children.every(Ne=>typeof Ne=="string")?fe.children=[fe.children.join("")]:fe.children.forEach(Ne=>{h._collapse(Ne)}))}}class x extends h{constructor(fe){super(),this.options=fe}addText(fe){fe!==""&&this.add(fe)}startScope(fe){this.openNode(fe)}endScope(){this.closeNode()}__addSublanguage(fe,Ne){const Ge=fe.root;Ne&&(Ge.scope=`language:${Ne}`),this.add(Ge)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(Y){return Y?typeof Y=="string"?Y:Y.source:null}function y(Y){return S("(?=",Y,")")}function T(Y){return S("(?:",Y,")*")}function N(Y){return S("(?:",Y,")?")}function S(...Y){return Y.map(Ne=>b(Ne)).join("")}function C(Y){const fe=Y[Y.length-1];return typeof fe=="object"&&fe.constructor===Object?(Y.splice(Y.length-1,1),fe):{}}function A(...Y){return"("+(C(Y).capture?"":"?:")+Y.map(Ge=>b(Ge)).join("|")+")"}function D(Y){return new RegExp(Y.toString()+"|").exec("").length-1}function k(Y,fe){const Ne=Y&&Y.exec(fe);return Ne&&Ne.index===0}const z=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function V(Y,{joinWith:fe}){let Ne=0;return Y.map(Ge=>{Ne+=1;const Mt=Ne;let Ct=b(Ge),Ie="";for(;Ct.length>0;){const we=z.exec(Ct);if(!we){Ie+=Ct;break}Ie+=Ct.substring(0,we.index),Ct=Ct.substring(we.index+we[0].length),we[0][0]==="\\"&&we[1]?Ie+="\\"+String(Number(we[1])+Mt):(Ie+=we[0],we[0]==="("&&Ne++)}return Ie}).map(Ge=>`(${Ge})`).join(fe)}const M=/\b\B/,L="[a-zA-Z]\\w*",K="[a-zA-Z_]\\w*",se="\\b\\d+(\\.\\d+)?",B="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",U="\\b(0b[01]+)",te="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ie=(Y={})=>{const fe=/^#![ ]*\//;return Y.binary&&(Y.begin=S(fe,/.*\b/,Y.binary,/\b.*/)),s({scope:"meta",begin:fe,end:/$/,relevance:0,"on:begin":(Ne,Ge)=>{Ne.index!==0&&Ge.ignoreMatch()}},Y)},Z={begin:"\\\\[\\s\\S]",relevance:0},ee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Z]},Q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Z]},$={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},pe=function(Y,fe,Ne={}){const Ge=s({scope:"comment",begin:Y,end:fe,contains:[]},Ne);Ge.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Mt=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ge.contains.push({begin:S(/[ ]+/,"(",Mt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ge},ke=pe("//","$"),P=pe("/\\*","\\*/"),R=pe("#","$"),W={scope:"number",begin:se,relevance:0},O={scope:"number",begin:B,relevance:0},ge={scope:"number",begin:U,relevance:0},ve={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Z,{begin:/\[/,end:/\]/,relevance:0,contains:[Z]}]},Ae={scope:"title",begin:L,relevance:0},$e={scope:"title",begin:K,relevance:0},dt={begin:"\\.\\s*"+K,relevance:0};var Ft=Object.freeze({__proto__:null,APOS_STRING_MODE:ee,BACKSLASH_ESCAPE:Z,BINARY_NUMBER_MODE:ge,BINARY_NUMBER_RE:U,COMMENT:pe,C_BLOCK_COMMENT_MODE:P,C_LINE_COMMENT_MODE:ke,C_NUMBER_MODE:O,C_NUMBER_RE:B,END_SAME_AS_BEGIN:function(Y){return Object.assign(Y,{"on:begin":(fe,Ne)=>{Ne.data._beginMatch=fe[1]},"on:end":(fe,Ne)=>{Ne.data._beginMatch!==fe[1]&&Ne.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:L,MATCH_NOTHING_RE:M,METHOD_GUARD:dt,NUMBER_MODE:W,NUMBER_RE:se,PHRASAL_WORDS_MODE:$,QUOTE_STRING_MODE:Q,REGEXP_MODE:ve,RE_STARTERS_RE:te,SHEBANG:ie,TITLE_MODE:Ae,UNDERSCORE_IDENT_RE:K,UNDERSCORE_TITLE_MODE:$e});function yn(Y,fe){Y.input[Y.index-1]==="."&&fe.ignoreMatch()}function da(Y,fe){Y.className!==void 0&&(Y.scope=Y.className,delete Y.className)}function Aa(Y,fe){fe&&Y.beginKeywords&&(Y.begin="\\b("+Y.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Y.__beforeBegin=yn,Y.keywords=Y.keywords||Y.beginKeywords,delete Y.beginKeywords,Y.relevance===void 0&&(Y.relevance=0))}function un(Y,fe){Array.isArray(Y.illegal)&&(Y.illegal=A(...Y.illegal))}function Qn(Y,fe){if(Y.match){if(Y.begin||Y.end)throw new Error("begin & end are not supported with match");Y.begin=Y.match,delete Y.match}}function Je(Y,fe){Y.relevance===void 0&&(Y.relevance=1)}const Dn=(Y,fe)=>{if(!Y.beforeMatch)return;if(Y.starts)throw new Error("beforeMatch cannot be used with starts");const Ne=Object.assign({},Y);Object.keys(Y).forEach(Ge=>{delete Y[Ge]}),Y.keywords=Ne.keywords,Y.begin=S(Ne.beforeMatch,y(Ne.begin)),Y.starts={relevance:0,contains:[Object.assign(Ne,{endsParent:!0})]},Y.relevance=0,delete Ne.beforeMatch},Cn=["of","and","for","in","not","or","if","then","parent","list","value"],fa="keyword";function Ca(Y,fe,Ne=fa){const Ge=Object.create(null);return typeof Y=="string"?Mt(Ne,Y.split(" ")):Array.isArray(Y)?Mt(Ne,Y):Object.keys(Y).forEach(function(Ct){Object.assign(Ge,Ca(Y[Ct],fe,Ct))}),Ge;function Mt(Ct,Ie){fe&&(Ie=Ie.map(we=>we.toLowerCase())),Ie.forEach(function(we){const Ye=we.split("|");Ge[Ye[0]]=[Ct,Wa(Ye[0],Ye[1])]})}}function Wa(Y,fe){return fe?Number(fe):ja(Y)?0:1}function ja(Y){return Cn.includes(Y.toLowerCase())}const Ar={},_t=Y=>{console.error(Y)},Ja=(Y,...fe)=>{console.log(`WARN: ${Y}`,...fe)},ue=(Y,fe)=>{Ar[`${Y}/${fe}`]||(console.log(`Deprecated as of ${Y}. ${fe}`),Ar[`${Y}/${fe}`]=!0)},Te=new Error;function Pe(Y,fe,{key:Ne}){let Ge=0;const Mt=Y[Ne],Ct={},Ie={};for(let we=1;we<=fe.length;we++)Ie[we+Ge]=Mt[we],Ct[we+Ge]=!0,Ge+=D(fe[we-1]);Y[Ne]=Ie,Y[Ne]._emit=Ct,Y[Ne]._multi=!0}function H(Y){if(Array.isArray(Y.begin)){if(Y.skip||Y.excludeBegin||Y.returnBegin)throw _t("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Te;if(typeof Y.beginScope!="object"||Y.beginScope===null)throw _t("beginScope must be object"),Te;Pe(Y,Y.begin,{key:"beginScope"}),Y.begin=V(Y.begin,{joinWith:""})}}function Se(Y){if(Array.isArray(Y.end)){if(Y.skip||Y.excludeEnd||Y.returnEnd)throw _t("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Te;if(typeof Y.endScope!="object"||Y.endScope===null)throw _t("endScope must be object"),Te;Pe(Y,Y.end,{key:"endScope"}),Y.end=V(Y.end,{joinWith:""})}}function ft(Y){Y.scope&&typeof Y.scope=="object"&&Y.scope!==null&&(Y.beginScope=Y.scope,delete Y.scope)}function ln(Y){ft(Y),typeof Y.beginScope=="string"&&(Y.beginScope={_wrap:Y.beginScope}),typeof Y.endScope=="string"&&(Y.endScope={_wrap:Y.endScope}),H(Y),Se(Y)}function Zt(Y){function fe(Ie,we){return new RegExp(b(Ie),"m"+(Y.case_insensitive?"i":"")+(Y.unicodeRegex?"u":"")+(we?"g":""))}class Ne{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(we,Ye){Ye.position=this.position++,this.matchIndexes[this.matchAt]=Ye,this.regexes.push([Ye,we]),this.matchAt+=D(we)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const we=this.regexes.map(Ye=>Ye[1]);this.matcherRe=fe(V(we,{joinWith:"|"}),!0),this.lastIndex=0}exec(we){this.matcherRe.lastIndex=this.lastIndex;const Ye=this.matcherRe.exec(we);if(!Ye)return null;const $t=Ye.findIndex((er,Vs)=>Vs>0&&er!==void 0),jt=this.matchIndexes[$t];return Ye.splice(0,$t),Object.assign(Ye,jt)}}class Ge{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(we){if(this.multiRegexes[we])return this.multiRegexes[we];const Ye=new Ne;return this.rules.slice(we).forEach(([$t,jt])=>Ye.addRule($t,jt)),Ye.compile(),this.multiRegexes[we]=Ye,Ye}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(we,Ye){this.rules.push([we,Ye]),Ye.type==="begin"&&this.count++}exec(we){const Ye=this.getMatcher(this.regexIndex);Ye.lastIndex=this.lastIndex;let $t=Ye.exec(we);if(this.resumingScanAtSamePosition()&&!($t&&$t.index===this.lastIndex)){const jt=this.getMatcher(0);jt.lastIndex=this.lastIndex+1,$t=jt.exec(we)}return $t&&(this.regexIndex+=$t.position+1,this.regexIndex===this.count&&this.considerAll()),$t}}function Mt(Ie){const we=new Ge;return Ie.contains.forEach(Ye=>we.addRule(Ye.begin,{rule:Ye,type:"begin"})),Ie.terminatorEnd&&we.addRule(Ie.terminatorEnd,{type:"end"}),Ie.illegal&&we.addRule(Ie.illegal,{type:"illegal"}),we}function Ct(Ie,we){const Ye=Ie;if(Ie.isCompiled)return Ye;[da,Qn,ln,Dn].forEach(jt=>jt(Ie,we)),Y.compilerExtensions.forEach(jt=>jt(Ie,we)),Ie.__beforeBegin=null,[Aa,un,Je].forEach(jt=>jt(Ie,we)),Ie.isCompiled=!0;let $t=null;return typeof Ie.keywords=="object"&&Ie.keywords.$pattern&&(Ie.keywords=Object.assign({},Ie.keywords),$t=Ie.keywords.$pattern,delete Ie.keywords.$pattern),$t=$t||/\w+/,Ie.keywords&&(Ie.keywords=Ca(Ie.keywords,Y.case_insensitive)),Ye.keywordPatternRe=fe($t,!0),we&&(Ie.begin||(Ie.begin=/\B|\b/),Ye.beginRe=fe(Ye.begin),!Ie.end&&!Ie.endsWithParent&&(Ie.end=/\B|\b/),Ie.end&&(Ye.endRe=fe(Ye.end)),Ye.terminatorEnd=b(Ye.end)||"",Ie.endsWithParent&&we.terminatorEnd&&(Ye.terminatorEnd+=(Ie.end?"|":"")+we.terminatorEnd)),Ie.illegal&&(Ye.illegalRe=fe(Ie.illegal)),Ie.contains||(Ie.contains=[]),Ie.contains=[].concat(...Ie.contains.map(function(jt){return cn(jt==="self"?Ie:jt)})),Ie.contains.forEach(function(jt){Ct(jt,Ye)}),Ie.starts&&Ct(Ie.starts,we),Ye.matcher=Mt(Ye),Ye}if(Y.compilerExtensions||(Y.compilerExtensions=[]),Y.contains&&Y.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Y.classNameAliases=s(Y.classNameAliases||{}),Ct(Y)}function Ot(Y){return Y?Y.endsWithParent||Ot(Y.starts):!1}function cn(Y){return Y.variants&&!Y.cachedVariants&&(Y.cachedVariants=Y.variants.map(function(fe){return s(Y,{variants:null},fe)})),Y.cachedVariants?Y.cachedVariants:Ot(Y)?s(Y,{starts:Y.starts?s(Y.starts):null}):Object.isFrozen(Y)?s(Y):Y}var gt="11.11.1";class Ba extends Error{constructor(fe,Ne){super(fe),this.name="HTMLInjectionError",this.html=Ne}}const wn=a,Oo=s,fs=Symbol("nomatch"),Ks=7,ms=function(Y){const fe=Object.create(null),Ne=Object.create(null),Ge=[];let Mt=!0;const Ct="Could not find the language '{}', did you forget to load/include a language module?",Ie={disableAutodetect:!0,name:"Plain text",contains:[]};let we={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:x};function Ye(Ee){return we.noHighlightRe.test(Ee)}function $t(Ee){let je=Ee.className+" ";je+=Ee.parentNode?Ee.parentNode.className:"";const et=we.languageDetectRe.exec(je);if(et){const bt=kn(et[1]);return bt||(Ja(Ct.replace("{}",et[1])),Ja("Falling back to no-highlight mode for this block.",Ee)),bt?et[1]:"no-highlight"}return je.split(/\s+/).find(bt=>Ye(bt)||kn(bt))}function jt(Ee,je,et){let bt="",Kt="";typeof je=="object"?(bt=Ee,et=je.ignoreIllegals,Kt=je.language):(ue("10.7.0","highlight(lang, code, ...args) has been deprecated."),ue("10.7.0",`Please use highlight(code, options) instead.
435
+ `))}function m(T,N,S,C){const A=S.enter("tableCell"),D=S.enter("phrasing"),k=S.containerPhrasing(T,{...C,before:o,after:o});return D(),A(),k}function h(T,N){return bO(T,{align:N,alignDelimiters:s,padding:a,stringLength:l})}function x(T,N,S){const C=T.children;let A=-1;const D=[],k=N.enter("table");for(;++A<C.length;)D[A]=b(C[A],N,S);return k(),D}function b(T,N,S){const C=T.children;let A=-1;const D=[],k=N.enter("tableRow");for(;++A<C.length;)D[A]=m(C[A],T,N,S);return k(),D}function y(T,N,S){let C=eT.inlineCode(T,N,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function r4(){return{exit:{taskListCheckValueChecked:a1,taskListCheckValueUnchecked:a1,paragraph:i4}}}function s4(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:l4}}}function a1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function i4(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const s=a.children[0];if(s&&s.type==="text"){const l=t.children;let o=-1,d;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){d=f;break}}d===a&&(s.value=s.value.slice(1),s.value.length===0?a.children.shift():a.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,a.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function l4(e,t,a,s){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",f=a.createTracker(s);o&&f.move(d);let m=eT.listItem(e,t,a,{...s,...f.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(x){return x+d}}function o4(){return[HR(),lO(),dO(),ZO(),r4()]}function u4(e){return{extensions:[FR(),oO(e),fO(),a4(e),s4()]}}const c4={tokenize:g4,partial:!0},tT={tokenize:b4,partial:!0},nT={tokenize:x4,partial:!0},aT={tokenize:E4,partial:!0},d4={tokenize:y4,partial:!0},rT={name:"wwwAutolink",tokenize:h4,previous:iT},sT={name:"protocolAutolink",tokenize:p4,previous:lT},vr={name:"emailAutolink",tokenize:m4,previous:oT},Za={};function f4(){return{text:Za}}let Ds=48;for(;Ds<123;)Za[Ds]=vr,Ds++,Ds===58?Ds=65:Ds===91&&(Ds=97);Za[43]=vr;Za[45]=vr;Za[46]=vr;Za[95]=vr;Za[72]=[vr,sT];Za[104]=[vr,sT];Za[87]=[vr,rT];Za[119]=[vr,rT];function m4(e,t,a){const s=this;let l,o;return d;function d(b){return!th(b)||!oT.call(s,s.previous)||qh(s.events)?a(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(b))}function f(b){return th(b)?(e.consume(b),f):b===64?(e.consume(b),m):a(b)}function m(b){return b===46?e.check(d4,x,h)(b):b===45||b===95||Sn(b)?(o=!0,e.consume(b),m):x(b)}function h(b){return e.consume(b),l=!0,m}function x(b){return o&&l&&In(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(b)):a(b)}}function h4(e,t,a){const s=this;return l;function l(d){return d!==87&&d!==119||!iT.call(s,s.previous)||qh(s.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(c4,e.attempt(tT,e.attempt(nT,o),a),a)(d))}function o(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(d)}}function p4(e,t,a){const s=this;let l="",o=!1;return d;function d(b){return(b===72||b===104)&&lT.call(s,s.previous)&&!qh(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(b),e.consume(b),f):a(b)}function f(b){if(In(b)&&l.length<5)return l+=String.fromCodePoint(b),e.consume(b),f;if(b===58){const y=l.toLowerCase();if(y==="http"||y==="https")return e.consume(b),m}return a(b)}function m(b){return b===47?(e.consume(b),o?h:(o=!0,m)):a(b)}function h(b){return b===null||Tc(b)||Rt(b)||Fs(b)||qc(b)?a(b):e.attempt(tT,e.attempt(nT,x),a)(b)}function x(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(b)}}function g4(e,t,a){let s=0;return l;function l(d){return(d===87||d===119)&&s<3?(s++,e.consume(d),l):d===46&&s===3?(e.consume(d),o):a(d)}function o(d){return d===null?a(d):t(d)}}function b4(e,t,a){let s,l,o;return d;function d(h){return h===46||h===95?e.check(aT,m,f)(h):h===null||Rt(h)||Fs(h)||h!==45&&qc(h)?m(h):(o=!0,e.consume(h),d)}function f(h){return h===95?s=!0:(l=s,s=void 0),e.consume(h),d}function m(h){return l||s||!o?a(h):t(h)}}function x4(e,t){let a=0,s=0;return l;function l(d){return d===40?(a++,e.consume(d),l):d===41&&s<a?o(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(aT,t,o)(d):d===null||Rt(d)||Fs(d)?t(d):(e.consume(d),l)}function o(d){return d===41&&s++,e.consume(d),l}}function E4(e,t,a){return s;function s(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),s):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||Rt(f)||Fs(f)?t(f):a(f)}function l(f){return f===null||f===40||f===91||Rt(f)||Fs(f)?t(f):s(f)}function o(f){return In(f)?d(f):a(f)}function d(f){return f===59?(e.consume(f),s):In(f)?(e.consume(f),d):a(f)}}function y4(e,t,a){return s;function s(o){return e.consume(o),l}function l(o){return Sn(o)?a(o):t(o)}}function iT(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Rt(e)}function lT(e){return!In(e)}function oT(e){return!(e===47||th(e))}function th(e){return e===43||e===45||e===46||e===95||Sn(e)}function qh(e){let t=e.length,a=!1;for(;t--;){const s=e[t][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){a=!0;break}if(s._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const T4={tokenize:k4,partial:!0};function _4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:A4,continuation:{tokenize:C4},exit:w4}},text:{91:{name:"gfmFootnoteCall",tokenize:v4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:N4,resolveTo:S4}}}}function N4(e,t,a){const s=this;let l=s.events.length;const o=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let d;for(;l--;){const m=s.events[l][1];if(m.type==="labelImage"){d=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return f;function f(m){if(!d||!d._balanced)return a(m);const h=Ia(s.sliceSerialize({start:d.end,end:s.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?a(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function S4(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[a+1],e[a+2],["enter",s,t],e[a+3],e[a+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",d,t],["exit",d,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(a,e.length-a+1,...f),e}function v4(e,t,a){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o=0,d;return f;function f(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),m}function m(b){return b!==94?a(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(b){if(o>999||b===93&&!d||b===null||b===91||Rt(b))return a(b);if(b===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(Ia(s.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(b)}return Rt(b)||(d=!0),o++,e.consume(b),b===92?x:h}function x(b){return b===91||b===92||b===93?(e.consume(b),o++,h):h(b)}}function A4(e,t,a){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let o,d=0,f;return m;function m(N){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(N){return N===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",x):a(N)}function x(N){if(d>999||N===93&&!f||N===null||N===91||Rt(N))return a(N);if(N===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return o=Ia(s.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(N),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Rt(N)||(f=!0),d++,e.consume(N),N===92?b:x}function b(N){return N===91||N===92||N===93?(e.consume(N),d++,x):x(N)}function y(N){return N===58?(e.enter("definitionMarker"),e.consume(N),e.exit("definitionMarker"),l.includes(o)||l.push(o),ct(e,T,"gfmFootnoteDefinitionWhitespace")):a(N)}function T(N){return t(N)}}function C4(e,t,a){return e.check(vo,t,e.attempt(T4,t,a))}function w4(e){e.exit("gfmFootnoteDefinition")}function k4(e,t,a){const s=this;return ct(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const d=s.events[s.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?t(o):a(o)}}function R4(e){let a=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:o,resolveAll:l};return a==null&&(a=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(d,f){let m=-1;for(;++m<d.length;)if(d[m][0]==="enter"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._close){let h=m;for(;h--;)if(d[h][0]==="exit"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._open&&d[m][1].end.offset-d[m][1].start.offset===d[h][1].end.offset-d[h][1].start.offset){d[m][1].type="strikethroughSequence",d[h][1].type="strikethroughSequence";const x={type:"strikethrough",start:Object.assign({},d[h][1].start),end:Object.assign({},d[m][1].end)},b={type:"strikethroughText",start:Object.assign({},d[h][1].end),end:Object.assign({},d[m][1].start)},y=[["enter",x,f],["enter",d[h][1],f],["exit",d[h][1],f],["enter",b,f]],T=f.parser.constructs.insideSpan.null;T&&la(y,y.length,0,Yc(T,d.slice(h+1,m),f)),la(y,y.length,0,[["exit",b,f],["enter",d[m][1],f],["exit",d[m][1],f],["exit",x,f]]),la(d,h-1,m-h+3,y),m=h+y.length-2;break}}for(m=-1;++m<d.length;)d[m][1].type==="strikethroughSequenceTemporary"&&(d[m][1].type="data");return d}function o(d,f,m){const h=this.previous,x=this.events;let b=0;return y;function y(N){return h===126&&x[x.length-1][1].type!=="characterEscape"?m(N):(d.enter("strikethroughSequenceTemporary"),T(N))}function T(N){const S=Pi(h);if(N===126)return b>1?m(N):(d.consume(N),b++,T);if(b<2&&!a)return m(N);const C=d.exit("strikethroughSequenceTemporary"),A=Pi(N);return C._open=!A||A===2&&!!S,C._close=!S||S===2&&!!A,f(N)}}}class O4{constructor(){this.map=[]}add(t,a,s){I4(this,t,a,s)}consume(t){if(this.map.sort(function(o,d){return o[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const s=[];for(;a>0;)a-=1,s.push(t.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),t.length=this.map[a][0];s.push(t.slice()),t.length=0;let l=s.pop();for(;l;){for(const o of l)t.push(o);l=s.pop()}this.map.length=0}}function I4(e,t,a,s){let l=0;if(!(a===0&&s.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=a,e.map[l][2].push(...s);return}l+=1}e.map.push([t,a,s])}}function M4(e,t){let a=!1;const s=[];for(;t<e.length;){const l=e[t];if(a){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=s.length-1;s[o]=s[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return s}function D4(){return{flow:{null:{name:"table",tokenize:L4,resolveAll:j4}}}}function L4(e,t,a){const s=this;let l=0,o=0,d;return f;function f(B){let U=s.events.length-1;for(;U>-1;){const Z=s.events[U][1].type;if(Z==="lineEnding"||Z==="linePrefix")U--;else break}const te=U>-1?s.events[U][1].type:null,ie=te==="tableHead"||te==="tableRow"?M:m;return ie===M&&s.parser.lazy[s.now().line]?a(B):ie(B)}function m(B){return e.enter("tableHead"),e.enter("tableRow"),h(B)}function h(B){return B===124||(d=!0,o+=1),x(B)}function x(B){return B===null?a(B):He(B)?o>1?(o=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),T):a(B):rt(B)?ct(e,x,"whitespace")(B):(o+=1,d&&(d=!1,l+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),d=!0,x):(e.enter("data"),b(B)))}function b(B){return B===null||B===124||Rt(B)?(e.exit("data"),x(B)):(e.consume(B),B===92?y:b)}function y(B){return B===92||B===124?(e.consume(B),b):b(B)}function T(B){return s.interrupt=!1,s.parser.lazy[s.now().line]?a(B):(e.enter("tableDelimiterRow"),d=!1,rt(B)?ct(e,N,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):N(B))}function N(B){return B===45||B===58?C(B):B===124?(d=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),S):V(B)}function S(B){return rt(B)?ct(e,C,"whitespace")(B):C(B)}function C(B){return B===58?(o+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),A):B===45?(o+=1,A(B)):B===null||He(B)?z(B):V(B)}function A(B){return B===45?(e.enter("tableDelimiterFiller"),D(B)):V(B)}function D(B){return B===45?(e.consume(B),D):B===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(B))}function k(B){return rt(B)?ct(e,z,"whitespace")(B):z(B)}function z(B){return B===124?N(B):B===null||He(B)?!d||l!==o?V(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):V(B)}function V(B){return a(B)}function M(B){return e.enter("tableRow"),L(B)}function L(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),L):B===null||He(B)?(e.exit("tableRow"),t(B)):rt(B)?ct(e,L,"whitespace")(B):(e.enter("data"),K(B))}function K(B){return B===null||B===124||Rt(B)?(e.exit("data"),L(B)):(e.consume(B),B===92?se:K)}function se(B){return B===92||B===124?(e.consume(B),K):K(B)}}function j4(e,t){let a=-1,s=!0,l=0,o=[0,0,0,0],d=[0,0,0,0],f=!1,m=0,h,x,b;const y=new O4;for(;++a<e.length;){const T=e[a],N=T[1];T[0]==="enter"?N.type==="tableHead"?(f=!1,m!==0&&(r1(y,t,m,h,x),x=void 0,m=0),h={type:"table",start:Object.assign({},N.start),end:Object.assign({},N.end)},y.add(a,0,[["enter",h,t]])):N.type==="tableRow"||N.type==="tableDelimiterRow"?(s=!0,b=void 0,o=[0,0,0,0],d=[0,a+1,0,0],f&&(f=!1,x={type:"tableBody",start:Object.assign({},N.start),end:Object.assign({},N.end)},y.add(a,0,[["enter",x,t]])),l=N.type==="tableDelimiterRow"?2:x?3:1):l&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")?(s=!1,d[2]===0&&(o[1]!==0&&(d[0]=d[1],b=Wu(y,t,o,l,void 0,b),o=[0,0,0,0]),d[2]=a)):N.type==="tableCellDivider"&&(s?s=!1:(o[1]!==0&&(d[0]=d[1],b=Wu(y,t,o,l,void 0,b)),o=d,d=[o[1],a,0,0])):N.type==="tableHead"?(f=!0,m=a):N.type==="tableRow"||N.type==="tableDelimiterRow"?(m=a,o[1]!==0?(d[0]=d[1],b=Wu(y,t,o,l,a,b)):d[1]!==0&&(b=Wu(y,t,d,l,a,b)),l=0):l&&(N.type==="data"||N.type==="tableDelimiterMarker"||N.type==="tableDelimiterFiller")&&(d[3]=a)}for(m!==0&&r1(y,t,m,h,x),y.consume(t.events),a=-1;++a<t.events.length;){const T=t.events[a];T[0]==="enter"&&T[1].type==="table"&&(T[1]._align=M4(t.events,a))}return e}function Wu(e,t,a,s,l,o){const d=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",f="tableContent";a[0]!==0&&(o.end=Object.assign({},Oi(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));const m=Oi(t.events,a[1]);if(o={type:d,start:Object.assign({},m),end:Object.assign({},m)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){const h=Oi(t.events,a[2]),x=Oi(t.events,a[3]),b={type:f,start:Object.assign({},h),end:Object.assign({},x)};if(e.add(a[2],0,[["enter",b,t]]),s!==2){const y=t.events[a[2]],T=t.events[a[3]];if(y[1].end=Object.assign({},T[1].end),y[1].type="chunkText",y[1].contentType="text",a[3]>a[2]+1){const N=a[2]+1,S=a[3]-a[2]-1;e.add(N,S,[])}}e.add(a[3]+1,0,[["exit",b,t]])}return l!==void 0&&(o.end=Object.assign({},Oi(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function r1(e,t,a,s,l){const o=[],d=Oi(t.events,a);l&&(l.end=Object.assign({},d),o.push(["exit",l,t])),s.end=Object.assign({},d),o.push(["exit",s,t]),e.add(a+1,0,o)}function Oi(e,t){const a=e[t],s=a[0]==="enter"?"start":"end";return a[1][s]}const B4={name:"tasklistCheck",tokenize:U4};function P4(){return{text:{91:B4}}}function U4(e,t,a){const s=this;return l;function l(m){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?a(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return Rt(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),d):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),d):a(m)}function d(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):a(m)}function f(m){return He(m)?t(m):rt(m)?e.check({tokenize:H4},t,a)(m):a(m)}}function H4(e,t,a){return ct(e,s,"whitespace");function s(l){return l===null?a(l):t(l)}}function F4(e){return by([f4(),_4(),R4(e),D4(),P4()])}const z4={};function os(e){const t=this,a=e||z4,s=t.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),o=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),d=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(F4(a)),o.push(o4()),d.push(u4(a))}function Yh(e){const[t,a]=v.useState("fit"),s=t==="wide";return u.jsxs("div",{className:`md-table-wrap ${s?"md-table-wide":"md-table-fit"}`,children:[u.jsxs("button",{type:"button",className:"md-table-toggle",title:s?"适应屏幕":"超宽展开",onClick:()=>a(s?"fit":"wide"),children:[s?u.jsx(NA,{className:"h-3 w-3"}):u.jsx(hA,{className:"h-3 w-3"}),u.jsx("span",{children:s?"适应屏幕":"超宽展开"})]}),u.jsx("div",{className:"md-table-scroll",children:u.jsx("table",{...e})})]})}const Di=zs(e=>({agents:[],loaded:!1,loadAgents:async()=>{const t=qe.getState().activeRepoId;try{const a=t?await k3(t):await $E();e({agents:a,loaded:!0})}catch{e({loaded:!0})}},createAgent:async(t,a)=>{const s=a?await R3(a,t):await GE(t);return e(l=>({agents:[...l.agents,s]})),s},updateAgent:async(t,a)=>{const s=await KE(t,a);e(l=>({agents:l.agents.map(o=>o.id===t?s:o)}))},deleteAgent:async t=>{await VE(t),e(a=>({agents:a.agents.filter(s=>s.id!==t)}))}}));function q4(e){if(typeof e!="string")return e;const t=e.trim();if(t)try{return JSON.parse(t)}catch{return t}}function hn(e){return e&&typeof e=="object"?e:null}function Ys(e){const t=hn(e);return t&&"properties"in t?t.properties:e}function Y4(e){const t=hn(e);return typeof(t==null?void 0:t.type)=="string"?t.type:void 0}function $4(e){const t=hn(Ys(e));if(!t)return null;const a=hn(t.info);if(a&&typeof a.id=="string"){const l=Array.isArray(t.parts)?t.parts:void 0;return{...a,...l?{parts:l}:{}}}if(typeof t.id=="string"&&typeof t.role=="string")return t;const s=hn(t.message);return s&&typeof s.id=="string"?s:null}function G4(e){const t=hn(Ys(e));if(!t)return{};const a=hn(t.part)??t;return typeof a.type!="string"?{}:{messageId:typeof a.messageID=="string"&&a.messageID||typeof a.messageId=="string"&&a.messageId||typeof t.messageID=="string"&&t.messageID||typeof t.messageId=="string"&&t.messageId||void 0,part:a}}function K4(e){const t=hn(Ys(e));if(!t||t.field!=="text")return null;const a=typeof t.messageID=="string"?t.messageID:null,s=typeof t.partID=="string"?t.partID:null,l=typeof t.delta=="string"?t.delta:null;return!a||!s||l===null?null:{messageId:a,partId:s,delta:l}}function V4(e){const t=Ys(e);if(Array.isArray(t))return t;const a=hn(t);return a&&Array.isArray(a.todos)?a.todos:[]}function qa(e){return typeof e=="number"?e:0}function Q4(e){const t=hn(Ys(e));if(!t||typeof t.id!="string")return null;const a={id:t.id};typeof t.title=="string"&&(a.title=t.title),typeof t.agent=="string"&&(a.agent=t.agent),typeof t.cost=="number"&&(a.cost=t.cost);const s=typeof t.parentID=="string"?t.parentID:typeof t.parent_id=="string"?t.parent_id:void 0;s&&(a.parentID=s);const l=hn(t.tokens),o=typeof t.tokens_input=="number"||typeof t.tokens_output=="number";if(l||o){const f=l?hn(l.cache):null;a.tokens={input:qa(l==null?void 0:l.input)||qa(t.tokens_input),output:qa(l==null?void 0:l.output)||qa(t.tokens_output),reasoning:qa(l==null?void 0:l.reasoning)||qa(t.tokens_reasoning),cache:{read:qa(f==null?void 0:f.read)||qa(t.tokens_cache_read),write:qa(f==null?void 0:f.write)||qa(t.tokens_cache_write)}}}const d=hn(t.model);return d&&(a.model={providerID:typeof d.providerID=="string"?d.providerID:void 0,modelID:typeof d.modelID=="string"?d.modelID:void 0,variant:typeof d.variant=="string"?d.variant:void 0}),a}function X4(e){const t=hn(Ys(e));if(!t)return null;if(typeof t.message=="string")return t.message;const a=hn(t.error);if(a){const s=hn(a.data);if(typeof(s==null?void 0:s.message)=="string")return`${a.name??"Error"}: ${s.message}`;if(typeof a.message=="string")return`${a.name??"Error"}: ${a.message}`;if(typeof a.name=="string")return String(a.name)}return typeof t.reason=="string"?t.reason:null}function Z4(e){const t=Ys(e);if(typeof t=="string")return t;const a=hn(t);if(typeof(a==null?void 0:a.status)=="string")return a.status;const s=hn(a==null?void 0:a.status);return typeof(s==null?void 0:s.type)=="string"?s.type:typeof(a==null?void 0:a.type)=="string"?a.type:null}function W4(e,t,a,s){switch(e==="message"||e===""?Y4(t)??e:e){case"message.updated":{const o=$4(t);o&&s.updateMessage(a,o);break}case"session.updated":{const o=Q4(t);o&&s.updateSessionInfo(o);break}case"message.part.updated":{const{messageId:o,part:d}=G4(t);d&&o&&s.updateMessagePart(a,o,d);break}case"message.part.delta":{const o=K4(t);o&&s.appendMessagePartDelta(a,o.messageId,o.partId,o.delta);break}case"todo.updated":{s.updateTodos(a,V4(t));break}case"session.status":{const o=Z4(t);o&&s.setSessionStatus(a,o);break}case"session.idle":{s.setSessionStatus(a,"idle");break}case"session.error":{const o=X4(t);s.setSessionStatus(a,"error",o??void 0);break}}}const J4=600*1e3;class eI{constructor(t,a){rn(this,"sessionId");rn(this,"idleTimer",null);rn(this,"active",!1);rn(this,"alive",!0);rn(this,"callbacks");this.sessionId=t,this.callbacks=a,this.resetIdleTimer()}dispatch(t,a){if(!this.alive)return;this.resetIdleTimer();const s=Le.getState();W4(t,a,this.sessionId,s)}activate(){this.active=!0,this.clearIdleTimer()}deactivate(){this.active=!1,this.resetIdleTimer()}refreshOnIdle(){Le.getState().refreshSessionData(this.sessionId)}stop(){this.alive=!1,this.clearIdleTimer()}resetIdleTimer(){this.clearIdleTimer(),!this.active&&(this.idleTimer=setTimeout(()=>{this.callbacks.onWorkerIdle(this.sessionId)},J4))}clearIdleTimer(){this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}}const tI=1e3,nI=3e4;class aI{constructor(t,a){rn(this,"source",null);rn(this,"reconnectTimer",null);rn(this,"attempts",0);rn(this,"disposed",!1);rn(this,"repoId");rn(this,"onEvent");this.repoId=t,this.onEvent=a}start(){this.connect()}stop(){var t;this.disposed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.source)==null||t.close(),this.source=null}connect(){if(this.disposed)return;const t=Z3(this.repoId),a=new EventSource(t);this.source=a,a.onopen=()=>{this.attempts=0},a.onmessage=l=>{this.handleRaw("message",l)};const s=["message.updated","message.part.updated","message.part.delta","message.removed","todo.updated","session.status","session.idle","session.error","session.updated"];for(const l of s)a.addEventListener(l,o=>{this.handleRaw(l,o)});a.onerror=()=>{if(!(this.disposed||!this.source)&&this.source.readyState===EventSource.CLOSED){this.source.close(),this.source=null;const l=Math.min(tI*2**this.attempts,nI);this.attempts++,this.reconnectTimer=setTimeout(()=>this.connect(),l)}}}handleRaw(t,a){if(!(a instanceof MessageEvent))return;const s=q4(a.data);if(s===void 0)return;const l=this.extractSessionId(s);if(!l)return;let o=t;if(t==="message"||t===""){const d=s&&typeof s=="object"?s:null;typeof(d==null?void 0:d.type)=="string"&&(o=d.type)}this.onEvent(l,o,s)}extractSessionId(t){if(!t||typeof t!="object")return null;const a=t;if(a.properties&&typeof a.properties=="object"){const s=a.properties;if(typeof s.sessionID=="string")return s.sessionID;if(typeof s.id=="string")return s.id}return typeof a.sessionID=="string"?a.sessionID:typeof a.sessionId=="string"?a.sessionId:null}}const rI=6e4;class sI{constructor(t){rn(this,"timer",null);rn(this,"paused",!1);rn(this,"callbacks");this.callbacks=t}start(){this.tick(),this.timer=setInterval(()=>{this.paused||this.tick()},rI)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null)}pause(){this.paused=!0}resume(){this.paused=!1,this.tick()}tick(){const t=qe.getState().activeRepoId;t&&(Le.getState().loadSessions(),W3(t).then(a=>{const s={};for(const[l,o]of Object.entries(a))s[l]=o.type??"idle";Le.getState().bulkSetStatuses(s);for(const[l,o]of Object.entries(s))(o==="busy"||o==="retry")&&this.callbacks.ensureWorker(l)}).catch(()=>{}))}}class iI{constructor(){rn(this,"workers",new Map);rn(this,"dispatcher",null);rn(this,"supervisor",null);rn(this,"visibilityHandler",null)}start(t){this.stop();const a={onWorkerIdle:s=>this.removeWorker(s)};this.dispatcher=new aI(t,(s,l,o)=>{const d=this.ensureWorker(s,a);if(l==="session.idle"||l==="session.status"){const f=Le.getState().sessionStatuses[s];d.dispatch(l,o);const m=Le.getState().sessionStatuses[s];f&&f!=="idle"&&m==="idle"&&d.refreshOnIdle()}else d.dispatch(l,o)}),this.dispatcher.start(),this.supervisor=new sI({ensureWorker:s=>this.ensureWorker(s,a)}),this.supervisor.start(),this.visibilityHandler=()=>{var s,l;document.hidden?(s=this.supervisor)==null||s.pause():(l=this.supervisor)==null||l.resume()},document.addEventListener("visibilitychange",this.visibilityHandler)}stop(){var t,a;(t=this.dispatcher)==null||t.stop(),this.dispatcher=null,(a=this.supervisor)==null||a.stop(),this.supervisor=null;for(const s of this.workers.values())s.stop();this.workers.clear(),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null)}activateSession(t){for(const l of this.workers.values())l.sessionId!==t&&l.deactivate();if(!t)return;const a={onWorkerIdle:l=>this.removeWorker(l)};this.ensureWorker(t,a).activate(),Le.getState().refreshSessionData(t)}deactivateSession(t){var a;(a=this.workers.get(t))==null||a.deactivate()}ensureWorker(t,a){let s=this.workers.get(t);return s||(s=new eI(t,a),this.workers.set(t,s)),s}removeWorker(t){const a=Le.getState().activeSessionId;if(t===a)return;const s=this.workers.get(t);s&&(s.stop(),this.workers.delete(t))}}const Sc=new iI,s1=(function(e,t,a){const s=Ao(a);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(s(e.children[t],t,e))return e.children[t]}),$s=(function(e){if(e==null)return uI;if(typeof e=="string")return oI(e);if(typeof e=="object")return lI(e);if(typeof e=="function")return $h(e);throw new Error("Expected function, string, or array as `test`")});function lI(e){const t=[];let a=-1;for(;++a<e.length;)t[a]=$s(e[a]);return $h(s);function s(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function oI(e){return $h(t);function t(a){return a.tagName===e}}function $h(e){return t;function t(a,s,l){return!!(cI(a)&&e.call(this,a,typeof s=="number"?s:void 0,l||void 0))}}function uI(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function cI(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const i1=/\n/g,l1=/[\t ]+/g,nh=$s("br"),o1=$s(xI),dI=$s("p"),u1=$s("tr"),fI=$s(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",bI,EI]),uT=$s(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function mI(e,t){const a=t||{},s="children"in e?e.children:[],l=uT(e),o=fT(e,{whitespace:a.whitespace||"normal"}),d=[];(e.type==="text"||e.type==="comment")&&d.push(...dT(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<s.length;)d.push(...cT(s[f],e,{whitespace:o,breakBefore:f?void 0:l,breakAfter:f<s.length-1?nh(s[f+1]):l}));const m=[];let h;for(f=-1;++f<d.length;){const x=d[f];typeof x=="number"?h!==void 0&&x>h&&(h=x):x&&(h!==void 0&&h>-1&&m.push(`
436
+ `.repeat(h)||" "),h=-1,m.push(x))}return m.join("")}function cT(e,t,a){return e.type==="element"?hI(e,t,a):e.type==="text"?a.whitespace==="normal"?dT(e,a):pI(e):[]}function hI(e,t,a){const s=fT(e,a),l=e.children||[];let o=-1,d=[];if(fI(e))return d;let f,m;for(nh(e)||u1(e)&&s1(t,e,u1)?m=`
437
+ `:dI(e)?(f=2,m=2):uT(e)&&(f=1,m=1);++o<l.length;)d=d.concat(cT(l[o],e,{whitespace:s,breakBefore:o?void 0:f,breakAfter:o<l.length-1?nh(l[o+1]):m}));return o1(e)&&s1(t,e,o1)&&d.push(" "),f&&d.unshift(f),m&&d.push(m),d}function dT(e,t){const a=String(e.value),s=[],l=[];let o=0;for(;o<=a.length;){i1.lastIndex=o;const m=i1.exec(a),h=m&&"index"in m?m.index:a.length;s.push(gI(a.slice(o,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,h===a.length?t.breakAfter:!0)),o=h+1}let d=-1,f;for(;++d<s.length;)s[d].charCodeAt(s[d].length-1)===8203||d<s.length-1&&s[d+1].charCodeAt(0)===8203?(l.push(s[d]),f=void 0):s[d]?(typeof f=="number"&&l.push(f),l.push(s[d]),f=0):(d===0||d===s.length-1)&&l.push(0);return l}function pI(e){return[String(e.value)]}function gI(e,t,a){const s=[];let l=0,o;for(;l<e.length;){l1.lastIndex=l;const d=l1.exec(e);o=d?d.index:e.length,!l&&!o&&d&&!t&&s.push(""),l!==o&&s.push(e.slice(l,o)),l=d?o+d[0].length:o}return l!==o&&!a&&s.push(""),s.join(" ")}function fT(e,t){if(e.type==="element"){const a=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return a.wrap?"pre-wrap":"pre";case"td":case"th":return a.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function bI(e){return!!(e.properties||{}).hidden}function xI(e){return e.tagName==="td"||e.tagName==="th"}function EI(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function yI(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},x={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},T=t.optional(l)+e.IDENT_RE+"\\s*\\(",N=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],z={type:S,keyword:N,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},V={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},M=[V,b,f,a,e.C_BLOCK_COMMENT_MODE,x,h],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:M.concat([{begin:/\(/,end:/\)/,keywords:z,contains:M.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+d+"[\\*&\\s]+)+"+T,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:z,relevance:0},{begin:T,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,x]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,x,f,{begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,x,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(L,K,V,M,[b,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:z,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function TI(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},a=yI(e),s=a.keywords;return s.type=[...s.type,...t.type],s.literal=[...s.literal,...t.literal],s.built_in=[...s.built_in,...t.built_in],s._hints=t._hints,a.name="Arduino",a.aliases=["ino"],a.supersetOf="cpp",a}function _I(e){const t=e.regex,a={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,l]};l.contains.push(f);const m={match:/\\"/},h={className:"string",begin:/'/,end:/'/},x={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,a]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],T=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),N={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},S=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],A={match:/(\/[a-z._-]+)+/},D=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],z=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],V=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:S,literal:C,built_in:[...D,...k,"set","shopt",...z,...V]},contains:[T,e.SHEBANG(),N,b,o,d,A,f,m,h,x,a]}}function NI(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="("+s+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},x={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},T=t.optional(l)+e.IDENT_RE+"\\s*\\(",C={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},A=[b,f,a,e.C_BLOCK_COMMENT_MODE,x,h],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:A.concat([{begin:/\(/,end:/\)/,keywords:C,contains:A.concat(["self"]),relevance:0}]),relevance:0},k={begin:"("+d+"[\\*&\\s]+)+"+T,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:C,relevance:0},{begin:T,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,x,f,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,x,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C",aliases:["h"],keywords:C,disableAutodetect:!0,illegal:"</",contains:[].concat(D,k,A,[b,{begin:e.IDENT_RE+"::",keywords:C},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:b,strings:h,keywords:C}}}function SI(e){const t=e.regex,a=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+t.optional(l)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},x={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},a,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(l)+e.IDENT_RE,relevance:0},T=t.optional(l)+e.IDENT_RE+"\\s*\\(",N=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],S=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],z={type:S,keyword:N,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},V={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},M=[V,b,f,a,e.C_BLOCK_COMMENT_MODE,x,h],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:M.concat([{begin:/\(/,end:/\)/,keywords:z,contains:M.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+d+"[\\*&\\s]+)+"+T,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:z,relevance:0},{begin:T,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,x]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[a,e.C_BLOCK_COMMENT_MODE,h,x,f,{begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:["self",a,e.C_BLOCK_COMMENT_MODE,h,x,f]}]},f,a,e.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(L,K,V,M,[b,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:z,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function vI(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],l=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:l.concat(o),built_in:t,literal:s},f=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),m={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},x={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},b=e.inherit(x,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:d},T=e.inherit(y,{illegal:/\n/}),N={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,T]},S={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},C=e.inherit(S,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},T]});y.contains=[S,N,x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.C_BLOCK_COMMENT_MODE],T.contains=[C,N,b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const A={variants:[h,S,N,x,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},D={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},k=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",z={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},A,m,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,D,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,D,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+k+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,D],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[A,m,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},z]}}const AI=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),CI=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],wI=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],kI=[...CI,...wI],RI=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),OI=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),II=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),MI=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function DI(e){const t=e.regex,a=AI(e),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",o=/@-?\w[\w]*(-\w+)*/,d="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[a.BLOCK_COMMENT,s,a.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+d,relevance:0},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+OI.join("|")+")"},{begin:":(:)?("+II.join("|")+")"}]},a.CSS_VARIABLE,{className:"attribute",begin:"\\b("+MI.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[a.BLOCK_COMMENT,a.HEXCOLOR,a.IMPORTANT,a.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},a.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:RI.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,a.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+kI.join("|")+")\\b"}]}}function LI(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function jI(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function BI(e){const t=e.regex,a=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(a,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function PI(e){const t=e.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},s=e.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const l={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[s,o,l,d,a,"self"],relevance:0},m=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,x=/'[^']*'/,b=t.either(m,h,x),y=t.concat(b,"(\\s*\\.\\s*",b,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[s,f,o,l,d,a]}}]}}var Ii="[0-9](_*[0-9])*",Ju=`\\.(${Ii})`,ec="[0-9a-fA-F](_*[0-9a-fA-F])*",c1={className:"number",variants:[{begin:`(\\b(${Ii})((${Ju})|\\.)?|(${Ju}))[eE][+-]?(${Ii})[fFdD]?\\b`},{begin:`\\b(${Ii})((${Ju})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ju})[fFdD]?\\b`},{begin:`\\b(${Ii})[fFdD]\\b`},{begin:`\\b0[xX]((${ec})\\.?|(${ec})?\\.(${ec}))[pP][+-]?(${Ii})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ec})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function mT(e,t,a){return a===-1?"":e.replace(t,s=>mT(e,t,a-1))}function UI(e){const t=e.regex,a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",s=a+mT("(?:<"+a+"~~~(?:\\s*,\\s*"+a+"~~~)*>)?",/~~~/g,2),m={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+a,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},x={className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:m,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,a),/\s+/,a,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,a],className:{1:"keyword",3:"title.class"},contains:[x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+s+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:m,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c1,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},c1,h]}}const d1="[A-Za-z$_][0-9A-Za-z$_]*",HI=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],FI=["true","false","null","undefined","NaN","Infinity"],hT=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],pT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],gT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],zI=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qI=[].concat(gT,hT,pT);function YI(e){const t=e.regex,a=(pe,{after:ke})=>{const P="</"+pe[0].slice(1);return pe.input.indexOf(P,ke)!==-1},s=d1,l={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(pe,ke)=>{const P=pe[0].length+pe.index,R=pe.input[P];if(R==="<"||R===","){ke.ignoreMatch();return}R===">"&&(a(pe,{after:P})||ke.ignoreMatch());let W;const O=pe.input.substring(P);if(W=O.match(/^\s*=/)){ke.ignoreMatch();return}if((W=O.match(/^\s+extends\s+/))&&W.index===0){ke.ignoreMatch();return}}},f={$pattern:d1,keyword:HI,literal:FI,built_in:qI,"variable.language":zI},m="[0-9](_?[0-9])*",h=`\\.(${m})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${h})|\\.)?|(${h}))[eE][+-]?(${m})\\b`},{begin:`\\b(${x})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},T={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},N={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},k=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,N,S,C,{match:/\$\d+/},b];y.contains=k.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(k)});const z=[].concat(D,y.contains),V=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(z)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:V},L={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...hT,...pT]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(pe){return t.concat("(?!",pe.join("|"),")")}const ie={match:t.concat(/\b/,te([...gT,"super","import"].map(pe=>`${pe}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Z={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ee={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},Q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:V,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,N,S,C,D,{match:/\$\d+/},b,K,{scope:"attr",match:s+t.lookahead(":"),relevance:0},$,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:Q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:V}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:o},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},ie,U,L,ee,{match:/\$[(.]/}]}}function $I(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],l={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[t,a,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Mi="[0-9](_*[0-9])*",tc=`\\.(${Mi})`,nc="[0-9a-fA-F](_*[0-9a-fA-F])*",GI={className:"number",variants:[{begin:`(\\b(${Mi})((${tc})|\\.)?|(${tc}))[eE][+-]?(${Mi})[fFdD]?\\b`},{begin:`\\b(${Mi})((${tc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${tc})[fFdD]?\\b`},{begin:`\\b(${Mi})[fFdD]\\b`},{begin:`\\b0[xX]((${nc})\\.?|(${nc})?\\.(${nc}))[pP][+-]?(${Mi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${nc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function KI(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},s={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},l={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},d={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,l]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,l]}]};l.contains.push(d);const f={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},m={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(d,{className:"string"}),"self"]}]},h=GI,x=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),b={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},y=b;return y.variants[1].contains=[b],b.variants[1].contains=[y],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,x,a,s,f,m,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[b,e.C_LINE_COMMENT_MODE,x],relevance:0},e.C_LINE_COMMENT_MODE,x,f,m,d,e.C_NUMBER_MODE]},x]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},f,m]},d,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
438
+ `},h]}}const VI=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),QI=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],XI=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ZI=[...QI,...XI],WI=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),bT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),xT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JI=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),e6=bT.concat(xT).sort().reverse();function t6(e){const t=VI(e),a=e6,s="and or not only",l="[\\w-]+",o="("+l+"|@\\{"+l+"\\})",d=[],f=[],m=function(k){return{className:"string",begin:"~?"+k+".*?"+k}},h=function(k,z,V){return{className:k,begin:z,relevance:V}},x={$pattern:/[a-z-]+/,keyword:s,attribute:WI.join(" ")},b={begin:"\\(",end:"\\)",contains:f,keywords:x,relevance:0};f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m("'"),m('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,b,h("variable","@@?"+l,10),h("variable","@\\{"+l+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:l+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const y=f.concat({begin:/\{/,end:/\}/,contains:d}),T={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},N={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JI.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},S={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:x,returnEnd:!0,contains:f,relevance:0}},C={className:"variable",variants:[{begin:"@"+l+"\\s*:",relevance:15},{begin:"@"+l}],starts:{end:"[;}]",returnEnd:!0,contains:y}},A={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,T,h("keyword","all\\b"),h("variable","@\\{"+l+"\\}"),{begin:"\\b("+ZI.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",o,0),h("selector-id","#"+o),h("selector-class","\\."+o,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+bT.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+xT.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:y},{begin:"!important"},t.FUNCTION_DISPATCH]},D={begin:l+`:(:)?(${a.join("|")})`,returnBegin:!0,contains:[A]};return d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,S,C,D,N,A,T,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:d}}function n6(e){const t="\\[=*\\[",a="\\]=*\\]",s={begin:t,end:a,contains:["self"]},l=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,a,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:l.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:l}].concat(l)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:a,contains:[s],relevance:5}])}}function a6(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,a]},l={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,a,s,l,o,d]}}function r6(e){const t=e.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,m={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},x={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=e.inherit(h,{contains:[]}),y=e.inherit(x,{contains:[]});h.contains.push(y),x.contains.push(b);let T=[a,m];return[h,x,b,y].forEach(A=>{A.contains=A.contains.concat(T)}),T=T.concat(h,x),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:T},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:T}]}]},a,o,h,x,{className:"quote",begin:"^>\\s+",contains:T,end:"$"},l,s,m,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function s6(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:a,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},m={$pattern:a,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+m.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:m,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function i6(e){const t=e.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,l={$pattern:/[\w.]+/,keyword:a.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:l},d={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},m={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},x=[e.BACKSLASH_ESCAPE,o,m],b=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(S,C,A="\\1")=>{const D=A==="\\1"?A:t.concat(A,C);return t.concat(t.concat("(?:",S,")"),C,/(?:\\.|[^\\\/])*?/,D,/(?:\\.|[^\\\/])*?/,A,s)},T=(S,C,A)=>t.concat(t.concat("(?:",S,")"),C,/(?:\\.|[^\\\/])*?/,A,s),N=[m,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:x,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",t.either(...b,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:T("(?:m|qr)?",/\//,/\//)},{begin:T("m|qr",t.either(...b,{capture:!0}),/\1/)},{begin:T("m|qr",/\(/,/\)/)},{begin:T("m|qr",/\[/,/\]/)},{begin:T("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=N,d.contains=N,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:N}}function l6(e){const t=e.regex,a=/(?![A-Za-z0-9])(?![$])/,s=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),l=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),o=t.concat(/[A-Z]+/,a),d={scope:"variable",match:"\\$+"+s},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},m={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),x=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(m)}),b={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(m),"on:begin":(Z,ee)=>{ee.data._beginMatch=Z[1]||Z[2]},"on:end":(Z,ee)=>{ee.data._beginMatch!==Z[1]&&ee.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),T=`[
439
+ ]`,N={scope:"string",variants:[x,h,b,y]},S={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},C=["false","null","true"],A=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],D=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],z={keyword:A,literal:(Z=>{const ee=[];return Z.forEach(Q=>{ee.push(Q),Q.toLowerCase()===Q?ee.push(Q.toUpperCase()):ee.push(Q.toLowerCase())}),ee})(C),built_in:D},V=Z=>Z.map(ee=>ee.replace(/\|\d+$/,"")),M={variants:[{match:[/new/,t.concat(T,"+"),t.concat("(?!",V(D).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},L=t.concat(s,"\\b(?!\\()"),K={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{1:"title.class",3:"variable.constant"}},{match:[l,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},se={scope:"attr",match:t.concat(s,t.lookahead(":"),t.lookahead(/(?!::)/))},B={relevance:0,begin:/\(/,end:/\)/,keywords:z,contains:[se,d,K,e.C_BLOCK_COMMENT_MODE,N,S,M]},U={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",V(A).join("\\b|"),"|",V(D).join("\\b|"),"\\b)"),s,t.concat(T,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[B]};B.contains.push(U);const te=[se,K,e.C_BLOCK_COMMENT_MODE,N,S,M],ie={begin:t.concat(/#\[\s*\\?/,t.either(l,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:C,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:C,keyword:["new","array"]},contains:["self",...te]},...te,{scope:"meta",variants:[{match:l},{match:o}]}]};return{case_insensitive:!1,keywords:z,contains:[ie,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},f,{scope:"variable.language",match:/\$this\b/},d,U,K,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},M,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",ie,d,K,e.C_BLOCK_COMMENT_MODE,N,S]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},N,S]}}function o6(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function u6(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function c6(e){const t=e.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},m={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},x={begin:/\{\{/,relevance:0},b={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,m,x,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,m,x,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,x,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,x,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",T=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,N=`\\b|${s.join("|")}`,S={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${T}))[eE][+-]?(${y})[jJ]?(?=${N})`},{begin:`(${T})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${N})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${N})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${N})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${N})`},{begin:`\\b(${y})[jJ](?=${N})`}]},C={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",m,S,b,e.HASH_COMMENT_MODE]}]};return h.contains=[b,S,m],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[m,S,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,C,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[S,A,b]}]}}function d6(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function f6(e){const t=e.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),l=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[l,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[o,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:l},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function m6(e){const t=e.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),l=t.concat(s,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},f={className:"doctag",begin:"@[A-Za-z]+"},m={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],x={className:"subst",begin:/#\{/,end:/\}/,keywords:d},b={className:"string",contains:[e.BACKSLASH_ESCAPE,x],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,x]})]}]},y="[1-9](_?[0-9])*|0",T="[0-9](_?[0-9])*",N={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${T}))?([eE][+-]?(${T})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},S={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},M=[b,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:d},{relevance:0,match:[l,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[S]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[b,{begin:a}],relevance:0},N,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:d},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,x],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(m,h),relevance:0}].concat(m,h);x.contains=M,S.contains=M;const B=[{begin:/^\s*=>/,starts:{end:"$",contains:M}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:M}}];return h.unshift(m),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(B).concat(h).concat(M)}}function h6(e){const t=e.regex,a=/(r#)?/,s=t.concat(a,e.UNDERSCORE_IDENT_RE),l=t.concat(a,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,t.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],m=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],x=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:x,keyword:f,literal:m,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:x}},{className:"punctuation",begin:"->"},o]}}const p6=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),g6=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],b6=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],x6=[...g6,...b6],E6=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),y6=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),T6=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),_6=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function N6(e){const t=p6(e),a=T6,s=y6,l="@[a-z-]+",o="and or not only",f={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+x6.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+s.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+a.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+_6.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,f,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:l,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:E6.join(" ")},contains:[{begin:l,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function S6(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function v6(e){const t=e.regex,a=e.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],m=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],x=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],b=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],T=x,N=[...h,...m].filter(V=>!x.includes(V)),S={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:t.concat(/\b/,t.either(...T),/\s*\(/),relevance:0,keywords:{built_in:T}};function D(V){return t.concat(/\b/,t.either(...V.map(M=>M.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:D(y),relevance:0};function z(V,{exceptions:M,when:L}={}){const K=L;return M=M||[],V.map(se=>se.match(/\|\d+$/)||M.includes(se)?se:K(se)?`${se}|0`:se)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:z(N,{when:V=>V.length<3}),literal:o,type:f,built_in:b},contains:[{scope:"type",match:D(d)},k,A,S,s,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,a,C]}}function ET(e){return e?typeof e=="string"?e:e.source:null}function Xl(e){return At("(?=",e,")")}function At(...e){return e.map(a=>ET(a)).join("")}function A6(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function On(...e){return"("+(A6(e).capture?"":"?:")+e.map(s=>ET(s)).join("|")+")"}const Gh=e=>At(/\b/,e,/\w$/.test(e)?/\b/:/\B/),C6=["Protocol","Type"].map(Gh),f1=["init","self"].map(Gh),w6=["Any","Self"],km=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],m1=["false","nil","true"],k6=["assignment","associativity","higherThan","left","lowerThan","none","right"],R6=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],h1=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],yT=On(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),TT=On(yT,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Rm=At(yT,TT,"*"),_T=On(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),vc=On(_T,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ya=At(_T,vc,"*"),ac=At(/[A-Z]/,vc,"*"),O6=["attached","autoclosure",At(/convention\(/,On("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",At(/objc\(/,Ya,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],I6=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function M6(e){const t={match:/\s+/,relevance:0},a=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,a],l={match:[/\./,On(...C6,...f1)],className:{2:"keyword"}},o={match:At(/\./,On(...km)),relevance:0},d=km.filter(Je=>typeof Je=="string").concat(["_|0"]),f=km.filter(Je=>typeof Je!="string").concat(w6).map(Gh),m={variants:[{className:"keyword",match:On(...f,...f1)}]},h={$pattern:On(/\b\w+/,/#\w+/),keyword:d.concat(R6),literal:m1},x=[l,o,m],b={match:At(/\./,On(...h1)),relevance:0},y={className:"built_in",match:At(/\b/,On(...h1),/(?=\()/)},T=[b,y],N={match:/->/,relevance:0},S={className:"operator",relevance:0,variants:[{match:Rm},{match:`\\.(\\.|${TT})+`}]},C=[N,S],A="([0-9]_*)+",D="([0-9a-fA-F]_*)+",k={className:"number",relevance:0,variants:[{match:`\\b(${A})(\\.(${A}))?([eE][+-]?(${A}))?\\b`},{match:`\\b0x(${D})(\\.(${D}))?([pP][+-]?(${A}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},z=(Je="")=>({className:"subst",variants:[{match:At(/\\/,Je,/[0\\tnr"']/)},{match:At(/\\/,Je,/u\{[0-9a-fA-F]{1,8}\}/)}]}),V=(Je="")=>({className:"subst",match:At(/\\/,Je,/[\t ]*(?:[\r\n]|\r\n)/)}),M=(Je="")=>({className:"subst",label:"interpol",begin:At(/\\/,Je,/\(/),end:/\)/}),L=(Je="")=>({begin:At(Je,/"""/),end:At(/"""/,Je),contains:[z(Je),V(Je),M(Je)]}),K=(Je="")=>({begin:At(Je,/"/),end:At(/"/,Je),contains:[z(Je),M(Je)]}),se={className:"string",variants:[L(),L("#"),L("##"),L("###"),K(),K("#"),K("##"),K("###")]},B=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],U={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:B},te=Je=>{const Dn=At(Je,/\//),Cn=At(/\//,Je);return{begin:Dn,end:Cn,contains:[...B,{scope:"comment",begin:`#(?!.*${Cn})`,end:/$/}]}},ie={scope:"regexp",variants:[te("###"),te("##"),te("#"),U]},Z={match:At(/`/,Ya,/`/)},ee={className:"variable",match:/\$\d+/},Q={className:"variable",match:`\\$${vc}+`},$=[Z,ee,Q],pe={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:I6,contains:[...C,k,se]}]}},ke={scope:"keyword",match:At(/@/,On(...O6),Xl(On(/\(/,/\s+/)))},P={scope:"meta",match:At(/@/,Ya)},R=[pe,ke,P],W={match:Xl(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:At(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,vc,"+")},{className:"type",match:ac,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:At(/\s+&\s+/,Xl(ac)),relevance:0}]},O={begin:/</,end:/>/,keywords:h,contains:[...s,...x,...R,N,W]};W.contains.push(O);const ge={match:At(Ya,/\s*:/),keywords:"_|0",relevance:0},ve={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",ge,...s,ie,...x,...T,...C,k,se,...$,...R,W]},Ae={begin:/</,end:/>/,keywords:"repeat each",contains:[...s,W]},$e={begin:On(Xl(At(Ya,/\s*:/)),Xl(At(Ya,/\s+/,Ya,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ya}]},dt={begin:/\(/,end:/\)/,keywords:h,contains:[$e,...s,...x,...C,k,se,...R,W,ve],endsParent:!0,illegal:/["']/},ut={match:[/(func|macro)/,/\s+/,On(Z.match,Ya,Rm)],className:{1:"keyword",3:"title.function"},contains:[Ae,dt,t],illegal:[/\[/,/%/]},Ft={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ae,dt,t],illegal:/\[|%/},yn={match:[/operator/,/\s+/,Rm],className:{1:"keyword",3:"title"}},da={begin:[/precedencegroup/,/\s+/,ac],className:{1:"keyword",3:"title"},contains:[W],keywords:[...k6,...m1],end:/}/},Aa={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},un={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Qn={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ya,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[Ae,...x,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:ac},...x],relevance:0}]};for(const Je of se.variants){const Dn=Je.contains.find(fa=>fa.label==="interpol");Dn.keywords=h;const Cn=[...x,...T,...C,k,se,...$];Dn.contains=[...Cn,{begin:/\(/,end:/\)/,contains:["self",...Cn]}]}return{name:"Swift",keywords:h,contains:[...s,ut,Ft,Aa,un,Qn,yn,da,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},ie,...x,...T,...C,k,se,...$,...R,W,ve]}}const Ac="[A-Za-z$_][0-9A-Za-z$_]*",NT=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ST=["true","false","null","undefined","NaN","Infinity"],vT=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],AT=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],CT=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],wT=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],kT=[].concat(CT,vT,AT);function D6(e){const t=e.regex,a=(pe,{after:ke})=>{const P="</"+pe[0].slice(1);return pe.input.indexOf(P,ke)!==-1},s=Ac,l={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(pe,ke)=>{const P=pe[0].length+pe.index,R=pe.input[P];if(R==="<"||R===","){ke.ignoreMatch();return}R===">"&&(a(pe,{after:P})||ke.ignoreMatch());let W;const O=pe.input.substring(P);if(W=O.match(/^\s*=/)){ke.ignoreMatch();return}if((W=O.match(/^\s+extends\s+/))&&W.index===0){ke.ignoreMatch();return}}},f={$pattern:Ac,keyword:NT,literal:ST,built_in:kT,"variable.language":wT},m="[0-9](_?[0-9])*",h=`\\.(${m})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${h})|\\.)?|(${h}))[eE][+-]?(${m})\\b`},{begin:`\\b(${x})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},T={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},N={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},S={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},k=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,N,S,C,{match:/\$\d+/},b];y.contains=k.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(k)});const z=[].concat(D,y.contains),V=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(z)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:V},L={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...vT,...AT]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function te(pe){return t.concat("(?!",pe.join("|"),")")}const ie={match:t.concat(/\b/,te([...CT,"super","import"].map(pe=>`${pe}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Z={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ee={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},Q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(Q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:V,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,T,N,S,C,D,{match:/\$\d+/},b,K,{scope:"attr",match:s+t.lookahead(":"),relevance:0},$,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:Q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:V}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:o},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},ie,U,L,ee,{match:/\$[(.]/}]}}function L6(e){const t=e.regex,a=D6(e),s=Ac,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},d={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[a.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},m=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Ac,keyword:NT.concat(m),literal:ST,built_in:kT.concat(l),"variable.language":wT},x={className:"meta",begin:"@"+s},b=(S,C,A)=>{const D=S.contains.findIndex(k=>k.label===C);if(D===-1)throw new Error("can not find mode to replace");S.contains.splice(D,1,A)};Object.assign(a.keywords,h),a.exports.PARAMS_CONTAINS.push(x);const y=a.contains.find(S=>S.scope==="attr"),T=Object.assign({},y,{match:t.concat(s,t.lookahead(/\s*\?:/))});a.exports.PARAMS_CONTAINS.push([a.exports.CLASS_REFERENCE,y,T]),a.contains=a.contains.concat([x,o,d,T]),b(a,"shebang",e.SHEBANG()),b(a,"use_strict",f);const N=a.contains.find(S=>S.label==="func.def");return N.relevance=0,Object.assign(a,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),a}function j6(e){const t=e.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},l=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,m={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,l),/ *#/)},{begin:t.concat(/# */,f,/ *#/)},{begin:t.concat(/# */,d,/ *#/)},{begin:t.concat(/# */,t.either(o,l),/ +/,t.either(d,f),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},x={className:"label",begin:/^\w+:/},b=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[a,s,m,h,x,b,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}function B6(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const a=e.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],l={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},m={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[a,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,d,l,e.QUOTE_STRING_MODE,m,h,f]}}function P6(e){const t=e.regex,a=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=e.inherit(o,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),m=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,m,f,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,d,m,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[m]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(a,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function U6(e){const t="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},f=e.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},T={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},N={begin:/\{/,end:/\}/,contains:[T],illegal:"\\n",relevance:0},S={begin:"\\[",end:"\\]",contains:[T],illegal:"\\n",relevance:0},C=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},N,S,o,d],A=[...C];return A.pop(),A.push(f),T.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const H6={arduino:TI,bash:_I,c:NI,cpp:SI,csharp:vI,css:DI,diff:LI,go:jI,graphql:BI,ini:PI,java:UI,javascript:YI,json:$I,kotlin:KI,less:t6,lua:n6,makefile:a6,markdown:r6,objectivec:s6,perl:i6,php:l6,"php-template":o6,plaintext:u6,python:c6,"python-repl":d6,r:f6,ruby:m6,rust:h6,scss:N6,shell:S6,sql:v6,swift:M6,typescript:L6,vbnet:j6,wasm:B6,xml:P6,yaml:U6};var Om,p1;function F6(){if(p1)return Om;p1=1;function e(Y){return Y instanceof Map?Y.clear=Y.delete=Y.set=function(){throw new Error("map is read-only")}:Y instanceof Set&&(Y.add=Y.clear=Y.delete=function(){throw new Error("set is read-only")}),Object.freeze(Y),Object.getOwnPropertyNames(Y).forEach(fe=>{const Ne=Y[fe],Ge=typeof Ne;(Ge==="object"||Ge==="function")&&!Object.isFrozen(Ne)&&e(Ne)}),Y}class t{constructor(fe){fe.data===void 0&&(fe.data={}),this.data=fe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(Y){return Y.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(Y,...fe){const Ne=Object.create(null);for(const Ge in Y)Ne[Ge]=Y[Ge];return fe.forEach(function(Ge){for(const Mt in Ge)Ne[Mt]=Ge[Mt]}),Ne}const l="</span>",o=Y=>!!Y.scope,d=(Y,{prefix:fe})=>{if(Y.startsWith("language:"))return Y.replace("language:","language-");if(Y.includes(".")){const Ne=Y.split(".");return[`${fe}${Ne.shift()}`,...Ne.map((Ge,Mt)=>`${Ge}${"_".repeat(Mt+1)}`)].join(" ")}return`${fe}${Y}`};class f{constructor(fe,Ne){this.buffer="",this.classPrefix=Ne.classPrefix,fe.walk(this)}addText(fe){this.buffer+=a(fe)}openNode(fe){if(!o(fe))return;const Ne=d(fe.scope,{prefix:this.classPrefix});this.span(Ne)}closeNode(fe){o(fe)&&(this.buffer+=l)}value(){return this.buffer}span(fe){this.buffer+=`<span class="${fe}">`}}const m=(Y={})=>{const fe={children:[]};return Object.assign(fe,Y),fe};class h{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(fe){this.top.children.push(fe)}openNode(fe){const Ne=m({scope:fe});this.add(Ne),this.stack.push(Ne)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(fe){return this.constructor._walk(fe,this.rootNode)}static _walk(fe,Ne){return typeof Ne=="string"?fe.addText(Ne):Ne.children&&(fe.openNode(Ne),Ne.children.forEach(Ge=>this._walk(fe,Ge)),fe.closeNode(Ne)),fe}static _collapse(fe){typeof fe!="string"&&fe.children&&(fe.children.every(Ne=>typeof Ne=="string")?fe.children=[fe.children.join("")]:fe.children.forEach(Ne=>{h._collapse(Ne)}))}}class x extends h{constructor(fe){super(),this.options=fe}addText(fe){fe!==""&&this.add(fe)}startScope(fe){this.openNode(fe)}endScope(){this.closeNode()}__addSublanguage(fe,Ne){const Ge=fe.root;Ne&&(Ge.scope=`language:${Ne}`),this.add(Ge)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(Y){return Y?typeof Y=="string"?Y:Y.source:null}function y(Y){return S("(?=",Y,")")}function T(Y){return S("(?:",Y,")*")}function N(Y){return S("(?:",Y,")?")}function S(...Y){return Y.map(Ne=>b(Ne)).join("")}function C(Y){const fe=Y[Y.length-1];return typeof fe=="object"&&fe.constructor===Object?(Y.splice(Y.length-1,1),fe):{}}function A(...Y){return"("+(C(Y).capture?"":"?:")+Y.map(Ge=>b(Ge)).join("|")+")"}function D(Y){return new RegExp(Y.toString()+"|").exec("").length-1}function k(Y,fe){const Ne=Y&&Y.exec(fe);return Ne&&Ne.index===0}const z=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function V(Y,{joinWith:fe}){let Ne=0;return Y.map(Ge=>{Ne+=1;const Mt=Ne;let Ct=b(Ge),Ie="";for(;Ct.length>0;){const we=z.exec(Ct);if(!we){Ie+=Ct;break}Ie+=Ct.substring(0,we.index),Ct=Ct.substring(we.index+we[0].length),we[0][0]==="\\"&&we[1]?Ie+="\\"+String(Number(we[1])+Mt):(Ie+=we[0],we[0]==="("&&Ne++)}return Ie}).map(Ge=>`(${Ge})`).join(fe)}const M=/\b\B/,L="[a-zA-Z]\\w*",K="[a-zA-Z_]\\w*",se="\\b\\d+(\\.\\d+)?",B="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",U="\\b(0b[01]+)",te="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ie=(Y={})=>{const fe=/^#![ ]*\//;return Y.binary&&(Y.begin=S(fe,/.*\b/,Y.binary,/\b.*/)),s({scope:"meta",begin:fe,end:/$/,relevance:0,"on:begin":(Ne,Ge)=>{Ne.index!==0&&Ge.ignoreMatch()}},Y)},Z={begin:"\\\\[\\s\\S]",relevance:0},ee={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Z]},Q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Z]},$={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},pe=function(Y,fe,Ne={}){const Ge=s({scope:"comment",begin:Y,end:fe,contains:[]},Ne);Ge.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Mt=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Ge.contains.push({begin:S(/[ ]+/,"(",Mt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ge},ke=pe("//","$"),P=pe("/\\*","\\*/"),R=pe("#","$"),W={scope:"number",begin:se,relevance:0},O={scope:"number",begin:B,relevance:0},ge={scope:"number",begin:U,relevance:0},ve={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Z,{begin:/\[/,end:/\]/,relevance:0,contains:[Z]}]},Ae={scope:"title",begin:L,relevance:0},$e={scope:"title",begin:K,relevance:0},dt={begin:"\\.\\s*"+K,relevance:0};var Ft=Object.freeze({__proto__:null,APOS_STRING_MODE:ee,BACKSLASH_ESCAPE:Z,BINARY_NUMBER_MODE:ge,BINARY_NUMBER_RE:U,COMMENT:pe,C_BLOCK_COMMENT_MODE:P,C_LINE_COMMENT_MODE:ke,C_NUMBER_MODE:O,C_NUMBER_RE:B,END_SAME_AS_BEGIN:function(Y){return Object.assign(Y,{"on:begin":(fe,Ne)=>{Ne.data._beginMatch=fe[1]},"on:end":(fe,Ne)=>{Ne.data._beginMatch!==fe[1]&&Ne.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:L,MATCH_NOTHING_RE:M,METHOD_GUARD:dt,NUMBER_MODE:W,NUMBER_RE:se,PHRASAL_WORDS_MODE:$,QUOTE_STRING_MODE:Q,REGEXP_MODE:ve,RE_STARTERS_RE:te,SHEBANG:ie,TITLE_MODE:Ae,UNDERSCORE_IDENT_RE:K,UNDERSCORE_TITLE_MODE:$e});function yn(Y,fe){Y.input[Y.index-1]==="."&&fe.ignoreMatch()}function da(Y,fe){Y.className!==void 0&&(Y.scope=Y.className,delete Y.className)}function Aa(Y,fe){fe&&Y.beginKeywords&&(Y.begin="\\b("+Y.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Y.__beforeBegin=yn,Y.keywords=Y.keywords||Y.beginKeywords,delete Y.beginKeywords,Y.relevance===void 0&&(Y.relevance=0))}function un(Y,fe){Array.isArray(Y.illegal)&&(Y.illegal=A(...Y.illegal))}function Qn(Y,fe){if(Y.match){if(Y.begin||Y.end)throw new Error("begin & end are not supported with match");Y.begin=Y.match,delete Y.match}}function Je(Y,fe){Y.relevance===void 0&&(Y.relevance=1)}const Dn=(Y,fe)=>{if(!Y.beforeMatch)return;if(Y.starts)throw new Error("beforeMatch cannot be used with starts");const Ne=Object.assign({},Y);Object.keys(Y).forEach(Ge=>{delete Y[Ge]}),Y.keywords=Ne.keywords,Y.begin=S(Ne.beforeMatch,y(Ne.begin)),Y.starts={relevance:0,contains:[Object.assign(Ne,{endsParent:!0})]},Y.relevance=0,delete Ne.beforeMatch},Cn=["of","and","for","in","not","or","if","then","parent","list","value"],fa="keyword";function Ca(Y,fe,Ne=fa){const Ge=Object.create(null);return typeof Y=="string"?Mt(Ne,Y.split(" ")):Array.isArray(Y)?Mt(Ne,Y):Object.keys(Y).forEach(function(Ct){Object.assign(Ge,Ca(Y[Ct],fe,Ct))}),Ge;function Mt(Ct,Ie){fe&&(Ie=Ie.map(we=>we.toLowerCase())),Ie.forEach(function(we){const Ye=we.split("|");Ge[Ye[0]]=[Ct,Wa(Ye[0],Ye[1])]})}}function Wa(Y,fe){return fe?Number(fe):ja(Y)?0:1}function ja(Y){return Cn.includes(Y.toLowerCase())}const Ar={},_t=Y=>{console.error(Y)},Ja=(Y,...fe)=>{console.log(`WARN: ${Y}`,...fe)},ue=(Y,fe)=>{Ar[`${Y}/${fe}`]||(console.log(`Deprecated as of ${Y}. ${fe}`),Ar[`${Y}/${fe}`]=!0)},Te=new Error;function Pe(Y,fe,{key:Ne}){let Ge=0;const Mt=Y[Ne],Ct={},Ie={};for(let we=1;we<=fe.length;we++)Ie[we+Ge]=Mt[we],Ct[we+Ge]=!0,Ge+=D(fe[we-1]);Y[Ne]=Ie,Y[Ne]._emit=Ct,Y[Ne]._multi=!0}function H(Y){if(Array.isArray(Y.begin)){if(Y.skip||Y.excludeBegin||Y.returnBegin)throw _t("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Te;if(typeof Y.beginScope!="object"||Y.beginScope===null)throw _t("beginScope must be object"),Te;Pe(Y,Y.begin,{key:"beginScope"}),Y.begin=V(Y.begin,{joinWith:""})}}function Se(Y){if(Array.isArray(Y.end)){if(Y.skip||Y.excludeEnd||Y.returnEnd)throw _t("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Te;if(typeof Y.endScope!="object"||Y.endScope===null)throw _t("endScope must be object"),Te;Pe(Y,Y.end,{key:"endScope"}),Y.end=V(Y.end,{joinWith:""})}}function ft(Y){Y.scope&&typeof Y.scope=="object"&&Y.scope!==null&&(Y.beginScope=Y.scope,delete Y.scope)}function ln(Y){ft(Y),typeof Y.beginScope=="string"&&(Y.beginScope={_wrap:Y.beginScope}),typeof Y.endScope=="string"&&(Y.endScope={_wrap:Y.endScope}),H(Y),Se(Y)}function Zt(Y){function fe(Ie,we){return new RegExp(b(Ie),"m"+(Y.case_insensitive?"i":"")+(Y.unicodeRegex?"u":"")+(we?"g":""))}class Ne{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(we,Ye){Ye.position=this.position++,this.matchIndexes[this.matchAt]=Ye,this.regexes.push([Ye,we]),this.matchAt+=D(we)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const we=this.regexes.map(Ye=>Ye[1]);this.matcherRe=fe(V(we,{joinWith:"|"}),!0),this.lastIndex=0}exec(we){this.matcherRe.lastIndex=this.lastIndex;const Ye=this.matcherRe.exec(we);if(!Ye)return null;const $t=Ye.findIndex((er,Vs)=>Vs>0&&er!==void 0),jt=this.matchIndexes[$t];return Ye.splice(0,$t),Object.assign(Ye,jt)}}class Ge{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(we){if(this.multiRegexes[we])return this.multiRegexes[we];const Ye=new Ne;return this.rules.slice(we).forEach(([$t,jt])=>Ye.addRule($t,jt)),Ye.compile(),this.multiRegexes[we]=Ye,Ye}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(we,Ye){this.rules.push([we,Ye]),Ye.type==="begin"&&this.count++}exec(we){const Ye=this.getMatcher(this.regexIndex);Ye.lastIndex=this.lastIndex;let $t=Ye.exec(we);if(this.resumingScanAtSamePosition()&&!($t&&$t.index===this.lastIndex)){const jt=this.getMatcher(0);jt.lastIndex=this.lastIndex+1,$t=jt.exec(we)}return $t&&(this.regexIndex+=$t.position+1,this.regexIndex===this.count&&this.considerAll()),$t}}function Mt(Ie){const we=new Ge;return Ie.contains.forEach(Ye=>we.addRule(Ye.begin,{rule:Ye,type:"begin"})),Ie.terminatorEnd&&we.addRule(Ie.terminatorEnd,{type:"end"}),Ie.illegal&&we.addRule(Ie.illegal,{type:"illegal"}),we}function Ct(Ie,we){const Ye=Ie;if(Ie.isCompiled)return Ye;[da,Qn,ln,Dn].forEach(jt=>jt(Ie,we)),Y.compilerExtensions.forEach(jt=>jt(Ie,we)),Ie.__beforeBegin=null,[Aa,un,Je].forEach(jt=>jt(Ie,we)),Ie.isCompiled=!0;let $t=null;return typeof Ie.keywords=="object"&&Ie.keywords.$pattern&&(Ie.keywords=Object.assign({},Ie.keywords),$t=Ie.keywords.$pattern,delete Ie.keywords.$pattern),$t=$t||/\w+/,Ie.keywords&&(Ie.keywords=Ca(Ie.keywords,Y.case_insensitive)),Ye.keywordPatternRe=fe($t,!0),we&&(Ie.begin||(Ie.begin=/\B|\b/),Ye.beginRe=fe(Ye.begin),!Ie.end&&!Ie.endsWithParent&&(Ie.end=/\B|\b/),Ie.end&&(Ye.endRe=fe(Ye.end)),Ye.terminatorEnd=b(Ye.end)||"",Ie.endsWithParent&&we.terminatorEnd&&(Ye.terminatorEnd+=(Ie.end?"|":"")+we.terminatorEnd)),Ie.illegal&&(Ye.illegalRe=fe(Ie.illegal)),Ie.contains||(Ie.contains=[]),Ie.contains=[].concat(...Ie.contains.map(function(jt){return cn(jt==="self"?Ie:jt)})),Ie.contains.forEach(function(jt){Ct(jt,Ye)}),Ie.starts&&Ct(Ie.starts,we),Ye.matcher=Mt(Ye),Ye}if(Y.compilerExtensions||(Y.compilerExtensions=[]),Y.contains&&Y.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Y.classNameAliases=s(Y.classNameAliases||{}),Ct(Y)}function Ot(Y){return Y?Y.endsWithParent||Ot(Y.starts):!1}function cn(Y){return Y.variants&&!Y.cachedVariants&&(Y.cachedVariants=Y.variants.map(function(fe){return s(Y,{variants:null},fe)})),Y.cachedVariants?Y.cachedVariants:Ot(Y)?s(Y,{starts:Y.starts?s(Y.starts):null}):Object.isFrozen(Y)?s(Y):Y}var gt="11.11.1";class Ba extends Error{constructor(fe,Ne){super(fe),this.name="HTMLInjectionError",this.html=Ne}}const wn=a,Oo=s,fs=Symbol("nomatch"),Ks=7,ms=function(Y){const fe=Object.create(null),Ne=Object.create(null),Ge=[];let Mt=!0;const Ct="Could not find the language '{}', did you forget to load/include a language module?",Ie={disableAutodetect:!0,name:"Plain text",contains:[]};let we={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:x};function Ye(Ee){return we.noHighlightRe.test(Ee)}function $t(Ee){let je=Ee.className+" ";je+=Ee.parentNode?Ee.parentNode.className:"";const et=we.languageDetectRe.exec(je);if(et){const bt=kn(et[1]);return bt||(Ja(Ct.replace("{}",et[1])),Ja("Falling back to no-highlight mode for this block.",Ee)),bt?et[1]:"no-highlight"}return je.split(/\s+/).find(bt=>Ye(bt)||kn(bt))}function jt(Ee,je,et){let bt="",Kt="";typeof je=="object"?(bt=Ee,et=je.ignoreIllegals,Kt=je.language):(ue("10.7.0","highlight(lang, code, ...args) has been deprecated."),ue("10.7.0",`Please use highlight(code, options) instead.
440
440
  https://github.com/highlightjs/highlight.js/issues/2277`),Kt=Ee,bt=je),et===void 0&&(et=!0);const _n={code:bt,language:Kt};ps("before:highlight",_n);const Xn=_n.result?_n.result:er(_n.language,_n.code,et);return Xn.code=_n.code,ps("after:highlight",Xn),Xn}function er(Ee,je,et,bt){const Kt=Object.create(null);function _n(_e,Me){return _e.keywords[Me]}function Xn(){if(!ze.keywords){Jt.addText(xt);return}let _e=0;ze.keywordPatternRe.lastIndex=0;let Me=ze.keywordPatternRe.exec(xt),Qe="";for(;Me;){Qe+=xt.substring(_e,Me.index);const st=pn.case_insensitive?Me[0].toLowerCase():Me[0],Ht=_n(ze,st);if(Ht){const[ma,tl]=Ht;if(Jt.addText(Qe),Qe="",Kt[st]=(Kt[st]||0)+1,Kt[st]<=Ks&&(Rr+=tl),ma.startsWith("_"))Qe+=Me[0];else{const Po=pn.classNameAliases[ma]||ma;Zn(Me[0],Po)}}else Qe+=Me[0];_e=ze.keywordPatternRe.lastIndex,Me=ze.keywordPatternRe.exec(xt)}Qe+=xt.substring(_e),Jt.addText(Qe)}function jn(){if(xt==="")return;let _e=null;if(typeof ze.subLanguage=="string"){if(!fe[ze.subLanguage]){Jt.addText(xt);return}_e=er(ze.subLanguage,xt,!0,Bo[ze.subLanguage]),Bo[ze.subLanguage]=_e._top}else _e=Qs(xt,ze.subLanguage.length?ze.subLanguage:null);ze.relevance>0&&(Rr+=_e.relevance),Jt.__addSublanguage(_e._emitter,_e.language)}function It(){ze.subLanguage!=null?jn():Xn(),xt=""}function Zn(_e,Me){_e!==""&&(Jt.startScope(Me),Jt.addText(_e),Jt.endScope())}function Lo(_e,Me){let Qe=1;const st=Me.length-1;for(;Qe<=st;){if(!_e._emit[Qe]){Qe++;continue}const Ht=pn.classNameAliases[_e[Qe]]||_e[Qe],ma=Me[Qe];Ht?Zn(ma,Ht):(xt=ma,Xn(),xt=""),Qe++}}function Zs(_e,Me){return _e.scope&&typeof _e.scope=="string"&&Jt.openNode(pn.classNameAliases[_e.scope]||_e.scope),_e.beginScope&&(_e.beginScope._wrap?(Zn(xt,pn.classNameAliases[_e.beginScope._wrap]||_e.beginScope._wrap),xt=""):_e.beginScope._multi&&(Lo(_e.beginScope,Me),xt="")),ze=Object.create(_e,{parent:{value:ze}}),ze}function Wi(_e,Me,Qe){let st=k(_e.endRe,Qe);if(st){if(_e["on:end"]){const Ht=new t(_e);_e["on:end"](Me,Ht),Ht.isMatchIgnored&&(st=!1)}if(st){for(;_e.endsParent&&_e.parent;)_e=_e.parent;return _e}}if(_e.endsWithParent)return Wi(_e.parent,Me,Qe)}function Ws(_e){return ze.matcher.regexIndex===0?(xt+=_e[0],1):(Or=!0,0)}function Wc(_e){const Me=_e[0],Qe=_e.rule,st=new t(Qe),Ht=[Qe.__beforeBegin,Qe["on:begin"]];for(const ma of Ht)if(ma&&(ma(_e,st),st.isMatchIgnored))return Ws(Me);return Qe.skip?xt+=Me:(Qe.excludeBegin&&(xt+=Me),It(),!Qe.returnBegin&&!Qe.excludeBegin&&(xt=Me)),Zs(Qe,_e),Qe.returnBegin?0:Me.length}function Bn(_e){const Me=_e[0],Qe=je.substring(_e.index),st=Wi(ze,_e,Qe);if(!st)return fs;const Ht=ze;ze.endScope&&ze.endScope._wrap?(It(),Zn(Me,ze.endScope._wrap)):ze.endScope&&ze.endScope._multi?(It(),Lo(ze.endScope,_e)):Ht.skip?xt+=Me:(Ht.returnEnd||Ht.excludeEnd||(xt+=Me),It(),Ht.excludeEnd&&(xt=Me));do ze.scope&&Jt.closeNode(),!ze.skip&&!ze.subLanguage&&(Rr+=ze.relevance),ze=ze.parent;while(ze!==st.parent);return st.starts&&Zs(st.starts,_e),Ht.returnEnd?0:Me.length}function Ji(){const _e=[];for(let Me=ze;Me!==pn;Me=Me.parent)Me.scope&&_e.unshift(Me.scope);_e.forEach(Me=>Jt.openNode(Me))}let gs={};function Js(_e,Me){const Qe=Me&&Me[0];if(xt+=_e,Qe==null)return It(),0;if(gs.type==="begin"&&Me.type==="end"&&gs.index===Me.index&&Qe===""){if(xt+=je.slice(Me.index,Me.index+1),!Mt){const st=new Error(`0 width match regex (${Ee})`);throw st.languageName=Ee,st.badRule=gs.rule,st}return 1}if(gs=Me,Me.type==="begin")return Wc(Me);if(Me.type==="illegal"&&!et){const st=new Error('Illegal lexeme "'+Qe+'" for mode "'+(ze.scope||"<unnamed>")+'"');throw st.mode=ze,st}else if(Me.type==="end"){const st=Bn(Me);if(st!==fs)return st}if(Me.type==="illegal"&&Qe==="")return xt+=`
441
- `,1;if(el>1e5&&el>Me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return xt+=Qe,Qe.length}const pn=kn(Ee);if(!pn)throw _t(Ct.replace("{}",Ee)),new Error('Unknown language: "'+Ee+'"');const jo=Zt(pn);let ei="",ze=bt||jo;const Bo={},Jt=new we.__emitter(we);Ji();let xt="",Rr=0,ar=0,el=0,Or=!1;try{if(pn.__emitTokens)pn.__emitTokens(je,Jt);else{for(ze.matcher.considerAll();;){el++,Or?Or=!1:ze.matcher.considerAll(),ze.matcher.lastIndex=ar;const _e=ze.matcher.exec(je);if(!_e)break;const Me=je.substring(ar,_e.index),Qe=Js(Me,_e);ar=_e.index+Qe}Js(je.substring(ar))}return Jt.finalize(),ei=Jt.toHTML(),{language:Ee,value:ei,relevance:Rr,illegal:!1,_emitter:Jt,_top:ze}}catch(_e){if(_e.message&&_e.message.includes("Illegal"))return{language:Ee,value:wn(je),illegal:!0,relevance:0,_illegalBy:{message:_e.message,index:ar,context:je.slice(ar-100,ar+100),mode:_e.mode,resultSoFar:ei},_emitter:Jt};if(Mt)return{language:Ee,value:wn(je),illegal:!1,relevance:0,errorRaised:_e,_emitter:Jt,_top:ze};throw _e}}function Vs(Ee){const je={value:wn(Ee),illegal:!1,relevance:0,_top:Ie,_emitter:new we.__emitter(we)};return je._emitter.addText(Ee),je}function Qs(Ee,je){je=je||we.languages||Object.keys(fe);const et=Vs(Ee),bt=je.filter(kn).filter(wr).map(It=>er(It,Ee,!1));bt.unshift(et);const Kt=bt.sort((It,Zn)=>{if(It.relevance!==Zn.relevance)return Zn.relevance-It.relevance;if(It.language&&Zn.language){if(kn(It.language).supersetOf===Zn.language)return 1;if(kn(Zn.language).supersetOf===It.language)return-1}return 0}),[_n,Xn]=Kt,jn=_n;return jn.secondBest=Xn,jn}function Pa(Ee,je,et){const bt=je&&Ne[je]||et;Ee.classList.add("hljs"),Ee.classList.add(`language-${bt}`)}function Gt(Ee){let je=null;const et=$t(Ee);if(Ye(et))return;if(ps("before:highlightElement",{el:Ee,language:et}),Ee.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Ee);return}if(Ee.children.length>0&&(we.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Ee)),we.throwUnescapedHTML))throw new Ba("One of your code blocks includes unescaped HTML.",Ee.innerHTML);je=Ee;const bt=je.textContent,Kt=et?jt(bt,{language:et,ignoreIllegals:!0}):Qs(bt);Ee.innerHTML=Kt.value,Ee.dataset.highlighted="yes",Pa(Ee,et,Kt.language),Ee.result={language:Kt.language,re:Kt.relevance,relevance:Kt.relevance},Kt.secondBest&&(Ee.secondBest={language:Kt.secondBest.language,relevance:Kt.secondBest.relevance}),ps("after:highlightElement",{el:Ee,result:Kt,text:bt})}function Tn(Ee){we=Oo(we,Ee)}const Cr=()=>{Xs(),ue("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Xi(){Xs(),ue("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Io=!1;function Xs(){function Ee(){Xs()}if(document.readyState==="loading"){Io||window.addEventListener("DOMContentLoaded",Ee,!1),Io=!0;return}document.querySelectorAll(we.cssSelector).forEach(Gt)}function Mo(Ee,je){let et=null;try{et=je(Y)}catch(bt){if(_t("Language definition for '{}' could not be registered.".replace("{}",Ee)),Mt)_t(bt);else throw bt;et=Ie}et.name||(et.name=Ee),fe[Ee]=et,et.rawDefinition=je.bind(null,Y),et.aliases&&tr(et.aliases,{languageName:Ee})}function hs(Ee){delete fe[Ee];for(const je of Object.keys(Ne))Ne[je]===Ee&&delete Ne[je]}function Zi(){return Object.keys(fe)}function kn(Ee){return Ee=(Ee||"").toLowerCase(),fe[Ee]||fe[Ne[Ee]]}function tr(Ee,{languageName:je}){typeof Ee=="string"&&(Ee=[Ee]),Ee.forEach(et=>{Ne[et.toLowerCase()]=je})}function wr(Ee){const je=kn(Ee);return je&&!je.disableAutodetect}function kr(Ee){Ee["before:highlightBlock"]&&!Ee["before:highlightElement"]&&(Ee["before:highlightElement"]=je=>{Ee["before:highlightBlock"](Object.assign({block:je.el},je))}),Ee["after:highlightBlock"]&&!Ee["after:highlightElement"]&&(Ee["after:highlightElement"]=je=>{Ee["after:highlightBlock"](Object.assign({block:je.el},je))})}function Wt(Ee){kr(Ee),Ge.push(Ee)}function Do(Ee){const je=Ge.indexOf(Ee);je!==-1&&Ge.splice(je,1)}function ps(Ee,je){const et=Ee;Ge.forEach(function(bt){bt[et]&&bt[et](je)})}function nr(Ee){return ue("10.7.0","highlightBlock will be removed entirely in v12.0"),ue("10.7.0","Please use highlightElement now."),Gt(Ee)}Object.assign(Y,{highlight:jt,highlightAuto:Qs,highlightAll:Xs,highlightElement:Gt,highlightBlock:nr,configure:Tn,initHighlighting:Cr,initHighlightingOnLoad:Xi,registerLanguage:Mo,unregisterLanguage:hs,listLanguages:Zi,getLanguage:kn,registerAliases:tr,autoDetection:wr,inherit:Oo,addPlugin:Wt,removePlugin:Do}),Y.debugMode=function(){Mt=!1},Y.safeMode=function(){Mt=!0},Y.versionString=gt,Y.regex={concat:S,lookahead:y,either:A,optional:N,anyNumberOfTimes:T};for(const Ee in Ft)typeof Ft[Ee]=="object"&&e(Ft[Ee]);return Object.assign(Y,Ft),Y},Ln=ms({});return Ln.newInstance=()=>ms({}),Om=Ln,Ln.HighlightJS=Ln,Ln.default=Ln,Om}var F6=H6();const z6=Rc(F6),g1={},q6="hljs-";function Y6(e){const t=z6.newInstance();return e&&o(e),{highlight:a,highlightAuto:s,listLanguages:l,register:o,registerAlias:d,registered:f};function a(m,h,x){const b=x||g1,y=typeof b.prefix=="string"?b.prefix:q6;if(!t.getLanguage(m))throw new Error("Unknown language: `"+m+"` is not registered");t.configure({__emitter:$6,classPrefix:y});const T=t.highlight(h,{ignoreIllegals:!0,language:m});if(T.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:T.errorRaised});const N=T._emitter.root,S=N.data;return S.language=T.language,S.relevance=T.relevance,N}function s(m,h){const b=(h||g1).subset||l();let y=-1,T=0,N;for(;++y<b.length;){const S=b[y];if(!t.getLanguage(S))continue;const C=a(S,m,h);C.data&&C.data.relevance!==void 0&&C.data.relevance>T&&(T=C.data.relevance,N=C)}return N||{type:"root",children:[],data:{language:void 0,relevance:T}}}function l(){return t.listLanguages()}function o(m,h){if(typeof m=="string")t.registerLanguage(m,h);else{let x;for(x in m)Object.hasOwn(m,x)&&t.registerLanguage(x,m[x])}}function d(m,h){if(typeof m=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:m});else{let x;for(x in m)if(Object.hasOwn(m,x)){const b=m[x];t.registerAliases(typeof b=="string"?b:[...b],{languageName:x})}}}function f(m){return!!t.getLanguage(m)}}class $6{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const a=this.stack[this.stack.length-1],s=a.children[a.children.length-1];s&&s.type==="text"?s.value+=t:a.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,a){const s=this.stack[this.stack.length-1],l=t.root.children;a?s.children.push({type:"element",tagName:"span",properties:{className:[a]},children:l}):s.children.push(...l)}openNode(t){const a=this,s=t.split(".").map(function(d,f){return f?d+"_".repeat(f):a.options.classPrefix+d}),l=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:s},children:[]};l.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const G6={};function K6(e){const t=e||G6,a=t.aliases,s=t.detect||!1,l=t.languages||U6,o=t.plainText,d=t.prefix,f=t.subset;let m="hljs";const h=Y6(l);if(a&&h.registerAlias(a),d){const x=d.indexOf("-");m=x===-1?d:d.slice(0,x)}return function(x,b){Co(x,"element",function(y,T,N){if(y.tagName!=="code"||!N||N.type!=="element"||N.tagName!=="pre")return;const S=V6(y);if(S===!1||!S&&!s||S&&o&&o.includes(S))return;Array.isArray(y.properties.className)||(y.properties.className=[]),y.properties.className.includes(m)||y.properties.className.unshift(m);const C=fI(y,{whitespace:"pre"});let A;try{A=S?h.highlight(S,C,{prefix:d}):h.highlightAuto(C,{prefix:d,subset:f})}catch(D){const k=D;if(S&&/Unknown language/.test(k.message)){b.message("Cannot highlight as `"+S+"`, it’s not registered",{ancestors:[N,y],cause:k,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw k}!S&&A.data&&A.data.language&&y.properties.className.push("language-"+A.data.language),A.children.length>0&&(y.children=A.children)})}}function V6(e){const t=e.properties.className;let a=-1;if(!Array.isArray(t))return;let s;for(;++a<t.length;){const l=String(t[a]);if(l==="no-highlight"||l==="nohighlight")return!1;!s&&l.slice(0,5)==="lang-"&&(s=l.slice(5)),!s&&l.slice(0,9)==="language-"&&(s=l.slice(9))}return s}function Q6({q:e,pending:t,selected:a,customText:s,onSelect:l,onCustomTextChange:o,onClearSelections:d,onSubmitCustom:f,isSingle:m}){const[h,x]=v.useState(!1),b=h||s.length>0;return u.jsxs("div",{className:"space-y-2",children:[e.header&&u.jsx("div",{className:"text-xs font-semibold text-fg-3",children:e.header}),u.jsx("p",{className:"text-sm text-fg-2",children:e.question}),e.options.length>0&&u.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.options.map(y=>{const T=!b&&((a==null?void 0:a.includes(y.label))??!1);return u.jsxs("button",{type:"button",disabled:!t,onClick:()=>{x(!1),o(""),l(y.label)},className:ce("rounded-md border px-3 py-1.5 text-left text-xs transition-colors",T?"border-emerald-500/60 bg-emerald-500/20 text-emerald-300 ring-1 ring-emerald-500/30":t?"border-blue-500/40 bg-blue-500/10 text-blue-300 hover:bg-blue-500/20":"border-line bg-surface/50 text-fg-5 cursor-default"),children:[T&&u.jsx(oa,{className:"mr-1 inline h-3 w-3"}),u.jsx("span",{className:"font-medium",children:y.label}),y.description&&u.jsx("span",{className:"ml-1.5 text-fg-5",children:y.description})]},y.label)}),t&&u.jsxs("button",{type:"button",onClick:()=>{b?(x(!1),o("")):(x(!0),d())},className:ce("rounded-md border px-3 py-1.5 text-left text-xs transition-colors",b?"border-emerald-500/60 bg-emerald-500/20 text-emerald-300 ring-1 ring-emerald-500/30":"border-dashed border-blue-500/40 text-blue-300 hover:bg-blue-500/10"),children:[b&&u.jsx(oa,{className:"mr-1 inline h-3 w-3"}),u.jsx("span",{className:"font-medium",children:"其他…"})]})]}),b&&t&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("input",{type:"text",value:s,onChange:y=>{o(y.target.value),y.target.value&&d()},onKeyDown:y=>{y.key==="Enter"&&s.trim()&&m&&f&&f()},placeholder:"输入自定义回复…",autoFocus:!0,className:"flex-1 rounded-md border border-blue-500/40 bg-blue-500/5 px-3 py-1.5 text-xs text-fg-1 placeholder:text-fg-5 outline-none focus:border-blue-500/60 focus:ring-1 focus:ring-blue-500/30"}),m&&u.jsx("button",{type:"button",disabled:!s.trim(),onClick:f,className:ce("flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",s.trim()?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:u.jsx(gc,{className:"h-3 w-3"})})]})]})}function X6({part:e}){const t=EC(e),a=wh(e),s=a==="pending"||a==="running",l=Le(K=>K.activeSessionId),o=Le(K=>K.replyQuestion),d=Le(K=>K.rejectQuestion),[f,m]=v.useState(null),[h,x]=v.useState({}),[b,y]=v.useState({});if(!t||t.length===0)return null;const T=t.length===1,N=()=>{l&&Yt.getState().removeToast(`question-${l}`)},S=(K,se)=>{if(!f){if(y(B=>{const{[K]:U,...te}=B;return te}),T){m("answered"),N(),o([[se]]);return}x(B=>{const U=t[K],te=B[K]??[];if(U.multiple){const ie=te.includes(se);return{...B,[K]:ie?te.filter(Z=>Z!==se):[...te,se]}}return{...B,[K]:[se]}})}},C=(K,se)=>{y(B=>{if(se)return{...B,[K]:se};const{[K]:U,...te}=B;return te})},A=K=>{x(se=>{const{[K]:B,...U}=se;return U})},D=K=>{var B;const se=(B=b[K])==null?void 0:B.trim();f||!se||(m("answered"),N(),o([[se]]))},k=t.filter((K,se)=>{var B,U;return(((B=h[se])==null?void 0:B.length)??0)>0||(((U=b[se])==null?void 0:U.trim().length)??0)>0}).length,z=!T&&k===t.length,V=()=>{if(f||!z)return;m("answered"),N();const K=t.map((se,B)=>{var te;const U=(te=b[B])==null?void 0:te.trim();return U?[U]:h[B]??[]});o(K)},M=()=>{f||(m("dismissed"),N(),d())},L=s&&!f;return u.jsxs("div",{className:ce("my-1 overflow-hidden rounded-md border bg-term/70",L?"border-blue-500/40":"border-line"),children:[u.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 font-mono text-xs",children:[u.jsx(bA,{className:ce("h-3.5 w-3.5 shrink-0",L?"text-blue-400":"text-fg-4")}),u.jsx("span",{className:ce("font-medium",L?"text-blue-300":"text-fg-3"),children:f==="answered"?"已回复":f==="dismissed"?"已取消":L?"等待回复":"Question"}),!T&&L&&u.jsxs("span",{className:"text-fg-5",children:["(",k,"/",t.length,")"]}),L&&u.jsxs("button",{type:"button",onClick:M,className:"ml-auto flex items-center gap-1 rounded px-1.5 py-0.5 text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-400",children:[u.jsx(Tt,{className:"h-3 w-3"}),u.jsx("span",{children:"取消"})]})]}),u.jsxs("div",{className:"border-t border-line px-4 py-3 space-y-3",children:[t.map((K,se)=>u.jsx(Q6,{q:K,pending:L,selected:h[se],customText:b[se]??"",onSelect:B=>S(se,B),onCustomTextChange:B=>C(se,B),onClearSelections:()=>A(se),onSubmitCustom:T?()=>D(se):void 0,isSingle:T},se)),!T&&L&&u.jsx("div",{className:"flex justify-end pt-1",children:u.jsxs("button",{type:"button",disabled:!z,onClick:V,className:ce("flex items-center gap-1.5 rounded-md px-4 py-1.5 text-xs font-medium transition-colors",z?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:[u.jsx(gc,{className:"h-3 w-3"}),u.jsx("span",{children:"提交回答"})]})})]})]})}const Im=2e3,Z6={read:"Read",write:"Write",edit:"Edit",patch:"Patch",grep:"Grep",glob:"Glob",bash:"Bash",shell:"Bash",list:"List",ls:"List",webfetch:"Fetch",fetch:"Fetch",task:"Task",agent:"Task",todowrite:"Todo",write_todos:"Todo",question:"Question",mcp_question:"Question"},W6={running:{glyph:"◌",label:"running",color:"text-amber-400",accent:"border-amber-500/40",spin:!0},completed:{glyph:"✓",label:"done",color:"text-emerald-400",accent:"border-emerald-500/40",spin:!1},error:{glyph:"✗",label:"error",color:"text-red-400",accent:"border-red-500/40",spin:!1},pending:{glyph:"○",label:"queued",color:"text-fg-4",accent:"border-fg-6",spin:!1}};function Kh(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Ga(e,t){if(!e)return null;for(const a of t){const s=e[a];if(typeof s=="string"&&s.trim())return s.trim()}return null}function J6(e,t){const a=e.toLowerCase(),s=Z6[a]??e.charAt(0).toUpperCase()+e.slice(1),l=Kh(t);switch(a){case"read":case"write":case"edit":case"patch":return{label:s,arg:Ga(l,["filePath","path","file"])};case"grep":{const o=Ga(l,["pattern","query"]);return{label:s,arg:o?`"${o}"`:null}}case"glob":return{label:s,arg:Ga(l,["pattern","query"])};case"bash":case"shell":{const o=Ga(l,["command","cmd","script"]);return{label:s,arg:o?o.split(`
442
- `)[0]:null}}case"webfetch":case"fetch":return{label:s,arg:Ga(l,["url"])};case"task":case"agent":return{label:s,arg:Ga(l,["description","prompt","title"])};default:return{label:s,arg:Ga(l,["filePath","path","pattern","query","command","url","description"])}}}function eM({oldStr:e,newStr:t}){const a=e.split(`
441
+ `,1;if(el>1e5&&el>Me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return xt+=Qe,Qe.length}const pn=kn(Ee);if(!pn)throw _t(Ct.replace("{}",Ee)),new Error('Unknown language: "'+Ee+'"');const jo=Zt(pn);let ei="",ze=bt||jo;const Bo={},Jt=new we.__emitter(we);Ji();let xt="",Rr=0,ar=0,el=0,Or=!1;try{if(pn.__emitTokens)pn.__emitTokens(je,Jt);else{for(ze.matcher.considerAll();;){el++,Or?Or=!1:ze.matcher.considerAll(),ze.matcher.lastIndex=ar;const _e=ze.matcher.exec(je);if(!_e)break;const Me=je.substring(ar,_e.index),Qe=Js(Me,_e);ar=_e.index+Qe}Js(je.substring(ar))}return Jt.finalize(),ei=Jt.toHTML(),{language:Ee,value:ei,relevance:Rr,illegal:!1,_emitter:Jt,_top:ze}}catch(_e){if(_e.message&&_e.message.includes("Illegal"))return{language:Ee,value:wn(je),illegal:!0,relevance:0,_illegalBy:{message:_e.message,index:ar,context:je.slice(ar-100,ar+100),mode:_e.mode,resultSoFar:ei},_emitter:Jt};if(Mt)return{language:Ee,value:wn(je),illegal:!1,relevance:0,errorRaised:_e,_emitter:Jt,_top:ze};throw _e}}function Vs(Ee){const je={value:wn(Ee),illegal:!1,relevance:0,_top:Ie,_emitter:new we.__emitter(we)};return je._emitter.addText(Ee),je}function Qs(Ee,je){je=je||we.languages||Object.keys(fe);const et=Vs(Ee),bt=je.filter(kn).filter(wr).map(It=>er(It,Ee,!1));bt.unshift(et);const Kt=bt.sort((It,Zn)=>{if(It.relevance!==Zn.relevance)return Zn.relevance-It.relevance;if(It.language&&Zn.language){if(kn(It.language).supersetOf===Zn.language)return 1;if(kn(Zn.language).supersetOf===It.language)return-1}return 0}),[_n,Xn]=Kt,jn=_n;return jn.secondBest=Xn,jn}function Pa(Ee,je,et){const bt=je&&Ne[je]||et;Ee.classList.add("hljs"),Ee.classList.add(`language-${bt}`)}function Gt(Ee){let je=null;const et=$t(Ee);if(Ye(et))return;if(ps("before:highlightElement",{el:Ee,language:et}),Ee.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Ee);return}if(Ee.children.length>0&&(we.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Ee)),we.throwUnescapedHTML))throw new Ba("One of your code blocks includes unescaped HTML.",Ee.innerHTML);je=Ee;const bt=je.textContent,Kt=et?jt(bt,{language:et,ignoreIllegals:!0}):Qs(bt);Ee.innerHTML=Kt.value,Ee.dataset.highlighted="yes",Pa(Ee,et,Kt.language),Ee.result={language:Kt.language,re:Kt.relevance,relevance:Kt.relevance},Kt.secondBest&&(Ee.secondBest={language:Kt.secondBest.language,relevance:Kt.secondBest.relevance}),ps("after:highlightElement",{el:Ee,result:Kt,text:bt})}function Tn(Ee){we=Oo(we,Ee)}const Cr=()=>{Xs(),ue("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Xi(){Xs(),ue("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Io=!1;function Xs(){function Ee(){Xs()}if(document.readyState==="loading"){Io||window.addEventListener("DOMContentLoaded",Ee,!1),Io=!0;return}document.querySelectorAll(we.cssSelector).forEach(Gt)}function Mo(Ee,je){let et=null;try{et=je(Y)}catch(bt){if(_t("Language definition for '{}' could not be registered.".replace("{}",Ee)),Mt)_t(bt);else throw bt;et=Ie}et.name||(et.name=Ee),fe[Ee]=et,et.rawDefinition=je.bind(null,Y),et.aliases&&tr(et.aliases,{languageName:Ee})}function hs(Ee){delete fe[Ee];for(const je of Object.keys(Ne))Ne[je]===Ee&&delete Ne[je]}function Zi(){return Object.keys(fe)}function kn(Ee){return Ee=(Ee||"").toLowerCase(),fe[Ee]||fe[Ne[Ee]]}function tr(Ee,{languageName:je}){typeof Ee=="string"&&(Ee=[Ee]),Ee.forEach(et=>{Ne[et.toLowerCase()]=je})}function wr(Ee){const je=kn(Ee);return je&&!je.disableAutodetect}function kr(Ee){Ee["before:highlightBlock"]&&!Ee["before:highlightElement"]&&(Ee["before:highlightElement"]=je=>{Ee["before:highlightBlock"](Object.assign({block:je.el},je))}),Ee["after:highlightBlock"]&&!Ee["after:highlightElement"]&&(Ee["after:highlightElement"]=je=>{Ee["after:highlightBlock"](Object.assign({block:je.el},je))})}function Wt(Ee){kr(Ee),Ge.push(Ee)}function Do(Ee){const je=Ge.indexOf(Ee);je!==-1&&Ge.splice(je,1)}function ps(Ee,je){const et=Ee;Ge.forEach(function(bt){bt[et]&&bt[et](je)})}function nr(Ee){return ue("10.7.0","highlightBlock will be removed entirely in v12.0"),ue("10.7.0","Please use highlightElement now."),Gt(Ee)}Object.assign(Y,{highlight:jt,highlightAuto:Qs,highlightAll:Xs,highlightElement:Gt,highlightBlock:nr,configure:Tn,initHighlighting:Cr,initHighlightingOnLoad:Xi,registerLanguage:Mo,unregisterLanguage:hs,listLanguages:Zi,getLanguage:kn,registerAliases:tr,autoDetection:wr,inherit:Oo,addPlugin:Wt,removePlugin:Do}),Y.debugMode=function(){Mt=!1},Y.safeMode=function(){Mt=!0},Y.versionString=gt,Y.regex={concat:S,lookahead:y,either:A,optional:N,anyNumberOfTimes:T};for(const Ee in Ft)typeof Ft[Ee]=="object"&&e(Ft[Ee]);return Object.assign(Y,Ft),Y},Ln=ms({});return Ln.newInstance=()=>ms({}),Om=Ln,Ln.HighlightJS=Ln,Ln.default=Ln,Om}var z6=F6();const q6=Rc(z6),g1={},Y6="hljs-";function $6(e){const t=q6.newInstance();return e&&o(e),{highlight:a,highlightAuto:s,listLanguages:l,register:o,registerAlias:d,registered:f};function a(m,h,x){const b=x||g1,y=typeof b.prefix=="string"?b.prefix:Y6;if(!t.getLanguage(m))throw new Error("Unknown language: `"+m+"` is not registered");t.configure({__emitter:G6,classPrefix:y});const T=t.highlight(h,{ignoreIllegals:!0,language:m});if(T.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:T.errorRaised});const N=T._emitter.root,S=N.data;return S.language=T.language,S.relevance=T.relevance,N}function s(m,h){const b=(h||g1).subset||l();let y=-1,T=0,N;for(;++y<b.length;){const S=b[y];if(!t.getLanguage(S))continue;const C=a(S,m,h);C.data&&C.data.relevance!==void 0&&C.data.relevance>T&&(T=C.data.relevance,N=C)}return N||{type:"root",children:[],data:{language:void 0,relevance:T}}}function l(){return t.listLanguages()}function o(m,h){if(typeof m=="string")t.registerLanguage(m,h);else{let x;for(x in m)Object.hasOwn(m,x)&&t.registerLanguage(x,m[x])}}function d(m,h){if(typeof m=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:m});else{let x;for(x in m)if(Object.hasOwn(m,x)){const b=m[x];t.registerAliases(typeof b=="string"?b:[...b],{languageName:x})}}}function f(m){return!!t.getLanguage(m)}}class G6{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const a=this.stack[this.stack.length-1],s=a.children[a.children.length-1];s&&s.type==="text"?s.value+=t:a.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,a){const s=this.stack[this.stack.length-1],l=t.root.children;a?s.children.push({type:"element",tagName:"span",properties:{className:[a]},children:l}):s.children.push(...l)}openNode(t){const a=this,s=t.split(".").map(function(d,f){return f?d+"_".repeat(f):a.options.classPrefix+d}),l=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:s},children:[]};l.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const K6={};function V6(e){const t=e||K6,a=t.aliases,s=t.detect||!1,l=t.languages||H6,o=t.plainText,d=t.prefix,f=t.subset;let m="hljs";const h=$6(l);if(a&&h.registerAlias(a),d){const x=d.indexOf("-");m=x===-1?d:d.slice(0,x)}return function(x,b){Co(x,"element",function(y,T,N){if(y.tagName!=="code"||!N||N.type!=="element"||N.tagName!=="pre")return;const S=Q6(y);if(S===!1||!S&&!s||S&&o&&o.includes(S))return;Array.isArray(y.properties.className)||(y.properties.className=[]),y.properties.className.includes(m)||y.properties.className.unshift(m);const C=mI(y,{whitespace:"pre"});let A;try{A=S?h.highlight(S,C,{prefix:d}):h.highlightAuto(C,{prefix:d,subset:f})}catch(D){const k=D;if(S&&/Unknown language/.test(k.message)){b.message("Cannot highlight as `"+S+"`, it’s not registered",{ancestors:[N,y],cause:k,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw k}!S&&A.data&&A.data.language&&y.properties.className.push("language-"+A.data.language),A.children.length>0&&(y.children=A.children)})}}function Q6(e){const t=e.properties.className;let a=-1;if(!Array.isArray(t))return;let s;for(;++a<t.length;){const l=String(t[a]);if(l==="no-highlight"||l==="nohighlight")return!1;!s&&l.slice(0,5)==="lang-"&&(s=l.slice(5)),!s&&l.slice(0,9)==="language-"&&(s=l.slice(9))}return s}function X6({q:e,pending:t,selected:a,customText:s,onSelect:l,onCustomTextChange:o,onClearSelections:d,onSubmitCustom:f,isSingle:m}){const[h,x]=v.useState(!1),b=h||s.length>0;return u.jsxs("div",{className:"space-y-2",children:[e.header&&u.jsx("div",{className:"text-xs font-semibold text-fg-3",children:e.header}),u.jsx("p",{className:"text-sm text-fg-2",children:e.question}),e.options.length>0&&u.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.options.map(y=>{const T=!b&&((a==null?void 0:a.includes(y.label))??!1);return u.jsxs("button",{type:"button",disabled:!t,onClick:()=>{x(!1),o(""),l(y.label)},className:ce("rounded-md border px-3 py-1.5 text-left text-xs transition-colors",T?"border-emerald-500/60 bg-emerald-500/20 text-emerald-300 ring-1 ring-emerald-500/30":t?"border-blue-500/40 bg-blue-500/10 text-blue-300 hover:bg-blue-500/20":"border-line bg-surface/50 text-fg-5 cursor-default"),children:[T&&u.jsx(oa,{className:"mr-1 inline h-3 w-3"}),u.jsx("span",{className:"font-medium",children:y.label}),y.description&&u.jsx("span",{className:"ml-1.5 text-fg-5",children:y.description})]},y.label)}),t&&u.jsxs("button",{type:"button",onClick:()=>{b?(x(!1),o("")):(x(!0),d())},className:ce("rounded-md border px-3 py-1.5 text-left text-xs transition-colors",b?"border-emerald-500/60 bg-emerald-500/20 text-emerald-300 ring-1 ring-emerald-500/30":"border-dashed border-blue-500/40 text-blue-300 hover:bg-blue-500/10"),children:[b&&u.jsx(oa,{className:"mr-1 inline h-3 w-3"}),u.jsx("span",{className:"font-medium",children:"其他…"})]})]}),b&&t&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("input",{type:"text",value:s,onChange:y=>{o(y.target.value),y.target.value&&d()},onKeyDown:y=>{y.key==="Enter"&&s.trim()&&m&&f&&f()},placeholder:"输入自定义回复…",autoFocus:!0,className:"flex-1 rounded-md border border-blue-500/40 bg-blue-500/5 px-3 py-1.5 text-xs text-fg-1 placeholder:text-fg-5 outline-none focus:border-blue-500/60 focus:ring-1 focus:ring-blue-500/30"}),m&&u.jsx("button",{type:"button",disabled:!s.trim(),onClick:f,className:ce("flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",s.trim()?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:u.jsx(gc,{className:"h-3 w-3"})})]})]})}function Z6({part:e}){const t=yC(e),a=wh(e),s=a==="pending"||a==="running",l=Le(K=>K.activeSessionId),o=Le(K=>K.replyQuestion),d=Le(K=>K.rejectQuestion),[f,m]=v.useState(null),[h,x]=v.useState({}),[b,y]=v.useState({});if(!t||t.length===0)return null;const T=t.length===1,N=()=>{l&&Yt.getState().removeToast(`question-${l}`)},S=(K,se)=>{if(!f){if(y(B=>{const{[K]:U,...te}=B;return te}),T){m("answered"),N(),o([[se]]);return}x(B=>{const U=t[K],te=B[K]??[];if(U.multiple){const ie=te.includes(se);return{...B,[K]:ie?te.filter(Z=>Z!==se):[...te,se]}}return{...B,[K]:[se]}})}},C=(K,se)=>{y(B=>{if(se)return{...B,[K]:se};const{[K]:U,...te}=B;return te})},A=K=>{x(se=>{const{[K]:B,...U}=se;return U})},D=K=>{var B;const se=(B=b[K])==null?void 0:B.trim();f||!se||(m("answered"),N(),o([[se]]))},k=t.filter((K,se)=>{var B,U;return(((B=h[se])==null?void 0:B.length)??0)>0||(((U=b[se])==null?void 0:U.trim().length)??0)>0}).length,z=!T&&k===t.length,V=()=>{if(f||!z)return;m("answered"),N();const K=t.map((se,B)=>{var te;const U=(te=b[B])==null?void 0:te.trim();return U?[U]:h[B]??[]});o(K)},M=()=>{f||(m("dismissed"),N(),d())},L=s&&!f;return u.jsxs("div",{className:ce("my-1 overflow-hidden rounded-md border bg-term/70",L?"border-blue-500/40":"border-line"),children:[u.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 font-mono text-xs",children:[u.jsx(bA,{className:ce("h-3.5 w-3.5 shrink-0",L?"text-blue-400":"text-fg-4")}),u.jsx("span",{className:ce("font-medium",L?"text-blue-300":"text-fg-3"),children:f==="answered"?"已回复":f==="dismissed"?"已取消":L?"等待回复":"Question"}),!T&&L&&u.jsxs("span",{className:"text-fg-5",children:["(",k,"/",t.length,")"]}),L&&u.jsxs("button",{type:"button",onClick:M,className:"ml-auto flex items-center gap-1 rounded px-1.5 py-0.5 text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-400",children:[u.jsx(Tt,{className:"h-3 w-3"}),u.jsx("span",{children:"取消"})]})]}),u.jsxs("div",{className:"border-t border-line px-4 py-3 space-y-3",children:[t.map((K,se)=>u.jsx(X6,{q:K,pending:L,selected:h[se],customText:b[se]??"",onSelect:B=>S(se,B),onCustomTextChange:B=>C(se,B),onClearSelections:()=>A(se),onSubmitCustom:T?()=>D(se):void 0,isSingle:T},se)),!T&&L&&u.jsx("div",{className:"flex justify-end pt-1",children:u.jsxs("button",{type:"button",disabled:!z,onClick:V,className:ce("flex items-center gap-1.5 rounded-md px-4 py-1.5 text-xs font-medium transition-colors",z?"bg-emerald-600 text-white hover:bg-emerald-500":"bg-surface/50 text-fg-5 cursor-not-allowed"),children:[u.jsx(gc,{className:"h-3 w-3"}),u.jsx("span",{children:"提交回答"})]})})]})]})}const Im=2e3,W6={read:"Read",write:"Write",edit:"Edit",patch:"Patch",grep:"Grep",glob:"Glob",bash:"Bash",shell:"Bash",list:"List",ls:"List",webfetch:"Fetch",fetch:"Fetch",task:"Task",agent:"Task",todowrite:"Todo",write_todos:"Todo",question:"Question",mcp_question:"Question"},J6={running:{glyph:"◌",label:"running",color:"text-amber-400",accent:"border-amber-500/40",spin:!0},completed:{glyph:"✓",label:"done",color:"text-emerald-400",accent:"border-emerald-500/40",spin:!1},error:{glyph:"✗",label:"error",color:"text-red-400",accent:"border-red-500/40",spin:!1},pending:{glyph:"○",label:"queued",color:"text-fg-4",accent:"border-fg-6",spin:!1}};function Kh(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function Ga(e,t){if(!e)return null;for(const a of t){const s=e[a];if(typeof s=="string"&&s.trim())return s.trim()}return null}function eM(e,t){const a=e.toLowerCase(),s=W6[a]??e.charAt(0).toUpperCase()+e.slice(1),l=Kh(t);switch(a){case"read":case"write":case"edit":case"patch":return{label:s,arg:Ga(l,["filePath","path","file"])};case"grep":{const o=Ga(l,["pattern","query"]);return{label:s,arg:o?`"${o}"`:null}}case"glob":return{label:s,arg:Ga(l,["pattern","query"])};case"bash":case"shell":{const o=Ga(l,["command","cmd","script"]);return{label:s,arg:o?o.split(`
442
+ `)[0]:null}}case"webfetch":case"fetch":return{label:s,arg:Ga(l,["url"])};case"task":case"agent":return{label:s,arg:Ga(l,["description","prompt","title"])};default:return{label:s,arg:Ga(l,["filePath","path","pattern","query","command","url","description"])}}}function tM({oldStr:e,newStr:t}){const a=e.split(`
443
443
  `),s=t.split(`
444
- `);return u.jsxs("div",{className:"grid grid-cols-1 gap-px overflow-x-auto rounded text-xs md:grid-cols-2",children:[u.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-del",children:a.map((l,o)=>u.jsxs("div",{children:[u.jsx("span",{className:"select-none text-red-400/70",children:"− "}),u.jsx("span",{className:"text-red-400",children:l})]},o))}),u.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-add",children:s.map((l,o)=>u.jsxs("div",{children:[u.jsx("span",{className:"select-none text-emerald-400/70",children:"+ "}),u.jsx("span",{className:"text-emerald-400",children:l})]},o))})]})}const b1={completed:{glyph:"✓",color:"text-emerald-400"},in_progress:{glyph:"◌",color:"text-amber-400"},cancelled:{glyph:"✗",color:"text-fg-5"},pending:{glyph:"○",color:"text-fg-4"}};function RT({todos:e}){return u.jsx("ul",{className:"space-y-0.5 text-xs",children:e.map((t,a)=>{var f;const s=((f=t.status)==null?void 0:f.toLowerCase())??"pending",l=s==="in-progress"||s==="active"?"in_progress":s==="done"||s==="complete"?"completed":s==="canceled"?"cancelled":s,o=b1[l]??b1.pending,d=l==="completed"||l==="cancelled";return u.jsxs("li",{className:"flex items-start gap-1.5",children:[u.jsx("span",{className:ce("shrink-0 leading-5",o.color,l==="in_progress"&&"fs-spin"),children:o.glyph}),u.jsx("span",{className:ce("leading-5",d?"text-fg-5 line-through":"text-fg-2"),children:t.content}),t.priority&&u.jsx("span",{className:"ml-auto shrink-0 text-fg-5",children:t.priority})]},a)})})}const tM={"visual-engineering":"bg-purple-500/15 text-purple-400",quick:"bg-emerald-500/15 text-emerald-400",deep:"bg-blue-500/15 text-blue-400",ultrabrain:"bg-amber-500/15 text-amber-400",artistry:"bg-pink-500/15 text-pink-400",writing:"bg-cyan-500/15 text-cyan-400","unspecified-low":"bg-elevated text-fg-4","unspecified-high":"bg-elevated text-fg-3"},nM={explore:"bg-teal-500/15 text-teal-400",librarian:"bg-indigo-500/15 text-indigo-400",oracle:"bg-amber-500/15 text-amber-400",metis:"bg-rose-500/15 text-rose-400",momus:"bg-orange-500/15 text-orange-400"};function aM({record:e}){const[t,a]=v.useState(!1),s=typeof e.category=="string"?e.category:null,l=typeof e.subagent_type=="string"?e.subagent_type:null,o=Ga(e,["description","title"]),d=typeof e.prompt=="string"?e.prompt:null,f=Array.isArray(e.load_skills)?e.load_skills.filter(y=>typeof y=="string"):[],m=typeof e.run_in_background=="boolean"?e.run_in_background:!1,h=typeof e.task_id=="string"?e.task_id:null,x=s??l,b=(s&&tM[s])??(l&&nM[l])??"bg-elevated text-fg-3";return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[x&&u.jsx("span",{className:ce("rounded px-1.5 py-0.5 text-[10px] font-medium",b),children:x}),f.map(y=>u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-4",children:y},y)),m&&u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-5",children:"bg"}),h&&u.jsxs("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",title:h,children:["↩ ",h.slice(0,16),"…"]})]}),o&&u.jsx("p",{className:"text-xs text-fg-2",children:o}),d&&u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>a(y=>!y),className:"flex items-center gap-1 text-[10px] text-fg-4 transition-colors hover:text-fg-2",children:[u.jsx(_h,{className:ce("h-3 w-3 transition-transform",t&&"rotate-90")}),"Prompt",u.jsxs("span",{className:"text-fg-5",children:["(",d.length," chars)"]})]}),t&&u.jsx("pre",{className:"mt-1 max-h-60 overflow-y-auto whitespace-pre-wrap break-words rounded bg-elevated/50 p-2 text-[11px] leading-relaxed text-fg-3",children:d})]})]})}function rM(e){const t=TC(e),a=Le(m=>m.activeSessionId),s=Le(m=>m.sessions);if(t)return t;if(!a)return null;const l=Hc(e),o=Kh(l),d=Ga(o,["description","title"]),f=s.filter(m=>m.parentID===a);if(f.length===0)return null;if(f.length===1)return f[0].id;if(d){const m=f.find(h=>h.title===d);if(m)return m.id}return null}function sM({part:e}){const t=rM(e),a=Le(s=>s.setActiveSession);return t?u.jsxs("button",{type:"button",onClick:s=>{s.stopPropagation(),a(t)},className:"mt-2 flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 font-mono text-xs text-blue-400 transition-colors hover:border-blue-500/50 hover:bg-blue-500/10",children:[u.jsxs("span",{className:"truncate text-fg-5",children:[t.slice(0,20),"…"]}),u.jsx(vv,{className:"h-3 w-3 shrink-0"}),u.jsx("span",{className:"shrink-0",children:"查看子会话"})]}):null}function iM(e,t){const a=Kh(t);if(!a)return null;const s=e.toLowerCase();if(s==="edit"||s==="patch"){const l=typeof a.oldString=="string"?a.oldString:"",o=typeof a.newString=="string"?a.newString:"";if(l||o)return u.jsx(eM,{oldStr:l,newStr:o})}if(s==="todowrite"||s==="write_todos"){const l=Array.isArray(a.todos)?a.todos:null;if(l&&l.length>0)return u.jsx(RT,{todos:l})}if(s==="bash"||s==="shell"){const l=Ga(a,["command","cmd","script"]);if(l)return u.jsxs("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:[u.jsx("span",{className:"select-none text-emerald-400/70",children:"❯ "}),l]})}if(s==="task"||s==="agent")return u.jsx(aM,{record:a});if(s==="read")return null;if(s==="write"){const l=typeof a.content=="string"?a.content:null;if(l){const o=l.length>500?`${l.slice(0,500)}…`:l;return u.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:o})}}return null}function lM(e,t){const a=e.toLowerCase();if(a==="todowrite"||a==="write_todos"){const s=Array.isArray(t)?t:null;if(s&&s.length>0)return u.jsx(RT,{todos:s})}return null}function oM({part:e}){const t=wh(e),a=t==="running"||t==="pending",[s,l]=v.useState(a),[o,d]=v.useState(!1),f=v.useRef(a);v.useEffect(()=>{f.current!==a&&(l(a),f.current=a)},[a]);const m=ey(e),h=m.toLowerCase(),x=h==="task"||h==="agent",b=Hc(e),{label:y,arg:T}=J6(m,b),N=iM(m,b),S=N?null:cx(b),C=Ch(e),A=lM(m,C),D=A?"":cx(C),k=W6[t],z=D.length>Im,V=o||!z?D:`${D.slice(0,Im)}…`;return u.jsxs("div",{className:"my-1 overflow-hidden rounded-md border border-line bg-term/70",children:[u.jsxs("button",{type:"button",onClick:()=>l(M=>!M),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors duration-150 hover:bg-surface/70",children:[u.jsx("span",{className:ce("shrink-0 leading-none",k.color),children:s?"▾":"▸"}),u.jsx("span",{className:"shrink-0 font-medium text-fg",children:y}),T&&u.jsx("span",{className:"truncate text-fg-3",children:T}),u.jsxs("span",{className:ce("ml-auto flex shrink-0 items-center gap-1.5 leading-none",k.color),children:[u.jsx("span",{className:ce(k.spin&&"fs-spin"),children:k.glyph}),u.jsx("span",{children:k.label})]})]}),s&&u.jsx("div",{className:"border-t border-line px-3 py-2",children:u.jsxs("div",{className:ce("ml-1 border-l-2 pl-3 font-mono text-xs",k.accent),children:[N&&u.jsx("section",{className:"mb-2",children:N}),S&&u.jsxs("section",{className:"mb-2",children:[u.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"input"}),u.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:S})]}),x&&u.jsx(sM,{part:e}),A&&u.jsx("section",{children:A}),D&&u.jsxs("section",{children:[u.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"output"}),u.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:V}),z&&u.jsx("button",{type:"button",onClick:()=>d(M=>!M),className:"mt-1 text-blue-400 transition-colors hover:text-blue-300",children:o?"show less":`show ${D.length-Im} more chars`})]}),!N&&!S&&!A&&!D&&u.jsx("div",{className:"text-fg-5",children:"no parameters"})]})})]})}function uM({text:e}){const[t,a]=v.useState(!1);return u.jsxs("div",{className:"my-1",children:[u.jsxs("button",{type:"button",onClick:()=>a(s=>!s),className:"flex items-center gap-1.5 font-mono text-xs text-fg-5 transition-colors hover:text-fg-3",children:[t?u.jsx(ss,{className:"h-3 w-3 shrink-0"}):u.jsx(_h,{className:"h-3 w-3 shrink-0"}),u.jsx(kE,{className:"h-3 w-3 shrink-0"}),u.jsx("span",{children:"thinking"})]}),t&&u.jsx("div",{className:"ml-1.5 mt-1 whitespace-pre-wrap border-l border-line pl-3 text-xs italic leading-relaxed text-fg-4",children:e})]})}function cM(){const[e,t]=v.useState(0);return v.useEffect(()=>{const a=Date.now(),s=setInterval(()=>{t(Math.floor((Date.now()-a)/1e3))},1e3);return()=>clearInterval(s)},[]),u.jsxs("div",{className:"my-1 flex items-center gap-1.5 font-mono text-xs text-fg-5",children:[u.jsx(kE,{className:"h-3 w-3 shrink-0 animate-pulse"}),u.jsx("span",{children:"thinking"}),e>0&&u.jsxs("span",{className:"text-fg-6",children:[e,"s"]})]})}function dM({part:e,isStreaming:t}){switch(Ah(e)){case"text":{const s=xc(e);return s.trim()?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[K6],components:{table:Yh},children:s})}):null}case"thinking":{const s=xc(e);return s.trim()?u.jsx(uM,{text:s}):t?u.jsx(cM,{}):null}case"tool":return ho(e)?u.jsx(X6,{part:e}):u.jsx(oM,{part:e});default:return null}}function fM({message:e,isStreaming:t,queued:a}){var x,b,y,T,N;const s=e.role==="user",l=e.parts??[],o=l.filter(S=>Ah(S)!=="other");if(s){const S=l.map(xc).join("").trim();return u.jsxs("div",{className:"fs-fade-in flex items-start gap-2 font-mono text-sm",children:[u.jsx("span",{className:"shrink-0 select-none text-emerald-400",children:"❯"}),u.jsx("span",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words text-fg-2",children:S||"…"}),a&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded border border-amber-500/30 px-1.5 py-0.5 text-xs text-amber-400",children:[u.jsx("span",{className:"leading-none",children:"○"}),u.jsx("span",{children:"queued"})]})]})}const d=((x=e.info)==null?void 0:x.agent)??e.agent,f=((b=e.info)==null?void 0:b.modelID)??e.modelID,m=(y=e.info)==null?void 0:y.error,h=(T=e.info)==null?void 0:T.finish;return u.jsxs("div",{className:"fs-fade-in font-mono",children:[(d||f)&&u.jsxs("div",{className:"mb-1 flex items-center gap-2 text-xs",children:[d&&u.jsx("span",{className:"text-fg-3",children:d}),d&&f&&u.jsx("span",{className:"text-fg-6",children:"·"}),f&&u.jsx("span",{className:"text-fg-5",children:f})]}),m&&u.jsxs("div",{className:"my-1 flex items-start gap-2 rounded-md border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("span",{className:"font-semibold",children:m.name??"Error"}),((N=m.data)==null?void 0:N.message)&&u.jsx("p",{className:"mt-0.5 text-red-400/80",children:m.data.message}),h&&h!=="end"&&u.jsxs("p",{className:"mt-0.5 text-red-400/60",children:["finish: ",h]})]})]}),u.jsx("div",{className:"space-y-2 text-sm text-fg",children:o.length>0?o.map((S,C)=>u.jsx(dM,{part:S,isStreaming:t},S.id??S.callID??C)):!m&&u.jsx("span",{className:"text-fg-5",children:"…"})})]})}const mM={completed:{glyph:"■",color:"text-emerald-400"},in_progress:{glyph:"■",color:"text-amber-400"},cancelled:{glyph:"■",color:"text-fg-6"},pending:{glyph:"□",color:"text-fg-5"}};function hM(e){const t=e.find(s=>Bi(s.status)==="in_progress");if(t)return t.content;const a=e.find(s=>Bi(s.status)==="pending");return a?a.content:"all steps complete"}function pM({todos:e,onClick:t}){if(e.length===0)return null;const a=e.length,s=xC(e);return u.jsx("div",{className:"rounded-md border border-line bg-term/60 px-3 py-2",children:u.jsxs("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2 text-left font-mono text-xs",children:[u.jsxs("span",{className:"shrink-0 tabular-nums text-fg-4",children:["[",s,"/",a,"]"]}),u.jsx("span",{className:"shrink-0 tracking-tight",children:e.map(l=>{const o=mM[Bi(l.status)];return u.jsx("span",{className:o.color,children:o.glyph},l.id)})}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-fg-2",children:hM(e)}),u.jsx("span",{className:"shrink-0 text-[10px] text-fg-5",children:"详情 →"})]})})}const gM=200;function bM(){return Le(e=>{const t=e.activeSessionId;if(!t)return!1;const a=e.messages[t]??po;for(let s=a.length-1;s>=0;s--){const l=a[s].parts;if(l){for(const o of l)if(Ah(o)==="tool"&&Ec(o))return!0}}return!1})}function xM(){const[e,t]=v.useState(""),[a,s]=v.useState(""),[l,o]=v.useState([]),d=v.useRef(null),f=Le(D=>D.activeSessionId),m=qe(D=>D.activeRepoId),h=Le(D=>{const k=D.activeSessionId;return k?D.sessionStatuses[k]:void 0}),x=Le(D=>D.sendMessage),b=bM();v.useEffect(()=>{if(!m){o([]);return}let D=!1;return(async()=>{try{const[k,z]=await Promise.all([Uc(),vh(m)]);if(D)return;const V=k.pinned_models,M=V?JSON.parse(V):[];o(M.length>0?z.filter(L=>M.includes(L.id)):[])}catch{D||o([])}})(),()=>{D=!0}},[m]);const y=h==="busy"&&!b,T=!f;v.useLayoutEffect(()=>{const D=d.current;D&&(D.style.height="auto",D.style.height=`${Math.min(D.scrollHeight,gM)}px`)},[e]),v.useEffect(()=>{t("")},[f]);const N=()=>{const D=e.trim();!D||T||(x(D,a||void 0),t(""))},S=D=>{D.nativeEvent.isComposing||D.keyCode===229||D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),N())},C=f?b?"输入回复,或点击上方选项…":y?"输入消息将排队等待处理…":"enter a command…":"select or start a run",A=f?y?"text-amber-400 fs-blink":b?"text-blue-400":"text-emerald-400":"text-fg-6";return u.jsxs("div",{className:"border-t border-line bg-term px-4 py-4",children:[u.jsxs("div",{className:ce("mx-auto flex max-w-4xl items-start gap-2 rounded-lg border px-3 py-2 transition-colors duration-150",T?"border-line":"border-fg-5 focus-within:border-fg-4"),children:[u.jsx("span",{className:ce("select-none pt-px font-mono text-sm leading-6",A),children:"❯"}),u.jsx("textarea",{ref:d,rows:2,value:e,disabled:T,onChange:D=>t(D.target.value),onKeyDown:S,placeholder:C,className:"flex-1 resize-none bg-transparent font-mono text-sm leading-6 text-fg placeholder:text-fg-6 focus:outline-none disabled:cursor-not-allowed"}),u.jsx("button",{type:"button",onClick:N,disabled:T||e.trim().length===0,"aria-label":"Send message",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-600 text-white transition-colors duration-150 hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:u.jsx(wE,{className:"h-4 w-4",strokeWidth:2.5})})]}),u.jsxs("div",{className:"mx-auto mt-1.5 flex max-w-4xl items-center gap-3 pl-5",children:[u.jsx("span",{className:"font-mono text-[10px] text-fg-6",children:"⏎ to run · shift+⏎ for newline"}),l.length>0&&u.jsxs("select",{value:a,onChange:D=>s(D.target.value),className:"ml-auto max-w-[200px] truncate rounded border border-line bg-surface px-2 py-0.5 font-mono text-[11px] text-fg-4 focus:border-fg-5 focus:outline-none",children:[u.jsx("option",{value:"",children:"默认模型"}),l.map(D=>u.jsx("option",{value:D.id,children:D.name||D.id},D.id))]})]})]})}const x1={idle:{glyph:"●",label:"ready",color:"text-emerald-400",spin:!1},busy:{glyph:"◌",label:"running",color:"text-amber-400",spin:!0},retry:{glyph:"◌",label:"retrying",color:"text-amber-400",spin:!0},error:{glyph:"✗",label:"error",color:"text-red-400",spin:!1}};function EM({status:e,reason:t}){const a=x1[e??"idle"]??x1.idle;return u.jsxs("span",{className:ce("flex items-center gap-1.5 rounded border border-line px-2 py-0.5 font-mono text-xs",a.color),title:e==="error"&&t?t:void 0,children:[u.jsx("span",{className:ce("leading-none",a.spin&&"fs-spin"),children:a.glyph}),u.jsx("span",{children:a.label})]})}const yM={"claude-opus-4":1e6,"claude-sonnet-4":1e6,"claude-sonnet-5":1e6,"claude-opus-5":1e6,"claude-3-7-sonnet":2e5,"claude-3-5-sonnet":2e5,"claude-3-5-haiku":2e5,"claude-3-opus":2e5,"claude-3-sonnet":2e5,"claude-3-haiku":2e5},E1=1e6;function TM(e){if(!e)return E1;for(const[t,a]of Object.entries(yM))if(e.startsWith(t))return a;return E1}function y1(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function _M(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>0?`$${e.toFixed(4)}`:"$0"}function NM(e){for(let t=e.length-1;t>=0;t--){const a=e[t];if(a.role==="assistant"&&a.tokens){const s=a.tokens;if(s.cache&&(s.cache.read>0||s.cache.write>0)||s.input>0||s.output>0)return s}}return null}function SM({session:e,messages:t}){var m,h,x;const a=NM(t),s=(e==null?void 0:e.cost)??0;if(!a&&!s)return null;const l=a?a.input+(((m=a.cache)==null?void 0:m.read)??0)+(((h=a.cache)==null?void 0:h.write)??0):0,o=TM((x=e==null?void 0:e.model)==null?void 0:x.modelID),d=l>0?Math.min(Math.round(l/o*100),999):0,f=d>=80?"text-red-400":d>=50?"text-amber-400":"text-fg-5";return u.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-fg-5",children:[l>0&&u.jsxs(u.Fragment,{children:[u.jsx("span",{title:"当前上下文 = cache_read + cache_write + input (最近一次请求)",children:y1(l)}),u.jsx("span",{className:"text-fg-6",children:"·"}),u.jsxs("span",{className:f,title:`上下文占比 (${y1(o)} 窗口)`,children:[d,"%"]}),u.jsx("span",{className:"text-fg-6",children:"·"})]}),u.jsx("span",{title:"会话累计费用",children:_M(s)})]})}const vM=144,AM=64;function OT({onToggleSidebar:e}){const[t,a]=v.useState(""),[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(""),[h,x]=v.useState(!1),b=v.useRef(null),y=v.useRef(null),T=Le(U=>U.createSession),N=Le(U=>U.sendError),S=qe(U=>U.activeRepoId),C=Di(U=>U.agents),A=Ue(U=>U.issues),D=Ue(U=>U.selectedIssueId),k=Ue(U=>U.pendingDraft);v.useEffect(()=>{D&&(d(D),Ue.getState().setSelectedIssue(null))},[D]),v.useEffect(()=>{k&&(a(k),Ue.getState().setPendingDraft(null))},[k]),v.useLayoutEffect(()=>{const U=b.current;U&&(U.style.height="auto",U.style.height=`${Math.min(U.scrollHeight,vM)}px`)},[t]),v.useEffect(()=>{const U=te=>{y.current&&!y.current.contains(te.target)&&x(!1)};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[]);const z=A.filter(U=>U.state==="open"),V=A.find(U=>U.id===o),M=f.trim().toLowerCase(),L=M?z.filter(U=>`#${U.number} ${U.title}`.toLowerCase().includes(M)):z,K=!!s||!!o,se=()=>{const U=t.trim();!S||!U&&!K||(a(""),T(U,void 0,void 0,void 0,o||void 0,s||void 0))},B=U=>{U.nativeEvent.isComposing||U.keyCode===229||U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),se())};return u.jsxs("div",{className:"relative flex flex-1 flex-col items-center justify-center bg-term",children:[u.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"absolute left-3 top-3 rounded-lg p-2 text-fg-3 hover:bg-elevated md:hidden",children:u.jsx(jc,{className:"h-5 w-5"})}),u.jsxs("div",{className:"w-full max-w-2xl px-6",children:[u.jsx("div",{className:"mb-8 text-center",children:u.jsxs("div",{className:"font-mono text-2xl text-fg-6",children:[u.jsx("span",{className:"text-emerald-500/60",children:"❯"}),u.jsx("span",{className:"fs-blink text-fg-4",children:" ▋"})]})}),u.jsxs("div",{className:"rounded-xl border border-line bg-base/80 shadow-sm transition-colors focus-within:border-fg-5",children:[u.jsxs("div",{className:"flex items-start gap-2 px-4 py-3",children:[u.jsx("span",{className:"select-none pt-px font-mono text-sm leading-6 text-emerald-400",children:"❯"}),u.jsx("textarea",{ref:b,rows:1,value:t,autoFocus:!0,disabled:!S,onChange:U=>a(U.target.value),onKeyDown:B,placeholder:S?"让 Agent 做什么?":"请先选择一个仓库",className:"flex-1 resize-none bg-transparent font-mono text-sm leading-6 text-fg placeholder:text-fg-6 focus:outline-none disabled:cursor-not-allowed"}),u.jsx("button",{type:"button",onClick:se,disabled:!S||!t.trim()&&!K,"aria-label":"Start run",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-600 text-white transition-colors duration-150 hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:u.jsx(wE,{className:"h-4 w-4",strokeWidth:2.5})})]}),u.jsxs("div",{className:"flex flex-col gap-2 border-t border-line/60 px-4 py-2 sm:flex-row sm:items-center sm:gap-3",children:[u.jsxs("label",{className:"flex items-center gap-1.5 font-mono text-[11px] text-fg-4",children:[u.jsx("span",{className:"shrink-0",children:"Agent"}),u.jsxs("select",{value:s,onChange:U=>l(U.target.value),className:"rounded border border-line bg-surface px-2 py-1 font-mono text-xs text-fg focus:border-fg-5 focus:outline-none",children:[u.jsx("option",{value:"",children:"默认"}),C.map(U=>u.jsx("option",{value:U.id,children:U.name},U.id))]})]}),A.length>0&&u.jsxs("div",{ref:y,className:"relative flex min-w-0 flex-1 items-center gap-1.5 font-mono text-[11px] text-fg-4",children:[u.jsx("span",{className:"shrink-0",children:"Issue"}),u.jsxs("button",{type:"button",onClick:()=>{x(U=>!U),m("")},className:"flex min-w-0 flex-1 items-center gap-1 truncate rounded border border-line bg-surface px-2 py-1 font-mono text-xs text-fg transition-colors hover:border-fg-5 focus:border-fg-5 focus:outline-none",children:[u.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:V?`#${V.number} ${V.title}`:"无"}),u.jsx(ss,{className:"h-3 w-3 shrink-0 text-fg-5"})]}),o&&u.jsx("button",{type:"button",onClick:()=>{d(""),m("")},className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})}),h&&u.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-full min-w-[280px] rounded-md border border-line bg-surface shadow-lg",children:[u.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-2 py-1.5",children:[u.jsx(Qa,{className:"h-3 w-3 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:f,onChange:U=>m(U.target.value),onKeyDown:U=>{U.key==="Escape"&&x(!1)},placeholder:"搜索 issue...",autoFocus:!0,className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"})]}),u.jsxs("ul",{className:"max-h-48 overflow-y-auto py-1",children:[!M&&u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>{d(""),x(!1)},className:ce("w-full px-2.5 py-1.5 text-left font-mono text-xs transition-colors hover:bg-elevated/60",o?"text-fg-4":"text-blue-400"),children:"无"})}),L.map(U=>u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>{d(U.id),m(""),x(!1)},className:ce("flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left transition-colors hover:bg-elevated/60",U.id===o?"bg-blue-500/10":""),children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium",U.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",U.number]}),u.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:U.title})]})},U.id)),L.length===0&&u.jsx("li",{className:"px-2.5 py-3 text-center font-mono text-[10px] text-fg-5",children:"无匹配结果"})]})]})]})]})]}),u.jsx("div",{className:"mt-2 text-center font-mono text-[10px] text-fg-6",children:"⌘⏎ / ctrl+⏎ 开始运行"}),N&&u.jsx("div",{className:"mt-3 rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:N})]})]})}function T1({body:e}){return e?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],components:{table:Yh},children:e})}):u.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"没有描述内容"})}function _1({issue:e}){var t;return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number," ",e.state]}),(t=e.labels)==null?void 0:t.map(a=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${a.color}20`,color:`#${a.color}`},children:a.name},a.id))]}),u.jsx("h2",{className:"mt-0.5 truncate text-sm font-medium text-fg",children:e.title})]})}function CM({onToggleSidebar:e}){const t=Ue(x=>x.matchingParentId),a=Ue(x=>x.matchingCandidateId),s=Ue(x=>x.issues.find(b=>b.id===t)),l=Ue(x=>x.issues.find(b=>b.id===a)),o=Ue(x=>x.exitMatchMode),d=Ue(x=>x.linkChild),[f,m]=v.useState(!1);if(!s)return null;const h=async()=>{l&&(m(!0),await d(s.number,l.number),m(!1))};return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[u.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[u.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated md:hidden",children:u.jsx(jc,{className:"h-5 w-5"})}),u.jsx("span",{className:"text-xs font-medium text-fg-4",children:"匹配子任务"}),u.jsxs("span",{className:"font-mono text-xs text-fg-3",children:["父: #",s.number]}),u.jsx("div",{className:"flex-1"}),u.jsxs("button",{type:"button",onClick:o,className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(Tt,{className:"h-3.5 w-3.5"}),"退出匹配"]})]}),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row",children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden border-b border-line md:border-b-0 md:border-r",children:[u.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:u.jsx(_1,{issue:s})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:u.jsx(T1,{body:s.body})})]}),u.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:l?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:u.jsx(_1,{issue:l})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:u.jsx(T1,{body:l.body})})]}):u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"← 从左侧列表选择候选 Issue"})})})]}),l&&u.jsx("div",{className:"flex items-center justify-center gap-3 border-t border-line bg-base px-4 py-3",children:u.jsxs("button",{type:"button",onClick:()=>void h(),disabled:f,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-4 py-2 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-50",children:[u.jsx(oa,{className:"h-3.5 w-3.5"}),f?"关联中…":`确认: 将 #${l.number} 设为 #${s.number} 的子任务`]})})]})}function wM({onToggleSidebar:e}){var l;const t=Ue(o=>o.previewIssueId),a=Ue(o=>o.issues.find(d=>d.id===t));if(!a)return u.jsx(OT,{onToggleSidebar:e});const s=()=>{Ue.getState().setSelectedIssue(a.id),Ue.getState().setPreviewIssue(null)};return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[u.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[u.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated md:hidden",children:u.jsx(jc,{className:"h-5 w-5"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",a.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",a.number," ",a.state]}),(l=a.labels)==null?void 0:l.map(o=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${o.color}20`,color:`#${o.color}`},children:o.name},o.id))]}),u.jsx("h2",{className:"mt-0.5 truncate text-sm font-medium text-fg",children:a.title})]}),u.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[a.htmlUrl&&u.jsxs("a",{href:a.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(hc,{className:"h-3.5 w-3.5"}),"源站"]}),u.jsxs("button",{type:"button",onClick:()=>Ue.getState().enterMatchMode(a.id),className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[u.jsx(_o,{className:"h-3.5 w-3.5"}),"匹配子任务"]}),u.jsxs("button",{type:"button",onClick:s,className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:[u.jsx(Bc,{className:"h-3.5 w-3.5 fill-current"}),"开始处理"]})]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto",children:u.jsx("div",{className:"mx-auto max-w-4xl px-6 py-6",children:a.body?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],components:{table:Yh},children:a.body})}):u.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"})})})]})}function kM({onToggleSidebar:e,onToggleRightPanel:t,rightPanelOpen:a}){var M;const s=va(),l=qe(Da),o=Le(L=>L.activeSessionId),d=Ue(L=>L.previewIssueId),f=Le(L=>L.sessions.find(K=>K.id===L.activeSessionId)??null),m=Le(L=>{const K=L.activeSessionId;return K?L.messages[K]??po:po}),h=Le(L=>{const K=L.activeSessionId;return K?L.todos[K]??yc:yc}),x=Le(L=>{const K=L.activeSessionId;return K?L.sessionStatuses[K]:void 0}),b=Le(L=>{const K=L.activeSessionId;return K?L.queuedMessageIds[K]??dx:dx}),y=Le(L=>{const K=L.activeSessionId;return K?L.errorReasons[K]:void 0}),T=Le(L=>L.sendError),N=Le(L=>L.abortSession),S=Ue(L=>f!=null&&f.issueId?L.issues.find(K=>K.id===f.issueId):void 0);v.useEffect(()=>{if(o)return Sc.activateSession(o),()=>Sc.deactivateSession(o)},[o]);const C=v.useRef(null),A=v.useRef(!0);v.useEffect(()=>{const L=C.current;L&&A.current&&(L.scrollTop=L.scrollHeight)},[m,h]),v.useEffect(()=>{A.current=!0},[o]),v.useEffect(()=>{if(x!=="busy"&&x!=="retry")return;const L=K=>{if(K.key!=="Escape"||K.defaultPrevented)return;const se=K.target;se instanceof HTMLInputElement||se instanceof HTMLTextAreaElement||se!=null&&se.isContentEditable||N()};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[x,N]);const D=Ue(L=>L.matchingParentId);if(!o)return D?u.jsx(CM,{onToggleSidebar:e}):d?u.jsx(wM,{onToggleSidebar:e}):u.jsx(OT,{onToggleSidebar:e});const k=x==="busy",z=x==="retry",V=k||z;return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[u.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[u.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated md:hidden",children:u.jsx(jc,{className:"h-5 w-5"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[(f==null?void 0:f.parentID)&&u.jsxs("button",{type:"button",onClick:()=>void Le.getState().setActiveSession(f.parentID),className:"mb-0.5 flex items-center gap-1 text-[11px] text-fg-4 transition-colors hover:text-blue-400",children:[u.jsx(Nv,{className:"h-3 w-3"}),"返回父会话"]}),u.jsx("h2",{className:"truncate text-sm font-medium text-fg",children:((M=f==null?void 0:f.title)==null?void 0:M.trim())||"untitled run"}),(f==null?void 0:f.agent)&&u.jsx("p",{className:"truncate font-mono text-xs text-fg-4",children:f.agent}),u.jsx(SM,{session:f,messages:m})]}),S&&u.jsxs("button",{type:"button",onClick:()=>s(`/${encodeURIComponent(l)}/issues?issueId=${S.id}`),className:"flex items-center gap-1 rounded-md border border-line px-2 py-1 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsxs("span",{className:ce("rounded px-1 py-0.5 text-[10px] font-semibold",S.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",S.number]}),u.jsx("span",{className:"hidden max-w-[120px] truncate sm:inline",children:S.title})]}),u.jsx(EM,{status:x,reason:y}),t&&u.jsx("button",{type:"button",onClick:t,"aria-label":a?"关闭侧边栏":"打开侧边栏",className:ce("hidden items-center justify-center rounded-md border border-line p-1.5 transition-colors md:flex",a?"bg-blue-500/10 text-blue-500 hover:bg-blue-500/20":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:u.jsx(DE,{className:"h-4 w-4"})}),V&&u.jsxs("button",{type:"button",onClick:()=>void N(),className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 font-mono text-xs text-fg-2 transition-colors hover:border-red-500/50 hover:text-red-400",children:[u.jsx(jE,{className:"h-3 w-3 fill-current"}),z?"stop retry":"stop"]})]}),u.jsx("div",{ref:C,onScroll:()=>{const L=C.current;L&&(A.current=L.scrollHeight-L.clientHeight-L.scrollTop<=AM)},className:"flex-1 overflow-y-auto",children:u.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-3 px-4 py-4",children:[m.length===0?u.jsxs("p",{className:"py-10 text-center font-mono text-xs text-fg-6",children:[u.jsx("span",{className:"text-emerald-500/60",children:"❯"})," waiting for input",u.jsx("span",{className:"fs-blink",children:" ▋"})]}):m.map((L,K)=>u.jsxs(v.Fragment,{children:[K>0&&L.role==="user"&&u.jsx("div",{className:"border-t border-line/70"}),u.jsx("div",{"data-message-id":L.id,children:u.jsx(fM,{message:L,isStreaming:k&&K===m.length-1,queued:b.includes(L.id)})})]},L.id)),h.length>0&&u.jsx(pM,{todos:[...h],onClick:t})]})}),x==="error"&&y&&u.jsxs("div",{className:"flex items-center gap-2 border-t border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:[u.jsx(Kn,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"truncate",children:y})]}),T&&u.jsxs("div",{className:"flex items-center gap-2 border-t border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:[u.jsx(Kn,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"truncate",children:T})]}),u.jsx(xM,{})]})}const Gn=zs((e,t)=>({pulls:[],loaded:!1,syncing:!1,selectedPrId:null,matchingPrId:null,matchingCandidateIssueId:null,clearPulls:()=>e({pulls:[],loaded:!1,selectedPrId:null,matchingPrId:null,matchingCandidateIssueId:null}),setSelectedPr:a=>e({selectedPrId:a}),enterMatchMode:a=>e({matchingPrId:a,matchingCandidateIssueId:null}),exitMatchMode:()=>{const a=t().matchingPrId;e({matchingPrId:null,matchingCandidateIssueId:null,selectedPrId:a})},setMatchCandidate:a=>e({matchingCandidateIssueId:a}),linkIssue:async(a,s)=>{const l=qe.getState().activeRepoId;if(!l)return!1;try{return await F3(l,a,s),!0}catch{return!1}},unlinkIssue:async(a,s)=>{const l=qe.getState().activeRepoId;if(!l)return!1;try{return await z3(l,a,s),!0}catch{return!1}},loadPulls:async()=>{const a=qe.getState().activeRepoId;if(!a){e({pulls:[],loaded:!0});return}try{const s=await lx(a,"all");e({pulls:s,loaded:!0})}catch{e({loaded:!0})}},syncPulls:async()=>{const a=qe.getState().activeRepoId;if(a){e({syncing:!0});try{await U3(a);const s=await lx(a,"all");e({pulls:s,syncing:!1})}catch(s){e({syncing:!1});let l="同步 PR 失败";if(s instanceof Hs)try{const o=JSON.parse(s.message);o.error&&(l=o.error)}catch{s.message&&(l=s.message)}Yt.getState().addToast(l,"error")}}}})),RM={completed:{glyph:"✓",color:"text-emerald-400",spin:!1},in_progress:{glyph:"◌",color:"text-amber-400",spin:!0},cancelled:{glyph:"✗",color:"text-fg-5",spin:!1},pending:{glyph:"○",color:"text-fg-4",spin:!1}};function OM(e){var l;const t=(l=e.time)==null?void 0:l.created;if(!t)return"";const a=t<1e12?t*1e3:t;return new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function IM(e){if(!e.parts)return"";for(const t of e.parts){const a=t.content??t.text;if(a)return a}return""}function MM({todos:e}){if(e.length===0)return u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无待办项"})});const t=e.filter(a=>{const s=Bi(a.status);return s==="completed"||s==="cancelled"}).length;return u.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[u.jsxs("div",{className:"mb-2 font-mono text-[10px] tabular-nums text-fg-5",children:["进度 ",t,"/",e.length]}),u.jsx("ul",{className:"space-y-1.5",children:e.map(a=>{const s=Bi(a.status),l=RM[s],o=s==="completed"||s==="cancelled";return u.jsxs("li",{className:"flex items-start gap-2 font-mono text-xs",children:[u.jsx("span",{className:ce("shrink-0 leading-5",l.color,l.spin&&"fs-spin"),children:l.glyph}),u.jsx("span",{className:ce("leading-5",o?"text-fg-5 line-through":"text-fg-2"),children:a.content})]},a.id)})})]})}function DM({messages:e,onScrollToMessage:t}){const a=e.filter(s=>s.role==="user");return a.length===0?u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无输入记录"})}):u.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:u.jsx("ul",{className:"space-y-1",children:a.map((s,l)=>{const o=IM(s),d=OM(s);return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(s.id),className:"group w-full rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"shrink-0 font-mono text-[10px] text-emerald-400/60",children:"❯"}),u.jsxs("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:["#",l+1]}),d&&u.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-fg-6",children:d})]}),o&&u.jsx("p",{className:"mt-0.5 line-clamp-2 pl-5 text-xs leading-relaxed text-fg-3 group-hover:text-fg-2",children:o})]})},s.id)})})})}function LM({linked:e,number:t,title:a,state:s,mergedAt:l,isPr:o,onToggle:d}){const f=o?s==="open"?"bg-emerald-500/15 text-emerald-400":l?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":s==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400";return u.jsx("li",{children:u.jsx("button",{type:"button",onClick:d,className:ce("flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors",e?"border-l-2 border-emerald-500 bg-emerald-500/5":"border-l-2 border-transparent hover:bg-elevated/50"),children:u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",f),children:["#",t]}),u.jsx("span",{className:"min-w-0 truncate text-xs text-fg-2",children:a}),e&&u.jsx(Lc,{className:"ml-auto h-3 w-3 shrink-0 text-emerald-400"})]})})})}function jM({links:e,sessionId:t}){var M,L,K,se;const a=va(),s=qe(Da),[l,o]=v.useState(null),[d,f]=v.useState(""),m=v.useRef(null),h=Ue(B=>B.issues),x=Gn(B=>B.pulls),b=Le(B=>B.addLink),y=Le(B=>B.removeLink),T=new Set(((M=e==null?void 0:e.issues)==null?void 0:M.map(B=>B.id))??[]),N=new Set(((L=e==null?void 0:e.pullRequests)==null?void 0:L.map(B=>B.id))??[]);v.useEffect(()=>{var B;l&&((B=m.current)==null||B.focus())},[l]);const S=()=>{o(null),f("")},C=async(B,U,te)=>{t&&(te?await y(t,B,U):await b(t,B,U))},A=d.trim().toLowerCase(),D=A?h.filter(B=>`#${B.number} ${B.title}`.toLowerCase().includes(A)):h,k=A?x.filter(B=>`#${B.number} ${B.title} ${B.headBranch}`.toLowerCase().includes(A)):x,z=((K=e==null?void 0:e.issues)==null?void 0:K.length)??0,V=((se=e==null?void 0:e.pullRequests)==null?void 0:se.length)??0;if(l){const B=l==="issue",U=B?D:k,te=B?T:N;return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-2",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:B?"关联 Issue":"关联 PR"}),u.jsxs("button",{type:"button",onClick:S,className:"flex h-6 items-center gap-1 rounded-md px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[u.jsx(Tt,{className:"h-3.5 w-3.5"}),"完成"]})]}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{ref:m,type:"text",value:d,onChange:ie=>f(ie.target.value),placeholder:B?"搜索 issue...":"搜索 PR...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&u.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:U.length===0?u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:(B?h:x).length===0?B?"暂无 Issue,请先同步":"暂无 PR,请先同步":"无匹配结果"}):u.jsx("ul",{className:"space-y-0.5",children:U.map(ie=>u.jsx(LM,{linked:te.has(ie.id),number:ie.number,title:ie.title,state:ie.state,mergedAt:B?void 0:ie.mergedAt,isPr:!B,onToggle:()=>C(l,ie.id,te.has(ie.id))},ie.id))})})]})}return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-2",children:[u.jsx("span",{className:"flex-1 font-mono text-[10px] text-fg-5",children:z+V>0?`${z+V} 项关联`:"暂无关联"}),u.jsxs("button",{type:"button",onClick:()=>o("issue"),className:"flex h-6 items-center gap-1 rounded-md border border-line px-1.5 text-fg-4 transition-colors hover:border-emerald-500/50 hover:text-emerald-400",children:[u.jsx(Sr,{className:"h-3 w-3"}),u.jsx("span",{className:"text-[10px] font-medium",children:"Issue"})]}),u.jsxs("button",{type:"button",onClick:()=>o("pr"),className:"flex h-6 items-center gap-1 rounded-md border border-line px-1.5 text-fg-4 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[u.jsx(Sr,{className:"h-3 w-3"}),u.jsx("span",{className:"text-[10px] font-medium",children:"PR"})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[z>0&&u.jsxs("div",{className:"mb-3",children:[u.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Issues (",z,")"]}),u.jsx("ul",{className:"space-y-1",children:e.issues.map(B=>u.jsxs("li",{className:"group flex items-start gap-1",children:[u.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(s)}/issues?issueId=${encodeURIComponent(B.id)}`),className:"flex min-w-0 flex-1 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[u.jsxs("span",{className:ce("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",B.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",B.number]}),u.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:B.title})]}),u.jsx("button",{type:"button",onClick:()=>void C("issue",B.id,!0),className:"mt-1.5 hidden shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/15 hover:text-red-400 group-hover:block",children:u.jsx(Tt,{className:"h-3 w-3"})})]},B.id))})]}),V>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Pull Requests (",V,")"]}),u.jsx("ul",{className:"space-y-1",children:e.pullRequests.map(B=>u.jsxs("li",{className:"group flex items-start gap-1",children:[u.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(s)}/pulls?prId=${encodeURIComponent(B.id)}`),className:"flex min-w-0 flex-1 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[u.jsxs("span",{className:ce("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",B.state==="open"?"bg-emerald-500/15 text-emerald-400":B.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400"),children:["#",B.number]}),u.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:B.title})]}),u.jsx("button",{type:"button",onClick:()=>void C("pr",B.id,!0),className:"mt-1.5 hidden shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/15 hover:text-red-400 group-hover:block",children:u.jsx(Tt,{className:"h-3 w-3"})})]},B.id))})]}),z===0&&V===0&&u.jsx("div",{className:"flex flex-1 items-center justify-center py-10",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"点击上方按钮添加关联"})})]})]})}const BM={"visual-engineering":"bg-purple-500/15 text-purple-400",quick:"bg-emerald-500/15 text-emerald-400",deep:"bg-blue-500/15 text-blue-400",ultrabrain:"bg-amber-500/15 text-amber-400",artistry:"bg-pink-500/15 text-pink-400",writing:"bg-cyan-500/15 text-cyan-400",explore:"bg-teal-500/15 text-teal-400",librarian:"bg-indigo-500/15 text-indigo-400",oracle:"bg-amber-500/15 text-amber-400",metis:"bg-rose-500/15 text-rose-400",momus:"bg-orange-500/15 text-orange-400"};function PM(e){switch(e){case"idle":return"bg-emerald-500";case"busy":case"retry":return"bg-amber-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-fg-5"}}function Mm(e){var a;const t=(a=e.time)==null?void 0:a.created;if(t)return t<1e12?t*1e3:t;if(e.createdAt){const s=Date.parse(e.createdAt);if(!Number.isNaN(s))return s}return null}function UM(e){const t=Date.now()-e,a=Math.floor(t/1e3);if(a<60)return"just now";const s=Math.floor(a/60);if(s<60)return`${s}m ago`;const l=Math.floor(s/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function HM(){const e=Le(m=>m.sessions),t=Le(m=>m.activeSessionId),a=Le(m=>m.sessionStatuses),s=Le(m=>m.setActiveSession),l=e.find(m=>m.id===t),o=(l==null?void 0:l.parentID)??t,d=!!(l!=null&&l.parentID),f=e.filter(m=>m.parentID===o).sort((m,h)=>(Mm(h)??0)-(Mm(m)??0));return f.length===0?u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无子任务"})}):u.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[d&&u.jsxs("div",{className:"mb-1.5 px-2 font-mono text-[10px] text-fg-5",children:["同级子任务 (",f.length,")"]}),u.jsx("ul",{className:"space-y-0.5",children:f.map(m=>{const h=m.id===t,x=a[m.id],b=Mm(m),y=(m.agent&&BM[m.agent])??"bg-elevated text-fg-4",T=m.title||`${m.id.slice(0,9)}...`;return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>{h||s(m.id)},className:ce("group flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors",h?"border-l-2 border-blue-500 bg-blue-500/5":"border-l-2 border-transparent hover:bg-elevated/60"),children:[u.jsx("span",{className:ce("mt-1 h-2 w-2 shrink-0 rounded-full",PM(x))}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[m.agent&&u.jsx("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium",y),children:m.agent}),b!=null&&u.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-6",children:UM(b)})]}),u.jsx("p",{className:ce("mt-0.5 line-clamp-2 text-xs leading-5",h?"text-fg-2":"text-fg-3 group-hover:text-fg-2"),children:T})]})]})},m.id)})})]})}function N1({todos:e,messages:t,sessionLinks:a,sessionId:s,onScrollToMessage:l}){var N,S;const[o,d]=v.useState("todo"),f=Le(C=>C.sessions),m=Le(C=>C.activeSessionId),h=t.filter(C=>C.role==="user").length,x=(((N=a==null?void 0:a.issues)==null?void 0:N.length)??0)+(((S=a==null?void 0:a.pullRequests)==null?void 0:S.length)??0),b=f.find(C=>C.id===m),y=(b==null?void 0:b.parentID)??m,T=f.filter(C=>C.parentID===y).length;return u.jsxs("div",{className:"flex h-full w-72 shrink-0 flex-col border-l border-line bg-surface",children:[u.jsxs("div",{className:"flex items-center border-b border-line",children:[u.jsxs("button",{type:"button",onClick:()=>d("todo"),className:ce("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",o==="todo"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(dA,{className:"h-3.5 w-3.5"}),"待办",e.length>0&&u.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:e.length})]}),u.jsxs("button",{type:"button",onClick:()=>d("prompts"),className:ce("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",o==="prompts"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(TA,{className:"h-3.5 w-3.5"}),"输入",h>0&&u.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:h})]}),u.jsxs("button",{type:"button",onClick:()=>d("links"),className:ce("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",o==="links"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(Lc,{className:"h-3.5 w-3.5"}),"关联",x>0&&u.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:x})]}),u.jsxs("button",{type:"button",onClick:()=>d("subtasks"),className:ce("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",o==="subtasks"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(_o,{className:"h-3.5 w-3.5"}),"子任务",T>0&&u.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:T})]})]}),o==="todo"?u.jsx(MM,{todos:e}):o==="prompts"?u.jsx(DM,{messages:t,onScrollToMessage:l}):o==="links"?u.jsx(jM,{links:a,sessionId:s}):u.jsx(HM,{})]})}const S1=8;function IT({onSwipeLeft:e,onSwipeRight:t,threshold:a=40,disabled:s=!1}={}){const l=v.useRef({x0:0,y0:0,dir:null,on:!1}),o=v.useRef(0),d=v.useCallback(h=>{if(s)return;const x=h.touches[0];l.current={x0:x.clientX,y0:x.clientY,dir:null,on:!0},o.current=0},[s]),f=v.useCallback(h=>{const x=l.current;if(!x.on)return;const b=h.touches[0].clientX-x.x0,y=h.touches[0].clientY-x.y0;if(!x.dir){(Math.abs(b)>S1||Math.abs(y)>S1)&&(x.dir=Math.abs(b)>Math.abs(y)?"h":"v");return}if(x.dir==="v"){x.on=!1;return}o.current=b},[]),m=v.useCallback(()=>{const h=l.current;if(!h.on||h.dir!=="h"){h.on=!1;return}h.on=!1;const x=o.current;x>a?t==null||t():x<-a&&(e==null||e())},[a,e,t]);return{onTouchStart:d,onTouchMove:f,onTouchEnd:m}}function ah({side:e,open:t,onClose:a,children:s,width:l="w-80"}){const o=e==="left";return u.jsxs("div",{className:"md:hidden",children:[t&&u.jsx("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:a,"aria-hidden":"true"}),u.jsx("div",{className:ce("fixed top-0 bottom-0 z-50 flex flex-col bg-surface pt-[var(--safe-top)] pb-[var(--safe-bottom)] shadow-xl transition-transform duration-200 ease-out",l,o?"left-0 border-r border-line":"right-0 border-l border-line",t?"translate-x-0":o?"-translate-x-full":"translate-x-full"),children:s})]})}function rh(e){var t,a;if(typeof((t=e.time)==null?void 0:t.updated)=="number")return e.time.updated;if(typeof((a=e.time)==null?void 0:a.created)=="number")return e.time.created;if(e.createdAt){const s=Date.parse(e.createdAt);return Number.isNaN(s)?0:s}return 0}function FM(e){const t=rh(e);if(!t)return"";const a=t<1e12?t*1e3:t,s=new Date(a);return s.toDateString()===new Date().toDateString()?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function v1(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>A1(e)):A1(e)}function A1(e){const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;opacity:0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function zM(e){switch(e){case"idle":return"bg-emerald-500";case"busy":case"retry":return"bg-amber-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-fg-5"}}function qM({session:e,isActive:t,isConfirming:a,onSelect:s,onDelete:l,onConfirm:o,onCancelConfirm:d,onRename:f,status:m,issue:h,linkedItems:x}){var te,ie;const b=FM(e),[y,T]=v.useState(!1),[N,S]=v.useState(""),C=v.useRef(null),A=()=>{var Z;S(((Z=e.title)==null?void 0:Z.trim())||""),T(!0),requestAnimationFrame(()=>{var ee;return(ee=C.current)==null?void 0:ee.focus()})},D=()=>{var ee;T(!1);const Z=N.trim();Z&&Z!==(((ee=e.title)==null?void 0:ee.trim())||"")&&f(Z)},[k,z]=v.useState(0),[V,M]=v.useState(!1),L=v.useRef({x0:0,y0:0,base:0,dir:null,on:!1}),K=Z=>{const ee=Z.touches[0];L.current={x0:ee.clientX,y0:ee.clientY,base:k,dir:null,on:!0},M(!1)},se=Z=>{const ee=L.current;if(!ee.on)return;const Q=Z.touches[0].clientX-ee.x0,$=Z.touches[0].clientY-ee.y0;if(!ee.dir){(Math.abs(Q)>5||Math.abs($)>5)&&(ee.dir=Math.abs(Q)>Math.abs($)?"h":"v");return}ee.dir!=="v"&&z(Math.max(-144,Math.min(0,ee.base+Q)))},B=()=>{L.current.on=!1,M(!0),z(Z=>Z<-144/2?-144:0)},U=()=>{M(!0),z(0)};return u.jsxs("li",{className:"relative overflow-hidden rounded-md",children:[u.jsx("div",{className:"absolute right-0 top-0 bottom-0 flex md:hidden",style:k<0?{zIndex:10}:void 0,children:a?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>{l(),U()},className:"flex w-12 items-center justify-center bg-red-500 text-white active:bg-red-600",children:u.jsx(oa,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>{d(),U()},className:"flex w-12 items-center justify-center bg-neutral-500 text-white active:bg-neutral-600",children:u.jsx(Tt,{className:"h-4 w-4"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>{A(),U()},className:"flex w-12 items-center justify-center bg-amber-500 text-white active:bg-amber-600",children:u.jsx(Qb,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>{var Z;v1(JSON.stringify({id:e.id,name:((Z=e.title)==null?void 0:Z.trim())||""},null,2)),U()},className:"flex w-12 items-center justify-center bg-blue-500 text-white active:bg-blue-600",children:u.jsx(mc,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>o(),className:"flex w-12 items-center justify-center bg-red-500 text-white active:bg-red-600",children:u.jsx(ji,{className:"h-4 w-4"})})]})}),u.jsxs("div",{className:ce("group relative rounded-md border-l-2",t?"border-blue-500 bg-elevated":"border-transparent bg-surface hover:bg-elevated/50",V&&"transition-transform duration-200 ease-out"),style:{...k!==0?{transform:`translateX(${k}px)`}:{},...k===-144?{pointerEvents:"none"}:{}},onTouchStart:K,onTouchMove:se,onTouchEnd:B,children:[u.jsxs("button",{type:"button",onClick:()=>{y||(s(),U())},className:"block w-full px-2.5 py-2 text-left",style:k===-144?{pointerEvents:"auto"}:void 0,children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:ce("h-1.5 w-1.5 shrink-0 rounded-full",zM(m))}),u.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((te=e.agent)==null?void 0:te.trim())||"默认"}),b&&u.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:b})]}),y?u.jsx("input",{ref:C,type:"text",value:N,onChange:Z=>S(Z.target.value),onBlur:D,onKeyDown:Z=>{Z.key==="Enter"&&D(),Z.key==="Escape"&&T(!1)},onClick:Z=>Z.stopPropagation(),className:"mt-0.5 w-full rounded border border-blue-500 bg-base pl-3.5 text-sm text-fg-2 outline-none"}):u.jsxs("div",{className:"mt-0.5 pl-3.5",onDoubleClick:Z=>{Z.stopPropagation(),A()},children:[(h||x)&&u.jsxs("div",{className:"mb-0.5 flex flex-wrap gap-1",children:[h&&u.jsxs("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",h.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",h.number]}),x==null?void 0:x.map(Z=>u.jsx("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",Z.type==="pr"?Z.state==="open"?"bg-blue-500/15 text-blue-400":Z.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":Z.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:Z.type==="pr"?`PR#${Z.number}`:`#${Z.number}`},`${Z.type}-${Z.number}`))]}),u.jsx("span",{className:"block truncate text-sm text-fg-2",children:((ie=e.title)==null?void 0:ie.trim())||"未命名运行"})]})]}),a?u.jsxs("span",{className:"absolute right-1.5 top-1.5 hidden items-center gap-1 rounded bg-surface/90 px-0.5 md:flex",children:[u.jsx("button",{type:"button",onClick:l,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:u.jsx(oa,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:d,className:"rounded p-1 text-fg-3 hover:bg-elevated",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}):u.jsxs("span",{className:"absolute right-1.5 top-1.5 hidden items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 md:flex",children:[u.jsx("button",{type:"button",onClick:A,title:"重命名",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:u.jsx(Qb,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>{var Z;v1(JSON.stringify({id:e.id,name:((Z=e.title)==null?void 0:Z.trim())||""},null,2))},title:"复制 Session JSON",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:u.jsx(mc,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:o,className:"rounded p-1 text-fg-5 hover:text-red-400",children:u.jsx(ji,{className:"h-3.5 w-3.5"})})]})]})]})}function Dm({issue:e,indent:t,selected:a,badge:s,onClick:l}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:l,className:ce("group flex w-full items-center gap-2 rounded-md py-1.5 text-left transition-colors",t?"pl-6 pr-2.5":"px-2.5",a?"bg-blue-500/10":"hover:bg-elevated/50"),children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number]}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-3",children:e.title}),s!=null&&s>0&&u.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:s})]})})}function C1({onClose:e}){const[t,a]=v.useState(null),[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(new Set),h=Le(R=>R.sessions),x=Le(R=>R.activeSessionId),b=Le(R=>R.sessionStatuses),y=Le(R=>R.setActiveSession),T=Le(R=>R.deleteSession),N=Le(R=>R.renameSession),S=qe(R=>R.activeRepoId),C=Ue(R=>R.issues),A=Ue(R=>R.syncing),D=Ue(R=>R.syncIssues),k=Ue(R=>R.matchingParentId),z=Ue(R=>R.matchingCandidateId),V=Le(R=>R.allSessionLinks),M=[...h].filter(R=>!R.parentID).sort((R,W)=>rh(W)-rh(R)),L=new Map(C.map(R=>[R.id,R])),K=new Map;for(const R of M)R.issueId&&K.set(R.issueId,(K.get(R.issueId)??0)+1);const se=C.filter(R=>R.state==="open"),B=new Map,U=se.filter(R=>{if(R.parentId){const W=B.get(R.parentId)??[];return W.push(R),B.set(R.parentId,W),!1}return!0}),te=U.filter(R=>B.has(R.id)),ie=U.filter(R=>!B.has(R.id)),Z=o.trim().toLowerCase(),ee=R=>`#${R.number} ${R.title}`.toLowerCase().includes(Z),Q=Z?te.filter(R=>ee(R)?!0:(B.get(R.id)??[]).some(ee)):te,$=Z?ie.filter(ee):ie,pe=R=>{m(W=>{const O=new Set(W);return O.has(R)?O.delete(R):O.add(R),O})},ke=R=>u.jsx("ul",{className:"space-y-0.5",children:R.map(W=>{const O=W.issueId?L.get(W.issueId):void 0,ge=V[W.id],ve=[];if(ge){for(const Ae of ge.issues)ve.push({number:Ae.number,state:Ae.state,type:"issue"});for(const Ae of ge.pullRequests)ve.push({number:Ae.number,state:Ae.state,type:"pr",mergedAt:Ae.mergedAt})}return u.jsx(qM,{session:W,isActive:W.id===x,isConfirming:t===W.id,status:b[W.id],issue:O?{number:O.number,title:O.title,state:O.state}:void 0,linkedItems:ve.length>0?ve:void 0,onSelect:()=>{y(W.id),e==null||e()},onDelete:()=>{T(W.id),a(null)},onConfirm:()=>a(W.id),onCancelConfirm:()=>a(null),onRename:Ae=>void N(W.id,Ae)},W.id)})}),P=R=>{k?Ue.getState().setMatchCandidate(R):(Ue.getState().setPreviewIssue(R),Le.setState({activeSessionId:null})),e==null||e()};if(k){const R=L.get(k),W=s.toLowerCase(),O=C.filter(ge=>ge.state==="open"&&ge.id!==k&&(!W||`#${ge.number} ${ge.title}`.toLowerCase().includes(W)));return u.jsxs("div",{className:"flex h-full w-80 shrink-0 flex-col border-r border-line bg-surface",children:[u.jsxs("div",{className:"border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"选择子任务"}),R&&u.jsxs("p",{className:"mt-0.5 truncate font-mono text-[10px] text-fg-5",children:["父: #",R.number," ",R.title]})]}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 text-fg-5"}),u.jsx("input",{type:"text",value:s,onChange:ge=>l(ge.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"})]})}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[u.jsx("ul",{className:"space-y-0.5",children:O.map(ge=>u.jsx(Dm,{issue:ge,selected:ge.id===z,onClick:()=>P(ge.id)},ge.id))}),O.length===0&&u.jsx("p",{className:"px-2 py-4 text-center font-mono text-xs text-fg-5",children:"无匹配结果"})]})]})}return u.jsxs("div",{className:"flex h-full w-80 shrink-0 flex-col border-r border-line bg-surface",children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"运行记录"}),S&&u.jsx("button",{type:"button",onClick:()=>{Le.setState({activeSessionId:null}),e==null||e()},title:"新建运行",className:"flex h-7 w-7 items-center justify-center rounded-md bg-blue-600 text-white transition-colors hover:bg-blue-500",children:u.jsx(Sr,{className:"h-4 w-4"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:S?M.length===0?u.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"暂无运行记录"}):u.jsx("div",{children:ke(M)}):u.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-line",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"}),S&&u.jsx("button",{type:"button",onClick:()=>void D(),disabled:A,title:"同步 Issues",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-3.5 w-3.5",A&&"animate-spin")})})]}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:o,onChange:R=>d(R.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),o&&u.jsx("button",{type:"button",onClick:()=>d(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:S?C.length===0?u.jsx("p",{className:"px-2 py-4 text-center font-mono text-xs text-fg-5",children:"点击 ↻ 同步 Issues"}):Q.length===0&&$.length===0?u.jsx("p",{className:"px-2 py-4 text-center font-mono text-xs text-fg-5",children:"无匹配 Issue"}):u.jsxs("ul",{className:"space-y-0.5",children:[Q.map(R=>{const W=B.get(R.id)??[],O=Z?W.filter(ee):W,ge=f.has(R.id)||!!Z;return u.jsxs("li",{children:[u.jsxs("div",{className:"flex items-center",children:[u.jsx("button",{type:"button",onClick:()=>pe(R.id),className:"flex h-6 w-5 shrink-0 items-center justify-center text-fg-5",children:u.jsx(_h,{className:ce("h-3 w-3 transition-transform",ge&&"rotate-90")})}),u.jsxs("button",{type:"button",onClick:()=>P(R.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded-md py-1.5 pr-2.5 text-left transition-colors hover:bg-elevated/50",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",R.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",R.number]}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-fg-2",children:R.title}),u.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:W.length})]})]}),ge&&O.length>0&&u.jsx("ul",{className:"space-y-0.5",children:O.map(ve=>u.jsx(Dm,{issue:ve,indent:!0,onClick:()=>P(ve.id)},ve.id))})]},R.id)}),$.map(R=>u.jsx(Dm,{issue:R,badge:K.get(R.id),onClick:()=>P(R.id)},R.id))]}):u.jsx("p",{className:"px-2 py-4 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]})]})}function YM(){const[e,t]=v.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1280px)").matches);return v.useEffect(()=>{const a=window.matchMedia("(min-width: 1280px)"),s=l=>t(l.matches);return a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e}function w1(e){const t=document.querySelector(`[data-message-id="${e}"]`);t&&(t.scrollIntoView({behavior:"smooth",block:"center"}),t.classList.add("fs-highlight"),setTimeout(()=>t.classList.remove("fs-highlight"),2e3))}function $M(){const[e,t]=v.useState(!1),[a,s]=v.useState(!1),[l,o]=v.useState(!1),d=YM(),f=Le(N=>N.activeSessionId),m=Le(N=>{const S=N.activeSessionId;return S?N.todos[S]??yc:yc}),h=Le(N=>{const S=N.activeSessionId;return S?N.messages[S]??po:po}),x=Le(N=>{const S=N.activeSessionId;return S?N.sessionLinks[S]:void 0});v.useEffect(()=>{d&&f?o(!0):d||o(!1)},[d,f]);const b=l&&!!f,y=()=>{window.matchMedia("(max-width: 767px)").matches?s(N=>!N):o(N=>!N)},T=IT({onSwipeRight:()=>t(!0),onSwipeLeft:()=>s(!0),disabled:e||a});return u.jsxs("div",{className:"flex min-h-0 flex-1",...T,children:[u.jsx("div",{className:"hidden shrink-0 md:flex",children:u.jsx(C1,{})}),u.jsx(ah,{side:"left",open:e,onClose:()=>t(!1),children:u.jsx(C1,{onClose:()=>t(!1)})}),u.jsx(ah,{side:"right",open:a,onClose:()=>s(!1),children:u.jsx(N1,{todos:m,messages:h,sessionLinks:x,sessionId:f,onScrollToMessage:N=>{s(!1),setTimeout(()=>w1(N),300)}})}),u.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:u.jsx(kM,{onToggleSidebar:()=>t(N=>!N),onToggleRightPanel:y,rightPanelOpen:b})}),b&&u.jsx("div",{className:"hidden shrink-0 md:flex",children:u.jsx(N1,{todos:m,messages:h,sessionLinks:x,sessionId:f,onScrollToMessage:w1})})]})}const k1=/[#.]/g;function GM(e,t){const a=e||"",s={};let l=0,o,d;for(;l<a.length;){k1.lastIndex=l;const f=k1.exec(a),m=a.slice(l,f?f.index:a.length);m&&(o?o==="#"?s.id=m:Array.isArray(s.className)?s.className.push(m):s.className=[m]:d=m,l+=m.length),f&&(o=f[0],l++)}return{type:"element",tagName:d||t||"div",properties:s,children:[]}}function MT(e,t,a){const s=a?XM(a):void 0;function l(o,d,...f){let m;if(o==null){m={type:"root",children:[]};const h=d;f.unshift(h)}else{m=GM(o,t);const h=m.tagName.toLowerCase(),x=s?s.get(h):void 0;if(m.tagName=x||h,KM(d))f.unshift(d);else for(const[b,y]of Object.entries(d))VM(e,m.properties,b,y)}for(const h of f)sh(m.children,h);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return l}function KM(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,a=Object.keys(e);for(const s of a){const l=t[s];if(l&&typeof l=="object"){if(!Array.isArray(l))return!0;const o=l;for(const d of o)if(typeof d!="number"&&typeof d!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function VM(e,t,a,s){const l=Fc(e,a);let o;if(s!=null){if(typeof s=="number"){if(Number.isNaN(s))return;o=s}else typeof s=="boolean"?o=s:typeof s=="string"?l.spaceSeparated?o=xx(s):l.commaSeparated?o=mx(s):l.commaOrSpaceSeparated?o=xx(mx(s).join(" ")):o=R1(l,l.property,s):Array.isArray(s)?o=[...s]:o=l.property==="style"?QM(s):String(s);if(Array.isArray(o)){const d=[];for(const f of o)d.push(R1(l,l.property,f));o=d}l.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[l.property]=o}}function sh(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const a of t)sh(e,a);else if(typeof t=="object"&&"type"in t)t.type==="root"?sh(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function R1(e,t,a){if(typeof a=="string"){if(e.number&&a&&!Number.isNaN(Number(a)))return Number(a);if((e.boolean||e.overloadedBoolean)&&(a===""||go(a)===go(t)))return!0}return a}function QM(e){const t=[];for(const[a,s]of Object.entries(e))t.push([a,s].join(": "));return t.join("; ")}function XM(e){const t=new Map;for(const a of e)t.set(a.toLowerCase(),a);return t}const ZM=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],WM=MT(So,"div"),JM=MT(cs,"g",ZM);function eD(e){const t=String(e),a=[];return{toOffset:l,toPoint:s};function s(o){if(typeof o=="number"&&o>-1&&o<=t.length){let d=0;for(;;){let f=a[d];if(f===void 0){const m=O1(t,a[d-1]);f=m===-1?t.length+1:m+1,a[d]=f}if(f>o)return{line:d+1,column:o-(d>0?a[d-1]:0)+1,offset:o};d++}}}function l(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;a.length<o.line;){const f=a[a.length-1],m=O1(t,f),h=m===-1?t.length+1:m+1;if(f===h)break;a.push(h)}const d=(o.line>1?a[o.line-2]:0)+o.column-1;if(d<a[o.line-1])return d}}}function O1(e,t){const a=e.indexOf("\r",t),s=e.indexOf(`
445
- `,t);return s===-1?a:a===-1||a+1===s?s:a<s?a:s}const Bs={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},DT={}.hasOwnProperty,tD=Object.prototype;function nD(e,t){const a=t||{};return Vh({file:a.file||void 0,location:!1,schema:a.space==="svg"?cs:So,verbose:a.verbose||!1},e)}function Vh(e,t){let a;switch(t.nodeName){case"#comment":{const s=t;return a={type:"comment",value:s.data},uc(e,s,a),a}case"#document":case"#document-fragment":{const s=t,l="mode"in s?s.mode==="quirks"||s.mode==="limited-quirks":!1;if(a={type:"root",children:LT(e,t.childNodes),data:{quirksMode:l}},e.file&&e.location){const o=String(e.file),d=eD(o),f=d.toPoint(0),m=d.toPoint(o.length);a.position={start:f,end:m}}return a}case"#documentType":{const s=t;return a={type:"doctype"},uc(e,s,a),a}case"#text":{const s=t;return a={type:"text",value:s.value},uc(e,s,a),a}default:return a=aD(e,t),a}}function LT(e,t){let a=-1;const s=[];for(;++a<t.length;){const l=Vh(e,t[a]);s.push(l)}return s}function aD(e,t){const a=e.schema;e.schema=t.namespaceURI===Bs.svg?cs:So;let s=-1;const l={};for(;++s<t.attrs.length;){const f=t.attrs[s],m=(f.prefix?f.prefix+":":"")+f.name;DT.call(tD,m)||(l[m]=f.value)}const d=(e.schema.space==="svg"?JM:WM)(t.tagName,l,LT(e,t.childNodes));if(uc(e,t,d),d.tagName==="template"){const f=t,m=f.sourceCodeLocation,h=m&&m.startTag&&Li(m.startTag),x=m&&m.endTag&&Li(m.endTag),b=Vh(e,f.content);h&&x&&e.file&&(b.position={start:h.end,end:x.start}),d.content=b}return e.schema=a,d}function uc(e,t,a){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const s=rD(e,a,t.sourceCodeLocation);s&&(e.location=!0,a.position=s)}}function rD(e,t,a){const s=Li(a);if(t.type==="element"){const l=t.children[t.children.length-1];if(s&&!a.endTag&&l&&l.position&&l.position.end&&(s.end=Object.assign({},l.position.end)),e.verbose){const o={};let d;if(a.attrs)for(d in a.attrs)DT.call(a.attrs,d)&&(o[Fc(e.schema,d).property]=Li(a.attrs[d]));a.startTag;const f=Li(a.startTag),m=a.endTag?Li(a.endTag):void 0,h={opening:f};m&&(h.closing=m),h.properties=o,t.data={position:h}}}return s}function Li(e){const t=I1({line:e.startLine,column:e.startCol,offset:e.startOffset}),a=I1({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||a?{start:t,end:a}:void 0}function I1(e){return e.line&&e.column?e:void 0}const sD={},iD={}.hasOwnProperty,jT=qy("type",{handlers:{root:oD,element:mD,text:dD,comment:fD,doctype:cD}});function lD(e,t){const s=(t||sD).space;return jT(e,s==="svg"?cs:So)}function oD(e,t){const a={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return a.childNodes=Qh(e.children,a,t),Ki(e,a),a}function uD(e,t){const a={nodeName:"#document-fragment",childNodes:[]};return a.childNodes=Qh(e.children,a,t),Ki(e,a),a}function cD(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ki(e,t),t}function dD(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ki(e,t),t}function fD(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ki(e,t),t}function mD(e,t){const a=t;let s=a;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=cs);const l=[];let o;if(e.properties){for(o in e.properties)if(o!=="children"&&iD.call(e.properties,o)){const m=hD(s,o,e.properties[o]);m&&l.push(m)}}const d=s.space,f={nodeName:e.tagName,tagName:e.tagName,attrs:l,namespaceURI:Bs[d],childNodes:[],parentNode:null};return f.childNodes=Qh(e.children,f,s),Ki(e,f),e.tagName==="template"&&e.content&&(f.content=uD(e.content,s)),f}function hD(e,t,a){const s=Fc(e,t);if(a===!1||a===null||a===void 0||typeof a=="number"&&Number.isNaN(a)||!a&&s.boolean)return;Array.isArray(a)&&(a=s.commaSeparated?ny(a):cy(a));const l={name:s.attribute,value:a===!0?"":String(a)};if(s.space&&s.space!=="html"&&s.space!=="svg"){const o=l.name.indexOf(":");o<0?l.prefix="":(l.name=l.name.slice(o+1),l.prefix=s.attribute.slice(0,o)),l.namespace=Bs[s.space]}return l}function Qh(e,t,a){let s=-1;const l=[];if(e)for(;++s<e.length;){const o=jT(e[s],a);o.parentNode=t,l.push(o)}return l}function Ki(e,t){const a=e.position;a&&a.start&&a.end&&(a.start.offset,a.end.offset,t.sourceCodeLocation={startLine:a.start.line,startCol:a.start.column,startOffset:a.start.offset,endLine:a.end.line,endCol:a.end.column,endOffset:a.end.offset})}const pD=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],gD=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Pt="�";var I;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(I||(I={}));const Yn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function BT(e){return e>=55296&&e<=57343}function bD(e){return e>=56320&&e<=57343}function xD(e,t){return(e-55296)*1024+9216+t}function PT(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function UT(e){return e>=64976&&e<=65007||gD.has(e)}var oe;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(oe||(oe={}));const ED=65536;class yD{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=ED,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,a){const{line:s,col:l,offset:o}=this,d=l+a,f=o+a;return{code:t,startLine:s,endLine:s,startCol:d,endCol:d,startOffset:f,endOffset:f}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const a=this.html.charCodeAt(this.pos+1);if(bD(a))return this.pos++,this._addGap(),xD(t,a)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(oe.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,a){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=a}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,a){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(a)return this.html.startsWith(t,this.pos);for(let s=0;s<t.length;s++)if((this.html.charCodeAt(this.pos+s)|32)!==t.charCodeAt(s))return!1;return!0}peek(t){const a=this.pos+t;if(a>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;const s=this.html.charCodeAt(a);return s===I.CARRIAGE_RETURN?I.LINE_FEED:s}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let t=this.html.charCodeAt(this.pos);return t===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):t===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,BT(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===I.LINE_FEED||t===I.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){PT(t)?this._err(oe.controlCharacterInInputStream):UT(t)&&this._err(oe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var tt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(tt||(tt={}));function HT(e,t){for(let a=e.attrs.length-1;a>=0;a--)if(e.attrs[a].name===t)return e.attrs[a].value;return null}const TD=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),_D=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function ND(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=_D.get(e))!==null&&t!==void 0?t:e}var mn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(mn||(mn={}));const SD=32;var is;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(is||(is={}));function ih(e){return e>=mn.ZERO&&e<=mn.NINE}function vD(e){return e>=mn.UPPER_A&&e<=mn.UPPER_F||e>=mn.LOWER_A&&e<=mn.LOWER_F}function AD(e){return e>=mn.UPPER_A&&e<=mn.UPPER_Z||e>=mn.LOWER_A&&e<=mn.LOWER_Z||ih(e)}function CD(e){return e===mn.EQUALS||AD(e)}var fn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(fn||(fn={}));var _r;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(_r||(_r={}));class wD{constructor(t,a,s){this.decodeTree=t,this.emitCodePoint=a,this.errors=s,this.state=fn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=_r.Strict}startEntity(t){this.decodeMode=t,this.state=fn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,a){switch(this.state){case fn.EntityStart:return t.charCodeAt(a)===mn.NUM?(this.state=fn.NumericStart,this.consumed+=1,this.stateNumericStart(t,a+1)):(this.state=fn.NamedEntity,this.stateNamedEntity(t,a));case fn.NumericStart:return this.stateNumericStart(t,a);case fn.NumericDecimal:return this.stateNumericDecimal(t,a);case fn.NumericHex:return this.stateNumericHex(t,a);case fn.NamedEntity:return this.stateNamedEntity(t,a)}}stateNumericStart(t,a){return a>=t.length?-1:(t.charCodeAt(a)|SD)===mn.LOWER_X?(this.state=fn.NumericHex,this.consumed+=1,this.stateNumericHex(t,a+1)):(this.state=fn.NumericDecimal,this.stateNumericDecimal(t,a))}addToNumericResult(t,a,s,l){if(a!==s){const o=s-a;this.result=this.result*Math.pow(l,o)+Number.parseInt(t.substr(a,o),l),this.consumed+=o}}stateNumericHex(t,a){const s=a;for(;a<t.length;){const l=t.charCodeAt(a);if(ih(l)||vD(l))a+=1;else return this.addToNumericResult(t,s,a,16),this.emitNumericEntity(l,3)}return this.addToNumericResult(t,s,a,16),-1}stateNumericDecimal(t,a){const s=a;for(;a<t.length;){const l=t.charCodeAt(a);if(ih(l))a+=1;else return this.addToNumericResult(t,s,a,10),this.emitNumericEntity(l,2)}return this.addToNumericResult(t,s,a,10),-1}emitNumericEntity(t,a){var s;if(this.consumed<=a)return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===mn.SEMI)this.consumed+=1;else if(this.decodeMode===_r.Strict)return 0;return this.emitCodePoint(ND(this.result),this.consumed),this.errors&&(t!==mn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,a){const{decodeTree:s}=this;let l=s[this.treeIndex],o=(l&is.VALUE_LENGTH)>>14;for(;a<t.length;a++,this.excess++){const d=t.charCodeAt(a);if(this.treeIndex=kD(s,l,this.treeIndex+Math.max(1,o),d),this.treeIndex<0)return this.result===0||this.decodeMode===_r.Attribute&&(o===0||CD(d))?0:this.emitNotTerminatedNamedEntity();if(l=s[this.treeIndex],o=(l&is.VALUE_LENGTH)>>14,o!==0){if(d===mn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==_r.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:a,decodeTree:s}=this,l=(s[a]&is.VALUE_LENGTH)>>14;return this.emitNamedEntityData(a,l,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,a,s){const{decodeTree:l}=this;return this.emitCodePoint(a===1?l[t]&~is.VALUE_LENGTH:l[t+1],s),a===3&&this.emitCodePoint(l[t+2],s),s}end(){var t;switch(this.state){case fn.NamedEntity:return this.result!==0&&(this.decodeMode!==_r.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fn.NumericDecimal:return this.emitNumericEntity(0,2);case fn.NumericHex:return this.emitNumericEntity(0,3);case fn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fn.EntityStart:return 0}}}function kD(e,t,a,s){const l=(t&is.BRANCH_LENGTH)>>7,o=t&is.JUMP_TABLE;if(l===0)return o!==0&&s===o?a:-1;if(o){const m=s-o;return m<0||m>=l?-1:e[a+m]-1}let d=a,f=d+l-1;for(;d<=f;){const m=d+f>>>1,h=e[m];if(h<s)d=m+1;else if(h>s)f=m-1;else return e[m+l]}return-1}var be;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(be||(be={}));var Us;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Us||(Us={}));var Na;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Na||(Na={}));var J;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(J||(J={}));var E;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(E||(E={}));const RD=new Map([[J.A,E.A],[J.ADDRESS,E.ADDRESS],[J.ANNOTATION_XML,E.ANNOTATION_XML],[J.APPLET,E.APPLET],[J.AREA,E.AREA],[J.ARTICLE,E.ARTICLE],[J.ASIDE,E.ASIDE],[J.B,E.B],[J.BASE,E.BASE],[J.BASEFONT,E.BASEFONT],[J.BGSOUND,E.BGSOUND],[J.BIG,E.BIG],[J.BLOCKQUOTE,E.BLOCKQUOTE],[J.BODY,E.BODY],[J.BR,E.BR],[J.BUTTON,E.BUTTON],[J.CAPTION,E.CAPTION],[J.CENTER,E.CENTER],[J.CODE,E.CODE],[J.COL,E.COL],[J.COLGROUP,E.COLGROUP],[J.DD,E.DD],[J.DESC,E.DESC],[J.DETAILS,E.DETAILS],[J.DIALOG,E.DIALOG],[J.DIR,E.DIR],[J.DIV,E.DIV],[J.DL,E.DL],[J.DT,E.DT],[J.EM,E.EM],[J.EMBED,E.EMBED],[J.FIELDSET,E.FIELDSET],[J.FIGCAPTION,E.FIGCAPTION],[J.FIGURE,E.FIGURE],[J.FONT,E.FONT],[J.FOOTER,E.FOOTER],[J.FOREIGN_OBJECT,E.FOREIGN_OBJECT],[J.FORM,E.FORM],[J.FRAME,E.FRAME],[J.FRAMESET,E.FRAMESET],[J.H1,E.H1],[J.H2,E.H2],[J.H3,E.H3],[J.H4,E.H4],[J.H5,E.H5],[J.H6,E.H6],[J.HEAD,E.HEAD],[J.HEADER,E.HEADER],[J.HGROUP,E.HGROUP],[J.HR,E.HR],[J.HTML,E.HTML],[J.I,E.I],[J.IMG,E.IMG],[J.IMAGE,E.IMAGE],[J.INPUT,E.INPUT],[J.IFRAME,E.IFRAME],[J.KEYGEN,E.KEYGEN],[J.LABEL,E.LABEL],[J.LI,E.LI],[J.LINK,E.LINK],[J.LISTING,E.LISTING],[J.MAIN,E.MAIN],[J.MALIGNMARK,E.MALIGNMARK],[J.MARQUEE,E.MARQUEE],[J.MATH,E.MATH],[J.MENU,E.MENU],[J.META,E.META],[J.MGLYPH,E.MGLYPH],[J.MI,E.MI],[J.MO,E.MO],[J.MN,E.MN],[J.MS,E.MS],[J.MTEXT,E.MTEXT],[J.NAV,E.NAV],[J.NOBR,E.NOBR],[J.NOFRAMES,E.NOFRAMES],[J.NOEMBED,E.NOEMBED],[J.NOSCRIPT,E.NOSCRIPT],[J.OBJECT,E.OBJECT],[J.OL,E.OL],[J.OPTGROUP,E.OPTGROUP],[J.OPTION,E.OPTION],[J.P,E.P],[J.PARAM,E.PARAM],[J.PLAINTEXT,E.PLAINTEXT],[J.PRE,E.PRE],[J.RB,E.RB],[J.RP,E.RP],[J.RT,E.RT],[J.RTC,E.RTC],[J.RUBY,E.RUBY],[J.S,E.S],[J.SCRIPT,E.SCRIPT],[J.SEARCH,E.SEARCH],[J.SECTION,E.SECTION],[J.SELECT,E.SELECT],[J.SOURCE,E.SOURCE],[J.SMALL,E.SMALL],[J.SPAN,E.SPAN],[J.STRIKE,E.STRIKE],[J.STRONG,E.STRONG],[J.STYLE,E.STYLE],[J.SUB,E.SUB],[J.SUMMARY,E.SUMMARY],[J.SUP,E.SUP],[J.TABLE,E.TABLE],[J.TBODY,E.TBODY],[J.TEMPLATE,E.TEMPLATE],[J.TEXTAREA,E.TEXTAREA],[J.TFOOT,E.TFOOT],[J.TD,E.TD],[J.TH,E.TH],[J.THEAD,E.THEAD],[J.TITLE,E.TITLE],[J.TR,E.TR],[J.TRACK,E.TRACK],[J.TT,E.TT],[J.U,E.U],[J.UL,E.UL],[J.SVG,E.SVG],[J.VAR,E.VAR],[J.WBR,E.WBR],[J.XMP,E.XMP]]);function Vi(e){var t;return(t=RD.get(e))!==null&&t!==void 0?t:E.UNKNOWN}const xe=E,OD={[be.HTML]:new Set([xe.ADDRESS,xe.APPLET,xe.AREA,xe.ARTICLE,xe.ASIDE,xe.BASE,xe.BASEFONT,xe.BGSOUND,xe.BLOCKQUOTE,xe.BODY,xe.BR,xe.BUTTON,xe.CAPTION,xe.CENTER,xe.COL,xe.COLGROUP,xe.DD,xe.DETAILS,xe.DIR,xe.DIV,xe.DL,xe.DT,xe.EMBED,xe.FIELDSET,xe.FIGCAPTION,xe.FIGURE,xe.FOOTER,xe.FORM,xe.FRAME,xe.FRAMESET,xe.H1,xe.H2,xe.H3,xe.H4,xe.H5,xe.H6,xe.HEAD,xe.HEADER,xe.HGROUP,xe.HR,xe.HTML,xe.IFRAME,xe.IMG,xe.INPUT,xe.LI,xe.LINK,xe.LISTING,xe.MAIN,xe.MARQUEE,xe.MENU,xe.META,xe.NAV,xe.NOEMBED,xe.NOFRAMES,xe.NOSCRIPT,xe.OBJECT,xe.OL,xe.P,xe.PARAM,xe.PLAINTEXT,xe.PRE,xe.SCRIPT,xe.SECTION,xe.SELECT,xe.SOURCE,xe.STYLE,xe.SUMMARY,xe.TABLE,xe.TBODY,xe.TD,xe.TEMPLATE,xe.TEXTAREA,xe.TFOOT,xe.TH,xe.THEAD,xe.TITLE,xe.TR,xe.TRACK,xe.UL,xe.WBR,xe.XMP]),[be.MATHML]:new Set([xe.MI,xe.MO,xe.MN,xe.MS,xe.MTEXT,xe.ANNOTATION_XML]),[be.SVG]:new Set([xe.TITLE,xe.FOREIGN_OBJECT,xe.DESC]),[be.XLINK]:new Set,[be.XML]:new Set,[be.XMLNS]:new Set},lh=new Set([xe.H1,xe.H2,xe.H3,xe.H4,xe.H5,xe.H6]);J.STYLE,J.SCRIPT,J.XMP,J.IFRAME,J.NOEMBED,J.NOFRAMES,J.PLAINTEXT;var j;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(j||(j={}));const Xt={DATA:j.DATA,RCDATA:j.RCDATA,RAWTEXT:j.RAWTEXT,SCRIPT_DATA:j.SCRIPT_DATA,PLAINTEXT:j.PLAINTEXT,CDATA_SECTION:j.CDATA_SECTION};function ID(e){return e>=I.DIGIT_0&&e<=I.DIGIT_9}function eo(e){return e>=I.LATIN_CAPITAL_A&&e<=I.LATIN_CAPITAL_Z}function MD(e){return e>=I.LATIN_SMALL_A&&e<=I.LATIN_SMALL_Z}function as(e){return MD(e)||eo(e)}function M1(e){return as(e)||ID(e)}function rc(e){return e+32}function FT(e){return e===I.SPACE||e===I.LINE_FEED||e===I.TABULATION||e===I.FORM_FEED}function D1(e){return FT(e)||e===I.SOLIDUS||e===I.GREATER_THAN_SIGN}function DD(e){return e===I.NULL?oe.nullCharacterReference:e>1114111?oe.characterReferenceOutsideUnicodeRange:BT(e)?oe.surrogateCharacterReference:UT(e)?oe.noncharacterCharacterReference:PT(e)||e===I.CARRIAGE_RETURN?oe.controlCharacterReference:null}class LD{constructor(t,a){this.options=t,this.handler=a,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=j.DATA,this.returnState=j.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new yD(a),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new wD(TD,(s,l)=>{this.preprocessor.pos=this.entityStartPos+l-1,this._flushCodePointConsumedAsCharacterReference(s)},a.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(oe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:s=>{this._err(oe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+s)},validateNumericCharacterReference:s=>{const l=DD(s);l&&this._err(l,1)}}:void 0)}_err(t,a=0){var s,l;(l=(s=this.handler).onParseError)===null||l===void 0||l.call(s,this.preprocessor.getError(t,a))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,a,s){this.active=!0,this.preprocessor.write(t,a),this._runParsingLoop(),this.paused||s==null||s()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let a=0;a<t;a++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,a){return this.preprocessor.startsWith(t,a)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:tt.START_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:tt.END_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:tt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:tt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,a){this.currentCharacterToken={type:t,chars:a,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,a;const s=this.currentToken;if(HT(s,this.currentAttr.name)===null){if(s.attrs.push(this.currentAttr),s.location&&this.currentLocation){const l=(t=(a=s.location).attrs)!==null&&t!==void 0?t:a.attrs=Object.create(null);l[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(oe.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Vi(t.tagName),t.type===tt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(oe.endTagWithAttributes),t.selfClosing&&this._err(oe.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case tt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case tt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case tt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:tt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,a){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=a;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,a)}_emitCodePoint(t){const a=FT(t)?tt.WHITESPACE_CHARACTER:t===I.NULL?tt.NULL_CHARACTER:tt.CHARACTER;this._appendCharToCurrentCharacterToken(a,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(tt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=j.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?_r.Attribute:_r.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===j.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case j.DATA:{this._stateData(t);break}case j.RCDATA:{this._stateRcdata(t);break}case j.RAWTEXT:{this._stateRawtext(t);break}case j.SCRIPT_DATA:{this._stateScriptData(t);break}case j.PLAINTEXT:{this._statePlaintext(t);break}case j.TAG_OPEN:{this._stateTagOpen(t);break}case j.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case j.TAG_NAME:{this._stateTagName(t);break}case j.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case j.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case j.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case j.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case j.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case j.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case j.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case j.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case j.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case j.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case j.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case j.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case j.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case j.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case j.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case j.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case j.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case j.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case j.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case j.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case j.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case j.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case j.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case j.BOGUS_COMMENT:{this._stateBogusComment(t);break}case j.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case j.COMMENT_START:{this._stateCommentStart(t);break}case j.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case j.COMMENT:{this._stateComment(t);break}case j.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case j.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case j.COMMENT_END:{this._stateCommentEnd(t);break}case j.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case j.DOCTYPE:{this._stateDoctype(t);break}case j.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case j.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case j.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case j.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case j.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case j.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case j.CDATA_SECTION:{this._stateCdataSection(t);break}case j.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case j.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case j.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case j.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=j.TAG_OPEN;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitCodePoint(t);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case I.AMPERSAND:{this._startCharacterReference();break}case I.LESS_THAN_SIGN:{this.state=j.RCDATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case I.LESS_THAN_SIGN:{this.state=j.RAWTEXT_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(as(t))this._createStartTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case I.EXCLAMATION_MARK:{this.state=j.MARKUP_DECLARATION_OPEN;break}case I.SOLIDUS:{this.state=j.END_TAG_OPEN;break}case I.QUESTION_MARK:{this._err(oe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t);break}case I.EOF:{this._err(oe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(oe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=j.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(as(t))this._createEndTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case I.GREATER_THAN_SIGN:{this._err(oe.missingEndTagName),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(oe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.tagName+=Pt;break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:a.tagName+=String.fromCodePoint(eo(t)?rc(t):t)}}_stateRcdataLessThanSign(t){t===I.SOLIDUS?this.state=j.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){as(t)?(this.state=j.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=j.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const a=this.currentToken;switch(a.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=j.BEFORE_ATTRIBUTE_NAME,!1;case I.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=j.SELF_CLOSING_START_TAG,!1;case I.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=j.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===I.SOLIDUS?this.state=j.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){as(t)?(this.state=j.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case I.SOLIDUS:{this.state=j.SCRIPT_DATA_END_TAG_OPEN;break}case I.EXCLAMATION_MARK:{this.state=j.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=j.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){as(t)?(this.state=j.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===I.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===I.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===I.SOLIDUS?this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:as(t)?(this._emitChars("<"),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){as(t)?(this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Yn.SCRIPT,!1)&&D1(this.preprocessor.peek(Yn.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<Yn.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===I.SOLIDUS?(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Yn.SCRIPT,!1)&&D1(this.preprocessor.peek(Yn.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<Yn.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this.state=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._err(oe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=j.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=j.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this._leaveAttrName(),this.state=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._leaveAttrName(),this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:{this._err(oe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.currentAttr.name+=Pt;break}default:this.currentAttr.name+=String.fromCodePoint(eo(t)?rc(t):t)}}_stateAfterAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case I.EQUALS_SIGN:{this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=j.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{this.state=j.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this.state=j.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingAttributeValue),this.state=j.DATA,this.emitCurrentTagToken();break}default:this.state=j.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case I.QUOTATION_MARK:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.currentAttr.value+=Pt;break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case I.APOSTROPHE:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.currentAttr.value+=Pt;break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=j.BEFORE_ATTRIBUTE_NAME;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.currentAttr.value+=Pt;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:case I.EQUALS_SIGN:case I.GRAVE_ACCENT:{this._err(oe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=j.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this._leaveAttrValue(),this.state=j.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this._err(oe.missingWhitespaceBetweenAttributes),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case I.GREATER_THAN_SIGN:{const a=this.currentToken;a.selfClosing=!0,this.state=j.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this._err(oe.unexpectedSolidusInTag),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const a=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(a);break}case I.EOF:{this.emitCurrentComment(a),this._emitEOFToken();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.data+=Pt;break}default:a.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Yn.DASH_DASH,!0)?(this._createCommentToken(Yn.DASH_DASH.length+1),this.state=j.COMMENT_START):this._consumeSequenceIfMatch(Yn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Yn.DOCTYPE.length+1),this.state=j.DOCTYPE):this._consumeSequenceIfMatch(Yn.CDATA_START,!0)?this.inForeignNode?this.state=j.CDATA_SECTION:(this._err(oe.cdataInHtmlContent),this._createCommentToken(Yn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=j.BOGUS_COMMENT):this._ensureHibernation()||(this._err(oe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.COMMENT_START_DASH;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptClosingOfEmptyComment),this.state=j.DATA;const a=this.currentToken;this.emitCurrentComment(a);break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const a=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptClosingOfEmptyComment),this.state=j.DATA,this.emitCurrentComment(a);break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateComment(t){const a=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=j.COMMENT_END_DASH;break}case I.LESS_THAN_SIGN:{a.data+="<",this.state=j.COMMENT_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.data+=Pt;break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const a=this.currentToken;switch(t){case I.EXCLAMATION_MARK:{a.data+="!",this.state=j.COMMENT_LESS_THAN_SIGN_BANG;break}case I.LESS_THAN_SIGN:{a.data+="<";break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===I.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=j.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===I.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=j.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==I.GREATER_THAN_SIGN&&t!==I.EOF&&this._err(oe.nestedComment),this.state=j.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const a=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const a=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(a);break}case I.EXCLAMATION_MARK:{this.state=j.COMMENT_END_BANG;break}case I.HYPHEN_MINUS:{a.data+="-";break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const a=this.currentToken;switch(t){case I.HYPHEN_MINUS:{a.data+="--!",this.state=j.COMMENT_END_DASH;break}case I.GREATER_THAN_SIGN:{this._err(oe.incorrectlyClosedComment),this.state=j.DATA,this.emitCurrentComment(a);break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--!",this.state=j.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case I.EOF:{this._err(oe.eofInDoctype),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingWhitespaceBeforeDoctypeName),this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(eo(t))this._createDoctypeToken(String.fromCharCode(rc(t))),this.state=j.DOCTYPE_NAME;else switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.NULL:{this._err(oe.unexpectedNullCharacter),this._createDoctypeToken(Pt),this.state=j.DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypeName),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=j.DOCTYPE_NAME}}_stateDoctypeName(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.AFTER_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.name+=Pt;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.name+=String.fromCodePoint(eo(t)?rc(t):t)}}_stateAfterDoctypeName(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Yn.PUBLIC,!1)?this.state=j.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Yn.SYSTEM,!1)?this.state=j.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(oe.invalidCharacterSequenceAfterDoctypeName),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(oe.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(oe.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{a.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{a.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.publicId+=Pt;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const a=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.publicId+=Pt;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.QUOTATION_MARK:{this._err(oe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(oe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.QUOTATION_MARK:{a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(oe.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(oe.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.systemId+=Pt;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const a=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.systemId+=Pt;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const a=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.NULL:{this._err(oe.unexpectedNullCharacter);break}case I.EOF:{this.emitCurrentDoctype(a),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case I.RIGHT_SQUARE_BRACKET:{this.state=j.CDATA_SECTION_BRACKET;break}case I.EOF:{this._err(oe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===I.RIGHT_SQUARE_BRACKET?this.state=j.CDATA_SECTION_END:(this._emitChars("]"),this.state=j.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case I.GREATER_THAN_SIGN:{this.state=j.DATA;break}case I.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=j.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(I.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&M1(this.preprocessor.peek(1))?j.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){M1(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===I.SEMICOLON&&this._err(oe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const zT=new Set([E.DD,E.DT,E.LI,E.OPTGROUP,E.OPTION,E.P,E.RB,E.RP,E.RT,E.RTC]),L1=new Set([...zT,E.CAPTION,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]),Cc=new Set([E.APPLET,E.CAPTION,E.HTML,E.MARQUEE,E.OBJECT,E.TABLE,E.TD,E.TEMPLATE,E.TH]),jD=new Set([...Cc,E.OL,E.UL]),BD=new Set([...Cc,E.BUTTON]),j1=new Set([E.ANNOTATION_XML,E.MI,E.MN,E.MO,E.MS,E.MTEXT]),B1=new Set([E.DESC,E.FOREIGN_OBJECT,E.TITLE]),PD=new Set([E.TR,E.TEMPLATE,E.HTML]),UD=new Set([E.TBODY,E.TFOOT,E.THEAD,E.TEMPLATE,E.HTML]),HD=new Set([E.TABLE,E.TEMPLATE,E.HTML]),FD=new Set([E.TD,E.TH]);class zD{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,a,s){this.treeAdapter=a,this.handler=s,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=E.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===E.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===be.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,a){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=a,this.currentTagId=a,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,a,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,a){const s=this._indexOf(t);this.items[s]=a,s===this.stackTop&&(this.current=a)}insertAfter(t,a,s){const l=this._indexOf(t)+1;this.items.splice(l,0,a),this.tagIDs.splice(l,0,s),this.stackTop++,l===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,l===this.stackTop)}popUntilTagNamePopped(t){let a=this.stackTop+1;do a=this.tagIDs.lastIndexOf(t,a-1);while(a>0&&this.treeAdapter.getNamespaceURI(this.items[a])!==be.HTML);this.shortenToLength(Math.max(a,0))}shortenToLength(t){for(;this.stackTop>=t;){const a=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(a,this.stackTop<t)}}popUntilElementPopped(t){const a=this._indexOf(t);this.shortenToLength(Math.max(a,0))}popUntilPopped(t,a){const s=this._indexOfTagNames(t,a);this.shortenToLength(Math.max(s,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(lh,be.HTML)}popUntilTableCellPopped(){this.popUntilPopped(FD,be.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,a){for(let s=this.stackTop;s>=0;s--)if(t.has(this.tagIDs[s])&&this.treeAdapter.getNamespaceURI(this.items[s])===a)return s;return-1}clearBackTo(t,a){const s=this._indexOfTagNames(t,a);this.shortenToLength(s+1)}clearBackToTableContext(){this.clearBackTo(HD,be.HTML)}clearBackToTableBodyContext(){this.clearBackTo(UD,be.HTML)}clearBackToTableRowContext(){this.clearBackTo(PD,be.HTML)}remove(t){const a=this._indexOf(t);a>=0&&(a===this.stackTop?this.pop():(this.items.splice(a,1),this.tagIDs.splice(a,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===E.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const a=this._indexOf(t)-1;return a>=0?this.items[a]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===E.HTML}hasInDynamicScope(t,a){for(let s=this.stackTop;s>=0;s--){const l=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case be.HTML:{if(l===t)return!0;if(a.has(l))return!1;break}case be.SVG:{if(B1.has(l))return!1;break}case be.MATHML:{if(j1.has(l))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Cc)}hasInListItemScope(t){return this.hasInDynamicScope(t,jD)}hasInButtonScope(t){return this.hasInDynamicScope(t,BD)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const a=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case be.HTML:{if(lh.has(a))return!0;if(Cc.has(a))return!1;break}case be.SVG:{if(B1.has(a))return!1;break}case be.MATHML:{if(j1.has(a))return!1;break}}}return!0}hasInTableScope(t){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===be.HTML)switch(this.tagIDs[a]){case t:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===be.HTML)switch(this.tagIDs[t]){case E.TBODY:case E.THEAD:case E.TFOOT:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasInSelectScope(t){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===be.HTML)switch(this.tagIDs[a]){case t:return!0;case E.OPTION:case E.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&zT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&L1.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&L1.has(this.currentTagId);)this.pop()}}const Lm=3;var Ka;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ka||(Ka={}));const P1={type:Ka.Marker};class qD{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,a){const s=[],l=a.length,o=this.treeAdapter.getTagName(t),d=this.treeAdapter.getNamespaceURI(t);for(let f=0;f<this.entries.length;f++){const m=this.entries[f];if(m.type===Ka.Marker)break;const{element:h}=m;if(this.treeAdapter.getTagName(h)===o&&this.treeAdapter.getNamespaceURI(h)===d){const x=this.treeAdapter.getAttrList(h);x.length===l&&s.push({idx:f,attrs:x})}}return s}_ensureNoahArkCondition(t){if(this.entries.length<Lm)return;const a=this.treeAdapter.getAttrList(t),s=this._getNoahArkConditionCandidates(t,a);if(s.length<Lm)return;const l=new Map(a.map(d=>[d.name,d.value]));let o=0;for(let d=0;d<s.length;d++){const f=s[d];f.attrs.every(m=>l.get(m.name)===m.value)&&(o+=1,o>=Lm&&this.entries.splice(f.idx,1))}}insertMarker(){this.entries.unshift(P1)}pushElement(t,a){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ka.Element,element:t,token:a})}insertElementAfterBookmark(t,a){const s=this.entries.indexOf(this.bookmark);this.entries.splice(s,0,{type:Ka.Element,element:t,token:a})}removeEntry(t){const a=this.entries.indexOf(t);a!==-1&&this.entries.splice(a,1)}clearToLastMarker(){const t=this.entries.indexOf(P1);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const a=this.entries.find(s=>s.type===Ka.Marker||this.treeAdapter.getTagName(s.element)===t);return a&&a.type===Ka.Element?a:null}getElementEntry(t){return this.entries.find(a=>a.type===Ka.Element&&a.element===t)}}const rs={createDocument(){return{nodeName:"#document",mode:Na.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,a){return{nodeName:e,tagName:e,attrs:a,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,a){const s=e.childNodes.indexOf(a);e.childNodes.splice(s,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,a,s){const l=e.childNodes.find(o=>o.nodeName==="#documentType");if(l)l.name=t,l.publicId=a,l.systemId=s;else{const o={nodeName:"#documentType",name:t,publicId:a,systemId:s,parentNode:null};rs.appendChild(e,o)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const a=e.childNodes[e.childNodes.length-1];if(rs.isTextNode(a)){a.value+=t;return}}rs.appendChild(e,rs.createTextNode(t))},insertTextBefore(e,t,a){const s=e.childNodes[e.childNodes.indexOf(a)-1];s&&rs.isTextNode(s)?s.value+=t:rs.insertBefore(e,rs.createTextNode(t),a)},adoptAttributes(e,t){const a=new Set(e.attrs.map(s=>s.name));for(let s=0;s<t.length;s++)a.has(t[s].name)||e.attrs.push(t[s])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},qT="html",YD="about:legacy-compat",$D="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",YT=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],GD=[...YT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],KD=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),$T=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],VD=[...$T,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function U1(e,t){return t.some(a=>e.startsWith(a))}function QD(e){return e.name===qT&&e.publicId===null&&(e.systemId===null||e.systemId===YD)}function XD(e){if(e.name!==qT)return Na.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===$D)return Na.QUIRKS;let{publicId:a}=e;if(a!==null){if(a=a.toLowerCase(),KD.has(a))return Na.QUIRKS;let s=t===null?GD:YT;if(U1(a,s))return Na.QUIRKS;if(s=t===null?$T:VD,U1(a,s))return Na.LIMITED_QUIRKS}return Na.NO_QUIRKS}const H1={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},ZD="definitionurl",WD="definitionURL",JD=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),eL=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:be.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:be.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:be.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:be.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:be.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:be.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:be.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:be.XML}],["xml:space",{prefix:"xml",name:"space",namespace:be.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:be.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:be.XMLNS}]]),tL=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),nL=new Set([E.B,E.BIG,E.BLOCKQUOTE,E.BODY,E.BR,E.CENTER,E.CODE,E.DD,E.DIV,E.DL,E.DT,E.EM,E.EMBED,E.H1,E.H2,E.H3,E.H4,E.H5,E.H6,E.HEAD,E.HR,E.I,E.IMG,E.LI,E.LISTING,E.MENU,E.META,E.NOBR,E.OL,E.P,E.PRE,E.RUBY,E.S,E.SMALL,E.SPAN,E.STRONG,E.STRIKE,E.SUB,E.SUP,E.TABLE,E.TT,E.U,E.UL,E.VAR]);function aL(e){const t=e.tagID;return t===E.FONT&&e.attrs.some(({name:s})=>s===Us.COLOR||s===Us.SIZE||s===Us.FACE)||nL.has(t)}function GT(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===ZD){e.attrs[t].name=WD;break}}function KT(e){for(let t=0;t<e.attrs.length;t++){const a=JD.get(e.attrs[t].name);a!=null&&(e.attrs[t].name=a)}}function Xh(e){for(let t=0;t<e.attrs.length;t++){const a=eL.get(e.attrs[t].name);a&&(e.attrs[t].prefix=a.prefix,e.attrs[t].name=a.name,e.attrs[t].namespace=a.namespace)}}function rL(e){const t=tL.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Vi(e.tagName))}function sL(e,t){return t===be.MATHML&&(e===E.MI||e===E.MO||e===E.MN||e===E.MS||e===E.MTEXT)}function iL(e,t,a){if(t===be.MATHML&&e===E.ANNOTATION_XML){for(let s=0;s<a.length;s++)if(a[s].name===Us.ENCODING){const l=a[s].value.toLowerCase();return l===H1.TEXT_HTML||l===H1.APPLICATION_XML}}return t===be.SVG&&(e===E.FOREIGN_OBJECT||e===E.DESC||e===E.TITLE)}function lL(e,t,a,s){return(!s||s===be.HTML)&&iL(e,t,a)||(!s||s===be.MATHML)&&sL(e,t)}const oL="hidden",uL=8,cL=3;var F;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(F||(F={}));const dL={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},VT=new Set([E.TABLE,E.TBODY,E.TFOOT,E.THEAD,E.TR]),F1={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:rs,onParseError:null};class z1{constructor(t,a,s=null,l=null){this.fragmentContext=s,this.scriptHandler=l,this.currentToken=null,this.stopped=!1,this.insertionMode=F.INITIAL,this.originalInsertionMode=F.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...F1,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=a??this.treeAdapter.createDocument(),this.tokenizer=new LD(this.options,this),this.activeFormattingElements=new qD(this.treeAdapter),this.fragmentContextID=s?Vi(this.treeAdapter.getTagName(s)):E.UNKNOWN,this._setContextModes(s??this.document,this.fragmentContextID),this.openElements=new zD(this.document,this.treeAdapter,this)}static parse(t,a){const s=new this(a);return s.tokenizer.write(t,!0),s.document}static getFragmentParser(t,a){const s={...F1,...a};t??(t=s.treeAdapter.createElement(J.TEMPLATE,be.HTML,[]));const l=s.treeAdapter.createElement("documentmock",be.HTML,[]),o=new this(s,l,t);return o.fragmentContextID===E.TEMPLATE&&o.tmplInsertionModeStack.unshift(F.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),a=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,a),a}_err(t,a,s){var l;if(!this.onParseError)return;const o=(l=t.location)!==null&&l!==void 0?l:dL,d={code:a,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:s?o.startLine:o.endLine,endCol:s?o.startCol:o.endCol,endOffset:s?o.startOffset:o.endOffset};this.onParseError(d)}onItemPush(t,a,s){var l,o;(o=(l=this.treeAdapter).onItemPush)===null||o===void 0||o.call(l,t),s&&this.openElements.stackTop>0&&this._setContextModes(t,a)}onItemPop(t,a){var s,l;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(l=(s=this.treeAdapter).onItemPop)===null||l===void 0||l.call(s,t,this.openElements.current),a){let o,d;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,d=this.fragmentContextID):{current:o,currentTagId:d}=this.openElements,this._setContextModes(o,d)}}_setContextModes(t,a){const s=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===be.HTML;this.currentNotInHTML=!s,this.tokenizer.inForeignNode=!s&&t!==void 0&&a!==void 0&&!this._isIntegrationPoint(a,t)}_switchToTextParsing(t,a){this._insertElement(t,be.HTML),this.tokenizer.state=a,this.originalInsertionMode=this.insertionMode,this.insertionMode=F.TEXT}switchToPlaintextParsing(){this.insertionMode=F.TEXT,this.originalInsertionMode=F.IN_BODY,this.tokenizer.state=Xt.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===J.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==be.HTML))switch(this.fragmentContextID){case E.TITLE:case E.TEXTAREA:{this.tokenizer.state=Xt.RCDATA;break}case E.STYLE:case E.XMP:case E.IFRAME:case E.NOEMBED:case E.NOFRAMES:case E.NOSCRIPT:{this.tokenizer.state=Xt.RAWTEXT;break}case E.SCRIPT:{this.tokenizer.state=Xt.SCRIPT_DATA;break}case E.PLAINTEXT:{this.tokenizer.state=Xt.PLAINTEXT;break}}}_setDocumentType(t){const a=t.name||"",s=t.publicId||"",l=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,a,s,l),t.location){const d=this.treeAdapter.getChildNodes(this.document).find(f=>this.treeAdapter.isDocumentTypeNode(f));d&&this.treeAdapter.setNodeSourceCodeLocation(d,t.location)}}_attachElementToTree(t,a){if(this.options.sourceCodeLocationInfo){const s=a&&{...a,startTag:a};this.treeAdapter.setNodeSourceCodeLocation(t,s)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const s=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(s??this.document,t)}}_appendElement(t,a){const s=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(s,t.location)}_insertElement(t,a){const s=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(s,t.location),this.openElements.push(s,t.tagID)}_insertFakeElement(t,a){const s=this.treeAdapter.createElement(t,be.HTML,[]);this._attachElementToTree(s,null),this.openElements.push(s,a)}_insertTemplate(t){const a=this.treeAdapter.createElement(t.tagName,be.HTML,t.attrs),s=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(a,s),this._attachElementToTree(a,t.location),this.openElements.push(a,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(J.HTML,be.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,E.HTML)}_appendCommentNode(t,a){const s=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(a,s),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_insertCharacters(t){let a,s;if(this._shouldFosterParentOnInsertion()?({parent:a,beforeElement:s}=this._findFosterParentingLocation(),s?this.treeAdapter.insertTextBefore(a,t.chars,s):this.treeAdapter.insertText(a,t.chars)):(a=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(a,t.chars)),!t.location)return;const l=this.treeAdapter.getChildNodes(a),o=s?l.lastIndexOf(s):l.length,d=l[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(d)){const{endLine:m,endCol:h,endOffset:x}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(d,{endLine:m,endCol:h,endOffset:x})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(d,t.location)}_adoptNodes(t,a){for(let s=this.treeAdapter.getFirstChild(t);s;s=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(s),this.treeAdapter.appendChild(a,s)}_setEndLocation(t,a){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&a.location){const s=a.location,l=this.treeAdapter.getTagName(t),o=a.type===tt.END_TAG&&l===a.tagName?{endTag:{...s},endLine:s.endLine,endCol:s.endCol,endOffset:s.endOffset}:{endLine:s.startLine,endCol:s.startCol,endOffset:s.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,o)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let a,s;return this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,t.tagID===E.SVG&&this.treeAdapter.getTagName(a)===J.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(a)===be.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===E.MGLYPH||t.tagID===E.MALIGNMARK)&&s!==void 0&&!this._isIntegrationPoint(s,a,be.HTML)}_processToken(t){switch(t.type){case tt.CHARACTER:{this.onCharacter(t);break}case tt.NULL_CHARACTER:{this.onNullCharacter(t);break}case tt.COMMENT:{this.onComment(t);break}case tt.DOCTYPE:{this.onDoctype(t);break}case tt.START_TAG:{this._processStartTag(t);break}case tt.END_TAG:{this.onEndTag(t);break}case tt.EOF:{this.onEof(t);break}case tt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,a,s){const l=this.treeAdapter.getNamespaceURI(a),o=this.treeAdapter.getAttrList(a);return lL(t,l,o,s)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const a=this.activeFormattingElements.entries.findIndex(l=>l.type===Ka.Marker||this.openElements.contains(l.element)),s=a===-1?t-1:a-1;for(let l=s;l>=0;l--){const o=this.activeFormattingElements.entries[l];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=F.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(E.P),this.openElements.popUntilTagNamePopped(E.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case E.TR:{this.insertionMode=F.IN_ROW;return}case E.TBODY:case E.THEAD:case E.TFOOT:{this.insertionMode=F.IN_TABLE_BODY;return}case E.CAPTION:{this.insertionMode=F.IN_CAPTION;return}case E.COLGROUP:{this.insertionMode=F.IN_COLUMN_GROUP;return}case E.TABLE:{this.insertionMode=F.IN_TABLE;return}case E.BODY:{this.insertionMode=F.IN_BODY;return}case E.FRAMESET:{this.insertionMode=F.IN_FRAMESET;return}case E.SELECT:{this._resetInsertionModeForSelect(t);return}case E.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case E.HTML:{this.insertionMode=this.headElement?F.AFTER_HEAD:F.BEFORE_HEAD;return}case E.TD:case E.TH:{if(t>0){this.insertionMode=F.IN_CELL;return}break}case E.HEAD:{if(t>0){this.insertionMode=F.IN_HEAD;return}break}}this.insertionMode=F.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let a=t-1;a>0;a--){const s=this.openElements.tagIDs[a];if(s===E.TEMPLATE)break;if(s===E.TABLE){this.insertionMode=F.IN_SELECT_IN_TABLE;return}}this.insertionMode=F.IN_SELECT}_isElementCausesFosterParenting(t){return VT.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const a=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case E.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(a)===be.HTML)return{parent:this.treeAdapter.getTemplateContent(a),beforeElement:null};break}case E.TABLE:{const s=this.treeAdapter.getParentNode(a);return s?{parent:s,beforeElement:a}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const a=this._findFosterParentingLocation();a.beforeElement?this.treeAdapter.insertBefore(a.parent,t,a.beforeElement):this.treeAdapter.appendChild(a.parent,t)}_isSpecialElement(t,a){const s=this.treeAdapter.getNamespaceURI(t);return OD[s].has(a)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){F8(this,t);return}switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{ro(this,t);break}case F.BEFORE_HEAD:{so(this,t);break}case F.IN_HEAD:{io(this,t);break}case F.IN_HEAD_NO_SCRIPT:{lo(this,t);break}case F.AFTER_HEAD:{oo(this,t);break}case F.IN_BODY:case F.IN_CAPTION:case F.IN_CELL:case F.IN_TEMPLATE:{XT(this,t);break}case F.TEXT:case F.IN_SELECT:case F.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case F.IN_TABLE:case F.IN_TABLE_BODY:case F.IN_ROW:{jm(this,t);break}case F.IN_TABLE_TEXT:{n_(this,t);break}case F.IN_COLUMN_GROUP:{wc(this,t);break}case F.AFTER_BODY:{kc(this,t);break}case F.AFTER_AFTER_BODY:{cc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){H8(this,t);return}switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{ro(this,t);break}case F.BEFORE_HEAD:{so(this,t);break}case F.IN_HEAD:{io(this,t);break}case F.IN_HEAD_NO_SCRIPT:{lo(this,t);break}case F.AFTER_HEAD:{oo(this,t);break}case F.TEXT:{this._insertCharacters(t);break}case F.IN_TABLE:case F.IN_TABLE_BODY:case F.IN_ROW:{jm(this,t);break}case F.IN_COLUMN_GROUP:{wc(this,t);break}case F.AFTER_BODY:{kc(this,t);break}case F.AFTER_AFTER_BODY:{cc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){oh(this,t);return}switch(this.insertionMode){case F.INITIAL:case F.BEFORE_HTML:case F.BEFORE_HEAD:case F.IN_HEAD:case F.IN_HEAD_NO_SCRIPT:case F.AFTER_HEAD:case F.IN_BODY:case F.IN_TABLE:case F.IN_CAPTION:case F.IN_COLUMN_GROUP:case F.IN_TABLE_BODY:case F.IN_ROW:case F.IN_CELL:case F.IN_SELECT:case F.IN_SELECT_IN_TABLE:case F.IN_TEMPLATE:case F.IN_FRAMESET:case F.AFTER_FRAMESET:{oh(this,t);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}case F.AFTER_BODY:{xL(this,t);break}case F.AFTER_AFTER_BODY:case F.AFTER_AFTER_FRAMESET:{EL(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case F.INITIAL:{yL(this,t);break}case F.BEFORE_HEAD:case F.IN_HEAD:case F.IN_HEAD_NO_SCRIPT:case F.AFTER_HEAD:{this._err(t,oe.misplacedDoctype);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,oe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?z8(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{TL(this,t);break}case F.BEFORE_HEAD:{NL(this,t);break}case F.IN_HEAD:{La(this,t);break}case F.IN_HEAD_NO_SCRIPT:{AL(this,t);break}case F.AFTER_HEAD:{wL(this,t);break}case F.IN_BODY:{An(this,t);break}case F.IN_TABLE:{Hi(this,t);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}case F.IN_CAPTION:{S8(this,t);break}case F.IN_COLUMN_GROUP:{Jh(this,t);break}case F.IN_TABLE_BODY:{Qc(this,t);break}case F.IN_ROW:{Xc(this,t);break}case F.IN_CELL:{C8(this,t);break}case F.IN_SELECT:{s_(this,t);break}case F.IN_SELECT_IN_TABLE:{k8(this,t);break}case F.IN_TEMPLATE:{O8(this,t);break}case F.AFTER_BODY:{M8(this,t);break}case F.IN_FRAMESET:{D8(this,t);break}case F.AFTER_FRAMESET:{j8(this,t);break}case F.AFTER_AFTER_BODY:{P8(this,t);break}case F.AFTER_AFTER_FRAMESET:{U8(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?q8(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{_L(this,t);break}case F.BEFORE_HEAD:{SL(this,t);break}case F.IN_HEAD:{vL(this,t);break}case F.IN_HEAD_NO_SCRIPT:{CL(this,t);break}case F.AFTER_HEAD:{kL(this,t);break}case F.IN_BODY:{Vc(this,t);break}case F.TEXT:{h8(this,t);break}case F.IN_TABLE:{Eo(this,t);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}case F.IN_CAPTION:{v8(this,t);break}case F.IN_COLUMN_GROUP:{A8(this,t);break}case F.IN_TABLE_BODY:{uh(this,t);break}case F.IN_ROW:{r_(this,t);break}case F.IN_CELL:{w8(this,t);break}case F.IN_SELECT:{i_(this,t);break}case F.IN_SELECT_IN_TABLE:{R8(this,t);break}case F.IN_TEMPLATE:{I8(this,t);break}case F.AFTER_BODY:{o_(this,t);break}case F.IN_FRAMESET:{L8(this,t);break}case F.AFTER_FRAMESET:{B8(this,t);break}case F.AFTER_AFTER_BODY:{cc(this,t);break}}}onEof(t){switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{ro(this,t);break}case F.BEFORE_HEAD:{so(this,t);break}case F.IN_HEAD:{io(this,t);break}case F.IN_HEAD_NO_SCRIPT:{lo(this,t);break}case F.AFTER_HEAD:{oo(this,t);break}case F.IN_BODY:case F.IN_TABLE:case F.IN_CAPTION:case F.IN_COLUMN_GROUP:case F.IN_TABLE_BODY:case F.IN_ROW:case F.IN_CELL:case F.IN_SELECT:case F.IN_SELECT_IN_TABLE:{e_(this,t);break}case F.TEXT:{p8(this,t);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}case F.IN_TEMPLATE:{l_(this,t);break}case F.AFTER_BODY:case F.IN_FRAMESET:case F.AFTER_FRAMESET:case F.AFTER_AFTER_BODY:case F.AFTER_AFTER_FRAMESET:{Wh(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===I.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case F.IN_HEAD:case F.IN_HEAD_NO_SCRIPT:case F.AFTER_HEAD:case F.TEXT:case F.IN_COLUMN_GROUP:case F.IN_SELECT:case F.IN_SELECT_IN_TABLE:case F.IN_FRAMESET:case F.AFTER_FRAMESET:{this._insertCharacters(t);break}case F.IN_BODY:case F.IN_CAPTION:case F.IN_CELL:case F.IN_TEMPLATE:case F.AFTER_BODY:case F.AFTER_AFTER_BODY:case F.AFTER_AFTER_FRAMESET:{QT(this,t);break}case F.IN_TABLE:case F.IN_TABLE_BODY:case F.IN_ROW:{jm(this,t);break}case F.IN_TABLE_TEXT:{t_(this,t);break}}}}function fL(e,t){let a=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return a?e.openElements.contains(a.element)?e.openElements.hasInScope(t.tagID)||(a=null):(e.activeFormattingElements.removeEntry(a),a=null):JT(e,t),a}function mL(e,t){let a=null,s=e.openElements.stackTop;for(;s>=0;s--){const l=e.openElements.items[s];if(l===t.element)break;e._isSpecialElement(l,e.openElements.tagIDs[s])&&(a=l)}return a||(e.openElements.shortenToLength(Math.max(s,0)),e.activeFormattingElements.removeEntry(t)),a}function hL(e,t,a){let s=t,l=e.openElements.getCommonAncestor(t);for(let o=0,d=l;d!==a;o++,d=l){l=e.openElements.getCommonAncestor(d);const f=e.activeFormattingElements.getElementEntry(d),m=f&&o>=cL;!f||m?(m&&e.activeFormattingElements.removeEntry(f),e.openElements.remove(d)):(d=pL(e,f),s===t&&(e.activeFormattingElements.bookmark=f),e.treeAdapter.detachNode(s),e.treeAdapter.appendChild(d,s),s=d)}return s}function pL(e,t){const a=e.treeAdapter.getNamespaceURI(t.element),s=e.treeAdapter.createElement(t.token.tagName,a,t.token.attrs);return e.openElements.replace(t.element,s),t.element=s,s}function gL(e,t,a){const s=e.treeAdapter.getTagName(t),l=Vi(s);if(e._isElementCausesFosterParenting(l))e._fosterParentElement(a);else{const o=e.treeAdapter.getNamespaceURI(t);l===E.TEMPLATE&&o===be.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,a)}}function bL(e,t,a){const s=e.treeAdapter.getNamespaceURI(a.element),{token:l}=a,o=e.treeAdapter.createElement(l.tagName,s,l.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,l),e.activeFormattingElements.removeEntry(a),e.openElements.remove(a.element),e.openElements.insertAfter(t,o,l.tagID)}function Zh(e,t){for(let a=0;a<uL;a++){const s=fL(e,t);if(!s)break;const l=mL(e,s);if(!l)break;e.activeFormattingElements.bookmark=s;const o=hL(e,l,s.element),d=e.openElements.getCommonAncestor(s.element);e.treeAdapter.detachNode(o),d&&gL(e,d,o),bL(e,l,s)}}function oh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function xL(e,t){e._appendCommentNode(t,e.openElements.items[0])}function EL(e,t){e._appendCommentNode(t,e.document)}function Wh(e,t){if(e.stopped=!0,t.location){const a=e.fragmentContext?0:2;for(let s=e.openElements.stackTop;s>=a;s--)e._setEndLocation(e.openElements.items[s],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const s=e.openElements.items[0],l=e.treeAdapter.getNodeSourceCodeLocation(s);if(l&&!l.endTag&&(e._setEndLocation(s,t),e.openElements.stackTop>=1)){const o=e.openElements.items[1],d=e.treeAdapter.getNodeSourceCodeLocation(o);d&&!d.endTag&&e._setEndLocation(o,t)}}}}function yL(e,t){e._setDocumentType(t);const a=t.forceQuirks?Na.QUIRKS:XD(t);QD(t)||e._err(t,oe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,a),e.insertionMode=F.BEFORE_HTML}function Zl(e,t){e._err(t,oe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Na.QUIRKS),e.insertionMode=F.BEFORE_HTML,e._processToken(t)}function TL(e,t){t.tagID===E.HTML?(e._insertElement(t,be.HTML),e.insertionMode=F.BEFORE_HEAD):ro(e,t)}function _L(e,t){const a=t.tagID;(a===E.HTML||a===E.HEAD||a===E.BODY||a===E.BR)&&ro(e,t)}function ro(e,t){e._insertFakeRootElement(),e.insertionMode=F.BEFORE_HEAD,e._processToken(t)}function NL(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.HEAD:{e._insertElement(t,be.HTML),e.headElement=e.openElements.current,e.insertionMode=F.IN_HEAD;break}default:so(e,t)}}function SL(e,t){const a=t.tagID;a===E.HEAD||a===E.BODY||a===E.HTML||a===E.BR?so(e,t):e._err(t,oe.endTagWithoutMatchingOpenElement)}function so(e,t){e._insertFakeElement(J.HEAD,E.HEAD),e.headElement=e.openElements.current,e.insertionMode=F.IN_HEAD,e._processToken(t)}function La(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case E.TITLE:{e._switchToTextParsing(t,Xt.RCDATA);break}case E.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Xt.RAWTEXT):(e._insertElement(t,be.HTML),e.insertionMode=F.IN_HEAD_NO_SCRIPT);break}case E.NOFRAMES:case E.STYLE:{e._switchToTextParsing(t,Xt.RAWTEXT);break}case E.SCRIPT:{e._switchToTextParsing(t,Xt.SCRIPT_DATA);break}case E.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=F.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(F.IN_TEMPLATE);break}case E.HEAD:{e._err(t,oe.misplacedStartTagForHeadElement);break}default:io(e,t)}}function vL(e,t){switch(t.tagID){case E.HEAD:{e.openElements.pop(),e.insertionMode=F.AFTER_HEAD;break}case E.BODY:case E.BR:case E.HTML:{io(e,t);break}case E.TEMPLATE:{Gs(e,t);break}default:e._err(t,oe.endTagWithoutMatchingOpenElement)}}function Gs(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==E.TEMPLATE&&e._err(t,oe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,oe.endTagWithoutMatchingOpenElement)}function io(e,t){e.openElements.pop(),e.insertionMode=F.AFTER_HEAD,e._processToken(t)}function AL(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.BASEFONT:case E.BGSOUND:case E.HEAD:case E.LINK:case E.META:case E.NOFRAMES:case E.STYLE:{La(e,t);break}case E.NOSCRIPT:{e._err(t,oe.nestedNoscriptInHead);break}default:lo(e,t)}}function CL(e,t){switch(t.tagID){case E.NOSCRIPT:{e.openElements.pop(),e.insertionMode=F.IN_HEAD;break}case E.BR:{lo(e,t);break}default:e._err(t,oe.endTagWithoutMatchingOpenElement)}}function lo(e,t){const a=t.type===tt.EOF?oe.openElementsLeftAfterEof:oe.disallowedContentInNoscriptInHead;e._err(t,a),e.openElements.pop(),e.insertionMode=F.IN_HEAD,e._processToken(t)}function wL(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.BODY:{e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=F.IN_BODY;break}case E.FRAMESET:{e._insertElement(t,be.HTML),e.insertionMode=F.IN_FRAMESET;break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{e._err(t,oe.abandonedHeadElementChild),e.openElements.push(e.headElement,E.HEAD),La(e,t),e.openElements.remove(e.headElement);break}case E.HEAD:{e._err(t,oe.misplacedStartTagForHeadElement);break}default:oo(e,t)}}function kL(e,t){switch(t.tagID){case E.BODY:case E.HTML:case E.BR:{oo(e,t);break}case E.TEMPLATE:{Gs(e,t);break}default:e._err(t,oe.endTagWithoutMatchingOpenElement)}}function oo(e,t){e._insertFakeElement(J.BODY,E.BODY),e.insertionMode=F.IN_BODY,Kc(e,t)}function Kc(e,t){switch(t.type){case tt.CHARACTER:{XT(e,t);break}case tt.WHITESPACE_CHARACTER:{QT(e,t);break}case tt.COMMENT:{oh(e,t);break}case tt.START_TAG:{An(e,t);break}case tt.END_TAG:{Vc(e,t);break}case tt.EOF:{e_(e,t);break}}}function QT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function XT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function RL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function OL(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(a,t.attrs))}function IL(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&a&&(e.treeAdapter.detachNode(a),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_FRAMESET)}function ML(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML)}function DL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&lh.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,be.HTML)}function LL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function jL(e,t){const a=e.openElements.tmplCount>0;(!e.formElement||a)&&(e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML),a||(e.formElement=e.openElements.current))}function BL(e,t){e.framesetOk=!1;const a=t.tagID;for(let s=e.openElements.stackTop;s>=0;s--){const l=e.openElements.tagIDs[s];if(a===E.LI&&l===E.LI||(a===E.DD||a===E.DT)&&(l===E.DD||l===E.DT)){e.openElements.generateImpliedEndTagsWithExclusion(l),e.openElements.popUntilTagNamePopped(l);break}if(l!==E.ADDRESS&&l!==E.DIV&&l!==E.P&&e._isSpecialElement(e.openElements.items[s],l))break}e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML)}function PL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.tokenizer.state=Xt.PLAINTEXT}function UL(e,t){e.openElements.hasInScope(E.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.framesetOk=!1}function HL(e,t){const a=e.activeFormattingElements.getElementEntryInScopeWithTagName(J.A);a&&(Zh(e,t),e.openElements.remove(a.element),e.activeFormattingElements.removeEntry(a)),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function FL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function zL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(E.NOBR)&&(Zh(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function qL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function YL(e,t){e.treeAdapter.getDocumentMode(e.document)!==Na.QUIRKS&&e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=F.IN_TABLE}function ZT(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,be.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function WT(e){const t=HT(e,Us.TYPE);return t!=null&&t.toLowerCase()===oL}function $L(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,be.HTML),WT(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function GL(e,t){e._appendElement(t,be.HTML),t.ackSelfClosing=!0}function KL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._appendElement(t,be.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function VL(e,t){t.tagName=J.IMG,t.tagID=E.IMG,ZT(e,t)}function QL(e,t){e._insertElement(t,be.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Xt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=F.TEXT}function XL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Xt.RAWTEXT)}function ZL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Xt.RAWTEXT)}function q1(e,t){e._switchToTextParsing(t,Xt.RAWTEXT)}function WL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===F.IN_TABLE||e.insertionMode===F.IN_CAPTION||e.insertionMode===F.IN_TABLE_BODY||e.insertionMode===F.IN_ROW||e.insertionMode===F.IN_CELL?F.IN_SELECT_IN_TABLE:F.IN_SELECT}function JL(e,t){e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML)}function e8(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,be.HTML)}function t8(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(E.RTC),e._insertElement(t,be.HTML)}function n8(e,t){e._reconstructActiveFormattingElements(),GT(t),Xh(t),t.selfClosing?e._appendElement(t,be.MATHML):e._insertElement(t,be.MATHML),t.ackSelfClosing=!0}function a8(e,t){e._reconstructActiveFormattingElements(),KT(t),Xh(t),t.selfClosing?e._appendElement(t,be.SVG):e._insertElement(t,be.SVG),t.ackSelfClosing=!0}function Y1(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML)}function An(e,t){switch(t.tagID){case E.I:case E.S:case E.B:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.SMALL:case E.STRIKE:case E.STRONG:{FL(e,t);break}case E.A:{HL(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{DL(e,t);break}case E.P:case E.DL:case E.OL:case E.UL:case E.DIV:case E.DIR:case E.NAV:case E.MAIN:case E.MENU:case E.ASIDE:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.DETAILS:case E.ADDRESS:case E.ARTICLE:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{ML(e,t);break}case E.LI:case E.DD:case E.DT:{BL(e,t);break}case E.BR:case E.IMG:case E.WBR:case E.AREA:case E.EMBED:case E.KEYGEN:{ZT(e,t);break}case E.HR:{KL(e,t);break}case E.RB:case E.RTC:{e8(e,t);break}case E.RT:case E.RP:{t8(e,t);break}case E.PRE:case E.LISTING:{LL(e,t);break}case E.XMP:{XL(e,t);break}case E.SVG:{a8(e,t);break}case E.HTML:{RL(e,t);break}case E.BASE:case E.LINK:case E.META:case E.STYLE:case E.TITLE:case E.SCRIPT:case E.BGSOUND:case E.BASEFONT:case E.TEMPLATE:{La(e,t);break}case E.BODY:{OL(e,t);break}case E.FORM:{jL(e,t);break}case E.NOBR:{zL(e,t);break}case E.MATH:{n8(e,t);break}case E.TABLE:{YL(e,t);break}case E.INPUT:{$L(e,t);break}case E.PARAM:case E.TRACK:case E.SOURCE:{GL(e,t);break}case E.IMAGE:{VL(e,t);break}case E.BUTTON:{UL(e,t);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{qL(e,t);break}case E.IFRAME:{ZL(e,t);break}case E.SELECT:{WL(e,t);break}case E.OPTION:case E.OPTGROUP:{JL(e,t);break}case E.NOEMBED:case E.NOFRAMES:{q1(e,t);break}case E.FRAMESET:{IL(e,t);break}case E.TEXTAREA:{QL(e,t);break}case E.NOSCRIPT:{e.options.scriptingEnabled?q1(e,t):Y1(e,t);break}case E.PLAINTEXT:{PL(e,t);break}case E.COL:case E.TH:case E.TD:case E.TR:case E.HEAD:case E.FRAME:case E.TBODY:case E.TFOOT:case E.THEAD:case E.CAPTION:case E.COLGROUP:break;default:Y1(e,t)}}function r8(e,t){if(e.openElements.hasInScope(E.BODY)&&(e.insertionMode=F.AFTER_BODY,e.options.sourceCodeLocationInfo)){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e._setEndLocation(a,t)}}function s8(e,t){e.openElements.hasInScope(E.BODY)&&(e.insertionMode=F.AFTER_BODY,o_(e,t))}function i8(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a))}function l8(e){const t=e.openElements.tmplCount>0,{formElement:a}=e;t||(e.formElement=null),(a||t)&&e.openElements.hasInScope(E.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(E.FORM):a&&e.openElements.remove(a))}function o8(e){e.openElements.hasInButtonScope(E.P)||e._insertFakeElement(J.P,E.P),e._closePElement()}function u8(e){e.openElements.hasInListItemScope(E.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(E.LI),e.openElements.popUntilTagNamePopped(E.LI))}function c8(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a))}function d8(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function f8(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a),e.activeFormattingElements.clearToLastMarker())}function m8(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(J.BR,E.BR),e.openElements.pop(),e.framesetOk=!1}function JT(e,t){const a=t.tagName,s=t.tagID;for(let l=e.openElements.stackTop;l>0;l--){const o=e.openElements.items[l],d=e.openElements.tagIDs[l];if(s===d&&(s!==E.UNKNOWN||e.treeAdapter.getTagName(o)===a)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.stackTop>=l&&e.openElements.shortenToLength(l);break}if(e._isSpecialElement(o,d))break}}function Vc(e,t){switch(t.tagID){case E.A:case E.B:case E.I:case E.S:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.NOBR:case E.SMALL:case E.STRIKE:case E.STRONG:{Zh(e,t);break}case E.P:{o8(e);break}case E.DL:case E.UL:case E.OL:case E.DIR:case E.DIV:case E.NAV:case E.PRE:case E.MAIN:case E.MENU:case E.ASIDE:case E.BUTTON:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.ADDRESS:case E.ARTICLE:case E.DETAILS:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.LISTING:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{i8(e,t);break}case E.LI:{u8(e);break}case E.DD:case E.DT:{c8(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{d8(e);break}case E.BR:{m8(e);break}case E.BODY:{r8(e,t);break}case E.HTML:{s8(e,t);break}case E.FORM:{l8(e);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{f8(e,t);break}case E.TEMPLATE:{Gs(e,t);break}default:JT(e,t)}}function e_(e,t){e.tmplInsertionModeStack.length>0?l_(e,t):Wh(e,t)}function h8(e,t){var a;t.tagID===E.SCRIPT&&((a=e.scriptHandler)===null||a===void 0||a.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function p8(e,t){e._err(t,oe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function jm(e,t){if(e.openElements.currentTagId!==void 0&&VT.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=F.IN_TABLE_TEXT,t.type){case tt.CHARACTER:{n_(e,t);break}case tt.WHITESPACE_CHARACTER:{t_(e,t);break}}else ko(e,t)}function g8(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_CAPTION}function b8(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_COLUMN_GROUP}function x8(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.COLGROUP,E.COLGROUP),e.insertionMode=F.IN_COLUMN_GROUP,Jh(e,t)}function E8(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_TABLE_BODY}function y8(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.TBODY,E.TBODY),e.insertionMode=F.IN_TABLE_BODY,Qc(e,t)}function T8(e,t){e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function _8(e,t){WT(t)?e._appendElement(t,be.HTML):ko(e,t),t.ackSelfClosing=!0}function N8(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,be.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Hi(e,t){switch(t.tagID){case E.TD:case E.TH:case E.TR:{y8(e,t);break}case E.STYLE:case E.SCRIPT:case E.TEMPLATE:{La(e,t);break}case E.COL:{x8(e,t);break}case E.FORM:{N8(e,t);break}case E.TABLE:{T8(e,t);break}case E.TBODY:case E.TFOOT:case E.THEAD:{E8(e,t);break}case E.INPUT:{_8(e,t);break}case E.CAPTION:{g8(e,t);break}case E.COLGROUP:{b8(e,t);break}default:ko(e,t)}}function Eo(e,t){switch(t.tagID){case E.TABLE:{e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode());break}case E.TEMPLATE:{Gs(e,t);break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:ko(e,t)}}function ko(e,t){const a=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Kc(e,t),e.fosterParentingEnabled=a}function t_(e,t){e.pendingCharacterTokens.push(t)}function n_(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Wl(e,t){let a=0;if(e.hasNonWhitespacePendingCharacterToken)for(;a<e.pendingCharacterTokens.length;a++)ko(e,e.pendingCharacterTokens[a]);else for(;a<e.pendingCharacterTokens.length;a++)e._insertCharacters(e.pendingCharacterTokens[a]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const a_=new Set([E.CAPTION,E.COL,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]);function S8(e,t){const a=t.tagID;a_.has(a)?e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=F.IN_TABLE,Hi(e,t)):An(e,t)}function v8(e,t){const a=t.tagID;switch(a){case E.CAPTION:case E.TABLE:{e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=F.IN_TABLE,a===E.TABLE&&Eo(e,t));break}case E.BODY:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:Vc(e,t)}}function Jh(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.COL:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case E.TEMPLATE:{La(e,t);break}default:wc(e,t)}}function A8(e,t){switch(t.tagID){case E.COLGROUP:{e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=F.IN_TABLE);break}case E.TEMPLATE:{Gs(e,t);break}case E.COL:break;default:wc(e,t)}}function wc(e,t){e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=F.IN_TABLE,e._processToken(t))}function Qc(e,t){switch(t.tagID){case E.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_ROW;break}case E.TH:case E.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(J.TR,E.TR),e.insertionMode=F.IN_ROW,Xc(e,t);break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE,Hi(e,t));break}default:Hi(e,t)}}function uh(e,t){const a=t.tagID;switch(t.tagID){case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasInTableScope(a)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE);break}case E.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE,Eo(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:case E.TR:break;default:Eo(e,t)}}function Xc(e,t){switch(t.tagID){case E.TH:case E.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_CELL,e.activeFormattingElements.insertMarker();break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE_BODY,Qc(e,t));break}default:Hi(e,t)}}function r_(e,t){switch(t.tagID){case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE_BODY);break}case E.TABLE:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE_BODY,uh(e,t));break}case E.TBODY:case E.TFOOT:case E.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(E.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE_BODY,uh(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:break;default:Eo(e,t)}}function C8(e,t){const a=t.tagID;a_.has(a)?(e.openElements.hasInTableScope(E.TD)||e.openElements.hasInTableScope(E.TH))&&(e._closeTableCell(),Xc(e,t)):An(e,t)}function w8(e,t){const a=t.tagID;switch(a){case E.TD:case E.TH:{e.openElements.hasInTableScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=F.IN_ROW);break}case E.TABLE:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(a)&&(e._closeTableCell(),r_(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:break;default:Vc(e,t)}}function s_(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._insertElement(t,be.HTML);break}case E.OPTGROUP:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._insertElement(t,be.HTML);break}case E.HR:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case E.INPUT:case E.KEYGEN:case E.TEXTAREA:case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),t.tagID!==E.SELECT&&e._processStartTag(t));break}case E.SCRIPT:case E.TEMPLATE:{La(e,t);break}}}function i_(e,t){switch(t.tagID){case E.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===E.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===E.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop();break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop();break}case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode());break}case E.TEMPLATE:{Gs(e,t);break}}}function k8(e,t){const a=t.tagID;a===E.CAPTION||a===E.TABLE||a===E.TBODY||a===E.TFOOT||a===E.THEAD||a===E.TR||a===E.TD||a===E.TH?(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e._processStartTag(t)):s_(e,t)}function R8(e,t){const a=t.tagID;a===E.CAPTION||a===E.TABLE||a===E.TBODY||a===E.TFOOT||a===E.THEAD||a===E.TR||a===E.TD||a===E.TH?e.openElements.hasInTableScope(a)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e.onEndTag(t)):i_(e,t)}function O8(e,t){switch(t.tagID){case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{La(e,t);break}case E.CAPTION:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.tmplInsertionModeStack[0]=F.IN_TABLE,e.insertionMode=F.IN_TABLE,Hi(e,t);break}case E.COL:{e.tmplInsertionModeStack[0]=F.IN_COLUMN_GROUP,e.insertionMode=F.IN_COLUMN_GROUP,Jh(e,t);break}case E.TR:{e.tmplInsertionModeStack[0]=F.IN_TABLE_BODY,e.insertionMode=F.IN_TABLE_BODY,Qc(e,t);break}case E.TD:case E.TH:{e.tmplInsertionModeStack[0]=F.IN_ROW,e.insertionMode=F.IN_ROW,Xc(e,t);break}default:e.tmplInsertionModeStack[0]=F.IN_BODY,e.insertionMode=F.IN_BODY,An(e,t)}}function I8(e,t){t.tagID===E.TEMPLATE&&Gs(e,t)}function l_(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Wh(e,t)}function M8(e,t){t.tagID===E.HTML?An(e,t):kc(e,t)}function o_(e,t){var a;if(t.tagID===E.HTML){if(e.fragmentContext||(e.insertionMode=F.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===E.HTML){e._setEndLocation(e.openElements.items[0],t);const s=e.openElements.items[1];s&&!(!((a=e.treeAdapter.getNodeSourceCodeLocation(s))===null||a===void 0)&&a.endTag)&&e._setEndLocation(s,t)}}else kc(e,t)}function kc(e,t){e.insertionMode=F.IN_BODY,Kc(e,t)}function D8(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.FRAMESET:{e._insertElement(t,be.HTML);break}case E.FRAME:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case E.NOFRAMES:{La(e,t);break}}}function L8(e,t){t.tagID===E.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==E.FRAMESET&&(e.insertionMode=F.AFTER_FRAMESET))}function j8(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.NOFRAMES:{La(e,t);break}}}function B8(e,t){t.tagID===E.HTML&&(e.insertionMode=F.AFTER_AFTER_FRAMESET)}function P8(e,t){t.tagID===E.HTML?An(e,t):cc(e,t)}function cc(e,t){e.insertionMode=F.IN_BODY,Kc(e,t)}function U8(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.NOFRAMES:{La(e,t);break}}}function H8(e,t){t.chars=Pt,e._insertCharacters(t)}function F8(e,t){e._insertCharacters(t),e.framesetOk=!1}function u_(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==be.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function z8(e,t){if(aL(t))u_(e),e._startTagOutsideForeignContent(t);else{const a=e._getAdjustedCurrentElement(),s=e.treeAdapter.getNamespaceURI(a);s===be.MATHML?GT(t):s===be.SVG&&(rL(t),KT(t)),Xh(t),t.selfClosing?e._appendElement(t,s):e._insertElement(t,s),t.ackSelfClosing=!0}}function q8(e,t){if(t.tagID===E.P||t.tagID===E.BR){u_(e),e._endTagOutsideForeignContent(t);return}for(let a=e.openElements.stackTop;a>0;a--){const s=e.openElements.items[a];if(e.treeAdapter.getNamespaceURI(s)===be.HTML){e._endTagOutsideForeignContent(t);break}const l=e.treeAdapter.getTagName(s);if(l.toLowerCase()===t.tagName){t.tagName=l,e.openElements.shortenToLength(a);break}}}J.AREA,J.BASE,J.BASEFONT,J.BGSOUND,J.BR,J.COL,J.EMBED,J.FRAME,J.HR,J.IMG,J.INPUT,J.KEYGEN,J.LINK,J.META,J.PARAM,J.SOURCE,J.TRACK,J.WBR;const Y8=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,$8=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),$1={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function c_(e,t){const a=t9(e),s=qy("type",{handlers:{root:G8,element:K8,text:V8,comment:f_,doctype:Q8,raw:Z8},unknown:W8}),l={parser:a?new z1($1):z1.getFragmentParser(void 0,$1),handle(f){s(f,l)},stitches:!1,options:t||{}};s(e,l),Qi(l,Xa());const o=a?l.parser.document:l.parser.getFragment(),d=nD(o,{file:l.options.file});return l.stitches&&Co(d,"comment",function(f,m,h){const x=f;if(x.value.stitch&&h&&m!==void 0){const b=h.children;return b[m]=x.value.stitch,m}}),d.type==="root"&&d.children.length===1&&d.children[0].type===e.type?d.children[0]:d}function d_(e,t){let a=-1;if(e)for(;++a<e.length;)t.handle(e[a])}function G8(e,t){d_(e.children,t)}function K8(e,t){J8(e,t),d_(e.children,t),e9(e,t)}function V8(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const a={type:tt.CHARACTER,chars:e.value,location:Ro(e)};Qi(t,Xa(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function Q8(e,t){const a={type:tt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ro(e)};Qi(t,Xa(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function X8(e,t){t.stitches=!0;const a=n9(e);if("children"in e&&"children"in a){const s=c_({type:"root",children:e.children},t.options);a.children=s.children}f_({type:"comment",value:{stitch:a}},t)}function f_(e,t){const a=e.value,s={type:tt.COMMENT,data:a,location:Ro(e)};Qi(t,Xa(e)),t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken)}function Z8(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,m_(t,Xa(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Y8,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const a=t.parser.tokenizer._consume();t.parser.tokenizer._callState(a)}}function W8(e,t){const a=e;if(t.options.passThrough&&t.options.passThrough.includes(a.type))X8(a,t);else{let s="";throw $8.has(a.type)&&(s=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+a.type+"` node"+s)}}function Qi(e,t){m_(e,t);const a=e.parser.tokenizer.currentCharacterToken;a&&a.location&&(a.location.endLine=e.parser.tokenizer.preprocessor.line,a.location.endCol=e.parser.tokenizer.preprocessor.col+1,a.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Xt.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function m_(e,t){if(t&&t.offset!==void 0){const a={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=a}}function J8(e,t){const a=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Xt.PLAINTEXT)return;Qi(t,Xa(e));const s=t.parser.openElements.current;let l="namespaceURI"in s?s.namespaceURI:Bs.html;l===Bs.html&&a==="svg"&&(l=Bs.svg);const o=lD({...e,children:[]},{space:l===Bs.svg?"svg":"html"}),d={type:tt.START_TAG,tagName:a,tagID:Vi(a),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:Ro(e)};t.parser.currentToken=d,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=a}function e9(e,t){const a=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&pD.includes(a)||t.parser.tokenizer.state===Xt.PLAINTEXT)return;Qi(t,zc(e));const s={type:tt.END_TAG,tagName:a,tagID:Vi(a),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ro(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),a===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Xt.RCDATA||t.parser.tokenizer.state===Xt.RAWTEXT||t.parser.tokenizer.state===Xt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Xt.DATA)}function t9(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ro(e){const t=Xa(e)||{line:void 0,column:void 0,offset:void 0},a=zc(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:a.line,endCol:a.column,endOffset:a.offset}}function n9(e){return"children"in e?Ui({...e,children:[]}):Ui(e)}function uo(e){return function(t,a){return c_(t,{...e,file:a})}}const G1=[{key:"open",label:"开放"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function a9(e){const t=e<1e12?e*1e3:e,a=Date.now()-t;return a<6e4?"刚刚":a<36e5?`${Math.floor(a/6e4)}分钟前`:a<864e5?`${Math.floor(a/36e5)}小时前`:a<2592e6?`${Math.floor(a/864e5)}天前`:new Date(t).toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}function K1({onDone:e}){const[t,a]=v.useState(""),[s,l]=v.useState(""),[o,d]=v.useState(!1),f=Ue(x=>x.createIssue),m=async()=>{!t.trim()||o||(d(!0),await f(t.trim(),s.trim()||void 0),d(!1),e())},h=x=>{(x.metaKey||x.ctrlKey)&&x.key==="Enter"&&(x.preventDefault(),m())};return u.jsxs("div",{className:"border-b border-line px-3 py-3",children:[u.jsx("input",{type:"text",value:t,onChange:x=>a(x.target.value),onKeyDown:h,placeholder:"Issue 标题",autoFocus:!0,className:"w-full rounded-md border border-line bg-base px-2.5 py-1.5 text-xs text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none"}),u.jsx("textarea",{value:s,onChange:x=>l(x.target.value),onKeyDown:h,placeholder:"描述(可选) ⌘⏎ 创建",rows:3,className:"mt-2 w-full resize-none rounded-md border border-line bg-base px-2.5 py-1.5 text-xs text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none"}),u.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:e,className:"rounded-md px-2.5 py-1 text-xs text-fg-4 transition-colors hover:text-fg-2",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void m(),disabled:!t.trim()||o,className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:"创建"})]})]})}function r9({repoId:e,issueNumber:t,onPublished:a}){const s=va(),l=qe(Da),[o,d]=v.useState(""),[f,m]=v.useState("idle"),[h,x]=v.useState(""),[b,y]=v.useState(null),[T,N]=v.useState(!1),S=v.useRef(null),C=v.useCallback(()=>{S.current&&(clearInterval(S.current),S.current=null)},[]);v.useEffect(()=>()=>C(),[C]),v.useEffect(()=>{let M=!1;return ux(e,t).then(L=>{!M&&L.body&&(x(L.body),m("preview"))}).catch(()=>{}),()=>{M=!0}},[e,t]);const A=async()=>{if(!(!o.trim()||T)){N(!0);try{const M=await ox(e,t,o.trim());a(M),d(""),Yt.getState().addToast("评论已发布","success")}catch(M){Yt.getState().addToast(M instanceof Error?M.message:"发布失败","error")}finally{N(!1)}}},D=async()=>{if(!(!o.trim()||f==="polishing")){m("polishing");try{const{sessionId:M}=await $3(e,t,o.trim());y(M),S.current=setInterval(async()=>{try{if((await YE(e,M)).type==="idle"){C();const K=await ux(e,t);x(K.body),m("preview")}}catch{C(),m("idle"),Yt.getState().addToast("润色状态检查失败","error")}},2e3)}catch(M){m("idle"),Yt.getState().addToast(M instanceof Error?M.message:"润色启动失败","error")}}},k=async()=>{if(!(!h.trim()||T)){N(!0);try{const M=await ox(e,t,h.trim());a(M),d(""),x(""),y(null),m("idle"),Yt.getState().addToast("评论已发布","success")}catch(M){Yt.getState().addToast(M instanceof Error?M.message:"发布失败","error")}finally{N(!1)}}},z=()=>{C(),x(""),y(null),m("idle")},V=()=>{!b||!l||(Le.setState({activeSessionId:b}),s(`/${encodeURIComponent(l)}/run`))};return f==="preview"?u.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[u.jsxs("h3",{className:"mb-3 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[u.jsx(um,{className:"h-3.5 w-3.5 text-amber-400"}),"AI 润色结果"]}),u.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:u.jsx("textarea",{value:h,onChange:M=>x(M.target.value),rows:6,className:"w-full resize-none bg-transparent text-sm text-fg placeholder:text-fg-6 focus:outline-none"})}),u.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.jsxs("button",{type:"button",disabled:T,onClick:()=>void k(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(gc,{className:"h-3.5 w-3.5"}),"发布评论"]}),u.jsxs("button",{type:"button",onClick:()=>void D(),className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(um,{className:"h-3.5 w-3.5"}),"重新润色"]}),u.jsx("button",{type:"button",onClick:V,className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:"转入深度对话"}),u.jsx("button",{type:"button",onClick:z,className:"ml-auto rounded-md px-2.5 py-1.5 text-xs text-fg-5 transition-colors hover:text-fg-3",children:"放弃"})]})]}):u.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[u.jsx("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-fg-4",children:"添加评论"}),u.jsx("textarea",{value:o,onChange:M=>d(M.target.value),placeholder:"写下你的评论...",rows:4,disabled:f==="polishing",className:"w-full resize-none rounded-lg border border-line bg-base px-3 py-2.5 text-sm text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none disabled:opacity-50"}),u.jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[u.jsxs("button",{type:"button",disabled:!o.trim()||T||f==="polishing",onClick:()=>void A(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(gc,{className:"h-3.5 w-3.5"}),T?"发送中...":"直接发送"]}),u.jsxs("button",{type:"button",disabled:!o.trim()||f==="polishing",onClick:()=>void D(),className:"flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-1.5 text-xs font-medium text-amber-400 transition-colors hover:bg-amber-500/20 disabled:opacity-40",children:[u.jsx(um,{className:"h-3.5 w-3.5"}),f==="polishing"?"润色中...":"AI 润色"]})]})]})}function V1({issue:e,sessionCount:t,isActive:a,isEpic:s,milestone:l,onSelect:o}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:o,className:ce("group flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors",a?"border-l-2 border-blue-500 bg-elevated/80":"border-l-2 border-transparent hover:bg-elevated/50"),children:[u.jsx("span",{className:ce("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold",e.state==="open"?"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-1 ring-emerald-500/25":"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-1 ring-purple-500/25"),children:e.number}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[s&&u.jsx("span",{className:"shrink-0 rounded px-1 py-0.5 text-[9px] font-bold tracking-wide bg-amber-400/12 text-amber-400",children:"EPIC"}),u.jsx("span",{className:"min-w-0 text-xs font-medium text-fg-2 group-hover:text-fg",children:e.title})]}),e.labels&&e.labels.length>0&&u.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(d=>u.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${d.color}20`,color:`#${d.color}`},children:d.name},d.id))}),l&&u.jsxs("span",{className:"mt-1 flex items-center gap-1 text-[10px] text-indigo-400/70",children:[u.jsx(Nh,{className:"h-2.5 w-2.5"}),l.title]})]}),t>0&&u.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:t})]})})}function s9({issue:e,sessionCount:t,isEpic:a,milestone:s,onSelect:l}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:l,className:"group flex w-full items-center gap-3 border-b border-line px-4 py-3 text-left transition-colors hover:bg-elevated/50",children:[u.jsx("span",{className:ce("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold",e.state==="open"?"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-1 ring-emerald-500/25":"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-1 ring-purple-500/25"),children:e.number}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[a&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wide bg-amber-400/12 text-amber-400",children:"EPIC"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:e.title}),s&&u.jsxs("span",{className:"hidden shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium bg-indigo-500/15 text-indigo-400 sm:flex",children:[u.jsx(Nh,{className:"h-2.5 w-2.5"}),s.title]}),t>0&&u.jsxs("span",{className:"shrink-0 rounded-full bg-elevated px-2 py-0.5 font-mono text-[10px] text-fg-5",children:[t," 次运行"]}),e.assignees&&e.assignees.length>0&&u.jsxs("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:[e.assignees.slice(0,3).map(o=>u.jsx("img",{src:o.avatar_url,alt:o.login,title:o.login,className:"h-5 w-5 rounded-full ring-2 ring-surface"},o.login)),e.assignees.length>3&&u.jsxs("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-elevated text-[9px] font-medium text-fg-4 ring-2 ring-surface",children:["+",e.assignees.length-3]})]})]}),u.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[e.authorLogin&&u.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&u.jsx("img",{src:e.authorAvatar,alt:"",className:"mr-1 inline-block h-3.5 w-3.5 rounded-full align-text-bottom"}),e.authorLogin]}),e.authorLogin&&u.jsx("span",{className:"text-fg-6",children:"·"}),u.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:a9(e.createdAt)}),(e.commentCount??0)>0&&u.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-[11px] text-fg-6",children:[u.jsx("span",{className:"text-fg-6",children:"·"}),u.jsx(EA,{className:"h-3 w-3"}),e.commentCount]}),(e.labels&&e.labels.length>0||(e.commentCount??0)>0||e.authorLogin)&&e.labels&&e.labels.length>0&&u.jsx("span",{className:"text-fg-6",children:"·"}),e.labels&&e.labels.length>0?e.labels.map(o=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-medium",style:{backgroundColor:`#${o.color}20`,color:`#${o.color}`},children:o.name},o.id)):e.authorLogin?null:u.jsx("span",{className:"text-[11px] text-fg-6",children:" "})]})]})]})})}function i9({issue:e,milestone:t,onBack:a,onClose:s,onToggleSidebar:l}){var te;const o=va(),d=qe(ie=>ie.activeRepoId),f=qe(Da),[m,h]=v.useState([]),[x,b]=v.useState(!1),[y,T]=v.useState([]),[N,S]=v.useState(0),[C,A]=v.useState(!1),[D,k]=v.useState(!1),[z,V]=v.useState("issue"),M=Ue(ie=>ie.updateIssueState);v.useEffect(()=>{d&&(b(!0),Y3(d,e.number).then(h).catch(()=>h([])).finally(()=>b(!1)))},[d,e.number]),v.useEffect(()=>{d&&ix(d,e.number).then(T).catch(()=>T([]))},[d,e.number]),v.useEffect(()=>{V("issue"),S(0)},[e.id]);const L=y[N]??y[0],K=async ie=>{if(!(C||!d||!L)){A(!0);try{await P3(d,e.number,L.number,ie),ie&&await M(e.number,"closed");const Z=await ix(d,e.number);T(Z),N>=Z.length&&S(Math.max(0,Z.length-1)),Yt.getState().addToast(`PR #${L.number} 合入成功`,"success")}catch(Z){let ee="合入失败";if(Z instanceof Hs)try{ee=JSON.parse(Z.message).error??ee}catch{ee=Z.message}Yt.getState().addToast(ee,"error")}finally{A(!1)}}},se=()=>{if(!L)return;const ie=`请解决 PR #${L.number} 的合并冲突: ${L.title}`;Ue.getState().setSelectedIssue(e.id),Ue.getState().setPendingDraft(ie),Ue.getState().setPreviewIssue(null),Le.setState({activeSessionId:null}),o(`/${encodeURIComponent(f)}/run`)},B=()=>{Ue.getState().setSelectedIssue(e.id),Ue.getState().setPreviewIssue(null),Le.setState({activeSessionId:null}),o(`/${encodeURIComponent(f)}/run`)},U=ie=>{const Z=new Date(ie);return Z.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})+" "+Z.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})};return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("header",{className:"flex flex-col gap-2 border-b border-line px-4 py-3 md:flex-row md:items-center md:gap-3 md:px-6",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[u.jsx("button",{type:"button",onClick:a,"aria-label":"返回列表",className:"-ml-1 shrink-0 rounded-md p-1.5 text-fg-3 transition-colors hover:bg-elevated hover:text-fg md:hidden",children:u.jsx(RE,{className:"h-5 w-5"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number," ",e.state]}),(te=e.labels)==null?void 0:te.map(ie=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${ie.color}20`,color:`#${ie.color}`},children:ie.name},ie.id)),t&&u.jsxs("span",{className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium bg-indigo-500/15 text-indigo-400",children:[u.jsx(Nh,{className:"h-2.5 w-2.5"}),t.title]})]}),u.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),(e.authorLogin||e.assignees&&e.assignees.length>0)&&u.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-xs text-fg-4",children:[e.authorLogin&&u.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&u.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.assignees&&e.assignees.length>0&&u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-fg-5",children:"→"}),u.jsx("span",{className:"flex items-center -space-x-1",children:e.assignees.map(ie=>u.jsx("img",{src:ie.avatar_url,alt:ie.login,title:ie.login,className:"h-4 w-4 rounded-full ring-1 ring-surface"},ie.login))}),u.jsx("span",{className:"text-fg-4",children:e.assignees.map(ie=>ie.login).join(", ")})]})]})]})]}),u.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&u.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(hc,{className:"h-3.5 w-3.5"}),"源站"]}),u.jsxs("button",{type:"button",onClick:()=>{Ue.getState().enterMatchMode(e.id),Le.setState({activeSessionId:null}),o(`/${encodeURIComponent(f)}/run`)},className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[u.jsx(_o,{className:"h-3.5 w-3.5"}),"匹配子任务"]}),u.jsx("button",{type:"button",disabled:D,onClick:async()=>{k(!0),await M(e.number,e.state==="open"?"closed":"open"),k(!1)},className:ce("flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium transition-colors disabled:opacity-40",e.state==="open"?"border-red-500/30 text-red-400 hover:border-red-500/60 hover:bg-red-500/10":"border-emerald-500/30 text-emerald-400 hover:border-emerald-500/60 hover:bg-emerald-500/10"),children:e.state==="open"?u.jsxs(u.Fragment,{children:[u.jsx(OE,{className:"h-3.5 w-3.5"}),"关闭"]}):u.jsxs(u.Fragment,{children:[u.jsx(fo,{className:"h-3.5 w-3.5"}),"重新打开"]})}),u.jsxs("button",{type:"button",onClick:B,className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:[u.jsx(Bc,{className:"h-3.5 w-3.5 fill-current"}),"开始处理"]}),l&&u.jsx("button",{type:"button",onClick:l,title:"面板",className:"flex h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2",children:u.jsx(DE,{className:"h-4 w-4"})}),s&&u.jsx("button",{type:"button",onClick:s,title:"关闭详情",className:"hidden h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 md:flex",children:u.jsx(Tt,{className:"h-4 w-4"})})]})]}),y.length>0&&u.jsxs("div",{className:"flex shrink-0 items-center border-b border-line bg-surface",children:[u.jsxs("button",{type:"button",onClick:()=>V("issue"),className:ce("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",z==="issue"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(fo,{className:"h-3.5 w-3.5"}),"Issue"]}),u.jsxs("button",{type:"button",onClick:()=>V("pr"),className:ce("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",z==="pr"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(mo,{className:"h-3.5 w-3.5"}),"PR",u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",z==="pr"?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:y.length}),y.some(ie=>ie.mergeable===!1)&&u.jsxs("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[u.jsx(Kn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]})]})]}),z==="issue"||y.length===0?u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:u.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[e.body?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:e.body})}):u.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"}),x?u.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):m.length>0&&u.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[u.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",m.length,")"]}),u.jsx("div",{className:"space-y-4",children:m.map(ie=>u.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:ie.user.avatar_url,alt:ie.user.login,className:"h-5 w-5 rounded-full"}),u.jsx("span",{className:"text-xs font-semibold text-fg-2",children:ie.user.login}),u.jsx("span",{className:"text-[10px] text-fg-6",children:U(ie.created_at)})]}),u.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:ie.body})})]},ie.id))})]}),d&&u.jsx(r9,{repoId:d,issueNumber:e.number,onPublished:ie=>h(Z=>[...Z,ie])},e.id)]})}):u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-line bg-surface px-4 py-0",children:[y.length>1&&y.map((ie,Z)=>u.jsxs("button",{type:"button",onClick:()=>S(Z),className:ce("flex items-center gap-1.5 border-b-2 px-2.5 py-2.5 text-xs font-medium transition-colors",Z===N?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsxs("span",{className:"font-mono text-[10px]",children:["#",ie.number]}),u.jsx("span",{className:"max-w-[140px] truncate",children:ie.title})]},ie.number)),u.jsxs("div",{className:ce("flex items-center gap-2",y.length>1&&"ml-auto"),children:[(L==null?void 0:L.html_url)&&u.jsxs("a",{href:L.html_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 rounded-md border border-line px-2 py-1.5 font-mono text-[11px] text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(hc,{className:"h-3 w-3"}),u.jsx("span",{className:"hidden sm:inline",children:"查看"})]}),(L==null?void 0:L.mergeable)===!1&&u.jsxs("button",{type:"button",onClick:se,className:"flex items-center gap-1.5 rounded-md border border-amber-500/30 px-2.5 py-1.5 text-xs font-medium text-amber-400 transition-colors hover:border-amber-500/60 hover:bg-amber-500/10",children:[u.jsx(JA,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"hidden sm:inline",children:"解冲突"})]}),u.jsxs("button",{type:"button",disabled:C||(L==null?void 0:L.mergeable)===!1,onClick:()=>void K(!1),className:"flex items-center gap-1.5 rounded-md border border-emerald-500/30 px-2.5 py-1.5 text-xs font-medium text-emerald-400 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 disabled:opacity-40",children:[u.jsx(pc,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"hidden sm:inline",children:"合入"})]}),u.jsxs("button",{type:"button",disabled:C||(L==null?void 0:L.mergeable)===!1,onClick:()=>void K(!0),className:"flex items-center gap-1.5 rounded-md border border-blue-500/30 px-2.5 py-1.5 text-xs font-medium text-blue-400 transition-colors hover:border-blue-500/60 hover:bg-blue-500/10 disabled:opacity-40",children:[u.jsx(pc,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"hidden sm:inline",children:"合入并关闭"})]})]})]}),L&&u.jsx("div",{className:"flex-1 overflow-y-auto",children:u.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[u.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",L.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",L.number," ",L.state]}),L.mergeable===!1&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:"Conflict"}),u.jsx("span",{className:"text-sm font-semibold text-fg",children:L.title})]}),L.body?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:L.body})}):u.jsx("p",{className:"py-6 text-center font-mono text-xs text-fg-5",children:"该 PR 没有描述内容"})]})})]})]})}function h_({issue:e,childrenMap:t,currentId:a,onSelect:s,depth:l}){const o=t.get(e.id)??[],d=e.id===a;return u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>s(e.id),className:ce("group flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs transition-colors",d?"bg-blue-500/10 text-blue-400":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),style:{paddingLeft:`${l*18+8}px`},children:[u.jsx("span",{className:ce("h-1.5 w-1.5 shrink-0 rounded-full",e.state==="open"?"bg-emerald-400":"bg-purple-400")}),u.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-fg-6",children:["#",e.number]}),u.jsx("span",{className:"min-w-0 truncate",children:e.title})]}),o.length>0&&u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute top-0 bottom-3 w-px bg-line",style:{left:`${l*18+16}px`}}),o.map(f=>u.jsx(h_,{issue:f,childrenMap:t,currentId:a,onSelect:s,depth:l+1},f.id))]})]})}function l9(e,t){let a=0,s=0;const l=[...t.get(e)??[]];for(let o=0;o<l.length;o++){const d=l[o];a++,d.state==="closed"&&s++;const f=t.get(d.id);f&&l.push(...f)}return{total:a,closed:s}}function o9(e){var o;const t=typeof((o=e.time)==null?void 0:o.created)=="number"?e.time.created:e.createdAt?Date.parse(e.createdAt):0;if(!t||Number.isNaN(t))return"";const a=t<1e12?t*1e3:t,s=new Date(a);return s.toDateString()===new Date().toDateString()?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Q1({session:e,onSelect:t}){var s,l;const a=o9(e);return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:t,className:"block w-full rounded-md border-l-2 border-transparent px-2.5 py-2 text-left transition-colors hover:bg-elevated/50",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((s=e.agent)==null?void 0:s.trim())||"默认"}),a&&u.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:a})]}),u.jsx("div",{className:"mt-0.5 truncate text-sm text-fg-2",children:((l=e.title)==null?void 0:l.trim())||"未命名运行"})]})})}function p_({sessions:e,onSelect:t}){const a=Ue(d=>d.issues),s=new Map(a.map(d=>[d.id,d])),l=new Map,o=[];for(const d of e)if(d.issueId&&s.has(d.issueId)){const f=l.get(d.issueId)??[];f.push(d),l.set(d.issueId,f)}else o.push(d);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-line",children:[u.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[u.jsx(Ev,{className:"h-3.5 w-3.5 text-fg-5"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"运行记录"}),u.jsx("span",{className:"ml-auto rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:e.length})]}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:e.length===0?u.jsx("p",{className:"px-2 py-4 text-center font-mono text-[10px] text-fg-6",children:"暂无运行记录"}):u.jsxs("div",{className:"space-y-3",children:[[...l.entries()].map(([d,f])=>{const m=s.get(d);return u.jsxs("div",{children:[u.jsxs("div",{className:"mb-1 flex items-center gap-1.5 px-1",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",m.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",m.number]}),u.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:m.title})]}),u.jsx("ul",{className:"space-y-0.5",children:f.map(h=>u.jsx(Q1,{session:h,onSelect:()=>t(h.id)},h.id))})]},d)}),o.length>0&&u.jsxs("div",{children:[l.size>0&&u.jsx("div",{className:"mb-1 px-1",children:u.jsx("span",{className:"text-xs font-medium text-fg-5",children:"未关联 Issue"})}),u.jsx("ul",{className:"space-y-0.5",children:o.map(d=>u.jsx(Q1,{session:d,onSelect:()=>t(d.id)},d.id))})]})]})})]})}function u9({rootIssue:e,childrenMap:t,currentId:a,onSelect:s,sessions:l,onSessionSelect:o}){const{total:d,closed:f}=l9(e.id,t),m=d===0?0:Math.round(f/d*100);return u.jsxs("div",{className:"flex w-full flex-col",children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[u.jsx(kA,{className:"h-3.5 w-3.5 text-fg-5"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"子任务树"})]}),d>0&&u.jsxs("div",{className:"border-b border-line px-3 py-2",children:[u.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-elevated",children:u.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-emerald-400 to-blue-500 transition-all",style:{width:`${m}%`}})}),u.jsxs("p",{className:"mt-1 font-mono text-[10px] text-fg-6",children:[f," / ",d," completed"]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:u.jsx(h_,{issue:e,childrenMap:t,currentId:a,onSelect:s,depth:0})})]}),u.jsx(p_,{sessions:l,onSelect:o})]})}function c9({sessions:e,onSessionSelect:t}){return u.jsx("div",{className:"flex w-full flex-col",children:u.jsx(p_,{sessions:e,onSelect:t})})}function d9(){const[e,t]=v.useState("open"),[a,s]=v.useState("stray"),[l,o]=v.useState(!1),[d,f]=v.useState(""),[m,h]=v.useState(null),[x,b]=v.useState(null),[y,T]=v.useState(!1),[N,S]=v.useState(!1),[C,A]=v.useState(null),[D,k]=v.useState(null),[z,V]=v.useState(null),[M,L]=AE(),K=Ue(H=>H.issues),se=Ue(H=>H.syncing),B=Ue(H=>H.syncIssues),U=Ue(H=>H.tags),te=Ue(H=>H.tagFilterMode),ie=Ue(H=>H.cycleTagFilter),Z=Ue(H=>H.clearTagFilter),ee=Ue(H=>H.loadTags),Q=Ue(H=>H.milestones),$=Ue(H=>H.selectedMilestoneId),pe=Ue(H=>H.setMilestoneFilter),ke=Ue(H=>H.loadMilestones),P=qe(H=>H.activeRepoId),R=Le(H=>H.sessions);v.useEffect(()=>{const H=M.get("issueId");H&&K.some(Se=>Se.id===H)&&(h(H),L({},{replace:!0}))},[M,L,K]),v.useEffect(()=>{P&&(ee(),ke())},[P,ee,ke]);const W=new Map;for(const H of R)H.issueId&&!H.parentID&&W.set(H.issueId,(W.get(H.issueId)??0)+1);const O=new Set(K.filter(H=>H.parentId).map(H=>H.parentId)),ge=new Map;for(const H of K)if(H.parentId){const Se=ge.get(H.parentId);Se?Se.push(H):ge.set(H.parentId,[H])}function ve(H){return H.parentId?"task":O.has(H.id)?"epic":"stray"}const Ae=new Map(Q.map(H=>[H.id,H])),$e=e==="all"?K:K.filter(H=>H.state===e),dt=a==="all"?$e:$e.filter(H=>ve(H)===a),ut=te.size===0?dt:dt.filter(H=>{var ft;const Se=new Set((H.labels??[]).map(ln=>ln.name));for(const[ln,Zt]of te){const Ot=(ft=U.find(cn=>cn.id===ln))==null?void 0:ft.name;if(Ot&&(Zt==="include"&&!Se.has(Ot)||Zt==="exclude"&&Se.has(Ot)))return!1}return!0}),Ft=d.trim().toLowerCase(),yn=Ft?ut.filter(H=>`#${H.number} ${H.title}`.toLowerCase().includes(Ft)):ut,da=$?yn.filter(H=>H.milestoneId===$):yn,Aa=D?da.filter(H=>H.authorLogin===D):da,un=z?Aa.filter(H=>(H.assignees??[]).some(Se=>Se.login===z)):Aa,Qn=(()=>{const H=new Map;for(const Se of K)Se.authorLogin&&!H.has(Se.authorLogin)&&H.set(Se.authorLogin,{login:Se.authorLogin,avatar:Se.authorAvatar});return[...H.values()]})(),Je=(()=>{const H=new Map;for(const Se of K)for(const ft of Se.assignees??[])H.has(ft.login)||H.set(ft.login,{login:ft.login,avatar:ft.avatar_url});return[...H.values()]})(),Dn=K.filter(H=>H.state==="open").length,Cn=K.filter(H=>H.state==="closed").length,fa=$e.filter(H=>ve(H)==="epic").length,Ca=$e.filter(H=>ve(H)==="task").length,Wa=$e.filter(H=>ve(H)==="stray").length,ja=K.find(H=>H.id===m)??null,Ar=va(),_t=new Set;if(m&&(_t.add(m),x)){_t.add(x);const H=[...ge.get(x)??[]];for(let Se=0;Se<H.length;Se++){_t.add(H[Se].id);const ft=ge.get(H[Se].id);ft&&H.push(...ft)}}const Ja=R.filter(H=>H.issueId&&_t.has(H.issueId)&&!H.parentID),ue=qe(Da),Te=H=>{Le.setState({activeSessionId:H}),Ar(`/${encodeURIComponent(ue)}/run`)},Pe=IT({onSwipeRight:()=>S(!0),onSwipeLeft:()=>T(!0),disabled:!m||N||y});return u.jsxs("div",{className:"flex min-h-0 flex-1",...Pe,children:[u.jsxs("div",{className:ce("shrink-0 flex-col bg-surface",m?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[m?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"}),P&&u.jsx("div",{className:"flex items-center gap-1",children:u.jsx("button",{type:"button",onClick:()=>void B(),disabled:se,title:"同步",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-3.5 w-3.5",se&&"animate-spin")})})})]}),l&&u.jsx(K1,{onDone:()=>o(!1)}),u.jsx("div",{className:"flex border-b border-line",children:G1.map(({key:H,label:Se})=>{const ft=H==="open"?Dn:H==="closed"?Cn:K.length;return u.jsxs("button",{type:"button",onClick:()=>t(H),className:ce("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===H?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[Se,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===H?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:ft})]},H)})}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:d,onChange:H=>f(H.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&u.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2.5",children:[u.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg",children:"Issues"}),u.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:G1.map(({key:H,label:Se})=>{const ft=H==="open"?Dn:H==="closed"?Cn:K.length;return u.jsxs("button",{type:"button",onClick:()=>t(H),className:ce("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===H?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[Se,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===H?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:ft})]},H)})}),u.jsx("div",{className:"mx-1 h-4 w-px shrink-0 bg-line"}),u.jsxs("button",{type:"button",onClick:()=>A(C==="type"?null:"type"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="type"?"bg-elevated text-fg":a!=="all"?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["类型",a!=="all"&&u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:a==="epic"?"Epic":a==="task"?"任务":"游离"}),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="type"&&"rotate-180")})]}),u.jsxs("button",{type:"button",onClick:()=>A(C==="tag"?null:"tag"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="tag"?"bg-elevated text-fg":te.size>0?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["标签",te.size>0&&u.jsx("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:te.size}),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="tag"&&"rotate-180")})]}),u.jsxs("button",{type:"button",onClick:()=>A(C==="milestone"?null:"milestone"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="milestone"?"bg-elevated text-fg":$?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Milestone",$&&(()=>{const H=Q.find(Se=>Se.id===$);return H?u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:H.title}):null})(),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="milestone"&&"rotate-180")})]}),u.jsxs("button",{type:"button",onClick:()=>A(C==="author"?null:"author"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="author"?"bg-elevated text-fg":D?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Author",D&&u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:D}),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="author"&&"rotate-180")})]}),u.jsxs("button",{type:"button",onClick:()=>A(C==="assignee"?null:"assignee"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="assignee"?"bg-elevated text-fg":z?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Assignee",z&&u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:z}),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="assignee"&&"rotate-180")})]}),u.jsx("div",{className:"min-w-0 flex-1 px-1",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:d,onChange:H=>f(H.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&u.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),P&&u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx("button",{type:"button",onClick:()=>void B(),disabled:se,title:"同步 Issues",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-3.5 w-3.5",se&&"animate-spin")})}),u.jsx("button",{type:"button",onClick:()=>o(H=>!H),title:"新建 Issue",className:ce("flex h-8 w-8 items-center justify-center rounded-md transition-colors",l?"bg-blue-600 text-white":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:u.jsx(Sr,{className:"h-3.5 w-3.5"})})]})]}),C==="type"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:["epic","stray","task","all"].map(H=>{const Se=H==="epic"?"Epic":H==="stray"?"游离":H==="task"?"任务":"全部",ft=H==="epic"?fa:H==="stray"?Wa:H==="task"?Ca:$e.length,ln=a===H;return u.jsxs("button",{type:"button",onClick:()=>s(ln&&H!=="all"?"all":H),className:ce("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-semibold transition-colors",ln?H==="epic"?"bg-amber-400/15 text-amber-400":H==="stray"?"bg-sky-400/15 text-sky-400":H==="task"?"bg-violet-400/15 text-violet-400":"bg-fg-6/20 text-fg-3":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[Se,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px] font-medium",ln?"opacity-70":"text-fg-6"),children:ft})]},H)})}),C==="tag"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:U.length===0?u.jsx("span",{className:"text-xs text-fg-5",children:"暂无标签"}):u.jsxs(u.Fragment,{children:[U.map(H=>{const Se=te.get(H.id);return u.jsxs("button",{type:"button",onClick:()=>ie(H.id),className:ce("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",Se==="include"?"ring-1 ring-current shadow-sm":Se==="exclude"?"opacity-90 line-through decoration-2":"opacity-50 hover:opacity-80"),style:Se==="exclude"?{backgroundColor:`#${H.color}10`,color:`#${H.color}`,boxShadow:`inset 0 0 0 1px color-mix(in srgb, #${H.color} 30%, transparent)`}:{backgroundColor:`#${H.color}18`,color:`#${H.color}`,boxShadow:Se==="include"?`inset 0 0 0 1px color-mix(in srgb, #${H.color} 50%, transparent)`:void 0},children:[Se==="exclude"&&u.jsx("span",{className:"mr-1 text-[10px]",children:"✕"}),H.name]},H.id)}),te.size>0&&u.jsx("button",{type:"button",onClick:Z,className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),C==="milestone"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:Q.length===0?u.jsx("span",{className:"text-xs text-fg-5",children:"暂无里程碑"}):u.jsxs(u.Fragment,{children:[Q.map(H=>{const Se=$===H.id;return u.jsxs("button",{type:"button",onClick:()=>pe(Se?null:H.id),className:ce("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",Se?"bg-indigo-500/15 text-indigo-400 ring-1 ring-indigo-400/50 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[H.title,H.state==="closed"&&u.jsx("span",{className:"ml-1 text-[10px] opacity-60",children:"✓"})]},H.id)}),$&&u.jsx("button",{type:"button",onClick:()=>pe(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),C==="author"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:Qn.length===0?u.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见作者"}):u.jsxs(u.Fragment,{children:[Qn.map(H=>u.jsxs("button",{type:"button",onClick:()=>k(D===H.login?null:H.login),className:ce("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",D===H.login?"bg-blue-500/15 text-blue-400 ring-1 ring-blue-500/30 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[H.avatar&&u.jsx("img",{src:H.avatar,alt:"",className:"h-4 w-4 rounded-full"}),H.login]},H.login)),D&&u.jsx("button",{type:"button",onClick:()=>k(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),C==="assignee"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:Je.length===0?u.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见指派人"}):u.jsxs(u.Fragment,{children:[Je.map(H=>u.jsxs("button",{type:"button",onClick:()=>V(z===H.login?null:H.login),className:ce("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",z===H.login?"bg-blue-500/15 text-blue-400 ring-1 ring-blue-500/30 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[H.avatar&&u.jsx("img",{src:H.avatar,alt:"",className:"h-4 w-4 rounded-full"}),H.login]},H.login)),z&&u.jsx("button",{type:"button",onClick:()=>V(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),l&&u.jsx(K1,{onDone:()=>o(!1)})]}),u.jsx("div",{className:ce("flex-1 overflow-y-auto",m?"px-2 py-2":"px-3 py-3"),children:P?un.length===0?u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:K.length===0?"点击 ↻ 同步 Issues":"无匹配 Issue"}):u.jsx("ul",{className:ce(m?"space-y-0.5":"space-y-1"),children:un.map(H=>m?u.jsx(V1,{issue:H,sessionCount:W.get(H.id)??0,isActive:m===H.id,isEpic:ve(H)==="epic",milestone:H.milestoneId?Ae.get(H.milestoneId):void 0,onSelect:()=>{h(H.id),b(ve(H)==="epic"?H.id:null)}},H.id):u.jsx(s9,{issue:H,sessionCount:W.get(H.id)??0,isEpic:ve(H)==="epic",milestone:H.milestoneId?Ae.get(H.milestoneId):void 0,onSelect:()=>{h(H.id),b(ve(H)==="epic"?H.id:null)}},H.id))}):u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),m&&u.jsx(ah,{side:"left",open:N,onClose:()=>S(!1),children:u.jsxs("div",{className:"flex h-full flex-col",children:[u.jsx("div",{className:"border-b border-line px-3 py-3",children:u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:un.length===0?u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"无匹配 Issue"}):u.jsx("ul",{className:"space-y-0.5",children:un.map(H=>u.jsx(V1,{issue:H,sessionCount:W.get(H.id)??0,isActive:m===H.id,isEpic:ve(H)==="epic",milestone:H.milestoneId?Ae.get(H.milestoneId):void 0,onSelect:()=>{h(H.id),b(ve(H)==="epic"?H.id:null),S(!1)}},H.id))})})]})}),m&&u.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col bg-term",children:ja?u.jsxs(u.Fragment,{children:[u.jsx(i9,{issue:ja,milestone:ja.milestoneId?Ae.get(ja.milestoneId):void 0,onBack:()=>{h(null),b(null),T(!1)},onClose:()=>{h(null),b(null),T(!1)},onToggleSidebar:()=>T(H=>!H)}),y&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"absolute inset-0 z-10 bg-black/30",onClick:()=>T(!1)}),u.jsxs("div",{className:"absolute right-0 top-0 bottom-0 z-20 flex w-[280px] flex-col border-l border-line bg-surface shadow-xl",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-line px-3 py-2.5",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:x?"子任务树 & 运行记录":"运行记录"}),u.jsx("button",{type:"button",onClick:()=>T(!1),className:"flex h-6 w-6 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:u.jsx(Tt,{className:"h-4 w-4"})})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:x?(()=>{const H=K.find(Se=>Se.id===x);return H?u.jsx(u9,{rootIssue:H,childrenMap:ge,currentId:m,onSelect:Se=>{h(Se),T(!1)},sessions:Ja,onSessionSelect:Te}):null})():u.jsx(c9,{sessions:Ja,onSessionSelect:Te})})]})]})]}):u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"Issue 未找到"})})})]})}const X1=[{key:"open",label:"开放"},{key:"merged",label:"已合并"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function g_(e){const t=e<1e12?e*1e3:e,a=Date.now()-t;return a<6e4?"刚刚":a<36e5?`${Math.floor(a/6e4)}分钟前`:a<864e5?`${Math.floor(a/36e5)}小时前`:a<2592e6?`${Math.floor(a/864e5)}天前`:new Date(t).toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}function f9(e){return e==="merged"?"bg-purple-500/15 text-purple-400":e==="closed"?"bg-red-500/15 text-red-400":"bg-emerald-500/15 text-emerald-400"}function m9({pr:e,isActive:t,onSelect:a}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:a,className:ce("group flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors",t?"border-l-2 border-blue-500 bg-elevated/80":"border-l-2 border-transparent hover:bg-elevated/50"),children:[u.jsx("span",{className:ce("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold ring-1",e.state==="merged"?"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-purple-500/25":e.state==="closed"?"bg-gradient-to-br from-red-500/20 to-red-500/5 text-red-400 ring-red-500/25":"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-emerald-500/25"),children:e.number}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[e.draft===1&&u.jsx("span",{className:"shrink-0 rounded px-1 py-0.5 text-[9px] font-bold bg-fg-6/15 text-fg-4",children:"DRAFT"}),u.jsx("span",{className:"min-w-0 text-xs font-medium text-fg-2 group-hover:text-fg",children:e.title})]}),u.jsxs("div",{className:"mt-0.5 truncate font-mono text-[10px] text-fg-6",children:[e.headBranch," → ",e.baseBranch]}),e.labels&&e.labels.length>0&&u.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(s=>u.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${s.color}20`,color:`#${s.color}`},children:s.name},s.id))})]})]})})}function h9({pr:e,onSelect:t}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:t,className:"group flex w-full items-center gap-3 border-b border-line px-4 py-3 text-left transition-colors hover:bg-elevated/50",children:[u.jsx("span",{className:ce("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold ring-1",e.state==="merged"?"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-purple-500/25":e.state==="closed"?"bg-gradient-to-br from-red-500/20 to-red-500/5 text-red-400 ring-red-500/25":"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-emerald-500/25"),children:e.number}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[e.draft===1&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wide bg-fg-6/15 text-fg-4",children:"DRAFT"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:e.title}),e.mergeable==="false"&&e.state==="open"&&u.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[u.jsx(Kn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]}),e.assignees&&e.assignees.length>0&&u.jsx("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:e.assignees.slice(0,3).map(a=>u.jsx("img",{src:a.avatar_url,alt:a.login,title:a.login,className:"h-5 w-5 rounded-full ring-2 ring-surface"},a.login))})]}),u.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[u.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-fg-5",children:[e.headBranch," → ",e.baseBranch]}),u.jsx("span",{className:"text-fg-6",children:"·"}),e.authorLogin&&u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&u.jsx("img",{src:e.authorAvatar,alt:"",className:"mr-1 inline-block h-3.5 w-3.5 rounded-full align-text-bottom"}),e.authorLogin]}),u.jsx("span",{className:"text-fg-6",children:"·"})]}),u.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:g_(e.createdAt)}),e.labels&&e.labels.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-fg-6",children:"·"}),e.labels.map(a=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-medium",style:{backgroundColor:`#${a.color}20`,color:`#${a.color}`},children:a.name},a.id))]})]})]})]})})}function p9({issue:e,linked:t,onToggle:a}){return u.jsx("li",{children:u.jsx("button",{type:"button",onClick:a,className:ce("group flex w-full items-start gap-2 rounded-md px-3 py-2.5 text-left transition-colors",t?"border-l-2 border-emerald-500 bg-emerald-500/5":"border-l-2 border-transparent hover:bg-elevated/50"),children:u.jsx("div",{className:"min-w-0 flex-1",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-xs font-medium",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number]}),u.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-fg-2",children:e.title}),t&&u.jsx(Lc,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-emerald-400"})]})})})})}function g9({pr:e,onBack:t,onClose:a,onEnterMatch:s}){var k;const l=qe(z=>z.activeRepoId),o=qe(Da),[d,f]=v.useState(!1),[m,h]=v.useState([]),[x,b]=v.useState(!1),[y,T]=v.useState([]),N=va(),S=Gn(z=>z.unlinkIssue);v.useEffect(()=>{l&&(b(!0),q3(l,e.number).then(h).catch(()=>h([])).finally(()=>b(!1)))},[l,e.number]),v.useEffect(()=>{l&&XE(l,e.number).then(T).catch(()=>T([]))},[l,e.number]);const C=async z=>{if(!(d||!l)){f(!0);try{if(await H3(l,e.number),z&&y.length>0){const V=y.filter(M=>M.state==="open");await Promise.all(V.map(M=>QE(l,M.number,{state:"closed"}))),T(M=>M.map(L=>L.state==="open"?{...L,state:"closed"}:L)),Ue.getState().loadIssues(),Yt.getState().addToast(`PR #${e.number} 合入成功,已关闭 ${V.length} 个 Issue`,"success")}else Yt.getState().addToast(`PR #${e.number} 合入成功`,"success");Gn.getState().loadPulls()}catch(V){let M="合入失败";if(V instanceof Hs)try{M=JSON.parse(V.message).error??M}catch{M=V.message}Yt.getState().addToast(M,"error")}finally{f(!1)}}},A=async z=>{await S(e.number,z)&&T(M=>M.filter(L=>L.number!==z))},D=z=>{const V=new Date(z);return V.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})+" "+V.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})};return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("header",{className:"flex flex-col gap-2 border-b border-line px-4 py-3 md:flex-row md:items-center md:gap-3 md:px-6",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[u.jsx("button",{type:"button",onClick:t,"aria-label":"返回列表",className:"-ml-1 shrink-0 rounded-md p-1.5 text-fg-3 transition-colors hover:bg-elevated hover:text-fg md:hidden",children:u.jsx(RE,{className:"h-5 w-5"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",f9(e.state)),children:["#",e.number," ",e.state]}),e.draft===1&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-bold bg-fg-6/15 text-fg-4",children:"DRAFT"}),e.mergeable==="false"&&e.state==="open"&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:"Conflict"}),(k=e.labels)==null?void 0:k.map(z=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${z.color}20`,color:`#${z.color}`},children:z.name},z.id))]}),u.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),u.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-xs text-fg-4",children:[u.jsxs("span",{className:"flex items-center gap-1 font-mono text-[11px] text-fg-5",children:[u.jsx(mo,{className:"h-3.5 w-3.5"}),e.headBranch," → ",e.baseBranch]}),e.authorLogin&&u.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&u.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.mergedAt&&u.jsxs("span",{className:"text-purple-400",children:["合并于 ",g_(e.mergedAt)]})]})]})]}),u.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&u.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(hc,{className:"h-3.5 w-3.5"}),"源站"]}),u.jsxs("button",{type:"button",onClick:s,className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[u.jsx(Lc,{className:"h-3.5 w-3.5"}),"关联 Issue"]}),e.state==="open"&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",disabled:d||e.mergeable==="false",onClick:()=>void C(!1),className:"flex h-8 items-center gap-1.5 rounded-md border border-emerald-500/30 px-2.5 text-xs font-medium text-emerald-400 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 disabled:opacity-40",children:[u.jsx(pc,{className:"h-3.5 w-3.5"}),"合入"]}),y.some(z=>z.state==="open")&&u.jsxs("button",{type:"button",disabled:d||e.mergeable==="false",onClick:()=>void C(!0),className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(pc,{className:"h-3.5 w-3.5"}),"合入并关闭 Issues"]})]}),a&&u.jsx("button",{type:"button",onClick:a,title:"关闭详情",className:"hidden h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 md:flex",children:u.jsx(Tt,{className:"h-4 w-4"})})]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:u.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[y.length>0&&u.jsxs("div",{className:"mb-6 rounded-lg border border-line bg-elevated/30 px-4 py-3",children:[u.jsxs("h3",{className:"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[u.jsx(fo,{className:"h-3.5 w-3.5"}),"关联 Issues (",y.length,")"]}),u.jsx("div",{className:"space-y-1.5",children:y.map(z=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>N(`/${encodeURIComponent(o)}/issues?issueId=${encodeURIComponent(z.id)}`),className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-1 py-0.5 transition-colors hover:bg-elevated/60",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",z.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",z.number]}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-fg-2",children:z.title})]}),u.jsx("button",{type:"button",onClick:()=>void A(z.number),title:"取消关联",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-400",children:u.jsx(OE,{className:"h-3.5 w-3.5"})})]},z.id))})]}),e.body?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:e.body})}):u.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 PR 没有描述内容"}),x?u.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):m.length>0&&u.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[u.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",m.length,")"]}),u.jsx("div",{className:"space-y-4",children:m.map(z=>u.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:z.user.avatar_url,alt:z.user.login,className:"h-5 w-5 rounded-full"}),u.jsx("span",{className:"text-xs font-semibold text-fg-2",children:z.user.login}),u.jsx("span",{className:"text-[10px] text-fg-6",children:D(z.created_at)})]}),u.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:z.body})})]},z.id))})]})]})})]})}function b9(){const[e,t]=v.useState("open"),[a,s]=v.useState(""),[l,o]=v.useState(null),[d,f]=v.useState(""),[m,h]=AE(),x=Gn($=>$.pulls),b=Gn($=>$.syncing),y=Gn($=>$.syncPulls),T=Gn($=>$.matchingPrId),N=Gn($=>$.enterMatchMode),S=Gn($=>$.exitMatchMode),C=Gn($=>$.linkIssue),A=qe($=>$.activeRepoId),D=Ue($=>$.issues);v.useEffect(()=>{const $=m.get("prId");$&&x.some(pe=>pe.id===$)&&(o($),h({},{replace:!0}))},[m,h,x]);const k=T?x.find($=>$.id===T)??null:null,[z,V]=v.useState(new Set);v.useEffect(()=>{if(!A||!k){V(new Set);return}XE(A,k.number).then($=>V(new Set($.map(pe=>pe.id)))).catch(()=>V(new Set))},[A,k]);const M=async $=>{if(!k)return;z.has($.id)?await Gn.getState().unlinkIssue(k.number,$.number)&&V(P=>{const R=new Set(P);return R.delete($.id),R}):await C(k.number,$.number)&&V(P=>new Set(P).add($.id))},L=x.filter($=>$.state==="open").length,K=x.filter($=>$.state==="merged").length,se=x.filter($=>$.state==="closed").length,B=e==="all"?x:x.filter($=>$.state===e),U=a.trim().toLowerCase(),te=U?B.filter($=>`#${$.number} ${$.title} ${$.headBranch} ${$.baseBranch}`.toLowerCase().includes(U)):B,ie=d.trim().toLowerCase(),Z=ie?D.filter($=>`#${$.number} ${$.title}`.toLowerCase().includes(ie)):D,ee=x.find($=>$.id===l)??null,Q=k??ee;return u.jsxs("div",{className:"flex min-h-0 flex-1",children:[u.jsxs("div",{className:ce("shrink-0 flex-col bg-surface",Q?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[T?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:"选择 Issue 关联"}),u.jsxs("button",{type:"button",onClick:S,className:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[u.jsx(Tt,{className:"h-3.5 w-3.5"}),"完成"]})]}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:d,onChange:$=>f($.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&u.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:Z.length===0?u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:D.length===0?"暂无 Issue,请先同步":"无匹配 Issue"}):u.jsx("ul",{className:"space-y-0.5",children:Z.map($=>u.jsx(p9,{issue:$,linked:z.has($.id),onToggle:()=>void M($)},$.id))})})]}):Q?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Pull Requests"}),A&&u.jsx("button",{type:"button",onClick:()=>void y(),disabled:b,title:"同步",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-3.5 w-3.5",b&&"animate-spin")})})]}),u.jsx("div",{className:"flex border-b border-line",children:X1.map(({key:$,label:pe})=>{const ke=$==="open"?L:$==="merged"?K:$==="closed"?se:x.length;return u.jsxs("button",{type:"button",onClick:()=>t($),className:ce("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===$?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[pe,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===$?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:ke})]},$)})}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:a,onChange:$=>s($.target.value),placeholder:"搜索 PR...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),a&&u.jsx("button",{type:"button",onClick:()=>s(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})})]}):u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2.5",children:[u.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg",children:"Pull Requests"}),u.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:X1.map(({key:$,label:pe})=>{const ke=$==="open"?L:$==="merged"?K:$==="closed"?se:x.length;return u.jsxs("button",{type:"button",onClick:()=>t($),className:ce("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===$?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[pe,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===$?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:ke})]},$)})}),u.jsx("div",{className:"min-w-0 flex-1 px-1",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:a,onChange:$=>s($.target.value),placeholder:"搜索 PR...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),a&&u.jsx("button",{type:"button",onClick:()=>s(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),u.jsx("button",{type:"button",onClick:()=>void y(),disabled:b||!A,title:"同步 PR",className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-4 w-4",b&&"animate-spin")})})]})}),!T&&u.jsx("div",{className:ce("flex-1 overflow-y-auto",Q?"px-2 py-2":"px-3 py-3"),children:A?te.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-fg-5",children:[u.jsx(mo,{className:"h-8 w-8"}),u.jsx("p",{className:"font-mono text-xs",children:x.length===0?"点击 ↻ 同步 PR":"没有匹配的 PR"})]}):u.jsx("ul",{className:ce(Q?"space-y-0.5":"space-y-1"),children:te.map($=>Q?u.jsx(m9,{pr:$,isActive:$.id===(l??T),onSelect:()=>o($.id)},$.id):u.jsx(h9,{pr:$,onSelect:()=>o($.id)},$.id))}):u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),Q?u.jsx(g9,{pr:Q,onBack:()=>{o(null),T&&S()},onClose:()=>{o(null),T&&S()},onEnterMatch:()=>N(Q.id)},`${Q.id}-${T??"view"}`):u.jsx("div",{className:"hidden flex-1 items-center justify-center md:flex",children:u.jsxs("div",{className:"text-center text-fg-5",children:[u.jsx(mo,{className:"mx-auto h-12 w-12 opacity-20"}),u.jsx("p",{className:"mt-3 font-mono text-xs",children:"选择一个 PR 查看详情"})]})})]})}let yr=null;function x9(e){const t=Date.now()-e,a=Math.floor(t/6e4);return a<1?"刚刚":a<60?`${a} 分钟前`:`${Math.floor(a/60)} 小时前`}const Z1=[{id:"usage",label:"Claude 账号",icon:Sh},{id:"git",label:"Git 源站",icon:_o},{id:"models",label:"模型",icon:lc},{id:"custom-agents",label:"Custom Agents",icon:Rv},{id:"agents",label:"AGENTS.md",icon:ME}],E9={id:"server",label:"服务器",icon:UE};function y9(e){if(!e)return null;const t=new Date(e).getTime()-Date.now();if(t<=0)return"已重置";const a=Math.floor(t/36e5),s=Math.floor(t%36e5/6e4);return a>0?`${a}h ${s}m 后重置`:`${s}m 后重置`}function T9(e){return e>=90?"bg-red-500":e>=70?"bg-amber-500":"bg-blue-500"}function Bm({label:e,window:t}){if(!t)return null;const a=Math.round(t.utilization),s=y9(t.resets_at),l=a>=90,o=a>=70;return u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:e}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s&&u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-elevated px-1.5 py-0.5 text-[10px] font-medium text-fg-4 tabular-nums",children:[u.jsx($v,{className:"h-2.5 w-2.5"}),s]}),u.jsxs("span",{className:ce("text-sm font-bold leading-none tabular-nums",l?"text-red-400":o?"text-amber-400":"text-fg"),children:[a,"%"]})]})]}),u.jsx("div",{className:"h-2.5 overflow-hidden rounded-full bg-elevated ring-1 ring-inset ring-line/60",children:u.jsx("div",{className:ce("h-full rounded-full transition-all duration-500 ease-out",T9(a),l?"shadow-sm shadow-red-500/50":o?"shadow-sm shadow-amber-500/40":null),style:{width:`${Math.min(a,100)}%`}})})]})}function _9({account:e,onSwitch:t,switching:a}){var l;const s=e.active;return u.jsxs("div",{className:ce("relative overflow-hidden rounded-xl border bg-base p-4 shadow-sm transition-colors",s?"border-blue-500/30 ring-1 ring-inset ring-blue-500/20":"border-line"),children:[s&&u.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-1 bg-blue-500"}),u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx("div",{className:ce("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg",s?"bg-blue-500/15 text-blue-500":"bg-elevated text-fg-4"),children:u.jsx(PE,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:e.label}),s&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full bg-blue-500/15 px-2 py-0.5 text-[10px] font-semibold text-blue-500",children:[u.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 shadow-sm shadow-blue-500/60"}),"当前"]}),!s&&t&&u.jsxs("button",{type:"button",onClick:()=>t(e.id),disabled:a,className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-line px-2 py-0.5 text-[10px] font-medium text-fg-4 transition-colors hover:border-blue-500/50 hover:text-blue-500 disabled:opacity-40",children:[a&&u.jsx(Va,{className:"h-2.5 w-2.5 fs-spin"}),"切换"]}),e.excluded&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-elevated px-2 py-0.5 text-[10px] font-medium text-fg-5",children:[u.jsx(wv,{className:"h-2.5 w-2.5"}),"不自动切"]}),e.needsReauth&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-red-500/15 px-2 py-0.5 text-[10px] font-medium text-red-400",children:[u.jsx(Kn,{className:"h-2.5 w-2.5"}),"需重新登录"]})]}),e.error&&!e.usage?u.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"min-w-0 break-words",children:e.error})]}):e.usage?u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsx(Bm,{label:"5 小时窗口",window:e.usage.five_hour}),u.jsx(Bm,{label:"7 天窗口",window:e.usage.seven_day}),(l=e.usage.scoped)==null?void 0:l.map(o=>u.jsx(Bm,{label:o.label,window:o},o.label))]}):null]})}function N9(){const[e,t]=v.useState((yr==null?void 0:yr.data)??null),[a,s]=v.useState(!yr),[l,o]=v.useState(null),[d,f]=v.useState(null),[m,h]=v.useState((yr==null?void 0:yr.fetchedAt)??null),[,x]=v.useState(0),b=v.useCallback(S=>{const C=Date.now();yr={data:S,fetchedAt:C},t(S),h(C)},[]),y=v.useCallback(()=>{s(!0),o(null),aC().then(S=>{b(S),s(!1)}).catch(S=>{o(S instanceof Error?S.message:String(S)),s(!1)})},[b]);v.useEffect(()=>{yr||y()},[y]),v.useEffect(()=>{const S=setInterval(()=>x(C=>C+1),3e4);return()=>clearInterval(S)},[]);const T=v.useRef(!1),N=v.useCallback(S=>{T.current||(T.current=!0,f(S),rC(S).then(C=>{b(C),f(null)}).catch(C=>{o(C instanceof Error?C.message:String(C)),f(null)}).finally(()=>{T.current=!1}))},[b]);return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:u.jsx(sA,{className:"h-4 w-4"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Claude 订阅额度"}),u.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"各账号的 Pro/Max 订阅窗口用量。"})]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[m&&u.jsx("span",{className:"text-[10px] tabular-nums text-fg-5",children:x9(m)}),u.jsx("button",{type:"button",onClick:y,disabled:a,className:"rounded-md p-1.5 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-4 w-4",a&&"fs-spin")})})]})]}),u.jsx("div",{className:"mt-4 space-y-2.5",children:a&&!e?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(Va,{className:"h-5 w-5 fs-spin"}),u.jsx("p",{className:"text-xs",children:"加载中…"})]}):l&&!e?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[u.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-red-500/10",children:u.jsx(Kn,{className:"h-5 w-5"})}),u.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:l})]}):e&&e.accounts.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-elevated text-fg-4",children:u.jsx(XA,{className:"h-5 w-5"})}),u.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:"未找到账号。请在 OpenCode TUI 中通过 claude-accounts-usage 插件登录。"})]}):e?e.accounts.map(S=>u.jsx(_9,{account:S,onSwitch:N,switching:d===S.id},S.id)):null})]})}function S9({host:e,onDelete:t}){const[a,s]=v.useState(!1);return u.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-3",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm font-medium text-fg",children:e.name}),u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:e.platform})]}),u.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-xs text-fg-4",children:[u.jsx("span",{children:e.host}),u.jsx("span",{className:"text-fg-6",children:"·"}),u.jsx("span",{className:"text-fg-5",children:e.token})]})]}),a?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-red-400 hover:bg-red-500/10",children:u.jsx(oa,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>s(!1),className:"rounded p-1.5 text-fg-4 hover:bg-elevated",children:u.jsx(Tt,{className:"h-4 w-4"})})]}):u.jsx("button",{type:"button",onClick:()=>s(!0),className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:u.jsx(ji,{className:"h-4 w-4"})})]})}function v9({onAdded:e}){const[t,a]=v.useState(!1),[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(""),[h,x]=v.useState("gitea"),[b,y]=v.useState(!1),[T,N]=v.useState(!1),S=()=>{l(""),d(""),m(""),x("gitea"),a(!1)},C=async()=>{if(!(!s.trim()||!o.trim()||!f.trim())){y(!0);try{await tC(s.trim(),o.trim(),f.trim(),h),S(),e()}finally{y(!1)}}};return t?u.jsxs("div",{className:"space-y-3 rounded-lg border border-line bg-base p-4",children:[u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("label",{className:"flex-1",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),u.jsx("input",{type:"text",value:o,onChange:A=>d(A.target.value),placeholder:"公司 Gitea",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("label",{className:"w-28",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"平台"}),u.jsxs("select",{value:h,onChange:A=>x(A.target.value),className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:[u.jsx("option",{value:"gitea",children:"Gitea"}),u.jsx("option",{value:"github",children:"GitHub"}),u.jsx("option",{value:"gitlab",children:"GitLab"})]})]})]}),u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Host"}),u.jsx("input",{type:"text",value:s,onChange:A=>l(A.target.value),placeholder:"git.btsai.work",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Token"}),u.jsxs("div",{className:"relative mt-1",children:[u.jsx("input",{type:T?"text":"password",value:f,onChange:A=>m(A.target.value),placeholder:"Personal Access Token",className:"w-full rounded-md border border-line bg-surface px-3 py-1.5 pr-9 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),u.jsx("button",{type:"button",onClick:()=>N(!T),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-fg-5 hover:text-fg-3",children:T?u.jsx(Jv,{className:"h-3.5 w-3.5"}):u.jsx(tA,{className:"h-3.5 w-3.5"})})]})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u.jsx("button",{type:"button",onClick:S,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void C(),disabled:b||!s.trim()||!o.trim()||!f.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:b?"保存中…":"保存"})]})]}):u.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(Sr,{className:"h-3.5 w-3.5"})," 添加 Git 源站"]})}function A9(){const[e,t]=v.useState(""),[a,s]=v.useState(""),[l,o]=v.useState(!0),[d,f]=v.useState(!1),[m,h]=v.useState(null);v.useEffect(()=>{K3().then(y=>{t(y.content),s(y.content),o(!1)}).catch(y=>{h(y instanceof Error?y.message:String(y)),o(!1)})},[]);const x=async()=>{f(!0),h(null);try{await V3(e),s(e)}catch(y){h(y instanceof Error?y.message:String(y))}f(!1)},b=e!==a;return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"全局 AGENTS.md"}),u.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"此内容会注入到所有仓库的 Agent 系统指令中。修改后 opencode 热加载,即时生效。"})]}),u.jsxs("button",{type:"button",onClick:()=>void x(),disabled:d||!b,className:"flex shrink-0 items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(Pc,{className:"h-3.5 w-3.5"}),d?"保存中…":"保存"]})]}),m&&u.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"min-w-0 break-words",children:m})]}),u.jsx("div",{className:"mt-4",children:l?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(Va,{className:"h-5 w-5 fs-spin"}),u.jsx("p",{className:"text-xs",children:"加载中…"})]}):u.jsx("textarea",{value:e,onChange:y=>t(y.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
444
+ `);return u.jsxs("div",{className:"grid grid-cols-1 gap-px overflow-x-auto rounded text-xs md:grid-cols-2",children:[u.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-del",children:a.map((l,o)=>u.jsxs("div",{children:[u.jsx("span",{className:"select-none text-red-400/70",children:"− "}),u.jsx("span",{className:"text-red-400",children:l})]},o))}),u.jsx("pre",{className:"min-w-0 whitespace-pre-wrap break-words p-1.5 fs-diff-add",children:s.map((l,o)=>u.jsxs("div",{children:[u.jsx("span",{className:"select-none text-emerald-400/70",children:"+ "}),u.jsx("span",{className:"text-emerald-400",children:l})]},o))})]})}const b1={completed:{glyph:"✓",color:"text-emerald-400"},in_progress:{glyph:"◌",color:"text-amber-400"},cancelled:{glyph:"✗",color:"text-fg-5"},pending:{glyph:"○",color:"text-fg-4"}};function RT({todos:e}){return u.jsx("ul",{className:"space-y-0.5 text-xs",children:e.map((t,a)=>{var f;const s=((f=t.status)==null?void 0:f.toLowerCase())??"pending",l=s==="in-progress"||s==="active"?"in_progress":s==="done"||s==="complete"?"completed":s==="canceled"?"cancelled":s,o=b1[l]??b1.pending,d=l==="completed"||l==="cancelled";return u.jsxs("li",{className:"flex items-start gap-1.5",children:[u.jsx("span",{className:ce("shrink-0 leading-5",o.color,l==="in_progress"&&"fs-spin"),children:o.glyph}),u.jsx("span",{className:ce("leading-5",d?"text-fg-5 line-through":"text-fg-2"),children:t.content}),t.priority&&u.jsx("span",{className:"ml-auto shrink-0 text-fg-5",children:t.priority})]},a)})})}const nM={"visual-engineering":"bg-purple-500/15 text-purple-400",quick:"bg-emerald-500/15 text-emerald-400",deep:"bg-blue-500/15 text-blue-400",ultrabrain:"bg-amber-500/15 text-amber-400",artistry:"bg-pink-500/15 text-pink-400",writing:"bg-cyan-500/15 text-cyan-400","unspecified-low":"bg-elevated text-fg-4","unspecified-high":"bg-elevated text-fg-3"},aM={explore:"bg-teal-500/15 text-teal-400",librarian:"bg-indigo-500/15 text-indigo-400",oracle:"bg-amber-500/15 text-amber-400",metis:"bg-rose-500/15 text-rose-400",momus:"bg-orange-500/15 text-orange-400"};function rM({record:e}){const[t,a]=v.useState(!1),s=typeof e.category=="string"?e.category:null,l=typeof e.subagent_type=="string"?e.subagent_type:null,o=Ga(e,["description","title"]),d=typeof e.prompt=="string"?e.prompt:null,f=Array.isArray(e.load_skills)?e.load_skills.filter(y=>typeof y=="string"):[],m=typeof e.run_in_background=="boolean"?e.run_in_background:!1,h=typeof e.task_id=="string"?e.task_id:null,x=s??l,b=(s&&nM[s])??(l&&aM[l])??"bg-elevated text-fg-3";return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[x&&u.jsx("span",{className:ce("rounded px-1.5 py-0.5 text-[10px] font-medium",b),children:x}),f.map(y=>u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-4",children:y},y)),m&&u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 text-[10px] text-fg-5",children:"bg"}),h&&u.jsxs("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",title:h,children:["↩ ",h.slice(0,16),"…"]})]}),o&&u.jsx("p",{className:"text-xs text-fg-2",children:o}),d&&u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>a(y=>!y),className:"flex items-center gap-1 text-[10px] text-fg-4 transition-colors hover:text-fg-2",children:[u.jsx(_h,{className:ce("h-3 w-3 transition-transform",t&&"rotate-90")}),"Prompt",u.jsxs("span",{className:"text-fg-5",children:["(",d.length," chars)"]})]}),t&&u.jsx("pre",{className:"mt-1 max-h-60 overflow-y-auto whitespace-pre-wrap break-words rounded bg-elevated/50 p-2 text-[11px] leading-relaxed text-fg-3",children:d})]})]})}function sM(e){const t=_C(e),a=Le(m=>m.activeSessionId),s=Le(m=>m.sessions);if(t)return t;if(!a)return null;const l=Hc(e),o=Kh(l),d=Ga(o,["description","title"]),f=s.filter(m=>m.parentID===a);if(f.length===0)return null;if(f.length===1)return f[0].id;if(d){const m=f.find(h=>h.title===d);if(m)return m.id}return null}function iM({part:e}){const t=sM(e),a=Le(s=>s.setActiveSession);return t?u.jsxs("button",{type:"button",onClick:s=>{s.stopPropagation(),a(t)},className:"mt-2 flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 font-mono text-xs text-blue-400 transition-colors hover:border-blue-500/50 hover:bg-blue-500/10",children:[u.jsxs("span",{className:"truncate text-fg-5",children:[t.slice(0,20),"…"]}),u.jsx(vv,{className:"h-3 w-3 shrink-0"}),u.jsx("span",{className:"shrink-0",children:"查看子会话"})]}):null}function lM(e,t){const a=Kh(t);if(!a)return null;const s=e.toLowerCase();if(s==="edit"||s==="patch"){const l=typeof a.oldString=="string"?a.oldString:"",o=typeof a.newString=="string"?a.newString:"";if(l||o)return u.jsx(tM,{oldStr:l,newStr:o})}if(s==="todowrite"||s==="write_todos"){const l=Array.isArray(a.todos)?a.todos:null;if(l&&l.length>0)return u.jsx(RT,{todos:l})}if(s==="bash"||s==="shell"){const l=Ga(a,["command","cmd","script"]);if(l)return u.jsxs("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:[u.jsx("span",{className:"select-none text-emerald-400/70",children:"❯ "}),l]})}if(s==="task"||s==="agent")return u.jsx(rM,{record:a});if(s==="read")return null;if(s==="write"){const l=typeof a.content=="string"?a.content:null;if(l){const o=l.length>500?`${l.slice(0,500)}…`:l;return u.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:o})}}return null}function oM(e,t){const a=e.toLowerCase();if(a==="todowrite"||a==="write_todos"){const s=Array.isArray(t)?t:null;if(s&&s.length>0)return u.jsx(RT,{todos:s})}return null}function uM({part:e}){const t=wh(e),a=t==="running"||t==="pending",[s,l]=v.useState(a),[o,d]=v.useState(!1),f=v.useRef(a);v.useEffect(()=>{f.current!==a&&(l(a),f.current=a)},[a]);const m=ey(e),h=m.toLowerCase(),x=h==="task"||h==="agent",b=Hc(e),{label:y,arg:T}=eM(m,b),N=lM(m,b),S=N?null:cx(b),C=Ch(e),A=oM(m,C),D=A?"":cx(C),k=J6[t],z=D.length>Im,V=o||!z?D:`${D.slice(0,Im)}…`;return u.jsxs("div",{className:"my-1 overflow-hidden rounded-md border border-line bg-term/70",children:[u.jsxs("button",{type:"button",onClick:()=>l(M=>!M),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left font-mono text-xs transition-colors duration-150 hover:bg-surface/70",children:[u.jsx("span",{className:ce("shrink-0 leading-none",k.color),children:s?"▾":"▸"}),u.jsx("span",{className:"shrink-0 font-medium text-fg",children:y}),T&&u.jsx("span",{className:"truncate text-fg-3",children:T}),u.jsxs("span",{className:ce("ml-auto flex shrink-0 items-center gap-1.5 leading-none",k.color),children:[u.jsx("span",{className:ce(k.spin&&"fs-spin"),children:k.glyph}),u.jsx("span",{children:k.label})]})]}),s&&u.jsx("div",{className:"border-t border-line px-3 py-2",children:u.jsxs("div",{className:ce("ml-1 border-l-2 pl-3 font-mono text-xs",k.accent),children:[N&&u.jsx("section",{className:"mb-2",children:N}),S&&u.jsxs("section",{className:"mb-2",children:[u.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"input"}),u.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:S})]}),x&&u.jsx(iM,{part:e}),A&&u.jsx("section",{children:A}),D&&u.jsxs("section",{children:[u.jsx("div",{className:"mb-1 text-[10px] uppercase tracking-wider text-fg-5",children:"output"}),u.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-words text-fg-2",children:V}),z&&u.jsx("button",{type:"button",onClick:()=>d(M=>!M),className:"mt-1 text-blue-400 transition-colors hover:text-blue-300",children:o?"show less":`show ${D.length-Im} more chars`})]}),!N&&!S&&!A&&!D&&u.jsx("div",{className:"text-fg-5",children:"no parameters"})]})})]})}function cM({text:e}){const[t,a]=v.useState(!1);return u.jsxs("div",{className:"my-1",children:[u.jsxs("button",{type:"button",onClick:()=>a(s=>!s),className:"flex items-center gap-1.5 font-mono text-xs text-fg-5 transition-colors hover:text-fg-3",children:[t?u.jsx(ss,{className:"h-3 w-3 shrink-0"}):u.jsx(_h,{className:"h-3 w-3 shrink-0"}),u.jsx(kE,{className:"h-3 w-3 shrink-0"}),u.jsx("span",{children:"thinking"})]}),t&&u.jsx("div",{className:"ml-1.5 mt-1 whitespace-pre-wrap border-l border-line pl-3 text-xs italic leading-relaxed text-fg-4",children:e})]})}function dM(){const[e,t]=v.useState(0);return v.useEffect(()=>{const a=Date.now(),s=setInterval(()=>{t(Math.floor((Date.now()-a)/1e3))},1e3);return()=>clearInterval(s)},[]),u.jsxs("div",{className:"my-1 flex items-center gap-1.5 font-mono text-xs text-fg-5",children:[u.jsx(kE,{className:"h-3 w-3 shrink-0 animate-pulse"}),u.jsx("span",{children:"thinking"}),e>0&&u.jsxs("span",{className:"text-fg-6",children:[e,"s"]})]})}function fM({part:e,isStreaming:t}){switch(Ah(e)){case"text":{const s=xc(e);return s.trim()?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[V6],components:{table:Yh},children:s})}):null}case"thinking":{const s=xc(e);return s.trim()?u.jsx(cM,{text:s}):t?u.jsx(dM,{}):null}case"tool":return ho(e)?u.jsx(Z6,{part:e}):u.jsx(uM,{part:e});default:return null}}function mM({message:e,isStreaming:t,queued:a}){var x,b,y,T,N;const s=e.role==="user",l=e.parts??[],o=l.filter(S=>Ah(S)!=="other");if(s){const S=l.map(xc).join("").trim();return u.jsxs("div",{className:"fs-fade-in flex items-start gap-2 font-mono text-sm",children:[u.jsx("span",{className:"shrink-0 select-none text-emerald-400",children:"❯"}),u.jsx("span",{className:"min-w-0 flex-1 whitespace-pre-wrap break-words text-fg-2",children:S||"…"}),a&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded border border-amber-500/30 px-1.5 py-0.5 text-xs text-amber-400",children:[u.jsx("span",{className:"leading-none",children:"○"}),u.jsx("span",{children:"queued"})]})]})}const d=((x=e.info)==null?void 0:x.agent)??e.agent,f=((b=e.info)==null?void 0:b.modelID)??e.modelID,m=(y=e.info)==null?void 0:y.error,h=(T=e.info)==null?void 0:T.finish;return u.jsxs("div",{className:"fs-fade-in font-mono",children:[(d||f)&&u.jsxs("div",{className:"mb-1 flex items-center gap-2 text-xs",children:[d&&u.jsx("span",{className:"text-fg-3",children:d}),d&&f&&u.jsx("span",{className:"text-fg-6",children:"·"}),f&&u.jsx("span",{className:"text-fg-5",children:f})]}),m&&u.jsxs("div",{className:"my-1 flex items-start gap-2 rounded-md border border-red-500/20 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("span",{className:"font-semibold",children:m.name??"Error"}),((N=m.data)==null?void 0:N.message)&&u.jsx("p",{className:"mt-0.5 text-red-400/80",children:m.data.message}),h&&h!=="end"&&u.jsxs("p",{className:"mt-0.5 text-red-400/60",children:["finish: ",h]})]})]}),u.jsx("div",{className:"space-y-2 text-sm text-fg",children:o.length>0?o.map((S,C)=>u.jsx(fM,{part:S,isStreaming:t},S.id??S.callID??C)):!m&&u.jsx("span",{className:"text-fg-5",children:"…"})})]})}const hM={completed:{glyph:"■",color:"text-emerald-400"},in_progress:{glyph:"■",color:"text-amber-400"},cancelled:{glyph:"■",color:"text-fg-6"},pending:{glyph:"□",color:"text-fg-5"}};function pM(e){const t=e.find(s=>Bi(s.status)==="in_progress");if(t)return t.content;const a=e.find(s=>Bi(s.status)==="pending");return a?a.content:"all steps complete"}function gM({todos:e,onClick:t}){if(e.length===0)return null;const a=e.length,s=EC(e);return u.jsx("div",{className:"rounded-md border border-line bg-term/60 px-3 py-2",children:u.jsxs("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2 text-left font-mono text-xs",children:[u.jsxs("span",{className:"shrink-0 tabular-nums text-fg-4",children:["[",s,"/",a,"]"]}),u.jsx("span",{className:"shrink-0 tracking-tight",children:e.map(l=>{const o=hM[Bi(l.status)];return u.jsx("span",{className:o.color,children:o.glyph},l.id)})}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-fg-2",children:pM(e)}),u.jsx("span",{className:"shrink-0 text-[10px] text-fg-5",children:"详情 →"})]})})}const bM=200;function xM(){return Le(e=>{const t=e.activeSessionId;if(!t)return!1;const a=e.messages[t]??po;for(let s=a.length-1;s>=0;s--){const l=a[s].parts;if(l){for(const o of l)if(Ah(o)==="tool"&&Ec(o))return!0}}return!1})}function EM(){const[e,t]=v.useState(""),[a,s]=v.useState(""),[l,o]=v.useState([]),d=v.useRef(null),f=Le(D=>D.activeSessionId),m=qe(D=>D.activeRepoId),h=Le(D=>{const k=D.activeSessionId;return k?D.sessionStatuses[k]:void 0}),x=Le(D=>D.sendMessage),b=xM();v.useEffect(()=>{if(!m){o([]);return}let D=!1;return(async()=>{try{const[k,z]=await Promise.all([Uc(),vh(m)]);if(D)return;const V=k.pinned_models,M=V?JSON.parse(V):[];o(M.length>0?z.filter(L=>M.includes(L.id)):[])}catch{D||o([])}})(),()=>{D=!0}},[m]);const y=h==="busy"&&!b,T=!f;v.useLayoutEffect(()=>{const D=d.current;D&&(D.style.height="auto",D.style.height=`${Math.min(D.scrollHeight,bM)}px`)},[e]),v.useEffect(()=>{t("")},[f]);const N=()=>{const D=e.trim();!D||T||(x(D,a||void 0),t(""))},S=D=>{D.nativeEvent.isComposing||D.keyCode===229||D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),N())},C=f?b?"输入回复,或点击上方选项…":y?"输入消息将排队等待处理…":"enter a command…":"select or start a run",A=f?y?"text-amber-400 fs-blink":b?"text-blue-400":"text-emerald-400":"text-fg-6";return u.jsxs("div",{className:"border-t border-line bg-term px-4 py-4",children:[u.jsxs("div",{className:ce("mx-auto flex max-w-4xl items-start gap-2 rounded-lg border px-3 py-2 transition-colors duration-150",T?"border-line":"border-fg-5 focus-within:border-fg-4"),children:[u.jsx("span",{className:ce("select-none pt-px font-mono text-sm leading-6",A),children:"❯"}),u.jsx("textarea",{ref:d,rows:2,value:e,disabled:T,onChange:D=>t(D.target.value),onKeyDown:S,placeholder:C,className:"flex-1 resize-none bg-transparent font-mono text-sm leading-6 text-fg placeholder:text-fg-6 focus:outline-none disabled:cursor-not-allowed"}),u.jsx("button",{type:"button",onClick:N,disabled:T||e.trim().length===0,"aria-label":"Send message",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-600 text-white transition-colors duration-150 hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:u.jsx(wE,{className:"h-4 w-4",strokeWidth:2.5})})]}),u.jsxs("div",{className:"mx-auto mt-1.5 flex max-w-4xl items-center gap-3 pl-5",children:[u.jsx("span",{className:"font-mono text-[10px] text-fg-6",children:"⏎ to run · shift+⏎ for newline"}),l.length>0&&u.jsxs("select",{value:a,onChange:D=>s(D.target.value),className:"ml-auto max-w-[200px] truncate rounded border border-line bg-surface px-2 py-0.5 font-mono text-[11px] text-fg-4 focus:border-fg-5 focus:outline-none",children:[u.jsx("option",{value:"",children:"默认模型"}),l.map(D=>u.jsx("option",{value:D.id,children:D.name||D.id},D.id))]})]})]})}const x1={idle:{glyph:"●",label:"ready",color:"text-emerald-400",spin:!1},busy:{glyph:"◌",label:"running",color:"text-amber-400",spin:!0},retry:{glyph:"◌",label:"retrying",color:"text-amber-400",spin:!0},error:{glyph:"✗",label:"error",color:"text-red-400",spin:!1}};function yM({status:e,reason:t}){const a=x1[e??"idle"]??x1.idle;return u.jsxs("span",{className:ce("flex items-center gap-1.5 rounded border border-line px-2 py-0.5 font-mono text-xs",a.color),title:e==="error"&&t?t:void 0,children:[u.jsx("span",{className:ce("leading-none",a.spin&&"fs-spin"),children:a.glyph}),u.jsx("span",{children:a.label})]})}const TM={"claude-opus-4":1e6,"claude-sonnet-4":1e6,"claude-sonnet-5":1e6,"claude-opus-5":1e6,"claude-3-7-sonnet":2e5,"claude-3-5-sonnet":2e5,"claude-3-5-haiku":2e5,"claude-3-opus":2e5,"claude-3-sonnet":2e5,"claude-3-haiku":2e5},E1=1e6;function _M(e){if(!e)return E1;for(const[t,a]of Object.entries(TM))if(e.startsWith(t))return a;return E1}function y1(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function NM(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:e>0?`$${e.toFixed(4)}`:"$0"}function SM(e){for(let t=e.length-1;t>=0;t--){const a=e[t];if(a.role==="assistant"&&a.tokens){const s=a.tokens;if(s.cache&&(s.cache.read>0||s.cache.write>0)||s.input>0||s.output>0)return s}}return null}function vM({session:e,messages:t}){var m,h,x;const a=SM(t),s=(e==null?void 0:e.cost)??0;if(!a&&!s)return null;const l=a?a.input+(((m=a.cache)==null?void 0:m.read)??0)+(((h=a.cache)==null?void 0:h.write)??0):0,o=_M((x=e==null?void 0:e.model)==null?void 0:x.modelID),d=l>0?Math.min(Math.round(l/o*100),999):0,f=d>=80?"text-red-400":d>=50?"text-amber-400":"text-fg-5";return u.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-fg-5",children:[l>0&&u.jsxs(u.Fragment,{children:[u.jsx("span",{title:"当前上下文 = cache_read + cache_write + input (最近一次请求)",children:y1(l)}),u.jsx("span",{className:"text-fg-6",children:"·"}),u.jsxs("span",{className:f,title:`上下文占比 (${y1(o)} 窗口)`,children:[d,"%"]}),u.jsx("span",{className:"text-fg-6",children:"·"})]}),u.jsx("span",{title:"会话累计费用",children:NM(s)})]})}const AM=144,CM=64;function OT({onToggleSidebar:e}){const[t,a]=v.useState(""),[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(""),[h,x]=v.useState(!1),b=v.useRef(null),y=v.useRef(null),T=Le(U=>U.createSession),N=Le(U=>U.sendError),S=qe(U=>U.activeRepoId),C=Di(U=>U.agents),A=Ue(U=>U.issues),D=Ue(U=>U.selectedIssueId),k=Ue(U=>U.pendingDraft);v.useEffect(()=>{D&&(d(D),Ue.getState().setSelectedIssue(null))},[D]),v.useEffect(()=>{k&&(a(k),Ue.getState().setPendingDraft(null))},[k]),v.useLayoutEffect(()=>{const U=b.current;U&&(U.style.height="auto",U.style.height=`${Math.min(U.scrollHeight,AM)}px`)},[t]),v.useEffect(()=>{const U=te=>{y.current&&!y.current.contains(te.target)&&x(!1)};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[]);const z=A.filter(U=>U.state==="open"),V=A.find(U=>U.id===o),M=f.trim().toLowerCase(),L=M?z.filter(U=>`#${U.number} ${U.title}`.toLowerCase().includes(M)):z,K=!!s||!!o,se=()=>{const U=t.trim();!S||!U&&!K||(a(""),T(U,void 0,void 0,void 0,o||void 0,s||void 0))},B=U=>{U.nativeEvent.isComposing||U.keyCode===229||U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),se())};return u.jsxs("div",{className:"relative flex flex-1 flex-col items-center justify-center bg-term",children:[u.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"absolute left-3 top-3 rounded-lg p-2 text-fg-3 hover:bg-elevated md:hidden",children:u.jsx(jc,{className:"h-5 w-5"})}),u.jsxs("div",{className:"w-full max-w-2xl px-6",children:[u.jsx("div",{className:"mb-8 text-center",children:u.jsxs("div",{className:"font-mono text-2xl text-fg-6",children:[u.jsx("span",{className:"text-emerald-500/60",children:"❯"}),u.jsx("span",{className:"fs-blink text-fg-4",children:" ▋"})]})}),u.jsxs("div",{className:"rounded-xl border border-line bg-base/80 shadow-sm transition-colors focus-within:border-fg-5",children:[u.jsxs("div",{className:"flex items-start gap-2 px-4 py-3",children:[u.jsx("span",{className:"select-none pt-px font-mono text-sm leading-6 text-emerald-400",children:"❯"}),u.jsx("textarea",{ref:b,rows:1,value:t,autoFocus:!0,disabled:!S,onChange:U=>a(U.target.value),onKeyDown:B,placeholder:S?"让 Agent 做什么?":"请先选择一个仓库",className:"flex-1 resize-none bg-transparent font-mono text-sm leading-6 text-fg placeholder:text-fg-6 focus:outline-none disabled:cursor-not-allowed"}),u.jsx("button",{type:"button",onClick:se,disabled:!S||!t.trim()&&!K,"aria-label":"Start run",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-600 text-white transition-colors duration-150 hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:u.jsx(wE,{className:"h-4 w-4",strokeWidth:2.5})})]}),u.jsxs("div",{className:"flex flex-col gap-2 border-t border-line/60 px-4 py-2 sm:flex-row sm:items-center sm:gap-3",children:[u.jsxs("label",{className:"flex items-center gap-1.5 font-mono text-[11px] text-fg-4",children:[u.jsx("span",{className:"shrink-0",children:"Agent"}),u.jsxs("select",{value:s,onChange:U=>l(U.target.value),className:"rounded border border-line bg-surface px-2 py-1 font-mono text-xs text-fg focus:border-fg-5 focus:outline-none",children:[u.jsx("option",{value:"",children:"默认"}),C.map(U=>u.jsx("option",{value:U.id,children:U.name},U.id))]})]}),A.length>0&&u.jsxs("div",{ref:y,className:"relative flex min-w-0 flex-1 items-center gap-1.5 font-mono text-[11px] text-fg-4",children:[u.jsx("span",{className:"shrink-0",children:"Issue"}),u.jsxs("button",{type:"button",onClick:()=>{x(U=>!U),m("")},className:"flex min-w-0 flex-1 items-center gap-1 truncate rounded border border-line bg-surface px-2 py-1 font-mono text-xs text-fg transition-colors hover:border-fg-5 focus:border-fg-5 focus:outline-none",children:[u.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:V?`#${V.number} ${V.title}`:"无"}),u.jsx(ss,{className:"h-3 w-3 shrink-0 text-fg-5"})]}),o&&u.jsx("button",{type:"button",onClick:()=>{d(""),m("")},className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})}),h&&u.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-full min-w-[280px] rounded-md border border-line bg-surface shadow-lg",children:[u.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-2 py-1.5",children:[u.jsx(Qa,{className:"h-3 w-3 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:f,onChange:U=>m(U.target.value),onKeyDown:U=>{U.key==="Escape"&&x(!1)},placeholder:"搜索 issue...",autoFocus:!0,className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"})]}),u.jsxs("ul",{className:"max-h-48 overflow-y-auto py-1",children:[!M&&u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>{d(""),x(!1)},className:ce("w-full px-2.5 py-1.5 text-left font-mono text-xs transition-colors hover:bg-elevated/60",o?"text-fg-4":"text-blue-400"),children:"无"})}),L.map(U=>u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>{d(U.id),m(""),x(!1)},className:ce("flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left transition-colors hover:bg-elevated/60",U.id===o?"bg-blue-500/10":""),children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium",U.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",U.number]}),u.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:U.title})]})},U.id)),L.length===0&&u.jsx("li",{className:"px-2.5 py-3 text-center font-mono text-[10px] text-fg-5",children:"无匹配结果"})]})]})]})]})]}),u.jsx("div",{className:"mt-2 text-center font-mono text-[10px] text-fg-6",children:"⌘⏎ / ctrl+⏎ 开始运行"}),N&&u.jsx("div",{className:"mt-3 rounded-lg border border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:N})]})]})}function T1({body:e}){return e?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],components:{table:Yh},children:e})}):u.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"没有描述内容"})}function _1({issue:e}){var t;return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number," ",e.state]}),(t=e.labels)==null?void 0:t.map(a=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${a.color}20`,color:`#${a.color}`},children:a.name},a.id))]}),u.jsx("h2",{className:"mt-0.5 truncate text-sm font-medium text-fg",children:e.title})]})}function wM({onToggleSidebar:e}){const t=Ue(x=>x.matchingParentId),a=Ue(x=>x.matchingCandidateId),s=Ue(x=>x.issues.find(b=>b.id===t)),l=Ue(x=>x.issues.find(b=>b.id===a)),o=Ue(x=>x.exitMatchMode),d=Ue(x=>x.linkChild),[f,m]=v.useState(!1);if(!s)return null;const h=async()=>{l&&(m(!0),await d(s.number,l.number),m(!1))};return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[u.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[u.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated md:hidden",children:u.jsx(jc,{className:"h-5 w-5"})}),u.jsx("span",{className:"text-xs font-medium text-fg-4",children:"匹配子任务"}),u.jsxs("span",{className:"font-mono text-xs text-fg-3",children:["父: #",s.number]}),u.jsx("div",{className:"flex-1"}),u.jsxs("button",{type:"button",onClick:o,className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(Tt,{className:"h-3.5 w-3.5"}),"退出匹配"]})]}),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row",children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden border-b border-line md:border-b-0 md:border-r",children:[u.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:u.jsx(_1,{issue:s})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:u.jsx(T1,{body:s.body})})]}),u.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:l?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"border-b border-line/60 px-4 py-2.5",children:u.jsx(_1,{issue:l})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-6",children:u.jsx(T1,{body:l.body})})]}):u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"← 从左侧列表选择候选 Issue"})})})]}),l&&u.jsx("div",{className:"flex items-center justify-center gap-3 border-t border-line bg-base px-4 py-3",children:u.jsxs("button",{type:"button",onClick:()=>void h(),disabled:f,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-4 py-2 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-50",children:[u.jsx(oa,{className:"h-3.5 w-3.5"}),f?"关联中…":`确认: 将 #${l.number} 设为 #${s.number} 的子任务`]})})]})}function kM({onToggleSidebar:e}){var l;const t=Ue(o=>o.previewIssueId),a=Ue(o=>o.issues.find(d=>d.id===t));if(!a)return u.jsx(OT,{onToggleSidebar:e});const s=()=>{Ue.getState().setSelectedIssue(a.id),Ue.getState().setPreviewIssue(null)};return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[u.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[u.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated md:hidden",children:u.jsx(jc,{className:"h-5 w-5"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",a.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",a.number," ",a.state]}),(l=a.labels)==null?void 0:l.map(o=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${o.color}20`,color:`#${o.color}`},children:o.name},o.id))]}),u.jsx("h2",{className:"mt-0.5 truncate text-sm font-medium text-fg",children:a.title})]}),u.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[a.htmlUrl&&u.jsxs("a",{href:a.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(hc,{className:"h-3.5 w-3.5"}),"源站"]}),u.jsxs("button",{type:"button",onClick:()=>Ue.getState().enterMatchMode(a.id),className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[u.jsx(_o,{className:"h-3.5 w-3.5"}),"匹配子任务"]}),u.jsxs("button",{type:"button",onClick:s,className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:[u.jsx(Bc,{className:"h-3.5 w-3.5 fill-current"}),"开始处理"]})]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto",children:u.jsx("div",{className:"mx-auto max-w-4xl px-6 py-6",children:a.body?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],components:{table:Yh},children:a.body})}):u.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"})})})]})}function RM({onToggleSidebar:e,onToggleRightPanel:t,rightPanelOpen:a}){var M;const s=va(),l=qe(Da),o=Le(L=>L.activeSessionId),d=Ue(L=>L.previewIssueId),f=Le(L=>L.sessions.find(K=>K.id===L.activeSessionId)??null),m=Le(L=>{const K=L.activeSessionId;return K?L.messages[K]??po:po}),h=Le(L=>{const K=L.activeSessionId;return K?L.todos[K]??yc:yc}),x=Le(L=>{const K=L.activeSessionId;return K?L.sessionStatuses[K]:void 0}),b=Le(L=>{const K=L.activeSessionId;return K?L.queuedMessageIds[K]??dx:dx}),y=Le(L=>{const K=L.activeSessionId;return K?L.errorReasons[K]:void 0}),T=Le(L=>L.sendError),N=Le(L=>L.abortSession),S=Ue(L=>f!=null&&f.issueId?L.issues.find(K=>K.id===f.issueId):void 0);v.useEffect(()=>{if(o)return Sc.activateSession(o),()=>Sc.deactivateSession(o)},[o]);const C=v.useRef(null),A=v.useRef(!0);v.useEffect(()=>{const L=C.current;L&&A.current&&(L.scrollTop=L.scrollHeight)},[m,h]),v.useEffect(()=>{A.current=!0},[o]),v.useEffect(()=>{if(x!=="busy"&&x!=="retry")return;const L=K=>{if(K.key!=="Escape"||K.defaultPrevented)return;const se=K.target;se instanceof HTMLInputElement||se instanceof HTMLTextAreaElement||se!=null&&se.isContentEditable||N()};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[x,N]);const D=Ue(L=>L.matchingParentId);if(!o)return D?u.jsx(wM,{onToggleSidebar:e}):d?u.jsx(kM,{onToggleSidebar:e}):u.jsx(OT,{onToggleSidebar:e});const k=x==="busy",z=x==="retry",V=k||z;return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden bg-term",children:[u.jsxs("header",{className:"flex items-center gap-3 border-b border-line bg-base px-4 py-2.5",children:[u.jsx("button",{type:"button",onClick:e,"aria-label":"Open sidebar",className:"-ml-1 rounded-lg p-1.5 text-fg-3 hover:bg-elevated md:hidden",children:u.jsx(jc,{className:"h-5 w-5"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[(f==null?void 0:f.parentID)&&u.jsxs("button",{type:"button",onClick:()=>void Le.getState().setActiveSession(f.parentID),className:"mb-0.5 flex items-center gap-1 text-[11px] text-fg-4 transition-colors hover:text-blue-400",children:[u.jsx(Nv,{className:"h-3 w-3"}),"返回父会话"]}),u.jsx("h2",{className:"truncate text-sm font-medium text-fg",children:((M=f==null?void 0:f.title)==null?void 0:M.trim())||"untitled run"}),(f==null?void 0:f.agent)&&u.jsx("p",{className:"truncate font-mono text-xs text-fg-4",children:f.agent}),u.jsx(vM,{session:f,messages:m})]}),S&&u.jsxs("button",{type:"button",onClick:()=>s(`/${encodeURIComponent(l)}/issues?issueId=${S.id}`),className:"flex items-center gap-1 rounded-md border border-line px-2 py-1 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsxs("span",{className:ce("rounded px-1 py-0.5 text-[10px] font-semibold",S.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",S.number]}),u.jsx("span",{className:"hidden max-w-[120px] truncate sm:inline",children:S.title})]}),u.jsx(yM,{status:x,reason:y}),t&&u.jsx("button",{type:"button",onClick:t,"aria-label":a?"关闭侧边栏":"打开侧边栏",className:ce("hidden items-center justify-center rounded-md border border-line p-1.5 transition-colors md:flex",a?"bg-blue-500/10 text-blue-500 hover:bg-blue-500/20":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:u.jsx(DE,{className:"h-4 w-4"})}),V&&u.jsxs("button",{type:"button",onClick:()=>void N(),className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 font-mono text-xs text-fg-2 transition-colors hover:border-red-500/50 hover:text-red-400",children:[u.jsx(jE,{className:"h-3 w-3 fill-current"}),z?"stop retry":"stop"]})]}),u.jsx("div",{ref:C,onScroll:()=>{const L=C.current;L&&(A.current=L.scrollHeight-L.clientHeight-L.scrollTop<=CM)},className:"flex-1 overflow-y-auto",children:u.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-3 px-4 py-4",children:[m.length===0?u.jsxs("p",{className:"py-10 text-center font-mono text-xs text-fg-6",children:[u.jsx("span",{className:"text-emerald-500/60",children:"❯"})," waiting for input",u.jsx("span",{className:"fs-blink",children:" ▋"})]}):m.map((L,K)=>u.jsxs(v.Fragment,{children:[K>0&&L.role==="user"&&u.jsx("div",{className:"border-t border-line/70"}),u.jsx("div",{"data-message-id":L.id,children:u.jsx(mM,{message:L,isStreaming:k&&K===m.length-1,queued:b.includes(L.id)})})]},L.id)),h.length>0&&u.jsx(gM,{todos:[...h],onClick:t})]})}),x==="error"&&y&&u.jsxs("div",{className:"flex items-center gap-2 border-t border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:[u.jsx(Kn,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"truncate",children:y})]}),T&&u.jsxs("div",{className:"flex items-center gap-2 border-t border-red-500/20 bg-red-500/10 px-4 py-2 font-mono text-xs text-red-400",children:[u.jsx(Kn,{className:"h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"truncate",children:T})]}),u.jsx(EM,{})]})}const Gn=zs((e,t)=>({pulls:[],loaded:!1,syncing:!1,selectedPrId:null,matchingPrId:null,matchingCandidateIssueId:null,clearPulls:()=>e({pulls:[],loaded:!1,selectedPrId:null,matchingPrId:null,matchingCandidateIssueId:null}),setSelectedPr:a=>e({selectedPrId:a}),enterMatchMode:a=>e({matchingPrId:a,matchingCandidateIssueId:null}),exitMatchMode:()=>{const a=t().matchingPrId;e({matchingPrId:null,matchingCandidateIssueId:null,selectedPrId:a})},setMatchCandidate:a=>e({matchingCandidateIssueId:a}),linkIssue:async(a,s)=>{const l=qe.getState().activeRepoId;if(!l)return!1;try{return await F3(l,a,s),!0}catch{return!1}},unlinkIssue:async(a,s)=>{const l=qe.getState().activeRepoId;if(!l)return!1;try{return await z3(l,a,s),!0}catch{return!1}},loadPulls:async()=>{const a=qe.getState().activeRepoId;if(!a){e({pulls:[],loaded:!0});return}try{const s=await lx(a,"all");e({pulls:s,loaded:!0})}catch{e({loaded:!0})}},syncPulls:async()=>{const a=qe.getState().activeRepoId;if(a){e({syncing:!0});try{await U3(a);const s=await lx(a,"all");e({pulls:s,syncing:!1})}catch(s){e({syncing:!1});let l="同步 PR 失败";if(s instanceof Hs)try{const o=JSON.parse(s.message);o.error&&(l=o.error)}catch{s.message&&(l=s.message)}Yt.getState().addToast(l,"error")}}}})),OM={completed:{glyph:"✓",color:"text-emerald-400",spin:!1},in_progress:{glyph:"◌",color:"text-amber-400",spin:!0},cancelled:{glyph:"✗",color:"text-fg-5",spin:!1},pending:{glyph:"○",color:"text-fg-4",spin:!1}};function IM(e){var l;const t=(l=e.time)==null?void 0:l.created;if(!t)return"";const a=t<1e12?t*1e3:t;return new Date(a).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function MM(e){if(!e.parts)return"";for(const t of e.parts){const a=t.content??t.text;if(a)return a}return""}function DM({todos:e}){if(e.length===0)return u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无待办项"})});const t=e.filter(a=>{const s=Bi(a.status);return s==="completed"||s==="cancelled"}).length;return u.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[u.jsxs("div",{className:"mb-2 font-mono text-[10px] tabular-nums text-fg-5",children:["进度 ",t,"/",e.length]}),u.jsx("ul",{className:"space-y-1.5",children:e.map(a=>{const s=Bi(a.status),l=OM[s],o=s==="completed"||s==="cancelled";return u.jsxs("li",{className:"flex items-start gap-2 font-mono text-xs",children:[u.jsx("span",{className:ce("shrink-0 leading-5",l.color,l.spin&&"fs-spin"),children:l.glyph}),u.jsx("span",{className:ce("leading-5",o?"text-fg-5 line-through":"text-fg-2"),children:a.content})]},a.id)})})]})}function LM({messages:e,onScrollToMessage:t}){const a=e.filter(s=>s.role==="user");return a.length===0?u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无输入记录"})}):u.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:u.jsx("ul",{className:"space-y-1",children:a.map((s,l)=>{const o=MM(s),d=IM(s);return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>t==null?void 0:t(s.id),className:"group w-full rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"shrink-0 font-mono text-[10px] text-emerald-400/60",children:"❯"}),u.jsxs("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:["#",l+1]}),d&&u.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] text-fg-6",children:d})]}),o&&u.jsx("p",{className:"mt-0.5 line-clamp-2 pl-5 text-xs leading-relaxed text-fg-3 group-hover:text-fg-2",children:o})]})},s.id)})})})}function jM({linked:e,number:t,title:a,state:s,mergedAt:l,isPr:o,onToggle:d}){const f=o?s==="open"?"bg-emerald-500/15 text-emerald-400":l?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":s==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400";return u.jsx("li",{children:u.jsx("button",{type:"button",onClick:d,className:ce("flex w-full items-start gap-2 rounded-md px-2 py-2 text-left transition-colors",e?"border-l-2 border-emerald-500 bg-emerald-500/5":"border-l-2 border-transparent hover:bg-elevated/50"),children:u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",f),children:["#",t]}),u.jsx("span",{className:"min-w-0 truncate text-xs text-fg-2",children:a}),e&&u.jsx(Lc,{className:"ml-auto h-3 w-3 shrink-0 text-emerald-400"})]})})})}function BM({links:e,sessionId:t}){var M,L,K,se;const a=va(),s=qe(Da),[l,o]=v.useState(null),[d,f]=v.useState(""),m=v.useRef(null),h=Ue(B=>B.issues),x=Gn(B=>B.pulls),b=Le(B=>B.addLink),y=Le(B=>B.removeLink),T=new Set(((M=e==null?void 0:e.issues)==null?void 0:M.map(B=>B.id))??[]),N=new Set(((L=e==null?void 0:e.pullRequests)==null?void 0:L.map(B=>B.id))??[]);v.useEffect(()=>{var B;l&&((B=m.current)==null||B.focus())},[l]);const S=()=>{o(null),f("")},C=async(B,U,te)=>{t&&(te?await y(t,B,U):await b(t,B,U))},A=d.trim().toLowerCase(),D=A?h.filter(B=>`#${B.number} ${B.title}`.toLowerCase().includes(A)):h,k=A?x.filter(B=>`#${B.number} ${B.title} ${B.headBranch}`.toLowerCase().includes(A)):x,z=((K=e==null?void 0:e.issues)==null?void 0:K.length)??0,V=((se=e==null?void 0:e.pullRequests)==null?void 0:se.length)??0;if(l){const B=l==="issue",U=B?D:k,te=B?T:N;return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-2",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:B?"关联 Issue":"关联 PR"}),u.jsxs("button",{type:"button",onClick:S,className:"flex h-6 items-center gap-1 rounded-md px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[u.jsx(Tt,{className:"h-3.5 w-3.5"}),"完成"]})]}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{ref:m,type:"text",value:d,onChange:ie=>f(ie.target.value),placeholder:B?"搜索 issue...":"搜索 PR...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&u.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:U.length===0?u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:(B?h:x).length===0?B?"暂无 Issue,请先同步":"暂无 PR,请先同步":"无匹配结果"}):u.jsx("ul",{className:"space-y-0.5",children:U.map(ie=>u.jsx(jM,{linked:te.has(ie.id),number:ie.number,title:ie.title,state:ie.state,mergedAt:B?void 0:ie.mergedAt,isPr:!B,onToggle:()=>C(l,ie.id,te.has(ie.id))},ie.id))})})]})}return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-2",children:[u.jsx("span",{className:"flex-1 font-mono text-[10px] text-fg-5",children:z+V>0?`${z+V} 项关联`:"暂无关联"}),u.jsxs("button",{type:"button",onClick:()=>o("issue"),className:"flex h-6 items-center gap-1 rounded-md border border-line px-1.5 text-fg-4 transition-colors hover:border-emerald-500/50 hover:text-emerald-400",children:[u.jsx(Sr,{className:"h-3 w-3"}),u.jsx("span",{className:"text-[10px] font-medium",children:"Issue"})]}),u.jsxs("button",{type:"button",onClick:()=>o("pr"),className:"flex h-6 items-center gap-1 rounded-md border border-line px-1.5 text-fg-4 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[u.jsx(Sr,{className:"h-3 w-3"}),u.jsx("span",{className:"text-[10px] font-medium",children:"PR"})]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[z>0&&u.jsxs("div",{className:"mb-3",children:[u.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Issues (",z,")"]}),u.jsx("ul",{className:"space-y-1",children:e.issues.map(B=>u.jsxs("li",{className:"group flex items-start gap-1",children:[u.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(s)}/issues?issueId=${encodeURIComponent(B.id)}`),className:"flex min-w-0 flex-1 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[u.jsxs("span",{className:ce("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",B.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",B.number]}),u.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:B.title})]}),u.jsx("button",{type:"button",onClick:()=>void C("issue",B.id,!0),className:"mt-1.5 hidden shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/15 hover:text-red-400 group-hover:block",children:u.jsx(Tt,{className:"h-3 w-3"})})]},B.id))})]}),V>0&&u.jsxs("div",{children:[u.jsxs("div",{className:"mb-1.5 font-mono text-[10px] font-medium uppercase tracking-wider text-fg-5",children:["Pull Requests (",V,")"]}),u.jsx("ul",{className:"space-y-1",children:e.pullRequests.map(B=>u.jsxs("li",{className:"group flex items-start gap-1",children:[u.jsxs("button",{type:"button",onClick:()=>a(`/${encodeURIComponent(s)}/pulls?prId=${encodeURIComponent(B.id)}`),className:"flex min-w-0 flex-1 items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-elevated/60",children:[u.jsxs("span",{className:ce("mt-0.5 shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-semibold",B.state==="open"?"bg-emerald-500/15 text-emerald-400":B.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400"),children:["#",B.number]}),u.jsx("span",{className:"line-clamp-2 text-xs leading-5 text-fg-3 group-hover:text-fg-2",children:B.title})]}),u.jsx("button",{type:"button",onClick:()=>void C("pr",B.id,!0),className:"mt-1.5 hidden shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/15 hover:text-red-400 group-hover:block",children:u.jsx(Tt,{className:"h-3 w-3"})})]},B.id))})]}),z===0&&V===0&&u.jsx("div",{className:"flex flex-1 items-center justify-center py-10",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"点击上方按钮添加关联"})})]})]})}const PM={"visual-engineering":"bg-purple-500/15 text-purple-400",quick:"bg-emerald-500/15 text-emerald-400",deep:"bg-blue-500/15 text-blue-400",ultrabrain:"bg-amber-500/15 text-amber-400",artistry:"bg-pink-500/15 text-pink-400",writing:"bg-cyan-500/15 text-cyan-400",explore:"bg-teal-500/15 text-teal-400",librarian:"bg-indigo-500/15 text-indigo-400",oracle:"bg-amber-500/15 text-amber-400",metis:"bg-rose-500/15 text-rose-400",momus:"bg-orange-500/15 text-orange-400"};function UM(e){switch(e){case"idle":return"bg-emerald-500";case"busy":case"retry":return"bg-amber-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-fg-5"}}function Mm(e){var a;const t=(a=e.time)==null?void 0:a.created;if(t)return t<1e12?t*1e3:t;if(e.createdAt){const s=Date.parse(e.createdAt);if(!Number.isNaN(s))return s}return null}function HM(e){const t=Date.now()-e,a=Math.floor(t/1e3);if(a<60)return"just now";const s=Math.floor(a/60);if(s<60)return`${s}m ago`;const l=Math.floor(s/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function FM(){const e=Le(m=>m.sessions),t=Le(m=>m.activeSessionId),a=Le(m=>m.sessionStatuses),s=Le(m=>m.setActiveSession),l=e.find(m=>m.id===t),o=(l==null?void 0:l.parentID)??t,d=!!(l!=null&&l.parentID),f=e.filter(m=>m.parentID===o).sort((m,h)=>(Mm(h)??0)-(Mm(m)??0));return f.length===0?u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"暂无子任务"})}):u.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[d&&u.jsxs("div",{className:"mb-1.5 px-2 font-mono text-[10px] text-fg-5",children:["同级子任务 (",f.length,")"]}),u.jsx("ul",{className:"space-y-0.5",children:f.map(m=>{const h=m.id===t,x=a[m.id],b=Mm(m),y=(m.agent&&PM[m.agent])??"bg-elevated text-fg-4",T=m.title||`${m.id.slice(0,9)}...`;return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>{h||s(m.id)},className:ce("group flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors",h?"border-l-2 border-blue-500 bg-blue-500/5":"border-l-2 border-transparent hover:bg-elevated/60"),children:[u.jsx("span",{className:ce("mt-1 h-2 w-2 shrink-0 rounded-full",UM(x))}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[m.agent&&u.jsx("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium",y),children:m.agent}),b!=null&&u.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-6",children:HM(b)})]}),u.jsx("p",{className:ce("mt-0.5 line-clamp-2 text-xs leading-5",h?"text-fg-2":"text-fg-3 group-hover:text-fg-2"),children:T})]})]})},m.id)})})]})}function N1({todos:e,messages:t,sessionLinks:a,sessionId:s,onScrollToMessage:l}){var N,S;const[o,d]=v.useState("todo"),f=Le(C=>C.sessions),m=Le(C=>C.activeSessionId),h=t.filter(C=>C.role==="user").length,x=(((N=a==null?void 0:a.issues)==null?void 0:N.length)??0)+(((S=a==null?void 0:a.pullRequests)==null?void 0:S.length)??0),b=f.find(C=>C.id===m),y=(b==null?void 0:b.parentID)??m,T=f.filter(C=>C.parentID===y).length;return u.jsxs("div",{className:"flex h-full w-72 shrink-0 flex-col border-l border-line bg-surface",children:[u.jsxs("div",{className:"flex items-center border-b border-line",children:[u.jsxs("button",{type:"button",onClick:()=>d("todo"),className:ce("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",o==="todo"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(dA,{className:"h-3.5 w-3.5"}),"待办",e.length>0&&u.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:e.length})]}),u.jsxs("button",{type:"button",onClick:()=>d("prompts"),className:ce("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",o==="prompts"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(TA,{className:"h-3.5 w-3.5"}),"输入",h>0&&u.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:h})]}),u.jsxs("button",{type:"button",onClick:()=>d("links"),className:ce("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",o==="links"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(Lc,{className:"h-3.5 w-3.5"}),"关联",x>0&&u.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:x})]}),u.jsxs("button",{type:"button",onClick:()=>d("subtasks"),className:ce("flex flex-1 items-center justify-center gap-1.5 border-b-2 px-3 py-2.5 text-xs font-medium transition-colors",o==="subtasks"?"border-blue-500 text-blue-500":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(_o,{className:"h-3.5 w-3.5"}),"子任务",T>0&&u.jsx("span",{className:"rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:T})]})]}),o==="todo"?u.jsx(DM,{todos:e}):o==="prompts"?u.jsx(LM,{messages:t,onScrollToMessage:l}):o==="links"?u.jsx(BM,{links:a,sessionId:s}):u.jsx(FM,{})]})}const S1=8;function IT({onSwipeLeft:e,onSwipeRight:t,threshold:a=40,disabled:s=!1}={}){const l=v.useRef({x0:0,y0:0,dir:null,on:!1}),o=v.useRef(0),d=v.useCallback(h=>{if(s)return;const x=h.touches[0];l.current={x0:x.clientX,y0:x.clientY,dir:null,on:!0},o.current=0},[s]),f=v.useCallback(h=>{const x=l.current;if(!x.on)return;const b=h.touches[0].clientX-x.x0,y=h.touches[0].clientY-x.y0;if(!x.dir){(Math.abs(b)>S1||Math.abs(y)>S1)&&(x.dir=Math.abs(b)>Math.abs(y)?"h":"v");return}if(x.dir==="v"){x.on=!1;return}o.current=b},[]),m=v.useCallback(()=>{const h=l.current;if(!h.on||h.dir!=="h"){h.on=!1;return}h.on=!1;const x=o.current;x>a?t==null||t():x<-a&&(e==null||e())},[a,e,t]);return{onTouchStart:d,onTouchMove:f,onTouchEnd:m}}function ah({side:e,open:t,onClose:a,children:s,width:l="w-80"}){const o=e==="left";return u.jsxs("div",{className:"md:hidden",children:[t&&u.jsx("div",{className:"fixed inset-0 z-40 bg-black/50",onClick:a,"aria-hidden":"true"}),u.jsx("div",{className:ce("fixed top-0 bottom-0 z-50 flex flex-col bg-surface pt-[var(--safe-top)] pb-[var(--safe-bottom)] shadow-xl transition-transform duration-200 ease-out",l,o?"left-0 border-r border-line":"right-0 border-l border-line",t?"translate-x-0":o?"-translate-x-full":"translate-x-full"),children:s})]})}function rh(e){var t,a;if(typeof((t=e.time)==null?void 0:t.updated)=="number")return e.time.updated;if(typeof((a=e.time)==null?void 0:a.created)=="number")return e.time.created;if(e.createdAt){const s=Date.parse(e.createdAt);return Number.isNaN(s)?0:s}return 0}function zM(e){const t=rh(e);if(!t)return"";const a=t<1e12?t*1e3:t,s=new Date(a);return s.toDateString()===new Date().toDateString()?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function v1(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>A1(e)):A1(e)}function A1(e){const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;opacity:0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}function qM(e){switch(e){case"idle":return"bg-emerald-500";case"busy":case"retry":return"bg-amber-500 animate-pulse";case"error":return"bg-red-500";default:return"bg-fg-5"}}function YM({session:e,isActive:t,isConfirming:a,onSelect:s,onDelete:l,onConfirm:o,onCancelConfirm:d,onRename:f,status:m,issue:h,linkedItems:x}){var te,ie;const b=zM(e),[y,T]=v.useState(!1),[N,S]=v.useState(""),C=v.useRef(null),A=()=>{var Z;S(((Z=e.title)==null?void 0:Z.trim())||""),T(!0),requestAnimationFrame(()=>{var ee;return(ee=C.current)==null?void 0:ee.focus()})},D=()=>{var ee;T(!1);const Z=N.trim();Z&&Z!==(((ee=e.title)==null?void 0:ee.trim())||"")&&f(Z)},[k,z]=v.useState(0),[V,M]=v.useState(!1),L=v.useRef({x0:0,y0:0,base:0,dir:null,on:!1}),K=Z=>{const ee=Z.touches[0];L.current={x0:ee.clientX,y0:ee.clientY,base:k,dir:null,on:!0},M(!1)},se=Z=>{const ee=L.current;if(!ee.on)return;const Q=Z.touches[0].clientX-ee.x0,$=Z.touches[0].clientY-ee.y0;if(!ee.dir){(Math.abs(Q)>5||Math.abs($)>5)&&(ee.dir=Math.abs(Q)>Math.abs($)?"h":"v");return}ee.dir!=="v"&&z(Math.max(-144,Math.min(0,ee.base+Q)))},B=()=>{L.current.on=!1,M(!0),z(Z=>Z<-144/2?-144:0)},U=()=>{M(!0),z(0)};return u.jsxs("li",{className:"relative overflow-hidden rounded-md",children:[u.jsx("div",{className:"absolute right-0 top-0 bottom-0 flex md:hidden",style:k<0?{zIndex:10}:void 0,children:a?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>{l(),U()},className:"flex w-12 items-center justify-center bg-red-500 text-white active:bg-red-600",children:u.jsx(oa,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>{d(),U()},className:"flex w-12 items-center justify-center bg-neutral-500 text-white active:bg-neutral-600",children:u.jsx(Tt,{className:"h-4 w-4"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>{A(),U()},className:"flex w-12 items-center justify-center bg-amber-500 text-white active:bg-amber-600",children:u.jsx(Qb,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>{var Z;v1(JSON.stringify({id:e.id,name:((Z=e.title)==null?void 0:Z.trim())||""},null,2)),U()},className:"flex w-12 items-center justify-center bg-blue-500 text-white active:bg-blue-600",children:u.jsx(mc,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>o(),className:"flex w-12 items-center justify-center bg-red-500 text-white active:bg-red-600",children:u.jsx(ji,{className:"h-4 w-4"})})]})}),u.jsxs("div",{className:ce("group relative rounded-md border-l-2",t?"border-blue-500 bg-elevated":"border-transparent bg-surface hover:bg-elevated/50",V&&"transition-transform duration-200 ease-out"),style:{...k!==0?{transform:`translateX(${k}px)`}:{},...k===-144?{pointerEvents:"none"}:{}},onTouchStart:K,onTouchMove:se,onTouchEnd:B,children:[u.jsxs("button",{type:"button",onClick:()=>{y||(s(),U())},className:"block w-full px-2.5 py-2 text-left",style:k===-144?{pointerEvents:"auto"}:void 0,children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:ce("h-1.5 w-1.5 shrink-0 rounded-full",qM(m))}),u.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((te=e.agent)==null?void 0:te.trim())||"默认"}),b&&u.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:b})]}),y?u.jsx("input",{ref:C,type:"text",value:N,onChange:Z=>S(Z.target.value),onBlur:D,onKeyDown:Z=>{Z.key==="Enter"&&D(),Z.key==="Escape"&&T(!1)},onClick:Z=>Z.stopPropagation(),className:"mt-0.5 w-full rounded border border-blue-500 bg-base pl-3.5 text-sm text-fg-2 outline-none"}):u.jsxs("div",{className:"mt-0.5 pl-3.5",onDoubleClick:Z=>{Z.stopPropagation(),A()},children:[(h||x)&&u.jsxs("div",{className:"mb-0.5 flex flex-wrap gap-1",children:[h&&u.jsxs("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",h.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",h.number]}),x==null?void 0:x.map(Z=>u.jsx("span",{className:ce("shrink-0 rounded px-1 py-0.5 font-mono text-[10px] font-medium leading-none",Z.type==="pr"?Z.state==="open"?"bg-blue-500/15 text-blue-400":Z.mergedAt?"bg-purple-500/15 text-purple-400":"bg-red-500/15 text-red-400":Z.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:Z.type==="pr"?`PR#${Z.number}`:`#${Z.number}`},`${Z.type}-${Z.number}`))]}),u.jsx("span",{className:"block truncate text-sm text-fg-2",children:((ie=e.title)==null?void 0:ie.trim())||"未命名运行"})]})]}),a?u.jsxs("span",{className:"absolute right-1.5 top-1.5 hidden items-center gap-1 rounded bg-surface/90 px-0.5 md:flex",children:[u.jsx("button",{type:"button",onClick:l,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:u.jsx(oa,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:d,className:"rounded p-1 text-fg-3 hover:bg-elevated",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}):u.jsxs("span",{className:"absolute right-1.5 top-1.5 hidden items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100 md:flex",children:[u.jsx("button",{type:"button",onClick:A,title:"重命名",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:u.jsx(Qb,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>{var Z;v1(JSON.stringify({id:e.id,name:((Z=e.title)==null?void 0:Z.trim())||""},null,2))},title:"复制 Session JSON",className:"rounded p-1 text-fg-5 hover:text-fg-2",children:u.jsx(mc,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:o,className:"rounded p-1 text-fg-5 hover:text-red-400",children:u.jsx(ji,{className:"h-3.5 w-3.5"})})]})]})]})}function Dm({issue:e,indent:t,selected:a,badge:s,onClick:l}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:l,className:ce("group flex w-full items-center gap-2 rounded-md py-1.5 text-left transition-colors",t?"pl-6 pr-2.5":"px-2.5",a?"bg-blue-500/10":"hover:bg-elevated/50"),children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number]}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-3",children:e.title}),s!=null&&s>0&&u.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:s})]})})}function C1({onClose:e}){const[t,a]=v.useState(null),[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(new Set),h=Le(R=>R.sessions),x=Le(R=>R.activeSessionId),b=Le(R=>R.sessionStatuses),y=Le(R=>R.setActiveSession),T=Le(R=>R.deleteSession),N=Le(R=>R.renameSession),S=qe(R=>R.activeRepoId),C=Ue(R=>R.issues),A=Ue(R=>R.syncing),D=Ue(R=>R.syncIssues),k=Ue(R=>R.matchingParentId),z=Ue(R=>R.matchingCandidateId),V=Le(R=>R.allSessionLinks),M=[...h].filter(R=>!R.parentID).sort((R,W)=>rh(W)-rh(R)),L=new Map(C.map(R=>[R.id,R])),K=new Map;for(const R of M)R.issueId&&K.set(R.issueId,(K.get(R.issueId)??0)+1);const se=C.filter(R=>R.state==="open"),B=new Map,U=se.filter(R=>{if(R.parentId){const W=B.get(R.parentId)??[];return W.push(R),B.set(R.parentId,W),!1}return!0}),te=U.filter(R=>B.has(R.id)),ie=U.filter(R=>!B.has(R.id)),Z=o.trim().toLowerCase(),ee=R=>`#${R.number} ${R.title}`.toLowerCase().includes(Z),Q=Z?te.filter(R=>ee(R)?!0:(B.get(R.id)??[]).some(ee)):te,$=Z?ie.filter(ee):ie,pe=R=>{m(W=>{const O=new Set(W);return O.has(R)?O.delete(R):O.add(R),O})},ke=R=>u.jsx("ul",{className:"space-y-0.5",children:R.map(W=>{const O=W.issueId?L.get(W.issueId):void 0,ge=V[W.id],ve=[];if(ge){for(const Ae of ge.issues)ve.push({number:Ae.number,state:Ae.state,type:"issue"});for(const Ae of ge.pullRequests)ve.push({number:Ae.number,state:Ae.state,type:"pr",mergedAt:Ae.mergedAt})}return u.jsx(YM,{session:W,isActive:W.id===x,isConfirming:t===W.id,status:b[W.id],issue:O?{number:O.number,title:O.title,state:O.state}:void 0,linkedItems:ve.length>0?ve:void 0,onSelect:()=>{y(W.id),e==null||e()},onDelete:()=>{T(W.id),a(null)},onConfirm:()=>a(W.id),onCancelConfirm:()=>a(null),onRename:Ae=>void N(W.id,Ae)},W.id)})}),P=R=>{k?Ue.getState().setMatchCandidate(R):(Ue.getState().setPreviewIssue(R),Le.setState({activeSessionId:null})),e==null||e()};if(k){const R=L.get(k),W=s.toLowerCase(),O=C.filter(ge=>ge.state==="open"&&ge.id!==k&&(!W||`#${ge.number} ${ge.title}`.toLowerCase().includes(W)));return u.jsxs("div",{className:"flex h-full w-80 shrink-0 flex-col border-r border-line bg-surface",children:[u.jsxs("div",{className:"border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"选择子任务"}),R&&u.jsxs("p",{className:"mt-0.5 truncate font-mono text-[10px] text-fg-5",children:["父: #",R.number," ",R.title]})]}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 text-fg-5"}),u.jsx("input",{type:"text",value:s,onChange:ge=>l(ge.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"})]})}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:[u.jsx("ul",{className:"space-y-0.5",children:O.map(ge=>u.jsx(Dm,{issue:ge,selected:ge.id===z,onClick:()=>P(ge.id)},ge.id))}),O.length===0&&u.jsx("p",{className:"px-2 py-4 text-center font-mono text-xs text-fg-5",children:"无匹配结果"})]})]})}return u.jsxs("div",{className:"flex h-full w-80 shrink-0 flex-col border-r border-line bg-surface",children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"运行记录"}),S&&u.jsx("button",{type:"button",onClick:()=>{Le.setState({activeSessionId:null}),e==null||e()},title:"新建运行",className:"flex h-7 w-7 items-center justify-center rounded-md bg-blue-600 text-white transition-colors hover:bg-blue-500",children:u.jsx(Sr,{className:"h-4 w-4"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:S?M.length===0?u.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"暂无运行记录"}):u.jsx("div",{children:ke(M)}):u.jsx("p",{className:"px-2 py-6 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-line",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"}),S&&u.jsx("button",{type:"button",onClick:()=>void D(),disabled:A,title:"同步 Issues",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-3.5 w-3.5",A&&"animate-spin")})})]}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:o,onChange:R=>d(R.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),o&&u.jsx("button",{type:"button",onClick:()=>d(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:S?C.length===0?u.jsx("p",{className:"px-2 py-4 text-center font-mono text-xs text-fg-5",children:"点击 ↻ 同步 Issues"}):Q.length===0&&$.length===0?u.jsx("p",{className:"px-2 py-4 text-center font-mono text-xs text-fg-5",children:"无匹配 Issue"}):u.jsxs("ul",{className:"space-y-0.5",children:[Q.map(R=>{const W=B.get(R.id)??[],O=Z?W.filter(ee):W,ge=f.has(R.id)||!!Z;return u.jsxs("li",{children:[u.jsxs("div",{className:"flex items-center",children:[u.jsx("button",{type:"button",onClick:()=>pe(R.id),className:"flex h-6 w-5 shrink-0 items-center justify-center text-fg-5",children:u.jsx(_h,{className:ce("h-3 w-3 transition-transform",ge&&"rotate-90")})}),u.jsxs("button",{type:"button",onClick:()=>P(R.id),className:"flex min-w-0 flex-1 items-center gap-2 rounded-md py-1.5 pr-2.5 text-left transition-colors hover:bg-elevated/50",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",R.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",R.number]}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-fg-2",children:R.title}),u.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:W.length})]})]}),ge&&O.length>0&&u.jsx("ul",{className:"space-y-0.5",children:O.map(ve=>u.jsx(Dm,{issue:ve,indent:!0,onClick:()=>P(ve.id)},ve.id))})]},R.id)}),$.map(R=>u.jsx(Dm,{issue:R,badge:K.get(R.id),onClick:()=>P(R.id)},R.id))]}):u.jsx("p",{className:"px-2 py-4 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]})]})}function $M(){const[e,t]=v.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 1280px)").matches);return v.useEffect(()=>{const a=window.matchMedia("(min-width: 1280px)"),s=l=>t(l.matches);return a.addEventListener("change",s),()=>a.removeEventListener("change",s)},[]),e}function w1(e){const t=document.querySelector(`[data-message-id="${e}"]`);t&&(t.scrollIntoView({behavior:"smooth",block:"center"}),t.classList.add("fs-highlight"),setTimeout(()=>t.classList.remove("fs-highlight"),2e3))}function GM(){const[e,t]=v.useState(!1),[a,s]=v.useState(!1),[l,o]=v.useState(!1),d=$M(),f=Le(N=>N.activeSessionId),m=Le(N=>{const S=N.activeSessionId;return S?N.todos[S]??yc:yc}),h=Le(N=>{const S=N.activeSessionId;return S?N.messages[S]??po:po}),x=Le(N=>{const S=N.activeSessionId;return S?N.sessionLinks[S]:void 0});v.useEffect(()=>{d&&f?o(!0):d||o(!1)},[d,f]);const b=l&&!!f,y=()=>{window.matchMedia("(max-width: 767px)").matches?s(N=>!N):o(N=>!N)},T=IT({onSwipeRight:()=>t(!0),onSwipeLeft:()=>s(!0),disabled:e||a});return u.jsxs("div",{className:"flex min-h-0 flex-1",...T,children:[u.jsx("div",{className:"hidden shrink-0 md:flex",children:u.jsx(C1,{})}),u.jsx(ah,{side:"left",open:e,onClose:()=>t(!1),children:u.jsx(C1,{onClose:()=>t(!1)})}),u.jsx(ah,{side:"right",open:a,onClose:()=>s(!1),children:u.jsx(N1,{todos:m,messages:h,sessionLinks:x,sessionId:f,onScrollToMessage:N=>{s(!1),setTimeout(()=>w1(N),300)}})}),u.jsx("div",{className:"flex min-w-0 flex-1 flex-col",children:u.jsx(RM,{onToggleSidebar:()=>t(N=>!N),onToggleRightPanel:y,rightPanelOpen:b})}),b&&u.jsx("div",{className:"hidden shrink-0 md:flex",children:u.jsx(N1,{todos:m,messages:h,sessionLinks:x,sessionId:f,onScrollToMessage:w1})})]})}const k1=/[#.]/g;function KM(e,t){const a=e||"",s={};let l=0,o,d;for(;l<a.length;){k1.lastIndex=l;const f=k1.exec(a),m=a.slice(l,f?f.index:a.length);m&&(o?o==="#"?s.id=m:Array.isArray(s.className)?s.className.push(m):s.className=[m]:d=m,l+=m.length),f&&(o=f[0],l++)}return{type:"element",tagName:d||t||"div",properties:s,children:[]}}function MT(e,t,a){const s=a?ZM(a):void 0;function l(o,d,...f){let m;if(o==null){m={type:"root",children:[]};const h=d;f.unshift(h)}else{m=KM(o,t);const h=m.tagName.toLowerCase(),x=s?s.get(h):void 0;if(m.tagName=x||h,VM(d))f.unshift(d);else for(const[b,y]of Object.entries(d))QM(e,m.properties,b,y)}for(const h of f)sh(m.children,h);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return l}function VM(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,a=Object.keys(e);for(const s of a){const l=t[s];if(l&&typeof l=="object"){if(!Array.isArray(l))return!0;const o=l;for(const d of o)if(typeof d!="number"&&typeof d!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function QM(e,t,a,s){const l=Fc(e,a);let o;if(s!=null){if(typeof s=="number"){if(Number.isNaN(s))return;o=s}else typeof s=="boolean"?o=s:typeof s=="string"?l.spaceSeparated?o=xx(s):l.commaSeparated?o=mx(s):l.commaOrSpaceSeparated?o=xx(mx(s).join(" ")):o=R1(l,l.property,s):Array.isArray(s)?o=[...s]:o=l.property==="style"?XM(s):String(s);if(Array.isArray(o)){const d=[];for(const f of o)d.push(R1(l,l.property,f));o=d}l.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[l.property]=o}}function sh(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const a of t)sh(e,a);else if(typeof t=="object"&&"type"in t)t.type==="root"?sh(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function R1(e,t,a){if(typeof a=="string"){if(e.number&&a&&!Number.isNaN(Number(a)))return Number(a);if((e.boolean||e.overloadedBoolean)&&(a===""||go(a)===go(t)))return!0}return a}function XM(e){const t=[];for(const[a,s]of Object.entries(e))t.push([a,s].join(": "));return t.join("; ")}function ZM(e){const t=new Map;for(const a of e)t.set(a.toLowerCase(),a);return t}const WM=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],JM=MT(So,"div"),eD=MT(cs,"g",WM);function tD(e){const t=String(e),a=[];return{toOffset:l,toPoint:s};function s(o){if(typeof o=="number"&&o>-1&&o<=t.length){let d=0;for(;;){let f=a[d];if(f===void 0){const m=O1(t,a[d-1]);f=m===-1?t.length+1:m+1,a[d]=f}if(f>o)return{line:d+1,column:o-(d>0?a[d-1]:0)+1,offset:o};d++}}}function l(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;a.length<o.line;){const f=a[a.length-1],m=O1(t,f),h=m===-1?t.length+1:m+1;if(f===h)break;a.push(h)}const d=(o.line>1?a[o.line-2]:0)+o.column-1;if(d<a[o.line-1])return d}}}function O1(e,t){const a=e.indexOf("\r",t),s=e.indexOf(`
445
+ `,t);return s===-1?a:a===-1||a+1===s?s:a<s?a:s}const Bs={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},DT={}.hasOwnProperty,nD=Object.prototype;function aD(e,t){const a=t||{};return Vh({file:a.file||void 0,location:!1,schema:a.space==="svg"?cs:So,verbose:a.verbose||!1},e)}function Vh(e,t){let a;switch(t.nodeName){case"#comment":{const s=t;return a={type:"comment",value:s.data},uc(e,s,a),a}case"#document":case"#document-fragment":{const s=t,l="mode"in s?s.mode==="quirks"||s.mode==="limited-quirks":!1;if(a={type:"root",children:LT(e,t.childNodes),data:{quirksMode:l}},e.file&&e.location){const o=String(e.file),d=tD(o),f=d.toPoint(0),m=d.toPoint(o.length);a.position={start:f,end:m}}return a}case"#documentType":{const s=t;return a={type:"doctype"},uc(e,s,a),a}case"#text":{const s=t;return a={type:"text",value:s.value},uc(e,s,a),a}default:return a=rD(e,t),a}}function LT(e,t){let a=-1;const s=[];for(;++a<t.length;){const l=Vh(e,t[a]);s.push(l)}return s}function rD(e,t){const a=e.schema;e.schema=t.namespaceURI===Bs.svg?cs:So;let s=-1;const l={};for(;++s<t.attrs.length;){const f=t.attrs[s],m=(f.prefix?f.prefix+":":"")+f.name;DT.call(nD,m)||(l[m]=f.value)}const d=(e.schema.space==="svg"?eD:JM)(t.tagName,l,LT(e,t.childNodes));if(uc(e,t,d),d.tagName==="template"){const f=t,m=f.sourceCodeLocation,h=m&&m.startTag&&Li(m.startTag),x=m&&m.endTag&&Li(m.endTag),b=Vh(e,f.content);h&&x&&e.file&&(b.position={start:h.end,end:x.start}),d.content=b}return e.schema=a,d}function uc(e,t,a){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const s=sD(e,a,t.sourceCodeLocation);s&&(e.location=!0,a.position=s)}}function sD(e,t,a){const s=Li(a);if(t.type==="element"){const l=t.children[t.children.length-1];if(s&&!a.endTag&&l&&l.position&&l.position.end&&(s.end=Object.assign({},l.position.end)),e.verbose){const o={};let d;if(a.attrs)for(d in a.attrs)DT.call(a.attrs,d)&&(o[Fc(e.schema,d).property]=Li(a.attrs[d]));a.startTag;const f=Li(a.startTag),m=a.endTag?Li(a.endTag):void 0,h={opening:f};m&&(h.closing=m),h.properties=o,t.data={position:h}}}return s}function Li(e){const t=I1({line:e.startLine,column:e.startCol,offset:e.startOffset}),a=I1({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||a?{start:t,end:a}:void 0}function I1(e){return e.line&&e.column?e:void 0}const iD={},lD={}.hasOwnProperty,jT=qy("type",{handlers:{root:uD,element:hD,text:fD,comment:mD,doctype:dD}});function oD(e,t){const s=(t||iD).space;return jT(e,s==="svg"?cs:So)}function uD(e,t){const a={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return a.childNodes=Qh(e.children,a,t),Ki(e,a),a}function cD(e,t){const a={nodeName:"#document-fragment",childNodes:[]};return a.childNodes=Qh(e.children,a,t),Ki(e,a),a}function dD(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ki(e,t),t}function fD(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ki(e,t),t}function mD(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ki(e,t),t}function hD(e,t){const a=t;let s=a;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=cs);const l=[];let o;if(e.properties){for(o in e.properties)if(o!=="children"&&lD.call(e.properties,o)){const m=pD(s,o,e.properties[o]);m&&l.push(m)}}const d=s.space,f={nodeName:e.tagName,tagName:e.tagName,attrs:l,namespaceURI:Bs[d],childNodes:[],parentNode:null};return f.childNodes=Qh(e.children,f,s),Ki(e,f),e.tagName==="template"&&e.content&&(f.content=cD(e.content,s)),f}function pD(e,t,a){const s=Fc(e,t);if(a===!1||a===null||a===void 0||typeof a=="number"&&Number.isNaN(a)||!a&&s.boolean)return;Array.isArray(a)&&(a=s.commaSeparated?ny(a):cy(a));const l={name:s.attribute,value:a===!0?"":String(a)};if(s.space&&s.space!=="html"&&s.space!=="svg"){const o=l.name.indexOf(":");o<0?l.prefix="":(l.name=l.name.slice(o+1),l.prefix=s.attribute.slice(0,o)),l.namespace=Bs[s.space]}return l}function Qh(e,t,a){let s=-1;const l=[];if(e)for(;++s<e.length;){const o=jT(e[s],a);o.parentNode=t,l.push(o)}return l}function Ki(e,t){const a=e.position;a&&a.start&&a.end&&(a.start.offset,a.end.offset,t.sourceCodeLocation={startLine:a.start.line,startCol:a.start.column,startOffset:a.start.offset,endLine:a.end.line,endCol:a.end.column,endOffset:a.end.offset})}const gD=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],bD=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Pt="�";var I;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(I||(I={}));const Yn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function BT(e){return e>=55296&&e<=57343}function xD(e){return e>=56320&&e<=57343}function ED(e,t){return(e-55296)*1024+9216+t}function PT(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function UT(e){return e>=64976&&e<=65007||bD.has(e)}var oe;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(oe||(oe={}));const yD=65536;class TD{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=yD,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,a){const{line:s,col:l,offset:o}=this,d=l+a,f=o+a;return{code:t,startLine:s,endLine:s,startCol:d,endCol:d,startOffset:f,endOffset:f}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const a=this.html.charCodeAt(this.pos+1);if(xD(a))return this.pos++,this._addGap(),ED(t,a)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,I.EOF;return this._err(oe.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,a){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=a}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,a){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(a)return this.html.startsWith(t,this.pos);for(let s=0;s<t.length;s++)if((this.html.charCodeAt(this.pos+s)|32)!==t.charCodeAt(s))return!1;return!0}peek(t){const a=this.pos+t;if(a>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;const s=this.html.charCodeAt(a);return s===I.CARRIAGE_RETURN?I.LINE_FEED:s}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,I.EOF;let t=this.html.charCodeAt(this.pos);return t===I.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,I.LINE_FEED):t===I.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,BT(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===I.LINE_FEED||t===I.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){PT(t)?this._err(oe.controlCharacterInInputStream):UT(t)&&this._err(oe.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var tt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(tt||(tt={}));function HT(e,t){for(let a=e.attrs.length-1;a>=0;a--)if(e.attrs[a].name===t)return e.attrs[a].value;return null}const _D=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),ND=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function SD(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=ND.get(e))!==null&&t!==void 0?t:e}var mn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(mn||(mn={}));const vD=32;var is;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(is||(is={}));function ih(e){return e>=mn.ZERO&&e<=mn.NINE}function AD(e){return e>=mn.UPPER_A&&e<=mn.UPPER_F||e>=mn.LOWER_A&&e<=mn.LOWER_F}function CD(e){return e>=mn.UPPER_A&&e<=mn.UPPER_Z||e>=mn.LOWER_A&&e<=mn.LOWER_Z||ih(e)}function wD(e){return e===mn.EQUALS||CD(e)}var fn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(fn||(fn={}));var _r;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(_r||(_r={}));class kD{constructor(t,a,s){this.decodeTree=t,this.emitCodePoint=a,this.errors=s,this.state=fn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=_r.Strict}startEntity(t){this.decodeMode=t,this.state=fn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,a){switch(this.state){case fn.EntityStart:return t.charCodeAt(a)===mn.NUM?(this.state=fn.NumericStart,this.consumed+=1,this.stateNumericStart(t,a+1)):(this.state=fn.NamedEntity,this.stateNamedEntity(t,a));case fn.NumericStart:return this.stateNumericStart(t,a);case fn.NumericDecimal:return this.stateNumericDecimal(t,a);case fn.NumericHex:return this.stateNumericHex(t,a);case fn.NamedEntity:return this.stateNamedEntity(t,a)}}stateNumericStart(t,a){return a>=t.length?-1:(t.charCodeAt(a)|vD)===mn.LOWER_X?(this.state=fn.NumericHex,this.consumed+=1,this.stateNumericHex(t,a+1)):(this.state=fn.NumericDecimal,this.stateNumericDecimal(t,a))}addToNumericResult(t,a,s,l){if(a!==s){const o=s-a;this.result=this.result*Math.pow(l,o)+Number.parseInt(t.substr(a,o),l),this.consumed+=o}}stateNumericHex(t,a){const s=a;for(;a<t.length;){const l=t.charCodeAt(a);if(ih(l)||AD(l))a+=1;else return this.addToNumericResult(t,s,a,16),this.emitNumericEntity(l,3)}return this.addToNumericResult(t,s,a,16),-1}stateNumericDecimal(t,a){const s=a;for(;a<t.length;){const l=t.charCodeAt(a);if(ih(l))a+=1;else return this.addToNumericResult(t,s,a,10),this.emitNumericEntity(l,2)}return this.addToNumericResult(t,s,a,10),-1}emitNumericEntity(t,a){var s;if(this.consumed<=a)return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===mn.SEMI)this.consumed+=1;else if(this.decodeMode===_r.Strict)return 0;return this.emitCodePoint(SD(this.result),this.consumed),this.errors&&(t!==mn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,a){const{decodeTree:s}=this;let l=s[this.treeIndex],o=(l&is.VALUE_LENGTH)>>14;for(;a<t.length;a++,this.excess++){const d=t.charCodeAt(a);if(this.treeIndex=RD(s,l,this.treeIndex+Math.max(1,o),d),this.treeIndex<0)return this.result===0||this.decodeMode===_r.Attribute&&(o===0||wD(d))?0:this.emitNotTerminatedNamedEntity();if(l=s[this.treeIndex],o=(l&is.VALUE_LENGTH)>>14,o!==0){if(d===mn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==_r.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:a,decodeTree:s}=this,l=(s[a]&is.VALUE_LENGTH)>>14;return this.emitNamedEntityData(a,l,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,a,s){const{decodeTree:l}=this;return this.emitCodePoint(a===1?l[t]&~is.VALUE_LENGTH:l[t+1],s),a===3&&this.emitCodePoint(l[t+2],s),s}end(){var t;switch(this.state){case fn.NamedEntity:return this.result!==0&&(this.decodeMode!==_r.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fn.NumericDecimal:return this.emitNumericEntity(0,2);case fn.NumericHex:return this.emitNumericEntity(0,3);case fn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fn.EntityStart:return 0}}}function RD(e,t,a,s){const l=(t&is.BRANCH_LENGTH)>>7,o=t&is.JUMP_TABLE;if(l===0)return o!==0&&s===o?a:-1;if(o){const m=s-o;return m<0||m>=l?-1:e[a+m]-1}let d=a,f=d+l-1;for(;d<=f;){const m=d+f>>>1,h=e[m];if(h<s)d=m+1;else if(h>s)f=m-1;else return e[m+l]}return-1}var be;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(be||(be={}));var Us;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Us||(Us={}));var Na;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Na||(Na={}));var J;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(J||(J={}));var E;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(E||(E={}));const OD=new Map([[J.A,E.A],[J.ADDRESS,E.ADDRESS],[J.ANNOTATION_XML,E.ANNOTATION_XML],[J.APPLET,E.APPLET],[J.AREA,E.AREA],[J.ARTICLE,E.ARTICLE],[J.ASIDE,E.ASIDE],[J.B,E.B],[J.BASE,E.BASE],[J.BASEFONT,E.BASEFONT],[J.BGSOUND,E.BGSOUND],[J.BIG,E.BIG],[J.BLOCKQUOTE,E.BLOCKQUOTE],[J.BODY,E.BODY],[J.BR,E.BR],[J.BUTTON,E.BUTTON],[J.CAPTION,E.CAPTION],[J.CENTER,E.CENTER],[J.CODE,E.CODE],[J.COL,E.COL],[J.COLGROUP,E.COLGROUP],[J.DD,E.DD],[J.DESC,E.DESC],[J.DETAILS,E.DETAILS],[J.DIALOG,E.DIALOG],[J.DIR,E.DIR],[J.DIV,E.DIV],[J.DL,E.DL],[J.DT,E.DT],[J.EM,E.EM],[J.EMBED,E.EMBED],[J.FIELDSET,E.FIELDSET],[J.FIGCAPTION,E.FIGCAPTION],[J.FIGURE,E.FIGURE],[J.FONT,E.FONT],[J.FOOTER,E.FOOTER],[J.FOREIGN_OBJECT,E.FOREIGN_OBJECT],[J.FORM,E.FORM],[J.FRAME,E.FRAME],[J.FRAMESET,E.FRAMESET],[J.H1,E.H1],[J.H2,E.H2],[J.H3,E.H3],[J.H4,E.H4],[J.H5,E.H5],[J.H6,E.H6],[J.HEAD,E.HEAD],[J.HEADER,E.HEADER],[J.HGROUP,E.HGROUP],[J.HR,E.HR],[J.HTML,E.HTML],[J.I,E.I],[J.IMG,E.IMG],[J.IMAGE,E.IMAGE],[J.INPUT,E.INPUT],[J.IFRAME,E.IFRAME],[J.KEYGEN,E.KEYGEN],[J.LABEL,E.LABEL],[J.LI,E.LI],[J.LINK,E.LINK],[J.LISTING,E.LISTING],[J.MAIN,E.MAIN],[J.MALIGNMARK,E.MALIGNMARK],[J.MARQUEE,E.MARQUEE],[J.MATH,E.MATH],[J.MENU,E.MENU],[J.META,E.META],[J.MGLYPH,E.MGLYPH],[J.MI,E.MI],[J.MO,E.MO],[J.MN,E.MN],[J.MS,E.MS],[J.MTEXT,E.MTEXT],[J.NAV,E.NAV],[J.NOBR,E.NOBR],[J.NOFRAMES,E.NOFRAMES],[J.NOEMBED,E.NOEMBED],[J.NOSCRIPT,E.NOSCRIPT],[J.OBJECT,E.OBJECT],[J.OL,E.OL],[J.OPTGROUP,E.OPTGROUP],[J.OPTION,E.OPTION],[J.P,E.P],[J.PARAM,E.PARAM],[J.PLAINTEXT,E.PLAINTEXT],[J.PRE,E.PRE],[J.RB,E.RB],[J.RP,E.RP],[J.RT,E.RT],[J.RTC,E.RTC],[J.RUBY,E.RUBY],[J.S,E.S],[J.SCRIPT,E.SCRIPT],[J.SEARCH,E.SEARCH],[J.SECTION,E.SECTION],[J.SELECT,E.SELECT],[J.SOURCE,E.SOURCE],[J.SMALL,E.SMALL],[J.SPAN,E.SPAN],[J.STRIKE,E.STRIKE],[J.STRONG,E.STRONG],[J.STYLE,E.STYLE],[J.SUB,E.SUB],[J.SUMMARY,E.SUMMARY],[J.SUP,E.SUP],[J.TABLE,E.TABLE],[J.TBODY,E.TBODY],[J.TEMPLATE,E.TEMPLATE],[J.TEXTAREA,E.TEXTAREA],[J.TFOOT,E.TFOOT],[J.TD,E.TD],[J.TH,E.TH],[J.THEAD,E.THEAD],[J.TITLE,E.TITLE],[J.TR,E.TR],[J.TRACK,E.TRACK],[J.TT,E.TT],[J.U,E.U],[J.UL,E.UL],[J.SVG,E.SVG],[J.VAR,E.VAR],[J.WBR,E.WBR],[J.XMP,E.XMP]]);function Vi(e){var t;return(t=OD.get(e))!==null&&t!==void 0?t:E.UNKNOWN}const xe=E,ID={[be.HTML]:new Set([xe.ADDRESS,xe.APPLET,xe.AREA,xe.ARTICLE,xe.ASIDE,xe.BASE,xe.BASEFONT,xe.BGSOUND,xe.BLOCKQUOTE,xe.BODY,xe.BR,xe.BUTTON,xe.CAPTION,xe.CENTER,xe.COL,xe.COLGROUP,xe.DD,xe.DETAILS,xe.DIR,xe.DIV,xe.DL,xe.DT,xe.EMBED,xe.FIELDSET,xe.FIGCAPTION,xe.FIGURE,xe.FOOTER,xe.FORM,xe.FRAME,xe.FRAMESET,xe.H1,xe.H2,xe.H3,xe.H4,xe.H5,xe.H6,xe.HEAD,xe.HEADER,xe.HGROUP,xe.HR,xe.HTML,xe.IFRAME,xe.IMG,xe.INPUT,xe.LI,xe.LINK,xe.LISTING,xe.MAIN,xe.MARQUEE,xe.MENU,xe.META,xe.NAV,xe.NOEMBED,xe.NOFRAMES,xe.NOSCRIPT,xe.OBJECT,xe.OL,xe.P,xe.PARAM,xe.PLAINTEXT,xe.PRE,xe.SCRIPT,xe.SECTION,xe.SELECT,xe.SOURCE,xe.STYLE,xe.SUMMARY,xe.TABLE,xe.TBODY,xe.TD,xe.TEMPLATE,xe.TEXTAREA,xe.TFOOT,xe.TH,xe.THEAD,xe.TITLE,xe.TR,xe.TRACK,xe.UL,xe.WBR,xe.XMP]),[be.MATHML]:new Set([xe.MI,xe.MO,xe.MN,xe.MS,xe.MTEXT,xe.ANNOTATION_XML]),[be.SVG]:new Set([xe.TITLE,xe.FOREIGN_OBJECT,xe.DESC]),[be.XLINK]:new Set,[be.XML]:new Set,[be.XMLNS]:new Set},lh=new Set([xe.H1,xe.H2,xe.H3,xe.H4,xe.H5,xe.H6]);J.STYLE,J.SCRIPT,J.XMP,J.IFRAME,J.NOEMBED,J.NOFRAMES,J.PLAINTEXT;var j;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(j||(j={}));const Xt={DATA:j.DATA,RCDATA:j.RCDATA,RAWTEXT:j.RAWTEXT,SCRIPT_DATA:j.SCRIPT_DATA,PLAINTEXT:j.PLAINTEXT,CDATA_SECTION:j.CDATA_SECTION};function MD(e){return e>=I.DIGIT_0&&e<=I.DIGIT_9}function eo(e){return e>=I.LATIN_CAPITAL_A&&e<=I.LATIN_CAPITAL_Z}function DD(e){return e>=I.LATIN_SMALL_A&&e<=I.LATIN_SMALL_Z}function as(e){return DD(e)||eo(e)}function M1(e){return as(e)||MD(e)}function rc(e){return e+32}function FT(e){return e===I.SPACE||e===I.LINE_FEED||e===I.TABULATION||e===I.FORM_FEED}function D1(e){return FT(e)||e===I.SOLIDUS||e===I.GREATER_THAN_SIGN}function LD(e){return e===I.NULL?oe.nullCharacterReference:e>1114111?oe.characterReferenceOutsideUnicodeRange:BT(e)?oe.surrogateCharacterReference:UT(e)?oe.noncharacterCharacterReference:PT(e)||e===I.CARRIAGE_RETURN?oe.controlCharacterReference:null}class jD{constructor(t,a){this.options=t,this.handler=a,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=j.DATA,this.returnState=j.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new TD(a),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new kD(_D,(s,l)=>{this.preprocessor.pos=this.entityStartPos+l-1,this._flushCodePointConsumedAsCharacterReference(s)},a.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(oe.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:s=>{this._err(oe.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+s)},validateNumericCharacterReference:s=>{const l=LD(s);l&&this._err(l,1)}}:void 0)}_err(t,a=0){var s,l;(l=(s=this.handler).onParseError)===null||l===void 0||l.call(s,this.preprocessor.getError(t,a))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,a,s){this.active=!0,this.preprocessor.write(t,a),this._runParsingLoop(),this.paused||s==null||s()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let a=0;a<t;a++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,a){return this.preprocessor.startsWith(t,a)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:tt.START_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:tt.END_TAG,tagName:"",tagID:E.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:tt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:tt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,a){this.currentCharacterToken={type:t,chars:a,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,a;const s=this.currentToken;if(HT(s,this.currentAttr.name)===null){if(s.attrs.push(this.currentAttr),s.location&&this.currentLocation){const l=(t=(a=s.location).attrs)!==null&&t!==void 0?t:a.attrs=Object.create(null);l[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(oe.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=Vi(t.tagName),t.type===tt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(oe.endTagWithAttributes),t.selfClosing&&this._err(oe.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case tt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case tt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case tt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:tt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,a){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=a;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,a)}_emitCodePoint(t){const a=FT(t)?tt.WHITESPACE_CHARACTER:t===I.NULL?tt.NULL_CHARACTER:tt.CHARACTER;this._appendCharToCurrentCharacterToken(a,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(tt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=j.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?_r.Attribute:_r.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===j.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===j.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case j.DATA:{this._stateData(t);break}case j.RCDATA:{this._stateRcdata(t);break}case j.RAWTEXT:{this._stateRawtext(t);break}case j.SCRIPT_DATA:{this._stateScriptData(t);break}case j.PLAINTEXT:{this._statePlaintext(t);break}case j.TAG_OPEN:{this._stateTagOpen(t);break}case j.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case j.TAG_NAME:{this._stateTagName(t);break}case j.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case j.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case j.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case j.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case j.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case j.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case j.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case j.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case j.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case j.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case j.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case j.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case j.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case j.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case j.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case j.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case j.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case j.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case j.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case j.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case j.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case j.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case j.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case j.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case j.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case j.BOGUS_COMMENT:{this._stateBogusComment(t);break}case j.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case j.COMMENT_START:{this._stateCommentStart(t);break}case j.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case j.COMMENT:{this._stateComment(t);break}case j.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case j.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case j.COMMENT_END:{this._stateCommentEnd(t);break}case j.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case j.DOCTYPE:{this._stateDoctype(t);break}case j.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case j.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case j.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case j.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case j.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case j.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case j.CDATA_SECTION:{this._stateCdataSection(t);break}case j.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case j.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case j.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case j.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=j.TAG_OPEN;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitCodePoint(t);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case I.AMPERSAND:{this._startCharacterReference();break}case I.LESS_THAN_SIGN:{this.state=j.RCDATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case I.LESS_THAN_SIGN:{this.state=j.RAWTEXT_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(as(t))this._createStartTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case I.EXCLAMATION_MARK:{this.state=j.MARKUP_DECLARATION_OPEN;break}case I.SOLIDUS:{this.state=j.END_TAG_OPEN;break}case I.QUESTION_MARK:{this._err(oe.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t);break}case I.EOF:{this._err(oe.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(oe.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=j.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(as(t))this._createEndTagToken(),this.state=j.TAG_NAME,this._stateTagName(t);else switch(t){case I.GREATER_THAN_SIGN:{this._err(oe.missingEndTagName),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(oe.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.tagName+=Pt;break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:a.tagName+=String.fromCodePoint(eo(t)?rc(t):t)}}_stateRcdataLessThanSign(t){t===I.SOLIDUS?this.state=j.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){as(t)?(this.state=j.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=j.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const a=this.currentToken;switch(a.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=j.BEFORE_ATTRIBUTE_NAME,!1;case I.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=j.SELF_CLOSING_START_TAG,!1;case I.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=j.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===I.SOLIDUS?this.state=j.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){as(t)?(this.state=j.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case I.SOLIDUS:{this.state=j.SCRIPT_DATA_END_TAG_OPEN;break}case I.EXCLAMATION_MARK:{this.state=j.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=j.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){as(t)?(this.state=j.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===I.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===I.HYPHEN_MINUS?(this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=j.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case I.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_ESCAPED,this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===I.SOLIDUS?this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:as(t)?(this._emitChars("<"),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){as(t)?(this.state=j.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Yn.SCRIPT,!1)&&D1(this.preprocessor.peek(Yn.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<Yn.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=j.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case I.HYPHEN_MINUS:{this._emitChars("-");break}case I.LESS_THAN_SIGN:{this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case I.GREATER_THAN_SIGN:{this.state=j.SCRIPT_DATA,this._emitChars(">");break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Pt);break}case I.EOF:{this._err(oe.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===I.SOLIDUS?(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Yn.SCRIPT,!1)&&D1(this.preprocessor.peek(Yn.SCRIPT.length))){this._emitCodePoint(t);for(let a=0;a<Yn.SCRIPT.length;a++)this._emitCodePoint(this._consume());this.state=j.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=j.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this.state=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._err(oe.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=j.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=j.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:case I.SOLIDUS:case I.GREATER_THAN_SIGN:case I.EOF:{this._leaveAttrName(),this.state=j.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case I.EQUALS_SIGN:{this._leaveAttrName(),this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:{this._err(oe.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.currentAttr.name+=Pt;break}default:this.currentAttr.name+=String.fromCodePoint(eo(t)?rc(t):t)}}_stateAfterAttributeName(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.SOLIDUS:{this.state=j.SELF_CLOSING_START_TAG;break}case I.EQUALS_SIGN:{this.state=j.BEFORE_ATTRIBUTE_VALUE;break}case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=j.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{this.state=j.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this.state=j.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingAttributeValue),this.state=j.DATA,this.emitCurrentTagToken();break}default:this.state=j.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case I.QUOTATION_MARK:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.currentAttr.value+=Pt;break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case I.APOSTROPHE:{this.state=j.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.currentAttr.value+=Pt;break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=j.BEFORE_ATTRIBUTE_NAME;break}case I.AMPERSAND:{this._startCharacterReference();break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),this.currentAttr.value+=Pt;break}case I.QUOTATION_MARK:case I.APOSTROPHE:case I.LESS_THAN_SIGN:case I.EQUALS_SIGN:case I.GRAVE_ACCENT:{this._err(oe.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this._leaveAttrValue(),this.state=j.BEFORE_ATTRIBUTE_NAME;break}case I.SOLIDUS:{this._leaveAttrValue(),this.state=j.SELF_CLOSING_START_TAG;break}case I.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=j.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this._err(oe.missingWhitespaceBetweenAttributes),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case I.GREATER_THAN_SIGN:{const a=this.currentToken;a.selfClosing=!0,this.state=j.DATA,this.emitCurrentTagToken();break}case I.EOF:{this._err(oe.eofInTag),this._emitEOFToken();break}default:this._err(oe.unexpectedSolidusInTag),this.state=j.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const a=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(a);break}case I.EOF:{this.emitCurrentComment(a),this._emitEOFToken();break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.data+=Pt;break}default:a.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Yn.DASH_DASH,!0)?(this._createCommentToken(Yn.DASH_DASH.length+1),this.state=j.COMMENT_START):this._consumeSequenceIfMatch(Yn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Yn.DOCTYPE.length+1),this.state=j.DOCTYPE):this._consumeSequenceIfMatch(Yn.CDATA_START,!0)?this.inForeignNode?this.state=j.CDATA_SECTION:(this._err(oe.cdataInHtmlContent),this._createCommentToken(Yn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=j.BOGUS_COMMENT):this._ensureHibernation()||(this._err(oe.incorrectlyOpenedComment),this._createCommentToken(2),this.state=j.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case I.HYPHEN_MINUS:{this.state=j.COMMENT_START_DASH;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptClosingOfEmptyComment),this.state=j.DATA;const a=this.currentToken;this.emitCurrentComment(a);break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const a=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptClosingOfEmptyComment),this.state=j.DATA,this.emitCurrentComment(a);break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateComment(t){const a=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=j.COMMENT_END_DASH;break}case I.LESS_THAN_SIGN:{a.data+="<",this.state=j.COMMENT_LESS_THAN_SIGN;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.data+=Pt;break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const a=this.currentToken;switch(t){case I.EXCLAMATION_MARK:{a.data+="!",this.state=j.COMMENT_LESS_THAN_SIGN_BANG;break}case I.LESS_THAN_SIGN:{a.data+="<";break}default:this.state=j.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===I.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=j.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===I.HYPHEN_MINUS?this.state=j.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=j.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==I.GREATER_THAN_SIGN&&t!==I.EOF&&this._err(oe.nestedComment),this.state=j.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const a=this.currentToken;switch(t){case I.HYPHEN_MINUS:{this.state=j.COMMENT_END;break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="-",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const a=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentComment(a);break}case I.EXCLAMATION_MARK:{this.state=j.COMMENT_END_BANG;break}case I.HYPHEN_MINUS:{a.data+="-";break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--",this.state=j.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const a=this.currentToken;switch(t){case I.HYPHEN_MINUS:{a.data+="--!",this.state=j.COMMENT_END_DASH;break}case I.GREATER_THAN_SIGN:{this._err(oe.incorrectlyClosedComment),this.state=j.DATA,this.emitCurrentComment(a);break}case I.EOF:{this._err(oe.eofInComment),this.emitCurrentComment(a),this._emitEOFToken();break}default:a.data+="--!",this.state=j.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case I.EOF:{this._err(oe.eofInDoctype),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingWhitespaceBeforeDoctypeName),this.state=j.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(eo(t))this._createDoctypeToken(String.fromCharCode(rc(t))),this.state=j.DOCTYPE_NAME;else switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.NULL:{this._err(oe.unexpectedNullCharacter),this._createDoctypeToken(Pt),this.state=j.DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypeName),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),this._createDoctypeToken(null);const a=this.currentToken;a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=j.DOCTYPE_NAME}}_stateDoctypeName(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.AFTER_DOCTYPE_NAME;break}case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.name+=Pt;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.name+=String.fromCodePoint(eo(t)?rc(t):t)}}_stateAfterDoctypeName(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Yn.PUBLIC,!1)?this.state=j.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Yn.SYSTEM,!1)?this.state=j.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(oe.invalidCharacterSequenceAfterDoctypeName),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(oe.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(oe.missingWhitespaceAfterDoctypePublicKeyword),a.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{a.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{a.publicId="",this.state=j.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypePublicIdentifier),a.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypePublicIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.publicId+=Pt;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const a=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=j.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.publicId+=Pt;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptDoctypePublicIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case I.GREATER_THAN_SIGN:{this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.QUOTATION_MARK:{this._err(oe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(oe.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.QUOTATION_MARK:{a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:{this.state=j.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.QUOTATION_MARK:{this._err(oe.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{this._err(oe.missingWhitespaceAfterDoctypeSystemKeyword),a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.QUOTATION_MARK:{a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case I.APOSTROPHE:{a.systemId="",this.state=j.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case I.GREATER_THAN_SIGN:{this._err(oe.missingDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.DATA,this.emitCurrentDoctype(a);break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.missingQuoteBeforeDoctypeSystemIdentifier),a.forceQuirks=!0,this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const a=this.currentToken;switch(t){case I.QUOTATION_MARK:{this.state=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.systemId+=Pt;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const a=this.currentToken;switch(t){case I.APOSTROPHE:{this.state=j.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case I.NULL:{this._err(oe.unexpectedNullCharacter),a.systemId+=Pt;break}case I.GREATER_THAN_SIGN:{this._err(oe.abruptDoctypeSystemIdentifier),a.forceQuirks=!0,this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:a.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const a=this.currentToken;switch(t){case I.SPACE:case I.LINE_FEED:case I.TABULATION:case I.FORM_FEED:break;case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.EOF:{this._err(oe.eofInDoctype),a.forceQuirks=!0,this.emitCurrentDoctype(a),this._emitEOFToken();break}default:this._err(oe.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=j.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const a=this.currentToken;switch(t){case I.GREATER_THAN_SIGN:{this.emitCurrentDoctype(a),this.state=j.DATA;break}case I.NULL:{this._err(oe.unexpectedNullCharacter);break}case I.EOF:{this.emitCurrentDoctype(a),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case I.RIGHT_SQUARE_BRACKET:{this.state=j.CDATA_SECTION_BRACKET;break}case I.EOF:{this._err(oe.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===I.RIGHT_SQUARE_BRACKET?this.state=j.CDATA_SECTION_END:(this._emitChars("]"),this.state=j.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case I.GREATER_THAN_SIGN:{this.state=j.DATA;break}case I.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=j.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(I.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&M1(this.preprocessor.peek(1))?j.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){M1(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===I.SEMICOLON&&this._err(oe.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const zT=new Set([E.DD,E.DT,E.LI,E.OPTGROUP,E.OPTION,E.P,E.RB,E.RP,E.RT,E.RTC]),L1=new Set([...zT,E.CAPTION,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]),Cc=new Set([E.APPLET,E.CAPTION,E.HTML,E.MARQUEE,E.OBJECT,E.TABLE,E.TD,E.TEMPLATE,E.TH]),BD=new Set([...Cc,E.OL,E.UL]),PD=new Set([...Cc,E.BUTTON]),j1=new Set([E.ANNOTATION_XML,E.MI,E.MN,E.MO,E.MS,E.MTEXT]),B1=new Set([E.DESC,E.FOREIGN_OBJECT,E.TITLE]),UD=new Set([E.TR,E.TEMPLATE,E.HTML]),HD=new Set([E.TBODY,E.TFOOT,E.THEAD,E.TEMPLATE,E.HTML]),FD=new Set([E.TABLE,E.TEMPLATE,E.HTML]),zD=new Set([E.TD,E.TH]);class qD{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,a,s){this.treeAdapter=a,this.handler=s,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=E.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===E.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===be.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,a){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=a,this.currentTagId=a,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,a,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,a){const s=this._indexOf(t);this.items[s]=a,s===this.stackTop&&(this.current=a)}insertAfter(t,a,s){const l=this._indexOf(t)+1;this.items.splice(l,0,a),this.tagIDs.splice(l,0,s),this.stackTop++,l===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,l===this.stackTop)}popUntilTagNamePopped(t){let a=this.stackTop+1;do a=this.tagIDs.lastIndexOf(t,a-1);while(a>0&&this.treeAdapter.getNamespaceURI(this.items[a])!==be.HTML);this.shortenToLength(Math.max(a,0))}shortenToLength(t){for(;this.stackTop>=t;){const a=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(a,this.stackTop<t)}}popUntilElementPopped(t){const a=this._indexOf(t);this.shortenToLength(Math.max(a,0))}popUntilPopped(t,a){const s=this._indexOfTagNames(t,a);this.shortenToLength(Math.max(s,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(lh,be.HTML)}popUntilTableCellPopped(){this.popUntilPopped(zD,be.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,a){for(let s=this.stackTop;s>=0;s--)if(t.has(this.tagIDs[s])&&this.treeAdapter.getNamespaceURI(this.items[s])===a)return s;return-1}clearBackTo(t,a){const s=this._indexOfTagNames(t,a);this.shortenToLength(s+1)}clearBackToTableContext(){this.clearBackTo(FD,be.HTML)}clearBackToTableBodyContext(){this.clearBackTo(HD,be.HTML)}clearBackToTableRowContext(){this.clearBackTo(UD,be.HTML)}remove(t){const a=this._indexOf(t);a>=0&&(a===this.stackTop?this.pop():(this.items.splice(a,1),this.tagIDs.splice(a,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===E.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const a=this._indexOf(t)-1;return a>=0?this.items[a]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===E.HTML}hasInDynamicScope(t,a){for(let s=this.stackTop;s>=0;s--){const l=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case be.HTML:{if(l===t)return!0;if(a.has(l))return!1;break}case be.SVG:{if(B1.has(l))return!1;break}case be.MATHML:{if(j1.has(l))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Cc)}hasInListItemScope(t){return this.hasInDynamicScope(t,BD)}hasInButtonScope(t){return this.hasInDynamicScope(t,PD)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const a=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case be.HTML:{if(lh.has(a))return!0;if(Cc.has(a))return!1;break}case be.SVG:{if(B1.has(a))return!1;break}case be.MATHML:{if(j1.has(a))return!1;break}}}return!0}hasInTableScope(t){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===be.HTML)switch(this.tagIDs[a]){case t:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===be.HTML)switch(this.tagIDs[t]){case E.TBODY:case E.THEAD:case E.TFOOT:return!0;case E.TABLE:case E.HTML:return!1}return!0}hasInSelectScope(t){for(let a=this.stackTop;a>=0;a--)if(this.treeAdapter.getNamespaceURI(this.items[a])===be.HTML)switch(this.tagIDs[a]){case t:return!0;case E.OPTION:case E.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&zT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&L1.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&L1.has(this.currentTagId);)this.pop()}}const Lm=3;var Ka;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ka||(Ka={}));const P1={type:Ka.Marker};class YD{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,a){const s=[],l=a.length,o=this.treeAdapter.getTagName(t),d=this.treeAdapter.getNamespaceURI(t);for(let f=0;f<this.entries.length;f++){const m=this.entries[f];if(m.type===Ka.Marker)break;const{element:h}=m;if(this.treeAdapter.getTagName(h)===o&&this.treeAdapter.getNamespaceURI(h)===d){const x=this.treeAdapter.getAttrList(h);x.length===l&&s.push({idx:f,attrs:x})}}return s}_ensureNoahArkCondition(t){if(this.entries.length<Lm)return;const a=this.treeAdapter.getAttrList(t),s=this._getNoahArkConditionCandidates(t,a);if(s.length<Lm)return;const l=new Map(a.map(d=>[d.name,d.value]));let o=0;for(let d=0;d<s.length;d++){const f=s[d];f.attrs.every(m=>l.get(m.name)===m.value)&&(o+=1,o>=Lm&&this.entries.splice(f.idx,1))}}insertMarker(){this.entries.unshift(P1)}pushElement(t,a){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ka.Element,element:t,token:a})}insertElementAfterBookmark(t,a){const s=this.entries.indexOf(this.bookmark);this.entries.splice(s,0,{type:Ka.Element,element:t,token:a})}removeEntry(t){const a=this.entries.indexOf(t);a!==-1&&this.entries.splice(a,1)}clearToLastMarker(){const t=this.entries.indexOf(P1);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const a=this.entries.find(s=>s.type===Ka.Marker||this.treeAdapter.getTagName(s.element)===t);return a&&a.type===Ka.Element?a:null}getElementEntry(t){return this.entries.find(a=>a.type===Ka.Element&&a.element===t)}}const rs={createDocument(){return{nodeName:"#document",mode:Na.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,a){return{nodeName:e,tagName:e,attrs:a,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,a){const s=e.childNodes.indexOf(a);e.childNodes.splice(s,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,a,s){const l=e.childNodes.find(o=>o.nodeName==="#documentType");if(l)l.name=t,l.publicId=a,l.systemId=s;else{const o={nodeName:"#documentType",name:t,publicId:a,systemId:s,parentNode:null};rs.appendChild(e,o)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const a=e.childNodes[e.childNodes.length-1];if(rs.isTextNode(a)){a.value+=t;return}}rs.appendChild(e,rs.createTextNode(t))},insertTextBefore(e,t,a){const s=e.childNodes[e.childNodes.indexOf(a)-1];s&&rs.isTextNode(s)?s.value+=t:rs.insertBefore(e,rs.createTextNode(t),a)},adoptAttributes(e,t){const a=new Set(e.attrs.map(s=>s.name));for(let s=0;s<t.length;s++)a.has(t[s].name)||e.attrs.push(t[s])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},qT="html",$D="about:legacy-compat",GD="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",YT=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],KD=[...YT,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],VD=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),$T=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],QD=[...$T,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function U1(e,t){return t.some(a=>e.startsWith(a))}function XD(e){return e.name===qT&&e.publicId===null&&(e.systemId===null||e.systemId===$D)}function ZD(e){if(e.name!==qT)return Na.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===GD)return Na.QUIRKS;let{publicId:a}=e;if(a!==null){if(a=a.toLowerCase(),VD.has(a))return Na.QUIRKS;let s=t===null?KD:YT;if(U1(a,s))return Na.QUIRKS;if(s=t===null?$T:QD,U1(a,s))return Na.LIMITED_QUIRKS}return Na.NO_QUIRKS}const H1={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},WD="definitionurl",JD="definitionURL",eL=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),tL=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:be.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:be.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:be.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:be.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:be.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:be.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:be.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:be.XML}],["xml:space",{prefix:"xml",name:"space",namespace:be.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:be.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:be.XMLNS}]]),nL=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),aL=new Set([E.B,E.BIG,E.BLOCKQUOTE,E.BODY,E.BR,E.CENTER,E.CODE,E.DD,E.DIV,E.DL,E.DT,E.EM,E.EMBED,E.H1,E.H2,E.H3,E.H4,E.H5,E.H6,E.HEAD,E.HR,E.I,E.IMG,E.LI,E.LISTING,E.MENU,E.META,E.NOBR,E.OL,E.P,E.PRE,E.RUBY,E.S,E.SMALL,E.SPAN,E.STRONG,E.STRIKE,E.SUB,E.SUP,E.TABLE,E.TT,E.U,E.UL,E.VAR]);function rL(e){const t=e.tagID;return t===E.FONT&&e.attrs.some(({name:s})=>s===Us.COLOR||s===Us.SIZE||s===Us.FACE)||aL.has(t)}function GT(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===WD){e.attrs[t].name=JD;break}}function KT(e){for(let t=0;t<e.attrs.length;t++){const a=eL.get(e.attrs[t].name);a!=null&&(e.attrs[t].name=a)}}function Xh(e){for(let t=0;t<e.attrs.length;t++){const a=tL.get(e.attrs[t].name);a&&(e.attrs[t].prefix=a.prefix,e.attrs[t].name=a.name,e.attrs[t].namespace=a.namespace)}}function sL(e){const t=nL.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Vi(e.tagName))}function iL(e,t){return t===be.MATHML&&(e===E.MI||e===E.MO||e===E.MN||e===E.MS||e===E.MTEXT)}function lL(e,t,a){if(t===be.MATHML&&e===E.ANNOTATION_XML){for(let s=0;s<a.length;s++)if(a[s].name===Us.ENCODING){const l=a[s].value.toLowerCase();return l===H1.TEXT_HTML||l===H1.APPLICATION_XML}}return t===be.SVG&&(e===E.FOREIGN_OBJECT||e===E.DESC||e===E.TITLE)}function oL(e,t,a,s){return(!s||s===be.HTML)&&lL(e,t,a)||(!s||s===be.MATHML)&&iL(e,t)}const uL="hidden",cL=8,dL=3;var F;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(F||(F={}));const fL={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},VT=new Set([E.TABLE,E.TBODY,E.TFOOT,E.THEAD,E.TR]),F1={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:rs,onParseError:null};class z1{constructor(t,a,s=null,l=null){this.fragmentContext=s,this.scriptHandler=l,this.currentToken=null,this.stopped=!1,this.insertionMode=F.INITIAL,this.originalInsertionMode=F.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...F1,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=a??this.treeAdapter.createDocument(),this.tokenizer=new jD(this.options,this),this.activeFormattingElements=new YD(this.treeAdapter),this.fragmentContextID=s?Vi(this.treeAdapter.getTagName(s)):E.UNKNOWN,this._setContextModes(s??this.document,this.fragmentContextID),this.openElements=new qD(this.document,this.treeAdapter,this)}static parse(t,a){const s=new this(a);return s.tokenizer.write(t,!0),s.document}static getFragmentParser(t,a){const s={...F1,...a};t??(t=s.treeAdapter.createElement(J.TEMPLATE,be.HTML,[]));const l=s.treeAdapter.createElement("documentmock",be.HTML,[]),o=new this(s,l,t);return o.fragmentContextID===E.TEMPLATE&&o.tmplInsertionModeStack.unshift(F.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),a=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,a),a}_err(t,a,s){var l;if(!this.onParseError)return;const o=(l=t.location)!==null&&l!==void 0?l:fL,d={code:a,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:s?o.startLine:o.endLine,endCol:s?o.startCol:o.endCol,endOffset:s?o.startOffset:o.endOffset};this.onParseError(d)}onItemPush(t,a,s){var l,o;(o=(l=this.treeAdapter).onItemPush)===null||o===void 0||o.call(l,t),s&&this.openElements.stackTop>0&&this._setContextModes(t,a)}onItemPop(t,a){var s,l;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(l=(s=this.treeAdapter).onItemPop)===null||l===void 0||l.call(s,t,this.openElements.current),a){let o,d;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,d=this.fragmentContextID):{current:o,currentTagId:d}=this.openElements,this._setContextModes(o,d)}}_setContextModes(t,a){const s=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===be.HTML;this.currentNotInHTML=!s,this.tokenizer.inForeignNode=!s&&t!==void 0&&a!==void 0&&!this._isIntegrationPoint(a,t)}_switchToTextParsing(t,a){this._insertElement(t,be.HTML),this.tokenizer.state=a,this.originalInsertionMode=this.insertionMode,this.insertionMode=F.TEXT}switchToPlaintextParsing(){this.insertionMode=F.TEXT,this.originalInsertionMode=F.IN_BODY,this.tokenizer.state=Xt.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===J.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==be.HTML))switch(this.fragmentContextID){case E.TITLE:case E.TEXTAREA:{this.tokenizer.state=Xt.RCDATA;break}case E.STYLE:case E.XMP:case E.IFRAME:case E.NOEMBED:case E.NOFRAMES:case E.NOSCRIPT:{this.tokenizer.state=Xt.RAWTEXT;break}case E.SCRIPT:{this.tokenizer.state=Xt.SCRIPT_DATA;break}case E.PLAINTEXT:{this.tokenizer.state=Xt.PLAINTEXT;break}}}_setDocumentType(t){const a=t.name||"",s=t.publicId||"",l=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,a,s,l),t.location){const d=this.treeAdapter.getChildNodes(this.document).find(f=>this.treeAdapter.isDocumentTypeNode(f));d&&this.treeAdapter.setNodeSourceCodeLocation(d,t.location)}}_attachElementToTree(t,a){if(this.options.sourceCodeLocationInfo){const s=a&&{...a,startTag:a};this.treeAdapter.setNodeSourceCodeLocation(t,s)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const s=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(s??this.document,t)}}_appendElement(t,a){const s=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(s,t.location)}_insertElement(t,a){const s=this.treeAdapter.createElement(t.tagName,a,t.attrs);this._attachElementToTree(s,t.location),this.openElements.push(s,t.tagID)}_insertFakeElement(t,a){const s=this.treeAdapter.createElement(t,be.HTML,[]);this._attachElementToTree(s,null),this.openElements.push(s,a)}_insertTemplate(t){const a=this.treeAdapter.createElement(t.tagName,be.HTML,t.attrs),s=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(a,s),this._attachElementToTree(a,t.location),this.openElements.push(a,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(J.HTML,be.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,E.HTML)}_appendCommentNode(t,a){const s=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(a,s),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_insertCharacters(t){let a,s;if(this._shouldFosterParentOnInsertion()?({parent:a,beforeElement:s}=this._findFosterParentingLocation(),s?this.treeAdapter.insertTextBefore(a,t.chars,s):this.treeAdapter.insertText(a,t.chars)):(a=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(a,t.chars)),!t.location)return;const l=this.treeAdapter.getChildNodes(a),o=s?l.lastIndexOf(s):l.length,d=l[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(d)){const{endLine:m,endCol:h,endOffset:x}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(d,{endLine:m,endCol:h,endOffset:x})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(d,t.location)}_adoptNodes(t,a){for(let s=this.treeAdapter.getFirstChild(t);s;s=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(s),this.treeAdapter.appendChild(a,s)}_setEndLocation(t,a){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&a.location){const s=a.location,l=this.treeAdapter.getTagName(t),o=a.type===tt.END_TAG&&l===a.tagName?{endTag:{...s},endLine:s.endLine,endCol:s.endCol,endOffset:s.endOffset}:{endLine:s.startLine,endCol:s.startCol,endOffset:s.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,o)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let a,s;return this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,t.tagID===E.SVG&&this.treeAdapter.getTagName(a)===J.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(a)===be.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===E.MGLYPH||t.tagID===E.MALIGNMARK)&&s!==void 0&&!this._isIntegrationPoint(s,a,be.HTML)}_processToken(t){switch(t.type){case tt.CHARACTER:{this.onCharacter(t);break}case tt.NULL_CHARACTER:{this.onNullCharacter(t);break}case tt.COMMENT:{this.onComment(t);break}case tt.DOCTYPE:{this.onDoctype(t);break}case tt.START_TAG:{this._processStartTag(t);break}case tt.END_TAG:{this.onEndTag(t);break}case tt.EOF:{this.onEof(t);break}case tt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,a,s){const l=this.treeAdapter.getNamespaceURI(a),o=this.treeAdapter.getAttrList(a);return oL(t,l,o,s)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const a=this.activeFormattingElements.entries.findIndex(l=>l.type===Ka.Marker||this.openElements.contains(l.element)),s=a===-1?t-1:a-1;for(let l=s;l>=0;l--){const o=this.activeFormattingElements.entries[l];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=F.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(E.P),this.openElements.popUntilTagNamePopped(E.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case E.TR:{this.insertionMode=F.IN_ROW;return}case E.TBODY:case E.THEAD:case E.TFOOT:{this.insertionMode=F.IN_TABLE_BODY;return}case E.CAPTION:{this.insertionMode=F.IN_CAPTION;return}case E.COLGROUP:{this.insertionMode=F.IN_COLUMN_GROUP;return}case E.TABLE:{this.insertionMode=F.IN_TABLE;return}case E.BODY:{this.insertionMode=F.IN_BODY;return}case E.FRAMESET:{this.insertionMode=F.IN_FRAMESET;return}case E.SELECT:{this._resetInsertionModeForSelect(t);return}case E.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case E.HTML:{this.insertionMode=this.headElement?F.AFTER_HEAD:F.BEFORE_HEAD;return}case E.TD:case E.TH:{if(t>0){this.insertionMode=F.IN_CELL;return}break}case E.HEAD:{if(t>0){this.insertionMode=F.IN_HEAD;return}break}}this.insertionMode=F.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let a=t-1;a>0;a--){const s=this.openElements.tagIDs[a];if(s===E.TEMPLATE)break;if(s===E.TABLE){this.insertionMode=F.IN_SELECT_IN_TABLE;return}}this.insertionMode=F.IN_SELECT}_isElementCausesFosterParenting(t){return VT.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const a=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case E.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(a)===be.HTML)return{parent:this.treeAdapter.getTemplateContent(a),beforeElement:null};break}case E.TABLE:{const s=this.treeAdapter.getParentNode(a);return s?{parent:s,beforeElement:a}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const a=this._findFosterParentingLocation();a.beforeElement?this.treeAdapter.insertBefore(a.parent,t,a.beforeElement):this.treeAdapter.appendChild(a.parent,t)}_isSpecialElement(t,a){const s=this.treeAdapter.getNamespaceURI(t);return ID[s].has(a)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){z8(this,t);return}switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{ro(this,t);break}case F.BEFORE_HEAD:{so(this,t);break}case F.IN_HEAD:{io(this,t);break}case F.IN_HEAD_NO_SCRIPT:{lo(this,t);break}case F.AFTER_HEAD:{oo(this,t);break}case F.IN_BODY:case F.IN_CAPTION:case F.IN_CELL:case F.IN_TEMPLATE:{XT(this,t);break}case F.TEXT:case F.IN_SELECT:case F.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case F.IN_TABLE:case F.IN_TABLE_BODY:case F.IN_ROW:{jm(this,t);break}case F.IN_TABLE_TEXT:{n_(this,t);break}case F.IN_COLUMN_GROUP:{wc(this,t);break}case F.AFTER_BODY:{kc(this,t);break}case F.AFTER_AFTER_BODY:{cc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){F8(this,t);return}switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{ro(this,t);break}case F.BEFORE_HEAD:{so(this,t);break}case F.IN_HEAD:{io(this,t);break}case F.IN_HEAD_NO_SCRIPT:{lo(this,t);break}case F.AFTER_HEAD:{oo(this,t);break}case F.TEXT:{this._insertCharacters(t);break}case F.IN_TABLE:case F.IN_TABLE_BODY:case F.IN_ROW:{jm(this,t);break}case F.IN_COLUMN_GROUP:{wc(this,t);break}case F.AFTER_BODY:{kc(this,t);break}case F.AFTER_AFTER_BODY:{cc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){oh(this,t);return}switch(this.insertionMode){case F.INITIAL:case F.BEFORE_HTML:case F.BEFORE_HEAD:case F.IN_HEAD:case F.IN_HEAD_NO_SCRIPT:case F.AFTER_HEAD:case F.IN_BODY:case F.IN_TABLE:case F.IN_CAPTION:case F.IN_COLUMN_GROUP:case F.IN_TABLE_BODY:case F.IN_ROW:case F.IN_CELL:case F.IN_SELECT:case F.IN_SELECT_IN_TABLE:case F.IN_TEMPLATE:case F.IN_FRAMESET:case F.AFTER_FRAMESET:{oh(this,t);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}case F.AFTER_BODY:{EL(this,t);break}case F.AFTER_AFTER_BODY:case F.AFTER_AFTER_FRAMESET:{yL(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case F.INITIAL:{TL(this,t);break}case F.BEFORE_HEAD:case F.IN_HEAD:case F.IN_HEAD_NO_SCRIPT:case F.AFTER_HEAD:{this._err(t,oe.misplacedDoctype);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,oe.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?q8(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{_L(this,t);break}case F.BEFORE_HEAD:{SL(this,t);break}case F.IN_HEAD:{La(this,t);break}case F.IN_HEAD_NO_SCRIPT:{CL(this,t);break}case F.AFTER_HEAD:{kL(this,t);break}case F.IN_BODY:{An(this,t);break}case F.IN_TABLE:{Hi(this,t);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}case F.IN_CAPTION:{v8(this,t);break}case F.IN_COLUMN_GROUP:{Jh(this,t);break}case F.IN_TABLE_BODY:{Qc(this,t);break}case F.IN_ROW:{Xc(this,t);break}case F.IN_CELL:{w8(this,t);break}case F.IN_SELECT:{s_(this,t);break}case F.IN_SELECT_IN_TABLE:{R8(this,t);break}case F.IN_TEMPLATE:{I8(this,t);break}case F.AFTER_BODY:{D8(this,t);break}case F.IN_FRAMESET:{L8(this,t);break}case F.AFTER_FRAMESET:{B8(this,t);break}case F.AFTER_AFTER_BODY:{U8(this,t);break}case F.AFTER_AFTER_FRAMESET:{H8(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Y8(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{NL(this,t);break}case F.BEFORE_HEAD:{vL(this,t);break}case F.IN_HEAD:{AL(this,t);break}case F.IN_HEAD_NO_SCRIPT:{wL(this,t);break}case F.AFTER_HEAD:{RL(this,t);break}case F.IN_BODY:{Vc(this,t);break}case F.TEXT:{p8(this,t);break}case F.IN_TABLE:{Eo(this,t);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}case F.IN_CAPTION:{A8(this,t);break}case F.IN_COLUMN_GROUP:{C8(this,t);break}case F.IN_TABLE_BODY:{uh(this,t);break}case F.IN_ROW:{r_(this,t);break}case F.IN_CELL:{k8(this,t);break}case F.IN_SELECT:{i_(this,t);break}case F.IN_SELECT_IN_TABLE:{O8(this,t);break}case F.IN_TEMPLATE:{M8(this,t);break}case F.AFTER_BODY:{o_(this,t);break}case F.IN_FRAMESET:{j8(this,t);break}case F.AFTER_FRAMESET:{P8(this,t);break}case F.AFTER_AFTER_BODY:{cc(this,t);break}}}onEof(t){switch(this.insertionMode){case F.INITIAL:{Zl(this,t);break}case F.BEFORE_HTML:{ro(this,t);break}case F.BEFORE_HEAD:{so(this,t);break}case F.IN_HEAD:{io(this,t);break}case F.IN_HEAD_NO_SCRIPT:{lo(this,t);break}case F.AFTER_HEAD:{oo(this,t);break}case F.IN_BODY:case F.IN_TABLE:case F.IN_CAPTION:case F.IN_COLUMN_GROUP:case F.IN_TABLE_BODY:case F.IN_ROW:case F.IN_CELL:case F.IN_SELECT:case F.IN_SELECT_IN_TABLE:{e_(this,t);break}case F.TEXT:{g8(this,t);break}case F.IN_TABLE_TEXT:{Wl(this,t);break}case F.IN_TEMPLATE:{l_(this,t);break}case F.AFTER_BODY:case F.IN_FRAMESET:case F.AFTER_FRAMESET:case F.AFTER_AFTER_BODY:case F.AFTER_AFTER_FRAMESET:{Wh(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===I.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case F.IN_HEAD:case F.IN_HEAD_NO_SCRIPT:case F.AFTER_HEAD:case F.TEXT:case F.IN_COLUMN_GROUP:case F.IN_SELECT:case F.IN_SELECT_IN_TABLE:case F.IN_FRAMESET:case F.AFTER_FRAMESET:{this._insertCharacters(t);break}case F.IN_BODY:case F.IN_CAPTION:case F.IN_CELL:case F.IN_TEMPLATE:case F.AFTER_BODY:case F.AFTER_AFTER_BODY:case F.AFTER_AFTER_FRAMESET:{QT(this,t);break}case F.IN_TABLE:case F.IN_TABLE_BODY:case F.IN_ROW:{jm(this,t);break}case F.IN_TABLE_TEXT:{t_(this,t);break}}}}function mL(e,t){let a=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return a?e.openElements.contains(a.element)?e.openElements.hasInScope(t.tagID)||(a=null):(e.activeFormattingElements.removeEntry(a),a=null):JT(e,t),a}function hL(e,t){let a=null,s=e.openElements.stackTop;for(;s>=0;s--){const l=e.openElements.items[s];if(l===t.element)break;e._isSpecialElement(l,e.openElements.tagIDs[s])&&(a=l)}return a||(e.openElements.shortenToLength(Math.max(s,0)),e.activeFormattingElements.removeEntry(t)),a}function pL(e,t,a){let s=t,l=e.openElements.getCommonAncestor(t);for(let o=0,d=l;d!==a;o++,d=l){l=e.openElements.getCommonAncestor(d);const f=e.activeFormattingElements.getElementEntry(d),m=f&&o>=dL;!f||m?(m&&e.activeFormattingElements.removeEntry(f),e.openElements.remove(d)):(d=gL(e,f),s===t&&(e.activeFormattingElements.bookmark=f),e.treeAdapter.detachNode(s),e.treeAdapter.appendChild(d,s),s=d)}return s}function gL(e,t){const a=e.treeAdapter.getNamespaceURI(t.element),s=e.treeAdapter.createElement(t.token.tagName,a,t.token.attrs);return e.openElements.replace(t.element,s),t.element=s,s}function bL(e,t,a){const s=e.treeAdapter.getTagName(t),l=Vi(s);if(e._isElementCausesFosterParenting(l))e._fosterParentElement(a);else{const o=e.treeAdapter.getNamespaceURI(t);l===E.TEMPLATE&&o===be.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,a)}}function xL(e,t,a){const s=e.treeAdapter.getNamespaceURI(a.element),{token:l}=a,o=e.treeAdapter.createElement(l.tagName,s,l.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,l),e.activeFormattingElements.removeEntry(a),e.openElements.remove(a.element),e.openElements.insertAfter(t,o,l.tagID)}function Zh(e,t){for(let a=0;a<cL;a++){const s=mL(e,t);if(!s)break;const l=hL(e,s);if(!l)break;e.activeFormattingElements.bookmark=s;const o=pL(e,l,s.element),d=e.openElements.getCommonAncestor(s.element);e.treeAdapter.detachNode(o),d&&bL(e,d,o),xL(e,l,s)}}function oh(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function EL(e,t){e._appendCommentNode(t,e.openElements.items[0])}function yL(e,t){e._appendCommentNode(t,e.document)}function Wh(e,t){if(e.stopped=!0,t.location){const a=e.fragmentContext?0:2;for(let s=e.openElements.stackTop;s>=a;s--)e._setEndLocation(e.openElements.items[s],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const s=e.openElements.items[0],l=e.treeAdapter.getNodeSourceCodeLocation(s);if(l&&!l.endTag&&(e._setEndLocation(s,t),e.openElements.stackTop>=1)){const o=e.openElements.items[1],d=e.treeAdapter.getNodeSourceCodeLocation(o);d&&!d.endTag&&e._setEndLocation(o,t)}}}}function TL(e,t){e._setDocumentType(t);const a=t.forceQuirks?Na.QUIRKS:ZD(t);XD(t)||e._err(t,oe.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,a),e.insertionMode=F.BEFORE_HTML}function Zl(e,t){e._err(t,oe.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Na.QUIRKS),e.insertionMode=F.BEFORE_HTML,e._processToken(t)}function _L(e,t){t.tagID===E.HTML?(e._insertElement(t,be.HTML),e.insertionMode=F.BEFORE_HEAD):ro(e,t)}function NL(e,t){const a=t.tagID;(a===E.HTML||a===E.HEAD||a===E.BODY||a===E.BR)&&ro(e,t)}function ro(e,t){e._insertFakeRootElement(),e.insertionMode=F.BEFORE_HEAD,e._processToken(t)}function SL(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.HEAD:{e._insertElement(t,be.HTML),e.headElement=e.openElements.current,e.insertionMode=F.IN_HEAD;break}default:so(e,t)}}function vL(e,t){const a=t.tagID;a===E.HEAD||a===E.BODY||a===E.HTML||a===E.BR?so(e,t):e._err(t,oe.endTagWithoutMatchingOpenElement)}function so(e,t){e._insertFakeElement(J.HEAD,E.HEAD),e.headElement=e.openElements.current,e.insertionMode=F.IN_HEAD,e._processToken(t)}function La(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case E.TITLE:{e._switchToTextParsing(t,Xt.RCDATA);break}case E.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,Xt.RAWTEXT):(e._insertElement(t,be.HTML),e.insertionMode=F.IN_HEAD_NO_SCRIPT);break}case E.NOFRAMES:case E.STYLE:{e._switchToTextParsing(t,Xt.RAWTEXT);break}case E.SCRIPT:{e._switchToTextParsing(t,Xt.SCRIPT_DATA);break}case E.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=F.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(F.IN_TEMPLATE);break}case E.HEAD:{e._err(t,oe.misplacedStartTagForHeadElement);break}default:io(e,t)}}function AL(e,t){switch(t.tagID){case E.HEAD:{e.openElements.pop(),e.insertionMode=F.AFTER_HEAD;break}case E.BODY:case E.BR:case E.HTML:{io(e,t);break}case E.TEMPLATE:{Gs(e,t);break}default:e._err(t,oe.endTagWithoutMatchingOpenElement)}}function Gs(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==E.TEMPLATE&&e._err(t,oe.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,oe.endTagWithoutMatchingOpenElement)}function io(e,t){e.openElements.pop(),e.insertionMode=F.AFTER_HEAD,e._processToken(t)}function CL(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.BASEFONT:case E.BGSOUND:case E.HEAD:case E.LINK:case E.META:case E.NOFRAMES:case E.STYLE:{La(e,t);break}case E.NOSCRIPT:{e._err(t,oe.nestedNoscriptInHead);break}default:lo(e,t)}}function wL(e,t){switch(t.tagID){case E.NOSCRIPT:{e.openElements.pop(),e.insertionMode=F.IN_HEAD;break}case E.BR:{lo(e,t);break}default:e._err(t,oe.endTagWithoutMatchingOpenElement)}}function lo(e,t){const a=t.type===tt.EOF?oe.openElementsLeftAfterEof:oe.disallowedContentInNoscriptInHead;e._err(t,a),e.openElements.pop(),e.insertionMode=F.IN_HEAD,e._processToken(t)}function kL(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.BODY:{e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=F.IN_BODY;break}case E.FRAMESET:{e._insertElement(t,be.HTML),e.insertionMode=F.IN_FRAMESET;break}case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{e._err(t,oe.abandonedHeadElementChild),e.openElements.push(e.headElement,E.HEAD),La(e,t),e.openElements.remove(e.headElement);break}case E.HEAD:{e._err(t,oe.misplacedStartTagForHeadElement);break}default:oo(e,t)}}function RL(e,t){switch(t.tagID){case E.BODY:case E.HTML:case E.BR:{oo(e,t);break}case E.TEMPLATE:{Gs(e,t);break}default:e._err(t,oe.endTagWithoutMatchingOpenElement)}}function oo(e,t){e._insertFakeElement(J.BODY,E.BODY),e.insertionMode=F.IN_BODY,Kc(e,t)}function Kc(e,t){switch(t.type){case tt.CHARACTER:{XT(e,t);break}case tt.WHITESPACE_CHARACTER:{QT(e,t);break}case tt.COMMENT:{oh(e,t);break}case tt.START_TAG:{An(e,t);break}case tt.END_TAG:{Vc(e,t);break}case tt.EOF:{e_(e,t);break}}}function QT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function XT(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function OL(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function IL(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(a,t.attrs))}function ML(e,t){const a=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&a&&(e.treeAdapter.detachNode(a),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_FRAMESET)}function DL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML)}function LL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&lh.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,be.HTML)}function jL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function BL(e,t){const a=e.openElements.tmplCount>0;(!e.formElement||a)&&(e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML),a||(e.formElement=e.openElements.current))}function PL(e,t){e.framesetOk=!1;const a=t.tagID;for(let s=e.openElements.stackTop;s>=0;s--){const l=e.openElements.tagIDs[s];if(a===E.LI&&l===E.LI||(a===E.DD||a===E.DT)&&(l===E.DD||l===E.DT)){e.openElements.generateImpliedEndTagsWithExclusion(l),e.openElements.popUntilTagNamePopped(l);break}if(l!==E.ADDRESS&&l!==E.DIV&&l!==E.P&&e._isSpecialElement(e.openElements.items[s],l))break}e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML)}function UL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.tokenizer.state=Xt.PLAINTEXT}function HL(e,t){e.openElements.hasInScope(E.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.framesetOk=!1}function FL(e,t){const a=e.activeFormattingElements.getElementEntryInScopeWithTagName(J.A);a&&(Zh(e,t),e.openElements.remove(a.element),e.activeFormattingElements.removeEntry(a)),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function zL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function qL(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(E.NOBR)&&(Zh(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,be.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function YL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function $L(e,t){e.treeAdapter.getDocumentMode(e.document)!==Na.QUIRKS&&e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=F.IN_TABLE}function ZT(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,be.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function WT(e){const t=HT(e,Us.TYPE);return t!=null&&t.toLowerCase()===uL}function GL(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,be.HTML),WT(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function KL(e,t){e._appendElement(t,be.HTML),t.ackSelfClosing=!0}function VL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._appendElement(t,be.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function QL(e,t){t.tagName=J.IMG,t.tagID=E.IMG,ZT(e,t)}function XL(e,t){e._insertElement(t,be.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Xt.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=F.TEXT}function ZL(e,t){e.openElements.hasInButtonScope(E.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Xt.RAWTEXT)}function WL(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Xt.RAWTEXT)}function q1(e,t){e._switchToTextParsing(t,Xt.RAWTEXT)}function JL(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===F.IN_TABLE||e.insertionMode===F.IN_CAPTION||e.insertionMode===F.IN_TABLE_BODY||e.insertionMode===F.IN_ROW||e.insertionMode===F.IN_CELL?F.IN_SELECT_IN_TABLE:F.IN_SELECT}function e8(e,t){e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML)}function t8(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,be.HTML)}function n8(e,t){e.openElements.hasInScope(E.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(E.RTC),e._insertElement(t,be.HTML)}function a8(e,t){e._reconstructActiveFormattingElements(),GT(t),Xh(t),t.selfClosing?e._appendElement(t,be.MATHML):e._insertElement(t,be.MATHML),t.ackSelfClosing=!0}function r8(e,t){e._reconstructActiveFormattingElements(),KT(t),Xh(t),t.selfClosing?e._appendElement(t,be.SVG):e._insertElement(t,be.SVG),t.ackSelfClosing=!0}function Y1(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,be.HTML)}function An(e,t){switch(t.tagID){case E.I:case E.S:case E.B:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.SMALL:case E.STRIKE:case E.STRONG:{zL(e,t);break}case E.A:{FL(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{LL(e,t);break}case E.P:case E.DL:case E.OL:case E.UL:case E.DIV:case E.DIR:case E.NAV:case E.MAIN:case E.MENU:case E.ASIDE:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.DETAILS:case E.ADDRESS:case E.ARTICLE:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{DL(e,t);break}case E.LI:case E.DD:case E.DT:{PL(e,t);break}case E.BR:case E.IMG:case E.WBR:case E.AREA:case E.EMBED:case E.KEYGEN:{ZT(e,t);break}case E.HR:{VL(e,t);break}case E.RB:case E.RTC:{t8(e,t);break}case E.RT:case E.RP:{n8(e,t);break}case E.PRE:case E.LISTING:{jL(e,t);break}case E.XMP:{ZL(e,t);break}case E.SVG:{r8(e,t);break}case E.HTML:{OL(e,t);break}case E.BASE:case E.LINK:case E.META:case E.STYLE:case E.TITLE:case E.SCRIPT:case E.BGSOUND:case E.BASEFONT:case E.TEMPLATE:{La(e,t);break}case E.BODY:{IL(e,t);break}case E.FORM:{BL(e,t);break}case E.NOBR:{qL(e,t);break}case E.MATH:{a8(e,t);break}case E.TABLE:{$L(e,t);break}case E.INPUT:{GL(e,t);break}case E.PARAM:case E.TRACK:case E.SOURCE:{KL(e,t);break}case E.IMAGE:{QL(e,t);break}case E.BUTTON:{HL(e,t);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{YL(e,t);break}case E.IFRAME:{WL(e,t);break}case E.SELECT:{JL(e,t);break}case E.OPTION:case E.OPTGROUP:{e8(e,t);break}case E.NOEMBED:case E.NOFRAMES:{q1(e,t);break}case E.FRAMESET:{ML(e,t);break}case E.TEXTAREA:{XL(e,t);break}case E.NOSCRIPT:{e.options.scriptingEnabled?q1(e,t):Y1(e,t);break}case E.PLAINTEXT:{UL(e,t);break}case E.COL:case E.TH:case E.TD:case E.TR:case E.HEAD:case E.FRAME:case E.TBODY:case E.TFOOT:case E.THEAD:case E.CAPTION:case E.COLGROUP:break;default:Y1(e,t)}}function s8(e,t){if(e.openElements.hasInScope(E.BODY)&&(e.insertionMode=F.AFTER_BODY,e.options.sourceCodeLocationInfo)){const a=e.openElements.tryPeekProperlyNestedBodyElement();a&&e._setEndLocation(a,t)}}function i8(e,t){e.openElements.hasInScope(E.BODY)&&(e.insertionMode=F.AFTER_BODY,o_(e,t))}function l8(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a))}function o8(e){const t=e.openElements.tmplCount>0,{formElement:a}=e;t||(e.formElement=null),(a||t)&&e.openElements.hasInScope(E.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(E.FORM):a&&e.openElements.remove(a))}function u8(e){e.openElements.hasInButtonScope(E.P)||e._insertFakeElement(J.P,E.P),e._closePElement()}function c8(e){e.openElements.hasInListItemScope(E.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(E.LI),e.openElements.popUntilTagNamePopped(E.LI))}function d8(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a))}function f8(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function m8(e,t){const a=t.tagID;e.openElements.hasInScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a),e.activeFormattingElements.clearToLastMarker())}function h8(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(J.BR,E.BR),e.openElements.pop(),e.framesetOk=!1}function JT(e,t){const a=t.tagName,s=t.tagID;for(let l=e.openElements.stackTop;l>0;l--){const o=e.openElements.items[l],d=e.openElements.tagIDs[l];if(s===d&&(s!==E.UNKNOWN||e.treeAdapter.getTagName(o)===a)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.stackTop>=l&&e.openElements.shortenToLength(l);break}if(e._isSpecialElement(o,d))break}}function Vc(e,t){switch(t.tagID){case E.A:case E.B:case E.I:case E.S:case E.U:case E.EM:case E.TT:case E.BIG:case E.CODE:case E.FONT:case E.NOBR:case E.SMALL:case E.STRIKE:case E.STRONG:{Zh(e,t);break}case E.P:{u8(e);break}case E.DL:case E.UL:case E.OL:case E.DIR:case E.DIV:case E.NAV:case E.PRE:case E.MAIN:case E.MENU:case E.ASIDE:case E.BUTTON:case E.CENTER:case E.FIGURE:case E.FOOTER:case E.HEADER:case E.HGROUP:case E.DIALOG:case E.ADDRESS:case E.ARTICLE:case E.DETAILS:case E.SEARCH:case E.SECTION:case E.SUMMARY:case E.LISTING:case E.FIELDSET:case E.BLOCKQUOTE:case E.FIGCAPTION:{l8(e,t);break}case E.LI:{c8(e);break}case E.DD:case E.DT:{d8(e,t);break}case E.H1:case E.H2:case E.H3:case E.H4:case E.H5:case E.H6:{f8(e);break}case E.BR:{h8(e);break}case E.BODY:{s8(e,t);break}case E.HTML:{i8(e,t);break}case E.FORM:{o8(e);break}case E.APPLET:case E.OBJECT:case E.MARQUEE:{m8(e,t);break}case E.TEMPLATE:{Gs(e,t);break}default:JT(e,t)}}function e_(e,t){e.tmplInsertionModeStack.length>0?l_(e,t):Wh(e,t)}function p8(e,t){var a;t.tagID===E.SCRIPT&&((a=e.scriptHandler)===null||a===void 0||a.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function g8(e,t){e._err(t,oe.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function jm(e,t){if(e.openElements.currentTagId!==void 0&&VT.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=F.IN_TABLE_TEXT,t.type){case tt.CHARACTER:{n_(e,t);break}case tt.WHITESPACE_CHARACTER:{t_(e,t);break}}else ko(e,t)}function b8(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_CAPTION}function x8(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_COLUMN_GROUP}function E8(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.COLGROUP,E.COLGROUP),e.insertionMode=F.IN_COLUMN_GROUP,Jh(e,t)}function y8(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_TABLE_BODY}function T8(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.TBODY,E.TBODY),e.insertionMode=F.IN_TABLE_BODY,Qc(e,t)}function _8(e,t){e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function N8(e,t){WT(t)?e._appendElement(t,be.HTML):ko(e,t),t.ackSelfClosing=!0}function S8(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,be.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Hi(e,t){switch(t.tagID){case E.TD:case E.TH:case E.TR:{T8(e,t);break}case E.STYLE:case E.SCRIPT:case E.TEMPLATE:{La(e,t);break}case E.COL:{E8(e,t);break}case E.FORM:{S8(e,t);break}case E.TABLE:{_8(e,t);break}case E.TBODY:case E.TFOOT:case E.THEAD:{y8(e,t);break}case E.INPUT:{N8(e,t);break}case E.CAPTION:{b8(e,t);break}case E.COLGROUP:{x8(e,t);break}default:ko(e,t)}}function Eo(e,t){switch(t.tagID){case E.TABLE:{e.openElements.hasInTableScope(E.TABLE)&&(e.openElements.popUntilTagNamePopped(E.TABLE),e._resetInsertionMode());break}case E.TEMPLATE:{Gs(e,t);break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:ko(e,t)}}function ko(e,t){const a=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Kc(e,t),e.fosterParentingEnabled=a}function t_(e,t){e.pendingCharacterTokens.push(t)}function n_(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Wl(e,t){let a=0;if(e.hasNonWhitespacePendingCharacterToken)for(;a<e.pendingCharacterTokens.length;a++)ko(e,e.pendingCharacterTokens[a]);else for(;a<e.pendingCharacterTokens.length;a++)e._insertCharacters(e.pendingCharacterTokens[a]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const a_=new Set([E.CAPTION,E.COL,E.COLGROUP,E.TBODY,E.TD,E.TFOOT,E.TH,E.THEAD,E.TR]);function v8(e,t){const a=t.tagID;a_.has(a)?e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=F.IN_TABLE,Hi(e,t)):An(e,t)}function A8(e,t){const a=t.tagID;switch(a){case E.CAPTION:case E.TABLE:{e.openElements.hasInTableScope(E.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(E.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=F.IN_TABLE,a===E.TABLE&&Eo(e,t));break}case E.BODY:case E.COL:case E.COLGROUP:case E.HTML:case E.TBODY:case E.TD:case E.TFOOT:case E.TH:case E.THEAD:case E.TR:break;default:Vc(e,t)}}function Jh(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.COL:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case E.TEMPLATE:{La(e,t);break}default:wc(e,t)}}function C8(e,t){switch(t.tagID){case E.COLGROUP:{e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=F.IN_TABLE);break}case E.TEMPLATE:{Gs(e,t);break}case E.COL:break;default:wc(e,t)}}function wc(e,t){e.openElements.currentTagId===E.COLGROUP&&(e.openElements.pop(),e.insertionMode=F.IN_TABLE,e._processToken(t))}function Qc(e,t){switch(t.tagID){case E.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_ROW;break}case E.TH:case E.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(J.TR,E.TR),e.insertionMode=F.IN_ROW,Xc(e,t);break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE,Hi(e,t));break}default:Hi(e,t)}}function uh(e,t){const a=t.tagID;switch(t.tagID){case E.TBODY:case E.TFOOT:case E.THEAD:{e.openElements.hasInTableScope(a)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE);break}case E.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE,Eo(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:case E.TR:break;default:Eo(e,t)}}function Xc(e,t){switch(t.tagID){case E.TH:case E.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,be.HTML),e.insertionMode=F.IN_CELL,e.activeFormattingElements.insertMarker();break}case E.CAPTION:case E.COL:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE_BODY,Qc(e,t));break}default:Hi(e,t)}}function r_(e,t){switch(t.tagID){case E.TR:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE_BODY);break}case E.TABLE:{e.openElements.hasInTableScope(E.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE_BODY,uh(e,t));break}case E.TBODY:case E.TFOOT:case E.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(E.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=F.IN_TABLE_BODY,uh(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:case E.TD:case E.TH:break;default:Eo(e,t)}}function w8(e,t){const a=t.tagID;a_.has(a)?(e.openElements.hasInTableScope(E.TD)||e.openElements.hasInTableScope(E.TH))&&(e._closeTableCell(),Xc(e,t)):An(e,t)}function k8(e,t){const a=t.tagID;switch(a){case E.TD:case E.TH:{e.openElements.hasInTableScope(a)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(a),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=F.IN_ROW);break}case E.TABLE:case E.TBODY:case E.TFOOT:case E.THEAD:case E.TR:{e.openElements.hasInTableScope(a)&&(e._closeTableCell(),r_(e,t));break}case E.BODY:case E.CAPTION:case E.COL:case E.COLGROUP:case E.HTML:break;default:Vc(e,t)}}function s_(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e._insertElement(t,be.HTML);break}case E.OPTGROUP:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._insertElement(t,be.HTML);break}case E.HR:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop(),e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case E.INPUT:case E.KEYGEN:case E.TEXTAREA:case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),t.tagID!==E.SELECT&&e._processStartTag(t));break}case E.SCRIPT:case E.TEMPLATE:{La(e,t);break}}}function i_(e,t){switch(t.tagID){case E.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===E.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===E.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===E.OPTGROUP&&e.openElements.pop();break}case E.OPTION:{e.openElements.currentTagId===E.OPTION&&e.openElements.pop();break}case E.SELECT:{e.openElements.hasInSelectScope(E.SELECT)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode());break}case E.TEMPLATE:{Gs(e,t);break}}}function R8(e,t){const a=t.tagID;a===E.CAPTION||a===E.TABLE||a===E.TBODY||a===E.TFOOT||a===E.THEAD||a===E.TR||a===E.TD||a===E.TH?(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e._processStartTag(t)):s_(e,t)}function O8(e,t){const a=t.tagID;a===E.CAPTION||a===E.TABLE||a===E.TBODY||a===E.TFOOT||a===E.THEAD||a===E.TR||a===E.TD||a===E.TH?e.openElements.hasInTableScope(a)&&(e.openElements.popUntilTagNamePopped(E.SELECT),e._resetInsertionMode(),e.onEndTag(t)):i_(e,t)}function I8(e,t){switch(t.tagID){case E.BASE:case E.BASEFONT:case E.BGSOUND:case E.LINK:case E.META:case E.NOFRAMES:case E.SCRIPT:case E.STYLE:case E.TEMPLATE:case E.TITLE:{La(e,t);break}case E.CAPTION:case E.COLGROUP:case E.TBODY:case E.TFOOT:case E.THEAD:{e.tmplInsertionModeStack[0]=F.IN_TABLE,e.insertionMode=F.IN_TABLE,Hi(e,t);break}case E.COL:{e.tmplInsertionModeStack[0]=F.IN_COLUMN_GROUP,e.insertionMode=F.IN_COLUMN_GROUP,Jh(e,t);break}case E.TR:{e.tmplInsertionModeStack[0]=F.IN_TABLE_BODY,e.insertionMode=F.IN_TABLE_BODY,Qc(e,t);break}case E.TD:case E.TH:{e.tmplInsertionModeStack[0]=F.IN_ROW,e.insertionMode=F.IN_ROW,Xc(e,t);break}default:e.tmplInsertionModeStack[0]=F.IN_BODY,e.insertionMode=F.IN_BODY,An(e,t)}}function M8(e,t){t.tagID===E.TEMPLATE&&Gs(e,t)}function l_(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(E.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Wh(e,t)}function D8(e,t){t.tagID===E.HTML?An(e,t):kc(e,t)}function o_(e,t){var a;if(t.tagID===E.HTML){if(e.fragmentContext||(e.insertionMode=F.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===E.HTML){e._setEndLocation(e.openElements.items[0],t);const s=e.openElements.items[1];s&&!(!((a=e.treeAdapter.getNodeSourceCodeLocation(s))===null||a===void 0)&&a.endTag)&&e._setEndLocation(s,t)}}else kc(e,t)}function kc(e,t){e.insertionMode=F.IN_BODY,Kc(e,t)}function L8(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.FRAMESET:{e._insertElement(t,be.HTML);break}case E.FRAME:{e._appendElement(t,be.HTML),t.ackSelfClosing=!0;break}case E.NOFRAMES:{La(e,t);break}}}function j8(e,t){t.tagID===E.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==E.FRAMESET&&(e.insertionMode=F.AFTER_FRAMESET))}function B8(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.NOFRAMES:{La(e,t);break}}}function P8(e,t){t.tagID===E.HTML&&(e.insertionMode=F.AFTER_AFTER_FRAMESET)}function U8(e,t){t.tagID===E.HTML?An(e,t):cc(e,t)}function cc(e,t){e.insertionMode=F.IN_BODY,Kc(e,t)}function H8(e,t){switch(t.tagID){case E.HTML:{An(e,t);break}case E.NOFRAMES:{La(e,t);break}}}function F8(e,t){t.chars=Pt,e._insertCharacters(t)}function z8(e,t){e._insertCharacters(t),e.framesetOk=!1}function u_(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==be.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function q8(e,t){if(rL(t))u_(e),e._startTagOutsideForeignContent(t);else{const a=e._getAdjustedCurrentElement(),s=e.treeAdapter.getNamespaceURI(a);s===be.MATHML?GT(t):s===be.SVG&&(sL(t),KT(t)),Xh(t),t.selfClosing?e._appendElement(t,s):e._insertElement(t,s),t.ackSelfClosing=!0}}function Y8(e,t){if(t.tagID===E.P||t.tagID===E.BR){u_(e),e._endTagOutsideForeignContent(t);return}for(let a=e.openElements.stackTop;a>0;a--){const s=e.openElements.items[a];if(e.treeAdapter.getNamespaceURI(s)===be.HTML){e._endTagOutsideForeignContent(t);break}const l=e.treeAdapter.getTagName(s);if(l.toLowerCase()===t.tagName){t.tagName=l,e.openElements.shortenToLength(a);break}}}J.AREA,J.BASE,J.BASEFONT,J.BGSOUND,J.BR,J.COL,J.EMBED,J.FRAME,J.HR,J.IMG,J.INPUT,J.KEYGEN,J.LINK,J.META,J.PARAM,J.SOURCE,J.TRACK,J.WBR;const $8=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,G8=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),$1={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function c_(e,t){const a=n9(e),s=qy("type",{handlers:{root:K8,element:V8,text:Q8,comment:f_,doctype:X8,raw:W8},unknown:J8}),l={parser:a?new z1($1):z1.getFragmentParser(void 0,$1),handle(f){s(f,l)},stitches:!1,options:t||{}};s(e,l),Qi(l,Xa());const o=a?l.parser.document:l.parser.getFragment(),d=aD(o,{file:l.options.file});return l.stitches&&Co(d,"comment",function(f,m,h){const x=f;if(x.value.stitch&&h&&m!==void 0){const b=h.children;return b[m]=x.value.stitch,m}}),d.type==="root"&&d.children.length===1&&d.children[0].type===e.type?d.children[0]:d}function d_(e,t){let a=-1;if(e)for(;++a<e.length;)t.handle(e[a])}function K8(e,t){d_(e.children,t)}function V8(e,t){e9(e,t),d_(e.children,t),t9(e,t)}function Q8(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const a={type:tt.CHARACTER,chars:e.value,location:Ro(e)};Qi(t,Xa(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function X8(e,t){const a={type:tt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Ro(e)};Qi(t,Xa(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function Z8(e,t){t.stitches=!0;const a=a9(e);if("children"in e&&"children"in a){const s=c_({type:"root",children:e.children},t.options);a.children=s.children}f_({type:"comment",value:{stitch:a}},t)}function f_(e,t){const a=e.value,s={type:tt.COMMENT,data:a,location:Ro(e)};Qi(t,Xa(e)),t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken)}function W8(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,m_(t,Xa(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace($8,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const a=t.parser.tokenizer._consume();t.parser.tokenizer._callState(a)}}function J8(e,t){const a=e;if(t.options.passThrough&&t.options.passThrough.includes(a.type))Z8(a,t);else{let s="";throw G8.has(a.type)&&(s=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+a.type+"` node"+s)}}function Qi(e,t){m_(e,t);const a=e.parser.tokenizer.currentCharacterToken;a&&a.location&&(a.location.endLine=e.parser.tokenizer.preprocessor.line,a.location.endCol=e.parser.tokenizer.preprocessor.col+1,a.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=Xt.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function m_(e,t){if(t&&t.offset!==void 0){const a={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=a}}function e9(e,t){const a=e.tagName.toLowerCase();if(t.parser.tokenizer.state===Xt.PLAINTEXT)return;Qi(t,Xa(e));const s=t.parser.openElements.current;let l="namespaceURI"in s?s.namespaceURI:Bs.html;l===Bs.html&&a==="svg"&&(l=Bs.svg);const o=oD({...e,children:[]},{space:l===Bs.svg?"svg":"html"}),d={type:tt.START_TAG,tagName:a,tagID:Vi(a),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:Ro(e)};t.parser.currentToken=d,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=a}function t9(e,t){const a=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&gD.includes(a)||t.parser.tokenizer.state===Xt.PLAINTEXT)return;Qi(t,zc(e));const s={type:tt.END_TAG,tagName:a,tagID:Vi(a),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Ro(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),a===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===Xt.RCDATA||t.parser.tokenizer.state===Xt.RAWTEXT||t.parser.tokenizer.state===Xt.SCRIPT_DATA)&&(t.parser.tokenizer.state=Xt.DATA)}function n9(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Ro(e){const t=Xa(e)||{line:void 0,column:void 0,offset:void 0},a=zc(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:a.line,endCol:a.column,endOffset:a.offset}}function a9(e){return"children"in e?Ui({...e,children:[]}):Ui(e)}function uo(e){return function(t,a){return c_(t,{...e,file:a})}}const G1=[{key:"open",label:"开放"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function r9(e){const t=e<1e12?e*1e3:e,a=Date.now()-t;return a<6e4?"刚刚":a<36e5?`${Math.floor(a/6e4)}分钟前`:a<864e5?`${Math.floor(a/36e5)}小时前`:a<2592e6?`${Math.floor(a/864e5)}天前`:new Date(t).toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}function K1({onDone:e}){const[t,a]=v.useState(""),[s,l]=v.useState(""),[o,d]=v.useState(!1),f=Ue(x=>x.createIssue),m=async()=>{!t.trim()||o||(d(!0),await f(t.trim(),s.trim()||void 0),d(!1),e())},h=x=>{(x.metaKey||x.ctrlKey)&&x.key==="Enter"&&(x.preventDefault(),m())};return u.jsxs("div",{className:"border-b border-line px-3 py-3",children:[u.jsx("input",{type:"text",value:t,onChange:x=>a(x.target.value),onKeyDown:h,placeholder:"Issue 标题",autoFocus:!0,className:"w-full rounded-md border border-line bg-base px-2.5 py-1.5 text-xs text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none"}),u.jsx("textarea",{value:s,onChange:x=>l(x.target.value),onKeyDown:h,placeholder:"描述(可选) ⌘⏎ 创建",rows:3,className:"mt-2 w-full resize-none rounded-md border border-line bg-base px-2.5 py-1.5 text-xs text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none"}),u.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:e,className:"rounded-md px-2.5 py-1 text-xs text-fg-4 transition-colors hover:text-fg-2",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void m(),disabled:!t.trim()||o,className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:"创建"})]})]})}function s9({repoId:e,issueNumber:t,onPublished:a}){const s=va(),l=qe(Da),[o,d]=v.useState(""),[f,m]=v.useState("idle"),[h,x]=v.useState(""),[b,y]=v.useState(null),[T,N]=v.useState(!1),S=v.useRef(null),C=v.useCallback(()=>{S.current&&(clearInterval(S.current),S.current=null)},[]);v.useEffect(()=>()=>C(),[C]),v.useEffect(()=>{let M=!1;return ux(e,t).then(L=>{!M&&L.body&&(x(L.body),m("preview"))}).catch(()=>{}),()=>{M=!0}},[e,t]);const A=async()=>{if(!(!o.trim()||T)){N(!0);try{const M=await ox(e,t,o.trim());a(M),d(""),Yt.getState().addToast("评论已发布","success")}catch(M){Yt.getState().addToast(M instanceof Error?M.message:"发布失败","error")}finally{N(!1)}}},D=async()=>{if(!(!o.trim()||f==="polishing")){m("polishing");try{const{sessionId:M}=await $3(e,t,o.trim());y(M),S.current=setInterval(async()=>{try{if((await YE(e,M)).type==="idle"){C();const K=await ux(e,t);x(K.body),m("preview")}}catch{C(),m("idle"),Yt.getState().addToast("润色状态检查失败","error")}},2e3)}catch(M){m("idle"),Yt.getState().addToast(M instanceof Error?M.message:"润色启动失败","error")}}},k=async()=>{if(!(!h.trim()||T)){N(!0);try{const M=await ox(e,t,h.trim());a(M),d(""),x(""),y(null),m("idle"),Yt.getState().addToast("评论已发布","success")}catch(M){Yt.getState().addToast(M instanceof Error?M.message:"发布失败","error")}finally{N(!1)}}},z=()=>{C(),x(""),y(null),m("idle")},V=()=>{!b||!l||(Le.setState({activeSessionId:b}),s(`/${encodeURIComponent(l)}/run`))};return f==="preview"?u.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[u.jsxs("h3",{className:"mb-3 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[u.jsx(um,{className:"h-3.5 w-3.5 text-amber-400"}),"AI 润色结果"]}),u.jsx("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-4 py-3",children:u.jsx("textarea",{value:h,onChange:M=>x(M.target.value),rows:6,className:"w-full resize-none bg-transparent text-sm text-fg placeholder:text-fg-6 focus:outline-none"})}),u.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[u.jsxs("button",{type:"button",disabled:T,onClick:()=>void k(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(gc,{className:"h-3.5 w-3.5"}),"发布评论"]}),u.jsxs("button",{type:"button",onClick:()=>void D(),className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(um,{className:"h-3.5 w-3.5"}),"重新润色"]}),u.jsx("button",{type:"button",onClick:V,className:"flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:"转入深度对话"}),u.jsx("button",{type:"button",onClick:z,className:"ml-auto rounded-md px-2.5 py-1.5 text-xs text-fg-5 transition-colors hover:text-fg-3",children:"放弃"})]})]}):u.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[u.jsx("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-fg-4",children:"添加评论"}),u.jsx("textarea",{value:o,onChange:M=>d(M.target.value),placeholder:"写下你的评论...",rows:4,disabled:f==="polishing",className:"w-full resize-none rounded-lg border border-line bg-base px-3 py-2.5 text-sm text-fg placeholder:text-fg-6 focus:border-fg-5 focus:outline-none disabled:opacity-50"}),u.jsxs("div",{className:"mt-2.5 flex items-center gap-2",children:[u.jsxs("button",{type:"button",disabled:!o.trim()||T||f==="polishing",onClick:()=>void A(),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(gc,{className:"h-3.5 w-3.5"}),T?"发送中...":"直接发送"]}),u.jsxs("button",{type:"button",disabled:!o.trim()||f==="polishing",onClick:()=>void D(),className:"flex items-center gap-1.5 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-1.5 text-xs font-medium text-amber-400 transition-colors hover:bg-amber-500/20 disabled:opacity-40",children:[u.jsx(um,{className:"h-3.5 w-3.5"}),f==="polishing"?"润色中...":"AI 润色"]})]})]})}function V1({issue:e,sessionCount:t,isActive:a,isEpic:s,milestone:l,onSelect:o}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:o,className:ce("group flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors",a?"border-l-2 border-blue-500 bg-elevated/80":"border-l-2 border-transparent hover:bg-elevated/50"),children:[u.jsx("span",{className:ce("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold",e.state==="open"?"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-1 ring-emerald-500/25":"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-1 ring-purple-500/25"),children:e.number}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[s&&u.jsx("span",{className:"shrink-0 rounded px-1 py-0.5 text-[9px] font-bold tracking-wide bg-amber-400/12 text-amber-400",children:"EPIC"}),u.jsx("span",{className:"min-w-0 text-xs font-medium text-fg-2 group-hover:text-fg",children:e.title})]}),e.labels&&e.labels.length>0&&u.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(d=>u.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${d.color}20`,color:`#${d.color}`},children:d.name},d.id))}),l&&u.jsxs("span",{className:"mt-1 flex items-center gap-1 text-[10px] text-indigo-400/70",children:[u.jsx(Nh,{className:"h-2.5 w-2.5"}),l.title]})]}),t>0&&u.jsx("span",{className:"shrink-0 rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:t})]})})}function i9({issue:e,sessionCount:t,isEpic:a,milestone:s,onSelect:l}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:l,className:"group flex w-full items-center gap-3 border-b border-line px-4 py-3 text-left transition-colors hover:bg-elevated/50",children:[u.jsx("span",{className:ce("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold",e.state==="open"?"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-1 ring-emerald-500/25":"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-1 ring-purple-500/25"),children:e.number}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[a&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wide bg-amber-400/12 text-amber-400",children:"EPIC"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:e.title}),s&&u.jsxs("span",{className:"hidden shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium bg-indigo-500/15 text-indigo-400 sm:flex",children:[u.jsx(Nh,{className:"h-2.5 w-2.5"}),s.title]}),t>0&&u.jsxs("span",{className:"shrink-0 rounded-full bg-elevated px-2 py-0.5 font-mono text-[10px] text-fg-5",children:[t," 次运行"]}),e.assignees&&e.assignees.length>0&&u.jsxs("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:[e.assignees.slice(0,3).map(o=>u.jsx("img",{src:o.avatar_url,alt:o.login,title:o.login,className:"h-5 w-5 rounded-full ring-2 ring-surface"},o.login)),e.assignees.length>3&&u.jsxs("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-elevated text-[9px] font-medium text-fg-4 ring-2 ring-surface",children:["+",e.assignees.length-3]})]})]}),u.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[e.authorLogin&&u.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&u.jsx("img",{src:e.authorAvatar,alt:"",className:"mr-1 inline-block h-3.5 w-3.5 rounded-full align-text-bottom"}),e.authorLogin]}),e.authorLogin&&u.jsx("span",{className:"text-fg-6",children:"·"}),u.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:r9(e.createdAt)}),(e.commentCount??0)>0&&u.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-[11px] text-fg-6",children:[u.jsx("span",{className:"text-fg-6",children:"·"}),u.jsx(EA,{className:"h-3 w-3"}),e.commentCount]}),(e.labels&&e.labels.length>0||(e.commentCount??0)>0||e.authorLogin)&&e.labels&&e.labels.length>0&&u.jsx("span",{className:"text-fg-6",children:"·"}),e.labels&&e.labels.length>0?e.labels.map(o=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-medium",style:{backgroundColor:`#${o.color}20`,color:`#${o.color}`},children:o.name},o.id)):e.authorLogin?null:u.jsx("span",{className:"text-[11px] text-fg-6",children:" "})]})]})]})})}function l9({issue:e,milestone:t,onBack:a,onClose:s,onToggleSidebar:l}){var te;const o=va(),d=qe(ie=>ie.activeRepoId),f=qe(Da),[m,h]=v.useState([]),[x,b]=v.useState(!1),[y,T]=v.useState([]),[N,S]=v.useState(0),[C,A]=v.useState(!1),[D,k]=v.useState(!1),[z,V]=v.useState("issue"),M=Ue(ie=>ie.updateIssueState);v.useEffect(()=>{d&&(b(!0),Y3(d,e.number).then(h).catch(()=>h([])).finally(()=>b(!1)))},[d,e.number]),v.useEffect(()=>{d&&ix(d,e.number).then(T).catch(()=>T([]))},[d,e.number]),v.useEffect(()=>{V("issue"),S(0)},[e.id]);const L=y[N]??y[0],K=async ie=>{if(!(C||!d||!L)){A(!0);try{await P3(d,e.number,L.number,ie),ie&&await M(e.number,"closed");const Z=await ix(d,e.number);T(Z),N>=Z.length&&S(Math.max(0,Z.length-1)),Yt.getState().addToast(`PR #${L.number} 合入成功`,"success")}catch(Z){let ee="合入失败";if(Z instanceof Hs)try{ee=JSON.parse(Z.message).error??ee}catch{ee=Z.message}Yt.getState().addToast(ee,"error")}finally{A(!1)}}},se=()=>{if(!L)return;const ie=`请解决 PR #${L.number} 的合并冲突: ${L.title}`;Ue.getState().setSelectedIssue(e.id),Ue.getState().setPendingDraft(ie),Ue.getState().setPreviewIssue(null),Le.setState({activeSessionId:null}),o(`/${encodeURIComponent(f)}/run`)},B=()=>{Ue.getState().setSelectedIssue(e.id),Ue.getState().setPreviewIssue(null),Le.setState({activeSessionId:null}),o(`/${encodeURIComponent(f)}/run`)},U=ie=>{const Z=new Date(ie);return Z.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})+" "+Z.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})};return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("header",{className:"flex flex-col gap-2 border-b border-line px-4 py-3 md:flex-row md:items-center md:gap-3 md:px-6",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[u.jsx("button",{type:"button",onClick:a,"aria-label":"返回列表",className:"-ml-1 shrink-0 rounded-md p-1.5 text-fg-3 transition-colors hover:bg-elevated hover:text-fg md:hidden",children:u.jsx(RE,{className:"h-5 w-5"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number," ",e.state]}),(te=e.labels)==null?void 0:te.map(ie=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${ie.color}20`,color:`#${ie.color}`},children:ie.name},ie.id)),t&&u.jsxs("span",{className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium bg-indigo-500/15 text-indigo-400",children:[u.jsx(Nh,{className:"h-2.5 w-2.5"}),t.title]})]}),u.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),(e.authorLogin||e.assignees&&e.assignees.length>0)&&u.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-xs text-fg-4",children:[e.authorLogin&&u.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&u.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.assignees&&e.assignees.length>0&&u.jsxs("span",{className:"flex items-center gap-1",children:[u.jsx("span",{className:"text-fg-5",children:"→"}),u.jsx("span",{className:"flex items-center -space-x-1",children:e.assignees.map(ie=>u.jsx("img",{src:ie.avatar_url,alt:ie.login,title:ie.login,className:"h-4 w-4 rounded-full ring-1 ring-surface"},ie.login))}),u.jsx("span",{className:"text-fg-4",children:e.assignees.map(ie=>ie.login).join(", ")})]})]})]})]}),u.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&u.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(hc,{className:"h-3.5 w-3.5"}),"源站"]}),u.jsxs("button",{type:"button",onClick:()=>{Ue.getState().enterMatchMode(e.id),Le.setState({activeSessionId:null}),o(`/${encodeURIComponent(f)}/run`)},className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[u.jsx(_o,{className:"h-3.5 w-3.5"}),"匹配子任务"]}),u.jsx("button",{type:"button",disabled:D,onClick:async()=>{k(!0),await M(e.number,e.state==="open"?"closed":"open"),k(!1)},className:ce("flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-xs font-medium transition-colors disabled:opacity-40",e.state==="open"?"border-red-500/30 text-red-400 hover:border-red-500/60 hover:bg-red-500/10":"border-emerald-500/30 text-emerald-400 hover:border-emerald-500/60 hover:bg-emerald-500/10"),children:e.state==="open"?u.jsxs(u.Fragment,{children:[u.jsx(OE,{className:"h-3.5 w-3.5"}),"关闭"]}):u.jsxs(u.Fragment,{children:[u.jsx(fo,{className:"h-3.5 w-3.5"}),"重新打开"]})}),u.jsxs("button",{type:"button",onClick:B,className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500",children:[u.jsx(Bc,{className:"h-3.5 w-3.5 fill-current"}),"开始处理"]}),l&&u.jsx("button",{type:"button",onClick:l,title:"面板",className:"flex h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2",children:u.jsx(DE,{className:"h-4 w-4"})}),s&&u.jsx("button",{type:"button",onClick:s,title:"关闭详情",className:"hidden h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 md:flex",children:u.jsx(Tt,{className:"h-4 w-4"})})]})]}),y.length>0&&u.jsxs("div",{className:"flex shrink-0 items-center border-b border-line bg-surface",children:[u.jsxs("button",{type:"button",onClick:()=>V("issue"),className:ce("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",z==="issue"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(fo,{className:"h-3.5 w-3.5"}),"Issue"]}),u.jsxs("button",{type:"button",onClick:()=>V("pr"),className:ce("flex items-center gap-1.5 border-b-2 px-4 py-2.5 text-xs font-medium transition-colors",z==="pr"?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsx(mo,{className:"h-3.5 w-3.5"}),"PR",u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",z==="pr"?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:y.length}),y.some(ie=>ie.mergeable===!1)&&u.jsxs("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[u.jsx(Kn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]})]})]}),z==="issue"||y.length===0?u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:u.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[e.body?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:e.body})}):u.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 Issue 没有描述内容"}),x?u.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):m.length>0&&u.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[u.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",m.length,")"]}),u.jsx("div",{className:"space-y-4",children:m.map(ie=>u.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:ie.user.avatar_url,alt:ie.user.login,className:"h-5 w-5 rounded-full"}),u.jsx("span",{className:"text-xs font-semibold text-fg-2",children:ie.user.login}),u.jsx("span",{className:"text-[10px] text-fg-6",children:U(ie.created_at)})]}),u.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:ie.body})})]},ie.id))})]}),d&&u.jsx(s9,{repoId:d,issueNumber:e.number,onPublished:ie=>h(Z=>[...Z,ie])},e.id)]})}):u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-line bg-surface px-4 py-0",children:[y.length>1&&y.map((ie,Z)=>u.jsxs("button",{type:"button",onClick:()=>S(Z),className:ce("flex items-center gap-1.5 border-b-2 px-2.5 py-2.5 text-xs font-medium transition-colors",Z===N?"border-blue-500 text-fg":"border-transparent text-fg-4 hover:text-fg-2"),children:[u.jsxs("span",{className:"font-mono text-[10px]",children:["#",ie.number]}),u.jsx("span",{className:"max-w-[140px] truncate",children:ie.title})]},ie.number)),u.jsxs("div",{className:ce("flex items-center gap-2",y.length>1&&"ml-auto"),children:[(L==null?void 0:L.html_url)&&u.jsxs("a",{href:L.html_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 rounded-md border border-line px-2 py-1.5 font-mono text-[11px] text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(hc,{className:"h-3 w-3"}),u.jsx("span",{className:"hidden sm:inline",children:"查看"})]}),(L==null?void 0:L.mergeable)===!1&&u.jsxs("button",{type:"button",onClick:se,className:"flex items-center gap-1.5 rounded-md border border-amber-500/30 px-2.5 py-1.5 text-xs font-medium text-amber-400 transition-colors hover:border-amber-500/60 hover:bg-amber-500/10",children:[u.jsx(JA,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"hidden sm:inline",children:"解冲突"})]}),u.jsxs("button",{type:"button",disabled:C||(L==null?void 0:L.mergeable)===!1,onClick:()=>void K(!1),className:"flex items-center gap-1.5 rounded-md border border-emerald-500/30 px-2.5 py-1.5 text-xs font-medium text-emerald-400 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 disabled:opacity-40",children:[u.jsx(pc,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"hidden sm:inline",children:"合入"})]}),u.jsxs("button",{type:"button",disabled:C||(L==null?void 0:L.mergeable)===!1,onClick:()=>void K(!0),className:"flex items-center gap-1.5 rounded-md border border-blue-500/30 px-2.5 py-1.5 text-xs font-medium text-blue-400 transition-colors hover:border-blue-500/60 hover:bg-blue-500/10 disabled:opacity-40",children:[u.jsx(pc,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"hidden sm:inline",children:"合入并关闭"})]})]})]}),L&&u.jsx("div",{className:"flex-1 overflow-y-auto",children:u.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[u.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",L.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",L.number," ",L.state]}),L.mergeable===!1&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:"Conflict"}),u.jsx("span",{className:"text-sm font-semibold text-fg",children:L.title})]}),L.body?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:L.body})}):u.jsx("p",{className:"py-6 text-center font-mono text-xs text-fg-5",children:"该 PR 没有描述内容"})]})})]})]})}function h_({issue:e,childrenMap:t,currentId:a,onSelect:s,depth:l}){const o=t.get(e.id)??[],d=e.id===a;return u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>s(e.id),className:ce("group flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs transition-colors",d?"bg-blue-500/10 text-blue-400":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),style:{paddingLeft:`${l*18+8}px`},children:[u.jsx("span",{className:ce("h-1.5 w-1.5 shrink-0 rounded-full",e.state==="open"?"bg-emerald-400":"bg-purple-400")}),u.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-fg-6",children:["#",e.number]}),u.jsx("span",{className:"min-w-0 truncate",children:e.title})]}),o.length>0&&u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute top-0 bottom-3 w-px bg-line",style:{left:`${l*18+16}px`}}),o.map(f=>u.jsx(h_,{issue:f,childrenMap:t,currentId:a,onSelect:s,depth:l+1},f.id))]})]})}function o9(e,t){let a=0,s=0;const l=[...t.get(e)??[]];for(let o=0;o<l.length;o++){const d=l[o];a++,d.state==="closed"&&s++;const f=t.get(d.id);f&&l.push(...f)}return{total:a,closed:s}}function u9(e){var o;const t=typeof((o=e.time)==null?void 0:o.created)=="number"?e.time.created:e.createdAt?Date.parse(e.createdAt):0;if(!t||Number.isNaN(t))return"";const a=t<1e12?t*1e3:t,s=new Date(a);return s.toDateString()===new Date().toDateString()?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Q1({session:e,onSelect:t}){var s,l;const a=u9(e);return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:t,className:"block w-full rounded-md border-l-2 border-transparent px-2.5 py-2 text-left transition-colors hover:bg-elevated/50",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"min-w-0 truncate font-mono text-xs text-fg-3",children:((s=e.agent)==null?void 0:s.trim())||"默认"}),a&&u.jsx("span",{className:"ml-auto shrink-0 font-mono text-[10px] tabular-nums text-fg-5",children:a})]}),u.jsx("div",{className:"mt-0.5 truncate text-sm text-fg-2",children:((l=e.title)==null?void 0:l.trim())||"未命名运行"})]})})}function p_({sessions:e,onSelect:t}){const a=Ue(d=>d.issues),s=new Map(a.map(d=>[d.id,d])),l=new Map,o=[];for(const d of e)if(d.issueId&&s.has(d.issueId)){const f=l.get(d.issueId)??[];f.push(d),l.set(d.issueId,f)}else o.push(d);return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col border-t border-line",children:[u.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[u.jsx(Ev,{className:"h-3.5 w-3.5 text-fg-5"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"运行记录"}),u.jsx("span",{className:"ml-auto rounded-full bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:e.length})]}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:e.length===0?u.jsx("p",{className:"px-2 py-4 text-center font-mono text-[10px] text-fg-6",children:"暂无运行记录"}):u.jsxs("div",{className:"space-y-3",children:[[...l.entries()].map(([d,f])=>{const m=s.get(d);return u.jsxs("div",{children:[u.jsxs("div",{className:"mb-1 flex items-center gap-1.5 px-1",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",m.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",m.number]}),u.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:m.title})]}),u.jsx("ul",{className:"space-y-0.5",children:f.map(h=>u.jsx(Q1,{session:h,onSelect:()=>t(h.id)},h.id))})]},d)}),o.length>0&&u.jsxs("div",{children:[l.size>0&&u.jsx("div",{className:"mb-1 px-1",children:u.jsx("span",{className:"text-xs font-medium text-fg-5",children:"未关联 Issue"})}),u.jsx("ul",{className:"space-y-0.5",children:o.map(d=>u.jsx(Q1,{session:d,onSelect:()=>t(d.id)},d.id))})]})]})})]})}function c9({rootIssue:e,childrenMap:t,currentId:a,onSelect:s,sessions:l,onSessionSelect:o}){const{total:d,closed:f}=o9(e.id,t),m=d===0?0:Math.round(f/d*100);return u.jsxs("div",{className:"flex w-full flex-col",children:[u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-3",children:[u.jsx(kA,{className:"h-3.5 w-3.5 text-fg-5"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:"子任务树"})]}),d>0&&u.jsxs("div",{className:"border-b border-line px-3 py-2",children:[u.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-elevated",children:u.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-emerald-400 to-blue-500 transition-all",style:{width:`${m}%`}})}),u.jsxs("p",{className:"mt-1 font-mono text-[10px] text-fg-6",children:[f," / ",d," completed"]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:u.jsx(h_,{issue:e,childrenMap:t,currentId:a,onSelect:s,depth:0})})]}),u.jsx(p_,{sessions:l,onSelect:o})]})}function d9({sessions:e,onSessionSelect:t}){return u.jsx("div",{className:"flex w-full flex-col",children:u.jsx(p_,{sessions:e,onSelect:t})})}function f9(){const[e,t]=v.useState("open"),[a,s]=v.useState("stray"),[l,o]=v.useState(!1),[d,f]=v.useState(""),[m,h]=v.useState(null),[x,b]=v.useState(null),[y,T]=v.useState(!1),[N,S]=v.useState(!1),[C,A]=v.useState(null),[D,k]=v.useState(null),[z,V]=v.useState(null),[M,L]=AE(),K=Ue(H=>H.issues),se=Ue(H=>H.syncing),B=Ue(H=>H.syncIssues),U=Ue(H=>H.tags),te=Ue(H=>H.tagFilterMode),ie=Ue(H=>H.cycleTagFilter),Z=Ue(H=>H.clearTagFilter),ee=Ue(H=>H.loadTags),Q=Ue(H=>H.milestones),$=Ue(H=>H.selectedMilestoneId),pe=Ue(H=>H.setMilestoneFilter),ke=Ue(H=>H.loadMilestones),P=qe(H=>H.activeRepoId),R=Le(H=>H.sessions);v.useEffect(()=>{const H=M.get("issueId");H&&K.some(Se=>Se.id===H)&&(h(H),L({},{replace:!0}))},[M,L,K]),v.useEffect(()=>{P&&(ee(),ke())},[P,ee,ke]);const W=new Map;for(const H of R)H.issueId&&!H.parentID&&W.set(H.issueId,(W.get(H.issueId)??0)+1);const O=new Set(K.filter(H=>H.parentId).map(H=>H.parentId)),ge=new Map;for(const H of K)if(H.parentId){const Se=ge.get(H.parentId);Se?Se.push(H):ge.set(H.parentId,[H])}function ve(H){return H.parentId?"task":O.has(H.id)?"epic":"stray"}const Ae=new Map(Q.map(H=>[H.id,H])),$e=e==="all"?K:K.filter(H=>H.state===e),dt=a==="all"?$e:$e.filter(H=>ve(H)===a),ut=te.size===0?dt:dt.filter(H=>{var ft;const Se=new Set((H.labels??[]).map(ln=>ln.name));for(const[ln,Zt]of te){const Ot=(ft=U.find(cn=>cn.id===ln))==null?void 0:ft.name;if(Ot&&(Zt==="include"&&!Se.has(Ot)||Zt==="exclude"&&Se.has(Ot)))return!1}return!0}),Ft=d.trim().toLowerCase(),yn=Ft?ut.filter(H=>`#${H.number} ${H.title}`.toLowerCase().includes(Ft)):ut,da=$?yn.filter(H=>H.milestoneId===$):yn,Aa=D?da.filter(H=>H.authorLogin===D):da,un=z?Aa.filter(H=>(H.assignees??[]).some(Se=>Se.login===z)):Aa,Qn=(()=>{const H=new Map;for(const Se of K)Se.authorLogin&&!H.has(Se.authorLogin)&&H.set(Se.authorLogin,{login:Se.authorLogin,avatar:Se.authorAvatar});return[...H.values()]})(),Je=(()=>{const H=new Map;for(const Se of K)for(const ft of Se.assignees??[])H.has(ft.login)||H.set(ft.login,{login:ft.login,avatar:ft.avatar_url});return[...H.values()]})(),Dn=K.filter(H=>H.state==="open").length,Cn=K.filter(H=>H.state==="closed").length,fa=$e.filter(H=>ve(H)==="epic").length,Ca=$e.filter(H=>ve(H)==="task").length,Wa=$e.filter(H=>ve(H)==="stray").length,ja=K.find(H=>H.id===m)??null,Ar=va(),_t=new Set;if(m&&(_t.add(m),x)){_t.add(x);const H=[...ge.get(x)??[]];for(let Se=0;Se<H.length;Se++){_t.add(H[Se].id);const ft=ge.get(H[Se].id);ft&&H.push(...ft)}}const Ja=R.filter(H=>H.issueId&&_t.has(H.issueId)&&!H.parentID),ue=qe(Da),Te=H=>{Le.setState({activeSessionId:H}),Ar(`/${encodeURIComponent(ue)}/run`)},Pe=IT({onSwipeRight:()=>S(!0),onSwipeLeft:()=>T(!0),disabled:!m||N||y});return u.jsxs("div",{className:"flex min-h-0 flex-1",...Pe,children:[u.jsxs("div",{className:ce("shrink-0 flex-col bg-surface",m?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[m?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"}),P&&u.jsx("div",{className:"flex items-center gap-1",children:u.jsx("button",{type:"button",onClick:()=>void B(),disabled:se,title:"同步",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-3.5 w-3.5",se&&"animate-spin")})})})]}),l&&u.jsx(K1,{onDone:()=>o(!1)}),u.jsx("div",{className:"flex border-b border-line",children:G1.map(({key:H,label:Se})=>{const ft=H==="open"?Dn:H==="closed"?Cn:K.length;return u.jsxs("button",{type:"button",onClick:()=>t(H),className:ce("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===H?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[Se,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===H?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:ft})]},H)})}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:d,onChange:H=>f(H.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&u.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2.5",children:[u.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg",children:"Issues"}),u.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:G1.map(({key:H,label:Se})=>{const ft=H==="open"?Dn:H==="closed"?Cn:K.length;return u.jsxs("button",{type:"button",onClick:()=>t(H),className:ce("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===H?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[Se,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===H?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:ft})]},H)})}),u.jsx("div",{className:"mx-1 h-4 w-px shrink-0 bg-line"}),u.jsxs("button",{type:"button",onClick:()=>A(C==="type"?null:"type"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="type"?"bg-elevated text-fg":a!=="all"?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["类型",a!=="all"&&u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:a==="epic"?"Epic":a==="task"?"任务":"游离"}),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="type"&&"rotate-180")})]}),u.jsxs("button",{type:"button",onClick:()=>A(C==="tag"?null:"tag"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="tag"?"bg-elevated text-fg":te.size>0?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["标签",te.size>0&&u.jsx("span",{className:"rounded-full bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:te.size}),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="tag"&&"rotate-180")})]}),u.jsxs("button",{type:"button",onClick:()=>A(C==="milestone"?null:"milestone"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="milestone"?"bg-elevated text-fg":$?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Milestone",$&&(()=>{const H=Q.find(Se=>Se.id===$);return H?u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:H.title}):null})(),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="milestone"&&"rotate-180")})]}),u.jsxs("button",{type:"button",onClick:()=>A(C==="author"?null:"author"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="author"?"bg-elevated text-fg":D?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Author",D&&u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:D}),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="author"&&"rotate-180")})]}),u.jsxs("button",{type:"button",onClick:()=>A(C==="assignee"?null:"assignee"),className:ce("flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors",C==="assignee"?"bg-elevated text-fg":z?"text-fg-2":"text-fg-4 hover:bg-elevated/60 hover:text-fg-2"),children:["Assignee",z&&u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-400",children:z}),u.jsx(ss,{className:ce("h-3 w-3 transition-transform",C==="assignee"&&"rotate-180")})]}),u.jsx("div",{className:"min-w-0 flex-1 px-1",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:d,onChange:H=>f(H.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&u.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),P&&u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx("button",{type:"button",onClick:()=>void B(),disabled:se,title:"同步 Issues",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-3.5 w-3.5",se&&"animate-spin")})}),u.jsx("button",{type:"button",onClick:()=>o(H=>!H),title:"新建 Issue",className:ce("flex h-8 w-8 items-center justify-center rounded-md transition-colors",l?"bg-blue-600 text-white":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:u.jsx(Sr,{className:"h-3.5 w-3.5"})})]})]}),C==="type"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:["epic","stray","task","all"].map(H=>{const Se=H==="epic"?"Epic":H==="stray"?"游离":H==="task"?"任务":"全部",ft=H==="epic"?fa:H==="stray"?Wa:H==="task"?Ca:$e.length,ln=a===H;return u.jsxs("button",{type:"button",onClick:()=>s(ln&&H!=="all"?"all":H),className:ce("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1.5 text-xs font-semibold transition-colors",ln?H==="epic"?"bg-amber-400/15 text-amber-400":H==="stray"?"bg-sky-400/15 text-sky-400":H==="task"?"bg-violet-400/15 text-violet-400":"bg-fg-6/20 text-fg-3":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[Se,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px] font-medium",ln?"opacity-70":"text-fg-6"),children:ft})]},H)})}),C==="tag"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:U.length===0?u.jsx("span",{className:"text-xs text-fg-5",children:"暂无标签"}):u.jsxs(u.Fragment,{children:[U.map(H=>{const Se=te.get(H.id);return u.jsxs("button",{type:"button",onClick:()=>ie(H.id),className:ce("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",Se==="include"?"ring-1 ring-current shadow-sm":Se==="exclude"?"opacity-90 line-through decoration-2":"opacity-50 hover:opacity-80"),style:Se==="exclude"?{backgroundColor:`#${H.color}10`,color:`#${H.color}`,boxShadow:`inset 0 0 0 1px color-mix(in srgb, #${H.color} 30%, transparent)`}:{backgroundColor:`#${H.color}18`,color:`#${H.color}`,boxShadow:Se==="include"?`inset 0 0 0 1px color-mix(in srgb, #${H.color} 50%, transparent)`:void 0},children:[Se==="exclude"&&u.jsx("span",{className:"mr-1 text-[10px]",children:"✕"}),H.name]},H.id)}),te.size>0&&u.jsx("button",{type:"button",onClick:Z,className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),C==="milestone"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:Q.length===0?u.jsx("span",{className:"text-xs text-fg-5",children:"暂无里程碑"}):u.jsxs(u.Fragment,{children:[Q.map(H=>{const Se=$===H.id;return u.jsxs("button",{type:"button",onClick:()=>pe(Se?null:H.id),className:ce("shrink-0 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",Se?"bg-indigo-500/15 text-indigo-400 ring-1 ring-indigo-400/50 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[H.title,H.state==="closed"&&u.jsx("span",{className:"ml-1 text-[10px] opacity-60",children:"✓"})]},H.id)}),$&&u.jsx("button",{type:"button",onClick:()=>pe(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),C==="author"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:Qn.length===0?u.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见作者"}):u.jsxs(u.Fragment,{children:[Qn.map(H=>u.jsxs("button",{type:"button",onClick:()=>k(D===H.login?null:H.login),className:ce("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",D===H.login?"bg-blue-500/15 text-blue-400 ring-1 ring-blue-500/30 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[H.avatar&&u.jsx("img",{src:H.avatar,alt:"",className:"h-4 w-4 rounded-full"}),H.login]},H.login)),D&&u.jsx("button",{type:"button",onClick:()=>k(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),C==="assignee"&&u.jsx("div",{className:"flex items-center gap-2 overflow-x-auto border-b border-line px-4 py-2",style:{scrollbarWidth:"none"},children:Je.length===0?u.jsx("span",{className:"text-xs text-fg-5",children:"同步后可见指派人"}):u.jsxs(u.Fragment,{children:[Je.map(H=>u.jsxs("button",{type:"button",onClick:()=>V(z===H.login?null:H.login),className:ce("flex shrink-0 items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",z===H.login?"bg-blue-500/15 text-blue-400 ring-1 ring-blue-500/30 shadow-sm":"bg-elevated/60 text-fg-5 hover:bg-elevated hover:text-fg-3"),children:[H.avatar&&u.jsx("img",{src:H.avatar,alt:"",className:"h-4 w-4 rounded-full"}),H.login]},H.login)),z&&u.jsx("button",{type:"button",onClick:()=>V(null),className:"shrink-0 rounded-md px-2 py-1 text-[10px] text-fg-5 transition-colors hover:bg-elevated hover:text-fg-3",children:"清除"})]})}),l&&u.jsx(K1,{onDone:()=>o(!1)})]}),u.jsx("div",{className:ce("flex-1 overflow-y-auto",m?"px-2 py-2":"px-3 py-3"),children:P?un.length===0?u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:K.length===0?"点击 ↻ 同步 Issues":"无匹配 Issue"}):u.jsx("ul",{className:ce(m?"space-y-0.5":"space-y-1"),children:un.map(H=>m?u.jsx(V1,{issue:H,sessionCount:W.get(H.id)??0,isActive:m===H.id,isEpic:ve(H)==="epic",milestone:H.milestoneId?Ae.get(H.milestoneId):void 0,onSelect:()=>{h(H.id),b(ve(H)==="epic"?H.id:null)}},H.id):u.jsx(i9,{issue:H,sessionCount:W.get(H.id)??0,isEpic:ve(H)==="epic",milestone:H.milestoneId?Ae.get(H.milestoneId):void 0,onSelect:()=>{h(H.id),b(ve(H)==="epic"?H.id:null)}},H.id))}):u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),m&&u.jsx(ah,{side:"left",open:N,onClose:()=>S(!1),children:u.jsxs("div",{className:"flex h-full flex-col",children:[u.jsx("div",{className:"border-b border-line px-3 py-3",children:u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Issues"})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:un.length===0?u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"无匹配 Issue"}):u.jsx("ul",{className:"space-y-0.5",children:un.map(H=>u.jsx(V1,{issue:H,sessionCount:W.get(H.id)??0,isActive:m===H.id,isEpic:ve(H)==="epic",milestone:H.milestoneId?Ae.get(H.milestoneId):void 0,onSelect:()=>{h(H.id),b(ve(H)==="epic"?H.id:null),S(!1)}},H.id))})})]})}),m&&u.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col bg-term",children:ja?u.jsxs(u.Fragment,{children:[u.jsx(l9,{issue:ja,milestone:ja.milestoneId?Ae.get(ja.milestoneId):void 0,onBack:()=>{h(null),b(null),T(!1)},onClose:()=>{h(null),b(null),T(!1)},onToggleSidebar:()=>T(H=>!H)}),y&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"absolute inset-0 z-10 bg-black/30",onClick:()=>T(!1)}),u.jsxs("div",{className:"absolute right-0 top-0 bottom-0 z-20 flex w-[280px] flex-col border-l border-line bg-surface shadow-xl",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-line px-3 py-2.5",children:[u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-fg-4",children:x?"子任务树 & 运行记录":"运行记录"}),u.jsx("button",{type:"button",onClick:()=>T(!1),className:"flex h-6 w-6 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:u.jsx(Tt,{className:"h-4 w-4"})})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:x?(()=>{const H=K.find(Se=>Se.id===x);return H?u.jsx(c9,{rootIssue:H,childrenMap:ge,currentId:m,onSelect:Se=>{h(Se),T(!1)},sessions:Ja,onSessionSelect:Te}):null})():u.jsx(d9,{sessions:Ja,onSessionSelect:Te})})]})]})]}):u.jsx("div",{className:"flex flex-1 items-center justify-center",children:u.jsx("p",{className:"font-mono text-xs text-fg-5",children:"Issue 未找到"})})})]})}const X1=[{key:"open",label:"开放"},{key:"merged",label:"已合并"},{key:"closed",label:"已关闭"},{key:"all",label:"全部"}];function g_(e){const t=e<1e12?e*1e3:e,a=Date.now()-t;return a<6e4?"刚刚":a<36e5?`${Math.floor(a/6e4)}分钟前`:a<864e5?`${Math.floor(a/36e5)}小时前`:a<2592e6?`${Math.floor(a/864e5)}天前`:new Date(t).toLocaleDateString("zh-CN",{month:"short",day:"numeric"})}function m9(e){return e==="merged"?"bg-purple-500/15 text-purple-400":e==="closed"?"bg-red-500/15 text-red-400":"bg-emerald-500/15 text-emerald-400"}function h9({pr:e,isActive:t,onSelect:a}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:a,className:ce("group flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left transition-colors",t?"border-l-2 border-blue-500 bg-elevated/80":"border-l-2 border-transparent hover:bg-elevated/50"),children:[u.jsx("span",{className:ce("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold ring-1",e.state==="merged"?"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-purple-500/25":e.state==="closed"?"bg-gradient-to-br from-red-500/20 to-red-500/5 text-red-400 ring-red-500/25":"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-emerald-500/25"),children:e.number}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[e.draft===1&&u.jsx("span",{className:"shrink-0 rounded px-1 py-0.5 text-[9px] font-bold bg-fg-6/15 text-fg-4",children:"DRAFT"}),u.jsx("span",{className:"min-w-0 text-xs font-medium text-fg-2 group-hover:text-fg",children:e.title})]}),u.jsxs("div",{className:"mt-0.5 truncate font-mono text-[10px] text-fg-6",children:[e.headBranch," → ",e.baseBranch]}),e.labels&&e.labels.length>0&&u.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(s=>u.jsx("span",{className:"rounded px-1 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${s.color}20`,color:`#${s.color}`},children:s.name},s.id))})]})]})})}function p9({pr:e,onSelect:t}){return u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:t,className:"group flex w-full items-center gap-3 border-b border-line px-4 py-3 text-left transition-colors hover:bg-elevated/50",children:[u.jsx("span",{className:ce("flex h-10 w-10 shrink-0 items-center justify-center rounded-full font-mono text-sm font-bold ring-1",e.state==="merged"?"bg-gradient-to-br from-purple-500/20 to-purple-500/5 text-purple-400 ring-purple-500/25":e.state==="closed"?"bg-gradient-to-br from-red-500/20 to-red-500/5 text-red-400 ring-red-500/25":"bg-gradient-to-br from-emerald-500/20 to-emerald-500/5 text-emerald-400 ring-emerald-500/25"),children:e.number}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[e.draft===1&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wide bg-fg-6/15 text-fg-4",children:"DRAFT"}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-fg-2 group-hover:text-fg",children:e.title}),e.mergeable==="false"&&e.state==="open"&&u.jsxs("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:[u.jsx(Kn,{className:"inline h-3 w-3 -mt-px"})," Conflict"]}),e.assignees&&e.assignees.length>0&&u.jsx("div",{className:"hidden shrink-0 items-center -space-x-1.5 sm:flex",children:e.assignees.slice(0,3).map(a=>u.jsx("img",{src:a.avatar_url,alt:a.login,title:a.login,className:"h-5 w-5 rounded-full ring-2 ring-surface"},a.login))})]}),u.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[u.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-fg-5",children:[e.headBranch," → ",e.baseBranch]}),u.jsx("span",{className:"text-fg-6",children:"·"}),e.authorLogin&&u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"shrink-0 text-[11px] text-fg-5",title:e.authorLogin,children:[e.authorAvatar&&u.jsx("img",{src:e.authorAvatar,alt:"",className:"mr-1 inline-block h-3.5 w-3.5 rounded-full align-text-bottom"}),e.authorLogin]}),u.jsx("span",{className:"text-fg-6",children:"·"})]}),u.jsx("span",{className:"shrink-0 text-[11px] text-fg-6",children:g_(e.createdAt)}),e.labels&&e.labels.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-fg-6",children:"·"}),e.labels.map(a=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[11px] font-medium",style:{backgroundColor:`#${a.color}20`,color:`#${a.color}`},children:a.name},a.id))]})]})]})]})})}function g9({issue:e,linked:t,onToggle:a}){return u.jsx("li",{children:u.jsx("button",{type:"button",onClick:a,className:ce("group flex w-full items-start gap-2 rounded-md px-3 py-2.5 text-left transition-colors",t?"border-l-2 border-emerald-500 bg-emerald-500/5":"border-l-2 border-transparent hover:bg-elevated/50"),children:u.jsx("div",{className:"min-w-0 flex-1",children:u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-xs font-medium",e.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",e.number]}),u.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-fg-2",children:e.title}),t&&u.jsx(Lc,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-emerald-400"})]})})})})}function b9({pr:e,onBack:t,onClose:a,onEnterMatch:s}){var k;const l=qe(z=>z.activeRepoId),o=qe(Da),[d,f]=v.useState(!1),[m,h]=v.useState([]),[x,b]=v.useState(!1),[y,T]=v.useState([]),N=va(),S=Gn(z=>z.unlinkIssue);v.useEffect(()=>{l&&(b(!0),q3(l,e.number).then(h).catch(()=>h([])).finally(()=>b(!1)))},[l,e.number]),v.useEffect(()=>{l&&XE(l,e.number).then(T).catch(()=>T([]))},[l,e.number]);const C=async z=>{if(!(d||!l)){f(!0);try{if(await H3(l,e.number),z&&y.length>0){const V=y.filter(M=>M.state==="open");await Promise.all(V.map(M=>QE(l,M.number,{state:"closed"}))),T(M=>M.map(L=>L.state==="open"?{...L,state:"closed"}:L)),Ue.getState().loadIssues(),Yt.getState().addToast(`PR #${e.number} 合入成功,已关闭 ${V.length} 个 Issue`,"success")}else Yt.getState().addToast(`PR #${e.number} 合入成功`,"success");Gn.getState().loadPulls()}catch(V){let M="合入失败";if(V instanceof Hs)try{M=JSON.parse(V.message).error??M}catch{M=V.message}Yt.getState().addToast(M,"error")}finally{f(!1)}}},A=async z=>{await S(e.number,z)&&T(M=>M.filter(L=>L.number!==z))},D=z=>{const V=new Date(z);return V.toLocaleDateString("zh-CN",{month:"short",day:"numeric"})+" "+V.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})};return u.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[u.jsxs("header",{className:"flex flex-col gap-2 border-b border-line px-4 py-3 md:flex-row md:items-center md:gap-3 md:px-6",children:[u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[u.jsx("button",{type:"button",onClick:t,"aria-label":"返回列表",className:"-ml-1 shrink-0 rounded-md p-1.5 text-fg-3 transition-colors hover:bg-elevated hover:text-fg md:hidden",children:u.jsx(RE,{className:"h-5 w-5"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold",m9(e.state)),children:["#",e.number," ",e.state]}),e.draft===1&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-bold bg-fg-6/15 text-fg-4",children:"DRAFT"}),e.mergeable==="false"&&e.state==="open"&&u.jsx("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-semibold bg-red-500/15 text-red-400",children:"Conflict"}),(k=e.labels)==null?void 0:k.map(z=>u.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`#${z.color}20`,color:`#${z.color}`},children:z.name},z.id))]}),u.jsx("h2",{className:"mt-1 text-base font-semibold text-fg",children:e.title}),u.jsxs("div",{className:"mt-1.5 flex items-center gap-3 text-xs text-fg-4",children:[u.jsxs("span",{className:"flex items-center gap-1 font-mono text-[11px] text-fg-5",children:[u.jsx(mo,{className:"h-3.5 w-3.5"}),e.headBranch," → ",e.baseBranch]}),e.authorLogin&&u.jsxs("span",{className:"flex items-center gap-1.5",children:[e.authorAvatar&&u.jsx("img",{src:e.authorAvatar,alt:"",className:"h-4 w-4 rounded-full"}),e.authorLogin]}),e.mergedAt&&u.jsxs("span",{className:"text-purple-400",children:["合并于 ",g_(e.mergedAt)]})]})]})]}),u.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[e.htmlUrl&&u.jsxs("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 font-mono text-xs text-fg-3 transition-colors hover:border-fg-5 hover:text-fg",children:[u.jsx(hc,{className:"h-3.5 w-3.5"}),"源站"]}),u.jsxs("button",{type:"button",onClick:s,className:"flex h-8 items-center gap-1.5 rounded-md border border-line px-2.5 text-xs text-fg-3 transition-colors hover:border-blue-500/50 hover:text-blue-400",children:[u.jsx(Lc,{className:"h-3.5 w-3.5"}),"关联 Issue"]}),e.state==="open"&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",disabled:d||e.mergeable==="false",onClick:()=>void C(!1),className:"flex h-8 items-center gap-1.5 rounded-md border border-emerald-500/30 px-2.5 text-xs font-medium text-emerald-400 transition-colors hover:border-emerald-500/60 hover:bg-emerald-500/10 disabled:opacity-40",children:[u.jsx(pc,{className:"h-3.5 w-3.5"}),"合入"]}),y.some(z=>z.state==="open")&&u.jsxs("button",{type:"button",disabled:d||e.mergeable==="false",onClick:()=>void C(!0),className:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(pc,{className:"h-3.5 w-3.5"}),"合入并关闭 Issues"]})]}),a&&u.jsx("button",{type:"button",onClick:a,title:"关闭详情",className:"hidden h-8 w-8 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 md:flex",children:u.jsx(Tt,{className:"h-4 w-4"})})]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:u.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6",children:[y.length>0&&u.jsxs("div",{className:"mb-6 rounded-lg border border-line bg-elevated/30 px-4 py-3",children:[u.jsxs("h3",{className:"mb-2 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-fg-4",children:[u.jsx(fo,{className:"h-3.5 w-3.5"}),"关联 Issues (",y.length,")"]}),u.jsx("div",{className:"space-y-1.5",children:y.map(z=>u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>N(`/${encodeURIComponent(o)}/issues?issueId=${encodeURIComponent(z.id)}`),className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-1 py-0.5 transition-colors hover:bg-elevated/60",children:[u.jsxs("span",{className:ce("shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",z.state==="open"?"bg-emerald-500/15 text-emerald-400":"bg-purple-500/15 text-purple-400"),children:["#",z.number]}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-left text-sm text-fg-2",children:z.title})]}),u.jsx("button",{type:"button",onClick:()=>void A(z.number),title:"取消关联",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-400",children:u.jsx(OE,{className:"h-3.5 w-3.5"})})]},z.id))})]}),e.body?u.jsx("div",{className:"markdown-body leading-relaxed",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:e.body})}):u.jsx("p",{className:"py-10 text-center font-mono text-xs text-fg-5",children:"该 PR 没有描述内容"}),x?u.jsx("p",{className:"mt-8 text-center font-mono text-xs text-fg-6",children:"加载评论…"}):m.length>0&&u.jsxs("div",{className:"mt-8 border-t border-line pt-6",children:[u.jsxs("h3",{className:"mb-4 text-xs font-semibold uppercase tracking-wider text-fg-4",children:["评论 (",m.length,")"]}),u.jsx("div",{className:"space-y-4",children:m.map(z=>u.jsxs("div",{className:"rounded-lg border border-line bg-elevated/40 px-4 py-3",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("img",{src:z.user.avatar_url,alt:z.user.login,className:"h-5 w-5 rounded-full"}),u.jsx("span",{className:"text-xs font-semibold text-fg-2",children:z.user.login}),u.jsx("span",{className:"text-[10px] text-fg-6",children:D(z.created_at)})]}),u.jsx("div",{className:"markdown-body mt-2 text-sm leading-relaxed text-fg-3",children:u.jsx(ls,{remarkPlugins:[os],rehypePlugins:[uo],children:z.body})})]},z.id))})]})]})})]})}function x9(){const[e,t]=v.useState("open"),[a,s]=v.useState(""),[l,o]=v.useState(null),[d,f]=v.useState(""),[m,h]=AE(),x=Gn($=>$.pulls),b=Gn($=>$.syncing),y=Gn($=>$.syncPulls),T=Gn($=>$.matchingPrId),N=Gn($=>$.enterMatchMode),S=Gn($=>$.exitMatchMode),C=Gn($=>$.linkIssue),A=qe($=>$.activeRepoId),D=Ue($=>$.issues);v.useEffect(()=>{const $=m.get("prId");$&&x.some(pe=>pe.id===$)&&(o($),h({},{replace:!0}))},[m,h,x]);const k=T?x.find($=>$.id===T)??null:null,[z,V]=v.useState(new Set);v.useEffect(()=>{if(!A||!k){V(new Set);return}XE(A,k.number).then($=>V(new Set($.map(pe=>pe.id)))).catch(()=>V(new Set))},[A,k]);const M=async $=>{if(!k)return;z.has($.id)?await Gn.getState().unlinkIssue(k.number,$.number)&&V(P=>{const R=new Set(P);return R.delete($.id),R}):await C(k.number,$.number)&&V(P=>new Set(P).add($.id))},L=x.filter($=>$.state==="open").length,K=x.filter($=>$.state==="merged").length,se=x.filter($=>$.state==="closed").length,B=e==="all"?x:x.filter($=>$.state===e),U=a.trim().toLowerCase(),te=U?B.filter($=>`#${$.number} ${$.title} ${$.headBranch} ${$.baseBranch}`.toLowerCase().includes(U)):B,ie=d.trim().toLowerCase(),Z=ie?D.filter($=>`#${$.number} ${$.title}`.toLowerCase().includes(ie)):D,ee=x.find($=>$.id===l)??null,Q=k??ee;return u.jsxs("div",{className:"flex min-h-0 flex-1",children:[u.jsxs("div",{className:ce("shrink-0 flex-col bg-surface",Q?"hidden md:flex md:w-80 border-r border-line":"flex w-full"),children:[T?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-400",children:"选择 Issue 关联"}),u.jsxs("button",{type:"button",onClick:S,className:"flex h-7 items-center gap-1 rounded-md px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:[u.jsx(Tt,{className:"h-3.5 w-3.5"}),"完成"]})]}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:d,onChange:$=>f($.target.value),placeholder:"搜索 issue...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),d&&u.jsx("button",{type:"button",onClick:()=>f(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-2",children:Z.length===0?u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:D.length===0?"暂无 Issue,请先同步":"无匹配 Issue"}):u.jsx("ul",{className:"space-y-0.5",children:Z.map($=>u.jsx(g9,{issue:$,linked:z.has($.id),onToggle:()=>void M($)},$.id))})})]}):Q?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-line px-3 py-3",children:[u.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-fg-3",children:"Pull Requests"}),A&&u.jsx("button",{type:"button",onClick:()=>void y(),disabled:b,title:"同步",className:"flex h-7 w-7 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-3.5 w-3.5",b&&"animate-spin")})})]}),u.jsx("div",{className:"flex border-b border-line",children:X1.map(({key:$,label:pe})=>{const ke=$==="open"?L:$==="merged"?K:$==="closed"?se:x.length;return u.jsxs("button",{type:"button",onClick:()=>t($),className:ce("flex flex-1 items-center justify-center gap-1.5 py-2 text-xs font-medium transition-colors",e===$?"border-b-2 border-blue-500 text-blue-500":"text-fg-4 hover:text-fg-2"),children:[pe,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===$?"bg-blue-500/10 text-blue-500":"bg-elevated text-fg-5"),children:ke})]},$)})}),u.jsx("div",{className:"border-b border-line px-3 py-2",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2 py-1",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:a,onChange:$=>s($.target.value),placeholder:"搜索 PR...",className:"min-w-0 flex-1 bg-transparent font-mono text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),a&&u.jsx("button",{type:"button",onClick:()=>s(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})})]}):u.jsx(u.Fragment,{children:u.jsxs("div",{className:"flex items-center gap-2 border-b border-line px-4 py-2.5",children:[u.jsx("span",{className:"shrink-0 text-sm font-semibold text-fg",children:"Pull Requests"}),u.jsx("div",{className:"flex shrink-0 items-center rounded-lg bg-elevated/60 p-0.5",children:X1.map(({key:$,label:pe})=>{const ke=$==="open"?L:$==="merged"?K:$==="closed"?se:x.length;return u.jsxs("button",{type:"button",onClick:()=>t($),className:ce("flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e===$?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-2"),children:[pe,u.jsx("span",{className:ce("rounded-full px-1.5 py-0.5 font-mono text-[10px]",e===$?"bg-blue-500/10 text-blue-500":"text-fg-5"),children:ke})]},$)})}),u.jsx("div",{className:"min-w-0 flex-1 px-1",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-base px-2.5 py-1.5",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:a,onChange:$=>s($.target.value),placeholder:"搜索 PR...",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),a&&u.jsx("button",{type:"button",onClick:()=>s(""),className:"shrink-0 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]})}),u.jsx("button",{type:"button",onClick:()=>void y(),disabled:b||!A,title:"同步 PR",className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-4 w-4",b&&"animate-spin")})})]})}),!T&&u.jsx("div",{className:ce("flex-1 overflow-y-auto",Q?"px-2 py-2":"px-3 py-3"),children:A?te.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-fg-5",children:[u.jsx(mo,{className:"h-8 w-8"}),u.jsx("p",{className:"font-mono text-xs",children:x.length===0?"点击 ↻ 同步 PR":"没有匹配的 PR"})]}):u.jsx("ul",{className:ce(Q?"space-y-0.5":"space-y-1"),children:te.map($=>Q?u.jsx(h9,{pr:$,isActive:$.id===(l??T),onSelect:()=>o($.id)},$.id):u.jsx(p9,{pr:$,onSelect:()=>o($.id)},$.id))}):u.jsx("p",{className:"px-2 py-8 text-center font-mono text-xs text-fg-5",children:"请先选择一个仓库"})})]}),Q?u.jsx(b9,{pr:Q,onBack:()=>{o(null),T&&S()},onClose:()=>{o(null),T&&S()},onEnterMatch:()=>N(Q.id)},`${Q.id}-${T??"view"}`):u.jsx("div",{className:"hidden flex-1 items-center justify-center md:flex",children:u.jsxs("div",{className:"text-center text-fg-5",children:[u.jsx(mo,{className:"mx-auto h-12 w-12 opacity-20"}),u.jsx("p",{className:"mt-3 font-mono text-xs",children:"选择一个 PR 查看详情"})]})})]})}let yr=null;function E9(e){const t=Date.now()-e,a=Math.floor(t/6e4);return a<1?"刚刚":a<60?`${a} 分钟前`:`${Math.floor(a/60)} 小时前`}const Z1=[{id:"usage",label:"Claude 账号",icon:Sh},{id:"git",label:"Git 源站",icon:_o},{id:"models",label:"模型",icon:lc},{id:"custom-agents",label:"Custom Agents",icon:Rv},{id:"agents",label:"AGENTS.md",icon:ME}],y9={id:"server",label:"服务器",icon:UE};function T9(e){if(!e)return null;const t=new Date(e).getTime()-Date.now();if(t<=0)return"已重置";const a=Math.floor(t/36e5),s=Math.floor(t%36e5/6e4);return a>0?`${a}h ${s}m 后重置`:`${s}m 后重置`}function _9(e){return e>=90?"bg-red-500":e>=70?"bg-amber-500":"bg-blue-500"}function Bm({label:e,window:t}){if(!t)return null;const a=Math.round(t.utilization),s=T9(t.resets_at),l=a>=90,o=a>=70;return u.jsxs("div",{className:"space-y-1.5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg-3",children:e}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s&&u.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-elevated px-1.5 py-0.5 text-[10px] font-medium text-fg-4 tabular-nums",children:[u.jsx($v,{className:"h-2.5 w-2.5"}),s]}),u.jsxs("span",{className:ce("text-sm font-bold leading-none tabular-nums",l?"text-red-400":o?"text-amber-400":"text-fg"),children:[a,"%"]})]})]}),u.jsx("div",{className:"h-2.5 overflow-hidden rounded-full bg-elevated ring-1 ring-inset ring-line/60",children:u.jsx("div",{className:ce("h-full rounded-full transition-all duration-500 ease-out",_9(a),l?"shadow-sm shadow-red-500/50":o?"shadow-sm shadow-amber-500/40":null),style:{width:`${Math.min(a,100)}%`}})})]})}function N9({account:e,onSwitch:t,switching:a}){var l;const s=e.active;return u.jsxs("div",{className:ce("relative overflow-hidden rounded-xl border bg-base p-4 shadow-sm transition-colors",s?"border-blue-500/30 ring-1 ring-inset ring-blue-500/20":"border-line"),children:[s&&u.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-1 bg-blue-500"}),u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx("div",{className:ce("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg",s?"bg-blue-500/15 text-blue-500":"bg-elevated text-fg-4"),children:u.jsx(PE,{className:"h-3.5 w-3.5"})}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:e.label}),s&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full bg-blue-500/15 px-2 py-0.5 text-[10px] font-semibold text-blue-500",children:[u.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-blue-500 shadow-sm shadow-blue-500/60"}),"当前"]}),!s&&t&&u.jsxs("button",{type:"button",onClick:()=>t(e.id),disabled:a,className:"inline-flex shrink-0 items-center gap-1 rounded-full border border-line px-2 py-0.5 text-[10px] font-medium text-fg-4 transition-colors hover:border-blue-500/50 hover:text-blue-500 disabled:opacity-40",children:[a&&u.jsx(Va,{className:"h-2.5 w-2.5 fs-spin"}),"切换"]}),e.excluded&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-elevated px-2 py-0.5 text-[10px] font-medium text-fg-5",children:[u.jsx(wv,{className:"h-2.5 w-2.5"}),"不自动切"]}),e.needsReauth&&u.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-red-500/15 px-2 py-0.5 text-[10px] font-medium text-red-400",children:[u.jsx(Kn,{className:"h-2.5 w-2.5"}),"需重新登录"]})]}),e.error&&!e.usage?u.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"min-w-0 break-words",children:e.error})]}):e.usage?u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsx(Bm,{label:"5 小时窗口",window:e.usage.five_hour}),u.jsx(Bm,{label:"7 天窗口",window:e.usage.seven_day}),(l=e.usage.scoped)==null?void 0:l.map(o=>u.jsx(Bm,{label:o.label,window:o},o.label))]}):null]})}function S9(){const[e,t]=v.useState((yr==null?void 0:yr.data)??null),[a,s]=v.useState(!yr),[l,o]=v.useState(null),[d,f]=v.useState(null),[m,h]=v.useState((yr==null?void 0:yr.fetchedAt)??null),[,x]=v.useState(0),b=v.useCallback(S=>{const C=Date.now();yr={data:S,fetchedAt:C},t(S),h(C)},[]),y=v.useCallback(()=>{s(!0),o(null),rC().then(S=>{b(S),s(!1)}).catch(S=>{o(S instanceof Error?S.message:String(S)),s(!1)})},[b]);v.useEffect(()=>{yr||y()},[y]),v.useEffect(()=>{const S=setInterval(()=>x(C=>C+1),3e4);return()=>clearInterval(S)},[]);const T=v.useRef(!1),N=v.useCallback(S=>{T.current||(T.current=!0,f(S),sC(S).then(C=>{b(C),f(null)}).catch(C=>{o(C instanceof Error?C.message:String(C)),f(null)}).finally(()=>{T.current=!1}))},[b]);return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:u.jsx(sA,{className:"h-4 w-4"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Claude 订阅额度"}),u.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"各账号的 Pro/Max 订阅窗口用量。"})]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[m&&u.jsx("span",{className:"text-[10px] tabular-nums text-fg-5",children:E9(m)}),u.jsx("button",{type:"button",onClick:y,disabled:a,className:"rounded-md p-1.5 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-40",children:u.jsx(us,{className:ce("h-4 w-4",a&&"fs-spin")})})]})]}),u.jsx("div",{className:"mt-4 space-y-2.5",children:a&&!e?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(Va,{className:"h-5 w-5 fs-spin"}),u.jsx("p",{className:"text-xs",children:"加载中…"})]}):l&&!e?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[u.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-red-500/10",children:u.jsx(Kn,{className:"h-5 w-5"})}),u.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:l})]}):e&&e.accounts.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-elevated text-fg-4",children:u.jsx(XA,{className:"h-5 w-5"})}),u.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:"未找到账号。请在 OpenCode TUI 中通过 claude-accounts-usage 插件登录。"})]}):e?e.accounts.map(S=>u.jsx(N9,{account:S,onSwitch:N,switching:d===S.id},S.id)):null})]})}function v9({host:e,onDelete:t}){const[a,s]=v.useState(!1);return u.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-3",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm font-medium text-fg",children:e.name}),u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:e.platform})]}),u.jsxs("div",{className:"mt-0.5 flex items-center gap-2 font-mono text-xs text-fg-4",children:[u.jsx("span",{children:e.host}),u.jsx("span",{className:"text-fg-6",children:"·"}),u.jsx("span",{className:"text-fg-5",children:e.token})]})]}),a?u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-red-400 hover:bg-red-500/10",children:u.jsx(oa,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>s(!1),className:"rounded p-1.5 text-fg-4 hover:bg-elevated",children:u.jsx(Tt,{className:"h-4 w-4"})})]}):u.jsx("button",{type:"button",onClick:()=>s(!0),className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:u.jsx(ji,{className:"h-4 w-4"})})]})}function A9({onAdded:e}){const[t,a]=v.useState(!1),[s,l]=v.useState(""),[o,d]=v.useState(""),[f,m]=v.useState(""),[h,x]=v.useState("gitea"),[b,y]=v.useState(!1),[T,N]=v.useState(!1),S=()=>{l(""),d(""),m(""),x("gitea"),a(!1)},C=async()=>{if(!(!s.trim()||!o.trim()||!f.trim())){y(!0);try{await nC(s.trim(),o.trim(),f.trim(),h),S(),e()}finally{y(!1)}}};return t?u.jsxs("div",{className:"space-y-3 rounded-lg border border-line bg-base p-4",children:[u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("label",{className:"flex-1",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),u.jsx("input",{type:"text",value:o,onChange:A=>d(A.target.value),placeholder:"公司 Gitea",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("label",{className:"w-28",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"平台"}),u.jsxs("select",{value:h,onChange:A=>x(A.target.value),className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:[u.jsx("option",{value:"gitea",children:"Gitea"}),u.jsx("option",{value:"github",children:"GitHub"}),u.jsx("option",{value:"gitlab",children:"GitLab"})]})]})]}),u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Host"}),u.jsx("input",{type:"text",value:s,onChange:A=>l(A.target.value),placeholder:"git.btsai.work",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Token"}),u.jsxs("div",{className:"relative mt-1",children:[u.jsx("input",{type:T?"text":"password",value:f,onChange:A=>m(A.target.value),placeholder:"Personal Access Token",className:"w-full rounded-md border border-line bg-surface px-3 py-1.5 pr-9 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),u.jsx("button",{type:"button",onClick:()=>N(!T),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-fg-5 hover:text-fg-3",children:T?u.jsx(Jv,{className:"h-3.5 w-3.5"}):u.jsx(tA,{className:"h-3.5 w-3.5"})})]})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u.jsx("button",{type:"button",onClick:S,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void C(),disabled:b||!s.trim()||!o.trim()||!f.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:b?"保存中…":"保存"})]})]}):u.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(Sr,{className:"h-3.5 w-3.5"})," 添加 Git 源站"]})}function C9(){const[e,t]=v.useState(""),[a,s]=v.useState(""),[l,o]=v.useState(!0),[d,f]=v.useState(!1),[m,h]=v.useState(null);v.useEffect(()=>{K3().then(y=>{t(y.content),s(y.content),o(!1)}).catch(y=>{h(y instanceof Error?y.message:String(y)),o(!1)})},[]);const x=async()=>{f(!0),h(null);try{await V3(e),s(e)}catch(y){h(y instanceof Error?y.message:String(y))}f(!1)},b=e!==a;return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"全局 AGENTS.md"}),u.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"此内容会注入到所有仓库的 Agent 系统指令中。修改后 opencode 热加载,即时生效。"})]}),u.jsxs("button",{type:"button",onClick:()=>void x(),disabled:d||!b,className:"flex shrink-0 items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(Pc,{className:"h-3.5 w-3.5"}),d?"保存中…":"保存"]})]}),m&&u.jsxs("div",{className:"mt-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsx("span",{className:"min-w-0 break-words",children:m})]}),u.jsx("div",{className:"mt-4",children:l?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(Va,{className:"h-5 w-5 fs-spin"}),u.jsx("p",{className:"text-xs",children:"加载中…"})]}):u.jsx("textarea",{value:e,onChange:y=>t(y.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
446
446
 
447
- 在此编写全局 Agent 指令…`})}),u.jsx("p",{className:"mt-3 text-[11px] text-fg-5",children:"文件路径:~/.config/opencode/AGENTS.md"})]})}function C9(){const[e,t]=v.useState([]),[a,s]=v.useState(!0),l=()=>{eC().then(d=>{t(d),s(!1)}).catch(()=>s(!1))};v.useEffect(l,[]);const o=async d=>{await nC(d),t(f=>f.filter(m=>m.id!==d))};return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Git 源站管理"}),u.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"为不同的 Git 托管平台配置访问凭证,用于同步 Issues。系统会根据仓库的 git URL 自动匹配对应的源站。"}),u.jsx("div",{className:"mt-4 space-y-2",children:a?u.jsx("p",{className:"py-4 text-center font-mono text-xs text-fg-5",children:"加载中…"}):u.jsxs(u.Fragment,{children:[e.map(d=>u.jsx(S9,{host:d,onDelete:()=>void o(d.id)},d.id)),u.jsx(v9,{onAdded:l})]})}),u.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"Token 存储在数据库中。也可通过环境变量 GITEA_TOKEN 设置全局 fallback。"})]})}const ch="pinned_models";function w9(e){const t=new Map;for(const a of e){const s=a.providerName||a.providerID,l=t.get(s);l?l.push(a):t.set(s,[a])}return Array.from(t,([a,s])=>({provider:a,models:s})).sort((a,s)=>{const l=a.models.some(d=>d.configured),o=s.models.some(d=>d.configured);return l!==o?l?-1:1:a.provider.localeCompare(s.provider)})}function k9(e){return e?e>=1e6?`${(e/1e6).toFixed(e%1e6===0?0:1)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e):""}function R9(e){if(!e)return"";const t=[];return e.input!=null&&t.push(`$${e.input}/Mi`),e.output!=null&&t.push(`$${e.output}/Mo`),t.join(" ")}function O9(){const e=qe(k=>k.activeRepoId),[t,a]=v.useState([]),[s,l]=v.useState(new Set),[o,d]=v.useState(!0),[f,m]=v.useState(null),[h,x]=v.useState(null),[b,y]=v.useState("");v.useEffect(()=>{let k=!1;async function z(){d(!0),m(null);try{const[V,M]=await Promise.all([Uc(),e?vh(e):Promise.resolve([])]);if(k)return;const L=V[ch],K=L?JSON.parse(L):[];l(new Set(K)),a(M),x(null),y("")}catch(V){k||m(V instanceof Error?V.message:String(V))}k||d(!1)}return z(),()=>{k=!0}},[e]);const T=async k=>{const z=new Set(s);z.has(k)?z.delete(k):z.add(k),l(z);try{await $m(ch,JSON.stringify([...z]))}catch{l(s)}},N=v.useMemo(()=>w9(t),[t]),S=t.filter(k=>s.has(k.id)).length,C=h?N.find(k=>k.provider===h):N[0],A=b.trim().toLowerCase(),D=C?A?C.models.filter(k=>(k.name||k.id).toLowerCase().includes(A)||k.id.toLowerCase().includes(A)):C.models:[];return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsx("div",{className:"flex items-center justify-between gap-3",children:u.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:u.jsx(lc,{className:"h-4 w-4"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"常用模型"}),u.jsxs("p",{className:"mt-0.5 text-xs text-fg-4",children:["勾选常用模型,在新建对话时快速选择。",S>0&&u.jsxs("span",{className:"ml-1 text-blue-400",children:["已选 ",S," 个"]})]})]})]})}),u.jsx("div",{className:"mt-4",children:e?o?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(Va,{className:"h-5 w-5 fs-spin"}),u.jsx("p",{className:"text-xs",children:"加载模型列表…"})]}):f?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[u.jsx(Kn,{className:"h-5 w-5"}),u.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:f})]}):t.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(lc,{className:"h-5 w-5"}),u.jsx("p",{className:"text-xs",children:"当前仓库没有可用模型。"})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex gap-1 overflow-x-auto rounded-lg border border-line bg-base p-1",children:N.map(k=>{var M;const z=k.provider===(h??((M=N[0])==null?void 0:M.provider)),V=k.models.filter(L=>s.has(L.id)).length;return u.jsxs("button",{type:"button",onClick:()=>{x(k.provider),y("")},className:ce("flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",z?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[k.provider,V>0&&u.jsx("span",{className:"rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-blue-500",children:V})]},k.provider)})}),u.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-md border border-line bg-base px-3 py-1.5",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:b,onChange:k=>y(k.target.value),placeholder:"搜索模型…",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),b&&u.jsx("button",{type:"button",onClick:()=>y(""),className:"text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]}),u.jsx("div",{className:"mt-3 rounded-lg border border-line bg-base",children:D.length===0?u.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-5",children:"无匹配模型"}):u.jsx("div",{className:"divide-y divide-line/40",children:D.map(k=>{const z=s.has(k.id),V=k9(k.contextLimit),M=R9(k.cost);return u.jsxs("label",{className:ce("flex cursor-pointer items-center gap-3 px-3 py-2 transition-colors hover:bg-elevated/60",z&&"bg-blue-500/5"),children:[u.jsx("input",{type:"checkbox",checked:z,onChange:()=>void T(k.id),className:"h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-line accent-blue-500"}),u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-fg",children:k.name||k.id}),u.jsxs("span",{className:"flex shrink-0 items-center gap-2",children:[V&&u.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5 text-[10px] text-fg-5",children:V}),M&&u.jsx("span",{className:"text-[10px] text-fg-6",children:M})]})]},k.id)})})})]}):u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(lc,{className:"h-5 w-5"}),u.jsx("p",{className:"text-xs",children:"请先在左侧选择一个仓库以加载可用模型。"})]})})]})}const I9=["Sisyphus - ultraworker","Prometheus - Plan Builder","Atlas - Plan Executor"];function M9({agent:e,onEdit:t,onDelete:a}){const[s,l]=v.useState(!1),[o,d]=v.useState(!1),f=async()=>{const h=await nx(e.id),x=new Blob([JSON.stringify(h,null,2)],{type:"application/json"}),b=URL.createObjectURL(x),y=document.createElement("a");y.href=b,y.download=`${e.name.replace(/[^a-zA-Z0-9\u4e00-\u9fff_-]/g,"_")}.json`,y.click(),URL.revokeObjectURL(b)},m=async()=>{const h=await nx(e.id);await navigator.clipboard.writeText(JSON.stringify(h,null,2)),d(!0),setTimeout(()=>d(!1),2e3)};return u.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-3",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm font-medium text-fg",children:e.name}),u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:e.baseAgent}),e.model&&u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:e.model}),e.repoId&&u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400",children:"repo"})]}),e.systemPrompt&&u.jsx("p",{className:"mt-0.5 truncate font-mono text-xs text-fg-5",children:e.systemPrompt})]}),u.jsx("div",{className:"flex items-center gap-1",children:s?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:a,className:"rounded p-1.5 text-red-400 hover:bg-red-500/10",children:u.jsx(oa,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>l(!1),className:"rounded p-1.5 text-fg-4 hover:bg-elevated",children:u.jsx(Tt,{className:"h-4 w-4"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>void f(),title:"导出 JSON 文件",className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:u.jsx(Xv,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>void m(),title:"复制 JSON 到剪贴板",className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:o?u.jsx(oa,{className:"h-4 w-4 text-green-500"}):u.jsx(qv,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:u.jsx(LE,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>l(!0),className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:u.jsx(ji,{className:"h-4 w-4"})})]})})]})}const Ls="__system_prompt__";function W1({initial:e,availableFragments:t,onSave:a,onCancel:s}){const l=qe(U=>U.activeRepoId),[o,d]=v.useState((e==null?void 0:e.name)??""),[f,m]=v.useState((e==null?void 0:e.baseAgent)??"Sisyphus - ultraworker"),[h,x]=v.useState((e==null?void 0:e.model)??""),[b,y]=v.useState((e==null?void 0:e.systemPrompt)??""),[T,N]=v.useState(!1),[S,C]=v.useState(!1),[A,D]=v.useState([]);v.useEffect(()=>{if(!l){D([]);return}let U=!1;return(async()=>{try{const[te,ie]=await Promise.all([Uc(),vh(l)]);if(U)return;const Z=te[ch],ee=Z?JSON.parse(Z):[];D(ee.length>0?ie.filter(Q=>ee.includes(Q.id)):[])}catch{U||D([])}})(),()=>{U=!0}},[l]);const[k,z]=v.useState(()=>{const U=(e==null?void 0:e.fragments.map(ee=>ee.id))??[],te=(e==null?void 0:e.systemPromptPosition)??-1,ie=te>=0&&te<=U.length?te:U.length,Z=[...U];return Z.splice(ie,0,Ls),Z}),V=U=>{z(te=>{if(te.includes(U))return te.filter(ee=>ee!==U);const ie=te.indexOf(Ls),Z=[...te];return Z.splice(ie>=0?ie:Z.length,0,U),Z})},M=(U,te)=>{const ie=U+te;ie<0||ie>=k.length||z(Z=>{const ee=[...Z];return[ee[U],ee[ie]]=[ee[ie],ee[U]],ee})},L=k.filter(U=>U!==Ls),K=(()=>{const U=k.indexOf(Ls);return U<0?-1:k.slice(0,U).filter(te=>te!==Ls).length})(),se=k.map(U=>{var te;return U===Ls?b:(te=t.find(ie=>ie.id===U))==null?void 0:te.content}).filter(Boolean).join(`
447
+ 在此编写全局 Agent 指令…`})}),u.jsx("p",{className:"mt-3 text-[11px] text-fg-5",children:"文件路径:~/.config/opencode/AGENTS.md"})]})}function w9(){const[e,t]=v.useState([]),[a,s]=v.useState(!0),l=()=>{tC().then(d=>{t(d),s(!1)}).catch(()=>s(!1))};v.useEffect(l,[]);const o=async d=>{await aC(d),t(f=>f.filter(m=>m.id!==d))};return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Git 源站管理"}),u.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"为不同的 Git 托管平台配置访问凭证,用于同步 Issues。系统会根据仓库的 git URL 自动匹配对应的源站。"}),u.jsx("div",{className:"mt-4 space-y-2",children:a?u.jsx("p",{className:"py-4 text-center font-mono text-xs text-fg-5",children:"加载中…"}):u.jsxs(u.Fragment,{children:[e.map(d=>u.jsx(v9,{host:d,onDelete:()=>void o(d.id)},d.id)),u.jsx(A9,{onAdded:l})]})}),u.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"Token 存储在数据库中。也可通过环境变量 GITEA_TOKEN 设置全局 fallback。"})]})}const ch="pinned_models";function k9(e){const t=new Map;for(const a of e){const s=a.providerName||a.providerID,l=t.get(s);l?l.push(a):t.set(s,[a])}return Array.from(t,([a,s])=>({provider:a,models:s})).sort((a,s)=>{const l=a.models.some(d=>d.configured),o=s.models.some(d=>d.configured);return l!==o?l?-1:1:a.provider.localeCompare(s.provider)})}function R9(e){return e?e>=1e6?`${(e/1e6).toFixed(e%1e6===0?0:1)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e):""}function O9(e){if(!e)return"";const t=[];return e.input!=null&&t.push(`$${e.input}/Mi`),e.output!=null&&t.push(`$${e.output}/Mo`),t.join(" ")}function I9(){const e=qe(k=>k.activeRepoId),[t,a]=v.useState([]),[s,l]=v.useState(new Set),[o,d]=v.useState(!0),[f,m]=v.useState(null),[h,x]=v.useState(null),[b,y]=v.useState("");v.useEffect(()=>{let k=!1;async function z(){d(!0),m(null);try{const[V,M]=await Promise.all([Uc(),e?vh(e):Promise.resolve([])]);if(k)return;const L=V[ch],K=L?JSON.parse(L):[];l(new Set(K)),a(M),x(null),y("")}catch(V){k||m(V instanceof Error?V.message:String(V))}k||d(!1)}return z(),()=>{k=!0}},[e]);const T=async k=>{const z=new Set(s);z.has(k)?z.delete(k):z.add(k),l(z);try{await $m(ch,JSON.stringify([...z]))}catch{l(s)}},N=v.useMemo(()=>k9(t),[t]),S=t.filter(k=>s.has(k.id)).length,C=h?N.find(k=>k.provider===h):N[0],A=b.trim().toLowerCase(),D=C?A?C.models.filter(k=>(k.name||k.id).toLowerCase().includes(A)||k.id.toLowerCase().includes(A)):C.models:[];return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsx("div",{className:"flex items-center justify-between gap-3",children:u.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:u.jsx(lc,{className:"h-4 w-4"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"常用模型"}),u.jsxs("p",{className:"mt-0.5 text-xs text-fg-4",children:["勾选常用模型,在新建对话时快速选择。",S>0&&u.jsxs("span",{className:"ml-1 text-blue-400",children:["已选 ",S," 个"]})]})]})]})}),u.jsx("div",{className:"mt-4",children:e?o?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(Va,{className:"h-5 w-5 fs-spin"}),u.jsx("p",{className:"text-xs",children:"加载模型列表…"})]}):f?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-red-400",children:[u.jsx(Kn,{className:"h-5 w-5"}),u.jsx("p",{className:"max-w-xs text-center text-xs leading-relaxed",children:f})]}):t.length===0?u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(lc,{className:"h-5 w-5"}),u.jsx("p",{className:"text-xs",children:"当前仓库没有可用模型。"})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex gap-1 overflow-x-auto rounded-lg border border-line bg-base p-1",children:N.map(k=>{var M;const z=k.provider===(h??((M=N[0])==null?void 0:M.provider)),V=k.models.filter(L=>s.has(L.id)).length;return u.jsxs("button",{type:"button",onClick:()=>{x(k.provider),y("")},className:ce("flex shrink-0 items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",z?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[k.provider,V>0&&u.jsx("span",{className:"rounded-full bg-blue-500/15 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-blue-500",children:V})]},k.provider)})}),u.jsxs("div",{className:"mt-3 flex items-center gap-2 rounded-md border border-line bg-base px-3 py-1.5",children:[u.jsx(Qa,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),u.jsx("input",{type:"text",value:b,onChange:k=>y(k.target.value),placeholder:"搜索模型…",className:"min-w-0 flex-1 bg-transparent text-xs text-fg placeholder:text-fg-6 focus:outline-none"}),b&&u.jsx("button",{type:"button",onClick:()=>y(""),className:"text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3 w-3"})})]}),u.jsx("div",{className:"mt-3 rounded-lg border border-line bg-base",children:D.length===0?u.jsx("div",{className:"px-3 py-6 text-center text-xs text-fg-5",children:"无匹配模型"}):u.jsx("div",{className:"divide-y divide-line/40",children:D.map(k=>{const z=s.has(k.id),V=R9(k.contextLimit),M=O9(k.cost);return u.jsxs("label",{className:ce("flex cursor-pointer items-center gap-3 px-3 py-2 transition-colors hover:bg-elevated/60",z&&"bg-blue-500/5"),children:[u.jsx("input",{type:"checkbox",checked:z,onChange:()=>void T(k.id),className:"h-3.5 w-3.5 shrink-0 cursor-pointer rounded border-line accent-blue-500"}),u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-fg",children:k.name||k.id}),u.jsxs("span",{className:"flex shrink-0 items-center gap-2",children:[V&&u.jsx("span",{className:"rounded bg-surface px-1.5 py-0.5 text-[10px] text-fg-5",children:V}),M&&u.jsx("span",{className:"text-[10px] text-fg-6",children:M})]})]},k.id)})})})]}):u.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-10 text-fg-5",children:[u.jsx(lc,{className:"h-5 w-5"}),u.jsx("p",{className:"text-xs",children:"请先在左侧选择一个仓库以加载可用模型。"})]})})]})}const M9=["Sisyphus - ultraworker","Prometheus - Plan Builder","Atlas - Plan Executor"];function D9({agent:e,onEdit:t,onDelete:a}){const[s,l]=v.useState(!1),[o,d]=v.useState(!1),f=async()=>{const h=await nx(e.id),x=new Blob([JSON.stringify(h,null,2)],{type:"application/json"}),b=URL.createObjectURL(x),y=document.createElement("a");y.href=b,y.download=`${e.name.replace(/[^a-zA-Z0-9\u4e00-\u9fff_-]/g,"_")}.json`,y.click(),URL.revokeObjectURL(b)},m=async()=>{const h=await nx(e.id);await navigator.clipboard.writeText(JSON.stringify(h,null,2)),d(!0),setTimeout(()=>d(!1),2e3)};return u.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-4 py-3",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm font-medium text-fg",children:e.name}),u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:e.baseAgent}),e.model&&u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:e.model}),e.repoId&&u.jsx("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-400",children:"repo"})]}),e.systemPrompt&&u.jsx("p",{className:"mt-0.5 truncate font-mono text-xs text-fg-5",children:e.systemPrompt})]}),u.jsx("div",{className:"flex items-center gap-1",children:s?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:a,className:"rounded p-1.5 text-red-400 hover:bg-red-500/10",children:u.jsx(oa,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>l(!1),className:"rounded p-1.5 text-fg-4 hover:bg-elevated",children:u.jsx(Tt,{className:"h-4 w-4"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:()=>void f(),title:"导出 JSON 文件",className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:u.jsx(Xv,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>void m(),title:"复制 JSON 到剪贴板",className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:o?u.jsx(oa,{className:"h-4 w-4 text-green-500"}):u.jsx(qv,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:t,className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:u.jsx(LE,{className:"h-4 w-4"})}),u.jsx("button",{type:"button",onClick:()=>l(!0),className:"rounded p-1.5 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:u.jsx(ji,{className:"h-4 w-4"})})]})})]})}const Ls="__system_prompt__";function W1({initial:e,availableFragments:t,onSave:a,onCancel:s}){const l=qe(U=>U.activeRepoId),[o,d]=v.useState((e==null?void 0:e.name)??""),[f,m]=v.useState((e==null?void 0:e.baseAgent)??"Sisyphus - ultraworker"),[h,x]=v.useState((e==null?void 0:e.model)??""),[b,y]=v.useState((e==null?void 0:e.systemPrompt)??""),[T,N]=v.useState(!1),[S,C]=v.useState(!1),[A,D]=v.useState([]);v.useEffect(()=>{if(!l){D([]);return}let U=!1;return(async()=>{try{const[te,ie]=await Promise.all([Uc(),vh(l)]);if(U)return;const Z=te[ch],ee=Z?JSON.parse(Z):[];D(ee.length>0?ie.filter(Q=>ee.includes(Q.id)):[])}catch{U||D([])}})(),()=>{U=!0}},[l]);const[k,z]=v.useState(()=>{const U=(e==null?void 0:e.fragments.map(ee=>ee.id))??[],te=(e==null?void 0:e.systemPromptPosition)??-1,ie=te>=0&&te<=U.length?te:U.length,Z=[...U];return Z.splice(ie,0,Ls),Z}),V=U=>{z(te=>{if(te.includes(U))return te.filter(ee=>ee!==U);const ie=te.indexOf(Ls),Z=[...te];return Z.splice(ie>=0?ie:Z.length,0,U),Z})},M=(U,te)=>{const ie=U+te;ie<0||ie>=k.length||z(Z=>{const ee=[...Z];return[ee[U],ee[ie]]=[ee[ie],ee[U]],ee})},L=k.filter(U=>U!==Ls),K=(()=>{const U=k.indexOf(Ls);return U<0?-1:k.slice(0,U).filter(te=>te!==Ls).length})(),se=k.map(U=>{var te;return U===Ls?b:(te=t.find(ie=>ie.id===U))==null?void 0:te.content}).filter(Boolean).join(`
448
448
 
449
449
  ---
450
450
 
451
- `),B=async()=>{if(!(!o.trim()||!f)){C(!0);try{await a({name:o.trim(),baseAgent:f,model:h.trim()||void 0,systemPrompt:b,systemPromptPosition:K,fragmentIds:L})}finally{C(!1)}}};return u.jsxs("div",{className:"space-y-3 rounded-lg border border-line bg-base p-4",children:[u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("label",{className:"flex-1",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),u.jsx("input",{type:"text",value:o,onChange:U=>d(U.target.value),placeholder:"代码审查员",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("label",{className:"w-36",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Base Agent"}),u.jsx("select",{value:f,onChange:U=>m(U.target.value),className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:I9.map(U=>u.jsx("option",{value:U,children:U},U))})]})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"模型(可选)"}),u.jsxs("select",{value:h,onChange:U=>x(U.target.value),className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 font-mono text-sm text-fg focus:border-blue-500 focus:outline-none",children:[u.jsx("option",{value:"",children:"默认模型"}),A.map(U=>u.jsx("option",{value:U.id,children:U.name||U.id},U.id))]}),A.length===0&&u.jsx("p",{className:"mt-1 text-[11px] text-fg-5",children:"在「模型」Tab 中勾选常用模型后可选择。"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"提示词组合"}),u.jsx("p",{className:"mt-0.5 text-[11px] text-fg-5",children:"拖拽排序片段与补充指令的拼接顺序。"}),u.jsxs("div",{className:"mt-1.5 space-y-1",children:[k.map((U,te)=>{if(U===Ls)return u.jsxs("div",{className:"flex items-center gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2 py-1",children:[u.jsxs("div",{className:"flex flex-col",children:[u.jsx("button",{type:"button",onClick:()=>M(te,-1),disabled:te===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),u.jsx("button",{type:"button",onClick:()=>M(te,1),disabled:te===k.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),u.jsx("span",{className:"flex-1 truncate text-xs font-medium text-amber-400",children:"✎ 补充指令"})]},U);const ie=t.find(Z=>Z.id===U);return ie?u.jsxs("div",{className:"flex items-center gap-2 rounded border border-blue-500/30 bg-blue-500/5 px-2 py-1",children:[u.jsxs("div",{className:"flex flex-col",children:[u.jsx("button",{type:"button",onClick:()=>M(te,-1),disabled:te===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),u.jsx("button",{type:"button",onClick:()=>M(te,1),disabled:te===k.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),u.jsx("span",{className:"flex-1 truncate text-xs text-fg",children:ie.name}),u.jsx("button",{type:"button",onClick:()=>V(U),className:"text-fg-5 hover:text-red-400",children:u.jsx(Tt,{className:"h-3 w-3"})})]},U):null}),t.filter(U=>!L.includes(U.id)).length>0&&u.jsxs("select",{value:"",onChange:U=>{U.target.value&&V(U.target.value)},className:"w-full rounded border border-dashed border-line bg-surface px-2 py-1 text-xs text-fg-4 focus:border-blue-500 focus:outline-none",children:[u.jsx("option",{value:"",children:"+ 添加片段…"}),t.filter(U=>!L.includes(U.id)).map(U=>u.jsx("option",{value:U.id,children:U.name},U.id))]})]})]}),u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"补充指令内容"}),u.jsx("textarea",{value:b,onChange:U=>y(U.target.value),rows:3,placeholder:"agent 级别的补充指令…",className:"mt-1 w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),(L.length>0||b)&&u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>N(!T),className:"flex items-center gap-1 text-xs font-medium text-fg-4 hover:text-fg-3",children:[u.jsx("span",{children:T?"▾":"▸"})," 预览最终提示词"]}),T&&u.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-line bg-elevated px-3 py-2 font-mono text-xs leading-relaxed text-fg-4",children:se||"(空)"})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u.jsx("button",{type:"button",onClick:s,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void B(),disabled:S||!o.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:S?"保存中…":e?"更新":"创建"})]})]})}function D9({fragment:e,onEdit:t,onDelete:a}){const[s,l]=v.useState(!1);return u.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-3 py-2",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"text-xs font-medium text-fg",children:e.name}),e.content&&u.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-fg-5",children:e.content})]}),u.jsx("div",{className:"flex items-center gap-1",children:s?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:a,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:u.jsx(oa,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>l(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:u.jsx(LE,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>l(!0),className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:u.jsx(ji,{className:"h-3.5 w-3.5"})})]})})]})}function J1({initial:e,onSave:t,onCancel:a}){const[s,l]=v.useState((e==null?void 0:e.name)??""),[o,d]=v.useState((e==null?void 0:e.content)??""),[f,m]=v.useState(!1),h=async()=>{if(s.trim()){m(!0);try{await t({name:s.trim(),content:o})}finally{m(!1)}}};return u.jsxs("div",{className:"space-y-2 rounded-lg border border-line bg-base p-3",children:[u.jsx("input",{type:"text",value:s,onChange:x=>l(x.target.value),placeholder:"片段名称",className:"w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),u.jsx("textarea",{value:o,onChange:x=>d(x.target.value),rows:3,placeholder:"提示词内容…",className:"w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:a,className:"rounded-md px-3 py-1 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void h(),disabled:f||!s.trim(),className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-500 disabled:opacity-40",children:f?"保存中…":e?"更新":"创建"})]})]})}function L9({onImported:e,onCancel:t}){const[a,s]=v.useState(""),[l,o]=v.useState(!1),[d,f]=v.useState(null),m=v.useRef(null),h=async b=>{f(null);let y;try{y=JSON.parse(b)}catch{f("JSON 格式无效");return}if(y.type!=="fourth-spark-custom-agent"||!y.agent){f("不是有效的 Custom Agent 导出文件");return}o(!0);try{await w3(y),e()}catch(T){f(T instanceof Error?T.message:String(T))}finally{o(!1)}},x=b=>{var N;const y=(N=b.target.files)==null?void 0:N[0];if(!y)return;const T=new FileReader;T.onload=()=>{const S=T.result;s(S),h(S)},T.readAsText(y)};return u.jsxs("div",{className:"space-y-3 rounded-lg border border-line bg-base p-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"导入 Custom Agent"}),u.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}),u.jsx("input",{ref:m,type:"file",accept:".json",onChange:x,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>{var b;return(b=m.current)==null?void 0:b.click()},className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(BE,{className:"h-3.5 w-3.5"})," 上传 JSON 文件"]}),u.jsx("div",{className:"relative",children:u.jsx("textarea",{value:a,onChange:b=>s(b.target.value),rows:4,placeholder:"或粘贴 JSON 内容…",className:"w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-xs leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})}),d&&u.jsxs("div",{className:"flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsx("span",{children:d})]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:t,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void h(a),disabled:l||!a.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:l?"导入中…":"导入"})]})]})}function j9(){const[e,t]=v.useState([]),[a,s]=v.useState([]),[l,o]=v.useState(!0),[d,f]=v.useState(!1),[m,h]=v.useState(null),[x,b]=v.useState(!1),[y,T]=v.useState(null),[N,S]=v.useState(!1),C=()=>{Promise.all([$E(),O3()]).then(([L,K])=>{t(L),s(K),o(!1)}).catch(()=>o(!1))};v.useEffect(C,[]);const A=async L=>{await GE(L),f(!1),C(),Di.getState().loadAgents()},D=async L=>{m&&(await KE(m.id,L),h(null),C(),Di.getState().loadAgents())},k=async L=>{await VE(L),t(K=>K.filter(se=>se.id!==L)),Di.getState().loadAgents()},z=async L=>{await I3(L),b(!1),C()},V=async L=>{y&&(await M3(y.id,L),T(null),C())},M=async L=>{await D3(L),s(K=>K.filter(se=>se.id!==L))};return l?u.jsx("section",{className:"rounded-xl border border-line bg-surface p-5",children:u.jsx("p",{className:"py-4 text-center font-mono text-xs text-fg-5",children:"加载中…"})}):u.jsxs("div",{className:"space-y-4",children:[u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"提示词片段"}),u.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"可复用的提示词模块,可在多个 Custom Agent 间共享。"}),u.jsxs("div",{className:"mt-3 space-y-1.5",children:[a.map(L=>(y==null?void 0:y.id)===L.id?u.jsx(J1,{initial:L,onSave:V,onCancel:()=>T(null)},L.id):u.jsx(D9,{fragment:L,onEdit:()=>T(L),onDelete:()=>void M(L.id)},L.id)),x?u.jsx(J1,{onSave:z,onCancel:()=>b(!1)}):u.jsxs("button",{type:"button",onClick:()=>b(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(Sr,{className:"h-3.5 w-3.5"})," 添加片段"]})]})]}),u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Custom Agents"}),u.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"组合 base agent + 模型 + 提示词片段 + 补充指令。创建 Session 时选择即可。"}),u.jsxs("div",{className:"mt-3 space-y-2",children:[e.map(L=>(m==null?void 0:m.id)===L.id?u.jsx(W1,{initial:L,availableFragments:a,onSave:D,onCancel:()=>h(null)},L.id):u.jsx(M9,{agent:L,onEdit:()=>h(L),onDelete:()=>void k(L.id)},L.id)),d?u.jsx(W1,{availableFragments:a,onSave:A,onCancel:()=>f(!1)}):N?u.jsx(L9,{onImported:()=>{S(!1),C(),Di.getState().loadAgents()},onCancel:()=>S(!1)}):u.jsxs("div",{className:"flex gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>f(!0),className:"flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(Sr,{className:"h-3.5 w-3.5"})," 添加 Custom Agent"]}),u.jsxs("button",{type:"button",onClick:()=>S(!0),className:"flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(BE,{className:"h-3.5 w-3.5"})," 导入 Agent"]})]})]}),u.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"全局 Agent 对所有仓库可见。支持导出 JSON 分享给其他实例。"})]})]})}function B9(){const[e,t]=v.useState(Ym),[a,s]=v.useState(!1),[l,o]=v.useState(null),[d,f]=v.useState(Ym),m=e!==d,h=async()=>{const b=e.replace(/\/+$/,"");if(b){s(!0),o(null);try{const y=await fetch(`${b}/api/health`,{signal:AbortSignal.timeout(5e3)});o(y.ok?"ok":"fail")}catch{o("fail")}s(!1)}},x=()=>{const b=e.replace(/\/+$/,"");s3(b),f(b),t(b)};return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:u.jsx(UE,{className:"h-4 w-4"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"服务器连接"}),u.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"配置远程 Fourth Spark Server 地址。"})]})]}),u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"服务器地址"}),u.jsx("input",{type:"url",value:e,onChange:b=>{t(b.target.value),o(null)},placeholder:"http://192.168.1.100:3000",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>void h(),disabled:a||!e.trim(),className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated disabled:opacity-40",children:[a?u.jsx(Va,{className:"h-3.5 w-3.5 fs-spin"}):u.jsx(us,{className:"h-3.5 w-3.5"}),"测试连接"]}),u.jsxs("button",{type:"button",onClick:x,disabled:!m,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(Pc,{className:"h-3.5 w-3.5"}),"保存"]}),l==="ok"&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[u.jsx(oa,{className:"h-3.5 w-3.5"})," 连接成功"]}),l==="fail"&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[u.jsx(Kn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),u.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"保存后需重新打开 App 生效。确保手机与开发机在同一局域网。"})]})}function P9(){const[e,t]=v.useState("local"),[a,s]=v.useState(!1);return v.useEffect(()=>{ZE().then(l=>t(l.mode==="worker"?"cloud":"local")).catch(()=>{}).finally(()=>s(!0))},[]),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex gap-1 rounded-lg border border-line bg-base p-1",children:[u.jsxs("button",{type:"button",onClick:()=>t("local"),className:ce("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e==="local"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[u.jsx(Sh,{className:"h-3.5 w-3.5"}),"本地模式"]}),u.jsxs("button",{type:"button",onClick:()=>t("cloud"),className:ce("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e==="cloud"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[u.jsx(IE,{className:"h-3.5 w-3.5"}),"账号池"]})]}),a&&e==="local"&&u.jsx(N9,{}),a&&e==="cloud"&&u.jsx(U9,{})]})}function U9(){const[e,t]=v.useState(""),[a,s]=v.useState(""),[l,o]=v.useState(""),[d,f]=v.useState(""),[m,h]=v.useState(!1),[x,b]=v.useState(null),[y,T]=v.useState(!1),[N,S]=v.useState(null);v.useEffect(()=>{let V=!1;return(async()=>{const[M,L]=await Promise.all([Uc().catch(()=>({})),ZE().catch(()=>null)]);if(V)return;const K=M.cloud_master_url??"",se=M.cloud_worker_id||(L==null?void 0:L.defaultWorkerId)||"";t(K),o(K),s(se),f(M.cloud_worker_id??""),S(L)})(),()=>{V=!0}},[]);const C=e!==l||a!==d,D=((N==null?void 0:N.mode)??(l?"worker":"local"))==="worker",k=async()=>{const V=e.replace(/\/+$/,"");if(!V)return;h(!0),b(null);const M=await J3(V);b(M?"ok":"fail"),h(!1)},z=async()=>{const V=e.replace(/\/+$/,""),M=a.trim();T(!0);try{await $m("cloud_master_url",V),await $m("cloud_worker_id",M),o(V),f(M),t(V),s(M)}finally{T(!1)}};return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:u.jsx(IE,{className:"h-4 w-4"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"账号池配置"}),u.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"连接 claude-accounts-pool Master,共享多账号池。"})]})]}),u.jsxs("div",{className:"mt-4 space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[u.jsx("span",{className:ce("h-2 w-2 shrink-0 rounded-full",D?"bg-blue-500 shadow-sm shadow-blue-500/60":"bg-green-500 shadow-sm shadow-green-500/60")}),u.jsx("span",{className:"text-xs font-medium text-fg-3",children:D?"Worker 模式":"本地模式"}),D&&(N==null?void 0:N.workerId)&&u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:N.workerId}),D&&(N==null?void 0:N.connected)!=null&&u.jsx("span",{className:ce("ml-auto text-[10px] font-medium",N.connected?"text-green-500":"text-red-400"),children:N.connected?"已连接":"未连接"})]}),D&&(N==null?void 0:N.heldAccount)&&u.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[u.jsx(PE,{className:"h-3.5 w-3.5 shrink-0 text-blue-500"}),u.jsx("span",{className:"text-xs text-fg-4",children:"当前账号"}),u.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg",children:N.heldAccount.label}),u.jsx("span",{className:"ml-auto rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:N.heldAccount.id.slice(0,8)})]})]}),u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Master URL"}),u.jsx("input",{type:"url",value:e,onChange:V=>{t(V.target.value),b(null)},placeholder:"http://100.64.0.36:8787",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Worker ID"}),u.jsx("input",{type:"text",value:a,onChange:V=>s(V.target.value),placeholder:"fourth-spark-1",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),u.jsx("span",{className:"mt-1 block text-[11px] text-fg-5",children:"此 Worker 在账号池中的唯一标识,建议用小写字母、数字和连字符。"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>void k(),disabled:m||!e.trim(),className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated disabled:opacity-40",children:[m?u.jsx(Va,{className:"h-3.5 w-3.5 fs-spin"}):u.jsx(us,{className:"h-3.5 w-3.5"}),"测试连接"]}),u.jsxs("button",{type:"button",onClick:()=>void z(),disabled:!C||y,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(Pc,{className:"h-3.5 w-3.5"}),y?"保存中…":"保存"]}),x==="ok"&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[u.jsx(oa,{className:"h-3.5 w-3.5"})," 连接成功"]}),x==="fail"&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[u.jsx(Kn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),u.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"保存后需重启 Server 生效。清空 Master URL 可切回本地模式。"})]})}function H9(){const[e,t]=v.useState("usage"),a=v.useMemo(()=>zE()||Ym()?[...Z1,E9]:Z1,[]);return u.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:u.jsxs("div",{className:"mx-auto max-w-2xl",children:[u.jsx("h1",{className:"text-lg font-semibold text-fg",children:"设置"}),u.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"全局配置"}),u.jsx("div",{className:"mt-6 flex gap-1 rounded-lg border border-line bg-surface p-1",children:a.map(s=>u.jsxs("button",{type:"button",onClick:()=>t(s.id),className:ce("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e===s.id?"bg-base text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[u.jsx(s.icon,{className:"h-3.5 w-3.5"}),s.label]},s.id))}),u.jsxs("div",{className:"mt-4",children:[e==="usage"&&u.jsx(P9,{}),e==="git"&&u.jsx(C9,{}),e==="models"&&u.jsx(O9,{}),e==="custom-agents"&&u.jsx(j9,{}),e==="agents"&&u.jsx(A9,{}),e==="server"&&u.jsx(B9,{})]})]})})}const F9=300,z9=4e3,q9={info:{icon:"ℹ",badge:"bg-fg/10 text-fg-2",bar:"bg-fg-4"},success:{icon:"✓",badge:"bg-emerald-500/10 text-emerald-500",bar:"bg-emerald-500"},warning:{icon:"⚠",badge:"bg-amber-500/10 text-amber-500",bar:"bg-amber-500"},error:{icon:"✕",badge:"bg-red-500/10 text-red-500",bar:"bg-red-500"}};function Y9(){const e=Yt(h=>h.toasts),t=Yt(h=>h.removeToast),a=Le(h=>h.setActiveSession),s=qe(Da),l=va(),o=h=>{t(h.id),h.sessionId&&(a(h.sessionId),l(`/${encodeURIComponent(s)}/run`))},[d,f]=v.useState([]),m=v.useRef(new Map);return v.useEffect(()=>{const h=new Set(e.map(x=>x.id));f(x=>{let b=x.map(y=>h.has(y.id)||y.exiting?y:{...y,exiting:!0});for(const y of e)b.some(T=>T.id===y.id)||(b=[...b,{...y}]);return b})},[e]),v.useEffect(()=>{const h=m.current;for(const x of d)x.exiting&&!h.has(x.id)&&h.set(x.id,setTimeout(()=>{h.delete(x.id),f(b=>b.filter(y=>y.id!==x.id))},F9))},[d]),v.useEffect(()=>{const h=m.current;return()=>h.forEach(clearTimeout)},[]),d.length===0?null:u.jsx("div",{className:"pointer-events-none fixed top-4 right-4 z-50 flex w-[calc(100%-2rem)] max-w-sm flex-col","aria-live":"polite","aria-atomic":"false",children:d.map(h=>{const x=q9[h.variant];return u.jsx("div",{className:"grid w-full transition-[grid-template-rows] duration-300 ease-out",style:{gridTemplateRows:h.exiting?"0fr":"1fr"},children:u.jsx("div",{className:"min-h-0 overflow-hidden",children:u.jsxs("div",{role:"status",onClick:()=>o(h),style:{animation:`${h.exiting?"toast-out":"toast-in"} 0.3s ease-out forwards`},className:"pointer-events-auto relative mb-2 flex cursor-pointer items-start gap-3 overflow-hidden rounded-xl border border-line bg-surface/80 px-3.5 py-3 shadow-lg shadow-black/5 backdrop-blur-md transition-colors hover:border-line-hard hover:bg-surface/90",children:[u.jsx("span",{"aria-hidden":!0,className:`mt-px flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${x.badge}`,children:x.icon}),u.jsx("p",{className:"min-w-0 flex-1 text-sm leading-snug break-words text-fg",children:h.message}),h.persistent&&!h.exiting&&u.jsx("button",{type:"button","aria-label":"关闭",onClick:b=>{b.stopPropagation(),t(h.id)},className:"mt-px flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-fg-4 transition-colors hover:bg-fg/10 hover:text-fg",children:"✕"}),!h.exiting&&!h.persistent&&u.jsx("span",{"aria-hidden":!0,className:`absolute bottom-0 left-0 h-0.5 w-full origin-left ${x.bar}`,style:{animation:`toast-progress ${z9}ms linear forwards`}})]})})},h.id)})})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Fi;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Fi||(Fi={}));class Pm extends Error{constructor(t,a,s){super(t),this.message=t,this.code=a,this.data=s}}const $9=e=>{var t,a;return e!=null&&e.androidBridge?"android":!((a=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||a===void 0)&&a.bridge?"ios":"web"},G9=e=>{const t=e.CapacitorCustomPlatform||null,a=e.Capacitor||{},s=a.Plugins=a.Plugins||{},l=()=>t!==null?t.name:$9(e),o=()=>l()!=="web",d=b=>{const y=h.get(b);return!!(y!=null&&y.platforms.has(l())||f(b))},f=b=>{var y;return(y=a.PluginHeaders)===null||y===void 0?void 0:y.find(T=>T.name===b)},m=b=>e.console.error(b),h=new Map,x=(b,y={})=>{const T=h.get(b);if(T)return console.warn(`Capacitor plugin "${b}" already registered. Cannot register plugins twice.`),T.proxy;const N=l(),S=f(b);let C;const A=async()=>(!C&&N in y?C=typeof y[N]=="function"?C=await y[N]():C=y[N]:t!==null&&!C&&"web"in y&&(C=typeof y.web=="function"?C=await y.web():C=y.web),C),D=(K,se)=>{var B,U;if(S){const te=S==null?void 0:S.methods.find(ie=>se===ie.name);if(te)return te.rtype==="promise"?ie=>a.nativePromise(b,se.toString(),ie):(ie,Z)=>a.nativeCallback(b,se.toString(),ie,Z);if(K)return(B=K[se])===null||B===void 0?void 0:B.bind(K)}else{if(K)return(U=K[se])===null||U===void 0?void 0:U.bind(K);throw new Pm(`"${b}" plugin is not implemented on ${N}`,Fi.Unimplemented)}},k=K=>{let se;const B=(...U)=>{const te=A().then(ie=>{const Z=D(ie,K);if(Z){const ee=Z(...U);return se=ee==null?void 0:ee.remove,ee}else throw new Pm(`"${b}.${K}()" is not implemented on ${N}`,Fi.Unimplemented)});return K==="addListener"&&(te.remove=async()=>se()),te};return B.toString=()=>`${K.toString()}() { [capacitor code] }`,Object.defineProperty(B,"name",{value:K,writable:!1,configurable:!1}),B},z=k("addListener"),V=k("removeListener"),M=(K,se)=>{const B=z({eventName:K},se),U=async()=>{const ie=await B;V({eventName:K,callbackId:ie},se)},te=new Promise(ie=>B.then(()=>ie({remove:U})));return te.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await U()},te},L=new Proxy({},{get(K,se){switch(se){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return S?M:z;case"removeListener":return V;default:return k(se)}}});return s[b]=L,h.set(b,{name:b,proxy:L,platforms:new Set([...Object.keys(y),...S?[N]:[]])}),L};return a.convertFileSrc||(a.convertFileSrc=b=>b),a.getPlatform=l,a.handleError=m,a.isNativePlatform=o,a.isPluginAvailable=d,a.registerPlugin=x,a.Exception=Pm,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a},K9=e=>e.Capacitor=G9(e),dh=K9(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Zc=dh.registerPlugin;class e0{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,a){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(a);const o=this.windowListeners[t];o&&!o.registered&&this.addWindowListener(o),s&&this.sendRetainedArgumentsForEvent(t);const d=async()=>this.removeListener(t,a);return Promise.resolve({remove:d})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,a,s){const l=this.listeners[t];if(!l){if(s){let o=this.retainedEventArguments[t];o||(o=[]),o.push(a),this.retainedEventArguments[t]=o}return}l.forEach(o=>o(a))}hasListeners(t){var a;return!!(!((a=this.listeners[t])===null||a===void 0)&&a.length)}registerWindowListener(t,a){this.windowListeners[a]={registered:!1,windowEventName:t,pluginEventName:a,handler:s=>{this.notifyListeners(a,s)}}}unimplemented(t="not implemented"){return new dh.Exception(t,Fi.Unimplemented)}unavailable(t="not available"){return new dh.Exception(t,Fi.Unavailable)}async removeListener(t,a){const s=this.listeners[t];if(!s)return;const l=s.indexOf(a);this.listeners[t].splice(l,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const a=this.retainedEventArguments[t];a&&(delete this.retainedEventArguments[t],a.forEach(s=>{this.notifyListeners(t,s)}))}}const eE=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),tE=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class V9 extends e0{async getCookies(){const t=document.cookie,a={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[l,o]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");l=tE(l).trim(),o=tE(o).trim(),a[l]=o}),a}async setCookie(t){try{const a=eE(t.key),s=eE(t.value),l=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",o=(t.path||"/").replace("path=",""),d=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${a}=${s||""}${l}; path=${o}; ${d};`}catch(a){return Promise.reject(a)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const a of t)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Zc("CapacitorCookies",{web:()=>new V9});const Q9=async e=>new Promise((t,a)=>{const s=new FileReader;s.onload=()=>{const l=s.result;t(l.indexOf(",")>=0?l.split(",")[1]:l)},s.onerror=l=>a(l),s.readAsDataURL(e)}),X9=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(l=>l.toLocaleLowerCase()).reduce((l,o,d)=>(l[o]=e[t[d]],l),{})},Z9=(e,t=!0)=>e?Object.entries(e).reduce((s,l)=>{const[o,d]=l;let f,m;return Array.isArray(d)?(m="",d.forEach(h=>{f=t?encodeURIComponent(h):h,m+=`${o}=${f}&`}),m.slice(0,-1)):(f=t?encodeURIComponent(d):d,m=`${o}=${f}`),`${s}&${m}`},"").substr(1):null,W9=(e,t={})=>{const a=Object.assign({method:e.method||"GET",headers:e.headers},t),l=X9(e.headers)["content-type"]||"";if(typeof e.data=="string")a.body=e.data;else if(l.includes("application/x-www-form-urlencoded")){const o=new URLSearchParams;for(const[d,f]of Object.entries(e.data||{}))o.set(d,f);a.body=o.toString()}else if(l.includes("multipart/form-data")||e.data instanceof FormData){const o=new FormData;if(e.data instanceof FormData)e.data.forEach((f,m)=>{o.append(m,f)});else for(const f of Object.keys(e.data))o.append(f,e.data[f]);a.body=o;const d=new Headers(a.headers);d.delete("content-type"),a.headers=d}else(l.includes("application/json")||typeof e.data=="object")&&(a.body=JSON.stringify(e.data));return a};class J9 extends e0{async request(t){const a=W9(t,t.webFetchExtra),s=Z9(t.params,t.shouldEncodeUrlParams),l=s?`${t.url}?${s}`:t.url,o=await fetch(l,a),d=o.headers.get("content-type")||"";let{responseType:f="text"}=o.ok?t:{};d.includes("application/json")&&(f="json");let m,h;switch(f){case"arraybuffer":case"blob":h=await o.blob(),m=await Q9(h);break;case"json":m=await o.json();break;case"document":case"text":default:m=await o.text()}const x={};return o.headers.forEach((b,y)=>{x[y]=b}),{data:m,headers:x,status:o.status,url:o.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Zc("CapacitorHttp",{web:()=>new J9});var nE;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(nE||(nE={}));var aE;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(aE||(aE={}));class ej extends e0{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}Zc("SystemBars",{web:()=>new ej});const Jl=Zc("PushNotifications",{});let rE=!1;async function tj(e){!zE()||rE||(rE=!0,(await Jl.requestPermissions()).receive!=="granted")||(Jl.addListener("registration",async a=>{try{await sC(a.value,"ios")}catch{}}),Jl.addListener("registrationError",()=>{}),Jl.addListener("pushNotificationActionPerformed",a=>{const s=a.notification.data,l=s==null?void 0:s.sessionId;if(l){const o=Da(qe.getState());o&&e(`/${encodeURIComponent(o)}/run?session=${l}`)}}),await Jl.register())}function nj(e){const t=e.match(/^\/([^/]+)\/(run|issues|pulls)/);return t?decodeURIComponent(t[1]):null}function aj(){const e=qe(s=>s.repos),a=qe(Da)??(e.length>0?e[0].name:null);return a?u.jsx(Hm,{to:`/${encodeURIComponent(a)}/run`,replace:!0}):u.jsx(Hm,{to:"/repos",replace:!0})}function rj(){const e=va(),t=ca(),a=qe(f=>f.activeRepoId),s=qe(f=>f.repos),l=qe(f=>f.setActiveRepo),o=Le(f=>f.loadSessions),d=Le(f=>f.clearSessions);return v.useEffect(()=>(qe.getState().loadRepos(),tj(e),qm.getState().init()),[e]),v.useEffect(()=>{if(s.length===0)return;const f=nj(t.pathname);if(!f)return;const m=s.find(h=>h.name===f);m&&m.id!==qe.getState().activeRepoId&&l(m.id)},[t.pathname,s,l]),v.useEffect(()=>(a?(d(),Ue.getState().clearIssues(),Gn.getState().clearPulls(),o(),Di.getState().loadAgents(),Ue.getState().loadIssues(),Gn.getState().loadPulls(),Sc.start(a)):(d(),Ue.getState().clearIssues(),Gn.getState().clearPulls()),()=>Sc.stop()),[a,o,d]),u.jsxs(u.Fragment,{children:[u.jsx(MS,{children:u.jsxs(Tr,{element:u.jsx(dC,{}),children:[u.jsx(Tr,{path:"/repos",element:u.jsx(hC,{})}),u.jsx(Tr,{path:"/settings",element:u.jsx(H9,{})}),u.jsx(Tr,{path:"/:repoId/run",element:u.jsx($M,{})}),u.jsx(Tr,{path:"/:repoId/issues",element:u.jsx(d9,{})}),u.jsx(Tr,{path:"/:repoId/pulls",element:u.jsx(b9,{})}),u.jsx(Tr,{path:"/:repoId",element:u.jsx(Hm,{to:"run",replace:!0})}),u.jsx(Tr,{path:"*",element:u.jsx(aj,{})})]})}),u.jsx(Y9,{})]})}function sj(){return u.jsx(rv,{children:u.jsx(rj,{})})}const b_=document.getElementById("root");if(!b_)throw new Error("Root element #root not found in index.html");O2.createRoot(b_).render(u.jsx(v.StrictMode,{children:u.jsx(sj,{})}));
451
+ `),B=async()=>{if(!(!o.trim()||!f)){C(!0);try{await a({name:o.trim(),baseAgent:f,model:h.trim()||void 0,systemPrompt:b,systemPromptPosition:K,fragmentIds:L})}finally{C(!1)}}};return u.jsxs("div",{className:"space-y-3 rounded-lg border border-line bg-base p-4",children:[u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("label",{className:"flex-1",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"名称"}),u.jsx("input",{type:"text",value:o,onChange:U=>d(U.target.value),placeholder:"代码审查员",className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("label",{className:"w-36",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Base Agent"}),u.jsx("select",{value:f,onChange:U=>m(U.target.value),className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg focus:border-blue-500 focus:outline-none",children:M9.map(U=>u.jsx("option",{value:U,children:U},U))})]})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"模型(可选)"}),u.jsxs("select",{value:h,onChange:U=>x(U.target.value),className:"mt-1 w-full rounded-md border border-line bg-surface px-3 py-1.5 font-mono text-sm text-fg focus:border-blue-500 focus:outline-none",children:[u.jsx("option",{value:"",children:"默认模型"}),A.map(U=>u.jsx("option",{value:U.id,children:U.name||U.id},U.id))]}),A.length===0&&u.jsx("p",{className:"mt-1 text-[11px] text-fg-5",children:"在「模型」Tab 中勾选常用模型后可选择。"})]}),u.jsxs("div",{children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"提示词组合"}),u.jsx("p",{className:"mt-0.5 text-[11px] text-fg-5",children:"拖拽排序片段与补充指令的拼接顺序。"}),u.jsxs("div",{className:"mt-1.5 space-y-1",children:[k.map((U,te)=>{if(U===Ls)return u.jsxs("div",{className:"flex items-center gap-2 rounded border border-amber-500/30 bg-amber-500/5 px-2 py-1",children:[u.jsxs("div",{className:"flex flex-col",children:[u.jsx("button",{type:"button",onClick:()=>M(te,-1),disabled:te===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),u.jsx("button",{type:"button",onClick:()=>M(te,1),disabled:te===k.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),u.jsx("span",{className:"flex-1 truncate text-xs font-medium text-amber-400",children:"✎ 补充指令"})]},U);const ie=t.find(Z=>Z.id===U);return ie?u.jsxs("div",{className:"flex items-center gap-2 rounded border border-blue-500/30 bg-blue-500/5 px-2 py-1",children:[u.jsxs("div",{className:"flex flex-col",children:[u.jsx("button",{type:"button",onClick:()=>M(te,-1),disabled:te===0,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▲"}),u.jsx("button",{type:"button",onClick:()=>M(te,1),disabled:te===k.length-1,className:"text-[10px] leading-none text-fg-5 hover:text-fg-2 disabled:opacity-30",children:"▼"})]}),u.jsx("span",{className:"flex-1 truncate text-xs text-fg",children:ie.name}),u.jsx("button",{type:"button",onClick:()=>V(U),className:"text-fg-5 hover:text-red-400",children:u.jsx(Tt,{className:"h-3 w-3"})})]},U):null}),t.filter(U=>!L.includes(U.id)).length>0&&u.jsxs("select",{value:"",onChange:U=>{U.target.value&&V(U.target.value)},className:"w-full rounded border border-dashed border-line bg-surface px-2 py-1 text-xs text-fg-4 focus:border-blue-500 focus:outline-none",children:[u.jsx("option",{value:"",children:"+ 添加片段…"}),t.filter(U=>!L.includes(U.id)).map(U=>u.jsx("option",{value:U.id,children:U.name},U.id))]})]})]}),u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"补充指令内容"}),u.jsx("textarea",{value:b,onChange:U=>y(U.target.value),rows:3,placeholder:"agent 级别的补充指令…",className:"mt-1 w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),(L.length>0||b)&&u.jsxs("div",{children:[u.jsxs("button",{type:"button",onClick:()=>N(!T),className:"flex items-center gap-1 text-xs font-medium text-fg-4 hover:text-fg-3",children:[u.jsx("span",{children:T?"▾":"▸"})," 预览最终提示词"]}),T&&u.jsx("pre",{className:"mt-1 max-h-48 overflow-auto rounded border border-line bg-elevated px-3 py-2 font-mono text-xs leading-relaxed text-fg-4",children:se||"(空)"})]}),u.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u.jsx("button",{type:"button",onClick:s,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void B(),disabled:S||!o.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:S?"保存中…":e?"更新":"创建"})]})]})}function L9({fragment:e,onEdit:t,onDelete:a}){const[s,l]=v.useState(!1);return u.jsxs("div",{className:"group flex items-center gap-3 rounded-lg border border-line bg-base px-3 py-2",children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"text-xs font-medium text-fg",children:e.name}),e.content&&u.jsx("p",{className:"mt-0.5 truncate font-mono text-[11px] text-fg-5",children:e.content})]}),u.jsx("div",{className:"flex items-center gap-1",children:s?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:a,className:"rounded p-1 text-red-400 hover:bg-red-500/10",children:u.jsx(oa,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>l(!1),className:"rounded p-1 text-fg-4 hover:bg-elevated",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-fg-3 group-hover:opacity-100",children:u.jsx(LE,{className:"h-3.5 w-3.5"})}),u.jsx("button",{type:"button",onClick:()=>l(!0),className:"rounded p-1 text-fg-5 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:u.jsx(ji,{className:"h-3.5 w-3.5"})})]})})]})}function J1({initial:e,onSave:t,onCancel:a}){const[s,l]=v.useState((e==null?void 0:e.name)??""),[o,d]=v.useState((e==null?void 0:e.content)??""),[f,m]=v.useState(!1),h=async()=>{if(s.trim()){m(!0);try{await t({name:s.trim(),content:o})}finally{m(!1)}}};return u.jsxs("div",{className:"space-y-2 rounded-lg border border-line bg-base p-3",children:[u.jsx("input",{type:"text",value:s,onChange:x=>l(x.target.value),placeholder:"片段名称",className:"w-full rounded-md border border-line bg-surface px-3 py-1.5 text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),u.jsx("textarea",{value:o,onChange:x=>d(x.target.value),rows:3,placeholder:"提示词内容…",className:"w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:a,className:"rounded-md px-3 py-1 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void h(),disabled:f||!s.trim(),className:"rounded-md bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-500 disabled:opacity-40",children:f?"保存中…":e?"更新":"创建"})]})]})}function j9({onImported:e,onCancel:t}){const[a,s]=v.useState(""),[l,o]=v.useState(!1),[d,f]=v.useState(null),m=v.useRef(null),h=async b=>{f(null);let y;try{y=JSON.parse(b)}catch{f("JSON 格式无效");return}if(y.type!=="fourth-spark-custom-agent"||!y.agent){f("不是有效的 Custom Agent 导出文件");return}o(!0);try{await w3(y),e()}catch(T){f(T instanceof Error?T.message:String(T))}finally{o(!1)}},x=b=>{var N;const y=(N=b.target.files)==null?void 0:N[0];if(!y)return;const T=new FileReader;T.onload=()=>{const S=T.result;s(S),h(S)},T.readAsText(y)};return u.jsxs("div",{className:"space-y-3 rounded-lg border border-line bg-base p-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"导入 Custom Agent"}),u.jsx("button",{type:"button",onClick:t,className:"rounded p-1 text-fg-5 hover:text-fg-3",children:u.jsx(Tt,{className:"h-3.5 w-3.5"})})]}),u.jsx("input",{ref:m,type:"file",accept:".json",onChange:x,className:"hidden"}),u.jsxs("button",{type:"button",onClick:()=>{var b;return(b=m.current)==null?void 0:b.click()},className:"flex w-full items-center justify-center gap-1.5 rounded-md border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(BE,{className:"h-3.5 w-3.5"})," 上传 JSON 文件"]}),u.jsx("div",{className:"relative",children:u.jsx("textarea",{value:a,onChange:b=>s(b.target.value),rows:4,placeholder:"或粘贴 JSON 内容…",className:"w-full resize-y rounded-md border border-line bg-surface px-3 py-2 font-mono text-xs leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})}),d&&u.jsxs("div",{className:"flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[u.jsx(Kn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),u.jsx("span",{children:d})]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx("button",{type:"button",onClick:t,className:"rounded-md px-3 py-1.5 text-xs text-fg-4 hover:bg-elevated",children:"取消"}),u.jsx("button",{type:"button",onClick:()=>void h(a),disabled:l||!a.trim(),className:"rounded-md bg-blue-600 px-4 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:l?"导入中…":"导入"})]})]})}function B9(){const[e,t]=v.useState([]),[a,s]=v.useState([]),[l,o]=v.useState(!0),[d,f]=v.useState(!1),[m,h]=v.useState(null),[x,b]=v.useState(!1),[y,T]=v.useState(null),[N,S]=v.useState(!1),C=()=>{Promise.all([$E(),O3()]).then(([L,K])=>{t(L),s(K),o(!1)}).catch(()=>o(!1))};v.useEffect(C,[]);const A=async L=>{await GE(L),f(!1),C(),Di.getState().loadAgents()},D=async L=>{m&&(await KE(m.id,L),h(null),C(),Di.getState().loadAgents())},k=async L=>{await VE(L),t(K=>K.filter(se=>se.id!==L)),Di.getState().loadAgents()},z=async L=>{await I3(L),b(!1),C()},V=async L=>{y&&(await M3(y.id,L),T(null),C())},M=async L=>{await D3(L),s(K=>K.filter(se=>se.id!==L))};return l?u.jsx("section",{className:"rounded-xl border border-line bg-surface p-5",children:u.jsx("p",{className:"py-4 text-center font-mono text-xs text-fg-5",children:"加载中…"})}):u.jsxs("div",{className:"space-y-4",children:[u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"提示词片段"}),u.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"可复用的提示词模块,可在多个 Custom Agent 间共享。"}),u.jsxs("div",{className:"mt-3 space-y-1.5",children:[a.map(L=>(y==null?void 0:y.id)===L.id?u.jsx(J1,{initial:L,onSave:V,onCancel:()=>T(null)},L.id):u.jsx(L9,{fragment:L,onEdit:()=>T(L),onDelete:()=>void M(L.id)},L.id)),x?u.jsx(J1,{onSave:z,onCancel:()=>b(!1)}):u.jsxs("button",{type:"button",onClick:()=>b(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(Sr,{className:"h-3.5 w-3.5"})," 添加片段"]})]})]}),u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Custom Agents"}),u.jsx("p",{className:"mt-1 text-xs text-fg-4",children:"组合 base agent + 模型 + 提示词片段 + 补充指令。创建 Session 时选择即可。"}),u.jsxs("div",{className:"mt-3 space-y-2",children:[e.map(L=>(m==null?void 0:m.id)===L.id?u.jsx(W1,{initial:L,availableFragments:a,onSave:D,onCancel:()=>h(null)},L.id):u.jsx(D9,{agent:L,onEdit:()=>h(L),onDelete:()=>void k(L.id)},L.id)),d?u.jsx(W1,{availableFragments:a,onSave:A,onCancel:()=>f(!1)}):N?u.jsx(j9,{onImported:()=>{S(!1),C(),Di.getState().loadAgents()},onCancel:()=>S(!1)}):u.jsxs("div",{className:"flex gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>f(!0),className:"flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(Sr,{className:"h-3.5 w-3.5"})," 添加 Custom Agent"]}),u.jsxs("button",{type:"button",onClick:()=>S(!0),className:"flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-dashed border-line py-2.5 text-xs text-fg-4 transition-colors hover:border-fg-5 hover:text-fg-3",children:[u.jsx(BE,{className:"h-3.5 w-3.5"})," 导入 Agent"]})]})]}),u.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"全局 Agent 对所有仓库可见。支持导出 JSON 分享给其他实例。"})]})]})}function P9(){const[e,t]=v.useState(Ym),[a,s]=v.useState(!1),[l,o]=v.useState(null),[d,f]=v.useState(Ym),m=e!==d,h=async()=>{const b=e.replace(/\/+$/,"");if(b){s(!0),o(null);try{const y=await fetch(`${b}/api/health`,{signal:AbortSignal.timeout(5e3)});o(y.ok?"ok":"fail")}catch{o("fail")}s(!1)}},x=()=>{const b=e.replace(/\/+$/,"");s3(b),f(b),t(b)};return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:u.jsx(UE,{className:"h-4 w-4"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"服务器连接"}),u.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"配置远程 Fourth Spark Server 地址。"})]})]}),u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"服务器地址"}),u.jsx("input",{type:"url",value:e,onChange:b=>{t(b.target.value),o(null)},placeholder:"http://192.168.1.100:3000",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>void h(),disabled:a||!e.trim(),className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated disabled:opacity-40",children:[a?u.jsx(Va,{className:"h-3.5 w-3.5 fs-spin"}):u.jsx(us,{className:"h-3.5 w-3.5"}),"测试连接"]}),u.jsxs("button",{type:"button",onClick:x,disabled:!m,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(Pc,{className:"h-3.5 w-3.5"}),"保存"]}),l==="ok"&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[u.jsx(oa,{className:"h-3.5 w-3.5"})," 连接成功"]}),l==="fail"&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[u.jsx(Kn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),u.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"保存后需重新打开 App 生效。确保手机与开发机在同一局域网。"})]})}function U9(){const[e,t]=v.useState("local"),[a,s]=v.useState(!1);return v.useEffect(()=>{ZE().then(l=>t(l.mode==="worker"?"cloud":"local")).catch(()=>{}).finally(()=>s(!0))},[]),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex gap-1 rounded-lg border border-line bg-base p-1",children:[u.jsxs("button",{type:"button",onClick:()=>t("local"),className:ce("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e==="local"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[u.jsx(Sh,{className:"h-3.5 w-3.5"}),"本地模式"]}),u.jsxs("button",{type:"button",onClick:()=>t("cloud"),className:ce("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e==="cloud"?"bg-surface text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[u.jsx(IE,{className:"h-3.5 w-3.5"}),"账号池"]})]}),a&&e==="local"&&u.jsx(S9,{}),a&&e==="cloud"&&u.jsx(H9,{})]})}function H9(){const[e,t]=v.useState(""),[a,s]=v.useState(""),[l,o]=v.useState(""),[d,f]=v.useState(""),[m,h]=v.useState(!1),[x,b]=v.useState(null),[y,T]=v.useState(!1),[N,S]=v.useState(null);v.useEffect(()=>{let V=!1;return(async()=>{const[M,L]=await Promise.all([Uc().catch(()=>({})),ZE().catch(()=>null)]);if(V)return;const K=M.cloud_master_url??"",se=M.cloud_worker_id||(L==null?void 0:L.defaultWorkerId)||"";t(K),o(K),s(se),f(M.cloud_worker_id??""),S(L)})(),()=>{V=!0}},[]);const C=e!==l||a!==d,D=((N==null?void 0:N.mode)??(l?"worker":"local"))==="worker",k=async()=>{const V=e.replace(/\/+$/,"");if(!V)return;h(!0),b(null);const M=await eC(V);b(M?"ok":"fail"),h(!1)},z=async()=>{const V=e.replace(/\/+$/,""),M=a.trim();T(!0);try{await $m("cloud_master_url",V),await $m("cloud_worker_id",M),o(V),f(M),t(V),s(M);const L=await J3().catch(()=>null);L&&S(L)}finally{T(!1)}};return u.jsxs("section",{className:"rounded-xl border border-line bg-surface p-5",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[u.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-500",children:u.jsx(IE,{className:"h-4 w-4"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"text-sm font-semibold text-fg",children:"账号池配置"}),u.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"连接 claude-accounts-pool Master,共享多账号池。"})]})]}),u.jsxs("div",{className:"mt-4 space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[u.jsx("span",{className:ce("h-2 w-2 shrink-0 rounded-full",D?"bg-blue-500 shadow-sm shadow-blue-500/60":"bg-green-500 shadow-sm shadow-green-500/60")}),u.jsx("span",{className:"text-xs font-medium text-fg-3",children:D?"Worker 模式":"本地模式"}),D&&(N==null?void 0:N.workerId)&&u.jsx("span",{className:"rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-4",children:N.workerId}),D&&(N==null?void 0:N.connected)!=null&&u.jsx("span",{className:ce("ml-auto text-[10px] font-medium",N.connected?"text-green-500":"text-red-400"),children:N.connected?"已连接":"未连接"})]}),D&&(N==null?void 0:N.heldAccount)&&u.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-line bg-base px-3 py-2",children:[u.jsx(PE,{className:"h-3.5 w-3.5 shrink-0 text-blue-500"}),u.jsx("span",{className:"text-xs text-fg-4",children:"当前账号"}),u.jsx("span",{className:"min-w-0 truncate text-xs font-medium text-fg",children:N.heldAccount.label}),u.jsx("span",{className:"ml-auto rounded bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-fg-5",children:N.heldAccount.id.slice(0,8)})]})]}),u.jsxs("div",{className:"mt-4 space-y-3",children:[u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Master URL"}),u.jsx("input",{type:"url",value:e,onChange:V=>{t(V.target.value),b(null)},placeholder:"http://100.64.0.36:8787",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"})]}),u.jsxs("label",{className:"block",children:[u.jsx("span",{className:"text-xs font-medium text-fg-3",children:"Worker ID"}),u.jsx("input",{type:"text",value:a,onChange:V=>s(V.target.value),placeholder:"fourth-spark-1",className:"mt-1 w-full rounded-md border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none"}),u.jsx("span",{className:"mt-1 block text-[11px] text-fg-5",children:"此 Worker 在账号池中的唯一标识,建议用小写字母、数字和连字符。"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{type:"button",onClick:()=>void k(),disabled:m||!e.trim(),className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs font-medium text-fg-3 transition-colors hover:bg-elevated disabled:opacity-40",children:[m?u.jsx(Va,{className:"h-3.5 w-3.5 fs-spin"}):u.jsx(us,{className:"h-3.5 w-3.5"}),"测试连接"]}),u.jsxs("button",{type:"button",onClick:()=>void z(),disabled:!C||y,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[u.jsx(Pc,{className:"h-3.5 w-3.5"}),y?"保存中…":"保存"]}),x==="ok"&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-500",children:[u.jsx(oa,{className:"h-3.5 w-3.5"})," 连接成功"]}),x==="fail"&&u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-red-400",children:[u.jsx(Kn,{className:"h-3.5 w-3.5"})," 连接失败"]})]})]}),u.jsx("p",{className:"mt-4 text-[11px] text-fg-5",children:"清空 Master URL 可切回本地模式。"})]})}function F9(){const[e,t]=v.useState("usage"),a=v.useMemo(()=>zE()||Ym()?[...Z1,y9]:Z1,[]);return u.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:u.jsxs("div",{className:"mx-auto max-w-2xl",children:[u.jsx("h1",{className:"text-lg font-semibold text-fg",children:"设置"}),u.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"全局配置"}),u.jsx("div",{className:"mt-6 flex gap-1 rounded-lg border border-line bg-surface p-1",children:a.map(s=>u.jsxs("button",{type:"button",onClick:()=>t(s.id),className:ce("flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e===s.id?"bg-base text-fg shadow-sm":"text-fg-4 hover:text-fg-3"),children:[u.jsx(s.icon,{className:"h-3.5 w-3.5"}),s.label]},s.id))}),u.jsxs("div",{className:"mt-4",children:[e==="usage"&&u.jsx(U9,{}),e==="git"&&u.jsx(w9,{}),e==="models"&&u.jsx(I9,{}),e==="custom-agents"&&u.jsx(B9,{}),e==="agents"&&u.jsx(C9,{}),e==="server"&&u.jsx(P9,{})]})]})})}const z9=300,q9=4e3,Y9={info:{icon:"ℹ",badge:"bg-fg/10 text-fg-2",bar:"bg-fg-4"},success:{icon:"✓",badge:"bg-emerald-500/10 text-emerald-500",bar:"bg-emerald-500"},warning:{icon:"⚠",badge:"bg-amber-500/10 text-amber-500",bar:"bg-amber-500"},error:{icon:"✕",badge:"bg-red-500/10 text-red-500",bar:"bg-red-500"}};function $9(){const e=Yt(h=>h.toasts),t=Yt(h=>h.removeToast),a=Le(h=>h.setActiveSession),s=qe(Da),l=va(),o=h=>{t(h.id),h.sessionId&&(a(h.sessionId),l(`/${encodeURIComponent(s)}/run`))},[d,f]=v.useState([]),m=v.useRef(new Map);return v.useEffect(()=>{const h=new Set(e.map(x=>x.id));f(x=>{let b=x.map(y=>h.has(y.id)||y.exiting?y:{...y,exiting:!0});for(const y of e)b.some(T=>T.id===y.id)||(b=[...b,{...y}]);return b})},[e]),v.useEffect(()=>{const h=m.current;for(const x of d)x.exiting&&!h.has(x.id)&&h.set(x.id,setTimeout(()=>{h.delete(x.id),f(b=>b.filter(y=>y.id!==x.id))},z9))},[d]),v.useEffect(()=>{const h=m.current;return()=>h.forEach(clearTimeout)},[]),d.length===0?null:u.jsx("div",{className:"pointer-events-none fixed top-4 right-4 z-50 flex w-[calc(100%-2rem)] max-w-sm flex-col","aria-live":"polite","aria-atomic":"false",children:d.map(h=>{const x=Y9[h.variant];return u.jsx("div",{className:"grid w-full transition-[grid-template-rows] duration-300 ease-out",style:{gridTemplateRows:h.exiting?"0fr":"1fr"},children:u.jsx("div",{className:"min-h-0 overflow-hidden",children:u.jsxs("div",{role:"status",onClick:()=>o(h),style:{animation:`${h.exiting?"toast-out":"toast-in"} 0.3s ease-out forwards`},className:"pointer-events-auto relative mb-2 flex cursor-pointer items-start gap-3 overflow-hidden rounded-xl border border-line bg-surface/80 px-3.5 py-3 shadow-lg shadow-black/5 backdrop-blur-md transition-colors hover:border-line-hard hover:bg-surface/90",children:[u.jsx("span",{"aria-hidden":!0,className:`mt-px flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${x.badge}`,children:x.icon}),u.jsx("p",{className:"min-w-0 flex-1 text-sm leading-snug break-words text-fg",children:h.message}),h.persistent&&!h.exiting&&u.jsx("button",{type:"button","aria-label":"关闭",onClick:b=>{b.stopPropagation(),t(h.id)},className:"mt-px flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-fg-4 transition-colors hover:bg-fg/10 hover:text-fg",children:"✕"}),!h.exiting&&!h.persistent&&u.jsx("span",{"aria-hidden":!0,className:`absolute bottom-0 left-0 h-0.5 w-full origin-left ${x.bar}`,style:{animation:`toast-progress ${q9}ms linear forwards`}})]})})},h.id)})})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Fi;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Fi||(Fi={}));class Pm extends Error{constructor(t,a,s){super(t),this.message=t,this.code=a,this.data=s}}const G9=e=>{var t,a;return e!=null&&e.androidBridge?"android":!((a=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||a===void 0)&&a.bridge?"ios":"web"},K9=e=>{const t=e.CapacitorCustomPlatform||null,a=e.Capacitor||{},s=a.Plugins=a.Plugins||{},l=()=>t!==null?t.name:G9(e),o=()=>l()!=="web",d=b=>{const y=h.get(b);return!!(y!=null&&y.platforms.has(l())||f(b))},f=b=>{var y;return(y=a.PluginHeaders)===null||y===void 0?void 0:y.find(T=>T.name===b)},m=b=>e.console.error(b),h=new Map,x=(b,y={})=>{const T=h.get(b);if(T)return console.warn(`Capacitor plugin "${b}" already registered. Cannot register plugins twice.`),T.proxy;const N=l(),S=f(b);let C;const A=async()=>(!C&&N in y?C=typeof y[N]=="function"?C=await y[N]():C=y[N]:t!==null&&!C&&"web"in y&&(C=typeof y.web=="function"?C=await y.web():C=y.web),C),D=(K,se)=>{var B,U;if(S){const te=S==null?void 0:S.methods.find(ie=>se===ie.name);if(te)return te.rtype==="promise"?ie=>a.nativePromise(b,se.toString(),ie):(ie,Z)=>a.nativeCallback(b,se.toString(),ie,Z);if(K)return(B=K[se])===null||B===void 0?void 0:B.bind(K)}else{if(K)return(U=K[se])===null||U===void 0?void 0:U.bind(K);throw new Pm(`"${b}" plugin is not implemented on ${N}`,Fi.Unimplemented)}},k=K=>{let se;const B=(...U)=>{const te=A().then(ie=>{const Z=D(ie,K);if(Z){const ee=Z(...U);return se=ee==null?void 0:ee.remove,ee}else throw new Pm(`"${b}.${K}()" is not implemented on ${N}`,Fi.Unimplemented)});return K==="addListener"&&(te.remove=async()=>se()),te};return B.toString=()=>`${K.toString()}() { [capacitor code] }`,Object.defineProperty(B,"name",{value:K,writable:!1,configurable:!1}),B},z=k("addListener"),V=k("removeListener"),M=(K,se)=>{const B=z({eventName:K},se),U=async()=>{const ie=await B;V({eventName:K,callbackId:ie},se)},te=new Promise(ie=>B.then(()=>ie({remove:U})));return te.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await U()},te},L=new Proxy({},{get(K,se){switch(se){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return S?M:z;case"removeListener":return V;default:return k(se)}}});return s[b]=L,h.set(b,{name:b,proxy:L,platforms:new Set([...Object.keys(y),...S?[N]:[]])}),L};return a.convertFileSrc||(a.convertFileSrc=b=>b),a.getPlatform=l,a.handleError=m,a.isNativePlatform=o,a.isPluginAvailable=d,a.registerPlugin=x,a.Exception=Pm,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a},V9=e=>e.Capacitor=K9(e),dh=V9(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Zc=dh.registerPlugin;class e0{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,a){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(a);const o=this.windowListeners[t];o&&!o.registered&&this.addWindowListener(o),s&&this.sendRetainedArgumentsForEvent(t);const d=async()=>this.removeListener(t,a);return Promise.resolve({remove:d})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,a,s){const l=this.listeners[t];if(!l){if(s){let o=this.retainedEventArguments[t];o||(o=[]),o.push(a),this.retainedEventArguments[t]=o}return}l.forEach(o=>o(a))}hasListeners(t){var a;return!!(!((a=this.listeners[t])===null||a===void 0)&&a.length)}registerWindowListener(t,a){this.windowListeners[a]={registered:!1,windowEventName:t,pluginEventName:a,handler:s=>{this.notifyListeners(a,s)}}}unimplemented(t="not implemented"){return new dh.Exception(t,Fi.Unimplemented)}unavailable(t="not available"){return new dh.Exception(t,Fi.Unavailable)}async removeListener(t,a){const s=this.listeners[t];if(!s)return;const l=s.indexOf(a);this.listeners[t].splice(l,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const a=this.retainedEventArguments[t];a&&(delete this.retainedEventArguments[t],a.forEach(s=>{this.notifyListeners(t,s)}))}}const eE=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),tE=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Q9 extends e0{async getCookies(){const t=document.cookie,a={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[l,o]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");l=tE(l).trim(),o=tE(o).trim(),a[l]=o}),a}async setCookie(t){try{const a=eE(t.key),s=eE(t.value),l=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",o=(t.path||"/").replace("path=",""),d=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${a}=${s||""}${l}; path=${o}; ${d};`}catch(a){return Promise.reject(a)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(a){return Promise.reject(a)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const a of t)document.cookie=a.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Zc("CapacitorCookies",{web:()=>new Q9});const X9=async e=>new Promise((t,a)=>{const s=new FileReader;s.onload=()=>{const l=s.result;t(l.indexOf(",")>=0?l.split(",")[1]:l)},s.onerror=l=>a(l),s.readAsDataURL(e)}),Z9=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(l=>l.toLocaleLowerCase()).reduce((l,o,d)=>(l[o]=e[t[d]],l),{})},W9=(e,t=!0)=>e?Object.entries(e).reduce((s,l)=>{const[o,d]=l;let f,m;return Array.isArray(d)?(m="",d.forEach(h=>{f=t?encodeURIComponent(h):h,m+=`${o}=${f}&`}),m.slice(0,-1)):(f=t?encodeURIComponent(d):d,m=`${o}=${f}`),`${s}&${m}`},"").substr(1):null,J9=(e,t={})=>{const a=Object.assign({method:e.method||"GET",headers:e.headers},t),l=Z9(e.headers)["content-type"]||"";if(typeof e.data=="string")a.body=e.data;else if(l.includes("application/x-www-form-urlencoded")){const o=new URLSearchParams;for(const[d,f]of Object.entries(e.data||{}))o.set(d,f);a.body=o.toString()}else if(l.includes("multipart/form-data")||e.data instanceof FormData){const o=new FormData;if(e.data instanceof FormData)e.data.forEach((f,m)=>{o.append(m,f)});else for(const f of Object.keys(e.data))o.append(f,e.data[f]);a.body=o;const d=new Headers(a.headers);d.delete("content-type"),a.headers=d}else(l.includes("application/json")||typeof e.data=="object")&&(a.body=JSON.stringify(e.data));return a};class ej extends e0{async request(t){const a=J9(t,t.webFetchExtra),s=W9(t.params,t.shouldEncodeUrlParams),l=s?`${t.url}?${s}`:t.url,o=await fetch(l,a),d=o.headers.get("content-type")||"";let{responseType:f="text"}=o.ok?t:{};d.includes("application/json")&&(f="json");let m,h;switch(f){case"arraybuffer":case"blob":h=await o.blob(),m=await X9(h);break;case"json":m=await o.json();break;case"document":case"text":default:m=await o.text()}const x={};return o.headers.forEach((b,y)=>{x[y]=b}),{data:m,headers:x,status:o.status,url:o.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Zc("CapacitorHttp",{web:()=>new ej});var nE;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(nE||(nE={}));var aE;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(aE||(aE={}));class tj extends e0{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}Zc("SystemBars",{web:()=>new tj});const Jl=Zc("PushNotifications",{});let rE=!1;async function nj(e){!zE()||rE||(rE=!0,(await Jl.requestPermissions()).receive!=="granted")||(Jl.addListener("registration",async a=>{try{await iC(a.value,"ios")}catch{}}),Jl.addListener("registrationError",()=>{}),Jl.addListener("pushNotificationActionPerformed",a=>{const s=a.notification.data,l=s==null?void 0:s.sessionId;if(l){const o=Da(qe.getState());o&&e(`/${encodeURIComponent(o)}/run?session=${l}`)}}),await Jl.register())}function aj(e){const t=e.match(/^\/([^/]+)\/(run|issues|pulls)/);return t?decodeURIComponent(t[1]):null}function rj(){const e=qe(s=>s.repos),a=qe(Da)??(e.length>0?e[0].name:null);return a?u.jsx(Hm,{to:`/${encodeURIComponent(a)}/run`,replace:!0}):u.jsx(Hm,{to:"/repos",replace:!0})}function sj(){const e=va(),t=ca(),a=qe(f=>f.activeRepoId),s=qe(f=>f.repos),l=qe(f=>f.setActiveRepo),o=Le(f=>f.loadSessions),d=Le(f=>f.clearSessions);return v.useEffect(()=>(qe.getState().loadRepos(),nj(e),qm.getState().init()),[e]),v.useEffect(()=>{if(s.length===0)return;const f=aj(t.pathname);if(!f)return;const m=s.find(h=>h.name===f);m&&m.id!==qe.getState().activeRepoId&&l(m.id)},[t.pathname,s,l]),v.useEffect(()=>(a?(d(),Ue.getState().clearIssues(),Gn.getState().clearPulls(),o(),Di.getState().loadAgents(),Ue.getState().loadIssues(),Gn.getState().loadPulls(),Sc.start(a)):(d(),Ue.getState().clearIssues(),Gn.getState().clearPulls()),()=>Sc.stop()),[a,o,d]),u.jsxs(u.Fragment,{children:[u.jsx(MS,{children:u.jsxs(Tr,{element:u.jsx(fC,{}),children:[u.jsx(Tr,{path:"/repos",element:u.jsx(pC,{})}),u.jsx(Tr,{path:"/settings",element:u.jsx(F9,{})}),u.jsx(Tr,{path:"/:repoId/run",element:u.jsx(GM,{})}),u.jsx(Tr,{path:"/:repoId/issues",element:u.jsx(f9,{})}),u.jsx(Tr,{path:"/:repoId/pulls",element:u.jsx(x9,{})}),u.jsx(Tr,{path:"/:repoId",element:u.jsx(Hm,{to:"run",replace:!0})}),u.jsx(Tr,{path:"*",element:u.jsx(rj,{})})]})}),u.jsx($9,{})]})}function ij(){return u.jsx(rv,{children:u.jsx(sj,{})})}const b_=document.getElementById("root");if(!b_)throw new Error("Root element #root not found in index.html");O2.createRoot(b_).render(u.jsx(v.StrictMode,{children:u.jsx(ij,{})}));