tmex-cli 0.6.7 → 0.7.0

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.
@@ -0,0 +1,68 @@
1
+ import{c as Le,a as Ki,p as Zi,t as Ce,g as Et,b as el,d as tl,K as nl,e as rl,A as il,f as ll,h as ol,i as sl,j as al,k as ul,l as cl,m as fl,n as hl,o as pl,q as dl,r as ml,s as gl,u as _r,v as k,w as ne,x as me,y as ge,C as jr,z as zr,B as Dr,L as Lr,D as Fr,E as Yt,F as Xt,X as Ln,G as pe,H as xl,M as yl,I as kl,J as bl,N as wl,O as Sl,P as Fn,Q as Cl,T as El,R as Rn,S as Tl,U as vl,V as Al,W as Il,Y as Nl,Z as Pl,_ as _l,$ as jl,a0 as zl,a1 as Dl,a2 as Ll,a3 as Fl,a4 as Rl,a5 as Ml,a6 as Ol,a7 as Bl,a8 as $l,a9 as Hl,aa as ql,ab as Ul,ac as Mn,ad as Vl,ae as Wl,af as Gl,ag as Yl}from"./index-BhWcb9L_.js";import{K as Xl}from"./keyboard-B6P8isCn.js";import{S as Ql}from"./send-XA81w52-.js";/**
2
+ * @license lucide-react v0.564.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Jl=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Kl=Le("arrow-down",Jl);/**
7
+ * @license lucide-react v0.564.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Zl=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],eo=Le("brain",Zl);/**
12
+ * @license lucide-react v0.564.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const to=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],no=Le("chevrons-up-down",to);/**
17
+ * @license lucide-react v0.564.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const ro=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],io=Le("search",ro);/**
22
+ * @license lucide-react v0.564.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const lo=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],oo=Le("square",lo);/**
27
+ * @license lucide-react v0.564.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const so=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ao=Le("terminal",so);/**
32
+ * @license lucide-react v0.564.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const uo=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],co=Le("wrench",uo);function it(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function Ue(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rr(e){if(Ue(e)&&typeof e.type=="string")switch(e.type){case"text":case"json":if("value"in e)return{value:e.value,isError:!1,denied:!1};break;case"error-text":case"error-json":if("value"in e)return{value:e.value,isError:!0,denied:!1};break;case"execution-denied":return{value:typeof e.reason=="string"?e.reason:void 0,isError:!1,denied:!0}}return{value:e,isError:!1,denied:!1}}function Mr(e){return typeof e=="string"?e:Array.isArray(e)?e.map(n=>Ue(n)&&typeof n.text=="string"?n.text:"").filter(Boolean).join(`
37
+ `):""}function fo(e){const n=[],t=new Map;for(const r of e){const i=Ue(r.content)?r.content:null;if(!i)continue;const o=i.content;switch(r.role){case"user":{const l=Mr(o);l&&n.push({kind:"user",key:`m${r.seq}`,text:l});break}case"assistant":{if(typeof o=="string"){o&&n.push({kind:"assistant-text",key:`m${r.seq}`,text:o,streaming:!1});break}if(!Array.isArray(o))break;o.forEach((l,s)=>{if(!Ue(l))return;const a=`m${r.seq}p${s}`;if(l.type==="text"&&typeof l.text=="string"&&l.text){n.push({kind:"assistant-text",key:a,text:l.text,streaming:!1});return}if(l.type==="reasoning"&&typeof l.text=="string"&&l.text){n.push({kind:"reasoning",key:a,text:l.text,streaming:!1});return}if(l.type==="tool-call"&&typeof l.toolCallId=="string"){const u={toolCallId:l.toolCallId,toolName:typeof l.toolName=="string"?l.toolName:"unknown",input:l.input,isError:!1,denied:!1,resolved:!1};t.set(u.toolCallId,u),n.push({kind:"tool-call",key:a,call:u})}});break}case"tool":{if(!Array.isArray(o))break;for(const l of o){if(!Ue(l)||l.type!=="tool-result")continue;const s=typeof l.toolCallId=="string"?l.toolCallId:"",a=t.get(s),{value:u,isError:f,denied:c}=Rr(l.output);a&&(a.output=u,a.isError=f,a.denied=c,a.resolved=!0)}break}}}return{blocks:n,toolBlocksById:t}}function ho(e,n){const{blocks:t,toolBlocksById:r}=fo(e??[]);if(!n)return t;for(const i of n.toolCalls){const o=r.get(i.toolCallId);if(o){!o.resolved&&i.resolved&&(o.output=i.output,o.isError=i.isError,o.denied=i.denied,o.resolved=!0);continue}t.push({kind:"tool-call",key:`live-tool-${i.toolCallId}`,call:i})}for(const i of n.reasonings)i.text&&t.push({kind:"reasoning",key:`live-reasoning-${i.messageId}`,text:i.text,streaming:!0});for(const i of n.texts)i.text&&t.push({kind:"assistant-text",key:`live-text-${i.messageId}`,text:i.text,streaming:!0});return t}function Qt(e){return!e||e.length===0?-1:e[e.length-1].seq}function po(e){if(!e)return null;for(let n=e.length-1;n>=0;n--){const t=e[n];if(t.role!=="user")continue;const r=Ue(t.content)?t.content:null,i=r?Mr(r.content):"";if(i)return i}return null}async function he(e,n){try{return(await e.json()).error??n}catch{return n}}function Ke(e){return Object.values(e).filter(n=>!!n).sort((n,t)=>n.updatedAt<t.updatedAt?1:-1).map(n=>n.id)}function On(e,n){if(!e||e.length===0)return[...n].sort((r,i)=>r.seq-i.seq);const t=new Map;for(const r of e)t.set(r.seq,r);for(const r of n)t.set(r.seq,r);return[...t.values()].sort((r,i)=>r.seq-i.seq)}let Bn=!1;const He=new Set,mo=40,_e=new Map;let Ze=null;const go=120,lt=new Map,Pt=new Set,Jt=new Set;function xo(e){const n=lt.get(e);n&&(clearTimeout(n),lt.delete(e)),_e.delete(e),Jt.delete(e)}function Kt(e){const n=tl(e);Et().send(n.kind,n.payload)}function yo(e){const n=el(e);Et().send(n.kind,n.payload)}function $n(e,n,t,r){let i=_e.get(e);i||(i={texts:new Map,reasonings:new Map},_e.set(e,i));const o=i[n];o.set(t,(o.get(t)??"")+r)}function ko(e){const n=()=>{if(Ze&&(clearTimeout(Ze),Ze=null),_e.size===0)return;const r=new Map(_e);_e.clear(),e(i=>{const o={...i.inProgress};for(const[l,s]of r){const a=o[l]??it(),u={...a,texts:[...a.texts],reasonings:[...a.reasonings]};for(const f of["texts","reasonings"])for(const[c,p]of s[f]){const h=u[f],d=h.findIndex(g=>g.messageId===c);d>=0?h[d]={...h[d],text:h[d].text+p}:h.push({messageId:c,text:p,stale:!1})}o[l]=u}return{inProgress:o}})};return{flush:n,schedule:()=>{Ze||(Ze=setTimeout(n,mo))}}}function bo(e,n){if(Bn)return;Bn=!0;const t=Et(),r=ko(e),i=d=>{lt.get(d)||lt.set(d,setTimeout(()=>{lt.delete(d),n().loadHistory(d)},go))},o=(d,g)=>{_e.delete(d),e(y=>{const C=y.sessions[d],w=it();return g.inProgressText&&w.texts.push({messageId:"__sync__",text:g.inProgressText,stale:!1}),g.inProgressReasoning&&w.reasonings.push({messageId:"__sync_reasoning__",text:g.inProgressReasoning,stale:!1}),{sessions:C?{...y.sessions,[d]:{...C,status:g.status,lastError:g.lastError}}:y.sessions,inProgress:{...y.inProgress,[d]:w},pendingConfirmations:{...y.pendingConfirmations,[d]:g.pendingConfirmations.map(_=>({id:_.confirmationId,toolCallId:_.toolCallId,toolName:_.toolName,input:_.input,createdAt:_.createdAt}))}}});const b=n();(g.lastMessageSeq>Qt(b.messages[d])||!b.historyLoaded[d])&&b.loadHistory(d)},l=(d,g)=>{const b=!!n().sessions[d];if(e(y=>{const C=y.sessions[d];return C?{sessions:{...y.sessions,[d]:{...C,status:g.status,lastError:g.lastError!==void 0?g.lastError:C.lastError}}}:y}),!b){n().loadSessions();return}n().refreshSession(d)},s=(d,g)=>{r.flush(),e(b=>{const y=b.inProgress[d]??it(),C=[...y.toolCalls],w=C.findIndex(z=>z.toolCallId===g.toolCallId),_={toolCallId:g.toolCallId,toolName:g.toolName,input:g.input,isError:!1,denied:!1,resolved:!1,stale:!1};return w>=0?C[w]={...C[w],..._}:C.push(_),{inProgress:{...b.inProgress,[d]:{...y,toolCalls:C}}}})},a=(d,g)=>{r.flush();const{value:b,isError:y,denied:C}=Rr(g.output);e(w=>{const _=w.inProgress[d]??it(),z=[..._.toolCalls],E=z.findIndex(M=>M.toolCallId===g.toolCallId);return E>=0?z[E]={...z[E],output:b,isError:!!g.isError||y,denied:C,resolved:!0}:z.push({toolCallId:g.toolCallId,toolName:g.toolName,input:void 0,output:b,isError:!!g.isError||y,denied:C,resolved:!0,stale:_.staleBarrier}),{inProgress:{...w.inProgress,[d]:{..._,toolCalls:z}}}})},u=(d,g)=>{e(b=>{const y=b.pendingConfirmations[d]??[];return y.some(C=>C.id===g.confirmationId)?b:{pendingConfirmations:{...b.pendingConfirmations,[d]:[...y,{id:g.confirmationId,toolCallId:g.toolCallId,toolName:g.toolName,input:g.input,createdAt:new Date().toISOString()}]}}})},f=(d,g)=>{e(b=>{const y=b.pendingConfirmations[d];return!y||!y.some(C=>C.id===g.confirmationId)?b:{pendingConfirmations:{...b.pendingConfirmations,[d]:y.filter(C=>C.id!==g.confirmationId)}}})},c=(d,g)=>{r.flush(),(g.role==="assistant"||g.role==="tool")&&e(b=>{const y=b.inProgress[d];return y?{inProgress:{...b.inProgress,[d]:{texts:y.texts.map(C=>({...C,stale:!0})),reasonings:y.reasonings.map(C=>({...C,stale:!0})),toolCalls:y.toolCalls.map(C=>C.resolved?{...C,stale:!0}:C),staleBarrier:!0}}}:b}),i(d)},p=(d,g)=>{r.flush(),e(b=>{const y=b.sessions[d];return{sessions:y?{...b.sessions,[d]:{...y,status:g.sessionStatus}}:b.sessions,inProgress:{...b.inProgress,[d]:it()}}}),g.lastMessageSeq>Qt(n().messages[d])&&i(d)},h=(d,g)=>{const b=n().sessions[d];Ce.error(gl.t("agent.toast.errorTitle",{title:(b==null?void 0:b.title)??"Agent"}),{description:g.message})};t.onMessage(d=>{if(d.kind!==nl)return;let g;try{g=rl(il,d.payload)}catch(C){console.error("[agent] failed to decode AGENT_EVENT:",C);return}let b;try{b=JSON.parse(new TextDecoder().decode(g.payload))}catch(C){console.error("[agent] failed to parse AGENT_EVENT payload:",C);return}const y=g.sessionId;switch(g.eventType){case ml:o(y,b);return;case dl:l(y,b);return;case pl:{const C=b;$n(y,"texts",C.messageId,C.delta),r.schedule();return}case hl:{const C=b;$n(y,"reasonings",C.messageId,C.delta),r.schedule();return}case fl:s(y,b);return;case cl:a(y,b);return;case ul:u(y,b);return;case al:f(y,b);return;case sl:c(y,b);return;case ol:h(y,b);return;case ll:p(y,b);return;default:return}}),t.onStateChange(d=>{if(d!=="READY")return;for(const b of He)Kt(b);const g=n().activeSessionId;g&&n().loadHistory(g)})}const Y=Ki()(Zi((e,n)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,showAllSessions:!1,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},sending:{},ensureInitialized(){bo(e,n),Et().connect();const t=n().activeSessionId;t&&!He.has(t)&&(He.add(t),Kt(t))},async loadSessions(){try{const t=await fetch("/api/agent/sessions");if(!t.ok)throw new Error(await he(t,"Failed to load agent sessions"));const r=await t.json();e(()=>{const o={};for(const l of r.sessions)o[l.id]=l;return{sessions:o,sessionOrder:Ke(o),sessionsLoaded:!0}});const i=n();i.activeSessionId&&!i.sessions[i.activeSessionId]&&i.setActiveSession(null)}catch(t){console.error("[agent] loadSessions failed:",t)}},async refreshSession(t){try{const r=await fetch(`/api/agent/sessions/${t}`);if(r.status===404){await n().loadSessions();return}if(!r.ok)throw new Error(await he(r,"Failed to load agent session"));const i=await r.json();e(o=>{const l={...o.sessions,[t]:i.session};return{sessions:l,sessionOrder:Ke(l)}})}catch(r){console.error("[agent] refreshSession failed:",r)}},setActiveSession(t){const r=n().activeSessionId;r!==t&&(r&&He.has(r)&&(He.delete(r),yo(r)),e({activeSessionId:t}),t&&(He.add(t),Kt(t),n().historyLoaded[t]||n().loadHistory(t)))},setShowAllSessions(t){e({showAllSessions:t})},async createSession(t,r){try{const i=await fetch("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:t,paneId:r})});if(!i.ok)throw new Error(await he(i,"Failed to create agent session"));const l=(await i.json()).session;return e(s=>{const a={...s.sessions,[l.id]:l};return{sessions:a,sessionOrder:Ke(a),messages:{...s.messages,[l.id]:[]},historyLoaded:{...s.historyLoaded,[l.id]:!0}}}),n().setActiveSession(l.id),l}catch(i){return Ce.error(i instanceof Error?i.message:String(i)),null}},async renameSession(t,r){try{const i=await fetch(`/api/agent/sessions/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:r})});if(!i.ok)throw new Error(await he(i,"Failed to rename agent session"));const o=await i.json();return e(l=>{const s={...l.sessions,[t]:o.session};return{sessions:s,sessionOrder:Ke(s)}}),!0}catch(i){return Ce.error(i instanceof Error?i.message:String(i)),!1}},async deleteSession(t){try{const r=await fetch(`/api/agent/sessions/${t}`,{method:"DELETE"});if(!r.ok)throw new Error(await he(r,"Failed to delete agent session"));return n().activeSessionId===t&&n().setActiveSession(null),xo(t),e(i=>{const o={...i.sessions};delete o[t];const l={...i.messages};delete l[t];const s={...i.historyLoaded};delete s[t];const a={...i.inProgress};delete a[t];const u={...i.pendingConfirmations};return delete u[t],{sessions:o,sessionOrder:Ke(o),messages:l,historyLoaded:s,inProgress:a,pendingConfirmations:u}}),!0}catch(r){return Ce.error(r instanceof Error?r.message:String(r)),!1}},async setWriteMode(t,r){try{const i=await fetch(`/api/agent/sessions/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({writeMode:r})});if(!i.ok)throw new Error(await he(i,"Failed to update write mode"));const o=await i.json();e(l=>({sessions:{...l.sessions,[t]:o.session}}))}catch(i){Ce.error(i instanceof Error?i.message:String(i))}},async rebindPane(t,r){try{const i=await fetch(`/api/agent/sessions/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paneId:r})});if(!i.ok)throw new Error(await he(i,"Failed to rebind pane"));const o=await i.json();e(l=>({sessions:{...l.sessions,[t]:o.session}}))}catch(i){Ce.error(i instanceof Error?i.message:String(i))}},async loadHistory(t){if(Pt.has(t)){Jt.add(t);return}Pt.add(t);try{const r=n(),i=r.historyLoaded[t]?Qt(r.messages[t]):-1,o=i>=0?`?afterSeq=${i}`:"",l=await fetch(`/api/agent/sessions/${t}/messages${o}`);if(!l.ok)throw new Error(await he(l,"Failed to load agent messages"));const s=await l.json();e(a=>{const u=On(i>=0?a.messages[t]:void 0,s.messages),f=a.inProgress[t],c=f&&{texts:f.texts.filter(p=>!p.stale),reasonings:f.reasonings.filter(p=>!p.stale),toolCalls:f.toolCalls.filter(p=>!p.stale),staleBarrier:!1};return{messages:{...a.messages,[t]:u},historyLoaded:{...a.historyLoaded,[t]:!0},inProgress:c?{...a.inProgress,[t]:c}:a.inProgress}})}catch(r){console.error("[agent] loadHistory failed:",r)}finally{Pt.delete(t),Jt.delete(t)&&n().loadHistory(t)}},async sendMessage(t,r){e(i=>({sending:{...i.sending,[t]:!0}}));try{const i=await fetch(`/api/agent/sessions/${t}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r})});if(!i.ok)throw new Error(await he(i,"Failed to send message"));const o=await i.json();return e(l=>{const s=l.sessions[t];return{messages:{...l.messages,[t]:On(l.messages[t],[o.message])},sessions:s?{...l.sessions,[t]:{...s,status:"running",lastError:null}}:l.sessions}}),!0}catch(i){return Ce.error(i instanceof Error?i.message:String(i)),!1}finally{e(i=>({sending:{...i.sending,[t]:!1}}))}},async stopSession(t){try{const r=await fetch(`/api/agent/sessions/${t}/stop`,{method:"POST"});if(!r.ok)throw new Error(await he(r,"Failed to stop agent session"));const i=await r.json();if(i.session){const o=i.session;e(l=>({sessions:{...l.sessions,[t]:o}}))}}catch(r){Ce.error(r instanceof Error?r.message:String(r))}},async decideConfirmation(t,r,i,o){const l=()=>{e(s=>{const a=s.pendingConfirmations[t];return a?{pendingConfirmations:{...s.pendingConfirmations,[t]:a.filter(u=>u.id!==r)}}:s})};try{const s=await fetch(`/api/agent/confirmations/${r}/decide`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o===void 0?{approved:i}:{approved:i,reason:o})});if(s.status===409){l();try{const a=await fetch(`/api/agent/sessions/${t}/confirmations`);if(a.ok){const u=await a.json();e(f=>({pendingConfirmations:{...f.pendingConfirmations,[t]:u.confirmations.map(c=>({id:c.id,toolCallId:c.toolCallId,toolName:c.toolName,input:c.input,createdAt:c.createdAt}))}}))}}catch{}return}if(!s.ok)throw new Error(await he(s,"Failed to decide confirmation"));l()}catch(s){Ce.error(s instanceof Error?s.message:String(s))}}}),{name:"tmex-agent",partialize:e=>({activeSessionId:e.activeSessionId,showAllSessions:e.showAllSessions})}));function wo(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const So=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Co=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Eo={};function Hn(e,n){return(Eo.jsx?Co:So).test(e)}const To=/[ \t\n\f\r]/g;function vo(e){return typeof e=="object"?e.type==="text"?qn(e.value):!1:qn(e)}function qn(e){return e.replace(To,"")===""}class ft{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}ft.prototype.normal={};ft.prototype.property={};ft.prototype.space=void 0;function Or(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new ft(t,r,n)}function Zt(e){return e.toLowerCase()}class re{constructor(n,t){this.attribute=t,this.property=n}}re.prototype.attribute="";re.prototype.booleanish=!1;re.prototype.boolean=!1;re.prototype.commaOrSpaceSeparated=!1;re.prototype.commaSeparated=!1;re.prototype.defined=!1;re.prototype.mustUseProperty=!1;re.prototype.number=!1;re.prototype.overloadedBoolean=!1;re.prototype.property="";re.prototype.spaceSeparated=!1;re.prototype.space=void 0;let Ao=0;const F=Fe(),X=Fe(),en=Fe(),v=Fe(),W=Fe(),je=Fe(),le=Fe();function Fe(){return 2**++Ao}const tn=Object.freeze(Object.defineProperty({__proto__:null,boolean:F,booleanish:X,commaOrSpaceSeparated:le,commaSeparated:je,number:v,overloadedBoolean:en,spaceSeparated:W},Symbol.toStringTag,{value:"Module"})),_t=Object.keys(tn);class hn extends re{constructor(n,t,r,i){let o=-1;if(super(n,t),Un(this,"space",i),typeof r=="number")for(;++o<_t.length;){const l=_t[o];Un(this,_t[o],(r&tn[l])===tn[l])}}}hn.prototype.defined=!0;function Un(e,n,t){t&&(e[n]=t)}function Ge(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new hn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[Zt(r)]=r,t[Zt(o.attribute)]=r}return new ft(n,t,e.space)}const Br=Ge({properties:{ariaActiveDescendant:null,ariaAtomic:X,ariaAutoComplete:null,ariaBusy:X,ariaChecked:X,ariaColCount:v,ariaColIndex:v,ariaColSpan:v,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:X,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:X,ariaFlowTo:W,ariaGrabbed:X,ariaHasPopup:null,ariaHidden:X,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:v,ariaLive:null,ariaModal:X,ariaMultiLine:X,ariaMultiSelectable:X,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:v,ariaPressed:X,ariaReadOnly:X,ariaRelevant:null,ariaRequired:X,ariaRoleDescription:W,ariaRowCount:v,ariaRowIndex:v,ariaRowSpan:v,ariaSelected:X,ariaSetSize:v,ariaSort:null,ariaValueMax:v,ariaValueMin:v,ariaValueNow:v,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function $r(e,n){return n in e?e[n]:n}function Hr(e,n){return $r(e,n.toLowerCase())}const Io=Ge({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:je,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:F,allowPaymentRequest:F,allowUserMedia:F,alpha:F,alt:null,as:null,async:F,autoCapitalize:null,autoComplete:W,autoFocus:F,autoPlay:F,blocking:W,capture:null,charSet:null,checked:F,cite:null,className:W,closedBy:null,colorSpace:null,cols:v,colSpan:v,command:null,commandFor:null,content:null,contentEditable:X,controls:F,controlsList:W,coords:v|je,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F,defer:F,dir:null,dirName:null,disabled:F,download:en,draggable:X,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F,formTarget:null,headers:W,height:v,hidden:en,high:v,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:F,inputMode:null,integrity:null,is:null,isMap:F,itemId:null,itemProp:W,itemRef:W,itemScope:F,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:F,low:v,manifest:null,max:null,maxLength:v,media:null,method:null,min:null,minLength:v,multiple:F,muted:F,name:null,nonce:null,noModule:F,noValidate:F,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:F,optimum:v,pattern:null,ping:W,placeholder:null,playsInline:F,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F,referrerPolicy:null,rel:W,required:F,reversed:F,rows:v,rowSpan:v,sandbox:W,scope:null,scoped:F,seamless:F,selected:F,shadowRootClonable:F,shadowRootCustomElementRegistry:F,shadowRootDelegatesFocus:F,shadowRootMode:null,shadowRootSerializable:F,shape:null,size:v,sizes:null,slot:null,span:v,spellCheck:X,src:null,srcDoc:null,srcLang:null,srcSet:null,start:v,step:null,style:null,tabIndex:v,target:null,title:null,translate:null,type:null,typeMustMatch:F,useMap:null,value:X,width:v,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:v,borderColor:null,bottomMargin:v,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:F,declare:F,event:null,face:null,frame:null,frameBorder:null,hSpace:v,leftMargin:v,link:null,longDesc:null,lowSrc:null,marginHeight:v,marginWidth:v,noResize:F,noHref:F,noShade:F,noWrap:F,object:null,profile:null,prompt:null,rev:null,rightMargin:v,rules:null,scheme:null,scrolling:X,standby:null,summary:null,text:null,topMargin:v,valueType:null,version:null,vAlign:null,vLink:null,vSpace:v,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:F,disablePictureInPicture:F,disableRemotePlayback:F,exportParts:je,part:W,prefix:null,property:null,results:v,security:null,unselectable:null},space:"html",transform:Hr}),No=Ge({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:le,accentHeight:v,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:v,amplitude:v,arabicForm:null,ascent:v,attributeName:null,attributeType:null,azimuth:v,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:v,by:null,calcMode:null,capHeight:v,className:W,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:v,diffuseConstant:v,direction:null,display:null,dur:null,divisor:v,dominantBaseline:null,download:F,dx:null,dy:null,edgeMode:null,editable:null,elevation:v,enableBackground:null,end:null,event:null,exponent:v,externalResourcesRequired:null,fill:null,fillOpacity:v,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:je,g2:je,glyphName:je,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:v,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:v,horizOriginX:v,horizOriginY:v,id:null,ideographic:v,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:v,k:v,k1:v,k2:v,k3:v,k4:v,kernelMatrix:le,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:v,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:v,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:v,overlineThickness:v,paintOrder:null,panose1:null,path:null,pathLength:v,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:v,pointsAtY:v,pointsAtZ:v,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:le,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:le,rev:le,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:le,requiredFeatures:le,requiredFonts:le,requiredFormats:le,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:v,specularExponent:v,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:v,strikethroughThickness:v,string:null,stroke:null,strokeDashArray:le,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:v,strokeOpacity:v,strokeWidth:null,style:null,surfaceScale:v,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:le,tabIndex:v,tableValues:null,target:null,targetX:v,targetY:v,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:le,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:v,underlineThickness:v,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:v,values:null,vAlphabetic:v,vMathematical:v,vectorEffect:null,vHanging:v,vIdeographic:v,version:null,vertAdvY:v,vertOriginX:v,vertOriginY:v,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:v,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$r}),qr=Ge({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Ur=Ge({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hr}),Vr=Ge({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Po={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"},_o=/[A-Z]/g,Vn=/-[a-z]/g,jo=/^data[-\w.:]+$/i;function zo(e,n){const t=Zt(n);let r=n,i=re;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&jo.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Vn,Lo);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Vn.test(o)){let l=o.replace(_o,Do);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=hn}return new i(r,n)}function Do(e){return"-"+e.toLowerCase()}function Lo(e){return e.charAt(1).toUpperCase()}const Fo=Or([Br,Io,qr,Ur,Vr],"html"),pn=Or([Br,No,qr,Ur,Vr],"svg");function Ro(e){return e.join(" ").trim()}var Be={},jt,Wn;function Mo(){if(Wn)return jt;Wn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,a=`
38
+ `,u="/",f="*",c="",p="comment",h="declaration";function d(b,y){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];y=y||{};var C=1,w=1;function _(L){var N=L.match(n);N&&(C+=N.length);var U=L.lastIndexOf(a);w=~U?L.length-U:w+L.length}function z(){var L={line:C,column:w};return function(N){return N.position=new E(L),A(),N}}function E(L){this.start=L,this.end={line:C,column:w},this.source=y.source}E.prototype.content=b;function M(L){var N=new Error(y.source+":"+C+":"+w+": "+L);if(N.reason=L,N.filename=y.source,N.line=C,N.column=w,N.source=b,!y.silent)throw N}function $(L){var N=L.exec(b);if(N){var U=N[0];return _(U),b=b.slice(U.length),N}}function A(){$(t)}function S(L){var N;for(L=L||[];N=j();)N!==!1&&L.push(N);return L}function j(){var L=z();if(!(u!=b.charAt(0)||f!=b.charAt(1))){for(var N=2;c!=b.charAt(N)&&(f!=b.charAt(N)||u!=b.charAt(N+1));)++N;if(N+=2,c===b.charAt(N-1))return M("End of comment missing");var U=b.slice(2,N-2);return w+=2,_(U),b=b.slice(N),w+=2,L({type:p,comment:U})}}function P(){var L=z(),N=$(r);if(N){if(j(),!$(i))return M("property missing ':'");var U=$(o),Q=L({type:h,property:g(N[0].replace(e,c)),value:U?g(U[0].replace(e,c)):c});return $(l),Q}}function q(){var L=[];S(L);for(var N;N=P();)N!==!1&&(L.push(N),S(L));return L}return A(),q()}function g(b){return b?b.replace(s,c):c}return jt=d,jt}var Gn;function Oo(){if(Gn)return Be;Gn=1;var e=Be&&Be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Be,"__esModule",{value:!0}),Be.default=t;const n=e(Mo());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),s=typeof i=="function";return l.forEach(a=>{if(a.type!=="declaration")return;const{property:u,value:f}=a;s?i(u,f,a):f&&(o=o||{},o[u]=f)}),o}return Be}var et={},Yn;function Bo(){if(Yn)return et;Yn=1,Object.defineProperty(et,"__esModule",{value:!0}),et.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||t.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},s=function(u,f){return"".concat(f,"-")},a=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,s):u=u.replace(r,s),u.replace(n,l))};return et.camelCase=a,et}var tt,Xn;function $o(){if(Xn)return tt;Xn=1;var e=tt&&tt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Oo()),t=Bo();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(s,a){s&&a&&(l[(0,t.camelCase)(s,o)]=a)}),l}return r.default=r,tt=r,tt}var Ho=$o();const qo=_r(Ho),Wr=Gr("end"),dn=Gr("start");function Gr(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Uo(e){const n=dn(e),t=Wr(e);if(n&&t)return{start:n,end:t}}function ot(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Qn(e.position):"start"in e||"end"in e?Qn(e):"line"in e||"column"in e?nn(e):""}function nn(e){return Jn(e&&e.line)+":"+Jn(e&&e.column)}function Qn(e){return nn(e&&e.start)+"-"+nn(e&&e.end)}function Jn(e){return e&&typeof e=="number"?e:1}class Z extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const s=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=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=ot(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Z.prototype.file="";Z.prototype.name="";Z.prototype.reason="";Z.prototype.message="";Z.prototype.stack="";Z.prototype.column=void 0;Z.prototype.line=void 0;Z.prototype.ancestors=void 0;Z.prototype.cause=void 0;Z.prototype.fatal=void 0;Z.prototype.place=void 0;Z.prototype.ruleId=void 0;Z.prototype.source=void 0;const mn={}.hasOwnProperty,Vo=new Map,Wo=/[A-Z]/g,Go=new Set(["table","tbody","thead","tfoot","tr"]),Yo=new Set(["td","th"]),Yr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Xo(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=rs(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=ns(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?pn:Fo,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=Xr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Xr(e,n,t){if(n.type==="element")return Qo(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Jo(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Zo(e,n,t);if(n.type==="mdxjsEsm")return Ko(e,n);if(n.type==="root")return es(e,n,t);if(n.type==="text")return ts(e,n)}function Qo(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=pn,e.schema=i),e.ancestors.push(n);const o=Jr(e,n.tagName,!1),l=is(e,n);let s=xn(e,n);return Go.has(n.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!vo(a):!0})),Qr(e,l,o,n),gn(l,s),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Jo(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ut(e,n.position)}function Ko(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ut(e,n.position)}function Zo(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=pn,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:Jr(e,n.name,!0),l=ls(e,n),s=xn(e,n);return Qr(e,l,o,n),gn(l,s),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function es(e,n,t){const r={};return gn(r,xn(e,n)),e.create(n,e.Fragment,r,t)}function ts(e,n){return n.value}function Qr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function gn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function ns(e,n,t){return r;function r(i,o,l,s){const u=Array.isArray(l.children)?t:n;return s?u(o,l,s):u(o,l)}}function rs(e,n){return t;function t(r,i,o,l){const s=Array.isArray(o.children),a=dn(r);return n(i,o,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function is(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&mn.call(n.properties,i)){const o=os(e,i,n.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&Yo.has(n.tagName)?r=s:t[l]=s}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function ls(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(t,e.evaluater.evaluateExpression(s.argument))}else ut(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else ut(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function xn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Vo;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const a=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(a){const u=i.get(a)||0;l=a+"-"+u,i.set(a,u+1)}}const s=Xr(e,o,l);s!==void 0&&t.push(s)}return t}function os(e,n,t){const r=zo(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?wo(t):Ro(t)),r.property==="style"){let i=typeof t=="object"?t:ss(e,String(t));return e.stylePropertyNameCase==="css"&&(i=as(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Po[r.property]||r.property:r.attribute,t]}}function ss(e,n){try{return qo(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new Z("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Yr+"#cannot-parse-style-attribute",i}}function Jr(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const s=Hn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=l}else r=Hn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return mn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ut(e)}function ut(e,n){const t=new Z("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=Yr+"#cannot-handle-mdx-estrees-without-createevaluater",t}function as(e){const n={};let t;for(t in e)mn.call(e,t)&&(n[us(t)]=e[t]);return n}function us(e){let n=e.replace(Wo,cs);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function cs(e){return"-"+e.toLowerCase()}const zt={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"]},fs={};function yn(e,n){const t=fs,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Kr(e,r,i)}function Kr(e,n,t){if(hs(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Kn(e.children,n,t)}return Array.isArray(e)?Kn(e,n,t):""}function Kn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Kr(e[i],n,t);return r.join("")}function hs(e){return!!(e&&typeof e=="object")}const Zn=document.createElement("i");function kn(e){const n="&"+e+";";Zn.innerHTML=n;const t=Zn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function oe(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function se(e,n){return e.length>0?(oe(e,e.length,0,n),e):n}const er={}.hasOwnProperty;function Zr(e){const n={};let t=-1;for(;++t<e.length;)ps(n,e[t]);return n}function ps(e,n){let t;for(t in n){const i=(er.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){er.call(i,l)||(i[l]=[]);const s=o[l];ds(i[l],Array.isArray(s)?s:s?[s]:[])}}}function ds(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);oe(e,0,0,r)}function ei(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function de(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ee=Ae(/[A-Za-z]/),K=Ae(/[\dA-Za-z]/),ms=Ae(/[#-'*+\--9=?A-Z^-~]/);function bt(e){return e!==null&&(e<32||e===127)}const rn=Ae(/\d/),gs=Ae(/[\dA-Fa-f]/),xs=Ae(/[!-/:-@[-`{-~]/);function D(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const Tt=Ae(new RegExp("\\p{P}|\\p{S}","u")),ze=Ae(/\s/);function Ae(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ye(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&K(e.charCodeAt(t+1))&&K(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(t+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function H(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return O(a)?(e.enter(t),s(a)):n(a)}function s(a){return O(a)&&o++<i?(e.consume(a),s):(e.exit(t),n(a))}}const ys={tokenize:ks};function ks(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),H(e,n,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const a=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=a),t=a,l(s)}function l(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return D(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),l)}}const bs={tokenize:ws},tr={tokenize:Ss};function ws(e){const n=this,t=[];let r=0,i,o,l;return s;function s(w){if(r<t.length){const _=t[r];return n.containerState=_[1],e.attempt(_[0].continuation,a,u)(w)}return u(w)}function a(w){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&C();const _=n.events.length;let z=_,E;for(;z--;)if(n.events[z][0]==="exit"&&n.events[z][1].type==="chunkFlow"){E=n.events[z][1].end;break}y(r);let M=_;for(;M<n.events.length;)n.events[M][1].end={...E},M++;return oe(n.events,z+1,0,n.events.slice(_)),n.events.length=M,u(w)}return s(w)}function u(w){if(r===t.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return d(w);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(tr,f,c)(w)}function f(w){return i&&C(),y(r),p(w)}function c(w){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,d(w)}function p(w){return n.containerState={},e.attempt(tr,h,d)(w)}function h(w){return r++,t.push([n.currentConstruct,n.containerState]),p(w)}function d(w){if(w===null){i&&C(),y(0),e.consume(w);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),g(w)}function g(w){if(w===null){b(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return D(w)?(e.consume(w),b(e.exit("chunkFlow")),r=0,n.interrupt=void 0,s):(e.consume(w),g)}function b(w,_){const z=n.sliceStream(w);if(_&&z.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(z),n.parser.lazy[w.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<l&&(!i.events[E][1].end||i.events[E][1].end.offset>l))return;const M=n.events.length;let $=M,A,S;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(A){S=n.events[$][1].end;break}A=!0}for(y(r),E=M;E<n.events.length;)n.events[E][1].end={...S},E++;oe(n.events,$+1,0,n.events.slice(M)),n.events.length=E}}function y(w){let _=t.length;for(;_-- >w;){const z=t[_];n.containerState=z[1],z[0].exit.call(n,e)}t.length=w}function C(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Ss(e,n,t){return H(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ve(e){if(e===null||G(e)||ze(e))return 1;if(Tt(e))return 2}function vt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const ln={name:"attention",resolveAll:Cs,tokenize:Es};function Cs(e,n){let t=-1,r,i,o,l,s,a,u,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;a=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[t][1].start};nr(c,-a),nr(p,a),l={type:a>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[t][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=se(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=se(u,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),u=se(u,vt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=se(u,[["exit",o,n],["enter",s,n],["exit",s,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,u=se(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,oe(e,r-1,t-r+3,u),t=r+u.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function Es(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ve(r);let o;return l;function l(a){return o=a,e.enter("attentionSequence"),s(a)}function s(a){if(a===o)return e.consume(a),s;const u=e.exit("attentionSequence"),f=Ve(a),c=!f||f===2&&i||t.includes(a),p=!i||i===2&&f||t.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),n(a)}}function nr(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Ts={name:"autolink",tokenize:vs};function vs(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ee(h)?(e.consume(h),l):h===64?t(h):u(h)}function l(h){return h===43||h===45||h===46||K(h)?(r=1,s(h)):u(h)}function s(h){return h===58?(e.consume(h),r=0,a):(h===43||h===45||h===46||K(h))&&r++<32?(e.consume(h),s):(r=0,u(h))}function a(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||bt(h)?t(h):(e.consume(h),a)}function u(h){return h===64?(e.consume(h),f):ms(h)?(e.consume(h),u):t(h)}function f(h){return K(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||K(h))&&r++<63){const d=h===45?p:c;return e.consume(h),d}return t(h)}}const ht={partial:!0,tokenize:As};function As(e,n,t){return r;function r(o){return O(o)?H(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||D(o)?n(o):t(o)}}const ti={continuation:{tokenize:Ns},exit:Ps,name:"blockQuote",tokenize:Is};function Is(e,n,t){const r=this;return i;function i(l){if(l===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return O(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function Ns(e,n,t){const r=this;return i;function i(l){return O(l)?H(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(ti,n,t)(l)}}function Ps(e){e.exit("blockQuote")}const ni={name:"characterEscape",tokenize:_s};function _s(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return xs(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ri={name:"characterReference",tokenize:js};function js(e,n,t){const r=this;let i=0,o,l;return s;function s(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),a}function a(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,l=K,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=gs,f):(e.enter("characterReferenceValue"),o=7,l=rn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===K&&!kn(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const rr={partial:!0,tokenize:Ds},ir={concrete:!0,name:"codeFenced",tokenize:zs};function zs(e,n,t){const r=this,i={partial:!0,tokenize:z};let o=0,l=0,s;return a;function a(E){return u(E)}function u(E){const M=r.events[r.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,s=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===s?(l++,e.consume(E),f):l<3?t(E):(e.exit("codeFencedFenceSequence"),O(E)?H(e,c,"whitespace")(E):c(E))}function c(E){return E===null||D(E)?(e.exit("codeFencedFence"),r.interrupt?n(E):e.check(rr,g,_)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||D(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(E)):O(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),H(e,h,"whitespace")(E)):E===96&&E===s?t(E):(e.consume(E),p)}function h(E){return E===null||D(E)?c(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(E))}function d(E){return E===null||D(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(E)):E===96&&E===s?t(E):(e.consume(E),d)}function g(E){return e.attempt(i,_,b)(E)}function b(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),y}function y(E){return o>0&&O(E)?H(e,C,"linePrefix",o+1)(E):C(E)}function C(E){return E===null||D(E)?e.check(rr,g,_)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||D(E)?(e.exit("codeFlowValue"),C(E)):(e.consume(E),w)}function _(E){return e.exit("codeFenced"),n(E)}function z(E,M,$){let A=0;return S;function S(N){return E.enter("lineEnding"),E.consume(N),E.exit("lineEnding"),j}function j(N){return E.enter("codeFencedFence"),O(N)?H(E,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):P(N)}function P(N){return N===s?(E.enter("codeFencedFenceSequence"),q(N)):$(N)}function q(N){return N===s?(A++,E.consume(N),q):A>=l?(E.exit("codeFencedFenceSequence"),O(N)?H(E,L,"whitespace")(N):L(N)):$(N)}function L(N){return N===null||D(N)?(E.exit("codeFencedFence"),M(N)):$(N)}}}function Ds(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const Dt={name:"codeIndented",tokenize:Fs},Ls={partial:!0,tokenize:Rs};function Fs(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),H(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):t(u)}function l(u){return u===null?a(u):D(u)?e.attempt(Ls,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||D(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),n(u)}}function Rs(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):D(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):H(e,o,"linePrefix",5)(l)}function o(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?n(l):D(l)?i(l):t(l)}}const Ms={name:"codeText",previous:Bs,resolve:Os,tokenize:$s};function Os(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function Bs(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $s(e,n,t){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),s(c)}function s(c){return c===96?(e.consume(c),r++,s):(e.exit("codeTextSequence"),a(c))}function a(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),a):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):D(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),a):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||D(c)?(e.exit("codeTextData"),a(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",u(c))}}class Hs{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&nt(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),nt(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),nt(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);nt(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);nt(this.left,t.reverse())}}}function nt(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function ii(e){const n={};let t=-1,r,i,o,l,s,a,u;const f=new Hs(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,o=0,o<a.length&&a[o][1].type==="lineEndingBlank"&&(o+=2),o<a.length&&a[o][1].type==="content"))for(;++o<a.length&&a[o][1].type!=="content";)a[o][1].type==="chunkText"&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,qs(f,t)),t=n[t],u=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},s=f.slice(i,t),s.unshift(r),f.splice(i,t-i+1,s))}}return oe(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function qs(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const s=l.events,a=[],u={};let f,c,p=-1,h=t,d=0,g=0;const b=[g];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<s.length;)s[p][0]==="exit"&&s[p-1][0]==="enter"&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(g=p+1,b.push(g),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):b.pop(),p=b.length;p--;){const y=s.slice(b[p],b[p+1]),C=o.pop();a.push([C,C+y.length-1]),e.splice(C,2,y)}for(a.reverse(),p=-1;++p<a.length;)u[d+a[p][0]]=d+a[p][1],d+=a[p][1]-a[p][0]-1;return u}const Us={resolve:Ws,tokenize:Gs},Vs={partial:!0,tokenize:Ys};function Ws(e){return ii(e),e}function Gs(e,n){let t;return r;function r(s){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):D(s)?e.check(Vs,l,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),n(s)}function l(s){return e.consume(s),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Ys(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),H(e,o,"linePrefix")}function o(l){if(l===null||D(l))return t(l);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function li(e,n,t,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||bt(y)?t(y):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),g(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(s),p(y)):y===null||y===60||D(y)?t(y):(e.consume(y),y===92?d:h)}function d(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function g(y){return!f&&(y===null||y===41||G(y))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),n(y)):f<u&&y===40?(e.consume(y),f++,g):y===41?(e.consume(y),f--,g):y===null||y===32||y===40||bt(y)?t(y):(e.consume(y),y===92?b:g)}function b(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function oi(e,n,t,r,i,o){const l=this;let s=0,a;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return s>999||h===null||h===91||h===93&&!a||h===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):D(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||D(h)||s++>999?(e.exit("chunkString"),f(h)):(e.consume(h),a||(a=!O(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),s++,c):c(h)}}function si(e,n,t,r,i,o){let l;return s;function s(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,a):t(p)}function a(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),a(l)):p===null?t(p):D(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),H(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||D(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function st(e,n){let t;return r;function r(i){return D(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):O(i)?H(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Xs={name:"definition",tokenize:Js},Qs={partial:!0,tokenize:Ks};function Js(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return oi.call(r,e,s,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=de(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):t(h)}function a(h){return G(h)?st(e,u)(h):u(h)}function u(h){return li(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Qs,c,c)(h)}function c(h){return O(h)?H(e,p,"whitespace")(h):p(h)}function p(h){return h===null||D(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function Ks(e,n,t){return r;function r(s){return G(s)?st(e,i)(s):t(s)}function i(s){return si(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return O(s)?H(e,l,"whitespace")(s):l(s)}function l(s){return s===null||D(s)?n(s):t(s)}}const Zs={name:"hardBreakEscape",tokenize:ea};function ea(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return D(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const ta={name:"headingAtx",resolve:na,tokenize:ra};function na(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},oe(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function ra(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||G(f)?(e.exit("atxHeadingSequence"),s(f)):t(f)}function s(f){return f===35?(e.enter("atxHeadingSequence"),a(f)):f===null||D(f)?(e.exit("atxHeading"),n(f)):O(f)?H(e,s,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function a(f){return f===35?(e.consume(f),a):(e.exit("atxHeadingSequence"),s(f))}function u(f){return f===null||f===35||G(f)?(e.exit("atxHeadingText"),s(f)):(e.consume(f),u)}}const ia=["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"],lr=["pre","script","style","textarea"],la={concrete:!0,name:"htmlFlow",resolveTo:aa,tokenize:ua},oa={partial:!0,tokenize:fa},sa={partial:!0,tokenize:ca};function aa(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function ua(e,n,t){const r=this;let i,o,l,s,a;return u;function u(x){return f(x)}function f(x){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(x),c}function c(x){return x===33?(e.consume(x),p):x===47?(e.consume(x),o=!0,g):x===63?(e.consume(x),i=3,r.interrupt?n:m):ee(x)?(e.consume(x),l=String.fromCharCode(x),b):t(x)}function p(x){return x===45?(e.consume(x),i=2,h):x===91?(e.consume(x),i=5,s=0,d):ee(x)?(e.consume(x),i=4,r.interrupt?n:m):t(x)}function h(x){return x===45?(e.consume(x),r.interrupt?n:m):t(x)}function d(x){const ce="CDATA[";return x===ce.charCodeAt(s++)?(e.consume(x),s===ce.length?r.interrupt?n:P:d):t(x)}function g(x){return ee(x)?(e.consume(x),l=String.fromCharCode(x),b):t(x)}function b(x){if(x===null||x===47||x===62||G(x)){const ce=x===47,Ie=l.toLowerCase();return!ce&&!o&&lr.includes(Ie)?(i=1,r.interrupt?n(x):P(x)):ia.includes(l.toLowerCase())?(i=6,ce?(e.consume(x),y):r.interrupt?n(x):P(x)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(x):o?C(x):w(x))}return x===45||K(x)?(e.consume(x),l+=String.fromCharCode(x),b):t(x)}function y(x){return x===62?(e.consume(x),r.interrupt?n:P):t(x)}function C(x){return O(x)?(e.consume(x),C):S(x)}function w(x){return x===47?(e.consume(x),S):x===58||x===95||ee(x)?(e.consume(x),_):O(x)?(e.consume(x),w):S(x)}function _(x){return x===45||x===46||x===58||x===95||K(x)?(e.consume(x),_):z(x)}function z(x){return x===61?(e.consume(x),E):O(x)?(e.consume(x),z):w(x)}function E(x){return x===null||x===60||x===61||x===62||x===96?t(x):x===34||x===39?(e.consume(x),a=x,M):O(x)?(e.consume(x),E):$(x)}function M(x){return x===a?(e.consume(x),a=null,A):x===null||D(x)?t(x):(e.consume(x),M)}function $(x){return x===null||x===34||x===39||x===47||x===60||x===61||x===62||x===96||G(x)?z(x):(e.consume(x),$)}function A(x){return x===47||x===62||O(x)?w(x):t(x)}function S(x){return x===62?(e.consume(x),j):t(x)}function j(x){return x===null||D(x)?P(x):O(x)?(e.consume(x),j):t(x)}function P(x){return x===45&&i===2?(e.consume(x),U):x===60&&i===1?(e.consume(x),Q):x===62&&i===4?(e.consume(x),ue):x===63&&i===3?(e.consume(x),m):x===93&&i===5?(e.consume(x),ke):D(x)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(oa,be,q)(x)):x===null||D(x)?(e.exit("htmlFlowData"),q(x)):(e.consume(x),P)}function q(x){return e.check(sa,L,be)(x)}function L(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),N}function N(x){return x===null||D(x)?q(x):(e.enter("htmlFlowData"),P(x))}function U(x){return x===45?(e.consume(x),m):P(x)}function Q(x){return x===47?(e.consume(x),l="",ae):P(x)}function ae(x){if(x===62){const ce=l.toLowerCase();return lr.includes(ce)?(e.consume(x),ue):P(x)}return ee(x)&&l.length<8?(e.consume(x),l+=String.fromCharCode(x),ae):P(x)}function ke(x){return x===93?(e.consume(x),m):P(x)}function m(x){return x===62?(e.consume(x),ue):x===45&&i===2?(e.consume(x),m):P(x)}function ue(x){return x===null||D(x)?(e.exit("htmlFlowData"),be(x)):(e.consume(x),ue)}function be(x){return e.exit("htmlFlow"),n(x)}}function ca(e,n,t){const r=this;return i;function i(l){return D(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function fa(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ht,n,t)}}const ha={name:"htmlText",tokenize:pa};function pa(e,n,t){const r=this;let i,o,l;return s;function s(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),a}function a(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),z):m===63?(e.consume(m),w):ee(m)?(e.consume(m),$):t(m)}function u(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,d):ee(m)?(e.consume(m),C):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):D(m)?(l=c,Q(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?U(m):m===45?p(m):c(m)}function d(m){const ue="CDATA[";return m===ue.charCodeAt(o++)?(e.consume(m),o===ue.length?g:d):t(m)}function g(m){return m===null?t(m):m===93?(e.consume(m),b):D(m)?(l=g,Q(m)):(e.consume(m),g)}function b(m){return m===93?(e.consume(m),y):g(m)}function y(m){return m===62?U(m):m===93?(e.consume(m),y):g(m)}function C(m){return m===null||m===62?U(m):D(m)?(l=C,Q(m)):(e.consume(m),C)}function w(m){return m===null?t(m):m===63?(e.consume(m),_):D(m)?(l=w,Q(m)):(e.consume(m),w)}function _(m){return m===62?U(m):w(m)}function z(m){return ee(m)?(e.consume(m),E):t(m)}function E(m){return m===45||K(m)?(e.consume(m),E):M(m)}function M(m){return D(m)?(l=M,Q(m)):O(m)?(e.consume(m),M):U(m)}function $(m){return m===45||K(m)?(e.consume(m),$):m===47||m===62||G(m)?A(m):t(m)}function A(m){return m===47?(e.consume(m),U):m===58||m===95||ee(m)?(e.consume(m),S):D(m)?(l=A,Q(m)):O(m)?(e.consume(m),A):U(m)}function S(m){return m===45||m===46||m===58||m===95||K(m)?(e.consume(m),S):j(m)}function j(m){return m===61?(e.consume(m),P):D(m)?(l=j,Q(m)):O(m)?(e.consume(m),j):A(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,q):D(m)?(l=P,Q(m)):O(m)?(e.consume(m),P):(e.consume(m),L)}function q(m){return m===i?(e.consume(m),i=void 0,N):m===null?t(m):D(m)?(l=q,Q(m)):(e.consume(m),q)}function L(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||G(m)?A(m):(e.consume(m),L)}function N(m){return m===47||m===62||G(m)?A(m):t(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function Q(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ae}function ae(m){return O(m)?H(e,ke,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ke(m)}function ke(m){return e.enter("htmlTextData"),l(m)}}const bn={name:"labelEnd",resolveAll:xa,resolveTo:ya,tokenize:ka},da={tokenize:ba},ma={tokenize:wa},ga={tokenize:Sa};function xa(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&oe(e,0,e.length,t),e}function ya(e,n){let t=e.length,r=0,i,o,l,s;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const a={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return s=[["enter",a,n],["enter",u,n]],s=se(s,e.slice(o+1,o+r+3)),s=se(s,[["enter",f,n]]),s=se(s,vt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),s=se(s,[["exit",f,n],e[l-2],e[l-1],["exit",u,n]]),s=se(s,e.slice(l+1)),s=se(s,[["exit",a,n]]),oe(e,o,e.length,s),e}function ka(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(de(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),a):t(p)}function a(p){return p===40?e.attempt(da,f,l?f:c)(p):p===91?e.attempt(ma,f,l?u:c)(p):l?f(p):c(p)}function u(p){return e.attempt(ga,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function ba(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return G(c)?st(e,o)(c):o(c)}function o(c){return c===41?f(c):li(e,l,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return G(c)?st(e,a)(c):f(c)}function s(c){return t(c)}function a(c){return c===34||c===39||c===40?si(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return G(c)?st(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function wa(e,n,t){const r=this;return i;function i(s){return oi.call(r,e,o,l,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(de(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(s):t(s)}function l(s){return t(s)}}function Sa(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const Ca={name:"labelStartImage",resolveAll:bn.resolveAll,tokenize:Ea};function Ea(e,n,t){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),l):t(s)}function l(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(s):n(s)}}const Ta={name:"labelStartLink",resolveAll:bn.resolveAll,tokenize:va};function va(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Lt={name:"lineEnding",tokenize:Aa};function Aa(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),H(e,n,"linePrefix")}}const kt={name:"thematicBreak",tokenize:Ia};function Ia(e,n,t){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,s(u)}function s(u){return u===i?(e.enter("thematicBreakSequence"),a(u)):r>=3&&(u===null||D(u))?(e.exit("thematicBreak"),n(u)):t(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),O(u)?H(e,s,"whitespace")(u):s(u))}}const te={continuation:{tokenize:ja},exit:Da,name:"list",tokenize:_a},Na={partial:!0,tokenize:La},Pa={partial:!0,tokenize:za};function _a(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(h){const d=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:rn(h)){if(r.containerState.type||(r.containerState.type=d,e.enter(d,{_container:!0})),d==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(kt,t,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return t(h)}function a(h){return rn(h)&&++l<10?(e.consume(h),a):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):t(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(ht,r.interrupt?t:f,e.attempt(Na,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return O(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function ja(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(ht,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,H(e,n,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!O(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Pa,n,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,H(e,e.attempt(te,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function za(e,n,t){const r=this;return H(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function Da(e){e.exit(this.containerState.type)}function La(e,n,t){const r=this;return H(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const or={name:"setextUnderline",resolveTo:Fa,tokenize:Ra};function Fa(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function Ra(e,n,t){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):t(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),O(u)?H(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||D(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const Ma={tokenize:Oa};function Oa(e){const n=this,t=e.attempt(ht,r,e.attempt(this.parser.constructs.flowInitial,i,H(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Us,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Ba={resolveAll:ui()},$a=ai("string"),Ha=ai("text");function ai(e){return{resolveAll:ui(e==="text"?qa:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,s);return l;function l(f){return u(f)?o(f):s(f)}function s(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),a}function a(f){return u(f)?(t.exit("data"),o(f)):(t.consume(f),a)}function u(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function ui(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function qa(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,l=-1,s=0,a;for(;o--;){const u=i[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)s++,l--;if(l)break;l=-1}else if(u===-2)a=!0,s++;else if(u!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(s=0),s){const u={type:t===e.length||a||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const Ua={42:te,43:te,45:te,48:te,49:te,50:te,51:te,52:te,53:te,54:te,55:te,56:te,57:te,62:ti},Va={91:Xs},Wa={[-2]:Dt,[-1]:Dt,32:Dt},Ga={35:ta,42:kt,45:[or,kt],60:la,61:or,95:kt,96:ir,126:ir},Ya={38:ri,92:ni},Xa={[-5]:Lt,[-4]:Lt,[-3]:Lt,33:Ca,38:ri,42:ln,60:[Ts,ha],91:Ta,92:[Zs,ni],93:bn,95:ln,96:Ms},Qa={null:[ln,Ba]},Ja={null:[42,95]},Ka={null:[]},Za=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ja,contentInitial:Va,disable:Ka,document:Ua,flow:Ga,flowInitial:Wa,insideSpan:Qa,string:Ya,text:Xa},Symbol.toStringTag,{value:"Module"}));function eu(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let l=[],s=[];const a={attempt:M(z),check:M(E),consume:C,enter:w,exit:_,interrupt:M(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:d,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(u,a);return n.resolveAll&&o.push(n),u;function c(j){return l=se(l,j),b(),l[l.length-1]!==null?[]:($(n,0),u.events=vt(o,u.events,u),u.events)}function p(j,P){return nu(h(j),P)}function h(j){return tu(l,j)}function d(){const{_bufferIndex:j,_index:P,line:q,column:L,offset:N}=r;return{_bufferIndex:j,_index:P,line:q,column:L,offset:N}}function g(j){i[j.line]=j.column,S()}function b(){let j;for(;r._index<l.length;){const P=l[r._index];if(typeof P=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<P.length;)y(P.charCodeAt(r._bufferIndex));else y(P)}}function y(j){f=f(j)}function C(j){D(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,S()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=j}function w(j,P){const q=P||{};return q.type=j,q.start=d(),u.events.push(["enter",q,u]),s.push(q),q}function _(j){const P=s.pop();return P.end=d(),u.events.push(["exit",P,u]),P}function z(j,P){$(j,P.from)}function E(j,P){P.restore()}function M(j,P){return q;function q(L,N,U){let Q,ae,ke,m;return Array.isArray(L)?be(L):"tokenize"in L?be([L]):ue(L);function ue(J){return Xe;function Xe(Te){const Re=Te!==null&&J[Te],Me=Te!==null&&J.null,dt=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(Me)?Me:Me?[Me]:[]];return be(dt)(Te)}}function be(J){return Q=J,ae=0,J.length===0?U:x(J[ae])}function x(J){return Xe;function Xe(Te){return m=A(),ke=J,J.partial||(u.currentConstruct=J),J.name&&u.parser.constructs.disable.null.includes(J.name)?Ie():J.tokenize.call(P?Object.assign(Object.create(u),P):u,a,ce,Ie)(Te)}}function ce(J){return j(ke,m),N}function Ie(J){return m.restore(),++ae<Q.length?x(Q[ae]):U}}}function $(j,P){j.resolveAll&&!o.includes(j)&&o.push(j),j.resolve&&oe(u.events,P,u.events.length-P,j.resolve(u.events.slice(P),u)),j.resolveTo&&(u.events=j.resolveTo(u.events,u))}function A(){const j=d(),P=u.previous,q=u.currentConstruct,L=u.events.length,N=Array.from(s);return{from:L,restore:U};function U(){r=j,u.previous=P,u.currentConstruct=q,u.events.length=L,s=N,S()}}function S(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function tu(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function nu(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
39
+ `;break}case-3:{l=`\r
40
+ `;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function ru(e){const r={constructs:Zr([Za,...(e||{}).extensions||[]]),content:i(ys),defined:[],document:i(bs),flow:i(Ma),lazy:{},string:i($a),text:i(Ha)};return r;function i(o){return l;function l(s){return eu(r,o,s)}}}function iu(e){for(;!ii(e););return e}const sr=/[\0\t\n\r]/g;function lu(){let e=1,n="",t=!0,r;return i;function i(o,l,s){const a=[];let u,f,c,p,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(sr.lastIndex=c,u=sr.exec(o),p=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(p),!u){n=o.slice(c);break}if(h===10&&c===p&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),c<p&&(a.push(o.slice(c,p)),e+=p-c),h){case 0:{a.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,a.push(-2);e++<f;)a.push(-1);break}case 10:{a.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return s&&(r&&a.push(-5),n&&a.push(n),a.push(null)),a}}const ou=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function su(e){return e.replace(ou,au)}function au(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return ei(t.slice(o?2:1),o?16:10)}return kn(t)||e}const ci={}.hasOwnProperty;function uu(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),cu(t)(iu(ru(t).document().write(lu()(e,n,!0))))}function cu(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(zn),autolinkProtocol:A,autolinkEmail:A,atxHeading:o(Pn),blockQuote:o(Me),characterEscape:A,characterReference:A,codeFenced:o(dt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(dt,l),codeText:o(qi,l),codeTextData:A,data:A,codeFlowValue:A,definition:o(Ui),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Vi),hardBreakEscape:o(_n),hardBreakTrailing:o(_n),htmlFlow:o(jn,l),htmlFlowData:A,htmlText:o(jn,l),htmlTextData:A,image:o(Wi),label:l,link:o(zn),listItem:o(Gi),listItemValue:p,listOrdered:o(Dn,c),listUnordered:o(Dn),paragraph:o(Yi),reference:x,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Pn),strong:o(Xi),thematicBreak:o(Ji)},exit:{atxHeading:a(),atxHeadingSequence:z,autolink:a(),autolinkEmail:Re,autolinkProtocol:Te,blockQuote:a(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:J,characterReference:Xe,codeFenced:a(b),codeFencedFence:g,codeFencedFenceInfo:h,codeFencedFenceMeta:d,codeFlowValue:S,codeIndented:a(y),codeText:a(N),codeTextData:S,data:S,definition:a(),definitionDestinationString:_,definitionLabelString:C,definitionTitleString:w,emphasis:a(),hardBreakEscape:a(P),hardBreakTrailing:a(P),htmlFlow:a(q),htmlFlowData:S,htmlText:a(L),htmlTextData:S,image:a(Q),label:ke,labelText:ae,lineEnding:j,link:a(U),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:ce,resourceDestinationString:m,resourceTitleString:ue,resource:be,setextHeading:a($),setextHeadingLineSequence:M,setextHeadingText:E,strong:a(),thematicBreak:a()}};fi(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(T){let I={type:"root",children:[]};const R={stack:[I],tokenStack:[],config:n,enter:s,exit:u,buffer:l,resume:f,data:t},B=[];let V=-1;for(;++V<T.length;)if(T[V][1].type==="listOrdered"||T[V][1].type==="listUnordered")if(T[V][0]==="enter")B.push(V);else{const fe=B.pop();V=i(T,fe,V)}for(V=-1;++V<T.length;){const fe=n[T[V][0]];ci.call(fe,T[V][1].type)&&fe[T[V][1].type].call(Object.assign({sliceSerialize:T[V][2].sliceSerialize},R),T[V][1])}if(R.tokenStack.length>0){const fe=R.tokenStack[R.tokenStack.length-1];(fe[1]||ar).call(R,void 0,fe[0])}for(I.position={start:ve(T.length>0?T[0][1].start:{line:1,column:1,offset:0}),end:ve(T.length>0?T[T.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<n.transforms.length;)I=n.transforms[V](I)||I;return I}function i(T,I,R){let B=I-1,V=-1,fe=!1,Ne,we,Qe,Je;for(;++B<=R;){const ie=T[B];switch(ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ie[0]==="enter"?V++:V--,Je=void 0;break}case"lineEndingBlank":{ie[0]==="enter"&&(Ne&&!Je&&!V&&!Qe&&(Qe=B),Je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Je=void 0}if(!V&&ie[0]==="enter"&&ie[1].type==="listItemPrefix"||V===-1&&ie[0]==="exit"&&(ie[1].type==="listUnordered"||ie[1].type==="listOrdered")){if(Ne){let Oe=B;for(we=void 0;Oe--;){const Se=T[Oe];if(Se[1].type==="lineEnding"||Se[1].type==="lineEndingBlank"){if(Se[0]==="exit")continue;we&&(T[we][1].type="lineEndingBlank",fe=!0),Se[1].type="lineEnding",we=Oe}else if(!(Se[1].type==="linePrefix"||Se[1].type==="blockQuotePrefix"||Se[1].type==="blockQuotePrefixWhitespace"||Se[1].type==="blockQuoteMarker"||Se[1].type==="listItemIndent"))break}Qe&&(!we||Qe<we)&&(Ne._spread=!0),Ne.end=Object.assign({},we?T[we][1].start:ie[1].end),T.splice(we||B,0,["exit",Ne,ie[2]]),B++,R++}if(ie[1].type==="listItemPrefix"){const Oe={type:"listItem",_spread:!1,start:Object.assign({},ie[1].start),end:void 0};Ne=Oe,T.splice(B,0,["enter",Oe,ie[2]]),B++,R++,Qe=void 0,Je=!0}}}return T[I][1]._spread=fe,R}function o(T,I){return R;function R(B){s.call(this,T(B),B),I&&I.call(this,B)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(T,I,R){this.stack[this.stack.length-1].children.push(T),this.stack.push(T),this.tokenStack.push([I,R||void 0]),T.position={start:ve(I.start),end:void 0}}function a(T){return I;function I(R){T&&T.call(this,R),u.call(this,R)}}function u(T,I){const R=this.stack.pop(),B=this.tokenStack.pop();if(B)B[0].type!==T.type&&(I?I.call(this,T,B[0]):(B[1]||ar).call(this,T,B[0]));else throw new Error("Cannot close `"+T.type+"` ("+ot({start:T.start,end:T.end})+"): it’s not open");R.position.end=ve(T.end)}function f(){return yn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(T){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(T),10),this.data.expectingFirstListItemValue=void 0}}function h(){const T=this.resume(),I=this.stack[this.stack.length-1];I.lang=T}function d(){const T=this.resume(),I=this.stack[this.stack.length-1];I.meta=T}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const T=this.resume(),I=this.stack[this.stack.length-1];I.value=T.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const T=this.resume(),I=this.stack[this.stack.length-1];I.value=T.replace(/(\r?\n|\r)$/g,"")}function C(T){const I=this.resume(),R=this.stack[this.stack.length-1];R.label=I,R.identifier=de(this.sliceSerialize(T)).toLowerCase()}function w(){const T=this.resume(),I=this.stack[this.stack.length-1];I.title=T}function _(){const T=this.resume(),I=this.stack[this.stack.length-1];I.url=T}function z(T){const I=this.stack[this.stack.length-1];if(!I.depth){const R=this.sliceSerialize(T).length;I.depth=R}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function M(T){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(T).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function A(T){const R=this.stack[this.stack.length-1].children;let B=R[R.length-1];(!B||B.type!=="text")&&(B=Qi(),B.position={start:ve(T.start),end:void 0},R.push(B)),this.stack.push(B)}function S(T){const I=this.stack.pop();I.value+=this.sliceSerialize(T),I.position.end=ve(T.end)}function j(T){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const R=I.children[I.children.length-1];R.position.end=ve(T.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(I.type)&&(A.call(this,T),S.call(this,T))}function P(){this.data.atHardBreak=!0}function q(){const T=this.resume(),I=this.stack[this.stack.length-1];I.value=T}function L(){const T=this.resume(),I=this.stack[this.stack.length-1];I.value=T}function N(){const T=this.resume(),I=this.stack[this.stack.length-1];I.value=T}function U(){const T=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=I,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function Q(){const T=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=I,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function ae(T){const I=this.sliceSerialize(T),R=this.stack[this.stack.length-2];R.label=su(I),R.identifier=de(I).toLowerCase()}function ke(){const T=this.stack[this.stack.length-1],I=this.resume(),R=this.stack[this.stack.length-1];if(this.data.inReference=!0,R.type==="link"){const B=T.children;R.children=B}else R.alt=I}function m(){const T=this.resume(),I=this.stack[this.stack.length-1];I.url=T}function ue(){const T=this.resume(),I=this.stack[this.stack.length-1];I.title=T}function be(){this.data.inReference=void 0}function x(){this.data.referenceType="collapsed"}function ce(T){const I=this.resume(),R=this.stack[this.stack.length-1];R.label=I,R.identifier=de(this.sliceSerialize(T)).toLowerCase(),this.data.referenceType="full"}function Ie(T){this.data.characterReferenceType=T.type}function J(T){const I=this.sliceSerialize(T),R=this.data.characterReferenceType;let B;R?(B=ei(I,R==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):B=kn(I);const V=this.stack[this.stack.length-1];V.value+=B}function Xe(T){const I=this.stack.pop();I.position.end=ve(T.end)}function Te(T){S.call(this,T);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(T)}function Re(T){S.call(this,T);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(T)}function Me(){return{type:"blockquote",children:[]}}function dt(){return{type:"code",lang:null,meta:null,value:""}}function qi(){return{type:"inlineCode",value:""}}function Ui(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Vi(){return{type:"emphasis",children:[]}}function Pn(){return{type:"heading",depth:0,children:[]}}function _n(){return{type:"break"}}function jn(){return{type:"html",value:""}}function Wi(){return{type:"image",title:null,url:"",alt:null}}function zn(){return{type:"link",title:null,url:"",children:[]}}function Dn(T){return{type:"list",ordered:T.type==="listOrdered",start:null,spread:T._spread,children:[]}}function Gi(T){return{type:"listItem",spread:T._spread,checked:null,children:[]}}function Yi(){return{type:"paragraph",children:[]}}function Xi(){return{type:"strong",children:[]}}function Qi(){return{type:"text",value:""}}function Ji(){return{type:"thematicBreak"}}}function ve(e){return{line:e.line,column:e.column,offset:e.offset}}function fi(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?fi(e,r):fu(e,r)}}function fu(e,n){let t;for(t in n)if(ci.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function ar(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+ot({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+ot({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+ot({start:n.start,end:n.end})+") is still open")}function hu(e){const n=this;n.parser=t;function t(r){return uu(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function pu(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function du(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
41
+ `}]}function mu(e,n){const t=n.value?n.value+`
42
+ `:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function gu(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function xu(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function yu(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Ye(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,s+=1,e.footnoteCounts.set(r,s);const a={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(n,u),e.applyData(n,u)}function ku(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function bu(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function hi(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function wu(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return hi(e,n);const i={src:Ye(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function Su(e,n){const t={src:Ye(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function Cu(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function Eu(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return hi(e,n);const i={href:Ye(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function Tu(e,n){const t={href:Ye(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function vu(e,n,t){const r=e.all(n),i=t?Au(t):pi(n),o={},l=[];if(typeof n.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const f=r[s];(i||s!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
43
+ `}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const a=r[r.length-1];a&&(i||a.type!=="element"||a.tagName!=="p")&&l.push({type:"text",value:`
44
+ `});const u={type:"element",tagName:"li",properties:o,children:l};return e.patch(n,u),e.applyData(n,u)}function Au(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r<t.length;)n=pi(t[r])}return n}function pi(e){const n=e.spread;return n??e.children.length>1}function Iu(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function Nu(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Pu(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function _u(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ju(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},s=dn(n.children[1]),a=Wr(n.children[n.children.length-1]);s&&a&&(l.position={start:s,end:a}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function zu(e,n,t){const r=t?t.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,s=l?l.length:n.children.length;let a=-1;const u=[];for(;++a<s;){const c=n.children[a],p={},h=l?l[a]:void 0;h&&(p.align=h);let d={type:"element",tagName:o,properties:p,children:[]};c&&(d.children=e.all(c),e.patch(c,d),d=e.applyData(c,d)),u.push(d)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,f),e.applyData(n,f)}function Du(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ur=9,cr=32;function Lu(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const o=[];for(;r;)o.push(fr(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return o.push(fr(n.slice(i),i>0,!1)),o.join("")}function fr(e,n,t){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===ur||o===cr;)r++,o=e.codePointAt(r)}if(t){let o=e.codePointAt(i-1);for(;o===ur||o===cr;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Fu(e,n){const t={type:"text",value:Lu(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Ru(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Mu={blockquote:pu,break:du,code:mu,delete:gu,emphasis:xu,footnoteReference:yu,heading:ku,html:bu,imageReference:wu,image:Su,inlineCode:Cu,linkReference:Eu,link:Tu,listItem:vu,list:Iu,paragraph:Nu,root:Pu,strong:_u,table:ju,tableCell:Du,tableRow:zu,text:Fu,thematicBreak:Ru,toml:mt,yaml:mt,definition:mt,footnoteDefinition:mt};function mt(){}const di=-1,At=0,at=1,wt=2,wn=3,Sn=4,Cn=5,En=6,mi=7,gi=8,Ou=typeof self=="object"?self:globalThis,hr=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ou[e](n)},Bu=(e,n)=>{const t=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=n[i];switch(o){case At:case di:return t(l,i);case at:{const s=t([],i);for(const a of l)s.push(r(a));return s}case wt:{const s=t({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case wn:return t(new Date(l),i);case Sn:{const{source:s,flags:a}=l;return t(new RegExp(s,a),i)}case Cn:{const s=t(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case En:{const s=t(new Set,i);for(const a of l)s.add(r(a));return s}case mi:{const{name:s,message:a}=l;return t(hr(s,a),i)}case gi:return t(BigInt(l),i);case"BigInt":return t(Object(BigInt(l)),i);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return t(new DataView(s),l)}}return t(hr(o,l),i)};return r},pr=e=>Bu(new Map,e)(0),$e="",{toString:$u}={},{keys:Hu}=Object,rt=e=>{const n=typeof e;if(n!=="object"||!e)return[At,n];const t=$u.call(e).slice(8,-1);switch(t){case"Array":return[at,$e];case"Object":return[wt,$e];case"Date":return[wn,$e];case"RegExp":return[Sn,$e];case"Map":return[Cn,$e];case"Set":return[En,$e];case"DataView":return[at,t]}return t.includes("Array")?[at,t]:t.includes("Error")?[mi,t]:[wt,t]},gt=([e,n])=>e===At&&(n==="function"||n==="symbol"),qu=(e,n,t,r)=>{const i=(l,s)=>{const a=r.push(l)-1;return t.set(s,a),a},o=l=>{if(t.has(l))return t.get(l);let[s,a]=rt(l);switch(s){case At:{let f=l;switch(a){case"bigint":s=gi,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);f=null;break;case"undefined":return i([di],l)}return i([s,f],l)}case at:{if(a){let p=l;return a==="DataView"?p=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(p=new Uint8Array(l)),i([a,[...p]],l)}const f=[],c=i([s,f],l);for(const p of l)f.push(o(p));return c}case wt:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(n&&"toJSON"in l)return o(l.toJSON());const f=[],c=i([s,f],l);for(const p of Hu(l))(e||!gt(rt(l[p])))&&f.push([o(p),o(l[p])]);return c}case wn:return i([s,l.toISOString()],l);case Sn:{const{source:f,flags:c}=l;return i([s,{source:f,flags:c}],l)}case Cn:{const f=[],c=i([s,f],l);for(const[p,h]of l)(e||!(gt(rt(p))||gt(rt(h))))&&f.push([o(p),o(h)]);return c}case En:{const f=[],c=i([s,f],l);for(const p of l)(e||!gt(rt(p)))&&f.push(o(p));return c}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},dr=(e,{json:n,lossy:t}={})=>{const r=[];return qu(!(n||t),!!n,new Map,r)(e),r},St=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?pr(dr(e,n)):structuredClone(e):(e,n)=>pr(dr(e,n));function Uu(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Vu(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Wu(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||Uu,r=e.options.footnoteBackLabel||Vu,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[a]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),p=Ye(c.toLowerCase());let h=0;const d=[],g=e.footnoteCounts.get(c);for(;g!==void 0&&++h<=g;){d.length>0&&d.push({type:"text",value:" "});let C=typeof t=="string"?t:t(a,h);typeof C=="string"&&(C={type:"text",value:C}),d.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,h),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const b=f[f.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const C=b.children[b.children.length-1];C&&C.type==="text"?C.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...d)}else f.push(...d);const y={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,y),s.push(y)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...St(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
45
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
46
+ `}]}}const It=(function(e){if(e==null)return Qu;if(typeof e=="function")return Nt(e);if(typeof e=="object")return Array.isArray(e)?Gu(e):Yu(e);if(typeof e=="string")return Xu(e);throw new Error("Expected function, string, or object as test")});function Gu(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=It(e[t]);return Nt(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function Yu(e){const n=e;return Nt(t);function t(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function Xu(e){return Nt(n);function n(t){return t&&t.type===e}}function Nt(e){return n;function n(t,r,i){return!!(Ju(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Qu(){return!0}function Ju(e){return e!==null&&typeof e=="object"&&"type"in e}const xi=[],Ku=!0,on=!1,Zu="skip";function yi(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const o=It(i),l=r?-1:1;s(e,void 0,[])();function s(a,u,f){const c=a&&typeof a=="object"?a:{};if(typeof c.type=="string"){const h=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(a.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=xi,d,g,b;if((!n||o(a,u,f[f.length-1]||void 0))&&(h=ec(t(a,f)),h[0]===on))return h;if("children"in a&&a.children){const y=a;if(y.children&&h[0]!==Zu)for(g=(r?y.children.length:-1)+l,b=f.concat(y);g>-1&&g<y.children.length;){const C=y.children[g];if(d=s(C,g,b)(),d[0]===on)return d;g=typeof d[1]=="number"?d[1]:g+l}}return h}}}function ec(e){return Array.isArray(e)?e:typeof e=="number"?[Ku,e]:e==null?xi:[e]}function Tn(e,n,t,r){let i,o,l;typeof n=="function"&&typeof t!="function"?(o=void 0,l=n,i=t):(o=n,l=t,i=r),yi(e,o,s,i);function s(a,u){const f=u[u.length-1],c=f?f.children.indexOf(a):void 0;return l(a,c,f)}}const sn={}.hasOwnProperty,tc={};function nc(e,n){const t=n||tc,r=new Map,i=new Map,o=new Map,l={...Mu,...t.handlers},s={all:u,applyData:ic,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:a,options:t,patch:rc,wrap:oc};return Tn(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),s;function a(f,c){const p=f.type,h=s.handlers[p];if(sn.call(s.handlers,p)&&h)return h(s,f,c);if(s.options.passThrough&&s.options.passThrough.includes(p)){if("children"in f){const{children:g,...b}=f,y=St(b);return y.children=s.all(f),y}return St(f)}return(s.options.unknownHandler||lc)(s,f,c)}function u(f){const c=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const d=s.one(p[h],f);if(d){if(h&&p[h-1].type==="break"&&(!Array.isArray(d)&&d.type==="text"&&(d.value=mr(d.value)),!Array.isArray(d)&&d.type==="element")){const g=d.children[0];g&&g.type==="text"&&(g.value=mr(g.value))}Array.isArray(d)?c.push(...d):c.push(d)}}}return c}}function rc(e,n){e.position&&(n.position=Uo(e))}function ic(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const l="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:l}}t.type==="element"&&o&&Object.assign(t.properties,St(o)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function lc(e,n){const t=n.data||{},r="value"in n&&!(sn.call(t,"hProperties")||sn.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function oc(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
47
+ `});++r<e.length;)r&&t.push({type:"text",value:`
48
+ `}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
49
+ `}),t}function mr(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function gr(e,n){const t=nc(e,n),r=t.one(e,void 0),i=Wu(t),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
50
+ `},i),o}function sc(e,n){return e&&"run"in e?async function(t,r){const i=gr(t,{file:r,...n});await e.run(i,r)}:function(t,r){return gr(t,{file:r,...e||n})}}function xr(e){if(e)throw e}var Ft,yr;function ac(){if(yr)return Ft;yr=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},o=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),c=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!c)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},l=function(u,f){t&&f.name==="__proto__"?t(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},s=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return Ft=function a(){var u,f,c,p,h,d,g=arguments[0],b=1,y=arguments.length,C=!1;for(typeof g=="boolean"&&(C=g,g=arguments[1]||{},b=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});b<y;++b)if(u=arguments[b],u!=null)for(f in u)c=s(g,f),p=s(u,f),g!==p&&(C&&p&&(o(p)||(h=i(p)))?(h?(h=!1,d=c&&i(c)?c:[]):d=c&&o(c)?c:{},l(g,{name:f,newValue:a(C,d,p)})):typeof p<"u"&&l(g,{name:f,newValue:p}));return g},Ft}var uc=ac();const Rt=_r(uc);function an(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function cc(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);s(null,...i);function s(a,...u){const f=e[++o];let c=-1;if(a){l(a);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?fc(f,s)(...u):l(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function fc(e,n){let t;return r;function r(...l){const s=e.length>l.length;let a;s&&l.push(i);try{a=e.apply(this,l)}catch(u){const f=u;if(s&&t)throw f;return i(f)}s||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(l,...s){t||(t=!0,n(l,...s))}function o(l){i(null,l)}}const xe={basename:hc,dirname:pc,extname:dc,join:mc,sep:"/"};function hc(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');pt(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,s=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),s>-1&&(e.codePointAt(i)===n.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function pc(e){if(pt(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function dc(e){pt(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const s=e.codePointAt(n);if(s===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),s===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function mc(...e){let n=-1,t;for(;++n<e.length;)pt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":gc(t)}function gc(e){pt(e);const n=e.codePointAt(0)===47;let t=xc(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function xc(e,n){let t="",r=0,i=-1,o=0,l=-1,s,a;for(;++l<=e.length;){if(l<e.length)s=e.codePointAt(l);else{if(s===47)break;s=47}if(s===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(a=t.lastIndexOf("/"),a!==t.length-1){a<0?(t="",r=0):(t=t.slice(0,a),r=t.length-1-t.lastIndexOf("/")),i=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return t}function pt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const yc={cwd:kc};function kc(){return"/"}function un(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bc(e){if(typeof e=="string")e=new URL(e);else if(!un(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return wc(e)}function wc(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const Mt=["history","path","basename","stem","extname","dirname"];class ki{constructor(n){let t;n?un(n)?t={path:n}:typeof n=="string"||Sc(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":yc.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mt.length;){const o=Mt[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)Mt.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?xe.basename(this.path):void 0}set basename(n){Bt(n,"basename"),Ot(n,"basename"),this.path=xe.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?xe.dirname(this.path):void 0}set dirname(n){kr(this.basename,"dirname"),this.path=xe.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?xe.extname(this.path):void 0}set extname(n){if(Ot(n,"extname"),kr(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=xe.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){un(n)&&(n=bc(n)),Bt(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?xe.basename(this.path,this.extname):void 0}set stem(n){Bt(n,"stem"),Ot(n,"stem"),this.path=xe.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new Z(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Ot(e,n){if(e&&e.includes(xe.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+xe.sep+"`")}function Bt(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function kr(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function Sc(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Cc=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),Ec={}.hasOwnProperty;class vn extends Cc{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=cc()}copy(){const n=new vn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(Rt(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(qt("data",this.frozen),this.namespace[n]=t,this):Ec.call(this.namespace,n)&&this.namespace[n]||void 0:n?(qt("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=xt(n),r=this.parser||this.Parser;return $t("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),$t("process",this.parser||this.Parser),Ht("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const s=xt(n),a=r.parse(s);r.run(a,s,function(f,c,p){if(f||!c||!p)return u(f);const h=c,d=r.stringify(h,p);Ac(d)?p.value=d:p.result=d,u(f,p)});function u(f,c){f||!c?l(f):o?o(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),$t("processSync",this.parser||this.Parser),Ht("processSync",this.compiler||this.Compiler),this.process(n,i),wr("processSync","process",t),r;function i(o,l){t=!0,xr(o),r=l}}run(n,t,r){br(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,s){const a=xt(t);i.run(n,a,u);function u(f,c,p){const h=c||n;f?s(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),wr("runSync","run",r),i;function o(l,s){xr(l),i=s,r=!0}}stringify(n,t){this.freeze();const r=xt(t),i=this.compiler||this.Compiler;return Ht("stringify",i),br(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(qt("use",this.frozen),n!=null)if(typeof n=="function")a(n,t);else if(typeof n=="object")Array.isArray(n)?s(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(u){if(typeof u=="function")a(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;a(f,c)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(u){if(!("plugins"in u)&&!("settings"in u))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");s(u.plugins),u.settings&&(i.settings=Rt(!0,i.settings,u.settings))}function s(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function a(u,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===u){p=c;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[h,...d]=f;const g=r[p][1];an(g)&&an(h)&&(h=Rt(!0,g,h)),r[p]=[u,h,...d]}}}}const Tc=new vn().freeze();function $t(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ht(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qt(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function br(e){if(!an(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function xt(e){return vc(e)?e:new ki(e)}function vc(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ac(e){return typeof e=="string"||Ic(e)}function Ic(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Nc="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Sr=[],Cr={allowDangerousHtml:!0},Pc=/^(https?|ircs?|mailto|xmpp)$/i,_c=[{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 jc(e){const n=zc(e),t=Dc(e);return Lc(n.runSync(n.parse(t),t),e)}function zc(e){const n=e.rehypePlugins||Sr,t=e.remarkPlugins||Sr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Cr}:Cr;return Tc().use(hu).use(t).use(sc,r).use(n)}function Dc(e){const n=e.children||"",t=new ki;return typeof n=="string"&&(t.value=n),t}function Lc(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,l=n.skipHtml,s=n.unwrapDisallowed,a=n.urlTransform||Fc;for(const f of _c)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Nc+f.id,void 0);return Tn(e,u),Xo(e,{Fragment:k.Fragment,components:i,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function u(f,c,p){if(f.type==="raw"&&p&&typeof c=="number")return l?p.children.splice(c,1):p.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let h;for(h in zt)if(Object.hasOwn(zt,h)&&Object.hasOwn(f.properties,h)){const d=f.properties[h],g=zt[h];(g===null||g.includes(f.tagName))&&(f.properties[h]=a(String(d||""),h,f))}}if(f.type==="element"){let h=t?!t.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return s&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function Fc(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||Pc.test(e.slice(0,n))?e:""}function Er(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+n.length);return r}function Rc(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Mc(e,n,t){const i=It((t||{}).ignore||[]),o=Oc(n);let l=-1;for(;++l<o.length;)yi(e,"text",s);function s(u,f){let c=-1,p;for(;++c<f.length;){const h=f[c],d=p?p.children:void 0;if(i(h,d?d.indexOf(h):void 0,p))return;p=h}if(p)return a(u,f)}function a(u,f){const c=f[f.length-1],p=o[l][0],h=o[l][1];let d=0;const b=c.children.indexOf(u);let y=!1,C=[];p.lastIndex=0;let w=p.exec(u.value);for(;w;){const _=w.index,z={index:w.index,input:w.input,stack:[...f,u]};let E=h(...w,z);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=_+1:(d!==_&&C.push({type:"text",value:u.value.slice(d,_)}),Array.isArray(E)?C.push(...E):E&&C.push(E),d=_+w[0].length,y=!0),!p.global)break;w=p.exec(u.value)}return y?(d<u.value.length&&C.push({type:"text",value:u.value.slice(d)}),c.children.splice(b,1,...C)):C=[u],b+C.length}}function Oc(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const t=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<t.length;){const i=t[r];n.push([Bc(i[0]),$c(i[1])])}return n}function Bc(e){return typeof e=="string"?new RegExp(Rc(e),"g"):e}function $c(e){return typeof e=="function"?e:function(){return e}}const Ut="phrasing",Vt=["autolink","link","image","label"];function Hc(){return{transforms:[Xc],enter:{literalAutolink:Uc,literalAutolinkEmail:Wt,literalAutolinkHttp:Wt,literalAutolinkWww:Wt},exit:{literalAutolink:Yc,literalAutolinkEmail:Gc,literalAutolinkHttp:Vc,literalAutolinkWww:Wc}}}function qc(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ut,notInConstruct:Vt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ut,notInConstruct:Vt},{character:":",before:"[ps]",after:"\\/",inConstruct:Ut,notInConstruct:Vt}]}}function Uc(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Wt(e){this.config.enter.autolinkProtocol.call(this,e)}function Vc(e){this.config.exit.autolinkProtocol.call(this,e)}function Wc(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function Gc(e){this.config.exit.autolinkEmail.call(this,e)}function Yc(e){this.exit(e)}function Xc(e){Mc(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Qc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Jc]],{ignore:["link","linkReference"]})}function Qc(e,n,t,r,i){let o="";if(!bi(i)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!Kc(t)))return!1;const l=Zc(t+r);if(!l[0])return!1;const s={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[s,{type:"text",value:l[1]}]:s}function Jc(e,n,t,r){return!bi(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function Kc(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function Zc(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const i=Er(e,"(");let o=Er(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function bi(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||ze(t)||Tt(t))&&(!n||t!==47)}wi.peek=uf;function ef(){this.buffer()}function tf(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function nf(){this.buffer()}function rf(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lf(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=de(this.sliceSerialize(e)).toLowerCase(),t.label=n}function of(e){this.exit(e)}function sf(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=de(this.sliceSerialize(e)).toLowerCase(),t.label=n}function af(e){this.exit(e)}function uf(){return"["}function wi(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const l=t.enter("footnoteReference"),s=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),s(),l(),o+=i.move("]"),o}function cf(){return{enter:{gfmFootnoteCallString:ef,gfmFootnoteCall:tf,gfmFootnoteDefinitionLabelString:nf,gfmFootnoteDefinition:rf},exit:{gfmFootnoteCallString:lf,gfmFootnoteCall:of,gfmFootnoteDefinitionLabelString:sf,gfmFootnoteDefinition:af}}}function ff(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:wi},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,l){const s=o.createTracker(l);let a=s.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return a+=s.move(o.safe(o.associationId(r),{before:a,after:"]"})),f(),a+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),a+=s.move((n?`
51
+ `:" ")+o.indentLines(o.containerFlow(r,s.current()),n?Si:hf))),u(),a}}function hf(e,n,t){return n===0?e:Si(e,n,t)}function Si(e,n,t){return(t?"":" ")+e}const pf=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ci.peek=yf;function df(){return{canContainEols:["delete"],enter:{strikethrough:gf},exit:{strikethrough:xf}}}function mf(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:pf}],handlers:{delete:Ci}}}function gf(e){this.enter({type:"delete",children:[]},e)}function xf(e){this.exit(e)}function Ci(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function yf(){return"~"}function kf(e){return e.length}function bf(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||kf,o=[],l=[],s=[],a=[];let u=0,f=-1;for(;++f<e.length;){const g=[],b=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const C=wf(e[f][y]);if(t.alignDelimiters!==!1){const w=i(C);b[y]=w,(a[y]===void 0||w>a[y])&&(a[y]=w)}g.push(C)}l[f]=g,s[f]=b}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=Tr(r[c]);else{const g=Tr(r);for(;++c<u;)o[c]=g}c=-1;const p=[],h=[];for(;++c<u;){const g=o[c];let b="",y="";g===99?(b=":",y=":"):g===108?b=":":g===114&&(y=":");let C=t.alignDelimiters===!1?1:Math.max(1,a[c]-b.length-y.length);const w=b+"-".repeat(C)+y;t.alignDelimiters!==!1&&(C=b.length+C+y.length,C>a[c]&&(a[c]=C),h[c]=C),p[c]=w}l.splice(1,0,p),s.splice(1,0,h),f=-1;const d=[];for(;++f<l.length;){const g=l[f],b=s[f];c=-1;const y=[];for(;++c<u;){const C=g[c]||"";let w="",_="";if(t.alignDelimiters!==!1){const z=a[c]-(b[c]||0),E=o[c];E===114?w=" ".repeat(z):E===99?z%2?(w=" ".repeat(z/2+.5),_=" ".repeat(z/2-.5)):(w=" ".repeat(z/2),_=w):_=" ".repeat(z)}t.delimiterStart!==!1&&!c&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&C==="")&&(t.delimiterStart!==!1||c)&&y.push(" "),t.alignDelimiters!==!1&&y.push(w),y.push(C),t.alignDelimiters!==!1&&y.push(_),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||c!==u-1)&&y.push("|")}d.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return d.join(`
52
+ `)}function wf(e){return e==null?"":String(e)}function Tr(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function Sf(e,n,t,r){const i=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);const l=t.indentLines(t.containerFlow(e,o.current()),Cf);return i(),l}function Cf(e,n,t){return">"+(t?"":" ")+e}function Ef(e,n){return vr(e,n.inConstruct,!0)&&!vr(e,n.notInConstruct,!1)}function vr(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function Ar(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
53
+ `&&Ef(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
54
+ `}function Tf(e,n){const t=String(e);let r=t.indexOf(n),i=r,o=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+n.length,r=t.indexOf(n,i);return l}function vf(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Af(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function If(e,n,t,r){const i=Af(t),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(vf(e,t)){const c=t.enter("codeIndented"),p=t.indentLines(o,Nf);return c(),p}const s=t.createTracker(r),a=i.repeat(Math.max(Tf(o,i)+1,3)),u=t.enter("codeFenced");let f=s.move(a);if(e.lang){const c=t.enter(`codeFencedLang${l}`);f+=s.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...s.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${l}`);f+=s.move(" "),f+=s.move(t.safe(e.meta,{before:f,after:`
55
+ `,encode:["`"],...s.current()})),c()}return f+=s.move(`
56
+ `),o&&(f+=s.move(o+`
57
+ `)),f+=s.move(a),u(),f}function Nf(e,n,t){return(t?"":" ")+e}function An(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Pf(e,n,t,r){const i=An(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("definition");let s=t.enter("label");const a=t.createTracker(r);let u=a.move("[");return u+=a.move(t.safe(t.associationId(e),{before:u,after:"]",...a.current()})),u+=a.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(s=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":`
58
+ `,...a.current()}))),s(),e.title&&(s=t.enter(`title${o}`),u+=a.move(" "+i),u+=a.move(t.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),s()),l(),u}function _f(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function ct(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ct(e,n,t){const r=Ve(e),i=Ve(n);return r===void 0?i===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ei.peek=jf;function Ei(e,n,t,r){const i=_f(t),o=t.enter("emphasis"),l=t.createTracker(r),s=l.move(i);let a=l.move(t.containerPhrasing(e,{after:i,before:s,...l.current()}));const u=a.charCodeAt(0),f=Ct(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(a=ct(u)+a.slice(1));const c=a.charCodeAt(a.length-1),p=Ct(r.after.charCodeAt(0),c,i);p.inside&&(a=a.slice(0,-1)+ct(c));const h=l.move(i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+a+h}function jf(e,n,t){return t.options.emphasis||"*"}function zf(e,n){let t=!1;return Tn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,on}),!!((!e.depth||e.depth<3)&&yn(e)&&(n.options.setext||t))}function Df(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(zf(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),p=t.containerPhrasing(e,{...o.current(),before:`
59
+ `,after:`
60
+ `});return c(),f(),p+`
61
+ `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
62
+ `))+1))}const l="#".repeat(i),s=t.enter("headingAtx"),a=t.enter("phrasing");o.move(l+" ");let u=t.containerPhrasing(e,{before:"# ",after:`
63
+ `,...o.current()});return/^[\t ]/.test(u)&&(u=ct(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,t.options.closeAtx&&(u+=" "+l),a(),s(),u}Ti.peek=Lf;function Ti(e){return e.value||""}function Lf(){return"<"}vi.peek=Ff;function vi(e,n,t,r){const i=An(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let s=t.enter("label");const a=t.createTracker(r);let u=a.move("![");return u+=a.move(t.safe(e.alt,{before:u,after:"]",...a.current()})),u+=a.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(s=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),s(),e.title&&(s=t.enter(`title${o}`),u+=a.move(" "+i),u+=a.move(t.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),s()),u+=a.move(")"),l(),u}function Ff(){return"!"}Ai.peek=Rf;function Ai(e,n,t,r){const i=e.referenceType,o=t.enter("imageReference");let l=t.enter("label");const s=t.createTracker(r);let a=s.move("![");const u=t.safe(e.alt,{before:a,after:"]",...s.current()});a+=s.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:a,after:"]",...s.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?a+=s.move(c+"]"):i==="shortcut"?a=a.slice(0,-1):a+=s.move("]"),a}function Rf(){return"!"}Ii.peek=Mf;function Ii(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const l=t.unsafe[o],s=t.compilePattern(l);let a;if(l.atBreak)for(;a=s.exec(r);){let u=a.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(a.index+1)}}return i+r+i}function Mf(){return"`"}function Ni(e,n){const t=yn(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Pi.peek=Of;function Pi(e,n,t,r){const i=An(t),o=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let s,a;if(Ni(e,t)){const f=t.stack;t.stack=[],s=t.enter("autolink");let c=l.move("<");return c+=l.move(t.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),s(),t.stack=f,c}s=t.enter("link"),a=t.enter("label");let u=l.move("[");return u+=l.move(t.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(t.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function Of(e,n,t){return Ni(e,t)?"<":"["}_i.peek=Bf;function _i(e,n,t,r){const i=e.referenceType,o=t.enter("linkReference");let l=t.enter("label");const s=t.createTracker(r);let a=s.move("[");const u=t.containerPhrasing(e,{before:a,after:"]",...s.current()});a+=s.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:a,after:"]",...s.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?a+=s.move(c+"]"):i==="shortcut"?a=a.slice(0,-1):a+=s.move("]"),a}function Bf(){return"["}function In(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function $f(e){const n=In(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Hf(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function ji(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function qf(e,n,t,r){const i=t.enter("list"),o=t.bulletCurrent;let l=e.ordered?Hf(t):In(t);const s=e.ordered?l==="."?")":".":$f(t);let a=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(a=!0),ji(t)===l&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(l=s),t.bulletCurrent=l;const u=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=o,i(),u}function Uf(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function Vf(e,n,t,r){const i=Uf(t);let o=t.bulletCurrent||In(t);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const s=t.createTracker(r);s.move(o+" ".repeat(l-o.length)),s.shift(l);const a=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,s.current()),f);return a(),u;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?o:o+" ".repeat(l-o.length))+c}}function Wf(e,n,t,r){const i=t.enter("paragraph"),o=t.enter("phrasing"),l=t.containerPhrasing(e,r);return o(),i(),l}const Gf=It(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Yf(e,n,t,r){return(e.children.some(function(l){return Gf(l)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Xf(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}zi.peek=Qf;function zi(e,n,t,r){const i=Xf(t),o=t.enter("strong"),l=t.createTracker(r),s=l.move(i+i);let a=l.move(t.containerPhrasing(e,{after:i,before:s,...l.current()}));const u=a.charCodeAt(0),f=Ct(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(a=ct(u)+a.slice(1));const c=a.charCodeAt(a.length-1),p=Ct(r.after.charCodeAt(0),c,i);p.inside&&(a=a.slice(0,-1)+ct(c));const h=l.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},s+a+h}function Qf(e,n,t){return t.options.strong||"*"}function Jf(e,n,t,r){return t.safe(e.value,r)}function Kf(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function Zf(e,n,t){const r=(ji(t)+(t.options.ruleSpaces?" ":"")).repeat(Kf(t));return t.options.ruleSpaces?r.slice(0,-1):r}const Di={blockquote:Sf,break:Ar,code:If,definition:Pf,emphasis:Ei,hardBreak:Ar,heading:Df,html:Ti,image:vi,imageReference:Ai,inlineCode:Ii,link:Pi,linkReference:_i,list:qf,listItem:Vf,paragraph:Wf,root:Yf,strong:zi,text:Jf,thematicBreak:Zf};function eh(){return{enter:{table:th,tableData:Ir,tableHeader:Ir,tableRow:rh},exit:{codeText:ih,table:nh,tableData:Gt,tableHeader:Gt,tableRow:Gt}}}function th(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function nh(e){this.exit(e),this.data.inTable=void 0}function rh(e){this.enter({type:"tableRow",children:[]},e)}function Gt(e){this.exit(e)}function Ir(e){this.enter({type:"tableCell",children:[]},e)}function ih(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,lh));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function lh(e,n){return n==="|"?n:e}function oh(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,o=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
64
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:a,tableRow:s}};function l(h,d,g,b){return u(f(h,g,b),h.align)}function s(h,d,g,b){const y=c(h,g,b),C=u([y]);return C.slice(0,C.indexOf(`
65
+ `))}function a(h,d,g,b){const y=g.enter("tableCell"),C=g.enter("phrasing"),w=g.containerPhrasing(h,{...b,before:o,after:o});return C(),y(),w}function u(h,d){return bf(h,{align:d,alignDelimiters:r,padding:t,stringLength:i})}function f(h,d,g){const b=h.children;let y=-1;const C=[],w=d.enter("table");for(;++y<b.length;)C[y]=c(b[y],d,g);return w(),C}function c(h,d,g){const b=h.children;let y=-1;const C=[],w=d.enter("tableRow");for(;++y<b.length;)C[y]=a(b[y],h,d,g);return w(),C}function p(h,d,g){let b=Di.inlineCode(h,d,g);return g.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function sh(){return{exit:{taskListCheckValueChecked:Nr,taskListCheckValueUnchecked:Nr,paragraph:uh}}}function ah(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ch}}}function Nr(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function uh(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let o=-1,l;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){l=s;break}}l===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function ch(e,n,t,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",s=t.createTracker(r);o&&s.move(l);let a=Di.listItem(e,n,t,{...r,...s.current()});return o&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),a;function u(f){return f+l}}function fh(){return[Hc(),cf(),df(),eh(),sh()]}function hh(e){return{extensions:[qc(),ff(e),mf(),oh(e),ah()]}}const ph={tokenize:kh,partial:!0},Li={tokenize:bh,partial:!0},Fi={tokenize:wh,partial:!0},Ri={tokenize:Sh,partial:!0},dh={tokenize:Ch,partial:!0},Mi={name:"wwwAutolink",tokenize:xh,previous:Bi},Oi={name:"protocolAutolink",tokenize:yh,previous:$i},Ee={name:"emailAutolink",tokenize:gh,previous:Hi},ye={};function mh(){return{text:ye}}let Pe=48;for(;Pe<123;)ye[Pe]=Ee,Pe++,Pe===58?Pe=65:Pe===91&&(Pe=97);ye[43]=Ee;ye[45]=Ee;ye[46]=Ee;ye[95]=Ee;ye[72]=[Ee,Oi];ye[104]=[Ee,Oi];ye[87]=[Ee,Mi];ye[119]=[Ee,Mi];function gh(e,n,t){const r=this;let i,o;return l;function l(c){return!cn(c)||!Hi.call(r,r.previous)||Nn(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(c))}function s(c){return cn(c)?(e.consume(c),s):c===64?(e.consume(c),a):t(c)}function a(c){return c===46?e.check(dh,f,u)(c):c===45||c===95||K(c)?(o=!0,e.consume(c),a):f(c)}function u(c){return e.consume(c),i=!0,a}function f(c){return o&&i&&ee(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function xh(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!Bi.call(r,r.previous)||Nn(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ph,e.attempt(Li,e.attempt(Fi,o),t),t)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function yh(e,n,t){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&$i.call(r,r.previous)&&!Nn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),s):t(c)}function s(c){if(ee(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),s;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),a}return t(c)}function a(c){return c===47?(e.consume(c),o?u:(o=!0,a)):t(c)}function u(c){return c===null||bt(c)||G(c)||ze(c)||Tt(c)?t(c):e.attempt(Li,e.attempt(Fi,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function kh(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):t(l)}function o(l){return l===null?t(l):n(l)}}function bh(e,n,t){let r,i,o;return l;function l(u){return u===46||u===95?e.check(Ri,a,s)(u):u===null||G(u)||ze(u)||u!==45&&Tt(u)?a(u):(o=!0,e.consume(u),l)}function s(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function a(u){return i||r||!o?t(u):n(u)}}function wh(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Ri,n,o)(l):l===null||G(l)||ze(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function Sh(e,n,t){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||G(s)||ze(s)?n(s):t(s)}function i(s){return s===null||s===40||s===91||G(s)||ze(s)?n(s):r(s)}function o(s){return ee(s)?l(s):t(s)}function l(s){return s===59?(e.consume(s),r):ee(s)?(e.consume(s),l):t(s)}}function Ch(e,n,t){return r;function r(o){return e.consume(o),i}function i(o){return K(o)?t(o):n(o)}}function Bi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function $i(e){return!ee(e)}function Hi(e){return!(e===47||cn(e))}function cn(e){return e===43||e===45||e===46||e===95||K(e)}function Nn(e){let n=e.length,t=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const Eh={tokenize:jh,partial:!0};function Th(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Nh,continuation:{tokenize:Ph},exit:_h}},text:{91:{name:"gfmFootnoteCall",tokenize:Ih},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vh,resolveTo:Ah}}}}function vh(e,n,t){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const a=r.events[i][1];if(a.type==="labelImage"){l=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return s;function s(a){if(!l||!l._balanced)return t(a);const u=de(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?t(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),n(a))}}function Ah(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",l,n],["exit",l,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...s),e}function Ih(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return s;function s(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),a}function a(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!l||c===null||c===91||G(c))return t(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(de(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return G(c)||(l=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function Nh(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,s;return a;function a(d){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(d),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(d){return d===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(d),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(d)}function f(d){if(l>999||d===93&&!s||d===null||d===91||G(d))return t(d);if(d===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return o=de(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(d),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return G(d)||(s=!0),l++,e.consume(d),d===92?c:f}function c(d){return d===91||d===92||d===93?(e.consume(d),l++,f):f(d)}function p(d){return d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),i.includes(o)||i.push(o),H(e,h,"gfmFootnoteDefinitionWhitespace")):t(d)}function h(d){return n(d)}}function Ph(e,n,t){return e.check(ht,n,e.attempt(Eh,n,t))}function _h(e){e.exit("gfmFootnoteDefinition")}function jh(e,n,t){const r=this;return H(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(o):t(o)}}function zh(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,s){let a=-1;for(;++a<l.length;)if(l[a][0]==="enter"&&l[a][1].type==="strikethroughSequenceTemporary"&&l[a][1]._close){let u=a;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[a][1].end.offset-l[a][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[a][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[a][1].end)},c={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[a][1].start)},p=[["enter",f,s],["enter",l[u][1],s],["exit",l[u][1],s],["enter",c,s]],h=s.parser.constructs.insideSpan.null;h&&oe(p,p.length,0,vt(h,l.slice(u+1,a),s)),oe(p,p.length,0,[["exit",c,s],["enter",l[a][1],s],["exit",l[a][1],s],["exit",f,s]]),oe(l,u-1,a-u+3,p),a=u+p.length-2;break}}for(a=-1;++a<l.length;)l[a][1].type==="strikethroughSequenceTemporary"&&(l[a][1].type="data");return l}function o(l,s,a){const u=this.previous,f=this.events;let c=0;return p;function p(d){return u===126&&f[f.length-1][1].type!=="characterEscape"?a(d):(l.enter("strikethroughSequenceTemporary"),h(d))}function h(d){const g=Ve(u);if(d===126)return c>1?a(d):(l.consume(d),c++,h);if(c<2&&!t)return a(d);const b=l.exit("strikethroughSequenceTemporary"),y=Ve(d);return b._open=!y||y===2&&!!g,b._close=!g||g===2&&!!y,s(d)}}}class Dh{constructor(){this.map=[]}add(n,t,r){Lh(this,n,t,r)}consume(n){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.pop()}this.map.length=0}}function Lh(e,n,t,r){let i=0;if(!(t===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===n){e.map[i][1]+=t,e.map[i][2].push(...r);return}i+=1}e.map.push([n,t,r])}}function Fh(e,n){let t=!1;const r=[];for(;n<e.length;){const i=e[n];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function Rh(){return{flow:{null:{name:"table",tokenize:Mh,resolveAll:Oh}}}}function Mh(e,n,t){const r=this;let i=0,o=0,l;return s;function s(S){let j=r.events.length-1;for(;j>-1;){const L=r.events[j][1].type;if(L==="lineEnding"||L==="linePrefix")j--;else break}const P=j>-1?r.events[j][1].type:null,q=P==="tableHead"||P==="tableRow"?E:a;return q===E&&r.parser.lazy[r.now().line]?t(S):q(S)}function a(S){return e.enter("tableHead"),e.enter("tableRow"),u(S)}function u(S){return S===124||(l=!0,o+=1),f(S)}function f(S){return S===null?t(S):D(S)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),h):t(S):O(S)?H(e,f,"whitespace")(S):(o+=1,l&&(l=!1,i+=1),S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(S)))}function c(S){return S===null||S===124||G(S)?(e.exit("data"),f(S)):(e.consume(S),S===92?p:c)}function p(S){return S===92||S===124?(e.consume(S),c):c(S)}function h(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(S):(e.enter("tableDelimiterRow"),l=!1,O(S)?H(e,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):d(S))}function d(S){return S===45||S===58?b(S):S===124?(l=!0,e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),g):z(S)}function g(S){return O(S)?H(e,b,"whitespace")(S):b(S)}function b(S){return S===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),y):S===45?(o+=1,y(S)):S===null||D(S)?_(S):z(S)}function y(S){return S===45?(e.enter("tableDelimiterFiller"),C(S)):z(S)}function C(S){return S===45?(e.consume(S),C):S===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(S))}function w(S){return O(S)?H(e,_,"whitespace")(S):_(S)}function _(S){return S===124?d(S):S===null||D(S)?!l||i!==o?z(S):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(S)):z(S)}function z(S){return t(S)}function E(S){return e.enter("tableRow"),M(S)}function M(S){return S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),M):S===null||D(S)?(e.exit("tableRow"),n(S)):O(S)?H(e,M,"whitespace")(S):(e.enter("data"),$(S))}function $(S){return S===null||S===124||G(S)?(e.exit("data"),M(S)):(e.consume(S),S===92?A:$)}function A(S){return S===92||S===124?(e.consume(S),$):$(S)}}function Oh(e,n){let t=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],s=!1,a=0,u,f,c;const p=new Dh;for(;++t<e.length;){const h=e[t],d=h[1];h[0]==="enter"?d.type==="tableHead"?(s=!1,a!==0&&(Pr(p,n,a,u,f),f=void 0,a=0),u={type:"table",start:Object.assign({},d.start),end:Object.assign({},d.end)},p.add(t,0,[["enter",u,n]])):d.type==="tableRow"||d.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,t+1,0,0],s&&(s=!1,f={type:"tableBody",start:Object.assign({},d.start),end:Object.assign({},d.end)},p.add(t,0,[["enter",f,n]])),i=d.type==="tableDelimiterRow"?2:f?3:1):i&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],c=yt(p,n,o,i,void 0,c),o=[0,0,0,0]),l[2]=t)):d.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=yt(p,n,o,i,void 0,c)),o=l,l=[o[1],t,0,0])):d.type==="tableHead"?(s=!0,a=t):d.type==="tableRow"||d.type==="tableDelimiterRow"?(a=t,o[1]!==0?(l[0]=l[1],c=yt(p,n,o,i,t,c)):l[1]!==0&&(c=yt(p,n,l,i,t,c)),i=0):i&&(d.type==="data"||d.type==="tableDelimiterMarker"||d.type==="tableDelimiterFiller")&&(l[3]=t)}for(a!==0&&Pr(p,n,a,u,f),p.consume(n.events),t=-1;++t<n.events.length;){const h=n.events[t];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Fh(n.events,t))}return e}function yt(e,n,t,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";t[0]!==0&&(o.end=Object.assign({},qe(n.events,t[0])),e.add(t[0],0,[["exit",o,n]]));const a=qe(n.events,t[1]);if(o={type:l,start:Object.assign({},a),end:Object.assign({},a)},e.add(t[1],0,[["enter",o,n]]),t[2]!==0){const u=qe(n.events,t[2]),f=qe(n.events,t[3]),c={type:s,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",c,n]]),r!==2){const p=n.events[t[2]],h=n.events[t[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",t[3]>t[2]+1){const d=t[2]+1,g=t[3]-t[2]-1;e.add(d,g,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(o.end=Object.assign({},qe(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function Pr(e,n,t,r,i){const o=[],l=qe(n.events,t);i&&(i.end=Object.assign({},l),o.push(["exit",i,n])),r.end=Object.assign({},l),o.push(["exit",r,n]),e.add(t+1,0,o)}function qe(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Bh={name:"tasklistCheck",tokenize:Hh};function $h(){return{text:{91:Bh}}}function Hh(e,n,t){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),o)}function o(a){return G(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),l):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),l):t(a)}function l(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):t(a)}function s(a){return D(a)?n(a):O(a)?e.check({tokenize:qh},n,t)(a):t(a)}}function qh(e,n,t){return H(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function Uh(e){return Zr([mh(),Th(),zh(e),Rh(),$h()])}const Vh={};function Wh(e){const n=this,t=e||Vh,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Uh(t)),o.push(fh()),l.push(hh(t))}function Gh(e){const n=e.split(`
66
+ `),t=[];let r=[],i=!1;const o=()=>{const l=r.join(`
67
+ `);l.trim()&&t.push(l),r=[]};for(const l of n){if(/^\s*(```|~~~)/.test(l)){i=!i,r.push(l);continue}if(!i&&l.trim()===""){o();continue}r.push(l)}return o(),t}const Yh={a:({node:e,...n})=>k.jsx("a",{...n,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 break-all"}),pre:({node:e,...n})=>k.jsx("pre",{...n,className:"bg-muted overflow-x-auto rounded-md p-2 font-mono text-xs leading-relaxed"}),code:({node:e,className:n,...t})=>k.jsx("code",{...t,className:me("bg-muted rounded px-1 font-mono text-xs",n)}),ul:({node:e,...n})=>k.jsx("ul",{...n,className:"list-disc pl-5"}),ol:({node:e,...n})=>k.jsx("ol",{...n,className:"list-decimal pl-5"}),blockquote:({node:e,...n})=>k.jsx("blockquote",{...n,className:"border-border text-muted-foreground border-l-2 pl-2"}),h1:({node:e,...n})=>k.jsx("h1",{...n,className:"text-base font-semibold"}),h2:({node:e,...n})=>k.jsx("h2",{...n,className:"text-sm font-semibold"}),h3:({node:e,...n})=>k.jsx("h3",{...n,className:"text-sm font-semibold"}),table:({node:e,...n})=>k.jsx("div",{className:"overflow-x-auto",children:k.jsx("table",{...n,className:"border-border w-full border-collapse border text-xs"})}),th:({node:e,...n})=>k.jsx("th",{...n,className:"border-border bg-muted border px-2 py-1 text-left"}),td:({node:e,...n})=>k.jsx("td",{...n,className:"border-border border px-2 py-1"})},Xh=ne.memo(function({content:n}){return k.jsx(jc,{remarkPlugins:[Wh],components:Yh,children:n})});function Qh({text:e,streaming:n=!1,className:t}){const r=ne.useMemo(()=>Gh(e),[e]);return k.jsxs("div",{className:me("flex min-w-0 flex-col gap-2 text-sm leading-relaxed",t),children:[r.map((i,o)=>k.jsx(Xh,{content:i},o)),n&&k.jsx("span",{"data-testid":"agent-streaming-cursor",className:"bg-foreground inline-block h-4 w-2 animate-pulse self-start"})]})}function Jh({text:e,streaming:n=!1,className:t}){return k.jsx("div",{"data-testid":"agent-assistant-message",className:me("min-w-0 max-w-full self-start",t),children:k.jsx(Qh,{text:e,streaming:n})})}function Kh({text:e,streaming:n=!1,className:t}){const{t:r}=ge();return k.jsxs(jr,{"data-testid":"agent-reasoning-block",className:me("min-w-0 max-w-full self-start",t),children:[k.jsxs(zr,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[k.jsx(Dr,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),k.jsx(eo,{className:"size-3"}),k.jsx("span",{children:r("agent.reasoning.title")}),n&&k.jsx(Lr,{className:"size-3 animate-spin"})]}),k.jsx(Fr,{children:k.jsx("div",{className:"text-muted-foreground border-border mt-1 border-l-2 pl-2 text-xs whitespace-pre-wrap break-words",children:e})})]})}function De(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fn(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Zh(e){return De(e.output)&&typeof e.output.error=="string"?e.output.error:e.isError?fn(e.output):null}function ep(e){switch(e){case"send_input":return k.jsx(Xl,{className:"size-3.5"});case"read_screen":return k.jsx(yl,{className:"size-3.5"});case"web_search":return k.jsx(io,{className:"size-3.5"});case"fetch_url":return k.jsx(xl,{className:"size-3.5"});default:return k.jsx(co,{className:"size-3.5"})}}function We({label:e,text:n}){return k.jsxs(jr,{children:[k.jsxs(zr,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[k.jsx(Dr,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),k.jsx("span",{children:e})]}),k.jsx(Fr,{children:k.jsx("pre",{className:"bg-muted mt-1 max-h-64 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:n})})]})}function tp(e){if(typeof e!="string")return null;try{const n=JSON.parse(e);return Array.isArray(n)?n.filter(De).map(t=>({title:typeof t.title=="string"?t.title:"",url:typeof t.url=="string"?t.url:"",snippet:typeof t.snippet=="string"?t.snippet:""})).filter(t=>t.url):null}catch{return null}}function np({call:e}){const{t:n}=ge(),t=De(e.input)?e.input:{},r=typeof t.text=="string"?t.text:"",i=Array.isArray(t.keys)?t.keys.filter(s=>typeof s=="string"):[],o=De(e.output)?e.output:{},l=typeof o.screenTail=="string"?o.screenTail:"";return k.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&k.jsx("pre",{className:"bg-muted max-h-40 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:r}),i.length>0&&k.jsx("div",{className:"flex flex-wrap items-center gap-1",children:i.map((s,a)=>k.jsx(kl,{variant:"outline",className:"font-mono",children:s},`${a}-${s}`))}),l&&k.jsx(We,{label:n("agent.tool.result"),text:l})]})}function rp({call:e}){const{t:n}=ge(),t=De(e.output)?e.output:{},r=typeof t.screen=="string"?t.screen:"";return r?k.jsx(We,{label:n("agent.tool.screen"),text:r}):null}function ip({call:e}){const{t:n}=ge(),t=De(e.input)?e.input:{},r=typeof t.query=="string"?t.query:"",i=e.resolved&&!e.isError&&!e.denied?tp(e.output):null;return k.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&k.jsxs("p",{className:"text-muted-foreground text-xs break-words",children:["“",r,"”"]}),i&&i.length>0&&k.jsx("ul",{className:"flex flex-col gap-1",children:i.map(o=>k.jsxs("li",{className:"min-w-0 text-xs",children:[k.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate underline underline-offset-2",title:o.title||o.url,children:o.title||o.url}),o.snippet&&k.jsx("p",{className:"text-muted-foreground line-clamp-2 break-words",children:o.snippet})]},o.url))}),e.resolved&&!e.isError&&!e.denied&&!i&&typeof e.output=="string"&&k.jsx(We,{label:n("agent.tool.result"),text:e.output})]})}function lp({call:e}){const{t:n}=ge(),t=De(e.input)?e.input:{},r=typeof t.url=="string"?t.url:"",i=typeof e.output=="string"?e.output:"";return k.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&k.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate text-xs underline underline-offset-2",title:r,children:r}),e.resolved&&!e.isError&&!e.denied&&i&&k.jsx(We,{label:n("agent.tool.result"),text:i})]})}function op({call:e}){const{t:n}=ge();return k.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.input!==void 0&&k.jsx(We,{label:n("agent.tool.input"),text:fn(e.input)}),e.resolved&&!e.isError&&!e.denied&&e.output!==void 0&&k.jsx(We,{label:n("agent.tool.result"),text:fn(e.output)})]})}function sp({call:e,confirmationId:n,onDecide:t,className:r}){const{t:i}=ge(),o=!!n&&!e.resolved,l=e.resolved&&e.denied,s=e.resolved&&!l?Zh(e):null,a=!e.resolved&&!o,u=l&&typeof e.output=="string"?e.output:"",f=`agent.tool.${e.toolName}`,c=["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)?i(f):e.toolName;return k.jsxs("div",{"data-testid":`agent-tool-card-${e.toolCallId}`,"data-tool-name":e.toolName,"data-tool-denied":l||void 0,className:me("border-border bg-card flex max-w-full min-w-0 flex-col gap-1.5 self-start rounded-md border p-2",s!==null&&"border-destructive/50",l&&"opacity-80",r),children:[k.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[ep(e.toolName),k.jsx("span",{className:"min-w-0 truncate",children:c}),a&&k.jsx(Lr,{className:"text-muted-foreground size-3 animate-spin"}),e.resolved&&!l&&s===null&&k.jsx(Yt,{className:"size-3 text-emerald-500"}),s!==null&&k.jsx(Xt,{className:"text-destructive size-3"}),l&&k.jsxs("span",{className:"text-destructive flex items-center gap-0.5",children:[k.jsx(Ln,{className:"size-3"}),i("agent.tool.denied")]})]}),e.toolName==="send_input"&&k.jsx(np,{call:e}),e.toolName==="read_screen"&&k.jsx(rp,{call:e}),e.toolName==="web_search"&&k.jsx(ip,{call:e}),e.toolName==="fetch_url"&&k.jsx(lp,{call:e}),!["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)&&k.jsx(op,{call:e}),s!==null&&k.jsx("p",{className:"text-destructive text-xs break-words whitespace-pre-wrap",children:s}),u&&k.jsx("p",{className:"text-muted-foreground text-xs break-words whitespace-pre-wrap",children:u}),o&&n&&k.jsxs("div",{"data-testid":`agent-tool-approval-${e.toolCallId}`,className:"flex items-center gap-2 pt-1",children:[k.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:i("agent.confirm.title")}),k.jsxs(pe,{"data-testid":"agent-confirm-approve",size:"xs",variant:"secondary",onClick:()=>t==null?void 0:t(n,!0),children:[k.jsx(Yt,{}),i("agent.confirm.approve")]}),k.jsxs(pe,{"data-testid":"agent-confirm-deny",size:"xs",variant:"destructive",onClick:()=>t==null?void 0:t(n,!1),children:[k.jsx(Ln,{}),i("agent.confirm.deny")]})]})]})}function ap({text:e,className:n}){return k.jsx("div",{"data-testid":"agent-user-message",className:me("bg-primary text-primary-foreground max-w-[85%] self-end rounded-lg px-3 py-2 text-sm whitespace-pre-wrap break-words",n),children:e})}const up=48;function cp(){return k.jsxs("div",{"data-testid":"agent-running-indicator",className:"flex items-center gap-1 self-start px-1",children:[k.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full"}),k.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:150ms]"}),k.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:300ms]"})]})}function fp({blocks:e,running:n,emptyText:t,confirmationByToolCallId:r,onDecide:i,className:o}){const{t:l}=ge(),s=ne.useRef(null),a=ne.useRef(!0),[u,f]=ne.useState(!1),c=()=>{const h=s.current;h&&(h.scrollTop=h.scrollHeight,a.current=!0,f(!1))};ne.useEffect(()=>{if(a.current){const h=s.current;h&&(h.scrollTop=h.scrollHeight)}else f(!0)},[e,n]);const p=()=>{const h=s.current;if(!h)return;const g=h.scrollHeight-h.scrollTop-h.clientHeight<up;a.current=g,f(!g)};return e.length===0&&!n?k.jsx("div",{"data-testid":"agent-chat-thread",className:me("flex min-h-0 flex-1 items-center justify-center p-4",o),children:k.jsx("p",{className:"text-muted-foreground text-sm",children:t})}):k.jsxs("div",{className:me("relative min-h-0 flex-1",o),children:[k.jsx("div",{ref:s,"data-testid":"agent-chat-thread",className:"h-full overflow-y-auto p-3",onScroll:p,children:k.jsxs("div",{className:"flex flex-col gap-3",children:[e.map(h=>{switch(h.kind){case"user":return k.jsx(ap,{text:h.text},h.key);case"assistant-text":return k.jsx(Jh,{text:h.text,streaming:h.streaming},h.key);case"reasoning":return k.jsx(Kh,{text:h.text,streaming:h.streaming},h.key);case"tool-call":return k.jsx(sp,{call:h.call,confirmationId:r.get(h.call.toolCallId),onDecide:i},h.key);default:return null}}),n&&k.jsx(cp,{})]})}),u&&k.jsx(pe,{"data-testid":"agent-scroll-to-bottom",size:"icon-sm",variant:"secondary",className:"absolute right-3 bottom-3 z-10 rounded-full shadow-md",onClick:c,"aria-label":l("agent.panel.scrollToBottom"),children:k.jsx(Kl,{})})]})}function hp({sessions:e,currentSessionId:n,showAll:t,onToggleShowAll:r,onSelect:i,onCreate:o,onRename:l,onDelete:s,createDisabled:a,createDisabledReason:u}){const{t:f}=ge(),c=e.find(w=>w.id===n),[p,h]=ne.useState(null),[d,g]=ne.useState(""),[b,y]=ne.useState(null),C=()=>{const w=d.trim();p&&w&&l(p.id,w),h(null)};return k.jsxs(k.Fragment,{children:[k.jsxs(bl,{children:[k.jsxs(wl,{render:k.jsx(pe,{variant:"ghost",size:"sm",className:"min-w-0 max-w-full justify-start gap-1","data-testid":"agent-session-switcher"}),children:[k.jsx("span",{className:me("min-w-0 truncate",!c&&"text-muted-foreground"),children:c?c.title:f("agent.session.none")}),k.jsx(no,{className:"text-muted-foreground shrink-0"})]}),k.jsxs(Sl,{align:"start",className:"w-64","data-testid":"agent-session-switcher-menu",children:[e.length===0&&k.jsx("p",{className:"text-muted-foreground px-2 py-1.5 text-xs",children:f("agent.session.noSessions")}),e.map(w=>k.jsxs(Fn,{"data-testid":`agent-session-item-${w.id}`,onClick:()=>i(w.id),children:[k.jsx("span",{className:"min-w-0 flex-1 truncate",children:w.title}),w.id===n&&k.jsx(Yt,{className:"shrink-0"}),k.jsx("button",{type:"button","data-testid":`agent-session-rename-${w.id}`,"aria-label":f("agent.session.rename"),className:"text-muted-foreground hover:text-foreground shrink-0 p-0.5",onClick:_=>{_.stopPropagation(),_.preventDefault(),g(w.title),h(w)},children:k.jsx(Cl,{className:"size-3.5"})}),k.jsx("button",{type:"button","data-testid":`agent-session-delete-${w.id}`,"aria-label":f("agent.session.delete"),className:"text-muted-foreground hover:text-destructive shrink-0 p-0.5",onClick:_=>{_.stopPropagation(),_.preventDefault(),y(w)},children:k.jsx(El,{className:"size-3.5"})})]},w.id)),k.jsx(Rn,{}),k.jsx(Tl,{"data-testid":"agent-session-show-all",checked:t,onCheckedChange:w=>r(!!w),closeOnClick:!1,children:f("agent.session.showAll")}),k.jsx(Rn,{}),k.jsxs(Fn,{"data-testid":"agent-session-create",disabled:a,onClick:()=>o(),children:[k.jsx(vl,{className:"shrink-0"}),k.jsx("span",{children:f("agent.session.new")})]}),k.jsx("p",{className:"text-muted-foreground px-2 pt-0.5 pb-1.5 text-[11px] leading-snug",children:a&&u?u:f("agent.session.privacyNotice")})]})]}),k.jsx(Al,{open:p!==null,onOpenChange:w=>{w||h(null)},children:k.jsxs(Il,{"data-testid":"agent-session-rename-dialog",className:"sm:max-w-sm",children:[k.jsx(Nl,{children:k.jsx(Pl,{children:f("agent.session.renameTitle")})}),k.jsx(_l,{"data-testid":"agent-session-rename-input",value:d,placeholder:f("agent.session.renamePlaceholder"),onChange:w=>g(w.target.value),onKeyDown:w=>{w.key==="Enter"&&!w.nativeEvent.isComposing&&(w.preventDefault(),C())},autoFocus:!0}),k.jsxs(jl,{children:[k.jsx(pe,{variant:"outline",onClick:()=>h(null),children:f("agent.session.cancel")}),k.jsx(pe,{"data-testid":"agent-session-rename-save",disabled:d.trim().length===0,onClick:C,children:f("agent.session.save")})]})]})}),k.jsx(zl,{open:b!==null,onOpenChange:w=>{w||y(null)},children:k.jsxs(Dl,{"data-testid":"agent-session-delete-dialog",children:[k.jsxs(Ll,{children:[k.jsx(Fl,{children:f("agent.session.deleteTitle")}),k.jsx(Rl,{children:f("agent.session.deleteDesc",{title:(b==null?void 0:b.title)??""})})]}),k.jsxs(Ml,{children:[k.jsx(Ol,{children:f("agent.session.cancel")}),k.jsx(Bl,{"data-testid":"agent-session-delete-confirm",onClick:()=>{b&&s(b.id),y(null)},children:f("agent.session.deleteConfirm")})]})]})})]})}function pp({onSend:e,onStop:n,running:t,disabled:r,className:i}){const{t:o}=ge(),[l,s]=ne.useState(""),a=()=>{const u=l.trim();!u||r||t||(e==null||e(u),s(""))};return k.jsxs("div",{"data-testid":"agent-chat-input",className:me("flex shrink-0 items-end gap-2 border-t p-3",i),children:[k.jsx(Gl,{"data-testid":"agent-chat-input-textarea",value:l,onChange:u=>s(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!u.shiftKey&&!u.nativeEvent.isComposing&&(u.preventDefault(),a())},placeholder:o("agent.panel.inputPlaceholder"),disabled:r,className:"max-h-40 min-h-9 flex-1 resize-none",rows:1}),t?k.jsx(pe,{"data-testid":"agent-chat-stop",size:"icon",variant:"destructive",onClick:()=>n==null?void 0:n(),"aria-label":o("agent.panel.stop"),children:k.jsx(oo,{})}):k.jsx(pe,{"data-testid":"agent-chat-send",size:"icon",disabled:r||l.trim().length===0,onClick:a,"aria-label":o("agent.panel.send"),children:k.jsx(Ql,{})})]})}function dp(e,n,t){var o;if(!e.deviceId||!e.paneId)return null;const r=((o=t==null?void 0:t.find(l=>l.id===e.deviceId))==null?void 0:o.name)??null,i=n[e.deviceId];if(!(i!=null&&i.session))return{label:`${e.paneId}@${r??"?"}`,state:"unknown",windowId:null};for(const l of i.session.windows){const s=l.panes.find(a=>a.id===e.paneId);if(s)return{label:Yl({paneIdx:s.index,windowIdx:l.index,paneTitle:s.title,windowName:l.name,windowCustomName:l.customName,deviceName:r}),state:"valid",windowId:l.id}}return{label:`${e.paneId}@${r??"?"}`,state:"invalid",windowId:null}}function yp(){const{t:e}=ge(),n=$l(),t=Hl("/devices/:deviceId/windows/:windowId/panes/:paneId"),r=(t==null?void 0:t.params.deviceId)??null,i=(t==null?void 0:t.params.paneId)??null,o=Y(A=>A.sessions),l=Y(A=>A.sessionOrder),s=Y(A=>A.activeSessionId),a=Y(A=>A.showAllSessions),u=Y(A=>A.activeSessionId?A.messages[A.activeSessionId]:void 0),f=Y(A=>A.activeSessionId?A.inProgress[A.activeSessionId]:void 0),c=Y(A=>A.activeSessionId?A.pendingConfirmations[A.activeSessionId]:void 0),p=Y(A=>A.activeSessionId?A.sending[A.activeSessionId]:void 0),h=ql(A=>A.snapshots),{data:d}=Ul({queryKey:["devices"],queryFn:async()=>{const A=await fetch("/api/devices");if(!A.ok)throw new Error("Failed to load devices");return A.json()},throwOnError:!1});ne.useEffect(()=>{const A=Y.getState();A.ensureInitialized(),A.loadSessions()},[]);const g=s?o[s]:void 0,b=ne.useMemo(()=>{const A=l.map(S=>o[S]).filter(S=>!!S);return a||!i||!r?A:A.filter(S=>S.id===s||S.deviceId===r&&S.paneId===i)},[l,o,a,r,i,s]),y=ne.useMemo(()=>{const A=new Map;for(const S of c??[])A.set(S.toolCallId,S.id);return A},[c]),C=ne.useMemo(()=>{const A=ho(u,f),S=new Set;for(const P of A)P.kind==="tool-call"&&S.add(P.call.toolCallId);const j=[];for(const P of c??[])S.has(P.toolCallId)||j.push({kind:"tool-call",key:`confirmation-${P.id}`,call:{toolCallId:P.toolCallId,toolName:P.toolName,input:P.input,isError:!1,denied:!1,resolved:!1}});return j.length>0?[...A,...j]:A},[u,f,c]),w=g?dp(g,h,d==null?void 0:d.devices):null,_=!!(g&&i&&r&&(g.paneId!==i||g.deviceId!==r)),z=(g==null?void 0:g.status)==="running",E=po(u),M=(A,S)=>{s&&Y.getState().decideConfirmation(s,A,S)},$=()=>{if(g!=null&&g.deviceId){if((w==null?void 0:w.state)==="valid"&&w.windowId&&g.paneId){n(`/devices/${g.deviceId}/windows/${w.windowId}/panes/${encodeURIComponent(g.paneId)}`);return}(w==null?void 0:w.state)==="unknown"&&n(`/devices/${g.deviceId}`)}};return k.jsxs("div",{"data-testid":"agent-panel",className:"flex h-full min-h-0 flex-col",children:[k.jsxs("header",{"data-testid":"agent-panel-header",className:"flex h-12 shrink-0 items-center gap-2 px-3 md:h-16",children:[k.jsx("span",{className:"text-sm font-semibold",children:e("agent.panel.title")}),k.jsx(Mn,{orientation:"vertical",className:"shrink-0 data-[orientation=vertical]:h-4"}),k.jsx("div",{className:"min-w-0 flex-1",children:k.jsx(hp,{sessions:b,currentSessionId:s,showAll:a,onToggleShowAll:A=>Y.getState().setShowAllSessions(A),onSelect:A=>Y.getState().setActiveSession(A),onCreate:()=>{r&&i&&Y.getState().createSession(r,i)},onRename:(A,S)=>{Y.getState().renameSession(A,S)},onDelete:A=>{Y.getState().deleteSession(A)},createDisabled:!r||!i,createDisabledReason:e("agent.session.createDisabledNoPane")})}),k.jsx(Vl,{className:"shrink-0","data-testid":"right-panel-close"})]}),k.jsx(Mn,{}),g&&w&&k.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 py-1.5",children:[k.jsxs("button",{type:"button","data-testid":"agent-binding-chip","data-binding-state":w.state,className:me("border-border flex min-w-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs",w.state==="valid"?"hover:bg-muted cursor-pointer":"text-muted-foreground",w.state==="invalid"&&"opacity-60"),onClick:$,disabled:w.state==="invalid",children:[k.jsx(ao,{className:"size-3 shrink-0"}),k.jsx("span",{className:"min-w-0 truncate",children:w.label}),w.state==="invalid"&&k.jsxs("span",{className:"shrink-0",children:["· ",e("agent.binding.invalid")]})]}),k.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[k.jsx("span",{className:"text-muted-foreground text-xs",children:g.writeMode==="auto"?e("agent.writeMode.auto"):e("agent.writeMode.confirm")}),k.jsx(Wl,{"data-testid":"agent-write-mode-switch",checked:g.writeMode==="auto",onCheckedChange:A=>{Y.getState().setWriteMode(g.id,A?"auto":"confirm")}})]})]}),g&&_&&k.jsxs("div",{"data-testid":"agent-pane-mismatch",className:"bg-muted/50 mx-3 mb-1.5 flex shrink-0 flex-wrap items-center gap-2 rounded-md px-2 py-1.5 text-xs",children:[k.jsx(Xt,{className:"text-muted-foreground size-3.5 shrink-0"}),k.jsx("span",{className:"text-muted-foreground min-w-0 flex-1",children:e("agent.binding.mismatchTitle")}),(w==null?void 0:w.state)==="valid"&&k.jsx(pe,{"data-testid":"agent-binding-goto",size:"xs",variant:"outline",onClick:$,children:e("agent.binding.goTo")}),i&&k.jsx(pe,{"data-testid":"agent-binding-rebind",size:"xs",variant:"outline",onClick:()=>{Y.getState().rebindPane(g.id,i)},children:e("agent.binding.rebind")})]}),(g==null?void 0:g.status)==="error"&&g.lastError&&k.jsxs("div",{"data-testid":"agent-error-banner",className:"bg-destructive/10 text-destructive mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-md px-2 py-1.5 text-xs",children:[k.jsx(Xt,{className:"mt-0.5 size-3.5 shrink-0"}),k.jsx("span",{className:"min-w-0 flex-1 break-words",children:g.lastError}),E&&k.jsx(pe,{"data-testid":"agent-error-retry",size:"xs",variant:"outline",className:"shrink-0",disabled:!!p,onClick:()=>{Y.getState().sendMessage(g.id,E)},children:e("agent.panel.retry")})]}),k.jsx(fp,{blocks:g?C:[],running:!!z,emptyText:e("agent.panel.empty"),confirmationByToolCallId:y,onDecide:M},(g==null?void 0:g.id)??"none"),k.jsx(pp,{disabled:!g||g.status==="waiting_confirmation"||!!p,running:!!z,onSend:A=>{g&&Y.getState().sendMessage(g.id,A)},onStop:()=>{g&&Y.getState().stopSession(g.id)}})]})}export{yp as AgentPanel,pp as ChatInput,fp as ChatThread,hp as SessionSwitcher};
68
+ //# sourceMappingURL=index-D-orbg3h.js.map