import{a as Me,u as wt,r as G,j as m,c as W,B as le,t as Nr,D as $e,e as $i,g as lt,v as Nn,L as In,b as Tn,l as jn,o as at,m as Wi,n as Gi}from"./index-Daq5M5bC.js";import{L as An,C as Yi,a as Xi,b as Qi,c as Ki,d as Ji,S as Zi}from"./logo-NAd285bv.js";import{l as dt,p as el,s as tl,T as nl,L as rl,U as il,S as ll,t as Ln}from"./user-status-C4MB9Ruf.js";import{g as Pn,s as al,S as ot,a as st,C as zn,c as ut,d as ze,G as ol,b as sl}from"./SubtitleDisplay-ChT0YnnH.js";import{S as ul}from"./settings-qFuUALDY.js";import{P as cl}from"./index-B33Yn3RC.js";import"./index-ChHm2POI.js";/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fl=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ct=Me("arrow-right",fl);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hl=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],pl=Me("bookmark",hl);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ml=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ir=Me("external-link",ml);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dl=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],gl=Me("refresh-cw",dl);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xl=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],yl=Me("send",xl);/**
 * @license lucide-react v0.511.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kl=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],bl=Me("youtube",kl);function wl(e,n=2800){const t=e.split(/([ \t\n\r]+)/).filter(Boolean),r=e.length;let i=0;return t.map(a=>{const l=a.length/r,o=Math.floor(l*n),s=i,u=i+o;return i=u,{text:a,start:s,end:u}})}const Sl="Life is like a box of chocolates.",Dn={en:"Life is like a box of chocolates.","zh-cn":"生活就像一盒巧克力。","zh-tw":"人生就像一盒巧克力。",es:"La vida es como una caja de bombones.",fr:"La vie est comme une boîte de chocolats.",de:"Das Leben ist wie eine Schachtel Pralinen.",ja:"人生はチョコレートの箱のようなもの。",ko:"人生은 초콜릿 상자와 같다.",it:"La vita è come una scatola di cioccolatini.",ru:"Жизнь как коробка шоколадных конфет.",pt:"A vida é como uma caixa de chocolates.",ar:"الحياة مثل علبة من الشوكولاتة.",hi:"ज़िंदगी चॉकलेट के डिब्बे की तरह है।",tr:"Hayat bir kutu çikolata gibidir.",vi:"Cuộc sống giống như một hộp sô cô la.",th:"ชีวิตก็เหมือนกล่องช็อกโกแลต",id:"Hidup itu seperti sekotak cokelat.",nl:"Het kehidupan is als een doos bonbons.",ms:"Hidup adalah seperti kotak coklat.",he:"החיים הם כמו קופסת שוקולד.",ur:"زندگی چاکलेट کے ڈبے کی طرح ہے۔",bn:"জীবন চকোলেটের বাক্সের মতো।",pl:"Życie jest jak pudełko czekoladek.",sv:"Livet är som en ask choklad.",da:"Livet er som en æske chokolade.",fi:"Elämä on kuin suklaarasia.",hu:"Az élet olyan, mint egy doboz bonbon.",cs:"Život je jako bonboniéra.",km:"ជីវិតប្រៀបដូចជាប្រអប់សូកូឡា។",tl:"Ang buhay ay parang isang kahon ng tsokolate.",fa:"زندگی مثل یک جعبه شکلات است."};function Fn(e){const n=e.toLowerCase(),t=Dn[n]||Dn[n.split("-")[0]]||Sl;return{text:t,words:wl(t)}}const vl=.9,Cl=10;function El({showNative:e,showLearning:n,nativeLanguage:t,learnLanguage:r}){const{t:i}=wt(),[a,l]=G.useState(0),o=2800,s=G.useRef(null),u=G.useRef(void 0),f=Fn(r),c=Fn(t),p={start:0,end:o,text:f.text,words:f.words},h=c.text,x=N=>{s.current===null&&(s.current=N);const E=(N-s.current)%(o+1500);l(Math.min(E,o)),u.current=requestAnimationFrame(x)};G.useEffect(()=>(u.current=requestAnimationFrame(x),()=>{u.current&&cancelAnimationFrame(u.current)}),[]);const b={fontSize:20,textColor:"#ffffff",backgroundColor:"#151515",opacity:.75,showNativeSubtitles:e,showLearningSubtitles:n,karaokeStyle:"neon",position:"bottom"},v={...b,fontSize:Math.max(Cl,Math.floor(b.fontSize*vl))},y={"--vs-offset":"0px","--vs-scale":"1"};return m.jsxs("div",{className:"w-full h-full bg-slate-900/90 rounded-lg flex flex-col items-center justify-center p-6 relative overflow-hidden group select-none min-h-[200px]",children:[m.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-indigo-900/20 via-slate-900/10 to-emerald-900/20 pointer-events-none"}),m.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-10 pointer-events-none",children:m.jsx("div",{className:"w-16 h-16 rounded-full border-4 border-white flex items-center justify-center",children:m.jsx("div",{className:"w-0 h-0 border-t-[12px] border-t-transparent border-l-[24px] border-l-white border-b-[12px] border-b-transparent ml-2"})})}),m.jsxs("div",{className:"relative z-10 w-full flex flex-col items-center justify-center gap-0.5 transition-all duration-300",style:y,children:[m.jsx("div",{className:W("transition-all duration-500 transform w-full flex justify-center",n?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none absolute"),children:m.jsx(Pn,{texts:[p.text],subtitleItems:[p],settings:b,karaokeTimeMsOverride:a})}),m.jsx("div",{className:W("transition-all duration-500 transform w-full flex justify-center",e?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none absolute"),children:m.jsx(Pn,{texts:[h],settings:v})})]})]})}const tn=G.forwardRef(({className:e,onChange:n,...t},r)=>{const i=G.useRef(null),a=G.useCallback(s=>{i.current=s,typeof r=="function"?r(s):r&&(r.current=s)},[r]),l=G.useCallback(()=>{const s=i.current;s&&(s.style.height="auto",s.style.height=`${s.scrollHeight}px`)},[]);G.useEffect(()=>{l()},[t.value,t.defaultValue,l]);const o=s=>{l(),n==null||n(s)};return m.jsx("textarea",{className:W("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,onChange:o,...t})});tn.displayName="Textarea";async function Nl(e,n){let t=e;try{await al("ACQUIRE_LANGUAGE:OPEN_EXTENSION_PAGE",{page:t},"background")}catch(r){console.error("Failed to open extension page:",r)}}const Tr=W("bg-muted/50 hover:bg-muted/70 focus-visible:bg-muted/60","border border-border/60 hover:border-border focus-visible:border-primary/50","dark:bg-muted/45 dark:border-white/15 dark:hover:border-white/25 dark:focus-visible:border-primary/80","focus-visible:ring-0","rounded-xl transition-all duration-200 shadow-inner"),Il=({value:e,onChange:n,onSend:t,placeholder:r,isSending:i=!1,isComposingRef:a,cambridgeUrl:l,cambridgeIconUrl:o,onOpenExternalLinkPopup:s,onConfigureAI:u,showConfigureAI:f=!1,density:c="default"})=>{const p=x=>{x.key==="Enter"&&!x.shiftKey&&!x.nativeEvent.isComposing&&(!a||!a.current)&&(x.preventDefault(),t())},h=c==="compact";return m.jsxs("div",{className:W("flex-shrink-0 pt-2",h?"px-3 pb-3":"px-3 sm:px-4 pb-4"),children:[m.jsxs("div",{className:W("flex justify-between items-center",h?"pb-1":"pb-2"),children:[l&&s?m.jsx("div",{className:"flex gap-2",children:m.jsxs("button",{onClick:()=>s(l),className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium text-muted-foreground hover:text-primary bg-muted/20 hover:bg-primary/10 transition-all duration-200 rounded-md border border-muted/30 hover:border-primary/30 shadow-sm",children:[o&&m.jsx("img",{src:o,alt:"Cambridge",className:"w-3 h-3"}),m.jsx(Ir,{className:"h-3 w-3"}),m.jsx("span",{children:"Cambridge"})]})}):m.jsx("div",{}),f&&m.jsxs(le,{variant:"ghost",size:"sm",className:"h-6 px-2 text-[10px]",onClick:()=>{u?u():Nl("/options.html")},children:[m.jsx(ul,{className:"h-3 w-3 mr-1"}),"Configure AI"]})]}),m.jsxs("div",{className:"relative group",children:[m.jsx(tn,{value:e,onChange:x=>n(x.target.value),onCompositionStart:()=>{a&&(a.current=!0)},onCompositionEnd:()=>{a&&(a.current=!1)},placeholder:r,className:W("w-full resize-none pr-12 pl-3",h?"min-h-[40px] max-h-48 pt-2 pb-2 text-xs":"min-h-[60px] max-h-48 pb-2 pt-3 text-[15px]",Tr),onKeyDown:p}),m.jsx("div",{className:W("absolute right-2",h?"bottom-1.5":"bottom-2"),children:m.jsx(le,{onClick:t,disabled:!e.trim()||i,size:"icon",className:W("rounded-lg transition-all duration-200",h?"h-6 w-6":"h-8 w-8",e.trim()?"bg-primary text-primary-foreground shadow-md hover:scale-105":"bg-muted text-muted-foreground opacity-50"),children:m.jsx(yl,{className:W(h?"h-3 w-3":"h-4 w-4")})})})]})]})};var Tl="Separator",_n="horizontal",jl=["horizontal","vertical"],jr=G.forwardRef((e,n)=>{const{decorative:t,orientation:r=_n,...i}=e,a=Al(r)?r:_n,o=t?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return m.jsx(cl.div,{"data-orientation":a,...o,...i,ref:n})});jr.displayName=Tl;function Al(e){return jl.includes(e)}var Ar=jr;const Lr=G.forwardRef(({className:e,orientation:n="horizontal",decorative:t=!0,...r},i)=>m.jsx(Ar,{ref:i,decorative:t,orientation:n,className:W("shrink-0 bg-border",n==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Lr.displayName=Ar.displayName;function Ll(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Pl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,zl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dl={};function Rn(e,n){return(Dl.jsx?zl:Pl).test(e)}const Fl=/[ \t\n\f\r]/g;function _l(e){return typeof e=="object"?e.type==="text"?On(e.value):!1:On(e)}function On(e){return e.replace(Fl,"")===""}class tt{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}tt.prototype.normal={};tt.prototype.property={};tt.prototype.space=void 0;function Pr(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new tt(t,r,n)}function Vt(e){return e.toLowerCase()}class ae{constructor(n,t){this.attribute=t,this.property=n}}ae.prototype.attribute="";ae.prototype.booleanish=!1;ae.prototype.boolean=!1;ae.prototype.commaOrSpaceSeparated=!1;ae.prototype.commaSeparated=!1;ae.prototype.defined=!1;ae.prototype.mustUseProperty=!1;ae.prototype.number=!1;ae.prototype.overloadedBoolean=!1;ae.prototype.property="";ae.prototype.spaceSeparated=!1;ae.prototype.space=void 0;let Rl=0;const M=je(),Z=je(),$t=je(),C=je(),Q=je(),Re=je(),se=je();function je(){return 2**++Rl}const Wt=Object.freeze(Object.defineProperty({__proto__:null,boolean:M,booleanish:Z,commaOrSpaceSeparated:se,commaSeparated:Re,number:C,overloadedBoolean:$t,spaceSeparated:Q},Symbol.toStringTag,{value:"Module"})),It=Object.keys(Wt);class nn extends ae{constructor(n,t,r,i){let a=-1;if(super(n,t),Mn(this,"space",i),typeof r=="number")for(;++a<It.length;){const l=It[a];Mn(this,It[a],(r&Wt[l])===Wt[l])}}}nn.prototype.defined=!0;function Mn(e,n,t){t&&(e[n]=t)}function Be(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const a=new nn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),n[r]=a,t[Vt(r)]=r,t[Vt(a.attribute)]=r}return new tt(n,t,e.space)}const zr=Be({properties:{ariaActiveDescendant:null,ariaAtomic:Z,ariaAutoComplete:null,ariaBusy:Z,ariaChecked:Z,ariaColCount:C,ariaColIndex:C,ariaColSpan:C,ariaControls:Q,ariaCurrent:null,ariaDescribedBy:Q,ariaDetails:null,ariaDisabled:Z,ariaDropEffect:Q,ariaErrorMessage:null,ariaExpanded:Z,ariaFlowTo:Q,ariaGrabbed:Z,ariaHasPopup:null,ariaHidden:Z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Q,ariaLevel:C,ariaLive:null,ariaModal:Z,ariaMultiLine:Z,ariaMultiSelectable:Z,ariaOrientation:null,ariaOwns:Q,ariaPlaceholder:null,ariaPosInSet:C,ariaPressed:Z,ariaReadOnly:Z,ariaRelevant:null,ariaRequired:Z,ariaRoleDescription:Q,ariaRowCount:C,ariaRowIndex:C,ariaRowSpan:C,ariaSelected:Z,ariaSetSize:C,ariaSort:null,ariaValueMax:C,ariaValueMin:C,ariaValueNow:C,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Dr(e,n){return n in e?e[n]:n}function Fr(e,n){return Dr(e,n.toLowerCase())}const Ol=Be({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Re,acceptCharset:Q,accessKey:Q,action:null,allow:null,allowFullScreen:M,allowPaymentRequest:M,allowUserMedia:M,alt:null,as:null,async:M,autoCapitalize:null,autoComplete:Q,autoFocus:M,autoPlay:M,blocking:Q,capture:null,charSet:null,checked:M,cite:null,className:Q,cols:C,colSpan:null,content:null,contentEditable:Z,controls:M,controlsList:Q,coords:C|Re,crossOrigin:null,data:null,dateTime:null,decoding:null,default:M,defer:M,dir:null,dirName:null,disabled:M,download:$t,draggable:Z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:M,formTarget:null,headers:Q,height:C,hidden:$t,high:C,href:null,hrefLang:null,htmlFor:Q,httpEquiv:Q,id:null,imageSizes:null,imageSrcSet:null,inert:M,inputMode:null,integrity:null,is:null,isMap:M,itemId:null,itemProp:Q,itemRef:Q,itemScope:M,itemType:Q,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:M,low:C,manifest:null,max:null,maxLength:C,media:null,method:null,min:null,minLength:C,multiple:M,muted:M,name:null,nonce:null,noModule:M,noValidate:M,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:M,optimum:C,pattern:null,ping:Q,placeholder:null,playsInline:M,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:M,referrerPolicy:null,rel:Q,required:M,reversed:M,rows:C,rowSpan:C,sandbox:Q,scope:null,scoped:M,seamless:M,selected:M,shadowRootClonable:M,shadowRootDelegatesFocus:M,shadowRootMode:null,shape:null,size:C,sizes:null,slot:null,span:C,spellCheck:Z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:C,step:null,style:null,tabIndex:C,target:null,title:null,translate:null,type:null,typeMustMatch:M,useMap:null,value:Z,width:C,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Q,axis:null,background:null,bgColor:null,border:C,borderColor:null,bottomMargin:C,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:M,declare:M,event:null,face:null,frame:null,frameBorder:null,hSpace:C,leftMargin:C,link:null,longDesc:null,lowSrc:null,marginHeight:C,marginWidth:C,noResize:M,noHref:M,noShade:M,noWrap:M,object:null,profile:null,prompt:null,rev:null,rightMargin:C,rules:null,scheme:null,scrolling:Z,standby:null,summary:null,text:null,topMargin:C,valueType:null,version:null,vAlign:null,vLink:null,vSpace:C,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:M,disableRemotePlayback:M,prefix:null,property:null,results:C,security:null,unselectable:null},space:"html",transform:Fr}),Ml=Be({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:se,accentHeight:C,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:C,amplitude:C,arabicForm:null,ascent:C,attributeName:null,attributeType:null,azimuth:C,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:C,by:null,calcMode:null,capHeight:C,className:Q,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:C,diffuseConstant:C,direction:null,display:null,dur:null,divisor:C,dominantBaseline:null,download:M,dx:null,dy:null,edgeMode:null,editable:null,elevation:C,enableBackground:null,end:null,event:null,exponent:C,externalResourcesRequired:null,fill:null,fillOpacity:C,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Re,g2:Re,glyphName:Re,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:C,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:C,horizOriginX:C,horizOriginY:C,id:null,ideographic:C,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:C,k:C,k1:C,k2:C,k3:C,k4:C,kernelMatrix:se,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:C,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:C,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:C,overlineThickness:C,paintOrder:null,panose1:null,path:null,pathLength:C,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Q,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:C,pointsAtY:C,pointsAtZ:C,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:se,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:se,rev:se,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:se,requiredFeatures:se,requiredFonts:se,requiredFormats:se,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:C,specularExponent:C,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:C,strikethroughThickness:C,string:null,stroke:null,strokeDashArray:se,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:C,strokeOpacity:C,strokeWidth:null,style:null,surfaceScale:C,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:se,tabIndex:C,tableValues:null,target:null,targetX:C,targetY:C,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:se,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:C,underlineThickness:C,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:C,values:null,vAlphabetic:C,vMathematical:C,vectorEffect:null,vHanging:C,vIdeographic:C,version:null,vertAdvY:C,vertOriginX:C,vertOriginY:C,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:C,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Dr}),_r=Be({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()}}),Rr=Be({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fr}),Or=Be({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Bl={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"},Ul=/[A-Z]/g,Bn=/-[a-z]/g,Hl=/^data[-\w.:]+$/i;function ql(e,n){const t=Vt(n);let r=n,i=ae;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Hl.test(n)){if(n.charAt(4)==="-"){const a=n.slice(5).replace(Bn,$l);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=n.slice(4);if(!Bn.test(a)){let l=a.replace(Ul,Vl);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=nn}return new i(r,n)}function Vl(e){return"-"+e.toLowerCase()}function $l(e){return e.charAt(1).toUpperCase()}const Wl=Pr([zr,Ol,_r,Rr,Or],"html"),rn=Pr([zr,Ml,_r,Rr,Or],"svg");function Gl(e){return e.join(" ").trim()}var De={},Tt,Un;function Yl(){if(Un)return Tt;Un=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,s=`
`,u="/",f="*",c="",p="comment",h="declaration";Tt=function(b,v){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];v=v||{};var y=1,N=1;function E(L){var T=L.match(n);T&&(y+=T.length);var z=L.lastIndexOf(s);N=~z?L.length-z:N+L.length}function D(){var L={line:y,column:N};return function(T){return T.position=new F(L),$(),T}}function F(L){this.start=L,this.end={line:y,column:N},this.source=v.source}F.prototype.content=b;function S(L){var T=new Error(v.source+":"+y+":"+N+": "+L);if(T.reason=L,T.filename=v.source,T.line=y,T.column=N,T.source=b,!v.silent)throw T}function O(L){var T=L.exec(b);if(T){var z=T[0];return E(z),b=b.slice(z.length),T}}function $(){O(t)}function H(L){var T;for(L=L||[];T=k();)T!==!1&&L.push(T);return L}function k(){var L=D();if(!(u!=b.charAt(0)||f!=b.charAt(1))){for(var T=2;c!=b.charAt(T)&&(f!=b.charAt(T)||u!=b.charAt(T+1));)++T;if(T+=2,c===b.charAt(T-1))return S("End of comment missing");var z=b.slice(2,T-2);return N+=2,E(z),b=b.slice(T),N+=2,L({type:p,comment:z})}}function j(){var L=D(),T=O(r);if(T){if(k(),!O(i))return S("property missing ':'");var z=O(a),J=L({type:h,property:x(T[0].replace(e,c)),value:z?x(z[0].replace(e,c)):c});return O(l),J}}function A(){var L=[];H(L);for(var T;T=j();)T!==!1&&(L.push(T),H(L));return L}return $(),A()};function x(b){return b?b.replace(o,c):c}return Tt}var Hn;function Xl(){if(Hn)return De;Hn=1;var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0}),De.default=t;var n=e(Yl());function t(r,i){var a=null;if(!r||typeof r!="string")return a;var l=(0,n.default)(r),o=typeof i=="function";return l.forEach(function(s){if(s.type==="declaration"){var u=s.property,f=s.value;o?i(u,f,s):f&&(a=a||{},a[u]=f)}}),a}return De}var We={},qn;function Ql(){if(qn)return We;qn=1,Object.defineProperty(We,"__esModule",{value:!0}),We.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(u){return!u||t.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},o=function(u,f){return"".concat(f,"-")},s=function(u,f){return f===void 0&&(f={}),a(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,o):u=u.replace(r,o),u.replace(n,l))};return We.camelCase=s,We}var Ge,Vn;function Kl(){if(Vn)return Ge;Vn=1;var e=Ge&&Ge.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Xl()),t=Ql();function r(i,a){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(o,s){o&&s&&(l[(0,t.camelCase)(o,a)]=s)}),l}return r.default=r,Ge=r,Ge}var Jl=Kl();const Zl=Nr(Jl),Mr=Br("end"),ln=Br("start");function Br(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 ea(e){const n=ln(e),t=Mr(e);if(n&&t)return{start:n,end:t}}function Qe(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?$n(e.position):"start"in e||"end"in e?$n(e):"line"in e||"column"in e?Gt(e):""}function Gt(e){return Wn(e&&e.line)+":"+Wn(e&&e.column)}function $n(e){return Gt(e&&e.start)+"-"+Gt(e&&e.end)}function Wn(e){return e&&typeof e=="number"?e:1}class ne extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",a={},l=!1;if(t&&("line"in t&&"column"in t?a={place:t}:"start"in t&&"end"in t?a={place:t}:"type"in t?a={ancestors:[t],place:t.position}:a={...t}),typeof n=="string"?i=n:!a.cause&&n&&(l=!0,i=n.message,a.cause=n),!a.ruleId&&!a.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?a.ruleId=r:(a.source=r.slice(0,s),a.ruleId=r.slice(s+1))}if(!a.place&&a.ancestors&&a.ancestors){const s=a.ancestors[a.ancestors.length-1];s&&(a.place=s.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=o?o.line:void 0,this.name=Qe(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}ne.prototype.file="";ne.prototype.name="";ne.prototype.reason="";ne.prototype.message="";ne.prototype.stack="";ne.prototype.column=void 0;ne.prototype.line=void 0;ne.prototype.ancestors=void 0;ne.prototype.cause=void 0;ne.prototype.fatal=void 0;ne.prototype.place=void 0;ne.prototype.ruleId=void 0;ne.prototype.source=void 0;const an={}.hasOwnProperty,ta=new Map,na=/[A-Z]/g,ra=new Set(["table","tbody","thead","tfoot","tr"]),ia=new Set(["td","th"]),Ur="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function la(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=pa(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=ha(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"?rn:Wl,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},a=Hr(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Hr(e,n,t){if(n.type==="element")return aa(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return oa(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return ua(e,n,t);if(n.type==="mdxjsEsm")return sa(e,n);if(n.type==="root")return ca(e,n,t);if(n.type==="text")return fa(e,n)}function aa(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=rn,e.schema=i),e.ancestors.push(n);const a=Vr(e,n.tagName,!1),l=ma(e,n);let o=sn(e,n);return ra.has(n.tagName)&&(o=o.filter(function(s){return typeof s=="string"?!_l(s):!0})),qr(e,l,a,n),on(l,o),e.ancestors.pop(),e.schema=r,e.create(n,a,l,t)}function oa(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)}Ze(e,n.position)}function sa(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Ze(e,n.position)}function ua(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=rn,e.schema=i),e.ancestors.push(n);const a=n.name===null?e.Fragment:Vr(e,n.name,!0),l=da(e,n),o=sn(e,n);return qr(e,l,a,n),on(l,o),e.ancestors.pop(),e.schema=r,e.create(n,a,l,t)}function ca(e,n,t){const r={};return on(r,sn(e,n)),e.create(n,e.Fragment,r,t)}function fa(e,n){return n.value}function qr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function on(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function ha(e,n,t){return r;function r(i,a,l,o){const u=Array.isArray(l.children)?t:n;return o?u(a,l,o):u(a,l)}}function pa(e,n){return t;function t(r,i,a,l){const o=Array.isArray(a.children),s=ln(r);return n(i,a,l,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function ma(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&an.call(n.properties,i)){const a=ga(e,i,n.properties[i]);if(a){const[l,o]=a;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&ia.has(n.tagName)?r=o:t[l]=o}}if(r){const a=t.style||(t.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function da(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const o=l.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else Ze(e,n.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else Ze(e,n.position);else a=r.value===null?!0:r.value;t[i]=a}return t}function sn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:ta;for(;++r<n.children.length;){const a=n.children[r];let l;if(e.passKeys){const s=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(s){const u=i.get(s)||0;l=s+"-"+u,i.set(s,u+1)}}const o=Hr(e,a,l);o!==void 0&&t.push(o)}return t}function ga(e,n,t){const r=ql(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Ll(t):Gl(t)),r.property==="style"){let i=typeof t=="object"?t:xa(e,String(t));return e.stylePropertyNameCase==="css"&&(i=ya(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Bl[r.property]||r.property:r.attribute,t]}}function xa(e,n){try{return Zl(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ne("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=Ur+"#cannot-parse-style-attribute",i}}function Vr(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let a=-1,l;for(;++a<i.length;){const o=Rn(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=l}else r=Rn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return an.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ze(e)}function Ze(e,n){const t=new ne("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=Ur+"#cannot-handle-mdx-estrees-without-createevaluater",t}function ya(e){const n={};let t;for(t in e)an.call(e,t)&&(n[ka(t)]=e[t]);return n}function ka(e){let n=e.replace(na,ba);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function ba(e){return"-"+e.toLowerCase()}const jt={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"]},wa={};function un(e,n){const t=wa,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return $r(e,r,i)}function $r(e,n,t){if(Sa(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 Gn(e.children,n,t)}return Array.isArray(e)?Gn(e,n,t):""}function Gn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=$r(e[i],n,t);return r.join("")}function Sa(e){return!!(e&&typeof e=="object")}const Yn=document.createElement("i");function cn(e){const n="&"+e+";";Yn.innerHTML=n;const t=Yn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ue(e,n,t,r){const i=e.length;let a=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);a<r.length;)l=r.slice(a,a+1e4),l.unshift(n,0),e.splice(...l),a+=1e4,n+=1e4}function ce(e,n){return e.length>0?(ue(e,e.length,0,n),e):n}const Xn={}.hasOwnProperty;function Wr(e){const n={};let t=-1;for(;++t<e.length;)va(n,e[t]);return n}function va(e,n){let t;for(t in n){const i=(Xn.call(e,t)?e[t]:void 0)||(e[t]={}),a=n[t];let l;if(a)for(l in a){Xn.call(i,l)||(i[l]=[]);const o=a[l];Ca(i[l],Array.isArray(o)?o:o?[o]:[])}}}function Ca(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ue(e,0,0,r)}function Gr(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 me(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const re=Ce(/[A-Za-z]/),te=Ce(/[\dA-Za-z]/),Ea=Ce(/[#-'*+\--9=?A-Z^-~]/);function xt(e){return e!==null&&(e<32||e===127)}const Yt=Ce(/\d/),Na=Ce(/[\dA-Fa-f]/),Ia=Ce(/[!-/:-@[-`{-~]/);function P(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function B(e){return e===-2||e===-1||e===32}const St=Ce(new RegExp("\\p{P}|\\p{S}","u")),Te=Ce(/\s/);function Ce(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ue(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const a=e.charCodeAt(t);let l="";if(a===37&&te(e.charCodeAt(t+1))&&te(e.charCodeAt(t+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(t+1);a<56320&&o>56319&&o<57344?(l=String.fromCharCode(a,o),i=1):l="�"}else l=String.fromCharCode(a);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 q(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(s){return B(s)?(e.enter(t),o(s)):n(s)}function o(s){return B(s)&&a++<i?(e.consume(s),o):(e.exit(t),n(s))}}const Ta={tokenize:ja};function ja(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),q(e,n,"linePrefix")}function i(o){return e.enter("paragraph"),a(o)}function a(o){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,l(o)}function l(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return P(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),l)}}const Aa={tokenize:La},Qn={tokenize:Pa};function La(e){const n=this,t=[];let r=0,i,a,l;return o;function o(E){if(r<t.length){const D=t[r];return n.containerState=D[1],e.attempt(D[0].continuation,s,u)(E)}return u(E)}function s(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&N();const D=n.events.length;let F=D,S;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){S=n.events[F][1].end;break}y(r);let O=D;for(;O<n.events.length;)n.events[O][1].end={...S},O++;return ue(n.events,F+1,0,n.events.slice(D)),n.events.length=O,u(E)}return o(E)}function u(E){if(r===t.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return x(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Qn,f,c)(E)}function f(E){return i&&N(),y(r),p(E)}function c(E){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,x(E)}function p(E){return n.containerState={},e.attempt(Qn,h,x)(E)}function h(E){return r++,t.push([n.currentConstruct,n.containerState]),p(E)}function x(E){if(E===null){i&&N(),y(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),b(E)}function b(E){if(E===null){v(e.exit("chunkFlow"),!0),y(0),e.consume(E);return}return P(E)?(e.consume(E),v(e.exit("chunkFlow")),r=0,n.interrupt=void 0,o):(e.consume(E),b)}function v(E,D){const F=n.sliceStream(E);if(D&&F.push(null),E.previous=a,a&&(a.next=E),a=E,i.defineSkip(E.start),i.write(F),n.parser.lazy[E.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<l&&(!i.events[S][1].end||i.events[S][1].end.offset>l))return;const O=n.events.length;let $=O,H,k;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){if(H){k=n.events[$][1].end;break}H=!0}for(y(r),S=O;S<n.events.length;)n.events[S][1].end={...k},S++;ue(n.events,$+1,0,n.events.slice(O)),n.events.length=S}}function y(E){let D=t.length;for(;D-- >E;){const F=t[D];n.containerState=F[1],F[0].exit.call(n,e)}t.length=E}function N(){i.write([null]),a=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Pa(e,n,t){return q(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Oe(e){if(e===null||X(e)||Te(e))return 1;if(St(e))return 2}function vt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(n=a(n,t),r.push(a))}return n}const Xt={name:"attention",resolveAll:za,tokenize:Da};function za(e,n){let t=-1,r,i,a,l,o,s,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;s=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};Kn(c,-s),Kn(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},o={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},a={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ce(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=ce(u,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",a,n]]),u=ce(u,vt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=ce(u,[["exit",a,n],["enter",o,n],["exit",o,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,u=ce(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,ue(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 Da(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Oe(r);let a;return l;function l(s){return a=s,e.enter("attentionSequence"),o(s)}function o(s){if(s===a)return e.consume(s),o;const u=e.exit("attentionSequence"),f=Oe(s),c=!f||f===2&&i||t.includes(s),p=!i||i===2&&f||t.includes(r);return u._open=!!(a===42?c:c&&(i||!p)),u._close=!!(a===42?p:p&&(f||!c)),n(s)}}function Kn(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Fa={name:"autolink",tokenize:_a};function _a(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"),a}function a(h){return re(h)?(e.consume(h),l):h===64?t(h):u(h)}function l(h){return h===43||h===45||h===46||te(h)?(r=1,o(h)):u(h)}function o(h){return h===58?(e.consume(h),r=0,s):(h===43||h===45||h===46||te(h))&&r++<32?(e.consume(h),o):(r=0,u(h))}function s(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||xt(h)?t(h):(e.consume(h),s)}function u(h){return h===64?(e.consume(h),f):Ea(h)?(e.consume(h),u):t(h)}function f(h){return te(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||te(h))&&r++<63){const x=h===45?p:c;return e.consume(h),x}return t(h)}}const nt={partial:!0,tokenize:Ra};function Ra(e,n,t){return r;function r(a){return B(a)?q(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||P(a)?n(a):t(a)}}const Yr={continuation:{tokenize:Ma},exit:Ba,name:"blockQuote",tokenize:Oa};function Oa(e,n,t){const r=this;return i;function i(l){if(l===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return t(l)}function a(l){return B(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function Ma(e,n,t){const r=this;return i;function i(l){return B(l)?q(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(Yr,n,t)(l)}}function Ba(e){e.exit("blockQuote")}const Xr={name:"characterEscape",tokenize:Ua};function Ua(e,n,t){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Ia(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(a)}}const Qr={name:"characterReference",tokenize:Ha};function Ha(e,n,t){const r=this;let i=0,a,l;return o;function o(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),s}function s(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,l=te,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=Na,f):(e.enter("characterReferenceValue"),a=7,l=Yt,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===te&&!cn(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<a?(e.consume(c),f):t(c)}}const Jn={partial:!0,tokenize:Va},Zn={concrete:!0,name:"codeFenced",tokenize:qa};function qa(e,n,t){const r=this,i={partial:!0,tokenize:F};let a=0,l=0,o;return s;function s(S){return u(S)}function u(S){const O=r.events[r.events.length-1];return a=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,o=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(S)}function f(S){return S===o?(l++,e.consume(S),f):l<3?t(S):(e.exit("codeFencedFenceSequence"),B(S)?q(e,c,"whitespace")(S):c(S))}function c(S){return S===null||P(S)?(e.exit("codeFencedFence"),r.interrupt?n(S):e.check(Jn,b,D)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||P(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(S)):B(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),q(e,h,"whitespace")(S)):S===96&&S===o?t(S):(e.consume(S),p)}function h(S){return S===null||P(S)?c(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===null||P(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(S)):S===96&&S===o?t(S):(e.consume(S),x)}function b(S){return e.attempt(i,D,v)(S)}function v(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return a>0&&B(S)?q(e,N,"linePrefix",a+1)(S):N(S)}function N(S){return S===null||P(S)?e.check(Jn,b,D)(S):(e.enter("codeFlowValue"),E(S))}function E(S){return S===null||P(S)?(e.exit("codeFlowValue"),N(S)):(e.consume(S),E)}function D(S){return e.exit("codeFenced"),n(S)}function F(S,O,$){let H=0;return k;function k(z){return S.enter("lineEnding"),S.consume(z),S.exit("lineEnding"),j}function j(z){return S.enter("codeFencedFence"),B(z)?q(S,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):A(z)}function A(z){return z===o?(S.enter("codeFencedFenceSequence"),L(z)):$(z)}function L(z){return z===o?(H++,S.consume(z),L):H>=l?(S.exit("codeFencedFenceSequence"),B(z)?q(S,T,"whitespace")(z):T(z)):$(z)}function T(z){return z===null||P(z)?(S.exit("codeFencedFence"),O(z)):$(z)}}}function Va(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"),a)}function a(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const At={name:"codeIndented",tokenize:Wa},$a={partial:!0,tokenize:Ga};function Wa(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),q(e,a,"linePrefix",5)(u)}function a(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?s(u):P(u)?e.attempt($a,l,s)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||P(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),o)}function s(u){return e.exit("codeIndented"),n(u)}}function Ga(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):P(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):q(e,a,"linePrefix",5)(l)}function a(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(l):P(l)?i(l):t(l)}}const Ya={name:"codeText",previous:Qa,resolve:Xa,tokenize:Ka};function Xa(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 Qa(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ka(e,n,t){let r=0,i,a;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),o(c)}function o(c){return c===96?(e.consume(c),r++,o):(e.exit("codeTextSequence"),s(c))}function s(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),s):c===96?(a=e.enter("codeTextSequence"),i=0,f(c)):P(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||P(c)?(e.exit("codeTextData"),s(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)):(a.type="codeTextData",u(c))}}class Ja{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 a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ye(this.left,r),a.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),Ye(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Ye(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);Ye(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Ye(this.left,t.reverse())}}}function Ye(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 Kr(e){const n={};let t=-1,r,i,a,l,o,s,u;const f=new Ja(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"&&(s=r[1]._tokenizer.events,a=0,a<s.length&&s[a][1].type==="lineEndingBlank"&&(a+=2),a<s.length&&s[a][1].type==="content"))for(;++a<s.length&&s[a][1].type!=="content";)s[a][1].type==="chunkText"&&(s[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Za(f,t)),t=n[t],u=!0);else if(r[1]._container){for(a=t,i=void 0;a--;)if(l=f.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},o=f.slice(i,t),o.unshift(r),f.splice(i,t-i+1,o))}}return ue(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function Za(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const a=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const o=l.events,s=[],u={};let f,c,p=-1,h=t,x=0,b=0;const v=[b];for(;h;){for(;e.get(++i)[1]!==h;);a.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<o.length;)o[p][0]==="exit"&&o[p-1][0]==="enter"&&o[p][1].type===o[p-1][1].type&&o[p][1].start.line!==o[p][1].end.line&&(b=p+1,v.push(b),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),p=v.length;p--;){const y=o.slice(v[p],v[p+1]),N=a.pop();s.push([N,N+y.length-1]),e.splice(N,2,y)}for(s.reverse(),p=-1;++p<s.length;)u[x+s[p][0]]=x+s[p][1],x+=s[p][1]-s[p][0]-1;return u}const eo={resolve:no,tokenize:ro},to={partial:!0,tokenize:io};function no(e){return Kr(e),e}function ro(e,n){let t;return r;function r(o){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?a(o):P(o)?e.check(to,l,a)(o):(e.consume(o),i)}function a(o){return e.exit("chunkContent"),e.exit("content"),n(o)}function l(o){return e.consume(o),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function io(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),q(e,a,"linePrefix")}function a(l){if(l===null||P(l))return t(l);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function Jr(e,n,t,r,i,a,l,o,s){const u=s||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(y),e.exit(a),p):y===null||y===32||y===41||xt(y)?t(y):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),b(y))}function p(y){return y===62?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(o),p(y)):y===null||y===60||P(y)?t(y):(e.consume(y),y===92?x:h)}function x(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function b(y){return!f&&(y===null||y===41||X(y))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),n(y)):f<u&&y===40?(e.consume(y),f++,b):y===41?(e.consume(y),f--,b):y===null||y===32||y===40||xt(y)?t(y):(e.consume(y),y===92?v:b)}function v(y){return y===40||y===41||y===92?(e.consume(y),b):b(y)}}function Zr(e,n,t,r,i,a){const l=this;let o=0,s;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(a),f}function f(h){return o>999||h===null||h===91||h===93&&!s||h===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(a),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):P(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||P(h)||o++>999?(e.exit("chunkString"),f(h)):(e.consume(h),s||(s=!B(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),o++,c):c(h)}}function ei(e,n,t,r,i,a){let l;return o;function o(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,s):t(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(a),u(p))}function u(p){return p===l?(e.exit(a),s(l)):p===null?t(p):P(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),q(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||P(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 Ke(e,n){let t;return r;function r(i){return P(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):B(i)?q(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const lo={name:"definition",tokenize:oo},ao={partial:!0,tokenize:so};function oo(e,n,t){const r=this;let i;return a;function a(h){return e.enter("definition"),l(h)}function l(h){return Zr.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function o(h){return i=me(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),s):t(h)}function s(h){return X(h)?Ke(e,u)(h):u(h)}function u(h){return Jr(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(ao,c,c)(h)}function c(h){return B(h)?q(e,p,"whitespace")(h):p(h)}function p(h){return h===null||P(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function so(e,n,t){return r;function r(o){return X(o)?Ke(e,i)(o):t(o)}function i(o){return ei(e,a,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return B(o)?q(e,l,"whitespace")(o):l(o)}function l(o){return o===null||P(o)?n(o):t(o)}}const uo={name:"hardBreakEscape",tokenize:co};function co(e,n,t){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return P(a)?(e.exit("hardBreakEscape"),n(a)):t(a)}}const fo={name:"headingAtx",resolve:ho,tokenize:po};function ho(e,n){let t=e.length-2,r=3,i,a;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},a={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ue(e,r,t-r+1,[["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n]])),e}function po(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),a(f)}function a(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||X(f)?(e.exit("atxHeadingSequence"),o(f)):t(f)}function o(f){return f===35?(e.enter("atxHeadingSequence"),s(f)):f===null||P(f)?(e.exit("atxHeading"),n(f)):B(f)?q(e,o,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function s(f){return f===35?(e.consume(f),s):(e.exit("atxHeadingSequence"),o(f))}function u(f){return f===null||f===35||X(f)?(e.exit("atxHeadingText"),o(f)):(e.consume(f),u)}}const mo=["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"],er=["pre","script","style","textarea"],go={concrete:!0,name:"htmlFlow",resolveTo:ko,tokenize:bo},xo={partial:!0,tokenize:So},yo={partial:!0,tokenize:wo};function ko(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 bo(e,n,t){const r=this;let i,a,l,o,s;return u;function u(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),a=!0,b):g===63?(e.consume(g),i=3,r.interrupt?n:d):re(g)?(e.consume(g),l=String.fromCharCode(g),v):t(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,o=0,x):re(g)?(e.consume(g),i=4,r.interrupt?n:d):t(g)}function h(g){return g===45?(e.consume(g),r.interrupt?n:d):t(g)}function x(g){const he="CDATA[";return g===he.charCodeAt(o++)?(e.consume(g),o===he.length?r.interrupt?n:A:x):t(g)}function b(g){return re(g)?(e.consume(g),l=String.fromCharCode(g),v):t(g)}function v(g){if(g===null||g===47||g===62||X(g)){const he=g===47,Ee=l.toLowerCase();return!he&&!a&&er.includes(Ee)?(i=1,r.interrupt?n(g):A(g)):mo.includes(l.toLowerCase())?(i=6,he?(e.consume(g),y):r.interrupt?n(g):A(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(g):a?N(g):E(g))}return g===45||te(g)?(e.consume(g),l+=String.fromCharCode(g),v):t(g)}function y(g){return g===62?(e.consume(g),r.interrupt?n:A):t(g)}function N(g){return B(g)?(e.consume(g),N):k(g)}function E(g){return g===47?(e.consume(g),k):g===58||g===95||re(g)?(e.consume(g),D):B(g)?(e.consume(g),E):k(g)}function D(g){return g===45||g===46||g===58||g===95||te(g)?(e.consume(g),D):F(g)}function F(g){return g===61?(e.consume(g),S):B(g)?(e.consume(g),F):E(g)}function S(g){return g===null||g===60||g===61||g===62||g===96?t(g):g===34||g===39?(e.consume(g),s=g,O):B(g)?(e.consume(g),S):$(g)}function O(g){return g===s?(e.consume(g),s=null,H):g===null||P(g)?t(g):(e.consume(g),O)}function $(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||X(g)?F(g):(e.consume(g),$)}function H(g){return g===47||g===62||B(g)?E(g):t(g)}function k(g){return g===62?(e.consume(g),j):t(g)}function j(g){return g===null||P(g)?A(g):B(g)?(e.consume(g),j):t(g)}function A(g){return g===45&&i===2?(e.consume(g),J):g===60&&i===1?(e.consume(g),_):g===62&&i===4?(e.consume(g),fe):g===63&&i===3?(e.consume(g),d):g===93&&i===5?(e.consume(g),de):P(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xo,ye,L)(g)):g===null||P(g)?(e.exit("htmlFlowData"),L(g)):(e.consume(g),A)}function L(g){return e.check(yo,T,ye)(g)}function T(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),z}function z(g){return g===null||P(g)?L(g):(e.enter("htmlFlowData"),A(g))}function J(g){return g===45?(e.consume(g),d):A(g)}function _(g){return g===47?(e.consume(g),l="",V):A(g)}function V(g){if(g===62){const he=l.toLowerCase();return er.includes(he)?(e.consume(g),fe):A(g)}return re(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),V):A(g)}function de(g){return g===93?(e.consume(g),d):A(g)}function d(g){return g===62?(e.consume(g),fe):g===45&&i===2?(e.consume(g),d):A(g)}function fe(g){return g===null||P(g)?(e.exit("htmlFlowData"),ye(g)):(e.consume(g),fe)}function ye(g){return e.exit("htmlFlow"),n(g)}}function wo(e,n,t){const r=this;return i;function i(l){return P(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):t(l)}function a(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function So(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(nt,n,t)}}const vo={name:"htmlText",tokenize:Co};function Co(e,n,t){const r=this;let i,a,l;return o;function o(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),s}function s(d){return d===33?(e.consume(d),u):d===47?(e.consume(d),F):d===63?(e.consume(d),E):re(d)?(e.consume(d),$):t(d)}function u(d){return d===45?(e.consume(d),f):d===91?(e.consume(d),a=0,x):re(d)?(e.consume(d),N):t(d)}function f(d){return d===45?(e.consume(d),h):t(d)}function c(d){return d===null?t(d):d===45?(e.consume(d),p):P(d)?(l=c,_(d)):(e.consume(d),c)}function p(d){return d===45?(e.consume(d),h):c(d)}function h(d){return d===62?J(d):d===45?p(d):c(d)}function x(d){const fe="CDATA[";return d===fe.charCodeAt(a++)?(e.consume(d),a===fe.length?b:x):t(d)}function b(d){return d===null?t(d):d===93?(e.consume(d),v):P(d)?(l=b,_(d)):(e.consume(d),b)}function v(d){return d===93?(e.consume(d),y):b(d)}function y(d){return d===62?J(d):d===93?(e.consume(d),y):b(d)}function N(d){return d===null||d===62?J(d):P(d)?(l=N,_(d)):(e.consume(d),N)}function E(d){return d===null?t(d):d===63?(e.consume(d),D):P(d)?(l=E,_(d)):(e.consume(d),E)}function D(d){return d===62?J(d):E(d)}function F(d){return re(d)?(e.consume(d),S):t(d)}function S(d){return d===45||te(d)?(e.consume(d),S):O(d)}function O(d){return P(d)?(l=O,_(d)):B(d)?(e.consume(d),O):J(d)}function $(d){return d===45||te(d)?(e.consume(d),$):d===47||d===62||X(d)?H(d):t(d)}function H(d){return d===47?(e.consume(d),J):d===58||d===95||re(d)?(e.consume(d),k):P(d)?(l=H,_(d)):B(d)?(e.consume(d),H):J(d)}function k(d){return d===45||d===46||d===58||d===95||te(d)?(e.consume(d),k):j(d)}function j(d){return d===61?(e.consume(d),A):P(d)?(l=j,_(d)):B(d)?(e.consume(d),j):H(d)}function A(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),i=d,L):P(d)?(l=A,_(d)):B(d)?(e.consume(d),A):(e.consume(d),T)}function L(d){return d===i?(e.consume(d),i=void 0,z):d===null?t(d):P(d)?(l=L,_(d)):(e.consume(d),L)}function T(d){return d===null||d===34||d===39||d===60||d===61||d===96?t(d):d===47||d===62||X(d)?H(d):(e.consume(d),T)}function z(d){return d===47||d===62||X(d)?H(d):t(d)}function J(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),n):t(d)}function _(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),V}function V(d){return B(d)?q(e,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):de(d)}function de(d){return e.enter("htmlTextData"),l(d)}}const fn={name:"labelEnd",resolveAll:To,resolveTo:jo,tokenize:Ao},Eo={tokenize:Lo},No={tokenize:Po},Io={tokenize:zo};function To(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&&ue(e,0,e.length,t),e}function jo(e,n){let t=e.length,r=0,i,a,l,o;for(;t--;)if(i=e[t][1],a){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&&(a=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const s={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return o=[["enter",s,n],["enter",u,n]],o=ce(o,e.slice(a+1,a+r+3)),o=ce(o,[["enter",f,n]]),o=ce(o,vt(n.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),n)),o=ce(o,[["exit",f,n],e[l-2],e[l-1],["exit",u,n]]),o=ce(o,e.slice(l+1)),o=ce(o,[["exit",s,n]]),ue(e,a,e.length,o),e}function Ao(e,n,t){const r=this;let i=r.events.length,a,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return o;function o(p){return a?a._inactive?c(p):(l=r.parser.defined.includes(me(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),s):t(p)}function s(p){return p===40?e.attempt(Eo,f,l?f:c)(p):p===91?e.attempt(No,f,l?u:c)(p):l?f(p):c(p)}function u(p){return e.attempt(Io,f,c)(p)}function f(p){return n(p)}function c(p){return a._balanced=!0,t(p)}}function Lo(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 X(c)?Ke(e,a)(c):a(c)}function a(c){return c===41?f(c):Jr(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return X(c)?Ke(e,s)(c):f(c)}function o(c){return t(c)}function s(c){return c===34||c===39||c===40?ei(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return X(c)?Ke(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 Po(e,n,t){const r=this;return i;function i(o){return Zr.call(r,e,a,l,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(me(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(o):t(o)}function l(o){return t(o)}}function zo(e,n,t){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),n):t(a)}}const Do={name:"labelStartImage",resolveAll:fn.resolveAll,tokenize:Fo};function Fo(e,n,t){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),l):t(o)}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}const _o={name:"labelStartLink",resolveAll:fn.resolveAll,tokenize:Ro};function Ro(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"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Lt={name:"lineEnding",tokenize:Oo};function Oo(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),q(e,n,"linePrefix")}}const gt={name:"thematicBreak",tokenize:Mo};function Mo(e,n,t){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||P(u))?(e.exit("thematicBreak"),n(u)):t(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),B(u)?q(e,o,"whitespace")(u):o(u))}}const ie={continuation:{tokenize:qo},exit:$o,name:"list",tokenize:Ho},Bo={partial:!0,tokenize:Wo},Uo={partial:!0,tokenize:Vo};function Ho(e,n,t){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return o;function o(h){const x=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Yt(h)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(gt,t,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(h)}return t(h)}function s(h){return Yt(h)&&++l<10?(e.consume(h),s):(!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(nt,r.interrupt?t:f,e.attempt(Bo,p,c))}function f(h){return r.containerState.initialBlankLine=!0,a++,p(h)}function c(h){return B(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function qo(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(nt,i,a);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,q(e,n,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!B(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Uo,n,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,q(e,e.attempt(ie,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Vo(e,n,t){const r=this;return q(e,i,"listItemIndent",r.containerState.size+1);function i(a){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(a):t(a)}}function $o(e){e.exit(this.containerState.type)}function Wo(e,n,t){const r=this;return q(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=r.events[r.events.length-1];return!B(a)&&l&&l[1].type==="listItemPrefixWhitespace"?n(a):t(a)}}const tr={name:"setextUnderline",resolveTo:Go,tokenize:Yo};function Go(e,n){let t=e.length,r,i,a;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),!a&&e[t][1].type==="definition"&&(a=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,n]),e.splice(a+1,0,["exit",e[r][1],n]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function Yo(e,n,t){const r=this;let i;return a;function a(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"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),B(u)?q(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||P(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const Xo={tokenize:Qo};function Qo(e){const n=this,t=e.attempt(nt,r,e.attempt(this.parser.constructs.flowInitial,i,q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(eo,i)),"linePrefix")));return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Ko={resolveAll:ni()},Jo=ti("string"),Zo=ti("text");function ti(e){return{resolveAll:ni(e==="text"?es:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],a=t.attempt(i,l,o);return l;function l(f){return u(f)?a(f):o(f)}function o(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),s}function s(f){return u(f)?(t.exit("data"),a(f)):(t.consume(f),s)}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 ni(e){return n;function n(t,r){let i=-1,a;for(;++i<=t.length;)a===void 0?t[i]&&t[i][1].type==="data"&&(a=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==a+2&&(t[a][1].end=t[i-1][1].end,t.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(t,r):t}}function es(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 a=i.length,l=-1,o=0,s;for(;a--;){const u=i[a];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)o++,l--;if(l)break;l=-1}else if(u===-2)s=!0,o++;else if(u!==-1){a++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(o=0),o){const u={type:t===e.length||s||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},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 ts={42:ie,43:ie,45:ie,48:ie,49:ie,50:ie,51:ie,52:ie,53:ie,54:ie,55:ie,56:ie,57:ie,62:Yr},ns={91:lo},rs={[-2]:At,[-1]:At,32:At},is={35:fo,42:gt,45:[tr,gt],60:go,61:tr,95:gt,96:Zn,126:Zn},ls={38:Qr,92:Xr},as={[-5]:Lt,[-4]:Lt,[-3]:Lt,33:Do,38:Qr,42:Xt,60:[Fa,vo],91:_o,92:[uo,Xr],93:fn,95:Xt,96:Ya},os={null:[Xt,Ko]},ss={null:[42,95]},us={null:[]},cs=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ss,contentInitial:ns,disable:us,document:ts,flow:is,flowInitial:rs,insideSpan:os,string:ls,text:as},Symbol.toStringTag,{value:"Module"}));function fs(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={},a=[];let l=[],o=[];const s={attempt:O(F),check:O(S),consume:N,enter:E,exit:D,interrupt:O(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(u,s);return n.resolveAll&&a.push(n),u;function c(j){return l=ce(l,j),v(),l[l.length-1]!==null?[]:($(n,0),u.events=vt(a,u.events,u),u.events)}function p(j,A){return ps(h(j),A)}function h(j){return hs(l,j)}function x(){const{_bufferIndex:j,_index:A,line:L,column:T,offset:z}=r;return{_bufferIndex:j,_index:A,line:L,column:T,offset:z}}function b(j){i[j.line]=j.column,k()}function v(){let j;for(;r._index<l.length;){const A=l[r._index];if(typeof A=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<A.length;)y(A.charCodeAt(r._bufferIndex));else y(A)}}function y(j){f=f(j)}function N(j){P(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,k()):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 E(j,A){const L=A||{};return L.type=j,L.start=x(),u.events.push(["enter",L,u]),o.push(L),L}function D(j){const A=o.pop();return A.end=x(),u.events.push(["exit",A,u]),A}function F(j,A){$(j,A.from)}function S(j,A){A.restore()}function O(j,A){return L;function L(T,z,J){let _,V,de,d;return Array.isArray(T)?ye(T):"tokenize"in T?ye([T]):fe(T);function fe(ee){return He;function He(Se){const Ae=Se!==null&&ee[Se],Le=Se!==null&&ee.null,it=[...Array.isArray(Ae)?Ae:Ae?[Ae]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return ye(it)(Se)}}function ye(ee){return _=ee,V=0,ee.length===0?J:g(ee[V])}function g(ee){return He;function He(Se){return d=H(),de=ee,ee.partial||(u.currentConstruct=ee),ee.name&&u.parser.constructs.disable.null.includes(ee.name)?Ee():ee.tokenize.call(A?Object.assign(Object.create(u),A):u,s,he,Ee)(Se)}}function he(ee){return j(de,d),z}function Ee(ee){return d.restore(),++V<_.length?g(_[V]):J}}}function $(j,A){j.resolveAll&&!a.includes(j)&&a.push(j),j.resolve&&ue(u.events,A,u.events.length-A,j.resolve(u.events.slice(A),u)),j.resolveTo&&(u.events=j.resolveTo(u.events,u))}function H(){const j=x(),A=u.previous,L=u.currentConstruct,T=u.events.length,z=Array.from(o);return{from:T,restore:J};function J(){r=j,u.previous=A,u.currentConstruct=L,u.events.length=T,o=z,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function hs(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,a=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,a)];else{if(l=e.slice(t,i),r>-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function ps(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const a=e[t];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
`;break}case-3:{l=`\r
`;break}case-2:{l=n?" ":"	";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function ms(e){const r={constructs:Wr([cs,...(e||{}).extensions||[]]),content:i(Ta),defined:[],document:i(Aa),flow:i(Xo),lazy:{},string:i(Jo),text:i(Zo)};return r;function i(a){return l;function l(o){return fs(r,a,o)}}}function ds(e){for(;!Kr(e););return e}const nr=/[\0\t\n\r]/g;function gs(){let e=1,n="",t=!0,r;return i;function i(a,l,o){const s=[];let u,f,c,p,h;for(a=n+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),c=0,n="",t&&(a.charCodeAt(0)===65279&&c++,t=void 0);c<a.length;){if(nr.lastIndex=c,u=nr.exec(a),p=u&&u.index!==void 0?u.index:a.length,h=a.charCodeAt(p),!u){n=a.slice(c);break}if(h===10&&c===p&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<p&&(s.push(a.slice(c,p)),e+=p-c),h){case 0:{s.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,s.push(-2);e++<f;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return o&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const xs=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ys(e){return e.replace(xs,ks)}function ks(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),a=i===120||i===88;return Gr(t.slice(a?2:1),a?16:10)}return cn(t)||e}const ri={}.hasOwnProperty;function bs(e,n,t){return typeof n!="string"&&(t=n,n=void 0),ws(t)(ds(ms(t).document().write(gs()(e,n,!0))))}function ws(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Cn),autolinkProtocol:H,autolinkEmail:H,atxHeading:a(wn),blockQuote:a(Le),characterEscape:H,characterReference:H,codeFenced:a(it),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(it,l),codeText:a(_i,l),codeTextData:H,data:H,codeFlowValue:H,definition:a(Ri),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Oi),hardBreakEscape:a(Sn),hardBreakTrailing:a(Sn),htmlFlow:a(vn,l),htmlFlowData:H,htmlText:a(vn,l),htmlTextData:H,image:a(Mi),label:l,link:a(Cn),listItem:a(Bi),listItemValue:p,listOrdered:a(En,c),listUnordered:a(En),paragraph:a(Ui),reference:g,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(wn),strong:a(Hi),thematicBreak:a(Vi)},exit:{atxHeading:s(),atxHeadingSequence:F,autolink:s(),autolinkEmail:Ae,autolinkProtocol:Se,blockQuote:s(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:Ee,characterReferenceMarkerNumeric:Ee,characterReferenceValue:ee,characterReference:He,codeFenced:s(v),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:x,codeFlowValue:k,codeIndented:s(y),codeText:s(z),codeTextData:k,data:k,definition:s(),definitionDestinationString:D,definitionLabelString:N,definitionTitleString:E,emphasis:s(),hardBreakEscape:s(A),hardBreakTrailing:s(A),htmlFlow:s(L),htmlFlowData:k,htmlText:s(T),htmlTextData:k,image:s(_),label:de,labelText:V,lineEnding:j,link:s(J),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:he,resourceDestinationString:d,resourceTitleString:fe,resource:ye,setextHeading:s($),setextHeadingLineSequence:O,setextHeadingText:S,strong:s(),thematicBreak:s()}};ii(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(w){let I={type:"root",children:[]};const R={stack:[I],tokenStack:[],config:n,enter:o,exit:u,buffer:l,resume:f,data:t},U=[];let Y=-1;for(;++Y<w.length;)if(w[Y][1].type==="listOrdered"||w[Y][1].type==="listUnordered")if(w[Y][0]==="enter")U.push(Y);else{const pe=U.pop();Y=i(w,pe,Y)}for(Y=-1;++Y<w.length;){const pe=n[w[Y][0]];ri.call(pe,w[Y][1].type)&&pe[w[Y][1].type].call(Object.assign({sliceSerialize:w[Y][2].sliceSerialize},R),w[Y][1])}if(R.tokenStack.length>0){const pe=R.tokenStack[R.tokenStack.length-1];(pe[1]||rr).call(R,void 0,pe[0])}for(I.position={start:ve(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:ve(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},Y=-1;++Y<n.transforms.length;)I=n.transforms[Y](I)||I;return I}function i(w,I,R){let U=I-1,Y=-1,pe=!1,Ne,ke,qe,Ve;for(;++U<=R;){const oe=w[U];switch(oe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{oe[0]==="enter"?Y++:Y--,Ve=void 0;break}case"lineEndingBlank":{oe[0]==="enter"&&(Ne&&!Ve&&!Y&&!qe&&(qe=U),Ve=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ve=void 0}if(!Y&&oe[0]==="enter"&&oe[1].type==="listItemPrefix"||Y===-1&&oe[0]==="exit"&&(oe[1].type==="listUnordered"||oe[1].type==="listOrdered")){if(Ne){let Pe=U;for(ke=void 0;Pe--;){const be=w[Pe];if(be[1].type==="lineEnding"||be[1].type==="lineEndingBlank"){if(be[0]==="exit")continue;ke&&(w[ke][1].type="lineEndingBlank",pe=!0),be[1].type="lineEnding",ke=Pe}else if(!(be[1].type==="linePrefix"||be[1].type==="blockQuotePrefix"||be[1].type==="blockQuotePrefixWhitespace"||be[1].type==="blockQuoteMarker"||be[1].type==="listItemIndent"))break}qe&&(!ke||qe<ke)&&(Ne._spread=!0),Ne.end=Object.assign({},ke?w[ke][1].start:oe[1].end),w.splice(ke||U,0,["exit",Ne,oe[2]]),U++,R++}if(oe[1].type==="listItemPrefix"){const Pe={type:"listItem",_spread:!1,start:Object.assign({},oe[1].start),end:void 0};Ne=Pe,w.splice(U,0,["enter",Pe,oe[2]]),U++,R++,qe=void 0,Ve=!0}}}return w[I][1]._spread=pe,R}function a(w,I){return R;function R(U){o.call(this,w(U),U),I&&I.call(this,U)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(w,I,R){this.stack[this.stack.length-1].children.push(w),this.stack.push(w),this.tokenStack.push([I,R||void 0]),w.position={start:ve(I.start),end:void 0}}function s(w){return I;function I(R){w&&w.call(this,R),u.call(this,R)}}function u(w,I){const R=this.stack.pop(),U=this.tokenStack.pop();if(U)U[0].type!==w.type&&(I?I.call(this,w,U[0]):(U[1]||rr).call(this,w,U[0]));else throw new Error("Cannot close `"+w.type+"` ("+Qe({start:w.start,end:w.end})+"): it’s not open");R.position.end=ve(w.end)}function f(){return un(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(w){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(w),10),this.data.expectingFirstListItemValue=void 0}}function h(){const w=this.resume(),I=this.stack[this.stack.length-1];I.lang=w}function x(){const w=this.resume(),I=this.stack[this.stack.length-1];I.meta=w}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w.replace(/(\r?\n|\r)$/g,"")}function N(w){const I=this.resume(),R=this.stack[this.stack.length-1];R.label=I,R.identifier=me(this.sliceSerialize(w)).toLowerCase()}function E(){const w=this.resume(),I=this.stack[this.stack.length-1];I.title=w}function D(){const w=this.resume(),I=this.stack[this.stack.length-1];I.url=w}function F(w){const I=this.stack[this.stack.length-1];if(!I.depth){const R=this.sliceSerialize(w).length;I.depth=R}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function O(w){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(w).codePointAt(0)===61?1:2}function $(){this.data.setextHeadingSlurpLineEnding=void 0}function H(w){const R=this.stack[this.stack.length-1].children;let U=R[R.length-1];(!U||U.type!=="text")&&(U=qi(),U.position={start:ve(w.start),end:void 0},R.push(U)),this.stack.push(U)}function k(w){const I=this.stack.pop();I.value+=this.sliceSerialize(w),I.position.end=ve(w.end)}function j(w){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const R=I.children[I.children.length-1];R.position.end=ve(w.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(I.type)&&(H.call(this,w),k.call(this,w))}function A(){this.data.atHardBreak=!0}function L(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function T(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function z(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function J(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=I,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function _(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=I,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function V(w){const I=this.sliceSerialize(w),R=this.stack[this.stack.length-2];R.label=ys(I),R.identifier=me(I).toLowerCase()}function de(){const w=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 U=w.children;R.children=U}else R.alt=I}function d(){const w=this.resume(),I=this.stack[this.stack.length-1];I.url=w}function fe(){const w=this.resume(),I=this.stack[this.stack.length-1];I.title=w}function ye(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function he(w){const I=this.resume(),R=this.stack[this.stack.length-1];R.label=I,R.identifier=me(this.sliceSerialize(w)).toLowerCase(),this.data.referenceType="full"}function Ee(w){this.data.characterReferenceType=w.type}function ee(w){const I=this.sliceSerialize(w),R=this.data.characterReferenceType;let U;R?(U=Gr(I,R==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):U=cn(I);const Y=this.stack[this.stack.length-1];Y.value+=U}function He(w){const I=this.stack.pop();I.position.end=ve(w.end)}function Se(w){k.call(this,w);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(w)}function Ae(w){k.call(this,w);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(w)}function Le(){return{type:"blockquote",children:[]}}function it(){return{type:"code",lang:null,meta:null,value:""}}function _i(){return{type:"inlineCode",value:""}}function Ri(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oi(){return{type:"emphasis",children:[]}}function wn(){return{type:"heading",depth:0,children:[]}}function Sn(){return{type:"break"}}function vn(){return{type:"html",value:""}}function Mi(){return{type:"image",title:null,url:"",alt:null}}function Cn(){return{type:"link",title:null,url:"",children:[]}}function En(w){return{type:"list",ordered:w.type==="listOrdered",start:null,spread:w._spread,children:[]}}function Bi(w){return{type:"listItem",spread:w._spread,checked:null,children:[]}}function Ui(){return{type:"paragraph",children:[]}}function Hi(){return{type:"strong",children:[]}}function qi(){return{type:"text",value:""}}function Vi(){return{type:"thematicBreak"}}}function ve(e){return{line:e.line,column:e.column,offset:e.offset}}function ii(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?ii(e,r):Ss(e,r)}}function Ss(e,n){let t;for(t in n)if(ri.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 rr(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Qe({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Qe({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Qe({start:n.start,end:n.end})+") is still open")}function vs(e){const n=this;n.parser=t;function t(r){return bs(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Cs(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 Es(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
`}]}function Ns(e,n){const t=n.value?n.value+`
`:"",r={};n.lang&&(r.className=["language-"+n.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Is(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ts(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function js(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Ue(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,o+=1,e.footnoteCounts.set(r,o);const s={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(n,u),e.applyData(n,u)}function As(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 Ls(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function li(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),a=i[0];a&&a.type==="text"?a.value="["+a.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 Ps(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return li(e,n);const i={src:Ue(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,a),e.applyData(n,a)}function zs(e,n){const t={src:Ue(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 Ds(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 Fs(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return li(e,n);const i={href:Ue(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function _s(e,n){const t={href:Ue(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 Rs(e,n,t){const r=e.all(n),i=t?Os(t):ai(n),a={},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:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const f=r[o];(i||o!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
`}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const s=r[r.length-1];s&&(i||s.type!=="element"||s.tagName!=="p")&&l.push({type:"text",value:`
`});const u={type:"element",tagName:"li",properties:a,children:l};return e.patch(n,u),e.applyData(n,u)}function Os(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=ai(t[r])}return n}function ai(e){const n=e.spread;return n??e.children.length>1}function Ms(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 a={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,a),e.applyData(n,a)}function Bs(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Us(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function Hs(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function qs(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)},o=ln(n.children[1]),s=Mr(n.children[n.children.length-1]);o&&s&&(l.position={start:o,end:s}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,a),e.applyData(n,a)}function Vs(e,n,t){const r=t?t.children:void 0,a=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,o=l?l.length:n.children.length;let s=-1;const u=[];for(;++s<o;){const c=n.children[s],p={},h=l?l[s]:void 0;h&&(p.align=h);let x={type:"element",tagName:a,properties:p,children:[]};c&&(x.children=e.all(c),e.patch(c,x),x=e.applyData(c,x)),u.push(x)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,f),e.applyData(n,f)}function $s(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ir=9,lr=32;function Ws(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const a=[];for(;r;)a.push(ar(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return a.push(ar(n.slice(i),i>0,!1)),a.join("")}function ar(e,n,t){let r=0,i=e.length;if(n){let a=e.codePointAt(r);for(;a===ir||a===lr;)r++,a=e.codePointAt(r)}if(t){let a=e.codePointAt(i-1);for(;a===ir||a===lr;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Gs(e,n){const t={type:"text",value:Ws(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Ys(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Xs={blockquote:Cs,break:Es,code:Ns,delete:Is,emphasis:Ts,footnoteReference:js,heading:As,html:Ls,imageReference:Ps,image:zs,inlineCode:Ds,linkReference:Fs,link:_s,listItem:Rs,list:Ms,paragraph:Bs,root:Us,strong:Hs,table:qs,tableCell:$s,tableRow:Vs,text:Gs,thematicBreak:Ys,toml:ft,yaml:ft,definition:ft,footnoteDefinition:ft};function ft(){}const oi=-1,Ct=0,Je=1,yt=2,hn=3,pn=4,mn=5,dn=6,si=7,ui=8,or=typeof self=="object"?self:globalThis,Qs=(e,n)=>{const t=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=n[i];switch(a){case Ct:case oi:return t(l,i);case Je:{const o=t([],i);for(const s of l)o.push(r(s));return o}case yt:{const o=t({},i);for(const[s,u]of l)o[r(s)]=r(u);return o}case hn:return t(new Date(l),i);case pn:{const{source:o,flags:s}=l;return t(new RegExp(o,s),i)}case mn:{const o=t(new Map,i);for(const[s,u]of l)o.set(r(s),r(u));return o}case dn:{const o=t(new Set,i);for(const s of l)o.add(r(s));return o}case si:{const{name:o,message:s}=l;return t(new or[o](s),i)}case ui: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:o}=new Uint8Array(l);return t(new DataView(o),l)}}return t(new or[a](l),i)};return r},sr=e=>Qs(new Map,e)(0),Fe="",{toString:Ks}={},{keys:Js}=Object,Xe=e=>{const n=typeof e;if(n!=="object"||!e)return[Ct,n];const t=Ks.call(e).slice(8,-1);switch(t){case"Array":return[Je,Fe];case"Object":return[yt,Fe];case"Date":return[hn,Fe];case"RegExp":return[pn,Fe];case"Map":return[mn,Fe];case"Set":return[dn,Fe];case"DataView":return[Je,t]}return t.includes("Array")?[Je,t]:t.includes("Error")?[si,t]:[yt,t]},ht=([e,n])=>e===Ct&&(n==="function"||n==="symbol"),Zs=(e,n,t,r)=>{const i=(l,o)=>{const s=r.push(l)-1;return t.set(o,s),s},a=l=>{if(t.has(l))return t.get(l);let[o,s]=Xe(l);switch(o){case Ct:{let f=l;switch(s){case"bigint":o=ui,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);f=null;break;case"undefined":return i([oi],l)}return i([o,f],l)}case Je:{if(s){let p=l;return s==="DataView"?p=new Uint8Array(l.buffer):s==="ArrayBuffer"&&(p=new Uint8Array(l)),i([s,[...p]],l)}const f=[],c=i([o,f],l);for(const p of l)f.push(a(p));return c}case yt:{if(s)switch(s){case"BigInt":return i([s,l.toString()],l);case"Boolean":case"Number":case"String":return i([s,l.valueOf()],l)}if(n&&"toJSON"in l)return a(l.toJSON());const f=[],c=i([o,f],l);for(const p of Js(l))(e||!ht(Xe(l[p])))&&f.push([a(p),a(l[p])]);return c}case hn:return i([o,l.toISOString()],l);case pn:{const{source:f,flags:c}=l;return i([o,{source:f,flags:c}],l)}case mn:{const f=[],c=i([o,f],l);for(const[p,h]of l)(e||!(ht(Xe(p))||ht(Xe(h))))&&f.push([a(p),a(h)]);return c}case dn:{const f=[],c=i([o,f],l);for(const p of l)(e||!ht(Xe(p)))&&f.push(a(p));return c}}const{message:u}=l;return i([o,{name:s,message:u}],l)};return a},ur=(e,{json:n,lossy:t}={})=>{const r=[];return Zs(!(n||t),!!n,new Map,r)(e),r},kt=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?sr(ur(e,n)):structuredClone(e):(e,n)=>sr(ur(e,n));function eu(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 tu(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function nu(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||eu,r=e.options.footnoteBackLabel||tu,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let s=-1;for(;++s<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[s]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),p=Ue(c.toLowerCase());let h=0;const x=[],b=e.footnoteCounts.get(c);for(;b!==void 0&&++h<=b;){x.length>0&&x.push({type:"text",value:" "});let N=typeof t=="string"?t:t(s,h);typeof N=="string"&&(N={type:"text",value:N}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(s,h),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const v=f[f.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const N=v.children[v.children.length-1];N&&N.type==="text"?N.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else f.push(...x);const y={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...kt(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
`}]}}const Et=function(e){if(e==null)return au;if(typeof e=="function")return Nt(e);if(typeof e=="object")return Array.isArray(e)?ru(e):iu(e);if(typeof e=="string")return lu(e);throw new Error("Expected function, string, or object as test")};function ru(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=Et(e[t]);return Nt(r);function r(...i){let a=-1;for(;++a<n.length;)if(n[a].apply(this,i))return!0;return!1}}function iu(e){const n=e;return Nt(t);function t(r){const i=r;let a;for(a in e)if(i[a]!==n[a])return!1;return!0}}function lu(e){return Nt(n);function n(t){return t&&t.type===e}}function Nt(e){return n;function n(t,r,i){return!!(ou(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function au(){return!0}function ou(e){return e!==null&&typeof e=="object"&&"type"in e}const ci=[],su=!0,Qt=!1,uu="skip";function fi(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const a=Et(i),l=r?-1:1;o(e,void 0,[])();function o(s,u,f){const c=s&&typeof s=="object"?s:{};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 ("+(s.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=ci,x,b,v;if((!n||a(s,u,f[f.length-1]||void 0))&&(h=cu(t(s,f)),h[0]===Qt))return h;if("children"in s&&s.children){const y=s;if(y.children&&h[0]!==uu)for(b=(r?y.children.length:-1)+l,v=f.concat(y);b>-1&&b<y.children.length;){const N=y.children[b];if(x=o(N,b,v)(),x[0]===Qt)return x;b=typeof x[1]=="number"?x[1]:b+l}}return h}}}function cu(e){return Array.isArray(e)?e:typeof e=="number"?[su,e]:e==null?ci:[e]}function gn(e,n,t,r){let i,a,l;typeof n=="function"&&typeof t!="function"?(a=void 0,l=n,i=t):(a=n,l=t,i=r),fi(e,a,o,i);function o(s,u){const f=u[u.length-1],c=f?f.children.indexOf(s):void 0;return l(s,c,f)}}const Kt={}.hasOwnProperty,fu={};function hu(e,n){const t=n||fu,r=new Map,i=new Map,a=new Map,l={...Xs,...t.handlers},o={all:u,applyData:mu,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:s,options:t,patch:pu,wrap:gu};return gn(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)}}),o;function s(f,c){const p=f.type,h=o.handlers[p];if(Kt.call(o.handlers,p)&&h)return h(o,f,c);if(o.options.passThrough&&o.options.passThrough.includes(p)){if("children"in f){const{children:b,...v}=f,y=kt(v);return y.children=o.all(f),y}return kt(f)}return(o.options.unknownHandler||du)(o,f,c)}function u(f){const c=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const x=o.one(p[h],f);if(x){if(h&&p[h-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=cr(x.value)),!Array.isArray(x)&&x.type==="element")){const b=x.children[0];b&&b.type==="text"&&(b.value=cr(b.value))}Array.isArray(x)?c.push(...x):c.push(x)}}}return c}}function pu(e,n){e.position&&(n.position=ea(e))}function mu(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=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"&&a&&Object.assign(t.properties,kt(a)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function du(e,n){const t=n.data||{},r="value"in n&&!(Kt.call(t,"hProperties")||Kt.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 gu(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
`});++r<e.length;)r&&t.push({type:"text",value:`
`}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
`}),t}function cr(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function fr(e,n){const t=hu(e,n),r=t.one(e,void 0),i=nu(t),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
`},i),a}function xu(e,n){return e&&"run"in e?async function(t,r){const i=fr(t,{file:r,...n});await e.run(i,r)}:function(t,r){return fr(t,{file:r,...e||n})}}function hr(e){if(e)throw e}var Pt,pr;function yu(){if(pr)return Pt;pr=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]"},a=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},o=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return Pt=function s(){var u,f,c,p,h,x,b=arguments[0],v=1,y=arguments.length,N=!1;for(typeof b=="boolean"&&(N=b,b=arguments[1]||{},v=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});v<y;++v)if(u=arguments[v],u!=null)for(f in u)c=o(b,f),p=o(u,f),b!==p&&(N&&p&&(a(p)||(h=i(p)))?(h?(h=!1,x=c&&i(c)?c:[]):x=c&&a(c)?c:{},l(b,{name:f,newValue:s(N,x,p)})):typeof p<"u"&&l(b,{name:f,newValue:p}));return b},Pt}var ku=yu();const zt=Nr(ku);function Jt(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 bu(){const e=[],n={run:t,use:r};return n;function t(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);o(null,...i);function o(s,...u){const f=e[++a];let c=-1;if(s){l(s);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?wu(f,o)(...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 wu(e,n){let t;return r;function r(...l){const o=e.length>l.length;let s;o&&l.push(i);try{s=e.apply(this,l)}catch(u){const f=u;if(o&&t)throw f;return i(f)}o||(s&&s.then&&typeof s.then=="function"?s.then(a,i):s instanceof Error?i(s):a(s))}function i(l,...o){t||(t=!0,n(l,...o))}function a(l){i(null,l)}}const ge={basename:Su,dirname:vu,extname:Cu,join:Eu,sep:"/"};function Su(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');rt(e);let t=0,r=-1,i=e.length,a;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){t=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,o=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){t=i+1;break}}else l<0&&(a=!0,l=i+1),o>-1&&(e.codePointAt(i)===n.codePointAt(o--)?o<0&&(r=i):(o=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function vu(e){if(rt(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 Cu(e){rt(e);let n=e.length,t=-1,r=0,i=-1,a=0,l;for(;n--;){const o=e.codePointAt(n);if(o===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),o===46?i<0?i=n:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||t<0||a===0||a===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Eu(...e){let n=-1,t;for(;++n<e.length;)rt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Nu(t)}function Nu(e){rt(e);const n=e.codePointAt(0)===47;let t=Iu(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Iu(e,n){let t="",r=0,i=-1,a=0,l=-1,o,s;for(;++l<=e.length;){if(l<e.length)o=e.codePointAt(l);else{if(o===47)break;o=47}if(o===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(s=t.lastIndexOf("/"),s!==t.length-1){s<0?(t="",r=0):(t=t.slice(0,s),r=t.length-1-t.lastIndexOf("/")),i=l,a=0;continue}}else if(t.length>0){t="",r=0,i=l,a=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,a=0}else o===46&&a>-1?a++:a=-1}return t}function rt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Tu={cwd:ju};function ju(){return"/"}function Zt(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Au(e){if(typeof e=="string")e=new URL(e);else if(!Zt(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 Lu(e)}function Lu(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 Dt=["history","path","basename","stem","extname","dirname"];class hi{constructor(n){let t;n?Zt(n)?t={path:n}:typeof n=="string"||Pu(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Tu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Dt.length;){const a=Dt[r];a in t&&t[a]!==void 0&&t[a]!==null&&(this[a]=a==="history"?[...t[a]]:t[a])}let i;for(i in t)Dt.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?ge.basename(this.path):void 0}set basename(n){_t(n,"basename"),Ft(n,"basename"),this.path=ge.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ge.dirname(this.path):void 0}set dirname(n){mr(this.basename,"dirname"),this.path=ge.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ge.extname(this.path):void 0}set extname(n){if(Ft(n,"extname"),mr(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=ge.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Zt(n)&&(n=Au(n)),_t(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ge.basename(this.path,this.extname):void 0}set stem(n){_t(n,"stem"),Ft(n,"stem"),this.path=ge.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 ne(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 Ft(e,n){if(e&&e.includes(ge.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ge.sep+"`")}function _t(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function mr(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function Pu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zu=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},Du={}.hasOwnProperty;class xn extends zu{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=bu()}copy(){const n=new xn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(zt(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(Mt("data",this.frozen),this.namespace[n]=t,this):Du.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Mt("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=pt(n),r=this.parser||this.Parser;return Rt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),Rt("process",this.parser||this.Parser),Ot("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(a,l){const o=pt(n),s=r.parse(o);r.run(s,o,function(f,c,p){if(f||!c||!p)return u(f);const h=c,x=r.stringify(h,p);Ru(x)?p.value=x:p.result=x,u(f,p)});function u(f,c){f||!c?l(f):a?a(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),Rt("processSync",this.parser||this.Parser),Ot("processSync",this.compiler||this.Compiler),this.process(n,i),gr("processSync","process",t),r;function i(a,l){t=!0,hr(a),r=l}}run(n,t,r){dr(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?a(void 0,r):new Promise(a);function a(l,o){const s=pt(t);i.run(n,s,u);function u(f,c,p){const h=c||n;f?o(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,a),gr("runSync","run",r),i;function a(l,o){hr(l),i=o,r=!0}}stringify(n,t){this.freeze();const r=pt(t),i=this.compiler||this.Compiler;return Ot("stringify",i),dr(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(Mt("use",this.frozen),n!=null)if(typeof n=="function")s(n,t);else if(typeof n=="object")Array.isArray(n)?o(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function a(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;s(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");o(u.plugins),u.settings&&(i.settings=zt(!0,i.settings,u.settings))}function o(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];a(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(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,...x]=f;const b=r[p][1];Jt(b)&&Jt(h)&&(h=zt(!0,b,h)),r[p]=[u,h,...x]}}}}const Fu=new xn().freeze();function Rt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ot(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Mt(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 dr(e){if(!Jt(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function gr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function pt(e){return _u(e)?e:new hi(e)}function _u(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ru(e){return typeof e=="string"||Ou(e)}function Ou(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Mu="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",xr=[],yr={allowDangerousHtml:!0},Bu=/^(https?|ircs?|mailto|xmpp)$/i,Uu=[{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 Hu(e){const n=qu(e),t=Vu(e);return $u(n.runSync(n.parse(t),t),e)}function qu(e){const n=e.rehypePlugins||xr,t=e.remarkPlugins||xr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yr}:yr;return Fu().use(vs).use(t).use(xu,r).use(n)}function Vu(e){const n=e.children||"",t=new hi;return typeof n=="string"&&(t.value=n),t}function $u(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,a=n.disallowedElements,l=n.skipHtml,o=n.unwrapDisallowed,s=n.urlTransform||Wu;for(const f of Uu)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Mu+f.id,void 0);return gn(e,u),la(e,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.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 jt)if(Object.hasOwn(jt,h)&&Object.hasOwn(f.properties,h)){const x=f.properties[h],b=jt[h];(b===null||b.includes(f.tagName))&&(f.properties[h]=s(String(x||""),h,f))}}if(f.type==="element"){let h=t?!t.includes(f.tagName):a?a.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return o&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function Wu(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||Bu.test(e.slice(0,n))?e:""}function kr(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 Gu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yu(e,n,t){const i=Et((t||{}).ignore||[]),a=Xu(n);let l=-1;for(;++l<a.length;)fi(e,"text",o);function o(u,f){let c=-1,p;for(;++c<f.length;){const h=f[c],x=p?p.children:void 0;if(i(h,x?x.indexOf(h):void 0,p))return;p=h}if(p)return s(u,f)}function s(u,f){const c=f[f.length-1],p=a[l][0],h=a[l][1];let x=0;const v=c.children.indexOf(u);let y=!1,N=[];p.lastIndex=0;let E=p.exec(u.value);for(;E;){const D=E.index,F={index:E.index,input:E.input,stack:[...f,u]};let S=h(...E,F);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?p.lastIndex=D+1:(x!==D&&N.push({type:"text",value:u.value.slice(x,D)}),Array.isArray(S)?N.push(...S):S&&N.push(S),x=D+E[0].length,y=!0),!p.global)break;E=p.exec(u.value)}return y?(x<u.value.length&&N.push({type:"text",value:u.value.slice(x)}),c.children.splice(v,1,...N)):N=[u],v+N.length}}function Xu(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([Qu(i[0]),Ku(i[1])])}return n}function Qu(e){return typeof e=="string"?new RegExp(Gu(e),"g"):e}function Ku(e){return typeof e=="function"?e:function(){return e}}const Bt="phrasing",Ut=["autolink","link","image","label"];function Ju(){return{transforms:[lc],enter:{literalAutolink:ec,literalAutolinkEmail:Ht,literalAutolinkHttp:Ht,literalAutolinkWww:Ht},exit:{literalAutolink:ic,literalAutolinkEmail:rc,literalAutolinkHttp:tc,literalAutolinkWww:nc}}}function Zu(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Bt,notInConstruct:Ut},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Bt,notInConstruct:Ut},{character:":",before:"[ps]",after:"\\/",inConstruct:Bt,notInConstruct:Ut}]}}function ec(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ht(e){this.config.enter.autolinkProtocol.call(this,e)}function tc(e){this.config.exit.autolinkProtocol.call(this,e)}function nc(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 rc(e){this.config.exit.autolinkEmail.call(this,e)}function ic(e){this.exit(e)}function lc(e){Yu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ac],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),oc]],{ignore:["link","linkReference"]})}function ac(e,n,t,r,i){let a="";if(!pi(i)||(/^w/i.test(n)&&(t=n+t,n="",a="http://"),!sc(t)))return!1;const l=uc(t+r);if(!l[0])return!1;const o={type:"link",title:null,url:a+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[o,{type:"text",value:l[1]}]:o}function oc(e,n,t,r){return!pi(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function sc(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 uc(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=kr(e,"(");let a=kr(e,")");for(;r!==-1&&i>a;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),a++;return[e,t]}function pi(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Te(t)||St(t))&&(!n||t!==47)}mi.peek=yc;function cc(){this.buffer()}function fc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function hc(){this.buffer()}function pc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function mc(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=me(this.sliceSerialize(e)).toLowerCase(),t.label=n}function dc(e){this.exit(e)}function gc(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=me(this.sliceSerialize(e)).toLowerCase(),t.label=n}function xc(e){this.exit(e)}function yc(){return"["}function mi(e,n,t,r){const i=t.createTracker(r);let a=i.move("[^");const l=t.enter("footnoteReference"),o=t.enter("reference");return a+=i.move(t.safe(t.associationId(e),{after:"]",before:a})),o(),l(),a+=i.move("]"),a}function kc(){return{enter:{gfmFootnoteCallString:cc,gfmFootnoteCall:fc,gfmFootnoteDefinitionLabelString:hc,gfmFootnoteDefinition:pc},exit:{gfmFootnoteCallString:mc,gfmFootnoteCall:dc,gfmFootnoteDefinitionLabelString:gc,gfmFootnoteDefinition:xc}}}function bc(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:mi},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,a,l){const o=a.createTracker(l);let s=o.move("[^");const u=a.enter("footnoteDefinition"),f=a.enter("label");return s+=o.move(a.safe(a.associationId(r),{before:s,after:"]"})),f(),s+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),s+=o.move((n?`
`:" ")+a.indentLines(a.containerFlow(r,o.current()),n?di:wc))),u(),s}}function wc(e,n,t){return n===0?e:di(e,n,t)}function di(e,n,t){return(t?"":"    ")+e}const Sc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];gi.peek=Ic;function vc(){return{canContainEols:["delete"],enter:{strikethrough:Ec},exit:{strikethrough:Nc}}}function Cc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Sc}],handlers:{delete:gi}}}function Ec(e){this.enter({type:"delete",children:[]},e)}function Nc(e){this.exit(e)}function gi(e,n,t,r){const i=t.createTracker(r),a=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),a(),l}function Ic(){return"~"}function Tc(e){return e.length}function jc(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||Tc,a=[],l=[],o=[],s=[];let u=0,f=-1;for(;++f<e.length;){const b=[],v=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const N=Ac(e[f][y]);if(t.alignDelimiters!==!1){const E=i(N);v[y]=E,(s[y]===void 0||E>s[y])&&(s[y]=E)}b.push(N)}l[f]=b,o[f]=v}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)a[c]=br(r[c]);else{const b=br(r);for(;++c<u;)a[c]=b}c=-1;const p=[],h=[];for(;++c<u;){const b=a[c];let v="",y="";b===99?(v=":",y=":"):b===108?v=":":b===114&&(y=":");let N=t.alignDelimiters===!1?1:Math.max(1,s[c]-v.length-y.length);const E=v+"-".repeat(N)+y;t.alignDelimiters!==!1&&(N=v.length+N+y.length,N>s[c]&&(s[c]=N),h[c]=N),p[c]=E}l.splice(1,0,p),o.splice(1,0,h),f=-1;const x=[];for(;++f<l.length;){const b=l[f],v=o[f];c=-1;const y=[];for(;++c<u;){const N=b[c]||"";let E="",D="";if(t.alignDelimiters!==!1){const F=s[c]-(v[c]||0),S=a[c];S===114?E=" ".repeat(F):S===99?F%2?(E=" ".repeat(F/2+.5),D=" ".repeat(F/2-.5)):(E=" ".repeat(F/2),D=E):D=" ".repeat(F)}t.delimiterStart!==!1&&!c&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&N==="")&&(t.delimiterStart!==!1||c)&&y.push(" "),t.alignDelimiters!==!1&&y.push(E),y.push(N),t.alignDelimiters!==!1&&y.push(D),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||c!==u-1)&&y.push("|")}x.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return x.join(`
`)}function Ac(e){return e==null?"":String(e)}function br(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 Lc(e,n,t,r){const i=t.enter("blockquote"),a=t.createTracker(r);a.move("> "),a.shift(2);const l=t.indentLines(t.containerFlow(e,a.current()),Pc);return i(),l}function Pc(e,n,t){return">"+(t?"":" ")+e}function zc(e,n){return wr(e,n.inConstruct,!0)&&!wr(e,n.notInConstruct,!1)}function wr(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 Sr(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
`&&zc(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function Dc(e,n){const t=String(e);let r=t.indexOf(n),i=r,a=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>l&&(l=a):a=1,i=r+n.length,r=t.indexOf(n,i);return l}function Fc(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 _c(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 Rc(e,n,t,r){const i=_c(t),a=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Fc(e,t)){const c=t.enter("codeIndented"),p=t.indentLines(a,Oc);return c(),p}const o=t.createTracker(r),s=i.repeat(Math.max(Dc(a,i)+1,3)),u=t.enter("codeFenced");let f=o.move(s);if(e.lang){const c=t.enter(`codeFencedLang${l}`);f+=o.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...o.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${l}`);f+=o.move(" "),f+=o.move(t.safe(e.meta,{before:f,after:`
`,encode:["`"],...o.current()})),c()}return f+=o.move(`
`),a&&(f+=o.move(a+`
`)),f+=o.move(s),u(),f}function Oc(e,n,t){return(t?"":"    ")+e}function yn(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 Mc(e,n,t,r){const i=yn(t),a=i==='"'?"Quote":"Apostrophe",l=t.enter("definition");let o=t.enter("label");const s=t.createTracker(r);let u=s.move("[");return u+=s.move(t.safe(t.associationId(e),{before:u,after:"]",...s.current()})),u+=s.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(o=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":`
`,...s.current()}))),o(),e.title&&(o=t.enter(`title${a}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),o()),l(),u}function Bc(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 et(e){return"&#x"+e.toString(16).toUpperCase()+";"}function bt(e,n,t){const r=Oe(e),i=Oe(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}}xi.peek=Uc;function xi(e,n,t,r){const i=Bc(t),a=t.enter("emphasis"),l=t.createTracker(r),o=l.move(i);let s=l.move(t.containerPhrasing(e,{after:i,before:o,...l.current()}));const u=s.charCodeAt(0),f=bt(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=et(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=bt(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+et(c));const h=l.move(i);return a(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},o+s+h}function Uc(e,n,t){return t.options.emphasis||"*"}function Hc(e,n){let t=!1;return gn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,Qt}),!!((!e.depth||e.depth<3)&&un(e)&&(n.options.setext||t))}function qc(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),a=t.createTracker(r);if(Hc(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),p=t.containerPhrasing(e,{...a.current(),before:`
`,after:`
`});return c(),f(),p+`
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
`))+1))}const l="#".repeat(i),o=t.enter("headingAtx"),s=t.enter("phrasing");a.move(l+" ");let u=t.containerPhrasing(e,{before:"# ",after:`
`,...a.current()});return/^[\t ]/.test(u)&&(u=et(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,t.options.closeAtx&&(u+=" "+l),s(),o(),u}yi.peek=Vc;function yi(e){return e.value||""}function Vc(){return"<"}ki.peek=$c;function ki(e,n,t,r){const i=yn(t),a=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let o=t.enter("label");const s=t.createTracker(r);let u=s.move("![");return u+=s.move(t.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(o=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),o(),e.title&&(o=t.enter(`title${a}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),o()),u+=s.move(")"),l(),u}function $c(){return"!"}bi.peek=Wc;function bi(e,n,t,r){const i=e.referenceType,a=t.enter("imageReference");let l=t.enter("label");const o=t.createTracker(r);let s=o.move("![");const u=t.safe(e.alt,{before:s,after:"]",...o.current()});s+=o.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...o.current()});return l(),t.stack=f,a(),i==="full"||!u||u!==c?s+=o.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=o.move("]"),s}function Wc(){return"!"}wi.peek=Gc;function wi(e,n,t){let r=e.value||"",i="`",a=-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+" ");++a<t.unsafe.length;){const l=t.unsafe[a],o=t.compilePattern(l);let s;if(l.atBreak)for(;s=o.exec(r);){let u=s.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(s.index+1)}}return i+r+i}function Gc(){return"`"}function Si(e,n){const t=un(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))}vi.peek=Yc;function vi(e,n,t,r){const i=yn(t),a=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let o,s;if(Si(e,t)){const f=t.stack;t.stack=[],o=t.enter("autolink");let c=l.move("<");return c+=l.move(t.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),o(),t.stack=f,c}o=t.enter("link"),s=t.enter("label");let u=l.move("[");return u+=l.move(t.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=t.enter(`title${a}`),u+=l.move(" "+i),u+=l.move(t.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),u+=l.move(")"),o(),u}function Yc(e,n,t){return Si(e,t)?"<":"["}Ci.peek=Xc;function Ci(e,n,t,r){const i=e.referenceType,a=t.enter("linkReference");let l=t.enter("label");const o=t.createTracker(r);let s=o.move("[");const u=t.containerPhrasing(e,{before:s,after:"]",...o.current()});s+=o.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...o.current()});return l(),t.stack=f,a(),i==="full"||!u||u!==c?s+=o.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=o.move("]"),s}function Xc(){return"["}function kn(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 Qc(e){const n=kn(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 Kc(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 Ei(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 Jc(e,n,t,r){const i=t.enter("list"),a=t.bulletCurrent;let l=e.ordered?Kc(t):kn(t);const o=e.ordered?l==="."?")":".":Qc(t);let s=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&&(s=!0),Ei(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"){s=!0;break}}}}s&&(l=o),t.bulletCurrent=l;const u=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=a,i(),u}function Zc(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 ef(e,n,t,r){const i=Zc(t);let a=t.bulletCurrent||kn(t);n&&n.type==="list"&&n.ordered&&(a=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+a);let l=a.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const o=t.createTracker(r);o.move(a+" ".repeat(l-a.length)),o.shift(l);const s=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),f);return s(),u;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?a:a+" ".repeat(l-a.length))+c}}function tf(e,n,t,r){const i=t.enter("paragraph"),a=t.enter("phrasing"),l=t.containerPhrasing(e,r);return a(),i(),l}const nf=Et(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function rf(e,n,t,r){return(e.children.some(function(l){return nf(l)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function lf(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Ni.peek=af;function Ni(e,n,t,r){const i=lf(t),a=t.enter("strong"),l=t.createTracker(r),o=l.move(i+i);let s=l.move(t.containerPhrasing(e,{after:i,before:o,...l.current()}));const u=s.charCodeAt(0),f=bt(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=et(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=bt(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+et(c));const h=l.move(i+i);return a(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},o+s+h}function af(e,n,t){return t.options.strong||"*"}function of(e,n,t,r){return t.safe(e.value,r)}function sf(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 uf(e,n,t){const r=(Ei(t)+(t.options.ruleSpaces?" ":"")).repeat(sf(t));return t.options.ruleSpaces?r.slice(0,-1):r}const Ii={blockquote:Lc,break:Sr,code:Rc,definition:Mc,emphasis:xi,hardBreak:Sr,heading:qc,html:yi,image:ki,imageReference:bi,inlineCode:wi,link:vi,linkReference:Ci,list:Jc,listItem:ef,paragraph:tf,root:rf,strong:Ni,text:of,thematicBreak:uf};function cf(){return{enter:{table:ff,tableData:vr,tableHeader:vr,tableRow:pf},exit:{codeText:mf,table:hf,tableData:qt,tableHeader:qt,tableRow:qt}}}function ff(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 hf(e){this.exit(e),this.data.inTable=void 0}function pf(e){this.enter({type:"tableRow",children:[]},e)}function qt(e){this.exit(e)}function vr(e){this.enter({type:"tableCell",children:[]},e)}function mf(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,df));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function df(e,n){return n==="|"?n:e}function gf(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,a=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:s,tableRow:o}};function l(h,x,b,v){return u(f(h,b,v),h.align)}function o(h,x,b,v){const y=c(h,b,v),N=u([y]);return N.slice(0,N.indexOf(`
`))}function s(h,x,b,v){const y=b.enter("tableCell"),N=b.enter("phrasing"),E=b.containerPhrasing(h,{...v,before:a,after:a});return N(),y(),E}function u(h,x){return jc(h,{align:x,alignDelimiters:r,padding:t,stringLength:i})}function f(h,x,b){const v=h.children;let y=-1;const N=[],E=x.enter("table");for(;++y<v.length;)N[y]=c(v[y],x,b);return E(),N}function c(h,x,b){const v=h.children;let y=-1;const N=[],E=x.enter("tableRow");for(;++y<v.length;)N[y]=s(v[y],h,x,b);return E(),N}function p(h,x,b){let v=Ii.inlineCode(h,x,b);return b.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function xf(){return{exit:{taskListCheckValueChecked:Cr,taskListCheckValueUnchecked:Cr,paragraph:kf}}}function yf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:bf}}}function Cr(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function kf(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 a=-1,l;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){l=o;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 bf(e,n,t,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",o=t.createTracker(r);a&&o.move(l);let s=Ii.listItem(e,n,t,{...r,...o.current()});return a&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(f){return f+l}}function wf(){return[Ju(),kc(),vc(),cf(),xf()]}function Sf(e){return{extensions:[Zu(),bc(e),Cc(),gf(e),yf()]}}const vf={tokenize:jf,partial:!0},Ti={tokenize:Af,partial:!0},ji={tokenize:Lf,partial:!0},Ai={tokenize:Pf,partial:!0},Cf={tokenize:zf,partial:!0},Li={name:"wwwAutolink",tokenize:If,previous:zi},Pi={name:"protocolAutolink",tokenize:Tf,previous:Di},we={name:"emailAutolink",tokenize:Nf,previous:Fi},xe={};function Ef(){return{text:xe}}let Ie=48;for(;Ie<123;)xe[Ie]=we,Ie++,Ie===58?Ie=65:Ie===91&&(Ie=97);xe[43]=we;xe[45]=we;xe[46]=we;xe[95]=we;xe[72]=[we,Pi];xe[104]=[we,Pi];xe[87]=[we,Li];xe[119]=[we,Li];function Nf(e,n,t){const r=this;let i,a;return l;function l(c){return!en(c)||!Fi.call(r,r.previous)||bn(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(c))}function o(c){return en(c)?(e.consume(c),o):c===64?(e.consume(c),s):t(c)}function s(c){return c===46?e.check(Cf,f,u)(c):c===45||c===95||te(c)?(a=!0,e.consume(c),s):f(c)}function u(c){return e.consume(c),i=!0,s}function f(c){return a&&i&&re(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function If(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!zi.call(r,r.previous)||bn(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(vf,e.attempt(Ti,e.attempt(ji,a),t),t)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function Tf(e,n,t){const r=this;let i="",a=!1;return l;function l(c){return(c===72||c===104)&&Di.call(r,r.previous)&&!bn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),o):t(c)}function o(c){if(re(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),o;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),s}return t(c)}function s(c){return c===47?(e.consume(c),a?u:(a=!0,s)):t(c)}function u(c){return c===null||xt(c)||X(c)||Te(c)||St(c)?t(c):e.attempt(Ti,e.attempt(ji,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function jf(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),a):t(l)}function a(l){return l===null?t(l):n(l)}}function Af(e,n,t){let r,i,a;return l;function l(u){return u===46||u===95?e.check(Ai,s,o)(u):u===null||X(u)||Te(u)||u!==45&&St(u)?s(u):(a=!0,e.consume(u),l)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function s(u){return i||r||!a?t(u):n(u)}}function Lf(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?a(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(Ai,n,a)(l):l===null||X(l)||Te(l)?n(l):(e.consume(l),i)}function a(l){return l===41&&r++,e.consume(l),i}}function Pf(e,n,t){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||X(o)||Te(o)?n(o):t(o)}function i(o){return o===null||o===40||o===91||X(o)||Te(o)?n(o):r(o)}function a(o){return re(o)?l(o):t(o)}function l(o){return o===59?(e.consume(o),r):re(o)?(e.consume(o),l):t(o)}}function zf(e,n,t){return r;function r(a){return e.consume(a),i}function i(a){return te(a)?t(a):n(a)}}function zi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function Di(e){return!re(e)}function Fi(e){return!(e===47||en(e))}function en(e){return e===43||e===45||e===46||e===95||te(e)}function bn(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 Df={tokenize:Hf,partial:!0};function Ff(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Mf,continuation:{tokenize:Bf},exit:Uf}},text:{91:{name:"gfmFootnoteCall",tokenize:Of},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_f,resolveTo:Rf}}}}function _f(e,n,t){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const s=r.events[i][1];if(s.type==="labelImage"){l=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return o;function o(s){if(!l||!l._balanced)return t(s);const u=me(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?t(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),n(s))}}function Rf(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 a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",a,n],["enter",l,n],["exit",l,n],["exit",a,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function Of(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return o;function o(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),s}function s(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(a>999||c===93&&!l||c===null||c===91||X(c))return t(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(me(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return X(c)||(l=!0),a++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),a++,u):u(c)}}function Mf(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,o;return s;function s(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(x)}function f(x){if(l>999||x===93&&!o||x===null||x===91||X(x))return t(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return a=me(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return X(x)||(o=!0),l++,e.consume(x),x===92?c:f}function c(x){return x===91||x===92||x===93?(e.consume(x),l++,f):f(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(a)||i.push(a),q(e,h,"gfmFootnoteDefinitionWhitespace")):t(x)}function h(x){return n(x)}}function Bf(e,n,t){return e.check(nt,n,e.attempt(Df,n,t))}function Uf(e){e.exit("gfmFootnoteDefinition")}function Hf(e,n,t){const r=this;return q(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(a):t(a)}}function qf(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,o){let s=-1;for(;++s<l.length;)if(l[s][0]==="enter"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._close){let u=s;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[s][1].end.offset-l[s][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[s][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[s][1].end)},c={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[s][1].start)},p=[["enter",f,o],["enter",l[u][1],o],["exit",l[u][1],o],["enter",c,o]],h=o.parser.constructs.insideSpan.null;h&&ue(p,p.length,0,vt(h,l.slice(u+1,s),o)),ue(p,p.length,0,[["exit",c,o],["enter",l[s][1],o],["exit",l[s][1],o],["exit",f,o]]),ue(l,u-1,s-u+3,p),s=u+p.length-2;break}}for(s=-1;++s<l.length;)l[s][1].type==="strikethroughSequenceTemporary"&&(l[s][1].type="data");return l}function a(l,o,s){const u=this.previous,f=this.events;let c=0;return p;function p(x){return u===126&&f[f.length-1][1].type!=="characterEscape"?s(x):(l.enter("strikethroughSequenceTemporary"),h(x))}function h(x){const b=Oe(u);if(x===126)return c>1?s(x):(l.consume(x),c++,h);if(c<2&&!t)return s(x);const v=l.exit("strikethroughSequenceTemporary"),y=Oe(x);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,o(x)}}}class Vf{constructor(){this.map=[]}add(n,t,r){$f(this,n,t,r)}consume(n){if(this.map.sort(function(a,l){return a[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 a of i)n.push(a);i=r.pop()}this.map.length=0}}function $f(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 Wf(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 a=r.length-1;r[a]=r[a]==="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 Gf(){return{flow:{null:{name:"table",tokenize:Yf,resolveAll:Xf}}}}function Yf(e,n,t){const r=this;let i=0,a=0,l;return o;function o(k){let j=r.events.length-1;for(;j>-1;){const T=r.events[j][1].type;if(T==="lineEnding"||T==="linePrefix")j--;else break}const A=j>-1?r.events[j][1].type:null,L=A==="tableHead"||A==="tableRow"?S:s;return L===S&&r.parser.lazy[r.now().line]?t(k):L(k)}function s(k){return e.enter("tableHead"),e.enter("tableRow"),u(k)}function u(k){return k===124||(l=!0,a+=1),f(k)}function f(k){return k===null?t(k):P(k)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),h):t(k):B(k)?q(e,f,"whitespace")(k):(a+=1,l&&(l=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(k)))}function c(k){return k===null||k===124||X(k)?(e.exit("data"),f(k)):(e.consume(k),k===92?p:c)}function p(k){return k===92||k===124?(e.consume(k),c):c(k)}function h(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(k):(e.enter("tableDelimiterRow"),l=!1,B(k)?q(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):x(k))}function x(k){return k===45||k===58?v(k):k===124?(l=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),b):F(k)}function b(k){return B(k)?q(e,v,"whitespace")(k):v(k)}function v(k){return k===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(a+=1,y(k)):k===null||P(k)?D(k):F(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),N(k)):F(k)}function N(k){return k===45?(e.consume(k),N):k===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(k))}function E(k){return B(k)?q(e,D,"whitespace")(k):D(k)}function D(k){return k===124?x(k):k===null||P(k)?!l||i!==a?F(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(k)):F(k)}function F(k){return t(k)}function S(k){return e.enter("tableRow"),O(k)}function O(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),O):k===null||P(k)?(e.exit("tableRow"),n(k)):B(k)?q(e,O,"whitespace")(k):(e.enter("data"),$(k))}function $(k){return k===null||k===124||X(k)?(e.exit("data"),O(k)):(e.consume(k),k===92?H:$)}function H(k){return k===92||k===124?(e.consume(k),$):$(k)}}function Xf(e,n){let t=-1,r=!0,i=0,a=[0,0,0,0],l=[0,0,0,0],o=!1,s=0,u,f,c;const p=new Vf;for(;++t<e.length;){const h=e[t],x=h[1];h[0]==="enter"?x.type==="tableHead"?(o=!1,s!==0&&(Er(p,n,s,u,f),f=void 0,s=0),u={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},p.add(t,0,[["enter",u,n]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,c=void 0,a=[0,0,0,0],l=[0,t+1,0,0],o&&(o=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},p.add(t,0,[["enter",f,n]])),i=x.type==="tableDelimiterRow"?2:f?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],c=mt(p,n,a,i,void 0,c),a=[0,0,0,0]),l[2]=t)):x.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],c=mt(p,n,a,i,void 0,c)),a=l,l=[a[1],t,0,0])):x.type==="tableHead"?(o=!0,s=t):x.type==="tableRow"||x.type==="tableDelimiterRow"?(s=t,a[1]!==0?(l[0]=l[1],c=mt(p,n,a,i,t,c)):l[1]!==0&&(c=mt(p,n,l,i,t,c)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=t)}for(s!==0&&Er(p,n,s,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=Wf(n.events,t))}return e}function mt(e,n,t,r,i,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";t[0]!==0&&(a.end=Object.assign({},_e(n.events,t[0])),e.add(t[0],0,[["exit",a,n]]));const s=_e(n.events,t[1]);if(a={type:l,start:Object.assign({},s),end:Object.assign({},s)},e.add(t[1],0,[["enter",a,n]]),t[2]!==0){const u=_e(n.events,t[2]),f=_e(n.events,t[3]),c={type:o,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 x=t[2]+1,b=t[3]-t[2]-1;e.add(x,b,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(a.end=Object.assign({},_e(n.events,i)),e.add(i,0,[["exit",a,n]]),a=void 0),a}function Er(e,n,t,r,i){const a=[],l=_e(n.events,t);i&&(i.end=Object.assign({},l),a.push(["exit",i,n])),r.end=Object.assign({},l),a.push(["exit",r,n]),e.add(t+1,0,a)}function _e(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Qf={name:"tasklistCheck",tokenize:Jf};function Kf(){return{text:{91:Qf}}}function Jf(e,n,t){const r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),a)}function a(s){return X(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),l):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),l):t(s)}function l(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(s)}function o(s){return P(s)?n(s):B(s)?e.check({tokenize:Zf},n,t)(s):t(s)}}function Zf(e,n,t){return q(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function eh(e){return Wr([Ef(),Ff(),qf(e),Gf(),Kf()])}const th={};function nh(e){const n=this,t=e||th,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(eh(t)),a.push(wf()),l.push(Sf(t))}const rh=({content:e,className:n})=>m.jsx("div",{className:W("text-[15px] leading-relaxed text-foreground",n),children:m.jsx(Hu,{remarkPlugins:[nh],components:{p:({node:t,className:r,...i})=>m.jsx("p",{...i,className:W("m-0 mb-3 last:mb-0 leading-relaxed",r)}),h1:({node:t,className:r,...i})=>m.jsx("h1",{...i,className:W("mt-3 mb-1 text-base font-semibold leading-snug",r)}),h2:({node:t,className:r,...i})=>m.jsx("h2",{...i,className:W("mt-3 mb-1 text-base font-semibold leading-snug",r)}),h3:({node:t,className:r,...i})=>m.jsx("h3",{...i,className:W("mt-3 mb-1 text-[15px] font-medium leading-snug",r)}),h4:({node:t,className:r,...i})=>m.jsx("h4",{...i,className:W("mt-2 mb-1 text-[15px] font-medium leading-snug",r)}),ul:({node:t,className:r,...i})=>m.jsx("ul",{...i,className:W("my-2 pl-5 list-disc space-y-2",r)}),ol:({node:t,className:r,...i})=>m.jsx("ol",{...i,className:W("my-2 pl-5 list-decimal space-y-2",r)}),li:({node:t,className:r,...i})=>m.jsx("li",{...i,className:W("m-0",r)}),blockquote:({node:t,className:r,...i})=>m.jsx("blockquote",{...i,className:W("my-2 border-l-2 border-border/50 pl-3 text-muted-foreground",r)}),a:({node:t,className:r,...i})=>m.jsx("a",{...i,className:W("text-primary underline underline-offset-2 hover:opacity-90",r)}),hr:({node:t,className:r,...i})=>m.jsx("hr",{...i,className:W("my-3 border-border/60",r)}),pre:({node:t,className:r,...i})=>m.jsx("pre",{...i,className:W("my-2 overflow-x-auto rounded-lg border border-border/40 bg-muted/30 p-3",r)}),code:({node:t,className:r,...i})=>typeof r=="string"&&r.includes("language-")?m.jsx("code",{...i,className:W("font-mono text-xs",r)}):m.jsx("code",{...i,className:W("rounded bg-muted/40 px-1 py-0.5 font-mono text-xs",r)})},children:e})}),ih=({messages:e,streamingAssistantId:n,density:t="default",showSeparator:r=!0})=>{const{t:i}=wt();if(e.length===0)return null;const a=t==="compact";return m.jsxs(m.Fragment,{children:[r&&m.jsx(Lr,{className:"my-6 opacity-50"}),m.jsx("div",{className:W("space-y-4 text-sm",a&&"space-y-2 text-xs"),children:e.map(l=>m.jsx("div",{className:W("group flex flex-col gap-1 transition-all duration-200"),children:l.role==="user"?m.jsx(tn,{readOnly:!0,value:l.content,className:W("w-full resize-none overflow-hidden px-3 py-3 leading-relaxed",a?"min-h-[32px] py-2 text-xs":"min-h-[44px] text-[15px]",Tr)}):m.jsx("div",{className:"w-full pl-1 py-1",children:l.id===n&&!l.content?m.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[m.jsx("span",{className:W("text-sm",a&&"text-xs"),children:i("drawer.thinking","Thinking")}),m.jsx("span",{className:"inline-block w-0.5 h-4 bg-primary/40 cursor-blink"})]}):m.jsxs("div",{children:[m.jsx(rh,{content:l.content}),l.id===n&&m.jsx("span",{className:"inline-block w-0.5 h-4 bg-current cursor-blink ml-1"})]})})},l.id))})]})};function lh(){const{t:e}=wt(),[n,t]=G.useState(""),[r,i]=G.useState([]),[a,l]=G.useState(null),[o,s]=G.useState("idle"),u=G.useRef(null),f="Why 'get' instead of 'take'?";return G.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[r,a]),G.useEffect(()=>{let c=!0;const p=async()=>{if(!c||(s("idle"),t(""),i([]),l(null),await new Promise(v=>setTimeout(v,1e3)),!c))return;s("typing");for(let v=0;v<=f.length;v++){if(!c)return;t(f.slice(0,v)),await new Promise(y=>setTimeout(y,50+Math.random()*50))}if(await new Promise(v=>setTimeout(v,500)),!c||(s("sending"),await new Promise(v=>setTimeout(v,300)),!c))return;i([{id:"u1",role:"user",content:f}]),t(""),s("thinking");const x="a1",b={id:x,role:"assistant",content:""};i(v=>[...v,b]),l(x),await new Promise(v=>setTimeout(v,3e3)),c&&c&&p()};return p(),()=>{c=!1}},[]),m.jsxs("div",{className:"w-full h-full bg-card border rounded-md flex flex-col overflow-hidden text-xs shadow-sm select-none",children:[m.jsxs("div",{className:"p-3 border-b bg-muted/30",children:[m.jsx("div",{className:"font-bold text-base text-primary",children:"get"}),m.jsx("div",{className:"text-muted-foreground mt-1",children:"v. to obtain, buy, or earn something."})]}),m.jsx("div",{className:"flex-1 min-h-0 bg-background/50 relative flex flex-col",children:m.jsx("div",{ref:u,className:"flex-1 overflow-y-auto px-3",children:r.length>0&&m.jsx(ih,{messages:r,streamingAssistantId:a,density:"compact",showSeparator:!1})})}),m.jsx(Il,{value:n,onChange:()=>{},onSend:()=>{},isSending:o==="sending",placeholder:"",density:"compact"})]})}function ah(){const[e,n]=G.useState(!1);return G.useEffect(()=>{let t=!0;const r=async()=>{t&&(n(!1),await new Promise(i=>setTimeout(i,1500)),t&&(n(!0),await new Promise(i=>setTimeout(i,4e3)),t&&r()))};return r(),()=>{t=!1}},[]),m.jsx("div",{className:"w-full h-full flex items-center justify-center bg-muted/10 p-4 select-none",children:m.jsxs("div",{className:"w-full max-w-[240px] bg-card border rounded-lg shadow-sm overflow-hidden relative",children:[m.jsxs("div",{className:"p-3 border-b flex justify-between items-start bg-muted/20",children:[m.jsxs("div",{children:[m.jsx("div",{className:"font-bold text-lg text-primary",children:"serendipity"}),m.jsx("div",{className:"text-xs text-muted-foreground italic",children:"/ˌser.ənˈdɪp.ə.ti/"})]}),m.jsx(pl,{className:"w-4 h-4 text-primary fill-primary"})]}),m.jsxs("div",{className:"p-3 space-y-3",children:[m.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/30 p-2 rounded border-l-2 border-primary/50",children:['"It was pure ',m.jsx("strong",{className:"text-foreground",children:"serendipity"}),' that we met at the coffee shop."',m.jsxs("div",{className:"flex items-center gap-1 mt-1.5 opacity-70",children:[m.jsx(bl,{className:"w-3 h-3"}),m.jsx("span",{className:"text-[10px]",children:"YouTube • 02:14"})]})]}),m.jsxs("div",{className:"flex items-center justify-between pt-1",children:[m.jsx("div",{className:"text-[10px] text-muted-foreground",children:"Eudic Sync"}),m.jsx("div",{className:`flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full transition-colors duration-500 ${e?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-muted text-muted-foreground"}`,children:e?m.jsxs(m.Fragment,{children:[m.jsx(dt,{className:"w-3 h-3"})," Synced"]}):m.jsxs(m.Fragment,{children:[m.jsx(gl,{className:"w-3 h-3 animate-spin"})," Syncing..."]})})]})]})]})})}const K={SETUP:0,SUBTITLES:1,USAGE:2,AUTH:3,DONE:4};function oh(){const{t:e,i18n:n}=wt(),[t,r]=G.useState(()=>{try{if(typeof window>"u")return K.SETUP;const _=window.localStorage.getItem("acquire-language:welcome-step");if(!_)return K.SETUP;const V=Number.parseInt(_,10);return Number.isFinite(V)&&Object.values(K).includes(V)?V:K.SETUP}catch{return K.SETUP}}),i=_=>{r(_);try{if(typeof window>"u")return;window.localStorage.setItem("acquire-language:welcome-step",String(_))}catch{}},[a,l]=G.useState($e.general.nativeLanguage),[o,s]=G.useState($e.general.learnLanguage),[u,f]=G.useState($e.general.languageLevel),[c,p]=G.useState($e.subtitle.showNativeSubtitles),[h,x]=G.useState($e.subtitle.showLearningSubtitles),[b,v]=G.useState(!1),y=el(tl);G.useEffect(()=>{$i().then(_=>{l(_.general.nativeLanguage),s(_.general.learnLanguage),f(_.general.languageLevel),p(_.subtitle.showNativeSubtitles),x(_.subtitle.showLearningSubtitles)})},[]);const N=async()=>{v(!0);try{await jn({general:{nativeLanguage:a,learnLanguage:o,languageLevel:u}}),i(K.SUBTITLES)}catch(_){console.error("Failed to save settings",_)}finally{v(!1)}},E=async()=>{v(!0);try{await jn({subtitle:{showNativeSubtitles:c,showLearningSubtitles:h}}),i(K.USAGE)}catch(_){console.error("Failed to save settings",_)}finally{v(!1)}},D=()=>{at.tabs.create({url:"https://www.youtube.com/"})},F=()=>{at.tabs.create({url:"https://www.bilibili.com/"})},S=()=>{at.tabs.create({url:"/vocabulary.html"})},O=()=>{at.tabs.create({url:"/options.html"})},$=async()=>{const _=await y.signIn();_.success?Ln.success(e("auth.signInSuccess","Signed in successfully")):_.error&&Ln.error(_.error)},H=()=>c&&h?"bilingual":h&&!c?"main":!h&&c?"translation":"bilingual",k=_=>{_==="main"?(p(!1),x(!0)):_==="translation"?(p(!0),x(!1)):(p(!0),x(!0))},j=a===o,A=()=>{var _;return m.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[m.jsxs("div",{className:"flex flex-col items-center gap-2",children:[m.jsx("div",{className:"relative w-full",children:m.jsxs(ot,{value:a,onValueChange:l,children:[m.jsxs(st,{className:"w-full h-auto py-4 px-5 border bg-muted/20 hover:bg-muted/40 transition-all rounded-xl flex flex-col items-start gap-2 [&>svg]:hidden shadow-sm hover:shadow-md hover:border-primary/20 group",children:[m.jsx("span",{className:"text-sm font-medium text-foreground/70 group-hover:text-primary transition-colors",children:e("welcome.step1.nativeLanguage")}),m.jsxs("div",{className:"flex items-center gap-3 w-full",children:[m.jsx("span",{className:"text-2xl shadow-sm rounded-full bg-background/50 p-1 border border-border/20 flex-shrink-0",children:lt(a)}),m.jsx("span",{className:"text-lg font-medium truncate flex-1 text-left",children:Nn(a)}),m.jsx(zn,{className:"h-4 w-4 text-muted-foreground/50 opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),m.jsx(ut,{position:"popper",className:"max-h-72 overflow-y-auto",children:In.filter(V=>V.value!=="auto").map(V=>m.jsxs(ze,{value:V.value,children:[m.jsx("span",{className:"mr-2",children:lt(V.value)}),V.label]},V.value))})]})}),m.jsx("div",{className:"flex flex-col items-center -my-3 z-10 pl-8 pointer-events-none opacity-50",children:m.jsx("div",{className:"h-6 w-px border-l border-dashed border-foreground/20"})}),m.jsx("div",{className:"relative w-full",children:m.jsxs(ot,{value:o,onValueChange:s,children:[m.jsxs(st,{className:`w-full h-auto py-4 px-5 border bg-muted/20 hover:bg-muted/40 transition-all rounded-xl flex flex-col items-start gap-2 [&>svg]:hidden shadow-sm hover:shadow-md group ${j?"border-destructive/60 hover:border-destructive/80":"hover:border-primary/20"}`,children:[m.jsx("span",{className:"text-sm font-medium text-foreground/70 group-hover:text-primary transition-colors",children:e("welcome.step1.learningLanguage")}),m.jsxs("div",{className:"flex items-center gap-3 w-full",children:[m.jsx("span",{className:"text-2xl shadow-sm rounded-full bg-background/50 p-1 border border-border/20 flex-shrink-0",children:lt(o)}),m.jsx("span",{className:"text-lg font-medium truncate flex-1 text-left",children:Nn(o)}),m.jsx(zn,{className:"h-4 w-4 text-muted-foreground/50 opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),m.jsx(ut,{position:"popper",className:"max-h-72 overflow-y-auto",children:In.map(V=>m.jsxs(ze,{value:V.value,children:[m.jsx("span",{className:"mr-2",children:lt(V.value)}),V.label]},V.value))})]})}),j&&m.jsx("p",{className:"text-sm text-destructive w-full px-1 animate-in fade-in duration-200",children:e("welcome.step1.sameLanguageError")})]}),m.jsx("div",{className:"w-full pt-1",children:m.jsxs(ot,{value:u,onValueChange:f,children:[m.jsxs(st,{className:"w-full h-11 rounded-lg border-border/50 bg-background/50 hover:bg-accent/50 transition-colors px-4 flex items-center justify-between group",children:[m.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground group-hover:text-foreground transition-colors",children:[m.jsx(ol,{className:"h-4 w-4"}),m.jsx("span",{className:"text-xs font-medium uppercase tracking-wide",children:e("welcome.step1.level")})]}),m.jsx("span",{className:"font-medium text-sm",children:((_=Tn.find(V=>V.value===u))==null?void 0:_.label.split(" - ")[1])||"Intermediate"})]}),m.jsx(ut,{children:Tn.map(V=>m.jsx(ze,{value:V.value,children:V.label},V.value))})]})}),m.jsx("div",{className:"pt-3 w-full",children:m.jsxs(le,{onClick:N,className:"w-full h-11 text-base shadow-sm hover:shadow-md transition-all",disabled:b||j,children:[e(b?"general.saving":"welcome.next")," ",m.jsx(ct,{className:"ml-2 h-4 w-4"})]})})]})},L=()=>m.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx("h3",{className:"text-xl font-bold",children:e("welcome.step_subtitles.title")}),m.jsx("p",{className:"text-muted-foreground",children:e("welcome.step_subtitles.desc")})]}),m.jsx("div",{className:"rounded-lg flex items-center justify-center border relative overflow-hidden group shadow-inner",children:m.jsx(El,{showNative:c,showLearning:h,nativeLanguage:a,learnLanguage:o})}),m.jsx("div",{className:"space-y-4 pt-4 border-t",children:m.jsxs("div",{className:"space-y-2",children:[m.jsx(rl,{children:e("subtitle.mode.title","Subtitle Mode")}),m.jsxs(ot,{value:H(),onValueChange:k,children:[m.jsx(st,{className:"w-full",children:m.jsx(sl,{})}),m.jsxs(ut,{children:[m.jsx(ze,{value:"bilingual",children:e("subtitle.mode.bilingual","Bilingual subtitles")}),m.jsx(ze,{value:"main",children:e("subtitle.mode.main","Main subtitles")}),m.jsx(ze,{value:"translation",children:e("subtitle.mode.translation","Translation subtitles")})]})]})]})})]}),m.jsxs("div",{className:"flex gap-3 pt-2",children:[m.jsx(le,{variant:"outline",onClick:()=>i(K.SETUP),className:"w-1/3",children:e("welcome.back")}),m.jsxs(le,{onClick:E,className:"w-2/3",disabled:b,children:[e(b?"general.saving":"welcome.next")," ",m.jsx(ct,{className:"ml-2 h-4 w-4"})]})]})]}),T=()=>m.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-right-4 duration-300 text-center",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx("h3",{className:"text-xl font-bold",children:e("welcome.step_guide.title")}),m.jsx("p",{className:"text-muted-foreground",children:e("welcome.step_guide.desc")})]}),m.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-left",children:[m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx("div",{className:"aspect-video bg-muted rounded-xl overflow-hidden border shadow-sm relative",children:m.jsx(lh,{})}),m.jsxs("div",{className:"space-y-1 px-1",children:[m.jsx("h4",{className:"font-semibold text-base",children:e("welcome.step_guide.feature1Title")}),m.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e("welcome.step_guide.feature1Desc")})]})]}),m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsx("div",{className:"aspect-video bg-muted rounded-xl overflow-hidden border shadow-sm relative",children:m.jsx(ah,{})}),m.jsxs("div",{className:"space-y-1 px-1",children:[m.jsx("h4",{className:"font-semibold text-base",children:e("welcome.step_guide.feature2Title")}),m.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e("welcome.step_guide.feature2Desc")}),m.jsx("div",{className:"pt-1",children:m.jsxs("a",{href:"/options.html?tab=integrations",target:"_blank",className:"text-xs text-primary hover:underline inline-flex items-center font-medium bg-primary/5 px-2 py-1 rounded-md border border-primary/10 transition-colors hover:bg-primary/10",children:[e("welcome.step_guide.setupEudic")," ",m.jsx(Ir,{className:"h-3 w-3 ml-1.5"})]})})]})]})]}),m.jsxs("div",{className:"mt-8 flex gap-3",children:[m.jsx(le,{variant:"outline",onClick:()=>i(K.SUBTITLES),className:"w-1/3",children:e("welcome.back")}),m.jsxs(le,{onClick:()=>i(K.AUTH),className:"w-2/3",children:[e("welcome.next")," ",m.jsx(ct,{className:"ml-2 h-4 w-4"})]})]})]}),z=()=>m.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-right-4 duration-300 text-center",children:[m.jsxs("div",{className:"space-y-4",children:[m.jsx("div",{className:"flex justify-center",children:m.jsx("div",{className:"h-16 w-16 bg-primary/10 rounded-full flex items-center justify-center",children:m.jsx(Zi,{className:"h-8 w-8 text-primary"})})}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("h3",{className:"text-xl font-bold",children:e("welcome.step3.title")}),m.jsx("p",{className:"text-muted-foreground",children:e("welcome.step3.desc")})]})]}),m.jsxs("div",{className:"bg-muted/30 rounded-xl border border-border/50 p-6 space-y-6 shadow-sm",children:[m.jsxs("div",{className:"space-y-3 text-left",children:[m.jsxs("div",{className:"flex items-start gap-3",children:[m.jsx("div",{className:"mt-0.5 bg-primary/10 rounded-full p-1",children:m.jsx(dt,{className:"h-3 w-3 text-primary"})}),m.jsx("span",{className:"text-sm font-medium",children:e("welcome.step3.benefit1")})]}),m.jsxs("div",{className:"flex items-start gap-3",children:[m.jsx("div",{className:"mt-0.5 bg-primary/10 rounded-full p-1",children:m.jsx(dt,{className:"h-3 w-3 text-primary"})}),m.jsx("span",{className:"text-sm font-medium",children:e("welcome.step3.benefit2")})]})]}),y.user&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"h-px bg-border/50"}),m.jsx("div",{children:m.jsxs("div",{className:"space-y-4",children:[m.jsx(il,{auth:y,variant:"full",className:"justify-center w-full"}),m.jsxs("div",{className:"mt-4 flex items-center gap-2 text-sm text-green-600 justify-center bg-green-50 dark:bg-green-950/30 p-2 rounded animate-in fade-in duration-300",children:[m.jsx(dt,{className:"h-4 w-4"}),e("welcome.step3.loggedIn")]})]})})]})]}),m.jsxs("div",{className:"flex gap-3 pt-2",children:[m.jsx(le,{variant:"outline",onClick:()=>i(K.USAGE),className:"w-1/3 h-11",children:e("welcome.back")}),y.user?m.jsxs(le,{onClick:()=>i(K.DONE),className:"w-2/3 h-11",size:"lg",children:[e("welcome.next"),m.jsx(ct,{className:"ml-2 h-4 w-4"})]}):m.jsx(ll,{onSignIn:$,size:"lg",className:"w-2/3 h-11 text-base font-semibold shadow-md hover:shadow-lg transition-all",isSigningIn:y.isSigningIn,text:e("welcome.step3.signInOrSignUp"),icon:null})]}),!y.user&&m.jsx("div",{className:"flex justify-center pt-2",children:m.jsx(le,{variant:"ghost",size:"sm",onClick:()=>i(K.DONE),className:"text-muted-foreground hover:text-foreground text-xs",children:e("welcome.step3.skip")})})]}),J=()=>m.jsxs("div",{className:"space-y-8 animate-in fade-in zoom-in-95 duration-500 text-center py-8",children:[m.jsx("div",{className:"flex justify-center mb-6",children:m.jsxs("div",{className:"relative",children:[m.jsx("div",{className:"absolute inset-0 bg-primary/20 blur-xl rounded-full"}),m.jsx(An,{className:"w-24 h-24 relative z-10"})]})}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("h2",{className:"text-3xl font-bold tracking-tight bg-clip-text text-transparent bg-gradient-to-r from-primary to-primary/60",children:e("welcome.step4.title")}),m.jsx("p",{className:"text-muted-foreground max-w-lg mx-auto",children:e("welcome.step4.desc")})]}),m.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-xs mx-auto",children:[m.jsxs(le,{size:"lg",className:"w-full h-14 text-lg shadow-lg shadow-primary/20 hover:shadow-primary/40 transition-all",onClick:D,children:[m.jsx("img",{src:"/icon/YouTube_full.svg",alt:"YouTube",className:"h-6 mr-2"}),e("welcome.step4.openYoutube")]}),m.jsxs(le,{size:"lg",className:"w-full h-14 text-lg shadow-lg shadow-primary/20 hover:shadow-primary/40 transition-all",onClick:F,children:[m.jsx("img",{src:"/icon/Bilibili.svg",alt:"Bilibili",className:"h-6 mr-2"}),e("update.bilibili.openBtn","Open Bilibili")]}),m.jsxs("div",{className:"grid grid-cols-2 gap-3 w-full",children:[m.jsx(le,{variant:"outline",onClick:S,children:e("popup.vocabulary")}),m.jsx(le,{variant:"outline",onClick:O,children:e("popup.settings")})]})]})]});return m.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[m.jsx(nl,{}),m.jsx("header",{className:"border-b bg-muted/20",children:m.jsxs("div",{className:"container max-w-4xl mx-auto h-16 flex items-center justify-between px-4",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(An,{className:"w-8 h-8"}),m.jsx("span",{className:"font-bold text-lg",children:e("common.appName")})]}),t!==K.DONE&&m.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m.jsxs("span",{className:t>=K.SETUP?"text-primary font-medium":"",children:["1. ",e("welcome.steps.setup")]}),m.jsx("span",{className:"text-muted-foreground/30",children:"/"}),m.jsxs("span",{className:t>=K.SUBTITLES?"text-primary font-medium":"",children:["2. ",e("welcome.steps.subtitles")]}),m.jsx("span",{className:"text-muted-foreground/30",children:"/"}),m.jsxs("span",{className:t>=K.USAGE?"text-primary font-medium":"",children:["3. ",e("welcome.steps.usage")]}),m.jsx("span",{className:"text-muted-foreground/30",children:"/"}),m.jsxs("span",{className:t>=K.AUTH?"text-primary font-medium":"",children:["4. ",e("welcome.steps.auth")]})]})]})}),m.jsx("main",{className:"flex-1 container max-w-4xl mx-auto py-12 px-4",children:m.jsxs(Yi,{className:"max-w-2xl mx-auto border-none shadow-none bg-transparent",children:[m.jsx(Xi,{className:"text-center pb-8",children:t===K.SETUP&&m.jsxs(m.Fragment,{children:[m.jsx(Qi,{className:"text-2xl",children:e("welcome.step1.title")}),m.jsx(Ki,{children:e("welcome.step1.desc")})]})}),m.jsxs(Ji,{className:"relative",children:[t===K.SETUP&&m.jsx(A,{}),t===K.SUBTITLES&&m.jsx(L,{}),t===K.USAGE&&m.jsx(T,{}),t===K.AUTH&&m.jsx(z,{}),t===K.DONE&&m.jsx(J,{})]})]})})]})}Wi().finally(()=>{Gi.createRoot(document.getElementById("root")).render(m.jsx(G.StrictMode,{children:m.jsx(oh,{})}))});
