@nextclaw/ui 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/assets/{ChannelsList-D_sFrLcv.js → ChannelsList-DiX7ssoj.js} +1 -1
- package/dist/assets/ChatPage-CEEbtfae.js +34 -0
- package/dist/assets/{DocBrowser-BjlljUNM.js → DocBrowser-CkDugJv3.js} +1 -1
- package/dist/assets/{MarketplacePage-Dob7bQI5.js → MarketplacePage-Cxt223yL.js} +1 -1
- package/dist/assets/{ModelConfig-BesYoiw5.js → ModelConfig-BRRJU2mk.js} +1 -1
- package/dist/assets/{ProvidersList-NOoQyb_C.js → ProvidersList-Bl-OMAwu.js} +1 -1
- package/dist/assets/{RuntimeConfig-CGLGP3_g.js → RuntimeConfig-C0wurlgT.js} +1 -1
- package/dist/assets/{SecretsConfig-DP_InKs3.js → SecretsConfig-C_3yJm1I.js} +2 -2
- package/dist/assets/{SessionsConfig-XJbSPDZp.js → SessionsConfig-D13xFf5J.js} +1 -1
- package/dist/assets/{card-Bg0moANO.js → card-sDEXo_R4.js} +1 -1
- package/dist/assets/index-6azf0otP.css +1 -0
- package/dist/assets/index-DP9xXu9V.js +2 -0
- package/dist/assets/{label-DZuLJB_b.js → label-DhIqXnKx.js} +1 -1
- package/dist/assets/{logos-BDO7tmL-.js → logos-B9Qiy9wo.js} +1 -1
- package/dist/assets/{page-layout-BL29v3Ct.js → page-layout-CC6kzYFp.js} +1 -1
- package/dist/assets/{switch-DxH8lRYW.js → switch-DFPJEEVz.js} +1 -1
- package/dist/assets/{tabs-custom-BPd_6USz.js → tabs-custom-C_1pBckQ.js} +1 -1
- package/dist/assets/{useConfig-CJjG7ys-.js → useConfig-q7QqH3JB.js} +3 -3
- package/dist/assets/{useConfirmDialog-C-G5k7zK.js → useConfirmDialog-BNkeOTcY.js} +1 -1
- package/dist/assets/{vendor-Ylg6Wdt_.js → vendor-Dj2ULvht.js} +61 -56
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/src/components/chat/ChatThread.tsx +4 -2
- package/src/index.css +226 -29
- package/src/lib/i18n.ts +2 -0
- package/dist/assets/ChatPage-dDje_-4b.js +0 -32
- package/dist/assets/index-8RAlp6Gn.js +0 -2
- package/dist/assets/index-r3k4oB78.css +0 -1
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import{r as R,j as h,X as _l,Y as En,A as Nn,B as In,N as fn,Z as Ml,q as Bl,s as ql,u as $l,_ as ii,a0 as Hl,a1 as li,a2 as An,a3 as Ul,a4 as Vl,a5 as Kl,a6 as Wl,a7 as Ql,a8 as Xl,a9 as Yl,aa as Gl,ab as si,ac as ai,ad as st,ae as oi,af as ui,ag as Jl,ah as Zl,ai as es,aj as ts,ak as ns,al as rs,am as is,an as ls,ao as ss,ap as as,aq as os,g as us,ar as cs,as as fs,m as hs,at as ps,au as Gn,av as ds,M as ms,aw as ci,ax as gs,ay as xs,az as ys,w as bs,aA as ks,aB as ws}from"./vendor-Ylg6Wdt_.js";import{I as jn,d as Ss,e as Cs,f as vs,g as Es,s as Ns,h as Is,i as As,u as js,a as Ts,j as Ps,k as Rs,l as Ds,m as Ls,n as Os}from"./useConfig-CJjG7ys-.js";import{T as Jn,a as Zn,b as er,c as tr,u as zs,M as Fs}from"./MarketplacePage-Dob7bQI5.js";import{P as fi,u as hi}from"./useConfirmDialog-C-G5k7zK.js";import{B as Ie,P as _s,a as Ms}from"./page-layout-BL29v3Ct.js";import{u as pi,f as Bs,t as A,T as nr,L as rr,c as ie,g as Ot,S as jt,a as Tt,d as Pt,e as We,b as di}from"./index-8RAlp6Gn.js";import{b as qs,n as $s,e as Hs,a as Us,c as Vs}from"./chat-message-pw9oafI4.js";import{C as Ks,a as Ws}from"./card-Bg0moANO.js";import{b as Qs,c as Xs}from"./provider-models-y4mUDcGF.js";import"./tabs-custom-BPd_6USz.js";function Ys(e){const n=new Date,t=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),r=t-864e5,i=t-7*864e5,l=[],s=[],a=[],u=[];for(const f of e){const c=new Date(f.updatedAt).getTime();c>=t?l.push(f):c>=r?s.push(f):c>=i?a.push(f):u.push(f)}const o=[];return l.length>0&&o.push({label:A("chatSidebarToday"),sessions:l}),s.length>0&&o.push({label:A("chatSidebarYesterday"),sessions:s}),a.length>0&&o.push({label:A("chatSidebarPrevious7Days"),sessions:a}),u.length>0&&o.push({label:A("chatSidebarOlder"),sessions:u}),o}const Gs=[{target:"/cron",label:()=>A("chatSidebarScheduledTasks"),icon:Nn},{target:"/skills",label:()=>A("chatSidebarSkills"),icon:In}];function Js(e){var o,f;const{language:n,setLanguage:t}=pi(),{theme:r,setTheme:i}=Bs(),l=A(((o=nr.find(c=>c.value===r))==null?void 0:o.labelKey)??"themeWarm"),s=((f=rr.find(c=>c.value===n))==null?void 0:f.label)??n,a=R.useMemo(()=>Ys(e.sessions),[e.sessions]),u=c=>{n!==c&&(t(c),window.location.reload())};return h.jsxs("aside",{className:"w-[280px] shrink-0 flex flex-col h-full bg-secondary border-r border-gray-200/60",children:[h.jsx("div",{className:"px-5 pt-5 pb-3",children:h.jsxs("div",{className:"flex items-center gap-2.5",children:[h.jsx("div",{className:"h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center",children:h.jsx("img",{src:"/logo.svg",alt:"NextClaw",className:"h-full w-full object-contain"})}),h.jsx("span",{className:"text-[15px] font-semibold text-gray-800 tracking-[-0.01em]",children:"NextClaw"})]})}),h.jsx("div",{className:"px-4 pb-3",children:h.jsxs(Ie,{variant:"primary",className:"w-full rounded-xl",onClick:e.onCreateSession,children:[h.jsx(_l,{className:"h-4 w-4 mr-2"}),A("chatSidebarNewTask")]})}),h.jsx("div",{className:"px-4 pb-3",children:h.jsxs("div",{className:"relative",children:[h.jsx(En,{className:"h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400"}),h.jsx(jn,{value:e.query,onChange:c=>e.onQueryChange(c.target.value),placeholder:A("chatSidebarSearchPlaceholder"),className:"pl-8 h-9 rounded-lg text-xs"})]})}),h.jsx("div",{className:"px-3 pb-2",children:h.jsx("ul",{className:"space-y-0.5",children:Gs.map(c=>{const d=c.icon;return h.jsx("li",{children:h.jsx(fn,{to:c.target,className:({isActive:p})=>ie("group w-full flex items-center gap-3 px-3 py-2 rounded-xl text-[13px] font-medium transition-all duration-150",p?"bg-gray-200 text-gray-900 font-semibold shadow-sm":"text-gray-600 hover:bg-gray-200/60 hover:text-gray-900"),children:({isActive:p})=>h.jsxs(h.Fragment,{children:[h.jsx(d,{className:ie("h-4 w-4 transition-colors",p?"text-gray-900":"text-gray-500 group-hover:text-gray-800")}),h.jsx("span",{children:c.label()})]})})},c.target)})})}),h.jsx("div",{className:"mx-4 border-t border-gray-200/60"}),h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar px-3 py-2",children:e.isLoading?h.jsx("div",{className:"text-xs text-gray-500 p-3",children:A("sessionsLoading")}):a.length===0?h.jsxs("div",{className:"p-4 text-center",children:[h.jsx(Ml,{className:"h-6 w-6 mx-auto mb-2 text-gray-300"}),h.jsx("div",{className:"text-xs text-gray-500",children:A("sessionsEmpty")})]}):h.jsx("div",{className:"space-y-3",children:a.map(c=>h.jsxs("div",{children:[h.jsx("div",{className:"px-2 py-1 text-[11px] font-medium text-gray-400 uppercase tracking-wider",children:c.label}),h.jsx("div",{className:"space-y-0.5",children:c.sessions.map(d=>{const p=e.selectedSessionKey===d.key;return h.jsxs("button",{onClick:()=>e.onSelectSession(d.key),className:ie("w-full rounded-xl px-3 py-2 text-left transition-all text-[13px]",p?"bg-gray-200 text-gray-900 font-semibold shadow-sm":"text-gray-700 hover:bg-gray-200/60 hover:text-gray-900"),children:[h.jsx("div",{className:"truncate font-medium",children:e.sessionTitle(d)}),h.jsxs("div",{className:"mt-0.5 text-[11px] text-gray-400 truncate",children:[d.messageCount," · ",Ot(d.updatedAt)]})]},d.key)})})]},c.label))})}),h.jsxs("div",{className:"px-3 py-3 border-t border-gray-200/60 space-y-0.5",children:[h.jsx(fn,{to:"/settings",className:({isActive:c})=>ie("group w-full flex items-center gap-2.5 px-3 py-2 rounded-xl text-[13px] font-medium transition-all duration-150",c?"bg-gray-200 text-gray-900 font-semibold shadow-sm":"text-gray-600 hover:bg-gray-200/60 hover:text-gray-900"),children:({isActive:c})=>h.jsxs(h.Fragment,{children:[h.jsx(Bl,{className:ie("h-4 w-4 transition-colors",c?"text-gray-900":"text-gray-500 group-hover:text-gray-800")}),h.jsx("span",{children:A("settings")})]})}),h.jsxs(jt,{value:r,onValueChange:c=>i(c),children:[h.jsxs(Tt,{className:"w-full h-auto rounded-xl border-0 bg-transparent shadow-none px-3 py-2 text-[13px] font-medium text-gray-600 hover:bg-gray-200/60 focus:ring-0",children:[h.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[h.jsx(ql,{className:"h-4 w-4 text-gray-400"}),h.jsx("span",{children:A("theme")})]}),h.jsx("span",{className:"ml-auto text-[11px] text-gray-500",children:l})]}),h.jsx(Pt,{children:nr.map(c=>h.jsx(We,{value:c.value,className:"text-xs",children:A(c.labelKey)},c.value))})]}),h.jsxs(jt,{value:n,onValueChange:c=>u(c),children:[h.jsxs(Tt,{className:"w-full h-auto rounded-xl border-0 bg-transparent shadow-none px-3 py-2 text-[13px] font-medium text-gray-600 hover:bg-gray-200/60 focus:ring-0",children:[h.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[h.jsx($l,{className:"h-4 w-4 text-gray-400"}),h.jsx("span",{children:A("language")})]}),h.jsx("span",{className:"ml-auto text-[11px] text-gray-500",children:s})]}),h.jsx(Pt,{children:rr.map(c=>h.jsx(We,{value:c.value,className:"text-xs",children:c.label},c.value))})]})]})]})}function Zs(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const ea=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ta=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,na={};function ir(e,n){return(na.jsx?ta:ea).test(e)}const ra=/[ \t\n\f\r]/g;function ia(e){return typeof e=="object"?e.type==="text"?lr(e.value):!1:lr(e)}function lr(e){return e.replace(ra,"")===""}class pt{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}pt.prototype.normal={};pt.prototype.property={};pt.prototype.space=void 0;function mi(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new pt(t,r,n)}function hn(e){return e.toLowerCase()}class me{constructor(n,t){this.attribute=t,this.property=n}}me.prototype.attribute="";me.prototype.booleanish=!1;me.prototype.boolean=!1;me.prototype.commaOrSpaceSeparated=!1;me.prototype.commaSeparated=!1;me.prototype.defined=!1;me.prototype.mustUseProperty=!1;me.prototype.number=!1;me.prototype.overloadedBoolean=!1;me.prototype.property="";me.prototype.spaceSeparated=!1;me.prototype.space=void 0;let la=0;const q=qe(),re=qe(),pn=qe(),I=qe(),Z=qe(),Qe=qe(),xe=qe();function qe(){return 2**++la}const dn=Object.freeze(Object.defineProperty({__proto__:null,boolean:q,booleanish:re,commaOrSpaceSeparated:xe,commaSeparated:Qe,number:I,overloadedBoolean:pn,spaceSeparated:Z},Symbol.toStringTag,{value:"Module"})),Kt=Object.keys(dn);class Tn extends me{constructor(n,t,r,i){let l=-1;if(super(n,t),sr(this,"space",i),typeof r=="number")for(;++l<Kt.length;){const s=Kt[l];sr(this,Kt[l],(r&dn[s])===dn[s])}}}Tn.prototype.defined=!0;function sr(e,n,t){t&&(e[n]=t)}function Ge(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new Tn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[hn(r)]=r,t[hn(l.attribute)]=r}return new pt(n,t,e.space)}const gi=Ge({properties:{ariaActiveDescendant:null,ariaAtomic:re,ariaAutoComplete:null,ariaBusy:re,ariaChecked:re,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:Z,ariaCurrent:null,ariaDescribedBy:Z,ariaDetails:null,ariaDisabled:re,ariaDropEffect:Z,ariaErrorMessage:null,ariaExpanded:re,ariaFlowTo:Z,ariaGrabbed:re,ariaHasPopup:null,ariaHidden:re,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Z,ariaLevel:I,ariaLive:null,ariaModal:re,ariaMultiLine:re,ariaMultiSelectable:re,ariaOrientation:null,ariaOwns:Z,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:re,ariaReadOnly:re,ariaRelevant:null,ariaRequired:re,ariaRoleDescription:Z,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:re,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 xi(e,n){return n in e?e[n]:n}function yi(e,n){return xi(e,n.toLowerCase())}const sa=Ge({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Qe,acceptCharset:Z,accessKey:Z,action:null,allow:null,allowFullScreen:q,allowPaymentRequest:q,allowUserMedia:q,alt:null,as:null,async:q,autoCapitalize:null,autoComplete:Z,autoFocus:q,autoPlay:q,blocking:Z,capture:null,charSet:null,checked:q,cite:null,className:Z,cols:I,colSpan:null,content:null,contentEditable:re,controls:q,controlsList:Z,coords:I|Qe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:q,defer:q,dir:null,dirName:null,disabled:q,download:pn,draggable:re,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:q,formTarget:null,headers:Z,height:I,hidden:pn,high:I,href:null,hrefLang:null,htmlFor:Z,httpEquiv:Z,id:null,imageSizes:null,imageSrcSet:null,inert:q,inputMode:null,integrity:null,is:null,isMap:q,itemId:null,itemProp:Z,itemRef:Z,itemScope:q,itemType:Z,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:q,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:q,muted:q,name:null,nonce:null,noModule:q,noValidate:q,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:q,optimum:I,pattern:null,ping:Z,placeholder:null,playsInline:q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:q,referrerPolicy:null,rel:Z,required:q,reversed:q,rows:I,rowSpan:I,sandbox:Z,scope:null,scoped:q,seamless:q,selected:q,shadowRootClonable:q,shadowRootDelegatesFocus:q,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:re,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:q,useMap:null,value:re,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Z,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:q,declare:q,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:q,noHref:q,noShade:q,noWrap:q,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:re,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:q,disableRemotePlayback:q,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:yi}),aa=Ge({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",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:xe,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:Z,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:q,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:Qe,g2:Qe,glyphName:Qe,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:xe,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:Z,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xe,rev:xe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xe,requiredFeatures:xe,requiredFonts:xe,requiredFormats:xe,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:xe,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:xe,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:xe,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:xi}),bi=Ge({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),ki=Ge({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yi}),wi=Ge({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),oa={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"},ua=/[A-Z]/g,ar=/-[a-z]/g,ca=/^data[-\w.:]+$/i;function fa(e,n){const t=hn(n);let r=n,i=me;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&ca.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(ar,pa);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!ar.test(l)){let s=l.replace(ua,ha);s.charAt(0)!=="-"&&(s="-"+s),n="data"+s}}i=Tn}return new i(r,n)}function ha(e){return"-"+e.toLowerCase()}function pa(e){return e.charAt(1).toUpperCase()}const da=mi([gi,sa,bi,ki,wi],"html"),Pn=mi([gi,aa,bi,ki,wi],"svg");function ma(e){return e.join(" ").trim()}var Ue={},Wt,or;function ga(){if(or)return Wt;or=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
2
|
-
`,o="/",f="*",c="",d="comment",p="declaration";function x(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var N=1,v=1;function O(E){var j=E.match(n);j&&(N+=j.length);var $=E.lastIndexOf(u);v=~$?E.length-$:v+E.length}function F(){var E={line:N,column:v};return function(j){return j.position=new w(E),T(),j}}function w(E){this.start=E,this.end={line:N,column:v},this.source=y.source}w.prototype.content=S;function z(E){var j=new Error(y.source+":"+N+":"+v+": "+E);if(j.reason=E,j.filename=y.source,j.line=N,j.column=v,j.source=S,!y.silent)throw j}function _(E){var j=E.exec(S);if(j){var $=j[0];return O($),S=S.slice($.length),j}}function T(){_(t)}function k(E){var j;for(E=E||[];j=D();)j!==!1&&E.push(j);return E}function D(){var E=F();if(!(o!=S.charAt(0)||f!=S.charAt(1))){for(var j=2;c!=S.charAt(j)&&(f!=S.charAt(j)||o!=S.charAt(j+1));)++j;if(j+=2,c===S.charAt(j-1))return z("End of comment missing");var $=S.slice(2,j-2);return v+=2,O($),S=S.slice(j),v+=2,E({type:d,comment:$})}}function L(){var E=F(),j=_(r);if(j){if(D(),!_(i))return z("property missing ':'");var $=_(l),U=E({type:p,property:b(j[0].replace(e,c)),value:$?b($[0].replace(e,c)):c});return _(s),U}}function H(){var E=[];k(E);for(var j;j=L();)j!==!1&&(E.push(j),k(E));return E}return T(),H()}function b(S){return S?S.replace(a,c):c}return Wt=x,Wt}var ur;function xa(){if(ur)return Ue;ur=1;var e=Ue&&Ue.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.default=t;const n=e(ga());function t(r,i){let l=null;if(!r||typeof r!="string")return l;const s=(0,n.default)(r),a=typeof i=="function";return s.forEach(u=>{if(u.type!=="declaration")return;const{property:o,value:f}=u;a?i(o,f,u):f&&(l=l||{},l[o]=f)}),l}return Ue}var nt={},cr;function ya(){if(cr)return nt;cr=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)-/,l=function(o){return!o||t.test(o)||e.test(o)},s=function(o,f){return f.toUpperCase()},a=function(o,f){return"".concat(f,"-")},u=function(o,f){return f===void 0&&(f={}),l(o)?o:(o=o.toLowerCase(),f.reactCompat?o=o.replace(i,a):o=o.replace(r,a),o.replace(n,s))};return nt.camelCase=u,nt}var rt,fr;function ba(){if(fr)return rt;fr=1;var e=rt&&rt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(xa()),t=ya();function r(i,l){var s={};return!i||typeof i!="string"||(0,n.default)(i,function(a,u){a&&u&&(s[(0,t.camelCase)(a,l)]=u)}),s}return r.default=r,rt=r,rt}var ka=ba();const wa=ii(ka),Si=Ci("end"),Rn=Ci("start");function Ci(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 vi(e){const n=Rn(e),t=Si(e);if(n&&t)return{start:n,end:t}}function at(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?hr(e.position):"start"in e||"end"in e?hr(e):"line"in e||"column"in e?mn(e):""}function mn(e){return pr(e&&e.line)+":"+pr(e&&e.column)}function hr(e){return mn(e&&e.start)+"-"+mn(e&&e.end)}function pr(e){return e&&typeof e=="number"?e:1}class ue extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},s=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(s=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.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=at(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=s&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ue.prototype.file="";ue.prototype.name="";ue.prototype.reason="";ue.prototype.message="";ue.prototype.stack="";ue.prototype.column=void 0;ue.prototype.line=void 0;ue.prototype.ancestors=void 0;ue.prototype.cause=void 0;ue.prototype.fatal=void 0;ue.prototype.place=void 0;ue.prototype.ruleId=void 0;ue.prototype.source=void 0;const Dn={}.hasOwnProperty,Sa=new Map,Ca=/[A-Z]/g,va=new Set(["table","tbody","thead","tfoot","tr"]),Ea=new Set(["td","th"]),Ei="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Na(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=La(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=Da(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Pn:da,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Ni(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Ni(e,n,t){if(n.type==="element")return Ia(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Aa(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Ta(e,n,t);if(n.type==="mdxjsEsm")return ja(e,n);if(n.type==="root")return Pa(e,n,t);if(n.type==="text")return Ra(e,n)}function Ia(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Pn,e.schema=i),e.ancestors.push(n);const l=Ai(e,n.tagName,!1),s=Oa(e,n);let a=On(e,n);return va.has(n.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!ia(u):!0})),Ii(e,s,l,n),Ln(s,a),e.ancestors.pop(),e.schema=r,e.create(n,l,s,t)}function Aa(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)}ct(e,n.position)}function ja(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ct(e,n.position)}function Ta(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Pn,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:Ai(e,n.name,!0),s=za(e,n),a=On(e,n);return Ii(e,s,l,n),Ln(s,a),e.ancestors.pop(),e.schema=r,e.create(n,l,s,t)}function Pa(e,n,t){const r={};return Ln(r,On(e,n)),e.create(n,e.Fragment,r,t)}function Ra(e,n){return n.value}function Ii(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Ln(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Da(e,n,t){return r;function r(i,l,s,a){const o=Array.isArray(s.children)?t:n;return a?o(l,s,a):o(l,s)}}function La(e,n){return t;function t(r,i,l,s){const a=Array.isArray(l.children),u=Rn(r);return n(i,l,s,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Oa(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Dn.call(n.properties,i)){const l=Fa(e,i,n.properties[i]);if(l){const[s,a]=l;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&Ea.has(n.tagName)?r=a:t[s]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function za(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const s=l.expression;s.type;const a=s.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else ct(e,n.position);else{const i=r.name;let l;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,l=e.evaluater.evaluateExpression(a.expression)}else ct(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function On(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Sa;for(;++r<n.children.length;){const l=n.children[r];let s;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const o=i.get(u)||0;s=u+"-"+o,i.set(u,o+1)}}const a=Ni(e,l,s);a!==void 0&&t.push(a)}return t}function Fa(e,n,t){const r=fa(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Zs(t):ma(t)),r.property==="style"){let i=typeof t=="object"?t:_a(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Ma(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?oa[r.property]||r.property:r.attribute,t]}}function _a(e,n){try{return wa(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new ue("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=Ei+"#cannot-parse-style-attribute",i}}function Ai(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let l=-1,s;for(;++l<i.length;){const a=ir(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=s}else r=ir(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Dn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ct(e)}function ct(e,n){const t=new ue("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=Ei+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Ma(e){const n={};let t;for(t in e)Dn.call(e,t)&&(n[Ba(t)]=e[t]);return n}function Ba(e){let n=e.replace(Ca,qa);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function qa(e){return"-"+e.toLowerCase()}const Qt={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"]},$a={};function zn(e,n){const t=$a,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return ji(e,r,i)}function ji(e,n,t){if(Ha(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 dr(e.children,n,t)}return Array.isArray(e)?dr(e,n,t):""}function dr(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=ji(e[i],n,t);return r.join("")}function Ha(e){return!!(e&&typeof e=="object")}const mr=document.createElement("i");function Fn(e){const n="&"+e+";";mr.innerHTML=n;const t=mr.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ye(e,n,t,r){const i=e.length;let l=0,s;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)s=Array.from(r),s.unshift(n,t),e.splice(...s);else for(t&&e.splice(n,t);l<r.length;)s=r.slice(l,l+1e4),s.unshift(n,0),e.splice(...s),l+=1e4,n+=1e4}function ke(e,n){return e.length>0?(ye(e,e.length,0,n),e):n}const gr={}.hasOwnProperty;function Ti(e){const n={};let t=-1;for(;++t<e.length;)Ua(n,e[t]);return n}function Ua(e,n){let t;for(t in n){const i=(gr.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let s;if(l)for(s in l){gr.call(i,s)||(i[s]=[]);const a=l[s];Va(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Va(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ye(e,0,0,r)}function Pi(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 he=Oe(/[A-Za-z]/),oe=Oe(/[\dA-Za-z]/),Ka=Oe(/[#-'*+\--9=?A-Z^-~]/);function Rt(e){return e!==null&&(e<32||e===127)}const gn=Oe(/\d/),Wa=Oe(/[\dA-Fa-f]/),Qa=Oe(/[!-/:-@[-`{-~]/);function M(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}const zt=Oe(new RegExp("\\p{P}|\\p{S}","u")),Be=Oe(/\s/);function Oe(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Je(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let s="";if(l===37&&oe(e.charCodeAt(t+1))&&oe(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(s=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(s=String.fromCharCode(l,a),i=1):s="�"}else s=String.fromCharCode(l);s&&(n.push(e.slice(r,t),encodeURIComponent(s)),r=t+i+1,s=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function Q(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return s;function s(u){return K(u)?(e.enter(t),a(u)):n(u)}function a(u){return K(u)&&l++<i?(e.consume(u),a):(e.exit(t),n(u))}}const Xa={tokenize:Ya};function Ya(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"),Q(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return M(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),s)}}const Ga={tokenize:Ja},xr={tokenize:Za};function Ja(e){const n=this,t=[];let r=0,i,l,s;return a;function a(v){if(r<t.length){const O=t[r];return n.containerState=O[1],e.attempt(O[0].continuation,u,o)(v)}return o(v)}function u(v){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&N();const O=n.events.length;let F=O,w;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){w=n.events[F][1].end;break}y(r);let z=O;for(;z<n.events.length;)n.events[z][1].end={...w},z++;return ye(n.events,F+1,0,n.events.slice(O)),n.events.length=z,o(v)}return a(v)}function o(v){if(r===t.length){if(!i)return d(v);if(i.currentConstruct&&i.currentConstruct.concrete)return x(v);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(xr,f,c)(v)}function f(v){return i&&N(),y(r),d(v)}function c(v){return n.parser.lazy[n.now().line]=r!==t.length,s=n.now().offset,x(v)}function d(v){return n.containerState={},e.attempt(xr,p,x)(v)}function p(v){return r++,t.push([n.currentConstruct,n.containerState]),d(v)}function x(v){if(v===null){i&&N(),y(0),e.consume(v);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),b(v)}function b(v){if(v===null){S(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return M(v)?(e.consume(v),S(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(v),b)}function S(v,O){const F=n.sliceStream(v);if(O&&F.push(null),v.previous=l,l&&(l.next=v),l=v,i.defineSkip(v.start),i.write(F),n.parser.lazy[v.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<s&&(!i.events[w][1].end||i.events[w][1].end.offset>s))return;const z=n.events.length;let _=z,T,k;for(;_--;)if(n.events[_][0]==="exit"&&n.events[_][1].type==="chunkFlow"){if(T){k=n.events[_][1].end;break}T=!0}for(y(r),w=z;w<n.events.length;)n.events[w][1].end={...k},w++;ye(n.events,_+1,0,n.events.slice(z)),n.events.length=w}}function y(v){let O=t.length;for(;O-- >v;){const F=t[O];n.containerState=F[1],F[0].exit.call(n,e)}t.length=v}function N(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Za(e,n,t){return Q(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xe(e){if(e===null||J(e)||Be(e))return 1;if(zt(e))return 2}function Ft(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}const xn={name:"attention",resolveAll:eo,tokenize:to};function eo(e,n){let t=-1,r,i,l,s,a,u,o,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;u=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},d={...e[t][1].start};yr(c,-u),yr(d,u),s={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},l={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[t][1].start={...a.end},o=[],e[r][1].end.offset-e[r][1].start.offset&&(o=ke(o,[["enter",e[r][1],n],["exit",e[r][1],n]])),o=ke(o,[["enter",i,n],["enter",s,n],["exit",s,n],["enter",l,n]]),o=ke(o,Ft(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),o=ke(o,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,o=ke(o,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,ye(e,r-1,t-r+3,o),t=r+o.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=Xe(r);let l;return s;function s(u){return l=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===l)return e.consume(u),a;const o=e.exit("attentionSequence"),f=Xe(u),c=!f||f===2&&i||t.includes(u),d=!i||i===2&&f||t.includes(r);return o._open=!!(l===42?c:c&&(i||!d)),o._close=!!(l===42?d:d&&(f||!c)),n(u)}}function yr(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(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(p){return he(p)?(e.consume(p),s):p===64?t(p):o(p)}function s(p){return p===43||p===45||p===46||oe(p)?(r=1,a(p)):o(p)}function a(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||oe(p))&&r++<32?(e.consume(p),a):(r=0,o(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||Rt(p)?t(p):(e.consume(p),u)}function o(p){return p===64?(e.consume(p),f):Ka(p)?(e.consume(p),o):t(p)}function f(p){return oe(p)?c(p):t(p)}function c(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):d(p)}function d(p){if((p===45||oe(p))&&r++<63){const x=p===45?d:c;return e.consume(p),x}return t(p)}}const dt={partial:!0,tokenize:io};function io(e,n,t){return r;function r(l){return K(l)?Q(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||M(l)?n(l):t(l)}}const Ri={continuation:{tokenize:so},exit:ao,name:"blockQuote",tokenize:lo};function lo(e,n,t){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),l}return t(s)}function l(s){return K(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(s))}}function so(e,n,t){const r=this;return i;function i(s){return K(s)?Q(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):l(s)}function l(s){return e.attempt(Ri,n,t)(s)}}function ao(e){e.exit("blockQuote")}const Di={name:"characterEscape",tokenize:oo};function oo(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return Qa(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const Li={name:"characterReference",tokenize:uo};function uo(e,n,t){const r=this;let i=0,l,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),o):(e.enter("characterReferenceValue"),l=31,s=oe,f(c))}function o(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,s=Wa,f):(e.enter("characterReferenceValue"),l=7,s=gn,f(c))}function f(c){if(c===59&&i){const d=e.exit("characterReferenceValue");return s===oe&&!Fn(r.sliceSerialize(d))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return s(c)&&i++<l?(e.consume(c),f):t(c)}}const br={partial:!0,tokenize:fo},kr={concrete:!0,name:"codeFenced",tokenize:co};function co(e,n,t){const r=this,i={partial:!0,tokenize:F};let l=0,s=0,a;return u;function u(w){return o(w)}function o(w){const z=r.events[r.events.length-1];return l=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(w)}function f(w){return w===a?(s++,e.consume(w),f):s<3?t(w):(e.exit("codeFencedFenceSequence"),K(w)?Q(e,c,"whitespace")(w):c(w))}function c(w){return w===null||M(w)?(e.exit("codeFencedFence"),r.interrupt?n(w):e.check(br,b,O)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||M(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(w)):K(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Q(e,p,"whitespace")(w)):w===96&&w===a?t(w):(e.consume(w),d)}function p(w){return w===null||M(w)?c(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||M(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(w)):w===96&&w===a?t(w):(e.consume(w),x)}function b(w){return e.attempt(i,O,S)(w)}function S(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return l>0&&K(w)?Q(e,N,"linePrefix",l+1)(w):N(w)}function N(w){return w===null||M(w)?e.check(br,b,O)(w):(e.enter("codeFlowValue"),v(w))}function v(w){return w===null||M(w)?(e.exit("codeFlowValue"),N(w)):(e.consume(w),v)}function O(w){return e.exit("codeFenced"),n(w)}function F(w,z,_){let T=0;return k;function k(j){return w.enter("lineEnding"),w.consume(j),w.exit("lineEnding"),D}function D(j){return w.enter("codeFencedFence"),K(j)?Q(w,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):L(j)}function L(j){return j===a?(w.enter("codeFencedFenceSequence"),H(j)):_(j)}function H(j){return j===a?(T++,w.consume(j),H):T>=s?(w.exit("codeFencedFenceSequence"),K(j)?Q(w,E,"whitespace")(j):E(j)):_(j)}function E(j){return j===null||M(j)?(w.exit("codeFencedFence"),z(j)):_(j)}}}function fo(e,n,t){const r=this;return i;function i(s){return s===null?t(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),l)}function l(s){return r.parser.lazy[r.now().line]?t(s):n(s)}}const Xt={name:"codeIndented",tokenize:po},ho={partial:!0,tokenize:mo};function po(e,n,t){const r=this;return i;function i(o){return e.enter("codeIndented"),Q(e,l,"linePrefix",5)(o)}function l(o){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(o):t(o)}function s(o){return o===null?u(o):M(o)?e.attempt(ho,s,u)(o):(e.enter("codeFlowValue"),a(o))}function a(o){return o===null||M(o)?(e.exit("codeFlowValue"),s(o)):(e.consume(o),a)}function u(o){return e.exit("codeIndented"),n(o)}}function mo(e,n,t){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?t(s):M(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Q(e,l,"linePrefix",5)(s)}function l(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(s):M(s)?i(s):t(s)}}const go={name:"codeText",previous:yo,resolve:xo,tokenize:bo};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 bo(e,n,t){let r=0,i,l;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(l=e.enter("codeTextSequence"),i=0,f(c)):M(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),o(c))}function o(c){return c===null||c===32||c===96||M(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),o)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(l.type="codeTextData",o(c))}}class ko{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 l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&it(this.left,r),l.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 Oi(e){const n={};let t=-1,r,i,l,s,a,u,o;const f=new ko(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"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,wo(f,t)),t=n[t],o=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(s=f.get(l),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=l);else if(!(s[1].type==="linePrefix"||s[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 ye(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!o}function wo(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let s=t._tokenizer;s||(s=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,u=[],o={};let f,c,d=-1,p=t,x=0,b=0;const S=[b];for(;p;){for(;e.get(++i)[1]!==p;);l.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),c&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=t;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(b=d+1,S.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):S.pop(),d=S.length;d--;){const y=a.slice(S[d],S[d+1]),N=l.pop();u.push([N,N+y.length-1]),e.splice(N,2,y)}for(u.reverse(),d=-1;++d<u.length;)o[x+u[d][0]]=x+u[d][1],x+=u[d][1]-u[d][0]-1;return o}const So={resolve:vo,tokenize:Eo},Co={partial:!0,tokenize:No};function vo(e){return Oi(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?l(a):M(a)?e.check(Co,s,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function s(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function No(e,n,t){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Q(e,l,"linePrefix")}function l(s){if(s===null||M(s))return t(s);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(s):e.interrupt(r.parser.constructs.flow,t,n)(s)}}function zi(e,n,t,r,i,l,s,a,u){const o=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(y),e.exit(l),d):y===null||y===32||y===41||Rt(y)?t(y):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(y))}function d(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),d(y)):y===null||y===60||M(y)?t(y):(e.consume(y),y===92?x:p)}function x(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function b(y){return!f&&(y===null||y===41||J(y))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),n(y)):f<o&&y===40?(e.consume(y),f++,b):y===41?(e.consume(y),f--,b):y===null||y===32||y===40||Rt(y)?t(y):(e.consume(y),y===92?S:b)}function S(y){return y===40||y===41||y===92?(e.consume(y),b):b(y)}}function Fi(e,n,t,r,i,l){const s=this;let a=0,u;return o;function o(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(l),f}function f(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?t(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):M(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||M(p)||a++>999?(e.exit("chunkString"),f(p)):(e.consume(p),u||(u=!K(p)),p===92?d:c)}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,c):c(p)}}function _i(e,n,t,r,i,l){let s;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),s=d===40?41:d,u):t(d)}function u(d){return d===s?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),n):(e.enter(l),o(d))}function o(d){return d===s?(e.exit(l),u(s)):d===null?t(d):M(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Q(e,o,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===s||d===null||M(d)?(e.exit("chunkString"),o(d)):(e.consume(d),d===92?c:f)}function c(d){return d===s||d===92?(e.consume(d),f):f(d)}}function ot(e,n){let t;return r;function r(i){return M(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):K(i)?Q(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Io={name:"definition",tokenize:jo},Ao={partial:!0,tokenize:To};function jo(e,n,t){const r=this;let i;return l;function l(p){return e.enter("definition"),s(p)}function s(p){return Fi.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):t(p)}function u(p){return J(p)?ot(e,o)(p):o(p)}function o(p){return zi(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(Ao,c,c)(p)}function c(p){return K(p)?Q(e,d,"whitespace")(p):d(p)}function d(p){return p===null||M(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function To(e,n,t){return r;function r(a){return J(a)?ot(e,i)(a):t(a)}function i(a){return _i(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return K(a)?Q(e,s,"whitespace")(a):s(a)}function s(a){return a===null||M(a)?n(a):t(a)}}const Po={name:"hardBreakEscape",tokenize:Ro};function Ro(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return M(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const Do={name:"headingAtx",resolve:Lo,tokenize:Oo};function Lo(e,n){let t=e.length-2,r=3,i,l;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},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ye(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Oo(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),l(f)}function l(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||J(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||M(f)?(e.exit("atxHeading"),n(f)):K(f)?Q(e,a,"whitespace")(f):(e.enter("atxHeadingText"),o(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function o(f){return f===null||f===35||J(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),o)}}const zo=["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"],wr=["pre","script","style","textarea"],Fo={concrete:!0,name:"htmlFlow",resolveTo:Bo,tokenize:qo},_o={partial:!0,tokenize:Ho},Mo={partial:!0,tokenize:$o};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 qo(e,n,t){const r=this;let i,l,s,a,u;return o;function o(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),d):g===47?(e.consume(g),l=!0,b):g===63?(e.consume(g),i=3,r.interrupt?n:m):he(g)?(e.consume(g),s=String.fromCharCode(g),S):t(g)}function d(g){return g===45?(e.consume(g),i=2,p):g===91?(e.consume(g),i=5,a=0,x):he(g)?(e.consume(g),i=4,r.interrupt?n:m):t(g)}function p(g){return g===45?(e.consume(g),r.interrupt?n:m):t(g)}function x(g){const se="CDATA[";return g===se.charCodeAt(a++)?(e.consume(g),a===se.length?r.interrupt?n:L:x):t(g)}function b(g){return he(g)?(e.consume(g),s=String.fromCharCode(g),S):t(g)}function S(g){if(g===null||g===47||g===62||J(g)){const se=g===47,we=s.toLowerCase();return!se&&!l&&wr.includes(we)?(i=1,r.interrupt?n(g):L(g)):zo.includes(s.toLowerCase())?(i=6,se?(e.consume(g),y):r.interrupt?n(g):L(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(g):l?N(g):v(g))}return g===45||oe(g)?(e.consume(g),s+=String.fromCharCode(g),S):t(g)}function y(g){return g===62?(e.consume(g),r.interrupt?n:L):t(g)}function N(g){return K(g)?(e.consume(g),N):k(g)}function v(g){return g===47?(e.consume(g),k):g===58||g===95||he(g)?(e.consume(g),O):K(g)?(e.consume(g),v):k(g)}function O(g){return g===45||g===46||g===58||g===95||oe(g)?(e.consume(g),O):F(g)}function F(g){return g===61?(e.consume(g),w):K(g)?(e.consume(g),F):v(g)}function w(g){return g===null||g===60||g===61||g===62||g===96?t(g):g===34||g===39?(e.consume(g),u=g,z):K(g)?(e.consume(g),w):_(g)}function z(g){return g===u?(e.consume(g),u=null,T):g===null||M(g)?t(g):(e.consume(g),z)}function _(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||J(g)?F(g):(e.consume(g),_)}function T(g){return g===47||g===62||K(g)?v(g):t(g)}function k(g){return g===62?(e.consume(g),D):t(g)}function D(g){return g===null||M(g)?L(g):K(g)?(e.consume(g),D):t(g)}function L(g){return g===45&&i===2?(e.consume(g),$):g===60&&i===1?(e.consume(g),U):g===62&&i===4?(e.consume(g),ce):g===63&&i===3?(e.consume(g),m):g===93&&i===5?(e.consume(g),le):M(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(_o,fe,H)(g)):g===null||M(g)?(e.exit("htmlFlowData"),H(g)):(e.consume(g),L)}function H(g){return e.check(Mo,E,fe)(g)}function E(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),j}function j(g){return g===null||M(g)?H(g):(e.enter("htmlFlowData"),L(g))}function $(g){return g===45?(e.consume(g),m):L(g)}function U(g){return g===47?(e.consume(g),s="",ee):L(g)}function ee(g){if(g===62){const se=s.toLowerCase();return wr.includes(se)?(e.consume(g),ce):L(g)}return he(g)&&s.length<8?(e.consume(g),s+=String.fromCharCode(g),ee):L(g)}function le(g){return g===93?(e.consume(g),m):L(g)}function m(g){return g===62?(e.consume(g),ce):g===45&&i===2?(e.consume(g),m):L(g)}function ce(g){return g===null||M(g)?(e.exit("htmlFlowData"),fe(g)):(e.consume(g),ce)}function fe(g){return e.exit("htmlFlow"),n(g)}}function $o(e,n,t){const r=this;return i;function i(s){return M(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),l):t(s)}function l(s){return r.parser.lazy[r.now().line]?t(s):n(s)}}function Ho(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(dt,n,t)}}const Uo={name:"htmlText",tokenize:Vo};function Vo(e,n,t){const r=this;let i,l,s;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),o):m===47?(e.consume(m),F):m===63?(e.consume(m),v):he(m)?(e.consume(m),_):t(m)}function o(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),l=0,x):he(m)?(e.consume(m),N):t(m)}function f(m){return m===45?(e.consume(m),p):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),d):M(m)?(s=c,U(m)):(e.consume(m),c)}function d(m){return m===45?(e.consume(m),p):c(m)}function p(m){return m===62?$(m):m===45?d(m):c(m)}function x(m){const ce="CDATA[";return m===ce.charCodeAt(l++)?(e.consume(m),l===ce.length?b:x):t(m)}function b(m){return m===null?t(m):m===93?(e.consume(m),S):M(m)?(s=b,U(m)):(e.consume(m),b)}function S(m){return m===93?(e.consume(m),y):b(m)}function y(m){return m===62?$(m):m===93?(e.consume(m),y):b(m)}function N(m){return m===null||m===62?$(m):M(m)?(s=N,U(m)):(e.consume(m),N)}function v(m){return m===null?t(m):m===63?(e.consume(m),O):M(m)?(s=v,U(m)):(e.consume(m),v)}function O(m){return m===62?$(m):v(m)}function F(m){return he(m)?(e.consume(m),w):t(m)}function w(m){return m===45||oe(m)?(e.consume(m),w):z(m)}function z(m){return M(m)?(s=z,U(m)):K(m)?(e.consume(m),z):$(m)}function _(m){return m===45||oe(m)?(e.consume(m),_):m===47||m===62||J(m)?T(m):t(m)}function T(m){return m===47?(e.consume(m),$):m===58||m===95||he(m)?(e.consume(m),k):M(m)?(s=T,U(m)):K(m)?(e.consume(m),T):$(m)}function k(m){return m===45||m===46||m===58||m===95||oe(m)?(e.consume(m),k):D(m)}function D(m){return m===61?(e.consume(m),L):M(m)?(s=D,U(m)):K(m)?(e.consume(m),D):T(m)}function L(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,H):M(m)?(s=L,U(m)):K(m)?(e.consume(m),L):(e.consume(m),E)}function H(m){return m===i?(e.consume(m),i=void 0,j):m===null?t(m):M(m)?(s=H,U(m)):(e.consume(m),H)}function E(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||J(m)?T(m):(e.consume(m),E)}function j(m){return m===47||m===62||J(m)?T(m):t(m)}function $(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function U(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ee}function ee(m){return K(m)?Q(e,le,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):le(m)}function le(m){return e.enter("htmlTextData"),s(m)}}const _n={name:"labelEnd",resolveAll:Xo,resolveTo:Yo,tokenize:Go},Ko={tokenize:Jo},Wo={tokenize:Zo},Qo={tokenize:eu};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&&ye(e,0,e.length,t),e}function Yo(e,n){let t=e.length,r=0,i,l,s,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=t);const u={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},o={type:"label",start:{...e[l][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,n],["enter",o,n]],a=ke(a,e.slice(l+1,l+r+3)),a=ke(a,[["enter",f,n]]),a=ke(a,Ft(n.parser.constructs.insideSpan.null,e.slice(l+r+4,s-3),n)),a=ke(a,[["exit",f,n],e[s-2],e[s-1],["exit",o,n]]),a=ke(a,e.slice(s+1)),a=ke(a,[["exit",u,n]]),ye(e,l,e.length,a),e}function Go(e,n,t){const r=this;let i=r.events.length,l,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(d){return l?l._inactive?c(d):(s=r.parser.defined.includes(Se(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),u):t(d)}function u(d){return d===40?e.attempt(Ko,f,s?f:c)(d):d===91?e.attempt(Wo,f,s?o:c)(d):s?f(d):c(d)}function o(d){return e.attempt(Qo,f,c)(d)}function f(d){return n(d)}function c(d){return l._balanced=!0,t(d)}}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 J(c)?ot(e,l)(c):l(c)}function l(c){return c===41?f(c):zi(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return J(c)?ot(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?_i(e,o,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function o(c){return J(c)?ot(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 Fi.call(r,e,l,s,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function s(a){return t(a)}}function eu(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}const tu={name:"labelStartImage",resolveAll:_n.resolveAll,tokenize:nu};function nu(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):t(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const ru={name:"labelStartLink",resolveAll:_n.resolveAll,tokenize:iu};function iu(e,n,t){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),l}function l(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(s):n(s)}}const Yt={name:"lineEnding",tokenize:lu};function lu(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Q(e,n,"linePrefix")}}const At={name:"thematicBreak",tokenize:su};function su(e,n,t){let r=0,i;return l;function l(o){return e.enter("thematicBreak"),s(o)}function s(o){return i=o,a(o)}function a(o){return o===i?(e.enter("thematicBreakSequence"),u(o)):r>=3&&(o===null||M(o))?(e.exit("thematicBreak"),n(o)):t(o)}function u(o){return o===i?(e.consume(o),r++,u):(e.exit("thematicBreakSequence"),K(o)?Q(e,a,"whitespace")(o):a(o))}}const de={continuation:{tokenize:cu},exit:hu,name:"list",tokenize:uu},au={partial:!0,tokenize:pu},ou={partial:!0,tokenize:fu};function uu(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:gn(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(At,t,o)(p):o(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return t(p)}function u(p){return gn(p)&&++s<10?(e.consume(p),u):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),o(p)):t(p)}function o(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(dt,r.interrupt?t:f,e.attempt(au,d,c))}function f(p){return r.containerState.initialBlankLine=!0,l++,d(p)}function c(p){return K(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):t(p)}function d(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function cu(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(dt,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!K(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ou,n,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt(de,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function fu(e,n,t){const r=this;return Q(e,i,"listItemIndent",r.containerState.size+1);function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?n(l):t(l)}}function hu(e){e.exit(this.containerState.type)}function pu(e,n,t){const r=this;return Q(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const s=r.events[r.events.length-1];return!K(l)&&s&&s[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const Sr={name:"setextUnderline",resolveTo:du,tokenize:mu};function du(e,n){let t=e.length,r,i,l;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),!l&&e[t][1].type==="definition"&&(l=t);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",s,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=s,e.push(["exit",s,n]),e}function mu(e,n,t){const r=this;let i;return l;function l(o){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=o,s(o)):t(o)}function s(o){return e.enter("setextHeadingLineSequence"),a(o)}function a(o){return o===i?(e.consume(o),a):(e.exit("setextHeadingLineSequence"),K(o)?Q(e,u,"lineSuffix")(o):u(o))}function u(o){return o===null||M(o)?(e.exit("setextHeadingLine"),n(o)):t(o)}}const gu={tokenize:xu};function xu(e){const n=this,t=e.attempt(dt,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(So,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const yu={resolveAll:Bi()},bu=Mi("string"),ku=Mi("text");function Mi(e){return{resolveAll:Bi(e==="text"?wu:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,s,a);return s;function s(f){return o(f)?l(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return o(f)?(t.exit("data"),l(f)):(t.consume(f),u)}function o(f){if(f===null)return!0;const c=i[f];let d=-1;if(c)for(;++d<c.length;){const p=c[d];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Bi(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function wu(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 l=i.length,s=-1,a=0,u;for(;l--;){const o=i[l];if(typeof o=="string"){for(s=o.length;o.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(o===-2)u=!0,a++;else if(o!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const o={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:r.start._bufferIndex+s,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(t,0,["enter",o,n],["exit",o,n]),t+=2)}t++}return e}const Su={42:de,43:de,45:de,48:de,49:de,50:de,51:de,52:de,53:de,54:de,55:de,56:de,57:de,62:Ri},Cu={91:Io},vu={[-2]:Xt,[-1]:Xt,32:Xt},Eu={35:Do,42:At,45:[Sr,At],60:Fo,61:Sr,95:At,96:kr,126:kr},Nu={38:Li,92:Di},Iu={[-5]:Yt,[-4]:Yt,[-3]:Yt,33:tu,38:Li,42:xn,60:[no,Uo],91:ru,92:[Po,Di],93:_n,95:xn,96:go},Au={null:[xn,yu]},ju={null:[42,95]},Tu={null:[]},Pu=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ju,contentInitial:Cu,disable:Tu,document:Su,flow:Eu,flowInitial:vu,insideSpan:Au,string:Nu,text:Iu},Symbol.toStringTag,{value:"Module"}));function Ru(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={},l=[];let s=[],a=[];const u={attempt:z(F),check:z(w),consume:N,enter:v,exit:O,interrupt:z(w,{interrupt:!0})},o={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:d,sliceStream:p,write:c};let f=n.tokenize.call(o,u);return n.resolveAll&&l.push(n),o;function c(D){return s=ke(s,D),S(),s[s.length-1]!==null?[]:(_(n,0),o.events=Ft(l,o.events,o),o.events)}function d(D,L){return Lu(p(D),L)}function p(D){return Du(s,D)}function x(){const{_bufferIndex:D,_index:L,line:H,column:E,offset:j}=r;return{_bufferIndex:D,_index:L,line:H,column:E,offset:j}}function b(D){i[D.line]=D.column,k()}function S(){let D;for(;r._index<s.length;){const L=s[r._index];if(typeof L=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<L.length;)y(L.charCodeAt(r._bufferIndex));else y(L)}}function y(D){f=f(D)}function N(D){M(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,k()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),o.previous=D}function v(D,L){const H=L||{};return H.type=D,H.start=x(),o.events.push(["enter",H,o]),a.push(H),H}function O(D){const L=a.pop();return L.end=x(),o.events.push(["exit",L,o]),L}function F(D,L){_(D,L.from)}function w(D,L){L.restore()}function z(D,L){return H;function H(E,j,$){let U,ee,le,m;return Array.isArray(E)?fe(E):"tokenize"in E?fe([E]):ce(E);function ce(ne){return Fe;function Fe(Ce){const je=Ce!==null&&ne[Ce],Te=Ce!==null&&ne.null,$e=[...Array.isArray(je)?je:je?[je]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return fe($e)(Ce)}}function fe(ne){return U=ne,ee=0,ne.length===0?$:g(ne[ee])}function g(ne){return Fe;function Fe(Ce){return m=T(),le=ne,ne.partial||(o.currentConstruct=ne),ne.name&&o.parser.constructs.disable.null.includes(ne.name)?we():ne.tokenize.call(L?Object.assign(Object.create(o),L):o,u,se,we)(Ce)}}function se(ne){return D(le,m),j}function we(ne){return m.restore(),++ee<U.length?g(U[ee]):$}}}function _(D,L){D.resolveAll&&!l.includes(D)&&l.push(D),D.resolve&&ye(o.events,L,o.events.length-L,D.resolve(o.events.slice(L),o)),D.resolveTo&&(o.events=D.resolveTo(o.events,o))}function T(){const D=x(),L=o.previous,H=o.currentConstruct,E=o.events.length,j=Array.from(a);return{from:E,restore:$};function $(){r=D,o.previous=L,o.currentConstruct=H,o.events.length=E,a=j,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Du(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let s;if(t===i)s=[e[t].slice(r,l)];else{if(s=e.slice(t,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}l>0&&s.push(e[i].slice(0,l))}return s}function Lu(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let s;if(typeof l=="string")s=l;else switch(l){case-5:{s="\r";break}case-4:{s=`
|
|
3
|
-
`;break}case-3:{s=`\r
|
|
4
|
-
`;break}case-2:{s=n?" ":" ";break}case-1:{if(!n&&i)continue;s=" ";break}default:s=String.fromCharCode(l)}i=l===-2,r.push(s)}return r.join("")}function Ou(e){const r={constructs:Ti([Pu,...(e||{}).extensions||[]]),content:i(Xa),defined:[],document:i(Ga),flow:i(gu),lazy:{},string:i(bu),text:i(ku)};return r;function i(l){return s;function s(a){return Ru(r,l,a)}}}function zu(e){for(;!Oi(e););return e}const Cr=/[\0\t\n\r]/g;function Fu(){let e=1,n="",t=!0,r;return i;function i(l,s,a){const u=[];let o,f,c,d,p;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(s||void 0).decode(l)),c=0,n="",t&&(l.charCodeAt(0)===65279&&c++,t=void 0);c<l.length;){if(Cr.lastIndex=c,o=Cr.exec(l),d=o&&o.index!==void 0?o.index:l.length,p=l.charCodeAt(d),!o){n=l.slice(c);break}if(p===10&&c===d&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<d&&(u.push(l.slice(c,d)),e+=d-c),p){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=d+1}return a&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const _u=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Mu(e){return e.replace(_u,Bu)}function Bu(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return Pi(t.slice(l?2:1),l?16:10)}return Fn(t)||e}const qi={}.hasOwnProperty;function qu(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),$u(t)(zu(Ou(t).document().write(Fu()(e,n,!0))))}function $u(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(et),autolinkProtocol:T,autolinkEmail:T,atxHeading:l(wt),blockQuote:l(Te),characterEscape:T,characterReference:T,codeFenced:l($e),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:l($e,s),codeText:l(yt,s),codeTextData:T,data:T,codeFlowValue:T,definition:l(bt),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:l(kt),hardBreakEscape:l(Pe),hardBreakTrailing:l(Pe),htmlFlow:l(Ze,s),htmlFlowData:T,htmlText:l(Ze,s),htmlTextData:T,image:l(He),label:s,link:l(et),listItem:l(Ct),listItemValue:d,listOrdered:l(St,c),listUnordered:l(St),paragraph:l($t),reference:g,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:l(wt),strong:l(Ht),thematicBreak:l(Vt)},exit:{atxHeading:u(),atxHeadingSequence:F,autolink:u(),autolinkEmail:je,autolinkProtocol:Ce,blockQuote:u(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:we,characterReferenceMarkerNumeric:we,characterReferenceValue:ne,characterReference:Fe,codeFenced:u(S),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:k,codeIndented:u(y),codeText:u(j),codeTextData:k,data:k,definition:u(),definitionDestinationString:O,definitionLabelString:N,definitionTitleString:v,emphasis:u(),hardBreakEscape:u(L),hardBreakTrailing:u(L),htmlFlow:u(H),htmlFlowData:k,htmlText:u(E),htmlTextData:k,image:u(U),label:le,labelText:ee,lineEnding:D,link:u($),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:se,resourceDestinationString:m,resourceTitleString:ce,resource:fe,setextHeading:u(_),setextHeadingLineSequence:z,setextHeadingText:w,strong:u(),thematicBreak:u()}};$i(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(C){let P={type:"root",children:[]};const B={stack:[P],tokenStack:[],config:n,enter:a,exit:o,buffer:s,resume:f,data:t},V=[];let Y=-1;for(;++Y<C.length;)if(C[Y][1].type==="listOrdered"||C[Y][1].type==="listUnordered")if(C[Y][0]==="enter")V.push(Y);else{const pe=V.pop();Y=i(C,pe,Y)}for(Y=-1;++Y<C.length;){const pe=n[C[Y][0]];qi.call(pe,C[Y][1].type)&&pe[C[Y][1].type].call(Object.assign({sliceSerialize:C[Y][2].sliceSerialize},B),C[Y][1])}if(B.tokenStack.length>0){const pe=B.tokenStack[B.tokenStack.length-1];(pe[1]||vr).call(B,void 0,pe[0])}for(P.position={start:De(C.length>0?C[0][1].start:{line:1,column:1,offset:0}),end:De(C.length>0?C[C.length-2][1].end:{line:1,column:1,offset:0})},Y=-1;++Y<n.transforms.length;)P=n.transforms[Y](P)||P;return P}function i(C,P,B){let V=P-1,Y=-1,pe=!1,ve,be,Re,X;for(;++V<=B;){const W=C[V];switch(W[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{W[0]==="enter"?Y++:Y--,X=void 0;break}case"lineEndingBlank":{W[0]==="enter"&&(ve&&!X&&!Y&&!Re&&(Re=V),X=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:X=void 0}if(!Y&&W[0]==="enter"&&W[1].type==="listItemPrefix"||Y===-1&&W[0]==="exit"&&(W[1].type==="listUnordered"||W[1].type==="listOrdered")){if(ve){let te=V;for(be=void 0;te--;){const G=C[te];if(G[1].type==="lineEnding"||G[1].type==="lineEndingBlank"){if(G[0]==="exit")continue;be&&(C[be][1].type="lineEndingBlank",pe=!0),G[1].type="lineEnding",be=te}else if(!(G[1].type==="linePrefix"||G[1].type==="blockQuotePrefix"||G[1].type==="blockQuotePrefixWhitespace"||G[1].type==="blockQuoteMarker"||G[1].type==="listItemIndent"))break}Re&&(!be||Re<be)&&(ve._spread=!0),ve.end=Object.assign({},be?C[be][1].start:W[1].end),C.splice(be||V,0,["exit",ve,W[2]]),V++,B++}if(W[1].type==="listItemPrefix"){const te={type:"listItem",_spread:!1,start:Object.assign({},W[1].start),end:void 0};ve=te,C.splice(V,0,["enter",te,W[2]]),V++,B++,Re=void 0,X=!0}}}return C[P][1]._spread=pe,B}function l(C,P){return B;function B(V){a.call(this,C(V),V),P&&P.call(this,V)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(C,P,B){this.stack[this.stack.length-1].children.push(C),this.stack.push(C),this.tokenStack.push([P,B||void 0]),C.position={start:De(P.start),end:void 0}}function u(C){return P;function P(B){C&&C.call(this,B),o.call(this,B)}}function o(C,P){const B=this.stack.pop(),V=this.tokenStack.pop();if(V)V[0].type!==C.type&&(P?P.call(this,C,V[0]):(V[1]||vr).call(this,C,V[0]));else throw new Error("Cannot close `"+C.type+"` ("+at({start:C.start,end:C.end})+"): it’s not open");B.position.end=De(C.end)}function f(){return zn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function d(C){if(this.data.expectingFirstListItemValue){const P=this.stack[this.stack.length-2];P.start=Number.parseInt(this.sliceSerialize(C),10),this.data.expectingFirstListItemValue=void 0}}function p(){const C=this.resume(),P=this.stack[this.stack.length-1];P.lang=C}function x(){const C=this.resume(),P=this.stack[this.stack.length-1];P.meta=C}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const C=this.resume(),P=this.stack[this.stack.length-1];P.value=C.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const C=this.resume(),P=this.stack[this.stack.length-1];P.value=C.replace(/(\r?\n|\r)$/g,"")}function N(C){const P=this.resume(),B=this.stack[this.stack.length-1];B.label=P,B.identifier=Se(this.sliceSerialize(C)).toLowerCase()}function v(){const C=this.resume(),P=this.stack[this.stack.length-1];P.title=C}function O(){const C=this.resume(),P=this.stack[this.stack.length-1];P.url=C}function F(C){const P=this.stack[this.stack.length-1];if(!P.depth){const B=this.sliceSerialize(C).length;P.depth=B}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function z(C){const P=this.stack[this.stack.length-1];P.depth=this.sliceSerialize(C).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function T(C){const B=this.stack[this.stack.length-1].children;let V=B[B.length-1];(!V||V.type!=="text")&&(V=Ut(),V.position={start:De(C.start),end:void 0},B.push(V)),this.stack.push(V)}function k(C){const P=this.stack.pop();P.value+=this.sliceSerialize(C),P.position.end=De(C.end)}function D(C){const P=this.stack[this.stack.length-1];if(this.data.atHardBreak){const B=P.children[P.children.length-1];B.position.end=De(C.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(P.type)&&(T.call(this,C),k.call(this,C))}function L(){this.data.atHardBreak=!0}function H(){const C=this.resume(),P=this.stack[this.stack.length-1];P.value=C}function E(){const C=this.resume(),P=this.stack[this.stack.length-1];P.value=C}function j(){const C=this.resume(),P=this.stack[this.stack.length-1];P.value=C}function $(){const C=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";C.type+="Reference",C.referenceType=P,delete C.url,delete C.title}else delete C.identifier,delete C.label;this.data.referenceType=void 0}function U(){const C=this.stack[this.stack.length-1];if(this.data.inReference){const P=this.data.referenceType||"shortcut";C.type+="Reference",C.referenceType=P,delete C.url,delete C.title}else delete C.identifier,delete C.label;this.data.referenceType=void 0}function ee(C){const P=this.sliceSerialize(C),B=this.stack[this.stack.length-2];B.label=Mu(P),B.identifier=Se(P).toLowerCase()}function le(){const C=this.stack[this.stack.length-1],P=this.resume(),B=this.stack[this.stack.length-1];if(this.data.inReference=!0,B.type==="link"){const V=C.children;B.children=V}else B.alt=P}function m(){const C=this.resume(),P=this.stack[this.stack.length-1];P.url=C}function ce(){const C=this.resume(),P=this.stack[this.stack.length-1];P.title=C}function fe(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function se(C){const P=this.resume(),B=this.stack[this.stack.length-1];B.label=P,B.identifier=Se(this.sliceSerialize(C)).toLowerCase(),this.data.referenceType="full"}function we(C){this.data.characterReferenceType=C.type}function ne(C){const P=this.sliceSerialize(C),B=this.data.characterReferenceType;let V;B?(V=Pi(P,B==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):V=Fn(P);const Y=this.stack[this.stack.length-1];Y.value+=V}function Fe(C){const P=this.stack.pop();P.position.end=De(C.end)}function Ce(C){k.call(this,C);const P=this.stack[this.stack.length-1];P.url=this.sliceSerialize(C)}function je(C){k.call(this,C);const P=this.stack[this.stack.length-1];P.url="mailto:"+this.sliceSerialize(C)}function Te(){return{type:"blockquote",children:[]}}function $e(){return{type:"code",lang:null,meta:null,value:""}}function yt(){return{type:"inlineCode",value:""}}function bt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function kt(){return{type:"emphasis",children:[]}}function wt(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function Ze(){return{type:"html",value:""}}function He(){return{type:"image",title:null,url:"",alt:null}}function et(){return{type:"link",title:null,url:"",children:[]}}function St(C){return{type:"list",ordered:C.type==="listOrdered",start:null,spread:C._spread,children:[]}}function Ct(C){return{type:"listItem",spread:C._spread,checked:null,children:[]}}function $t(){return{type:"paragraph",children:[]}}function Ht(){return{type:"strong",children:[]}}function Ut(){return{type:"text",value:""}}function Vt(){return{type:"thematicBreak"}}}function De(e){return{line:e.line,column:e.column,offset:e.offset}}function $i(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?$i(e,r):Hu(e,r)}}function Hu(e,n){let t;for(t in n)if(qi.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 vr(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+at({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+at({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+at({start:n.start,end:n.end})+") is still open")}function Uu(e){const n=this;n.parser=t;function t(r){return qu(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Vu(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 Ku(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|
|
5
|
-
`}]}function Wu(e,n){const t=n.value?n.value+`
|
|
6
|
-
`:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(l.data={meta:n.meta}),e.patch(n,l),l=e.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(n,l),l}function Qu(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Xu(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Yu(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Je(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=l+1,a+=1,e.footnoteCounts.set(r,a);const u={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(s)}]};e.patch(n,u);const o={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,o),e.applyData(n,o)}function Gu(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 Ju(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function Hi(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Zu(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Hi(e,n);const i={src:Je(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function ec(e,n){const t={src:Je(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 tc(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 nc(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return Hi(e,n);const i={href:Je(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function rc(e,n){const t={href:Je(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 ic(e,n,t){const r=e.all(n),i=t?lc(t):Ui(n),l={},s=[];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:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
|
|
7
|
-
`}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
8
|
-
`});const o={type:"element",tagName:"li",properties:l,children:s};return e.patch(n,o),e.applyData(n,o)}function lc(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=Ui(t[r])}return n}function Ui(e){const n=e.spread;return n??e.children.length>1}function sc(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const l={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,l),e.applyData(n,l)}function ac(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function oc(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function uc(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function cc(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],s),i.push(s)}if(t.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Rn(n.children[1]),u=Si(n.children[n.children.length-1]);a&&u&&(s.position={start:a,end:u}),i.push(s)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function fc(e,n,t){const r=t?t.children:void 0,l=(r?r.indexOf(n):1)===0?"th":"td",s=t&&t.type==="table"?t.align:void 0,a=s?s.length:n.children.length;let u=-1;const o=[];for(;++u<a;){const c=n.children[u],d={},p=s?s[u]:void 0;p&&(d.align=p);let x={type:"element",tagName:l,properties:d,children:[]};c&&(x.children=e.all(c),e.patch(c,x),x=e.applyData(c,x)),o.push(x)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(o,!0)};return e.patch(n,f),e.applyData(n,f)}function hc(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const Er=9,Nr=32;function pc(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const l=[];for(;r;)l.push(Ir(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(Ir(n.slice(i),i>0,!1)),l.join("")}function Ir(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===Er||l===Nr;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===Er||l===Nr;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function dc(e,n){const t={type:"text",value:pc(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function mc(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const gc={blockquote:Vu,break:Ku,code:Wu,delete:Qu,emphasis:Xu,footnoteReference:Yu,heading:Gu,html:Ju,imageReference:Zu,image:ec,inlineCode:tc,linkReference:nc,link:rc,listItem:ic,list:sc,paragraph:ac,root:oc,strong:uc,table:cc,tableCell:hc,tableRow:fc,text:dc,thematicBreak:mc,toml:vt,yaml:vt,definition:vt,footnoteDefinition:vt};function vt(){}const Vi=-1,_t=0,ut=1,Dt=2,Mn=3,Bn=4,qn=5,$n=6,Ki=7,Wi=8,Ar=typeof self=="object"?self:globalThis,xc=(e,n)=>{const t=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,s]=n[i];switch(l){case _t:case Vi:return t(s,i);case ut:{const a=t([],i);for(const u of s)a.push(r(u));return a}case Dt:{const a=t({},i);for(const[u,o]of s)a[r(u)]=r(o);return a}case Mn:return t(new Date(s),i);case Bn:{const{source:a,flags:u}=s;return t(new RegExp(a,u),i)}case qn:{const a=t(new Map,i);for(const[u,o]of s)a.set(r(u),r(o));return a}case $n:{const a=t(new Set,i);for(const u of s)a.add(r(u));return a}case Ki:{const{name:a,message:u}=s;return t(new Ar[a](u),i)}case Wi:return t(BigInt(s),i);case"BigInt":return t(Object(BigInt(s)),i);case"ArrayBuffer":return t(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return t(new DataView(a),s)}}return t(new Ar[l](s),i)};return r},jr=e=>xc(new Map,e)(0),Ve="",{toString:yc}={},{keys:bc}=Object,lt=e=>{const n=typeof e;if(n!=="object"||!e)return[_t,n];const t=yc.call(e).slice(8,-1);switch(t){case"Array":return[ut,Ve];case"Object":return[Dt,Ve];case"Date":return[Mn,Ve];case"RegExp":return[Bn,Ve];case"Map":return[qn,Ve];case"Set":return[$n,Ve];case"DataView":return[ut,t]}return t.includes("Array")?[ut,t]:t.includes("Error")?[Ki,t]:[Dt,t]},Et=([e,n])=>e===_t&&(n==="function"||n==="symbol"),kc=(e,n,t,r)=>{const i=(s,a)=>{const u=r.push(s)-1;return t.set(a,u),u},l=s=>{if(t.has(s))return t.get(s);let[a,u]=lt(s);switch(a){case _t:{let f=s;switch(u){case"bigint":a=Wi,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);f=null;break;case"undefined":return i([Vi],s)}return i([a,f],s)}case ut:{if(u){let d=s;return u==="DataView"?d=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(d=new Uint8Array(s)),i([u,[...d]],s)}const f=[],c=i([a,f],s);for(const d of s)f.push(l(d));return c}case Dt:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(n&&"toJSON"in s)return l(s.toJSON());const f=[],c=i([a,f],s);for(const d of bc(s))(e||!Et(lt(s[d])))&&f.push([l(d),l(s[d])]);return c}case Mn:return i([a,s.toISOString()],s);case Bn:{const{source:f,flags:c}=s;return i([a,{source:f,flags:c}],s)}case qn:{const f=[],c=i([a,f],s);for(const[d,p]of s)(e||!(Et(lt(d))||Et(lt(p))))&&f.push([l(d),l(p)]);return c}case $n:{const f=[],c=i([a,f],s);for(const d of s)(e||!Et(lt(d)))&&f.push(l(d));return c}}const{message:o}=s;return i([a,{name:u,message:o}],s)};return l},Tr=(e,{json:n,lossy:t}={})=>{const r=[];return kc(!(n||t),!!n,new Map,r)(e),r},ft=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?jr(Tr(e,n)):structuredClone(e):(e,n)=>jr(Tr(e,n));function wc(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 Sc(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Cc(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||wc,r=e.options.footnoteBackLabel||Sc,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let u=-1;for(;++u<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[u]);if(!o)continue;const f=e.all(o),c=String(o.identifier).toUpperCase(),d=Je(c.toLowerCase());let p=0;const x=[],b=e.footnoteCounts.get(c);for(;b!==void 0&&++p<=b;){x.length>0&&x.push({type:"text",value:" "});let N=typeof t=="string"?t:t(u,p);typeof N=="string"&&(N={type:"text",value:N}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+d+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,p),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const N=S.children[S.children.length-1];N&&N.type==="text"?N.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...x)}else f.push(...x);const y={type:"element",tagName:"li",properties:{id:n+"fn-"+d},children:e.wrap(f,!0)};e.patch(o,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...ft(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
9
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
10
|
-
`}]}}const Mt=(function(e){if(e==null)return Ic;if(typeof e=="function")return Bt(e);if(typeof e=="object")return Array.isArray(e)?vc(e):Ec(e);if(typeof e=="string")return Nc(e);throw new Error("Expected function, string, or object as test")});function vc(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=Mt(e[t]);return Bt(r);function r(...i){let l=-1;for(;++l<n.length;)if(n[l].apply(this,i))return!0;return!1}}function Ec(e){const n=e;return Bt(t);function t(r){const i=r;let l;for(l in e)if(i[l]!==n[l])return!1;return!0}}function Nc(e){return Bt(n);function n(t){return t&&t.type===e}}function Bt(e){return n;function n(t,r,i){return!!(Ac(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Ic(){return!0}function Ac(e){return e!==null&&typeof e=="object"&&"type"in e}const Qi=[],jc=!0,yn=!1,Tc="skip";function Xi(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const l=Mt(i),s=r?-1:1;a(e,void 0,[])();function a(u,o,f){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return d;function d(){let p=Qi,x,b,S;if((!n||l(u,o,f[f.length-1]||void 0))&&(p=Pc(t(u,f)),p[0]===yn))return p;if("children"in u&&u.children){const y=u;if(y.children&&p[0]!==Tc)for(b=(r?y.children.length:-1)+s,S=f.concat(y);b>-1&&b<y.children.length;){const N=y.children[b];if(x=a(N,b,S)(),x[0]===yn)return x;b=typeof x[1]=="number"?x[1]:b+s}}return p}}}function Pc(e){return Array.isArray(e)?e:typeof e=="number"?[jc,e]:e==null?Qi:[e]}function Hn(e,n,t,r){let i,l,s;typeof n=="function"&&typeof t!="function"?(l=void 0,s=n,i=t):(l=n,s=t,i=r),Xi(e,l,a,i);function a(u,o){const f=o[o.length-1],c=f?f.children.indexOf(u):void 0;return s(u,c,f)}}const bn={}.hasOwnProperty,Rc={};function Dc(e,n){const t=n||Rc,r=new Map,i=new Map,l=new Map,s={...gc,...t.handlers},a={all:o,applyData:Oc,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:s,one:u,options:t,patch:Lc,wrap:Fc};return Hn(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,d=String(f.identifier).toUpperCase();c.has(d)||c.set(d,f)}}),a;function u(f,c){const d=f.type,p=a.handlers[d];if(bn.call(a.handlers,d)&&p)return p(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(d)){if("children"in f){const{children:b,...S}=f,y=ft(S);return y.children=a.all(f),y}return ft(f)}return(a.options.unknownHandler||zc)(a,f,c)}function o(f){const c=[];if("children"in f){const d=f.children;let p=-1;for(;++p<d.length;){const x=a.one(d[p],f);if(x){if(p&&d[p-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Pr(x.value)),!Array.isArray(x)&&x.type==="element")){const b=x.children[0];b&&b.type==="text"&&(b.value=Pr(b.value))}Array.isArray(x)?c.push(...x):c.push(x)}}}return c}}function Lc(e,n){e.position&&(n.position=vi(e))}function Oc(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const s="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:s}}t.type==="element"&&l&&Object.assign(t.properties,ft(l)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function zc(e,n){const t=n.data||{},r="value"in n&&!(bn.call(t,"hProperties")||bn.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 Fc(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
|
|
11
|
-
`});++r<e.length;)r&&t.push({type:"text",value:`
|
|
12
|
-
`}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
|
|
13
|
-
`}),t}function Pr(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=Dc(e,n),r=t.one(e,void 0),i=Cc(t),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
14
|
-
`},i),l}function _c(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 Dr(e){if(e)throw e}var Gt,Lr;function Mc(){if(Lr)return Gt;Lr=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(o){return typeof Array.isArray=="function"?Array.isArray(o):n.call(o)==="[object Array]"},l=function(o){if(!o||n.call(o)!=="[object Object]")return!1;var f=e.call(o,"constructor"),c=o.constructor&&o.constructor.prototype&&e.call(o.constructor.prototype,"isPrototypeOf");if(o.constructor&&!f&&!c)return!1;var d;for(d in o);return typeof d>"u"||e.call(o,d)},s=function(o,f){t&&f.name==="__proto__"?t(o,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):o[f.name]=f.newValue},a=function(o,f){if(f==="__proto__")if(e.call(o,f)){if(r)return r(o,f).value}else return;return o[f]};return Gt=function u(){var o,f,c,d,p,x,b=arguments[0],S=1,y=arguments.length,N=!1;for(typeof b=="boolean"&&(N=b,b=arguments[1]||{},S=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});S<y;++S)if(o=arguments[S],o!=null)for(f in o)c=a(b,f),d=a(o,f),b!==d&&(N&&d&&(l(d)||(p=i(d)))?(p?(p=!1,x=c&&i(c)?c:[]):x=c&&l(c)?c:{},s(b,{name:f,newValue:u(N,x,d)})):typeof d<"u"&&s(b,{name:f,newValue:d}));return b},Gt}var Bc=Mc();const Jt=ii(Bc);function kn(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 qc(){const e=[],n={run:t,use:r};return n;function t(...i){let l=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...o){const f=e[++l];let c=-1;if(u){s(u);return}for(;++c<i.length;)(o[c]===null||o[c]===void 0)&&(o[c]=i[c]);i=o,f?$c(f,a)(...o):s(null,...o)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function $c(e,n){let t;return r;function r(...s){const a=e.length>s.length;let u;a&&s.push(i);try{u=e.apply(this,s)}catch(o){const f=o;if(a&&t)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(l,i):u instanceof Error?i(u):l(u))}function i(s,...a){t||(t=!0,n(s,...a))}function l(s){i(null,s)}}const Ee={basename:Hc,dirname:Uc,extname:Vc,join:Kc,sep:"/"};function Hc(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');mt(e);let t=0,r=-1,i=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let s=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else s<0&&(l=!0,s=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return t===r?r=s:r<0&&(r=e.length),e.slice(t,r)}function Uc(e){if(mt(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 Vc(e){mt(e);let n=e.length,t=-1,r=0,i=-1,l=0,s;for(;n--;){const a=e.codePointAt(n);if(a===47){if(s){r=n+1;break}continue}t<0&&(s=!0,t=n+1),a===46?i<0?i=n:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||t<0||l===0||l===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Kc(...e){let n=-1,t;for(;++n<e.length;)mt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Wc(t)}function Wc(e){mt(e);const n=e.codePointAt(0)===47;let t=Qc(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Qc(e,n){let t="",r=0,i=-1,l=0,s=-1,a,u;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||l===1))if(i!==s-1&&l===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(u=t.lastIndexOf("/"),u!==t.length-1){u<0?(t="",r=0):(t=t.slice(0,u),r=t.length-1-t.lastIndexOf("/")),i=s,l=0;continue}}else if(t.length>0){t="",r=0,i=s,l=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,s):t=e.slice(i+1,s),r=s-i-1;i=s,l=0}else a===46&&l>-1?l++:l=-1}return t}function mt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Xc={cwd:Yc};function Yc(){return"/"}function wn(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Gc(e){if(typeof e=="string")e=new URL(e);else if(!wn(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 Jc(e)}function Jc(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 Zt=["history","path","basename","stem","extname","dirname"];class Yi{constructor(n){let t;n?wn(n)?t={path:n}:typeof n=="string"||Zc(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Xc.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Zt.length;){const l=Zt[r];l in t&&t[l]!==void 0&&t[l]!==null&&(this[l]=l==="history"?[...t[l]]:t[l])}let i;for(i in t)Zt.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?Ee.basename(this.path):void 0}set basename(n){tn(n,"basename"),en(n,"basename"),this.path=Ee.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Ee.dirname(this.path):void 0}set dirname(n){Or(this.basename,"dirname"),this.path=Ee.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Ee.extname(this.path):void 0}set extname(n){if(en(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=Ee.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){wn(n)&&(n=Gc(n)),tn(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Ee.basename(this.path,this.extname):void 0}set stem(n){tn(n,"stem"),en(n,"stem"),this.path=Ee.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 ue(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 en(e,n){if(e&&e.includes(Ee.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Ee.sep+"`")}function tn(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 Zc(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ef=(function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),tf={}.hasOwnProperty;class Un extends ef{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=qc()}copy(){const n=new Un;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(Jt(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(ln("data",this.frozen),this.namespace[n]=t,this):tf.call(this.namespace,n)&&this.namespace[n]||void 0:n?(ln("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=Nt(n),r=this.parser||this.Parser;return nn("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),nn("process",this.parser||this.Parser),rn("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(l,s){const a=Nt(n),u=r.parse(a);r.run(u,a,function(f,c,d){if(f||!c||!d)return o(f);const p=c,x=r.stringify(p,d);lf(x)?d.value=x:d.result=x,o(f,d)});function o(f,c){f||!c?s(f):l?l(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),nn("processSync",this.parser||this.Parser),rn("processSync",this.compiler||this.Compiler),this.process(n,i),Fr("processSync","process",t),r;function i(l,s){t=!0,Dr(l),r=s}}run(n,t,r){zr(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?l(void 0,r):new Promise(l);function l(s,a){const u=Nt(t);i.run(n,u,o);function o(f,c,d){const p=c||n;f?a(f):s?s(p):r(void 0,p,d)}}}runSync(n,t){let r=!1,i;return this.run(n,t,l),Fr("runSync","run",r),i;function l(s,a){Dr(s),i=a,r=!0}}stringify(n,t){this.freeze();const r=Nt(t),i=this.compiler||this.Compiler;return rn("stringify",i),zr(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(ln("use",this.frozen),n!=null)if(typeof n=="function")u(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):s(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function l(o){if(typeof o=="function")u(o,[]);else if(typeof o=="object")if(Array.isArray(o)){const[f,...c]=o;u(f,c)}else s(o);else throw new TypeError("Expected usable value, not `"+o+"`")}function s(o){if(!("plugins"in o)&&!("settings"in o))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(o.plugins),o.settings&&(i.settings=Jt(!0,i.settings,o.settings))}function a(o){let f=-1;if(o!=null)if(Array.isArray(o))for(;++f<o.length;){const c=o[f];l(c)}else throw new TypeError("Expected a list of plugins, not `"+o+"`")}function u(o,f){let c=-1,d=-1;for(;++c<r.length;)if(r[c][0]===o){d=c;break}if(d===-1)r.push([o,...f]);else if(f.length>0){let[p,...x]=f;const b=r[d][1];kn(b)&&kn(p)&&(p=Jt(!0,b,p)),r[d]=[o,p,...x]}}}}const nf=new Un().freeze();function nn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function rn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ln(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 zr(e){if(!kn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Fr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Nt(e){return rf(e)?e:new Yi(e)}function rf(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lf(e){return typeof e=="string"||sf(e)}function sf(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const af="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_r=[],Mr={allowDangerousHtml:!0},of=/^(https?|ircs?|mailto|xmpp)$/i,uf=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cf(e){const n=ff(e),t=hf(e);return pf(n.runSync(n.parse(t),t),e)}function ff(e){const n=e.rehypePlugins||_r,t=e.remarkPlugins||_r,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Mr}:Mr;return nf().use(Uu).use(t).use(_c,r).use(n)}function hf(e){const n=e.children||"",t=new Yi;return typeof n=="string"&&(t.value=n),t}function pf(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,s=n.skipHtml,a=n.unwrapDisallowed,u=n.urlTransform||df;for(const f of uf)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+af+f.id,void 0);return Hn(e,o),Na(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function o(f,c,d){if(f.type==="raw"&&d&&typeof c=="number")return s?d.children.splice(c,1):d.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let p;for(p in Qt)if(Object.hasOwn(Qt,p)&&Object.hasOwn(f.properties,p)){const x=f.properties[p],b=Qt[p];(b===null||b.includes(f.tagName))&&(f.properties[p]=u(String(x||""),p,f))}}if(f.type==="element"){let p=t?!t.includes(f.tagName):l?l.includes(f.tagName):!1;if(!p&&r&&typeof c=="number"&&(p=!r(f,c,d)),p&&d&&typeof c=="number")return a&&f.children?d.children.splice(c,1,...f.children):d.children.splice(c,1),c}}}function df(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||of.test(e.slice(0,n))?e:""}const _e=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],Br={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[..._e,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[..._e],h2:[["className","sr-only"]],img:[..._e,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[..._e,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[..._e],table:[..._e],ul:[..._e,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Le={}.hasOwnProperty;function mf(e,n){let t={type:"root",children:[]};const r={schema:n?{...Br,...n}:Br,stack:[]},i=Gi(r,e);return i&&(Array.isArray(i)?i.length===1?t=i[0]:t.children=i:t=i),t}function Gi(e,n){if(n&&typeof n=="object"){const t=n;switch(typeof t.type=="string"?t.type:""){case"comment":return gf(e,t);case"doctype":return xf(e,t);case"element":return yf(e,t);case"root":return bf(e,t);case"text":return kf(e,t)}}}function gf(e,n){if(e.schema.allowComments){const t=typeof n.value=="string"?n.value:"",r=t.indexOf("-->"),l={type:"comment",value:r<0?t:t.slice(0,r)};return gt(l,n),l}}function xf(e,n){if(e.schema.allowDoctypes){const t={type:"doctype"};return gt(t,n),t}}function yf(e,n){const t=typeof n.tagName=="string"?n.tagName:"";e.stack.push(t);const r=Ji(e,n.children),i=wf(e,n.properties);e.stack.pop();let l=!1;if(t&&t!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(t))&&(l=!0,e.schema.ancestors&&Le.call(e.schema.ancestors,t))){const a=e.schema.ancestors[t];let u=-1;for(l=!1;++u<a.length;)e.stack.includes(a[u])&&(l=!0)}if(!l)return e.schema.strip&&!e.schema.strip.includes(t)?r:void 0;const s={type:"element",tagName:t,properties:i,children:r};return gt(s,n),s}function bf(e,n){const r={type:"root",children:Ji(e,n.children)};return gt(r,n),r}function kf(e,n){const r={type:"text",value:typeof n.value=="string"?n.value:""};return gt(r,n),r}function Ji(e,n){const t=[];if(Array.isArray(n)){const r=n;let i=-1;for(;++i<r.length;){const l=Gi(e,r[i]);l&&(Array.isArray(l)?t.push(...l):t.push(l))}}return t}function wf(e,n){const t=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,l=r&&Le.call(r,t)?r[t]:void 0,s=r&&Le.call(r,"*")?r["*"]:void 0,a=n&&typeof n=="object"?n:{},u={};let o;for(o in a)if(Le.call(a,o)){const f=a[o];let c=qr(e,$r(l,o),o,f);c==null&&(c=qr(e,$r(s,o),o,f)),c!=null&&(u[o]=c)}if(i&&Le.call(i,t)){const f=i[t];for(o in f)Le.call(f,o)&&!Le.call(u,o)&&(u[o]=f[o])}return u}function qr(e,n,t,r){return n?Array.isArray(r)?Sf(e,n,t,r):Zi(e,n,t,r):void 0}function Sf(e,n,t,r){let i=-1;const l=[];for(;++i<r.length;){const s=Zi(e,n,t,r[i]);(typeof s=="number"||typeof s=="string")&&l.push(s)}return l}function Zi(e,n,t,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&Cf(e,t,r)){if(typeof n=="object"&&n.length>1){let i=!1,l=0;for(;++l<n.length;){const s=n[l];if(s&&typeof s=="object"&&"flags"in s){if(s.test(String(r))){i=!0;break}}else if(s===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(t)?e.schema.clobberPrefix+r:r}}function Cf(e,n,t){const r=e.schema.protocols&&Le.call(e.schema.protocols,n)?e.schema.protocols[n]:void 0;if(!r||r.length===0)return!0;const i=String(t),l=i.indexOf(":"),s=i.indexOf("?"),a=i.indexOf("#"),u=i.indexOf("/");if(l<0||u>-1&&l>u||s>-1&&l>s||a>-1&&l>a)return!0;let o=-1;for(;++o<r.length;){const f=r[o];if(l===f.length&&i.slice(0,f.length)===f)return!0}return!1}function gt(e,n){const t=vi(n);n.data&&(e.data=ft(n.data)),t&&(e.position=t)}function $r(e,n){let t,r=-1;if(e)for(;++r<e.length;){const i=e[r],l=typeof i=="string"?i:i[0];if(l===n)return i;l==="data*"&&(t=i)}if(n.length>4&&n.slice(0,4).toLowerCase()==="data")return t}function vf(e){return function(n){return mf(n,e)}}function Hr(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 Ef(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Nf(e,n,t){const i=Mt((t||{}).ignore||[]),l=If(n);let s=-1;for(;++s<l.length;)Xi(e,"text",a);function a(o,f){let c=-1,d;for(;++c<f.length;){const p=f[c],x=d?d.children:void 0;if(i(p,x?x.indexOf(p):void 0,d))return;d=p}if(d)return u(o,f)}function u(o,f){const c=f[f.length-1],d=l[s][0],p=l[s][1];let x=0;const S=c.children.indexOf(o);let y=!1,N=[];d.lastIndex=0;let v=d.exec(o.value);for(;v;){const O=v.index,F={index:v.index,input:v.input,stack:[...f,o]};let w=p(...v,F);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?d.lastIndex=O+1:(x!==O&&N.push({type:"text",value:o.value.slice(x,O)}),Array.isArray(w)?N.push(...w):w&&N.push(w),x=O+v[0].length,y=!0),!d.global)break;v=d.exec(o.value)}return y?(x<o.value.length&&N.push({type:"text",value:o.value.slice(x)}),c.children.splice(S,1,...N)):N=[o],S+N.length}}function If(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([Af(i[0]),jf(i[1])])}return n}function Af(e){return typeof e=="string"?new RegExp(Ef(e),"g"):e}function jf(e){return typeof e=="function"?e:function(){return e}}const sn="phrasing",an=["autolink","link","image","label"];function Tf(){return{transforms:[Ff],enter:{literalAutolink:Rf,literalAutolinkEmail:on,literalAutolinkHttp:on,literalAutolinkWww:on},exit:{literalAutolink:zf,literalAutolinkEmail:Of,literalAutolinkHttp:Df,literalAutolinkWww:Lf}}}function Pf(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:sn,notInConstruct:an},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:sn,notInConstruct:an},{character:":",before:"[ps]",after:"\\/",inConstruct:sn,notInConstruct:an}]}}function Rf(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function on(e){this.config.enter.autolinkProtocol.call(this,e)}function Df(e){this.config.exit.autolinkProtocol.call(this,e)}function Lf(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 Of(e){this.config.exit.autolinkEmail.call(this,e)}function zf(e){this.exit(e)}function Ff(e){Nf(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_f],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Mf]],{ignore:["link","linkReference"]})}function _f(e,n,t,r,i){let l="";if(!el(i)||(/^w/i.test(n)&&(t=n+t,n="",l="http://"),!Bf(t)))return!1;const s=qf(t+r);if(!s[0])return!1;const a={type:"link",title:null,url:l+n+s[0],children:[{type:"text",value:n+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function Mf(e,n,t,r){return!el(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function Bf(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 qf(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=Hr(e,"(");let l=Hr(e,")");for(;r!==-1&&i>l;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),l++;return[e,t]}function el(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Be(t)||zt(t))&&(!n||t!==47)}tl.peek=Yf;function $f(){this.buffer()}function Hf(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Uf(){this.buffer()}function Vf(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Kf(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 Wf(e){this.exit(e)}function Qf(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 Xf(e){this.exit(e)}function Yf(){return"["}function tl(e,n,t,r){const i=t.createTracker(r);let l=i.move("[^");const s=t.enter("footnoteReference"),a=t.enter("reference");return l+=i.move(t.safe(t.associationId(e),{after:"]",before:l})),a(),s(),l+=i.move("]"),l}function Gf(){return{enter:{gfmFootnoteCallString:$f,gfmFootnoteCall:Hf,gfmFootnoteDefinitionLabelString:Uf,gfmFootnoteDefinition:Vf},exit:{gfmFootnoteCallString:Kf,gfmFootnoteCall:Wf,gfmFootnoteDefinitionLabelString:Qf,gfmFootnoteDefinition:Xf}}}function Jf(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:tl},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,l,s){const a=l.createTracker(s);let u=a.move("[^");const o=l.enter("footnoteDefinition"),f=l.enter("label");return u+=a.move(l.safe(l.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((n?`
|
|
15
|
-
`:" ")+l.indentLines(l.containerFlow(r,a.current()),n?nl:Zf))),o(),u}}function Zf(e,n,t){return n===0?e:nl(e,n,t)}function nl(e,n,t){return(t?"":" ")+e}const eh=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];rl.peek=lh;function th(){return{canContainEols:["delete"],enter:{strikethrough:rh},exit:{strikethrough:ih}}}function nh(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:eh}],handlers:{delete:rl}}}function rh(e){this.enter({type:"delete",children:[]},e)}function ih(e){this.exit(e)}function rl(e,n,t,r){const i=t.createTracker(r),l=t.enter("strikethrough");let s=i.move("~~");return s+=t.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),l(),s}function lh(){return"~"}function sh(e){return e.length}function ah(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||sh,l=[],s=[],a=[],u=[];let o=0,f=-1;for(;++f<e.length;){const b=[],S=[];let y=-1;for(e[f].length>o&&(o=e[f].length);++y<e[f].length;){const N=oh(e[f][y]);if(t.alignDelimiters!==!1){const v=i(N);S[y]=v,(u[y]===void 0||v>u[y])&&(u[y]=v)}b.push(N)}s[f]=b,a[f]=S}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<o;)l[c]=Ur(r[c]);else{const b=Ur(r);for(;++c<o;)l[c]=b}c=-1;const d=[],p=[];for(;++c<o;){const b=l[c];let S="",y="";b===99?(S=":",y=":"):b===108?S=":":b===114&&(y=":");let N=t.alignDelimiters===!1?1:Math.max(1,u[c]-S.length-y.length);const v=S+"-".repeat(N)+y;t.alignDelimiters!==!1&&(N=S.length+N+y.length,N>u[c]&&(u[c]=N),p[c]=N),d[c]=v}s.splice(1,0,d),a.splice(1,0,p),f=-1;const x=[];for(;++f<s.length;){const b=s[f],S=a[f];c=-1;const y=[];for(;++c<o;){const N=b[c]||"";let v="",O="";if(t.alignDelimiters!==!1){const F=u[c]-(S[c]||0),w=l[c];w===114?v=" ".repeat(F):w===99?F%2?(v=" ".repeat(F/2+.5),O=" ".repeat(F/2-.5)):(v=" ".repeat(F/2),O=v):O=" ".repeat(F)}t.delimiterStart!==!1&&!c&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&N==="")&&(t.delimiterStart!==!1||c)&&y.push(" "),t.alignDelimiters!==!1&&y.push(v),y.push(N),t.alignDelimiters!==!1&&y.push(O),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||c!==o-1)&&y.push("|")}x.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return x.join(`
|
|
16
|
-
`)}function oh(e){return e==null?"":String(e)}function Ur(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 uh(e,n,t,r){const i=t.enter("blockquote"),l=t.createTracker(r);l.move("> "),l.shift(2);const s=t.indentLines(t.containerFlow(e,l.current()),ch);return i(),s}function ch(e,n,t){return">"+(t?"":" ")+e}function fh(e,n){return Vr(e,n.inConstruct,!0)&&!Vr(e,n.notInConstruct,!1)}function Vr(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function Kr(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
|
|
17
|
-
`&&fh(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
18
|
-
`}function hh(e,n){const t=String(e);let r=t.indexOf(n),i=r,l=0,s=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++l>s&&(s=l):l=1,i=r+n.length,r=t.indexOf(n,i);return s}function ph(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 dh(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 mh(e,n,t,r){const i=dh(t),l=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(ph(e,t)){const c=t.enter("codeIndented"),d=t.indentLines(l,gh);return c(),d}const a=t.createTracker(r),u=i.repeat(Math.max(hh(l,i)+1,3)),o=t.enter("codeFenced");let f=a.move(u);if(e.lang){const c=t.enter(`codeFencedLang${s}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
|
|
19
|
-
`,encode:["`"],...a.current()})),c()}return f+=a.move(`
|
|
20
|
-
`),l&&(f+=a.move(l+`
|
|
21
|
-
`)),f+=a.move(u),o(),f}function gh(e,n,t){return(t?"":" ")+e}function Vn(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 xh(e,n,t,r){const i=Vn(t),l=i==='"'?"Quote":"Apostrophe",s=t.enter("definition");let a=t.enter("label");const u=t.createTracker(r);let o=u.move("[");return o+=u.move(t.safe(t.associationId(e),{before:o,after:"]",...u.current()})),o+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),o+=u.move("<"),o+=u.move(t.safe(e.url,{before:o,after:">",...u.current()})),o+=u.move(">")):(a=t.enter("destinationRaw"),o+=u.move(t.safe(e.url,{before:o,after:e.title?" ":`
|
|
22
|
-
`,...u.current()}))),a(),e.title&&(a=t.enter(`title${l}`),o+=u.move(" "+i),o+=u.move(t.safe(e.title,{before:o,after:i,...u.current()})),o+=u.move(i),a()),s(),o}function yh(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 ht(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Lt(e,n,t){const r=Xe(e),i=Xe(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}}il.peek=bh;function il(e,n,t,r){const i=yh(t),l=t.enter("emphasis"),s=t.createTracker(r),a=s.move(i);let u=s.move(t.containerPhrasing(e,{after:i,before:a,...s.current()}));const o=u.charCodeAt(0),f=Lt(r.before.charCodeAt(r.before.length-1),o,i);f.inside&&(u=ht(o)+u.slice(1));const c=u.charCodeAt(u.length-1),d=Lt(r.after.charCodeAt(0),c,i);d.inside&&(u=u.slice(0,-1)+ht(c));const p=s.move(i);return l(),t.attentionEncodeSurroundingInfo={after:d.outside,before:f.outside},a+u+p}function bh(e,n,t){return t.options.emphasis||"*"}function kh(e,n){let t=!1;return Hn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,yn}),!!((!e.depth||e.depth<3)&&zn(e)&&(n.options.setext||t))}function wh(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),l=t.createTracker(r);if(kh(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),d=t.containerPhrasing(e,{...l.current(),before:`
|
|
23
|
-
`,after:`
|
|
24
|
-
`});return c(),f(),d+`
|
|
25
|
-
`+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
|
|
26
|
-
`))+1))}const s="#".repeat(i),a=t.enter("headingAtx"),u=t.enter("phrasing");l.move(s+" ");let o=t.containerPhrasing(e,{before:"# ",after:`
|
|
27
|
-
`,...l.current()});return/^[\t ]/.test(o)&&(o=ht(o.charCodeAt(0))+o.slice(1)),o=o?s+" "+o:s,t.options.closeAtx&&(o+=" "+s),u(),a(),o}ll.peek=Sh;function ll(e){return e.value||""}function Sh(){return"<"}sl.peek=Ch;function sl(e,n,t,r){const i=Vn(t),l=i==='"'?"Quote":"Apostrophe",s=t.enter("image");let a=t.enter("label");const u=t.createTracker(r);let o=u.move("![");return o+=u.move(t.safe(e.alt,{before:o,after:"]",...u.current()})),o+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),o+=u.move("<"),o+=u.move(t.safe(e.url,{before:o,after:">",...u.current()})),o+=u.move(">")):(a=t.enter("destinationRaw"),o+=u.move(t.safe(e.url,{before:o,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=t.enter(`title${l}`),o+=u.move(" "+i),o+=u.move(t.safe(e.title,{before:o,after:i,...u.current()})),o+=u.move(i),a()),o+=u.move(")"),s(),o}function Ch(){return"!"}al.peek=vh;function al(e,n,t,r){const i=e.referenceType,l=t.enter("imageReference");let s=t.enter("label");const a=t.createTracker(r);let u=a.move("![");const o=t.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(o+"]["),s();const f=t.stack;t.stack=[],s=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return s(),t.stack=f,l(),i==="full"||!o||o!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function vh(){return"!"}ol.peek=Eh;function ol(e,n,t){let r=e.value||"",i="`",l=-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+" ");++l<t.unsafe.length;){const s=t.unsafe[l],a=t.compilePattern(s);let u;if(s.atBreak)for(;u=a.exec(r);){let o=u.index;r.charCodeAt(o)===10&&r.charCodeAt(o-1)===13&&o--,r=r.slice(0,o)+" "+r.slice(u.index+1)}}return i+r+i}function Eh(){return"`"}function ul(e,n){const t=zn(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))}cl.peek=Nh;function cl(e,n,t,r){const i=Vn(t),l=i==='"'?"Quote":"Apostrophe",s=t.createTracker(r);let a,u;if(ul(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let c=s.move("<");return c+=s.move(t.containerPhrasing(e,{before:c,after:">",...s.current()})),c+=s.move(">"),a(),t.stack=f,c}a=t.enter("link"),u=t.enter("label");let o=s.move("[");return o+=s.move(t.containerPhrasing(e,{before:o,after:"](",...s.current()})),o+=s.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=t.enter("destinationLiteral"),o+=s.move("<"),o+=s.move(t.safe(e.url,{before:o,after:">",...s.current()})),o+=s.move(">")):(u=t.enter("destinationRaw"),o+=s.move(t.safe(e.url,{before:o,after:e.title?" ":")",...s.current()}))),u(),e.title&&(u=t.enter(`title${l}`),o+=s.move(" "+i),o+=s.move(t.safe(e.title,{before:o,after:i,...s.current()})),o+=s.move(i),u()),o+=s.move(")"),a(),o}function Nh(e,n,t){return ul(e,t)?"<":"["}fl.peek=Ih;function fl(e,n,t,r){const i=e.referenceType,l=t.enter("linkReference");let s=t.enter("label");const a=t.createTracker(r);let u=a.move("[");const o=t.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(o+"]["),s();const f=t.stack;t.stack=[],s=t.enter("reference");const c=t.safe(t.associationId(e),{before:u,after:"]",...a.current()});return s(),t.stack=f,l(),i==="full"||!o||o!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Ih(){return"["}function Kn(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Ah(e){const n=Kn(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function jh(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 hl(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 Th(e,n,t,r){const i=t.enter("list"),l=t.bulletCurrent;let s=e.ordered?jh(t):Kn(t);const a=e.ordered?s==="."?")":".":Ah(t);let u=n&&t.bulletLastUsed?s===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&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&&(u=!0),hl(t)===s&&f){let c=-1;for(;++c<e.children.length;){const d=e.children[c];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),t.bulletCurrent=s;const o=t.containerFlow(e,r);return t.bulletLastUsed=s,t.bulletCurrent=l,i(),o}function Ph(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 Rh(e,n,t,r){const i=Ph(t);let l=t.bulletCurrent||Kn(t);n&&n.type==="list"&&n.ordered&&(l=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+l);let s=l.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=t.createTracker(r);a.move(l+" ".repeat(s-l.length)),a.shift(s);const u=t.enter("listItem"),o=t.indentLines(t.containerFlow(e,a.current()),f);return u(),o;function f(c,d,p){return d?(p?"":" ".repeat(s))+c:(p?l:l+" ".repeat(s-l.length))+c}}function Dh(e,n,t,r){const i=t.enter("paragraph"),l=t.enter("phrasing"),s=t.containerPhrasing(e,r);return l(),i(),s}const Lh=Mt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Oh(e,n,t,r){return(e.children.some(function(s){return Lh(s)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function zh(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}pl.peek=Fh;function pl(e,n,t,r){const i=zh(t),l=t.enter("strong"),s=t.createTracker(r),a=s.move(i+i);let u=s.move(t.containerPhrasing(e,{after:i,before:a,...s.current()}));const o=u.charCodeAt(0),f=Lt(r.before.charCodeAt(r.before.length-1),o,i);f.inside&&(u=ht(o)+u.slice(1));const c=u.charCodeAt(u.length-1),d=Lt(r.after.charCodeAt(0),c,i);d.inside&&(u=u.slice(0,-1)+ht(c));const p=s.move(i+i);return l(),t.attentionEncodeSurroundingInfo={after:d.outside,before:f.outside},a+u+p}function Fh(e,n,t){return t.options.strong||"*"}function _h(e,n,t,r){return t.safe(e.value,r)}function Mh(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 Bh(e,n,t){const r=(hl(t)+(t.options.ruleSpaces?" ":"")).repeat(Mh(t));return t.options.ruleSpaces?r.slice(0,-1):r}const dl={blockquote:uh,break:Kr,code:mh,definition:xh,emphasis:il,hardBreak:Kr,heading:wh,html:ll,image:sl,imageReference:al,inlineCode:ol,link:cl,linkReference:fl,list:Th,listItem:Rh,paragraph:Dh,root:Oh,strong:pl,text:_h,thematicBreak:Bh};function qh(){return{enter:{table:$h,tableData:Wr,tableHeader:Wr,tableRow:Uh},exit:{codeText:Vh,table:Hh,tableData:un,tableHeader:un,tableRow:un}}}function $h(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 Hh(e){this.exit(e),this.data.inTable=void 0}function Uh(e){this.enter({type:"tableRow",children:[]},e)}function un(e){this.exit(e)}function Wr(e){this.enter({type:"tableCell",children:[]},e)}function Vh(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Kh));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function Kh(e,n){return n==="|"?n:e}function Wh(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,l=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
28
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:s,tableCell:u,tableRow:a}};function s(p,x,b,S){return o(f(p,b,S),p.align)}function a(p,x,b,S){const y=c(p,b,S),N=o([y]);return N.slice(0,N.indexOf(`
|
|
29
|
-
`))}function u(p,x,b,S){const y=b.enter("tableCell"),N=b.enter("phrasing"),v=b.containerPhrasing(p,{...S,before:l,after:l});return N(),y(),v}function o(p,x){return ah(p,{align:x,alignDelimiters:r,padding:t,stringLength:i})}function f(p,x,b){const S=p.children;let y=-1;const N=[],v=x.enter("table");for(;++y<S.length;)N[y]=c(S[y],x,b);return v(),N}function c(p,x,b){const S=p.children;let y=-1;const N=[],v=x.enter("tableRow");for(;++y<S.length;)N[y]=u(S[y],p,x,b);return v(),N}function d(p,x,b){let S=dl.inlineCode(p,x,b);return b.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function Qh(){return{exit:{taskListCheckValueChecked:Qr,taskListCheckValueUnchecked:Qr,paragraph:Yh}}}function Xh(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Gh}}}function Qr(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function Yh(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 l=-1,s;for(;++l<i.length;){const a=i[l];if(a.type==="paragraph"){s=a;break}}s===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 Gh(e,n,t,r){const i=e.children[0],l=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);l&&a.move(s);let u=dl.listItem(e,n,t,{...r,...a.current()});return l&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,o)),u;function o(f){return f+s}}function Jh(){return[Tf(),Gf(),th(),qh(),Qh()]}function Zh(e){return{extensions:[Pf(),Jf(e),nh(),Wh(e),Xh()]}}const ep={tokenize:sp,partial:!0},ml={tokenize:ap,partial:!0},gl={tokenize:op,partial:!0},xl={tokenize:up,partial:!0},tp={tokenize:cp,partial:!0},yl={name:"wwwAutolink",tokenize:ip,previous:kl},bl={name:"protocolAutolink",tokenize:lp,previous:wl},Ae={name:"emailAutolink",tokenize:rp,previous:Sl},Ne={};function np(){return{text:Ne}}let Me=48;for(;Me<123;)Ne[Me]=Ae,Me++,Me===58?Me=65:Me===91&&(Me=97);Ne[43]=Ae;Ne[45]=Ae;Ne[46]=Ae;Ne[95]=Ae;Ne[72]=[Ae,bl];Ne[104]=[Ae,bl];Ne[87]=[Ae,yl];Ne[119]=[Ae,yl];function rp(e,n,t){const r=this;let i,l;return s;function s(c){return!Sn(c)||!Sl.call(r,r.previous)||Wn(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Sn(c)?(e.consume(c),a):c===64?(e.consume(c),u):t(c)}function u(c){return c===46?e.check(tp,f,o)(c):c===45||c===95||oe(c)?(l=!0,e.consume(c),u):f(c)}function o(c){return e.consume(c),i=!0,u}function f(c){return l&&i&&he(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function ip(e,n,t){const r=this;return i;function i(s){return s!==87&&s!==119||!kl.call(r,r.previous)||Wn(r.events)?t(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ep,e.attempt(ml,e.attempt(gl,l),t),t)(s))}function l(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(s)}}function lp(e,n,t){const r=this;let i="",l=!1;return s;function s(c){return(c===72||c===104)&&wl.call(r,r.previous)&&!Wn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(he(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(c),u}return t(c)}function u(c){return c===47?(e.consume(c),l?o:(l=!0,u)):t(c)}function o(c){return c===null||Rt(c)||J(c)||Be(c)||zt(c)?t(c):e.attempt(ml,e.attempt(gl,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function sp(e,n,t){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),l):t(s)}function l(s){return s===null?t(s):n(s)}}function ap(e,n,t){let r,i,l;return s;function s(o){return o===46||o===95?e.check(xl,u,a)(o):o===null||J(o)||Be(o)||o!==45&&zt(o)?u(o):(l=!0,e.consume(o),s)}function a(o){return o===95?r=!0:(i=r,r=void 0),e.consume(o),s}function u(o){return i||r||!l?t(o):n(o)}}function op(e,n){let t=0,r=0;return i;function i(s){return s===40?(t++,e.consume(s),i):s===41&&r<t?l(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(xl,n,l)(s):s===null||J(s)||Be(s)?n(s):(e.consume(s),i)}function l(s){return s===41&&r++,e.consume(s),i}}function up(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),l):a===93?(e.consume(a),i):a===60||a===null||J(a)||Be(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||J(a)||Be(a)?n(a):r(a)}function l(a){return he(a)?s(a):t(a)}function s(a){return a===59?(e.consume(a),r):he(a)?(e.consume(a),s):t(a)}}function cp(e,n,t){return r;function r(l){return e.consume(l),i}function i(l){return oe(l)?t(l):n(l)}}function kl(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||J(e)}function wl(e){return!he(e)}function Sl(e){return!(e===47||Sn(e))}function Sn(e){return e===43||e===45||e===46||e===95||oe(e)}function Wn(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 fp={tokenize:bp,partial:!0};function hp(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:gp,continuation:{tokenize:xp},exit:yp}},text:{91:{name:"gfmFootnoteCall",tokenize:mp},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:pp,resolveTo:dp}}}}function pp(e,n,t){const r=this;let i=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return t(u);const o=Se(r.sliceSerialize({start:s.end,end:r.now()}));return o.codePointAt(0)!==94||!l.includes(o.slice(1))?t(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),n(u))}}function dp(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 l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",l,n],["enter",s,n],["exit",s,n],["exit",l,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function mp(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",o)}function o(c){if(l>999||c===93&&!s||c===null||c===91||J(c))return t(c);if(c===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(Se(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return J(c)||(s=!0),l++,e.consume(c),c===92?f:o}function f(c){return c===91||c===92||c===93?(e.consume(c),l++,o):o(c)}}function gp(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,s=0,a;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),o}function o(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(s>999||x===93&&!a||x===null||x===91||J(x))return t(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return l=Se(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return J(x)||(a=!0),s++,e.consume(x),x===92?c:f}function c(x){return x===91||x===92||x===93?(e.consume(x),s++,f):f(x)}function d(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(l)||i.push(l),Q(e,p,"gfmFootnoteDefinitionWhitespace")):t(x)}function p(x){return n(x)}}function xp(e,n,t){return e.check(dt,n,e.attempt(fp,n,t))}function yp(e){e.exit("gfmFootnoteDefinition")}function bp(e,n,t){const r=this;return Q(e,i,"gfmFootnoteDefinitionIndent",5);function i(l){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?n(l):t(l)}}function kp(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let o=u;for(;o--;)if(s[o][0]==="exit"&&s[o][1].type==="strikethroughSequenceTemporary"&&s[o][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[o][1].end.offset-s[o][1].start.offset){s[u][1].type="strikethroughSequence",s[o][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[o][1].start),end:Object.assign({},s[u][1].end)},c={type:"strikethroughText",start:Object.assign({},s[o][1].end),end:Object.assign({},s[u][1].start)},d=[["enter",f,a],["enter",s[o][1],a],["exit",s[o][1],a],["enter",c,a]],p=a.parser.constructs.insideSpan.null;p&&ye(d,d.length,0,Ft(p,s.slice(o+1,u),a)),ye(d,d.length,0,[["exit",c,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",f,a]]),ye(s,o-1,u-o+3,d),u=o+d.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function l(s,a,u){const o=this.previous,f=this.events;let c=0;return d;function d(x){return o===126&&f[f.length-1][1].type!=="characterEscape"?u(x):(s.enter("strikethroughSequenceTemporary"),p(x))}function p(x){const b=Xe(o);if(x===126)return c>1?u(x):(s.consume(x),c++,p);if(c<2&&!t)return u(x);const S=s.exit("strikethroughSequenceTemporary"),y=Xe(x);return S._open=!y||y===2&&!!b,S._close=!b||b===2&&!!y,a(x)}}}class wp{constructor(){this.map=[]}add(n,t,r){Sp(this,n,t,r)}consume(n){if(this.map.sort(function(l,s){return l[0]-s[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 l of i)n.push(l);i=r.pop()}this.map.length=0}}function Sp(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 Cp(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 l=r.length-1;r[l]=r[l]==="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 vp(){return{flow:{null:{name:"table",tokenize:Ep,resolveAll:Np}}}}function Ep(e,n,t){const r=this;let i=0,l=0,s;return a;function a(k){let D=r.events.length-1;for(;D>-1;){const E=r.events[D][1].type;if(E==="lineEnding"||E==="linePrefix")D--;else break}const L=D>-1?r.events[D][1].type:null,H=L==="tableHead"||L==="tableRow"?w:u;return H===w&&r.parser.lazy[r.now().line]?t(k):H(k)}function u(k){return e.enter("tableHead"),e.enter("tableRow"),o(k)}function o(k){return k===124||(s=!0,l+=1),f(k)}function f(k){return k===null?t(k):M(k)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),p):t(k):K(k)?Q(e,f,"whitespace")(k):(l+=1,s&&(s=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(k)))}function c(k){return k===null||k===124||J(k)?(e.exit("data"),f(k)):(e.consume(k),k===92?d:c)}function d(k){return k===92||k===124?(e.consume(k),c):c(k)}function p(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(k):(e.enter("tableDelimiterRow"),s=!1,K(k)?Q(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):x(k))}function x(k){return k===45||k===58?S(k):k===124?(s=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),b):F(k)}function b(k){return K(k)?Q(e,S,"whitespace")(k):S(k)}function S(k){return k===58?(l+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(l+=1,y(k)):k===null||M(k)?O(k):F(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),N(k)):F(k)}function N(k){return k===45?(e.consume(k),N):k===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(k))}function v(k){return K(k)?Q(e,O,"whitespace")(k):O(k)}function O(k){return k===124?x(k):k===null||M(k)?!s||i!==l?F(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(k)):F(k)}function F(k){return t(k)}function w(k){return e.enter("tableRow"),z(k)}function z(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),z):k===null||M(k)?(e.exit("tableRow"),n(k)):K(k)?Q(e,z,"whitespace")(k):(e.enter("data"),_(k))}function _(k){return k===null||k===124||J(k)?(e.exit("data"),z(k)):(e.consume(k),k===92?T:_)}function T(k){return k===92||k===124?(e.consume(k),_):_(k)}}function Np(e,n){let t=-1,r=!0,i=0,l=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,o,f,c;const d=new wp;for(;++t<e.length;){const p=e[t],x=p[1];p[0]==="enter"?x.type==="tableHead"?(a=!1,u!==0&&(Xr(d,n,u,o,f),f=void 0,u=0),o={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},d.add(t,0,[["enter",o,n]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,c=void 0,l=[0,0,0,0],s=[0,t+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},d.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,s[2]===0&&(l[1]!==0&&(s[0]=s[1],c=It(d,n,l,i,void 0,c),l=[0,0,0,0]),s[2]=t)):x.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(s[0]=s[1],c=It(d,n,l,i,void 0,c)),l=s,s=[l[1],t,0,0])):x.type==="tableHead"?(a=!0,u=t):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=t,l[1]!==0?(s[0]=s[1],c=It(d,n,l,i,t,c)):s[1]!==0&&(c=It(d,n,s,i,t,c)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(s[3]=t)}for(u!==0&&Xr(d,n,u,o,f),d.consume(n.events),t=-1;++t<n.events.length;){const p=n.events[t];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=Cp(n.events,t))}return e}function It(e,n,t,r,i,l){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(l.end=Object.assign({},Ke(n.events,t[0])),e.add(t[0],0,[["exit",l,n]]));const u=Ke(n.events,t[1]);if(l={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(t[1],0,[["enter",l,n]]),t[2]!==0){const o=Ke(n.events,t[2]),f=Ke(n.events,t[3]),c={type:a,start:Object.assign({},o),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",c,n]]),r!==2){const d=n.events[t[2]],p=n.events[t[3]];if(d[1].end=Object.assign({},p[1].end),d[1].type="chunkText",d[1].contentType="text",t[3]>t[2]+1){const x=t[2]+1,b=t[3]-t[2]-1;e.add(x,b,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(l.end=Object.assign({},Ke(n.events,i)),e.add(i,0,[["exit",l,n]]),l=void 0),l}function Xr(e,n,t,r,i){const l=[],s=Ke(n.events,t);i&&(i.end=Object.assign({},s),l.push(["exit",i,n])),r.end=Object.assign({},s),l.push(["exit",r,n]),e.add(t+1,0,l)}function Ke(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Ip={name:"tasklistCheck",tokenize:jp};function Ap(){return{text:{91:Ip}}}function jp(e,n,t){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),l)}function l(u){return J(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):t(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(u)}function a(u){return M(u)?n(u):K(u)?e.check({tokenize:Tp},n,t)(u):t(u)}}function Tp(e,n,t){return Q(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function Pp(e){return Ti([np(),hp(),kp(e),vp(),Ap()])}const Rp={};function Dp(e){const n=this,t=e||Rp,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Pp(t)),l.push(Jh()),s.push(Zh(t))}const Yr=14e4,Gr=220;function Lp(e){return e.length<=Yr?e:`${e.slice(0,Yr)}
|
|
30
|
-
|
|
31
|
-
…`}function Op(e){return e==="user"?A("chatRoleUser"):e==="assistant"?A("chatRoleAssistant"):e==="tool"?A("chatRoleTool"):e==="system"?A("chatRoleSystem"):A("chatRoleMessage")}function zp(e){const n=e.toLowerCase();return n.includes("exec")||n.includes("shell")||n.includes("command")?h.jsx(Ul,{className:"h-3.5 w-3.5"}):n.includes("search")?h.jsx(En,{className:"h-3.5 w-3.5"}):n.includes("fetch")||n.includes("http")||n.includes("web")?h.jsx(Vl,{className:"h-3.5 w-3.5"}):n.includes("read")||n.includes("file")?h.jsx(Kl,{className:"h-3.5 w-3.5"}):n.includes("message")||n.includes("send")?h.jsx(Wl,{className:"h-3.5 w-3.5"}):n.includes("cron")||n.includes("schedule")?h.jsx(Ql,{className:"h-3.5 w-3.5"}):h.jsx(An,{className:"h-3.5 w-3.5"})}function cn({role:e}){return e==="user"?h.jsx("div",{className:"h-8 w-8 rounded-full bg-primary text-white flex items-center justify-center shadow-sm",children:h.jsx(Hl,{className:"h-4 w-4"})}):e==="assistant"?h.jsx("div",{className:"h-8 w-8 rounded-full bg-slate-900 text-white flex items-center justify-center shadow-sm",children:h.jsx(li,{className:"h-4 w-4"})}):h.jsx("div",{className:"h-8 w-8 rounded-full bg-amber-100 text-amber-700 flex items-center justify-center shadow-sm",children:h.jsx(An,{className:"h-4 w-4"})})}function Cl({text:e,role:n}){const t=n==="user";return h.jsx("div",{className:ie("chat-markdown",t?"chat-markdown-user":"chat-markdown-assistant"),children:h.jsx(cf,{remarkPlugins:[Dp],rehypePlugins:[vf],components:{a:({...r})=>h.jsx("a",{...r,target:"_blank",rel:"noreferrer noopener"})},children:Lp(e)})})}function Qn({card:e}){var s;const n=e.kind==="call"?A("chatToolCall"):A("chatToolResult"),t=((s=e.text)==null?void 0:s.trim())??"",r=t.length>Gr||t.includes(`
|
|
32
|
-
`),i=r?`${t.slice(0,Gr)}…`:t,l=e.kind==="result"||e.hasResult;return h.jsxs("div",{className:"rounded-xl border border-amber-200/80 bg-amber-50/60 px-3 py-2.5",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-amber-800 font-semibold",children:[zp(e.name),h.jsx("span",{children:n}),typeof e._workflowStep=="number"&&h.jsxs("span",{className:"rounded-md bg-amber-100 px-1.5 py-0.5 text-[10px] text-amber-700",children:["#",e._workflowStep+1]}),h.jsx("span",{className:"font-mono text-[11px] text-amber-900/80",children:e.name})]}),e.detail&&h.jsx("div",{className:"mt-1 text-[11px] text-amber-800/90 font-mono break-words",children:e.detail}),l&&h.jsx("div",{className:"mt-2",children:t?r?h.jsxs("details",{className:"group",children:[h.jsx("summary",{className:"cursor-pointer text-[11px] text-amber-700",children:A("chatToolOutput")}),h.jsx("pre",{className:"mt-2 rounded-lg border border-amber-200 bg-amber-100/40 p-2 text-[11px] whitespace-pre-wrap break-words text-amber-900",children:t})]}):h.jsx("pre",{className:"rounded-lg border border-amber-200 bg-amber-100/40 p-2 text-[11px] whitespace-pre-wrap break-words text-amber-900",children:i}):h.jsx("div",{className:"text-[11px] text-amber-700/80",children:A("chatToolNoOutput")})})]})}function vl({cards:e}){const n=e.map(t=>t.name.trim()).filter(t=>t.length>0).join(" → ");return h.jsxs("details",{className:"rounded-xl border border-amber-200/80 bg-amber-50/50 p-3",children:[h.jsx("summary",{className:"cursor-pointer list-none",children:h.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-amber-800 font-semibold",children:[h.jsx(An,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:A("chatToolWorkflow")}),h.jsx("span",{className:"font-mono text-[11px] text-amber-900/90",children:n||"tool"}),h.jsx("span",{className:"rounded-md bg-amber-100 px-1.5 py-0.5 text-[10px] text-amber-700",children:e.length}),h.jsx("span",{className:"text-[11px] font-normal text-amber-700/90",children:A("chatToolWorkflowDetails")})]})}),h.jsx("div",{className:"mt-3 space-y-2",children:e.map((t,r)=>h.jsx(Qn,{card:{...t,_workflowStep:r}},`${t.kind}-${t.callId??t.name}-${r}`))})]})}function El({reasoning:e,isUser:n}){return h.jsxs("details",{className:"mt-3",children:[h.jsx("summary",{className:ie("cursor-pointer text-xs",n?"text-primary-100":"text-gray-500"),children:A("chatReasoning")}),h.jsx("pre",{className:ie("mt-2 text-[11px] whitespace-pre-wrap break-words rounded-lg p-2",n?"bg-primary-700/60":"bg-gray-100"),children:e})]})}function Fp({message:e}){const n=$s(e),t=Hs(e.content).trim(),r=typeof e.reasoning_content=="string"?e.reasoning_content.trim():"",i=Us(e),l=n==="user",s=!!t&&!(n==="tool"&&i.length>0);return h.jsxs("div",{className:ie("rounded-2xl border px-4 py-3 shadow-sm",l?"bg-primary text-white border-primary":n==="assistant"?"bg-white text-gray-900 border-gray-200":"bg-orange-50/70 text-gray-900 border-orange-200/80"),children:[s&&h.jsx(Cl,{text:t,role:n}),r&&h.jsx(El,{reasoning:r,isUser:l}),i.length>0&&h.jsx("div",{className:ie("space-y-2",(s||r)&&"mt-3"),children:i.length>1?h.jsx(vl,{cards:i}):i.map((a,u)=>h.jsx(Qn,{card:{...a}},`${a.kind}-${a.name}-${a.callId??u}`))})]})}function _p({item:e}){const n=[];let t=0;for(;t<e.segments.length;){const r=e.segments[t];if(!r){t+=1;continue}if(r.kind==="assistant_message"){const s=!!r.text,a=!!r.reasoning;(s||a)&&n.push(h.jsxs("div",{children:[s&&h.jsx(Cl,{text:r.text,role:"assistant"}),a&&h.jsx(El,{reasoning:r.reasoning,isUser:!1})]},`${r.key}-${t}`)),t+=1;continue}const i=[];let l=t;for(;l<e.segments.length;){const s=e.segments[l];if(!s||s.kind!=="tool_card")break;i.push(s.card),l+=1}i.length>1?n.push(h.jsx(vl,{cards:i},`workflow-${r.key}-${t}`)):i.length===1&&n.push(h.jsx(Qn,{card:i[0]},`${r.key}-${t}`)),t=l}return h.jsx("div",{className:"rounded-2xl border px-4 py-3 shadow-sm bg-white text-gray-900 border-gray-200",children:h.jsx("div",{className:"space-y-3",children:n})})}function Mp({events:e,isSending:n,className:t}){const r=R.useMemo(()=>qs(e),[e]);return h.jsxs("div",{className:ie("space-y-5",t),children:[r.map(i=>{const l=i.kind==="assistant_turn"?"assistant":i.role,s=l==="user";return h.jsxs("div",{className:ie("flex gap-3",s?"justify-end":"justify-start"),children:[!s&&h.jsx(cn,{role:l}),h.jsxs("div",{className:ie("max-w-[92%] min-w-[280px] space-y-2",s&&"flex flex-col items-end"),children:[i.kind==="assistant_turn"?h.jsx(_p,{item:i}):h.jsx(Fp,{message:i.message}),h.jsxs("div",{className:ie("text-[11px] px-1",s?"text-primary-300":"text-gray-400"),children:[Op(l)," · ",Ot(i.timestamp)]})]}),s&&h.jsx(cn,{role:l})]},i.key)}),n&&h.jsxs("div",{className:"flex gap-3 justify-start",children:[h.jsx(cn,{role:"assistant"}),h.jsx("div",{className:"rounded-2xl border border-gray-200 bg-white px-4 py-3 text-sm text-gray-500 shadow-sm",children:A("chatTyping")})]})]})}var qt="Popover",[Nl]=Zl(qt,[ui]),xt=ui(),[Bp,ze]=Nl(qt),Il=e=>{const{__scopePopover:n,children:t,open:r,defaultOpen:i,onOpenChange:l,modal:s=!1}=e,a=xt(n),u=R.useRef(null),[o,f]=R.useState(!1),[c,d]=Xl({prop:r,defaultProp:i??!1,onChange:l,caller:qt});return h.jsx(Yl,{...a,children:h.jsx(Bp,{scope:n,contentId:Gl(),triggerRef:u,open:c,onOpenChange:d,onOpenToggle:R.useCallback(()=>d(p=>!p),[d]),hasCustomAnchor:o,onCustomAnchorAdd:R.useCallback(()=>f(!0),[]),onCustomAnchorRemove:R.useCallback(()=>f(!1),[]),modal:s,children:t})})};Il.displayName=qt;var Al="PopoverAnchor",qp=R.forwardRef((e,n)=>{const{__scopePopover:t,...r}=e,i=ze(Al,t),l=xt(t),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return R.useEffect(()=>(s(),()=>a()),[s,a]),h.jsx(oi,{...l,...r,ref:n})});qp.displayName=Al;var jl="PopoverTrigger",Tl=R.forwardRef((e,n)=>{const{__scopePopover:t,...r}=e,i=ze(jl,t),l=xt(t),s=si(n,i.triggerRef),a=h.jsx(ai.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ol(i.open),...r,ref:s,onClick:st(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:h.jsx(oi,{asChild:!0,...l,children:a})});Tl.displayName=jl;var Xn="PopoverPortal",[$p,Hp]=Nl(Xn,{forceMount:void 0}),Pl=e=>{const{__scopePopover:n,forceMount:t,children:r,container:i}=e,l=ze(Xn,n);return h.jsx($p,{scope:n,forceMount:t,children:h.jsx(fi,{present:t||l.open,children:h.jsx(Jl,{asChild:!0,container:i,children:r})})})};Pl.displayName=Xn;var Ye="PopoverContent",Rl=R.forwardRef((e,n)=>{const t=Hp(Ye,e.__scopePopover),{forceMount:r=t.forceMount,...i}=e,l=ze(Ye,e.__scopePopover);return h.jsx(fi,{present:r||l.open,children:l.modal?h.jsx(Vp,{...i,ref:n}):h.jsx(Kp,{...i,ref:n})})});Rl.displayName=Ye;var Up=ns("PopoverContent.RemoveScroll"),Vp=R.forwardRef((e,n)=>{const t=ze(Ye,e.__scopePopover),r=R.useRef(null),i=si(n,r),l=R.useRef(!1);return R.useEffect(()=>{const s=r.current;if(s)return es(s)},[]),h.jsx(ts,{as:Up,allowPinchZoom:!0,children:h.jsx(Dl,{...e,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:st(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),l.current||(a=t.triggerRef.current)==null||a.focus()}),onPointerDownOutside:st(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,o=a.button===2||u;l.current=o},{checkForDefaultPrevented:!1}),onFocusOutside:st(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Kp=R.forwardRef((e,n)=>{const t=ze(Ye,e.__scopePopover),r=R.useRef(!1),i=R.useRef(!1);return h.jsx(Dl,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,l),l.defaultPrevented||(r.current||(a=t.triggerRef.current)==null||a.focus(),l.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:l=>{var u,o;(u=e.onInteractOutside)==null||u.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=l.target;((o=t.triggerRef.current)==null?void 0:o.contains(s))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&i.current&&l.preventDefault()}})}),Dl=R.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:o,onInteractOutside:f,...c}=e,d=ze(Ye,t),p=xt(t);return rs(),h.jsx(is,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:l,children:h.jsx(ls,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:o,onDismiss:()=>d.onOpenChange(!1),children:h.jsx(ss,{"data-state":Ol(d.open),role:"dialog",id:d.contentId,...p,...c,ref:n,style:{...c.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ll="PopoverClose",Wp=R.forwardRef((e,n)=>{const{__scopePopover:t,...r}=e,i=ze(Ll,t);return h.jsx(ai.button,{type:"button",...r,ref:n,onClick:st(e.onClick,()=>i.onOpenChange(!1))})});Wp.displayName=Ll;var Qp="PopoverArrow",Xp=R.forwardRef((e,n)=>{const{__scopePopover:t,...r}=e,i=xt(t);return h.jsx(as,{...i,...r,ref:n})});Xp.displayName=Qp;function Ol(e){return e?"open":"closed"}var Yp=Il,Gp=Tl,Jp=Pl,zl=Rl;const Zp=Yp,ed=Gp,Fl=R.forwardRef(({className:e,sideOffset:n=8,align:t="start",...r},i)=>h.jsx(Jp,{children:h.jsx(zl,{ref:i,sideOffset:n,align:t,className:ie("z-[var(--z-popover,50)] w-72 overflow-hidden rounded-2xl border border-gray-200/50 bg-white p-4 shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Fl.displayName=zl.displayName;function td({records:e,isLoading:n=!1,selectedSkills:t,onSelectedSkillsChange:r}){const{language:i}=pi(),[l,s]=R.useState(""),a=R.useMemo(()=>new Set(t),[t]),u=t.length,o=R.useMemo(()=>{const c=l.trim().toLowerCase();return c?e.filter(d=>[d.label,d.spec,d.description,d.descriptionZh].filter(x=>typeof x=="string"&&x.trim().length>0).join(" ").toLowerCase().includes(c)):e},[l,e]),f=c=>{var p;const d=(p=c.spec)==null?void 0:p.trim();if(d){if(a.has(d)){r(t.filter(x=>x!==d));return}r([...t,d])}};return h.jsxs(Zp,{children:[h.jsx(ed,{asChild:!0,children:h.jsxs("button",{type:"button",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-gray-600 hover:bg-gray-100 hover:text-gray-900 transition-colors",children:[h.jsx(In,{className:"h-4 w-4"}),h.jsx("span",{children:A("chatSkillsPickerTitle")}),u>0&&h.jsx("span",{className:"ml-0.5 min-w-[18px] h-[18px] flex items-center justify-center rounded-full bg-primary/10 text-primary text-[10px] font-semibold",children:u})]})}),h.jsxs(Fl,{side:"top",align:"start",className:"w-[360px] p-0",children:[h.jsxs("div",{className:"space-y-2 border-b border-gray-100 px-4 py-3",children:[h.jsx("div",{className:"text-sm font-semibold text-gray-900",children:A("chatSkillsPickerTitle")}),h.jsxs("div",{className:"relative",children:[h.jsx(En,{className:"pointer-events-none absolute left-3 top-2.5 h-3.5 w-3.5 text-gray-400"}),h.jsx(jn,{value:l,onChange:c=>s(c.target.value),placeholder:A("chatSkillsPickerSearchPlaceholder"),className:"h-8 rounded-lg pl-8 text-xs"})]})]}),h.jsx("div",{className:"max-h-[320px] overflow-y-auto custom-scrollbar",children:n?h.jsx("div",{className:"p-4 text-xs text-gray-500",children:A("sessionsLoading")}):o.length===0?h.jsx("div",{className:"p-4 text-xs text-gray-500 text-center",children:A("chatSkillsPickerEmpty")}):h.jsx("div",{className:"py-1",children:o.map(c=>{var d,p;return h.jsxs("button",{type:"button",onClick:()=>f(c),className:"flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-gray-50",children:[h.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-500",children:h.jsx(os,{className:"h-4 w-4"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"truncate text-sm text-gray-900",children:c.label||c.spec}),c.origin==="builtin"&&h.jsx("span",{className:"shrink-0 text-[10px] bg-primary/10 text-primary px-1.5 py-0.5 rounded-full font-medium",children:A("chatSkillsPickerOfficial")})]}),h.jsx("div",{className:"mt-0.5 truncate text-xs text-gray-500",children:((d=i==="zh"?c.descriptionZh:c.description)==null?void 0:d.trim())||((p=c.description)==null?void 0:p.trim())||A("chatSkillsPickerNoDescription")})]}),h.jsx("div",{className:"ml-3 shrink-0",children:h.jsx("span",{className:a.has(c.spec)?"inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary text-white":"inline-flex h-5 w-5 items-center justify-center rounded-full border border-gray-300 bg-white",children:a.has(c.spec)&&h.jsx(us,{className:"h-3 w-3"})})})]},c.spec)})})}),h.jsx("div",{className:"px-4 py-2.5 border-t border-gray-100",children:h.jsxs(fn,{to:"/marketplace/skills",className:"inline-flex items-center gap-1.5 text-xs font-medium text-primary hover:text-primary/80 transition-colors",children:[A("chatSkillsPickerManage"),h.jsx(cs,{className:"h-3 w-3"})]})})]})]})}function nd({isProviderStateResolved:e,draft:n,onDraftChange:t,onSend:r,onStop:i,onGoToProviders:l,canStopGeneration:s,stopDisabledReason:a=null,sendError:u=null,isSending:o,queuedCount:f,modelOptions:c,selectedModel:d,onSelectedModelChange:p,skillRecords:x,isSkillsLoading:b=!1,selectedSkills:S,onSelectedSkillsChange:y}){const N=c.length>0,v=!e&&!N,O=e&&!N,F=(v||O)&&!o,w=c.find(T=>T.value===d),z=a==="__preparing__"?A("chatStopPreparing"):(a==null?void 0:a.trim())||A("chatStopUnavailable"),_=S.map(T=>{const k=x.find(D=>D.spec===T);return{spec:T,label:(k==null?void 0:k.label)||T}});return h.jsx("div",{className:"border-t border-gray-200/80 bg-white p-4",children:h.jsx("div",{className:"mx-auto w-full max-w-[min(1120px,100%)]",children:h.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-card overflow-hidden",children:[h.jsx("textarea",{value:n,onChange:T=>t(T.target.value),disabled:F,onKeyDown:T=>{if(T.key==="Escape"&&o&&s){T.preventDefault(),i();return}T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),r())},placeholder:v?"":N?A("chatInputPlaceholder"):A("chatModelNoOptions"),className:"w-full min-h-[68px] max-h-[220px] resize-y bg-transparent outline-none text-sm px-4 py-3 text-gray-800 placeholder:text-gray-400"}),v&&h.jsx("div",{className:"px-4 pb-2",children:h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2",children:[h.jsx("span",{className:"h-3 w-28 animate-pulse rounded bg-gray-200"}),h.jsx("span",{className:"h-3 w-16 animate-pulse rounded bg-gray-200"})]})}),O&&h.jsx("div",{className:"px-4 pb-2",children:h.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-3 py-1.5 text-xs text-amber-800",children:[h.jsx("span",{children:A("chatModelNoOptions")}),h.jsx("button",{type:"button",onClick:l,className:"font-semibold text-amber-900 underline-offset-2 hover:underline",children:A("chatGoConfigureProvider")})]})}),_.length>0&&h.jsx("div",{className:"px-4 pb-2",children:h.jsx("div",{className:"flex flex-wrap items-center gap-2",children:_.map(T=>h.jsxs("button",{type:"button",onClick:()=>y(S.filter(k=>k!==T.spec)),className:"inline-flex max-w-[200px] items-center gap-1.5 rounded-full bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary",children:[h.jsx("span",{className:"truncate",children:T.label}),h.jsx(fs,{className:"h-3 w-3 shrink-0"})]},T.spec))})}),h.jsxs("div",{className:"flex items-center justify-between px-3 pb-3",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(td,{records:x,isLoading:b,selectedSkills:S,onSelectedSkillsChange:y}),h.jsxs(jt,{value:N?d:void 0,onValueChange:p,disabled:!N,children:[h.jsx(Tt,{className:"h-8 w-auto min-w-[220px] rounded-lg border-0 bg-transparent shadow-none text-xs font-medium text-gray-600 hover:bg-gray-100 focus:ring-0 px-3",children:w?h.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-left",children:[h.jsx(hs,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),h.jsxs("span",{className:"truncate text-xs font-semibold text-gray-700",children:[w.providerLabel,"/",w.modelLabel]})]}):v?h.jsx("div",{className:"h-3 w-24 animate-pulse rounded bg-gray-200"}):h.jsx(di,{placeholder:A("chatSelectModel")})}),h.jsxs(Pt,{className:"w-[320px]",children:[c.length===0&&(v?h.jsxs("div",{className:"space-y-2 px-3 py-2",children:[h.jsx("div",{className:"h-3 w-36 animate-pulse rounded bg-gray-200"}),h.jsx("div",{className:"h-3 w-28 animate-pulse rounded bg-gray-200"}),h.jsx("div",{className:"h-3 w-32 animate-pulse rounded bg-gray-200"})]}):h.jsx("div",{className:"px-3 py-2 text-xs text-gray-500",children:A("chatModelNoOptions")})),c.map(T=>h.jsx(We,{value:T.value,className:"py-2",children:h.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[h.jsx("span",{className:"truncate text-xs font-semibold text-gray-800",children:T.modelLabel}),h.jsx("span",{className:"truncate text-[11px] text-gray-500",children:T.providerLabel})]})},T.value))]})]}),h.jsx(Jn,{children:h.jsxs(Zn,{children:[h.jsx(er,{asChild:!0,children:h.jsx("button",{type:"button",disabled:!0,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-gray-400 cursor-not-allowed",children:h.jsx(ps,{className:"h-4 w-4"})})}),h.jsx(tr,{side:"top",children:h.jsx("p",{className:"text-xs",children:A("chatInputAttachComingSoon")})})]})})]}),h.jsxs("div",{className:"flex flex-col items-end gap-1",children:[(u==null?void 0:u.trim())&&h.jsx("div",{className:"max-w-[420px] text-right text-[11px] text-red-600",children:u}),h.jsxs("div",{className:"flex items-center gap-2",children:[o&&f>0&&h.jsxs("span",{className:"text-[11px] text-gray-400",children:[A("chatQueuedHintPrefix")," ",f," ",A("chatQueuedHintSuffix")]}),o?s?h.jsxs(Ie,{size:"sm",variant:"destructive",className:"rounded-lg",onClick:()=>void i(),children:[h.jsx(Gn,{className:"h-3.5 w-3.5 mr-1.5"}),A("chatStop")]}):h.jsx(Jn,{children:h.jsxs(Zn,{children:[h.jsx(er,{asChild:!0,children:h.jsx("span",{children:h.jsxs(Ie,{size:"sm",className:"rounded-lg",disabled:!0,children:[h.jsx(Gn,{className:"h-3.5 w-3.5 mr-1.5"}),A("chatStop")]})})}),h.jsx(tr,{side:"top",children:h.jsx("p",{className:"text-xs",children:z})})]})}):h.jsxs(Ie,{size:"sm",className:"rounded-lg",onClick:()=>void r(),disabled:n.trim().length===0||!N,children:[h.jsx(ds,{className:"h-3.5 w-3.5 mr-1.5"}),A("chatSend")]})]})]})]})]})})})}const rd=[{icon:ms,titleKey:"chatWelcomeCapability1Title",descKey:"chatWelcomeCapability1Desc"},{icon:In,titleKey:"chatWelcomeCapability2Title",descKey:"chatWelcomeCapability2Desc"},{icon:Nn,titleKey:"chatWelcomeCapability3Title",descKey:"chatWelcomeCapability3Desc"}];function id({onCreateSession:e}){return h.jsx("div",{className:"h-full flex items-center justify-center p-8",children:h.jsxs("div",{className:"max-w-lg w-full text-center",children:[h.jsx("div",{className:"mx-auto mb-6 h-16 w-16 rounded-2xl bg-primary/10 flex items-center justify-center",children:h.jsx(li,{className:"h-8 w-8 text-primary"})}),h.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:A("chatWelcomeTitle")}),h.jsx("p",{className:"text-sm text-gray-500 mb-8",children:A("chatWelcomeSubtitle")}),h.jsx("div",{className:"grid grid-cols-3 gap-3",children:rd.map(n=>{const t=n.icon;return h.jsxs("button",{onClick:e,className:"rounded-2xl border border-gray-200 bg-white p-4 text-left shadow-card hover:shadow-card-hover transition-shadow cursor-pointer",children:[h.jsx("div",{className:"h-9 w-9 rounded-xl bg-primary/8 flex items-center justify-center mb-3",children:h.jsx(t,{className:"h-4.5 w-4.5 text-primary"})}),h.jsx("div",{className:"text-sm font-semibold text-gray-900 mb-1",children:A(n.titleKey)}),h.jsx("div",{className:"text-[11px] text-gray-500 leading-relaxed",children:A(n.descKey)})]},n.titleKey)})})]})})}function ld(){return h.jsxs("section",{className:"flex-1 min-h-0 flex flex-col overflow-hidden bg-gradient-to-b from-gray-50/60 to-white",children:[h.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar",children:h.jsx("div",{className:"mx-auto w-full max-w-[min(1120px,100%)] px-6 py-5",children:h.jsxs("div",{className:"space-y-4",children:[h.jsx("div",{className:"h-6 w-48 animate-pulse rounded bg-gray-200"}),h.jsx("div",{className:"h-24 w-[78%] animate-pulse rounded-2xl bg-gray-200/80"}),h.jsx("div",{className:"h-20 w-[62%] animate-pulse rounded-2xl bg-gray-200/80"}),h.jsx("div",{className:"h-28 w-[84%] animate-pulse rounded-2xl bg-gray-200/80"})]})})}),h.jsx("div",{className:"border-t border-gray-200/80 bg-white p-4",children:h.jsx("div",{className:"mx-auto w-full max-w-[min(1120px,100%)]",children:h.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-card p-4",children:[h.jsx("div",{className:"h-16 w-full animate-pulse rounded-xl bg-gray-200/80"}),h.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[h.jsx("div",{className:"h-8 w-36 animate-pulse rounded-lg bg-gray-200/80"}),h.jsx("div",{className:"h-8 w-20 animate-pulse rounded-lg bg-gray-200/80"})]})]})})})]})}function sd({isProviderStateResolved:e,modelOptions:n,selectedModel:t,onSelectedModelChange:r,onGoToProviders:i,skillRecords:l,isSkillsLoading:s=!1,selectedSkills:a,onSelectedSkillsChange:u,selectedSessionKey:o,sessionDisplayName:f,canDeleteSession:c,isDeletePending:d,onDeleteSession:p,onCreateSession:x,threadRef:b,onThreadScroll:S,isHistoryLoading:y,mergedEvents:N,isSending:v,isAwaitingAssistantOutput:O,streamingAssistantText:F,draft:w,onDraftChange:z,onSend:_,onStop:T,canStopGeneration:k,stopDisabledReason:D,sendError:L,queuedCount:H}){const E=!o&&N.length===0,j=n.length>0,$=e&&!j,U=y&&N.length===0&&!v&&!O&&!F.trim();return e?h.jsxs("section",{className:"flex-1 min-h-0 flex flex-col overflow-hidden bg-gradient-to-b from-gray-50/60 to-white",children:[o&&h.jsxs("div",{className:"px-5 py-3 border-b border-gray-200/60 bg-white/80 backdrop-blur-sm flex items-center justify-between shrink-0",children:[h.jsx("div",{className:"min-w-0 flex-1",children:h.jsx("span",{className:"text-sm font-medium text-gray-700 truncate",children:f||o})}),h.jsx(Ie,{variant:"ghost",size:"icon",className:"rounded-lg shrink-0 text-gray-400 hover:text-destructive",onClick:p,disabled:!c||d,children:h.jsx(ci,{className:"h-4 w-4"})})]}),$&&h.jsxs("div",{className:"px-5 py-2.5 border-b border-amber-200/70 bg-amber-50/70 flex items-center justify-between gap-3 shrink-0",children:[h.jsx("span",{className:"text-xs text-amber-800",children:A("chatModelNoOptions")}),h.jsx("button",{type:"button",onClick:i,className:"text-xs font-semibold text-amber-900 underline-offset-2 hover:underline",children:A("chatGoConfigureProvider")})]}),h.jsx("div",{ref:b,onScroll:S,className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar",children:E?h.jsx(id,{onCreateSession:x}):U?h.jsx("div",{className:"h-full"}):N.length===0?h.jsx("div",{className:"px-5 py-5 text-sm text-gray-500",children:A("chatNoMessages")}):h.jsx("div",{className:"mx-auto w-full max-w-[min(1120px,100%)] px-6 py-5",children:h.jsx(Mp,{events:N,isSending:v&&O})})}),h.jsx(nd,{isProviderStateResolved:e,draft:w,onDraftChange:z,onSend:_,onStop:T,onGoToProviders:i,canStopGeneration:k,stopDisabledReason:D,sendError:L,isSending:v,queuedCount:H,modelOptions:n,selectedModel:t,onSelectedModelChange:r,skillRecords:l,isSkillsLoading:s,selectedSkills:a,onSelectedSkillsChange:u})]}):h.jsx(ld,{})}function Jr(e){return Ot(e??void 0)}function ad(e){return typeof e!="number"||!Number.isFinite(e)?"-":Ot(new Date(e))}function od(e){if(typeof e!="number"||!Number.isFinite(e))return"-";const n=Math.round(e/1e3);if(n<60)return`${n}s`;const t=Math.round(n/60);if(t<60)return`${t}m`;const r=Math.round(t/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}function ud(e){const n=e.schedule;return n.kind==="cron"?n.expr?`cron ${n.expr}`:"cron":n.kind==="every"?`every ${od(n.everyMs)}`:n.kind==="at"?`at ${ad(n.atMs)}`:"-"}function cd(e){if(!e.payload.deliver)return"-";const n=e.payload.channel??"-",t=e.payload.to??"-";return`${n}:${t}`}function fd(e,n){const t=n.trim().toLowerCase();return t?[e.id,e.name,e.payload.message,e.payload.channel??"",e.payload.to??""].join(" ").toLowerCase().includes(t):!0}function hd(e,n){return n==="all"?!0:n==="enabled"?e.enabled:!e.enabled}function pd(){var x;const[e,n]=R.useState(""),[t,r]=R.useState("all"),i=Ss({all:!0}),l=Cs(),s=vs(),a=Es(),{confirm:u,ConfirmDialog:o}=hi(),f=R.useMemo(()=>{var S;return(((S=i.data)==null?void 0:S.jobs)??[]).filter(y=>fd(y,e)).filter(y=>hd(y,t))},[i.data,e,t]),c=async b=>{await u({title:`${A("cronDeleteConfirm")}?`,description:b.name?`${b.name} (${b.id})`:b.id,variant:"destructive",confirmLabel:A("delete")})&&l.mutate({id:b.id})},d=async b=>{const S=!b.enabled;await u({title:S?`${A("cronEnableConfirm")}?`:`${A("cronDisableConfirm")}?`,description:b.name?`${b.name} (${b.id})`:b.id,variant:S?"default":"destructive",confirmLabel:S?A("cronEnable"):A("cronDisable")})&&s.mutate({id:b.id,enabled:S})},p=async b=>{const S=!b.enabled;await u({title:S?`${A("cronRunForceConfirm")}?`:`${A("cronRunConfirm")}?`,description:b.name?`${b.name} (${b.id})`:b.id,confirmLabel:A("cronRunNow")})&&a.mutate({id:b.id,force:S})};return h.jsxs(_s,{fullHeight:!0,children:[h.jsx(Ms,{title:A("cronPageTitle"),description:A("cronPageDescription"),actions:h.jsx(Ie,{variant:"ghost",size:"icon",className:"h-9 w-9 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100",onClick:()=>i.refetch(),children:h.jsx(gs,{className:ie("h-4 w-4",i.isFetching&&"animate-spin")})})}),h.jsx("div",{className:"mb-6",children:h.jsxs("div",{className:"flex flex-wrap gap-3 items-center",children:[h.jsxs("div",{className:"relative flex-1 min-w-[240px]",children:[h.jsx(jn,{value:e,onChange:b=>n(b.target.value),placeholder:A("cronSearchPlaceholder"),className:"pl-9"}),h.jsx(Nn,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"})]}),h.jsx("div",{className:"min-w-[180px]",children:h.jsxs(jt,{value:t,onValueChange:b=>r(b),children:[h.jsx(Tt,{className:"w-full",children:h.jsx(di,{placeholder:A("cronStatusLabel")})}),h.jsxs(Pt,{children:[h.jsx(We,{value:"all",children:A("cronStatusAll")}),h.jsx(We,{value:"enabled",children:A("cronStatusEnabled")}),h.jsx(We,{value:"disabled",children:A("cronStatusDisabled")})]})]})}),h.jsxs("div",{className:"text-xs text-gray-500 ml-auto",children:[A("cronTotalLabel"),": ",((x=i.data)==null?void 0:x.total)??0," / ",f.length]})]})}),h.jsx("div",{className:"flex-1 overflow-auto custom-scrollbar",children:i.isLoading?h.jsx("div",{className:"text-sm text-gray-400 p-4 text-center",children:A("cronLoading")}):f.length===0?h.jsx("div",{className:"text-sm text-gray-400 p-4 text-center",children:A("cronEmpty")}):h.jsx("div",{className:"space-y-4",children:f.map(b=>h.jsx(Ks,{className:"border border-gray-200",children:h.jsx(Ws,{className:"pt-5 pb-5",children:h.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[h.jsxs("div",{className:"min-w-[220px] flex-1",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-sm font-semibold text-gray-900",children:b.name||b.id}),h.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full bg-gray-100 text-gray-500",children:b.id}),h.jsx("span",{className:ie("text-[10px] font-semibold px-2 py-0.5 rounded-full",b.enabled?"bg-emerald-50 text-emerald-700":"bg-gray-100 text-gray-500"),children:b.enabled?A("enabled"):A("disabled")}),b.deleteAfterRun&&h.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full bg-amber-50 text-amber-700",children:A("cronOneShot")})]}),h.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[A("cronScheduleLabel"),": ",ud(b)]}),h.jsx("div",{className:"mt-2 text-sm text-gray-700 whitespace-pre-wrap break-words",children:b.payload.message}),h.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[A("cronDeliverTo"),": ",cd(b)]})]}),h.jsxs("div",{className:"min-w-[220px] text-xs text-gray-500 space-y-2",children:[h.jsxs("div",{children:[h.jsxs("span",{className:"font-medium text-gray-700",children:[A("cronNextRun"),":"]})," ",Jr(b.state.nextRunAt)]}),h.jsxs("div",{children:[h.jsxs("span",{className:"font-medium text-gray-700",children:[A("cronLastRun"),":"]})," ",Jr(b.state.lastRunAt)]}),h.jsxs("div",{children:[h.jsxs("span",{className:"font-medium text-gray-700",children:[A("cronLastStatus"),":"]})," ",b.state.lastStatus??"-"]}),b.state.lastError&&h.jsx("div",{className:"text-[11px] text-red-500 break-words",children:b.state.lastError})]}),h.jsxs("div",{className:"flex items-start gap-2 flex-wrap justify-end",children:[h.jsxs(Ie,{variant:"subtle",size:"sm",onClick:()=>p(b),className:"gap-1",children:[h.jsx(xs,{className:"h-3.5 w-3.5"}),A("cronRunNow")]}),h.jsxs(Ie,{variant:b.enabled?"outline":"primary",size:"sm",onClick:()=>d(b),className:"gap-1",children:[h.jsx(ys,{className:"h-3.5 w-3.5"}),b.enabled?A("cronDisable"):A("cronEnable")]}),h.jsxs(Ie,{variant:"destructive",size:"sm",onClick:()=>c(b),className:"gap-1",children:[h.jsx(ci,{className:"h-3.5 w-3.5"}),A("delete")]})]})]})})},b.id))})}),h.jsx(o,{})]})}function dd(e){if(e instanceof Error){const t=e.message.trim();if(t)return t}return String(e??"").trim()||"Failed to send message"}function Cn(e){e.setIsSending(!1),e.setOptimisticUserEvent(null),e.setStreamingSessionEvents([]),e.setStreamingAssistantText(""),e.setStreamingAssistantTimestamp(null),e.setIsAwaitingAssistantOutput(!1),e.setCanStopCurrentRun(!1),e.setStopDisabledReason(null),e.setLastSendError(null)}function md(e){if(!Array.isArray(e))return[];const n=new Set;for(const t of e){const r=t.trim();r&&n.add(r)}return[...n]}function gd(e){if(e instanceof DOMException&&e.name==="AbortError")return!0;if(e instanceof Error){if(e.name==="AbortError")return!0;const n=e.message.toLowerCase();if(n.includes("aborted")||n.includes("abort"))return!0}return!1}function Zr(e,n="message.assistant.local"){const t=new Date().toISOString();return{seq:Date.now(),type:n,timestamp:t,message:{role:"assistant",content:e,timestamp:t}}}async function ei(e){await e.refetchSessions();const n=e.selectedSessionKeyRef.current;(!n||n===e.currentSessionKey||e.resultSessionKey&&n===e.resultSessionKey)&&await e.refetchHistory()}function xd(e,n){e(t=>{const r=[...t],i=r.findIndex(l=>l.seq===n.seq);return i>=0?r[i]=n:r.push(n),r})}async function ti(e){const{runId:n,runIdRef:t,activeRunRef:r,selectedSessionKeyRef:i,setSelectedSessionKey:l,setDraft:s,refetchSessions:a,refetchHistory:u,restoreDraftOnError:o,sourceSessionKey:f,sourceAgentId:c,sourceMessage:d,sourceStopSupported:p,sourceStopReason:x,optimisticUserEvent:b,openStream:S,setters:y}=e,N=new AbortController;r.current={localRunId:n,sessionKey:f,...c?{agentId:c}:{},requestAbortController:N,backendStopSupported:!!p,...x?{backendStopReason:x}:{}},y.setStreamingSessionEvents([]),y.setStreamingAssistantText(""),y.setStreamingAssistantTimestamp(null),y.setOptimisticUserEvent(b),y.setIsSending(!0),y.setIsAwaitingAssistantOutput(!0),y.setCanStopCurrentRun(!1),y.setStopDisabledReason(p?"__preparing__":x??null),y.setLastSendError(null);let v="";try{let O=!1;const F=new Date().toISOString();y.setStreamingAssistantTimestamp(F);const w=await S({signal:N.signal,onReady:_=>{var k;if(n!==t.current)return;const T=r.current;if(T&&T.localRunId===n){T.backendRunId=((k=_.runId)==null?void 0:k.trim())||void 0,typeof _.stopSupported=="boolean"&&(T.backendStopSupported=_.stopSupported),typeof _.stopReason=="string"&&_.stopReason.trim().length>0&&(T.backendStopReason=_.stopReason.trim());const D=!!(T.backendStopSupported&&T.backendRunId);y.setCanStopCurrentRun(D),y.setStopDisabledReason(D?null:T.backendStopReason??(T.backendStopSupported?"__preparing__":null))}_.sessionKey&&l(D=>D===_.sessionKey?D:_.sessionKey)},onDelta:_=>{n===t.current&&(v+=_.delta,y.setStreamingAssistantText(v),y.setIsAwaitingAssistantOutput(!1))},onSessionEvent:_=>{var T,k;n===t.current&&(((T=_.data.message)==null?void 0:T.role)==="user"&&y.setOptimisticUserEvent(null),xd(y.setStreamingSessionEvents,_.data),((k=_.data.message)==null?void 0:k.role)==="assistant"&&(O=!0,v="",y.setStreamingAssistantText(""),y.setIsAwaitingAssistantOutput(!1)))}});if(n!==t.current)return;y.setOptimisticUserEvent(null),w.sessionKey!==f&&l(w.sessionKey);const z=O?"":v.trim();await ei({selectedSessionKeyRef:i,currentSessionKey:f,resultSessionKey:w.sessionKey,refetchSessions:a,refetchHistory:u}),y.setStreamingSessionEvents(z?[Zr(z)]:[]),y.setStreamingAssistantText(""),y.setStreamingAssistantTimestamp(null),y.setIsAwaitingAssistantOutput(!1),y.setIsSending(!1),y.setCanStopCurrentRun(!1),y.setStopDisabledReason(null),y.setLastSendError(null),r.current=null}catch(O){if(n!==t.current)return;const F=N.signal.aborted||gd(O);if(t.current+=1,F){Cn(y),r.current=null,await ei({selectedSessionKeyRef:i,currentSessionKey:f,refetchSessions:a,refetchHistory:u});return}Cn(y);const w=dd(O);y.setLastSendError(w),y.setStreamingSessionEvents([Zr(w,"message.assistant.error.local")]),r.current=null,o&&s(z=>z.trim().length===0&&d?d:z)}}function yd(e){var H;const[n,t]=R.useState(null),[r,i]=R.useState([]),[l,s]=R.useState(""),[a,u]=R.useState(null),[o,f]=R.useState(!1),[c,d]=R.useState(!1),[p,x]=R.useState([]),[b,S]=R.useState(!1),[y,N]=R.useState(null),[v,O]=R.useState(null),F=R.useRef(0),w=R.useRef(0),z=R.useRef(null),_=R.useCallback(()=>{var E;F.current+=1,x([]),(E=z.current)==null||E.requestAbortController.abort(),z.current=null,Cn({setOptimisticUserEvent:t,setStreamingSessionEvents:i,setStreamingAssistantText:s,setStreamingAssistantTimestamp:u,setIsSending:f,setIsAwaitingAssistantOutput:d,setCanStopCurrentRun:S,setStopDisabledReason:N,setLastSendError:O})},[]);R.useEffect(()=>()=>{var E;F.current+=1,(E=z.current)==null||E.requestAbortController.abort(),z.current=null},[]);const T=R.useCallback(async(E,j)=>{O(null),F.current+=1;const $=md(E.requestedSkills);await ti({runId:F.current,runIdRef:F,activeRunRef:z,selectedSessionKeyRef:e.selectedSessionKeyRef,setSelectedSessionKey:e.setSelectedSessionKey,setDraft:e.setDraft,refetchSessions:e.refetchSessions,refetchHistory:e.refetchHistory,restoreDraftOnError:j==null?void 0:j.restoreDraftOnError,sourceSessionKey:E.sessionKey,sourceAgentId:E.agentId,sourceMessage:E.message,sourceStopSupported:E.stopSupported,sourceStopReason:E.stopReason,optimisticUserEvent:{seq:e.nextOptimisticUserSeq,type:"message.user.optimistic",timestamp:new Date().toISOString(),message:{role:"user",content:E.message,timestamp:new Date().toISOString()}},openStream:({signal:U,onReady:ee,onDelta:le,onSessionEvent:m})=>Is({message:E.message,sessionKey:E.sessionKey,agentId:E.agentId,...E.model?{model:E.model}:{},...$.length>0?{metadata:{requested_skills:$}}:{},channel:"ui",chatId:"web-ui"},{signal:U,onReady:ee,onDelta:le,onSessionEvent:m}),setters:{setOptimisticUserEvent:t,setStreamingSessionEvents:i,setStreamingAssistantText:s,setStreamingAssistantTimestamp:u,setIsSending:f,setIsAwaitingAssistantOutput:d,setCanStopCurrentRun:S,setStopDisabledReason:N,setLastSendError:O}})},[e]),k=R.useCallback(async E=>{var ee,le;const j=(ee=E.runId)==null?void 0:ee.trim(),$=(le=E.sessionKey)==null?void 0:le.trim();if(!j||!$)return;const U=z.current;(U==null?void 0:U.backendRunId)!==j&&(o&&U||(O(null),F.current+=1,await ti({runId:F.current,runIdRef:F,activeRunRef:z,selectedSessionKeyRef:e.selectedSessionKeyRef,setSelectedSessionKey:e.setSelectedSessionKey,setDraft:e.setDraft,refetchSessions:e.refetchSessions,refetchHistory:e.refetchHistory,sourceSessionKey:$,sourceAgentId:E.agentId,sourceStopSupported:E.stopSupported,sourceStopReason:E.stopReason,optimisticUserEvent:null,openStream:({signal:m,onReady:ce,onDelta:fe,onSessionEvent:g})=>As({runId:j},{signal:m,onReady:ce,onDelta:fe,onSessionEvent:g}),setters:{setOptimisticUserEvent:t,setStreamingSessionEvents:i,setStreamingAssistantText:s,setStreamingAssistantTimestamp:u,setIsSending:f,setIsAwaitingAssistantOutput:d,setCanStopCurrentRun:S,setStopDisabledReason:N,setLastSendError:O}})))},[o,e]);R.useEffect(()=>{if(o||p.length===0)return;const[E,...j]=p;x(j),T(E,{restoreDraftOnError:!0})},[o,p,T]);const D=R.useCallback(async E=>{O(null),w.current+=1;const j={id:w.current,message:E.message,sessionKey:E.sessionKey,agentId:E.agentId,...E.model?{model:E.model}:{},...E.requestedSkills&&E.requestedSkills.length>0?{requestedSkills:E.requestedSkills}:{},...typeof E.stopSupported=="boolean"?{stopSupported:E.stopSupported}:{},...E.stopReason?{stopReason:E.stopReason}:{}};if(o){x($=>[...$,j]);return}await T(j,{restoreDraftOnError:E.restoreDraftOnError})},[o,T]),L=R.useCallback(async()=>{const E=z.current;if(E&&E.backendStopSupported){if(S(!1),x([]),E.backendRunId)try{await Ns({runId:E.backendRunId,sessionKey:E.sessionKey,...E.agentId?{agentId:E.agentId}:{}})}catch{}E.requestAbortController.abort()}},[]);return{optimisticUserEvent:n,streamingSessionEvents:r,streamingAssistantText:l,streamingAssistantTimestamp:a,isSending:o,isAwaitingAssistantOutput:c,queuedCount:p.length,canStopCurrentRun:b,stopDisabledReason:y,lastSendError:v,activeBackendRunId:((H=z.current)==null?void 0:H.backendRunId)??null,sendMessage:D,resumeRun:k,stopCurrentRun:L,resetStreamState:_}}const vn="sid_";function bd(e){var r;const n=/^agent:([^:]+):/i.exec(e.trim());if(!n)return null;const t=(r=n[1])==null?void 0:r.trim();return t||null}function kd(e){const n=Math.random().toString(36).slice(2,8);return`agent:${e}:ui:direct:web-${Date.now().toString(36)}${n}`}function wd(e){const n=new TextEncoder().encode(e);let t="";for(const i of n)t+=String.fromCharCode(i);const r=btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"");return`${vn}${r}`}function Sd(e){if(!e.startsWith(vn))return null;const n=e.slice(vn.length).replace(/-/g,"+").replace(/_/g,"/"),t=n.length%4===0?"":"=".repeat(4-n.length%4);try{const r=atob(n+t),i=Uint8Array.from(r,l=>l.charCodeAt(0));return new TextDecoder().decode(i)}catch{return null}}function Cd(e){if(!e)return null;const n=Sd(e);if(n)return n;try{return decodeURIComponent(e)}catch{return e}}function ni(e){return`/chat/${wd(e)}`}function ri(e){if(e.label&&e.label.trim())return e.label.trim();const n=e.key.split(":");return n[n.length-1]||e.key}function vd(e){const{view:n,routeSessionKey:t,selectedSessionKey:r,selectedAgentId:i,setSelectedSessionKey:l,setSelectedAgentId:s,selectedSessionKeyRef:a,isUserScrollingRef:u,resetStreamState:o}=e;R.useEffect(()=>{if(n==="chat"){if(t){r!==t&&l(t);return}r!==null&&(l(null),o())}},[o,t,r,l,n]),R.useEffect(()=>{const f=r?bd(r):null;f&&i!==f&&s(f)},[i,r,s]),R.useEffect(()=>{a.current=r,u.current=!1},[u,r,a])}function Ed(e){const{threadRef:n,isUserScrollingRef:t,mergedEvents:r,isSending:i}=e,l=R.useCallback(()=>{const a=n.current;return a?a.scrollHeight-a.scrollTop-a.clientHeight<50:!0},[n]),s=R.useCallback(()=>{l()?t.current=!1:t.current=!0},[l,t]);return R.useEffect(()=>{const a=n.current;!a||t.current||(a.scrollTop=a.scrollHeight)},[i,t,r,n]),{handleScroll:s}}function Nd({view:e,sidebarProps:n,conversationProps:t,confirmDialog:r}){return h.jsxs("div",{className:"h-full flex",children:[h.jsx(Js,{...n}),e==="chat"?h.jsx(sd,{...t}):h.jsx("section",{className:"flex-1 min-h-0 overflow-hidden bg-gradient-to-b from-gray-50/60 to-white",children:h.jsx("div",{className:"h-full overflow-auto custom-scrollbar",children:h.jsx("div",{className:"mx-auto w-full max-w-[min(1120px,100%)] px-6 py-5",children:e==="cron"?h.jsx(pd,{}):h.jsx(Fs,{forcedType:"skills"})})})}),r]})}function Fd({view:e}){var V,Y,pe,ve,be,Re;const[n,t]=R.useState(""),[r,i]=R.useState(""),[l,s]=R.useState(null),[a,u]=R.useState("main"),[o,f]=R.useState(""),[c,d]=R.useState([]),{confirm:p,ConfirmDialog:x}=hi(),b=bs(),S=ks(),{sessionId:y}=ws(),N=R.useRef(null),v=R.useRef(!1),O=R.useRef(l),F=R.useMemo(()=>Cd(y),[y]),w=js(),z=Ts(),_=(w.isFetched||w.isSuccess)&&(z.isFetched||z.isSuccess),T=Ps({q:n.trim()||void 0,limit:120,activeMinutes:0}),k=zs("skill"),D=Rs({sessionKey:l,agentId:a}),L=Ds(l,300),H=Ls(),E=R.useMemo(()=>{const X=Qs({meta:z.data,config:w.data,onlyConfigured:!0}),W=new Set,te=[];for(const G of X)for(const ae of G.models){const ge=Xs(G.prefix,ae);!ge||W.has(ge)||(W.add(ge),te.push({value:ge,modelLabel:ae,providerLabel:G.displayName}))}return te.sort((G,ae)=>{const ge=G.providerLabel.localeCompare(ae.providerLabel);return ge!==0?ge:G.modelLabel.localeCompare(ae.modelLabel)})},[z.data,w.data]),j=R.useMemo(()=>{var X;return((X=T.data)==null?void 0:X.sessions)??[]},[(V=T.data)==null?void 0:V.sessions]),$=R.useMemo(()=>{var X;return((X=k.data)==null?void 0:X.records)??[]},[(Y=k.data)==null?void 0:Y.records]),U=R.useMemo(()=>j.find(X=>X.key===l)??null,[l,j]);R.useEffect(()=>{if(E.length===0){f("");return}f(X=>{var G,ae,ge,Yn;if(E.some(tt=>tt.value===X))return X;const W=(G=U==null?void 0:U.preferredModel)==null?void 0:G.trim();if(W&&E.some(tt=>tt.value===W))return W;const te=(ge=(ae=w.data)==null?void 0:ae.agents.defaults.model)==null?void 0:ge.trim();return te&&E.some(tt=>tt.value===te)?te:((Yn=E[0])==null?void 0:Yn.value)??""})},[(pe=w.data)==null?void 0:pe.agents.defaults.model,E,U==null?void 0:U.preferredModel]);const ee=L.data,le=(ee==null?void 0:ee.messages)??[],m=ee!=null&&ee.events&&ee.events.length>0?ee.events:Vs(le),ce=R.useMemo(()=>m.reduce((X,W)=>Number.isFinite(W.seq)?Math.max(X,W.seq):X,0)+1,[m]),{optimisticUserEvent:fe,streamingSessionEvents:g,streamingAssistantText:se,streamingAssistantTimestamp:we,isSending:ne,isAwaitingAssistantOutput:Fe,queuedCount:Ce,canStopCurrentRun:je,stopDisabledReason:Te,lastSendError:$e,sendMessage:yt,resumeRun:bt,activeBackendRunId:kt,stopCurrentRun:wt,resetStreamState:Pe}=yd({nextOptimisticUserSeq:ce,selectedSessionKeyRef:O,setSelectedSessionKey:s,setDraft:i,refetchSessions:T.refetch,refetchHistory:L.refetch}),Ze=Os(l?{sessionKey:l,states:["queued","running"],limit:5}:void 0),He=R.useMemo(()=>{var W;const X=((W=Ze.data)==null?void 0:W.runs)??[];return l?X.find(te=>te.sessionKey===l)??null:null},[(ve=Ze.data)==null?void 0:ve.runs,l]);R.useEffect(()=>{e!=="chat"||!l||!He||kt!==He.runId&&bt(He)},[kt,He,bt,l,e]);const et=R.useMemo(()=>{const X=new Map,W=G=>{Number.isFinite(G.seq)&&X.set(G.seq,G)};m.forEach(W),fe&&W(fe),g.forEach(W);const te=[...X.values()].sort((G,ae)=>G.seq-ae.seq);if(se.trim()){const G=te.reduce((ae,ge)=>ge.seq>ae?ge.seq:ae,0);te.push({seq:G+1,type:"stream.assistant_delta",timestamp:we??new Date().toISOString(),message:{role:"assistant",content:se,timestamp:we??new Date().toISOString()}})}return te},[m,fe,se,we,g]);vd({view:e,routeSessionKey:F,selectedSessionKey:l,selectedAgentId:a,setSelectedSessionKey:s,setSelectedAgentId:u,selectedSessionKeyRef:O,isUserScrollingRef:v,resetStreamState:Pe});const{handleScroll:St}=Ed({threadRef:N,isUserScrollingRef:v,mergedEvents:et,isSending:ne}),Ct=R.useCallback(()=>{Pe(),s(null),b.pathname!=="/chat"&&S("/chat")},[b.pathname,S,Pe]),$t=R.useCallback(()=>{b.pathname!=="/providers"&&S("/providers")},[b.pathname,S]),Ht=R.useCallback(async()=>{!l||!await p({title:A("chatDeleteSessionConfirm"),variant:"destructive",confirmLabel:A("delete")})||H.mutate({key:l},{onSuccess:async()=>{Pe(),s(null),S("/chat",{replace:!0}),await T.refetch()}})},[p,H,S,Pe,l,T]),Ut=R.useCallback(async()=>{var G,ae;const X=r.trim();if(!X)return;const W=c,te=l??kd(a);l||S(ni(te),{replace:!0}),i(""),d([]),await yt({message:X,sessionKey:te,agentId:a,model:o||void 0,stopSupported:((G=D.data)==null?void 0:G.stopSupported)??!1,stopReason:(ae=D.data)==null?void 0:ae.stopReason,requestedSkills:W,restoreDraftOnError:!0})},[(be=D.data)==null?void 0:be.stopReason,(Re=D.data)==null?void 0:Re.stopSupported,r,a,o,S,l,c,yt]),Vt=U?ri(U):void 0,C=R.useCallback(X=>{const W=ni(X);b.pathname!==W&&S(W)},[b.pathname,S]),P={sessions:j,selectedSessionKey:l,onSelectSession:C,onCreateSession:Ct,sessionTitle:ri,isLoading:T.isLoading,query:n,onQueryChange:t},B={isProviderStateResolved:_,modelOptions:E,selectedModel:o,onSelectedModelChange:f,onGoToProviders:$t,skillRecords:$,isSkillsLoading:k.isLoading,selectedSkills:c,onSelectedSkillsChange:d,selectedSessionKey:l,sessionDisplayName:Vt,canDeleteSession:!!U,isDeletePending:H.isPending,onDeleteSession:()=>{Ht()},onCreateSession:Ct,threadRef:N,onThreadScroll:St,isHistoryLoading:L.isLoading,mergedEvents:et,isSending:ne,isAwaitingAssistantOutput:Fe,streamingAssistantText:se,draft:r,onDraftChange:i,onSend:Ut,onStop:()=>{wt()},canStopGeneration:je,stopDisabledReason:Te,sendError:$e,queuedCount:Ce};return h.jsx(Nd,{view:e,sidebarProps:P,conversationProps:B,confirmDialog:h.jsx(x,{})})}export{Fd as ChatPage};
|