Files
2026-11-12 06:29:38 +08:00

32 lines
179 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{r as Q,j as g}from"./react-vendor-jWT2yUdV.js";import{u as yr,k as Qt,c as Ye,b as ge,O as zi,Q as ji,R as Ni,S as Li,s as kr,T as Di,aI as _i}from"./index-DiaaLdUu.js";import{i as Fi}from"./chunk-2QAN2V2R-B2qCPZrG.js";import{t as Ri,a as Mi}from"./chunk-ML27DD5T-ZFWrMOn-.js";import{t as Xe}from"./chunk-6LIX6LVT-B246pOuK.js";import{p as Oi}from"./chunk-APIAPHLK-nGgOe_Nr.js";import{z as Ce}from"./react-hot-toast-cGcFZPSt.js";import{g as Yt,h as In,i as An,a as Bi,j as $i,e as Hi}from"./index-DvErMbt6.js";import{k as Xt}from"./index-BBhZPeTB.js";import{a as br}from"./chunk-SXMLSBOY-NckgDZ9w.js";import{a as Ui,c as Vi}from"./chunk-5PILOUBS-KHYNqMZE.js";import{c as qi}from"./chunk-TE6SZS6W-DGowl7ka.js";import{c as De}from"./chunk-NAV3ZXLI-ChbUTMf0.js";import{u as wr,v as Wi}from"./index-DE7yoXMZ.js";import{E as Qi}from"./empty_state-BmDJmEaB.js";import{P as Tt}from"./plugin_manager-OIjldREQ.js";import{M as Pn}from"./mirror_selector_modal-CyjkhfUx.js";import{g as Sr}from"./qface-BZLvZXJ8.js";import{u as Yi}from"./use-dialog-CRIMuzeE.js";import{c as Xi}from"./react-router-dom-C6k78GT4.js";import"./chunk-SLABUSGS-Cmz8sGrU.js";import"./useFocusable-DA5Croun.js";import"./chunk-M3MASYO7-B4fjH-eW.js";import"./index-BV9-YCKp.js";import"./chunk-UX7UMZL5-CMHjUaC_.js";import"./SelectionManager-Dl9uHsLK.js";import"./usePress-BrNwsdVw.js";import"./layout-Buao20KT.js";import"./gestures-BHfQC-M8.js";import"./features-animation-BkV7kg8P.js";import"./Item-D8Sud-UP.js";import"./chunk-WQVQ7P2I-BJd1EiqP.js";import"./useHover-DC1o5-bm.js";import"./chunk-RJKRL3AU-CjtrMR1U.js";import"./iconBase-B7bT1FlI.js";import"./index-BsnVex0g.js";function Gi(e,n){if(n)try{const t=new URL(n);if(t.hostname==="github.com"||t.hostname==="www.github.com"){const r=t.pathname.split("/").filter(Boolean);if(r.length>=1)return`https://github.com/${r[0]}.png`}}catch{}if(e)try{const t=new URL(e);if(t.hostname==="github.com"||t.hostname==="www.github.com"){const r=t.pathname.split("/").filter(Boolean);if(r.length>=1)return`https://github.com/${r[0]}.png`}else return`https://api.iowen.cn/favicon/${t.hostname}.png`}catch{}}const Ki=({data:e,onInstall:n,onViewDetail:t,installStatus:r="not-installed",installedVersion:i})=>{const{name:o,version:l,author:a,description:s,tags:u,homepage:f,downloadUrl:c}=e,[p]=yr(Qt.backgroundImage,""),[h,x]=Q.useState(!1),C=!!p,w=Gi(f,c)||`https://avatar.vercel.sh/${encodeURIComponent(o)}`,y=g.jsx("span",{className:Ye("font-medium transition-colors",f?"hover:text-primary hover:underline cursor-pointer":""),children:a||"未知作者"});return g.jsxs(Ui,{className:Ye("group w-full backdrop-blur-xl rounded-2xl overflow-hidden transition-all duration-300","hover:shadow-lg hover:shadow-primary-500/10 hover:-translate-y-0.5","border border-white/60 dark:border-white/10 hover:border-primary/40",C?"bg-black/25 dark:bg-black/30":"bg-white/65 dark:bg-white/[0.04]"),shadow:"none",children:[g.jsxs(Vi,{className:Ye("p-4 flex flex-col gap-3",t&&"cursor-pointer"),onClick:t,children:[g.jsxs("div",{className:"flex items-start gap-3",children:[g.jsx(br,{src:w,name:a||"?",size:"md",isBordered:!0,color:"default",radius:"full",className:"flex-shrink-0 transition-transform group-hover:scale-105"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"flex items-center justify-between",children:g.jsx("div",{className:"flex items-center gap-1.5 min-w-0",children:f?g.jsx(Xe,{content:"访问项目主页",placement:"top",delay:500,children:g.jsx("a",{href:f,target:"_blank",rel:"noreferrer",className:"text-base font-bold text-default-900 hover:text-primary transition-colors truncate",onClick:v=>v.stopPropagation(),children:o})}):g.jsx("h3",{className:"text-base font-bold text-default-900 truncate",title:o,children:o})})}),g.jsxs("div",{className:"text-xs text-default-500 mt-0.5 truncate",children:["by ",f?g.jsx("a",{href:f,target:"_blank",rel:"noreferrer",onClick:v=>v.stopPropagation(),children:y}):y]})]})]}),g.jsx("div",{className:"relative min-h-[2.5rem] cursor-pointer group/desc",onClick:()=>x(!h),children:g.jsx(Xe,{content:s,isDisabled:!s||s.length<50||h,placement:"bottom",className:"max-w-[280px]",delay:500,children:g.jsx("p",{className:Ye("text-sm text-default-600 dark:text-default-400 leading-relaxed transition-all duration-300",h?"line-clamp-none":"line-clamp-2"),children:s||"暂无描述"})})}),g.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[g.jsxs(De,{size:"sm",variant:"flat",color:"primary",className:"h-5 text-xs font-semibold px-0.5",classNames:{content:"px-1"},children:["v",l]}),u==null?void 0:u.slice(0,2).map(v=>g.jsx(De,{size:"sm",variant:"flat",className:"h-5 text-xs px-0.5 bg-default-100 dark:bg-default-50/50 text-default-600",classNames:{content:"px-1"},children:v},v)),u&&u.length>2&&g.jsx(Xe,{content:g.jsx("div",{className:"flex flex-wrap gap-1 max-w-[200px] p-1",children:u.map(v=>g.jsx("span",{className:"text-xs bg-white/10 px-1.5 py-0.5 rounded-md border border-white/10",children:v},v))}),delay:0,closeDelay:0,children:g.jsxs(De,{size:"sm",variant:"flat",className:"h-5 text-xs px-0.5 cursor-pointer hover:bg-default-200 transition-colors",classNames:{content:"px-1"},children:["+",u.length-2]})}),r==="update-available"&&i&&g.jsx(De,{size:"sm",variant:"shadow",color:"warning",className:"h-5 text-xs font-semibold px-0.5 ml-auto animate-pulse",classNames:{content:"px-1"},children:"新版本"})]})]}),g.jsx(qi,{className:"px-4 pb-4 pt-0",onClick:v=>v.stopPropagation(),children:r==="installed"?g.jsx(ge,{fullWidth:!0,radius:"full",size:"sm",color:"success",variant:"flat",startContent:g.jsx(Yt,{size:18}),className:"font-medium bg-success/20 text-success dark:bg-success/20 cursor-default",isDisabled:!0,children:"已安装"}):r==="update-available"?g.jsxs(ge,{fullWidth:!0,radius:"full",size:"sm",color:"warning",variant:"shadow",className:"font-medium text-white shadow-warning/30 hover:shadow-warning/50 transition-shadow",startContent:g.jsx(wr,{size:18}),onPress:n,children:["更新到 v",l]}):g.jsx(ge,{fullWidth:!0,radius:"full",size:"sm",color:"primary",variant:"bordered",className:"font-medium bg-white dark:bg-zinc-900 border hover:bg-primary hover:text-white transition-all shadow-sm group/btn",startContent:g.jsx(Wi,{size:20,className:"transition-transform group-hover/btn:translate-y-0.5"}),onPress:n,children:"立即安装"})})]})};function Ji(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Zi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,el=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tl={};function Tn(e,n){return(tl.jsx?el:Zi).test(e)}const nl=/[ \t\n\f\r]/g;function rl(e){return typeof e=="object"?e.type==="text"?zn(e.value):!1:zn(e)}function zn(e){return e.replace(nl,"")===""}class ft{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}ft.prototype.normal={};ft.prototype.property={};ft.prototype.space=void 0;function Cr(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new ft(t,r,n)}function Gt(e){return e.toLowerCase()}class ce{constructor(n,t){this.attribute=t,this.property=n}}ce.prototype.attribute="";ce.prototype.booleanish=!1;ce.prototype.boolean=!1;ce.prototype.commaOrSpaceSeparated=!1;ce.prototype.commaSeparated=!1;ce.prototype.defined=!1;ce.prototype.mustUseProperty=!1;ce.prototype.number=!1;ce.prototype.overloadedBoolean=!1;ce.prototype.property="";ce.prototype.spaceSeparated=!1;ce.prototype.space=void 0;let il=0;const M=$e(),te=$e(),Kt=$e(),I=$e(),K=$e(),Ge=$e(),me=$e();function $e(){return 2**++il}const Jt=Object.freeze(Object.defineProperty({__proto__:null,boolean:M,booleanish:te,commaOrSpaceSeparated:me,commaSeparated:Ge,number:I,overloadedBoolean:Kt,spaceSeparated:K},Symbol.toStringTag,{value:"Module"})),zt=Object.keys(Jt);class sn extends ce{constructor(n,t,r,i){let o=-1;if(super(n,t),jn(this,"space",i),typeof r=="number")for(;++o<zt.length;){const l=zt[o];jn(this,zt[o],(r&Jt[l])===Jt[l])}}}sn.prototype.defined=!0;function jn(e,n,t){t&&(e[n]=t)}function Je(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new sn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[Gt(r)]=r,t[Gt(o.attribute)]=r}return new ft(n,t,e.space)}const vr=Je({properties:{ariaActiveDescendant:null,ariaAtomic:te,ariaAutoComplete:null,ariaBusy:te,ariaChecked:te,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:K,ariaCurrent:null,ariaDescribedBy:K,ariaDetails:null,ariaDisabled:te,ariaDropEffect:K,ariaErrorMessage:null,ariaExpanded:te,ariaFlowTo:K,ariaGrabbed:te,ariaHasPopup:null,ariaHidden:te,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:K,ariaLevel:I,ariaLive:null,ariaModal:te,ariaMultiLine:te,ariaMultiSelectable:te,ariaOrientation:null,ariaOwns:K,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:te,ariaReadOnly:te,ariaRelevant:null,ariaRequired:te,ariaRoleDescription:K,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:te,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Er(e,n){return n in e?e[n]:n}function Ir(e,n){return Er(e,n.toLowerCase())}const ll=Je({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ge,acceptCharset:K,accessKey:K,action:null,allow:null,allowFullScreen:M,allowPaymentRequest:M,allowUserMedia:M,alt:null,as:null,async:M,autoCapitalize:null,autoComplete:K,autoFocus:M,autoPlay:M,blocking:K,capture:null,charSet:null,checked:M,cite:null,className:K,cols:I,colSpan:null,content:null,contentEditable:te,controls:M,controlsList:K,coords:I|Ge,crossOrigin:null,data:null,dateTime:null,decoding:null,default:M,defer:M,dir:null,dirName:null,disabled:M,download:Kt,draggable:te,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:M,formTarget:null,headers:K,height:I,hidden:Kt,high:I,href:null,hrefLang:null,htmlFor:K,httpEquiv:K,id:null,imageSizes:null,imageSrcSet:null,inert:M,inputMode:null,integrity:null,is:null,isMap:M,itemId:null,itemProp:K,itemRef:K,itemScope:M,itemType:K,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:M,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,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:I,pattern:null,ping:K,placeholder:null,playsInline:M,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:M,referrerPolicy:null,rel:K,required:M,reversed:M,rows:I,rowSpan:I,sandbox:K,scope:null,scoped:M,seamless:M,selected:M,shadowRootClonable:M,shadowRootDelegatesFocus:M,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:te,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:M,useMap:null,value:te,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:K,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,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:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:M,noHref:M,noShade:M,noWrap:M,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:te,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:M,disableRemotePlayback:M,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:Ir}),ol=Je({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:me,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:K,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:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:M,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,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:Ge,g2:Ge,glyphName:Ge,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:me,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,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:I,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:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:K,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:me,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:me,rev:me,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:me,requiredFeatures:me,requiredFonts:me,requiredFormats:me,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:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:me,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:me,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:me,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Er}),Ar=Je({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()}}),Pr=Je({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ir}),Tr=Je({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),al={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"},sl=/[A-Z]/g,Nn=/-[a-z]/g,ul=/^data[-\w.:]+$/i;function cl(e,n){const t=Gt(n);let r=n,i=ce;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&ul.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Nn,hl);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Nn.test(o)){let l=o.replace(sl,fl);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=sn}return new i(r,n)}function fl(e){return"-"+e.toLowerCase()}function hl(e){return e.charAt(1).toUpperCase()}const pl=Cr([vr,ll,Ar,Pr,Tr],"html"),un=Cr([vr,ol,Ar,Pr,Tr],"svg");function ml(e){return e.join(" ").trim()}var qe={},jt,Ln;function dl(){if(Ln)return jt;Ln=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=`
`,u="/",f="*",c="",p="comment",h="declaration";function x(w,y){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];y=y||{};var v=1,E=1;function D(j){var P=j.match(n);P&&(v+=P.length);var W=j.lastIndexOf(s);E=~W?j.length-W:E+j.length}function F(){var j={line:v,column:E};return function(P){return P.position=new b(j),B(),P}}function b(j){this.start=j,this.end={line:v,column:E},this.source=y.source}b.prototype.content=w;function _(j){var P=new Error(y.source+":"+v+":"+E+": "+j);if(P.reason=j,P.filename=y.source,P.line=v,P.column=E,P.source=w,!y.silent)throw P}function U(j){var P=j.exec(w);if(P){var W=P[0];return D(W),w=w.slice(W.length),P}}function B(){U(t)}function k(j){var P;for(j=j||[];P=T();)P!==!1&&j.push(P);return j}function T(){var j=F();if(!(u!=w.charAt(0)||f!=w.charAt(1))){for(var P=2;c!=w.charAt(P)&&(f!=w.charAt(P)||u!=w.charAt(P+1));)++P;if(P+=2,c===w.charAt(P-1))return _("End of comment missing");var W=w.slice(2,P-2);return E+=2,D(W),w=w.slice(P),E+=2,j({type:p,comment:W})}}function z(){var j=F(),P=U(r);if(P){if(T(),!U(i))return _("property missing ':'");var W=U(o),ee=j({type:h,property:C(P[0].replace(e,c)),value:W?C(W[0].replace(e,c)):c});return U(l),ee}}function q(){var j=[];k(j);for(var P;P=z();)P!==!1&&(j.push(P),k(j));return j}return B(),q()}function C(w){return w?w.replace(a,c):c}return jt=x,jt}var Dn;function gl(){if(Dn)return qe;Dn=1;var e=qe&&qe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(qe,"__esModule",{value:!0}),qe.default=t;const n=e(dl());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:f}=s;a?i(u,f,s):f&&(o=o||{},o[u]=f)}),o}return qe}var nt={},_n;function xl(){if(_n)return nt;_n=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||t.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},a=function(u,f){return"".concat(f,"-")},s=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(n,l))};return nt.camelCase=s,nt}var rt,Fn;function yl(){if(Fn)return rt;Fn=1;var e=rt&&rt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(gl()),t=xl();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,s){a&&s&&(l[(0,t.camelCase)(a,o)]=s)}),l}return r.default=r,rt=r,rt}var kl=yl();const bl=Sr(kl),zr=jr("end"),cn=jr("start");function jr(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 wl(e){const n=cn(e),t=zr(e);if(n&&t)return{start:n,end:t}}function ot(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rn(e.position):"start"in e||"end"in e?Rn(e):"line"in e||"column"in e?Zt(e):""}function Zt(e){return Mn(e&&e.line)+":"+Mn(e&&e.column)}function Rn(e){return Zt(e&&e.start)+"-"+Zt(e&&e.end)}function Mn(e){return e&&typeof e=="number"?e:1}class ie extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=ot(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ie.prototype.file="";ie.prototype.name="";ie.prototype.reason="";ie.prototype.message="";ie.prototype.stack="";ie.prototype.column=void 0;ie.prototype.line=void 0;ie.prototype.ancestors=void 0;ie.prototype.cause=void 0;ie.prototype.fatal=void 0;ie.prototype.place=void 0;ie.prototype.ruleId=void 0;ie.prototype.source=void 0;const fn={}.hasOwnProperty,Sl=new Map,Cl=/[A-Z]/g,vl=new Set(["table","tbody","thead","tfoot","tr"]),El=new Set(["td","th"]),Nr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Il(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=Dl(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=Ll(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"?un:pl,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=Lr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Lr(e,n,t){if(n.type==="element")return Al(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Pl(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return zl(e,n,t);if(n.type==="mdxjsEsm")return Tl(e,n);if(n.type==="root")return jl(e,n,t);if(n.type==="text")return Nl(e,n)}function Al(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=un,e.schema=i),e.ancestors.push(n);const o=_r(e,n.tagName,!1),l=_l(e,n);let a=pn(e,n);return vl.has(n.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!rl(s):!0})),Dr(e,l,o,n),hn(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Pl(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ut(e,n.position)}function Tl(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ut(e,n.position)}function zl(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=un,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:_r(e,n.name,!0),l=Fl(e,n),a=pn(e,n);return Dr(e,l,o,n),hn(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function jl(e,n,t){const r={};return hn(r,pn(e,n)),e.create(n,e.Fragment,r,t)}function Nl(e,n){return n.value}function Dr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function hn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Ll(e,n,t){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?t:n;return a?u(o,l,a):u(o,l)}}function Dl(e,n){return t;function t(r,i,o,l){const a=Array.isArray(o.children),s=cn(r);return n(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function _l(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&fn.call(n.properties,i)){const o=Rl(e,i,n.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&El.has(n.tagName)?r=a:t[l]=a}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Fl(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else ut(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else ut(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function pn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Sl;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){const u=i.get(s)||0;l=s+"-"+u,i.set(s,u+1)}}const a=Lr(e,o,l);a!==void 0&&t.push(a)}return t}function Rl(e,n,t){const r=cl(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Ji(t):ml(t)),r.property==="style"){let i=typeof t=="object"?t:Ml(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Ol(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?al[r.property]||r.property:r.attribute,t]}}function Ml(e,n){try{return bl(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ie("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=Nr+"#cannot-parse-style-attribute",i}}function _r(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const a=Tn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=Tn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return fn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ut(e)}function ut(e,n){const t=new ie("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=Nr+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Ol(e){const n={};let t;for(t in e)fn.call(e,t)&&(n[Bl(t)]=e[t]);return n}function Bl(e){let n=e.replace(Cl,$l);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function $l(e){return"-"+e.toLowerCase()}const Nt={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"]},Hl={};function mn(e,n){const t=Hl,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Fr(e,r,i)}function Fr(e,n,t){if(Ul(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 On(e.children,n,t)}return Array.isArray(e)?On(e,n,t):""}function On(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Fr(e[i],n,t);return r.join("")}function Ul(e){return!!(e&&typeof e=="object")}const Bn=document.createElement("i");function dn(e){const n="&"+e+";";Bn.innerHTML=n;const t=Bn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function de(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function xe(e,n){return e.length>0?(de(e,e.length,0,n),e):n}const $n={}.hasOwnProperty;function Rr(e){const n={};let t=-1;for(;++t<e.length;)Vl(n,e[t]);return n}function Vl(e,n){let t;for(t in n){const i=($n.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){$n.call(i,l)||(i[l]=[]);const a=o[l];ql(i[l],Array.isArray(a)?a:a?[a]:[])}}}function ql(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);de(e,0,0,r)}function Mr(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 Se(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ae=_e(/[A-Za-z]/),re=_e(/[\dA-Za-z]/),Wl=_e(/[#-'*+\--9=?A-Z^-~]/);function kt(e){return e!==null&&(e<32||e===127)}const en=_e(/\d/),Ql=_e(/[\dA-Fa-f]/),Yl=_e(/[!-/:-@[-`{-~]/);function L(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const Ct=_e(new RegExp("\\p{P}|\\p{S}","u")),Be=_e(/\s/);function _e(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ze(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&re(e.charCodeAt(t+1))&&re(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function V(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return O(s)?(e.enter(t),a(s)):n(s)}function a(s){return O(s)&&o++<i?(e.consume(s),a):(e.exit(t),n(s))}}const Xl={tokenize:Gl};function Gl(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),V(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return L(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const Kl={tokenize:Jl},Hn={tokenize:Zl};function Jl(e){const n=this,t=[];let r=0,i,o,l;return a;function a(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&&v();const D=n.events.length;let F=D,b;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){b=n.events[F][1].end;break}y(r);let _=D;for(;_<n.events.length;)n.events[_][1].end={...b},_++;return de(n.events,F+1,0,n.events.slice(D)),n.events.length=_,u(E)}return a(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(Hn,f,c)(E)}function f(E){return i&&v(),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(Hn,h,x)(E)}function h(E){return r++,t.push([n.currentConstruct,n.containerState]),p(E)}function x(E){if(E===null){i&&v(),y(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),C(E)}function C(E){if(E===null){w(e.exit("chunkFlow"),!0),y(0),e.consume(E);return}return L(E)?(e.consume(E),w(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),C)}function w(E,D){const F=n.sliceStream(E);if(D&&F.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(F),n.parser.lazy[E.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const _=n.events.length;let U=_,B,k;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){if(B){k=n.events[U][1].end;break}B=!0}for(y(r),b=_;b<n.events.length;)n.events[b][1].end={...k},b++;de(n.events,U+1,0,n.events.slice(_)),n.events.length=b}}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 v(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Zl(e,n,t){return V(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ke(e){if(e===null||G(e)||Be(e))return 1;if(Ct(e))return 2}function vt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const tn={name:"attention",resolveAll:eo,tokenize:to};function eo(e,n){let t=-1,r,i,o,l,a,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};Un(c,-s),Un(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={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:{...a.end}},e[r][1].end={...l.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=xe(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=xe(u,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),u=xe(u,vt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=xe(u,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,u=xe(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,de(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 to(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ke(r);let o;return l;function l(s){return o=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===o)return e.consume(s),a;const u=e.exit("attentionSequence"),f=Ke(s),c=!f||f===2&&i||t.includes(s),p=!i||i===2&&f||t.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),n(s)}}function Un(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const no={name:"autolink",tokenize:ro};function ro(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ae(h)?(e.consume(h),l):h===64?t(h):u(h)}function l(h){return h===43||h===45||h===46||re(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,s):(h===43||h===45||h===46||re(h))&&r++<32?(e.consume(h),a):(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||kt(h)?t(h):(e.consume(h),s)}function u(h){return h===64?(e.consume(h),f):Wl(h)?(e.consume(h),u):t(h)}function f(h){return re(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||re(h))&&r++<63){const x=h===45?p:c;return e.consume(h),x}return t(h)}}const ht={partial:!0,tokenize:io};function io(e,n,t){return r;function r(o){return O(o)?V(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||L(o)?n(o):t(o)}}const Or={continuation:{tokenize:oo},exit:ao,name:"blockQuote",tokenize:lo};function lo(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return O(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function oo(e,n,t){const r=this;return i;function i(l){return O(l)?V(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Or,n,t)(l)}}function ao(e){e.exit("blockQuote")}const Br={name:"characterEscape",tokenize:so};function so(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Yl(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const $r={name:"characterReference",tokenize:uo};function uo(e,n,t){const r=this;let i=0,o,l;return a;function a(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"),o=31,l=re,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Ql,f):(e.enter("characterReferenceValue"),o=7,l=en,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===re&&!dn(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const Vn={partial:!0,tokenize:fo},qn={concrete:!0,name:"codeFenced",tokenize:co};function co(e,n,t){const r=this,i={partial:!0,tokenize:F};let o=0,l=0,a;return s;function s(b){return u(b)}function u(b){const _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?t(b):(e.exit("codeFencedFenceSequence"),O(b)?V(e,c,"whitespace")(b):c(b))}function c(b){return b===null||L(b)?(e.exit("codeFencedFence"),r.interrupt?n(b):e.check(Vn,C,D)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||L(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):O(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),V(e,h,"whitespace")(b)):b===96&&b===a?t(b):(e.consume(b),p)}function h(b){return b===null||L(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===null||L(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?t(b):(e.consume(b),x)}function C(b){return e.attempt(i,D,w)(b)}function w(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y}function y(b){return o>0&&O(b)?V(e,v,"linePrefix",o+1)(b):v(b)}function v(b){return b===null||L(b)?e.check(Vn,C,D)(b):(e.enter("codeFlowValue"),E(b))}function E(b){return b===null||L(b)?(e.exit("codeFlowValue"),v(b)):(e.consume(b),E)}function D(b){return e.exit("codeFenced"),n(b)}function F(b,_,U){let B=0;return k;function k(P){return b.enter("lineEnding"),b.consume(P),b.exit("lineEnding"),T}function T(P){return b.enter("codeFencedFence"),O(P)?V(b,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):z(P)}function z(P){return P===a?(b.enter("codeFencedFenceSequence"),q(P)):U(P)}function q(P){return P===a?(B++,b.consume(P),q):B>=l?(b.exit("codeFencedFenceSequence"),O(P)?V(b,j,"whitespace")(P):j(P)):U(P)}function j(P){return P===null||L(P)?(b.exit("codeFencedFence"),_(P)):U(P)}}}function fo(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const Lt={name:"codeIndented",tokenize:po},ho={partial:!0,tokenize:mo};function po(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),V(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):t(u)}function l(u){return u===null?s(u):L(u)?e.attempt(ho,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||L(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),n(u)}}function mo(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):L(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):V(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):L(l)?i(l):t(l)}}const go={name:"codeText",previous:yo,resolve:xo,tokenize:ko};function xo(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 yo(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ko(e,n,t){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(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?(o=e.enter("codeTextSequence"),i=0,f(c)):L(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||L(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)):(o.type="codeTextData",u(c))}}class bo{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&it(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),it(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),it(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);it(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);it(this.left,t.reverse())}}}function it(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 Hr(e){const n={};let t=-1,r,i,o,l,a,s,u;const f=new bo(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,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,wo(f,t)),t=n[t],u=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return de(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function wo(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,s=[],u={};let f,c,p=-1,h=t,x=0,C=0;const w=[C];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(C=p+1,w.push(C),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):w.pop(),p=w.length;p--;){const y=a.slice(w[p],w[p+1]),v=o.pop();s.push([v,v+y.length-1]),e.splice(v,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 So={resolve:vo,tokenize:Eo},Co={partial:!0,tokenize:Io};function vo(e){return Hr(e),e}function Eo(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):L(a)?e.check(Co,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),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"),V(e,o,"linePrefix")}function o(l){if(l===null||L(l))return t(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function Ur(e,n,t,r,i,o,l,a,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(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||kt(y)?t(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),C(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||L(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 C(y){return!f&&(y===null||y===41||G(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(y)):f<u&&y===40?(e.consume(y),f++,C):y===41?(e.consume(y),f--,C):y===null||y===32||y===40||kt(y)?t(y):(e.consume(y),y===92?w:C)}function w(y){return y===40||y===41||y===92?(e.consume(y),C):C(y)}}function Vr(e,n,t,r,i,o){const l=this;let a=0,s;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!s||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):L(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||L(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),s||(s=!O(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function qr(e,n,t,r,i,o){let l;return a;function a(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(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?t(p):L(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),V(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||L(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 at(e,n){let t;return r;function r(i){return L(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):O(i)?V(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Ao={name:"definition",tokenize:To},Po={partial:!0,tokenize:zo};function To(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return Vr.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=Se(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 G(h)?at(e,u)(h):u(h)}function u(h){return Ur(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Po,c,c)(h)}function c(h){return O(h)?V(e,p,"whitespace")(h):p(h)}function p(h){return h===null||L(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function zo(e,n,t){return r;function r(a){return G(a)?at(e,i)(a):t(a)}function i(a){return qr(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?V(e,l,"whitespace")(a):l(a)}function l(a){return a===null||L(a)?n(a):t(a)}}const jo={name:"hardBreakEscape",tokenize:No};function No(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return L(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const Lo={name:"headingAtx",resolve:Do,tokenize:_o};function Do(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},de(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function _o(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||G(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),s(f)):f===null||L(f)?(e.exit("atxHeading"),n(f)):O(f)?V(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function s(f){return f===35?(e.consume(f),s):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||G(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const Fo=["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"],Wn=["pre","script","style","textarea"],Ro={concrete:!0,name:"htmlFlow",resolveTo:Bo,tokenize:$o},Mo={partial:!0,tokenize:Uo},Oo={partial:!0,tokenize:Ho};function Bo(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 $o(e,n,t){const r=this;let i,o,l,a,s;return u;function u(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,C):d===63?(e.consume(d),i=3,r.interrupt?n:m):ae(d)?(e.consume(d),l=String.fromCharCode(d),w):t(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,x):ae(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function x(d){const se="CDATA[";return d===se.charCodeAt(a++)?(e.consume(d),a===se.length?r.interrupt?n:z:x):t(d)}function C(d){return ae(d)?(e.consume(d),l=String.fromCharCode(d),w):t(d)}function w(d){if(d===null||d===47||d===62||G(d)){const se=d===47,Ie=l.toLowerCase();return!se&&!o&&Wn.includes(Ie)?(i=1,r.interrupt?n(d):z(d)):Fo.includes(l.toLowerCase())?(i=6,se?(e.consume(d),y):r.interrupt?n(d):z(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):o?v(d):E(d))}return d===45||re(d)?(e.consume(d),l+=String.fromCharCode(d),w):t(d)}function y(d){return d===62?(e.consume(d),r.interrupt?n:z):t(d)}function v(d){return O(d)?(e.consume(d),v):k(d)}function E(d){return d===47?(e.consume(d),k):d===58||d===95||ae(d)?(e.consume(d),D):O(d)?(e.consume(d),E):k(d)}function D(d){return d===45||d===46||d===58||d===95||re(d)?(e.consume(d),D):F(d)}function F(d){return d===61?(e.consume(d),b):O(d)?(e.consume(d),F):E(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),s=d,_):O(d)?(e.consume(d),b):U(d)}function _(d){return d===s?(e.consume(d),s=null,B):d===null||L(d)?t(d):(e.consume(d),_)}function U(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||G(d)?F(d):(e.consume(d),U)}function B(d){return d===47||d===62||O(d)?E(d):t(d)}function k(d){return d===62?(e.consume(d),T):t(d)}function T(d){return d===null||L(d)?z(d):O(d)?(e.consume(d),T):t(d)}function z(d){return d===45&&i===2?(e.consume(d),W):d===60&&i===1?(e.consume(d),ee):d===62&&i===4?(e.consume(d),oe):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),fe):L(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Mo,ye,q)(d)):d===null||L(d)?(e.exit("htmlFlowData"),q(d)):(e.consume(d),z)}function q(d){return e.check(Oo,j,ye)(d)}function j(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),P}function P(d){return d===null||L(d)?q(d):(e.enter("htmlFlowData"),z(d))}function W(d){return d===45?(e.consume(d),m):z(d)}function ee(d){return d===47?(e.consume(d),l="",le):z(d)}function le(d){if(d===62){const se=l.toLowerCase();return Wn.includes(se)?(e.consume(d),oe):z(d)}return ae(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),le):z(d)}function fe(d){return d===93?(e.consume(d),m):z(d)}function m(d){return d===62?(e.consume(d),oe):d===45&&i===2?(e.consume(d),m):z(d)}function oe(d){return d===null||L(d)?(e.exit("htmlFlowData"),ye(d)):(e.consume(d),oe)}function ye(d){return e.exit("htmlFlow"),n(d)}}function Ho(e,n,t){const r=this;return i;function i(l){return L(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function Uo(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ht,n,t)}}const Vo={name:"htmlText",tokenize:qo};function qo(e,n,t){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),E):ae(m)?(e.consume(m),U):t(m)}function u(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,x):ae(m)?(e.consume(m),v):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):L(m)?(l=c,ee(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?W(m):m===45?p(m):c(m)}function x(m){const oe="CDATA[";return m===oe.charCodeAt(o++)?(e.consume(m),o===oe.length?C:x):t(m)}function C(m){return m===null?t(m):m===93?(e.consume(m),w):L(m)?(l=C,ee(m)):(e.consume(m),C)}function w(m){return m===93?(e.consume(m),y):C(m)}function y(m){return m===62?W(m):m===93?(e.consume(m),y):C(m)}function v(m){return m===null||m===62?W(m):L(m)?(l=v,ee(m)):(e.consume(m),v)}function E(m){return m===null?t(m):m===63?(e.consume(m),D):L(m)?(l=E,ee(m)):(e.consume(m),E)}function D(m){return m===62?W(m):E(m)}function F(m){return ae(m)?(e.consume(m),b):t(m)}function b(m){return m===45||re(m)?(e.consume(m),b):_(m)}function _(m){return L(m)?(l=_,ee(m)):O(m)?(e.consume(m),_):W(m)}function U(m){return m===45||re(m)?(e.consume(m),U):m===47||m===62||G(m)?B(m):t(m)}function B(m){return m===47?(e.consume(m),W):m===58||m===95||ae(m)?(e.consume(m),k):L(m)?(l=B,ee(m)):O(m)?(e.consume(m),B):W(m)}function k(m){return m===45||m===46||m===58||m===95||re(m)?(e.consume(m),k):T(m)}function T(m){return m===61?(e.consume(m),z):L(m)?(l=T,ee(m)):O(m)?(e.consume(m),T):B(m)}function z(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,q):L(m)?(l=z,ee(m)):O(m)?(e.consume(m),z):(e.consume(m),j)}function q(m){return m===i?(e.consume(m),i=void 0,P):m===null?t(m):L(m)?(l=q,ee(m)):(e.consume(m),q)}function j(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||G(m)?B(m):(e.consume(m),j)}function P(m){return m===47||m===62||G(m)?B(m):t(m)}function W(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function ee(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),le}function le(m){return O(m)?V(e,fe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):fe(m)}function fe(m){return e.enter("htmlTextData"),l(m)}}const gn={name:"labelEnd",resolveAll:Xo,resolveTo:Go,tokenize:Ko},Wo={tokenize:Jo},Qo={tokenize:Zo},Yo={tokenize:ea};function Xo(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&&de(e,0,e.length,t),e}function Go(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",s,n],["enter",u,n]],a=xe(a,e.slice(o+1,o+r+3)),a=xe(a,[["enter",f,n]]),a=xe(a,vt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=xe(a,[["exit",f,n],e[l-2],e[l-1],["exit",u,n]]),a=xe(a,e.slice(l+1)),a=xe(a,[["exit",s,n]]),de(e,o,e.length,a),e}function Ko(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(Se(r.sliceSerialize({start:o.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(Wo,f,l?f:c)(p):p===91?e.attempt(Qo,f,l?u:c)(p):l?f(p):c(p)}function u(p){return e.attempt(Yo,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function Jo(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return G(c)?at(e,o)(c):o(c)}function o(c){return c===41?f(c):Ur(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return G(c)?at(e,s)(c):f(c)}function a(c){return t(c)}function s(c){return c===34||c===39||c===40?qr(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return G(c)?at(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 Zo(e,n,t){const r=this;return i;function i(a){return Vr.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function ea(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const ta={name:"labelStartImage",resolveAll:gn.resolveAll,tokenize:na};function na(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const ra={name:"labelStartLink",resolveAll:gn.resolveAll,tokenize:ia};function ia(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Dt={name:"lineEnding",tokenize:la};function la(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),V(e,n,"linePrefix")}}const yt={name:"thematicBreak",tokenize:oa};function oa(e,n,t){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||L(u))?(e.exit("thematicBreak"),n(u)):t(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?V(e,a,"whitespace")(u):a(u))}}const ue={continuation:{tokenize:ca},exit:ha,name:"list",tokenize:ua},aa={partial:!0,tokenize:pa},sa={partial:!0,tokenize:fa};function ua(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const x=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:en(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(yt,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 en(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(ht,r.interrupt?t:f,e.attempt(aa,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return O(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function ca(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(ht,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,V(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(sa,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,V(e,e.attempt(ue,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function fa(e,n,t){const r=this;return V(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function ha(e){e.exit(this.containerState.type)}function pa(e,n,t){const r=this;return V(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const Qn={name:"setextUnderline",resolveTo:ma,tokenize:da};function ma(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function da(e,n,t){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):t(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?V(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||L(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const ga={tokenize:xa};function xa(e){const n=this,t=e.attempt(ht,r,e.attempt(this.parser.constructs.flowInitial,i,V(e,e.attempt(this.parser.constructs.flow,i,e.attempt(So,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const ya={resolveAll:Qr()},ka=Wr("string"),ba=Wr("text");function Wr(e){return{resolveAll:Qr(e==="text"?wa:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return u(f)?o(f):a(f)}function a(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"),o(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 Qr(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function wa(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,l=-1,a=0,s;for(;o--;){const u=i[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(u===-2)s=!0,a++;else if(u!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const u={type:t===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},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 Sa={42:ue,43:ue,45:ue,48:ue,49:ue,50:ue,51:ue,52:ue,53:ue,54:ue,55:ue,56:ue,57:ue,62:Or},Ca={91:Ao},va={[-2]:Lt,[-1]:Lt,32:Lt},Ea={35:Lo,42:yt,45:[Qn,yt],60:Ro,61:Qn,95:yt,96:qn,126:qn},Ia={38:$r,92:Br},Aa={[-5]:Dt,[-4]:Dt,[-3]:Dt,33:ta,38:$r,42:tn,60:[no,Vo],91:ra,92:[jo,Br],93:gn,95:tn,96:go},Pa={null:[tn,ya]},Ta={null:[42,95]},za={null:[]},ja=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ta,contentInitial:Ca,disable:za,document:Sa,flow:Ea,flowInitial:va,insideSpan:Pa,string:Ia,text:Aa},Symbol.toStringTag,{value:"Module"}));function Na(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let l=[],a=[];const s={attempt:_(F),check:_(b),consume:v,enter:E,exit:D,interrupt:_(b,{interrupt:!0})},u={code:null,containerState:{},defineSkip:C,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(u,s);return n.resolveAll&&o.push(n),u;function c(T){return l=xe(l,T),w(),l[l.length-1]!==null?[]:(U(n,0),u.events=vt(o,u.events,u),u.events)}function p(T,z){return Da(h(T),z)}function h(T){return La(l,T)}function x(){const{_bufferIndex:T,_index:z,line:q,column:j,offset:P}=r;return{_bufferIndex:T,_index:z,line:q,column:j,offset:P}}function C(T){i[T.line]=T.column,k()}function w(){let T;for(;r._index<l.length;){const z=l[r._index];if(typeof z=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<z.length;)y(z.charCodeAt(r._bufferIndex));else y(z)}}function y(T){f=f(T)}function v(T){L(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,k()):T!==-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=T}function E(T,z){const q=z||{};return q.type=T,q.start=x(),u.events.push(["enter",q,u]),a.push(q),q}function D(T){const z=a.pop();return z.end=x(),u.events.push(["exit",z,u]),z}function F(T,z){U(T,z.from)}function b(T,z){z.restore()}function _(T,z){return q;function q(j,P,W){let ee,le,fe,m;return Array.isArray(j)?ye(j):"tokenize"in j?ye([j]):oe(j);function oe(ne){return Fe;function Fe(ke){const ze=ke!==null&&ne[ke],je=ke!==null&&ne.null,He=[...Array.isArray(ze)?ze:ze?[ze]:[],...Array.isArray(je)?je:je?[je]:[]];return ye(He)(ke)}}function ye(ne){return ee=ne,le=0,ne.length===0?W:d(ne[le])}function d(ne){return Fe;function Fe(ke){return m=B(),fe=ne,ne.partial||(u.currentConstruct=ne),ne.name&&u.parser.constructs.disable.null.includes(ne.name)?Ie():ne.tokenize.call(z?Object.assign(Object.create(u),z):u,s,se,Ie)(ke)}}function se(ne){return T(fe,m),P}function Ie(ne){return m.restore(),++le<ee.length?d(ee[le]):W}}}function U(T,z){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&de(u.events,z,u.events.length-z,T.resolve(u.events.slice(z),u)),T.resolveTo&&(u.events=T.resolveTo(u.events,u))}function B(){const T=x(),z=u.previous,q=u.currentConstruct,j=u.events.length,P=Array.from(a);return{from:j,restore:W};function W(){r=T,u.previous=z,u.currentConstruct=q,u.events.length=j,a=P,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function La(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Da(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
`;break}case-3:{l=`\r
`;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function _a(e){const r={constructs:Rr([ja,...(e||{}).extensions||[]]),content:i(Xl),defined:[],document:i(Kl),flow:i(ga),lazy:{},string:i(ka),text:i(ba)};return r;function i(o){return l;function l(a){return Na(r,o,a)}}}function Fa(e){for(;!Hr(e););return e}const Yn=/[\0\t\n\r]/g;function Ra(){let e=1,n="",t=!0,r;return i;function i(o,l,a){const s=[];let u,f,c,p,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(Yn.lastIndex=c,u=Yn.exec(o),p=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(p),!u){n=o.slice(c);break}if(h===10&&c===p&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<p&&(s.push(o.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 a&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const Ma=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Oa(e){return e.replace(Ma,Ba)}function Ba(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return Mr(t.slice(o?2:1),o?16:10)}return dn(t)||e}const Yr={}.hasOwnProperty;function $a(e,n,t){return typeof n!="string"&&(t=n,n=void 0),Ha(t)(Fa(_a(t).document().write(Ra()(e,n,!0))))}function Ha(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ne),autolinkProtocol:B,autolinkEmail:B,atxHeading:o($),blockQuote:o(je),characterEscape:B,characterReference:B,codeFenced:o(He),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(He,l),codeText:o(Pt,l),codeTextData:B,data:B,codeFlowValue:B,definition:o(N),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Y),hardBreakEscape:o(J),hardBreakTrailing:o(J),htmlFlow:o(be,l),htmlFlowData:B,htmlText:o(be,l),htmlTextData:B,image:o(Re),label:l,link:o(Ne),listItem:o(Z),listItemValue:p,listOrdered:o(Ue,c),listUnordered:o(Ue),paragraph:o(he),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o($),strong:o(Ai),thematicBreak:o(Ti)},exit:{atxHeading:s(),atxHeadingSequence:F,autolink:s(),autolinkEmail:ze,autolinkProtocol:ke,blockQuote:s(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:ne,characterReference:Fe,codeFenced:s(w),codeFencedFence:C,codeFencedFenceInfo:h,codeFencedFenceMeta:x,codeFlowValue:k,codeIndented:s(y),codeText:s(P),codeTextData:k,data:k,definition:s(),definitionDestinationString:D,definitionLabelString:v,definitionTitleString:E,emphasis:s(),hardBreakEscape:s(z),hardBreakTrailing:s(z),htmlFlow:s(q),htmlFlowData:k,htmlText:s(j),htmlTextData:k,image:s(ee),label:fe,labelText:le,lineEnding:T,link:s(W),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:se,resourceDestinationString:m,resourceTitleString:oe,resource:ye,setextHeading:s(U),setextHeadingLineSequence:_,setextHeadingText:b,strong:s(),thematicBreak:s()}};Xr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(S){let A={type:"root",children:[]};const R={stack:[A],tokenStack:[],config:n,enter:a,exit:u,buffer:l,resume:f,data:t},H=[];let X=-1;for(;++X<S.length;)if(S[X][1].type==="listOrdered"||S[X][1].type==="listUnordered")if(S[X][0]==="enter")H.push(X);else{const we=H.pop();X=i(S,we,X)}for(X=-1;++X<S.length;){const we=n[S[X][0]];Yr.call(we,S[X][1].type)&&we[S[X][1].type].call(Object.assign({sliceSerialize:S[X][2].sliceSerialize},R),S[X][1])}if(R.tokenStack.length>0){const we=R.tokenStack[R.tokenStack.length-1];(we[1]||Xn).call(R,void 0,we[0])}for(A.position={start:Le(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:Le(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},X=-1;++X<n.transforms.length;)A=n.transforms[X](A)||A;return A}function i(S,A,R){let H=A-1,X=-1,we=!1,Me,Ae,et,tt;for(;++H<=R;){const pe=S[H];switch(pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pe[0]==="enter"?X++:X--,tt=void 0;break}case"lineEndingBlank":{pe[0]==="enter"&&(Me&&!tt&&!X&&!et&&(et=H),tt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tt=void 0}if(!X&&pe[0]==="enter"&&pe[1].type==="listItemPrefix"||X===-1&&pe[0]==="exit"&&(pe[1].type==="listUnordered"||pe[1].type==="listOrdered")){if(Me){let Ve=H;for(Ae=void 0;Ve--;){const Pe=S[Ve];if(Pe[1].type==="lineEnding"||Pe[1].type==="lineEndingBlank"){if(Pe[0]==="exit")continue;Ae&&(S[Ae][1].type="lineEndingBlank",we=!0),Pe[1].type="lineEnding",Ae=Ve}else if(!(Pe[1].type==="linePrefix"||Pe[1].type==="blockQuotePrefix"||Pe[1].type==="blockQuotePrefixWhitespace"||Pe[1].type==="blockQuoteMarker"||Pe[1].type==="listItemIndent"))break}et&&(!Ae||et<Ae)&&(Me._spread=!0),Me.end=Object.assign({},Ae?S[Ae][1].start:pe[1].end),S.splice(Ae||H,0,["exit",Me,pe[2]]),H++,R++}if(pe[1].type==="listItemPrefix"){const Ve={type:"listItem",_spread:!1,start:Object.assign({},pe[1].start),end:void 0};Me=Ve,S.splice(H,0,["enter",Ve,pe[2]]),H++,R++,et=void 0,tt=!0}}}return S[A][1]._spread=we,R}function o(S,A){return R;function R(H){a.call(this,S(H),H),A&&A.call(this,H)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(S,A,R){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([A,R||void 0]),S.position={start:Le(A.start),end:void 0}}function s(S){return A;function A(R){S&&S.call(this,R),u.call(this,R)}}function u(S,A){const R=this.stack.pop(),H=this.tokenStack.pop();if(H)H[0].type!==S.type&&(A?A.call(this,S,H[0]):(H[1]||Xn).call(this,S,H[0]));else throw new Error("Cannot close `"+S.type+"` ("+ot({start:S.start,end:S.end})+"): it’s not open");R.position.end=Le(S.end)}function f(){return mn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(S){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function h(){const S=this.resume(),A=this.stack[this.stack.length-1];A.lang=S}function x(){const S=this.resume(),A=this.stack[this.stack.length-1];A.meta=S}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const S=this.resume(),A=this.stack[this.stack.length-1];A.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const S=this.resume(),A=this.stack[this.stack.length-1];A.value=S.replace(/(\r?\n|\r)$/g,"")}function v(S){const A=this.resume(),R=this.stack[this.stack.length-1];R.label=A,R.identifier=Se(this.sliceSerialize(S)).toLowerCase()}function E(){const S=this.resume(),A=this.stack[this.stack.length-1];A.title=S}function D(){const S=this.resume(),A=this.stack[this.stack.length-1];A.url=S}function F(S){const A=this.stack[this.stack.length-1];if(!A.depth){const R=this.sliceSerialize(S).length;A.depth=R}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function _(S){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function B(S){const R=this.stack[this.stack.length-1].children;let H=R[R.length-1];(!H||H.type!=="text")&&(H=Pi(),H.position={start:Le(S.start),end:void 0},R.push(H)),this.stack.push(H)}function k(S){const A=this.stack.pop();A.value+=this.sliceSerialize(S),A.position.end=Le(S.end)}function T(S){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const R=A.children[A.children.length-1];R.position.end=Le(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(A.type)&&(B.call(this,S),k.call(this,S))}function z(){this.data.atHardBreak=!0}function q(){const S=this.resume(),A=this.stack[this.stack.length-1];A.value=S}function j(){const S=this.resume(),A=this.stack[this.stack.length-1];A.value=S}function P(){const S=this.resume(),A=this.stack[this.stack.length-1];A.value=S}function W(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=A,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function ee(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=A,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function le(S){const A=this.sliceSerialize(S),R=this.stack[this.stack.length-2];R.label=Oa(A),R.identifier=Se(A).toLowerCase()}function fe(){const S=this.stack[this.stack.length-1],A=this.resume(),R=this.stack[this.stack.length-1];if(this.data.inReference=!0,R.type==="link"){const H=S.children;R.children=H}else R.alt=A}function m(){const S=this.resume(),A=this.stack[this.stack.length-1];A.url=S}function oe(){const S=this.resume(),A=this.stack[this.stack.length-1];A.title=S}function ye(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function se(S){const A=this.resume(),R=this.stack[this.stack.length-1];R.label=A,R.identifier=Se(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function Ie(S){this.data.characterReferenceType=S.type}function ne(S){const A=this.sliceSerialize(S),R=this.data.characterReferenceType;let H;R?(H=Mr(A,R==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):H=dn(A);const X=this.stack[this.stack.length-1];X.value+=H}function Fe(S){const A=this.stack.pop();A.position.end=Le(S.end)}function ke(S){k.call(this,S);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(S)}function ze(S){k.call(this,S);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(S)}function je(){return{type:"blockquote",children:[]}}function He(){return{type:"code",lang:null,meta:null,value:""}}function Pt(){return{type:"inlineCode",value:""}}function N(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Y(){return{type:"emphasis",children:[]}}function $(){return{type:"heading",depth:0,children:[]}}function J(){return{type:"break"}}function be(){return{type:"html",value:""}}function Re(){return{type:"image",title:null,url:"",alt:null}}function Ne(){return{type:"link",title:null,url:"",children:[]}}function Ue(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function Z(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function he(){return{type:"paragraph",children:[]}}function Ai(){return{type:"strong",children:[]}}function Pi(){return{type:"text",value:""}}function Ti(){return{type:"thematicBreak"}}}function Le(e){return{line:e.line,column:e.column,offset:e.offset}}function Xr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?Xr(e,r):Ua(e,r)}}function Ua(e,n){let t;for(t in n)if(Yr.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 Xn(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+ot({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+ot({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+ot({start:n.start,end:n.end})+") is still open")}function Va(e){const n=this;n.parser=t;function t(r){return $a(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function qa(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 Wa(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
`}]}function Qa(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 Ya(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Xa(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ga(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Ze(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),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 Ka(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 Ja(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Gr(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function Za(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Gr(e,n);const i={src:Ze(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function es(e,n){const t={src:Ze(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 ts(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 ns(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Gr(e,n);const i={href:Ze(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function rs(e,n){const t={href:Ze(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 is(e,n,t){const r=e.all(n),i=t?ls(t):Kr(n),o={},l=[];if(typeof n.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==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:o,children:l};return e.patch(n,u),e.applyData(n,u)}function ls(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=Kr(t[r])}return n}function Kr(e){const n=e.spread;return n??e.children.length>1}function os(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function as(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ss(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function us(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function cs(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)},a=cn(n.children[1]),s=zr(n.children[n.children.length-1]);a&&s&&(l.position={start:a,end:s}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function fs(e,n,t){const r=t?t.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,a=l?l.length:n.children.length;let s=-1;const u=[];for(;++s<a;){const c=n.children[s],p={},h=l?l[s]:void 0;h&&(p.align=h);let x={type:"element",tagName:o,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 hs(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const Gn=9,Kn=32;function ps(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const o=[];for(;r;)o.push(Jn(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return o.push(Jn(n.slice(i),i>0,!1)),o.join("")}function Jn(e,n,t){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===Gn||o===Kn;)r++,o=e.codePointAt(r)}if(t){let o=e.codePointAt(i-1);for(;o===Gn||o===Kn;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ms(e,n){const t={type:"text",value:ps(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function ds(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const gs={blockquote:qa,break:Wa,code:Qa,delete:Ya,emphasis:Xa,footnoteReference:Ga,heading:Ka,html:Ja,imageReference:Za,image:es,inlineCode:ts,linkReference:ns,link:rs,listItem:is,list:os,paragraph:as,root:ss,strong:us,table:cs,tableCell:hs,tableRow:fs,text:ms,thematicBreak:ds,toml:mt,yaml:mt,definition:mt,footnoteDefinition:mt};function mt(){}const Jr=-1,Et=0,st=1,bt=2,xn=3,yn=4,kn=5,bn=6,Zr=7,ei=8,Zn=typeof self=="object"?self:globalThis,xs=(e,n)=>{const t=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=n[i];switch(o){case Et:case Jr:return t(l,i);case st:{const a=t([],i);for(const s of l)a.push(r(s));return a}case bt:{const a=t({},i);for(const[s,u]of l)a[r(s)]=r(u);return a}case xn:return t(new Date(l),i);case yn:{const{source:a,flags:s}=l;return t(new RegExp(a,s),i)}case kn:{const a=t(new Map,i);for(const[s,u]of l)a.set(r(s),r(u));return a}case bn:{const a=t(new Set,i);for(const s of l)a.add(r(s));return a}case Zr:{const{name:a,message:s}=l;return t(new Zn[a](s),i)}case ei: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:a}=new Uint8Array(l);return t(new DataView(a),l)}}return t(new Zn[o](l),i)};return r},er=e=>xs(new Map,e)(0),We="",{toString:ys}={},{keys:ks}=Object,lt=e=>{const n=typeof e;if(n!=="object"||!e)return[Et,n];const t=ys.call(e).slice(8,-1);switch(t){case"Array":return[st,We];case"Object":return[bt,We];case"Date":return[xn,We];case"RegExp":return[yn,We];case"Map":return[kn,We];case"Set":return[bn,We];case"DataView":return[st,t]}return t.includes("Array")?[st,t]:t.includes("Error")?[Zr,t]:[bt,t]},dt=([e,n])=>e===Et&&(n==="function"||n==="symbol"),bs=(e,n,t,r)=>{const i=(l,a)=>{const s=r.push(l)-1;return t.set(a,s),s},o=l=>{if(t.has(l))return t.get(l);let[a,s]=lt(l);switch(a){case Et:{let f=l;switch(s){case"bigint":a=ei,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);f=null;break;case"undefined":return i([Jr],l)}return i([a,f],l)}case st:{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([a,f],l);for(const p of l)f.push(o(p));return c}case bt:{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 o(l.toJSON());const f=[],c=i([a,f],l);for(const p of ks(l))(e||!dt(lt(l[p])))&&f.push([o(p),o(l[p])]);return c}case xn:return i([a,l.toISOString()],l);case yn:{const{source:f,flags:c}=l;return i([a,{source:f,flags:c}],l)}case kn:{const f=[],c=i([a,f],l);for(const[p,h]of l)(e||!(dt(lt(p))||dt(lt(h))))&&f.push([o(p),o(h)]);return c}case bn:{const f=[],c=i([a,f],l);for(const p of l)(e||!dt(lt(p)))&&f.push(o(p));return c}}const{message:u}=l;return i([a,{name:s,message:u}],l)};return o},tr=(e,{json:n,lossy:t}={})=>{const r=[];return bs(!(n||t),!!n,new Map,r)(e),r},wt=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?er(tr(e,n)):structuredClone(e):(e,n)=>er(tr(e,n));function ws(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 Ss(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Cs(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||ws,r=e.options.footnoteBackLabel||Ss,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];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=Ze(c.toLowerCase());let h=0;const x=[],C=e.footnoteCounts.get(c);for(;C!==void 0&&++h<=C;){x.length>0&&x.push({type:"text",value:" "});let v=typeof t=="string"?t:t(s,h);typeof v=="string"&&(v={type:"text",value:v}),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(v)?v:[v]})}const w=f[f.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const v=w.children[w.children.length-1];v&&v.type==="text"?v.value+=" ":w.children.push({type:"text",value:" "}),w.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),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...wt(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
`}]}}const It=(function(e){if(e==null)return As;if(typeof e=="function")return At(e);if(typeof e=="object")return Array.isArray(e)?vs(e):Es(e);if(typeof e=="string")return Is(e);throw new Error("Expected function, string, or object as test")});function vs(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=It(e[t]);return At(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function Es(e){const n=e;return At(t);function t(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function Is(e){return At(n);function n(t){return t&&t.type===e}}function At(e){return n;function n(t,r,i){return!!(Ps(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function As(){return!0}function Ps(e){return e!==null&&typeof e=="object"&&"type"in e}const ti=[],Ts=!0,nn=!1,zs="skip";function ni(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const o=It(i),l=r?-1:1;a(e,void 0,[])();function a(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=ti,x,C,w;if((!n||o(s,u,f[f.length-1]||void 0))&&(h=js(t(s,f)),h[0]===nn))return h;if("children"in s&&s.children){const y=s;if(y.children&&h[0]!==zs)for(C=(r?y.children.length:-1)+l,w=f.concat(y);C>-1&&C<y.children.length;){const v=y.children[C];if(x=a(v,C,w)(),x[0]===nn)return x;C=typeof x[1]=="number"?x[1]:C+l}}return h}}}function js(e){return Array.isArray(e)?e:typeof e=="number"?[Ts,e]:e==null?ti:[e]}function wn(e,n,t,r){let i,o,l;typeof n=="function"&&typeof t!="function"?(o=void 0,l=n,i=t):(o=n,l=t,i=r),ni(e,o,a,i);function a(s,u){const f=u[u.length-1],c=f?f.children.indexOf(s):void 0;return l(s,c,f)}}const rn={}.hasOwnProperty,Ns={};function Ls(e,n){const t=n||Ns,r=new Map,i=new Map,o=new Map,l={...gs,...t.handlers},a={all:u,applyData:_s,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:s,options:t,patch:Ds,wrap:Rs};return wn(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)}}),a;function s(f,c){const p=f.type,h=a.handlers[p];if(rn.call(a.handlers,p)&&h)return h(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:C,...w}=f,y=wt(w);return y.children=a.all(f),y}return wt(f)}return(a.options.unknownHandler||Fs)(a,f,c)}function u(f){const c=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const x=a.one(p[h],f);if(x){if(h&&p[h-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=nr(x.value)),!Array.isArray(x)&&x.type==="element")){const C=x.children[0];C&&C.type==="text"&&(C.value=nr(C.value))}Array.isArray(x)?c.push(...x):c.push(x)}}}return c}}function Ds(e,n){e.position&&(n.position=wl(e))}function _s(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const l="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:l}}t.type==="element"&&o&&Object.assign(t.properties,wt(o)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function Fs(e,n){const t=n.data||{},r="value"in n&&!(rn.call(t,"hProperties")||rn.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 Rs(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 nr(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function rr(e,n){const t=Ls(e,n),r=t.one(e,void 0),i=Cs(t),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
`},i),o}function Ms(e,n){return e&&"run"in e?async function(t,r){const i=rr(t,{file:r,...n});await e.run(i,r)}:function(t,r){return rr(t,{file:r,...e||n})}}function ir(e){if(e)throw e}var _t,lr;function Os(){if(lr)return _t;lr=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},o=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),c=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!c)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},l=function(u,f){t&&f.name==="__proto__"?t(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},a=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return _t=function s(){var u,f,c,p,h,x,C=arguments[0],w=1,y=arguments.length,v=!1;for(typeof C=="boolean"&&(v=C,C=arguments[1]||{},w=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});w<y;++w)if(u=arguments[w],u!=null)for(f in u)c=a(C,f),p=a(u,f),C!==p&&(v&&p&&(o(p)||(h=i(p)))?(h?(h=!1,x=c&&i(c)?c:[]):x=c&&o(c)?c:{},l(C,{name:f,newValue:s(v,x,p)})):typeof p<"u"&&l(C,{name:f,newValue:p}));return C},_t}var Bs=Os();const Ft=Sr(Bs);function ln(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 $s(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(s,...u){const f=e[++o];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?Hs(f,a)(...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 Hs(e,n){let t;return r;function r(...l){const a=e.length>l.length;let s;a&&l.push(i);try{s=e.apply(this,l)}catch(u){const f=u;if(a&&t)throw f;return i(f)}a||(s&&s.then&&typeof s.then=="function"?s.then(o,i):s instanceof Error?i(s):o(s))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}const ve={basename:Us,dirname:Vs,extname:qs,join:Ws,sep:"/"};function Us(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');pt(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function Vs(e){if(pt(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function qs(e){pt(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Ws(...e){let n=-1,t;for(;++n<e.length;)pt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Qs(t)}function Qs(e){pt(e);const n=e.codePointAt(0)===47;let t=Ys(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Ys(e,n){let t="",r=0,i=-1,o=0,l=-1,a,s;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(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,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function pt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Xs={cwd:Gs};function Gs(){return"/"}function on(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ks(e){if(typeof e=="string")e=new URL(e);else if(!on(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 Js(e)}function Js(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 Rt=["history","path","basename","stem","extname","dirname"];class ri{constructor(n){let t;n?on(n)?t={path:n}:typeof n=="string"||Zs(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Xs.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Rt.length;){const o=Rt[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)Rt.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?ve.basename(this.path):void 0}set basename(n){Ot(n,"basename"),Mt(n,"basename"),this.path=ve.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ve.dirname(this.path):void 0}set dirname(n){or(this.basename,"dirname"),this.path=ve.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ve.extname(this.path):void 0}set extname(n){if(Mt(n,"extname"),or(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=ve.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){on(n)&&(n=Ks(n)),Ot(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ve.basename(this.path,this.extname):void 0}set stem(n){Ot(n,"stem"),Mt(n,"stem"),this.path=ve.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 ie(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 Mt(e,n){if(e&&e.includes(ve.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ve.sep+"`")}function Ot(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function or(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function Zs(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eu=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),tu={}.hasOwnProperty;class Sn extends eu{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=$s()}copy(){const n=new Sn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(Ft(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(Ht("data",this.frozen),this.namespace[n]=t,this):tu.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Ht("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=gt(n),r=this.parser||this.Parser;return Bt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),Bt("process",this.parser||this.Parser),$t("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const a=gt(n),s=r.parse(a);r.run(s,a,function(f,c,p){if(f||!c||!p)return u(f);const h=c,x=r.stringify(h,p);iu(x)?p.value=x:p.result=x,u(f,p)});function u(f,c){f||!c?l(f):o?o(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),Bt("processSync",this.parser||this.Parser),$t("processSync",this.compiler||this.Compiler),this.process(n,i),sr("processSync","process",t),r;function i(o,l){t=!0,ir(o),r=l}}run(n,t,r){ar(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const s=gt(t);i.run(n,s,u);function u(f,c,p){const h=c||n;f?a(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),sr("runSync","run",r),i;function o(l,a){ir(l),i=a,r=!0}}stringify(n,t){this.freeze();const r=gt(t),i=this.compiler||this.Compiler;return $t("stringify",i),ar(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(Ht("use",this.frozen),n!=null)if(typeof n=="function")s(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(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");a(u.plugins),u.settings&&(i.settings=Ft(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function 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 C=r[p][1];ln(C)&&ln(h)&&(h=Ft(!0,C,h)),r[p]=[u,h,...x]}}}}const nu=new Sn().freeze();function Bt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function $t(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ht(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 ar(e){if(!ln(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function gt(e){return ru(e)?e:new ri(e)}function ru(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iu(e){return typeof e=="string"||lu(e)}function lu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ou="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ur=[],cr={allowDangerousHtml:!0},au=/^(https?|ircs?|mailto|xmpp)$/i,su=[{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:"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 uu(e){const n=cu(e),t=fu(e);return hu(n.runSync(n.parse(t),t),e)}function cu(e){const n=e.rehypePlugins||ur,t=e.remarkPlugins||ur,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cr}:cr;return nu().use(Va).use(t).use(Ms,r).use(n)}function fu(e){const n=e.children||"",t=new ri;return typeof n=="string"&&(t.value=n),t}function hu(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,l=n.skipHtml,a=n.unwrapDisallowed,s=n.urlTransform||pu;for(const f of su)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+ou+f.id,void 0);return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),wn(e,u),Il(e,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.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 Nt)if(Object.hasOwn(Nt,h)&&Object.hasOwn(f.properties,h)){const x=f.properties[h],C=Nt[h];(C===null||C.includes(f.tagName))&&(f.properties[h]=s(String(x||""),h,f))}}if(f.type==="element"){let h=t?!t.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return a&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function pu(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||au.test(e.slice(0,n))?e:""}function fr(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 mu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function du(e,n,t){const i=It((t||{}).ignore||[]),o=gu(n);let l=-1;for(;++l<o.length;)ni(e,"text",a);function a(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=o[l][0],h=o[l][1];let x=0;const w=c.children.indexOf(u);let y=!1,v=[];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 b=h(...E,F);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?p.lastIndex=D+1:(x!==D&&v.push({type:"text",value:u.value.slice(x,D)}),Array.isArray(b)?v.push(...b):b&&v.push(b),x=D+E[0].length,y=!0),!p.global)break;E=p.exec(u.value)}return y?(x<u.value.length&&v.push({type:"text",value:u.value.slice(x)}),c.children.splice(w,1,...v)):v=[u],w+v.length}}function gu(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([xu(i[0]),yu(i[1])])}return n}function xu(e){return typeof e=="string"?new RegExp(mu(e),"g"):e}function yu(e){return typeof e=="function"?e:function(){return e}}const Ut="phrasing",Vt=["autolink","link","image","label"];function ku(){return{transforms:[Iu],enter:{literalAutolink:wu,literalAutolinkEmail:qt,literalAutolinkHttp:qt,literalAutolinkWww:qt},exit:{literalAutolink:Eu,literalAutolinkEmail:vu,literalAutolinkHttp:Su,literalAutolinkWww:Cu}}}function bu(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ut,notInConstruct:Vt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ut,notInConstruct:Vt},{character:":",before:"[ps]",after:"\\/",inConstruct:Ut,notInConstruct:Vt}]}}function wu(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function qt(e){this.config.enter.autolinkProtocol.call(this,e)}function Su(e){this.config.exit.autolinkProtocol.call(this,e)}function Cu(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 vu(e){this.config.exit.autolinkEmail.call(this,e)}function Eu(e){this.exit(e)}function Iu(e){du(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Au],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Pu]],{ignore:["link","linkReference"]})}function Au(e,n,t,r,i){let o="";if(!ii(i)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!Tu(t)))return!1;const l=zu(t+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function Pu(e,n,t,r){return!ii(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function Tu(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 zu(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=fr(e,"(");let o=fr(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function ii(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Be(t)||Ct(t))&&(!n||t!==47)}li.peek=Ou;function ju(){this.buffer()}function Nu(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Lu(){this.buffer()}function Du(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function _u(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Se(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Fu(e){this.exit(e)}function Ru(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=Se(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Mu(e){this.exit(e)}function Ou(){return"["}function li(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const l=t.enter("footnoteReference"),a=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function Bu(){return{enter:{gfmFootnoteCallString:ju,gfmFootnoteCall:Nu,gfmFootnoteDefinitionLabelString:Lu,gfmFootnoteDefinition:Du},exit:{gfmFootnoteCallString:_u,gfmFootnoteCall:Fu,gfmFootnoteDefinitionLabelString:Ru,gfmFootnoteDefinition:Mu}}}function $u(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:li},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,l){const a=o.createTracker(l);let s=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return s+=a.move(o.safe(o.associationId(r),{before:s,after:"]"})),f(),s+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),s+=a.move((n?`
`:" ")+o.indentLines(o.containerFlow(r,a.current()),n?oi:Hu))),u(),s}}function Hu(e,n,t){return n===0?e:oi(e,n,t)}function oi(e,n,t){return(t?"":" ")+e}const Uu=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ai.peek=Yu;function Vu(){return{canContainEols:["delete"],enter:{strikethrough:Wu},exit:{strikethrough:Qu}}}function qu(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Uu}],handlers:{delete:ai}}}function Wu(e){this.enter({type:"delete",children:[]},e)}function Qu(e){this.exit(e)}function ai(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function Yu(){return"~"}function Xu(e){return e.length}function Gu(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||Xu,o=[],l=[],a=[],s=[];let u=0,f=-1;for(;++f<e.length;){const C=[],w=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const v=Ku(e[f][y]);if(t.alignDelimiters!==!1){const E=i(v);w[y]=E,(s[y]===void 0||E>s[y])&&(s[y]=E)}C.push(v)}l[f]=C,a[f]=w}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=hr(r[c]);else{const C=hr(r);for(;++c<u;)o[c]=C}c=-1;const p=[],h=[];for(;++c<u;){const C=o[c];let w="",y="";C===99?(w=":",y=":"):C===108?w=":":C===114&&(y=":");let v=t.alignDelimiters===!1?1:Math.max(1,s[c]-w.length-y.length);const E=w+"-".repeat(v)+y;t.alignDelimiters!==!1&&(v=w.length+v+y.length,v>s[c]&&(s[c]=v),h[c]=v),p[c]=E}l.splice(1,0,p),a.splice(1,0,h),f=-1;const x=[];for(;++f<l.length;){const C=l[f],w=a[f];c=-1;const y=[];for(;++c<u;){const v=C[c]||"";let E="",D="";if(t.alignDelimiters!==!1){const F=s[c]-(w[c]||0),b=o[c];b===114?E=" ".repeat(F):b===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&&v==="")&&(t.delimiterStart!==!1||c)&&y.push(" "),t.alignDelimiters!==!1&&y.push(E),y.push(v),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 Ku(e){return e==null?"":String(e)}function hr(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 Ju(e,n,t,r){const i=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);const l=t.indentLines(t.containerFlow(e,o.current()),Zu);return i(),l}function Zu(e,n,t){return">"+(t?"":" ")+e}function ec(e,n){return pr(e,n.inConstruct,!0)&&!pr(e,n.notInConstruct,!1)}function pr(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 mr(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
`&&ec(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function tc(e,n){const t=String(e);let r=t.indexOf(n),i=r,o=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+n.length,r=t.indexOf(n,i);return l}function nc(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 rc(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 ic(e,n,t,r){const i=rc(t),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(nc(e,t)){const c=t.enter("codeIndented"),p=t.indentLines(o,lc);return c(),p}const a=t.createTracker(r),s=i.repeat(Math.max(tc(o,i)+1,3)),u=t.enter("codeFenced");let f=a.move(s);if(e.lang){const c=t.enter(`codeFencedLang${l}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
`,encode:["`"],...a.current()})),c()}return f+=a.move(`
`),o&&(f+=a.move(o+`
`)),f+=a.move(s),u(),f}function lc(e,n,t){return(t?"":" ")+e}function Cn(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 oc(e,n,t,r){const i=Cn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("definition");let a=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("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":`
`,...s.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),l(),u}function ac(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function ct(e){return"&#x"+e.toString(16).toUpperCase()+";"}function St(e,n,t){const r=Ke(e),i=Ke(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}}si.peek=sc;function si(e,n,t,r){const i=ac(t),o=t.enter("emphasis"),l=t.createTracker(r),a=l.move(i);let s=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=St(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=ct(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=St(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+ct(c));const h=l.move(i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+s+h}function sc(e,n,t){return t.options.emphasis||"*"}function uc(e,n){let t=!1;return wn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,nn}),!!((!e.depth||e.depth<3)&&mn(e)&&(n.options.setext||t))}function cc(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(uc(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),p=t.containerPhrasing(e,{...o.current(),before:`
`,after:`
`});return c(),f(),p+`
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
`))+1))}const l="#".repeat(i),a=t.enter("headingAtx"),s=t.enter("phrasing");o.move(l+" ");let u=t.containerPhrasing(e,{before:"# ",after:`
`,...o.current()});return/^[\t ]/.test(u)&&(u=ct(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,t.options.closeAtx&&(u+=" "+l),s(),a(),u}ui.peek=fc;function ui(e){return e.value||""}function fc(){return"<"}ci.peek=hc;function ci(e,n,t,r){const i=Cn(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let a=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("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),u+=s.move(")"),l(),u}function hc(){return"!"}fi.peek=pc;function fi(e,n,t,r){const i=e.referenceType,o=t.enter("imageReference");let l=t.enter("label");const a=t.createTracker(r);let s=a.move("![");const u=t.safe(e.alt,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function pc(){return"!"}hi.peek=mc;function hi(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const l=t.unsafe[o],a=t.compilePattern(l);let s;if(l.atBreak)for(;s=a.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 mc(){return"`"}function pi(e,n){const t=mn(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))}mi.peek=dc;function mi(e,n,t,r){const i=Cn(t),o=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let a,s;if(pi(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let c=l.move("<");return c+=l.move(t.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),t.stack=f,c}a=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${o}`),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(")"),a(),u}function dc(e,n,t){return pi(e,t)?"<":"["}di.peek=gc;function di(e,n,t,r){const i=e.referenceType,o=t.enter("linkReference");let l=t.enter("label");const a=t.createTracker(r);let s=a.move("[");const u=t.containerPhrasing(e,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function gc(){return"["}function vn(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 xc(e){const n=vn(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 yc(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 gi(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 kc(e,n,t,r){const i=t.enter("list"),o=t.bulletCurrent;let l=e.ordered?yc(t):vn(t);const a=e.ordered?l==="."?")":".":xc(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),gi(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=a),t.bulletCurrent=l;const u=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=o,i(),u}function bc(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 wc(e,n,t,r){const i=bc(t);let o=t.bulletCurrent||vn(t);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=t.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const s=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,a.current()),f);return s(),u;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?o:o+" ".repeat(l-o.length))+c}}function Sc(e,n,t,r){const i=t.enter("paragraph"),o=t.enter("phrasing"),l=t.containerPhrasing(e,r);return o(),i(),l}const Cc=It(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vc(e,n,t,r){return(e.children.some(function(l){return Cc(l)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Ec(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}xi.peek=Ic;function xi(e,n,t,r){const i=Ec(t),o=t.enter("strong"),l=t.createTracker(r),a=l.move(i+i);let s=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=St(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=ct(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=St(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+ct(c));const h=l.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+s+h}function Ic(e,n,t){return t.options.strong||"*"}function Ac(e,n,t,r){return t.safe(e.value,r)}function Pc(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 Tc(e,n,t){const r=(gi(t)+(t.options.ruleSpaces?" ":"")).repeat(Pc(t));return t.options.ruleSpaces?r.slice(0,-1):r}const yi={blockquote:Ju,break:mr,code:ic,definition:oc,emphasis:si,hardBreak:mr,heading:cc,html:ui,image:ci,imageReference:fi,inlineCode:hi,link:mi,linkReference:di,list:kc,listItem:wc,paragraph:Sc,root:vc,strong:xi,text:Ac,thematicBreak:Tc};function zc(){return{enter:{table:jc,tableData:dr,tableHeader:dr,tableRow:Lc},exit:{codeText:Dc,table:Nc,tableData:Wt,tableHeader:Wt,tableRow:Wt}}}function jc(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 Nc(e){this.exit(e),this.data.inTable=void 0}function Lc(e){this.enter({type:"tableRow",children:[]},e)}function Wt(e){this.exit(e)}function dr(e){this.enter({type:"tableCell",children:[]},e)}function Dc(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,_c));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function _c(e,n){return n==="|"?n:e}function Fc(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,o=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:a}};function l(h,x,C,w){return u(f(h,C,w),h.align)}function a(h,x,C,w){const y=c(h,C,w),v=u([y]);return v.slice(0,v.indexOf(`
`))}function s(h,x,C,w){const y=C.enter("tableCell"),v=C.enter("phrasing"),E=C.containerPhrasing(h,{...w,before:o,after:o});return v(),y(),E}function u(h,x){return Gu(h,{align:x,alignDelimiters:r,padding:t,stringLength:i})}function f(h,x,C){const w=h.children;let y=-1;const v=[],E=x.enter("table");for(;++y<w.length;)v[y]=c(w[y],x,C);return E(),v}function c(h,x,C){const w=h.children;let y=-1;const v=[],E=x.enter("tableRow");for(;++y<w.length;)v[y]=s(w[y],h,x,C);return E(),v}function p(h,x,C){let w=yi.inlineCode(h,x,C);return C.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function Rc(){return{exit:{taskListCheckValueChecked:gr,taskListCheckValueUnchecked:gr,paragraph:Oc}}}function Mc(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Bc}}}function gr(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function Oc(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;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 Bc(e,n,t,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);o&&a.move(l);let s=yi.listItem(e,n,t,{...r,...a.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(f){return f+l}}function $c(){return[ku(),Bu(),Vu(),zc(),Rc()]}function Hc(e){return{extensions:[bu(),$u(e),qu(),Fc(e),Mc()]}}const Uc={tokenize:Xc,partial:!0},ki={tokenize:Gc,partial:!0},bi={tokenize:Kc,partial:!0},wi={tokenize:Jc,partial:!0},Vc={tokenize:Zc,partial:!0},Si={name:"wwwAutolink",tokenize:Qc,previous:vi},Ci={name:"protocolAutolink",tokenize:Yc,previous:Ei},Te={name:"emailAutolink",tokenize:Wc,previous:Ii},Ee={};function qc(){return{text:Ee}}let Oe=48;for(;Oe<123;)Ee[Oe]=Te,Oe++,Oe===58?Oe=65:Oe===91&&(Oe=97);Ee[43]=Te;Ee[45]=Te;Ee[46]=Te;Ee[95]=Te;Ee[72]=[Te,Ci];Ee[104]=[Te,Ci];Ee[87]=[Te,Si];Ee[119]=[Te,Si];function Wc(e,n,t){const r=this;let i,o;return l;function l(c){return!an(c)||!Ii.call(r,r.previous)||En(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return an(c)?(e.consume(c),a):c===64?(e.consume(c),s):t(c)}function s(c){return c===46?e.check(Vc,f,u)(c):c===45||c===95||re(c)?(o=!0,e.consume(c),s):f(c)}function u(c){return e.consume(c),i=!0,s}function f(c){return o&&i&&ae(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function Qc(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!vi.call(r,r.previous)||En(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Uc,e.attempt(ki,e.attempt(bi,o),t),t)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function Yc(e,n,t){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&Ei.call(r,r.previous)&&!En(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(ae(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;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),o?u:(o=!0,s)):t(c)}function u(c){return c===null||kt(c)||G(c)||Be(c)||Ct(c)?t(c):e.attempt(ki,e.attempt(bi,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function Xc(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):t(l)}function o(l){return l===null?t(l):n(l)}}function Gc(e,n,t){let r,i,o;return l;function l(u){return u===46||u===95?e.check(wi,s,a)(u):u===null||G(u)||Be(u)||u!==45&&Ct(u)?s(u):(o=!0,e.consume(u),l)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function s(u){return i||r||!o?t(u):n(u)}}function Kc(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(wi,n,o)(l):l===null||G(l)||Be(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function Jc(e,n,t){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||G(a)||Be(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||G(a)||Be(a)?n(a):r(a)}function o(a){return ae(a)?l(a):t(a)}function l(a){return a===59?(e.consume(a),r):ae(a)?(e.consume(a),l):t(a)}}function Zc(e,n,t){return r;function r(o){return e.consume(o),i}function i(o){return re(o)?t(o):n(o)}}function vi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function Ei(e){return!ae(e)}function Ii(e){return!(e===47||an(e))}function an(e){return e===43||e===45||e===46||e===95||re(e)}function En(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 ef={tokenize:uf,partial:!0};function tf(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:of,continuation:{tokenize:af},exit:sf}},text:{91:{name:"gfmFootnoteCall",tokenize:lf},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:nf,resolveTo:rf}}}}function nf(e,n,t){const r=this;let i=r.events.length;const o=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 a;function a(s){if(!l||!l._balanced)return t(s);const u=Se(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",l,n],["exit",l,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function lf(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(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(o>999||c===93&&!l||c===null||c===91||G(c))return t(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(Se(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return G(c)||(l=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function of(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;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&&!a||x===null||x===91||G(x))return t(x);if(x===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return o=Se(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return G(x)||(a=!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(o)||i.push(o),V(e,h,"gfmFootnoteDefinitionWhitespace")):t(x)}function h(x){return n(x)}}function af(e,n,t){return e.check(ht,n,e.attempt(ef,n,t))}function sf(e){e.exit("gfmFootnoteDefinition")}function uf(e,n,t){const r=this;return V(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(o):t(o)}}function cf(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){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,a],["enter",l[u][1],a],["exit",l[u][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&de(p,p.length,0,vt(h,l.slice(u+1,s),a)),de(p,p.length,0,[["exit",c,a],["enter",l[s][1],a],["exit",l[s][1],a],["exit",f,a]]),de(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 o(l,a,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 C=Ke(u);if(x===126)return c>1?s(x):(l.consume(x),c++,h);if(c<2&&!t)return s(x);const w=l.exit("strikethroughSequenceTemporary"),y=Ke(x);return w._open=!y||y===2&&!!C,w._close=!C||C===2&&!!y,a(x)}}}class ff{constructor(){this.map=[]}add(n,t,r){hf(this,n,t,r)}consume(n){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.pop()}this.map.length=0}}function hf(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 pf(e,n){let t=!1;const r=[];for(;n<e.length;){const i=e[n];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function mf(){return{flow:{null:{name:"table",tokenize:df,resolveAll:gf}}}}function df(e,n,t){const r=this;let i=0,o=0,l;return a;function a(k){let T=r.events.length-1;for(;T>-1;){const j=r.events[T][1].type;if(j==="lineEnding"||j==="linePrefix")T--;else break}const z=T>-1?r.events[T][1].type:null,q=z==="tableHead"||z==="tableRow"?b:s;return q===b&&r.parser.lazy[r.now().line]?t(k):q(k)}function s(k){return e.enter("tableHead"),e.enter("tableRow"),u(k)}function u(k){return k===124||(l=!0,o+=1),f(k)}function f(k){return k===null?t(k):L(k)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),h):t(k):O(k)?V(e,f,"whitespace")(k):(o+=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||G(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,O(k)?V(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):x(k))}function x(k){return k===45||k===58?w(k):k===124?(l=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),C):F(k)}function C(k){return O(k)?V(e,w,"whitespace")(k):w(k)}function w(k){return k===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(o+=1,y(k)):k===null||L(k)?D(k):F(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),v(k)):F(k)}function v(k){return k===45?(e.consume(k),v):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 O(k)?V(e,D,"whitespace")(k):D(k)}function D(k){return k===124?x(k):k===null||L(k)?!l||i!==o?F(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(k)):F(k)}function F(k){return t(k)}function b(k){return e.enter("tableRow"),_(k)}function _(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),_):k===null||L(k)?(e.exit("tableRow"),n(k)):O(k)?V(e,_,"whitespace")(k):(e.enter("data"),U(k))}function U(k){return k===null||k===124||G(k)?(e.exit("data"),_(k)):(e.consume(k),k===92?B:U)}function B(k){return k===92||k===124?(e.consume(k),U):U(k)}}function gf(e,n){let t=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,s=0,u,f,c;const p=new ff;for(;++t<e.length;){const h=e[t],x=h[1];h[0]==="enter"?x.type==="tableHead"?(a=!1,s!==0&&(xr(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,o=[0,0,0,0],l=[0,t+1,0,0],a&&(a=!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&&(o[1]!==0&&(l[0]=l[1],c=xt(p,n,o,i,void 0,c),o=[0,0,0,0]),l[2]=t)):x.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=xt(p,n,o,i,void 0,c)),o=l,l=[o[1],t,0,0])):x.type==="tableHead"?(a=!0,s=t):x.type==="tableRow"||x.type==="tableDelimiterRow"?(s=t,o[1]!==0?(l[0]=l[1],c=xt(p,n,o,i,t,c)):l[1]!==0&&(c=xt(p,n,l,i,t,c)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=t)}for(s!==0&&xr(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=pf(n.events,t))}return e}function xt(e,n,t,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(o.end=Object.assign({},Qe(n.events,t[0])),e.add(t[0],0,[["exit",o,n]]));const s=Qe(n.events,t[1]);if(o={type:l,start:Object.assign({},s),end:Object.assign({},s)},e.add(t[1],0,[["enter",o,n]]),t[2]!==0){const u=Qe(n.events,t[2]),f=Qe(n.events,t[3]),c={type:a,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,C=t[3]-t[2]-1;e.add(x,C,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(o.end=Object.assign({},Qe(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function xr(e,n,t,r,i){const o=[],l=Qe(n.events,t);i&&(i.end=Object.assign({},l),o.push(["exit",i,n])),r.end=Object.assign({},l),o.push(["exit",r,n]),e.add(t+1,0,o)}function Qe(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const xf={name:"tasklistCheck",tokenize:kf};function yf(){return{text:{91:xf}}}function kf(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"),o)}function o(s){return G(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"),a):t(s)}function a(s){return L(s)?n(s):O(s)?e.check({tokenize:bf},n,t)(s):t(s)}}function bf(e,n,t){return V(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function wf(e){return Rr([qc(),tf(),cf(e),mf(),yf()])}const Sf={};function Cf(e){const n=this,t=e||Sf,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(wf(t)),o.push($c()),l.push(Hc(t))}const vf=({content:e})=>g.jsx(uu,{className:"prose prose-sm sm:prose lg:prose-lg xl:prose-xl max-w-none",remarkPlugins:[Cf],components:{h1:({node:n,...t})=>g.jsx("h1",{className:"text-3xl font-bold mt-6 mb-4 pb-2 border-b-2 border-primary/20 text-default-900 first:mt-0",...t}),h2:({node:n,...t})=>g.jsx("h2",{className:"text-2xl font-bold mt-6 mb-3 pb-2 border-b border-default-200 text-default-800",...t}),h3:({node:n,...t})=>g.jsx("h3",{className:"text-xl font-semibold mt-5 mb-2 text-default-800",...t}),h4:({node:n,...t})=>g.jsx("h4",{className:"text-lg font-semibold mt-4 mb-2 text-default-700",...t}),h5:({node:n,...t})=>g.jsx("h5",{className:"text-base font-semibold mt-3 mb-2 text-default-700",...t}),h6:({node:n,...t})=>g.jsx("h6",{className:"text-sm font-semibold mt-3 mb-2 text-default-600",...t}),p:({node:n,...t})=>g.jsx("p",{className:"my-3 leading-7 text-default-700 first:mt-0 last:mb-0",...t}),a:({node:n,...t})=>g.jsx("a",{className:"text-primary font-medium hover:text-primary-600 underline decoration-primary/30 hover:decoration-primary transition-colors",target:"_blank",rel:"noopener noreferrer",...t}),ul:({node:n,...t})=>g.jsx("ul",{className:"my-3 ml-6 space-y-2 list-disc marker:text-primary",...t}),ol:({node:n,...t})=>g.jsx("ol",{className:"my-3 ml-6 space-y-2 list-decimal marker:text-primary marker:font-semibold",...t}),li:({node:n,...t})=>g.jsx("li",{className:"leading-7 text-default-700 pl-2",...t}),blockquote:({node:n,...t})=>g.jsx("blockquote",{className:"my-4 pl-4 pr-4 py-2 border-l-4 border-primary/50 bg-primary/5 rounded-r-lg italic text-default-600",...t}),pre:({node:n,...t})=>g.jsx("pre",{className:"my-4 p-4 bg-default-100 dark:bg-default-50 rounded-xl overflow-x-auto text-sm border border-default-200 shadow-sm",...t}),code:({node:n,inline:t,...r})=>t?g.jsx("code",{className:"px-1.5 py-0.5 mx-0.5 bg-primary/10 text-primary-700 dark:text-primary-600 rounded text-sm font-mono border border-primary/20",...r}):g.jsx("code",{className:"text-sm font-mono text-default-800",...r}),img:({node:n,...t})=>g.jsx("img",{className:"max-w-full h-auto rounded-lg my-4 shadow-md hover:shadow-xl transition-shadow border border-default-200",...t}),hr:({node:n,...t})=>g.jsx("hr",{className:"my-8 border-0 h-px bg-gradient-to-r from-transparent via-default-300 to-transparent",...t}),table:({node:n,...t})=>g.jsx("div",{className:"my-4 overflow-x-auto rounded-lg border border-default-200 shadow-sm",children:g.jsx("table",{className:"min-w-full divide-y divide-default-200",...t})}),thead:({node:n,...t})=>g.jsx("thead",{className:"bg-default-100",...t}),tbody:({node:n,...t})=>g.jsx("tbody",{className:"divide-y divide-default-200 bg-white dark:bg-default-50",...t}),tr:({node:n,...t})=>g.jsx("tr",{className:"hover:bg-default-50 transition-colors",...t}),th:({node:n,...t})=>g.jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold text-default-700 uppercase tracking-wider",...t}),td:({node:n,...t})=>g.jsx("td",{className:"px-4 py-3 text-sm text-default-700",...t}),strong:({node:n,...t})=>g.jsx("strong",{className:"font-bold text-default-900",...t}),em:({node:n,...t})=>g.jsx("em",{className:"italic text-default-700",...t}),del:({node:n,...t})=>g.jsx("del",{className:"line-through text-default-500",...t})},children:e});function Ef(e,n){if(n)try{const t=new URL(n);if(t.hostname==="github.com"||t.hostname==="www.github.com"){const r=t.pathname.split("/").filter(Boolean);if(r.length>=1)return`https://github.com/${r[0]}.png`}}catch{}if(e)try{const t=new URL(e);if(t.hostname==="github.com"||t.hostname==="www.github.com"){const r=t.pathname.split("/").filter(Boolean);if(r.length>=1)return`https://github.com/${r[0]}.png`}else return`https://api.iowen.cn/favicon/${t.hostname}.png`}catch{}}function If(e){if(!e)return null;try{const n=new URL(e);if(n.hostname==="github.com"||n.hostname==="www.github.com"){const t=n.pathname.split("/").filter(Boolean);if(t.length>=2)return{owner:t[0],repo:t[1]}}}catch{}return null}async function Af(e,n){const t=await fetch(`https://api.github.com/repos/${e}/${n}/readme`,{headers:{Accept:"application/vnd.github.v3.raw"}});if(!t.ok)throw new Error("Failed to fetch README");return t.text()}function Pf(e){let n=e.replace(/<!--[\s\S]*?-->/g,"");return n=n.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),n=n.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,""),n=n.replace(/<img[^>]*\\bsrc=["']([^"']+)["'][^>]*\\balt=["']([^"']+)["'][^>]*>/gi,"![$2]($1)"),n=n.replace(/<img[^>]*\\balt=["']([^"']+)["'][^>]*\\bsrc=["']([^"']+)["'][^>]*>/gi,"![$1]($2)"),n=n.replace(/<img[^>]+src=["']([^"']+)["'][^>]*>/gi,"![]($1)"),n=n.replace(/<\/?[^>]+(>|$)/g,""),n=n.replace(/\n{3,}/g,`
`),n.trim()}function Tf({isOpen:e,onClose:n,plugin:t,installStatus:r="not-installed",installedVersion:i,onInstall:o}){const[l,a]=Q.useState(""),[s,u]=Q.useState(!1),[f,c]=Q.useState(!1),p=t?If(t.homepage):null;if(Q.useEffect(()=>{if(!e||!p){a(""),c(!1);return}(async()=>{u(!0),c(!1);try{const _=await Af(p.owner,p.repo);a(Pf(_))}catch(_){console.error("Failed to fetch README:",_),c(!0)}finally{u(!1)}})()},[e,p==null?void 0:p.owner,p==null?void 0:p.repo]),!t)return null;const{name:h,version:x,author:C,description:w,tags:y,homepage:v,downloadUrl:E,minVersion:D}=t,F=Ef(v,E)||`https://avatar.vercel.sh/${encodeURIComponent(h)}`;return g.jsx(zi,{isOpen:e,onClose:n,size:"4xl",scrollBehavior:"inside",classNames:{backdrop:"z-[200]",wrapper:"z-[200]"},children:g.jsx(ji,{className:"rounded-3xl border border-white/70 dark:border-white/10 bg-white/92 dark:bg-zinc-900/92 backdrop-blur-2xl shadow-2xl shadow-primary-900/15",children:b=>g.jsxs(g.Fragment,{children:[g.jsx(Ni,{className:"flex flex-col gap-3 pb-2",children:g.jsxs("div",{className:"flex items-start gap-4",children:[g.jsx(br,{src:F,name:C||"?",size:"lg",isBordered:!0,color:"primary",radius:"lg",className:"flex-shrink-0"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("h2",{className:"text-2xl font-bold text-default-900",children:h}),v&&g.jsx(Xe,{content:"访问项目主页",children:g.jsx(ge,{isIconOnly:!0,size:"sm",variant:"flat",color:"primary",as:"a",href:v,target:"_blank",rel:"noreferrer",children:g.jsx(In,{size:18})})})]}),g.jsxs("p",{className:"text-sm text-default-500 mt-1",children:["by ",g.jsx("span",{className:"font-medium",children:C||"未知作者"})]}),g.jsxs("div",{className:"flex items-center gap-2 mt-2 flex-wrap",children:[g.jsxs(De,{size:"sm",color:"primary",variant:"flat",children:["v",x]}),y==null?void 0:y.map(_=>g.jsx(De,{size:"sm",variant:"flat",className:"bg-default-100 text-default-600",children:_},_)),r==="update-available"&&i&&g.jsx(De,{size:"sm",color:"warning",variant:"shadow",className:"animate-pulse",children:"可更新"}),r==="installed"&&g.jsx(De,{size:"sm",color:"success",variant:"flat",startContent:g.jsx(Yt,{size:14}),children:"已安装"})]})]})]})}),g.jsxs(Li,{className:"gap-4",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-sm font-semibold text-default-700 mb-2",children:"插件描述"}),g.jsx("p",{className:"text-sm text-default-600 leading-relaxed",children:w||"暂无描述"})]}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-sm font-semibold text-default-700 mb-3",children:"插件信息"}),g.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm",children:[g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"最新版本:"}),g.jsxs("span",{className:"font-medium text-default-900",children:["v",x]})]}),i&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"已安装版本:"}),g.jsxs("span",{className:"font-medium text-default-900",children:["v",i]})]}),D&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"最低要求版本:"}),g.jsxs("span",{className:"font-medium text-default-900",children:["v",D]})]}),g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"插件 ID:"}),g.jsx("span",{className:"font-mono text-xs text-default-900",children:t.id})]}),E&&g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsx("span",{className:"text-default-500",children:"下载地址:"}),g.jsx(ge,{size:"sm",variant:"flat",color:"primary",as:"a",href:E,target:"_blank",rel:"noreferrer",startContent:g.jsx(An,{size:14}),children:"下载插件"})]})]})]}),p&&g.jsx(g.Fragment,{children:g.jsxs("div",{className:"mt-2",children:[g.jsx("h3",{className:"text-sm font-semibold text-default-700 mb-3",children:"详情"}),s&&g.jsx("div",{className:"flex justify-center items-center py-12",children:g.jsx(kr,{size:"lg"})}),f&&g.jsxs("div",{className:"text-center py-8",children:[g.jsx("p",{className:"text-sm text-default-500 mb-3",children:"无法加载 README"}),g.jsx(ge,{color:"primary",variant:"flat",as:"a",href:v,target:"_blank",rel:"noreferrer",startContent:g.jsx(In,{}),children:"在 GitHub 查看"})]}),!s&&!f&&l&&g.jsx("div",{className:"rounded-lg border border-default-200 p-4 bg-default-50",children:g.jsx(vf,{content:l})})]})})]}),g.jsxs(Di,{children:[g.jsx(ge,{variant:"light",onPress:b,children:"关闭"}),r==="installed"?g.jsx(ge,{color:"success",variant:"flat",startContent:g.jsx(Yt,{size:18}),isDisabled:!0,children:"已安装"}):r==="update-available"?g.jsxs(ge,{color:"warning",variant:"shadow",startContent:g.jsx(wr,{size:18}),onPress:()=>{o==null||o(),b()},children:["更新到 v",x]}):g.jsx(ge,{color:"primary",variant:"shadow",startContent:g.jsx(An,{size:18}),onPress:()=>{o==null||o(),b()},children:"立即安装"})]})]})})})}function zf(e){const n=[...e];for(let t=n.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1));[n[t],n[r]]=[n[r],n[t]]}return n}const jf=({isEmpty:e})=>e?g.jsx(Qi,{compact:!0,icon:g.jsx(Xt,{size:20}),title:"暂时没有可用的插件",description:"换个分类看看,或者检查右上角的商店列表源是否可访问。"}):null;function mh(){const[e,n]=Q.useState([]),[t,r]=Q.useState([]),[i,o]=Q.useState(!1),[l,a]=Q.useState(""),[s,u]=Q.useState("all"),[f,c]=Q.useState(!1),p=Yi(),h=Q.useRef(null),[x,C]=Xi();Q.useEffect(()=>{const N=Y=>{var $;(Y.ctrlKey||Y.metaKey)&&Y.key==="f"&&(Y.preventDefault(),($=h.current)==null||$.focus())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[]);const[w,y]=Q.useState({show:!1,message:"",progress:0}),[v,E]=Q.useState(!1),[D,F]=Q.useState(void 0),[b,_]=Q.useState(!1),[U,B]=Q.useState(null),[k,T]=Q.useState(void 0),[z,q]=Q.useState(!1),[j,P]=Q.useState(null),W=20,[ee,le]=Q.useState(1),fe=async(N=!1)=>{o(!0);try{const Y=await Tt.getPluginStoreList(N);n(Y.plugins);const $=await Tt.getPluginList();c($.pluginManagerNotFound),r($.plugins||[])}catch(Y){Ce.error(Y.message)}finally{o(!1)}};Q.useEffect(()=>{fe()},[D]),Q.useEffect(()=>{const N=x.get("pluginId");if(N&&e.length>0&&!z){const Y=e.find($=>$.id===N);Y&&(P(Y),q(!0))}},[e,x,z]);const m=Q.useMemo(()=>{let N=e;return l&&(N=N.filter($=>{var J;return $.name.toLowerCase().includes(l.toLowerCase())||$.description.toLowerCase().includes(l.toLowerCase())||$.author.toLowerCase().includes(l.toLowerCase())||((J=$.tags)==null?void 0:J.some(be=>be.toLowerCase().includes(l.toLowerCase())))})),{all:N,official:N.filter($=>{var J;return(J=$.tags)==null?void 0:J.includes("官方")}),tools:N.filter($=>{var J;return(J=$.tags)==null?void 0:J.includes("工具")}),entertainment:N.filter($=>{var J;return(J=$.tags)==null?void 0:J.includes("娱乐")}),other:N.filter($=>{var J;return!((J=$.tags)!=null&&J.some(be=>["官方","工具","娱乐"].includes(be)))}),random:zf(N)}},[e,l]),oe=N=>{const Y=t.find($=>$.id===N.id||$.name===N.name);return Y?Y.version!==N.version?{status:"update-available",installedVersion:Y.version}:{status:"installed",installedVersion:Y.version}:{status:"not-installed"}},ye=Q.useMemo(()=>{var N,Y,$,J,be,Re;return[{key:"all",title:"全部",count:((N=m.all)==null?void 0:N.length)||0},{key:"official",title:"官方",count:((Y=m.official)==null?void 0:Y.length)||0},{key:"tools",title:"工具",count:(($=m.tools)==null?void 0:$.length)||0},{key:"entertainment",title:"娱乐",count:((J=m.entertainment)==null?void 0:J.length)||0},{key:"other",title:"其它",count:((be=m.other)==null?void 0:be.length)||0},{key:"random",title:"随机",count:((Re=m.random)==null?void 0:Re.length)||0}]},[m]),d=Q.useMemo(()=>m[s]||[],[m,s]),se=Q.useMemo(()=>Math.max(1,Math.ceil(d.length/W)),[d.length]),Ie=Q.useMemo(()=>{const N=(ee-1)*W;return d.slice(N,N+W)},[d,ee]),ne=Q.useCallback(N=>{u(N),le(1)},[]),Fe=Q.useCallback(N=>{a(N),le(1)},[]),ke=async N=>{B(N),_(!0)},ze=async(N,Y)=>{const $=Ce.loading("正在准备安装...");try{const J=localStorage.getItem(Qt.token);if(!J){Ce.error("未登录,请先登录",{id:$});return}const be=JSON.parse(J),Re=new URLSearchParams({id:N});Y&&Re.append("mirror",Y);const Ne=new _i.EventSourcePolyfill(`/api/Plugin/Store/Install/SSE?${Re.toString()}`,{headers:{Authorization:`Bearer ${be}`,Accept:"text/event-stream"},withCredentials:!0});Ne.onmessage=Ue=>{try{const Z=JSON.parse(Ue.data);Z.error?(Ce.error(`安装失败: ${Z.error}`,{id:$}),y(he=>({...he,show:!1})),Ne.close()):Z.success?(Ce.success("插件安装成功!",{id:$}),y(he=>({...he,show:!1})),Ne.close(),fe(),f&&p.confirm({title:"插件管理器未加载",content:g.jsxs("div",{className:"space-y-2",children:[g.jsx("p",{className:"text-sm text-default-600",children:"插件已安装成功,但插件管理器尚未加载。"}),g.jsx("p",{className:"text-sm text-default-600",children:"是否立即注册插件管理器?注册后插件才能正常运行。"})]}),confirmText:"注册插件管理器",cancelText:"稍后再说",onConfirm:()=>{(async()=>{try{await Tt.registerPluginManager(),Ce.success("插件管理器注册成功"),c(!1)}catch(he){Ce.error("注册失败: "+he.message)}})()}})):Z.message&&(typeof Z.progress=="number"&&Z.progress>=0&&Z.progress<=100?y(he=>({...he,show:!0,message:Z.message,progress:Z.progress,speedStr:Z.speedStr||(Z.message.includes("下载")?he.speedStr:void 0),eta:Z.eta!==void 0?Z.eta:Z.message.includes("下载")?he.eta:void 0,downloadedStr:Z.downloadedStr||(Z.message.includes("下载")?he.downloadedStr:void 0),totalStr:Z.totalStr||(Z.message.includes("下载")?he.totalStr:void 0)})):Ce.loading(Z.message,{id:$}))}catch(Z){console.error("Failed to parse SSE message:",Z)}},Ne.onerror=Ue=>{console.error("SSE连接出错:",Ue),Ce.error("连接中断,安装失败",{id:$}),y(Z=>({...Z,show:!1})),Ne.close()}}catch(J){Ce.error(`安装失败: ${J.message||"未知错误"}`,{id:$})}},je=()=>{if(!D)return"默认源";try{return new URL(D).hostname}catch{return D}},[He]=yr(Qt.backgroundImage,""),Pt=!!He;return g.jsxs(g.Fragment,{children:[g.jsx("title",{children:"插件商店 - SnowCat WebUI"}),g.jsxs("div",{className:"sc-page",children:[g.jsxs("div",{className:Ye("sticky top-14 z-10 backdrop-blur-xl py-3 px-3 md:px-6 rounded-2xl mb-4 -mx-3 md:-mx-6 -mt-4 md:-mt-6 transition-colors",Pt?"bg-black/25":"bg-transparent"),children:[g.jsxs("div",{className:"flex flex-col md:flex-row mb-3 items-start md:items-center justify-between gap-3",children:[g.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[g.jsx("div",{className:"w-10 h-10 sc-accent-tile",children:g.jsx(Xt,{size:20})}),g.jsxs("div",{className:"min-w-0",children:[g.jsx("h1",{className:"sc-title truncate",children:"插件商店"}),g.jsx("p",{className:"sc-subtitle truncate",children:"社区插件一键发现与安装"})]}),g.jsx(Xe,{content:"刷新列表",children:g.jsx(ge,{isIconOnly:!0,size:"sm",variant:"flat",className:"bg-white/60 dark:bg-white/10 text-default-600 dark:text-default-300 backdrop-blur-md hover:bg-white/80 dark:hover:bg-white/20",radius:"full",onPress:()=>fe(!0),isLoading:i,children:g.jsx(Bi,{size:18})})})]}),g.jsxs("div",{className:"flex items-center gap-3 w-full md:w-auto flex-1 justify-end",children:[g.jsx(Fi,{ref:h,placeholder:"搜索(Ctrl+F)...",startContent:g.jsx($i,{className:"text-default-400"}),value:l,onValueChange:Fe,className:"max-w-xs w-full",size:"sm",isClearable:!0,classNames:{inputWrapper:"bg-default-100/50 dark:bg-black/20 backdrop-blur-md border-white/20 dark:border-white/10"}}),g.jsxs("div",{className:"hidden sm:flex items-center gap-2 bg-default-100/50 backdrop-blur-md px-3 py-1.5 rounded-full border border-white/20 dark:border-white/10",children:[g.jsxs("span",{className:"text-xs text-default-500 whitespace-nowrap",children:["源: ",je()]}),g.jsx(Xe,{content:"切换列表源",children:g.jsx(ge,{isIconOnly:!0,size:"sm",variant:"light",className:"min-w-unit-6 w-6 h-6",onPress:()=>E(!0),children:g.jsx(Hi,{size:14})})})]})]})]}),g.jsx(Ri,{"aria-label":"Plugin Store Categories",className:"max-w-full",selectedKey:s,onSelectionChange:N=>ne(String(N)),classNames:{tabList:"sc-tablist",cursor:"sc-tab-cursor",panel:"hidden"},children:ye.map(N=>g.jsx(Mi,{title:`${N.title} (${N.count})`},N.key))})]}),g.jsxs("div",{className:"relative",children:[i&&g.jsx("div",{className:"absolute inset-0 bg-zinc-500/10 z-30 flex justify-center items-center backdrop-blur-sm rounded-lg",children:g.jsx(kr,{size:"lg"})}),g.jsx(jf,{isEmpty:!d.length}),g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 justify-start items-stretch gap-4",children:Ie.map(N=>{const Y=oe(N);return g.jsx(Ki,{data:N,installStatus:Y.status,installedVersion:Y.installedVersion,onInstall:()=>{ke(N)},onViewDetail:()=>{P(N),q(!0)}},N.id)})}),se>1&&g.jsx("div",{className:"flex justify-center mt-6 mb-2",children:g.jsx(Oi,{total:se,page:ee,onChange:le,showControls:!0,showShadow:!0,color:"primary",size:"lg",classNames:{wrapper:"backdrop-blur-md bg-white/50 dark:bg-white/[0.05] border border-white/60 dark:border-white/10"}})})]})]}),g.jsx(Pn,{isOpen:v,onClose:()=>E(!1),onSelect:N=>{F(N)},currentMirror:D,type:"raw"}),g.jsx(Pn,{isOpen:b,onClose:()=>{_(!1),B(null)},onSelect:N=>{T(N),U&&(_(!1),ze(U.id,N),B(null))},currentMirror:k,type:"file"}),g.jsx(Tf,{isOpen:z,onClose:()=>{q(!1),P(null),x.has("pluginId")&&(x.delete("pluginId"),C(x))},plugin:j,installStatus:j?oe(j).status:"not-installed",installedVersion:j?oe(j).installedVersion:void 0,onInstall:()=>{j&&ke(j)}}),w.show&&g.jsxs("div",{className:"fixed inset-0 flex items-center justify-center z-[9999] animate-in fade-in duration-300",children:[g.jsx("div",{className:"absolute inset-0 bg-black/20 dark:bg-black/40 backdrop-blur-md"}),g.jsxs("div",{className:Ye("relative w-[90%] max-w-md bg-white/90 dark:bg-zinc-900/90 backdrop-blur-2xl shadow-2xl shadow-primary-900/20 rounded-3xl border border-white/70 dark:border-white/10 p-7","flex flex-col gap-5 animate-in zoom-in-95 duration-300"),children:[g.jsxs("div",{className:"flex items-start gap-3",children:[g.jsx("div",{className:"w-10 h-10 sc-accent-tile flex-shrink-0",children:g.jsx(Xt,{size:18})}),g.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[g.jsx("h3",{className:"text-base font-bold text-default-900 dark:text-white",children:"正在安装插件"}),g.jsx("p",{className:"text-xs text-default-500 truncate",children:w.message})]})]}),g.jsxs("div",{className:"flex flex-col gap-4",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex flex-col gap-0.5",children:[w.speedStr&&g.jsx("p",{className:"text-xs text-primary font-bold",children:w.speedStr}),w.eta!==void 0&&w.eta!==null&&g.jsxs("p",{className:"text-xs text-default-400",children:["剩余时间: ",w.eta>0?w.eta<60?`${w.eta}s`:`${Math.floor(w.eta/60)}m ${w.eta%60}s`:"计算中..."]})]}),g.jsxs("span",{className:"text-2xl font-black text-primary font-mono",children:[Math.round(w.progress),"%"]})]}),g.jsx("div",{className:"w-full bg-default-200/50 dark:bg-white/[0.08] rounded-full h-3 overflow-hidden",children:g.jsx("div",{className:"h-full rounded-full transition-all duration-500 ease-out bg-gradient-to-r from-primary-400 via-primary-500 to-primary-600 shadow-[0_0_16px_rgba(255,127,172,0.55)]",style:{width:`${Math.max(w.progress,2)}%`}})}),g.jsxs("div",{className:"flex items-center justify-between text-xs text-default-400 font-bold tracking-tight",children:[g.jsxs("span",{children:["已下载 ",w.downloadedStr||"0.0MB"]}),g.jsxs("span",{children:["总计 ",w.totalStr||"获取中..."]})]})]})]})]})]})}export{mh as default};